| Summary: | Change "The Artist" to "Artist, The" in the Cover Manager | ||
|---|---|---|---|
| Product: | [Applications] amarok | Reporter: | Gleb Litvjak <blaster999> |
| Component: | general | Assignee: | Amarok Bugs <amarok-bugs-null> |
| Status: | RESOLVED FIXED | ||
| Severity: | wishlist | ||
| Priority: | NOR | ||
| Version First Reported In: | unspecified | ||
| Target Milestone: | --- | ||
| Platform: | Gentoo Packages | ||
| OS: | Linux | ||
| Latest Commit: | Version Fixed/Implemented In: | ||
| Sentry Crash Report: | |||
|
Description
Gleb Litvjak
2006-02-28 21:35:55 UTC
SVN commit 516411 by seb:
Change "The Artist" to "Artist, The" in the Cover Manager, like the collection browser
BUG:122858
M +2 -0 ChangeLog
M +30 -8 src/covermanager.cpp
--- trunk/extragear/multimedia/amarok/ChangeLog #516410:516411
@@ -4,6 +4,8 @@
VERSION 1.4-beta3:
FEATURES:
+ * Ignore 'The ' in artist names when sorting in the cover manager, as per
+ the collection browser. (BR 122858)
* Add autocompletion to the composer field in the tag dialog. (BR 123026)
CHANGES:
--- trunk/extragear/multimedia/amarok/src/covermanager.cpp #516410:516411
@@ -7,6 +7,7 @@
#include "browserToolBar.h"
#include "clicklineedit.h"
#include "debug.h"
+#include "collectionbrowser.h" //manipulateThe()
#include "collectiondb.h"
#include "config.h"
#include "coverfetcher.h"
@@ -84,23 +85,34 @@
m_artistView = new KListView( this );
m_artistView->addColumn(i18n( "Albums By" ));
m_artistView->setFullWidth( true );
- m_artistView->setSorting( -1 ); //no sort
+ m_artistView->setSorting( 0 );
m_artistView->setMinimumWidth( 180 );
- KListViewItem *item = new KListViewItem( m_artistView, i18n( "All Albums" ) );
- item->setPixmap( 0, SmallIcon("cdrom_unmount") );
+ KListViewItem *item = 0;
//load artists from the collection db
const QStringList artists = CollectionDB::instance()->artistList( false, false );
- foreach( artists ) {
- item = new KListViewItem( m_artistView, item, *it );
+ foreach( artists )
+ {
+ QString artist = *it;
+ if( artist.startsWith( "The " ) )
+ CollectionView::instance()->manipulateThe( artist, true );
+
+ item = new KListViewItem( m_artistView, item, artist );
item->setPixmap( 0, SmallIcon("personal") );
}
+ m_artistView->sort();
+
+ m_artistView->setSorting( -1 );
+ KListViewItem *last = item;
+ item = new KListViewItem( m_artistView, 0, i18n( "All Albums" ) );
+ item->setPixmap( 0, SmallIcon("cdrom_unmount") );
+
QueryBuilder qb;
qb.addReturnValue( QueryBuilder::tabAlbum, QueryBuilder::valName );
qb.setOptions( QueryBuilder::optOnlyCompilations | QueryBuilder::optRemoveDuplicates );
qb.setLimit( 0, 1 );
if ( qb.run().count() ) {
- item = new KListViewItem( m_artistView, item, i18n( "Various Artists" ) );
+ item = new KListViewItem( m_artistView, last, i18n( "Various Artists" ) );
item->setPixmap( 0, SmallIcon("personal") );
}
@@ -347,6 +359,11 @@
if( item->depth() ) //album item
return;
+ QString artist = item->text(0);
+
+ if( artist.endsWith( ", The" ) )
+ CollectionView::instance()->manipulateThe( artist, false );
+
m_coverView->clear();
m_coverItems.clear();
@@ -383,7 +400,7 @@
qb.setOptions( QueryBuilder::optNoCompilations );
if ( item != m_artistView->firstChild() )
- qb.addMatches( QueryBuilder::tabArtist, item->text( 0 ) );
+ qb.addMatches( QueryBuilder::tabArtist, artist );
albums = qb.run();
@@ -808,7 +825,12 @@
else if( m_artistView->selectedItem() ) {
text = i18n( "1 album", "%n albums", totalCounter );
if( m_artistView->selectedItem() != m_artistView->firstChild() ) //showing albums by an artist
- text += i18n( " by " ) + m_artistView->selectedItem()->text(0);
+ {
+ QString artist = m_artistView->selectedItem()->text(0);
+ if( artist.endsWith( ", The" ) )
+ CollectionView::instance()->manipulateThe( artist, false );
+ text += i18n( " by " ) + artist;
+ }
}
if( missingCounter )
|