Version: (using KDE KDE 3.4.1) OS: Linux To reproduce do - RMB click the dektop - choose "config desktop" - select "screensaver" - select a screensaver - click "advanced properties" at the right hand side - change "priority for screen saver" from low to high - click OK - click "advanced properties" at the right hand side ---> the priority is reset to "low"
Created an attachment (id=14171) [details] Solution to the problem related to the setting the priority of the screen saver The bug is in the KScreenSaverAdvancedDialog::slotPriority() function in the file kdebase/kcontrol/screensaver/advanceddialog.cpp. The value passed to the function slotPriority ( connected to the 'activated' signal of the qComboBox widget ) is zero based, insted the function assumes that it is 1-based. The patch correct this changing the value in the switch ( 1->0, 2->1, 3->2 ). Moreover the patch adds ability to set the correct value to the widget qcbPriority on the basis of config->readNumEntry("Priority", 19); Please apply Goffredo -- gpg key@ keyserver.linux.it: Goffredo Baroncelli (ghigo) <kreijack_AT_inwind.it> Key fingerprint = CE3C 7E01 6782 30A3 5B87 87C0 BB86 505C 6B2A CFF9
SVN commit 541662 by howells: Fix the completely broken priority setting. An off-by-one and a I-completely-forgot error. how embarassing. BUG: 114910 M +23 -3 advanceddialog.cpp --- branches/KDE/3.5/kdebase/kcontrol/screensaver/advanceddialog.cpp #541661:541662 @@ -6,6 +6,8 @@ #include <qwhatsthis.h> #include <qstring.h> +#include <config.h> + #include "advanceddialog.h" #include "advanceddialogimpl.h" #include "stdlib.h" @@ -52,6 +54,24 @@ dialog->qcbTopRight->setCurrentItem(config->readNumEntry("ActionTopRight", 0)); dialog->qcbBottomLeft->setCurrentItem(config->readNumEntry("ActionBottomLeft", 0)); dialog->qcbBottomRight->setCurrentItem(config->readNumEntry("ActionBottomRight", 0)); + + + switch(mPriority) + { + case 19: // Low + dialog->qcbPriority->setCurrentItem(0); + kdDebug() << "setting low" << endl; + break; + case 10: // Medium + dialog->qcbPriority->setCurrentItem(1); + kdDebug() << "setting medium" << endl; + break; + case 0: // High + dialog->qcbPriority->setCurrentItem(2); + kdDebug() << "setting high" << endl; + break; + } + mChanged = false; delete config; } @@ -60,15 +80,15 @@ { switch (val) { - case 1: // Low + case 0: // Low mPriority = 19; kdDebug() << "low priority" << endl; break; - case 2: // Medium + case 1: // Medium mPriority = 10; kdDebug() << "medium priority" << endl; break; - case 3: // High + case 2: // High mPriority = 0; kdDebug() << "high priority" << endl; break;
assign to right component
SVN commit 541690 by howells: forwardport r 541662 fix for bug 114910 CCBUG: 114910 M +22 -4 advanceddialog.cpp --- trunk/KDE/kdebase/workspace/kcontrol/screensaver/advanceddialog.cpp #541689:541690 @@ -5,9 +5,10 @@ #include <QPixmap> #include <kdebug.h> - #include <QString> +#include <config.h> + #include "advanceddialog.h" #include "advanceddialogimpl.h" #include "stdlib.h" @@ -54,6 +55,23 @@ dialog->qcbTopRight->setCurrentIndex(config->readEntry("ActionTopRight", 0)); dialog->qcbBottomLeft->setCurrentIndex(config->readEntry("ActionBottomLeft", 0)); dialog->qcbBottomRight->setCurrentIndex(config->readEntry("ActionBottomRight", 0)); + + switch(mPriority) + { + case 19: // Low + dialog->qcbPriority->setCurrentItem(0); + kdDebug() << "setting low" << endl; + break; + case 10: // Medium + dialog->qcbPriority->setCurrentItem(1); + kdDebug() << "setting medium" << endl; + break; + case 0: // High + dialog->qcbPriority->setCurrentItem(2); + kdDebug() << "setting high" << endl; + break; + } + mChanged = false; delete config; } @@ -62,15 +80,15 @@ { switch (val) { - case 1: // Low + case 0: // Low mPriority = 19; kDebug() << "low priority" << endl; break; - case 2: // Medium + case 1: // Medium mPriority = 10; kDebug() << "medium priority" << endl; break; - case 3: // High + case 2: // High mPriority = 0; kDebug() << "high priority" << endl; break;
You need to log in before you can comment on or make changes to this bug.