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/bookmarks/bookmarkmodel.h | 3 --- lib/web/profilemanager.cpp | 16 ++++++++-------- lib/web/profilemanager.h | 2 +- 3 files changed, 9 insertions(+), 12 deletions(-) (limited to 'lib') diff --git a/lib/bookmarks/bookmarkmodel.h b/lib/bookmarks/bookmarkmodel.h index ca6f004..28267aa 100644 --- a/lib/bookmarks/bookmarkmodel.h +++ b/lib/bookmarks/bookmarkmodel.h @@ -12,9 +12,6 @@ #include "bookmarkitem.h" #include -/* TODO BookmarkModel: moving items internally instead of copying during drag-drop - */ - class BookmarkModel : public QAbstractItemModel { Q_OBJECT 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); }); } diff --git a/lib/web/profilemanager.h b/lib/web/profilemanager.h index 9cd2cbd..5d751d2 100644 --- a/lib/web/profilemanager.h +++ b/lib/web/profilemanager.h @@ -25,7 +25,7 @@ class ProfileManager : public QObject { Q_OBJECT public: - explicit ProfileManager(const QHash &profileSection, const QString &defaultId, QObject *parent = nullptr); + explicit ProfileManager(const QHash &profileSection, QObject *parent); WebProfile *loadProfile(const QString &path); void deleteProfile(const QString &id); -- cgit v1.2.1