diff options
author | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2011-12-16 09:55:29 -0600 |
---|---|---|
committer | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2011-12-16 09:55:29 -0600 |
commit | 708e0debf366cbe6a2c966a3127ba82a9fdc07e5 (patch) | |
tree | 07f554e6804d9f39c420329bee10497248886c41 /amarok/src/playlist.cpp | |
parent | 2d3d921590b44ae1e8864104f3e36d022bec0308 (diff) | |
download | amarok-708e0debf366cbe6a2c966a3127ba82a9fdc07e5.tar.gz amarok-708e0debf366cbe6a2c966a3127ba82a9fdc07e5.zip |
Revert "Rename a number of old tq methods that are no longer tq specific"
This reverts commit 2d3d921590b44ae1e8864104f3e36d022bec0308.
Diffstat (limited to 'amarok/src/playlist.cpp')
-rw-r--r-- | amarok/src/playlist.cpp | 108 |
1 files changed, 54 insertions, 54 deletions
diff --git a/amarok/src/playlist.cpp b/amarok/src/playlist.cpp index cbc29f26..42b6bd4a 100644 --- a/amarok/src/playlist.cpp +++ b/amarok/src/playlist.cpp @@ -48,7 +48,7 @@ #include <cmath> //for pow() in playNextTrack() #include <tqbuffer.h> -#include <clipboard.h> //copyToClipboard(), slotMouseButtonPressed() +#include <tqclipboard.h> //copyToClipboard(), slotMouseButtonPressed() #include <tqcolor.h> #include <tqevent.h> #include <tqfile.h> //undo system @@ -62,7 +62,7 @@ #include <tqtooltip.h> #include <tqvaluelist.h> //addHybridTracks() #include <tqvaluevector.h> //playNextTrack() -#include <layout.h> +#include <tqlayout.h> #include <kaction.h> #include <kapplication.h> @@ -166,7 +166,7 @@ Playlist *Playlist::s_instance = 0; Playlist::Playlist( TQWidget *parent ) : KListView( parent, "ThePlaylist" ) , EngineObserver( EngineController::instance() ) - , m_startupTime_t( TQDateTime::currentDateTime().toTime_t() ) + , m_startupTime_t( TQDateTime::tqcurrentDateTime().toTime_t() ) , m_oldestTime_t( CollectionDB::instance()->query( "SELECT MIN( createdate ) FROM statistics;" ).first().toInt() ) , m_currentTrack( 0 ) , m_marker( 0 ) @@ -958,7 +958,7 @@ Playlist::playNextTrack( bool forceNext ) if( !AmarokConfig::randomMode() ) { item = MyIt::nextVisible( item ); - while( item && ( !checkFileStatus( item ) || !item->exists() ) ) + while( item && ( !checkFiletqStatus( item ) || !item->exists() ) ) item = MyIt::nextVisible( item ); setCurrentTrack( item ); } @@ -1002,7 +1002,7 @@ Playlist::playNextTrack( bool forceNext ) } else for( MyIt it( this ); *it; ++it ) - if ( !m_prevTracks.containsRef( *it ) && checkFileStatus( *it ) && (*it)->exists() ) + if ( !m_prevTracks.containsRef( *it ) && checkFiletqStatus( *it ) && (*it)->exists() ) tracks.push_back( *it ); if( tracks.isEmpty() ) { @@ -1082,7 +1082,7 @@ Playlist::playNextTrack( bool forceNext ) item = tracks.at( KApplication::random() % tracks.count() ); //is O(1) else { - const uint currenttime_t = TQDateTime::currentDateTime().toTime_t(); + const uint currenttime_t = TQDateTime::tqcurrentDateTime().toTime_t(); TQValueVector<int> weights( tracks.size() ); TQ_INT64 total = m_total; if( Amarok::randomAlbums() ) @@ -1131,13 +1131,13 @@ Playlist::playNextTrack( bool forceNext ) else if( item ) { item = MyIt::nextVisible( item ); - while( item && ( !checkFileStatus( item ) || !item->exists() ) ) + while( item && ( !checkFiletqStatus( item ) || !item->exists() ) ) item = MyIt::nextVisible( item ); } else { item = *MyIt( this ); //ie. first visible item - while( item && ( !checkFileStatus( item ) || !item->exists() ) ) + while( item && ( !checkFiletqStatus( item ) || !item->exists() ) ) item = item->nextSibling(); } @@ -1227,7 +1227,7 @@ Playlist::playPrevTrack() if( !item ) { item = *static_cast<MyIt&>(--MyIt( item )); - while( item && !checkFileStatus( item ) ) + while( item && !checkFiletqStatus( item ) ) item = *static_cast<MyIt&>(--MyIt( item )); } } @@ -1241,13 +1241,13 @@ Playlist::playPrevTrack() if( item ) { item = MyIt::prevVisible( item ); - while( item && ( !checkFileStatus( item ) || !item->isEnabled() ) ) + while( item && ( !checkFiletqStatus( item ) || !item->isEnabled() ) ) item = MyIt::prevVisible( item ); } else { item = *MyIt( this ); //ie. first visible item - while( item && ( !checkFileStatus( item ) || !item->isEnabled() ) ) + while( item && ( !checkFiletqStatus( item ) || !item->isEnabled() ) ) item = item->nextSibling(); } } @@ -1562,7 +1562,7 @@ Playlist::slotCountChanged() } bool -Playlist::checkFileStatus( PlaylistItem * item ) +Playlist::checkFiletqStatus( PlaylistItem * item ) { //DEBUG_BLOCK //debug() << "uniqueid of item = " << item->uniqueId() << ", url = " << item->url().path() << endl; @@ -1622,7 +1622,7 @@ Playlist::activate( TQListViewItem *item ) #define item static_cast<PlaylistItem*>(item) - if ( !checkFileStatus( item ) ) + if ( !checkFiletqStatus( item ) ) { Amarok::StatusBar::instance()->shortMessage( i18n("Local file does not exist.") ); return; @@ -1712,7 +1712,7 @@ TQPair<TQString, TQRect> Playlist::toolTipText( TQWidget*, const TQPoint &pos ) else text = item->text( col ); - TQRect irect = itemRect( item ); + TQRect irect = tqitemRect( item ); const int headerPos = header()->sectionPos( col ); irect.setLeft( headerPos - 1 ); irect.setRight( headerPos + header()->sectionSize( col ) ); @@ -1755,7 +1755,7 @@ TQPair<TQString, TQRect> Playlist::toolTipText( TQWidget*, const TQPoint &pos ) text = text.replace( "&", "&" ).replace( "<", "<" ).replace( ">", ">" ); if( item->isCurrent() ) { - text = TQString("<i>%1</i>").arg( text ); + text = TQString("<i>%1</i>").tqarg( text ); Amarok::ToolTip::s_hack = 1; //HACK for precise positioning } return TQPair<TQString, TQRect>( text, globalRect ); @@ -2277,7 +2277,7 @@ Playlist::writeTag( TQListViewItem *qitem, const TQString &, int column ) //SLOT for( PlaylistItem *item = m_itemsToChangeTagsFor.first(); item; item = m_itemsToChangeTagsFor.next() ) { - if( !checkFileStatus( item ) ) + if( !checkFiletqStatus( item ) ) continue; const TQString oldTag = item == qitem ? m_editOldTag : item->exactText(column); @@ -2340,8 +2340,8 @@ Playlist::paletteChange( const TQPalette &p ) const uint steps = STEPS+5+5; //so we don't fade all the way to base, and all the way up to highlight either - fg = colorGroup().highlight(); - bg = colorGroup().base(); + fg = tqcolorGroup().highlight(); + bg = tqcolorGroup().base(); dr = double(bg.red() - fg.red()) / steps; dg = double(bg.green() - fg.green()) / steps; @@ -2357,8 +2357,8 @@ Playlist::paletteChange( const TQPalette &p ) const uint steps = STEPS + 5; //so we don't fade all the way to base - fg = colorGroup().highlightedText(); - bg = colorGroup().text(); + fg = tqcolorGroup().highlightedText(); + bg = tqcolorGroup().text(); dr = double(bg.red() - fg.red()) / steps; dg = double(bg.green() - fg.green()) / steps; @@ -2372,7 +2372,7 @@ Playlist::paletteChange( const TQPalette &p ) KListView::paletteChange( p ); counter = 0; // reset the counter or apparently the text lacks contrast - slotGlowTimer(); // repaint currentTrack marker + slotGlowTimer(); // tqrepaint currentTrack marker } void @@ -2404,7 +2404,7 @@ Playlist::contentsDragMoveEvent( TQDragMoveEvent* e ) const TQPoint p = contentsToViewport( e->pos() ); TQListViewItem *item = itemAt( p ); if( !item || ctrlPressed ) item = lastItem(); - else if( p.y() - itemRect( item ).top() < (item->height()/2) ) item = item->itemAbove(); + else if( p.y() - tqitemRect( item ).top() < (item->height()/2) ) item = item->itemAbove(); if( item != m_marker ) { //NOTE this if block prevents flicker @@ -2532,7 +2532,7 @@ Playlist::viewportPaintEvent( TQPaintEvent *e ) TQPainter p( viewport() ); p.fillRect( drawDropVisualizer( 0, 0, m_marker ), - TQBrush( colorGroup().highlight().dark(), TQBrush::Dense4Pattern ) ); + TQBrush( tqcolorGroup().highlight().dark(), TQBrush::Dense4Pattern ) ); } else if( m_showHelp && isEmpty() ) { TQPainter p( viewport() ); @@ -2569,9 +2569,9 @@ Playlist::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() ); delete t; } } @@ -2737,7 +2737,7 @@ Playlist::eventFilter( TQObject *o, TQEvent *e ) KPopupMenu popup; if( mouseOverColumn >= 0 ) - popup.insertItem( i18n("&Hide %1").arg( columnText( mouseOverColumn ) ), HIDE ); //TODO + popup.insertItem( i18n("&Hide %1").tqarg( columnText( mouseOverColumn ) ), HIDE ); //TODO KPopupMenu sub; for( int i = 0; i < columns(); ++i ) //columns() references a property @@ -3124,10 +3124,10 @@ Playlist::saveXML( const TQString &path ) const TQString title = ( dynamicMode()->title() ).replace( "&", "&" ) .replace( "<", "<" ) .replace( ">", ">" ); - dynamic = TQString(" dynamicMode=\"%1\"").arg( title ); + dynamic = TQString(" dynamicMode=\"%1\"").tqarg( title ); } stream << TQString( "<playlist product=\"%1\" version=\"%2\"%3>\n" ) - .arg( "Amarok" ).arg( Amarok::xmlVersion() ).arg( dynamic ); + .tqarg( "Amarok" ).tqarg( Amarok::xmlVersion() ).tqarg( dynamic ); for( MyIt it( this, MyIt::All ); *it; ++it ) { @@ -3526,10 +3526,10 @@ Playlist::copyToClipboard( const TQListViewItem *item ) const //SLOT text.append( " :: " + playlistItem->url().url() ); // Copy both to clipboard and X11-selection - TQApplication::clipboard()->setText( text, TQClipboard::Clipboard ); - TQApplication::clipboard()->setText( text, TQClipboard::Selection ); + TQApplication::tqclipboard()->setText( text, TQClipboard::Clipboard ); + TQApplication::tqclipboard()->setText( text, TQClipboard::Selection ); - Amarok::OSD::instance()->OSDWidget::show( i18n( "Copied: %1" ).arg( text ), + Amarok::OSD::instance()->OSDWidget::show( i18n( "Copied: %1" ).tqarg( text ), TQImage(CollectionDB::instance()->albumImage(*playlistItem )) ); } } @@ -3594,7 +3594,7 @@ Playlist::changeFromQueueManager(TQPtrList<PlaylistItem> list) m_nextTracks = list; PLItemList in, out; - // make sure we repaint items no longer queued + // make sure we tqrepaint items no longer queued for( PlaylistItem* item = oldQueue.first(); item; item = oldQueue.next() ) if( !m_nextTracks.containsRef( item ) ) out << item; @@ -3604,7 +3604,7 @@ Playlist::changeFromQueueManager(TQPtrList<PlaylistItem> list) emit queueChanged( in, out ); - // repaint newly queued or altered queue items + // tqrepaint newly queued or altered queue items if( dynamicMode() ) sortQueuedItems(); else @@ -3777,7 +3777,7 @@ Playlist::showContextMenu( TQListViewItem *item, const TQPoint &p, int col ) //S Amarok::actionCollection()->action("playlist_shuffle")->plug( &popup ); m = PlaylistBrowser::instance()->findDynamicModeByTitle( AmarokConfig::lastDynamicMode() ); if( m ) - popup.insertItem( SmallIconSet( Amarok::icon( "dynamic" ) ), i18n("L&oad %1").arg( m->title().replace( '&', "&&" ) ), ENABLEDYNAMIC); + popup.insertItem( SmallIconSet( Amarok::icon( "dynamic" ) ), i18n("L&oad %1").tqarg( m->title().replace( '&', "&&" ) ), ENABLEDYNAMIC); } switch(popup.exec(p)) { @@ -3915,11 +3915,11 @@ Playlist::showContextMenu( TQListViewItem *item, const TQPoint &p, int col ) //S popup.insertItem( trackColumn ? i18n("Iteratively Assign Track &Numbers") : i18n("&Write '%1' for Selected Tracks") - .arg( KStringHandler::rsqueeze( tag, 30 ).replace( "&", "&&" ) ), FILL_DOWN ); + .tqarg( KStringHandler::rsqueeze( tag, 30 ).replace( "&", "&&" ) ), FILL_DOWN ); popup.insertItem( SmallIconSet( Amarok::icon( "edit" ) ), (itemCount == 1 ? i18n( "&Edit Tag '%1'" ) - : i18n( "&Edit '%1' Tag for Selected Tracks" )).arg( tagName ), EDIT ); + : i18n( "&Edit '%1' Tag for Selected Tracks" )).tqarg( tagName ), EDIT ); popup.insertItem( SmallIconSet( Amarok::icon( "info" ) ) , item->url().isLocalFile() ? @@ -4579,7 +4579,7 @@ Playlist::slotMouseButtonPressed( int button, TQListViewItem *after, const TQPoi { case Qt::MidButton: { - const TQString path = TQApplication::clipboard()->text( TQClipboard::Selection ); + const TQString path = TQApplication::tqclipboard()->text( TQClipboard::Selection ); const KURL url = KURL::fromPathOrURL( path ); if( url.isValid() ) @@ -4646,7 +4646,7 @@ Playlist::slotMoodbarPrefs( bool show, bool moodier, int alter, bool withMusic ) { // No need to call moodbar().load(), since that will happen // automatically next time it's displayed. We do have to - // repaint so that they get displayed though. + // tqrepaint so that they get displayed though. for( PlaylistIterator it( this, PlaylistIterator::All ) ; *it ; ++it ) { @@ -4700,7 +4700,7 @@ Playlist::slotEraseMarker() //SLOT { const TQRect spot = drawDropVisualizer( 0, 0, m_marker ); m_marker = 0; - viewport()->repaint( spot, false ); + viewport()->tqrepaint( spot, false ); } } @@ -4734,7 +4734,7 @@ Playlist::showTagDialog( TQPtrList<TQListViewItem> items ) TagDialog *dialog = new TagDialog( *item, item, instance() ); dialog->show(); } - else if ( checkFileStatus( item ) ) + else if ( checkFiletqStatus( item ) ) { TagDialog *dialog = new TagDialog( *item, item, instance() ); dialog->show(); @@ -4761,7 +4761,7 @@ Playlist::showTagDialog( TQPtrList<TQListViewItem> items ) #include <kpushbutton.h> #include <tqgroupbox.h> #include <tqlabel.h> -#include <layout.h> +#include <tqlayout.h> #include <tqprocess.h> #include <unistd.h> //usleep() @@ -4790,7 +4790,7 @@ Playlist::showTagDialog( TQPtrList<TQListViewItem> items ) lineEdit2 = new TQLineEdit( this, "Command" ); groupBox1 = new TQGroupBox( 1, Qt::Vertical, i18n( "Examples" ), this ); - groupBox1->layout()->setMargin( 11 ); + groupBox1->tqlayout()->setMargin( 11 ); new KActiveLabel( i18n( "file --brief %f\n" "ls -sh %f\n" "basename %f\n" "dirname %f" ), groupBox1 ); // buddies @@ -4798,22 +4798,22 @@ Playlist::showTagDialog( TQPtrList<TQListViewItem> items ) textLabel3->setBuddy( lineEdit2 ); // layouts - TQHBoxLayout *layout1 = new TQHBoxLayout( 0, 0, 6 ); - layout1->addItem( new TQSpacerItem( 181, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum ) ); - layout1->addWidget( new KPushButton( KStdGuiItem::ok(), this, "OkButton" ) ); - layout1->addWidget( new KPushButton( KStdGuiItem::cancel(), this, "CancelButton" ) ); + TQHBoxLayout *tqlayout1 = new TQHBoxLayout( 0, 0, 6 ); + tqlayout1->addItem( new TQSpacerItem( 181, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum ) ); + tqlayout1->addWidget( new KPushButton( KStdGuiItem::ok(), this, "OkButton" ) ); + tqlayout1->addWidget( new KPushButton( KStdGuiItem::cancel(), this, "CancelButton" ) ); - TQGridLayout *layout2 = new TQGridLayout( 0, 2, 2, 0, 6 ); - layout2->TQLayout::add( textLabel2 ); - layout2->TQLayout::add( lineEdit1 ); - layout2->TQLayout::add( textLabel3 ); - layout2->TQLayout::add( lineEdit2 ); + TQGridLayout *tqlayout2 = new TQGridLayout( 0, 2, 2, 0, 6 ); + tqlayout2->TQLayout::add( textLabel2 ); + tqlayout2->TQLayout::add( lineEdit1 ); + tqlayout2->TQLayout::add( textLabel3 ); + tqlayout2->TQLayout::add( lineEdit2 ); TQVBoxLayout *Form1Layout = new TQVBoxLayout( this, 11, 6, "Form1Layout"); Form1Layout->addWidget( textLabel1 ); Form1Layout->addWidget( groupBox1 ); - Form1Layout->addLayout( layout2 ); - Form1Layout->addLayout( layout1 ); + Form1Layout->addLayout( tqlayout2 ); + Form1Layout->addLayout( tqlayout1 ); Form1Layout->addItem( new TQSpacerItem( 20, 231, TQSizePolicy::Minimum, TQSizePolicy::Expanding ) ); // properties @@ -4960,7 +4960,7 @@ TagWriter::completeJob() // we write a space for some reason I cannot recall m_item->setExactText( m_tagType, m_oldTagString.isEmpty() ? " " : m_oldTagString ); Amarok::StatusBar::instance()->longMessage( i18n( - "Sorry, the tag for %1 could not be changed." ).arg( m_item->url().fileName() ), KDE::StatusBar::Sorry ); + "Sorry, the tag for %1 could not be changed." ).tqarg( m_item->url().fileName() ), KDE::StatusBar::Sorry ); break; case false: |