|
|
|
@ -128,7 +128,7 @@ CollectionBrowser::CollectionBrowser( const char* name )
|
|
|
|
|
m_timeFilter = new KComboBox( m_ipodHbox, "timeFilter" );
|
|
|
|
|
m_ipodHbox->setStretchFactor( m_timeFilter, 1 );
|
|
|
|
|
// Allow the combobox to shrink so the iPod buttons are still visible
|
|
|
|
|
m_timeFilter->tqsetSizePolicy( TQSizePolicy::Expanding, TQSizePolicy::Fixed );
|
|
|
|
|
m_timeFilter->setSizePolicy( TQSizePolicy::Expanding, TQSizePolicy::Fixed );
|
|
|
|
|
m_timeFilter->insertItem( i18n( "Entire Collection" ) );
|
|
|
|
|
m_timeFilter->insertItem( i18n( "Added Today" ) );
|
|
|
|
|
m_timeFilter->insertItem( i18n( "Added Within One Week" ) );
|
|
|
|
@ -415,7 +415,7 @@ CollectionBrowser::layoutToolbar()
|
|
|
|
|
m_configureAction->plug( m_toolbar );
|
|
|
|
|
|
|
|
|
|
//This would break things if the toolbar is too big, see bug #121915
|
|
|
|
|
//setMinimumWidth( m_toolbar->tqsizeHint().width() + 2 ); //set a reasonable minWidth
|
|
|
|
|
//setMinimumWidth( m_toolbar->sizeHint().width() + 2 ); //set a reasonable minWidth
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -864,7 +864,7 @@ CollectionView::slotExpand( TQListViewItem* item ) //SLOT
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ( translateTimeFilter( timeFilter() ) > 0 )
|
|
|
|
|
qb.addFilter( QueryBuilder::tabSong, QueryBuilder::valCreateDate, TQString().setNum( TQDateTime::tqcurrentDateTime().toTime_t() - translateTimeFilter( timeFilter() ) ), QueryBuilder::modeGreater );
|
|
|
|
|
qb.addFilter( QueryBuilder::tabSong, QueryBuilder::valCreateDate, TQString().setNum( TQDateTime::currentDateTime().toTime_t() - translateTimeFilter( timeFilter() ) ), QueryBuilder::modeGreater );
|
|
|
|
|
|
|
|
|
|
TQString itemText;
|
|
|
|
|
bool isUnknown;
|
|
|
|
@ -2335,7 +2335,7 @@ CollectionView::listSelected()
|
|
|
|
|
buildIpodQuery( qb, trackDepth(), filters, filterYear, true, true );
|
|
|
|
|
|
|
|
|
|
if ( translateTimeFilter( timeFilter() ) > 0 )
|
|
|
|
|
qb.addFilter( QueryBuilder::tabSong, QueryBuilder::valCreateDate, TQString().setNum( TQDateTime::tqcurrentDateTime().toTime_t() - translateTimeFilter( timeFilter() ) ), QueryBuilder::modeGreater );
|
|
|
|
|
qb.addFilter( QueryBuilder::tabSong, QueryBuilder::valCreateDate, TQString().setNum( TQDateTime::currentDateTime().toTime_t() - translateTimeFilter( timeFilter() ) ), QueryBuilder::modeGreater );
|
|
|
|
|
|
|
|
|
|
qb.setOptions( QueryBuilder::optOnlyCompilations );
|
|
|
|
|
qb.setGoogleFilter( tables | QueryBuilder::tabSong, m_filter );
|
|
|
|
@ -2350,7 +2350,7 @@ CollectionView::listSelected()
|
|
|
|
|
buildIpodQuery( qb, trackDepth(), filters, filterYear, true, false );
|
|
|
|
|
|
|
|
|
|
if ( translateTimeFilter( timeFilter() ) > 0 )
|
|
|
|
|
qb.addFilter( QueryBuilder::tabSong, QueryBuilder::valCreateDate, TQString().setNum( TQDateTime::tqcurrentDateTime().toTime_t() - translateTimeFilter( timeFilter() ) ), QueryBuilder::modeGreater );
|
|
|
|
|
qb.addFilter( QueryBuilder::tabSong, QueryBuilder::valCreateDate, TQString().setNum( TQDateTime::currentDateTime().toTime_t() - translateTimeFilter( timeFilter() ) ), QueryBuilder::modeGreater );
|
|
|
|
|
|
|
|
|
|
if( sortByTrackFirst )
|
|
|
|
|
qb.setOptions( QueryBuilder::optNoCompilations );
|
|
|
|
@ -2385,7 +2385,7 @@ CollectionView::listSelected()
|
|
|
|
|
const bool sampler = static_cast<CollectionItem*>( item )->isSampler();
|
|
|
|
|
qb.clear();
|
|
|
|
|
if ( translateTimeFilter( timeFilter() ) > 0 )
|
|
|
|
|
qb.addFilter( QueryBuilder::tabSong, QueryBuilder::valCreateDate, TQString().setNum( TQDateTime::tqcurrentDateTime().toTime_t() - translateTimeFilter( timeFilter() ) ), QueryBuilder::modeGreater );
|
|
|
|
|
qb.addFilter( QueryBuilder::tabSong, QueryBuilder::valCreateDate, TQString().setNum( TQDateTime::currentDateTime().toTime_t() - translateTimeFilter( timeFilter() ) ), QueryBuilder::modeGreater );
|
|
|
|
|
|
|
|
|
|
qb.addReturnValue( QueryBuilder::tabSong, QueryBuilder::valURL );
|
|
|
|
|
|
|
|
|
@ -2461,7 +2461,7 @@ CollectionView::listSelected()
|
|
|
|
|
const bool sampler = static_cast<CollectionItem*>( item )->isSampler();
|
|
|
|
|
qb.clear();
|
|
|
|
|
if ( translateTimeFilter( timeFilter() ) > 0 )
|
|
|
|
|
qb.addFilter( QueryBuilder::tabSong, QueryBuilder::valCreateDate, TQString().setNum( TQDateTime::tqcurrentDateTime().toTime_t() - translateTimeFilter( timeFilter() ) ), QueryBuilder::modeGreater );
|
|
|
|
|
qb.addFilter( QueryBuilder::tabSong, QueryBuilder::valCreateDate, TQString().setNum( TQDateTime::currentDateTime().toTime_t() - translateTimeFilter( timeFilter() ) ), QueryBuilder::modeGreater );
|
|
|
|
|
|
|
|
|
|
qb.addReturnValue( QueryBuilder::tabSong, QueryBuilder::valURL );
|
|
|
|
|
|
|
|
|
@ -2565,7 +2565,7 @@ CollectionView::listSelected()
|
|
|
|
|
const bool sampler = static_cast<CollectionItem*>( item )->isSampler();
|
|
|
|
|
qb.clear();
|
|
|
|
|
if ( translateTimeFilter( timeFilter() ) > 0 )
|
|
|
|
|
qb.addFilter( QueryBuilder::tabSong, QueryBuilder::valCreateDate, TQString().setNum( TQDateTime::tqcurrentDateTime().toTime_t() - translateTimeFilter( timeFilter() ) ), QueryBuilder::modeGreater );
|
|
|
|
|
qb.addFilter( QueryBuilder::tabSong, QueryBuilder::valCreateDate, TQString().setNum( TQDateTime::currentDateTime().toTime_t() - translateTimeFilter( timeFilter() ) ), QueryBuilder::modeGreater );
|
|
|
|
|
|
|
|
|
|
qb.addReturnValue( QueryBuilder::tabSong, QueryBuilder::valURL );
|
|
|
|
|
|
|
|
|
@ -3502,7 +3502,7 @@ CollectionView::manipulateThe( TQString &str, bool reverse )
|
|
|
|
|
bool
|
|
|
|
|
CollectionView::endsInThe( const TQString & text )
|
|
|
|
|
{
|
|
|
|
|
return text.tqendsWith( ", the", false );
|
|
|
|
|
return text.endsWith( ", the", false );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// avoid code duplication
|
|
|
|
@ -3539,9 +3539,9 @@ CollectionView::viewportPaintEvent( TQPaintEvent *e )
|
|
|
|
|
const uint w = t.width() + 20;
|
|
|
|
|
const uint h = t.height() + 20;
|
|
|
|
|
|
|
|
|
|
p.setBrush( tqcolorGroup().background() );
|
|
|
|
|
p.setBrush( colorGroup().background() );
|
|
|
|
|
p.drawRoundRect( 15, 15, w, h, (8*200)/w, (8*200)/h );
|
|
|
|
|
t.draw( &p, 20, 20, TQRect(), tqcolorGroup() );
|
|
|
|
|
t.draw( &p, 20, 20, TQRect(), colorGroup() );
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -3710,7 +3710,7 @@ CollectionView::renderFlatModeView( bool /*=false*/ )
|
|
|
|
|
QueryBuilder qb;
|
|
|
|
|
|
|
|
|
|
if ( translateTimeFilter( timeFilter() ) > 0 )
|
|
|
|
|
qb.addFilter( QueryBuilder::tabSong, QueryBuilder::valCreateDate, TQString().setNum( TQDateTime::tqcurrentDateTime().toTime_t() - translateTimeFilter( timeFilter() ) ), QueryBuilder::modeGreater );
|
|
|
|
|
qb.addFilter( QueryBuilder::tabSong, QueryBuilder::valCreateDate, TQString().setNum( TQDateTime::currentDateTime().toTime_t() - translateTimeFilter( timeFilter() ) ), QueryBuilder::modeGreater );
|
|
|
|
|
|
|
|
|
|
if ( translateTimeFilter( timeFilter() ) <= 0
|
|
|
|
|
&& (m_filter.length() < 3 || (!m_filter.contains( " " ) && m_filter.endsWith( ":" ) ) ) )
|
|
|
|
@ -3883,7 +3883,7 @@ CollectionView::renderTreeModeView( bool /*=false*/ )
|
|
|
|
|
QueryBuilder qb;
|
|
|
|
|
|
|
|
|
|
if ( translateTimeFilter( timeFilter() ) > 0 )
|
|
|
|
|
qb.addFilter( QueryBuilder::tabSong, QueryBuilder::valCreateDate, TQString().setNum( TQDateTime::tqcurrentDateTime().toTime_t() - translateTimeFilter( timeFilter() ) ), QueryBuilder::modeGreater );
|
|
|
|
|
qb.addFilter( QueryBuilder::tabSong, QueryBuilder::valCreateDate, TQString().setNum( TQDateTime::currentDateTime().toTime_t() - translateTimeFilter( timeFilter() ) ), QueryBuilder::modeGreater );
|
|
|
|
|
|
|
|
|
|
setSorting( 0 );
|
|
|
|
|
int VisYearAlbum = -1;
|
|
|
|
@ -3985,7 +3985,7 @@ CollectionView::renderTreeModeView( bool /*=false*/ )
|
|
|
|
|
//Dividers for "The Who" should be created as "W", not "T", because
|
|
|
|
|
//that's how we sort it
|
|
|
|
|
TQString actualStr = *it;
|
|
|
|
|
if ( m_cat1 == IdArtist && actualStr.tqstartsWith( "the ", false ) )
|
|
|
|
|
if ( m_cat1 == IdArtist && actualStr.startsWith( "the ", false ) )
|
|
|
|
|
manipulateThe( actualStr, true );
|
|
|
|
|
|
|
|
|
|
TQString headerStr = DividerItem::createGroup( actualStr, m_cat1);
|
|
|
|
@ -4020,7 +4020,7 @@ CollectionView::renderTreeModeView( bool /*=false*/ )
|
|
|
|
|
qb.clear();
|
|
|
|
|
if ( translateTimeFilter( timeFilter() ) > 0 )
|
|
|
|
|
qb.addFilter( QueryBuilder::tabSong, QueryBuilder::valCreateDate,
|
|
|
|
|
TQString().setNum( TQDateTime::tqcurrentDateTime().toTime_t() -
|
|
|
|
|
TQString().setNum( TQDateTime::currentDateTime().toTime_t() -
|
|
|
|
|
translateTimeFilter( timeFilter() ) ), QueryBuilder::modeGreater );
|
|
|
|
|
|
|
|
|
|
qb.addReturnValue( q_cat1, QueryBuilder::valName, true );
|
|
|
|
@ -4174,7 +4174,7 @@ CollectionView::renderIpodModeView( bool /*=false*/ )
|
|
|
|
|
QueryBuilder qb;
|
|
|
|
|
|
|
|
|
|
if ( translateTimeFilter( timeFilter() ) > 0 )
|
|
|
|
|
qb.addFilter( QueryBuilder::tabSong, QueryBuilder::valCreateDate, TQString().setNum( TQDateTime::tqcurrentDateTime().toTime_t() - translateTimeFilter( timeFilter() ) ), QueryBuilder::modeGreater );
|
|
|
|
|
qb.addFilter( QueryBuilder::tabSong, QueryBuilder::valCreateDate, TQString().setNum( TQDateTime::currentDateTime().toTime_t() - translateTimeFilter( timeFilter() ) ), QueryBuilder::modeGreater );
|
|
|
|
|
|
|
|
|
|
int catArr[3] = {m_cat1, m_cat2, m_cat3};
|
|
|
|
|
// stillFiltering is true when we're not viewing tracks
|
|
|
|
@ -4300,7 +4300,7 @@ CollectionView::renderIpodModeView( bool /*=false*/ )
|
|
|
|
|
//because that's how we sort it
|
|
|
|
|
TQString actualStr = item->text( 0 );
|
|
|
|
|
if ( m_cat == IdArtist &&
|
|
|
|
|
actualStr.tqstartsWith( "the ", false ) )
|
|
|
|
|
actualStr.startsWith( "the ", false ) )
|
|
|
|
|
manipulateThe( actualStr, true );
|
|
|
|
|
|
|
|
|
|
TQString headerStr = DividerItem::createGroup( actualStr, m_cat );
|
|
|
|
@ -4510,9 +4510,9 @@ CollectionItem::compare( TQListViewItem* i, int col, bool ascending ) const
|
|
|
|
|
return -1;
|
|
|
|
|
//For artists, we sort by ignoring "The" eg "The Who" sorts as if it were "Who"
|
|
|
|
|
case IdArtist:
|
|
|
|
|
if ( a.tqstartsWith( "the ", false ) )
|
|
|
|
|
if ( a.startsWith( "the ", false ) )
|
|
|
|
|
CollectionView::manipulateThe( a, true );
|
|
|
|
|
if ( b.tqstartsWith( "the ", false ) )
|
|
|
|
|
if ( b.startsWith( "the ", false ) )
|
|
|
|
|
CollectionView::manipulateThe( b, true );
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
@ -4698,7 +4698,7 @@ DividerItem::shareTheSameGroup(const TQString& itemStr, const TQString& divStr,
|
|
|
|
|
}
|
|
|
|
|
case IdArtist:
|
|
|
|
|
//"The Who" should count as being in "W" and not "T"
|
|
|
|
|
if ( tmp.tqstartsWith( "the ", false ) )
|
|
|
|
|
if ( tmp.startsWith( "the ", false ) )
|
|
|
|
|
CollectionView::manipulateThe( tmp, true );
|
|
|
|
|
//Fall through
|
|
|
|
|
default:
|
|
|
|
@ -4706,7 +4706,7 @@ DividerItem::shareTheSameGroup(const TQString& itemStr, const TQString& divStr,
|
|
|
|
|
if (divStr == "0-9" && TQChar(tmp.at(0)).isDigit()) {
|
|
|
|
|
inGroup = true;
|
|
|
|
|
}
|
|
|
|
|
else if (tmp.tqstartsWith(divStr, 0)) {
|
|
|
|
|
else if (tmp.startsWith(divStr, 0)) {
|
|
|
|
|
inGroup = true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|