|
|
|
@ -440,9 +440,9 @@ CollectionBrowser::ipodToolbar( bool activate )
|
|
|
|
|
CollectionView* CollectionView::m_instance = 0;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
CollectionView::CollectionView( CollectionBrowser* tqparent )
|
|
|
|
|
: KListView( tqparent )
|
|
|
|
|
, m_tqparent( tqparent )
|
|
|
|
|
CollectionView::CollectionView( CollectionBrowser* parent )
|
|
|
|
|
: KListView( parent )
|
|
|
|
|
, m_parent( parent )
|
|
|
|
|
, m_timeFilter( 0 )
|
|
|
|
|
, m_currentDepth( 0 )
|
|
|
|
|
, m_ipodIncremented ( 1 )
|
|
|
|
@ -570,7 +570,7 @@ CollectionView::keyPressEvent( TQKeyEvent *e )
|
|
|
|
|
// This rewritten code is more faithful to the ordinary moving
|
|
|
|
|
// behavior, even when looping around. (For instance, it behaves
|
|
|
|
|
// correctly if control-up is pressed at the top of the screen.)
|
|
|
|
|
// It sends fake keypress events to the tqparent instead of programatically
|
|
|
|
|
// It sends fake keypress events to the parent instead of programatically
|
|
|
|
|
// selecting items.
|
|
|
|
|
if( (e->key() == Key_Up || e->key() == Key_Down ) && currentItem() )
|
|
|
|
|
{
|
|
|
|
@ -637,10 +637,10 @@ CollectionView::keyPressEvent( TQKeyEvent *e )
|
|
|
|
|
&& m_viewMode == modeIpodView )
|
|
|
|
|
{
|
|
|
|
|
if( e->key() == Key_Right )
|
|
|
|
|
m_tqparent->m_ipodIncrement->activate();
|
|
|
|
|
m_parent->m_ipodIncrement->activate();
|
|
|
|
|
|
|
|
|
|
else if( e->key() == Key_Left )
|
|
|
|
|
m_tqparent->m_ipodDecrement->activate();
|
|
|
|
|
m_parent->m_ipodDecrement->activate();
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -660,7 +660,7 @@ CollectionView::renderView(bool force /* = false */) //SLOT
|
|
|
|
|
if(!force && !m_dirty )
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
if( BrowserBar::instance()->currentBrowser() != m_tqparent )
|
|
|
|
|
if( BrowserBar::instance()->currentBrowser() != m_parent )
|
|
|
|
|
{
|
|
|
|
|
// the collectionbrowser is intensive for sql, so we only renderView() if the tab
|
|
|
|
|
// is currently active. else, wait until user focuses it.
|
|
|
|
@ -791,7 +791,7 @@ CollectionView::slotEnsureSelectedItemVisible() //SLOT
|
|
|
|
|
while ( r )
|
|
|
|
|
{
|
|
|
|
|
parents.push( r );
|
|
|
|
|
r = r->tqparent();
|
|
|
|
|
r = r->parent();
|
|
|
|
|
}
|
|
|
|
|
while ( !parents.isEmpty() )
|
|
|
|
|
{
|
|
|
|
@ -939,18 +939,18 @@ CollectionView::slotExpand( TQListViewItem* item ) //SLOT
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 1:
|
|
|
|
|
tmptext = dynamic_cast<CollectionItem*>( item->tqparent() ) ?
|
|
|
|
|
static_cast<CollectionItem*>( item->tqparent() )->getSTQLText( 0 ) :
|
|
|
|
|
item->tqparent()->text( 0 );
|
|
|
|
|
tmptext = dynamic_cast<CollectionItem*>( item->parent() ) ?
|
|
|
|
|
static_cast<CollectionItem*>( item->parent() )->getSTQLText( 0 ) :
|
|
|
|
|
item->parent()->text( 0 );
|
|
|
|
|
isUnknown = tmptext.isEmpty();
|
|
|
|
|
|
|
|
|
|
if( !static_cast<CollectionItem*>( item->tqparent() )->isSampler() )
|
|
|
|
|
if( !static_cast<CollectionItem*>( item->parent() )->isSampler() )
|
|
|
|
|
{
|
|
|
|
|
if ( m_cat1 == IdArtist )
|
|
|
|
|
qb.setOptions( QueryBuilder::optNoCompilations );
|
|
|
|
|
if( VisYearAlbum == 1 )
|
|
|
|
|
{
|
|
|
|
|
tmptext = item->tqparent()->text( 0 );
|
|
|
|
|
tmptext = item->parent()->text( 0 );
|
|
|
|
|
TQString year = tmptext.left( tmptext.find( i18n(" - ") ) );
|
|
|
|
|
yearAlbumCalc( year, tmptext );
|
|
|
|
|
qb.addMatch( QueryBuilder::tabYear, year, false, true );
|
|
|
|
@ -1014,18 +1014,18 @@ CollectionView::slotExpand( TQListViewItem* item ) //SLOT
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 2:
|
|
|
|
|
tmptext = dynamic_cast<CollectionItem*> ( item->tqparent()->tqparent() ) ?
|
|
|
|
|
static_cast<CollectionItem*>( item->tqparent()->tqparent() )->getSTQLText( 0 ) :
|
|
|
|
|
item->tqparent()->tqparent()->text( 0 );
|
|
|
|
|
tmptext = dynamic_cast<CollectionItem*> ( item->parent()->parent() ) ?
|
|
|
|
|
static_cast<CollectionItem*>( item->parent()->parent() )->getSTQLText( 0 ) :
|
|
|
|
|
item->parent()->parent()->text( 0 );
|
|
|
|
|
isUnknown = tmptext.isEmpty();
|
|
|
|
|
|
|
|
|
|
if ( !static_cast<CollectionItem*>( item->tqparent()->tqparent() )->isSampler() )
|
|
|
|
|
if ( !static_cast<CollectionItem*>( item->parent()->parent() )->isSampler() )
|
|
|
|
|
{
|
|
|
|
|
if ( m_cat1 == IdArtist )
|
|
|
|
|
qb.setOptions( QueryBuilder::optNoCompilations );
|
|
|
|
|
if( VisYearAlbum == 1 )
|
|
|
|
|
{
|
|
|
|
|
tmptext = item->tqparent()->tqparent()->text( 0 );
|
|
|
|
|
tmptext = item->parent()->parent()->text( 0 );
|
|
|
|
|
TQString year = tmptext.left( tmptext.find( i18n(" - ") ) );
|
|
|
|
|
yearAlbumCalc( year, tmptext );
|
|
|
|
|
qb.addMatch( QueryBuilder::tabYear, year, false, true );
|
|
|
|
@ -1041,14 +1041,14 @@ CollectionView::slotExpand( TQListViewItem* item ) //SLOT
|
|
|
|
|
c = true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
tmptext = dynamic_cast<CollectionItem*>( item->tqparent() ) ?
|
|
|
|
|
static_cast<CollectionItem*>( item->tqparent() )->getSTQLText( 0 ) :
|
|
|
|
|
item->tqparent()->text( 0 );
|
|
|
|
|
tmptext = dynamic_cast<CollectionItem*>( item->parent() ) ?
|
|
|
|
|
static_cast<CollectionItem*>( item->parent() )->getSTQLText( 0 ) :
|
|
|
|
|
item->parent()->text( 0 );
|
|
|
|
|
isUnknown = tmptext.isEmpty();
|
|
|
|
|
|
|
|
|
|
if( VisYearAlbum == 2 )
|
|
|
|
|
{
|
|
|
|
|
tmptext = item->tqparent()->text( 0 );
|
|
|
|
|
tmptext = item->parent()->text( 0 );
|
|
|
|
|
TQString year = tmptext.left( tmptext.find( i18n(" - ") ) );
|
|
|
|
|
yearAlbumCalc( year, tmptext );
|
|
|
|
|
qb.addMatch( QueryBuilder::tabYear, year, false, true );
|
|
|
|
@ -1151,7 +1151,7 @@ CollectionView::slotExpand( TQListViewItem* item ) //SLOT
|
|
|
|
|
child->setExpandable( expandable );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//Display the album cover for the tqparent item now it is expanded
|
|
|
|
|
//Display the album cover for the parent item now it is expanded
|
|
|
|
|
if ( dynamic_cast<CollectionItem*>( item ) )
|
|
|
|
|
{
|
|
|
|
|
CollectionItem *i = static_cast<CollectionItem*>( item );
|
|
|
|
@ -1235,29 +1235,29 @@ CollectionView::presetMenu( int id ) //SLOT
|
|
|
|
|
void
|
|
|
|
|
CollectionView::cat1Menu( int id, bool rerender ) //SLOT
|
|
|
|
|
{
|
|
|
|
|
m_tqparent->m_cat1Menu->setItemChecked( m_cat1, false ); //uncheck old item
|
|
|
|
|
m_tqparent->m_cat2Menu->setItemEnabled( m_cat1, true ); //enable old items
|
|
|
|
|
m_tqparent->m_cat3Menu->setItemEnabled( m_cat1, true );
|
|
|
|
|
m_parent->m_cat1Menu->setItemChecked( m_cat1, false ); //uncheck old item
|
|
|
|
|
m_parent->m_cat2Menu->setItemEnabled( m_cat1, true ); //enable old items
|
|
|
|
|
m_parent->m_cat3Menu->setItemEnabled( m_cat1, true );
|
|
|
|
|
m_cat1 = id;
|
|
|
|
|
updateColumnHeader();
|
|
|
|
|
resetIpodDepth();
|
|
|
|
|
m_tqparent->m_cat1Menu->setItemChecked( m_cat1, true );
|
|
|
|
|
m_parent->m_cat1Menu->setItemChecked( m_cat1, true );
|
|
|
|
|
|
|
|
|
|
//prevent choosing the same category in both menus
|
|
|
|
|
m_tqparent->m_cat2Menu->setItemEnabled( id , false );
|
|
|
|
|
m_tqparent->m_cat3Menu->setItemEnabled( id , false );
|
|
|
|
|
m_parent->m_cat2Menu->setItemEnabled( id , false );
|
|
|
|
|
m_parent->m_cat3Menu->setItemEnabled( id , false );
|
|
|
|
|
|
|
|
|
|
//if this item is checked in second menu, uncheck it
|
|
|
|
|
if ( m_tqparent->m_cat2Menu->isItemChecked( id ) ) {
|
|
|
|
|
m_tqparent->m_cat2Menu->setItemChecked( id, false );
|
|
|
|
|
m_tqparent->m_cat2Menu->setItemChecked( IdNone, true );
|
|
|
|
|
if ( m_parent->m_cat2Menu->isItemChecked( id ) ) {
|
|
|
|
|
m_parent->m_cat2Menu->setItemChecked( id, false );
|
|
|
|
|
m_parent->m_cat2Menu->setItemChecked( IdNone, true );
|
|
|
|
|
m_cat2 = IdNone;
|
|
|
|
|
enableCat3Menu( false );
|
|
|
|
|
}
|
|
|
|
|
//if this item is checked in third menu, uncheck it
|
|
|
|
|
if ( m_tqparent->m_cat3Menu->isItemChecked( id ) ) {
|
|
|
|
|
m_tqparent->m_cat3Menu->setItemChecked( id, false );
|
|
|
|
|
m_tqparent->m_cat3Menu->setItemChecked( IdNone, true );
|
|
|
|
|
if ( m_parent->m_cat3Menu->isItemChecked( id ) ) {
|
|
|
|
|
m_parent->m_cat3Menu->setItemChecked( id, false );
|
|
|
|
|
m_parent->m_cat3Menu->setItemChecked( IdNone, true );
|
|
|
|
|
m_cat3 = IdNone;
|
|
|
|
|
}
|
|
|
|
|
updateTrackDepth();
|
|
|
|
@ -1271,23 +1271,23 @@ CollectionView::cat1Menu( int id, bool rerender ) //SLOT
|
|
|
|
|
void
|
|
|
|
|
CollectionView::cat2Menu( int id, bool rerender ) //SLOT
|
|
|
|
|
{
|
|
|
|
|
m_tqparent->m_cat2Menu->setItemChecked( m_cat2, false ); //uncheck old item
|
|
|
|
|
m_tqparent->m_cat3Menu->setItemEnabled( m_cat3, true ); //enable old item
|
|
|
|
|
m_parent->m_cat2Menu->setItemChecked( m_cat2, false ); //uncheck old item
|
|
|
|
|
m_parent->m_cat3Menu->setItemEnabled( m_cat3, true ); //enable old item
|
|
|
|
|
m_cat2 = id;
|
|
|
|
|
m_tqparent->m_cat2Menu->setItemChecked( m_cat2, true );
|
|
|
|
|
m_parent->m_cat2Menu->setItemChecked( m_cat2, true );
|
|
|
|
|
updateColumnHeader();
|
|
|
|
|
resetIpodDepth();
|
|
|
|
|
|
|
|
|
|
enableCat3Menu( id != IdNone );
|
|
|
|
|
|
|
|
|
|
//prevent choosing the same category in both menus
|
|
|
|
|
m_tqparent->m_cat3Menu->setItemEnabled( m_cat1 , false );
|
|
|
|
|
m_parent->m_cat3Menu->setItemEnabled( m_cat1 , false );
|
|
|
|
|
if( id != IdNone )
|
|
|
|
|
m_tqparent->m_cat3Menu->setItemEnabled( id , false );
|
|
|
|
|
m_parent->m_cat3Menu->setItemEnabled( id , false );
|
|
|
|
|
|
|
|
|
|
//if this item is checked in third menu, uncheck it
|
|
|
|
|
if ( m_tqparent->m_cat3Menu->isItemChecked( id ) ) {
|
|
|
|
|
m_tqparent->m_cat3Menu->setItemChecked( id, false );
|
|
|
|
|
if ( m_parent->m_cat3Menu->isItemChecked( id ) ) {
|
|
|
|
|
m_parent->m_cat3Menu->setItemChecked( id, false );
|
|
|
|
|
enableCat3Menu( false );
|
|
|
|
|
}
|
|
|
|
|
updateTrackDepth();
|
|
|
|
@ -1301,9 +1301,9 @@ CollectionView::cat2Menu( int id, bool rerender ) //SLOT
|
|
|
|
|
void
|
|
|
|
|
CollectionView::cat3Menu( int id, bool rerender ) //SLOT
|
|
|
|
|
{
|
|
|
|
|
m_tqparent->m_cat3Menu->setItemChecked( m_cat3, false ); //uncheck old item
|
|
|
|
|
m_parent->m_cat3Menu->setItemChecked( m_cat3, false ); //uncheck old item
|
|
|
|
|
m_cat3 = id;
|
|
|
|
|
m_tqparent->m_cat3Menu->setItemChecked( m_cat3, true );
|
|
|
|
|
m_parent->m_cat3Menu->setItemChecked( m_cat3, true );
|
|
|
|
|
updateColumnHeader();
|
|
|
|
|
resetIpodDepth();
|
|
|
|
|
updateTrackDepth();
|
|
|
|
@ -1317,17 +1317,17 @@ CollectionView::cat3Menu( int id, bool rerender ) //SLOT
|
|
|
|
|
void
|
|
|
|
|
CollectionView::enableCat3Menu( bool enable )
|
|
|
|
|
{
|
|
|
|
|
m_tqparent->m_cat3Menu->setItemEnabled( IdAlbum, enable );
|
|
|
|
|
m_tqparent->m_cat3Menu->setItemEnabled( IdVisYearAlbum, enable );
|
|
|
|
|
m_tqparent->m_cat3Menu->setItemEnabled( IdArtist, enable );
|
|
|
|
|
m_tqparent->m_cat3Menu->setItemEnabled( IdComposer, enable );
|
|
|
|
|
m_tqparent->m_cat3Menu->setItemEnabled( IdGenre, enable );
|
|
|
|
|
m_tqparent->m_cat3Menu->setItemEnabled( IdYear, enable );
|
|
|
|
|
m_tqparent->m_cat3Menu->setItemEnabled( IdLabel, enable );
|
|
|
|
|
m_parent->m_cat3Menu->setItemEnabled( IdAlbum, enable );
|
|
|
|
|
m_parent->m_cat3Menu->setItemEnabled( IdVisYearAlbum, enable );
|
|
|
|
|
m_parent->m_cat3Menu->setItemEnabled( IdArtist, enable );
|
|
|
|
|
m_parent->m_cat3Menu->setItemEnabled( IdComposer, enable );
|
|
|
|
|
m_parent->m_cat3Menu->setItemEnabled( IdGenre, enable );
|
|
|
|
|
m_parent->m_cat3Menu->setItemEnabled( IdYear, enable );
|
|
|
|
|
m_parent->m_cat3Menu->setItemEnabled( IdLabel, enable );
|
|
|
|
|
|
|
|
|
|
if( !enable ) {
|
|
|
|
|
m_tqparent->m_cat3Menu->setItemChecked( m_cat3, false );
|
|
|
|
|
m_tqparent->m_cat3Menu->setItemChecked( IdNone, true );
|
|
|
|
|
m_parent->m_cat3Menu->setItemChecked( m_cat3, false );
|
|
|
|
|
m_parent->m_cat3Menu->setItemChecked( IdNone, true );
|
|
|
|
|
m_cat3 = IdNone;
|
|
|
|
|
}
|
|
|
|
|
updateTrackDepth();
|
|
|
|
@ -1374,7 +1374,7 @@ CollectionView::ipodItemClicked( TQListViewItem *item, const TQPoint&, int c )
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
// The TQt manual says NOT to delete items from within this slot
|
|
|
|
|
TQTimer::singleShot( 0, m_tqparent->m_ipodIncrement, TQT_SLOT( activate() ) );
|
|
|
|
|
TQTimer::singleShot( 0, m_parent->m_ipodIncrement, TQT_SLOT( activate() ) );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -1525,11 +1525,11 @@ CollectionView::rmbPressed( TQListViewItem* item, const TQPoint& point, int ) //
|
|
|
|
|
{
|
|
|
|
|
TQString artist;
|
|
|
|
|
if( item->depth() - artistLevel == 1 )
|
|
|
|
|
artist = item->tqparent()->text( 0 );
|
|
|
|
|
artist = item->parent()->text( 0 );
|
|
|
|
|
else if( item->depth() - artistLevel == 2 )
|
|
|
|
|
artist = item->tqparent()->tqparent()->text( 0 );
|
|
|
|
|
artist = item->parent()->parent()->text( 0 );
|
|
|
|
|
else if( item->depth() - artistLevel == 3 )
|
|
|
|
|
artist = item->tqparent()->tqparent()->tqparent()->text( 0 );
|
|
|
|
|
artist = item->parent()->parent()->parent()->text( 0 );
|
|
|
|
|
K3bExporter::instance()->exportAlbum( artist, trueItemText );
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
@ -1579,15 +1579,15 @@ CollectionView::setViewMode( int mode, bool rerender /*=true*/ )
|
|
|
|
|
#if KDE_VERSION >= KDE_MAKE_VERSION(3,4,0)
|
|
|
|
|
setShadeSortColumn( false );
|
|
|
|
|
#endif
|
|
|
|
|
m_tqparent->m_ipodDecrement->setEnabled( m_currentDepth > 0 );
|
|
|
|
|
m_tqparent->ipodToolbar( true );
|
|
|
|
|
m_parent->m_ipodDecrement->setEnabled( m_currentDepth > 0 );
|
|
|
|
|
m_parent->ipodToolbar( true );
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
#if KDE_VERSION >= KDE_MAKE_VERSION(3,4,0)
|
|
|
|
|
setShadeSortColumn( true );
|
|
|
|
|
#endif
|
|
|
|
|
m_tqparent->ipodToolbar( false );
|
|
|
|
|
m_parent->ipodToolbar( false );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ( rerender )
|
|
|
|
@ -1628,9 +1628,9 @@ CollectionItem::setPixmap(int column, const TQPixmap & pix)
|
|
|
|
|
|
|
|
|
|
//Now work out the artist
|
|
|
|
|
CollectionItem *p = this;
|
|
|
|
|
while ( p->tqparent() && dynamic_cast<CollectionItem*>( p->tqparent() ) )
|
|
|
|
|
while ( p->parent() && dynamic_cast<CollectionItem*>( p->parent() ) )
|
|
|
|
|
{
|
|
|
|
|
p = static_cast<CollectionItem*>( p->tqparent() );
|
|
|
|
|
p = static_cast<CollectionItem*>( p->parent() );
|
|
|
|
|
if ( IdArtist == p->m_cat )
|
|
|
|
|
{
|
|
|
|
|
artist = p->text( 0 );
|
|
|
|
@ -1774,7 +1774,7 @@ CollectionView::organizeFiles( const KURL::List &urls, const TQString &caption,
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
OrganizeCollectionDialogBase base( m_tqparent, "OrganizeFiles", true, caption,
|
|
|
|
|
OrganizeCollectionDialogBase base( m_parent, "OrganizeFiles", true, caption,
|
|
|
|
|
KDialogBase::Ok|KDialogBase::Cancel|KDialogBase::Details );
|
|
|
|
|
TQVBox* page = base.makeVBoxMainWidget();
|
|
|
|
|
|
|
|
|
@ -2142,12 +2142,12 @@ CollectionView::updateColumnHeader()
|
|
|
|
|
TQResizeEvent rev( size(), TQSize() );
|
|
|
|
|
viewportResizeEvent( &rev );
|
|
|
|
|
|
|
|
|
|
m_tqparent->m_categoryMenu->setItemChecked( IdArtist, m_cat1 == IdArtist && m_cat2 == IdNone );
|
|
|
|
|
m_tqparent->m_categoryMenu->setItemChecked( IdAlbum, m_cat1 == IdAlbum && m_cat2 == IdNone );
|
|
|
|
|
m_tqparent->m_categoryMenu->setItemChecked( IdArtistAlbum, m_cat1 == IdArtist && m_cat2 == IdAlbum && m_cat3 == IdNone );
|
|
|
|
|
m_tqparent->m_categoryMenu->setItemChecked( IdArtistVisYearAlbum, m_cat1 == IdArtist && m_cat2 == IdVisYearAlbum && m_cat3 == IdNone );
|
|
|
|
|
m_tqparent->m_categoryMenu->setItemChecked( IdGenreArtist, m_cat1 == IdGenre && m_cat2 == IdArtist && m_cat3 == IdNone );
|
|
|
|
|
m_tqparent->m_categoryMenu->setItemChecked( IdGenreArtistAlbum, m_cat1 == IdGenre && m_cat2 == IdArtist && m_cat3 == IdAlbum );
|
|
|
|
|
m_parent->m_categoryMenu->setItemChecked( IdArtist, m_cat1 == IdArtist && m_cat2 == IdNone );
|
|
|
|
|
m_parent->m_categoryMenu->setItemChecked( IdAlbum, m_cat1 == IdAlbum && m_cat2 == IdNone );
|
|
|
|
|
m_parent->m_categoryMenu->setItemChecked( IdArtistAlbum, m_cat1 == IdArtist && m_cat2 == IdAlbum && m_cat3 == IdNone );
|
|
|
|
|
m_parent->m_categoryMenu->setItemChecked( IdArtistVisYearAlbum, m_cat1 == IdArtist && m_cat2 == IdVisYearAlbum && m_cat3 == IdNone );
|
|
|
|
|
m_parent->m_categoryMenu->setItemChecked( IdGenreArtist, m_cat1 == IdGenre && m_cat2 == IdArtist && m_cat3 == IdNone );
|
|
|
|
|
m_parent->m_categoryMenu->setItemChecked( IdGenreArtistAlbum, m_cat1 == IdGenre && m_cat2 == IdArtist && m_cat3 == IdAlbum );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -2219,7 +2219,7 @@ CollectionView::listSelectedSiblingsOf( int cat, TQListViewItem* item )
|
|
|
|
|
KURL::List
|
|
|
|
|
CollectionView::listSelected()
|
|
|
|
|
{
|
|
|
|
|
//Here we determine the URLs of all selected items. We use two passes, one for the tqparent items,
|
|
|
|
|
//Here we determine the URLs of all selected items. We use two passes, one for the parent items,
|
|
|
|
|
//and another one for the tqchildren.
|
|
|
|
|
|
|
|
|
|
KURL::List list;
|
|
|
|
@ -2450,13 +2450,13 @@ CollectionView::listSelected()
|
|
|
|
|
{
|
|
|
|
|
for ( item = firstChild(); item; item = item->nextSibling() )
|
|
|
|
|
for ( TQListViewItem* child = item->firstChild(); child; child = child->nextSibling() )
|
|
|
|
|
if ( child->isSelected() && !child->tqparent()->isSelected() )
|
|
|
|
|
if ( child->isSelected() && !child->parent()->isSelected() )
|
|
|
|
|
list << static_cast<CollectionItem*>( child ) ->url();
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
for ( item = firstChild(); item; item = item->nextSibling() )
|
|
|
|
|
for ( TQListViewItem* child = item->firstChild(); child; child = child->nextSibling() )
|
|
|
|
|
if ( child->isSelected() && !child->tqparent()->isSelected() )
|
|
|
|
|
if ( child->isSelected() && !child->parent()->isSelected() )
|
|
|
|
|
{
|
|
|
|
|
const bool sampler = static_cast<CollectionItem*>( item )->isSampler();
|
|
|
|
|
qb.clear();
|
|
|
|
@ -2543,7 +2543,7 @@ CollectionView::listSelected()
|
|
|
|
|
for ( item = firstChild(); item; item = item->nextSibling() )
|
|
|
|
|
for ( TQListViewItem* child = item->firstChild(); child; child = child->nextSibling() )
|
|
|
|
|
for ( TQListViewItem* grandChild = child->firstChild(); grandChild; grandChild = grandChild->nextSibling() )
|
|
|
|
|
if ( grandChild->isSelected() && !grandChild->isExpandable() && !child->tqparent()->isSelected() && !child->isSelected() )
|
|
|
|
|
if ( grandChild->isSelected() && !grandChild->isExpandable() && !child->parent()->isSelected() && !child->isSelected() )
|
|
|
|
|
list << static_cast<CollectionItem*>( grandChild ) ->url();
|
|
|
|
|
|
|
|
|
|
//category 3
|
|
|
|
@ -2553,14 +2553,14 @@ CollectionView::listSelected()
|
|
|
|
|
for ( TQListViewItem* child = item->firstChild(); child; child = child->nextSibling() )
|
|
|
|
|
for ( TQListViewItem* grandChild = child->firstChild(); grandChild; grandChild = grandChild->nextSibling() )
|
|
|
|
|
for ( TQListViewItem* grandChild2 = grandChild->firstChild(); grandChild2; grandChild2 = grandChild2->nextSibling() )
|
|
|
|
|
if ( grandChild2->isSelected() && !child->tqparent()->isSelected() && !child->isSelected() && !grandChild->isSelected() )
|
|
|
|
|
if ( grandChild2->isSelected() && !child->parent()->isSelected() && !child->isSelected() && !grandChild->isSelected() )
|
|
|
|
|
list << static_cast<CollectionItem*>( grandChild2 ) ->url();
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
for ( item = firstChild(); item; item = item->nextSibling() )
|
|
|
|
|
for ( TQListViewItem* child = item->firstChild(); child; child = child->nextSibling() )
|
|
|
|
|
for ( TQListViewItem* grandChild = child->firstChild(); grandChild; grandChild = grandChild->nextSibling() )
|
|
|
|
|
if ( grandChild->isSelected() && !grandChild->tqparent()->isSelected() )
|
|
|
|
|
if ( grandChild->isSelected() && !grandChild->parent()->isSelected() )
|
|
|
|
|
{
|
|
|
|
|
const bool sampler = static_cast<CollectionItem*>( item )->isSampler();
|
|
|
|
|
qb.clear();
|
|
|
|
@ -2661,7 +2661,7 @@ CollectionView::listSelected()
|
|
|
|
|
for ( TQListViewItem* child = item->firstChild(); child; child = child->nextSibling() )
|
|
|
|
|
for ( TQListViewItem* grandChild = child->firstChild(); grandChild; grandChild = grandChild->nextSibling() )
|
|
|
|
|
for ( TQListViewItem* grandChild2 = grandChild->firstChild(); grandChild2; grandChild2 = grandChild2->nextSibling() )
|
|
|
|
|
if ( grandChild2->isSelected() && !child->tqparent()->isSelected() && !child->isSelected() && !grandChild->isSelected() )
|
|
|
|
|
if ( grandChild2->isSelected() && !child->parent()->isSelected() && !child->isSelected() && !grandChild->isSelected() )
|
|
|
|
|
list << static_cast<CollectionItem*>( grandChild2 ) ->url();
|
|
|
|
|
|
|
|
|
|
return list;
|
|
|
|
@ -2957,7 +2957,7 @@ CollectionView::incrementDepth( bool rerender /*= true*/ )
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
m_tqparent->m_ipodDecrement->setEnabled( true );
|
|
|
|
|
m_parent->m_ipodDecrement->setEnabled( true );
|
|
|
|
|
|
|
|
|
|
// We're not in track mode
|
|
|
|
|
int catArr[3] = {m_cat1, m_cat2, m_cat3};
|
|
|
|
@ -3051,7 +3051,7 @@ CollectionView::decrementDepth ( bool rerender /*= true*/ )
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
m_currentDepth--;
|
|
|
|
|
m_tqparent->m_ipodDecrement->setEnabled( m_currentDepth > 0 );
|
|
|
|
|
m_parent->m_ipodDecrement->setEnabled( m_currentDepth > 0 );
|
|
|
|
|
m_ipodFilters[m_currentDepth].clear();
|
|
|
|
|
int catArr[3] = {m_cat1, m_cat2, m_cat3};
|
|
|
|
|
int cat = catArr[m_currentDepth];
|
|
|
|
@ -3086,7 +3086,7 @@ CollectionView::resetIpodDepth ( void )
|
|
|
|
|
m_ipodFilters[1].clear();
|
|
|
|
|
m_ipodFilters[2].clear();
|
|
|
|
|
m_ipodIncremented = 1;
|
|
|
|
|
m_tqparent->m_ipodDecrement->setEnabled( false );
|
|
|
|
|
m_parent->m_ipodDecrement->setEnabled( false );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -3384,7 +3384,7 @@ CollectionView::cacheView()
|
|
|
|
|
if ( item->isOpen() ) {
|
|
|
|
|
//construct path to item
|
|
|
|
|
TQStringList itemPath;
|
|
|
|
|
for( const TQListViewItem *i = item; i; i = i->tqparent() )
|
|
|
|
|
for( const TQListViewItem *i = item; i; i = i->parent() )
|
|
|
|
|
itemPath.prepend( i->text( 0 ) );
|
|
|
|
|
|
|
|
|
|
m_cacheOpenItemPaths.append ( itemPath );
|
|
|
|
@ -3445,7 +3445,7 @@ TQStringList
|
|
|
|
|
CollectionView::makeStructuredNameList( TQListViewItem *item ) const
|
|
|
|
|
{
|
|
|
|
|
TQStringList nameList;
|
|
|
|
|
for ( TQListViewItem *current = item; current; current = current->tqparent() )
|
|
|
|
|
for ( TQListViewItem *current = item; current; current = current->parent() )
|
|
|
|
|
nameList.push_front( current->text( 0 ) );
|
|
|
|
|
return nameList;
|
|
|
|
|
}
|
|
|
|
@ -4538,8 +4538,8 @@ CollectionItem::sortChildItems ( int column, bool ascending ) {
|
|
|
|
|
//
|
|
|
|
|
// DividerItem
|
|
|
|
|
|
|
|
|
|
DividerItem::DividerItem( TQListView* tqparent, TQString txt, int cat/*, bool sortYearsInverted*/)
|
|
|
|
|
: KListViewItem( tqparent), m_blockText(false), m_text(txt), m_cat(cat)/*, m_sortYearsInverted(sortYearsInverted)*/
|
|
|
|
|
DividerItem::DividerItem( TQListView* parent, TQString txt, int cat/*, bool sortYearsInverted*/)
|
|
|
|
|
: KListViewItem( parent), m_blockText(false), m_text(txt), m_cat(cat)/*, m_sortYearsInverted(sortYearsInverted)*/
|
|
|
|
|
{
|
|
|
|
|
setExpandable(false);
|
|
|
|
|
setDropEnabled(false);
|
|
|
|
|