diff options
author | Aqua-sama <aqua@iserlohn-fortress.net> | 2018-10-25 17:36:26 +0200 |
---|---|---|
committer | Aqua-sama <aqua@iserlohn-fortress.net> | 2018-10-25 17:36:26 +0200 |
commit | 689a94481d8b6a44119093b65814e0c0f3ad98b5 (patch) | |
tree | c967a0d8ae65b3a44fdeb2a859689abb5ab625d2 /src | |
parent | Add test/ meson.build (diff) | |
download | smolbote-689a94481d8b6a44119093b65814e0c0f3ad98b5.tar.xz |
Fix various build warnings
Diffstat (limited to 'src')
-rw-r--r-- | src/Kconfig | 82 | ||||
-rw-r--r-- | src/mainwindow/widgets/dockwidget.h | 2 | ||||
-rw-r--r-- | src/meson.build | 2 | ||||
-rw-r--r-- | src/webengine/filter.cpp | 27 |
4 files changed, 22 insertions, 91 deletions
diff --git a/src/Kconfig b/src/Kconfig deleted file mode 100644 index fcecdea..0000000 --- a/src/Kconfig +++ /dev/null @@ -1,82 +0,0 @@ -menu "Application" - config POI_NAME - string "Application name" - default "smolbote" - config POI_EXE - string "Executable name" - default "poi" - config POI_ICON - string "Path to icon" - default ":/icons/poi.svg" -endmenu - -menu "Configuration defaults" - config PATH_CONFIG - string "Configuration location" - default "~/.config/smolbote/smolbote.cfg" - config PATH_FILTER - string "Host filter path" - default "~/.config/smolbote/hosts.d" - config PATH_PLUGINS - string "Plugin load location" - default "~/.config/smolbote/plugins.d" - config PATH_PROFILES - string "Profile load location" - default "~/.config/smolbote/profiles.d" - config PATH_BOOKMARKS - string "Bookmarks location" - default "~/.config/smolbote/bookmarks.xbel" - config PATH_DOWNLOADS - string "Downloads location" - default "~/Downloads" -endmenu - -config USEPLASMA - bool "Enable KDE Frameworks integration" - default n - select SHOW_KDE_INTEGRATION - help - This is a help message - -menu "KDE Integration" - depends on USEPLASMA - - config PLASMA_BLUR - bool "Enable translucent background and blur behind window" - default n - - config WALLET_FOLDER - string "KDE Wallet folder name" - default "smolbote" -endmenu - -config USEBREAKPAD - bool "Enable Breakpad integration" - default n - -menu "Breakpad Integration" - depends on USEBREAKPAD - - config PATH_CRASHDUMP - string "Crash dump location" - default "~/.config/smolbote/crash.d" - - config PATH_CRASHHANDLER - string "Crash handler location" - default "" -endmenu - -menu "Workarounds" - config QTBUG_62511 - bool "Use RCC version 1 format" - default y - help - See QTBUG-62511: rcc embeds time in output - - config QTBUG_65223 - bool "Manually emit loadFinished" - default y - help - See QTBUG-65223: loadStarted is emitted twice when loading link with anchor - -endmenu diff --git a/src/mainwindow/widgets/dockwidget.h b/src/mainwindow/widgets/dockwidget.h index 99ae417..ed31ec3 100644 --- a/src/mainwindow/widgets/dockwidget.h +++ b/src/mainwindow/widgets/dockwidget.h @@ -13,6 +13,8 @@ class DockWidget : public QDockWidget { + Q_OBJECT + public: DockWidget(const QString &title, QWidget *parent = nullptr, Qt::WindowFlags flags = Qt::WindowFlags()); ~DockWidget(); diff --git a/src/meson.build b/src/meson.build index a977e8b..f99d0c7 100644 --- a/src/meson.build +++ b/src/meson.build @@ -1,6 +1,6 @@ # poi poi_moc = qt5.preprocess( - moc_headers: ['browser.h', 'session.h', + moc_headers: ['browser.h', 'mainwindow/mainwindow.h', 'mainwindow/widgets/dockwidget.h', 'mainwindow/widgets/navigationbar.h', 'mainwindow/widgets/searchform.h', 'subwindow/subwindow.h', 'subwindow/tabwidget.h', 'webengine/filter.h', 'webengine/urlinterceptor.h', 'webengine/webpage.h', 'webengine/webview.h'], diff --git a/src/webengine/filter.cpp b/src/webengine/filter.cpp index 9db61cb..216c84c 100644 --- a/src/webengine/filter.cpp +++ b/src/webengine/filter.cpp @@ -7,13 +7,13 @@ */ #include "filter.h" +#include "configuration.h" #include "urlinterceptor.h" +#include "util.h" #include <QDir> #include <QJsonArray> #include <QJsonDocument> #include <QTextStream> -#include "configuration.h" -#include "util.h" /* inline std::vector<FilterRule> parseAdBlockList(const QString &filename) @@ -36,7 +36,7 @@ inline std::vector<FilterRule> parseAdBlockList(const QString &filename) return rules; }*/ -Filter::Filter::Filter(const std::unique_ptr<Configuration> &config, QObject* parent) +Filter::Filter::Filter(const std::unique_ptr<Configuration> &config, QObject *parent) : QObject(parent) { // parse headers @@ -68,15 +68,26 @@ Filter::Filter::Filter(const std::unique_ptr<Configuration> &config, QObject* pa */ } -void Filter::filterRequest(QWebEngineUrlRequestInfo& info) const +void Filter::filterRequest(QWebEngineUrlRequestInfo &info) const { auto matches = filters.match(info.firstPartyUrl().toString(), info.requestUrl().toString()); for(const auto &rule : matches) { switch(rule->action()) { - case FilterLeaf::Block: - qDebug("block %s", qUtf8Printable(info.requestUrl().toString())); - info.block(true); - break; + case FilterLeaf::NotMatched: +#ifdef QT_DEBUG + qDebug("Paradoxical match: request matched, but not matched."); + qDebug(" - %s", qUtf8Printable(info.requestUrl().toString())); +#endif + break; + case FilterLeaf::Block: + //qDebug("block %s", qUtf8Printable(info.requestUrl().toString())); + info.block(true); + break; + case FilterLeaf::Allow: + info.block(false); + break; + //case FilterLeaf::Redirect: + // break; } } } |