Commit 3fa0a699 authored by Stefano Crocco's avatar Stefano Crocco Committed by David Faure
Browse files

Fix the location where adblock lists are saved

parent a5de0e7d
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
#include <QWebEngineSettings> #include <QWebEngineSettings>
#include <QFontDatabase> #include <QFontDatabase>
#include <QFileInfo> #include <QFileInfo>
#include <QDir>
QDataStream & operator<<(QDataStream& ds, const WebEngineSettings::WebFormInfo& info) QDataStream & operator<<(QDataStream& ds, const WebEngineSettings::WebFormInfo& info)
{ {
...@@ -335,7 +336,6 @@ void WebEngineSettings::init( KConfig * config, bool reset ) ...@@ -335,7 +336,6 @@ void WebEngineSettings::init( KConfig * config, bool reset )
} }
KConfigGroup cgFilter( config, "Filter Settings" ); KConfigGroup cgFilter( config, "Filter Settings" );
if ((reset || cgFilter.exists()) && (d->m_adFilterEnabled = cgFilter.readEntry("Enabled", false))) if ((reset || cgFilter.exists()) && (d->m_adFilterEnabled = cgFilter.readEntry("Enabled", false)))
{ {
d->m_hideAdsEnabled = cgFilter.readEntry("Shrink", false); d->m_hideAdsEnabled = cgFilter.readEntry("Shrink", false);
...@@ -374,7 +374,9 @@ void WebEngineSettings::init( KConfig * config, bool reset ) ...@@ -374,7 +374,9 @@ void WebEngineSettings::init( KConfig * config, bool reset )
if (filterEnabled && url.isValid()) { if (filterEnabled && url.isValid()) {
/** determine where to cache HTMLFilterList file */ /** determine where to cache HTMLFilterList file */
QString localFile = cgFilter.readEntry(QStringLiteral("HTMLFilterListLocalFilename-").append(QString::number(id))); QString localFile = cgFilter.readEntry(QStringLiteral("HTMLFilterListLocalFilename-").append(QString::number(id)));
localFile = QStandardPaths::locate(QStandardPaths::ConfigLocation, "khtml/", QStandardPaths::LocateDirectory) + localFile; QString dirName = QStandardPaths::writableLocation(QStandardPaths::CacheLocation);
QDir().mkpath(dirName);
localFile = dirName + '/' + localFile;
/** determine existence and age of cache file */ /** determine existence and age of cache file */
QFileInfo fileInfo(localFile); QFileInfo fileInfo(localFile);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment