[Kroupware] KMail Patch (Groupware configuration)

Stephan Buys s.buys at codefusion.co.za
Thu Apr 24 17:30:02 CEST 2003


Hi,

I had the situation where I changed a server and wanted to remove and recreate
the Groupware folders on my Kmail profile. Unfortunately it started crashing and
crashed every time I tried to change a setting in the KMail configuration.

I traced the problem to the

void GroupwarePage::apply()

function in configuredialog.cpp

The problem was that a null string was being dereferenced. I added a sanity
check to disable groupware functionality if the Folder is not initialised.

The diff (against CVS) is below.

Regards,
Stephan 

--- configuredialog.cpp	10 Apr 2003 20:23:17 -0000	1.310.2.43
+++ configuredialog.cpp	24 Apr 2003 14:27:51 -0000
@@ -4080,10 +4080,13 @@ void GroupwarePage::installProfile( KCon
 void GroupwarePage::apply()
 {
   KConfigGroup options( KMKernel::config(), "Groupware" );
-
-  options.writeEntry( "Enabled", mEnableGwCB->isChecked() );
-  options.writeEntry( "FolderLanguage", mLanguageCombo->currentItem() );
-  options.writeEntry( "GroupwareFolder", mFolderCombo->getFolder()->idString() );
+  if (mFolderCombo->getFolder()) {
+    options.writeEntry( "Enabled", mEnableGwCB->isChecked() );
+    options.writeEntry( "FolderLanguage", mLanguageCombo->currentItem() );
+    options.writeEntry( "GroupwareFolder", mFolderCombo->getFolder()->idString() );
+  } else {
+    options.writeEntry("Enabled", false);
+  }
   options.writeEntry( "AutoAccept", mAutoResCB->isChecked() );
   options.writeEntry( "AutoDeclConflict", mAutoDeclConflCB->isChecked() );
   options.writeEntry( "LegacyMangleFromToHeaders", mLegacyMangleFromTo->isChecked() );



More information about the Kroupware mailing list