aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAqua-sama <aqua@iserlohn-fortress.net>2018-03-21 13:29:41 +0100
committerAqua-sama <aqua@iserlohn-fortress.net>2018-03-21 13:29:41 +0100
commitbb5574831aef42b2f81979c1df8f706d3956bdca (patch)
tree7ad31ba13d86e4501631391a70698e146848e268 /src
parentUpdate manpage (diff)
downloadsmolbote-bb5574831aef42b2f81979c1df8f706d3956bdca.tar.xz
poi-config saving config
Diffstat (limited to 'src')
-rw-r--r--src/commandline.cpp16
1 files changed, 2 insertions, 14 deletions
diff --git a/src/commandline.cpp b/src/commandline.cpp
index 2a0de69..6f227c0 100644
--- a/src/commandline.cpp
+++ b/src/commandline.cpp
@@ -8,7 +8,7 @@
#include "commandline.h"
#include "version.h"
-#include <QStandardPaths>
+#include <configuration.h>
#include <iomanip>
#include <iostream>
@@ -21,18 +21,6 @@ void printOption(const QCommandLineOption &option)
<< std::endl;
}
-QString defaultUserConfigLocation()
-{
- // try to locate an existing config
- QString path = QStandardPaths::locate(QStandardPaths::AppConfigLocation, "smolbote.cfg");
-
- // it's possible there is no config, so set the path properly
- if(path.isEmpty())
- path = QStandardPaths::writableLocation(QStandardPaths::AppConfigLocation) + "/smolbote.cfg";
-
- return path;
-}
-
constexpr const char *socketPath()
{
#ifdef Q_OS_UNIX
@@ -49,7 +37,7 @@ CommandLine::CommandLine()
, helpOption(addHelpOption())
, versionOption(addVersionOption())
, buildOption("build", "Show build information.")
- , configOption({ "c", "config" }, "Set configuration file.", "path", defaultUserConfigLocation())
+ , configOption({ "c", "config" }, "Set configuration file.", "path", Configuration::defaultUserConfigLocation())
, profileOption({ "p", "profile" }, "Use this profile.", "profile", "")
, socketOption("socket", "Local server socket", "name", socketPath())
, newWindowOption("in-new-window", "Open URL in new window")