Fixed a bug: the edit dialog fields were not cleared if an
[emufront] / src / dialogs / executableeditdialog.cpp
index b878a97..04d1f3e 100644 (file)
@@ -138,6 +138,7 @@ void ExecutableEditDialog::setDataObject(EmuFrontObject *ob)
         qDebug("No executable");
         return;
     }
+    clear();
     if (!ex->getSetup()) {
         qDebug() << "No setup";
         return;
@@ -149,6 +150,14 @@ void ExecutableEditDialog::setDataObject(EmuFrontObject *ob)
     optEdit->setText(ex->getOptions());
 }
 
+void ExecutableEditDialog::clear()
+{
+    nameEdit->clear();
+    execEdit->clear();
+    optEdit->clear();
+    setupComBox->setCurrentIndex(-1);
+}
+
 void ExecutableEditDialog::setSelectedSetup(const Setup *su)
 {
     setupComBox->setSelected(su);