Commit ab710efe authored by Marius Pa's avatar Marius Pa Committed by Albert Astals Cid
Browse files

kgrdialog.cpp variable was assigned the same value

Fix PVS-Studio issue "src/kgrdialog.cpp:355: warning: V1048 The 'ans' variable was assigned the same value.".
parent 169b248b
Pipeline #211262 passed with stage
in 1 minute
......@@ -339,24 +339,24 @@ int KGrMessage::warning (QWidget * parent, const QString &caption,
const QString &label1, const QString &label2)
{
// KDE does word-wrapping and will observe "\n" line-breaks.
int ans = 0;
int result = 0;
if (label2.isEmpty()) {
// Display a box with 2 buttons.
ans = KMessageBox::questionYesNo (parent, text, caption,
KMessageBox::ButtonCode ans = KMessageBox::questionYesNo (parent, text, caption,
KGuiItem (label0), KGuiItem (label1));
ans = (ans == KMessageBox::Yes) ? 0 : 1;
result = (ans == KMessageBox::Yes) ? 0 : 1;
}
else {
// Display a box with 3 buttons.
ans = KMessageBox::questionYesNoCancel (parent, text, caption,
KMessageBox::ButtonCode ans = KMessageBox::questionYesNoCancel (parent, text, caption,
KGuiItem (label0), KGuiItem (label1),
KGuiItem (label2));
if (ans == KMessageBox::Cancel)
ans = 2;
result = 2;
else
ans = (ans == KMessageBox::Yes) ? 0 : 1;
result = (ans == KMessageBox::Yes) ? 0 : 1;
}
return (ans);
return (result);
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment