From 52ecc82bdc81a67a4e8d4915bc30f2dcbe8001d1 Mon Sep 17 00:00:00 2001 From: Bhushan Shah Date: Wed, 20 Nov 2019 14:01:54 +0530 Subject: [PATCH] Fix clazy issues --- containments/homescreen/applicationlistmodel.cpp | 10 +++++----- containments/homescreen/applicationlistmodel.h | 2 +- dialer/src/call-manager.cpp | 2 +- dialer/src/dialerutils.cpp | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/containments/homescreen/applicationlistmodel.cpp b/containments/homescreen/applicationlistmodel.cpp index b4b844c3..2b3ce889 100644 --- a/containments/homescreen/applicationlistmodel.cpp +++ b/containments/homescreen/applicationlistmodel.cpp @@ -43,8 +43,8 @@ ApplicationListModel::ApplicationListModel(HomeScreen *parent) m_homeScreen(parent) { //can't use the new syntax as this signal is overloaded - connect(KSycoca::self(), SIGNAL(databaseChanged(const QStringList &)), - this, SLOT(sycocaDbChanged(const QStringList &))); + connect(KSycoca::self(), SIGNAL(databaseChanged(QStringList)), + this, SLOT(sycocaDbChanged(QStringList))); loadSettings(); } @@ -60,7 +60,7 @@ void ApplicationListModel::loadSettings() m_maxFavoriteCount = m_homeScreen->config().readEntry("MaxFavoriteCount", 5); int i = 0; - for (auto app : m_appOrder) { + for (const QString &app : qAsConst(m_appOrder)) { m_appPositions[app] = i; ++i; } @@ -219,7 +219,7 @@ Qt::ItemFlags ApplicationListModel::flags(const QModelIndex &index) const { if (!index.isValid()) return nullptr; - return Qt::ItemIsDragEnabled|QAbstractItemModel::flags(index); + return Qt::ItemIsDragEnabled|QAbstractListModel::flags(index); } int ApplicationListModel::rowCount(const QModelIndex &parent) const @@ -306,7 +306,7 @@ void ApplicationListModel::moveItem(int row, int destination) m_appOrder.clear(); m_appPositions.clear(); int i = 0; - for (auto app : m_applicationList) { + for (const ApplicationData &app : qAsConst(m_applicationList)) { m_appOrder << app.storageId; m_appPositions[app.storageId] = i; ++i; diff --git a/containments/homescreen/applicationlistmodel.h b/containments/homescreen/applicationlistmodel.h index 571aaa41..af6edeab 100644 --- a/containments/homescreen/applicationlistmodel.h +++ b/containments/homescreen/applicationlistmodel.h @@ -86,7 +86,7 @@ public: QHash roleNames() const Q_DECL_OVERRIDE; - Q_INVOKABLE void setLocation(int row, LauncherLocation location); + Q_INVOKABLE void setLocation(int row, ApplicationListModel::LauncherLocation location); Q_INVOKABLE void moveItem(int row, int order); diff --git a/dialer/src/call-manager.cpp b/dialer/src/call-manager.cpp index cb76b4ac..f08f9a96 100644 --- a/dialer/src/call-manager.cpp +++ b/dialer/src/call-manager.cpp @@ -162,7 +162,7 @@ void CallManager::onCallStateChanged(Tp::CallState state) } d->dialerUtils->setCallState("active"); d->callTimer = new QTimer(this); - connect(d->callTimer, &QTimer::timeout, [=]() { + connect(d->callTimer, &QTimer::timeout, d->callTimer, [=]() { d->dialerUtils->setCallDuration(d->dialerUtils->callDuration() + 1); }); d->callTimer->start(1000); diff --git a/dialer/src/dialerutils.cpp b/dialer/src/dialerutils.cpp index 43743212..83d462df 100644 --- a/dialer/src/dialerutils.cpp +++ b/dialer/src/dialerutils.cpp @@ -57,7 +57,7 @@ void DialerUtils::dial(const QString &number) // FIXME: this should be replaced by kpeople thing qDebug() << "Starting call..."; Tp::PendingChannelRequest *pendingChannel = m_simAccount->ensureAudioCall(number); - connect(pendingChannel, &Tp::PendingChannelRequest::finished, [=](){ + connect(pendingChannel, &Tp::PendingChannelRequest::finished, pendingChannel, [=](){ if (pendingChannel->isError()) { qWarning() << "Error when requesting channel" << pendingChannel->errorMessage(); setCallState("failed"); @@ -78,7 +78,7 @@ const QString DialerUtils::formatNumber(const QString& number) QLocale locale; QStringList qcountry = locale.name().split('_'); QString countrycode(qcountry.constLast()); - const char* country = countrycode.toUtf8().constData(); + string country = countrycode.toUtf8().constData(); PhoneNumberUtil* util = PhoneNumberUtil::GetInstance(); AsYouTypeFormatter* formatter = util->PhoneNumberUtil::GetAsYouTypeFormatter(country);