]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/views/dolphinview.h
Fix Bug 153984 - Clicking cancel on the authentication dialog for fish/sftp/ftp kiosl...
[dolphin.git] / src / views / dolphinview.h
index f4b00823655ebb2250914f95c8680e7a74b5e4b3..1feaf0f11eff59d2562e7159cb18e6db5b578870 100644 (file)
@@ -181,8 +181,8 @@ public:
     void markUrlsAsSelected(const QList<KUrl>& urls);
 
     /**
-     * Marks the item indicated by \p url as the current item after the
-     * directory DolphinView::url() has been loaded.
+     * Marks the item indicated by \p url to be scrolled to and as the
+     * current item after directory DolphinView::url() has been loaded.
      */
     void markUrlAsCurrent(const KUrl& url);
 
@@ -237,6 +237,14 @@ public:
     void setNameFilter(const QString& nameFilter);
     QString nameFilter() const;
 
+    /**
+     * Filters the currently shown items by \a filters. All items
+     * whose content-type matches those given by the list of filters
+     * will be shown.
+     */
+    void setMimeTypeFilters(const QStringList& filters);
+    QStringList mimeTypeFilters() const;
+
     /**
      * Returns a textual representation of the state of the current
      * folder or selected items, suitable for use in the status bar.
@@ -475,6 +483,12 @@ signals:
      */
     void directoryLoadingCompleted();
 
+    /**
+     * Is emitted after the directory loading triggered by DolphinView::setUrl()
+     * has been canceled.
+     */
+    void directoryLoadingCanceled();
+
     /**
      * Is emitted after DolphinView::setUrl() has been invoked and provides
      * the information how much percent of the current directory have been loaded.
@@ -493,6 +507,12 @@ signals:
      */
     void redirection(const KUrl& oldUrl, const KUrl& newUrl);
 
+    /**
+     * Is emitted when the URL set by DolphinView::setUrl() represents a file.
+     * In this case no signal errorMessage() will be emitted.
+     */
+    void urlIsFileError(const KUrl& url);
+
     /**
      * Is emitted when the write state of the folder has been changed. The application
      * should disable all actions like "Create New..." that depend on the write
@@ -518,6 +538,7 @@ protected:
 
     /** @reimp */
     virtual void hideEvent(QHideEvent* event);
+    virtual bool event(QEvent* event);
 
 private slots:
     /**
@@ -628,24 +649,15 @@ private slots:
     void slotVisibleRolesChangedByHeader(const QList<QByteArray>& current,
                                          const QList<QByteArray>& previous);
 
-    void slotRoleEditingCanceled(int index, const QByteArray& role, const QVariant& value);
     void slotRoleEditingFinished(int index, const QByteArray& role, const QVariant& value);
 
     /**
      * 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 assured 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();
-
     /**
      * Called when a redirection happens.
      * Testcase: fish://localhost
@@ -749,8 +761,8 @@ private:
     QTimer* m_selectionChangedTimer;
 
     KUrl m_currentItemUrl; // Used for making the view to remember the current URL after F5
+    bool m_scrollToCurrentItem; // Used for marking we need to scroll to current item or not
     QPoint m_restoredContentsPosition;
-    KUrl m_createdItemUrl; // URL for a new item that got created by the "Create New..." menu
 
     QList<KUrl> m_selectedUrls; // Used for making the view to remember selections after F5
 
@@ -759,6 +771,7 @@ private:
     // For unit tests
     friend class TestBase;
     friend class DolphinDetailsViewTest;
+    friend class DolphinPart;                   // Accesses m_model
 };
 
 /// Allow using DolphinView::Mode in QVariant