From 07aedf7e7cc81b4f923654eb925fb6a2d7eec7c8 Mon Sep 17 00:00:00 2001 From: Laurent Montel Date: Tue, 15 May 2018 08:54:17 +0200 Subject: [PATCH] Warning-- --- sddmthemeinstaller.cpp | 4 ++-- src/advanceconfig.h | 2 +- src/configwidgets/selectimagebutton.cpp | 2 +- src/cursortheme/cursortheme.cpp | 3 +++ src/cursortheme/dummytheme.h | 2 +- src/cursortheme/sortproxymodel.h | 4 ++-- src/cursortheme/thememodel.cpp | 4 ++-- src/cursortheme/thememodel.h | 4 ++-- src/cursortheme/xcursortheme.h | 2 +- src/sddmkcm.h | 2 +- src/sessionmodel.cpp | 1 + src/sessionmodel.h | 4 ++-- src/themeconfig.h | 2 +- src/themesdelegate.h | 2 +- src/themesmodel.h | 4 ++-- src/usersmodel.h | 4 ++-- 16 files changed, 25 insertions(+), 21 deletions(-) diff --git a/sddmthemeinstaller.cpp b/sddmthemeinstaller.cpp index b3f7da4..ed0e747 100644 --- a/sddmthemeinstaller.cpp +++ b/sddmthemeinstaller.cpp @@ -72,7 +72,7 @@ int main(int argc, char **argv) KAuth::ExecuteJob *job = action.execute(); bool rc = job->exec(); if (!rc) { - KMessageBox::sorry(0, i18n("Unable to install theme"), job->errorString()); + KMessageBox::sorry(nullptr, i18n("Unable to install theme"), job->errorString()); qWarning() << job->error() << job->errorString(); return -1; } @@ -83,7 +83,7 @@ int main(int argc, char **argv) } if (parser.isSet(QLatin1String("uninstall"))) { KConfigGroup cg(KSharedConfig::openConfig(QStringLiteral("sddmthemeinstallerrc"), KConfig::SimpleConfig), "DownloadedThemes"); - QStringList installed = cg.readEntry(args.first(), QStringList()); + const QStringList installed = cg.readEntry(args.first(), QStringList()); for (const QString &installedTheme: installed) { KAuth::Action action(QStringLiteral("org.kde.kcontrol.kcmsddm.uninstalltheme")); action.setHelperId("org.kde.kcontrol.kcmsddm"); diff --git a/src/advanceconfig.h b/src/advanceconfig.h index 8130136..bb9ee82 100644 --- a/src/advanceconfig.h +++ b/src/advanceconfig.h @@ -34,7 +34,7 @@ class AdvanceConfig : public QWidget { Q_OBJECT public: - explicit AdvanceConfig(const KSharedConfigPtr &config, QWidget *parent = 0); + explicit AdvanceConfig(const KSharedConfigPtr &config, QWidget *parent = nullptr); ~AdvanceConfig(); QVariantMap save(); diff --git a/src/configwidgets/selectimagebutton.cpp b/src/configwidgets/selectimagebutton.cpp index 1282cc1..8255c17 100644 --- a/src/configwidgets/selectimagebutton.cpp +++ b/src/configwidgets/selectimagebutton.cpp @@ -73,7 +73,7 @@ QString SelectImageButton::imagePath() const { void SelectImageButton::onLoadImageFromFile() { - QUrl fileUrl = QFileDialog::getOpenFileUrl(this, i18nc("@title:window", "Select Image"), QUrl(), "image/*", 0, 0, QStringList() << "file"); + QUrl fileUrl = QFileDialog::getOpenFileUrl(this, i18nc("@title:window", "Select Image"), QUrl(), "image/*", nullptr, 0, QStringList() << "file"); if (!fileUrl.isEmpty()) { setImagePath(fileUrl.path()); diff --git a/src/cursortheme/cursortheme.cpp b/src/cursortheme/cursortheme.cpp index 45dd6f3..49f3ced 100644 --- a/src/cursortheme/cursortheme.cpp +++ b/src/cursortheme/cursortheme.cpp @@ -148,6 +148,9 @@ void CursorTheme::setCursorName(qulonglong cursor, const QString &name) const XFixesSetCursorName(QX11Info::display(), cursor, QFile::encodeName(name)); } +#else + Q_UNUSED(name); + Q_UNUSED(cursor); #endif } diff --git a/src/cursortheme/dummytheme.h b/src/cursortheme/dummytheme.h index 6e7eb46..dfe814c 100644 --- a/src/cursortheme/dummytheme.h +++ b/src/cursortheme/dummytheme.h @@ -23,7 +23,7 @@ class DummyTheme : public CursorTheme { public: DummyTheme(); - virtual ~DummyTheme(); + ~DummyTheme() Q_DECL_OVERRIDE; QImage loadImage(const QString &name, int size = 0) const Q_DECL_OVERRIDE; qulonglong loadCursor(const QString &name, int size = 0) const Q_DECL_OVERRIDE; diff --git a/src/cursortheme/sortproxymodel.h b/src/cursortheme/sortproxymodel.h index 3bd5161..f420c77 100644 --- a/src/cursortheme/sortproxymodel.h +++ b/src/cursortheme/sortproxymodel.h @@ -35,8 +35,8 @@ class SortProxyModel : public QSortFilterProxyModel { public: - SortProxyModel(QObject *parent = 0) : QSortFilterProxyModel(parent) {} - ~SortProxyModel() {} + explicit SortProxyModel(QObject *parent = nullptr) : QSortFilterProxyModel(parent) {} + ~SortProxyModel() Q_DECL_OVERRIDE {} inline const CursorTheme *theme(const QModelIndex &index) const; inline QModelIndex findIndex(const QString &name) const; inline QModelIndex defaultIndex() const; diff --git a/src/cursortheme/thememodel.cpp b/src/cursortheme/thememodel.cpp index 65a558c..9caac43 100644 --- a/src/cursortheme/thememodel.cpp +++ b/src/cursortheme/thememodel.cpp @@ -133,10 +133,10 @@ void CursorThemeModel::sort(int column, Qt::SortOrder order) const CursorTheme *CursorThemeModel::theme(const QModelIndex &index) { if (!index.isValid()) - return NULL; + return nullptr; if (index.row() < 0 || index.row() >= list.count()) - return NULL; + return nullptr; return list.at(index.row()); } diff --git a/src/cursortheme/thememodel.h b/src/cursortheme/thememodel.h index c2f029c..007064a 100644 --- a/src/cursortheme/thememodel.h +++ b/src/cursortheme/thememodel.h @@ -60,8 +60,8 @@ class CursorThemeModel : public QAbstractTableModel Q_OBJECT public: - CursorThemeModel(QObject *parent = 0); - ~CursorThemeModel(); + explicit CursorThemeModel(QObject *parent = nullptr); + ~CursorThemeModel() Q_DECL_OVERRIDE; inline int columnCount(const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE; inline int rowCount(const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE; QVariant headerData(int section, Qt::Orientation orientation, int role) const Q_DECL_OVERRIDE; diff --git a/src/cursortheme/xcursortheme.h b/src/cursortheme/xcursortheme.h index 078336e..8c7d760 100644 --- a/src/cursortheme/xcursortheme.h +++ b/src/cursortheme/xcursortheme.h @@ -43,7 +43,7 @@ class XCursorTheme : public CursorTheme * index.theme file if the dir has one. */ XCursorTheme(const QDir &dir); - virtual ~XCursorTheme() {} + ~XCursorTheme() Q_DECL_OVERRIDE {} const QStringList inherits() const { return m_inherits; } QImage loadImage(const QString &name, int size = 0) const Q_DECL_OVERRIDE; diff --git a/src/sddmkcm.h b/src/sddmkcm.h index 679d57a..ddb6ca5 100644 --- a/src/sddmkcm.h +++ b/src/sddmkcm.h @@ -28,7 +28,7 @@ class SddmKcm : public KCModule Q_OBJECT public: explicit SddmKcm(QWidget *parent, const QVariantList &args); - ~SddmKcm(); + ~SddmKcm() Q_DECL_OVERRIDE; public slots: void save() Q_DECL_OVERRIDE; diff --git a/src/sessionmodel.cpp b/src/sessionmodel.cpp index 9e52b12..086aa28 100644 --- a/src/sessionmodel.cpp +++ b/src/sessionmodel.cpp @@ -117,6 +117,7 @@ QHash SessionModel::roleNames() const { } int SessionModel::rowCount(const QModelIndex &parent) const { + Q_UNUSED(parent); return d->sessions.length(); } diff --git a/src/sessionmodel.h b/src/sessionmodel.h index d3b9d65..e307d37 100644 --- a/src/sessionmodel.h +++ b/src/sessionmodel.h @@ -43,8 +43,8 @@ public: CommentRole }; - SessionModel(QObject *parent = 0); - ~SessionModel(); + explicit SessionModel(QObject *parent = nullptr); + ~SessionModel() Q_DECL_OVERRIDE; void loadDir(const QString &path, SessionType type); diff --git a/src/themeconfig.h b/src/themeconfig.h index bf47ec6..b4de166 100644 --- a/src/themeconfig.h +++ b/src/themeconfig.h @@ -31,7 +31,7 @@ class ThemeConfig : public QWidget { Q_OBJECT public: - explicit ThemeConfig(const KSharedConfigPtr &config, QWidget *parent = 0); + explicit ThemeConfig(const KSharedConfigPtr &config, QWidget *parent = nullptr); ~ThemeConfig(); QVariantMap save(); diff --git a/src/themesdelegate.h b/src/themesdelegate.h index c4aacc7..d1e3089 100644 --- a/src/themesdelegate.h +++ b/src/themesdelegate.h @@ -23,7 +23,7 @@ class ThemesDelegate : public QAbstractItemDelegate { public: - explicit ThemesDelegate(QObject *parent = 0); + explicit ThemesDelegate(QObject *parent = nullptr); void paint(QPainter *painter, const QStyleOptionViewItem &option, diff --git a/src/themesmodel.h b/src/themesmodel.h index e6199f5..218f4dd 100644 --- a/src/themesmodel.h +++ b/src/themesmodel.h @@ -41,8 +41,8 @@ public: ConfigFileRole }; - explicit ThemesModel(QObject *parent=0); - virtual ~ThemesModel(); + explicit ThemesModel(QObject *parent=nullptr); + ~ThemesModel() Q_DECL_OVERRIDE; int rowCount(const QModelIndex &parent) const Q_DECL_OVERRIDE; QVariant data(const QModelIndex &index, int role) const Q_DECL_OVERRIDE; diff --git a/src/usersmodel.h b/src/usersmodel.h index a76e6af..6c7b715 100644 --- a/src/usersmodel.h +++ b/src/usersmodel.h @@ -32,8 +32,8 @@ public: IconRole }; - explicit UsersModel(QObject *parent=0); - virtual ~UsersModel(); + explicit UsersModel(QObject *parent=nullptr); + ~UsersModel() Q_DECL_OVERRIDE; int rowCount(const QModelIndex &parent) const Q_DECL_OVERRIDE; QVariant data(const QModelIndex &index, int role) const Q_DECL_OVERRIDE; -- GitLab