]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/views/viewproperties.h
First step to introduce dynamic roles
[dolphin.git] / src / views / viewproperties.h
index 2db67c0f390f74098d2b0c9262c61cb31ec33ee2..b46249eb2b520113425a40dfe558a8f791bbad03 100644 (file)
@@ -1,5 +1,5 @@
 /***************************************************************************
- *   Copyright (C) 2006-2010 by Peter Penz <peter.penz@gmx.at>             *
+ *   Copyright (C) 2006-2010 by Peter Penz <peter.penz19@gmail.com>        *
  *   Copyright (C) 2006 by Aaron J. Seigo <aseigo@kde.org>                 *
  *                                                                         *
  *   This program is free software; you can redistribute it and/or modify  *
@@ -22,7 +22,7 @@
 #define VIEWPROPERTIES_H
 
 #include <views/dolphinview.h>
-#include <kurl.h>
+#include <KUrl>
 #include <libdolphin_export.h>
 
 class ViewPropertySettings;
@@ -37,7 +37,7 @@ class ViewPropertySettings;
  * \code
  * ViewProperties props(KUrl("/home/peter/Documents"));
  * const DolphinView::Mode mode = props.viewMode();
- * const bool showHiddenFiles = props.isShowHiddenFilesEnabled();
+ * const bool hiddenFilesShown = props.hiddenFilesShown();
  * \endcode
  *
  * When modifying a view property, the '.directory' file is automatically updated
@@ -56,17 +56,17 @@ public:
     void setViewMode(DolphinView::Mode mode);
     DolphinView::Mode viewMode() const;
 
-    void setShowPreview(bool show);
-    bool showPreview() const;
+    void setPreviewsShown(bool show);
+    bool previewsShown() const;
 
-    void setShowHiddenFiles(bool show);
-    bool showHiddenFiles() const;
+    void setHiddenFilesShown(bool show);
+    bool hiddenFilesShown() const;
 
-    void setCategorizedSorting(bool categorized);
-    bool categorizedSorting() const;
+    void setGroupedSorting(bool grouped);
+    bool groupedSorting() const;
 
-    void setSorting(DolphinView::Sorting sorting);
-    DolphinView::Sorting sorting() const;
+    void setSortRole(const QByteArray& role);
+    QByteArray sortRole() const;
 
     void setSortOrder(Qt::SortOrder sortOrder);
     Qt::SortOrder sortOrder() const;
@@ -79,14 +79,14 @@ public:
      * Note that the additional-info property is the only property where
      * the value is dependent from another property (in this case the view-mode).
      */
-    void setAdditionalInfo(const KFileItemDelegate::InformationList& info);
+    void setVisibleRoles(const QList<QByteArray>& info);
 
     /**
      * Returns the additional information for the current set view-mode.
      * Note that the additional-info property is the only property where
      * the value is dependent from another property (in this case the view-mode).
      */
-    KFileItemDelegate::InformationList additionalInfo() const;
+    QList<QByteArray> visibleRoles() const;
 
     /**
      * Sets the directory properties view mode, show preview,
@@ -131,24 +131,17 @@ private:
      */
     QString destinationDir(const QString& subDir) const;
 
-    /**
-     * Helper method for ViewProperties::additionalInfo(): Returns
-     * the additional info for the outdated version 1 of the view-properties.
-     */
-    KFileItemDelegate::InformationList additionalInfoV1() const;
-
-    /**
-     * Helper method for ViewProperties::additionalInfo(): Returns
-     * the additional info for the current version 2 of the view-properties.
-     */
-    KFileItemDelegate::InformationList additionalInfoV2() const;
-
     /**
      * Returns the view-mode prefix when storing additional properties for
      * a view-mode.
      */
     QString viewModePrefix() const;
 
+    /**
+     * Returns true, if \a filePath is part of the home-path (see QDir::homePath()).
+     */
+    static bool isPartOfHome(const QString& filePath);
+
     Q_DISABLE_COPY(ViewProperties)
 
 private: