1
0
mirror of https://invent.kde.org/system/dolphin synced 2024-07-04 17:30:55 +00:00

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
This commit is contained in:
Kai Uwe Broulik 2016-02-09 22:11:00 +01:00
parent 08819ca3b1
commit 2257b94e4f
3 changed files with 7 additions and 4 deletions

View File

@ -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 },

View File

@ -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:

View File

@ -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) {