aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
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()));