aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAqua-sama <aqua@iserlohn-fortress.net>2017-12-26 14:16:00 +0100
committerAqua-sama <aqua@iserlohn-fortress.net>2017-12-26 14:16:00 +0100
commit12e81eb57b0da49dbcd2f823dbf156ee24a802f2 (patch)
treebb15985f9d284a838adcdefd91a5861c78eed08d /src
parentUpdated pre-commit hook (diff)
downloadsmolbote-12e81eb57b0da49dbcd2f823dbf156ee24a802f2.tar.xz
SettingsDialog patches
- Added scrollbar, so items are now properly viewable on all sizes - Reset button now works - Editing values causes a crash - Filter path is now in filter.path instead of browser.filterPath
Diffstat (limited to 'src')
-rw-r--r--src/browser.cpp7
-rw-r--r--src/main.cpp4
2 files changed, 8 insertions, 3 deletions
diff --git a/src/browser.cpp b/src/browser.cpp
index 6305c0e..1d09951 100644
--- a/src/browser.cpp
+++ b/src/browser.cpp
@@ -26,7 +26,9 @@ Browser::Browser(int &argc, char *argv[]) :
Browser::~Browser()
{
- m_bookmarksManager->save();
+ if(m_bookmarksManager) {
+ m_bookmarksManager->save();
+ }
}
void Browser::setConfiguration(std::shared_ptr<Configuration> &config)
@@ -36,8 +38,7 @@ void Browser::setConfiguration(std::shared_ptr<Configuration> &config)
m_bookmarksManager = std::make_shared<BookmarksWidget>(QString::fromStdString(m_config->value<std::string>("bookmarks.path").value()));
m_downloadManager = std::make_shared<DownloadsWidget>(QString::fromStdString(m_config->value<std::string>("downloads.path").value()));
- // TODO: change path
- m_urlRequestInterceptor = std::make_shared<UrlRequestInterceptor>(QString::fromStdString(m_config->value<std::string>("browser.filterPath").value_or("")));
+ m_urlRequestInterceptor = std::make_shared<UrlRequestInterceptor>(QString::fromStdString(m_config->value<std::string>("filter.path").value()));
// set default profile
m_defaultProfile = profile(QString::fromStdString(m_config->value<std::string>("browser.profile").value()));
diff --git a/src/main.cpp b/src/main.cpp
index 3483da7..23dfa68 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -40,6 +40,10 @@ bool writeUserConfig(const std::string &path, Configuration &config)
// The .path's need to be overriden because ~ doesn't translate to home
const QString &home = QStandardPaths::writableLocation(QStandardPaths::HomeLocation);
+ // filter.path
+ std::string filterPath = config.value<std::string>("filter.path").value();
+ config.setValue<std::string>("filter.path", patchHome(filterPath, home.toStdString()));
+
// profile.path
std::string profilePath = config.value<std::string>("profile.path").value();
config.setValue<std::string>("profile.path", patchHome(profilePath, home.toStdString()));