summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChinmoy Ranjan Pradhan <[email protected]>2016-12-27 09:10:06 +0530
committerChinmoy Ranjan Pradhan <[email protected]>2016-12-27 09:12:33 +0530
commit7e77eac8931b1c26122dc7a731d339a5d0745c68 (patch)
tree06e1b3a0c7b34fe1f31fd994e223eda93c8108a8
parentc8c6dc223f7be97368fe03fd8e32d3ab51e8d1c4 (diff)
Italicise the name of symlinks in plasma folder view.
Plasma folder view doesn't italicise the name of symlinks making it difficult to distinguish between symlinks and regular files. This patch solves the said issue. REVIEW: 128552
-rw-r--r--containments/desktop/package/contents/ui/FolderItemDelegate.qml2
-rw-r--r--containments/desktop/plugins/folder/foldermodel.cpp4
-rw-r--r--containments/desktop/plugins/folder/foldermodel.h1
3 files changed, 7 insertions, 0 deletions
diff --git a/containments/desktop/package/contents/ui/FolderItemDelegate.qml b/containments/desktop/package/contents/ui/FolderItemDelegate.qml
index b313d0f..67cc4bc 100644
--- a/containments/desktop/package/contents/ui/FolderItemDelegate.qml
+++ b/containments/desktop/package/contents/ui/FolderItemDelegate.qml
@@ -304,6 +304,8 @@ Item {
text: model.blank ? "" : model.display
+ font.italic: model.isLink
+
Component.onCompleted: textFix.disableMouseHandling(label) // FIXME TODO: See https://codereview.qt-project.org/#/c/113758/
}
}
diff --git a/containments/desktop/plugins/folder/foldermodel.cpp b/containments/desktop/plugins/folder/foldermodel.cpp
index 6441046..92c8ab8 100644
--- a/containments/desktop/plugins/folder/foldermodel.cpp
+++ b/containments/desktop/plugins/folder/foldermodel.cpp
@@ -153,6 +153,7 @@ QHash< int, QByteArray > FolderModel::staticRoleNames()
roleNames[BlankRole] = "blank";
roleNames[SelectedRole] = "selected";
roleNames[IsDirRole] = "isDir";
+ roleNames[IsLinkRole] = "isLink";
roleNames[UrlRole] = "url";
roleNames[LinkDestinationUrl] = "linkDestinationUrl";
roleNames[SizeRole] = "size";
@@ -946,6 +947,9 @@ QVariant FolderModel::data(const QModelIndex& index, int role) const
} else {
return isDir(mapToSource(index), m_dirModel);
}
+ } else if (role == IsLinkRole) {
+ const KFileItem item = itemForIndex(index);
+ return item.isLink();
} else if (role == UrlRole) {
return itemForIndex(index).url();
} else if (role == LinkDestinationUrl) {
diff --git a/containments/desktop/plugins/folder/foldermodel.h b/containments/desktop/plugins/folder/foldermodel.h
index c395b5d..5f89c49 100644
--- a/containments/desktop/plugins/folder/foldermodel.h
+++ b/containments/desktop/plugins/folder/foldermodel.h
@@ -92,6 +92,7 @@ class FolderModel : public QSortFilterProxyModel
BlankRole = Qt::UserRole + 1,
SelectedRole,
IsDirRole,
+ IsLinkRole,
UrlRole,
LinkDestinationUrl,
SizeRole,