GeneralSettings* settings = GeneralSettings::self();
const bool useGlobalViewProps = settings->globalViewProps() || url.isEmpty();
bool useDetailsViewWithPath = false;
+ bool useRecentDocumentsView = false;
+ bool useDownloadsView = false;
// We try and save it to the file .directory in the directory being viewed.
// If the directory is not writable by the user or the directory is not local,
} else if (url.scheme() == QLatin1String("trash")) {
m_filePath = destinationDir(QStringLiteral("trash"));
useDetailsViewWithPath = true;
+ } else if (url.scheme() == QLatin1String("recentdocuments")) {
+ m_filePath = destinationDir(QStringLiteral("recentdocuments"));
+ useRecentDocumentsView = true;
} else if (url.isLocalFile()) {
m_filePath = url.toLocalFile();
#endif
m_filePath = destinationDir(QStringLiteral("local")) + m_filePath;
}
+
+ if (m_filePath == QStandardPaths::writableLocation(QStandardPaths::DownloadLocation)) {
+ useDownloadsView = true;
+ }
} else {
m_filePath = destinationDir(QStringLiteral("remote")) + m_filePath;
}
if (useDetailsViewWithPath) {
setViewMode(DolphinView::DetailsView);
setVisibleRoles({"path"});
+ } else if (useRecentDocumentsView || useDownloadsView) {
+ setSortRole(QByteArrayLiteral("modificationtime"));
+ setSortOrder(Qt::DescendingOrder);
+
+ if (useRecentDocumentsView) {
+ setViewMode(DolphinView::DetailsView);
+ setVisibleRoles({QByteArrayLiteral("path")});
+ } else if (useDownloadsView) {
+ setSortFoldersFirst(false);
+ setGroupedSorting(true);
+ }
} else {
// The global view-properties act as default for directories without
// any view-property configuration. Constructing a ViewProperties