From 683f5a28b15e0dc7e2bc2fecc06d6e6902a46315 Mon Sep 17 00:00:00 2001 From: reionwong Date: Sun, 26 Sep 2021 23:50:32 +0800 Subject: [PATCH] Fix failed to open trash:// --- model/foldermodel.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/model/foldermodel.cpp b/model/foldermodel.cpp index 7f1883d..718d2b8 100644 --- a/model/foldermodel.cpp +++ b/model/foldermodel.cpp @@ -302,7 +302,7 @@ void FolderModel::setUrl(const QString &url) } // TODO: selected ? - if (info.isFile()) { + if (info.isFile() && !url.startsWith("trash:///")) { resolvedNewUrl = QUrl::fromLocalFile(info.dir().path()); } @@ -315,7 +315,7 @@ void FolderModel::setUrl(const QString &url) m_pathHistory.append(resolvedNewUrl); beginResetModel(); - m_url = resolvedNewUrl.toLocalFile(); + m_url = resolvedNewUrl.toString(); m_dirModel->dirLister()->openUrl(resolvedNewUrl); clearDragImages(); m_dragIndexes.clear();