Bug 56684 - Add Comment Column To Juk
Summary: Add Comment Column To Juk
Status: RESOLVED FIXED
Alias: None
Product: juk
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: Scott Wheeler
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-04-01 04:24 UTC by davidsmind
Modified: 2003-04-02 01:19 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description davidsmind 2003-04-01 04:24:24 UTC
Version:            (using KDE 3.1.9)
Compiler:          gcc version 3.2.2
OS:          Linux (i686) release 2.4.21-pre5-aa2

I Would like to see Comment Column capability added to juk. I don't code, but I don't think this should be too hard.
Comment 1 Scott Wheeler 2003-04-02 01:19:48 UTC
Subject: kdemultimedia/juk

CVS commit by 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


  M +8 -0      playlist.cpp   1.65
  M +6 -0      playlistitem.cpp   1.29
  M +2 -1      playlistitem.h   1.25


--- kdemultimedia/juk/playlist.cpp  #1.64:1.65
@@ -658,4 +658,5 @@ void Playlist::setup()
     addColumn(i18n("Year"));
     addColumn(i18n("Length"));
+    addColumn(i18n("Comment"));
     addColumn(i18n("File Name"));
 
@@ -697,4 +698,11 @@ void Playlist::setup()
 
     connect(m_headerMenu, SIGNAL(activated(int)), this, SLOT(slotToggleColumnVisible(int)));
+
+    //////////////////////////////////////////////////
+    // hide some columns by default
+    //////////////////////////////////////////////////
+
+    hideColumn(PlaylistItem::CommentColumn);
+    hideColumn(PlaylistItem::FileNameColumn);
 
     //////////////////////////////////////////////////

--- kdemultimedia/juk/playlistitem.cpp  #1.28:1.29
@@ -261,4 +261,10 @@ void PlaylistItem::slotRefreshImpl()
     setText(LengthColumn,      tag()->lengthString());
     setText(FileNameColumn,    filePath());
+    
+    QString shortComment = tag()->comment().simplifyWhiteSpace();
+    if(shortComment.length() > 50)
+        shortComment = shortComment.left(47) + "...";
+    
+    setText(CommentColumn,     shortComment);
 }
 

--- kdemultimedia/juk/playlistitem.h  #1.24:1.25
@@ -61,5 +61,6 @@ class PlaylistItem : public QObject, pub
 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; }