Some changes suggested by @Floessie

This commit is contained in:
Ingo Weyrich
2019-11-26 19:42:48 +01:00
parent 2a4891827d
commit 79431ffa1d
15 changed files with 44 additions and 45 deletions

View File

@@ -137,43 +137,47 @@ bool ExtProgStore::searchProgram (const Glib::ustring& name,
action.name = name;
action.target = (allowRaw ? 1 : 2);
auto& filePath = action.filePathEXE;
if (maxVer > 0) {
for (auto ver = maxVer; ver >= 0; ver--) {
auto filePath = progFilesDir + "\\" + Glib::ustring::compose(exePath, ver);
filePath = progFilesDir + "\\" + Glib::ustring::compose(exePath, ver);
if (Glib::file_test (filePath, Glib::FILE_TEST_EXISTS)) {
if (Glib::file_test(filePath, Glib::FILE_TEST_EXISTS)) {
break;
}
if (!exePath86.empty ()) {
if (!exePath86.empty()) {
filePath = progFilesDirx86 + "\\" + Glib::ustring::compose(exePath86, ver);
if (Glib::file_test (filePath, Glib::FILE_TEST_EXISTS)) {
if (Glib::file_test(filePath, Glib::FILE_TEST_EXISTS)) {
break;
}
}
filePath.clear();
}
} else {
do {
auto filePath = progFilesDir + "\\" + exePath;
filePath = progFilesDir + "\\" + exePath;
if (Glib::file_test (filePath, Glib::FILE_TEST_EXISTS)) {
if (Glib::file_test(filePath, Glib::FILE_TEST_EXISTS)) {
break;
}
if (!exePath86.empty ()) {
if (!exePath86.empty()) {
filePath = progFilesDirx86 + "\\" + exePath86;
if (Glib::file_test (filePath, Glib::FILE_TEST_EXISTS)) {
if (Glib::file_test(filePath, Glib::FILE_TEST_EXISTS)) {
break;
}
}
filePath.clear();
} while (false);
}