diff options
Diffstat (limited to 'amarok/src/mediadevice/ifp/ifpmediadevice.cpp')
-rw-r--r-- | amarok/src/mediadevice/ifp/ifpmediadevice.cpp | 76 |
1 files changed, 38 insertions, 38 deletions
diff --git a/amarok/src/mediadevice/ifp/ifpmediadevice.cpp b/amarok/src/mediadevice/ifp/ifpmediadevice.cpp index 7f5f101b..590e7959 100644 --- a/amarok/src/mediadevice/ifp/ifpmediadevice.cpp +++ b/amarok/src/mediadevice/ifp/ifpmediadevice.cpp @@ -57,12 +57,12 @@ namespace Amarok { class IfpMediaItem : public MediaItem { public: - IfpMediaItem( TQListView *parent, TQListViewItem *after = 0 ) - : MediaItem( parent, after ) + IfpMediaItem( TQListView *tqparent, TQListViewItem *after = 0 ) + : MediaItem( tqparent, after ) {} - IfpMediaItem( TQListViewItem *parent, TQListViewItem *after = 0 ) - : MediaItem( parent, after ) + IfpMediaItem( TQListViewItem *tqparent, TQListViewItem *after = 0 ) + : MediaItem( tqparent, after ) {} void @@ -74,7 +74,7 @@ class IfpMediaItem : public MediaItem void setEncodedName( TQCString &name ) { m_encodedName = name; } - QCString + TQCString encodedName() { return m_encodedName; } // List directories first, always @@ -127,9 +127,9 @@ IfpMediaDevice::IfpMediaDevice() } void -IfpMediaDevice::init( MediaBrowser* parent ) +IfpMediaDevice::init( MediaBrowser* tqparent ) { - MediaDevice::init( parent ); + MediaDevice::init( tqparent ); } IfpMediaDevice::~IfpMediaDevice() @@ -278,32 +278,32 @@ IfpMediaDevice::renameItem( TQListViewItem *item ) // SLOT /// Creating a directory MediaItem * -IfpMediaDevice::newDirectory( const TQString &name, MediaItem *parent ) +IfpMediaDevice::newDirectory( const TQString &name, MediaItem *tqparent ) { if( !m_connected || name.isEmpty() ) return 0; TQString cleanedName = cleanPath( name ); - const TQCString dirPath = TQFile::encodeName( getFullPath( parent ) + "\\" + cleanedName ); + const TQCString dirPath = TQFile::encodeName( getFullPath( tqparent ) + "\\" + cleanedName ); debug() << "Creating directory: " << dirPath << endl; int err = ifp_mkdir( &m_ifpdev, dirPath ); if( err ) //failed return 0; - m_tmpParent = parent; + m_tmpParent = tqparent; addTrackToList( IFP_DIR, cleanedName ); return m_last; } MediaItem * -IfpMediaDevice::newDirectoryRecursive( const TQString &name, MediaItem *parent ) +IfpMediaDevice::newDirectoryRecursive( const TQString &name, MediaItem *tqparent ) { TQStringList folders = TQStringList::split( '\\', name ); TQString progress = ""; - if( parent ) - progress += getFullPath( parent ) + "\\"; + if( tqparent ) + progress += getFullPath( tqparent ) + "\\"; else progress += "\\"; @@ -315,32 +315,32 @@ IfpMediaDevice::newDirectoryRecursive( const TQString &name, MediaItem *parent ) if( ifp_exists( &m_ifpdev, dirPath ) == IFP_DIR ) { - m_tmpParent = parent; - parent = findChildItem( *it, parent ); - if( !parent ) + m_tmpParent = tqparent; + tqparent = findChildItem( *it, tqparent ); + if( !tqparent ) { addTrackToList( IFP_DIR, *it ); - parent = m_last; + tqparent = m_last; } } else { - parent = newDirectory( *it, parent ); - if( !parent ) //failed + tqparent = newDirectory( *it, tqparent ); + if( !tqparent ) //failed return 0; } progress += "\\"; } - return parent; + return tqparent; } MediaItem * -IfpMediaDevice::findChildItem( const TQString &name, MediaItem *parent ) +IfpMediaDevice::findChildItem( const TQString &name, MediaItem *tqparent ) { TQListViewItem *child; - parent ? - child = parent->firstChild(): + tqparent ? + child = tqparent->firstChild(): child = m_view->firstChild(); while( child ) @@ -406,7 +406,7 @@ IfpMediaDevice::copyTrackToDevice( const MetaBundle& bundle ) TQString newFilename; // we don't put this in cleanPath because of remote directory delimiters - const TQString title = bundle.title().replace( '\\', '-' ); + const TQString title = bundle.title().tqreplace( '\\', '-' ); if( cleverFilename && !title.isEmpty() ) { if( bundle.track() > 0 ) @@ -452,8 +452,8 @@ void IfpMediaDevice::downloadSelectedItems() { // KConfig *config = Amarok::config( "MediaDevice" ); -// TQString save = config->readEntry( "DownloadLocation", TQString::null ); //restore the save directory - TQString save = TQString::null; +// TQString save = config->readEntry( "DownloadLocation", TQString() ); //restore the save directory + TQString save = TQString(); KURLRequesterDlg dialog( save, 0, 0 ); dialog.setCaption( kapp->makeStdCaption( i18n( "Choose a Download Directory" ) ) ); @@ -526,14 +526,14 @@ IfpMediaDevice::deleteItemFromDevice( MediaItem *item, int /*flags*/ ) case MediaItem::DIRECTORY: err = ifp_delete_dir_recursive( &m_ifpdev, encodedPath ); debug() << "Deleting folder: " << encodedPath << endl; - checkResult( err, i18n("Directory cannot be deleted: '%1'").arg(encodedPath) ); + checkResult( err, i18n("Directory cannot be deleted: '%1'").tqarg(encodedPath) ); break; default: err = ifp_delete( &m_ifpdev, encodedPath ); debug() << "Deleting file: " << encodedPath << endl; count += 1; - checkResult( err, i18n("File does not exist: '%1'").arg(encodedPath) ); + checkResult( err, i18n("File does not exist: '%1'").tqarg(encodedPath) ); break; } if( err == 0 ) //success @@ -564,7 +564,7 @@ void IfpMediaDevice::listDir( const TQString &dir ) { int err = ifp_list_dirs( &m_ifpdev, TQFile::encodeName( dir ), listDirCallback, this ); - checkResult( err, i18n("Cannot enter directory: '%1'").arg(dir) ); + checkResult( err, i18n("Cannot enter directory: '%1'").tqarg(dir) ); } // will be called by 'ifp_list_dirs' @@ -619,7 +619,7 @@ IfpMediaDevice::getCapacity( KIO::filesize_t *total, KIO::filesize_t *available /// Helper functions -QString +TQString IfpMediaDevice::getFullPath( const TQListViewItem *item, const bool getFilename ) { if( !item ) return TQString(); @@ -628,12 +628,12 @@ IfpMediaDevice::getFullPath( const TQListViewItem *item, const bool getFilename if( getFilename ) path = item->text(0); - TQListViewItem *parent = item->parent(); - while( parent ) + TQListViewItem *tqparent = item->tqparent(); + while( tqparent ) { path.prepend( "\\" ); - path.prepend( parent->text(0) ); - parent = parent->parent(); + path.prepend( tqparent->text(0) ); + tqparent = tqparent->tqparent(); } path.prepend( "\\" ); @@ -667,7 +667,7 @@ IfpMediaDevice::rmbPressed( TQListViewItem* qitem, const TQPoint& point, int ) if( item->type() == MediaItem::DIRECTORY ) m_view->newDirectory( static_cast<MediaItem*>(item) ); else - m_view->newDirectory( static_cast<MediaItem*>(item->parent()) ); + m_view->newDirectory( static_cast<MediaItem*>(item->tqparent()) ); break; case RENAME: @@ -701,12 +701,12 @@ TQString IfpMediaDevice::cleanPath( const TQString &component ) result.simplifyWhiteSpace(); - result.remove( "?" ).replace( "*", " " ).replace( ":", " " ); + result.remove( "?" ).tqreplace( "*", " " ).tqreplace( ":", " " ); // if( m_spacesToUnderscores ) -// result.replace( TQRegExp( "\\s" ), "_" ); +// result.tqreplace( TQRegExp( "\\s" ), "_" ); - result.replace( "/", "-" ); + result.tqreplace( "/", "-" ); return result; } |