Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Network
KIO Extras
Commits
35ce75f7
Commit
35ce75f7
authored
Aug 06, 2022
by
Harald Sitter
🏳️🌈
Browse files
mtp: don't else after return
makes clang-tidy happier
parent
386d01a0
Changes
2
Hide whitespace changes
Inline
Side-by-side
mtp/kio_mtp.cpp
View file @
35ce75f7
...
...
@@ -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
))
{
...
...
mtp/kiod_module/mtpstorage.cpp
View file @
35ce75f7
...
...
@@ -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
{};
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment