mirror of
https://invent.kde.org/system/dolphin
synced 2024-10-05 16:19:10 +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:
parent
08819ca3b1
commit
2257b94e4f
|
@ -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 },
|
{ "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 },
|
{ "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 },
|
{ "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 },
|
{ "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 },
|
{ "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 },
|
{ "group", GroupRole, I18N_NOOP2_NOSTRIP("@label", "User Group"), I18N_NOOP2_NOSTRIP("@label", "Other"), false, false },
|
||||||
|
|
|
@ -285,7 +285,7 @@ private:
|
||||||
// User visible roles available with Baloo:
|
// User visible roles available with Baloo:
|
||||||
CommentRole, TagsRole, RatingRole, ImageSizeRole, OrientationRole,
|
CommentRole, TagsRole, RatingRole, ImageSizeRole, OrientationRole,
|
||||||
WordCountRole, LineCountRole, ArtistRole, AlbumRole, DurationRole, TrackRole,
|
WordCountRole, LineCountRole, ArtistRole, AlbumRole, DurationRole, TrackRole,
|
||||||
CopiedFromRole,
|
OriginUrlRole,
|
||||||
// Non-visible roles:
|
// Non-visible roles:
|
||||||
IsDirRole, IsLinkRole, IsExpandedRole, IsExpandableRole, ExpandedParentsCountRole,
|
IsDirRole, IsLinkRole, IsExpandedRole, IsExpandableRole, ExpandedParentsCountRole,
|
||||||
// Mandatory last entry:
|
// Mandatory last entry:
|
||||||
|
|
|
@ -109,6 +109,9 @@ QHash<QByteArray, QVariant> KBalooRolesProvider::roleValues(const Baloo::File& f
|
||||||
if (roles.contains("comment")) {
|
if (roles.contains("comment")) {
|
||||||
values.insert("comment", md.userComment());
|
values.insert("comment", md.userComment());
|
||||||
}
|
}
|
||||||
|
if (roles.contains("originUrl")) {
|
||||||
|
values.insert("originUrl", md.originUrl());
|
||||||
|
}
|
||||||
|
|
||||||
return values;
|
return values;
|
||||||
}
|
}
|
||||||
|
@ -143,8 +146,8 @@ KBalooRolesProvider::KBalooRolesProvider() :
|
||||||
{ "artist", "artist" },
|
{ "artist", "artist" },
|
||||||
{ "album", "album" },
|
{ "album", "album" },
|
||||||
{ "duration", "duration" },
|
{ "duration", "duration" },
|
||||||
{ "trackNumber", "track" }
|
{ "trackNumber", "track" },
|
||||||
// { "http://www.semanticdesktop.org/ontologies/2010/04/30/ndo#copiedFrom", "copiedFrom" }
|
{ "originUrl", "originUrl" }
|
||||||
};
|
};
|
||||||
|
|
||||||
for (unsigned int i = 0; i < sizeof(propertyInfoList) / sizeof(PropertyInfo); ++i) {
|
for (unsigned int i = 0; i < sizeof(propertyInfoList) / sizeof(PropertyInfo); ++i) {
|
||||||
|
|
Loading…
Reference in a new issue