Browse Source

Fix various build warnings

Aqua-sama 1 month ago
parent
commit
689a94481d
Signed by: Aqua-sama <aqua@iserlohn-fortress.net> GPG Key ID: 5378B8349C1D5ADA

+ 65
- 20
Kconfig View File

@@ -1,28 +1,73 @@
1
-mainmenu "smolbote configuration"
1
+menu "Application"
2
+    config POI_NAME
3
+        string "Application name"
4
+        default "smolbote"
5
+    config POI_ICON
6
+        string "Path to icon"
7
+        default ":/icons/poi.svg"
8
+endmenu
9
+
10
+menu "Configuration defaults"
11
+    config PATH_CONFIG
12
+        string "Configuration location"
13
+        default "~/.config/smolbote/smolbote.cfg"
14
+    config PATH_FILTER
15
+        string "Host filter path"
16
+        default "~/.config/smolbote/hosts.d"
17
+    config PATH_PLUGINS
18
+        string "Plugin load location"
19
+        default "~/.config/smolbote/plugins.d"
20
+    config PATH_PROFILES
21
+        string "Profile load location"
22
+        default "~/.config/smolbote/profiles.d"
23
+    config PATH_BOOKMARKS
24
+        string "Bookmarks location"
25
+        default "~/.config/smolbote/bookmarks.xbel"
26
+    config PATH_DOWNLOADS
27
+        string "Downloads location"
28
+        default "~/Downloads"
29
+endmenu
30
+
31
+config USEPLASMA
32
+    bool "Enable KDE Frameworks integration"
33
+    default n
34
+    select SHOW_KDE_INTEGRATION
35
+    help
36
+        This is a help message
2 37
 
3
-comment "Build system settings"
4
-menu "Install paths"
5
-    config INSTALL_BINDIR
6
-        string "User executables"
7
-        default "bin"
38
+menu "KDE Integration"
39
+    depends on USEPLASMA
8 40
 
9
-    config INSTALL_LIBDIR
10
-        string "Object code libraries"
11
-        default "lib64"
41
+    config PLASMA_BLUR
42
+        bool "Enable translucent background and blur behind window"
43
+        default n
12 44
 
13
-    config INSTALL_PLUGINDIR
14
-        string "Plugins"
15
-        default "lib64/plugins"
45
+    config WALLET_FOLDER
46
+        string "KDE Wallet folder name"
47
+        default "smolbote"
48
+endmenu
49
+
50
+config USEBREAKPAD
51
+    bool "Enable Breakpad integration"
52
+    default n
16 53
 
17
-    config INSTALL_APPDIR
18
-        string "Application .desktop file"
19
-        default "usr/share/applications"
54
+menu "Breakpad Integration"
55
+    depends on USEBREAKPAD
20 56
 
21
-    config INSTALL_ICONDIR
22
-        string "Icons"
23
-        default "usr/share/icons"
57
+    config PATH_CRASHDUMP
58
+        string "Crash dump location"
59
+        default "~/.config/smolbote/crash.d"
24 60
 
61
+    config PATH_CRASHHANDLER
62
+        string "Crash handler location"
63
+        default ""
25 64
 endmenu
26 65
 
27
-comment "Application Settings"
28
-rsource src/Kconfig
66
+menu "Workarounds"
67
+    config QTBUG_65223
68
+        bool "Manually emit loadFinished"
69
+        default y
70
+        help
71
+            See QTBUG-65223: loadStarted is emitted twice when loading link with anchor
72
+
73
+endmenu

+ 2
- 0
include/browserinterface.h View File

@@ -12,6 +12,8 @@ class Profile;
12 12
 class BrowserInterface
13 13
 {
14 14
 public:
15
+    virtual ~BrowserInterface() = default;
16
+
15 17
     // configuration access
16 18
     virtual const QStringList configurationOptions() const = 0;
17 19
     virtual const QString configuration(const QString &key) const = 0;

+ 1
- 1
lib/bookmarks/xbel.h View File

@@ -15,6 +15,6 @@ namespace Xbel
15 15
 {
16 16
 void read(QIODevice *device, BookmarkItem *model);
17 17
 void write(QIODevice *device, const BookmarkItem *item);
18
-};
18
+}
19 19
 
20 20
 #endif // XBEL_H

+ 1
- 0
lib/downloads/widgets/elidedlabel.h View File

@@ -13,6 +13,7 @@
13 13
 
