]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Determine the path of the trash-protocol correctly
authorPeter Penz <peter.penz19@gmail.com>
Sat, 17 Dec 2011 22:11:33 +0000 (23:11 +0100)
committerPeter Penz <peter.penz19@gmail.com>
Sat, 17 Dec 2011 22:11:59 +0000 (23:11 +0100)
src/kitemviews/kfileitemmodel.cpp

index 86ec5de89f379118bb55ec1d09e55f06209a0971..04ec349665aba7e6b607072d001c35ac7f7a223a 100644 (file)
@@ -1133,7 +1133,12 @@ QHash<QByteArray, QVariant> KFileItemModel::retrieveData(const KFileItem& item)
     }
 
     if (m_requestRole[PathRole]) {
-        data.insert("path", item.localPath());
+        if (item.url().protocol() == QLatin1String("trash")) {
+            const KIO::UDSEntry udsEntry = item.entry();
+            data.insert("path", udsEntry.stringValue(KIO::UDSEntry::UDS_EXTRA));
+        } else {
+            data.insert("path", item.localPath());
+        }
     }
 
     if (m_requestRole[IsExpandedRole]) {