]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/dolphinview.h
fix issue that the view properties are not read out correctly for first directory...
[dolphin.git] / src / dolphinview.h
index d9a241759ca9e39b914c0264de12fff7128d9cc2..f6b85f96b74e9cee4d9abdb2a889328934d7f39f 100644 (file)
@@ -27,7 +27,7 @@
 #include <kfileitemdelegate.h>
 #include <kio/job.h>
 
-#include <urlnavigator.h>
+#include <kurlnavigator.h>
 
 #include <QDropEvent>
 #include <QLinkedList>
@@ -41,7 +41,7 @@ class FilterBar;
 class KFileItemDelegate;
 class KUrl;
 class KDirModel;
-class UrlNavigator;
+class KUrlNavigator;
 class DolphinColumnView;
 class DolphinDetailsView;
 class DolphinDirLister;
@@ -64,7 +64,7 @@ class ViewProperties;
  * @see DolphinIconsView
  * @see DolphinDetailsView
  * @see DolphinColumnView
- * @see UrlNavigator
+ * @see KUrlNavigator
  * @see DolphinStatusBar
  */
 class DolphinView : public QWidget
@@ -72,12 +72,12 @@ class DolphinView : public QWidget
     Q_OBJECT
 
 public:
-       /**
-     * Defines the view mode for a directory. The view mode
-     * can be defined when constructing a DolphinView. The
-     * view mode is automatically updated if the directory itself
-     * defines a view mode (see class ViewProperties for details).
-     */
+    /**
+        * Defines the view mode for a directory. The view mode
+        * can be defined when constructing a DolphinView. The
+        * view mode is automatically updated if the directory itself
+        * defines a view mode (see class ViewProperties for details).
+        */
     enum Mode
     {
         /**
@@ -121,7 +121,7 @@ public:
 
     /**
      * Sets the current active URL.
-     * The signals UrlNavigator::urlChanged() and UrlNavigator::historyChanged()
+     * The signals KUrlNavigator::urlChanged() and KUrlNavigator::historyChanged()
      * are emitted.
      */
     void setUrl(const KUrl& url);
@@ -164,6 +164,24 @@ public:
     void setShowHiddenFiles(bool show);
     bool showHiddenFiles() const;
 
+    /**
+     * Summarizes all sorted items by their category \a categorized
+     * is true.
+     * If the view properties should be remembered for each directory
+     * (GeneralSettings::globalViewProps() returns false), then the
+     * categorized sorting setting will be be stored automatically.
+     */
+    void setCategorizedSorting(bool categorized);
+    bool categorizedSorting() const;
+
+    /**
+     * Returns true, if the categorized sorting is supported by the current
+     * used mode (see DolphinView::setMode()). Currently only DolphinView::IconsView
+     * supports categorizations. To check whether the categorized
+     * sorting is set, use DolphinView::categorizedSorting().
+     */
+    bool supportsCategorizedSorting() const;
+
     /**
      * Triggers the renaming of the currently selected items, where
      * the user must input a new name for the items.
@@ -185,28 +203,28 @@ public:
 
     /**
      * Goes back one step in the URL history. The signals
-     * UrlNavigator::urlChanged() and UrlNavigator::historyChanged()
+     * KUrlNavigator::urlChanged() and KUrlNavigator::historyChanged()
      * are submitted.
      */
     void goBack();
 
     /**
      * Goes forward one step in the Url history. The signals
-     * UrlNavigator::urlChanged() and UrlNavigator::historyChanged()
+     * KUrlNavigator::urlChanged() and KUrlNavigator::historyChanged()
      * are submitted.
      */
     void goForward();
 
     /**
      * Goes up one step of the Url path. The signals
-     * UrlNavigator::urlChanged() and UrlNavigator::historyChanged()
+     * KUrlNavigator::urlChanged() and KUrlNavigator::historyChanged()
      * are submitted.
      */
     void goUp();
 
     /**
-     * Goes to the home URL. The signals UrlNavigator::urlChanged()
-     * and UrlNavigator::historyChanged() are submitted.
+     * Goes to the home URL. The signals KUrlNavigator::urlChanged()
+     * and KUrlNavigator::historyChanged() are submitted.
      */
     void goHome();
 
@@ -266,7 +284,7 @@ public:
 
     /**
      * Returns true, if the URL shown by the navigation bar is editable.
-     * @see UrlNavigator
+     * @see KUrlNavigator
      */
     bool isUrlEditable() const;
 
@@ -306,8 +324,11 @@ public:
     /** Returns the additional information which should be shown for the items. */
     KFileItemDelegate::AdditionalInformation additionalInfo() const;
 
-    /** Returns the UrlNavigator of the view for read access. */
-    const UrlNavigator* urlNavigator() const { return m_urlNavigator; }
+    /** Returns the KUrlNavigator of the view for read access. */
+    const KUrlNavigator* urlNavigator() const
+    {
+        return m_urlNavigator;
+    }
 
     /**
      * Triggers to request user information for the item given
@@ -372,6 +393,9 @@ signals:
     /** Is emitted if the 'show hidden files' property has been changed. */
     void showHiddenFilesChanged();
 
+    /** Is emitted if the 'categorized sorting' property has been changed. */
+    void categorizedSortingChanged();
+
     /** Is emitted if the sorting by name, size or date has been changed. */
     void sortingChanged(DolphinView::Sorting sorting);
 
@@ -405,7 +429,7 @@ protected:
     virtual void mouseReleaseEvent(QMouseEvent* event);
 
 private slots:
-    void loadDirectory(const KUrl& kurl);
+    void changeDirectory(const KUrl& url);
     void triggerItem(const QModelIndex& index);
     void updateProgress(int percent);
 
@@ -550,14 +574,18 @@ private:
      * requires some special handling for iterating through directories,
      * this method has been introduced for convenience.
      */
-    bool isColumnViewActive() const { return m_columnView != 0; }
+    bool isColumnViewActive() const
+    {
+        return m_columnView != 0;
+    }
 
 private:
     /**
      * Remembers the original pixmap for an item before
      * the cut effect is applied.
      */
-    struct CutItem {
+    struct CutItem
+    {
         KUrl url;
         QPixmap pixmap;
     };
@@ -572,7 +600,7 @@ private:
 
     DolphinMainWindow* m_mainWindow;
     QVBoxLayout* m_topLayout;
-    UrlNavigator* m_urlNavigator;
+    KUrlNavigator* m_urlNavigator;
 
     DolphinController* m_controller;
     DolphinIconsView* m_iconsView;