14 14
 class ElidedLabel : public QLabel
15 15
 {
16
+    Q_OBJECT
16 17
 
17 18
 public:
18 19
     explicit ElidedLabel(QWidget *parent = nullptr);

+ 1
- 1
lib/urlfilter/filterleaf.h View File

@@ -36,7 +36,7 @@ public:
36 36
 
37 37
     FilterLeaf(FilterLeaf &&other);
38 38
     FilterLeaf &operator=(FilterLeaf &&other);
39
-    ~FilterLeaf() = default;
39
+    virtual ~FilterLeaf() = default;
40 40
 
41 41
     virtual bool match(const QUrl &requestUrl) const = 0;
42 42
     virtual Action action() const = 0;

+ 1
- 1
lib/urlfilter/meson.build View File

@@ -1,7 +1,7 @@
1 1
 urlfilter_inc = include_directories('.')
2 2
 
3 3
 urlfilter_moc = qt5.preprocess(
4
-    moc_headers: ['filtertree.h', 'filterleaf.h', 'formats/adblockrule.h', 'formats/hostlistrule.h'],
4
+    moc_headers: 'filtertree.h',
5 5
     dependencies: dep_qt5
6 6
 )
7 7
 

+ 2
- 2
meson.build View File

@@ -41,7 +41,7 @@ dep_genheaders = declare_dependency(
41 41
         output: 'version.h'
42 42
     ),
43 43
     custom_target('configheader',
44
-        input: ['tools/config.py', 'src/Kconfig', host_machine.system() + '/.config'],
44
+        input: ['tools/config.py', 'Kconfig', host_machine.system() + '/.config'],
45 45
         output: 'config.h',
46 46
         command: [python3, '@INPUT0@', '--kconfig=@INPUT1@', '--dotconfig=@INPUT2@', '--generate=@OUTPUT@'],
47 47
         build_by_default: true
@@ -49,7 +49,7 @@ dep_genheaders = declare_dependency(
49 49
 )
50 50
 
51 51
 interfaces_moc = qt5.preprocess(
52
-    moc_headers: ['include/browserinterface.h', 'include/plugininterface.h', 'include/profileinterface.h'],
52
+    moc_headers: 'include/profileinterface.h',
53 53
     dependencies: dep_qt5
54 54
 )
55 55
 

+ 0
- 82
src/Kconfig View File

@@ -1,82 +0,0 @@
1
-menu "Application"
2
-    config POI_NAME
3
-        string "Application name"
4
-        default "smolbote"
5
-    config POI_EXE
6
-        string "Executable name"
7
-        default "poi"
8
-    config POI_ICON
9
-        string "Path to icon"
10
-        default ":/icons/poi.svg"
11
-endmenu
12
-
13
-menu "Configuration defaults"
14
-    config PATH_CONFIG
15
-        string "Configuration location"
16
-        default "~/.config/smolbote/smolbote.cfg"
17
-    config PATH_FILTER
18
-        string "Host filter path"
19
-        default "~/.config/smolbote/hosts.d"
20
-    config PATH_PLUGINS
21
-        string "Plugin load location"
22
-        default "~/.config/smolbote/plugins.d"
23
-    config PATH_PROFILES
24
-        string "Profile load location"
25
-        default "~/.config/smolbote/profiles.d"
26
-    config PATH_BOOKMARKS
27
-        string "Bookmarks location"
28
-        default "~/.config/smolbote/bookmarks.xbel"
29
-    config PATH_DOWNLOADS
30
-        string "Downloads location"
31
-        default "~/Downloads"
32
-endmenu
33
-
34
-config USEPLASMA
35
-    bool "Enable KDE Frameworks integration"
36
-    default n
37
-    select SHOW_KDE_INTEGRATION
38
-    help
39
-        This is a help message
40
-
41
-menu "KDE Integration"
42
-    depends on USEPLASMA
43
-
44
-    config PLASMA_BLUR
45
-        bool "Enable translucent background and blur behind window"
46
-        default n
47
-
48
-    config WALLET_FOLDER
49
-        string "KDE Wallet folder name"
50
-        default "smolbote"
51
-endmenu
52
-
53
-config USEBREAKPAD
54
-    bool "Enable Breakpad integration"
55
-    default n
56
-
57
-menu "Breakpad Integration"
58
-    depends on USEBREAKPAD
59
-
60
-    config PATH_CRASHDUMP
61
-        string "Crash dump location"
62
-        default "~/.config/smolbote/crash.d"
63
-
64
-    config PATH_CRASHHANDLER
65
-        string "Crash handler location"
66
-        default ""
67
-endmenu
68
-
69
-menu "Workarounds"
70
-    config QTBUG_62511
71
-        bool "Use RCC version 1 format"
72
-        default y
73
-        help
74
-            See QTBUG-62511: rcc embeds time in output
75
-
76
-    config QTBUG_65223
77
-        bool "Manually emit loadFinished"
78
-        default y
79
-        help
80
-            See QTBUG-65223: loadStarted is emitted twice when loading link with anchor
81
-
82
-endmenu

+ 2
- 0
src/mainwindow/widgets/dockwidget.h View File

@@ -13,6 +13,8 @@
13 13
 
14 14
 class DockWidget : public QDockWidget
15 15
 {
16
+    Q_OBJECT
17
+
16 18
 public:
17 19
     DockWidget(const QString &title, QWidget *parent = nullptr, Qt::WindowFlags flags = Qt::WindowFlags());
18 20
     ~DockWidget();

+ 1
- 1
src/meson.build View File

@@ -1,6 +1,6 @@
1 1
 # poi
2 2
 poi_moc = qt5.preprocess(
3
-    moc_headers: ['browser.h', 'session.h', 
3
+    moc_headers: ['browser.h',
4 4
         'mainwindow/mainwindow.h', 'mainwindow/widgets/dockwidget.h', 'mainwindow/widgets/navigationbar.h', 'mainwindow/widgets/searchform.h', 
5 5
         'subwindow/subwindow.h', 'subwindow/tabwidget.h', 
6 6
         'webengine/filter.h', 'webengine/urlinterceptor.h', 'webengine/webpage.h', 'webengine/webview.h'],

+ 19
- 8
src/webengine/filter.cpp View File

@@ -7,13 +7,13 @@
7 7
  */
8 8
 
9 9
 #include "filter.h"
10
+#include "configuration.h"
10 11
 #include "urlinterceptor.h"
12
+#include "util.h"
11 13
 #include <QDir>
12 14
 #include <QJsonArray>
13 15
 #include <QJsonDocument>
14 16
 #include <QTextStream>
15
-#include "configuration.h"
16
-#include "util.h"
17 17
 
18 18
 /*
19 19
 inline std::vector<FilterRule> parseAdBlockList(const QString &filename)
@@ -36,7 +36,7 @@ inline std::vector<FilterRule> parseAdBlockList(const QString &filename)
36 36
     return rules;
37 37
 }*/
38 38
 
39
-Filter::Filter::Filter(const std::unique_ptr<Configuration> &config, QObject* parent)
39
+Filter::Filter::Filter(const std::unique_ptr<Configuration> &config, QObject *parent)
40 40
     : QObject(parent)
41 41
 {
42 42
     // parse headers
@@ -68,15 +68,26 @@ Filter::Filter::Filter(const std::unique_ptr<Configuration> &config, QObject* pa
68 68
     */
69 69
 }
70 70
 
71
-void Filter::filterRequest(QWebEngineUrlRequestInfo& info) const
71
+void Filter::filterRequest(QWebEngineUrlRequestInfo &info) const
72 72
 {
73 73
     auto matches = filters.match(info.firstPartyUrl().toString(), info.requestUrl().toString());
74 74
     for(const auto &rule : matches) {
75 75
         switch(rule->action()) {
76
-            case FilterLeaf::Block:
77
-                qDebug("block %s", qUtf8Printable(info.requestUrl().toString()));
78
-                info.block(true);
79
-                break;
76
+        case FilterLeaf::NotMatched:
77
+#ifdef QT_DEBUG
78
+            qDebug("Paradoxical match: request matched, but not matched.");
79
+            qDebug(" - %s", qUtf8Printable(info.requestUrl().toString()));
80
+#endif
81
+            break;
82
+        case FilterLeaf::Block:
83
+            //qDebug("block %s", qUtf8Printable(info.requestUrl().toString()));
84
+            info.block(true);
85
+            break;
86
+        case FilterLeaf::Allow:
87
+            info.block(false);
88
+            break;
89
+        //case FilterLeaf::Redirect:
90
+        //    break;
80 91
         }
81 92
     }
82 93
 }

Loading…
Cancel
Save