From a6e6823da845ca14d37d8914c80185257e8c0e62 Mon Sep 17 00:00:00 2001 From: Aqua-sama Date: Mon, 2 Apr 2018 15:47:01 +0200 Subject: Refactoring TabBar - cleaned up code - moved to mainwindow/widgets - add Close tabs left/right to context menu --- src/webengine/webengineprofile.cpp | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) (limited to 'src/webengine/webengineprofile.cpp') diff --git a/src/webengine/webengineprofile.cpp b/src/webengine/webengineprofile.cpp index 263dcb5..55af9f2 100644 --- a/src/webengine/webengineprofile.cpp +++ b/src/webengine/webengineprofile.cpp @@ -51,25 +51,17 @@ QUrl WebEngineProfile::newtab() const return m_newtab; } -void WebEngineProfile::loadProfile(const QString &path) +void WebEngineProfile::loadProfile(QHash conf, const QString &path) { m_configPath = path; - // check if config file exists - if(!QFileInfo::exists(m_configPath)) { -#ifdef QT_DEBUG - qDebug("No config for profile '%s': %s", qUtf8Printable(m_name), qUtf8Printable(m_configPath)); -#endif - return; - } - #ifdef QT_DEBUG qDebug("Reading config for profile '%s': %s", qUtf8Printable(m_name), qUtf8Printable(m_configPath)); #endif QSettings config(m_configPath, QSettings::IniFormat); - m_homepage = config.value("homepage", m_homepage).toUrl(); - m_newtab = config.value("newtab", m_newtab).toUrl(); + m_homepage = config.value("homepage", conf["profile.homepage"]).toUrl(); + m_newtab = config.value("newtab", conf["profile.newtab"]).toUrl(); config.beginGroup("http"); setHttpUserAgent(config.value("userAgent", httpUserAgent()).toString()); @@ -84,7 +76,7 @@ void WebEngineProfile::loadProfile(const QString &path) setHttpCacheType(QWebEngineProfile::NoCache); } } - setHttpCacheMaximumSize(config.value("cacheSize").toInt()); + setHttpCacheMaximumSize(config.value("cacheSize", httpCacheMaximumSize()).toInt()); config.endGroup(); // http config.beginGroup("policy"); -- cgit v1.2.1