Diffstat (limited to 'libopie2/opiepim/core/orecur.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | libopie2/opiepim/core/orecur.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/libopie2/opiepim/core/orecur.cpp b/libopie2/opiepim/core/orecur.cpp index 6c81f8f..257d4fd 100644 --- a/libopie2/opiepim/core/orecur.cpp +++ b/libopie2/opiepim/core/orecur.cpp | |||
@@ -18,12 +18,13 @@ struct ORecur::Data : public QShared { | |||
18 | ORecur::RepeatType type; | 18 | ORecur::RepeatType type; |
19 | int freq; | 19 | int freq; |
20 | int pos; | 20 | int pos; |
21 | bool hasEnd : 1; | 21 | bool hasEnd : 1; |
22 | time_t end; | 22 | time_t end; |
23 | time_t create; | 23 | time_t create; |
24 | int rep; | ||
24 | }; | 25 | }; |
25 | 26 | ||
26 | 27 | ||
27 | ORecur::ORecur() { | 28 | ORecur::ORecur() { |
28 | data = new Data; | 29 | data = new Data; |
29 | } | 30 | } |
@@ -75,12 +76,15 @@ QDate ORecur::endDate()const { | |||
75 | time_t ORecur::endDateUTC()const { | 76 | time_t ORecur::endDateUTC()const { |
76 | return data->end; | 77 | return data->end; |
77 | } | 78 | } |
78 | time_t ORecur::createTime()const { | 79 | time_t ORecur::createTime()const { |
79 | return data->create; | 80 | return data->create; |
80 | } | 81 | } |
82 | int ORecur::repetition()const { | ||
83 | return data->rep; | ||
84 | } | ||
81 | void ORecur::setType( const RepeatType& z) { | 85 | void ORecur::setType( const RepeatType& z) { |
82 | checkOrModify(); | 86 | checkOrModify(); |
83 | data->type = z; | 87 | data->type = z; |
84 | } | 88 | } |
85 | void ORecur::setFrequency( int freq ) { | 89 | void ORecur::setFrequency( int freq ) { |
86 | checkOrModify(); | 90 | checkOrModify(); |
@@ -107,21 +111,26 @@ void ORecur::setCreateTime( time_t t) { | |||
107 | data->create = t; | 111 | data->create = t; |
108 | } | 112 | } |
109 | void ORecur::setHasEndDate( bool b) { | 113 | void ORecur::setHasEndDate( bool b) { |
110 | checkOrModify(); | 114 | checkOrModify(); |
111 | data->hasEnd = b; | 115 | data->hasEnd = b; |
112 | } | 116 | } |
117 | void ORecur::setRepitition( int rep ) { | ||
118 | checkOrModify(); | ||
119 | data->rep = rep; | ||
120 | } | ||
113 | void ORecur::checkOrModify() { | 121 | void ORecur::checkOrModify() { |
114 | if ( data->count != 1 ) { | 122 | if ( data->count != 1 ) { |
115 | data->deref(); | 123 | data->deref(); |
116 | Data* d2 = new Data; | 124 | Data* d2 = new Data; |
117 | d2->days = data->days; | 125 | d2->days = data->days; |
118 | d2->type = data->type; | 126 | d2->type = data->type; |
119 | d2->freq = data->freq; | 127 | d2->freq = data->freq; |
120 | d2->pos = data->pos; | 128 | d2->pos = data->pos; |
121 | d2->hasEnd = data->hasEnd; | 129 | d2->hasEnd = data->hasEnd; |
122 | d2->end = data->end; | 130 | d2->end = data->end; |
123 | d2->create = data->create; | 131 | d2->create = data->create; |
132 | d2->rep = data->rep; | ||
124 | data = d2; | 133 | data = d2; |
125 | } | 134 | } |
126 | } | 135 | } |
127 | 136 | ||