diff --git a/components/fullscreenpanel.cpp b/components/fullscreenpanel.cpp index f43386e5..29429597 100644 --- a/components/fullscreenpanel.cpp +++ b/components/fullscreenpanel.cpp @@ -43,8 +43,7 @@ FullScreenPanel::FullScreenPanel(QQuickWindow *parent) } FullScreenPanel::~FullScreenPanel() -{ -} += default; void FullScreenPanel::initWayland() { @@ -56,7 +55,7 @@ void FullScreenPanel::initWayland() if (!connection) { return; } - Registry *registry = new Registry(this); + auto *registry = new Registry(this); registry->create(connection); m_surface = Surface::fromWindow(this); diff --git a/components/fullscreenpanel.h b/components/fullscreenpanel.h index 310d12b4..1ad0aa4a 100644 --- a/components/fullscreenpanel.h +++ b/components/fullscreenpanel.h @@ -40,14 +40,14 @@ class FullScreenPanel : public QQuickWindow Q_PROPERTY(bool active READ isActive NOTIFY activeChanged) public: - FullScreenPanel(QQuickWindow *parent = 0); - ~FullScreenPanel(); + FullScreenPanel(QQuickWindow *parent = nullptr); + ~FullScreenPanel() override; Q_SIGNALS: void activeChanged(); protected: - void showEvent(QShowEvent *event); + void showEvent(QShowEvent *event) override; private: void initWayland(); diff --git a/components/mobileshellprivateplugin.h b/components/mobileshellprivateplugin.h index 0801fa4a..952dd578 100644 --- a/components/mobileshellprivateplugin.h +++ b/components/mobileshellprivateplugin.h @@ -31,7 +31,7 @@ class PlasmaMobileShellPrivatePlugin : public QQmlExtensionPlugin Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface") public: - void registerTypes(const char *uri); + void registerTypes(const char *uri) override; }; #endif diff --git a/containments/homescreen/applicationlistmodel.cpp b/containments/homescreen/applicationlistmodel.cpp index 30b90c5e..b3e06c71 100644 --- a/containments/homescreen/applicationlistmodel.cpp +++ b/containments/homescreen/applicationlistmodel.cpp @@ -46,8 +46,7 @@ ApplicationListModel::ApplicationListModel(QObject *parent) } ApplicationListModel::~ApplicationListModel() -{ -} += default; QHash ApplicationListModel::roleNames() const { @@ -188,7 +187,7 @@ QVariant ApplicationListModel::data(const QModelIndex &index, int role) const Qt::ItemFlags ApplicationListModel::flags(const QModelIndex &index) const { if (!index.isValid()) - return 0; + return nullptr; return Qt::ItemIsDragEnabled|QAbstractItemModel::flags(index); } @@ -249,7 +248,7 @@ void ApplicationListModel::runApplication(const QString &storageId) KService::Ptr service = KService::serviceByStorageId(storageId); - KRun::runService(*service, QList(), 0); + KRun::runService(*service, QList(), nullptr); } QStringList ApplicationListModel::appOrder() const diff --git a/containments/homescreen/applicationlistmodel.h b/containments/homescreen/applicationlistmodel.h index a5094566..ddf65bf5 100644 --- a/containments/homescreen/applicationlistmodel.h +++ b/containments/homescreen/applicationlistmodel.h @@ -41,8 +41,8 @@ class ApplicationListModel : public QAbstractListModel { Q_PROPERTY(QStringList appOrder READ appOrder WRITE setAppOrder NOTIFY appOrderChanged) public: - ApplicationListModel(QObject *parent = 0); - virtual ~ApplicationListModel(); + ApplicationListModel(QObject *parent = nullptr); + ~ApplicationListModel() override; int rowCount(const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE; @@ -52,7 +52,7 @@ public: QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const Q_DECL_OVERRIDE; - Qt::ItemFlags flags(const QModelIndex &index) const; + Qt::ItemFlags flags(const QModelIndex &index) const override; QHash roleNames() const Q_DECL_OVERRIDE; diff --git a/containments/homescreen/homescreen.cpp b/containments/homescreen/homescreen.cpp index 01eb27af..452667e4 100644 --- a/containments/homescreen/homescreen.cpp +++ b/containments/homescreen/homescreen.cpp @@ -32,8 +32,7 @@ HomeScreen::HomeScreen(QObject *parent, const QVariantList &args) } HomeScreen::~HomeScreen() -{ -} += default; ApplicationListModel *HomeScreen::applicationListModel() { diff --git a/containments/homescreen/homescreen.h b/containments/homescreen/homescreen.h index 54cca947..6a7bbf18 100644 --- a/containments/homescreen/homescreen.h +++ b/containments/homescreen/homescreen.h @@ -33,7 +33,7 @@ class HomeScreen : public Plasma::Containment public: HomeScreen( QObject *parent, const QVariantList &args ); - ~HomeScreen(); + ~HomeScreen() override; ApplicationListModel *applicationListModel(); diff --git a/containments/panel/phonepanel.cpp b/containments/panel/phonepanel.cpp index 1a9c0e09..b1816a5b 100644 --- a/containments/panel/phonepanel.cpp +++ b/containments/panel/phonepanel.cpp @@ -30,8 +30,7 @@ PhonePanel::PhonePanel(QObject *parent, const QVariantList &args) } PhonePanel::~PhonePanel() -{ -} += default; void PhonePanel::executeCommand(const QString &command) { @@ -42,7 +41,7 @@ void PhonePanel::executeCommand(const QString &command) void PhonePanel::toggleTorch() { if (!m_running) { - gst_init(NULL, NULL); + gst_init(nullptr, nullptr); // create elements m_source = gst_element_factory_make("droidcamsrc", "source"); m_sink = gst_element_factory_make("fakesink", "sink"); diff --git a/containments/panel/phonepanel.h b/containments/panel/phonepanel.h index f4d89ef5..205b1f35 100644 --- a/containments/panel/phonepanel.h +++ b/containments/panel/phonepanel.h @@ -33,7 +33,7 @@ class PhonePanel : public Plasma::Containment public: PhonePanel( QObject *parent, const QVariantList &args ); - ~PhonePanel(); + ~PhonePanel() override; public Q_SLOTS: void executeCommand(const QString &command); diff --git a/containments/taskpanel/taskpanel.h b/containments/taskpanel/taskpanel.h index d0d84cc5..0863c4a9 100644 --- a/containments/taskpanel/taskpanel.h +++ b/containments/taskpanel/taskpanel.h @@ -47,7 +47,7 @@ class TaskPanel : public Plasma::Containment public: TaskPanel( QObject *parent, const QVariantList &args ); - ~TaskPanel(); + ~TaskPanel() override; QWindow *panel(); void setPanel(QWindow *panel); diff --git a/dialer/plugin/kpeoplehelper.h b/dialer/plugin/kpeoplehelper.h index 7e6528bf..b902acc8 100644 --- a/dialer/plugin/kpeoplehelper.h +++ b/dialer/plugin/kpeoplehelper.h @@ -47,11 +47,11 @@ public: }; Q_ENUMS(Role) - KPeopleHelper(QObject *parent = 0); - ~KPeopleHelper(); + KPeopleHelper(QObject *parent = nullptr); + ~KPeopleHelper() override; - virtual QVariant data(const QModelIndex &index, int role) const Q_DECL_OVERRIDE; - virtual QHash roleNames() const Q_DECL_OVERRIDE; + QVariant data(const QModelIndex &index, int role) const Q_DECL_OVERRIDE; + QHash roleNames() const Q_DECL_OVERRIDE; private: KPeople::PersonsModel *m_model; diff --git a/dialer/plugin/kpeoplehelperplugin.h b/dialer/plugin/kpeoplehelperplugin.h index 5808d4b1..271cea41 100644 --- a/dialer/plugin/kpeoplehelperplugin.h +++ b/dialer/plugin/kpeoplehelperplugin.h @@ -29,7 +29,7 @@ class KPeopleHelperPlugin : public QQmlExtensionPlugin Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface") public: - void registerTypes(const char *uri); + void registerTypes(const char *uri) override; }; diff --git a/dialer/src/call-handler.cpp b/dialer/src/call-handler.cpp index ace8f896..3742962c 100644 --- a/dialer/src/call-handler.cpp +++ b/dialer/src/call-handler.cpp @@ -54,8 +54,7 @@ CallHandler::CallHandler(DialerUtils *utils) } CallHandler::~CallHandler() -{ -} += default; bool CallHandler::bypassApproval() const { diff --git a/dialer/src/call-handler.h b/dialer/src/call-handler.h index d2049a99..ad4d62bb 100644 --- a/dialer/src/call-handler.h +++ b/dialer/src/call-handler.h @@ -26,16 +26,16 @@ class CallHandler : public QObject, public Tp::AbstractClientHandler Q_OBJECT public: CallHandler(DialerUtils *utils); - virtual ~CallHandler(); + ~CallHandler() override; - virtual bool bypassApproval() const; - virtual void handleChannels(const Tp::MethodInvocationContextPtr<> & context, + bool bypassApproval() const override; + void handleChannels(const Tp::MethodInvocationContextPtr<> & context, const Tp::AccountPtr & account, const Tp::ConnectionPtr & connection, const QList & channels, const QList & requestsSatisfied, const QDateTime & userActionTime, - const Tp::AbstractClientHandler::HandlerInfo & handlerInfo); + const Tp::AbstractClientHandler::HandlerInfo & handlerInfo) override; private: QList handledCallChannels; DialerUtils *m_dialerUtils; diff --git a/dialer/src/call-manager.cpp b/dialer/src/call-manager.cpp index 8b70e89d..234345ec 100644 --- a/dialer/src/call-manager.cpp +++ b/dialer/src/call-manager.cpp @@ -131,7 +131,7 @@ void CallManager::onCallStateChanged(Tp::CallState state) //show approver; (void) d->callChannel->setRinging(); if (!d->ringingNotification) { - d->ringingNotification = new KNotification("ringing", KNotification::Persistent | KNotification::LoopSound, 0); + d->ringingNotification = new KNotification("ringing", KNotification::Persistent | KNotification::LoopSound, nullptr); d->ringingNotification->setComponentName("plasma_dialer"); } d->ringingNotification->sendEvent(); @@ -180,7 +180,7 @@ void CallManager::onCallStateChanged(Tp::CallState state) qDebug() << "Adding notification"; d->missedCalls++; if (!d->callsNotification) { - d->callsNotification = new KNotification("callMissed", KNotification::Persistent, 0); + d->callsNotification = new KNotification("callMissed", KNotification::Persistent, nullptr); } d->callsNotification->setComponentName("plasma_dialer"); d->callsNotification->setIconName("call-start"); diff --git a/dialer/src/call-manager.h b/dialer/src/call-manager.h index 7e44eabb..df51e014 100644 --- a/dialer/src/call-manager.h +++ b/dialer/src/call-manager.h @@ -26,8 +26,8 @@ class CallManager : public QObject { Q_OBJECT public: - explicit CallManager(const Tp::CallChannelPtr &callChannel, DialerUtils *dialerUtils, QObject *parent = 0); - virtual ~CallManager(); + explicit CallManager(const Tp::CallChannelPtr &callChannel, DialerUtils *dialerUtils, QObject *parent = nullptr); + ~CallManager() override; private Q_SLOTS: void onCallStateChanged(Tp::CallState state); diff --git a/dialer/src/dialerutils.cpp b/dialer/src/dialerutils.cpp index ce413912..0a770944 100644 --- a/dialer/src/dialerutils.cpp +++ b/dialer/src/dialerutils.cpp @@ -50,8 +50,7 @@ DialerUtils::DialerUtils(const Tp::AccountPtr &simAccount, QObject *parent) } DialerUtils::~DialerUtils() -{ -} += default; void DialerUtils::dial(const QString &number) { diff --git a/dialer/src/dialerutils.h b/dialer/src/dialerutils.h index 4a28c934..6299ba53 100644 --- a/dialer/src/dialerutils.h +++ b/dialer/src/dialerutils.h @@ -36,8 +36,8 @@ class DialerUtils : public QObject public: - DialerUtils(const Tp::AccountPtr &simAccount, QObject *parent = 0); - virtual ~DialerUtils(); + DialerUtils(const Tp::AccountPtr &simAccount, QObject *parent = nullptr); + ~DialerUtils() override; QString callState() const; void setCallState(const QString &state); diff --git a/dialer/src/main.cpp b/dialer/src/main.cpp index 26c16a6f..5db51c04 100644 --- a/dialer/src/main.cpp +++ b/dialer/src/main.cpp @@ -151,13 +151,13 @@ int main(int argc, char **argv) const QString packagePath("org.kde.phone.dialer"); //usually we have an ApplicationWindow here, so we do not need to create a window by ourselves - KDeclarative::QmlObject *obj = new KDeclarative::QmlObject(); + auto *obj = new KDeclarative::QmlObject(); obj->setTranslationDomain(packagePath); obj->setInitializationDelayed(true); obj->loadPackage(packagePath); obj->engine()->rootContext()->setContextProperty("commandlineArguments", parser.positionalArguments()); - DialerUtils *dialerUtils = new DialerUtils(simAccount); + auto *dialerUtils = new DialerUtils(simAccount); obj->engine()->rootContext()->setContextProperty("dialerUtils", QVariant::fromValue(dialerUtils)); obj->completeInitialization();