[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [kdepim-addons/Applications/17.08] plugins/webengineurlinterceptor/adblock/lib/widgets: Create
From:       Wolfgang Bauer <null () kde ! org>
Date:       2017-07-30 9:03:01
Message-ID: E1dbk7p-0003N7-2b () code ! kde ! org
[Download RAW message or body]

Git commit 45191cfc8875ba4433ea6f35cbe85db89e703a67 by Wolfgang Bauer.
Committed on 30/07/2017 at 08:57.
Pushed by wbauer into branch 'Applications/17.08'.

Create ~/.local/share/adblock/ if it doesn't exist

Otherwise saving manual filters will fail, which will also result in the
general settings (Enable Ad Block, Hide filtered elements, Update
interval) not getting written at all.

Differential Revision: https://phabricator.kde.org/D6980

M  +4    -0    plugins/webengineurlinterceptor/adblock/lib/widgets/adblocksettingwidget.cpp


https://commits.kde.org/kdepim-addons/45191cfc8875ba4433ea6f35cbe85db89e703a67

diff --git a/plugins/webengineurlinterceptor/adblock/lib/widgets/adblocksettingwidget.cpp \
b/plugins/webengineurlinterceptor/adblock/lib/widgets/adblocksettingwidget.cpp index \
                3e9abf24..8e90aaed 100644
--- a/plugins/webengineurlinterceptor/adblock/lib/widgets/adblocksettingwidget.cpp
+++ b/plugins/webengineurlinterceptor/adblock/lib/widgets/adblocksettingwidget.cpp
@@ -57,6 +57,7 @@ using namespace PimCommon::ConfigureImmutableWidgetUtils;
 #include <QTextStream>
 #include <QStandardPaths>
 #include <QRegularExpression>
+#include <QDir>
 #include <KRun>
 
 using namespace AdBlock;
@@ -289,6 +290,9 @@ void AdBlockSettingWidget::save()
         config.deleteGroup(group);
     }
 
+    // make sure the directory exists, otherwise saving the filters will fail
+    QDir().mkpath(QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) \
+ QStringLiteral("/adblock")); +
     const int numberItem(mUi->automaticFiltersListWidget->count());
     for (int i = 0; i < numberItem; ++i) {
         QListWidgetItem *subItem = mUi->automaticFiltersListWidget->item(i);


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic