Verified Commit 3c08594e authored by Jonah Brüchert's avatar Jonah Brüchert 🌳

Use nullptr and override

parent bd252d8c
......@@ -34,8 +34,8 @@ class ConfigGroupPrivate {
public:
ConfigGroupPrivate(ConfigGroup *q)
: q(q),
config(0),
configGroup(0)
config(nullptr),
configGroup(nullptr)
{}
~ConfigGroupPrivate()
......@@ -127,7 +127,7 @@ QStringList ConfigGroup::groupList() const
bool ConfigGroup::readConfigFile()
{
// Find parent ConfigGroup
ConfigGroup* parentGroup = 0;
ConfigGroup* parentGroup = nullptr;
QObject* current = parent();
while (current) {
parentGroup = qobject_cast<ConfigGroup*>(current);
......@@ -138,7 +138,7 @@ bool ConfigGroup::readConfigFile()
}
delete d->configGroup;
d->configGroup = 0;
d->configGroup = nullptr;
if (parentGroup) {
d->configGroup = new KConfigGroup(parentGroup->configGroup(), d->group);
......
......@@ -40,8 +40,8 @@ class ConfigGroup : public QQuickItem
Q_PROPERTY(QStringList groupList READ groupList NOTIFY groupListChanged)
public:
ConfigGroup(QQuickItem* parent=0);
~ConfigGroup();
ConfigGroup(QQuickItem* parent=nullptr);
~ConfigGroup() override;
KConfigGroup* configGroup();
......
......@@ -32,8 +32,8 @@ class Package : public QObject
Q_PROPERTY(QString visibleName READ visibleName NOTIFY visibleNameChanged)
public:
Package(QObject *parent = 0);
~Package();
Package(QObject *parent = nullptr);
~Package() override;
QString name() const;
void setName(const QString &name);
......
......@@ -49,8 +49,8 @@ SettingsComponent::SettingsComponent(QQuickItem *parent)
{
d = new SettingsComponentPrivate;
d->package = KPackage::PackageLoader::self()->loadPackage(QStringLiteral("KPackage/GenericQML"));
d->settingsModule = 0;
d->kcm = 0;
d->settingsModule = nullptr;
d->kcm = nullptr;
d->valid = false;
}
......@@ -61,9 +61,9 @@ SettingsComponent::~SettingsComponent()
void SettingsComponent::loadModule(const QString &name)
{
d->settingsModule->deleteLater();
d->settingsModule = 0;
d->settingsModule = nullptr;
d->kcm->deleteLater();
d->kcm = 0;
d->kcm = nullptr;
d->package.setPath(name);
//KGlobal::locale()->insertCatalog("plasma_package_" + name);
......
......@@ -39,8 +39,8 @@ class SettingsComponent : public QQuickItem
Q_PROPERTY(KQuickAddons::ConfigModule *kcm READ kcm NOTIFY kcmChanged)
public:
SettingsComponent(QQuickItem *parent = 0);
~SettingsComponent();
SettingsComponent(QQuickItem *parent = nullptr);
~SettingsComponent() override;
QString description() const;
......
......@@ -43,8 +43,8 @@ class SettingsModule : public QObject
Q_PROPERTY(QString category READ category WRITE setCategory NOTIFY categoryChanged)
public:
explicit SettingsModule(QObject *parent = 0, const QVariantList &v = QVariantList());
virtual ~SettingsModule();
explicit SettingsModule(QObject *parent = nullptr, const QVariantList &v = QVariantList());
~SettingsModule() override;
QString name() const;
QString description() const;
......
......@@ -38,8 +38,8 @@ class SettingsModulesModel : public QQmlComponent
Q_PROPERTY(QString formFactor READ formFactor WRITE setFormFactor NOTIFY formFactorChanged)
public:
SettingsModulesModel(QQmlComponent* parent = 0);
~SettingsModulesModel();
SettingsModulesModel(QQmlComponent* parent = nullptr);
~SettingsModulesModel() override;
QQmlListProperty<SettingsModule> settingsModules();
......
......@@ -30,7 +30,7 @@ class SettingsPlugin : public QQmlExtensionPlugin
public:
//void initializeEngine(QQmlEngine *engine, const char *uri);
void registerTypes(const char *uri);
void registerTypes(const char *uri) override;
};
#endif
......
......@@ -33,7 +33,7 @@ class DevelSettings : public KQuickAddons::ConfigModule
public:
DevelSettings(QObject* parent, const QVariantList& args);
virtual ~DevelSettings();
~DevelSettings() override;
bool sshEnabled() const;
void enableSsh(bool enable);
......
......@@ -28,7 +28,7 @@ class SshdHelper : public QObject
Q_OBJECT
public:
SshdHelper(QObject *parent = 0);
SshdHelper(QObject *parent = nullptr);
public slots:
ActionReply start(const QVariantMap &map);
......
......@@ -58,13 +58,13 @@ public:
PackageVersionRole = Qt::UserRole + 3
};
ThemeListModel(QObject *parent = 0);
virtual ~ThemeListModel();
ThemeListModel(QObject *parent = nullptr);
~ThemeListModel() override;
virtual QHash<int, QByteArray> roleNames() const;
QHash<int, QByteArray> roleNames() const override;
virtual int rowCount(const QModelIndex &parent = QModelIndex()) const;
virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
int rowCount(const QModelIndex &parent = QModelIndex()) const override;
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
QModelIndex indexOf(const QString &path) const;
void reload();
void clearThemeList();
......
......@@ -42,7 +42,7 @@ class ThemeSettings : public KQuickAddons::ConfigModule
public:
ThemeSettings(QObject* parent, const QVariantList& args);
virtual ~ThemeSettings();
~ThemeSettings() override;
QString themeName() const;
void setThemeName(const QString &theme);
......
......@@ -85,8 +85,8 @@ TimeSettings::TimeSettings(QObject* parent, const QVariantList& args)
qDebug() << "time settings init";
d = new TimeSettingsPrivate;
d->q = this;
d->timeZones = 0;
d->timeZonesModel = 0;
d->timeZones = nullptr;
d->timeZonesModel = nullptr;
setTimeZone(KSystemTimeZones::local().name());
KAboutData* about = new KAboutData("kcm_mobile_time", i18n("Configure Date and Time"),
......
......@@ -65,7 +65,7 @@ class TimeSettings : public KQuickAddons::ConfigModule
* @arg list Arguments, currently unused
*/
TimeSettings(QObject* parent, const QVariantList& args);
virtual ~TimeSettings();
~TimeSettings() override;
QString currentTimeText();
QTime currentTime() const;
......
......@@ -34,8 +34,8 @@ class TimeZone : public QObject
Q_PROPERTY(QString name READ name WRITE setName NOTIFY nameChanged)
public:
explicit TimeZone(const KTimeZone &zone, QObject *parent = 0);
virtual ~TimeZone();
explicit TimeZone(const KTimeZone &zone, QObject *parent = nullptr);
~TimeZone() override;
QString name();
public Q_SLOTS:
......
......@@ -28,7 +28,7 @@ class TimeZonesModel: public QStandardItemModel
Q_PROPERTY(int count READ count NOTIFY countChanged)
public:
TimeZonesModel(QObject *parent=0);
TimeZonesModel(QObject *parent=nullptr);
Q_INVOKABLE QVariantHash get(int i) const;
int count() const {return rowCount();}
......
......@@ -30,8 +30,8 @@ class SettingsApp : public QObject
Q_OBJECT
public:
explicit SettingsApp(QCommandLineParser &parser, QObject *parent = 0 );
~SettingsApp();
explicit SettingsApp(QCommandLineParser &parser, QObject *parent = nullptr );
~SettingsApp() override;
Q_SIGNALS:
void moduleRequested(const QString &module);
......
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