┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/kitemviews
diff options
context:
space:
mode:
authorPeter Penz <[email protected]>2012-03-14 16:51:21 +0100
committerPeter Penz <[email protected]>2012-03-14 16:53:31 +0100
commitd6e10a5942442f8423385ff1301c9163b334e4ed (patch)
treeffe62eb1c5efbd4278776ebecbe88d18899bf11b /src/kitemviews
parentd048fe0161cdf4a4c161db660947a167dd18dc80 (diff)
Use sub-menus for the "Sort By"- and "Additional Information"-menu
This allows doing some grouping for the visible roles by e.g. Image, Document, Music or whatever.
Diffstat (limited to 'src/kitemviews')
-rw-r--r--src/kitemviews/kfileitemmodel.cpp23
-rw-r--r--src/kitemviews/kfileitemmodel.h29
2 files changed, 27 insertions, 25 deletions
diff --git a/src/kitemviews/kfileitemmodel.cpp b/src/kitemviews/kfileitemmodel.cpp
index 428587e73..0fef47787 100644
--- a/src/kitemviews/kfileitemmodel.cpp
+++ b/src/kitemviews/kfileitemmodel.cpp
@@ -1977,15 +1977,24 @@ const KFileItemModel::RoleInfoMap* KFileItemModel::rolesInfoMap(int& count)
{ "name", NameRole, I18N_NOOP2_NOSTRIP("@label", "Name"), 0, 0 },
{ "size", SizeRole, I18N_NOOP2_NOSTRIP("@label", "Size"), 0, 0 },
{ "date", DateRole, I18N_NOOP2_NOSTRIP("@label", "Date"), 0, 0 },
- { "permissions", PermissionsRole, I18N_NOOP2_NOSTRIP("@label", "Permissions"), 0, 0 },
- { "owner", OwnerRole, I18N_NOOP2_NOSTRIP("@label", "Owner"), 0, 0 },
- { "group", GroupRole, I18N_NOOP2_NOSTRIP("@label", "Group"), 0, 0 },
{ "type", TypeRole, I18N_NOOP2_NOSTRIP("@label", "Type"), 0, 0 },
- { "destination", DestinationRole, I18N_NOOP2_NOSTRIP("@label", "Link Destination"), 0, 0 },
- { "path", PathRole, I18N_NOOP2_NOSTRIP("@label", "Path"), 0, 0 },
- { "comment", CommentRole, I18N_NOOP2_NOSTRIP("@label", "Comment"), 0, 0 },
+ { "rating", RatingRole, I18N_NOOP2_NOSTRIP("@label", "Rating"), 0, 0 },
{ "tags", TagsRole, I18N_NOOP2_NOSTRIP("@label", "Tags"), 0, 0 },
- { "rating", RatingRole, I18N_NOOP2_NOSTRIP("@label", "Rating"), 0, 0 }
+ { "comment", CommentRole, I18N_NOOP2_NOSTRIP("@label", "Comment"), 0, 0 },
+ { "wordCount", WordCountRole, I18N_NOOP2_NOSTRIP("@label", "Word Count"), I18N_NOOP2_NOSTRIP("@label", "Document") },
+ { "lineCount", LineCountRole, I18N_NOOP2_NOSTRIP("@label", "Line Count"), I18N_NOOP2_NOSTRIP("@label", "Document") },
+ { "imageSize", ImageSizeRole, I18N_NOOP2_NOSTRIP("@label", "Image Size"), I18N_NOOP2_NOSTRIP("@label", "Image") },
+ { "orientation", OrientationRole, I18N_NOOP2_NOSTRIP("@label", "Orientation"), I18N_NOOP2_NOSTRIP("@label", "Image") },
+ { "artist", ArtistRole, I18N_NOOP2_NOSTRIP("@label", "Artist"), I18N_NOOP2_NOSTRIP("@label", "Music") },
+ { "album", AlbumRole, I18N_NOOP2_NOSTRIP("@label", "Album"), I18N_NOOP2_NOSTRIP("@label", "Music") },
+ { "duration", DurationRole, I18N_NOOP2_NOSTRIP("@label", "Duration"), I18N_NOOP2_NOSTRIP("@label", "Music") },
+ { "track", TrackRole, I18N_NOOP2_NOSTRIP("@label", "Track"), I18N_NOOP2_NOSTRIP("@label", "Music") },
+ { "path", PathRole, I18N_NOOP2_NOSTRIP("@label", "Path"), I18N_NOOP2_NOSTRIP("@label", "Other") },
+ { "destination", DestinationRole, I18N_NOOP2_NOSTRIP("@label", "Link Destination"), I18N_NOOP2_NOSTRIP("@label", "Other") },
+ { "copiedFrom", CopiedFromRole, I18N_NOOP2_NOSTRIP("@label", "Copied From"), I18N_NOOP2_NOSTRIP("@label", "Other") },
+ { "permissions", PermissionsRole, I18N_NOOP2_NOSTRIP("@label", "Permissions"), I18N_NOOP2_NOSTRIP("@label", "Other") },
+ { "owner", OwnerRole, I18N_NOOP2_NOSTRIP("@label", "Owner"), I18N_NOOP2_NOSTRIP("@label", "Other") },
+ { "group", GroupRole, I18N_NOOP2_NOSTRIP("@label", "Group"), I18N_NOOP2_NOSTRIP("@label", "Other") },
};
count = sizeof(rolesInfoMap) / sizeof(RoleInfoMap);
diff --git a/src/kitemviews/kfileitemmodel.h b/src/kitemviews/kfileitemmodel.h
index 5d7a7fc8b..d48f600df 100644
--- a/src/kitemviews/kfileitemmodel.h
+++ b/src/kitemviews/kfileitemmodel.h
@@ -201,24 +201,17 @@ private slots:
private:
enum RoleType {
- NoRole,
- NameRole,
- SizeRole,
- DateRole,
- PermissionsRole,
- OwnerRole,
- GroupRole,
- TypeRole,
- DestinationRole,
- PathRole,
- CommentRole,
- TagsRole,
- RatingRole,
- IsDirRole,
- IsExpandedRole,
- IsExpandableRole,
- ExpandedParentsCountRole,
- RolesCount // Mandatory last entry
+ // User visible roles:
+ NoRole, NameRole, SizeRole, DateRole, PermissionsRole, OwnerRole,
+ GroupRole, TypeRole, DestinationRole, PathRole,
+ // User visible roles available with Nepomuk:
+ CommentRole, TagsRole, RatingRole, ImageSizeRole, OrientationRole,
+ WordCountRole, LineCountRole, ArtistRole, AlbumRole, DurationRole, TrackRole,
+ CopiedFromRole,
+ // Non-visible roles:
+ IsDirRole, IsExpandedRole, IsExpandableRole, ExpandedParentsCountRole,
+ // Mandatory last entry:
+ RolesCount
};
struct ItemData