summaryrefslogtreecommitdiffstats
path: root/amarok/src/statistics.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'amarok/src/statistics.cpp')
-rw-r--r--amarok/src/statistics.cpp86
1 files changed, 43 insertions, 43 deletions
diff --git a/amarok/src/statistics.cpp b/amarok/src/statistics.cpp
index 33d1b23b..1efed47f 100644
--- a/amarok/src/statistics.cpp
+++ b/amarok/src/statistics.cpp
@@ -48,8 +48,8 @@
Statistics *Statistics::s_instance = 0;
-Statistics::Statistics( TQWidget *parent, const char *name )
- : KDialogBase( KDialogBase::Swallow, 0, parent, name, false, 0, Close )
+Statistics::Statistics( TQWidget *tqparent, const char *name )
+ : KDialogBase( KDialogBase::Swallow, 0, tqparent, name, false, 0, Close )
, m_timer( new TQTimer( this ) )
{
s_instance = this;
@@ -119,8 +119,8 @@ Statistics::slotSetFilter() //SLOT
/// CLASS StatisticsList
//////////////////////////////////////////////////////////////////////////////////////////
-StatisticsList::StatisticsList( TQWidget *parent, const char *name )
- : KListView( parent, name )
+StatisticsList::StatisticsList( TQWidget *tqparent, const char *name )
+ : KListView( tqparent, name )
, m_currentItem( 0 )
, m_expanded( false )
{
@@ -272,12 +272,12 @@ StatisticsList::renderView()
qb.addReturnFunctionValue( QueryBuilder::funcMin, QueryBuilder::tabStats, QueryBuilder::valCreateDate );
qb.setOptions( QueryBuilder::optRemoveDuplicates );
a = qb.run();
- TQDateTime firstPlay = TQDateTime::currentDateTime();
+ TQDateTime firstPlay = TQDateTime::tqcurrentDateTime();
if ( a[0].toUInt() )
firstPlay.setTime_t( a[0].toUInt() );
m_newestItem = new StatisticsItem( i18n("Newest Items"), this, m_genreItem );
- m_newestItem->setSubtext( i18n("First played %1").arg( Amarok::verboseTimeSince( firstPlay ) ) );
+ m_newestItem->setSubtext( i18n("First played %1").tqarg( Amarok::verboseTimeSince( firstPlay ) ) );
m_trackItem ->setIcon( Amarok::icon("track") );
m_mostplayedItem->setIcon( Amarok::icon("mostplayed") );
@@ -344,7 +344,7 @@ StatisticsList::expandInformation( StatisticsItem *item, bool refresh )
for( uint i=0; i < fave.count(); i += qb.countReturnValues() )
{
- TQString name = i18n("%1. %2 - %3").arg( TQString::number(c),
+ TQString name = i18n("%1. %2 - %3").tqarg( TQString::number(c),
fave[i].isEmpty() ? i18n( "Unknown" ) : fave[i],
fave[i+1].isEmpty() ? i18n( "Unknown" ) : fave[i+1]);
TQString score = locale->formatNumber( fave[i+3].toDouble(), 0 );
@@ -378,11 +378,11 @@ StatisticsList::expandInformation( StatisticsItem *item, bool refresh )
for( uint i=0; i < fave.count(); i += qb.countReturnValues() )
{
- TQString name = i18n("%1. %2 - %3").arg( TQString::number(c),
+ TQString name = i18n("%1. %2 - %3").tqarg( TQString::number(c),
fave[i].isEmpty() ? i18n( "Unknown" ) : fave[i],
fave[i+1].isEmpty() ? i18n( "Unknown" ) : fave[i+1]);
double plays = fave[i+3].toDouble();
- TQString subtext = i18n("%1: %2").arg( i18n( "Playcount" ) ).arg( plays );
+ TQString subtext = i18n("%1: %2").tqarg( i18n( "Playcount" ) ).tqarg( plays );
m_last = new StatisticsDetailedItem( name, subtext, item, m_last );
m_last->setItemType( StatisticsDetailedItem::TRACK );
m_last->setUrl( fave[i+2] );
@@ -413,13 +413,13 @@ StatisticsList::expandInformation( StatisticsItem *item, bool refresh )
for( uint i=0; i < fave.count(); i += qb.countReturnValues() )
{
- TQString name = i18n("%1. %2").arg( TQString::number(c),
+ TQString name = i18n("%1. %2").tqarg( TQString::number(c),
fave[i].isEmpty() ? i18n( "Unknown" ) : fave[i] );
TQString score = locale->formatNumber( fave[i+1].toDouble(), 2 );
TQString rating = locale->formatNumber( fave[i+2].toDouble() / 2.0, 2 );
m_last = new StatisticsDetailedItem( name, subText( score, rating ), item, m_last );
m_last->setItemType( StatisticsDetailedItem::ARTIST );
- TQString url = TQString("%1").arg( fave[i] );
+ TQString url = TQString("%1").tqarg( fave[i] );
m_last->setUrl( url );
c++;
}
@@ -461,7 +461,7 @@ StatisticsList::expandInformation( StatisticsItem *item, bool refresh )
for( uint i=0; i < fave.count(); i += qb.countReturnValues() )
{
const bool isSampler = (fave[i+6] == trueValue);
- TQString name = i18n("%1. %2 - %3").arg( TQString::number(c),
+ TQString name = i18n("%1. %2 - %3").tqarg( TQString::number(c),
fave[i].isEmpty() ? i18n( "Unknown" ) : fave[i],
isSampler ? i18n( "Various Artists" ) :
( fave[i+1].isEmpty() ? i18n( "Unknown" ) : fave[i+1] ) );
@@ -470,7 +470,7 @@ StatisticsList::expandInformation( StatisticsItem *item, bool refresh )
m_last = new StatisticsDetailedItem( name, subText( score, rating ), item, m_last );
m_last->setItemType( StatisticsDetailedItem::ALBUM );
- TQString url = TQString("%1 @@@ %2").arg( isSampler ? "0" : fave[i+2], fave[i+3] );
+ TQString url = TQString("%1 @@@ %2").tqarg( isSampler ? "0" : fave[i+2], fave[i+3] );
m_last->setUrl( url );
c++;
}
@@ -500,14 +500,14 @@ StatisticsList::expandInformation( StatisticsItem *item, bool refresh )
for( uint i=0; i < fave.count(); i += qb.countReturnValues() )
{
- TQString name = i18n("%1. %2").arg( TQString::number(c),
+ TQString name = i18n("%1. %2").tqarg( TQString::number(c),
fave[i].isEmpty() ? i18n( "Unknown" ) : fave[i] );
TQString score = locale->formatNumber( fave[i+1].toDouble(), 2 );
TQString rating = locale->formatNumber( fave[i+2].toDouble() / 2.0, 2 );
m_last = new StatisticsDetailedItem( name, subText( score, rating ), item, m_last );
m_last->setItemType( StatisticsDetailedItem::GENRE );
- TQString url = TQString("%1").arg( fave[i] );
+ TQString url = TQString("%1").tqarg( fave[i] );
m_last->setUrl( url );
c++;
}
@@ -541,33 +541,33 @@ StatisticsList::expandInformation( StatisticsItem *item, bool refresh )
for( uint i=0; i < newest.count(); i += qb.countReturnValues() )
{
- TQString name = i18n("%1. %2 - %3").arg( TQString::number(c),
+ TQString name = i18n("%1. %2 - %3").tqarg( TQString::number(c),
newest[i].isEmpty() ? i18n( "Unknown" ) : newest[i],
newest[i+1].isEmpty() ? i18n( "Unknown" ) : newest[i+1] );
TQDateTime added = TQDateTime();
added.setTime_t( newest[i+4].toUInt() );
- TQString subtext = i18n("Added: %1").arg( Amarok::verboseTimeSince( added ) );
+ TQString subtext = i18n("Added: %1").tqarg( Amarok::verboseTimeSince( added ) );
m_last = new StatisticsDetailedItem( name, subtext, item, m_last );
m_last->setItemType( StatisticsDetailedItem::HISTORY );
- TQString url = TQString("%1 @@@ %2").arg( newest[i+2] ).arg( newest[i+3] );
+ TQString url = TQString("%1 @@@ %2").tqarg( newest[i+2] ).tqarg( newest[i+3] );
m_last->setUrl( url );
c++;
}
}
item->setExpanded( true );
- repaintItem( item ); // Better than ::repaint(), flickers less
+ tqrepaintItem( item ); // Better than ::tqrepaint(), flickers less
delete locale;
}
TQString StatisticsList::subText( const TQString &score, const TQString &rating ) //static
{
if( AmarokConfig::useScores() && AmarokConfig::useRatings() )
- return i18n( "Score: %1 Rating: %2" ).arg( score ).arg( rating );
+ return i18n( "Score: %1 Rating: %2" ).tqarg( score ).tqarg( rating );
else if( AmarokConfig::useScores() )
- return i18n( "Score: %1" ).arg( score );
+ return i18n( "Score: %1" ).tqarg( score );
else if( AmarokConfig::useRatings() )
- return i18n( "Rating: %1" ).arg( rating );
+ return i18n( "Rating: %1" ).tqarg( rating );
else
return TQString();
}
@@ -623,9 +623,9 @@ StatisticsList::viewportPaintEvent( TQPaintEvent *e )
const uint x = (viewport()->width() - w - 30) / 2 ;
const uint y = (viewport()->height() - h - 30) / 2 ;
- p.setBrush( colorGroup().background() );
+ p.setBrush( tqcolorGroup().background() );
p.drawRoundRect( x, y, w+30, h+30, (8*200)/w, (8*200)/h );
- t.draw( &p, x+15, y+15, TQRect(), colorGroup() );
+ t.draw( &p, x+15, y+15, TQRect(), tqcolorGroup() );
}
}
@@ -639,10 +639,10 @@ StatisticsList::showContextMenu( TQListViewItem *item, const TQPoint &p, int )
bool hasSQL = !( item->itemType() == StatisticsDetailedItem::TRACK ); //track is url
KPopupMenu menu( this );
- enum Actions { APPEND, QUEUE, INFO };
+ enum Actions { APPEND, TQUEUE, INFO };
menu.insertItem( SmallIconSet( Amarok::icon( "add_playlist" ) ), i18n( "&Append to Playlist" ), APPEND );
- menu.insertItem( SmallIconSet( Amarok::icon( "queue_track" ) ), i18n( "&Queue Track" ), QUEUE );
+ menu.insertItem( SmallIconSet( Amarok::icon( "queue_track" ) ), i18n( "&Queue Track" ), TQUEUE );
menu.insertSeparator();
@@ -656,7 +656,7 @@ StatisticsList::showContextMenu( TQListViewItem *item, const TQPoint &p, int )
Playlist::instance()->insertMedia( KURL::fromPathOrURL( item->url() ) );
break;
- case QUEUE:
+ case TQUEUE:
hasSQL ?
Playlist::instance()->insertMediaSql( item->getSQL(), Playlist::Queue ):
Playlist::instance()->insertMedia( KURL::fromPathOrURL( item->url() ), Playlist::Queue );
@@ -681,8 +681,8 @@ StatisticsList::showContextMenu( TQListViewItem *item, const TQPoint &p, int )
/// CLASS StatisticsItem
//////////////////////////////////////////////////////////////////////////////////////////
-StatisticsItem::StatisticsItem( TQString text, StatisticsList *parent, KListViewItem *after, const char *name )
- : KListViewItem( static_cast<KListView*>(parent), after, name )
+StatisticsItem::StatisticsItem( TQString text, StatisticsList *tqparent, KListViewItem *after, const char *name )
+ : KListViewItem( static_cast<KListView*>(tqparent), after, name )
, m_animTimer( new TQTimer( this ) )
, m_animCount( 0 )
, m_isActive( false )
@@ -701,7 +701,7 @@ void
StatisticsItem::setIcon( const TQString &icon )
{
TQString path = kapp->iconLoader()->iconPath( icon, -KIcon::SizeHuge );
- path.replace( "32x32", "48x48" ); //HACK fucking KIconLoader only returns 32x32 max. Why?
+ path.tqreplace( "32x32", "48x48" ); //HACK fucking KIconLoader only returns 32x32 max. Why?
// debug() << "ICONPATH: " << path << endl;
@@ -735,7 +735,7 @@ StatisticsItem::slotAnimTimer()
if( m_animEnter )
{
m_animCount += 1;
- listView()->repaintItem( this ); // Better than ::repaint(), flickers less
+ listView()->tqrepaintItem( this ); // Better than ::tqrepaint(), flickers less
if( m_animCount >= ANIM_MAX )
m_animTimer->stop();
@@ -743,7 +743,7 @@ StatisticsItem::slotAnimTimer()
else
{
m_animCount -= 1;
- listView()->repaintItem( this );
+ listView()->tqrepaintItem( this );
if( m_animCount <= 0 )
{
m_animTimer->stop();
@@ -837,7 +837,7 @@ StatisticsItem::paintCell( TQPainter *p, const TQColorGroup &cg, int column, int
p->drawPixmap( 0, 0, buffer );
}
-QColor
+TQColor
StatisticsItem::blendColors( const TQColor& color1, const TQColor& color2, int percent )
{
const float factor1 = ( 100 - ( float ) percent ) / 100;
@@ -857,9 +857,9 @@ StatisticsItem::blendColors( const TQColor& color1, const TQColor& color2, int p
/// CLASS StatisticsDetailedItem
//////////////////////////////////////////////////////////////////////////////////////////
-StatisticsDetailedItem::StatisticsDetailedItem( const TQString &text, const TQString &subtext, StatisticsItem *parent,
+StatisticsDetailedItem::StatisticsDetailedItem( const TQString &text, const TQString &subtext, StatisticsItem *tqparent,
StatisticsDetailedItem *after, const char *name )
- : KListViewItem( parent, after, name )
+ : KListViewItem( tqparent, after, name )
, m_type( NONE )
, m_subText( subtext )
{
@@ -930,10 +930,10 @@ StatisticsDetailedItem::paintCell( TQPainter *p, const TQColorGroup &cg, int col
if( showDetails )
{
- const TQColorGroup _cg = listView()->palette().disabled();
+ const TQColorGroup _cg = listView()->tqpalette().disabled();
text_x = lv->treeStepSize() + 3;
font.setItalic( true );
- pBuf.setPen( isSelected() ? _cg.highlightedText() : _cg.text().dark() );
+ pBuf.setPen( isSelected() ? _cg.highlightedText() : TQColor(_cg.text().dark()) );
pBuf.drawText( text_x, textHeight, width, fm.lineSpacing(), AlignVCenter, m_subText );
}
@@ -955,17 +955,17 @@ StatisticsDetailedItem::setup()
setHeight( h + margin );
}
-QString
+TQString
StatisticsDetailedItem::getSQL()
{
QueryBuilder qb;
- TQString query = TQString::null;
+ TQString query = TQString();
TQString artist, album, track; // track is unused here
Amarok::albumArtistTrackFromUrl( url(), artist, album, track );
if( itemType() == StatisticsDetailedItem::ALBUM || itemType() == StatisticsDetailedItem::HISTORY )
{
- qb.initSQLDrag();
+ qb.initSTQLDrag();
if ( artist != "0" )
qb.addMatch( QueryBuilder::tabSong, QueryBuilder::valArtistID, artist );
qb.addMatch( QueryBuilder::tabSong, QueryBuilder::valAlbumID, album );
@@ -977,7 +977,7 @@ StatisticsDetailedItem::getSQL()
{
const uint artist_id = CollectionDB::instance()->artistID( url() );
- qb.initSQLDrag();
+ qb.initSTQLDrag();
qb.addMatch( QueryBuilder::tabSong, QueryBuilder::valArtistID, TQString::number( artist_id ) );
qb.sortBy( QueryBuilder::tabYear, QueryBuilder::valName );
qb.sortBy( QueryBuilder::tabAlbum, QueryBuilder::valName );
@@ -989,7 +989,7 @@ StatisticsDetailedItem::getSQL()
{
const uint genre_id = CollectionDB::instance()->genreID( url() );
- qb.initSQLDrag();
+ qb.initSTQLDrag();
qb.addMatch( QueryBuilder::tabSong, QueryBuilder::valGenreID, TQString::number( genre_id ) );
qb.sortBy( QueryBuilder::tabArtist, QueryBuilder::valName );
qb.sortBy( QueryBuilder::tabYear, QueryBuilder::valName );
@@ -1009,7 +1009,7 @@ StatisticsDetailedItem::getURLs()
return KURL::List( KURL::fromPathOrURL(url()) );
QueryBuilder qb;
- TQString query = TQString::null;
+ TQString query = TQString();
TQString artist, album, track; // track is unused here
Amarok::albumArtistTrackFromUrl( m_url, artist, album, track );