Commit d3b6c2b6 authored by Méven Car's avatar Méven Car
Browse files

FileMetaDataWidget: Allow to see targetUrl if set

Useful for recentlyused:/ and recentdocuments
parent ca750b83
Pipeline #182262 passed with stage
in 43 seconds
......@@ -13,6 +13,7 @@
#include <KFormat>
#include <KLocalizedString>
#include <KProtocolInfo>
#include <KShell>
#include <QDebug>
#include <QTimer>
......@@ -181,6 +182,9 @@ void FileMetaDataProvider::insertSingleFileBasicData()
if (item.isLink()) {
m_data.insert(QStringLiteral("kfileitem#linkDest"), item.linkDest());
}
if (item.entry().contains(KIO::UDSEntry::UDS_TARGET_URL)) {
m_data.insert(QStringLiteral("kfileitem#targetUrl"), KShell::tildeCollapse(item.targetUrl().toDisplayString(QUrl::PreferLocalFile)));
}
QDateTime modificationTime = item.time(KFileItem::ModificationTime);
if (modificationTime.isValid()) {
m_data.insert(QStringLiteral("kfileitem#modified"), modificationTime);
......@@ -444,6 +448,7 @@ QString FileMetaDataProvider::label(const QString &metaDataLabel) const
{QStringLiteral("kfileitem#hiddenItems"), i18nc("@label", "Hidden items")},
{QStringLiteral("kfileitem#type"), i18nc("@label", "Type")},
{QStringLiteral("kfileitem#linkDest"), i18nc("@label", "Link to")},
{QStringLiteral("kfileitem#targetUrl"), i18nc("@label", "Points to")},
{QStringLiteral("tags"), i18nc("@label", "Tags")},
{QStringLiteral("rating"), i18nc("@label", "Rating")},
{QStringLiteral("userComment"), i18nc("@label", "Comment")},
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment