Skip to content

Commit

Permalink
Fix saving of debug configurations.
Browse files Browse the repository at this point in the history
  • Loading branch information
adeas31 committed Dec 11, 2015
1 parent 95d7513 commit 1abab71
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 20 deletions.
22 changes: 3 additions & 19 deletions OMEdit/OMEditGUI/Debugger/DebuggerMainWindow.cpp
Expand Up @@ -311,15 +311,6 @@ DebuggerConfigurationPage::DebuggerConfigurationPage(DebuggerConfiguration debug
setLayout(pMainLayout);
}

bool DebuggerConfigurationPage::isDirty()
{
return (mpNameTextBox->isModified()
|| mpProgramTextBox->isModified()
|| mpWorkingDirectoryTextBox->isModified()
|| mpGDBPathTextBox->isModified()
|| mpArgumentsTextBox->document()->isModified());
}

bool DebuggerConfigurationPage::configurationExists(QString configurationKeyToCheck)
{
QSettings *pSettings = OpenModelica::getApplicationSettings();
Expand Down Expand Up @@ -375,24 +366,17 @@ void DebuggerConfigurationPage::browseGDBPath()
*/
bool DebuggerConfigurationPage::saveDebugConfiguration()
{
if (!isDirty())
return true;

QSettings *pSettings = OpenModelica::getApplicationSettings();
pSettings->beginGroup("debuggerConfigurationList");
// remove the configuration setting if we have changed its name. But first check if there is no configuration with the new name.
if (mDebuggerConfiguration.name.compare(mpNameTextBox->text()) != 0)
{
if (configurationExists(mpNameTextBox->text()))
{
if (mDebuggerConfiguration.name.compare(mpNameTextBox->text()) != 0) {
if (configurationExists(mpNameTextBox->text())) {
QMessageBox::critical(this, QString(Helper::applicationName).append(" - ").append(Helper::error),
GUIMessages::getMessage(GUIMessages::DEBUG_CONFIGURATION_EXISTS_MSG).arg(mpNameTextBox->text())
.arg(mDebuggerConfiguration.name), Helper::ok);
pSettings->endGroup();
return false;
}
else
{
} else {
pSettings->remove(mDebuggerConfiguration.name);
}
}
Expand Down
1 change: 0 additions & 1 deletion OMEdit/OMEditGUI/Debugger/DebuggerMainWindow.h
Expand Up @@ -131,7 +131,6 @@ class DebuggerConfigurationPage : public QWidget
DebuggerConfigurationPage(DebuggerConfiguration debuggerConfiguration, QListWidgetItem *pListWidgetItem,
DebuggerConfigurationsDialog *pDebuggerConfigurationsDialog);
DebuggerConfiguration getDebuggerConfiguration() {return mDebuggerConfiguration;}
bool isDirty();
bool configurationExists(QString configurationKeyToCheck);
public slots:
void browseProgramFile();
Expand Down

0 comments on commit 1abab71

Please sign in to comment.