summaryrefslogtreecommitdiff
path: root/core/pim
authorumopapisdn <umopapisdn>2003-04-12 00:22:57 (UTC)
committer umopapisdn <umopapisdn>2003-04-12 00:22:57 (UTC)
commit59e2de381eebb33238ee1b257736a9ae0afdbb7e (patch) (side-by-side diff)
treeb86025f2f75318aba65534048105cec36d4b7766 /core/pim
parentd37f3eac6b876285eb7a03ab01194ea261458ea5 (diff)
downloadopie-59e2de381eebb33238ee1b257736a9ae0afdbb7e.zip
opie-59e2de381eebb33238ee1b257736a9ae0afdbb7e.tar.gz
opie-59e2de381eebb33238ee1b257736a9ae0afdbb7e.tar.bz2
Bugfix: (bug #0000833) Duplicating an event should also duplicate the category.
Diffstat (limited to 'core/pim') (more/less context) (show whitespace changes)
-rw-r--r--core/pim/datebook/datebook.cpp33
1 files changed, 6 insertions, 27 deletions
diff --git a/core/pim/datebook/datebook.cpp b/core/pim/datebook/datebook.cpp
index 3e18374..1bc82a5 100644
--- a/core/pim/datebook/datebook.cpp
+++ b/core/pim/datebook/datebook.cpp
@@ -407,22 +407,11 @@ void DateBook::duplicateEvent( const Event &e )
qWarning("Hmmm...");
// Alot of code duplication, as this is almost like editEvent();
if (syncing) {
- QMessageBox::warning( this, tr("Calendar"),
- tr( "Can not edit data, currently syncing") );
+ QMessageBox::warning( this, tr("Calendar"), tr( "Can not edit data, currently syncing") );
return;
}
- Event dupevent;
- dupevent.setStart(e.start());
- dupevent.setEnd(e.end());
- dupevent.setDescription(e.description());
- dupevent.setLocation(e.location());
-// dupevent.setCategory(e.category()); // how is this done??
- dupevent.setNotes(e.notes());
- dupevent.setAllDay(e.isAllDay());
- dupevent.setTimeZone(e.timeZone());
- if(e.hasAlarm()) dupevent.setAlarm(e.alarmDelay(),e.alarmSound());
- if(e.hasRepeat()) dupevent.setRepeat(e.repeatPattern());
+ Event dupevent(e); // Make a duplicate.
// workaround added for text input.
QDialog editDlg( this, 0, TRUE );
@@ -443,14 +432,9 @@ void DateBook::duplicateEvent( const Event &e )
#endif
while (editDlg.exec() ) {
Event newEv = entry->event();
- if(newEv.description().isEmpty() && newEv.notes().isEmpty() )
- break;
- newEv.setUid(e.uid()); // FIXME: Hack not to clear uid
QString error = checkEvent(newEv);
if (!error.isNull()) {
- if (QMessageBox::warning(this, "error box",
- error, "Fix it", "Continue",
- 0, 0, 1) == 0)
+ if (QMessageBox::warning(this, "error box", error, "Fix it", "Continue", 0, 0, 1) == 0)
continue;
}
db->addEvent(newEv);
@@ -462,8 +446,7 @@ void DateBook::duplicateEvent( const Event &e )
void DateBook::editEvent( const Event &e )
{
if (syncing) {
- QMessageBox::warning( this, tr("Calendar"),
- tr( "Can not edit data, currently syncing") );
+ QMessageBox::warning( this, tr("Calendar"), tr( "Can not edit data, currently syncing") );
return;
}
@@ -491,10 +474,7 @@ void DateBook::editEvent( const Event &e )
newEv.setUid(e.uid()); // FIXME: Hack not to clear uid
QString error = checkEvent(newEv);
if (!error.isNull()) {
- if (QMessageBox::warning(this, "error box",
- error, "Fix it", "Continue",
- 0, 0, 1) == 0)
- continue;
+ if (QMessageBox::warning(this, "error box", error, "Fix it", "Continue", 0, 0, 1) == 0) continue;
}
db->editEvent(e, newEv);
emit newEvent();
@@ -505,8 +485,7 @@ void DateBook::editEvent( const Event &e )
void DateBook::removeEvent( const Event &e )
{
if (syncing) {
- QMessageBox::warning( this, tr("Calendar"),
- tr( "Can not edit data, currently syncing") );
+ QMessageBox::warning( this, tr("Calendar"), tr( "Can not edit data, currently syncing") );
return;
}