diff options
| author | Frank Reininghaus <[email protected]> | 2010-05-10 12:49:41 +0000 |
|---|---|---|
| committer | Frank Reininghaus <[email protected]> | 2010-05-10 12:49:41 +0000 |
| commit | 7e74c6f23beb06b9541508b91914a4f9b3ee3a62 (patch) | |
| tree | fa66e579562ffd6e99b8328faf4cc99999c41903 /src/dolphinmodel.cpp | |
| parent | 717ff023cca4b8fc6c4b2b636004a810af3a4ae8 (diff) | |
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
Diffstat (limited to 'src/dolphinmodel.cpp')
| -rw-r--r-- | src/dolphinmodel.cpp | 16 |
1 files changed, 12 insertions, 4 deletions
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<const KDirModel*>(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(); } |
