GUI: Refactoring

This commit is contained in:
Daniel Marjamäki 2018-04-16 19:57:23 +02:00
parent d181e98d02
commit ebb3912396
1 changed files with 6 additions and 4 deletions

View File

@ -522,15 +522,17 @@ QString CheckThread::getAddonFilePath(const QString &dataDir, const QString &add
if (!dataDir.isEmpty()) {
foreach (const QString p, paths) {
if (QFileInfo(dataDir + p + addonFile).exists())
return dataDir + p + addonFile;
const QString filePath(dataDir + p + addonFile);
if (QFileInfo(filePath).exists())
return filePath;
}
}
const QString appPath = QApplication::applicationDirPath();
foreach (const QString p, paths) {
if (QFileInfo(appPath + p + addonFile).exists())
return appPath + p + addonFile;
const QString filePath(appPath + p + addonFile);
if (QFileInfo(filePath).exists())
return filePath;
}
return QString();