Skip to content

Commit

Permalink
Initialize default values for install path and command line.
Browse files Browse the repository at this point in the history
  • Loading branch information
DolceTriade committed Jun 4, 2017
1 parent 2f5450c commit 655e7f3
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
12 changes: 12 additions & 0 deletions settings.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,16 @@
#include "settings.h"
#include "system.h"

const char kDefaultCommand[] = "%command%";

Settings::Settings() : QObject(nullptr) {
if (!settings_.contains(Settings::INSTALL_PATH)) {
setInstallPath(Sys::defaultInstallPath());
}
if (!settings_.contains(Settings::COMMAND_LINE)) {
setCommandLine(kDefaultCommand);
}
}

QString Settings::installPath() const {
return settings_.value(Settings::INSTALL_PATH).toString();
Expand Down
2 changes: 2 additions & 0 deletions settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ class Settings : public QObject
const QString CURRENT_VERSION = "settings/currentVersion";
const QString INSTALL_FINISHED = "settings/installFinished";

Settings();

QString installPath() const;
QString commandLine() const;
QString currentVersion() const;
Expand Down

0 comments on commit 655e7f3

Please sign in to comment.