Commit 12d34ad6 authored by Scott Wheeler's avatar Scott Wheeler

Added a comment column (that's hidden by default) and also made the file

name column hidden by default.  The comment column only displays the first
50 characters of the comment.

CCMAIL:56684-done@bugs.kde.org

svn path=/trunk/kdemultimedia/juk/; revision=217692
parent 32b55e81
......@@ -657,6 +657,7 @@ void Playlist::setup()
addColumn(i18n("Genre"));
addColumn(i18n("Year"));
addColumn(i18n("Length"));
addColumn(i18n("Comment"));
addColumn(i18n("File Name"));
// These settings aren't really respected in KDE < 3.1.1, fixed in CVS
......@@ -697,6 +698,13 @@ void Playlist::setup()
connect(m_headerMenu, SIGNAL(activated(int)), this, SLOT(slotToggleColumnVisible(int)));
//////////////////////////////////////////////////
// hide some columns by default
//////////////////////////////////////////////////
hideColumn(PlaylistItem::CommentColumn);
hideColumn(PlaylistItem::FileNameColumn);
//////////////////////////////////////////////////
// setup playlist RMB menu
//////////////////////////////////////////////////
......
......@@ -260,6 +260,12 @@ void PlaylistItem::slotRefreshImpl()
setText(YearColumn, tag()->yearString());
setText(LengthColumn, tag()->lengthString());
setText(FileNameColumn, filePath());
QString shortComment = tag()->comment().simplifyWhiteSpace();
if(shortComment.length() > 50)
shortComment = shortComment.left(47) + "...";
setText(CommentColumn, shortComment);
}
////////////////////////////////////////////////////////////////////////////////
......
......@@ -60,7 +60,8 @@ class PlaylistItem : public QObject, public KListViewItem
public:
enum ColumnType { TrackColumn = 0, ArtistColumn = 1, AlbumColumn = 2, TrackNumberColumn = 3,
GenreColumn = 4, YearColumn = 5, LengthColumn = 6, FileNameColumn = 7 };
GenreColumn = 4, YearColumn = 5, LengthColumn = 6, CommentColumn = 7,
FileNameColumn = 8 };
static int lastColumn() { return FileNameColumn; }
......
Markdown is supported
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