Bug 123350 - Kontact crashes if you click "OK" before completing "Resourse Selection"
Summary: Kontact crashes if you click "OK" before completing "Resourse Selection"
Status: RESOLVED FIXED
Alias: None
Product: korganizer
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Ubuntu Linux
: NOR crash (vote)
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-03-09 19:49 UTC by kdecraig
Modified: 2007-01-10 23:02 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description kdecraig 2006-03-09 19:49:28 UTC
Version:           3.4.3 (using KDE KDE 3.4.3)
Installed from:    Ubuntu Packages
OS:                Linux

Create a new event on calendar or a new task.
Click 'OK'.

If you have multiple Resources available, a dialogue box pops up asking you to select one. If you click "OK" on the ORIGINAL window (ie the OK you just clicked) and then select and click OK in the Resource window Kontact crashes.
Comment 1 Haris Kouzinopoulos 2006-03-22 20:51:07 UTC
Can you paste a backtrace please?
Comment 2 kdecraig 2006-03-28 04:02:51 UTC
Here is a backtrace (with extra "(no debugging symbols found)" removed:

(no debugging symbols found)
Using host libthread_db library "/lib/tls/i686/cmov/libthread_db.so.1".
(no debugging symbols found)
`system-supplied DSO at 0xffffe000' has disappeared; keeping its symbols.
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
...
[Thread debugging using libthread_db enabled]
[New Thread -1239922464 (LWP 6284)]
...
(no debugging symbols found)
(no debugging symbols found)
[KCrash handler]
#4  0xb6eb0949 in QTimer::stop () from /usr/lib/libqt-mt.so.3
#5  0xb51ba982 in KOEditorFreeBusy::cancelReload ()
   from /usr/lib/libkorganizer.so.1
#6  0xb5257e3f in KOEventEditor::processInput ()
   from /usr/lib/libkorganizer.so.1
#7  0xb51ba2ef in KOIncidenceEditor::slotOk ()
   from /usr/lib/libkorganizer.so.1
#8  0xb6a51914 in KDialogBase::qt_invoke () from /usr/lib/libkdeui.so.4
#9  0xb51e7133 in KOIncidenceEditor::qt_invoke ()
   from /usr/lib/libkorganizer.so.1
#10 0xb5255fba in KOEventEditor::qt_invoke () from /usr/lib/libkorganizer.so.1
#11 0xb6e8b929 in QObject::activate_signal () from /usr/lib/libqt-mt.so.3
#12 0xb6e8c3c4 in QObject::activate_signal () from /usr/lib/libqt-mt.so.3
#13 0xb71f33a7 in QButton::clicked () from /usr/lib/libqt-mt.so.3
#14 0xb6f25982 in QButton::mouseReleaseEvent () from /usr/lib/libqt-mt.so.3
#15 0xb6ec6356 in QWidget::event () from /usr/lib/libqt-mt.so.3
#16 0xb6e22f80 in QApplication::internalNotify () from /usr/lib/libqt-mt.so.3
#17 0xb6e23500 in QApplication::notify () from /usr/lib/libqt-mt.so.3
#18 0xb74a6e37 in KApplication::notify () from /usr/lib/libkdecore.so.4
#19 0xb6db3e25 in QApplication::sendSpontaneousEvent ()
   from /usr/lib/libqt-mt.so.3
#20 0xb6daf325 in QETWidget::translateMouseEvent ()
   from /usr/lib/libqt-mt.so.3
#21 0xb6dad66f in QApplication::x11ProcessEvent () from /usr/lib/libqt-mt.so.3
#22 0xb6dc6fff in QEventLoop::processEvents () from /usr/lib/libqt-mt.so.3
#23 0xb6e3acfb in QEventLoop::enterLoop () from /usr/lib/libqt-mt.so.3
#24 0xb6e3ac1e in QEventLoop::exec () from /usr/lib/libqt-mt.so.3
#25 0xb6e21c13 in QApplication::exec () from /usr/lib/libqt-mt.so.3
#26 0x0805a207 in ?? ()
#27 0xbf9d7e20 in ?? ()
#28 0x00000001 in ?? ()
#29 0x00000001 in ?? ()
#30 0x00000000 in ?? ()
#31 0x00000000 in ?? ()
#32 0x00000001 in ?? ()
#33 0x0806653c in typeinfo name for QPtrList<KParts::Part> ()
#34 0x00000000 in ?? ()
#35 0x08065ba0 in typeinfo name for QPtrList<KParts::Part> ()
#36 0x08065b8c in typeinfo name for QPtrList<KParts::Part> ()
#37 0xbf9d7e18 in ?? ()
#38 0xb7983900 in __malloc_initialize_hook ()
   from /lib/tls/i686/cmov/libc.so.6
#39 0x00000015 in ?? ()
#40 0x0804e6b9 in ?? ()
#41 0x00000008 in ?? ()
#42 0x00000004 in ?? ()
#43 0xb7a90cd0 in ?? () from /usr/lib/libstdc++.so.6
#44 0xb7983908 in __malloc_initialize_hook ()
   from /lib/tls/i686/cmov/libc.so.6
#45 0x00000002 in ?? ()
#46 0x00000015 in ?? ()
#47 0x08063d48 in vtable for QGList ()
#48 0xb7fc5160 in ?? ()
#49 0x080b7220 in ?? ()
#50 0x00000000 in ?? ()
#51 0x080b6e80 in ?? ()
#52 0x08162068 in ?? ()
#53 0x08161d88 in ?? ()
#54 0x08172bf0 in ?? ()
#55 0x00000000 in ?? ()
#56 0x00000000 in ?? ()
#57 0x00000001 in ?? ()
#58 0x08078a48 in ?? ()
#59 0x00000000 in ?? ()
#60 0x00000000 in ?? ()
#61 0x08185aa0 in ?? ()
#62 0x08152998 in ?? ()
#63 0x08153d88 in ?? ()
#64 0x08057f00 in ?? ()
#65 0x08063dcc in vtable for QGList ()
#66 0x08155810 in ?? ()
#67 0x08155670 in ?? ()
#68 0x0816a148 in ?? ()
#69 0xb731e4e0 in vtable for QCString () from /usr/lib/libqt-mt.so.3
#70 0x080775f0 in ?? ()
#71 0xbf9d7f04 in ?? ()
#72 0x08155138 in ?? ()
#73 0x08079338 in ?? ()
#74 0x00000124 in ?? ()
#75 0x000000ff in ?? ()
#76 0xb6bf5ecc in ?? () from /usr/lib/libqt-mt.so.3
#77 0x00000000 in ?? ()
#78 0x0806c688 in ?? ()
#79 0x08057f01 in ?? ()
#80 0x0818a5a0 in ?? ()
#81 0x081852f8 in ?? ()
#82 0xb78639fc in ?? () from /lib/tls/i686/cmov/libc.so.6
#83 0xb785b32c in ?? () from /lib/tls/i686/cmov/libc.so.6
#84 0x08076320 in ?? ()
#85 0x00000049 in ?? ()
#86 0xb7301460 in ?? () from /usr/lib/libqt-mt.so.3
#87 0x00000000 in ?? ()
#88 0xb7fdbca0 in _rtld_global () from /lib/ld-linux.so.2
#89 0xbf9d7ee8 in ?? ()
#90 0xb6e7bc5f in QAsciiDict<void>::insert () from /usr/lib/libqt-mt.so.3
#91 0xb786cea2 in __libc_start_main () from /lib/tls/i686/cmov/libc.so.6
#92 0x08057d41 in ?? ()
Comment 3 Ulrich Gemkow 2006-05-16 15:30:13 UTC
Hello,

here is another backtrace from kde 3.5.2 with debugging symbols for
the same error

Using host libthread_db library "/lib/tls/libthread_db.so.1".
`shared object read from target memory' has disappeared; keeping its symbols.
[Thread debugging using libthread_db enabled]
[New Thread -1243597120 (LWP 12551)]
[New Thread -1285387344 (LWP 12724)]
[Thread debugging using libthread_db enabled]
[New Thread -1243597120 (LWP 12551)]
[New Thread -1285387344 (LWP 12724)]
[Thread debugging using libthread_db enabled]
[New Thread -1243597120 (LWP 12551)]
[New Thread -1285387344 (LWP 12724)]
[New Thread -1276994640 (LWP 12723)]
[New Thread -1268601936 (LWP 12722)]
[New Thread -1260209232 (LWP 12721)]
[KCrash handler]
#6  0xb7dc6e09 in KCal::CalendarResources::releaseSaveTicket (this=0x88511d0, 
    ticket=0x8905440) at calendarresources.cpp:702
