From 445f0b64bdd34e39f0565ef870937ebd3d5dfa61 Mon Sep 17 00:00:00 2001 From: Peter Penz Date: Sun, 7 Jan 2007 09:47:05 +0000 Subject: Allow that Dolphin can also be used with global view properties. Per default Dolphin remembers the view properties for each directory, but from the feedback I've got there is a not ignorable amount of people who prefer having global view properties instead. svn path=/trunk/playground/utils/dolphin/; revision=620774 --- src/viewproperties.h | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) (limited to 'src/viewproperties.h') diff --git a/src/viewproperties.h b/src/viewproperties.h index 992429241..1681b7890 100644 --- a/src/viewproperties.h +++ b/src/viewproperties.h @@ -66,6 +66,13 @@ public: void setSortOrder(Qt::SortOrder sortOrder); Qt::SortOrder sortOrder() const; + /** + * Sets the directory properties view mode, show preview, + * show hidden files, sorting and sort order like + * set in \a props. + */ + void setDirProperties(const ViewProperties& props); + /** * If \a autoSave is true, the properties are automatically * saved when the destructor is called. Per default autosaving @@ -80,23 +87,27 @@ public: * Saves the view properties for the directory specified * in the constructor. The method is automatically * invoked in the destructor, if - * ViewProperties::isAutoSaveEnabled() returns true. - * - * Note that the saving of the properties will be ignored - * if GeneralSettings::globalViewProps() returns true: in - * this case view properties may not be remembered for - * each directory. + * ViewProperties::isAutoSaveEnabled() returns true and + * at least one property has been changed. */ void save(); +private: + /** + * Returns the destination directory path where the view + * properties are stored. \a subDir specifies the used sub + * directory. + */ + QString destinationDir(const QString& subDir) const; + + ViewProperties(const ViewProperties& props); + ViewProperties& operator= (const ViewProperties& props); + private: bool m_changedProps; bool m_autoSave; QString m_filepath; ViewPropertySettings* m_node; - - ViewProperties(const ViewProperties& props); - ViewProperties& operator= (const ViewProperties& props); }; #endif -- cgit v1.3