diff options
Diffstat (limited to 'src/filelist.cpp')
-rwxr-xr-x | src/filelist.cpp | 398 |
1 files changed, 199 insertions, 199 deletions
diff --git a/src/filelist.cpp b/src/filelist.cpp index c4e6b5d..72cb8b0 100755 --- a/src/filelist.cpp +++ b/src/filelist.cpp @@ -21,14 +21,14 @@ #include <kurldrag.h> #include <kapplication.h> -#include <qlayout.h> -#include <qfileinfo.h> -#include <qsimplerichtext.h> -#include <qpainter.h> -#include <qapplication.h> -#include <qdragobject.h> -#include <qheader.h> -#include <qdir.h> +#include <tqlayout.h> +#include <tqfileinfo.h> +#include <tqsimplerichtext.h> +#include <tqpainter.h> +#include <tqapplication.h> +#include <tqdragobject.h> +#include <tqheader.h> +#include <tqdir.h> #include <kprogress.h> #include <kuser.h> @@ -38,8 +38,8 @@ // ### soundkonverter 0.4: draw tooltip like bubble info box -FileListItem::FileListItem( KListView* parent, FileListItem* after ) - : KListViewItem( parent, after ) +FileListItem::FileListItem( KListView* tqparent, FileListItem* after ) + : KListViewItem( tqparent, after ) { tags = 0; converting = false; @@ -47,8 +47,8 @@ FileListItem::FileListItem( KListView* parent, FileListItem* after ) ripping = false; } -FileListItem::FileListItem( KListView* parent ) - : KListViewItem( parent ) +FileListItem::FileListItem( KListView* tqparent ) + : KListViewItem( tqparent ) { tags = 0; converting = false; @@ -59,52 +59,52 @@ FileListItem::FileListItem( KListView* parent ) FileListItem::~FileListItem() {} -void FileListItem::paintCell( QPainter *p, const QColorGroup &cg, int column, int width, int alignment ) +void FileListItem::paintCell( TQPainter *p, const TQColorGroup &cg, int column, int width, int tqalignment ) { // NOTE speed up this function // NOTE calculate the red color - QColorGroup _cg( cg ); - QColor c; + TQColorGroup _cg( cg ); + TQColor c; if( column == ((FileList*)listView())->columnByName(i18n("Input")) || column == ((FileList*)listView())->columnByName(i18n("Output")) ) { int margin = listView()->itemMargin(); int w = width - 2*margin; int h = height(); - QRect textRect = p->boundingRect( margin, 0, w, h, alignment, text(column) ); + TQRect textRect = p->boundingRect( margin, 0, w, h, tqalignment, text(column) ); if( textRect.width() > w ) { - alignment = Qt::AlignRight | Qt::SingleLine; + tqalignment = TQt::AlignRight | TQt::SingleLine; } /*if ( textRect.width() <= w ) { - p->drawText( margin, 0, w, h, alignment | Qt::SingleLine | Qt::ExpandTabs, text(column), -1 ); + p->drawText( margin, 0, w, h, tqalignment | TQt::SingleLine | TQt::ExpandTabs, text(column), -1 ); } else { - textRect = p->boundingRect( margin, 0, w, h, Qt::AlignLeft, "... " ); - p->drawText( margin, 0, textRect.width(), h, Qt::AlignLeft | Qt::SingleLine | Qt::ExpandTabs, "...", -1 ); - p->drawText( margin+textRect.width(), 0, w-textRect.width(), h, Qt::AlignRight | Qt::SingleLine | Qt::ExpandTabs, text(column), -1 ); + textRect = p->boundingRect( margin, 0, w, h, TQt::AlignLeft, "... " ); + p->drawText( margin, 0, textRect.width(), h, TQt::AlignLeft | TQt::SingleLine | TQt::ExpandTabs, "...", -1 ); + p->drawText( margin+textRect.width(), 0, w-textRect.width(), h, TQt::AlignRight | TQt::SingleLine | TQt::ExpandTabs, text(column), -1 ); }*/ } if( isSelected() && converting ) { - _cg.setColor( QColorGroup::Highlight, QColor( 215, 62, 62 ) ); - QListViewItem::paintCell( p, _cg, column, width, alignment ); + _cg.setColor( TQColorGroup::Highlight, TQColor( 215, 62, 62 ) ); + TQListViewItem::paintCell( p, _cg, column, width, tqalignment ); return; } else if( converting && column != listView()->sortColumn() ) { - _cg.setColor( QColorGroup::Base, QColor( 255, 234, 234 ) ); - QListViewItem::paintCell( p, _cg, column, width, alignment ); + _cg.setColor( TQColorGroup::Base, TQColor( 255, 234, 234 ) ); + TQListViewItem::paintCell( p, _cg, column, width, tqalignment ); return; } else if( converting && column == listView()->sortColumn() ) { - _cg.setColor( QColorGroup::Base, QColor( 247, 227, 227 ) ); - QListViewItem::paintCell( p, _cg, column, width, alignment ); + _cg.setColor( TQColorGroup::Base, TQColor( 247, 227, 227 ) ); + TQListViewItem::paintCell( p, _cg, column, width, tqalignment ); return; } - KListViewItem::paintCell( p, _cg, column, width, alignment ); + KListViewItem::paintCell( p, _cg, column, width, tqalignment ); } /*void FileListItem::updateOutputCell() @@ -117,8 +117,8 @@ void FileListItem::updateOptionsCell() setText( ((FileList*)listView())->columnByName(i18n("Quality")), ((FileList*)listView())->config->getProfileName(options) ); }*/ -FileList::FileList( CDManager* _cdManager, TagEngine* _tagEngine, Config* _config, Options* _options, Logger* _logger, QWidget* parent, const char* name ) - : KListView( parent, name ) +FileList::FileList( CDManager* _cdManager, TagEngine* _tagEngine, Config* _config, Options* _options, Logger* _logger, TQWidget* tqparent, const char* name ) + : KListView( tqparent, name ) { cdManager = _cdManager; tagEngine = _tagEngine; @@ -140,62 +140,62 @@ FileList::FileList( CDManager* _cdManager, TagEngine* _tagEngine, Config* _confi header()->setClickEnabled( false ); - setSelectionMode( QListView::Extended ); + setSelectionMode( TQListView::Extended ); setAllColumnsShowFocus( true ); setResizeMode( LastColumn ); setSorting( -1 ); // NOTE if commented out, items aren't moveable anymore setMinimumHeight( 200 ); - QGridLayout* grid = new QGridLayout( this, 2, 1, 11, 6 ); + TQGridLayout* grid = new TQGridLayout( this, 2, 1, 11, 6 ); grid->setRowStretch( 0, 1 ); grid->setRowStretch( 2, 1 ); grid->setColStretch( 0, 1 ); grid->setColStretch( 2, 1 ); - pScanStatus = new KProgress( this, "pScanStatus" ); - pScanStatus->setMinimumHeight( pScanStatus->height() ); - pScanStatus->setFormat( "%v / %m" ); - pScanStatus->hide(); - grid->addWidget( pScanStatus, 1, 1 ); + pScantqStatus = new KProgress( this, "pScantqStatus" ); + pScantqStatus->setMinimumHeight( pScantqStatus->height() ); + pScantqStatus->setFormat( "%v / %m" ); + pScantqStatus->hide(); + grid->addWidget( pScantqStatus, 1, 1 ); grid->setColStretch( 1, 2 ); contextMenu = new KPopupMenu( this ); - connect( this, SIGNAL(contextMenuRequested( QListViewItem*, const QPoint&, int )), - this, SLOT(showContextMenu( QListViewItem*, const QPoint&, int )) + connect( TQT_TQOBJECT(this), TQT_SIGNAL(contextMenuRequested( TQListViewItem*, const TQPoint&, int )), + TQT_TQOBJECT(this), TQT_SLOT(showContextMenu( TQListViewItem*, const TQPoint&, int )) ); // we haven't got access to the action collection of soundKonverter, so let's create a new one actionCollection = new KActionCollection( this ); - edit = new KAction( i18n("Edit options ..."), "view_text", 0, this, SLOT(showOptionsEditorDialog()), actionCollection, "edit_options" ); - start = new KAction( i18n("Start conversion"), "run", 0, this, SLOT(convertSelectedItems()), actionCollection, "start_conversion" ); - stop = new KAction( i18n("Stop conversion"), "stop", 0, this, SLOT(stopSelectedItems()), actionCollection, "stop_conversion" ); - remove = new KAction( i18n("Remove"), "edittrash", Key_Delete, this, SLOT(removeSelectedItems()), actionCollection, "remove" ); - paste = new KAction( i18n("Paste"), "editpaste", 0, this, 0, actionCollection, "paste" ); // TODO paste + edit = new KAction( i18n("Edit options ..."), "view_text", 0, TQT_TQOBJECT(this), TQT_SLOT(showOptionsEditorDialog()), actionCollection, "edit_options" ); + start = new KAction( i18n("Start conversion"), "run", 0, TQT_TQOBJECT(this), TQT_SLOT(convertSelectedItems()), actionCollection, "start_conversion" ); + stop = new KAction( i18n("Stop conversion"), "stop", 0, TQT_TQOBJECT(this), TQT_SLOT(stopSelectedItems()), actionCollection, "stop_conversion" ); + remove = new KAction( i18n("Remove"), "edittrash", Key_Delete, TQT_TQOBJECT(this), TQT_SLOT(removeSelectedItems()), actionCollection, "remove" ); + paste = new KAction( i18n("Paste"), "editpaste", 0, TQT_TQOBJECT(this), 0, actionCollection, "paste" ); // TODO paste - connect( this, SIGNAL(selectionChanged()), - this, SLOT(itemsSelected()) + connect( TQT_TQOBJECT(this), TQT_SIGNAL(selectionChanged()), + TQT_TQOBJECT(this), TQT_SLOT(itemsSelected()) ); -// connect( this, SIGNAL(clicked(QListViewItem*,const QPoint&,int)), -// this, SLOT(clickedSomewhere(QListViewItem*,const QPoint&,int)) +// connect( TQT_TQOBJECT(this), TQT_SIGNAL(clicked(TQListViewItem*,const TQPoint&,int)), +// TQT_TQOBJECT(this), TQT_SLOT(clickedSomewhere(TQListViewItem*,const TQPoint&,int)) // ); - bubble = new QSimpleRichText( i18n( "<div align=center>" + bubble = new TQSimpleRichText( i18n( "<div align=center>" "<h3>File List</h3>" "Select your desired output options in the form above and add some files.<br/>" "You can add files by clicking on \"Add files ...\" or dropping them here." // "<br/><a href=\"documenation:about_compression\">Learn more about audio compression ...</a>" - "</div>" ), QApplication::font() ); + "</div>" ), TQApplication::font() ); - connect( header(), SIGNAL(sizeChange( int, int, int )), - SLOT(columnResizeEvent( int, int, int )) + connect( header(), TQT_SIGNAL(sizeChange( int, int, int )), + TQT_SLOT(columnResizeEvent( int, int, int )) ); - connect( this, SIGNAL( dropped(QDropEvent*, QListViewItem*, QListViewItem*) ), - SLOT( slotDropped(QDropEvent*, QListViewItem*, QListViewItem*) ) + connect( TQT_TQOBJECT(this), TQT_SIGNAL( dropped(TQDropEvent*, TQListViewItem*, TQListViewItem*) ), + TQT_SLOT( slotDropped(TQDropEvent*, TQListViewItem*, TQListViewItem*) ) ); -// if( QFile::exists(locateLocal("data","soundkonverter/filelist.autosave.xml")) ) load( true ); +// if( TQFile::exists(locateLocal("data","soundkonverter/filelist.autosave.xml")) ) load( true ); // debug(); // NOTE DEBUG } @@ -205,7 +205,7 @@ FileList::~FileList() delete optionsEditor; } -int FileList::columnByName( const QString& name ) +int FileList::columnByName( const TQString& name ) { for( int i = 0; i < columns(); ++i ) { if( columnText( i ) == name ) return i; @@ -213,26 +213,26 @@ int FileList::columnByName( const QString& name ) return -1; } -void FileList::viewportPaintEvent( QPaintEvent* e ) +void FileList::viewportPaintEvent( TQPaintEvent* e ) { KListView::viewportPaintEvent( e ); // the bubble help if( childCount() == 0 ) { - QPainter p( viewport() ); + TQPainter p( viewport() ); bubble->setWidth( width() - 50 ); const uint w = bubble->width() + 20; const uint h = bubble->height() + 20; - p.setBrush( colorGroup().background() ); + p.setBrush( tqcolorGroup().background() ); p.drawRoundRect( 15, 15, w, h, (8*200)/w, (8*200)/h ); - bubble->draw( &p, 20, 20, QRect(), colorGroup() ); + bubble->draw( &p, 20, 20, TQRect(), tqcolorGroup() ); } } -void FileList::viewportResizeEvent( QResizeEvent* ) +void FileList::viewportResizeEvent( TQResizeEvent* ) { // needed for correct redraw of bubble help triggerUpdate(); @@ -244,23 +244,23 @@ void FileList::columnResizeEvent( int, int, int ) triggerUpdate(); } -// void FileList::clickedSomewhere( QListViewItem*, const QPoint& pos, int ) +// void FileList::clickedSomewhere( TQListViewItem*, const TQPoint& pos, int ) // { // /* if( childCount() == 0 ) { -// kdDebug() << "clicked: `" << bubble->anchorAt(mapFromGlobal(pos)-QPoint(24,0)) << " (" << pos.x() << " | " << pos.y() << ")'" << endl; +// kdDebug() << "clicked: `" << bubble->anchorAt(mapFromGlobal(pos)-TQPoint(24,0)) << " (" << pos.x() << " | " << pos.y() << ")'" << endl; // }*/ // } -bool FileList::acceptDrag( QDropEvent* e ) const +bool FileList::acceptDrag( TQDropEvent* e ) const { return ( e->source() == viewport() || KURLDrag::canDecode(e) ); // TODO verify the files } -void FileList::slotDropped( QDropEvent* e, QListViewItem*, QListViewItem* itemAfter ) +void FileList::slotDropped( TQDropEvent* e, TQListViewItem*, TQListViewItem* itemAfter ) { - QString file; + TQString file; KURL::List list; - QStringList files; + TQStringList files; if( KURLDrag::decode( e, list ) ) // TODO local? { save( true ); @@ -268,8 +268,8 @@ void FileList::slotDropped( QDropEvent* e, QListViewItem*, QListViewItem* itemAf { // TODO verify the files (necessary when multiple files are being dropped) // TODO implement cdda:/ - file = QDir::convertSeparators( (*it).pathOrURL() ); // TODO implement that in the url/file dialog, too? - QFileInfo fileInfo( file ); + file = TQDir::convertSeparators( (*it).pathOrURL() ); // TODO implement that in the url/file dialog, too? + TQFileInfo fileInfo( file ); if( fileInfo.isDir() ) { addDir( file ); @@ -284,7 +284,7 @@ void FileList::slotDropped( QDropEvent* e, QListViewItem*, QListViewItem* itemAf } } -void FileList::showContextMenu( QListViewItem* item, const QPoint& point, int ) +void FileList::showContextMenu( TQListViewItem* item, const TQPoint& point, int ) { // if item is null, we can abort here if( !item ) return; @@ -362,32 +362,32 @@ void FileList::stopSelectedItems() } } -int FileList::listDir( const QString& directory, QStringList filter, bool recursive, bool fast, int count ) +int FileList::listDir( const TQString& directory, TQStringList filter, bool recursive, bool fast, int count ) { // NOTE speed up? - QDir dir( directory ); - dir.setFilter( QDir::Files | QDir::Dirs | QDir::NoSymLinks | QDir::Readable ); + TQDir dir( directory ); + dir.setFilter( TQDir::Files | TQDir::Dirs | TQDir::NoSymLinks | TQDir::Readable ); - QStringList list = dir.entryList(); + TQStringList list = dir.entryList(); - for( QStringList::Iterator it = list.begin(); it != list.end(); ++it ) { + for( TQStringList::Iterator it = list.begin(); it != list.end(); ++it ) { if( *it == "." || *it == ".." ) continue; - QFileInfo fileInfo( directory + "/" + *it ); + TQFileInfo fileInfo( directory + "/" + *it ); if( fast ) { if( fileInfo.isDir() && recursive ) { count = listDir( fileInfo.filePath(), filter, recursive, fast, count ); } else if( !fileInfo.isDir() || !recursive ) { // NOTE checking for isFile may not work with all file names // NOTE filter feature - for( QStringList::Iterator jt = filter.begin(); jt != filter.end(); ++jt ) { - if( (*it).endsWith("."+(*jt),false) ) { + for( TQStringList::Iterator jt = filter.begin(); jt != filter.end(); ++jt ) { + if( (*it).tqendsWith("."+(*jt),false) ) { count++; - pScanStatus->setTotalSteps( count ); + pScantqStatus->setTotalSteps( count ); break; } } if( filter.first() == "" ) { count++; - pScanStatus->setTotalSteps( count ); + pScantqStatus->setTotalSteps( count ); } } } @@ -397,18 +397,18 @@ int FileList::listDir( const QString& directory, QStringList filter, bool recurs } else if( !fileInfo.isDir() || !recursive ) { // NOTE checking for isFile may not work with all file names // NOTE filter feature - for( QStringList::Iterator jt = filter.begin(); jt != filter.end(); ++jt ) { - if( (*it).endsWith("."+(*jt),false) ) { + for( TQStringList::Iterator jt = filter.begin(); jt != filter.end(); ++jt ) { + if( (*it).tqendsWith("."+(*jt),false) ) { addFiles( KURL::encode_string(directory + "/" + *it) ); count++; - pScanStatus->setProgress( count ); + pScantqStatus->setProgress( count ); break; } } if( filter.first() == "" ) { addFiles( KURL::encode_string(directory + "/" + *it) ); count++; - pScanStatus->setProgress( count ); + pScantqStatus->setProgress( count ); } } } @@ -418,16 +418,16 @@ int FileList::listDir( const QString& directory, QStringList filter, bool recurs } // NOTE progressbar when adding files? -void FileList::addFiles( QStringList fileList, FileListItem* after, bool enabled ) +void FileList::addFiles( TQStringList fileList, FileListItem* after, bool enabled ) { // TODO test if everything works with remote files (http://) and local files (media://) FileListItem* lastListItem; if( !after && !enabled ) lastListItem = lastItem(); else lastListItem = after; - QString filePathName; - QString device; + TQString filePathName; + TQString device; - for( QStringList::Iterator it = fileList.begin(); it != fileList.end(); ++it ) { + for( TQStringList::Iterator it = fileList.begin(); it != fileList.end(); ++it ) { FileListItem* newItem = new FileListItem( this, lastListItem ); lastListItem = newItem; newItem->options = options->getCurrentOptions(); // FIXME speed up @@ -448,14 +448,14 @@ void FileList::addFiles( QStringList fileList, FileListItem* after, bool enabled else if( (*it).left( 13 ) == "system:/home/" ) { filePathName = *it; filePathName.remove( 0, 13 ); - filePathName = QDir::homeDirPath() + "/" + filePathName; + filePathName = TQDir::homeDirPath() + "/" + filePathName; newItem->local = true; } else if( (*it).left( 14 ) == "system:/users/" || (*it).left( 6 ) == "home:/" ) { int length = ( (*it).left(6) == "home:/" ) ? 6 : 14; - QString username = *it; + TQString username = *it; username.remove( 0, length ); - username = username.left( username.find("/") ); + username = username.left( username.tqfind("/") ); filePathName = *it; filePathName.remove( 0, length + username.length() ); KUser user( username ); @@ -466,7 +466,7 @@ void FileList::addFiles( QStringList fileList, FileListItem* after, bool enabled int length = ( (*it).left(7) == "media:/" ) ? 7 : 14; device = *it; device.remove( 0, length ); - device = "/dev/" + device.left( device.find( "/" ) ); + device = "/dev/" + device.left( device.tqfind( "/" ) ); KMountPoint::List mountPoints = KMountPoint::possibleMountPoints(); @@ -501,7 +501,7 @@ void FileList::addFiles( QStringList fileList, FileListItem* after, bool enabled // newItem->mimeType=""; // HACK last choise is to use the extension without KDE's help if( newItem->mimeType.isEmpty() || newItem->mimeType == "application/octet-stream" || newItem->mimeType == "text/plain" ) { - newItem->fileFormat = filePathName.right( filePathName.length() - filePathName.findRev(".") - 1 ); + newItem->fileFormat = filePathName.right( filePathName.length() - filePathName.tqfindRev(".") - 1 ); FormatItem *formatItem = config->getFormatItem( newItem->fileFormat ); if( formatItem ) newItem->mimeType = formatItem->mime_types.first(); // logger->log( 1000, " " + i18n("Mime type") + ": " + newItem->mimeType + " (" + i18n("Format") + ": " + newItem->fileFormat + ")" ); @@ -514,7 +514,7 @@ void FileList::addFiles( QStringList fileList, FileListItem* after, bool enabled continue; } newItem->options.filePathName = filePathName; - QFileInfo fileInfo( filePathName ); + TQFileInfo fileInfo( filePathName ); newItem->fileName = fileInfo.fileName(); newItem->tags = tagEngine->readTags( KURL::decode_string(filePathName) ); if( newItem->tags == 0 ) { @@ -536,8 +536,8 @@ void FileList::addFiles( QStringList fileList, FileListItem* after, bool enabled else { // logger->log( 1000, " File is remote (not yet implemented) (" + *it + ")" ); filePathName = *it; - newItem->fileName = filePathName.right( filePathName.length() - filePathName.findRev("/") - 1 ); - newItem->fileFormat = newItem->fileName.right( newItem->fileName.length() - newItem->fileName.findRev(".") - 1 ).lower(); + newItem->fileName = filePathName.right( filePathName.length() - filePathName.tqfindRev("/") - 1 ); + newItem->fileFormat = newItem->fileName.right( newItem->fileName.length() - newItem->fileName.tqfindRev(".") - 1 ).lower(); // NOTE http will not work with KMimeType - this just works if( filePathName.startsWith("http://") ) { newItem->mimeType = KMimeType::findByURL( "file:///" + newItem->fileName.lower() )->name(); @@ -565,29 +565,29 @@ void FileList::addFiles( QStringList fileList, FileListItem* after, bool enabled emit fileCountChanged( childCount() ); } -void FileList::addDir( const QString& directory, const QStringList& filter, bool recursive ) +void FileList::addDir( const TQString& directory, const TQStringList& filter, bool recursive ) { - pScanStatus->setProgress( 0 ); - pScanStatus->setTotalSteps( 0 ); - pScanStatus->show(); // show the status while scanning the directories + pScantqStatus->setProgress( 0 ); + pScantqStatus->setTotalSteps( 0 ); + pScantqStatus->show(); // show the status while scanning the directories kapp->processEvents(); int count = listDir( directory, filter, recursive, true ); listDir( directory, filter, recursive ); - pScanStatus->hide(); // hide the status bar, when the scan is done + pScantqStatus->hide(); // hide the status bar, when the scan is done } -void FileList::addTracks( const QString& device, QValueList<int> trackList ) +void FileList::addTracks( const TQString& device, TQValueList<int> trackList ) { - for( QValueList<int>::Iterator it = trackList.begin(); it != trackList.end(); ++it ) { -// logger->log( 1000, i18n("Adding track") + QString().sprintf(" %02i",*it) ); + for( TQValueList<int>::Iterator it = trackList.begin(); it != trackList.end(); ++it ) { +// logger->log( 1000, i18n("Adding track") + TQString().sprintf(" %02i",*it) ); FileListItem* newItem = new FileListItem( this, lastItem() ); newItem->options = options->getCurrentOptions(); // FIXME speed up // if( newItem->options.outputOptions.mode != OutputDirectory::Specify ) newItem->options.outputOptions.mode = OutputDirectory::MetaData; newItem->notify = notify; newItem->track = (*it); - newItem->fileName = i18n("Audio CD (%1)").arg(device) + ": " + i18n("Track") + QString().sprintf(" %02i",newItem->track); + newItem->fileName = i18n("Audio CD (%1)").tqarg(device) + ": " + i18n("Track") + TQString().sprintf(" %02i",newItem->track); newItem->mimeType = "application/x-cda"; newItem->fileFormat = "cda"; newItem->local = true; @@ -596,13 +596,13 @@ void FileList::addTracks( const QString& device, QValueList<int> trackList ) if( newItem->tags == 0 ) { // NOTE shouldn't happen // logger->log( 1000, " " + i18n("Reading tags failed") ); newItem->time = 210; - newItem->options.filePathName = QDir::homeDirPath() + "/" + i18n("Track") + QString().sprintf(" %02i",newItem->track) + "." + newItem->fileFormat; + newItem->options.filePathName = TQDir::homeDirPath() + "/" + i18n("Track") + TQString().sprintf(" %02i",newItem->track) + "." + newItem->fileFormat; } else { // logger->log( 1000, " " + i18n("Tags successfully read") ); newItem->time = newItem->tags->length; - newItem->options.filePathName = QDir::homeDirPath() + "/" + QString().sprintf("%02i - ",newItem->track) + newItem->tags->title + "." + newItem->fileFormat; - newItem->fileName = i18n("Audio CD (%1)").arg(device) + ": " + QString().sprintf("%02i - ",newItem->track) + newItem->tags->title; + newItem->options.filePathName = TQDir::homeDirPath() + "/" + TQString().sprintf("%02i - ",newItem->track) + newItem->tags->title + "." + newItem->fileFormat; + newItem->fileName = i18n("Audio CD (%1)").tqarg(device) + ": " + TQString().sprintf("%02i - ",newItem->track) + newItem->tags->title; } updateItem( newItem ); emit increaseTime( newItem->time ); @@ -610,15 +610,15 @@ void FileList::addTracks( const QString& device, QValueList<int> trackList ) emit fileCountChanged( childCount() ); } -void FileList::addDisc( const QString& device ) +void FileList::addDisc( const TQString& device ) { -// logger->log( 1000, i18n("Adding full audio CD (%1)").arg(device) ); +// logger->log( 1000, i18n("Adding full audio CD (%1)").tqarg(device) ); FileListItem* newItem = new FileListItem( this, lastItem() ); newItem->options = options->getCurrentOptions(); // if( newItem->options.outputOptions.mode != OutputDirectory::Specify ) newItem->options.outputOptions.mode = OutputDirectory::MetaData; newItem->notify = notify; newItem->track = 0; - newItem->fileName = i18n("Full audio CD (%1)").arg(device); + newItem->fileName = i18n("Full audio CD (%1)").tqarg(device); newItem->mimeType = "application/x-cda"; newItem->fileFormat = "cda"; newItem->local = true; @@ -627,13 +627,13 @@ void FileList::addDisc( const QString& device ) if( newItem->tags == 0 ) { // NOTE shouldn't happen // logger->log( 1000, " " + i18n("Reading tags failed") ); newItem->time = 3600; - newItem->options.filePathName = QDir::homeDirPath() + "/" + i18n("Audio CD") + "." + newItem->fileFormat; + newItem->options.filePathName = TQDir::homeDirPath() + "/" + i18n("Audio CD") + "." + newItem->fileFormat; } else { // logger->log( 1000, " " + i18n("Tags successfully read") ); newItem->time = newItem->tags->length; - newItem->options.filePathName = QDir::homeDirPath() + newItem->tags->title + "." + newItem->fileFormat; - newItem->fileName = i18n("Full audio CD (%1)").arg(device) + ": " + newItem->tags->title; + newItem->options.filePathName = TQDir::homeDirPath() + newItem->tags->title + "." + newItem->fileFormat; + newItem->fileName = i18n("Full audio CD (%1)").tqarg(device) + ": " + newItem->tags->title; } updateItem( newItem ); emit increaseTime( newItem->time ); @@ -689,7 +689,7 @@ void FileList::itemFinished( FileListItem* item, int state ) } } -void FileList::rippingFinished( const QString& device ) +void FileList::rippingFinished( const TQString& device ) { if( !queue ) return; @@ -734,7 +734,7 @@ void FileList::updateItem( FileListItem* item ) if( !item ) return; if( !item->converting ) { - if( config->data.general.conflictHandling == 1 && QFile::exists(KURL::decode_string(OutputDirectory::calcPath(item,config))) ) { // was: .replace("%2f","%252f") + if( config->data.general.conflictHandling == 1 && TQFile::exists(KURL::decode_string(OutputDirectory::calcPath(item,config))) ) { // was: .tqreplace("%2f","%252f") item->setText( columnByName(i18n("State")), i18n("Will be skipped") ); } else { @@ -745,10 +745,10 @@ void FileList::updateItem( FileListItem* item ) item->setText( columnByName(i18n("State")), i18n("Converting") ); } - if( item->track >= 0 ) item->setText( columnByName(i18n("Input")), KURL::decode_string(item->fileName).replace("%2f","/").replace("%%","%") ); - else item->setText( columnByName(i18n("Input")), KURL::decode_string(item->options.filePathName).replace("%2f","/").replace("%%","%") ); + if( item->track >= 0 ) item->setText( columnByName(i18n("Input")), KURL::decode_string(item->fileName).tqreplace("%2f","/").tqreplace("%%","%") ); + else item->setText( columnByName(i18n("Input")), KURL::decode_string(item->options.filePathName).tqreplace("%2f","/").tqreplace("%%","%") ); - item->setText( columnByName(i18n("Output")), KURL::decode_string(OutputDirectory::uniqueFileName(OutputDirectory::calcPath(item,config))).replace("%2f","/").replace("%%","%") ); + item->setText( columnByName(i18n("Output")), KURL::decode_string(OutputDirectory::uniqueFileName(OutputDirectory::calcPath(item,config))).tqreplace("%2f","/").tqreplace("%%","%") ); item->setText( columnByName(i18n("Quality")), config->getProfileName(item->options) ); } @@ -764,23 +764,23 @@ void FileList::showOptionsEditorDialog() return; } // } - connect( this, SIGNAL(editItems(QValueList<FileListItem*>)), - optionsEditor, SLOT(itemsSelected(QValueList<FileListItem*>)) + connect( TQT_TQOBJECT(this), TQT_SIGNAL(editItems(TQValueList<FileListItem*>)), + optionsEditor, TQT_SLOT(itemsSelected(TQValueList<FileListItem*>)) ); - connect( this, SIGNAL(setPreviousItemEnabled(bool)), - optionsEditor, SLOT(setPreviousEnabled(bool)) + connect( TQT_TQOBJECT(this), TQT_SIGNAL(setPreviousItemEnabled(bool)), + optionsEditor, TQT_SLOT(setPreviousEnabled(bool)) ); - connect( this, SIGNAL(setNextItemEnabled(bool)), - optionsEditor, SLOT(setNextEnabled(bool)) + connect( TQT_TQOBJECT(this), TQT_SIGNAL(setNextItemEnabled(bool)), + optionsEditor, TQT_SLOT(setNextEnabled(bool)) ); - connect( optionsEditor, SIGNAL(user2Clicked()), - this, SLOT(selectPreviousItem()) + connect( optionsEditor, TQT_SIGNAL(user2Clicked()), + TQT_TQOBJECT(this), TQT_SLOT(selectPreviousItem()) ); - connect( optionsEditor, SIGNAL(user1Clicked()), - this, SLOT(selectNextItem()) + connect( optionsEditor, TQT_SIGNAL(user1Clicked()), + TQT_TQOBJECT(this), TQT_SLOT(selectNextItem()) ); - /*connect( this, SIGNAL(moveEditor(int,int)), - optionsEditor, SLOT(moveWindow(int,int)) + /*connect( TQT_TQOBJECT(this), TQT_SIGNAL(moveEditor(int,int)), + optionsEditor, TQT_SLOT(moveWindow(int,int)) );*/ } itemsSelected(); @@ -794,13 +794,13 @@ void FileList::selectPreviousItem() FileListItem* item = selectedFiles.first()->itemAbove(); if( item != 0 ) { item->setSelected( true ); - repaintItem( item ); + tqrepaintItem( item ); ensureItemVisible( item ); } - for( QValueList<FileListItem*>::Iterator it = selectedFiles.begin(); it != selectedFiles.end(); ++it ) { + for( TQValueList<FileListItem*>::Iterator it = selectedFiles.begin(); it != selectedFiles.end(); ++it ) { (*it)->setSelected( false ); - repaintItem( *it ); + tqrepaintItem( *it ); } itemsSelected(); @@ -812,13 +812,13 @@ void FileList::selectNextItem() FileListItem* item = selectedFiles.last()->itemBelow(); if( item != 0 ) { item->setSelected( true ); - repaintItem( item ); + tqrepaintItem( item ); ensureItemVisible( item ); } - for( QValueList<FileListItem*>::Iterator it = selectedFiles.begin(); it != selectedFiles.end(); ++it ) { + for( TQValueList<FileListItem*>::Iterator it = selectedFiles.begin(); it != selectedFiles.end(); ++it ) { (*it)->setSelected( false ); - repaintItem( *it ); + tqrepaintItem( *it ); } itemsSelected(); @@ -898,7 +898,7 @@ void FileList::convertNextItem() { if( !queue ) return; - QStringList devices; + TQStringList devices; // look for tracks that are being ripped int count = 0; @@ -917,7 +917,7 @@ void FileList::convertNextItem() item = firstChild(); while( item != 0 && count < config->data.general.numFiles ) { if( !item->converting && item->text(columnByName(i18n("State"))) == i18n("Waiting") ) { - if( item->track >= 0 && devices.findIndex(item->device) == -1 ) { + if( item->track >= 0 && devices.tqfindIndex(item->device) == -1 ) { convertItem( item ); count++; devices += item->device; @@ -972,21 +972,21 @@ void FileList::load( bool autosave ) // NOTE clear the file list befor adding the saved items? int version; - QString name; + TQString name; FileListItem* lastListItem = lastItem(); - QString filename; + TQString filename; if( autosave ) filename = locateLocal("data","soundkonverter/filelist.autosave.xml"); else filename = locateLocal("data","soundkonverter/filelist.xml"); - QDomDocument domTree; - QFile opmlFile( filename ); + TQDomDocument domTree; + TQFile opmlFile( filename ); if( !opmlFile.open( IO_ReadOnly ) ) return; if( !domTree.setContent( &opmlFile ) ) return; opmlFile.close(); - QDomElement root = domTree.documentElement(); + TQDomElement root = domTree.documentElement(); if( root.attribute("type") != "filelist" ) return; - QDomNode node, sub1Node, sub2Node; + TQDomNode node, sub1Node, sub2Node; node = root.firstChild(); while( !node.isNull() ) { @@ -1087,20 +1087,20 @@ void FileList::save( bool autosave ) { // NOTE filenames should be encoded before saving - but it works fine without it (hm...) - QTime time; + TQTime time; time.start(); - QDomDocument domTree; - QDomElement root = domTree.createElement( "soundkonverter" ); + TQDomDocument domTree; + TQDomElement root = domTree.createElement( "soundkonverter" ); root.setAttribute( "type", "filelist" ); domTree.appendChild( root ); - QDomElement info = domTree.createElement( "info" ); + TQDomElement info = domTree.createElement( "info" ); info.setAttribute( "version", "300" ); root.appendChild( info ); for( FileListItem* item = firstChild(); item != 0; item = item->nextSibling() ) { - QDomElement file = domTree.createElement( "file" ); + TQDomElement file = domTree.createElement( "file" ); file.setAttribute( "fileName", item->fileName ); file.setAttribute( "mimeType", item->mimeType ); file.setAttribute( "fileFormat", item->fileFormat ); @@ -1112,7 +1112,7 @@ void FileList::save( bool autosave ) file.setAttribute( "filePathName", item->options.filePathName ); file.setAttribute( "outputFilePathName", item->options.outputFilePathName ); - QDomElement encodingOptions = domTree.createElement( "encodingOptions" ); + TQDomElement encodingOptions = domTree.createElement( "encodingOptions" ); encodingOptions.setAttribute( "sFormat", item->options.encodingOptions.sFormat ); encodingOptions.setAttribute( "sQualityMode", item->options.encodingOptions.sQualityMode ); @@ -1122,21 +1122,21 @@ void FileList::save( bool autosave ) encodingOptions.setAttribute( "iMinBitrate", item->options.encodingOptions.iMinBitrate ); encodingOptions.setAttribute( "iMaxBitrate", item->options.encodingOptions.iMaxBitrate ); - QDomElement samplingRate = domTree.createElement( "samplingRate" ); + TQDomElement samplingRate = domTree.createElement( "samplingRate" ); samplingRate.setAttribute( "bEnabled", item->options.encodingOptions.samplingRate.bEnabled ); samplingRate.setAttribute( "iSamplingRate", item->options.encodingOptions.samplingRate.iSamplingRate ); encodingOptions.appendChild( samplingRate ); - QDomElement channels = domTree.createElement( "channels" ); + TQDomElement channels = domTree.createElement( "channels" ); channels.setAttribute( "bEnabled", item->options.encodingOptions.channels.bEnabled ); channels.setAttribute( "sChannels", item->options.encodingOptions.channels.sChannels ); encodingOptions.appendChild( channels ); - QDomElement replaygain = domTree.createElement( "replaygain" ); + TQDomElement replaygain = domTree.createElement( "replaygain" ); replaygain.setAttribute( "bEnabled", item->options.encodingOptions.replaygain.bEnabled ); @@ -1146,7 +1146,7 @@ void FileList::save( bool autosave ) file.appendChild( encodingOptions ); - QDomElement outputOptions = domTree.createElement( "outputOptions" ); + TQDomElement outputOptions = domTree.createElement( "outputOptions" ); outputOptions.setAttribute( "mode", int(item->options.outputOptions.mode) ); outputOptions.setAttribute( "directory", item->options.outputOptions.directory ); @@ -1155,7 +1155,7 @@ void FileList::save( bool autosave ) if( item->tags ) { - QDomElement tags = domTree.createElement( "tags" ); + TQDomElement tags = domTree.createElement( "tags" ); tags.setAttribute( "artist", item->tags->artist ); tags.setAttribute( "composer", item->tags->composer ); @@ -1179,19 +1179,19 @@ void FileList::save( bool autosave ) root.appendChild( file ); } - QString filename; + TQString filename; if( autosave ) filename = locateLocal("data","soundkonverter/filelist.autosave.xml"); else filename = locateLocal("data","soundkonverter/filelist.xml"); - QFile opmlFile( filename ); + TQFile opmlFile( filename ); if( !opmlFile.open( IO_WriteOnly ) ) return; - QTextStream ts( &opmlFile ); + TQTextStream ts( &opmlFile ); ts << domTree.toString(); opmlFile.close(); - logger->log( 1000, "save file list: " + QString::number(time.elapsed()) ); + logger->log( 1000, "save file list: " + TQString::number(time.elapsed()) ); } void FileList::debug() // NOTE DEBUG @@ -1200,15 +1200,15 @@ void FileList::debug() // NOTE DEBUG ConversionOptions conversionOptions; - QStringList formats = config->allEncodableFormats(); + TQStringList formats = config->allEncodableFormats(); - for( QStringList::Iterator a = formats.begin(); a != formats.end(); ++a ) + for( TQStringList::Iterator a = formats.begin(); a != formats.end(); ++a ) { logger->log( 1000, "format: " + (*a) ); FormatItem* formatItem = config->getFormatItem( *a ); if( formatItem == 0 ) continue; - for( QValueList<ConvertPlugin*>::Iterator b = formatItem->encoders.begin(); b != formatItem->encoders.end(); ++b ) { + for( TQValueList<ConvertPlugin*>::Iterator b = formatItem->encoders.begin(); b != formatItem->encoders.end(); ++b ) { logger->log( 1000, " encoder: " + (*b)->enc.bin ); formatItem->encoder = (*b); if( (*b)->enc.strength.enabled ) { @@ -1278,11 +1278,11 @@ void FileList::debug() // NOTE DEBUG } } - for( QValueList<ConvertPlugin*>::Iterator b = formatItem->decoders.begin(); b != formatItem->decoders.end(); ++b ) { + for( TQValueList<ConvertPlugin*>::Iterator b = formatItem->decoders.begin(); b != formatItem->decoders.end(); ++b ) { formatItem->decoder = (*b); } - for( QValueList<ReplayGainPlugin*>::Iterator b = formatItem->replaygains.begin(); b != formatItem->replaygains.end(); ++b ) { + for( TQValueList<ReplayGainPlugin*>::Iterator b = formatItem->replaygains.begin(); b != formatItem->replaygains.end(); ++b ) { formatItem->replaygain = (*b); } } @@ -1290,21 +1290,21 @@ void FileList::debug() // NOTE DEBUG logger->log( 1000, "DEBUG end" ); } -QString FileList::debug_params( ConversionOptions conversionOptions, FormatItem* formatItem ) // NOTE DEBUG +TQString FileList::debug_params( ConversionOptions conversionOptions, FormatItem* formatItem ) // NOTE DEBUG { ConvertPlugin* plugin = formatItem->encoder; - QString sStrength; - QString sBitrate; - QString sQuality; - QString sMinBitrate; - QString sMaxBitrate; - QString sSamplingRate; + TQString sStrength; + TQString sBitrate; + TQString sQuality; + TQString sMinBitrate; + TQString sMaxBitrate; + TQString sSamplingRate; int t_int; float t_float; - QString param = ""; + TQString param = ""; if( !plugin->enc.param.isEmpty() ) param.append( " " + plugin->enc.param ); if( !plugin->enc.overwrite.isEmpty() ) param.append( " " + plugin->enc.overwrite ); @@ -1315,20 +1315,20 @@ QString FileList::debug_params( ConversionOptions conversionOptions, FormatItem* if( plugin->enc.strength.profiles.empty() ) { if( plugin->enc.strength.step < 1 ) { if( plugin->enc.strength.range_max >= plugin->enc.strength.range_min ) - sStrength = QString::number( compressionLevel ); + sStrength = TQString::number( compressionLevel ); else - sStrength = QString::number( plugin->enc.strength.range_min - compressionLevel ); + sStrength = TQString::number( plugin->enc.strength.range_min - compressionLevel ); } else { if( plugin->enc.strength.range_max >= plugin->enc.strength.range_min ) - sStrength = QString::number( int(compressionLevel) ); + sStrength = TQString::number( int(compressionLevel) ); else - sStrength = QString::number( int(plugin->enc.strength.range_min - compressionLevel) ); + sStrength = TQString::number( int(plugin->enc.strength.range_min - compressionLevel) ); } - if( plugin->enc.strength.separator != '.' ) sStrength.replace( QChar('.'), plugin->enc.strength.separator ); + if( plugin->enc.strength.separator != '.' ) sStrength.tqreplace( TQChar('.'), plugin->enc.strength.separator ); } else { - QStringList::Iterator it = plugin->enc.strength.profiles.at( compressionLevel ); + TQStringList::Iterator it = plugin->enc.strength.profiles.at( compressionLevel ); sStrength = *it; } } @@ -1336,16 +1336,16 @@ QString FileList::debug_params( ConversionOptions conversionOptions, FormatItem* if( conversionOptions.encodingOptions.sQualityMode == i18n("Bitrate") ) { if( conversionOptions.encodingOptions.sBitrateMode == "cbr" && plugin->enc.lossy.bitrate.cbr.enabled ) { param.append( " " + plugin->enc.lossy.bitrate.cbr.param ); - sBitrate = QString::number( conversionOptions.encodingOptions.iQuality ); + sBitrate = TQString::number( conversionOptions.encodingOptions.iQuality ); } else if( conversionOptions.encodingOptions.sBitrateMode == "abr" && plugin->enc.lossy.bitrate.abr.enabled ) { param.append( " " + plugin->enc.lossy.bitrate.abr.param ); - sBitrate = QString::number( conversionOptions.encodingOptions.iQuality ); + sBitrate = TQString::number( conversionOptions.encodingOptions.iQuality ); if( conversionOptions.encodingOptions.bBitrateRange && plugin->enc.lossy.bitrate.abr.bitrate_range.enabled ) { param.append( " " + plugin->enc.lossy.bitrate.abr.bitrate_range.param_min ); - sMinBitrate = QString::number( conversionOptions.encodingOptions.iMinBitrate ); + sMinBitrate = TQString::number( conversionOptions.encodingOptions.iMinBitrate ); param.append( " " + plugin->enc.lossy.bitrate.abr.bitrate_range.param_max ); - sMaxBitrate = QString::number( conversionOptions.encodingOptions.iMaxBitrate ); + sMaxBitrate = TQString::number( conversionOptions.encodingOptions.iMaxBitrate ); } } } @@ -1358,8 +1358,8 @@ QString FileList::debug_params( ConversionOptions conversionOptions, FormatItem* else t_float = ( (100.0f - (float)conversionOptions.encodingOptions.iQuality) * ( plugin->enc.lossy.quality.range_min - plugin->enc.lossy.quality.range_max ) / 100 ) + plugin->enc.lossy.quality.range_max; //t_float -= t_float%plugin->enc.quality.step; - //sQuality = QString().sprintf( "%.2f", t_float ); - sQuality = QString::number( t_float ); + //sQuality = TQString().sprintf( "%.2f", t_float ); + sQuality = TQString::number( t_float ); } else { if( plugin->enc.lossy.quality.range_max >= plugin->enc.lossy.quality.range_min) @@ -1367,13 +1367,13 @@ QString FileList::debug_params( ConversionOptions conversionOptions, FormatItem* else t_int = ( (100 - conversionOptions.encodingOptions.iQuality) * (int)( plugin->enc.lossy.quality.range_min - plugin->enc.lossy.quality.range_max ) / 100) + (int)plugin->enc.lossy.quality.range_max; //t_int -= t_int%plugin->enc.quality.step; - sQuality = QString::number( t_int ); + sQuality = TQString::number( t_int ); } - if( plugin->enc.bin == "oggenc" ) sQuality.replace(QChar('.'),KGlobal::locale()->decimalSymbol()); - else if( plugin->enc.lossy.quality.separator != '.' ) sQuality.replace(QChar('.'),plugin->enc.lossy.quality.separator); + if( plugin->enc.bin == "oggenc" ) sQuality.tqreplace(TQChar('.'),KGlobal::locale()->decimalSymbol()); + else if( plugin->enc.lossy.quality.separator != '.' ) sQuality.tqreplace(TQChar('.'),plugin->enc.lossy.quality.separator); } else { - QStringList::Iterator it = plugin->enc.lossy.quality.profiles.at( int(conversionOptions.encodingOptions.iQuality*plugin->enc.lossy.quality.range_max/100) ); + TQStringList::Iterator it = plugin->enc.lossy.quality.profiles.at( int(conversionOptions.encodingOptions.iQuality*plugin->enc.lossy.quality.range_max/100) ); sQuality = *it; } } @@ -1382,16 +1382,16 @@ QString FileList::debug_params( ConversionOptions conversionOptions, FormatItem* } else if( conversionOptions.encodingOptions.sQualityMode == i18n("Hybrid") && plugin->enc.hybrid.enabled ) { param.append( " " + plugin->enc.hybrid.param ); - sBitrate = QString::number( conversionOptions.encodingOptions.iQuality ); + sBitrate = TQString::number( conversionOptions.encodingOptions.iQuality ); } if( conversionOptions.encodingOptions.samplingRate.bEnabled && plugin->enc.lossy.samplingrate.enabled ) { param.append( " " + plugin->enc.lossy.samplingrate.param ); if( plugin->enc.lossy.samplingrate.unit == PluginLoaderBase::Hz ) { - sSamplingRate = QString::number( conversionOptions.encodingOptions.samplingRate.iSamplingRate ); + sSamplingRate = TQString::number( conversionOptions.encodingOptions.samplingRate.iSamplingRate ); } else { - sSamplingRate = QString::number( (float)conversionOptions.encodingOptions.samplingRate.iSamplingRate/1000 ); + sSamplingRate = TQString::number( (float)conversionOptions.encodingOptions.samplingRate.iSamplingRate/1000 ); } } @@ -1434,12 +1434,12 @@ QString FileList::debug_params( ConversionOptions conversionOptions, FormatItem* if( !plugin->enc.tag.year.isEmpty() ) param.append( " " + plugin->enc.tag.year ); } - param.replace( "%c", sStrength ); - param.replace( "%b", sBitrate ); - param.replace( "%q", sQuality ); - param.replace( "%m", sMinBitrate ); - param.replace( "%M", sMaxBitrate ); - param.replace( "%s", sSamplingRate ); + param.tqreplace( "%c", sStrength ); + param.tqreplace( "%b", sBitrate ); + param.tqreplace( "%q", sQuality ); + param.tqreplace( "%m", sMinBitrate ); + param.tqreplace( "%M", sMaxBitrate ); + param.tqreplace( "%s", sSamplingRate ); - return conversionOptions.encodingOptions.sInOutFiles.replace( "%p", param ); + return conversionOptions.encodingOptions.sInOutFiles.tqreplace( "%p", param ); } |