#7  0xb7dc6dc5 in KCal::CalendarResources::save (this=0x88511d0, 
    ticket=0x8905440, incidence=0x88b5de8) at calendarresources.cpp:693
#8  0xb7dc70e4 in KCal::CalendarResources::endChange (this=0x88511d0, 
    incidence=0x88b5de8) at calendarresources.cpp:747
#9  0xb2d1eecf in IncidenceChanger::endChange (this=0x882c2a8, 
    incidence=0x88b5de8) at incidencechanger.cpp:86
#10 0xb2c6fca7 in KOAgenda::endItemAction (this=0x884b0b8)
    at koagenda.cpp:1148
#11 0xb2c6d504 in KOAgenda::eventFilter_mouse (this=0x884b0b8, 
    object=0x8a7a510, me=0xbfae26c0) at koagenda.cpp:631
#12 0xb2c6c71f in KOAgenda::eventFilter (this=0x884b0b8, object=0x8a7a510, 
    event=0xbfae26c0) at koagenda.cpp:354
#13 0xb65e49fc in QObject::activate_filters ()
   from /usr/local/kde35/qt/lib/libqt-mt.so.3
#14 0xb65e4ac2 in QObject::event () from /usr/local/kde35/qt/lib/libqt-mt.so.3
#15 0xb66199ee in QWidget::event () from /usr/local/kde35/qt/lib/libqt-mt.so.3
#16 0xb658c3f9 in QApplication::internalNotify ()
   from /usr/local/kde35/qt/lib/libqt-mt.so.3
