From kmail-devel Wed Sep 03 12:28:11 2003 From: Stephan Kulow Date: Wed, 03 Sep 2003 12:28:11 +0000 To: kmail-devel Subject: [patch] readBoolEntry X-MARC-Message: https://marc.info/?l=kmail-devel&m=106259210725197 MIME-Version: 1 Content-Type: multipart/mixed; boundary="--Boundary-00=_b5dV/wXRdON4qmM" --Boundary-00=_b5dV/wXRdON4qmM Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi! I noticed a difference between leaving the default config and applying the default config in behaviour to expiring folders. A patch to "fix" that problem is attached, but I feel this should be fixed more generic (for 3.1 the diff may be ok, but for 3.2 we should use some generic pref storage - don't know how mature kpref is) Greetings, Stephan -- There may be no I in TEAM, but a M and an E. --Boundary-00=_b5dV/wXRdON4qmM Content-Type: text/x-diff; charset="us-ascii"; name="kmail.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="kmail.patch" Index: kmfoldermgr.cpp =================================================================== RCS file: /home/kde/kdepim/kmail/kmfoldermgr.cpp,v retrieving revision 1.87 diff -u -3 -p -u -r1.87 kmfoldermgr.cpp --- kmfoldermgr.cpp 26 Jul 2003 19:22:46 -0000 1.87 +++ kmfoldermgr.cpp 3 Sep 2003 12:25:44 -0000 @@ -59,7 +59,7 @@ void KMFolderMgr::expireAll() { KConfigGroupSaver saver(config, "General"); int ret = KMessageBox::Continue; - if (config->readBoolEntry("warn-before-expire")) { + if (config->readBoolEntry("warn-before-expire", true)) { ret = KMessageBox::warningContinueCancel(KMainWindow::memberList->first(), i18n("Are you sure you want to expire old messages?"), i18n("Expire old messages?"), i18n("Expire")); Index: kmkernel.cpp =================================================================== RCS file: /home/kde/kdepim/kmail/kmkernel.cpp,v retrieving revision 1.196 diff -u -3 -p -u -r1.196 kmkernel.cpp --- kmkernel.cpp 27 Aug 2003 13:48:51 -0000 1.196 +++ kmkernel.cpp 3 Sep 2003 12:25:44 -0000 @@ -948,7 +948,7 @@ void KMKernel::cleanupLoop() if (config->readNumEntry("when-to-expire")==expireAtExit) { expire = true; - if (config->readBoolEntry("warn-before-expire")) { + if (config->readBoolEntry("warn-before-expire", true)) { expire = canExpire(); } } Index: kmmainwidget.cpp =================================================================== RCS file: /home/kde/kdepim/kmail/kmmainwidget.cpp,v retrieving revision 1.79 diff -u -3 -p -u -r1.79 kmmainwidget.cpp --- kmmainwidget.cpp 28 Aug 2003 19:22:56 -0000 1.79 +++ kmmainwidget.cpp 3 Sep 2003 12:25:44 -0000 @@ -289,7 +289,7 @@ void KMMainWidget::readConfig(void) mSendOnCheck = config->readBoolEntry("sendOnCheck",false); mBeepOnNew = config->readBoolEntry("beep-on-mail", false); mSystemTrayOnNew = config->readBoolEntry("systray-on-mail", false); - mSystemTrayMode = config->readBoolEntry("systray-on-new", false) ? + mSystemTrayMode = config->readBoolEntry("systray-on-new", true) ? KMSystemTray::OnNewMail : KMSystemTray::AlwaysOn; mConfirmEmpty = config->readBoolEntry("confirm-before-empty", true); @@ -781,7 +781,7 @@ void KMMainWidget::slotExpireFolder() KConfig *config = KMKernel::config(); KConfigGroupSaver saver(config, "General"); - if (config->readBoolEntry("warn-before-expire")) { + if (config->readBoolEntry("warn-before-expire", true)) { str = i18n("Are you sure you want to expire the folder %1?").arg(mFolder->label()); if (KMessageBox::warningContinueCancel(this, str, i18n("Expire Folder"), i18n("&Expire")) @@ -948,7 +948,7 @@ void KMMainWidget::slotExpireAll() { KConfigGroupSaver saver(config, "General"); - if (config->readBoolEntry("warn-before-expire")) { + if (config->readBoolEntry("warn-before-expire", true)) { ret = KMessageBox::warningContinueCancel(KMainWindow::memberList->first(), i18n("Are you sure you want to expire all old messages?"), i18n("Expire old Messages?"), i18n("Expire")); Index: kmmainwin.cpp =================================================================== RCS file: /home/kde/kdepim/kmail/kmmainwin.cpp,v retrieving revision 1.567 diff -u -3 -p -u -r1.567 kmmainwin.cpp --- kmmainwin.cpp 26 Aug 2003 23:50:33 -0000 1.567 +++ kmmainwin.cpp 3 Sep 2003 12:25:44 -0000 @@ -192,7 +192,7 @@ bool KMMainWin::queryClose() { return true; } - if (config->readBoolEntry("warn-before-expire")) { + if (config->readBoolEntry("warn-before-expire", true)) { ret = KMessageBox::warningContinueCancel(KMainWindow::memberList->first(), str, i18n("Expire old Messages?"), i18n("Expire")); if (ret == KMessageBox::Continue) { --Boundary-00=_b5dV/wXRdON4qmM Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ KMail Developers mailing list kmail@mail.kde.org http://mail.kde.org/mailman/listinfo/kmail --Boundary-00=_b5dV/wXRdON4qmM--