┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKai Uwe Broulik <[email protected]>2016-02-09 22:11:00 +0100
committerKai Uwe Broulik <[email protected]>2016-02-09 22:11:00 +0100
commit2257b94e4fc425a62bcdc065791566a20c517052 (patch)
treeea2587ce3e0d39b69f5eb748ea1de1346c466b86 /src
parent08819ca3b1ec42f3c1aa022a57049fab24150bc4 (diff)
Support KFileMetadata OriginUrl as "Downloaded From"
This brings back the functionality to show where a file originally was downloaded from using xattr originUrl. REVIEW: 126927
Diffstat (limited to 'src')
-rw-r--r--src/kitemviews/kfileitemmodel.cpp2
-rw-r--r--src/kitemviews/kfileitemmodel.h2
-rw-r--r--src/kitemviews/private/kbaloorolesprovider.cpp7
3 files changed, 7 insertions, 4 deletions
diff --git a/src/kitemviews/kfileitemmodel.cpp b/src/kitemviews/kfileitemmodel.cpp
index 5f6fed0dc..b8b39603c 100644
--- a/src/kitemviews/kfileitemmodel.cpp
+++ b/src/kitemviews/kfileitemmodel.cpp
@@ -2200,7 +2200,7 @@ const KFileItemModel::RoleInfoMap* KFileItemModel::rolesInfoMap(int& count)
{ "track", TrackRole, I18N_NOOP2_NOSTRIP("@label", "Track"), I18N_NOOP2_NOSTRIP("@label", "Audio"), true, true },
{ "path", PathRole, I18N_NOOP2_NOSTRIP("@label", "Path"), I18N_NOOP2_NOSTRIP("@label", "Other"), false, false },
{ "destination", DestinationRole, I18N_NOOP2_NOSTRIP("@label", "Link Destination"), I18N_NOOP2_NOSTRIP("@label", "Other"), false, false },
- { "copiedFrom", CopiedFromRole, I18N_NOOP2_NOSTRIP("@label", "Copied From"), I18N_NOOP2_NOSTRIP("@label", "Other"), true, false },
+ { "originUrl", OriginUrlRole, I18N_NOOP2_NOSTRIP("@label", "Downloaded From"), I18N_NOOP2_NOSTRIP("@label", "Other"), true, false },
{ "permissions", PermissionsRole, I18N_NOOP2_NOSTRIP("@label", "Permissions"), I18N_NOOP2_NOSTRIP("@label", "Other"), false, false },
{ "owner", OwnerRole, I18N_NOOP2_NOSTRIP("@label", "Owner"), I18N_NOOP2_NOSTRIP("@label", "Other"), false, false },
{ "group", GroupRole, I18N_NOOP2_NOSTRIP("@label", "User Group"), I18N_NOOP2_NOSTRIP("@label", "Other"), false, false },
diff --git a/src/kitemviews/kfileitemmodel.h b/src/kitemviews/kfileitemmodel.h
index 167f508cf..e06313aa9 100644
--- a/src/kitemviews/kfileitemmodel.h
+++ b/src/kitemviews/kfileitemmodel.h
@@ -285,7 +285,7 @@ private:
// User visible roles available with Baloo:
CommentRole, TagsRole, RatingRole, ImageSizeRole, OrientationRole,
WordCountRole, LineCountRole, ArtistRole, AlbumRole, DurationRole, TrackRole,
- CopiedFromRole,
+ OriginUrlRole,
// Non-visible roles:
IsDirRole, IsLinkRole, IsExpandedRole, IsExpandableRole, ExpandedParentsCountRole,
// Mandatory last entry:
diff --git a/src/kitemviews/private/kbaloorolesprovider.cpp b/src/kitemviews/private/kbaloorolesprovider.cpp
index 920ce0671..b49499483 100644
--- a/src/kitemviews/private/kbaloorolesprovider.cpp
+++ b/src/kitemviews/private/kbaloorolesprovider.cpp
@@ -109,6 +109,9 @@ QHash<QByteArray, QVariant> KBalooRolesProvider::roleValues(const Baloo::File& f
if (roles.contains("comment")) {
values.insert("comment", md.userComment());
}
+ if (roles.contains("originUrl")) {
+ values.insert("originUrl", md.originUrl());
+ }
return values;
}
@@ -143,8 +146,8 @@ KBalooRolesProvider::KBalooRolesProvider() :
{ "artist", "artist" },
{ "album", "album" },
{ "duration", "duration" },
- { "trackNumber", "track" }
- // { "http://www.semanticdesktop.org/ontologies/2010/04/30/ndo#copiedFrom", "copiedFrom" }
+ { "trackNumber", "track" },
+ { "originUrl", "originUrl" }
};
for (unsigned int i = 0; i < sizeof(propertyInfoList) / sizeof(PropertyInfo); ++i) {