summaryrefslogtreecommitdiff
path: root/libopie2/opiepim/core/orecur.cpp
Side-by-side diff
Diffstat (limited to 'libopie2/opiepim/core/orecur.cpp') (more/less context) (show whitespace changes)
-rw-r--r--libopie2/opiepim/core/orecur.cpp9
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 {
ORecur::RepeatType type;
int freq;
int pos;
bool hasEnd : 1;
time_t end;
time_t create;
+ int rep;
};
ORecur::ORecur() {
data = new Data;
}
@@ -75,12 +76,15 @@ QDate ORecur::endDate()const {
time_t ORecur::endDateUTC()const {
return data->end;
}
time_t ORecur::createTime()const {
return data->create;
}
+int ORecur::repetition()const {
+ return data->rep;
+}
void ORecur::setType( const RepeatType& z) {
checkOrModify();
data->type = z;
}
void ORecur::setFrequency( int freq ) {
checkOrModify();
@@ -107,21 +111,26 @@ void ORecur::setCreateTime( time_t t) {
data->create = t;
}
void ORecur::setHasEndDate( bool b) {
checkOrModify();
data->hasEnd = b;
}
+void ORecur::setRepitition( int rep ) {
+ checkOrModify();
+ data->rep = rep;
+}
void ORecur::checkOrModify() {
if ( data->count != 1 ) {
data->deref();
Data* d2 = new Data;
d2->days = data->days;
d2->type = data->type;
d2->freq = data->freq;
d2->pos = data->pos;
d2->hasEnd = data->hasEnd;
d2->end = data->end;
d2->create = data->create;
+ d2->rep = data->rep;
data = d2;
}
}