diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-07-01 23:15:51 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-07-01 23:15:51 +0000 |
commit | 6b1b516f42036cf9eff691dba3fd6e9eab82a7e1 (patch) | |
tree | 6830f75fd57d0fac7e33c097ee98b210e90c5239 /src/cuesheeteditor.cpp | |
parent | 6318b8bb3ef964cfa99ba454a2630779cc9ac3ec (diff) | |
download | soundkonverter-6b1b516f42036cf9eff691dba3fd6e9eab82a7e1.tar.gz soundkonverter-6b1b516f42036cf9eff691dba3fd6e9eab82a7e1.zip |
TQt4 port soundkonverter
This enables compilation under both Qt3 and Qt4
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/soundkonverter@1239038 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'src/cuesheeteditor.cpp')
-rwxr-xr-x | src/cuesheeteditor.cpp | 110 |
1 files changed, 55 insertions, 55 deletions
diff --git a/src/cuesheeteditor.cpp b/src/cuesheeteditor.cpp index 206611b..56d88cf 100755 --- a/src/cuesheeteditor.cpp +++ b/src/cuesheeteditor.cpp @@ -1,8 +1,8 @@ #include "cuesheeteditor.h" -#include <qlayout.h> -#include <qstring.h> +#include <tqlayout.h> +#include <tqstring.h> #include <klocale.h> #include <kiconloader.h> @@ -18,8 +18,8 @@ // ### soundkonverter 0.4: import/export flac cuesheet -CuesheetEditor::CuesheetEditor( QWidget *parent, const char *name, bool modal, WFlags f ) - : KDialog( parent, name, modal, f ) +CuesheetEditor::CuesheetEditor( TQWidget *tqparent, const char *name, bool modal, WFlags f ) + : KDialog( tqparent, name, modal, f ) { // TODO can the cuesheet editor be extendet by more tags (composer), etc. @@ -30,7 +30,7 @@ CuesheetEditor::CuesheetEditor( QWidget *parent, const char *name, bool modal, W resize( 600, 400 ); setIcon( iconLoader->loadIcon("kwrite",KIcon::Small) ); - QGridLayout *grid = new QGridLayout( this, 4, 1, 11, 6 ); + TQGridLayout *grid = new TQGridLayout( this, 4, 1, 11, 6 ); tTextEdit = new KTextEdit( this, "tTextEdit" ); tTextEdit->setFocus(); @@ -64,31 +64,31 @@ CuesheetEditor::CuesheetEditor( QWidget *parent, const char *name, bool modal, W } */ - QHBoxLayout *buttonBox = new QHBoxLayout(); + TQHBoxLayout *buttonBox = new TQHBoxLayout(); grid->addLayout( buttonBox, 3, 0 ); pHelp = new KPushButton( iconLoader->loadIcon("help",KIcon::Small), "", this, "pHelp" ); buttonBox->addWidget( pHelp ); - connect( pHelp, SIGNAL(clicked()), - this, SLOT(help()) + connect( pHelp, TQT_SIGNAL(clicked()), + this, TQT_SLOT(help()) ); pGenerate = new KPushButton( iconLoader->loadIcon("filenew",KIcon::Small), i18n("Generate"), this, "pGenerate" ); buttonBox->addWidget( pGenerate ); - connect( pGenerate, SIGNAL(clicked()), - this, SLOT(generate()) + connect( pGenerate, TQT_SIGNAL(clicked()), + this, TQT_SLOT(generate()) ); pConvert = new KPushButton( iconLoader->loadIcon("run",KIcon::Small), i18n("Format"), this, "pConvert" ); buttonBox->addWidget( pConvert ); - connect( pConvert, SIGNAL(clicked()), - this, SLOT(convert()) + connect( pConvert, TQT_SIGNAL(clicked()), + this, TQT_SLOT(convert()) ); pShift = new KPushButton( iconLoader->loadIcon("reload",KIcon::Small), i18n("Shift Title/Performer"), this, "pShift" ); buttonBox->addWidget( pShift ); - connect( pShift, SIGNAL(clicked()), - this, SLOT(shift()) + connect( pShift, TQT_SIGNAL(clicked()), + this, TQT_SLOT(shift()) ); buttonBox->addStretch(); @@ -96,8 +96,8 @@ CuesheetEditor::CuesheetEditor( QWidget *parent, const char *name, bool modal, W pOk = new KPushButton(iconLoader->loadIcon("exit",KIcon::Small), i18n("Close"), this, "pOk" ); pOk->setFocus(); buttonBox->addWidget( pOk ); - connect( pOk, SIGNAL(clicked()), - this, SLOT(accept()) + connect( pOk, TQT_SIGNAL(clicked()), + this, TQT_SLOT(accept()) ); // delete the icon loader object @@ -116,27 +116,27 @@ void CuesheetEditor::help() void CuesheetEditor::generate() { - QString text = tTextEdit->text(); - QString newText; - QStringList titleList, performerList; - QValueList<int> timeList; - QString time; + TQString text = tTextEdit->text(); + TQString newText; + TQStringList titleList, performerList; + TQValueList<int> timeList; + TQString time; int min, sec; int index; while( index != -1 ) { - index = text.find( " - " ); + index = text.tqfind( " - " ); if( index == -1 ) break; titleList.append( text.left(index) ); text.remove( 0, index + 3 ); - index=text.find( " [" ); + index=text.tqfind( " [" ); if( index == -1 ) break; performerList.append( text.left(index) ); text.remove( 0, index + 2 ); - index = text.find( "]" ); + index = text.tqfind( "]" ); if( index == -1 ) break; time = text.left( index ); @@ -152,20 +152,20 @@ void CuesheetEditor::generate() int TRACK = 1; int INDEX = 0; bool addFrames = false; - QStringList::Iterator performerIt = performerList.begin(); - QValueList<int>::Iterator timeIt = timeList.begin(); - for( QStringList::Iterator titleIt = titleList.begin(); titleIt != titleList.end(); ++titleIt ) + TQStringList::Iterator performerIt = performerList.begin(); + TQValueList<int>::Iterator timeIt = timeList.begin(); + for( TQStringList::Iterator titleIt = titleList.begin(); titleIt != titleList.end(); ++titleIt ) { - newText.append( QString().sprintf(" TRACK %02i AUDIO\n",TRACK ) ); + newText.append( TQString().sprintf(" TRACK %02i AUDIO\n",TRACK ) ); newText.append( " TITLE \"" + (*titleIt) + "\"\n" ); newText.append( " PERFORMER \"" + (*performerIt) + "\"\n" ); if( addFrames ) { - newText.append( QString().sprintf(" INDEX 01 %02i:%02i:37\n",INDEX/60,INDEX%60) ); + newText.append( TQString().sprintf(" INDEX 01 %02i:%02i:37\n",INDEX/60,INDEX%60) ); INDEX++; addFrames = false; } else { - newText.append( QString().sprintf(" INDEX 01 %02i:%02i:00\n",INDEX/60,INDEX%60) ); + newText.append( TQString().sprintf(" INDEX 01 %02i:%02i:00\n",INDEX/60,INDEX%60) ); addFrames = true; } @@ -180,21 +180,21 @@ void CuesheetEditor::generate() void CuesheetEditor::convert() { - QString text=tTextEdit->text(); - QString newText; - QString tmpText; - QString first, rest; - QStringList splinters; + TQString text=tTextEdit->text(); + TQString newText; + TQString tmpText; + TQString first, rest; + TQStringList splinters; int index; while( index!=-1 ) { - index=text.find("\""); + index=text.tqfind("\""); if( index==-1 ) break; newText+=text.left(index+1); text.remove(0,index+1); - index=text.find("\""); + index=text.tqfind("\""); tmpText=text.left(index+1); text.remove(0,index+1); if( newText.right(6) == "FILE \"" ) @@ -202,8 +202,8 @@ void CuesheetEditor::convert() newText+=tmpText; continue; } - splinters=QStringList::split(' ',tmpText); - for( QStringList::Iterator it=splinters.begin(); it!=splinters.end(); ++it ) + splinters=TQStringList::split(' ',tmpText); + for( TQStringList::Iterator it=splinters.begin(); it!=splinters.end(); ++it ) { for( uint i=0; i<(*it).length(); i++ ) { @@ -249,26 +249,26 @@ void CuesheetEditor::convert() void CuesheetEditor::shift() //move the title to "PERFORMER" and performer to "TITLE" { - QString text = tTextEdit->text(); - QString newText; - QString line, title="", performer=""; + TQString text = tTextEdit->text(); + TQString newText; + TQString line, title="", performer=""; int index; while( index !=- 1 ) { - index = text.find("\n"); + index = text.tqfind("\n"); if( index == -1 ) break; line = text.left(index+1); text.remove(0,index+1); // TODO clean up - if( line.find( "TITLE" ) != -1 ) { - line.replace( "TITLE", "PERFORMER" ); + if( line.tqfind( "TITLE" ) != -1 ) { + line.tqreplace( "TITLE", "PERFORMER" ); if( performer != "" ) newText += performer; performer=line; } - else if( line.find( "PERFORMER" ) != -1 ) { - line.replace( "PERFORMER", "TITLE" ); + else if( line.tqfind( "PERFORMER" ) != -1 ) { + line.tqreplace( "PERFORMER", "TITLE" ); if( title != "" ) newText += title; title = line; } @@ -295,24 +295,24 @@ void CuesheetEditor::shift() //move the title to "PERFORMER" and performer to "T /* void CuesheetEditor::shift() //replace title by performer and reverse { - QString text=tTextEdit->text(); - QString newText; - QString line, title, performer; + TQString text=tTextEdit->text(); + TQString newText; + TQString line, title, performer; int index; while( index!=-1 ) { - index=text.find("\n"); + index=text.tqfind("\n"); if( index==-1 ) break; line=text.left(index+1); text.remove(0,index+1); - if( line.find(" TITLE \"") != -1 ) { - line.replace(" TITLE \""," PERFORMER \""); + if( line.tqfind(" TITLE \"") != -1 ) { + line.tqreplace(" TITLE \""," PERFORMER \""); newText+=line; } - else if( line.find(" PERFORMER \"") != -1 ) { - line.replace(" PERFORMER \""," TITLE \""); + else if( line.tqfind(" PERFORMER \"") != -1 ) { + line.tqreplace(" PERFORMER \""," TITLE \""); newText+=line; } else { |