Commit 07aedf7e authored by Laurent Montel's avatar Laurent Montel 😁

Warning--

parent a2083bb2
......@@ -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");
......
......@@ -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();
......
......@@ -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());
......
......@@ -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
}
......
......@@ -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;
......
......@@ -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;
......
......@@ -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());
}
......
......@@ -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;
......
......@@ -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;
......
......@@ -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;
......
......@@ -117,6 +117,7 @@ QHash<int, QByteArray> SessionModel::roleNames() const {
}
int SessionModel::rowCount(const QModelIndex &parent) const {
Q_UNUSED(parent);
return d->sessions.length();
}
......
......@@ -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);
......
......@@ -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();
......
......@@ -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,
......
......@@ -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;
......
......@@ -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;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment