summaryrefslogtreecommitdiffstats
path: root/amarok/src/mediabrowser.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'amarok/src/mediabrowser.cpp')
-rw-r--r--amarok/src/mediabrowser.cpp206
1 files changed, 103 insertions, 103 deletions
diff --git a/amarok/src/mediabrowser.cpp b/amarok/src/mediabrowser.cpp
index ced592d1..967ace1f 100644
--- a/amarok/src/mediabrowser.cpp
+++ b/amarok/src/mediabrowser.cpp
@@ -112,8 +112,8 @@ bool MediaBrowser::isAvailable() //static
class SpaceLabel : public TQLabel {
public:
- SpaceLabel(TQWidget *tqparent)
- : TQLabel(tqparent)
+ SpaceLabel(TQWidget *parent)
+ : TQLabel(parent)
{
m_total = m_used = m_scheduled = 0;
setBackgroundMode(TQt::NoBackground);
@@ -789,26 +789,26 @@ MediaBrowser::~MediaBrowser()
}
-MediaItem::MediaItem( TQListView* tqparent )
-: KListViewItem( tqparent )
+MediaItem::MediaItem( TQListView* parent )
+: KListViewItem( parent )
{
init();
}
-MediaItem::MediaItem( TQListViewItem* tqparent )
-: KListViewItem( tqparent )
+MediaItem::MediaItem( TQListViewItem* parent )
+: KListViewItem( parent )
{
init();
}
-MediaItem::MediaItem( TQListView* tqparent, TQListViewItem* after )
-: KListViewItem( tqparent, after )
+MediaItem::MediaItem( TQListView* parent, TQListViewItem* after )
+: KListViewItem( parent, after )
{
init();
}
-MediaItem::MediaItem( TQListViewItem* tqparent, TQListViewItem* after )
-: KListViewItem( tqparent, after )
+MediaItem::MediaItem( TQListViewItem* parent, TQListViewItem* after )
+: KListViewItem( parent, after )
{
init();
}
@@ -1171,9 +1171,9 @@ class MediaItemTip : public TQToolTip
};
-MediaView::MediaView( TQWidget* tqparent, MediaDevice *device )
- : KListView( tqparent )
- , m_tqparent( tqparent )
+MediaView::MediaView( TQWidget* parent, MediaDevice *device )
+ : KListView( parent )
+ , m_parent( parent )
, m_device( device )
{
hide();
@@ -1317,17 +1317,17 @@ MediaView::nodeBuildDragList( MediaItem* item, int flags )
}
int
-MediaView::getSelectedLeaves( MediaItem *tqparent, TQPtrList<MediaItem> *list, int flags )
+MediaView::getSelectedLeaves( MediaItem *parent, TQPtrList<MediaItem> *list, int flags )
{
int numFiles = 0;
if( !list )
list = new TQPtrList<MediaItem>;
MediaItem *it;
- if( !tqparent )
+ if( !parent )
it = dynamic_cast<MediaItem *>(firstChild());
else
- it = dynamic_cast<MediaItem *>(tqparent->firstChild());
+ it = dynamic_cast<MediaItem *>(parent->firstChild());
for( ; it; it = dynamic_cast<MediaItem*>(it->nextSibling()))
{
@@ -1419,9 +1419,9 @@ MediaView::contentsDropEvent( TQDropEvent *e )
}
else if( item->type() == MediaItem::PLAYLISTITEM )
{
- MediaItem *list = dynamic_cast<MediaItem *>(item->tqparent());
+ MediaItem *list = dynamic_cast<MediaItem *>(item->parent());
MediaItem *after = 0;
- for(MediaItem *it = dynamic_cast<MediaItem*>(item->tqparent()->firstChild());
+ for(MediaItem *it = dynamic_cast<MediaItem*>(item->parent()->firstChild());
it;
it = dynamic_cast<MediaItem *>(it->nextSibling()))
{
@@ -1513,14 +1513,14 @@ MediaView::rmbPressed( TQListViewItem *item, const TQPoint &p, int i )
}
MediaItem *
-MediaView::newDirectory( MediaItem *tqparent )
+MediaView::newDirectory( MediaItem *parent )
{
bool ok;
const TQString name = KInputDialog::getText(i18n("Add Directory"), i18n("Directory Name:"), TQString(), &ok, this);
if( ok && !name.isEmpty() )
{
- m_device->newDirectory( name, tqparent );
+ m_device->newDirectory( name, parent );
}
return 0;
@@ -1864,7 +1864,7 @@ MediaBrowser::updateStats()
bool
-MediaView::setFilter( const TQString &filter, MediaItem *tqparent )
+MediaView::setFilter( const TQString &filter, MediaItem *parent )
{
bool advanced = ExpressionParser::isAdvancedExpression( filter );
TQValueList<int> defaultColumns;
@@ -1874,14 +1874,14 @@ MediaView::setFilter( const TQString &filter, MediaItem *tqparent )
bool root = false;
MediaItem *it;
- if( !tqparent )
+ if( !parent )
{
root = true;
it = dynamic_cast<MediaItem *>(firstChild());
}
else
{
- it = dynamic_cast<MediaItem *>(tqparent->firstChild());
+ it = dynamic_cast<MediaItem *>(parent->firstChild());
}
bool tqchildrenVisible = false;
@@ -1947,7 +1947,7 @@ MediaDevice::MediaDevice()
, m_transcodeAlways( false )
, m_transcodeRemove( false )
, sysProc ( 0 )
- , m_tqparent( 0 )
+ , m_parent( 0 )
, m_view( 0 )
, m_wait( false )
, m_requireMount( false )
@@ -1968,11 +1968,11 @@ MediaDevice::MediaDevice()
sysProc = new KShellProcess(); Q_CHECK_PTR(sysProc);
}
-void MediaDevice::init( MediaBrowser* tqparent )
+void MediaDevice::init( MediaBrowser* parent )
{
- m_tqparent = tqparent;
+ m_parent = parent;
if( !m_view )
- m_view = new MediaView( m_tqparent->m_views, this );
+ m_view = new MediaView( m_parent->m_views, this );
m_view->hide();
}
@@ -2057,7 +2057,7 @@ MediaDevice::view()
void
MediaDevice::hideProgress()
{
- m_tqparent->m_progressBox->hide();
+ m_parent->m_progressBox->hide();
}
void
@@ -2083,7 +2083,7 @@ MediaQueue::syncPlaylist( const TQString &name, const TQString &query, bool load
item->m_playlistName = name;
item->setText( 0, name );
item->m_flags |= MediaItem::SmartPlaylist;
- m_tqparent->m_progress->setTotalSteps( m_tqparent->m_progress->totalSteps() + 1 );
+ m_parent->m_progress->setTotalSteps( m_parent->m_progress->totalSteps() + 1 );
itemCountChanged();
if( !loading )
URLsAdded();
@@ -2098,7 +2098,7 @@ MediaQueue::syncPlaylist( const TQString &name, const KURL &url, bool loading )
item->setData( url.url() );
item->m_playlistName = name;
item->setText( 0, name );
- m_tqparent->m_progress->setTotalSteps( m_tqparent->m_progress->totalSteps() + 1 );
+ m_parent->m_progress->setTotalSteps( m_parent->m_progress->totalSteps() + 1 );
itemCountChanged();
if( !loading )
URLsAdded();
@@ -2323,8 +2323,8 @@ MediaQueue::addURL( const KURL& url2, MetaBundle *bundle, const TQString &playli
}
item->setText( 0, text);
- m_tqparent->updateButtons();
- m_tqparent->m_progress->setTotalSteps( m_tqparent->m_progress->totalSteps() + 1 );
+ m_parent->updateButtons();
+ m_parent->m_progress->setTotalSteps( m_parent->m_progress->totalSteps() + 1 );
addItemToSize( item );
itemCountChanged();
}
@@ -2354,8 +2354,8 @@ MediaQueue::addURL( const KURL &url, MediaItem *item )
}
newitem->setText( 0, text);
newitem->setBundle( bundle );
- m_tqparent->updateButtons();
- m_tqparent->m_progress->setTotalSteps( m_tqparent->m_progress->totalSteps() + 1 );
+ m_parent->updateButtons();
+ m_parent->m_progress->setTotalSteps( m_parent->m_progress->totalSteps() + 1 );
addItemToSize( item );
itemCountChanged();
@@ -2374,13 +2374,13 @@ MediaQueue::addURLs( const KURL::List urls, const TQString &playlistName )
void
MediaQueue::URLsAdded()
{
- m_tqparent->updateStats();
- m_tqparent->updateButtons();
- if( m_tqparent->currentDevice()
- && m_tqparent->currentDevice()->isConnected()
- && m_tqparent->currentDevice()->asynchronousTransfer()
- && !m_tqparent->currentDevice()->isTransferring() )
- m_tqparent->currentDevice()->transferFiles();
+ m_parent->updateStats();
+ m_parent->updateButtons();
+ if( m_parent->currentDevice()
+ && m_parent->currentDevice()->isConnected()
+ && m_parent->currentDevice()->asynchronousTransfer()
+ && !m_parent->currentDevice()->isTransferring() )
+ m_parent->currentDevice()->transferFiles();
save( Amarok::saveLocation() + "transferlist.xml" );
}
@@ -2662,8 +2662,8 @@ MediaDevice::connectDevice( bool silent )
{
MediaBrowser::instance()->activateDevice( this );
}
- m_tqparent->updateStats();
- m_tqparent->updateButtons();
+ m_parent->updateStats();
+ m_parent->updateButtons();
if( !isConnected() )
{
@@ -2686,7 +2686,7 @@ MediaDevice::connectDevice( bool silent )
if(numFiles > 0)
{
- m_tqparent->m_stats->setText( i18n( "1 track to be deleted", "%n tracks to be deleted", numFiles ) );
+ m_parent->m_stats->setText( i18n( "1 track to be deleted", "%n tracks to be deleted", numFiles ) );
setProgress( 0, numFiles );
@@ -2708,9 +2708,9 @@ MediaDevice::connectDevice( bool silent )
synchronizeDevice();
- TQTimer::singleShot( 1500, m_tqparent->m_progressBox, TQT_SLOT(hide()) );
- m_tqparent->queue()->computeSize();
- m_tqparent->updateStats();
+ TQTimer::singleShot( 1500, m_parent->m_progressBox, TQT_SLOT(hide()) );
+ m_parent->queue()->computeSize();
+ m_parent->updateStats();
}
}
unlockDevice();
@@ -2725,7 +2725,7 @@ MediaDevice::connectDevice( bool silent )
Amarok::StatusBar::instance()->shortMessage( i18n( "Device successfully connected" ) );
- m_tqparent->updateDevices();
+ m_parent->updateDevices();
return true;
}
@@ -2756,7 +2756,7 @@ MediaDevice::disconnectDevice( bool postDisconnectHook )
closeDevice();
unlockDevice();
- m_tqparent->updateStats();
+ m_parent->updateStats();
bool result = true;
if( postDisconnectHook && runPostDisconnectCommand() != 0 )
@@ -2769,7 +2769,7 @@ MediaDevice::disconnectDevice( bool postDisconnectHook )
else
Amarok::StatusBar::instance()->shortMessage( i18n( "Device successfully disconnected" ) );
- m_tqparent->updateDevices();
+ m_parent->updateDevices();
return result;
}
@@ -2790,7 +2790,7 @@ MediaDevice::syncStatsFromDevice( MediaItem *root )
switch( it->type() )
{
case MediaItem::TRACK:
- if( !it->tqparent() || static_cast<MediaItem *>( it->tqparent() )->type() != MediaItem::PLAYLIST )
+ if( !it->parent() || static_cast<MediaItem *>( it->parent() )->type() != MediaItem::PLAYLIST )
{
const MetaBundle *bundle = it->bundle();
for( int i=0; i<it->recentlyPlayed(); i++ )
@@ -2830,7 +2830,7 @@ MediaDevice::syncStatsFromDevice( MediaItem *root )
}
break;
case MediaItem::PODCASTITEM:
- if( !it->tqparent() || static_cast<MediaItem *>( it->tqparent() )->type() != MediaItem::PLAYLIST )
+ if( !it->parent() || static_cast<MediaItem *>( it->parent() )->type() != MediaItem::PLAYLIST )
{
const MetaBundle *bundle = it->bundle();
if( it->played() || it->recentlyPlayed() )
@@ -2840,11 +2840,11 @@ MediaDevice::syncStatsFromDevice( MediaItem *root )
debug() << "marking podcast episode as played: " << peb->url() << endl;
if( PlaylistBrowser::instance() )
{
- PodcastEpisode *p = PlaylistBrowser::instance()->findPodcastEpisode( peb->url(), peb->tqparent() );
+ PodcastEpisode *p = PlaylistBrowser::instance()->findPodcastEpisode( peb->url(), peb->parent() );
if ( p )
p->setListened();
else
- debug() << "did not find podcast episode: " << peb->url() << " from " << peb->tqparent() << endl;
+ debug() << "did not find podcast episode: " << peb->url() << " from " << peb->parent() << endl;
}
}
}
@@ -2892,7 +2892,7 @@ MediaDevice::syncStatsToDevice( MediaItem *root )
switch( it->type() )
{
case MediaItem::TRACK:
- if( !it->tqparent() || static_cast<MediaItem *>( it->tqparent() )->type() != MediaItem::PLAYLIST )
+ if( !it->parent() || static_cast<MediaItem *>( it->parent() )->type() != MediaItem::PLAYLIST )
{
const MetaBundle *bundle = it->bundle();
TQString url = CollectionDB::instance()->getURL( *bundle );
@@ -2901,14 +2901,14 @@ MediaDevice::syncStatsToDevice( MediaItem *root )
break;
case MediaItem::PODCASTITEM:
- if( !it->tqparent() || static_cast<MediaItem *>( it->tqparent() )->type() != MediaItem::PLAYLIST )
+ if( !it->parent() || static_cast<MediaItem *>( it->parent() )->type() != MediaItem::PLAYLIST )
{
const MetaBundle *bundle = it->bundle();
if( PodcastEpisodeBundle *peb = bundle->podcastBundle() )
{
if( PlaylistBrowser::instance() )
{
- PodcastEpisode *p = PlaylistBrowser::instance()->findPodcastEpisode( peb->url(), peb->tqparent() );
+ PodcastEpisode *p = PlaylistBrowser::instance()->findPodcastEpisode( peb->url(), peb->parent() );
if( p )
it->setListened( !p->isNew() );
}
@@ -2934,16 +2934,16 @@ MediaDevice::transferFiles()
setCanceled( false );
m_transferring = true;
- m_tqparent->m_toolbar->getButton(MediaBrowser::TRANSFER)->setEnabled( false );
+ m_parent->m_toolbar->getButton(MediaBrowser::TRANSFER)->setEnabled( false );
- setProgress( 0, m_tqparent->m_queue->childCount() );
+ setProgress( 0, m_parent->m_queue->childCount() );
// ok, let's copy the stuff to the device
KURL::List existing, unplayable;
unsigned transcodeFail = 0;
// iterate through items
- MediaItem *next = static_cast<MediaItem *>(m_tqparent->m_queue->firstChild());
+ MediaItem *next = static_cast<MediaItem *>(m_parent->m_queue->firstChild());
while( next )
{
MediaItem *transferredItem = next;
@@ -2954,10 +2954,10 @@ MediaDevice::transferFiles()
if( transferredItem->device() )
{
transferredItem->device()->copyTrackFromDevice( transferredItem );
- m_tqparent->m_queue->subtractItemFromSize( transferredItem, true );
+ m_parent->m_queue->subtractItemFromSize( transferredItem, true );
delete transferredItem;
setProgress( progress() + 1 );
- m_tqparent->m_queue->itemCountChanged();
+ m_parent->m_queue->itemCountChanged();
kapp->tqprocessEvents( 100 );
continue;
}
@@ -2976,9 +2976,9 @@ MediaDevice::transferFiles()
{
// this should not happen
debug() << "invalid item in transfer queue" << endl;
- m_tqparent->m_queue->subtractItemFromSize( transferredItem, true );
+ m_parent->m_queue->subtractItemFromSize( transferredItem, true );
delete transferredItem;
- m_tqparent->m_queue->itemCountChanged();
+ m_parent->m_queue->itemCountChanged();
continue;
}
@@ -3120,17 +3120,17 @@ MediaDevice::transferFiles()
if( isCanceled() )
{
- m_tqparent->updateStats();
+ m_parent->updateStats();
break;
}
if( !(transferredItem->flags() & MediaItem::Failed) )
{
- m_tqparent->m_queue->subtractItemFromSize( transferredItem, true );
+ m_parent->m_queue->subtractItemFromSize( transferredItem, true );
delete transferredItem;
- m_tqparent->m_queue->itemCountChanged();
+ m_parent->m_queue->itemCountChanged();
}
- m_tqparent->updateStats();
+ m_parent->updateStats();
kapp->tqprocessEvents( 100 );
}
@@ -3189,8 +3189,8 @@ MediaDevice::transferFiles()
Amarok::StatusBar::instance()->shortMessage( msg, KDE::StatusBar::Sorry );
}
- m_tqparent->updateButtons();
- m_tqparent->queue()->save( Amarok::saveLocation() + "transferlist.xml" );
+ m_parent->updateButtons();
+ m_parent->queue()->save( Amarok::saveLocation() + "transferlist.xml" );
m_transferring = false;
if( m_deferredDisconnect )
@@ -3208,24 +3208,24 @@ MediaDevice::transferFiles()
int
MediaDevice::progress() const
{
- return m_tqparent->m_progress->progress();
+ return m_parent->m_progress->progress();
}
void
MediaDevice::setProgress( const int progress, const int total )
{
if( total != -1 )
- m_tqparent->m_progress->setTotalSteps( total );
- m_tqparent->m_progress->setProgress( progress );
- m_tqparent->m_progressBox->show();
+ m_parent->m_progress->setTotalSteps( total );
+ m_parent->m_progress->setProgress( progress );
+ m_parent->m_progressBox->show();
}
void
MediaDevice::fileTransferFinished() //SLOT
{
- m_tqparent->updateStats();
- m_tqparent->m_progressBox->hide();
- m_tqparent->m_toolbar->getButton(MediaBrowser::TRANSFER)->setEnabled( isConnected() && m_tqparent->queue()->childCount() > 0 );
+ m_parent->updateStats();
+ m_parent->m_progressBox->hide();
+ m_parent->m_toolbar->getButton(MediaBrowser::TRANSFER)->setEnabled( isConnected() && m_parent->queue()->childCount() > 0 );
m_wait = false;
}
@@ -3249,10 +3249,10 @@ MediaDevice::deleteFromDevice(MediaItem *item, int flags )
//NOTE we assume that currentItem is the main target
int numFiles = m_view->getSelectedLeaves(item, &list, MediaView::OnlySelected | ((flags & OnlyPlayed) ? MediaView::OnlyPlayed : MediaView::None) );
- m_tqparent->m_stats->setText( i18n( "1 track to be deleted", "%n tracks to be deleted", numFiles ) );
+ m_parent->m_stats->setText( i18n( "1 track to be deleted", "%n tracks to be deleted", numFiles ) );
if( numFiles > 0 && (flags & DeleteTrack) )
{
- int button = KMessageBox::warningContinueCancel( m_tqparent,
+ int button = KMessageBox::warningContinueCancel( m_parent,
i18n( "<p>You have selected 1 track to be <b>irreversibly</b> deleted.",
"<p>You have selected %n tracks to be <b>irreversibly</b> deleted.",
numFiles
@@ -3262,8 +3262,8 @@ MediaDevice::deleteFromDevice(MediaItem *item, int flags )
if ( button != KMessageBox::Continue )
{
- m_tqparent->queue()->computeSize();
- m_tqparent->updateStats();
+ m_parent->queue()->computeSize();
+ m_parent->updateStats();
m_deleting = false;
unlockDevice();
return 0;
@@ -3315,7 +3315,7 @@ MediaDevice::deleteFromDevice(MediaItem *item, int flags )
count = -1;
}
}
- m_tqparent->updateStats();
+ m_parent->updateStats();
fi = next;
}
@@ -3329,7 +3329,7 @@ MediaDevice::deleteFromDevice(MediaItem *item, int flags )
if(!isTransferring())
{
- TQTimer::singleShot( 1500, m_tqparent->m_progressBox, TQT_SLOT(hide()) );
+ TQTimer::singleShot( 1500, m_parent->m_progressBox, TQT_SLOT(hide()) );
}
if( m_deferredDisconnect )
@@ -3338,8 +3338,8 @@ MediaDevice::deleteFromDevice(MediaItem *item, int flags )
disconnectDevice( m_runDisconnectHook );
}
}
- m_tqparent->queue()->computeSize();
- m_tqparent->updateStats();
+ m_parent->queue()->computeSize();
+ m_parent->updateStats();
return count;
}
@@ -3448,7 +3448,7 @@ MediaQueue::save( const TQString &path )
i.appendChild( attr );
attr = newdoc.createElement( "PodcastRSS" );
- t = newdoc.createTextNode( peb->tqparent().url() );
+ t = newdoc.createTextNode( peb->parent().url() );
attr.appendChild( t );
i.appendChild( attr );
@@ -3599,8 +3599,8 @@ MediaDevice::isPreferredFormat( const MetaBundle &bundle )
}
-MediaQueue::MediaQueue(MediaBrowser *tqparent)
- : KListView( tqparent ), m_tqparent( tqparent )
+MediaQueue::MediaQueue(MediaBrowser *parent)
+ : KListView( parent ), m_parent( parent )
{
setFixedHeight( 200 );
setSelectionMode( TQListView::Extended );
@@ -3640,7 +3640,7 @@ MediaQueue::acceptDrag( TQDropEvent *e ) const
}
void
-MediaQueue::slotDropped( TQDropEvent* e, TQListViewItem* tqparent, TQListViewItem* after)
+MediaQueue::slotDropped( TQDropEvent* e, TQListViewItem* parent, TQListViewItem* after)
{
if( e->source() != viewport() )
{
@@ -3664,7 +3664,7 @@ MediaQueue::slotDropped( TQDropEvent* e, TQListViewItem* tqparent, TQListViewIte
}
else if( TQListViewItem *i = currentItem() )
{
- moveItem( i, tqparent, after );
+ moveItem( i, parent, after );
}
}
@@ -3699,9 +3699,9 @@ MediaQueue::computeSize() const
MediaItem *item = static_cast<MediaItem *>(it);
if( item && item->bundle() &&
- ( !m_tqparent->currentDevice()
- || !m_tqparent->currentDevice()->isConnected()
- || !m_tqparent->currentDevice()->trackExists(*item->bundle()) ) )
+ ( !m_parent->currentDevice()
+ || !m_parent->currentDevice()->isConnected()
+ || !m_parent->currentDevice()->trackExists(*item->bundle()) ) )
m_totalSize += ((item->size()+1023)/1024)*1024;
}
}
@@ -3716,9 +3716,9 @@ void
MediaQueue::addItemToSize( const MediaItem *item ) const
{
if( item && item->bundle() &&
- ( !m_tqparent->currentDevice()
- || !m_tqparent->currentDevice()->isConnected()
- || !m_tqparent->currentDevice()->trackExists(*item->bundle()) ) )
+ ( !m_parent->currentDevice()
+ || !m_parent->currentDevice()->isConnected()
+ || !m_parent->currentDevice()->trackExists(*item->bundle()) ) )
m_totalSize += ((item->size()+1023)/1024)*1024;
}
@@ -3726,9 +3726,9 @@ void
MediaQueue::subtractItemFromSize( const MediaItem *item, bool unconditionally ) const
{
if( item && item->bundle() &&
- ( !m_tqparent->currentDevice()
- || !m_tqparent->currentDevice()->isConnected()
- || (unconditionally || !m_tqparent->currentDevice()->trackExists(*item->bundle())) ) )
+ ( !m_parent->currentDevice()
+ || !m_parent->currentDevice()->isConnected()
+ || (unconditionally || !m_parent->currentDevice()->trackExists(*item->bundle())) ) )
m_totalSize -= ((item->size()+1023)/1024)*1024;
}
@@ -3743,7 +3743,7 @@ MediaQueue::removeSelected()
{
subtractItemFromSize( static_cast<MediaItem *>(item) );
delete item;
- if( m_tqparent->currentDevice() && m_tqparent->currentDevice()->isTransferring() )
+ if( m_parent->currentDevice() && m_parent->currentDevice()->isTransferring() )
{
MediaBrowser::instance()->m_progress->setTotalSteps( MediaBrowser::instance()->m_progress->totalSteps() - 1 );
}
@@ -3812,11 +3812,11 @@ MediaQueue::clearItems()
{
clear();
itemCountChanged();
- if(m_tqparent)
+ if(m_parent)
{
computeSize();
- m_tqparent->updateStats();
- m_tqparent->updateButtons();
+ m_parent->updateStats();
+ m_parent->updateButtons();
}
}