Skip to content

Commit

Permalink
hard path not to config
Browse files Browse the repository at this point in the history
Signed-off-by: Martin Ribelotta <[email protected]>
  • Loading branch information
martinribelotta committed Jul 30, 2017
1 parent d6fb2cb commit 0e90c49
Show file tree
Hide file tree
Showing 2 changed files with 69 additions and 8 deletions.
69 changes: 64 additions & 5 deletions images/document-close.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 5 additions & 3 deletions main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,20 +59,22 @@ int main(int argc, char *argv[])
<< tr.load(QLocale::system().name(), ":/i18n");
a.installTranslator(&tr);

AppConfig::mutableInstance().load();
AppConfig::mutableInstance().adjustPath();
QFile hardConfFile(QDir(QApplication::applicationDirPath()).absoluteFilePath(HARD_CONF_PATH));
if (hardConfFile.open(QFile::ReadOnly)) {
AppConfig::mutableInstance().load();
auto hardConf = QJsonDocument::fromJson(hardConfFile.readAll()).object();
QStringList additionalPaths;
for (auto p: hardConf.value("additionalPaths").toArray())
additionalPaths.append(AppConfig::mutableInstance().filterTextWithVariables(p.toString()));
AppConfig::mutableInstance().setBuildAdditionalPaths(additionalPaths);
additionalPaths.append(QDir::cleanPath(AppConfig::mutableInstance()
.filterTextWithVariables(p.toString())));
AppConfig::mutableInstance().adjustPath(additionalPaths);
AppConfig::mutableInstance().setBuildTemplateUrl(hardConf.value("templateUrl").toString());
AppConfig::mutableInstance().save();
}

AppConfig::mutableInstance().load();
AppConfig::mutableInstance().adjustPath();

QDir projectDir = AppConfig::mutableInstance().buildDefaultProjectPath();
QDir wSpace(QDir::cleanPath(projectDir.absoluteFilePath("..")));
Expand Down

0 comments on commit 0e90c49

Please sign in to comment.