]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/viewproperties.h
information sidebar fixes:
[dolphin.git] / src / viewproperties.h
index 7e48b923bf4a660b3f7095e063895f0781a797c2..65207afa0d06496c5b3a8ea2f1996d7d4e7b68d7 100644 (file)
@@ -1,6 +1,6 @@
 /***************************************************************************
- *   Copyright (C) 2006 by Peter Penz                                      *
- *   peter.penz@gmx.at                                                     *
+ *   Copyright (C) 2006 by Peter Penz (<peter.penz@gmx.at>)                *
+ *   Copyright (C) 2006 by Aaron J. Seigo (<aseigo@kde.org>)               *
  *                                                                         *
  *   This program is free software; you can redistribute it and/or modify  *
  *   it under the terms of the GNU General Public License as published by  *
 
 #include <dolphinview.h>
 #include <kurl.h>
-#include <qdatetime.h>
-
-#include "directoryviewpropertysettings.h"
+#include <libdolphin_export.h>
 
 class QFile;
-
+class ViewPropertySettings;
 /**
- * @brief Maintains the view properties like 'view mode' or 'show hidden files' for a directory.
+ * @brief Maintains the view properties like 'view mode' or
+ *        'show hidden files' for a directory.
  *
- * The view properties are automatically stored inside
- * the directory as hidden file called '.dolphinview'. To read out the view properties
- * just construct an instance by passing the Url of the directory:
+ * The view properties are automatically stored as part of the file
+ * .directory inside the corresponding path. To read out the view properties
+ * just construct an instance by passing the path of the directory:
  *
  * \code
  * ViewProperties props(KUrl("/home/peter/Documents"));
@@ -42,10 +41,14 @@ class QFile;
  * const bool showHiddenFiles = props.isShowHiddenFilesEnabled();
  * \endcode
  *
- * When modifying a view property, the '.dolphinview' file is automatically updated
+ * When modifying a view property, the '.directory' file is automatically updated
  * inside the destructor.
+ *
+ * If no .directory file is available or the global view mode is turned on
+ * (see GeneralSettings::globalViewMode()), the values from the global .directory file
+ * are used for initialization.
  */
-class ViewProperties
+class LIBDOLPHINPRIVATE_EXPORT ViewProperties
 {
 public:
     explicit ViewProperties(const KUrl& url);
@@ -60,12 +63,18 @@ public:
     void setShowHiddenFiles(bool show);
     bool showHiddenFiles() const;
 
+    void setCategorizedSorting(bool categorized);
+    bool categorizedSorting() const;
+
     void setSorting(DolphinView::Sorting sorting);
     DolphinView::Sorting sorting() const;
 
     void setSortOrder(Qt::SortOrder sortOrder);
     Qt::SortOrder sortOrder() const;
 
+    void setAdditionalInfo(KFileItemDelegate::AdditionalInformation info);
+    KFileItemDelegate::AdditionalInformation additionalInfo() const;
+
     /**
      * Sets the directory properties view mode, show preview,
      * show hidden files, sorting and sort order like
@@ -92,6 +101,15 @@ public:
      */
     void save();
 
+    /**
+     * Returns the URL of the directory, where the mirrored view properties
+     * are stored into. Mirrored view properties are used if:
+     * - there is no write access for storing the view properties into
+     *   the original directory
+     * - for non local directories
+     */
+    static KUrl mirroredDirectory();
+
 private:
     /**
      * Returns the destination directory path where the view
@@ -100,8 +118,7 @@ private:
      */
     QString destinationDir(const QString& subDir) const;
 
-    ViewProperties(const ViewProperties& props);
-    ViewProperties& operator= (const ViewProperties& props);
+    Q_DISABLE_COPY(ViewProperties)
 
 private:
     bool m_changedProps;