]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/views/dolphinmodel.cpp
- When showing the trash content, use the details view with path as default view
[dolphin.git] / src / views / dolphinmodel.cpp
index 137274e0dffa7e12572568578ce3ed5e15807c72..6474a4f3c639940227b49e667ea443bbfbb8d650 100644 (file)
@@ -104,8 +104,12 @@ QVariant DolphinModel::data(const QModelIndex& index, int role) const
         case DolphinModel::LocalPathOrUrl:
             const KDirModel *dirModel = qobject_cast<const KDirModel*>(index.model());
             const KFileItem item = dirModel->itemForIndex(index);
-            return item.localPath();
-            break;
+            const KUrl url = item.mostLocalUrl();
+            if (url.protocol() == QLatin1String("trash")) {
+                const KIO::UDSEntry udsEntry = item.entry();
+                return udsEntry.stringValue(KIO::UDSEntry::UDS_EXTRA);
+            }
+            return url.directory();
         }
         break;