aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAqua-sama <aqua@iserlohn-fortress.net>2018-10-04 19:42:46 +0200
committerAqua-sama <aqua@iserlohn-fortress.net>2018-10-04 19:42:46 +0200
commit5563bb3c94f9c001f95de44a5818d2f86631532b (patch)
tree2b9fe955e14b167c64251677533ee4d0f34006eb /lib
parentUpdate pkgbuild to use asciidoctor (diff)
downloadsmolbote-5563bb3c94f9c001f95de44a5818d2f86631532b.tar.xz
clazy: fix warnings
Diffstat (limited to 'lib')
-rw-r--r--lib/bookmarks/bookmarkmodel.h3
-rw-r--r--lib/web/profilemanager.cpp16
-rw-r--r--lib/web/profilemanager.h2
3 files changed, 9 insertions, 12 deletions
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 <QAbstractItemModel>
-/* 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 <QFileInfo>
#include <QWebEngineSettings>
-ProfileManager::ProfileManager(const QHash<QString, QString> &profileSection, const QString &defaultId, QObject *parent)
+ProfileManager::ProfileManager(const QHash<QString, QString> &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<void(WebProfile *)> 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<QString, QString> &profileSection, const QString &defaultId, QObject *parent = nullptr);
+ explicit ProfileManager(const QHash<QString, QString> &profileSection, QObject *parent);
WebProfile *loadProfile(const QString &path);
void deleteProfile(const QString &id);