Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 133561 - amaroK patch to sort playlist by muliple columns
Summary: amaroK patch to sort playlist by muliple columns
Status: RESOLVED UPSTREAM
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: x86 Other
: High enhancement (vote)
Assignee: Diego Elio Pettenò (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-05-16 19:28 UTC by James Bowlin
Modified: 2006-05-17 00:12 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
diff of amarok-1.4.0-r2.ebuild (amarok-ebuild.patch,764 bytes, patch)
2006-05-16 19:31 UTC, James Bowlin
Details | Diff
The actually amaroK patch from the files/ directory. (amarok-1.4-multicolsort.patch,2.79 KB, patch)
2006-05-16 19:33 UTC, James Bowlin
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description James Bowlin 2006-05-16 19:28:35 UTC
Hi!

Here is a simple patch for amaroK that allows users to sort their playlists
by multiple columns.

This feature was requested in this thread on the forums:
http://forums.gentoo.org/viewtopic-t-460797-highlight-.html

I got the patch from this KDE bug report:
http://bugs.kde.org/show_bug.cgi?id=111157

I used the patch submit by Stefan Siegel, not the patch(es) submitted
by Bonne Eggleston.  I modified Stafan's patch to work with the 1.4
code base.  It works with amarok-1.4.0-r1, amarok-1.4.0-r2, and
amarok-1.4_beta3-r2. 

I don't think the GUI and speed complaints against the Eggleston patch apply
to the Siegel patch.  The Siegel patch basically just changes:

  QString::localeAwareCompare( a, b )

to:

  QString::localeAwareCompare( a, b ) * 2
            + ( ( itemPos() < i->itemPos() ) == ascending ? -1 : 1 )

which stabilizes the sort and thus allows multicolumn sorts by using the
previous sort order as the "tie breaker" for the current sort.  Unless
there is something terribly wrong with QT, the time it takes to do the
two itemPos()'s should be much smaller than the time it takes to do the
localeAwareCompare() and thus the patch should not significantly affect the
speed of the sorts.  I was able to sort my entire collection of over 2000
tracks in under 10 seconds.  I also noticed that the time of sorts varied
with the length of the text of the column being sorted which again indicates
that the localeAwareCompare() is what is dominating the sort time.

I added a USE flag: multicolsort to control the application of this patch.
I will attach a diff of the latest ebuild and the patch file.
Comment 1 James Bowlin 2006-05-16 19:31:56 UTC
Created attachment 86900 [details, diff]
diff of amarok-1.4.0-r2.ebuild
Comment 2 James Bowlin 2006-05-16 19:33:47 UTC
Created attachment 86902 [details, diff]
The actually amaroK patch from the files/ directory.
Comment 3 Diego Elio Pettenò (RETIRED) gentoo-dev 2006-05-17 00:12:49 UTC
I won't patch amaroK to add features. The patches currently applied are suggested by upstream (and will be present already in official 1.4.0 release, consider our version a "prerelease"), and I don't really have time to maintain half-forks.

A 1.4.1 version shouldn't be much distant, so I think you should simply for upstream (string/feature freeze is over now).