#17 0xb658c639 in QApplication::notify ()
   from /usr/local/kde35/qt/lib/libqt-mt.so.3
#18 0xb6bc3704 in KApplication::notify (this=0xbfae2c20, receiver=0x8a7a510, 
    event=0xbfae26c0) at kapplication.cpp:550
#19 0xb652fdba in QETWidget::translateMouseEvent ()
   from /usr/local/kde35/qt/lib/libqt-mt.so.3
#20 0xb652e29f in QApplication::x11ProcessEvent ()
   from /usr/local/kde35/qt/lib/libqt-mt.so.3
#21 0xb653fc78 in QEventLoop::processEvents ()
   from /usr/local/kde35/qt/lib/libqt-mt.so.3
#22 0xb65a05ff in QEventLoop::enterLoop ()
   from /usr/local/kde35/qt/lib/libqt-mt.so.3
#23 0xb65a055c in QEventLoop::exec ()
   from /usr/local/kde35/qt/lib/libqt-mt.so.3
#24 0xb658b73c in QApplication::exec ()
   from /usr/local/kde35/qt/lib/libqt-mt.so.3
#25 0x0805cb29 in main (argc=1, argv=0xbfae2df4) at main.cpp:177
Comment 4 Dave Miller 2006-10-18 21:36:32 UTC
Hello, I can confirm that this bug exists too. I'm using Ubuntu Dapper with KDE 3.5.5

Here's the backtrace:

(no debugging symbols found)
Using host libthread_db library "/lib/tls/i686/cmov/libthread_db.so.1".
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
[Thread debugging using libthread_db enabled]
[New Thread -1242360128 (LWP 6603)]
[New Thread -1281336400 (LWP 6610)]
[New Thread -1272943696 (LWP 6609)]
[New Thread -1264550992 (LWP 6608)]
[New Thread -1256158288 (LWP 6607)]
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
[KCrash handler]
#6  0xb7016be1 in QTimer::stop () from /usr/lib/libqt-mt.so.3
#7  0xb2e6e4c4 in KOEditorFreeBusy::cancelReload ()
   from /usr/lib/libkorganizer.so.1
