From 6d8cd45cb7e5999dc79da192bc73673dd475f4df Mon Sep 17 00:00:00 2001 From: "craig.p.drummond" Date: Wed, 20 Jun 2012 16:18:50 +0000 Subject: [PATCH] Provide sub-text for all items in folderview, fixes corruption of list mode. --- ChangeLog | 2 ++ models/dirviewmodel.cpp | 11 ++++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 014ee23e9..f107716c2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -65,6 +65,8 @@ 40. Add keyboard short-cut for 'back' icon in listviews. 41. Fix issue (in Qt-builds) where messge widget sometimes (mainly at start-up) is not not as wide as the main window. +42. Provide sub-text for all items in folderview, fixes corruption of list + mode. 0.7.1 ----- diff --git a/models/dirviewmodel.cpp b/models/dirviewmodel.cpp index 2e1c0164b..4ed1adfd8 100644 --- a/models/dirviewmodel.cpp +++ b/models/dirviewmodel.cpp @@ -190,7 +190,16 @@ QVariant DirViewModel::data(const QModelIndex &index, int role) const #endif break; case DirViewItem::Type_File: - default: return QVariant(); + if (item->data().endsWith(".asx", Qt::CaseInsensitive) || item->data().endsWith(".m3u", Qt::CaseInsensitive) || + item->data().endsWith(".pls", Qt::CaseInsensitive) || item->data().endsWith(".xspf", Qt::CaseInsensitive) ) { + return i18n("Playlist"); + } else if (item->data().endsWith(".cue", Qt::CaseInsensitive)) { + return i18n("Cue Sheet"); + } else { + return i18n("Audio File"); + } + default: + return QVariant(); } default: break;