Fix standardR2ThemesLocationPath

This commit is contained in:
Florian Märkl 2018-10-12 11:47:35 +02:00
parent a73492a718
commit d625681391

View File

@ -47,19 +47,11 @@ ColorSchemeFileSaver::ColorSchemeFileSaver(QObject *parent) : QObject (parent)
currDir.setPath("");
}
QStringList entry = currDir.entryList(QDir::Dirs | QDir::NoDotAndDotDot, QDir::Name);
standardR2ThemesLocationPath = currDir.absolutePath();
currDir.setPath("");
for (auto it : entry) {
it = standardR2ThemesLocationPath + QDir::separator() + it + QDir::separator() + "cons";
if (QDir(it).exists()) {
currDir = it;
break;
}
}
standardR2ThemesLocationPath = currDir.absolutePath();
if (standardR2ThemesLocationPath == "") {
currDir.setPath(QString(r_sys_prefix(nullptr)) + QString(R_SYS_DIR) + R2_THEMES);
if (currDir.exists()) {
standardR2ThemesLocationPath = currDir.absolutePath();
} else {
standardR2ThemesLocationPath = "";
QMessageBox mb;
mb.setIcon(QMessageBox::Critical);
mb.setStandardButtons(QMessageBox::Ok);