[Kolab-devel] [PATCH] Fix korganizer crash if kgroupware is disabled kroupware_branch

Sergio Visinoni piffio at arklinux.org
Sun Nov 23 19:57:01 CET 2003


Hi,
the attached patch fixes a crash that occours when running
korganizer from kroupware_branch with groupware communication
turned off.
see https://bugzilla.arklinux.org/bugzilla/show_bug.cgi?id=243
for details.

Please Cc: me on reply since I'm not subscribed to the list.

greetings,
sergio
-------------- next part --------------
--- kdepim/korganizer/calendarview.cpp.kroupware-instance	2003-11-21 01:18:52.000000000 +0100
+++ kdepim/korganizer/calendarview.cpp	2003-11-21 01:46:45.000000000 +0100
@@ -775,7 +775,12 @@
 
 void CalendarView::editEvent( Event *event )
 {
-  if ( !event || !KOGroupware::instance()->canEditEvent() ) return;
+  if ( !event )
+    return;
+  
+  if ( KOPrefs::instance()->mGroupwareCommunication )
+    if ( !KOGroupware::instance()->canEditEvent() )
+      return;
 
   if ( event->isReadOnly() ) {
     showEvent( event );
@@ -785,7 +790,8 @@
   KOEventEditor *eventEditor = mDialogManager->getEventEditor();
 
   // Tell KMail not to sync events while this is open
-  KOGroupware::instance()->editingEvent( eventEditor );
+  if ( KOPrefs::instance()->mGroupwareCommunication )
+    KOGroupware::instance()->editingEvent( eventEditor );
 
   //mDialogList.insert( event, eventEditor );
   eventEditor->editEvent( event );
@@ -798,7 +804,12 @@
 
 void CalendarView::editTodo( Todo *todo )
 {
-  if ( !todo || !KOGroupware::instance()->canEditTodo() ) return;
+  if ( !todo )
+	  return;
+
+  if ( KOPrefs::instance()->mGroupwareCommunication )
+    if ( !KOGroupware::instance()->canEditTodo() )
+      return;
 
   if ( todo->isReadOnly() ) {
     showTodo( todo );
@@ -808,7 +819,8 @@
   KOTodoEditor *todoEditor = mDialogManager->getTodoEditor();
 
   // Tell KMail not to sync todos while this is open
-  KOGroupware::instance()->editingTodo( todoEditor );
+  if ( KOPrefs::instance()->mGroupwareCommunication )
+    KOGroupware::instance()->editingTodo( todoEditor );
 
   todoEditor->editTodo( todo );
   todoEditor->exec();
@@ -943,7 +955,7 @@
     } else {
       bool doDelete = true;
       if( KOPrefs::instance()->mGroupwareCommunication ) {
-	doDelete = KOGroupware::instance()->sendICalMessage( this, KCal::Scheduler::Cancel, todo, true );
+        doDelete = KOGroupware::instance()->sendICalMessage( this, KCal::Scheduler::Cancel, todo, true );
       }
       if( doDelete ) calendar()->deleteTodo(todo);
       updateView();
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.kolab.org/pipermail/devel/attachments/20031123/29733a6b/attachment.sig>


More information about the devel mailing list