From 5563bb3c94f9c001f95de44a5818d2f86631532b Mon Sep 17 00:00:00 2001 From: Aqua-sama Date: Thu, 4 Oct 2018 19:42:46 +0200 Subject: clazy: fix warnings --- lib/web/profilemanager.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'lib/web/profilemanager.cpp') diff --git a/lib/web/profilemanager.cpp b/lib/web/profilemanager.cpp index d6c61a9..74ddc75 100644 --- a/lib/web/profilemanager.cpp +++ b/lib/web/profilemanager.cpp @@ -11,7 +11,7 @@ #include #include -ProfileManager::ProfileManager(const QHash &profileSection, const QString &defaultId, QObject *parent) +ProfileManager::ProfileManager(const QHash &profileSection, QObject *parent) : QObject(parent) , defaults(profileSection) { @@ -28,22 +28,22 @@ WebProfile *ProfileManager::loadProfile(const QString &path) ptr->profile = new WebProfile(id, ptr->settings.value("name", id).toString(), nullptr); } Q_CHECK_PTR(ptr->profile); - connect(ptr->profile, &WebProfile::nameChanged, [this, id](const QString &name) { + connect(ptr->profile, &WebProfile::nameChanged, ptr->profile, [this, id](const QString &name) { this->m_profiles.at(id)->settings.setValue("name", name); }); ptr->profile->setSearch(ptr->settings.value("search", defaults.value("profile.search")).toString()); - connect(ptr->profile, &WebProfile::searchChanged, [this, id](const QString &url) { + connect(ptr->profile, &WebProfile::searchChanged, ptr->profile, [this, id](const QString &url) { this->m_profiles.at(id)->settings.setValue("search", url); }); ptr->profile->setHomepage(ptr->settings.value("homepage", defaults.value("profile.homepage")).toUrl()); - connect(ptr->profile, &WebProfile::homepageChanged, [this, id](const QUrl &url) { + connect(ptr->profile, &WebProfile::homepageChanged, ptr->profile, [this, id](const QUrl &url) { this->m_profiles.at(id)->settings.setValue("homepage", url); }); ptr->profile->setNewtab(ptr->settings.value("newtab", defaults.value("profile.newtab")).toUrl()); - connect(ptr->profile, &WebProfile::newtabChanged, [this, id](const QUrl &url) { + connect(ptr->profile, &WebProfile::newtabChanged, ptr->profile, [this, id](const QUrl &url) { this->m_profiles.at(id)->settings.setValue("newtab", url); }); @@ -55,7 +55,7 @@ WebProfile *ProfileManager::loadProfile(const QString &path) } } ptr->settings.endGroup(); // properties - connect(ptr->profile, &WebProfile::propertyChanged, [this, id](const QString &property, const QVariant &value) { + connect(ptr->profile, &WebProfile::propertyChanged, ptr->profile, [this, id](const QString &property, const QVariant &value) { this->m_profiles.at(id)->settings.setValue("properties/" + property, value); }); @@ -69,7 +69,7 @@ WebProfile *ProfileManager::loadProfile(const QString &path) } } ptr->settings.endGroup(); - connect(ptr->profile, &WebProfile::attributeChanged, [this, id](const QWebEngineSettings::WebAttribute attr, const bool value) { + connect(ptr->profile, &WebProfile::attributeChanged, ptr->profile, [this, id](const QWebEngineSettings::WebAttribute attr, const bool value) { this->m_profiles.at(id)->settings.setValue("attributes/" + QString::number(attr), value); }); @@ -91,7 +91,7 @@ QMenu *ProfileManager::createProfileMenu(std::function callb for(const auto &m_profile : m_profiles) { WebProfile *profile = m_profile.second->profile; QAction *action = menu->addAction(profile->name()); - connect(action, &QAction::triggered, [profile, callback]() { + connect(action, &QAction::triggered, profile, [profile, callback]() { callback(profile); }); } -- cgit v1.2.1