#8  0xb2f35511 in KOEventEditor::processInput ()
   from /usr/lib/libkorganizer.so.1
#9  0xb2e6ddfd in KOIncidenceEditor::slotOk ()
   from /usr/lib/libkorganizer.so.1
#10 0xb6844d3c in KDialogBase::qt_invoke () from /usr/lib/libkdeui.so.4
#11 0xb2e967c1 in KOIncidenceEditor::qt_invoke ()
   from /usr/lib/libkorganizer.so.1
#12 0xb2f0162c in KOEventEditor::qt_invoke () from /usr/lib/libkorganizer.so.1
#13 0xb6ff1eb9 in QObject::activate_signal () from /usr/lib/libqt-mt.so.3
#14 0xb6ff2954 in QObject::activate_signal () from /usr/lib/libqt-mt.so.3
#15 0xb738dd1f in QButton::clicked () from /usr/lib/libqt-mt.so.3
#16 0xb708d55e in QButton::mouseReleaseEvent () from /usr/lib/libqt-mt.so.3
#17 0xb702c68d in QWidget::event () from /usr/lib/libqt-mt.so.3
#18 0xb6f87e56 in QApplication::internalNotify () from /usr/lib/libqt-mt.so.3
#19 0xb6f883e0 in QApplication::notify () from /usr/lib/libqt-mt.so.3
#20 0xb769a1cd in KApplication::notify () from /usr/lib/libkdecore.so.4
#21 0xb6f191c5 in QApplication::sendSpontaneousEvent ()
   from /usr/lib/libqt-mt.so.3
#22 0xb6f14873 in QETWidget::translateMouseEvent ()
   from /usr/lib/libqt-mt.so.3
#23 0xb6f12d59 in QApplication::x11ProcessEvent () from /usr/lib/libqt-mt.so.3
#24 0xb6f2c4db in QEventLoop::processEvents () from /usr/lib/libqt-mt.so.3
#25 0xb6fa0947 in QEventLoop::enterLoop () from /usr/lib/libqt-mt.so.3
#26 0xb6fa086a in QEventLoop::exec () from /usr/lib/libqt-mt.so.3
#27 0xb6f86965 in QApplication::exec () from /usr/lib/libqt-mt.so.3
#28 0x0805a841 in ?? ()
#29 0xbfd768f0 in ?? ()
#30 0x00000001 in ?? ()
#31 0x00000001 in ?? ()
#32 0x00000000 in ?? ()
Comment 5 Reinhold Kainhofer 2006-11-02 19:24:01 UTC
Reassigning all KOrganizer bug reports and wishes to the newly created 
korganizer-devel mailing list.
Comment 6 Bram Schoenmakers 2006-12-24 19:37:08 UTC
I can confirm the crash, although I see no familiarity with the posted backtraces.
Comment 7 Reinhold Kainhofer 2007-01-10 12:10:36 UTC
The problem is that the resource (and for the dimap resource also the subresource) selection dialog does not have a parent widget set... The proper solution would be to somehow pass a proper parent widget to libkcal / the resource. But I don't see an obvious, non-ugly way.

Cheers,
Reinhold
Comment 8 Bram Schoenmakers 2007-01-10 19:01:12 UTC
No, please not the ugly way. On IRC I suggested to hide the event editor somewhat earlier such that the user cannot click it anymore.
Comment 9 Reinhold Kainhofer 2007-01-10 23:02:38 UTC
SVN commit 622165 by kainhofe:

Add the ability to the CalendarResource to set a parent widget for dialogs like the resource selection dialog. This is used in KOrganizer to make sure that the resource selection dialog is a child of the editor dialog (and thus disables the editor dialog).

This also fixes the crash described in bug 123350.

