summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--libopie/pim/oevent.cpp14
-rw-r--r--libopie2/opiepim/oevent.cpp14
2 files changed, 20 insertions, 8 deletions
diff --git a/libopie/pim/oevent.cpp b/libopie/pim/oevent.cpp
index 56ea10d..3ba8a52 100644
--- a/libopie/pim/oevent.cpp
+++ b/libopie/pim/oevent.cpp
@@ -221,61 +221,67 @@ QString OEvent::toRichText()const {
QString OEvent::toShortText()const {
return "OEvent shotText";
}
QString OEvent::type()const {
return QString::fromLatin1("OEvent");
}
QString OEvent::recordField( int /*id */ )const {
return QString::null;
}
int OEvent::rtti() {
return OPimResolver::DateBook;
}
bool OEvent::loadFromStream( QDataStream& ) {
return true;
}
bool OEvent::saveToStream( QDataStream& )const {
return true;
}
void OEvent::changeOrModify() {
if ( data->count != 1 ) {
data->deref();
Data* d2 = new Data;
d2->description = data->description;
d2->location = data->location;
- d2->manager = data->manager;
- d2->recur = data->recur;
+
+ if (data->manager )
+ d2->manager = new OPimNotifyManager( *data->manager );
+
+ if ( data->recur )
+ d2->recur = new ORecur( *data->recur );
+
d2->note = data->note;
d2->created = data->created;
d2->start = data->start;
d2->end = data->end;
d2->isAllDay = data->isAllDay;
d2->timezone = data->timezone;
d2->parent = data->parent;
- d2->child = data->child;
- if (d2->child )
+ if ( data->child ) {
+ d2->child = new QArray<int>( *data->child );
d2->child->detach();
+ }
data = d2;
}
}
void OEvent::deref() {
if ( data->deref() ) {
delete data;
data = 0;
}
}
// FIXME
QMap<int, QString> OEvent::toMap()const {
return QMap<int, QString>();
}
QMap<QString, QString> OEvent::toExtraMap()const {
return QMap<QString, QString>();
}
int OEvent::parent()const {
return data->parent;
}
void OEvent::setParent( int uid ) {
changeOrModify();
data->parent = uid;
}
diff --git a/libopie2/opiepim/oevent.cpp b/libopie2/opiepim/oevent.cpp
index 56ea10d..3ba8a52 100644
--- a/libopie2/opiepim/oevent.cpp
+++ b/libopie2/opiepim/oevent.cpp
@@ -221,61 +221,67 @@ QString OEvent::toRichText()const {
QString OEvent::toShortText()const {
return "OEvent shotText";
}
QString OEvent::type()const {
return QString::fromLatin1("OEvent");
}
QString OEvent::recordField( int /*id */ )const {
return QString::null;
}
int OEvent::rtti() {
return OPimResolver::DateBook;
}
bool OEvent::loadFromStream( QDataStream& ) {
return true;
}
bool OEvent::saveToStream( QDataStream& )const {
return true;
}
void OEvent::changeOrModify() {
if ( data->count != 1 ) {
data->deref();
Data* d2 = new Data;
d2->description = data->description;
d2->location = data->location;
- d2->manager = data->manager;
- d2->recur = data->recur;
+
+ if (data->manager )
+ d2->manager = new OPimNotifyManager( *data->manager );
+
+ if ( data->recur )
+ d2->recur = new ORecur( *data->recur );
+
d2->note = data->note;
d2->created = data->created;
d2->start = data->start;
d2->end = data->end;
d2->isAllDay = data->isAllDay;
d2->timezone = data->timezone;
d2->parent = data->parent;
- d2->child = data->child;
- if (d2->child )
+ if ( data->child ) {
+ d2->child = new QArray<int>( *data->child );
d2->child->detach();
+ }
data = d2;
}
}
void OEvent::deref() {
if ( data->deref() ) {
delete data;
data = 0;
}
}
// FIXME
QMap<int, QString> OEvent::toMap()const {
return QMap<int, QString>();
}
QMap<QString, QString> OEvent::toExtraMap()const {
return QMap<QString, QString>();
}
int OEvent::parent()const {
return data->parent;
}
void OEvent::setParent( int uid ) {
changeOrModify();
data->parent = uid;
}