Commit 47bcdee0 authored by Jonah Brüchert's avatar Jonah Brüchert 🌳

Modernize using clang-tidy

parent c614e322
......@@ -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);
......
......@@ -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();
......
......@@ -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
......@@ -46,8 +46,7 @@ ApplicationListModel::ApplicationListModel(QObject *parent)
}
ApplicationListModel::~ApplicationListModel()
{
}
= default;
QHash<int, QByteArray> 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<QUrl>(), 0);
KRun::runService(*service, QList<QUrl>(), nullptr);
}
QStringList ApplicationListModel::appOrder() const
......
......@@ -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<int, QByteArray> roleNames() const Q_DECL_OVERRIDE;
......
......@@ -32,8 +32,7 @@ HomeScreen::HomeScreen(QObject *parent, const QVariantList &args)
}
HomeScreen::~HomeScreen()
{
}
= default;
ApplicationListModel *HomeScreen::applicationListModel()
{
......
......@@ -33,7 +33,7 @@ class HomeScreen : public Plasma::Containment
public:
HomeScreen( QObject *parent, const QVariantList &args );
~HomeScreen();
~HomeScreen() override;
ApplicationListModel *applicationListModel();
......
......@@ -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");
......
......@@ -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);
......
......@@ -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);
......
......@@ -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<int, QByteArray> roleNames() const Q_DECL_OVERRIDE;
QVariant data(const QModelIndex &index, int role) const Q_DECL_OVERRIDE;
QHash<int, QByteArray> roleNames() const Q_DECL_OVERRIDE;
private:
KPeople::PersonsModel *m_model;
......
......@@ -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;
};
......
......@@ -54,8 +54,7 @@ CallHandler::CallHandler(DialerUtils *utils)
}
CallHandler::~CallHandler()
{
}
= default;
bool CallHandler::bypassApproval() const
{
......
......@@ -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<Tp::ChannelPtr> & channels,
const QList<Tp::ChannelRequestPtr> & requestsSatisfied,
const QDateTime & userActionTime,
const Tp::AbstractClientHandler::HandlerInfo & handlerInfo);
const Tp::AbstractClientHandler::HandlerInfo & handlerInfo) override;
private:
QList<Tp::CallChannelPtr> handledCallChannels;
DialerUtils *m_dialerUtils;
......
......@@ -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");
......
......@@ -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);
......
......@@ -50,8 +50,7 @@ DialerUtils::DialerUtils(const Tp::AccountPtr &simAccount, QObject *parent)
}
DialerUtils::~DialerUtils()
{
}
= default;
void DialerUtils::dial(const QString &number)
{
......
......@@ -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);
......
......@@ -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();
......
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