From 0492a063806b6d63e4f378908b809de104a24820 Mon Sep 17 00:00:00 2001 From: Aqua-sama Date: Sat, 25 Apr 2020 22:09:13 +0300 Subject: Update ProfileEditor plugin ProfileEditor: - add tests - disable read-only settings on otr profiles Add WebProfile::setHeaders and WebProfile::setCookies --- src/about/aboutdialog.ui | 5 -- src/about/aboutplugin.cpp | 60 ++------------- src/about/aboutplugin.h | 3 + src/about/aboutplugin.ui | 53 +++++++------ src/applicationmenu.cpp | 18 ++++- src/applicationmenu.h | 1 + src/browser.cpp | 58 ++++----------- src/browser.h | 9 ++- src/main.cpp | 14 ++-- src/webengine/meson.build | 2 +- src/webengine/test/profile.cpp | 145 ++++++++++++++++++------------------ src/webengine/webprofile.cpp | 18 +++-- src/webengine/webprofile.h | 62 ++++++++++++--- src/webengine/webprofilemanager.cpp | 4 +- src/webengine/webprofilemanager.h | 2 +- 15 files changed, 226 insertions(+), 228 deletions(-) (limited to 'src') diff --git a/src/about/aboutdialog.ui b/src/about/aboutdialog.ui index 5b1c12a..036474c 100644 --- a/src/about/aboutdialog.ui +++ b/src/about/aboutdialog.ui @@ -134,11 +134,6 @@ - - - Plugins - - diff --git a/src/about/aboutplugin.cpp b/src/about/aboutplugin.cpp index 92e55bb..a011b47 100644 --- a/src/about/aboutplugin.cpp +++ b/src/about/aboutplugin.cpp @@ -12,57 +12,12 @@ #include #include -QTreeWidgetItem *createItem(const QString &key, const QJsonValue &json, QTreeWidgetItem *parent) -{ - auto *item = new QTreeWidgetItem(parent, { key, QLatin1String("---") }); - - switch(json.type()) { - case QJsonValue::Bool: - item->setText(1, json.toBool() ? QLatin1String("true") : QLatin1String("false")); - break; - - case QJsonValue::Double: - item->setText(1, QString::number(json.toDouble())); - break; - - case QJsonValue::String: - item->setText(1, json.toString()); - break; - - case QJsonValue::Array: - item->setText(1, QString()); - for(const auto &v : json.toArray()) { - createItem(QString(), v, item); - } - break; - - case QJsonValue::Object: - item->setText(1, QString()); - for(const QString &k : json.toObject().keys()) { - createItem(k, json.toObject()[k], item); - } - break; - - case QJsonValue::Null: - item->setText(1, QLatin1String("null")); - break; - - case QJsonValue::Undefined: - item->setText(1, QLatin1String("undefined")); - break; - } - - return item; -} - AboutPluginDialog::AboutPluginDialog(QWidget *parent) : QDialog(parent) , ui(new Ui::AboutPluginDialog) { setAttribute(Qt::WA_DeleteOnClose, true); ui->setupUi(this); - - } AboutPluginDialog::~AboutPluginDialog() @@ -85,20 +40,17 @@ void AboutPluginDialog::add(QPluginLoader *loader) auto *enable_btn = new QToolButton(this); enable_btn->setCheckable(true); enable_btn->setChecked(loader->isLoaded()); + enable_btn->setText(loader->isLoaded() ? "loaded" : "unloaded"); ui->tableWidget->setCellWidget(index, 4, enable_btn); - connect(enable_btn, &QToolButton::clicked, this, [ loader, enable_btn ](bool checked) { + connect(enable_btn, &QToolButton::clicked, this, [this, loader, enable_btn](bool checked) { const bool success = checked ? loader->load() : loader->unload(); if(!success) { enable_btn->setChecked(!checked); - //ui->error->setText(loader->errorString()); + ui->msg->setText(loader->errorString()); + } else { + ui->msg->setText(checked ? "Plugin successfully loaded" : "Plugin successfully unloaded"); + enable_btn->setText(checked ? "loaded" : "unloaded"); } }); - - for(const QString &key : metadata.keys()) { - auto *i = createItem(key, metadata.value(key), nullptr); - if(i != nullptr) { - ui->details_treeWidget->insertTopLevelItem(0, i); - } - } } diff --git a/src/about/aboutplugin.h b/src/about/aboutplugin.h index b01cc78..f9cd3d4 100644 --- a/src/about/aboutplugin.h +++ b/src/about/aboutplugin.h @@ -24,6 +24,9 @@ public: explicit AboutPluginDialog(QWidget *parent = nullptr); ~AboutPluginDialog() override; +signals: + void loadPlugin(const QString &path); + public slots: void add(QPluginLoader *loader); diff --git a/src/about/aboutplugin.ui b/src/about/aboutplugin.ui index d4291e5..5f44886 100644 --- a/src/about/aboutplugin.ui +++ b/src/about/aboutplugin.ui @@ -6,7 +6,7 @@ 0 0 - 600 + 900 420 @@ -19,6 +19,9 @@ true + + false + Name @@ -52,28 +55,32 @@ - - - - Key - - - - - Value - - - - - - - - Qt::Horizontal - - - QDialogButtonBox::Close - - + + + + + Add + + + + + + + text + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Close + + + + diff --git a/src/applicationmenu.cpp b/src/applicationmenu.cpp index b7acd57..dc888e7 100644 --- a/src/applicationmenu.cpp +++ b/src/applicationmenu.cpp @@ -13,10 +13,12 @@ #include "session/sessiondialog.h" #include "smolbote/plugininterface.hpp" #include +#include ApplicationMenu::ApplicationMenu(Browser *app, QWidget *parent) : QMenu(parent) { + m_app = app; setTitle(qApp->applicationName()); Configuration conf; @@ -57,11 +59,21 @@ void ApplicationMenu::addPlugin(QPluginLoader *plugin) auto *action = addAction(metadata.value("name").toString()); action->setShortcut(QKeySequence::fromString(metadata.value("shortcut").toString())); - connect(action, &QAction::triggered, this, [this, plugin]() { + connect(action, &QAction::triggered, [this, plugin]() { if(plugin->isLoaded()) { - if(const auto *interface = qobject_cast(plugin->instance())) { - interface->createWidget(this->parentWidget())->exec(); + const auto *interface = qobject_cast(plugin->instance()); + auto *dlg = interface->createWidget(this->parentWidget()); + + if(auto *profileDlg = dynamic_cast(dlg)) { + WebProfileManager mgr; + mgr.walk([profileDlg](const QString &id, WebProfile *profile, QSettings *settings) { + profileDlg->addProfile(id, profile->name(), profile, settings); + }); } + + dlg->exec(); + } else { + spdlog::warn("Trying to run unloaded plugin!"); } }); insertAction(bottom_pluginSeparator, action); diff --git a/src/applicationmenu.h b/src/applicationmenu.h index 7e1fe47..8b558e0 100644 --- a/src/applicationmenu.h +++ b/src/applicationmenu.h @@ -25,6 +25,7 @@ public slots: void addPlugin(QPluginLoader *plugin); private: + Browser *m_app = nullptr; QAction *top_pluginSeparator = nullptr, *bottom_pluginSeparator = nullptr; }; diff --git a/src/browser.cpp b/src/browser.cpp index 2277e54..4f1e02e 100644 --- a/src/browser.cpp +++ b/src/browser.cpp @@ -92,10 +92,11 @@ void Browser::aboutPlugins() dlg->exec(); } -void Browser::loadPlugins(const QStringList &paths, const std::function &callback) +bool Browser::loadPlugin(const QString &path) { - if(paths.isEmpty()) - return; + if(path.isEmpty()) { + return false; + } Configuration conf; const auto state = PluginLoader::signature_state( @@ -103,23 +104,18 @@ void Browser::loadPlugins(const QStringList &paths, const std::function("plugins.signature.checked").value(), conf.value("plugins.signature.enforced").value()); - for(const auto &path : paths) { - auto *loader = new PluginLoader(path, state, this); - const bool loaded = loader->load(); - - callback(loader); - - if(!loaded) { - delete loader; - } else { - auto *info = new PluginInfo(loader); - m_plugins.append(info); + auto *loader = new PluginLoader(path, state, this); + const bool loaded = loader->load(); - for(MainWindow *window : qAsConst(m_windows)) { - addPluginTo(info, window); - } - } + if(!loaded) { + delete loader; + return false; } + auto *info = new PluginInfo(loader); + m_plugins.append(info); + + emit pluginAdded(loader); + return true; } void Browser::setup() @@ -205,6 +201,7 @@ void Browser::open(const QVector &data, bool merge) for(const auto &windowData : data) { auto *menu = new ApplicationMenu(this); + connect(this, &Browser::pluginAdded, menu, &ApplicationMenu::addPlugin); for(auto *info : qAsConst(m_plugins)) { menu->addPlugin(info->loader); } @@ -219,28 +216,3 @@ void Browser::open(const QVector &data, bool merge) }); } } - -void Browser::addPluginTo(PluginInfo *info, MainWindow *window) -{ - QPluginLoader *loader = info->loader; - auto *pluginMenu = new QMenu(loader->metaData().value("MetaData").toObject().value("name").toString()); - //window->m_menuBar->insertPlugin(pluginMenu); - info->menus.append(pluginMenu); - - auto *runAction = pluginMenu->addAction(tr("Run")); - runAction->setShortcut(QKeySequence::fromString(loader->metaData().value("MetaData").toObject().value("shortcut").toString())); - - connect(runAction, &QAction::triggered, window, [loader, window]() { - if(loader->isLoaded()) { - const auto *interface = qobject_cast(loader->instance()); - Q_CHECK_PTR(interface); - interface->createWidget(window)->exec(); - } - }); - - auto *removeAction = pluginMenu->addAction(tr("Remove")); - connect(removeAction, &QAction::triggered, this, [this, info]() { - m_plugins.removeOne(info); - delete info; - }); -} diff --git a/src/browser.h b/src/browser.h index 74136f1..1964267 100644 --- a/src/browser.h +++ b/src/browser.h @@ -31,8 +31,6 @@ public: explicit Browser(int &argc, char *argv[], bool allowSecondary = true); ~Browser() final; - void loadPlugins( - const QStringList &paths, const std::function &callback = [](const auto) {}); void setup(); const QVector windows() const @@ -49,12 +47,18 @@ public: return m_downloads.get(); } +signals: + void pluginAdded(QPluginLoader *); + public slots: void about(); void aboutPlugins(); + void showWidget(QWidget *widget, MainWindow *where) const; void open(const QVector &data, bool merge = true); + bool loadPlugin(const QString &path); + private: struct PluginInfo { explicit PluginInfo(QPluginLoader *l) @@ -71,7 +75,6 @@ private: QPluginLoader *loader; QVector menus; }; - void addPluginTo(PluginInfo *info, MainWindow *window); Q_DISABLE_COPY(Browser) diff --git a/src/main.cpp b/src/main.cpp index ca85b65..f0c1591 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -118,13 +118,13 @@ int main(int argc, char **argv) } // load plugins - app.loadPlugins(Util::files(conf.value("plugins.path").value(), { "*.so", "*.dll" }), - [](const auto *loader) { - if(loader->isLoaded()) - spdlog::info("Loaded plugin [{}]", qUtf8Printable(loader->fileName())); - else - spdlog::warn("Loading plugin [{}] failed: {}", qUtf8Printable(loader->fileName()), qUtf8Printable(loader->errorString())); - }); + 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)); + } + } } const auto profile = []() { diff --git a/src/webengine/meson.build b/src/webengine/meson.build index db7bdc5..47e4adf 100644 --- a/src/webengine/meson.build +++ b/src/webengine/meson.build @@ -5,7 +5,7 @@ webengine_moc = mod_qt5.preprocess( dep_webengine = declare_dependency( include_directories: [ '.', smolbote_include ], - link_with: static_library('webengine', dependencies: dep_qt5, + link_with: static_library('webengine', dependencies: [ dep_qt5, dep_spdlog ], include_directories: smolbote_include, sources: [ 'webprofile.cpp', 'urlinterceptor.cpp', 'webprofilemanager.cpp', 'webpage.cpp', 'webview.cpp', 'webviewcontextmenu.cpp', webengine_moc ]) ) diff --git a/src/webengine/test/profile.cpp b/src/webengine/test/profile.cpp index 7351f66..ae3a4e3 100644 --- a/src/webengine/test/profile.cpp +++ b/src/webengine/test/profile.cpp @@ -22,98 +22,99 @@ TEST_CASE("loading profile settings") delete settings; } -SCENARIO("loading individual profiles") +SCENARIO("profile properties") { - GIVEN("no profile preset") - { - const QString search = GENERATE(as{}, "https://search.url/t=%1", "https://duckduckgo.com/?q=%1&ia=web", "aaabbbccc"); - const QUrl homepage = GENERATE(as{}, "https://homepage.net", "about:blank", "aaabbbccc"); - const QUrl newtab = GENERATE(as{}, "https://newtab.net", "about:blank", "aaabbbccc"); + const QString search{ "about:blank" }; + const QUrl homepage{ "about:blank" }; + const QUrl newtab{ "about:blank" }; + const QString id{ "id" }; + + REQUIRE(qEnvironmentVariableIsSet("PROFILE")); - const QString id{ "id" }; - auto *settings = WebProfile::load(QString(), search, homepage, newtab); - auto *profile = WebProfile::load(id, settings, true); + // create an empty settings object + const QString settings_path = GENERATE(as{}, QString(), qgetenv("PROFILE")); + auto *settings = WebProfile::load(settings_path, search, homepage, newtab); + // create the actual profile + auto *profile = WebProfile::load(id, settings, true); - REQUIRE(profile != nullptr); + REQUIRE(profile != nullptr); + REQUIRE(profile->isOffTheRecord()); + + WHEN("id constant") + { REQUIRE(profile->getId() == id); REQUIRE(profile->property("id").toString() == id); - REQUIRE(profile->name() == id); - REQUIRE(profile->search() == search); - REQUIRE(profile->homepage() == homepage); - REQUIRE(profile->newtab() == newtab); - - REQUIRE(profile->isOffTheRecord()); - delete settings; - delete profile; } - GIVEN("an off-the-record profile preset") + WHEN("changing profile name") { - REQUIRE(qEnvironmentVariableIsSet("PROFILE")); - - const QString id{ "id" }; - auto *settings = WebProfile::load(qgetenv("PROFILE"), QString(), QUrl(), QUrl()); - auto *profile = WebProfile::load(id, settings, true); - - REQUIRE(profile != nullptr); - REQUIRE(profile->getId() == id); - REQUIRE(profile->isOffTheRecord()); - - WHEN("created") + const QString name = GENERATE(as{}, "a", "bb", "ccc"); + profile->setName(name); + THEN("the name changes") { - THEN("uses default values") - { - REQUIRE(profile->name() == "Test Profile"); - REQUIRE(profile->search() == "https://duckduckgo.com/?q=%1&ia=web"); - REQUIRE(profile->homepage() == QUrl("about:blank")); - REQUIRE(profile->newtab() == QUrl("about:blank")); - } + REQUIRE(profile->name() == name); + REQUIRE(settings->value("name").toString() == name); } - - WHEN("changing profile name") + } + WHEN("changing search") + { + const QString search = GENERATE(as{}, "a", "bb", "ccc"); + profile->setSearch(search); + THEN("the search url changes") { - const QString name = GENERATE(as{}, "a", "bb", "ccc"); - profile->setName(name); - THEN("the name changes") - { - REQUIRE(profile->name() == name); - REQUIRE(settings->value("name").toString() == name); - } + REQUIRE(profile->search() == search); + REQUIRE(settings->value("search").toString() == search); } - WHEN("changing search url") + } + WHEN("changing homepage url") + { + const QUrl url = GENERATE(as{}, "a", "bb", "ccc"); + profile->setHomepage(url); + THEN("homepage changes") { - const QString search = GENERATE(as{}, "a", "bb", "ccc"); - profile->setSearch(search); - THEN("the search url changes") - { - REQUIRE(profile->search() == search); - REQUIRE(settings->value("search").toString() == search); - } + REQUIRE(profile->homepage() == url); + REQUIRE(settings->value("homepage").toUrl() == url); } - WHEN("changing homepage") + } + WHEN("changing newtab url") + { + const QUrl url = GENERATE(as{}, "a", "bb", "ccc"); + profile->setNewtab(url); + THEN("newtab changes") { - const QUrl url = GENERATE(as{}, "a", "bb", "ccc"); - profile->setHomepage(url); - THEN("homepage changes") - { - REQUIRE(profile->homepage() == url); - REQUIRE(settings->value("homepage").toUrl() == url); - } + REQUIRE(profile->newtab() == url); + REQUIRE(settings->value("newtab").toUrl() == url); } - WHEN("changing newtab") + } + + WHEN("changing cookies") + { + auto list = profile->cookies(); + REQUIRE(list.isEmpty()); + list.append(QNetworkCookie("name", "value").toRawForm()); + profile->setCookies(list); + THEN("new cookie list gets applied") { - const QUrl url = GENERATE(as{}, "a", "bb", "ccc"); - profile->setNewtab(url); - THEN("newtab changes") - { - REQUIRE(profile->newtab() == url); - REQUIRE(settings->value("newtab").toUrl() == url); - } + // There is no event loop, so the signals cannot fire and update the cookie list + //REQUIRE(list == profile->cookies()); } + } - delete settings; - delete profile; + WHEN("changing headers") + { + QMap headers; + headers.insert("Dnt", "1"); + headers.insert("unknown", "pair"); + + profile->setHeaders(headers); + THEN("headers change") + { + REQUIRE(profile->headers() == headers); + } } + + delete settings; + delete profile; } int main(int argc, char **argv) diff --git a/src/webengine/webprofile.cpp b/src/webengine/webprofile.cpp index f0368c9..719ab34 100644 --- a/src/webengine/webprofile.cpp +++ b/src/webengine/webprofile.cpp @@ -7,11 +7,12 @@ */ #include "webprofile.h" +#include "urlinterceptor.h" #include #include #include #include -#include "urlinterceptor.h" +#include static WebProfile *s_profile = nullptr; @@ -47,7 +48,7 @@ WebProfile *WebProfile::load(const QString &id, QSettings *settings, bool isOffT { WebProfile *profile = nullptr; - if(isOffTheRecord || settings->value("otr", isOffTheRecord).toBool()) { + if(settings->value("otr", isOffTheRecord).toBool()) { profile = new WebProfile(id, nullptr); } else { profile = new WebProfile(id, id, nullptr); @@ -89,7 +90,8 @@ WebProfile *WebProfile::load(const QString &id, QSettings *settings, bool isOffT { // headers settings->beginGroup("headers"); - for(const QString &key : settings->childKeys()) { + const auto keys = settings->childKeys(); + for(const QString &key : keys) { profile->setHttpHeader(key.toLatin1(), settings->value(key).toString().toLatin1()); } settings->endGroup(); @@ -110,11 +112,14 @@ WebProfile::WebProfile(const QString &id, QObject *parent) { QWebEngineProfile::setUrlRequestInterceptor(new UrlRequestInterceptor(this)); connect(this->cookieStore(), &QWebEngineCookieStore::cookieAdded, this, [this](const QNetworkCookie &cookie) { + spdlog::debug("[{}]: +cookie {}", qUtf8Printable(m_name), qUtf8Printable(cookie.name())); m_cookies.append(cookie); }); connect(this->cookieStore(), &QWebEngineCookieStore::cookieRemoved, this, [this](const QNetworkCookie &cookie) { - m_cookies.removeAll(cookie); + spdlog::debug("[{}]: -cookie {}", qUtf8Printable(m_name), qUtf8Printable(cookie.name())); + m_cookies.removeOne(cookie); }); + cookieStore()->loadAllCookies(); } // default constructor @@ -124,9 +129,12 @@ WebProfile::WebProfile(const QString &id, const QString &storageName, QObject *p { QWebEngineProfile::setUrlRequestInterceptor(new UrlRequestInterceptor(this)); connect(this->cookieStore(), &QWebEngineCookieStore::cookieAdded, this, [this](const QNetworkCookie &cookie) { + spdlog::debug("[{}]: +cookie {}", qUtf8Printable(m_name), qUtf8Printable(cookie.name())); m_cookies.append(cookie); }); connect(this->cookieStore(), &QWebEngineCookieStore::cookieRemoved, this, [this](const QNetworkCookie &cookie) { - m_cookies.removeAll(cookie); + spdlog::debug("[{}]: -cookie {}", qUtf8Printable(m_name), qUtf8Printable(cookie.name())); + m_cookies.removeOne(cookie); }); + cookieStore()->loadAllCookies(); } diff --git a/src/webengine/webprofile.h b/src/webengine/webprofile.h index 180cc9d..0747638 100644 --- a/src/webengine/webprofile.h +++ b/src/webengine/webprofile.h @@ -11,13 +11,14 @@ #include #include +#include #include #include +#include #include +#include #include #include -#include -#include class UrlRequestInterceptor; class WebProfile : public QWebEngineProfile @@ -44,6 +45,10 @@ class WebProfile : public QWebEngineProfile Q_PROPERTY(bool spellCheckEnabled READ isSpellCheckEnabled WRITE setSpellCheckEnabled NOTIFY propertyChanged) + // more custom properties + Q_PROPERTY(QList cookies READ cookies WRITE setCookies NOTIFY cookiesChanged) + Q_PROPERTY(QMap headers READ headers WRITE setHeaders NOTIFY headersChanged) + signals: void nameChanged(const QString &name); void searchChanged(const QString &url); @@ -52,6 +57,9 @@ signals: void propertyChanged(const QString &name, const QVariant &value); void attributeChanged(QWebEngineSettings::WebAttribute attribute, bool value); + + void cookiesChanged(); + void headersChanged(); void headerChanged(const QString &name, const QString &value); void headerRemoved(const QString &name); @@ -60,9 +68,9 @@ public: [[nodiscard]] static WebProfile *load(const QString &id, QSettings *settings, bool isOffTheRecord = true); WebProfile(const WebProfile &) = delete; - WebProfile& operator=(const WebProfile &) = delete; + WebProfile &operator=(const WebProfile &) = delete; WebProfile(WebProfile &&) = delete; - WebProfile& operator=(WebProfile &&) = delete; + WebProfile &operator=(WebProfile &&) = delete; static WebProfile *defaultProfile(); static void setDefaultProfile(WebProfile *profile); @@ -83,9 +91,13 @@ public: emit nameChanged(name); } - [[nodiscard]] QVector cookies() const + [[nodiscard]] QList cookies() const { - return qAsConst(m_cookies); + QList r; + for(const auto &cookie : m_cookies) { + r.append(cookie.toRawForm()); + } + return r; } [[nodiscard]] QString search() const @@ -166,7 +178,16 @@ public: emit headerRemoved(name); } } - + [[nodiscard]] QMap headers() const + { + QMap r; + auto it = m_headers.constBegin(); + while(it != m_headers.constEnd()) { + r.insert(QString(it.key()), QVariant(it.value())); + ++it; + } + return r; + } void setSpellCheckEnabled(bool enable) { QWebEngineProfile::setSpellCheckEnabled(enable); @@ -178,6 +199,29 @@ public: m_filters.append(interceptor); } +public slots: + void setCookies(const QList &cookies) + { + auto *store = cookieStore(); + store->deleteAllCookies(); + for(const auto &data : cookies) { + for(const auto &cookie : QNetworkCookie::parseCookies(data.toByteArray())) { + store->setCookie(cookie); + } + } + emit cookiesChanged(); + } + void setHeaders(const QMap &headers) + { + m_headers.clear(); + auto it = headers.constBegin(); + while(it != headers.constEnd()) { + m_headers.insert(it.key().toLatin1(), it.value().toByteArray()); + ++it; + } + emit headersChanged(); + } + protected: // off-the-record constructor explicit WebProfile(const QString &id, QObject *parent = nullptr); @@ -190,8 +234,8 @@ protected: QUrl m_homepage = QUrl("about:blank"); QUrl m_newtab = QUrl("about:blank"); - QVector m_filters; - QVector m_cookies; + QVector m_filters; + QList m_cookies; QMap m_headers; }; diff --git a/src/webengine/webprofilemanager.cpp b/src/webengine/webprofilemanager.cpp index 785251b..5cc83f8 100644 --- a/src/webengine/webprofilemanager.cpp +++ b/src/webengine/webprofilemanager.cpp @@ -56,7 +56,7 @@ QStringList WebProfileManager::idList() const } template <> -void WebProfileManager::walk(std::function f) const +void WebProfileManager::walk(std::function f) const { for(auto iter = profiles.begin(); iter != profiles.end(); ++iter) { f(iter.key(), iter.value().ptr, iter.value().settings); @@ -64,7 +64,7 @@ void WebProfileManager::walk(std::function -void WebProfileManager::walk(std::function f) const +void WebProfileManager::walk(std::function f) const { s_instance->walk(f); } diff --git a/src/webengine/webprofilemanager.h b/src/webengine/webprofilemanager.h index 22fb31c..91dcaf8 100644 --- a/src/webengine/webprofilemanager.h +++ b/src/webengine/webprofilemanager.h @@ -93,7 +93,7 @@ public: return profiles.keys(); } - callable_when(unconsumed) void walk(std::function) const; + callable_when(unconsumed) void walk(std::function) const; callable_when(unconsumed) void make_global(); -- cgit v1.2.1