summaryrefslogtreecommitdiffstats
path: root/amarok/src/playlist.cpp
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2013-02-01 14:58:16 -0600
committerTimothy Pearson <kb9vqf@pearsoncomputing.net>2013-02-01 14:58:16 -0600
commit4522f2c3c08f17da3842744a2724a71824400484 (patch)
treeb27bcc72e17829d109cd7996d1243f7f6fab6500 /amarok/src/playlist.cpp
parent9f77b51ba89af86aead2b6faa1eb6dadbe47e771 (diff)
downloadamarok-4522f2c3c08f17da3842744a2724a71824400484.tar.gz
amarok-4522f2c3c08f17da3842744a2724a71824400484.zip
Rename a number of classes to enhance compatibility with KDE4
Diffstat (limited to 'amarok/src/playlist.cpp')
-rw-r--r--amarok/src/playlist.cpp80
1 files changed, 40 insertions, 40 deletions
diff --git a/amarok/src/playlist.cpp b/amarok/src/playlist.cpp
index 0c01c1de..633d2606 100644
--- a/amarok/src/playlist.cpp
+++ b/amarok/src/playlist.cpp
@@ -164,7 +164,7 @@ TQMutex* Playlist::s_dynamicADTMutex = new TQMutex();
Playlist *Playlist::s_instance = 0;
Playlist::Playlist( TQWidget *parent )
- : KListView( parent, "ThePlaylist" )
+ : TDEListView( parent, "ThePlaylist" )
, EngineObserver( EngineController::instance() )
, m_startupTime_t( TQDateTime::currentDateTime().toTime_t() )
, m_oldestTime_t( CollectionDB::instance()->query( "SELECT MIN( createdate ) FROM statistics;" ).first().toInt() )
@@ -319,26 +319,26 @@ Playlist::Playlist( TQWidget *parent )
connect( &Glow::timer, TQT_SIGNAL(timeout()), TQT_SLOT(slotGlowTimer()) );
- KActionCollection* const ac = Amarok::actionCollection();
- KAction *copy = KStdAction::copy( TQT_TQOBJECT(this), TQT_SLOT( copyToClipboard() ), ac, "playlist_copy" );
+ TDEActionCollection* const ac = Amarok::actionCollection();
+ TDEAction *copy = KStdAction::copy( TQT_TQOBJECT(this), TQT_SLOT( copyToClipboard() ), ac, "playlist_copy" );
KStdAction::selectAll( TQT_TQOBJECT(this), TQT_SLOT( selectAll() ), ac, "playlist_select_all" );
- m_clearButton = new KAction( i18n( "clear playlist", "&Clear" ), Amarok::icon( "playlist_clear" ), 0, TQT_TQOBJECT(this), TQT_SLOT( clear() ), ac, "playlist_clear" );
+ m_clearButton = new TDEAction( i18n( "clear playlist", "&Clear" ), Amarok::icon( "playlist_clear" ), 0, TQT_TQOBJECT(this), TQT_SLOT( clear() ), ac, "playlist_clear" );
m_undoButton = KStdAction::undo( TQT_TQOBJECT(this), TQT_SLOT( undo() ), ac, "playlist_undo" );
m_redoButton = KStdAction::redo( TQT_TQOBJECT(this), TQT_SLOT( redo() ), ac, "playlist_redo" );
m_undoButton ->setIcon( Amarok::icon( "undo" ) );
m_redoButton ->setIcon( Amarok::icon( "redo" ) );
- new KAction( i18n( "&Repopulate" ), Amarok::icon( "playlist_refresh" ), 0, TQT_TQOBJECT(this), TQT_SLOT( repopulate() ), ac, "repopulate" );
- new KAction( i18n( "S&huffle" ), "rebuild", CTRL+Key_H, TQT_TQOBJECT(this), TQT_SLOT( shuffle() ), ac, "playlist_shuffle" );
- KAction *gotoCurrent = new KAction( i18n( "&Go To Current Track" ), Amarok::icon( "music" ), CTRL+Key_J, TQT_TQOBJECT(this), TQT_SLOT( showCurrentTrack() ), ac, "playlist_show" );
- new KAction( i18n( "&Remove Duplicate && Dead Entries" ), 0, TQT_TQOBJECT(this), TQT_SLOT( removeDuplicates() ), ac, "playlist_remove_duplicates" );
- new KAction( i18n( "&Queue Selected Tracks" ), Amarok::icon( "queue_track" ), CTRL+Key_D, TQT_TQOBJECT(this), TQT_SLOT( queueSelected() ), ac, "queue_selected" );
- KToggleAction *stopafter = new KToggleAction( i18n( "&Stop Playing After Track" ), Amarok::icon( "stop" ), CTRL+ALT+Key_V,
+ new TDEAction( i18n( "&Repopulate" ), Amarok::icon( "playlist_refresh" ), 0, TQT_TQOBJECT(this), TQT_SLOT( repopulate() ), ac, "repopulate" );
+ new TDEAction( i18n( "S&huffle" ), "rebuild", CTRL+Key_H, TQT_TQOBJECT(this), TQT_SLOT( shuffle() ), ac, "playlist_shuffle" );
+ TDEAction *gotoCurrent = new TDEAction( i18n( "&Go To Current Track" ), Amarok::icon( "music" ), CTRL+Key_J, TQT_TQOBJECT(this), TQT_SLOT( showCurrentTrack() ), ac, "playlist_show" );
+ new TDEAction( i18n( "&Remove Duplicate && Dead Entries" ), 0, TQT_TQOBJECT(this), TQT_SLOT( removeDuplicates() ), ac, "playlist_remove_duplicates" );
+ new TDEAction( i18n( "&Queue Selected Tracks" ), Amarok::icon( "queue_track" ), CTRL+Key_D, TQT_TQOBJECT(this), TQT_SLOT( queueSelected() ), ac, "queue_selected" );
+ TDEToggleAction *stopafter = new TDEToggleAction( i18n( "&Stop Playing After Track" ), Amarok::icon( "stop" ), CTRL+ALT+Key_V,
TQT_TQOBJECT(this), TQT_SLOT( toggleStopAfterCurrentItem() ), ac, "stop_after" );
- { // KAction idiocy -- shortcuts don't work until they've been plugged into a menu
- KPopupMenu asdf;
+ { // TDEAction idiocy -- shortcuts don't work until they've been plugged into a menu
+ TDEPopupMenu asdf;
copy->plug( &asdf );
stopafter->plug( &asdf );
@@ -372,7 +372,7 @@ Playlist::Playlist( TQWidget *parent )
restoreLayout( TDEGlobal::config(), "PlaylistColumnsLayout" );
// Sorting must be disabled when current.xml is being loaded. See BUG 113042
- KListView::setSorting( NO_SORT ); //use base so we don't saveUndoState() too
+ TDEListView::setSorting( NO_SORT ); //use base so we don't saveUndoState() too
setDynamicMode( 0 );
@@ -2100,7 +2100,7 @@ Playlist::engineStateChanged( Engine::State state, Engine::State /*oldState*/ )
////////////////////////////////////////////////////////////////////////////////
-/// KListView Reimplementation
+/// TDEListView Reimplementation
////////////////////////////////////////////////////////////////////////////////
void
@@ -2165,7 +2165,7 @@ Playlist::clear() //SLOT
void
Playlist::safeClear()
{
- /* 3.3.5 and 3.3.6 have bad KListView::clear() functions.
+ /* 3.3.5 and 3.3.6 have bad TDEListView::clear() functions.
3.3.5 forgets to clear the pointer to the highlighted item.
3.3.6 forgets to clear the pointer to the last dragged item */
if ( strcmp( tqVersion(), "3.3.5" ) == 0
@@ -2187,7 +2187,7 @@ Playlist::safeClear()
triggerUpdate();
}
else
- KListView::clear();
+ TDEListView::clear();
}
void
@@ -2200,14 +2200,14 @@ Playlist::setSorting( int col, bool b )
//to figure out...at least right now
if( !dynamicMode() )
- KListView::setSorting( col, b );
+ TDEListView::setSorting( col, b );
}
void
Playlist::setColumnWidth( int col, int width )
{
- KListView::setColumnWidth( col, width );
+ TDEListView::setColumnWidth( col, width );
//FIXME this is because TQt doesn't by default disable resizing width 0 columns. GRRR!
//NOTE default column sizes are stored in default amarokrc so that restoreLayout() in ctor will
@@ -2256,7 +2256,7 @@ Playlist::rename( TQListViewItem *item, int column ) //SLOT
item->setSelected( true );
}
setCurrentItem( item );
- KListView::rename( item, column );
+ TDEListView::rename( item, column );
m_renameItem = item;
m_renameColumn = column;
@@ -2369,7 +2369,7 @@ Playlist::paletteChange( const TQPalette &p )
b = fg.blue();
}
- KListView::paletteChange( p );
+ TDEListView::paletteChange( p );
counter = 0; // reset the counter or apparently the text lacks contrast
slotGlowTimer(); // repaint currentTrack marker
@@ -2526,7 +2526,7 @@ Playlist::dragObject()
void
Playlist::viewportPaintEvent( TQPaintEvent *e )
{
- if( e ) KListView::viewportPaintEvent( e ); //we call with 0 in contentsDropEvent()
+ if( e ) TDEListView::viewportPaintEvent( e ); //we call with 0 in contentsDropEvent()
if ( m_marker ) {
TQPainter p( viewport() );
@@ -2582,7 +2582,7 @@ void
Playlist::viewportResizeEvent( TQResizeEvent *e )
{
if ( !m_smartResizing ) {
- KListView::viewportResizeEvent( e );
+ TDEListView::viewportResizeEvent( e );
return;
}
//only be clever with the sizing if there is not many items
@@ -2735,11 +2735,11 @@ Playlist::eventFilter( TQObject *o, TQEvent *e )
const int mouseOverColumn = header()->sectionAt( me->pos().x() );
- KPopupMenu popup;
+ TDEPopupMenu popup;
if( mouseOverColumn >= 0 )
popup.insertItem( i18n("&Hide %1").arg( columnText( mouseOverColumn ) ), HIDE ); //TODO
- KPopupMenu sub;
+ TDEPopupMenu sub;
for( int i = 0; i < columns(); ++i ) //columns() references a property
if( !columnWidth( i ) )
sub.insertItem( columnText( i ), i, i + 1 );
@@ -2967,7 +2967,7 @@ Playlist::eventFilter( TQObject *o, TQEvent *e )
}
//allow the header to process this
- return KListView::eventFilter( o, e );
+ return TDEListView::eventFilter( o, e );
#undef me
#undef ke
@@ -3295,8 +3295,8 @@ Playlist::disableDynamicMode() //SLOT
setDynamicMode( 0 );
AmarokConfig::setRandomMode( m_oldRandom );
AmarokConfig::setRepeat( m_oldRepeat );
- static_cast<KSelectAction*>(Amarok::actionCollection()->action( "random_mode" ))->setCurrentItem( m_oldRandom );
- static_cast<KSelectAction*>(Amarok::actionCollection()->action( "repeat" ))->setCurrentItem( m_oldRepeat );
+ static_cast<TDESelectAction*>(Amarok::actionCollection()->action( "random_mode" ))->setCurrentItem( m_oldRandom );
+ static_cast<TDESelectAction*>(Amarok::actionCollection()->action( "repeat" ))->setCurrentItem( m_oldRepeat );
}
void
@@ -3566,7 +3566,7 @@ Playlist::adjustColumn( int n )
else if( n == PlaylistItem::Mood )
setColumnWidth( n, 120 );
else
- KListView::adjustColumn( n );
+ TDEListView::adjustColumn( n );
}
void
@@ -3766,7 +3766,7 @@ Playlist::showContextMenu( TQListViewItem *item, const TQPoint &p, int col ) //S
enum { REPOPULATE, ENABLEDYNAMIC };
if( item == 0 )
{
- KPopupMenu popup;
+ TDEPopupMenu popup;
Amarok::actionCollection()->action("playlist_save")->plug( &popup );
Amarok::actionCollection()->action("playlist_clear")->plug( &popup );
DynamicMode *m = 0;
@@ -3816,7 +3816,7 @@ Playlist::showContextMenu( TQListViewItem *item, const TQPoint &p, int col ) //S
if( isCurrent && isLastFm )
{
- KActionCollection *ac = Amarok::actionCollection();
+ TDEActionCollection *ac = Amarok::actionCollection();
if( ac->action( "skip" ) ) ac->action( "skip" )->plug( &popup );
if( ac->action( "love" ) ) ac->action( "love" )->plug( &popup );
if( ac->action( "ban" ) ) ac->action( "ban" )->plug( &popup );
@@ -3874,7 +3874,7 @@ Playlist::showContextMenu( TQListViewItem *item, const TQPoint &p, int col ) //S
if( itemCount == 1 )
{
Amarok::actionCollection()->action( "stop_after" )->plug( &popup );
- dynamic_cast<KToggleAction *>( Amarok::actionCollection()->action( "stop_after" ) )->setChecked( m_stopAfterTrack == item );
+ dynamic_cast<TDEToggleAction *>( Amarok::actionCollection()->action( "stop_after" ) )->setChecked( m_stopAfterTrack == item );
}
if( isCurrent && itemCount == 1 )
@@ -3895,7 +3895,7 @@ Playlist::showContextMenu( TQListViewItem *item, const TQPoint &p, int col ) //S
popup.insertSeparator();
- KPopupMenu fileMenu;
+ TDEPopupMenu fileMenu;
if( CollectionDB::instance()->isDirInCollection( item->url().directory() ) )
{
fileMenu.insertItem( SmallIconSet( "filesaveas" ), i18n("&Organize File...", "&Organize %n Files...", itemCount), ORGANIZE );
@@ -3941,12 +3941,12 @@ Playlist::showContextMenu( TQListViewItem *item, const TQPoint &p, int col ) //S
TQValueList<TQString> submenuTexts = m_customSubmenuItem.keys();
for( TQValueList<TQString>::Iterator keyIt =submenuTexts.begin(); keyIt != submenuTexts.end(); ++keyIt )
{
- KPopupMenu* menu;
+ TDEPopupMenu* menu;
if( (*keyIt) == "root")
menu = &popup;
else
{
- menu = new KPopupMenu();
+ menu = new TDEPopupMenu();
popup.insertItem( *keyIt, menu);
}
foreach(m_customSubmenuItem[*keyIt])
@@ -4096,7 +4096,7 @@ Playlist::showContextMenu( TQListViewItem *item, const TQPoint &p, int col ) //S
case REPEAT:
// FIXME HACK Accessing AmarokConfig::Enum* yields compile errors with GCC 3.3.
- static_cast<KSelectAction*>( Amarok::actionCollection()->action( "repeat" ) )
+ static_cast<TDESelectAction*>( Amarok::actionCollection()->action( "repeat" ) )
->setCurrentItem( Amarok::repeatTrack()
? 0 /*AmarokConfig::EnumRepeat::Off*/
: 1 /*AmarokConfig::EnumRepeat::Track*/ );
@@ -4141,7 +4141,7 @@ Playlist::showContextMenu( TQListViewItem *item, const TQPoint &p, int col ) //S
void
Playlist::fontChange( const TQFont &old )
{
- KListView::fontChange( old );
+ TDEListView::fontChange( old );
initStarPixmaps();
triggerUpdate();
}
@@ -4150,7 +4150,7 @@ void
Playlist::contentsMouseMoveEvent( TQMouseEvent *e )
{
if( e )
- KListView::contentsMouseMoveEvent( e );
+ TDEListView::contentsMouseMoveEvent( e );
PlaylistItem *prev = m_hoveredRating;
const TQPoint pos = e ? e->pos() : viewportToContents( viewport()->mapFromGlobal( TQCursor::pos() ) );
@@ -4176,7 +4176,7 @@ Playlist::contentsMouseMoveEvent( TQMouseEvent *e )
void Playlist::leaveEvent( TQEvent *e )
{
- KListView::leaveEvent( e );
+ TDEListView::leaveEvent( e );
PlaylistItem *prev = m_hoveredRating;
m_hoveredRating = 0;
@@ -4205,7 +4205,7 @@ void Playlist::contentsMousePressEvent( TQMouseEvent *e )
CollectionDB::instance()->setSongRating( item->url().path(), rating, true );
}
else
- KListView::contentsMousePressEvent( e );
+ TDEListView::contentsMousePressEvent( e );
}
void Playlist::contentsWheelEvent( TQWheelEvent *e )
@@ -4238,7 +4238,7 @@ void Playlist::contentsWheelEvent( TQWheelEvent *e )
changed.at(i)->update();
}
else
- KListView::contentsWheelEvent( e );
+ TDEListView::contentsWheelEvent( e );
}
////////////////////////////////////////////////////////////////////////////////