Commit 35ce75f7 authored by Harald Sitter's avatar Harald Sitter 🏳️‍🌈
Browse files

mtp: don't else after return

makes clang-tidy happier
parent 386d01a0
......@@ -150,7 +150,8 @@ enum MTPWorker::Url MTPWorker::checkUrl(const QUrl &url)
}
if (url.path().startsWith(QLatin1Char('/'))) {
return Url::Valid;
} else if (url.scheme() == QLatin1String("mtp") && url.path().isEmpty()) {
}
if (url.scheme() == QLatin1String("mtp") && url.path().isEmpty()) {
QUrl newUrl = url;
newUrl.setPath(QLatin1String("/"));
redirection(newUrl);
......@@ -487,7 +488,8 @@ WorkerResult MTPWorker::copy(const QUrl &src, const QUrl &dest, int, JobFlags fl
// MTP doesn't support moving files directly on the device, so we have to download and then upload...
return WorkerResult::fail(ERR_UNSUPPORTED_ACTION, i18n("Cannot copy/move files on the device itself"));
} else if (src.scheme() == QLatin1String("file") && dest.scheme() == QLatin1String("mtp")) {
}
if (src.scheme() == QLatin1String("file") && dest.scheme() == QLatin1String("mtp")) {
// copy from filesystem to the device
switch (checkUrl(dest)) {
......@@ -557,7 +559,8 @@ WorkerResult MTPWorker::copy(const QUrl &src, const QUrl &dest, int, JobFlags fl
}
}
return WorkerResult::fail(KIO::ERR_CANNOT_WRITE, urlFileName(src));
} else if (src.scheme() == QLatin1String("mtp") && dest.scheme() == QLatin1String("file")) {
}
if (src.scheme() == QLatin1String("mtp") && dest.scheme() == QLatin1String("file")) {
// copy from the device to filesystem
switch (checkUrl(src)) {
......
......@@ -433,10 +433,9 @@ quint32 MTPStorage::queryPath(const QString &path, int timeToLive)
item.first = dateTime.addSecs(timeToLive);
m_cache.insert(path, item);
return item.second;
} else {
m_cache.remove(path);
return 0;
}
m_cache.remove(path);
return 0;
}
return 0;
......@@ -468,7 +467,8 @@ KMTPFileList MTPStorage::getFilesAndFolders(const QString &path, int &result)
if (!file.isValid()) {
result = 1; // not existing
return {};
} else if (!file.isFolder()) {
}
if (!file.isFolder()) {
result = 2; // is file
return {};
}
......
Supports Markdown
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