From 4633d4648a048c16744117ac6d48098e47f6f214 Mon Sep 17 00:00:00 2001 From: Aqua-sama Date: Fri, 20 Nov 2020 16:25:20 +0200 Subject: Fix meson warnings Update about dialog --- lib/session_formats/meson.build | 2 +- meson.build | 3 +-- plugins/AdblockFilter/meson.build | 6 +++--- src/about/aboutdialog.cpp | 1 - src/applicationmenu.cpp | 6 +++++- src/browser.cpp | 7 ------- src/browser.h | 1 - src/main.cpp | 12 ++++-------- 8 files changed, 14 insertions(+), 24 deletions(-) diff --git a/lib/session_formats/meson.build b/lib/session_formats/meson.build index 8996db6..d5680cb 100644 --- a/lib/session_formats/meson.build +++ b/lib/session_formats/meson.build @@ -3,7 +3,7 @@ lib_session_formats = declare_dependency( link_with: static_library('sessionformats', [ 'session_json.cpp' ], include_directories: plugininterfaces_include, dependencies: dep_qt5) ) -test('session: json format', executable('session_json', +test('session-json format', executable('session_json', sources: 'test/json.cpp', dependencies: [ dep_qt5, dep_catch, lib_session_formats ] )) diff --git a/meson.build b/meson.build index 272cb60..82f2014 100644 --- a/meson.build +++ b/meson.build @@ -92,7 +92,6 @@ dep_qt5 = dependency('qt5', ) dep_spdlog = dependency('spdlog', fallback: ['spdlog', 'spdlog_dep'], version: '>=1.3.1') -dep_gtest = dependency('gtest', required: false, disabler: true) dep_catch = dependency('catch2', required: true, fallback: ['catch2', 'catch2_dep'] ) dep_SingleApplication = dependency('singleapplication', fallback: [ 'singleapplication', 'SingleApplication_dep' ]) @@ -129,7 +128,7 @@ poi_exe = executable(get_option('poi'), install: true, ) -test('poi-bookmarks: xbel', poi_exe, args: [ 'bookmarks', '-x', files('test/bookmarks.xbel'), '--export=stdout' ]) +test('poi-bookmarks_xbel', poi_exe, args: [ 'bookmarks', '-x', files('test/bookmarks.xbel'), '--export=stdout' ]) subdir(host_machine.system()) diff --git a/plugins/AdblockFilter/meson.build b/plugins/AdblockFilter/meson.build index 942f325..19d2509 100644 --- a/plugins/AdblockFilter/meson.build +++ b/plugins/AdblockFilter/meson.build @@ -21,17 +21,17 @@ dep_adblockfilter = declare_dependency( # install_dir: get_option('libdir')/'smolbote/plugins' #) -test('adblock: rule', executable('libadblockfilter_rule', +test('adblock_rule', executable('libadblockfilter_rule', sources: 'test/rule.cpp', dependencies: [ dep_qt5, dep_catch, dep_adblockfilter ] )) -test('adblock: options', executable('libadblockfilter_options', +test('adblock_options', executable('libadblockfilter_options', sources: 'test/options.cpp', dependencies: [ dep_qt5, dep_catch, dep_adblockfilter ] )) -test('adblock: filterlist', executable('libadblockfilter_filterlist', +test('adblock_filterlist', executable('libadblockfilter_filterlist', sources: 'test/filterlist.cpp', dependencies: [ dep_qt5, dep_catch, dep_adblockfilter ] )) diff --git a/src/about/aboutdialog.cpp b/src/about/aboutdialog.cpp index f42d551..059e3bf 100644 --- a/src/about/aboutdialog.cpp +++ b/src/about/aboutdialog.cpp @@ -58,7 +58,6 @@ AboutDialog::AboutDialog(QWidget *parent) "

Libraries:

")); } diff --git a/src/applicationmenu.cpp b/src/applicationmenu.cpp index dc888e7..112e790 100644 --- a/src/applicationmenu.cpp +++ b/src/applicationmenu.cpp @@ -7,6 +7,7 @@ */ #include "applicationmenu.h" +#include "aboutdialog.h" #include "browser.h" #include "configuration.h" #include "session/savesessiondialog.h" @@ -39,7 +40,10 @@ ApplicationMenu::ApplicationMenu(Browser *app, QWidget *parent) bottom_pluginSeparator = addSeparator(); - auto *actionAbout = addAction(tr("About"), app, &Browser::about); + auto *actionAbout = addAction(tr("About"), app, []() { + auto *dlg = new AboutDialog(qApp->activeWindow()); + dlg->show(); + }); conf.shortcut(*actionAbout, "shortcuts.window.about"); auto *action_aboutPlugins = addAction(tr("About Plugins"), app, &Browser::aboutPlugins); diff --git a/src/browser.cpp b/src/browser.cpp index 894216e..d225cbe 100644 --- a/src/browser.cpp +++ b/src/browser.cpp @@ -7,7 +7,6 @@ */ #include "browser.h" -#include "aboutdialog.h" #include "aboutplugin.h" #include "applicationmenu.h" #include "bookmarks/bookmarkswidget.h" @@ -55,12 +54,6 @@ Browser::~Browser() m_windows.clear(); } -void Browser::about() -{ - auto *dlg = new AboutDialog(activeWindow()); - dlg->show(); -} - void Browser::aboutPlugins() { auto *dlg = new AboutPluginDialog; diff --git a/src/browser.h b/src/browser.h index 8e443fe..740eec8 100644 --- a/src/browser.h +++ b/src/browser.h @@ -54,7 +54,6 @@ signals: void pluginAdded(QPluginLoader *); public slots: - [[deprecated]] void about(); [[deprecated]] void aboutPlugins(); [[deprecated]] void showWidget(QWidget *widget, MainWindow *where) const; diff --git a/src/main.cpp b/src/main.cpp index 88fa657..135d0ee 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -49,16 +49,12 @@ int main(int argc, char **argv) const auto f = command_line::process(app, subcommands, "session"); { + // load plugins Configuration conf; const auto plugins_path = conf.value("plugins.path").value(); - // load plugins - /*for(const QString &path : Util::files(conf.value("plugins.path").value(), { "*.so", "*.dll" })) { - if(app.loadPlugin(path)) { - spdlog::debug("Loaded plugin [{}]", qUtf8Printable(path)); - } else { - spdlog::warn("Failed loading plugin [{}]", qUtf8Printable(path)); - } - }*/ + for(const QString &path : Util::files(plugins_path, { "*.so", "*.dll" })) { + app.loadPlugin(path) ? spdlog::debug("Loaded plugin [{}]", qUtf8Printable(path)) : spdlog::warn("Failed loading plugin [{}]", qUtf8Printable(path)); + } } return f(app); -- cgit v1.2.1