Clazy: Fix some warnings

This commit is contained in:
Hannah von Reth 2020-07-23 13:51:36 +02:00 committed by Kevin Ottens
parent 3caf8276a2
commit fd6146d09e
No known key found for this signature in database
GPG key ID: 074BBBCB8DECC9E2
2 changed files with 4 additions and 5 deletions

View file

@ -141,7 +141,7 @@ QString DiscoveryPhase::adjustRenamedPath(const QString &original, SyncFileItem:
return OCC::adjustRenamedPath(d == SyncFileItem::Down ? _renamedItemsRemote : _renamedItemsLocal, original); return OCC::adjustRenamedPath(d == SyncFileItem::Down ? _renamedItemsRemote : _renamedItemsLocal, original);
} }
QString adjustRenamedPath(const QMap<QString, QString> renamedItems, const QString original) QString adjustRenamedPath(const QMap<QString, QString> &renamedItems, const QString &original)
{ {
int slashPos = original.size(); int slashPos = original.size();
while ((slashPos = original.lastIndexOf('/', slashPos - 1)) > 0) { while ((slashPos = original.lastIndexOf('/', slashPos - 1)) > 0) {
@ -420,7 +420,7 @@ static void propertyMapToRemoteInfo(const QMap<QString, QString> &map, RemoteInf
} }
} }
void DiscoverySingleDirectoryJob::directoryListingIteratedSlot(QString file, const QMap<QString, QString> &map) void DiscoverySingleDirectoryJob::directoryListingIteratedSlot(const QString &file, const QMap<QString, QString> &map)
{ {
if (!_ignoredFirst) { if (!_ignoredFirst) {
// The first entry is for the folder itself, we should process it differently. // The first entry is for the folder itself, we should process it differently.
@ -493,7 +493,6 @@ void DiscoverySingleDirectoryJob::lsJobFinishedWithErrorSlot(QNetworkReply *r)
{ {
QString contentType = r->header(QNetworkRequest::ContentTypeHeader).toString(); QString contentType = r->header(QNetworkRequest::ContentTypeHeader).toString();
int httpCode = r->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt(); int httpCode = r->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt();
QString httpReason = r->attribute(QNetworkRequest::HttpReasonPhraseAttribute).toString();
QString msg = r->errorString(); QString msg = r->errorString();
qCWarning(lcDiscovery) << "LSCOL job error" << r->errorString() << httpCode << r->error(); qCWarning(lcDiscovery) << "LSCOL job error" << r->errorString() << httpCode << r->error();
if (r->error() == QNetworkReply::NoError if (r->error() == QNetworkReply::NoError

View file

@ -127,7 +127,7 @@ signals:
void finished(const HttpResult<QVector<RemoteInfo>> &result); void finished(const HttpResult<QVector<RemoteInfo>> &result);
private slots: private slots:
void directoryListingIteratedSlot(QString, const QMap<QString, QString> &); void directoryListingIteratedSlot(const QString &, const QMap<QString, QString> &);
void lsJobFinishedWithoutErrorSlot(); void lsJobFinishedWithoutErrorSlot();
void lsJobFinishedWithErrorSlot(QNetworkReply *); void lsJobFinishedWithErrorSlot(QNetworkReply *);
@ -273,5 +273,5 @@ signals:
}; };
/// Implementation of DiscoveryPhase::adjustRenamedPath /// Implementation of DiscoveryPhase::adjustRenamedPath
QString adjustRenamedPath(const QMap<QString, QString> renamedItems, const QString original); QString adjustRenamedPath(const QMap<QString, QString> &renamedItems, const QString &original);
} }