Skip to content

Commit

Permalink
Fixed memleak in Service::start vm and renamed stage Wizard to 'Initi…
Browse files Browse the repository at this point in the history
…al Setup'
  • Loading branch information
GermanAizek committed Aug 24, 2024
1 parent fbaf834 commit 195e889
Show file tree
Hide file tree
Showing 9 changed files with 16 additions and 13 deletions.
2 changes: 1 addition & 1 deletion resources/translations/English.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3609,7 +3609,7 @@ Do you want to show this message again?</source>
<name>First_Start_Wizard</name>
<message>
<location filename="First_Start_Wizard.ui" line="14"/>
<source>First Start Wizard</source>
<source>Initial Setup</source>
<translation type="unfinished"></translation>
</message>
<message>
Expand Down
2 changes: 1 addition & 1 deletion resources/translations/French.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3666,7 +3666,7 @@ Voulez-vous voir ce message la prochaine fois ?</translation>
<name>First_Start_Wizard</name>
<message>
<location filename="First_Start_Wizard.ui" line="14"/>
<source>First Start Wizard</source>
<source>Initial Setup</source>
<translation>Premier démarrage de l&apos;assistant</translation>
</message>
<message>
Expand Down
2 changes: 1 addition & 1 deletion resources/translations/German.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4087,7 +4087,7 @@ Push the &quot;Next&quot; button to go to next page or &quot;Back&quot; button t
</message>
<message>
<location filename="First_Start_Wizard.ui" line="14"/>
<source>First Start Wizard</source>
<source>Initial Setup</source>
<translation>Мастер первого запуска</translation>
</message>
<message>
Expand Down
2 changes: 1 addition & 1 deletion resources/translations/Russian.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4085,7 +4085,7 @@ Push the &quot;Next&quot; button to go to next page or &quot;Back&quot; button t
</message>
<message>
<location filename="First_Start_Wizard.ui" line="14"/>
<source>First Start Wizard</source>
<source>Initial Setup</source>
<translation>Мастер первого запуска</translation>
</message>
<message>
Expand Down
2 changes: 1 addition & 1 deletion resources/translations/Ukrainian.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3655,7 +3655,7 @@ Do you want to show this message again?</source>
<name>First_Start_Wizard</name>
<message>
<location filename="First_Start_Wizard.ui" line="14"/>
<source>First Start Wizard</source>
<source>Initial Setup</source>
<translation type="unfinished"></translation>
</message>
<message>
Expand Down
2 changes: 2 additions & 0 deletions src/First_Start_Wizard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,8 @@ void First_Start_Wizard::on_Button_Find_Emulators_clicked()
// Find QEMU
QList<Emulator> qemuEmulatorsList;

// TODO: Fix blank black screens in searching stage (if clicked on Search button)

for (int qx = 0; qx < paths.count(); ++qx) {
QMap<QString, QString> qemu_list =
System_Info::Find_QEMU_Binary_Files(paths[qx]);
Expand Down
2 changes: 1 addition & 1 deletion src/First_Start_Wizard.ui
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
</rect>
</property>
<property name="windowTitle">
<string>First Start Wizard</string>
<string>Initial Setup</string>
</property>
<property name="windowIcon">
<iconset resource="../resources/icons.qrc">
Expand Down
11 changes: 6 additions & 5 deletions src/Service.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -231,9 +231,9 @@ bool AQEMU_Service::init_service()
QString AQEMU_Service::start(const QString& s)
{
QSettings settings;
QString vm_dir = QDir::toNativeSeparators(
const auto& vm_dir = QDir::toNativeSeparators(
settings.value("VM_Directory", QDir::homePath() + "/.aqemu/").toString());
QString vm_file = vm_dir + s + ".aqemu";
const auto& vm_file = vm_dir + s + ".aqemu";

bool success = false;

Expand All @@ -246,9 +246,10 @@ QString AQEMU_Service::start(const QString& s)

if (QFileInfo(vm_file).exists())
vm->Load_VM(vm_file);
else
return QString("VM \"%1\" could not be started. No such VM found.")
.arg(s);
else {
delete vm;
return QString("VM \"%1\" could not be started. No such VM found.").arg(s);
}
}

if (vm->Start()) {
Expand Down
4 changes: 2 additions & 2 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -276,9 +276,9 @@ void AQEMU_Main::first_start_wizard()
First_Start_Wizard first_start_win(NULL);

if (first_start_win.exec() == QDialog::Accepted)
AQDebug("int main( int argc, char *argv[] )", "First Start Wizard Complete");
AQDebug("int main( int argc, char *argv[] )", "'Initial Setup' Complete");
else
AQWarning("int main( int argc, char *argv[] )", "First Start Wizard Canceled!");
AQWarning("int main( int argc, char *argv[] )", "'Initial Setup' Canceled!");
}
}

Expand Down

0 comments on commit 195e889

Please sign in to comment.