From bb5574831aef42b2f81979c1df8f706d3956bdca Mon Sep 17 00:00:00 2001 From: Aqua-sama Date: Wed, 21 Mar 2018 13:29:41 +0100 Subject: poi-config saving config --- src/commandline.cpp | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) (limited to 'src') 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 +#include #include #include @@ -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") -- cgit v1.2.1