#include <assert.h>
-#include <qdatetime.h>
-#include <qdir.h>
-#include <qfile.h>
+#include <QDateTime>
+#include <QFile>
#include <klocale.h>
#include <kstandarddirs.h>
#include <kinstance.h>
#include "viewproperties.h"
-
#include "dolphinsettings.h"
+#include "generalsettings.h"
#define FILE_NAME "/.directory"
return;
}
- // we try and save it to a file 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
+ // We try and save it to a file 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.
QString rootDir("/"); // TODO: should this be set to the root of the bookmark, if any?
if (cleanUrl.isLocalFile()) {
QFileInfo info(m_filepath);
return static_cast<DolphinView::Mode>(m_node->viewMode());
}
-void ViewProperties::setShowHiddenFilesEnabled(bool show)
+void ViewProperties::setShowPreview(bool show)
+{
+ if (m_node->showPreview() != show) {
+ m_node->setShowPreview(show);
+ updateTimeStamp();
+ }
+}
+
+bool ViewProperties::showPreview() const
+{
+ return m_node->showPreview();
+}
+
+
+void ViewProperties::setShowHiddenFiles(bool show)
{
if (m_node->showHiddenFiles() != show) {
m_node->setShowHiddenFiles(show);
}
}
-bool ViewProperties::isShowHiddenFilesEnabled() const
+bool ViewProperties::showHiddenFiles() const
{
return m_node->showHiddenFiles();
}
void ViewProperties::save()
{
- KStandardDirs::makeDir(m_filepath);
- m_node->writeConfig();
- m_changedProps = false;
+ const bool rememberSettings = !DolphinSettings::instance().generalSettings()->globalViewProps();
+ if (rememberSettings) {
+ KStandardDirs::makeDir(m_filepath);
+ m_node->writeConfig();
+ m_changedProps = false;
+ }
}
ViewProperties::ViewProperties(const ViewProperties& props)