-rw-r--r-- | libopie/libopie.pro | 2 | ||||
-rw-r--r-- | libopie/pim/opimmaintainer.cpp | 37 | ||||
-rw-r--r-- | libopie/pim/opimmaintainer.h | 36 | ||||
-rw-r--r-- | libopie/pim/opimxrefmanager.cpp | 2 | ||||
-rw-r--r-- | libopie/pim/otodo.cpp | 20 | ||||
-rw-r--r-- | libopie/pim/otodo.h | 12 | ||||
-rw-r--r-- | libopie2/opiepim/core/opimmaintainer.cpp | 37 | ||||
-rw-r--r-- | libopie2/opiepim/core/opimmaintainer.h | 36 | ||||
-rw-r--r-- | libopie2/opiepim/core/opimxrefmanager.cpp | 2 | ||||
-rw-r--r-- | libopie2/opiepim/otodo.cpp | 20 | ||||
-rw-r--r-- | libopie2/opiepim/otodo.h | 12 |
11 files changed, 214 insertions, 2 deletions
diff --git a/libopie/libopie.pro b/libopie/libopie.pro index 3e6156e..a80a407 100644 --- a/libopie/libopie.pro +++ b/libopie/libopie.pro | |||
@@ -32,4 +32,5 @@ HEADERS = ofontmenu.h \ | |||
32 | pim/opimxref.h \ | 32 | pim/opimxref.h \ |
33 | pim/opimxrefmanager.h \ | 33 | pim/opimxrefmanager.h \ |
34 | pim/opimmaintainer.h \ | ||
34 | orecurrancewidget.h \ | 35 | orecurrancewidget.h \ |
35 | oticker.h | 36 | oticker.h |
@@ -61,4 +62,5 @@ SOURCES = ofontmenu.cc \ | |||
61 | pim/opimxref.cpp \ | 62 | pim/opimxref.cpp \ |
62 | pim/opimxrefmanager.cpp \ | 63 | pim/opimxrefmanager.cpp \ |
64 | pim/opimmaintainer.cpp \ | ||
63 | orecurrancewidget.cpp \ | 65 | orecurrancewidget.cpp \ |
64 | oticker.cpp | 66 | oticker.cpp |
diff --git a/libopie/pim/opimmaintainer.cpp b/libopie/pim/opimmaintainer.cpp new file mode 100644 index 0000000..e34f035 --- a/dev/null +++ b/libopie/pim/opimmaintainer.cpp | |||
@@ -0,0 +1,37 @@ | |||
1 | #include "opimmaintainer.h" | ||
2 | |||
3 | OPimMaintainer::OPimMaintainer( enum Mode mode, int uid ) | ||
4 | : m_mode(mode), m_uid(uid ) | ||
5 | {} | ||
6 | OPimMaintainer::~OPimMaintainer() { | ||
7 | } | ||
8 | OPimMaintainer::OPimMaintainer( const OPimMaintainer& main ) { | ||
9 | *this = main; | ||
10 | } | ||
11 | OPimMaintainer &OPimMaintainer::operator=( const OPimMaintainer& main ) { | ||
12 | m_mode = main.m_mode; | ||
13 | m_uid = main.m_uid; | ||
14 | |||
15 | return *this; | ||
16 | } | ||
17 | bool OPimMaintainer::operator==( const OPimMaintainer& main ) { | ||
18 | if (m_mode != main.m_mode ) return false; | ||
19 | if (m_uid != main.m_uid ) return false; | ||
20 | |||
21 | return true; | ||
22 | } | ||
23 | bool OPimMaintainer::operator!=( const OPimMaintainer& main ) { | ||
24 | return !(*this == main ); | ||
25 | } | ||
26 | OPimMaintainer::Mode OPimMaintainer::mode()const { | ||
27 | return m_mode; | ||
28 | } | ||
29 | int OPimMaintainer::uid()const { | ||
30 | return m_uid; | ||
31 | } | ||
32 | void OPimMaintainer::setMode( enum Mode mo) { | ||
33 | m_mode = mo; | ||
34 | } | ||
35 | void OPimMaintainer::setUid( int uid ) { | ||
36 | m_uid = uid; | ||
37 | } | ||
diff --git a/libopie/pim/opimmaintainer.h b/libopie/pim/opimmaintainer.h new file mode 100644 index 0000000..310e15a --- a/dev/null +++ b/libopie/pim/opimmaintainer.h | |||
@@ -0,0 +1,36 @@ | |||
1 | #ifndef OPIE_PIM_MAINTAINER_H | ||
2 | #define OPIE_PIM_MAINTAINER_H | ||
3 | |||
4 | #include <qstring.h> | ||
5 | |||
6 | /** | ||
7 | * Who maintains what? | ||
8 | */ | ||
9 | class OPimMaintainer { | ||
10 | public: | ||
11 | enum Mode { Undefined = -1, | ||
12 | Responsible = 0, | ||
13 | DoneBy, | ||
14 | Coordinating }; | ||
15 | OPimMaintainer( enum Mode mode = Undefined, int uid = 0); | ||
16 | OPimMaintainer( const OPimMaintainer& ); | ||
17 | ~OPimMaintainer(); | ||
18 | |||
19 | OPimMaintainer &operator=( const OPimMaintainer& ); | ||
20 | bool operator==( const OPimMaintainer& ); | ||
21 | bool operator!=( const OPimMaintainer& ); | ||
22 | |||
23 | |||
24 | Mode mode()const; | ||
25 | int uid()const; | ||
26 | |||
27 | void setMode( enum Mode ); | ||
28 | void setUid( int uid ); | ||
29 | |||
30 | private: | ||
31 | Mode m_mode; | ||
32 | int m_uid; | ||
33 | |||
34 | }; | ||
35 | |||
36 | #endif | ||
diff --git a/libopie/pim/opimxrefmanager.cpp b/libopie/pim/opimxrefmanager.cpp index d49f5f5..965f542 100644 --- a/libopie/pim/opimxrefmanager.cpp +++ b/libopie/pim/opimxrefmanager.cpp | |||
@@ -7,4 +7,6 @@ OPimXRefManager::OPimXRefManager( const OPimXRefManager& ref) { | |||
7 | m_list = ref.m_list; | 7 | m_list = ref.m_list; |
8 | } | 8 | } |
9 | OPimXRefManager::~OPimXRefManager() { | ||
10 | } | ||
9 | OPimXRefManager &OPimXRefManager::operator=( const OPimXRefManager& ref) { | 11 | OPimXRefManager &OPimXRefManager::operator=( const OPimXRefManager& ref) { |
10 | m_list = ref.m_list; | 12 | m_list = ref.m_list; |
diff --git a/libopie/pim/otodo.cpp b/libopie/pim/otodo.cpp index 4d5cb79..6fcf9f6 100644 --- a/libopie/pim/otodo.cpp +++ b/libopie/pim/otodo.cpp | |||
@@ -15,4 +15,6 @@ | |||
15 | #include "opimstate.h" | 15 | #include "opimstate.h" |
16 | #include "orecur.h" | 16 | #include "orecur.h" |
17 | #include "opimmaintainer.h" | ||
18 | |||
17 | #include "otodo.h" | 19 | #include "otodo.h" |
18 | 20 | ||
@@ -34,4 +36,5 @@ struct OTodo::OTodoData : public QShared { | |||
34 | OPimState state; | 36 | OPimState state; |
35 | ORecur recur; | 37 | ORecur recur; |
38 | OPimMaintainer maintainer; | ||
36 | }; | 39 | }; |
37 | 40 | ||
@@ -154,4 +157,7 @@ ORecur OTodo::recurrence()const { | |||
154 | return data->recur; | 157 | return data->recur; |
155 | } | 158 | } |
159 | OPimMaintainer OTodo::maintainer()const { | ||
160 | return data->maintainer; | ||
161 | } | ||
156 | void OTodo::setCompleted( bool completed ) | 162 | void OTodo::setCompleted( bool completed ) |
157 | { | 163 | { |
@@ -203,4 +209,8 @@ void OTodo::setRecurrence( const ORecur& rec) { | |||
203 | data->recur = rec; | 209 | data->recur = rec; |
204 | } | 210 | } |
211 | void OTodo::setMaintainer( const OPimMaintainer& pim ) { | ||
212 | changeOrModify(); | ||
213 | data->maintainer = pim; | ||
214 | } | ||
205 | bool OTodo::isOverdue( ) | 215 | bool OTodo::isOverdue( ) |
206 | { | 216 | { |
@@ -322,4 +332,6 @@ bool OTodo::operator==(const OTodo &toDoEvent )const | |||
322 | if ( data->alarmDateTime != toDoEvent.data->alarmDateTime ) | 332 | if ( data->alarmDateTime != toDoEvent.data->alarmDateTime ) |
323 | return false; | 333 | return false; |
334 | if ( data->maintainer != toDoEvent.data->maintainer ) | ||
335 | return false; | ||
324 | 336 | ||
325 | return OPimRecord::operator==( toDoEvent ); | 337 | return OPimRecord::operator==( toDoEvent ); |
@@ -359,5 +371,5 @@ QMap<int, QString> OTodo::toMap() const { | |||
359 | map.insert( DateYear, QString::number( data->date.year() ) ); | 371 | map.insert( DateYear, QString::number( data->date.year() ) ); |
360 | map.insert( Progress, QString::number( data->prog ) ); | 372 | map.insert( Progress, QString::number( data->prog ) ); |
361 | map.insert( CrossReference, crossToString() ); | 373 | // map.insert( CrossReference, crossToString() ); |
362 | map.insert( HasAlarmDateTime, QString::number( data->hasAlarmDateTime ) ); | 374 | map.insert( HasAlarmDateTime, QString::number( data->hasAlarmDateTime ) ); |
363 | map.insert( AlarmDateTime, data->alarmDateTime.toString() ); | 375 | map.insert( AlarmDateTime, data->alarmDateTime.toString() ); |
@@ -383,4 +395,9 @@ void OTodo::changeOrModify() { | |||
383 | } | 395 | } |
384 | } | 396 | } |
397 | // WATCHOUT | ||
398 | /* | ||
399 | * if you add something to the Data struct | ||
400 | * be sure to copy it here | ||
401 | */ | ||
385 | void OTodo::copy( OTodoData* src, OTodoData* dest ) { | 402 | void OTodo::copy( OTodoData* src, OTodoData* dest ) { |
386 | dest->date = src->date; | 403 | dest->date = src->date; |
@@ -396,4 +413,5 @@ void OTodo::copy( OTodoData* src, OTodoData* dest ) { | |||
396 | dest->state = src->state; | 413 | dest->state = src->state; |
397 | dest->recur = src->recur; | 414 | dest->recur = src->recur; |
415 | dest->maintainer = src->maintainer; | ||
398 | } | 416 | } |
399 | QString OTodo::type() const { | 417 | QString OTodo::type() const { |
diff --git a/libopie/pim/otodo.h b/libopie/pim/otodo.h index 2cdc587..70b0253 100644 --- a/libopie/pim/otodo.h +++ b/libopie/pim/otodo.h | |||
@@ -19,4 +19,5 @@ | |||
19 | class OPimState; | 19 | class OPimState; |
20 | class ORecur; | 20 | class ORecur; |
21 | class OPimMaintainer; | ||
21 | class OTodo : public OPimRecord { | 22 | class OTodo : public OPimRecord { |
22 | public: | 23 | public: |
@@ -129,4 +130,9 @@ public: | |||
129 | 130 | ||
130 | /** | 131 | /** |
132 | * the Maintainer of this OTodo | ||
133 | */ | ||
134 | OPimMaintainer maintainer()const; | ||
135 | |||
136 | /** | ||
131 | * The description of the todo | 137 | * The description of the todo |
132 | */ | 138 | */ |
@@ -203,4 +209,10 @@ public: | |||
203 | */ | 209 | */ |
204 | void setState( const OPimState& state); | 210 | void setState( const OPimState& state); |
211 | |||
212 | /** | ||
213 | * set the Maintainer Mode | ||
214 | */ | ||
215 | void setMaintainer( const OPimMaintainer& ); | ||
216 | |||
205 | bool isOverdue(); | 217 | bool isOverdue(); |
206 | 218 | ||
diff --git a/libopie2/opiepim/core/opimmaintainer.cpp b/libopie2/opiepim/core/opimmaintainer.cpp new file mode 100644 index 0000000..e34f035 --- a/dev/null +++ b/libopie2/opiepim/core/opimmaintainer.cpp | |||
@@ -0,0 +1,37 @@ | |||
1 | #include "opimmaintainer.h" | ||
2 | |||
3 | OPimMaintainer::OPimMaintainer( enum Mode mode, int uid ) | ||
4 | : m_mode(mode), m_uid(uid ) | ||
5 | {} | ||
6 | OPimMaintainer::~OPimMaintainer() { | ||
7 | } | ||
8 | OPimMaintainer::OPimMaintainer( const OPimMaintainer& main ) { | ||
9 | *this = main; | ||
10 | } | ||
11 | OPimMaintainer &OPimMaintainer::operator=( const OPimMaintainer& main ) { | ||
12 | m_mode = main.m_mode; | ||
13 | m_uid = main.m_uid; | ||
14 | |||
15 | return *this; | ||
16 | } | ||
17 | bool OPimMaintainer::operator==( const OPimMaintainer& main ) { | ||
18 | if (m_mode != main.m_mode ) return false; | ||
19 | if (m_uid != main.m_uid ) return false; | ||
20 | |||
21 | return true; | ||
22 | } | ||
23 | bool OPimMaintainer::operator!=( const OPimMaintainer& main ) { | ||
24 | return !(*this == main ); | ||
25 | } | ||
26 | OPimMaintainer::Mode OPimMaintainer::mode()const { | ||
27 | return m_mode; | ||
28 | } | ||
29 | int OPimMaintainer::uid()const { | ||
30 | return m_uid; | ||
31 | } | ||
32 | void OPimMaintainer::setMode( enum Mode mo) { | ||
33 | m_mode = mo; | ||
34 | } | ||
35 | void OPimMaintainer::setUid( int uid ) { | ||
36 | m_uid = uid; | ||
37 | } | ||
diff --git a/libopie2/opiepim/core/opimmaintainer.h b/libopie2/opiepim/core/opimmaintainer.h new file mode 100644 index 0000000..310e15a --- a/dev/null +++ b/libopie2/opiepim/core/opimmaintainer.h | |||
@@ -0,0 +1,36 @@ | |||
1 | #ifndef OPIE_PIM_MAINTAINER_H | ||
2 | #define OPIE_PIM_MAINTAINER_H | ||
3 | |||
4 | #include <qstring.h> | ||
5 | |||
6 | /** | ||
7 | * Who maintains what? | ||
8 | */ | ||
9 | class OPimMaintainer { | ||
10 | public: | ||
11 | enum Mode { Undefined = -1, | ||
12 | Responsible = 0, | ||
13 | DoneBy, | ||
14 | Coordinating }; | ||
15 | OPimMaintainer( enum Mode mode = Undefined, int uid = 0); | ||
16 | OPimMaintainer( const OPimMaintainer& ); | ||
17 | ~OPimMaintainer(); | ||
18 | |||
19 | OPimMaintainer &operator=( const OPimMaintainer& ); | ||
20 | bool operator==( const OPimMaintainer& ); | ||
21 | bool operator!=( const OPimMaintainer& ); | ||
22 | |||
23 | |||
24 | Mode mode()const; | ||
25 | int uid()const; | ||
26 | |||
27 | void setMode( enum Mode ); | ||
28 | void setUid( int uid ); | ||
29 | |||
30 | private: | ||
31 | Mode m_mode; | ||
32 | int m_uid; | ||
33 | |||
34 | }; | ||
35 | |||
36 | #endif | ||
diff --git a/libopie2/opiepim/core/opimxrefmanager.cpp b/libopie2/opiepim/core/opimxrefmanager.cpp index d49f5f5..965f542 100644 --- a/libopie2/opiepim/core/opimxrefmanager.cpp +++ b/libopie2/opiepim/core/opimxrefmanager.cpp | |||
@@ -7,4 +7,6 @@ OPimXRefManager::OPimXRefManager( const OPimXRefManager& ref) { | |||
7 | m_list = ref.m_list; | 7 | m_list = ref.m_list; |
8 | } | 8 | } |
9 | OPimXRefManager::~OPimXRefManager() { | ||
10 | } | ||
9 | OPimXRefManager &OPimXRefManager::operator=( const OPimXRefManager& ref) { | 11 | OPimXRefManager &OPimXRefManager::operator=( const OPimXRefManager& ref) { |
10 | m_list = ref.m_list; | 12 | m_list = ref.m_list; |
diff --git a/libopie2/opiepim/otodo.cpp b/libopie2/opiepim/otodo.cpp index 4d5cb79..6fcf9f6 100644 --- a/libopie2/opiepim/otodo.cpp +++ b/libopie2/opiepim/otodo.cpp | |||
@@ -15,4 +15,6 @@ | |||
15 | #include "opimstate.h" | 15 | #include "opimstate.h" |
16 | #include "orecur.h" | 16 | #include "orecur.h" |
17 | #include "opimmaintainer.h" | ||
18 | |||
17 | #include "otodo.h" | 19 | #include "otodo.h" |
18 | 20 | ||
@@ -34,4 +36,5 @@ struct OTodo::OTodoData : public QShared { | |||
34 | OPimState state; | 36 | OPimState state; |
35 | ORecur recur; | 37 | ORecur recur; |
38 | OPimMaintainer maintainer; | ||
36 | }; | 39 | }; |
37 | 40 | ||
@@ -154,4 +157,7 @@ ORecur OTodo::recurrence()const { | |||
154 | return data->recur; | 157 | return data->recur; |
155 | } | 158 | } |
159 | OPimMaintainer OTodo::maintainer()const { | ||
160 | return data->maintainer; | ||
161 | } | ||
156 | void OTodo::setCompleted( bool completed ) | 162 | void OTodo::setCompleted( bool completed ) |
157 | { | 163 | { |
@@ -203,4 +209,8 @@ void OTodo::setRecurrence( const ORecur& rec) { | |||
203 | data->recur = rec; | 209 | data->recur = rec; |
204 | } | 210 | } |
211 | void OTodo::setMaintainer( const OPimMaintainer& pim ) { | ||
212 | changeOrModify(); | ||
213 | data->maintainer = pim; | ||
214 | } | ||
205 | bool OTodo::isOverdue( ) | 215 | bool OTodo::isOverdue( ) |
206 | { | 216 | { |
@@ -322,4 +332,6 @@ bool OTodo::operator==(const OTodo &toDoEvent )const | |||
322 | if ( data->alarmDateTime != toDoEvent.data->alarmDateTime ) | 332 | if ( data->alarmDateTime != toDoEvent.data->alarmDateTime ) |
323 | return false; | 333 | return false; |
334 | if ( data->maintainer != toDoEvent.data->maintainer ) | ||
335 | return false; | ||
324 | 336 | ||
325 | return OPimRecord::operator==( toDoEvent ); | 337 | return OPimRecord::operator==( toDoEvent ); |
@@ -359,5 +371,5 @@ QMap<int, QString> OTodo::toMap() const { | |||
359 | map.insert( DateYear, QString::number( data->date.year() ) ); | 371 | map.insert( DateYear, QString::number( data->date.year() ) ); |
360 | map.insert( Progress, QString::number( data->prog ) ); | 372 | map.insert( Progress, QString::number( data->prog ) ); |
361 | map.insert( CrossReference, crossToString() ); | 373 | // map.insert( CrossReference, crossToString() ); |
362 | map.insert( HasAlarmDateTime, QString::number( data->hasAlarmDateTime ) ); | 374 | map.insert( HasAlarmDateTime, QString::number( data->hasAlarmDateTime ) ); |
363 | map.insert( AlarmDateTime, data->alarmDateTime.toString() ); | 375 | map.insert( AlarmDateTime, data->alarmDateTime.toString() ); |
@@ -383,4 +395,9 @@ void OTodo::changeOrModify() { | |||
383 | } | 395 | } |
384 | } | 396 | } |
397 | // WATCHOUT | ||
398 | /* | ||
399 | * if you add something to the Data struct | ||
400 | * be sure to copy it here | ||
401 | */ | ||
385 | void OTodo::copy( OTodoData* src, OTodoData* dest ) { | 402 | void OTodo::copy( OTodoData* src, OTodoData* dest ) { |
386 | dest->date = src->date; | 403 | dest->date = src->date; |
@@ -396,4 +413,5 @@ void OTodo::copy( OTodoData* src, OTodoData* dest ) { | |||
396 | dest->state = src->state; | 413 | dest->state = src->state; |
397 | dest->recur = src->recur; | 414 | dest->recur = src->recur; |
415 | dest->maintainer = src->maintainer; | ||
398 | } | 416 | } |
399 | QString OTodo::type() const { | 417 | QString OTodo::type() const { |
diff --git a/libopie2/opiepim/otodo.h b/libopie2/opiepim/otodo.h index 2cdc587..70b0253 100644 --- a/libopie2/opiepim/otodo.h +++ b/libopie2/opiepim/otodo.h | |||
@@ -19,4 +19,5 @@ | |||
19 | class OPimState; | 19 | class OPimState; |
20 | class ORecur; | 20 | class ORecur; |
21 | class OPimMaintainer; | ||
21 | class OTodo : public OPimRecord { | 22 | class OTodo : public OPimRecord { |
22 | public: | 23 | public: |
@@ -129,4 +130,9 @@ public: | |||
129 | 130 | ||
130 | /** | 131 | /** |
132 | * the Maintainer of this OTodo | ||
133 | */ | ||
134 | OPimMaintainer maintainer()const; | ||
135 | |||
136 | /** | ||
131 | * The description of the todo | 137 | * The description of the todo |
132 | */ | 138 | */ |
@@ -203,4 +209,10 @@ public: | |||
203 | */ | 209 | */ |
204 | void setState( const OPimState& state); | 210 | void setState( const OPimState& state); |
211 | |||
212 | /** | ||
213 | * set the Maintainer Mode | ||
214 | */ | ||
215 | void setMaintainer( const OPimMaintainer& ); | ||
216 | |||
205 | bool isOverdue(); | 217 | bool isOverdue(); |
206 | 218 | ||