mirror of
https://bitbucket.org/smil3y/kde-workspace.git
synced 2025-02-23 10:22:49 +00:00
kioslave: mtp slave root directory stat() fix
MTPSlave::getPath() returns a null pair for the root path so pair.first was always null Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
047b7f68c7
commit
960bf5ff91
1 changed files with 9 additions and 10 deletions
|
@ -216,9 +216,8 @@ int MTPSlave::checkUrl(const KUrl& url, bool redirect)
|
|||
redirection(newUrl);
|
||||
|
||||
return 1;
|
||||
} else {
|
||||
return 2;
|
||||
}
|
||||
return 2;
|
||||
} else if (url.path().startsWith(QLatin1Char('/'))) {
|
||||
return 0;
|
||||
}
|
||||
|
@ -376,16 +375,16 @@ void MTPSlave::stat(const KUrl& url)
|
|||
QPair<void*, LIBMTP_mtpdevice_t*> pair = getPath(url.path());
|
||||
UDSEntry entry;
|
||||
|
||||
if (pair.first) {
|
||||
// Root
|
||||
if (pathItems.size() < 1) {
|
||||
entry.insert(UDSEntry::UDS_NAME, QLatin1String("mtp:///"));
|
||||
entry.insert(UDSEntry::UDS_URL, QLatin1String("mtp:///"));
|
||||
entry.insert(UDSEntry::UDS_NAME, QLatin1String("mtp:/"));
|
||||
entry.insert(UDSEntry::UDS_URL, QLatin1String("mtp:/"));
|
||||
entry.insert(UDSEntry::UDS_FILE_TYPE, S_IFDIR );
|
||||
entry.insert(UDSEntry::UDS_ACCESS, S_IRUSR | S_IRGRP | S_IROTH | S_IXUSR | S_IXGRP | S_IXOTH);
|
||||
entry.insert(UDSEntry::UDS_MIME_TYPE, QLatin1String("inode/directory"));
|
||||
} else if (pair.first) {
|
||||
// Device
|
||||
} else if (pathItems.size() < 2) {
|
||||
if (pathItems.size() < 2) {
|
||||
getEntry(entry, pair.second, url.url());
|
||||
// Storage
|
||||
} else if (pathItems.size() < 3) {
|
||||
|
|
Loading…
Add table
Reference in a new issue