Skip to content

Commit

Permalink
syntax fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ctrlaltca committed Mar 24, 2024
1 parent 6f5ad1f commit a54359d
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 17 deletions.
28 changes: 14 additions & 14 deletions src/modules/dialog/libkvidialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,27 +68,27 @@ KviKvsCallbackMessageBox::KviKvsCallbackMessageBox(
setIcon(QMessageBox::NoIcon);
setModal(modal);

yesButton = nullptr;
noButton = nullptr;
cancelButton = nullptr;
m_pYesButton = nullptr;
m_pNoButton = nullptr;
m_pCancelButton = nullptr;
if(!szButton0.isEmpty())
{
yesButton = addButton(szButton0, QMessageBox::YesRole);
m_pYesButton = addButton(szButton0, QMessageBox::YesRole);
}
if(!szButton1.isEmpty())
{
noButton = addButton(szButton1, QMessageBox::NoRole);
setEscapeButton(noButton);
m_pNoButton = addButton(szButton1, QMessageBox::NoRole);
setEscapeButton(m_pNoButton);
}
if(!szButton2.isEmpty())
{
cancelButton = addButton(szButton2, QMessageBox::RejectRole);
setEscapeButton(cancelButton);
m_pCancelButton = addButton(szButton2, QMessageBox::RejectRole);
setEscapeButton(m_pCancelButton);
}

if(yesButton == nullptr && noButton == nullptr && cancelButton == nullptr)
if(m_pYesButton == nullptr && m_pNoButton == nullptr && m_pCancelButton == nullptr)
{
yesButton = addButton("Ok", QMessageBox::YesRole);
m_pYesButton = addButton("Ok", QMessageBox::YesRole);
}

g_pDialogModuleDialogList->append(this);
Expand Down Expand Up @@ -119,22 +119,22 @@ void KviKvsCallbackMessageBox::done(int code)

kvs_int_t iVal = 0;

if(clickedButton() == yesButton)
if(clickedButton() == m_pYesButton)
{
iVal = 0;
}
else if(clickedButton() == noButton)
else if(clickedButton() == m_pNoButton)
{
iVal = 1;
}
else if(clickedButton() == cancelButton)
else if(clickedButton() == m_pCancelButton)
{
iVal = 2;
}
else
{
// user closed the dialog, fake an "escape button" press
if(cancelButton != nullptr)
if(m_pCancelButton != nullptr)
iVal = 2;
else
iVal = 1;
Expand Down
6 changes: 3 additions & 3 deletions src/modules/dialog/libkvidialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ class KviKvsCallbackMessageBox : public QMessageBox, public KviKvsCallbackObject
~KviKvsCallbackMessageBox();

protected:
QPushButton * yesButton;
QPushButton * noButton;
QPushButton * cancelButton;
QPushButton * m_pYesButton;
QPushButton * m_pNoButton;
QPushButton * m_pCancelButton;
protected slots:
void done(int code) override;
};
Expand Down

0 comments on commit a54359d

Please sign in to comment.