┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/views/dolphinview.h
diff options
context:
space:
mode:
authorPeter Penz <[email protected]>2012-03-11 19:02:45 +0100
committerPeter Penz <[email protected]>2012-03-11 19:05:56 +0100
commit2ba5c2cfc2cea534cccd860f94a7198530b83594 (patch)
tree787ee40d007b243a01ba581e778fc67aa179e361 /src/views/dolphinview.h
parentd28081338577bfe0104f42c20e167bb0ce70e094 (diff)
First step to introduce dynamic roles
Currently Dolphin is only capable of showing a fixed number of roles (e.g. name, size, date, owner, ...). Dolphin 2.1 should support also other roles like rating, tags, comments or other meta-information of images or audio-files. To support this the sorting-type and additional-type from DolphinView has been replaced by a role-type represented as QByteArray.
Diffstat (limited to 'src/views/dolphinview.h')
-rw-r--r--src/views/dolphinview.h66
1 files changed, 14 insertions, 52 deletions
diff --git a/src/views/dolphinview.h b/src/views/dolphinview.h
index f2f15c592..628ab2dc5 100644
--- a/src/views/dolphinview.h
+++ b/src/views/dolphinview.h
@@ -93,34 +93,6 @@ public:
CompactView
};
- /** Defines the sort order for the items of a directory. */
- enum Sorting
- {
- SortByName = 0,
- SortBySize,
- SortByDate,
- SortByPermissions,
- SortByOwner,
- SortByGroup,
- SortByType,
- SortByDestination,
- SortByPath
- };
-
- /** Defines the additional information shown for the items of a directory. */
- enum AdditionalInfo
- {
- NoInfo = 0,
- SizeInfo,
- DateInfo,
- PermissionsInfo,
- OwnerInfo,
- GroupInfo,
- TypeInfo,
- DestinationInfo,
- PathInfo
- };
-
/**
* @param url Specifies the content which should be shown.
* @param parent Parent widget of the view.
@@ -234,29 +206,21 @@ public:
*/
bool isZoomOutPossible() const;
- /** Sets the sorting criterion (e.g., SortByName, SortBySize,...) of the items inside a directory (see DolphinView::Sorting). */
- void setSorting(Sorting sorting);
-
- /** Returns the sorting criterion (e.g., SortByName, SortBySize,...) of the items inside a directory (see DolphinView::Sorting). */
- Sorting sorting() const;
+ void setSortRole(const QByteArray& role);
+ QByteArray sortRole() const;
- /** Sets the sort order (Qt::Ascending or Qt::Descending) for the items. */
void setSortOrder(Qt::SortOrder order);
-
- /** Returns the currently 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 setAdditionalInfoList(const QList<AdditionalInfo>& info);
+ void setVisibleRoles(const QList<QByteArray>& roles);
/** Returns the additional information which should be shown for the items. */
- QList<AdditionalInfo> additionalInfoList() const;
+ QList<QByteArray> visibleRoles() const;
/** Reloads the current directory. */
void reload();
@@ -450,17 +414,20 @@ signals:
void groupedSortingChanged(bool groupedSorting);
/** Is emitted if the sorting by name, size or date has been changed. */
- void sortingChanged(DolphinView::Sorting sorting);
+ void sortRoleChanged(const QByteArray& role);
/** 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. */
+ /**
+ * 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 additionalInfoListChanged(const QList<DolphinView::AdditionalInfo>& current,
- const QList<DolphinView::AdditionalInfo>& previous);
+ void visibleRolesChanged(const QList<QByteArray>& current,
+ const QList<QByteArray>& previous);
/** Is emitted if the zoom level has been changed by zooming in or out. */
void zoomLevelChanged(int current, int previous);
@@ -586,9 +553,9 @@ private slots:
/**
* Updates the view properties of the current URL to the
- * sorting given by \a sorting.
+ * sorting given by \a role.
*/
- void updateSorting(DolphinView::Sorting sorting);
+ void updateSortRole(const QByteArray& role);
/**
* Updates the view properties of the current URL to the
@@ -702,8 +669,6 @@ private:
*/
void applyViewProperties();
- void applyAdditionalInfoListToView();
-
/**
* Helper method for DolphinView::paste() and DolphinView::pasteIntoFolder().
* Pastes the clipboard data into the URL \a url.
@@ -737,9 +702,6 @@ private:
*/
void updateWritableState();
- QByteArray sortRoleForSorting(Sorting sorting) const;
- Sorting sortingForSortRole(const QByteArray& sortRole) const;
-
/**
* Returns the text for the filesize by converting it to the best fitting
* unit.
@@ -756,7 +718,7 @@ private:
KUrl m_url;
Mode m_mode;
- QList<AdditionalInfo> m_additionalInfoList;
+ QList<QByteArray> m_visibleRoles;
QVBoxLayout* m_topLayout;