[PATCH] Fix KMessageBox::warningYesNoCancel message box creation

ismail donmez kde at myrealbox.com
Tue Jun 8 12:25:41 BST 2004


Hi,

While trying to fix a Konversation bug I think I found a bug in 
kmessagebox.cpp. 

Looking at kmessagebox.cpp line 349 function 
void KMessageBox::saveDontShowAgainYesNo(const QString &dontShowAgainName, 
ButtonCode result)

If a user chooses "Do not show again" option it writes "yes" to config dialog 
( according to code ) :
	config->writeEntry( dontShowAgainName, result==Yes ? "yes" : "no");

But at line 319 in function

bool KMessageBox::shouldBeShownYesNo(const QString &dontShowAgainName, 
ButtonCode &result)

it does 

    if (dontAsk == "yes") {
        result = Yes;
        return false;
    }
    if (dontAsk == "no") {
        result = No;
        return false;      <----- This looks wrong
    }

So even if user choose to show or not the show dialog again if there is a 
yes/no config entry dialog will not be shown.
My patch modifies that part to : 

    if (dontAsk == "yes") {
        result = Yes;
        return false;
    }
    else if (dontAsk == "no") {
        result = No;
        return true; 
    }

so if the config entry is set to "no" meaning dialog should be shown again. 
Should I apply the patch
or am I confused somewhere?

Regards,
/ismail 

-- 
Time is what you make of it.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: kmessagebox.patch
Type: text/x-diff
Size: 568 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20040608/bbbef549/attachment.patch>


More information about the kde-core-devel mailing list