BUG: 123350


 M  +9 -7      korganizer/calendarview.cpp  
 M  +4 -0      korganizer/history.cpp  
 M  +20 -4     korganizer/incidencechanger.cpp  
 M  +1 -1      korganizer/incidencechanger.h  
 M  +2 -1      korganizer/interfaces/korganizer/incidencechangerbase.h  
 M  +1 -1      korganizer/journalentry.cpp  
 M  +2 -2      korganizer/koagenda.cpp  
 M  +1 -1      korganizer/koagendaview.cpp  
 M  +1 -1      korganizer/koeventeditor.cpp  
 M  +1 -1      korganizer/kojournaleditor.cpp  
 M  +1 -1      korganizer/kotodoeditor.cpp  
 M  +3 -3      korganizer/kotodoview.cpp  
 M  +11 -1     libkcal/calendarresources.cpp  
 M  +27 -7     libkcal/calendarresources.h  
 M  +1 -0      libkdepim/kdateedit.cpp  


--- branches/KDE/3.5/kdepim/korganizer/calendarview.cpp #622164:622165
@@ -708,7 +708,7 @@
           journal->setSummary( i18n("Journal of %1").arg( dateStr ) );
           journal->setDescription( description );
 
-          if ( !mChanger->addIncidence( journal ) ) {
+          if ( !mChanger->addIncidence( journal, this ) ) {
             KODialogManager::errorSaveIncidence( this, journal );
             delete journal;
             return;
@@ -892,14 +892,14 @@
         pastedEvent->setDtEnd(endDT);
       }
     }
-    mChanger->addIncidence( pastedEvent );
+    mChanger->addIncidence( pastedEvent, this );
 
   } else if ( pastedIncidence->type() == "Todo" ) {
     Todo* pastedTodo = static_cast<Todo*>(pastedIncidence);
     Todo* _selectedTodo = selectedTodo();
     if ( _selectedTodo )
       pastedTodo->setRelatedTo( _selectedTodo );
-    mChanger->addIncidence( pastedTodo );
+    mChanger->addIncidence( pastedTodo, this );
   }
 }
 
@@ -1080,7 +1080,7 @@
   format.setTimeZone( mCalendar->timeZoneId(), true );
   Incidence *incidence = format.fromString( ical );
   if ( !incidence ) return false;
-  if ( !mChanger->addIncidence( incidence ) ) {
+  if ( !mChanger->addIncidence( incidence, this ) ) {
     delete incidence;
     return false;
   }
@@ -1233,8 +1233,9 @@
   Incidence* newInc = mCalendar->dissociateOccurrence( incidence, date, true );
 
   if ( newInc ) {
+    // TODO: Use the same resource instead of asking again!
     mChanger->changeIncidence( oldincidence, incidence );
-    mChanger->addIncidence( newInc );
+    mChanger->addIncidence( newInc, this );
   } else {
     KMessageBox::sorry( this, i18n("Dissociating the occurrence failed."),
       i18n("Dissociating Failed") );
@@ -1259,8 +1260,9 @@
 
   Incidence* newInc = mCalendar->dissociateOccurrence( incidence, date, true );
   if ( newInc ) {
+    // TODO: Use the same resource instead of asking again!
     mChanger->changeIncidence( oldincidence, incidence );
-    mChanger->addIncidence( newInc );
+    mChanger->addIncidence( newInc, this );
   } else {
     KMessageBox::sorry( this, i18n("Dissociating the future occurrences failed."),
       i18n("Dissociating Failed") );
@@ -2184,7 +2186,7 @@
     todo->setHasDueDate( true );
   }
 
-  if ( !mChanger->addIncidence( incidence ) ) {
+  if ( !mChanger->addIncidence( incidence, this ) ) {
     KODialogManager::errorSaveIncidence( this, incidence );
     delete incidence;
   }
--- branches/KDE/3.5/kdepim/korganizer/history.cpp #622164:622165
@@ -170,6 +170,7 @@
 
 void History::EntryDelete::undo()
 {
+  // TODO: Use the proper resource instead of asking!
   mCalendar->addIncidence( mIncidence->clone() );
 }
 
@@ -204,6 +205,7 @@
 
 void History::EntryAdd::redo()
 {
+  // TODO: User the proper resource instead of asking again
   mCalendar->addIncidence( mIncidence->clone() );
 }
 
@@ -231,6 +233,7 @@
   Incidence *incidence = mCalendar->incidence( mNewIncidence->uid() );
   if ( incidence )
       mCalendar->deleteIncidence( incidence );
+  // TODO: Use the proper resource instead of asking again
   mCalendar->addIncidence( mOldIncidence->clone() );
 }
 
@@ -239,6 +242,7 @@
   Incidence *incidence = mCalendar->incidence( mOldIncidence->uid() );
   if ( incidence )
       mCalendar->deleteIncidence( incidence );
+  // TODO: Use the proper resource instead of asking again
   mCalendar->addIncidence( mNewIncidence->clone() );
 }
 
--- branches/KDE/3.5/kdepim/korganizer/incidencechanger.cpp #622164:622165
@@ -288,18 +288,34 @@
   return true;
 }
 
