aboutsummaryrefslogtreecommitdiff
path: root/src/browser.cpp
diff options
context:
space:
mode:
authorAqua-sama <aqua@iserlohn-fortress.net>2017-09-10 18:21:25 +0200
committerAqua-sama <aqua@iserlohn-fortress.net>2017-09-10 18:21:25 +0200
commit10a7765c7b6a1d62cb9ca2406145fd3799f5197c (patch)
tree5e73db926c878412593708624b0caf2bffadccfe /src/browser.cpp
parentSplit off Bookmarks into static lib (diff)
downloadsmolbote-10a7765c7b6a1d62cb9ca2406145fd3799f5197c.tar.xz
Config should now automatically update when changed
Diffstat (limited to 'src/browser.cpp')
-rw-r--r--src/browser.cpp35
1 files changed, 15 insertions, 20 deletions
diff --git a/src/browser.cpp b/src/browser.cpp
index 8db1980..60cdb03 100644
--- a/src/browser.cpp
+++ b/src/browser.cpp
@@ -39,13 +39,6 @@ Browser::Browser(int &argc, char *argv[]) :
m_blocklistManager = nullptr;
m_plugin = nullptr;
-
- setApplicationName("smolbote");
-#ifdef GIT_VERSION
- setApplicationVersion(GIT_VERSION);
-#else
- setApplicationVersion("1.0.0");
-#endif
}
Browser::~Browser()
@@ -160,10 +153,24 @@ BlockerManager *Browser::blocklists()
return m_blocklistManager;
}
-void Browser::setConfigPath(const QString &path)
+void Browser::loadSettings(const QString &path)
{
QString configLocation, defaultsLocation;
+ // set custom config path if any
+ if(!path.isEmpty()) {
+ configLocation = path;
+
+ } else {
+ // no custom config has been set
+ // check if config file exists for this user
+ QString cpath = QStandardPaths::writableLocation(QStandardPaths::AppConfigLocation) + "/poi.conf";
+ if(QFile::exists(cpath)) {
+ configLocation = cpath;
+ }
+ // else there is no user overrides
+ }
+
// set defaults location
// check system-specific locations
#ifdef Q_OS_LINUX
@@ -179,18 +186,6 @@ void Browser::setConfigPath(const QString &path)
defaultsLocation = ":/poi.toml";
}
- // set custom config path if any
- if(!path.isEmpty()) {
- configLocation = path;
-
- } else {
- // check if config file exists for this user
- QString cpath = QStandardPaths::writableLocation(QStandardPaths::AppConfigLocation) + "/poi.conf";
- if(QFile::exists(cpath)) {
- configLocation = cpath;
- }
- }
-
m_settings = new Settings(configLocation, defaultsLocation);
#ifdef QT_DEBUG