Fix failed to open trash://

This commit is contained in:
reionwong 2021-09-26 23:50:32 +08:00
parent becd1c3e39
commit 683f5a28b1

View file

@ -302,7 +302,7 @@ void FolderModel::setUrl(const QString &url)
} }
// TODO: selected ? // TODO: selected ?
if (info.isFile()) { if (info.isFile() && !url.startsWith("trash:///")) {
resolvedNewUrl = QUrl::fromLocalFile(info.dir().path()); resolvedNewUrl = QUrl::fromLocalFile(info.dir().path());
} }
@ -315,7 +315,7 @@ void FolderModel::setUrl(const QString &url)
m_pathHistory.append(resolvedNewUrl); m_pathHistory.append(resolvedNewUrl);
beginResetModel(); beginResetModel();
m_url = resolvedNewUrl.toLocalFile(); m_url = resolvedNewUrl.toString();
m_dirModel->dirLister()->openUrl(resolvedNewUrl); m_dirModel->dirLister()->openUrl(resolvedNewUrl);
clearDragImages(); clearDragImages();
m_dragIndexes.clear(); m_dragIndexes.clear();