-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcalendar.cpp
45 lines (38 loc) · 930 Bytes
/
calendar.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#include "calendar.h"
Calendar::Calendar(QObject *parent)
: QObject{parent}
{
}
Calendar::Calendar(const Calendar &other){
name = other.name;
color = other.color;
ctag = other.ctag;
display_name = other.display_name;
is_shown = other.is_shown;
is_todo = other.is_todo;
for (auto x : other.events){
events[x.first] = x.second;
}
for (auto x : other.todos){
todos[x.first] = x.second;
}
}
Calendar& Calendar::operator=(const Calendar& other){
name = other.name;
color = other.color;
ctag = other.ctag;
display_name = other.display_name;
is_shown = other.is_shown;
is_todo = other.is_todo;
for (auto const x : other.events){
events[x.first] = x.second;
}
for (auto const x : other.todos){
todos[x.first] = x.second;
}
return *this;
}
void Calendar::eraseContent(){
events.clear();
todos.clear();
}