Commit 6b9991bb authored by Elvis Angelaccio's avatar Elvis Angelaccio
Browse files

Fix paste action with KIO >= 5.25

After 5.25, KIO::pasteActionText() (called by Dolphin) no longer allows null
KFileItem destinations, so we need to explicitly create a writable UDSEntry for
"."

CCBUG: 366795
parent d80cc83b
...@@ -183,7 +183,7 @@ KIO::UDSEntry KIOGDrive::fileToUDSEntry(const FilePtr &origFile, const QString & ...@@ -183,7 +183,7 @@ KIO::UDSEntry KIOGDrive::fileToUDSEntry(const FilePtr &origFile, const QString &
entry.insert(KIO::UDSEntry::UDS_ACCESS, S_IRUSR | S_IRGRP | S_IROTH); entry.insert(KIO::UDSEntry::UDS_ACCESS, S_IRUSR | S_IRGRP | S_IROTH);
} }
} else { } else {
entry.insert(KIO::UDSEntry::UDS_ACCESS, S_IRUSR | S_IXUSR | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH); entry.insert(KIO::UDSEntry::UDS_ACCESS, S_IRUSR | S_IWUSR | S_IXUSR | S_IRGRP | S_IWGRP | S_IXGRP | S_IROTH | S_IXOTH);
} }
return entry; return entry;
...@@ -417,6 +417,14 @@ void KIOGDrive::listDir(const QUrl &url) ...@@ -417,6 +417,14 @@ void KIOGDrive::listDir(const QUrl &url)
m_cache.insertPath(path + file->title(), file->id()); m_cache.insertPath(path + file->title(), file->id());
} }
// We also need a non-null and writable UDSentry for "."
KIO::UDSEntry entry;
entry.insert(KIO::UDSEntry::UDS_NAME, QStringLiteral("."));
entry.insert(KIO::UDSEntry::UDS_FILE_TYPE, S_IFDIR);
entry.insert(KIO::UDSEntry::UDS_SIZE, 0);
entry.insert(KIO::UDSEntry::UDS_ACCESS, S_IRUSR | S_IWUSR | S_IXUSR | S_IRGRP | S_IWGRP | S_IXGRP | S_IROTH | S_IXOTH);
listEntry(entry);
finished(); finished();
} }
......
Markdown is supported
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