summaryrefslogtreecommitdiff
path: root/core/pim/datebook/datebook.cpp
Side-by-side diff
Diffstat (limited to 'core/pim/datebook/datebook.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/datebook/datebook.cpp24
1 files changed, 15 insertions, 9 deletions
diff --git a/core/pim/datebook/datebook.cpp b/core/pim/datebook/datebook.cpp
index 10a9b59..07d7164 100644
--- a/core/pim/datebook/datebook.cpp
+++ b/core/pim/datebook/datebook.cpp
@@ -193,4 +193,6 @@ DateBook::DateBook( QWidget *parent, const char *, WFlags f )
qDebug("done t=%d", t.elapsed() );
+ connect( qApp, SIGNAL( flush() ), this, SLOT( flush() ) );
+ connect( qApp, SIGNAL( reload()), this, SLOT( reload() ) );
/*
* Here is a problem description:
@@ -403,4 +405,6 @@ void DateBook::insertEvent( const Event &e )
{
Event dupEvent=e;
+ if(!dupEvent.isValidUid() ) // tkcRom seems to be different
+ dupEvent.assignUid();
dupEvent.setLocation(defaultLocation);
dupEvent.setCategories(defaultCategories);
@@ -444,13 +448,15 @@ void DateBook::duplicateEvent( const Event &e )
continue;
}
- /*
- * The problem:
- * DateBookDB does remove repeating events not by uid but by the time
- * the recurrence was created
- * so we need to update that time as well
- */
- Event::RepeatPattern rp = newEv.repeatPattern();
- rp.createTime = ::time( NULL );
- newEv.setRepeat( TRUE, rp ); // has repeat and repeatPattern...
+ /*
+ * The problem:
+ * DateBookDB does remove repeating events not by uid but by the time
+ * the recurrence was created
+ * so we need to update that time as well
+ */
+ Event::RepeatPattern rp = newEv.repeatPattern();
+ rp.createTime = ::time( NULL );
+ newEv.setRepeat( TRUE, rp ); // has repeat and repeatPattern...
+ if( newEv.uid() == e.uid() || !newEv.isValidUid() )
+ newEv.assignUid();
db->addEvent(newEv);