]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Support KFileMetadata OriginUrl as "Downloaded From"
authorKai Uwe Broulik <kde@privat.broulik.de>
Tue, 9 Feb 2016 21:11:00 +0000 (22:11 +0100)
committerKai Uwe Broulik <kde@privat.broulik.de>
Tue, 9 Feb 2016 21:11:00 +0000 (22:11 +0100)
This brings back the functionality to show where a file originally was downloaded
from using xattr originUrl.

REVIEW: 126927

src/kitemviews/kfileitemmodel.cpp
src/kitemviews/kfileitemmodel.h
src/kitemviews/private/kbaloorolesprovider.cpp

index 5f6fed0dcb4ca865c4d9a53bccc8c8824e1173d3..b8b39603c306046a1a84edd694f29f6d830c7aac 100644 (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 },
         { "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 },
         { "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 },
index 167f508cfffea39aadba366ef8fb3bf344b27157..e06313aa92de2943ef1a38c72fc2c3c9340d076b 100644 (file)
@@ -285,7 +285,7 @@ private:
         // User visible roles available with Baloo:
         CommentRole, TagsRole, RatingRole, ImageSizeRole, OrientationRole,
         WordCountRole, LineCountRole, ArtistRole, AlbumRole, DurationRole, TrackRole,
         // 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:
         // Non-visible roles:
         IsDirRole, IsLinkRole, IsExpandedRole, IsExpandableRole, ExpandedParentsCountRole,
         // Mandatory last entry:
index 920ce0671d57d832ecfcee960dd3964d403bc699..b494994830c19a5adc9e12e93008896932972ea7 100644 (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("comment")) {
         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" },
         { "album",    "album" },
         { "duration",      "duration" },
         { "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) {
     };
 
     for (unsigned int i = 0; i < sizeof(propertyInfoList) / sizeof(PropertyInfo); ++i) {