]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/dolphinview.h
SVN_SILENT made messages (.desktop file)
[dolphin.git] / src / dolphinview.h
index d558b4c5ade424b2f3409057619f4cc9e2f3d5bd..1df268ad7da89d0b335c20b285acd20ad7f2da1b 100644 (file)
@@ -267,6 +267,12 @@ public:
     /** Returns the current used sort order (Qt::Ascending or Qt::Descending). */
     Qt::SortOrder sortOrder() const;
 
+    /** Sets a separate sorting with folders first (true) or a mixed sorting of files and folders (false). */
+    void setSortFoldersFirst(bool foldersFirst);
+
+    /** Returns if files and folders are sorted separately or not. */
+    bool sortFoldersFirst() const;
+
     /** Sets the additional information which should be shown for the items. */
     void setAdditionalInfo(KFileItemDelegate::InformationList info);
 
@@ -422,6 +428,9 @@ public slots:
     /** Switches between an ascending and descending sorting order. */
     void toggleSortOrder();
 
+    /** Switches between a separate sorting (with folders first) and a mixed sorting of files and folders. */
+    void toggleSortFoldersFirst();
+
     /**
      * Switches on or off the displaying of additional information
      * as specified by \a action.
@@ -474,6 +483,9 @@ signals:
     /** Is emitted if the sort order (ascending or descending) has been changed. */
     void sortOrderChanged(Qt::SortOrder order);
 
+    /** Is emitted if the sorting of files and folders (separate with folders first or mixed) has been changed. */
+    void sortFoldersFirstChanged(bool foldersFirst);
+
     /** Is emitted if the additional information shown for this view has been changed. */
     void additionalInfoChanged();
 
@@ -481,7 +493,7 @@ signals:
     void zoomLevelChanged(int level);
 
     /**
-     * Is emitted if information of an item is requested to be shown e. g. in the sidebar.
+     * Is emitted if information of an item is requested to be shown e. g. in the panel.
      * If item is null, no item information request is pending.
      */
     void requestItemInfo(const KFileItem& item);
@@ -496,10 +508,13 @@ signals:
 
     /**
      * Is emitted if a context menu is requested for the item \a item,
-     * which is part of \a url. If the item is 0, the context menu
-     * for the URL should be shown.
+     * which is part of \a url. If the item is null, the context menu
+     * for the URL should be shown and the custom actions \a customActions
+     * will be added.
      */
-    void requestContextMenu(const KFileItem& item, const KUrl& url);
+    void requestContextMenu(const KFileItem& item,
+                            const KUrl& url,
+                            const QList<QAction*>& customActions);
 
     /**
      * Is emitted if an information message with the content \a msg
@@ -560,7 +575,7 @@ private slots:
      * is used to check whether the context menu is related to an
      * item or to the viewport.
      */
-    void openContextMenu(const QPoint& pos);
+    void openContextMenu(const QPoint& pos, const QList<QAction*>& customActions);
 
     /**
      * Drops dragged URLs to the destination path \a destPath. If
@@ -583,6 +598,12 @@ private slots:
      */
     void updateSortOrder(Qt::SortOrder order);
 
+    /**
+     * Updates the view properties of the current URL to the
+     * sorting of files and folders (separate with folders first or mixed) given by \a foldersFirst.
+     */
+    void updateSortFoldersFirst(bool foldersFirst);
+
     /**
      * Updates the view properties of the current URL to the
      * additional information given by \a info.
@@ -628,10 +649,36 @@ private slots:
     void restoreCurrentItem();
 
     /**
-     * Is connected to the enterDir() signal from the FolderExpander
-     * and triggers the entering of the directory indicated by \a index.
+     * Is invoked when the KDirLister indicates refreshed items.
+     */
+    void slotRefreshItems();
+
+    /**
+     * If \a view can be positively identified as not being the source for the
+     * current drag operation, deleteLater() it immediately.  Else stores
+     * it for later deletion.
      */
-    void enterDir(const QModelIndex& index, QAbstractItemView* view);
+    void deleteWhenNotDragSource(QAbstractItemView* view);
+
+    /**
+     * Observes the item with the URL \a url. As soon as the directory
+     * model indicates that the item is available, the item will
+     * get selected and it is assure that the item stays visible.
+     *
+     * @see selectAndScrollToCreatedItem()
+     */
+    void observeCreatedItem(const KUrl& url);
+
+    /**
+     * Selects and scrolls to the item that got observed
+     * by observeCreatedItem().
+     */
+    void selectAndScrollToCreatedItem();
+
+    /**
+     * Restore selection after view refresh.
+     */
+    void restoreSelection();
 
 private:
     void loadDirectory(const KUrl& url, bool reload = false);
@@ -699,12 +746,6 @@ private:
      */
     bool isColumnViewActive() const;
 
-    /**
-     * Deletes all views from m_expandedViews except if the view
-     * is currently shown.
-     */
-    void deleteExpandedViews();
-
     /**
      * Returns the MIME data for all selected items.
      */
@@ -718,6 +759,7 @@ private:
     bool m_tabsForFiles : 1;
     bool m_isContextMenuOpen : 1;   // TODO: workaround for Qt-issue 207192
     bool m_ignoreViewProperties : 1;
+    bool m_assureVisibleCurrentIndex : 1;
 
     Mode m_mode;
 
@@ -740,8 +782,10 @@ private:
 
     KUrl m_rootUrl;
     KUrl m_currentItemUrl;
+    KUrl m_createdItemUrl; // URL for a new item that got created by the "Create New..." menu
+    KFileItemList m_selectedItems; //this is used for making the View to remember selections after F5
 
-    QList<QAbstractItemView*> m_expandedViews;
+    QAbstractItemView* m_expandedDragSource;
 };
 
 inline bool DolphinView::isColumnViewActive() const