Fix clazy issues

This commit is contained in:
Bhushan Shah 2019-11-20 14:01:54 +05:30
parent 410e222bc8
commit 52ecc82bdc
4 changed files with 9 additions and 9 deletions

View file

@ -43,8 +43,8 @@ ApplicationListModel::ApplicationListModel(HomeScreen *parent)
m_homeScreen(parent) m_homeScreen(parent)
{ {
//can't use the new syntax as this signal is overloaded //can't use the new syntax as this signal is overloaded
connect(KSycoca::self(), SIGNAL(databaseChanged(const QStringList &)), connect(KSycoca::self(), SIGNAL(databaseChanged(QStringList)),
this, SLOT(sycocaDbChanged(const QStringList &))); this, SLOT(sycocaDbChanged(QStringList)));
loadSettings(); loadSettings();
} }
@ -60,7 +60,7 @@ void ApplicationListModel::loadSettings()
m_maxFavoriteCount = m_homeScreen->config().readEntry("MaxFavoriteCount", 5); m_maxFavoriteCount = m_homeScreen->config().readEntry("MaxFavoriteCount", 5);
int i = 0; int i = 0;
for (auto app : m_appOrder) { for (const QString &app : qAsConst(m_appOrder)) {
m_appPositions[app] = i; m_appPositions[app] = i;
++i; ++i;
} }
@ -219,7 +219,7 @@ Qt::ItemFlags ApplicationListModel::flags(const QModelIndex &index) const
{ {
if (!index.isValid()) if (!index.isValid())
return nullptr; return nullptr;
return Qt::ItemIsDragEnabled|QAbstractItemModel::flags(index); return Qt::ItemIsDragEnabled|QAbstractListModel::flags(index);
} }
int ApplicationListModel::rowCount(const QModelIndex &parent) const int ApplicationListModel::rowCount(const QModelIndex &parent) const
@ -306,7 +306,7 @@ void ApplicationListModel::moveItem(int row, int destination)
m_appOrder.clear(); m_appOrder.clear();
m_appPositions.clear(); m_appPositions.clear();
int i = 0; int i = 0;
for (auto app : m_applicationList) { for (const ApplicationData &app : qAsConst(m_applicationList)) {
m_appOrder << app.storageId; m_appOrder << app.storageId;
m_appPositions[app.storageId] = i; m_appPositions[app.storageId] = i;
++i; ++i;

View file

@ -86,7 +86,7 @@ public:
QHash<int, QByteArray> roleNames() const Q_DECL_OVERRIDE; QHash<int, QByteArray> 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); Q_INVOKABLE void moveItem(int row, int order);

View file

@ -162,7 +162,7 @@ void CallManager::onCallStateChanged(Tp::CallState state)
} }
d->dialerUtils->setCallState("active"); d->dialerUtils->setCallState("active");
d->callTimer = new QTimer(this); 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->dialerUtils->setCallDuration(d->dialerUtils->callDuration() + 1);
}); });
d->callTimer->start(1000); d->callTimer->start(1000);

View file

@ -57,7 +57,7 @@ void DialerUtils::dial(const QString &number)
// FIXME: this should be replaced by kpeople thing // FIXME: this should be replaced by kpeople thing
qDebug() << "Starting call..."; qDebug() << "Starting call...";
Tp::PendingChannelRequest *pendingChannel = m_simAccount->ensureAudioCall(number); Tp::PendingChannelRequest *pendingChannel = m_simAccount->ensureAudioCall(number);
connect(pendingChannel, &Tp::PendingChannelRequest::finished, [=](){ connect(pendingChannel, &Tp::PendingChannelRequest::finished, pendingChannel, [=](){
if (pendingChannel->isError()) { if (pendingChannel->isError()) {
qWarning() << "Error when requesting channel" << pendingChannel->errorMessage(); qWarning() << "Error when requesting channel" << pendingChannel->errorMessage();
setCallState("failed"); setCallState("failed");
@ -78,7 +78,7 @@ const QString DialerUtils::formatNumber(const QString& number)
QLocale locale; QLocale locale;
QStringList qcountry = locale.name().split('_'); QStringList qcountry = locale.name().split('_');
QString countrycode(qcountry.constLast()); QString countrycode(qcountry.constLast());
const char* country = countrycode.toUtf8().constData(); string country = countrycode.toUtf8().constData();
PhoneNumberUtil* util = PhoneNumberUtil::GetInstance(); PhoneNumberUtil* util = PhoneNumberUtil::GetInstance();
AsYouTypeFormatter* formatter = util->PhoneNumberUtil::GetAsYouTypeFormatter(country); AsYouTypeFormatter* formatter = util->PhoneNumberUtil::GetAsYouTypeFormatter(country);