-bool IncidenceChanger::addIncidence( Incidence *incidence )
+bool IncidenceChanger::addIncidence( Incidence *incidence, QWidget *parent )
 {
 kdDebug(5850)<<"IncidenceChanger::addIncidence for incidence \""<<incidence->summary()<<"\""<<endl;
   if ( KOPrefs::instance()->mUseGroupwareCommunication ) {
-    if ( !KOGroupware::instance()->sendICalMessage( 0,
+    if ( !KOGroupware::instance()->sendICalMessage( parent,
                                                     KCal::Scheduler::Request,
                                                     incidence ) ) {
       kdError() << "sendIcalMessage failed." << endl;
     }
   }
-  if ( !mCalendar->addIncidence( incidence ) ) {
-    KMessageBox::sorry( 0, i18n("Unable to save %1 \"%2\".")
+  // FIXME: This is a nasty hack, since we need to set a parent for the 
+  //        resource selection dialog. However, we don't have any UI methods
+  //        in the calendar, only in the CalendarResources::DestinationPolicy
+  //        So we need to type-cast it and extract it from the CalendarResources
+  CalendarResources *stdcal = dynamic_cast<CalendarResources*>(mCalendar);
+  QWidget *tmpparent = 0;
+  if ( stdcal ) {
+    tmpparent = stdcal->dialogParentWidget();
+    stdcal->setDialogParentWidget( parent );
+  }
+  bool success = mCalendar->addIncidence( incidence );
+  if ( stdcal ) {
+    // Reset the parent widget, otherwise we'll end up with pointers to deleted 
+    // widgets sooner or later
+    stdcal->setDialogParentWidget( tmpparent );
+  }
+  if ( !success ) {
+    KMessageBox::sorry( parent, i18n("Unable to save %1 \"%2\".")
                         .arg( i18n( incidence->type() ) )
                         .arg( incidence->summary() ) );
     return false;
--- branches/KDE/3.5/kdepim/korganizer/incidencechanger.h #622164:622165
@@ -37,7 +37,7 @@
   bool sendGroupwareMessage( Incidence *incidence, KCal::Scheduler::Method method, bool deleting = false );
   bool endChange( Incidence *incidence );
 
-  bool addIncidence( Incidence *incidence );
+  bool addIncidence( Incidence *incidence, QWidget *parent = 0 );
   bool changeIncidence( Incidence *oldinc, Incidence *newinc, int action = -1 );
   bool deleteIncidence( Incidence *incidence );
   
--- branches/KDE/3.5/kdepim/korganizer/interfaces/korganizer/incidencechangerbase.h #622164:622165
@@ -24,6 +24,7 @@
 #include <libkcal/scheduler.h>
 #include <qobject.h>
 
+class QWidget;
 namespace KCal {
 class Calendar;
 class Incidence;
@@ -46,7 +47,7 @@
   virtual bool beginChange( Incidence * incidence ) = 0;
   virtual bool endChange( Incidence *incidence ) = 0;
 
-  virtual bool addIncidence( Incidence *incidence ) = 0;
+  virtual bool addIncidence( Incidence *incidence, QWidget *parent = 0 ) = 0;
   virtual bool changeIncidence( Incidence *newinc, Incidence *oldinc, 
                                 int action = -1 ) = 0;
   virtual bool deleteIncidence( Incidence *incidence ) = 0;
--- branches/KDE/3.5/kdepim/korganizer/journalentry.cpp #622164:622165
@@ -383,7 +383,7 @@
     newJournal = true;
     mJournal = new Journal;
     writeJournalPrivate( mJournal );
-    if ( !mChanger->addIncidence( mJournal ) ) {
+    if ( !mChanger->addIncidence( mJournal, this ) ) {
       KODialogManager::errorSaveIncidence( this, mJournal );
       delete mJournal;
       mJournal = 0;
--- branches/KDE/3.5/kdepim/korganizer/koagenda.cpp #622164:622165
@@ -1078,7 +1078,7 @@
               emit enableAgendaUpdate( false );
               mActionItem->dissociateFromMultiItem();
               mActionItem->setIncidence( newInc );
-              mChanger->addIncidence( newInc );
+              mChanger->addIncidence( newInc, this );
               emit enableAgendaUpdate( true );
               mChanger->changeIncidence( oldIncSaved, oldInc );
             } else {
@@ -1105,7 +1105,7 @@
               emit enableAgendaUpdate( false );
               mActionItem->dissociateFromMultiItem();
               mActionItem->setIncidence( newInc );
-              mChanger->addIncidence( newInc );
+              mChanger->addIncidence( newInc, this );
               emit enableAgendaUpdate( true );
               mChanger->changeIncidence( oldIncSaved, oldInc );
             } else {
--- branches/KDE/3.5/kdepim/korganizer/koagendaview.cpp #622164:622165
@@ -1570,7 +1570,7 @@
       todo->setDtDue( newTime );
       todo->setFloats( allDay );
       todo->setHasDueDate( true );
-      if ( !mChanger->addIncidence( todo ) ) {
+      if ( !mChanger->addIncidence( todo, this ) ) {
         KODialogManager::errorSaveIncidence( this, todo );
       }
     }
--- branches/KDE/3.5/kdepim/korganizer/koeventeditor.cpp #622164:622165
@@ -277,7 +277,7 @@
     mEvent->setOrganizer( Person( KOPrefs::instance()->fullName(),
                           KOPrefs::instance()->email() ) );
     writeEvent( mEvent );
-    if ( !mChanger->addIncidence( mEvent ) ) {
+    if ( !mChanger->addIncidence( mEvent, this ) ) {
       delete mEvent;
       mEvent = 0;
       return false;
--- branches/KDE/3.5/kdepim/korganizer/kojournaleditor.cpp #622164:622165
@@ -149,7 +149,7 @@
 
     writeJournal( mJournal );
 
-    if ( !mChanger->addIncidence( mJournal ) ) {
+    if ( !mChanger->addIncidence( mJournal, this ) ) {
       KODialogManager::errorSaveIncidence( this, mJournal );
       delete mJournal;
       mJournal = 0;
--- branches/KDE/3.5/kdepim/korganizer/kotodoeditor.cpp #622164:622165
@@ -223,7 +223,7 @@
 
     writeTodo( mTodo );
 
-    if ( !mChanger->addIncidence( mTodo ) ) {
+    if ( !mChanger->addIncidence( mTodo, this ) ) {
       delete mTodo;
       mTodo = 0;
       return false;
--- branches/KDE/3.5/kdepim/korganizer/kotodoview.cpp #622164:622165
@@ -236,7 +236,7 @@
     } else {
 //      kdDebug(5850) << "Drop new Todo" << endl;
       todo->setRelatedTo(destinationEvent);
-      if ( !mChanger->addIncidence( todo ) ) {
+      if ( !mChanger->addIncidence( todo, this ) ) {
         KODialogManager::errorSaveIncidence( this, todo );
         delete todo;
         return;
@@ -980,7 +980,7 @@
    if ( newTodo->doesRecur() )
      newTodo->recurrence()->unsetRecurs();
 
-   mChanger->addIncidence( newTodo );
+   mChanger->addIncidence( newTodo, this );
  }
 }
 
@@ -1105,7 +1105,7 @@
     todo->setSummary( mQuickAdd->text() );
     todo->setOrganizer( Person( KOPrefs::instance()->fullName(),
                         KOPrefs::instance()->email() ) );
-    if ( !mChanger->addIncidence( todo ) ) {
+    if ( !mChanger->addIncidence( todo, this ) ) {
       KODialogManager::errorSaveIncidence( this, todo );
       delete todo;
       return;
--- branches/KDE/3.5/kdepim/libkcal/calendarresources.cpp #622164:622165
@@ -79,7 +79,7 @@
   }
 
   KRES::Resource *r;
-  r = KRES::SelectDialog::getResource( list, mParent );
+  r = KRES::SelectDialog::getResource( list, parent() );
   return static_cast<ResourceCalendar *>( r );
 }
 
@@ -179,6 +179,16 @@
   mDestinationPolicy = mAskPolicy;
 }
 
+QWidget *CalendarResources::dialogParentWidget()
+{
+  return mDestinationPolicy->parent();
+}
+void CalendarResources::setDialogParentWidget( QWidget *parent )
+{
+  mDestinationPolicy->setParent( parent );
+}
+
+
 void CalendarResources::close()
 {
   kdDebug(5800) << "CalendarResources::close" << endl;
--- branches/KDE/3.5/kdepim/libkcal/calendarresources.h #622164:622165
@@ -73,10 +73,13 @@
     class DestinationPolicy
     {
       public:
-        DestinationPolicy( CalendarResourceManager *manager ) :
-          mManager( manager ) {}
+        DestinationPolicy( CalendarResourceManager *manager,
+                              QWidget *parent = 0  ) :
+          mManager( manager ), mParent( parent ) {}
 
         virtual ResourceCalendar *destination( Incidence *incidence ) = 0;
+        virtual QWidget *parent() { return mParent; }
+        virtual void setParent( QWidget *newparent ) { mParent = newparent; }
 
       protected:
         CalendarResourceManager *resourceManager()
@@ -84,6 +87,7 @@
 
       private:
         CalendarResourceManager *mManager;
+        QWidget *mParent;
     };
 
     /**
@@ -92,8 +96,9 @@
     class StandardDestinationPolicy : public DestinationPolicy
     {
       public:
-        StandardDestinationPolicy( CalendarResourceManager *manager ) :
-          DestinationPolicy( manager ) {}
+        StandardDestinationPolicy( CalendarResourceManager *manager,
+                              QWidget *parent = 0  ) :
+          DestinationPolicy( manager, parent ) {}
 
         ResourceCalendar *destination( Incidence *incidence );
 
@@ -110,13 +115,11 @@
       public:
         AskDestinationPolicy( CalendarResourceManager *manager,
                               QWidget *parent = 0 ) :
-          DestinationPolicy( manager ), mParent( parent ) {}
+          DestinationPolicy( manager, parent ) {}
 
         ResourceCalendar *destination( Incidence *incidence );
 
       private:
-        QWidget *mParent;
-
         class Private;
         Private *d;
     };
@@ -250,6 +253,23 @@
        Resource which is queried.
     */
     void setAskDestinationPolicy();
+    
+    /** 
+       Returns the current parent for new dialogs. This is a bad hack, but we need
+       to properly set the parent for the resource selection dialog. Otherwise
+       the dialog will not be modal to the editor dialog in korganizer and 
+       the user can still work in the editor dialog (and thus crash korganizer).
+       Afterwards we need to reset it (to avoid pointers to widgets that are 
+       already deleted) so we also need the accessor
+    */
+    QWidget *dialogParentWidget();
+    /** 
+       Set the widget parent for new dialogs. This is a bad hack, but we need
+       to properly set the parent for the resource selection dialog. Otherwise
+       the dialog will not be modal to the editor dialog in korganizer and 
+       the user can still work in the editor dialog (and thus crash korganizer).
+    */
+    void setDialogParentWidget( QWidget *parent );
 
     /**
        Request ticket for saving the Calendar.  If a ticket is returned the
--- branches/KDE/3.5/kdepim/libkdepim/kdateedit.cpp #622164:622165
@@ -271,6 +271,7 @@
         step = 1;
       else if ( keyEvent->key() == Qt::Key_Down )
         step = -1;
+      // TODO: If it's not an input key, but something like Return, Enter, Tab, etc..., don't eat the keypress, but handle it through to the default eventfilter!
       if ( step && !mReadOnly ) {
         QDate date = parseDate();
         if ( date.isValid() ) {