X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/ae1980442d70aa04b1699fbba1c3503fdab58e6d..6e752f507a1dd82a40d4bd140457203842fc0c80:/src/views/dolphinview.h diff --git a/src/views/dolphinview.h b/src/views/dolphinview.h index f851724c2..2c772ad90 100644 --- a/src/views/dolphinview.h +++ b/src/views/dolphinview.h @@ -14,7 +14,7 @@ #include "config-dolphin.h" #include -#include +#include #include #include @@ -51,6 +51,8 @@ class QRegularExpression; * - show hidden files * - show previews * - enable grouping + * - grouping order + * - grouping type */ class DOLPHIN_EXPORT DolphinView : public QWidget { @@ -205,12 +207,34 @@ public: */ void resetZoomLevel(); + /** + * Updates the view properties of the current URL to the + * sorting given by \a role. + */ void setSortRole(const QByteArray &role); QByteArray sortRole() const; + /** + * Updates the view properties of the current URL to the + * sort order given by \a order. + */ void setSortOrder(Qt::SortOrder order); Qt::SortOrder sortOrder() const; + /** + * Updates the view properties of the current URL to the + * grouping given by \a role. + */ + void setGroupRole(const QByteArray &role); + QByteArray groupRole() const; + + /** + * Updates the view properties of the current URL to the + * sort order given by \a order. + */ + void setGroupOrder(Qt::SortOrder order); + Qt::SortOrder groupOrder() const; + /** Sets a separate sorting with folders first (true) or a mixed sorting of files and folders (false). */ void setSortFoldersFirst(bool foldersFirst); bool sortFoldersFirst() const; @@ -344,6 +368,11 @@ public: /** Activates the view if the item list container gets focus. */ bool eventFilter(QObject *watched, QEvent *event) override; + /** + * Returns whether the folder represented by the current URL is writable. + */ + bool isFolderWritable() const; + public Q_SLOTS: void reload(); @@ -509,6 +538,12 @@ Q_SIGNALS: /** Is emitted if the sort order (ascending or descending) has been changed. */ void sortOrderChanged(Qt::SortOrder order); + /** Is emitted if the grouping by name, size or date has been changed. */ + void groupRoleChanged(const QByteArray &role); + + /** Is emitted if the group order (ascending or descending) has been changed. */ + void groupOrderChanged(Qt::SortOrder order); + /** * Is emitted if the sorting of files and folders (separate with folders * first or mixed) has been changed. @@ -554,7 +589,7 @@ Q_SIGNALS: * Is emitted if an error message with the content \a msg * should be shown. */ - void errorMessage(const QString &msg); + void errorMessage(const QString &message, const int kioErrorCode); /** * Is emitted if an "operation completed" message with the content \a msg @@ -652,6 +687,12 @@ Q_SIGNALS: */ void currentDirectoryRemoved(); + /** + * Emitted when the view's background is double-clicked. + * Used to trigger an user configured action. + */ + void doubleClickViewBackground(Qt::MouseButton button); + protected: /** Changes the zoom level if Control is pressed during a wheel event. */ void wheelEvent(QWheelEvent *event) override; @@ -682,6 +723,7 @@ private Q_SLOTS: void slotRenameDialogRenamingFinished(const QList &urls); void slotSelectedItemTextPressed(int index); void slotItemCreatedFromJob(KIO::Job *, const QUrl &, const QUrl &to); + void slotItemLinkCreatedFromJob(KIO::Job *, const QUrl &, const QString &, const QUrl &to); void slotIncreaseZoom(); void slotDecreaseZoom(); void slotSwipeUp(); @@ -719,18 +761,6 @@ private Q_SLOTS: */ void slotStatJobResult(KJob *job); - /** - * Updates the view properties of the current URL to the - * sorting given by \a role. - */ - void updateSortRole(const QByteArray &role); - - /** - * Updates the view properties of the current URL to the - * sort order given by \a order. - */ - 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. @@ -824,6 +854,8 @@ private Q_SLOTS: void slotTwoClicksRenamingTimerTimeout(); + void onDirectoryLoadingCompletedAfterJob(); + private: void loadDirectory(const QUrl &url, bool reload = false); @@ -878,7 +910,7 @@ private: /** * Updates m_isFolderWritable dependent on whether the folder represented by * the current URL is writable. If the state has changed, the signal - * writeableStateChanged() will be emitted. + * writeStateChanged() will be emitted. */ void updateWritableState();