X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/5517e4cf10c8aee590b404072aebaffb55bafec3..ca5d3fde114dfdb280e46995e8a425d3ec558596:/src/views/viewproperties.cpp diff --git a/src/views/viewproperties.cpp b/src/views/viewproperties.cpp index d5330ffaa..d0c6fcf1e 100644 --- a/src/views/viewproperties.cpp +++ b/src/views/viewproperties.cpp @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2006-2010 by Peter Penz * + * Copyright (C) 2006-2010 by Peter Penz * * Copyright (C) 2006 by Aaron J. Seigo * * * * This program is free software; you can redistribute it and/or modify * @@ -24,10 +24,10 @@ #include "dolphin_directoryviewpropertysettings.h" #include "dolphin_generalsettings.h" -#include -#include -#include -#include +#include +#include +#include +#include #include #include @@ -49,15 +49,19 @@ ViewProperties::ViewProperties(const KUrl& url) : { GeneralSettings* settings = DolphinSettings::instance().generalSettings(); const bool useGlobalViewProps = settings->globalViewProps(); + bool useDetailsViewWithPath = 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, // we store the properties information in a local file. - const bool isSearchUrl = url.protocol().contains("search"); - if (isSearchUrl) { - m_filePath = destinationDir("search"); - } else if (useGlobalViewProps) { + if (useGlobalViewProps) { m_filePath = destinationDir("global"); + } else if (url.protocol().contains("search")) { + m_filePath = destinationDir("search"); + useDetailsViewWithPath = true; + } else if (url.protocol() == QLatin1String("trash")) { + m_filePath = destinationDir("trash"); + useDetailsViewWithPath = true; } else if (url.isLocalFile()) { m_filePath = url.toLocalFile(); const QFileInfo info(m_filePath); @@ -73,11 +77,11 @@ ViewProperties::ViewProperties(const KUrl& url) : // If the .directory file does not exist or the timestamp is too old, // use default values instead. - const bool useDefaultProps = (!useGlobalViewProps || isSearchUrl) && + const bool useDefaultProps = (!useGlobalViewProps || useDetailsViewWithPath) && (!QFileInfo(file).exists() || (m_node->timestamp() < settings->viewPropsTimestamp())); if (useDefaultProps) { - if (isSearchUrl) { + if (useDetailsViewWithPath) { setViewMode(DolphinView::DetailsView); setAdditionalInfo(KFileItemDelegate::InformationList() << KFileItemDelegate::LocalPathOrUrl); } else {