From 7e74c6f23beb06b9541508b91914a4f9b3ee3a62 Mon Sep 17 00:00:00 2001 From: Frank Reininghaus Date: Mon, 10 May 2010 12:49:41 +0000 Subject: Provide the destination of a symbolic link as a column in Dolphin's (and Konqueror's) Details View in KDE SC 4.5. This is based on the changes to KFileItemDelegate from commit 1124981. FEATURE: 211690 svn path=/trunk/KDE/kdebase/apps/; revision=1124982 --- src/dolphinmodel.cpp | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'src/dolphinmodel.cpp') diff --git a/src/dolphinmodel.cpp b/src/dolphinmodel.cpp index 35a5fb8f1..d81e0c38b 100644 --- a/src/dolphinmodel.cpp +++ b/src/dolphinmodel.cpp @@ -113,6 +113,12 @@ QVariant DolphinModel::data(const QModelIndex& index, int role) const return i18nc("@item::intable", "Unversioned"); } } + else if (index.column() == DolphinModel::LinkDestination) { + const KDirModel *dirModel = qobject_cast(index.model()); + KFileItem item = dirModel->itemForIndex(index); + return item.linkDest(); + } + break; default: @@ -125,12 +131,14 @@ QVariant DolphinModel::data(const QModelIndex& index, int role) const QVariant DolphinModel::headerData(int section, Qt::Orientation orientation, int role) const { if ((orientation == Qt::Horizontal) && (role == Qt::DisplayRole)) { - if (section < KDirModel::ColumnCount) { + switch (section) { + case DolphinModel::Version: + return i18nc("@title::column", "Version"); + case DolphinModel::LinkDestination: + return i18nc("@title::column", "Link Destination"); + default: return KDirModel::headerData(section, orientation, role); } - - Q_ASSERT(section == DolphinModel::Version); - return i18nc("@title::column", "Version"); } return QVariant(); } -- cgit v1.3