diff options
68 files changed, 1997 insertions, 2052 deletions
diff --git a/krename/ProgressDialog.cpp b/krename/ProgressDialog.cpp index 81723b5..91110e6 100644 --- a/krename/ProgressDialog.cpp +++ b/krename/ProgressDialog.cpp @@ -16,14 +16,10 @@ ***************************************************************************/ // QT Includes -#include <qlayout.h> -#include <qprogressbar.h> -#include <qtimer.h> -#include <qtooltip.h> - -#if QT_VERSION < 0x030100 - #include <qregexp.h> -#endif +#include <tqlayout.h> +#include <tqprogressbar.h> +#include <tqtimer.h> +#include <tqtooltip.h> // KDE includes #include <kapplication.h> @@ -34,7 +30,7 @@ #include <kpushbutton.h> #include <krun.h> -#include <qfile.h> +#include <tqfile.h> // Own includes #include "ProgressDialog.h" @@ -48,8 +44,8 @@ // update user interface every 1/2 second #define TIMER_INTERVAL 500 -ProgressDialog::ProgressDialog( QWidget* parent, const char* name, WFlags fl ) - : QWidget( parent, name, fl ) +ProgressDialog::ProgressDialog( TQWidget* tqparent, const char* name, WFlags fl ) + : TQWidget( tqparent, name, fl ) { renamedFiles = NULL; @@ -57,11 +53,11 @@ ProgressDialog::ProgressDialog( QWidget* parent, const char* name, WFlags fl ) setCaption( i18n("Progress") ); setIcon( BarIcon( "krename" ) ); - ProgressDialogLayout = new QVBoxLayout( this, 11, 6 ); - Layout1 = new QHBoxLayout( 0, 0, 6 ); - QHBoxLayout* Layout2 = new QHBoxLayout( 0, 6, 6 ); + ProgressDialogLayout = new TQVBoxLayout( this, 11, 6 ); + Layout1 = new TQHBoxLayout( 0, 0, 6 ); + TQHBoxLayout* Layout2 = new TQHBoxLayout( 0, 6, 6 ); - bar = new QProgressBar( this ); + bar = new TQProgressBar( this ); bar->setProgress( 0 ); buttonCancel = new KPushButton( i18n("&Cancel"), this ); @@ -69,24 +65,24 @@ ProgressDialog::ProgressDialog( QWidget* parent, const char* name, WFlags fl ) display = new KListView( this ); display->addColumn( i18n("Messages") ); display->addColumn( "sort" ); - display->setColumnWidthMode( 0, QListView::Maximum ); - display->setColumnWidthMode( 1, QListView::Manual ); + display->setColumnWidthMode( 0, TQListView::Maximum ); + display->setColumnWidthMode( 1, TQListView::Manual ); display->setColumnWidth( 1, 0 ); display->setSorting( -1 ); display->setUpdatesEnabled( false ); - QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Minimum, QSizePolicy::Minimum ); + TQSpacerItem* spacer = new TQSpacerItem( 20, 20, TQSizePolicy::Minimum, TQSizePolicy::Minimum ); buttonUndo = new KPushButton( this ); buttonUndo->setText( i18n("&Undo") ); buttonUndo->setEnabled( false ); mnuButton = new KPopupMenu( this ); - mnuButton->insertItem( i18n("Restart KRename..."), this, SLOT( restart() )); + mnuButton->insertItem( i18n("Restart KRename..."), this, TQT_SLOT( restart() )); mnuButton->insertSeparator(); - mnuButton->insertItem( i18n("Rename Processed Files &Again..."), this, SLOT( again() ), 0, MNU_DONE_ID ); - mnuButton->insertItem( i18n("Rename Unprocessed Files &Again..."), this, SLOT( unAgain() ), 0, MNU_ERROR_ID ); - mnuButton->insertItem( i18n("Rename All Files &Again..."), this, SLOT( allAgain() )); + mnuButton->insertItem( i18n("Rename Processed Files &Again..."), this, TQT_SLOT( again() ), 0, MNU_DONE_ID ); + mnuButton->insertItem( i18n("Rename Unprocessed Files &Again..."), this, TQT_SLOT( unAgain() ), 0, MNU_ERROR_ID ); + mnuButton->insertItem( i18n("Rename All Files &Again..."), this, TQT_SLOT( allAgain() )); buttonRestart = new KPushButton( this ); buttonRestart->setText( i18n( "&Rename More..." ) ); buttonRestart->setPopup( mnuButton ); @@ -114,15 +110,15 @@ ProgressDialog::ProgressDialog( QWidget* parent, const char* name, WFlags fl ) ProgressDialogLayout->addWidget( display ); ProgressDialogLayout->addLayout( Layout1 ); - connect( buttonClose, SIGNAL(clicked()), this, SLOT(quitAll())); - connect( buttonOpenDest, SIGNAL(clicked()), this, SLOT(openDest())); - connect( buttonCancel, SIGNAL( clicked()), this, SLOT(canceled() )); - connect( buttonUndo, SIGNAL( clicked() ), this, SLOT( undo() ) ); + connect( buttonClose, TQT_SIGNAL(clicked()), this, TQT_SLOT(quitAll())); + connect( buttonOpenDest, TQT_SIGNAL(clicked()), this, TQT_SLOT(openDest())); + connect( buttonCancel, TQT_SIGNAL( clicked()), this, TQT_SLOT(canceled() )); + connect( buttonUndo, TQT_SIGNAL( clicked() ), this, TQT_SLOT( undo() ) ); m_count = 0; m_canceled = false; - m_timer = new QTimer( this, "m_timer" ); - connect( m_timer, SIGNAL( timeout() ), this, SLOT( slotTimer() ) ); + m_timer = new TQTimer( this, "m_timer" ); + connect( m_timer, TQT_SIGNAL( timeout() ), this, TQT_SLOT( slotTimer() ) ); hide(); } @@ -135,11 +131,11 @@ ProgressDialog::~ProgressDialog() delete [] renamedFiles; } -void ProgressDialog::print( QString text, QString pixmap ) +void ProgressDialog::print( TQString text, TQString pixmap ) { if( !m_timer->isActive() ) { - KApplication::setOverrideCursor( Qt::waitCursor ); + KApplication::setOverrideCursor( TQt::waitCursor ); m_timer->start( TIMER_INTERVAL ); } @@ -152,29 +148,29 @@ void ProgressDialog::print( QString text, QString pixmap ) display->insertItem( item ); } -void ProgressDialog::error( QString text ) +void ProgressDialog::error( TQString text ) { if( !m_timer->isActive() ) { - KApplication::setOverrideCursor( Qt::waitCursor ); + KApplication::setOverrideCursor( TQt::waitCursor ); m_timer->start( TIMER_INTERVAL ); } //TODO: simplify this (breaks i18n) - KListViewItem* item = new KListViewItem( display, QString( i18n("Error: %1") ).arg( QString::null ) + simplify( text ), count() ); + KListViewItem* item = new KListViewItem( display, TQString( i18n("Error: %1") ).tqarg( TQString() ) + simplify( text ), count() ); item->setPixmap( 0, SmallIcon("cancel") ); display->insertItem( item ); } -void ProgressDialog::warning( QString text ) +void ProgressDialog::warning( TQString text ) { if( !m_timer->isActive() ) { - KApplication::setOverrideCursor( Qt::waitCursor ); + KApplication::setOverrideCursor( TQt::waitCursor ); m_timer->start( TIMER_INTERVAL ); } - KListViewItem* item = new KListViewItem( display, QString( i18n("Warning: %1") ).arg( QString::null ) + simplify( text ), count() ); + KListViewItem* item = new KListViewItem( display, TQString( i18n("Warning: %1") ).tqarg( TQString() ) + simplify( text ), count() ); item->setPixmap( 0, SmallIcon("idea") ); display->insertItem( item ); } @@ -211,7 +207,7 @@ void ProgressDialog::done( int errors, int successfull, bool allowundo ) void ProgressDialog::show() { - QWidget::show(); + TQWidget::show(); int w = kapp->desktop()->width(); int h = kapp->desktop()->height(); @@ -220,7 +216,7 @@ void ProgressDialog::show() void ProgressDialog::restart() { - QWidget* krename = KRenameImpl::launch( QRect( 0, 0, 0, 0 ), KURL::List() ); + TQWidget* krename = KRenameImpl::launch( TQRect( 0, 0, 0, 0 ), KURL::List() ); krename->show(); close(); } @@ -232,7 +228,7 @@ void ProgressDialog::again() if( !renamedFiles[i].error ) list.append( renamedFiles[i].dst ); - QWidget* krename = KRenameImpl::launch( QRect( 0, 0, 0, 0 ), list ); + TQWidget* krename = KRenameImpl::launch( TQRect( 0, 0, 0, 0 ), list ); krename->show(); close(); } @@ -244,7 +240,7 @@ void ProgressDialog::unAgain() if( renamedFiles[i].error ) list.append( renamedFiles[i].src ); - QWidget* krename = KRenameImpl::launch( QRect( 0, 0, 0, 0 ), list ); + TQWidget* krename = KRenameImpl::launch( TQRect( 0, 0, 0, 0 ), list ); krename->show(); close(); } @@ -255,7 +251,7 @@ void ProgressDialog::allAgain() for( unsigned int i = 0; i < m_size; i++ ) list.append( renamedFiles[i].error ? renamedFiles[i].src : renamedFiles[i].dst ); - QWidget* krename = KRenameImpl::launch( QRect( 0, 0, 0, 0 ), list ); + TQWidget* krename = KRenameImpl::launch( TQRect( 0, 0, 0, 0 ), list ); krename->show(); close(); } @@ -265,9 +261,9 @@ void ProgressDialog::openDest() new KRun( m_dest ); } -QString ProgressDialog::count() +TQString ProgressDialog::count() { - QString s; + TQString s; return s.sprintf( "%0*i", 7, ++m_count ); } @@ -290,15 +286,11 @@ void ProgressDialog::canceled() m_canceled = true; } -const QString ProgressDialog::simplify( const QString & text ) +const TQString ProgressDialog::simplify( const TQString & text ) { // make error messages fit in one line! - QString t( text ); -#if QT_VERSION >= 0x030100 + TQString t( text ); t.remove( '\n' ); -#else - t.replace( QRegExp("\n"), "" ); -#endif return t; } @@ -309,7 +301,7 @@ void ProgressDialog::undo() FileOperation fop; m_timer->start( TIMER_INTERVAL ); - KApplication::setOverrideCursor( Qt::waitCursor ); + KApplication::setOverrideCursor( TQt::waitCursor ); for( unsigned int i = 0; i < m_size; i++ ) { setProgress( i ); @@ -319,11 +311,11 @@ void ProgressDialog::undo() if( renamedFiles[i].dir ) { /** handle renamed directories and their contents */ - QString ddir = renamedFiles[i].dst.path(); - QString sdir = renamedFiles[i].src.path(); + TQString ddir = renamedFiles[i].dst.path(); + TQString sdir = renamedFiles[i].src.path(); for( unsigned int c = i+1; c < m_size; c++ ) { - QString dpath = renamedFiles[c].dst.path(); - QString spath = renamedFiles[c].src.path(); + TQString dpath = renamedFiles[c].dst.path(); + TQString spath = renamedFiles[c].src.path(); if( spath.startsWith( ddir ) ) { @@ -349,7 +341,7 @@ void ProgressDialog::undo() m_timer->stop(); KApplication::restoreOverrideCursor(); - QWidget* krename = KRenameImpl::launch( QRect( 0, 0, 0, 0 ), list ); + TQWidget* krename = KRenameImpl::launch( TQRect( 0, 0, 0, 0 ), list ); krename->show(); close(); } diff --git a/krename/ProgressDialog.h b/krename/ProgressDialog.h index 0bbab51..2b467b0 100644 --- a/krename/ProgressDialog.h +++ b/krename/ProgressDialog.h @@ -18,7 +18,7 @@ #ifndef PROGRESSDIALOG_H #define PROGRESSDIALOG_H -#include <qwidget.h> +#include <tqwidget.h> #include <kurl.h> typedef struct RenamedList @@ -34,18 +34,19 @@ class KRenameImpl; class KListView; class KPopupMenu; class KPushButton; -class QProgressBar; -class QStringList; -class QStrList; -class QString; -class QTimer; -class QHBoxLayout; -class QVBoxLayout; -class ProgressDialog : public QWidget +class TQProgressBar; +class TQStringList; +class TQStrList; +class TQString; +class TQTimer; +class TQHBoxLayout; +class TQVBoxLayout; +class ProgressDialog : public TQWidget { Q_OBJECT + TQ_OBJECT public: - ProgressDialog( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); + ProgressDialog( TQWidget* tqparent = 0, const char* name = 0, WFlags fl = 0 ); ~ProgressDialog(); void setProgressTotalSteps( int t ); @@ -57,9 +58,9 @@ class ProgressDialog : public QWidget inline void setCreatedDirectories( const KURL::List & list ); void done( int errors, int successfull, bool allowundo ); - void print( QString text, QString pixmap = 0 ); - void error( QString text ); - void warning( QString text ); + void print( TQString text, TQString pixmap = 0 ); + void error( TQString text ); + void warning( TQString text ); public slots: void show(); @@ -76,8 +77,8 @@ class ProgressDialog : public QWidget void slotTimer(); private: - QString count(); - const QString simplify( const QString & text ); + TQString count(); + const TQString simplify( const TQString & text ); protected: RenamedList* renamedFiles; @@ -88,7 +89,7 @@ class ProgressDialog : public QWidget bool m_canceled; KURL::List m_created; - QTimer* m_timer; + TQTimer* m_timer; KListView* display; KPushButton* buttonClose; @@ -98,10 +99,10 @@ class ProgressDialog : public QWidget KPushButton* buttonCancel; KPopupMenu* mnuButton; - QProgressBar* bar; + TQProgressBar* bar; - QVBoxLayout* ProgressDialogLayout; - QHBoxLayout* Layout1; + TQVBoxLayout* ProgressDialogLayout; + TQHBoxLayout* Layout1; }; diff --git a/krename/batchrenamer.cpp b/krename/batchrenamer.cpp index 89721e0..cf2941e 100644 --- a/krename/batchrenamer.cpp +++ b/krename/batchrenamer.cpp @@ -33,8 +33,8 @@ #include <sys/stat.h> // QT includes -#include <qdir.h> -#include <qregexp.h> +#include <tqdir.h> +#include <tqregexp.h> // KDE includes #include <kapplication.h> @@ -62,7 +62,7 @@ BatchRenamer::~BatchRenamer() { } -void BatchRenamer::processFiles( ProgressDialog* p, QObject* object ) +void BatchRenamer::processFiles( ProgressDialog* p, TQObject* object ) { delete object; t.start(); @@ -76,7 +76,7 @@ void BatchRenamer::processFiles( ProgressDialog* p, QObject* object ) if( m_mode == RENAME ) {// final Path = source Path m_files[i].dst.directory = m_files[i].src.directory; m_files[i].dst.url = m_files[i].src.url; - m_files[i].dst.url.setFileName( QString::null ); + m_files[i].dst.url.setFileName( TQString() ); } else { m_files[i].dst.directory = dirname.path(); m_files[i].dst.url = dirname; @@ -118,19 +118,19 @@ void BatchRenamer::processFiles( ProgressDialog* p, QObject* object ) if( m_files[c].src.directory.left( m_files[i].src.name.length() + 1 ) == ( m_files[i].src.name + "/" ) ) { - m_files[c].src.directory.replace( 0, m_files[i].src.name.length(), m_files[i].dst.name ); + m_files[c].src.directory.tqreplace( 0, m_files[i].src.name.length(), m_files[i].dst.name ); m_files[c].src.url.setPath( BatchRenamer::buildFilename( &m_files[c].src, true ) ); } } } } - p->print( QString( i18n("Filenames Processed after %1 seconds.")).arg(t.elapsed()/1000) ); + p->print( TQString( i18n("Filenames Processed after %1 seconds.")).tqarg(t.elapsed()/1000) ); work( p ); } -QString BatchRenamer::processString( QString text, QString oldname, int i ) +TQString BatchRenamer::processString( TQString text, TQString oldname, int i ) { /* * Come on! Grep for this text and help me! @@ -140,7 +140,7 @@ QString BatchRenamer::processString( QString text, QString oldname, int i ) * * Krename will have problems with files * which contain one of the following - * unicode characters: 60000, 60001, 60002 + * tqunicode characters: 60000, 60001, 60002 * 60003, 60004, 60005, 60006. * * This is not a good solution, if you have a @@ -180,10 +180,10 @@ QString BatchRenamer::processString( QString text, QString oldname, int i ) return text; } -QString BatchRenamer::parsePlugins( int i, const QString& text, int type ) +TQString BatchRenamer::parsePlugins( int i, const TQString& text, int type ) { - QPtrListIterator<PluginLoader::PluginLibrary> it( plug->libs ); - QString ret = text; + TQPtrListIterator<PluginLoader::PluginLibrary> it( plug->libs ); + TQString ret = text; if( type == TYPE_FINAL_FILE ) ret = ""; @@ -198,10 +198,10 @@ QString BatchRenamer::parsePlugins( int i, const QString& text, int type ) return ret; } -void BatchRenamer::createPreview( QListView* list ) +void BatchRenamer::createPreview( TQListView* list ) { KMyListViewItem* item1 = NULL; - QString tmp; + TQString tmp; m_counters.clear(); for( unsigned int i = 0; i < m_files.count(); i++) @@ -218,12 +218,12 @@ void BatchRenamer::createPreview( QListView* list ) bool modified = applyManualChanges( i ); - QString sname = BatchRenamer::buildFilename( &m_files[i].src, false ); + TQString sname = BatchRenamer::buildFilename( &m_files[i].src, false ); // Let's run the plugins that change the final filename, // i.e the encodingsplugin m_files[i].dst.name = parsePlugins( i, m_files[i].dst.name, TYPE_FINAL_FILENAME ); - QString dname = BatchRenamer::buildFilename( &m_files[i].dst, false ); + TQString dname = BatchRenamer::buildFilename( &m_files[i].dst, false ); item1 = new KMyListViewItem( modified, list, item1, sname, dname ); } @@ -234,14 +234,14 @@ void BatchRenamer::work( ProgressDialog* p ) // TODO: use CopyJob here FileOperation fop; - QFile* fundo ( NULL ); - QTextStream* tundo ( NULL ); + TQFile* fundo ( NULL ); + TQTextStream* tundo ( NULL ); if( undo ) { // Create header for undo script - fundo = new QFile( m_undoScript ); + fundo = new TQFile( m_undoScript ); if( fundo->open( IO_WriteOnly ) ) { - tundo = new QTextStream( fundo ); + tundo = new TQTextStream( fundo ); writeUndoScript( tundo ); } else { undo = false; @@ -258,11 +258,11 @@ void BatchRenamer::work( ProgressDialog* p ) * Give the user some information... */ if( m_mode == COPY) - p->print( QString( i18n("Files will be copied to: %1") ).arg(m_files[0].dst.directory) ); + p->print( TQString( i18n("Files will be copied to: %1") ).tqarg(m_files[0].dst.directory) ); else if( m_mode == MOVE ) - p->print( QString( i18n("Files will be moved to: %1") ).arg(m_files[0].dst.directory) ); + p->print( TQString( i18n("Files will be moved to: %1") ).tqarg(m_files[0].dst.directory) ); else if( m_mode == LINK ) - p->print( QString( i18n("Symbolic links will be created in: %1") ).arg(m_files[0].dst.directory) ); + p->print( TQString( i18n("Symbolic links will be created in: %1") ).tqarg(m_files[0].dst.directory) ); else if( m_mode == RENAME ) p->print( i18n("Input files will be renamed.") ); @@ -302,7 +302,7 @@ void BatchRenamer::work( ProgressDialog* p ) * The plugin should return an error message in this case! */ - QString eplug = parsePlugins( i, QString::null, TYPE_FINAL_FILE ); + TQString eplug = parsePlugins( i, TQString(), TYPE_FINAL_FILE ); if( !eplug.isEmpty() ) { p->error( eplug ); error++; @@ -317,25 +317,25 @@ void BatchRenamer::work( ProgressDialog* p ) (*tundo) << "mv --force -b --suffix=.krename_ \"" << m_files[i].dst.name << "\" \"" << m_files[i].src.name << "\"" << endl; } else - p->warning( QString( i18n("Undo is not possible for remote file: %1") ).arg( dst.prettyURL() ) ); + p->warning( TQString( i18n("Undo is not possible for remote file: %1") ).tqarg( dst.prettyURL() ) ); } if( !p->wasCancelled() ) { - QPtrListIterator<PluginLoader::PluginLibrary> it( plug->libs ); + TQPtrListIterator<PluginLoader::PluginLibrary> it( plug->libs ); for( ; it.current(); ++it ) { if( (*it)->usePlugin ) (*it)->plugin->finished(); } } - const QString m = QString( i18n("Renamed %1 files successfully.") ).arg(i-error); + const TQString m = TQString( i18n("Renamed %1 files successfully.") ).tqarg(i-error); ( i - error ) ? p->print( m ) : p->warning( m ); if( error > 0 ) - p->warning( QString( i18n("%2 errors occurred!") ).arg(error)); + p->warning( TQString( i18n("%2 errors occurred!") ).tqarg(error)); - p->print( QString( i18n("Elapsed time: %1 seconds") ).arg( t.elapsed()/1000 ), "kalarm" ); + p->print( TQString( i18n("Elapsed time: %1 seconds") ).tqarg( t.elapsed()/1000 ), "kalarm" ); p->print( i18n("KRename finished the renaming process."), "krename" ); p->print( i18n("Press close to quit!") ); p->setRenamedFiles( renamedFiles, m_files.count() ); @@ -356,105 +356,81 @@ void BatchRenamer::work( ProgressDialog* p ) delete this; } -void BatchRenamer::escape( QString & text, const QString & token, const QString & sequence ) +void BatchRenamer::escape( TQString & text, const TQString & token, const TQString & sequence ) { - /* - * NEVER, ABSOLUTELY NEVER change pos = 0 - * to pos = -1, it won't work ! - * This bug took hours to find and was - * a serious bug in 1.7. - */ -#if QT_VERSION >= 0x030100 - text.replace( token, sequence ); -#else - int pos = 0; - do { - pos = text.find( token, pos ); - if( pos >= 0 ) - text.replace( pos, token.length(), sequence ); - } while ( pos >= 0 ); -#endif + text.tqreplace( token, sequence ); } -QString & BatchRenamer::doEscape( QString & text, bool filename ) +TQString & BatchRenamer::doEscape( TQString text, bool filename ) { if( filename ) { - BatchRenamer::escape( text, "&", QChar( 60000 ) ); - BatchRenamer::escape( text, "$", QChar( 60001 ) ); - BatchRenamer::escape( text, "%", QChar( 60002 ) ); - BatchRenamer::escape( text, "#", QChar( 60004 ) ); - BatchRenamer::escape( text, "[", QChar( 60005 ) ); - BatchRenamer::escape( text, "]", QChar( 60006 ) ); - BatchRenamer::escape( text, "\\", QChar( 60007 ) ); - BatchRenamer::escape( text, "/", QChar( 60008 ) ); - BatchRenamer::escape( text, "{", QChar( 60009 ) ); - BatchRenamer::escape( text, "}", QChar( 60010 ) ); - BatchRenamer::escape( text, "*", QChar( 60011 ) ); + BatchRenamer::escape( text, "&", TQChar( 60000 ) ); + BatchRenamer::escape( text, "$", TQChar( 60001 ) ); + BatchRenamer::escape( text, "%", TQChar( 60002 ) ); + BatchRenamer::escape( text, "#", TQChar( 60004 ) ); + BatchRenamer::escape( text, "[", TQChar( 60005 ) ); + BatchRenamer::escape( text, "]", TQChar( 60006 ) ); + BatchRenamer::escape( text, "\\", TQChar( 60007 ) ); + BatchRenamer::escape( text, "/", TQChar( 60008 ) ); + BatchRenamer::escape( text, "{", TQChar( 60009 ) ); + BatchRenamer::escape( text, "}", TQChar( 60010 ) ); + BatchRenamer::escape( text, "*", TQChar( 60011 ) ); } else { - BatchRenamer::escape( text, "\\&", QChar( 60000 ) ); - BatchRenamer::escape( text, "\\$", QChar( 60001 ) ); - BatchRenamer::escape( text, "\\%", QChar( 60002 ) ); - BatchRenamer::escape( text, "\\#", QChar( 60004 ) ); - BatchRenamer::escape( text, "\\[", QChar( 60005 ) ); - BatchRenamer::escape( text, "\\]", QChar( 60006 ) ); - BatchRenamer::escape( text, "\\\\", QChar( 60007 ) ); - BatchRenamer::escape( text, "\\/", QChar( 60008 ) ); - BatchRenamer::escape( text, "\\{", QChar( 60009 ) ); - BatchRenamer::escape( text, "\\}", QChar( 60010 ) ); - BatchRenamer::escape( text, "\\*", QChar( 60011 ) ); + BatchRenamer::escape( text, "\\&", TQChar( 60000 ) ); + BatchRenamer::escape( text, "\\$", TQChar( 60001 ) ); + BatchRenamer::escape( text, "\\%", TQChar( 60002 ) ); + BatchRenamer::escape( text, "\\#", TQChar( 60004 ) ); + BatchRenamer::escape( text, "\\[", TQChar( 60005 ) ); + BatchRenamer::escape( text, "\\]", TQChar( 60006 ) ); + BatchRenamer::escape( text, "\\\\", TQChar( 60007 ) ); + BatchRenamer::escape( text, "\\/", TQChar( 60008 ) ); + BatchRenamer::escape( text, "\\{", TQChar( 60009 ) ); + BatchRenamer::escape( text, "\\}", TQChar( 60010 ) ); + BatchRenamer::escape( text, "\\*", TQChar( 60011 ) ); } return text; } -QString & BatchRenamer::unEscape( QString & text ) +TQString & BatchRenamer::unEscape( TQString & text ) { - BatchRenamer::escape( text, QChar( 60000 ), "&" ); - BatchRenamer::escape( text, QChar( 60001 ), "$" ); - BatchRenamer::escape( text, QChar( 60002 ), "%" ); - BatchRenamer::escape( text, QChar( 60004 ), "#" ); - BatchRenamer::escape( text, QChar( 60005 ), "[" ); - BatchRenamer::escape( text, QChar( 60006 ), "]" ); - BatchRenamer::escape( text, QChar( 60007 ), "\\" ); + BatchRenamer::escape( text, TQChar( 60000 ), "&" ); + BatchRenamer::escape( text, TQChar( 60001 ), "$" ); + BatchRenamer::escape( text, TQChar( 60002 ), "%" ); + BatchRenamer::escape( text, TQChar( 60004 ), "#" ); + BatchRenamer::escape( text, TQChar( 60005 ), "[" ); + BatchRenamer::escape( text, TQChar( 60006 ), "]" ); + BatchRenamer::escape( text, TQChar( 60007 ), "\\" ); // %252f == /, it seems that filenames on unix cannot contain // a /. So I use %252f, at least konqui displays it correctly // this was needed, so that plugins that return a slash do not cause errors - BatchRenamer::escape( text, QChar( 60008 ), "%2f" ); - BatchRenamer::escape( text, QChar( 60009 ), "{" ); - BatchRenamer::escape( text, QChar( 60010 ), "}" ); - BatchRenamer::escape( text, QChar( 60011 ), "*" ); + BatchRenamer::escape( text, TQChar( 60008 ), "%2f" ); + BatchRenamer::escape( text, TQChar( 60009 ), "{" ); + BatchRenamer::escape( text, TQChar( 60010 ), "}" ); + BatchRenamer::escape( text, TQChar( 60011 ), "*" ); return text; } int BatchRenamer::getCharacters( int n ) { - QString s; + TQString s; s.sprintf( "%i", n ); return s.length(); } -QString BatchRenamer::findAndProcess( const QString & token, QString text, const QString & replace ) +TQString BatchRenamer::findAndProcess( const TQString & token, TQString text, const TQString & tqreplace ) { /* * pos can here be -1 because - * findRev is called with it as a + * tqfindRev is called with it as a * value ! */ -#if QT_VERSION >= 0x030100 - text.replace( token, replace ); -#else - int pos = -1; - do { - pos = text.findRev( token, pos ); - if( pos >= 0 ) - text.replace( pos, token.length(), replace ); - } while( pos >= 0 ); -#endif + text.tqreplace( token, tqreplace ); return text; } -QString BatchRenamer::findNumbers( QString text, int count, int i ) +TQString BatchRenamer::findNumbers( TQString text, int count, int i ) { // Rewritten in Version 0.8 // Added numbers skipping in 1.3 @@ -464,10 +440,10 @@ QString BatchRenamer::findNumbers( QString text, int count, int i ) countervalues.start = m_index; countervalues.step = m_step; - if( text.contains( "#", FALSE ) <= 0 ) + if( text.tqcontains( "#", FALSE ) <= 0 ) return text; - pos = text.find("#", pos); + pos = text.tqfind("#", pos); pos++; while( text[pos] == '#' ) { text.remove(pos, 1); @@ -476,7 +452,7 @@ QString BatchRenamer::findNumbers( QString text, int count, int i ) findNumberAppendix( text, pos, &countervalues.start, &countervalues.step ); - pos = text.find("#", 0); + pos = text.tqfind("#", 0); if( (signed int)m_counters.count() <= m_counter_index ) { @@ -488,7 +464,7 @@ QString BatchRenamer::findNumbers( QString text, int count, int i ) do { m_counters[m_counter_index].value += m_counters[m_counter_index].step; - } while( m_skip.contains( m_counters[m_counter_index].value ) ); + } while( m_skip.tqcontains( m_counters[m_counter_index].value ) ); /* int v = start + (i*step) + m_skip_add[m_counter_index]; @@ -500,22 +476,22 @@ QString BatchRenamer::findNumbers( QString text, int count, int i ) } */ - QString temp; + TQString temp; temp.sprintf("%0*i", counter, m_counters[m_counter_index].value ); - text.replace( pos, 1, temp); + text.tqreplace( pos, 1, temp); ++m_counter_index; return findNumbers( text, count, i ); } -void BatchRenamer::findNumberAppendix( QString & text, int pos, int* start, int* step ) +void BatchRenamer::findNumberAppendix( TQString & text, int pos, int* start, int* step ) { - QString appendix = QString::null; + TQString appendix = TQString(); int tmp = 0; int end = 0; bool ok = false; - if( text[pos] == '{' && (end = text.find( "}", pos )) > -1) + if( text[pos] == '{' && (end = text.tqfind( "}", pos )) > -1) { //qDebug("Found an appendix:" + appendix ); appendix = text.mid( pos + 1, end - pos - 1); @@ -531,13 +507,13 @@ void BatchRenamer::findNumberAppendix( QString & text, int pos, int* start, int* } } -QString BatchRenamer::findStar( const QString & oldname, QString text ) +TQString BatchRenamer::findStar( const TQString & oldname, TQString text ) { int pos = -1; do { - pos = text.findRev("*", pos); + pos = text.tqfindRev("*", pos); if( pos >= 0 ) { - QString tmp = oldname.lower(); + TQString tmp = oldname.lower(); if( tmp[0].isLetter() ) tmp[0] = tmp[0].upper(); @@ -546,13 +522,13 @@ QString BatchRenamer::findStar( const QString & oldname, QString text ) tmp[i] != '\'' && tmp[i] != '?' && tmp[i] != '`' ) tmp[i+1] = tmp[i+1].upper(); - text.replace( pos, 1, tmp); + text.tqreplace( pos, 1, tmp); } } while( pos >= 0 ); return text; } -QString BatchRenamer::findBrackets( QString oldname, QString text, int i ) +TQString BatchRenamer::findBrackets( TQString oldname, TQString text, int i ) { /* * looks for a statement in brackets [ ] @@ -560,17 +536,17 @@ QString BatchRenamer::findBrackets( QString oldname, QString text, int i ) */ int num, pos = -1, a; - QString token; + TQString token; - if( text.contains("]", FALSE) <= 0 || text.isEmpty() ) + if( text.tqcontains("]", FALSE) <= 0 || text.isEmpty() ) return text; - num = text.contains("[", FALSE); + num = text.tqcontains("[", FALSE); if(num <= 0 ) return text; - pos = text.findRev("[", pos); - a = text.find("]", pos ); + pos = text.tqfindRev("[", pos); + a = text.tqfind("]", pos ); if( a < 0 && pos >= 0 ) return text; @@ -589,9 +565,9 @@ QString BatchRenamer::findBrackets( QString oldname, QString text, int i ) return findBrackets( oldname, text, i ); } -QString BatchRenamer::processToken( QString token, QString oldname, int i ) +TQString BatchRenamer::processToken( TQString token, TQString oldname, int i ) { - QString tmp; + TQString tmp; /* * Call here all functions that handle @@ -625,10 +601,10 @@ QString BatchRenamer::processToken( QString token, QString oldname, int i ) * Krename simply ignores unknown tokens! * Usefull for the MP3 Plugin! */ - return QString::null; + return TQString(); } -QString BatchRenamer::findToken( QString oldname, QString token, int i ) +TQString BatchRenamer::findToken( TQString oldname, TQString token, int i ) { enum conversion { LOWER, UPPER, MIXED, STAR, STRIP, NONE, EMPTY, NUMBER }; unsigned int numwidth = 0; @@ -658,7 +634,7 @@ QString BatchRenamer::findToken( QString oldname, QString token, int i ) if( c != EMPTY && c != NUMBER ) token.remove( 0, 1 ); - QString save = token; + TQString save = token; token = processToken( token, oldname, i ); switch( c ) { @@ -670,7 +646,7 @@ QString BatchRenamer::findToken( QString oldname, QString token, int i ) break; case MIXED: token = token.lower(); - token.replace( 0, 1, token[0].upper()); + token.tqreplace( 0, 1, token[0].upper()); break; case STAR: token = findStar( token, "*" ); @@ -694,20 +670,20 @@ QString BatchRenamer::findToken( QString oldname, QString token, int i ) return token; } -QString BatchRenamer::findPartStrings( QString oldname, QString token ) +TQString BatchRenamer::findPartStrings( TQString oldname, TQString token ) { - QString first, second; + TQString first, second; int pos = -1; // parse things like [2;4{[dirname]}] - if( token.contains( "{" ) >= 1 && token.contains( "}" ) >= 1 ) { - int pos = token.find( "{" ); - oldname = token.mid( pos + 1, token.findRev( "}" ) - pos - 1 ); + if( token.tqcontains( "{" ) >= 1 && token.tqcontains( "}" ) >= 1 ) { + int pos = token.tqfind( "{" ); + oldname = token.mid( pos + 1, token.tqfindRev( "}" ) - pos - 1 ); token = token.left( pos ); } - if( token.contains("-") ) { - pos = token.find( "-", 0 ); + if( token.tqcontains("-") ) { + pos = token.tqfind( "-", 0 ); first = token.left( pos ); // ------- Code OK ^ ! @@ -741,8 +717,8 @@ QString BatchRenamer::findPartStrings( QString oldname, QString token ) x++; return oldname.mid( first.toInt()-1, x ); - } else if( token.contains(";") ) { - pos = token.find( ";", 0 ); + } else if( token.tqcontains(";") ) { + pos = token.tqfind( ";", 0 ); first = token.left( pos ); second = token.mid( pos+1, token.length() ); @@ -753,13 +729,13 @@ QString BatchRenamer::findPartStrings( QString oldname, QString token ) int number = token.toInt( &ok ); if( ok && (number <= (signed int)oldname.length() && number > 0 ) ) - return QString(oldname[ number -1 ]); + return TQString(oldname[ number -1 ]); else - return QString::null; + return TQString(); } } -QString BatchRenamer::findDirName( QString token, QString path ) +TQString BatchRenamer::findDirName( TQString token, TQString path ) { if( token.left( 7 ).lower() == "dirname" ) { if( path.right( 1 ) == "/" ) @@ -768,9 +744,9 @@ QString BatchRenamer::findDirName( QString token, QString path ) int recursion = 1; if( token.length() > 7 ) { token = token.right( token.length() - 7 ); - recursion = token.contains( "." ); + recursion = token.tqcontains( "." ); if( recursion != (signed int)token.length() ) - return QString::null; + return TQString(); recursion++; } @@ -778,10 +754,10 @@ QString BatchRenamer::findDirName( QString token, QString path ) return path.section( "/", recursion * -1, recursion * -1); } - return QString::null; + return TQString(); } -QString BatchRenamer::findLength( const QString & token, const QString & name ) +TQString BatchRenamer::findLength( const TQString & token, const TQString & name ) { if( token.lower().startsWith( "length" ) ) { int minus = 0; @@ -792,67 +768,41 @@ QString BatchRenamer::findLength( const QString & token, const QString & name ) minus = 0; } - return QString::number( name.length() - minus ); + return TQString::number( name.length() - minus ); } - return QString::null; + return TQString(); } -QString BatchRenamer::findReplace( QString text ) +TQString BatchRenamer::findReplace( TQString text ) { // Call for each element in replace strings doReplace with correct values - for( unsigned int i = 0; i < m_replace.count(); i++ ) { - replacestrings s = m_replace[i]; - text = doReplace( text, unEscape( s.find ), s.replace, s.reg ); + for( unsigned int i = 0; i < m_tqreplace.count(); i++ ) { + replacestrings s = m_tqreplace[i]; + text = doReplace( text, unEscape( s.tqfind ), s.tqreplace, s.reg ); } return text; } -QString BatchRenamer::doReplace( QString text, QString find, QString replace, bool reg ) +TQString BatchRenamer::doReplace( TQString text, TQString tqfind, TQString tqreplace, bool reg ) { if( !reg ) { -#if QT_VERSION >= 0x030100 // we use the escaped text here because the user might want // to find a "&" and replace it - text.replace( doEscape( find ), replace ); -#else - int pos = 0; - QString f = doEscape( find ); - do { - - pos = text.find( f, pos ); - if( pos >= 0 ) { - text.replace( pos, f.length(), replace ); - pos += replace.length(); - } - } while( pos >= 0 ); -#endif + text.tqreplace( doEscape( tqfind ), tqreplace ); } else { -#if QT_VERSION >= 0x030100 // no doEscape() here for the regexp, because it would destroy our regular expression // other wise we will not find stuff like $, [ in the text - text = doEscape( unEscape( text ).replace( QRegExp( find ), replace ) ); -#else - // Test this code more! - pos = 0; - do { - QRegExp exp( find ); - pos = exp.search( text, pos ); - if( pos >= 0 ) { - text = doEscape( unEscape( text ).replace( pos, exp.matchedLength(), replace ) ); - pos += replace.length(); - } - } while( pos >= 0 ); -#endif + text = doEscape( unEscape( text ).tqreplace( TQRegExp( tqfind ), tqreplace ) ); } return text; } -void BatchRenamer::writeUndoScript( QTextStream* t ) +void BatchRenamer::writeUndoScript( TQTextStream* t ) { // write header comments (*t) << "#!/bin/bash" << endl @@ -882,15 +832,15 @@ void BatchRenamer::writeUndoScript( QTextStream* t ) void BatchRenamer::parseSubdirs( data* f ) { int pos = 0; - if( (pos = f->dst.name.findRev( "/", -1 ) ) > 0 ) { - QString dirs = f->dst.name.left( pos ); + if( (pos = f->dst.name.tqfindRev( "/", -1 ) ) > 0 ) { + TQString dirs = f->dst.name.left( pos ); f->dst.name = f->dst.name.right( f->dst.name.length() - pos - 1 ); f->dst.directory += ( f->dst.directory.right( 1 ) == "/" ) ? "" : "/"; // create the missing subdir now int i = 0; - QString d = ""; - while( (d = dirs.section( "/", i, i, QString::SectionSkipEmpty )) && ! d.isEmpty() ) { // asignment here! + TQString d = ""; + while( (d = dirs.section( "/", i, i, TQString::SectionSkipEmpty )) && ! d.isEmpty() ) { // asignment here! KURL url = f->dst.url; // it is important to unescape here // to support dirnames containing "&" or @@ -907,9 +857,9 @@ void BatchRenamer::parseSubdirs( data* f ) } } -QString BatchRenamer::buildFilename( fileentry* entry, bool dir ) +TQString BatchRenamer::buildFilename( fileentry* entry, bool dir ) { - QString filename = ( dir ? entry->directory : QString::null ) + entry->name + ( entry->extension.isEmpty() ? QString::null : QString(".") ) + entry->extension; + TQString filename = ( dir ? entry->directory : TQString() ) + entry->name + ( entry->extension.isEmpty() ? TQString() : TQString(".") ) + entry->extension; // unescape here as filename is still escaped unEscape( filename ); return filename; @@ -929,7 +879,7 @@ bool BatchRenamer::applyManualChanges( int i ) m_files[i].dst.name = m_changes[z].user; // the file extension is already included // in the users name - m_files[i].dst.extension = QString::null; + m_files[i].dst.extension = TQString(); return true; } } diff --git a/krename/batchrenamer.h b/krename/batchrenamer.h index 1eae7c6..11e4ca9 100644 --- a/krename/batchrenamer.h +++ b/krename/batchrenamer.h @@ -18,13 +18,13 @@ #ifndef BATCHRENAMER_H #define BATCHRENAMER_H -#include <qdatetime.h> -#include <qvaluelist.h> +#include <tqdatetime.h> +#include <tqvaluelist.h> #include <kurl.h> -class QFile; -class QProgressDialog; -class QString; +class TQFile; +class TQProgressDialog; +class TQString; /* How many diferrent users and groups * KRename supports. Values over 1000 @@ -45,9 +45,9 @@ enum { }; typedef struct fileentry { - QString name; // filename - QString directory; // directory - QString extension; // extension + TQString name; // filename + TQString directory; // directory + TQString extension; // extension KURL url; }; @@ -66,12 +66,12 @@ typedef struct data { */ typedef struct manualchanges { KURL url; // input filename - QString user; // name the user wants + TQString user; // name the user wants }; typedef struct replacestrings { - QString find; // Text to replace - QString replace; // Replace with + TQString tqfind; // Text to tqreplace + TQString tqreplace; // Replace with bool reg; // is it a reg expression ? }; @@ -85,57 +85,57 @@ typedef struct tCounterValues { *@author Dominik Seichter */ -class QObject; -class QListView; +class TQObject; +class TQListView; class ProgressDialog; class PluginLoader; class BatchRenamer { public: BatchRenamer(); ~BatchRenamer(); - void processFiles( ProgressDialog* p, QObject* object ); - void createPreview( QListView* list ); + void processFiles( ProgressDialog* p, TQObject* object ); + void createPreview( TQListView* list ); - inline void setText( const QString & t ) { text = t; doEscape( text, false ); } - inline void setExText( const QString & t ) { extext = t; } + inline void setText( const TQString & t ) { text = t; doEscape( text, false ); } + inline void setExText( const TQString & t ) { extext = t; } inline void setDirname( const KURL & url ) { dirname = url; } - inline void setUndoScript( const QString & t ) { m_undoScript = t; } + inline void setUndoScript( const TQString & t ) { m_undoScript = t; } inline void setUndo( bool b ) { undo = b; } inline void setOverwrite( bool b ) { overwrite = b; } inline void setIndex( int i ) { m_index = i; } inline void setStep( int s ) { m_step = s; } inline void setResetCounter( bool r ) { m_reset = r; } - inline void setSkipList( const QValueList<int> & s ) { m_skip = s; } - inline void setReplaceList( const QValueList<replacestrings> & r ) { m_replace = r; } + inline void setSkipList( const TQValueList<int> & s ) { m_skip = s; } + inline void setReplaceList( const TQValueList<replacestrings> & r ) { m_tqreplace = r; } - inline void setFiles( const QValueList<data> & f ) { m_files = f; } //TODO: use a pointer for more speed - inline QValueList<data> files() const { return m_files; } - inline void setChanges( const QValueList<manualchanges> & m ) { m_changes = m; } + inline void setFiles( const TQValueList<data> & f ) { m_files = f; } //TODO: use a pointer for more speed + inline TQValueList<data> files() const { return m_files; } + inline void setChanges( const TQValueList<manualchanges> & m ) { m_changes = m; } inline void setMode( int m) { m_mode = m; } inline int mode() const { return m_mode; } // Since 2.1 public, because plugins may want to access them to: - QString findAndProcess( const QString & token, QString text, const QString & replace ); - - QString findNumbers( QString text, int count, int i ); - QString findStar( const QString & oldname, QString text ); - QString findBrackets( QString oldname, QString text, int i ); - QString findToken( QString oldname, QString token, int i ); - QString processToken( QString token, QString oldname, int i ); - QString findPartStrings( QString oldname, QString token ); - static QString findDirName( QString token, QString path ); - QString findLength( const QString & token, const QString & name ); - QString findReplace( QString text ); // text is here already the new filename ! - QString doReplace( QString text, QString find, QString replace, bool reg ); // text is here already the new filename ! - - QString processString( QString text, QString oldname, int i ); + TQString findAndProcess( const TQString & token, TQString text, const TQString & tqreplace ); + + TQString findNumbers( TQString text, int count, int i ); + TQString findStar( const TQString & oldname, TQString text ); + TQString findBrackets( TQString oldname, TQString text, int i ); + TQString findToken( TQString oldname, TQString token, int i ); + TQString processToken( TQString token, TQString oldname, int i ); + TQString findPartStrings( TQString oldname, TQString token ); + static TQString findDirName( TQString token, TQString path ); + TQString findLength( const TQString & token, const TQString & name ); + TQString findReplace( TQString text ); // text is here already the new filename ! + TQString doReplace( TQString text, TQString tqfind, TQString tqreplace, bool reg ); // text is here already the new filename ! + + TQString processString( TQString text, TQString oldname, int i ); - static QString & doEscape( QString & text, bool filename = true ); - static QString & unEscape( QString & text ); - static void escape( QString & text, const QString & token, const QString & sequence ); + static TQString & doEscape( TQString text, bool filename = true ); + static TQString & unEscape( TQString & text ); + static void escape( TQString & text, const TQString & token, const TQString & sequence ); - static QString buildFilename( fileentry* entry, bool dir = true ); + static TQString buildFilename( fileentry* entry, bool dir = true ); private: /** @@ -147,42 +147,42 @@ class BatchRenamer { int getCharacters( int n ) ; void work( ProgressDialog* p ); - void writeUndoScript( QTextStream* t ); + void writeUndoScript( TQTextStream* t ); void parseSubdirs( data* f ); - void findNumberAppendix( QString & text, int pos, int* start, int* step ); + void findNumberAppendix( TQString & text, int pos, int* start, int* step ); /** resets all counters to there start value if the directory name at @p i * in m_files changes. * The caller has to check m_reset before calling this function. */ void findCounterReset( int i ); - QString parsePlugins( int i, const QString & text, int type ); + TQString parsePlugins( int i, const TQString & text, int type ); bool applyManualChanges( int i ); - QString text; // template + TQString text; // template KURL dirname; // destination dir - QString extext; // Extension template - QString m_undoScript; // Filename of undoscript + TQString extext; // Extension template + TQString m_undoScript; // Filename of undoscript bool undo; // create an undo script int m_index; // index for numbers int m_step; // step for numbers bool m_reset; // reset counter on new directories bool overwrite; // overwrite existing files int m_mode; // renaming mode - QValueList<int> m_skip; // Numbers to skip - QValueList<replacestrings> m_replace; // Replace strings - QValueList<data> m_files; - QValueList<manualchanges> m_changes; // User made changes + TQValueList<int> m_skip; // Numbers to skip + TQValueList<replacestrings> m_tqreplace; // Replace strings + TQValueList<data> m_files; + TQValueList<manualchanges> m_changes; // User made changes PluginLoader* plug; // a is used in find number and // required for skipping. int m_counter_index; - QValueList<tCounterValues> m_counters; + TQValueList<tCounterValues> m_counters; protected: - QFile* f; - QTime t; - QProgressDialog* progress; + TQFile* f; + TQTime t; + TQProgressDialog* progress; }; #endif diff --git a/krename/commandplugin.cpp b/krename/commandplugin.cpp index d413cec..752002e 100644 --- a/krename/commandplugin.cpp +++ b/krename/commandplugin.cpp @@ -18,9 +18,9 @@ #include "commandplugin.h" // QT includes -#include <qcheckbox.h> -#include <qlabel.h> -#include <qlayout.h> +#include <tqcheckbox.h> +#include <tqlabel.h> +#include <tqlayout.h> // KDE includes #include <kapplication.h> @@ -33,12 +33,12 @@ #include <kpushbutton.h> #include <kprocess.h> -const QString CommandPlugin::getName() const +const TQString CommandPlugin::getName() const { return i18n("Command Plugin"); } -const QString CommandPlugin::getAccelName() const +const TQString CommandPlugin::getAccelName() const { return i18n("&Command Plugin"); } @@ -58,27 +58,27 @@ bool CommandPlugin::checkError() return true; } -void CommandPlugin::drawInterface( QWidget* w, QVBoxLayout* l ) +void CommandPlugin::drawInterface( TQWidget* w, TQVBoxLayout* l ) { m_widget = w; - QHBoxLayout* hb = new QHBoxLayout( 0, 0, 6 ); - QVBoxLayout* vb = new QVBoxLayout( 0, 0, 6 ); + TQHBoxLayout* hb = new TQHBoxLayout( 0, 0, 6 ); + TQVBoxLayout* vb = new TQVBoxLayout( 0, 0, 6 ); - QLabel* la = new QLabel( w ); + TQLabel* la = new TQLabel( w ); la->setText( i18n("<b>Command Plugin</b>") ); l->addWidget( la ); - la = new QLabel( w ); + la = new TQLabel( w ); la->setText( i18n( "<qt>Executes a shell command on every file after it has been renamed. " "Add %1 to the command line arguments to get the filename of the renamed file.</qt>") ); l->addWidget( la ); - l->addWidget( new QLabel( i18n("Command:"), w ) ); + l->addWidget( new TQLabel( i18n("Command:"), w ) ); commandline = new KLineEdit( w ); l->addWidget( commandline ); - checkNoBlock = new QCheckBox( i18n("&Execute without blocking (not recommended)"), w ); + checkNoBlock = new TQCheckBox( i18n("&Execute without blocking (not recommended)"), w ); l->addWidget( checkNoBlock ); buttonAdd = new KPushButton( i18n("&Add"), w ); @@ -93,21 +93,21 @@ void CommandPlugin::drawInterface( QWidget* w, QVBoxLayout* l ) vb->setStretchFactor( list, 2 ); l->addLayout( vb ); - connect( buttonAdd, SIGNAL( clicked() ), this, SLOT( add() ) ); - connect( buttonRemove, SIGNAL( clicked() ), this, SLOT( remove() ) ); - connect( list, SIGNAL( executed( QListBoxItem* ) ), this, SLOT( exec() ) ); + connect( buttonAdd, TQT_SIGNAL( clicked() ), this, TQT_SLOT( add() ) ); + connect( buttonRemove, TQT_SIGNAL( clicked() ), this, TQT_SLOT( remove() ) ); + connect( list, TQT_SIGNAL( executed( TQListBoxItem* ) ), this, TQT_SLOT( exec() ) ); KConfig* conf = kapp->config(); conf->setGroup("CommandPlugin"); list->insertStringList( conf->readListEntry("commandlines" ) ); - QStringList examples; + TQStringList examples; examples.append( "chmod 0444 %1" ); examples.append( "convert %1 %1.png" ); examples.append( "echo %1 >> $HOME/file.list" ); // examples.append( ") for( unsigned int i = 0; i < examples.count(); i++ ) - if( !list->findItem( examples[i] ) ) + if( !list->tqfindItem( examples[i] ) ) list->insertItem( examples[i] ); } @@ -117,24 +117,15 @@ void CommandPlugin::fillStructure() noblock = checkNoBlock->isChecked(); } -QString CommandPlugin::processFile( BatchRenamer* b, int i, QString, int ) +TQString CommandPlugin::processFile( BatchRenamer* b, int i, TQString, int ) { - QString filename = b->files()[i].dst.name; + TQString filename = b->files()[i].dst.name; - QString c = command; + TQString c = command; KShellProcess proc; -#if QT_VERSION >= 0x030100 - c = c.replace( "%1", KShellProcess::quote( filename ) ); -#else - int pos = 0; - do { - pos = c.find( "%1", pos ); - if( pos >= 0 ) - c.replace( pos, 2, KShellProcess::quote( filename ) ); - } while ( pos >= 0 ); -#endif + c = c.tqreplace( "%1", KShellProcess::quote( filename ) ); proc << c; @@ -146,16 +137,16 @@ QString CommandPlugin::processFile( BatchRenamer* b, int i, QString, int ) proc.resume(); if( !noblock && proc.exitStatus() ) - return command.arg( filename ) + QString( i18n(" exited with error: %1") ).arg( proc.exitStatus() ); + return command.tqarg( filename ) + TQString( i18n(" exited with error: %1") ).tqarg( proc.exitStatus() ); - return QString::null; + return TQString(); } void CommandPlugin::finished() { KConfig* conf = kapp->config(); conf->setGroup("CommandPlugin"); - QStringList slist; + TQStringList slist; for( unsigned int i = 0; i < list->count(); i++ ) slist.append( list->text( i ) ); @@ -193,7 +184,7 @@ void CommandPlugin::exec() commandline->setText( list->text( i ) ); } -const QPixmap CommandPlugin::getIcon() const +const TQPixmap CommandPlugin::getIcon() const { return kapp->iconLoader()->loadIcon( "konsole", KIcon::Small ); } diff --git a/krename/commandplugin.h b/krename/commandplugin.h index 61edaee..1d6803e 100644 --- a/krename/commandplugin.h +++ b/krename/commandplugin.h @@ -23,25 +23,26 @@ #include "plugin.h" #include "helpdialog.h" -class QCheckBox; +class TQCheckBox; class KLineEdit; class KListBox; class KPushButton; class CommandPlugin : public Plugin { Q_OBJECT + TQ_OBJECT public: - const QString getName() const; - const QString getAccelName() const; + const TQString getName() const; + const TQString getAccelName() const; const int type() const; bool checkError(); - void drawInterface( QWidget* w, QVBoxLayout* l ); + void drawInterface( TQWidget* w, TQVBoxLayout* l ); void fillStructure(); - QString processFile( BatchRenamer*, int, QString token, int ); + TQString processFile( BatchRenamer*, int, TQString token, int ); void finished(); bool alwaysUsed() const { return false; } - const QPixmap getIcon() const; + const TQPixmap getIcon() const; private slots: void add(); @@ -50,12 +51,12 @@ class CommandPlugin : public Plugin { private: KLineEdit* commandline; - QCheckBox* checkNoBlock; + TQCheckBox* checkNoBlock; KListBox* list; KPushButton* buttonAdd; KPushButton* buttonRemove; - QString command; + TQString command; bool noblock; }; diff --git a/krename/confdialog.cpp b/krename/confdialog.cpp index eb03c3d..871f498 100644 --- a/krename/confdialog.cpp +++ b/krename/confdialog.cpp @@ -19,25 +19,25 @@ #include "confdialog.h" // QT includes -#include <qbuttongroup.h> -#include <qlabel.h> -#include <qlayout.h> -#include <qradiobutton.h> -#include <qtooltip.h> +#include <tqbuttongroup.h> +#include <tqlabel.h> +#include <tqlayout.h> +#include <tqradiobutton.h> +#include <tqtooltip.h> // KDE includes #include <kiconloader.h> #include <klocale.h> -ConfDialog::ConfDialog( QWidget* parent, const char* name ) +ConfDialog::ConfDialog( TQWidget* tqparent, const char* name ) : KDialogBase( KDialogBase::IconList, "KRename", - KDialogBase::Ok | KDialogBase::Cancel | KDialogBase::Default, KDialogBase::Ok, parent, name, true, true ), + KDialogBase::Ok | KDialogBase::Cancel | KDialogBase::Default, KDialogBase::Ok, tqparent, name, true, true ), GUIModeSelector() { setupTab1(); setupTab2(); - connect( this, SIGNAL( defaultClicked() ), this, SLOT( defaults() ) ); + connect( this, TQT_SIGNAL( defaultClicked() ), this, TQT_SLOT( defaults() ) ); } ConfDialog::~ConfDialog() @@ -46,38 +46,38 @@ ConfDialog::~ConfDialog() void ConfDialog::setupTab1() { - const QString caption = i18n("Look and Feel"); - QFrame* box = addPage( caption, caption, BarIcon("looknfeel") ); - QVBoxLayout* layout = new QVBoxLayout( box ); - QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding ); + const TQString caption = i18n("Look and Feel"); + TQFrame* box = addPage( caption, caption, BarIcon("looknfeel") ); + TQVBoxLayout* tqlayout = new TQVBoxLayout( box ); + TQSpacerItem* spacer = new TQSpacerItem( 20, 20, TQSizePolicy::Minimum, TQSizePolicy::Expanding ); - QButtonGroup* group = new QButtonGroup( box ); + TQButtonGroup* group = new TQButtonGroup( box ); group->setColumnLayout(0, Qt::Vertical ); - QVBoxLayout* lgroup = new QVBoxLayout( group->layout() ); + TQVBoxLayout* lgroup = new TQVBoxLayout( group->tqlayout() ); - optionWizard = new QRadioButton( group ); + optionWizard = new TQRadioButton( group ); optionWizard->setText( i18n("Use &wizard style GUI (beginners)") ); - optionTabs = new QRadioButton( group ); + optionTabs = new TQRadioButton( group ); optionTabs->setText( i18n("Use &tabbed GUI (advanced users)") ); - lgroup->addWidget( new QLabel( i18n("Configure the look and feel of the KRename GUI:<br>"), group ) ); + lgroup->addWidget( new TQLabel( i18n("Configure the look and feel of the KRename GUI:<br>"), group ) ); lgroup->addWidget( optionWizard ); lgroup->addWidget( optionTabs ); lgroup->addItem( spacer ); - layout->addWidget( group ); - layout->addItem( spacer ); + tqlayout->addWidget( group ); + tqlayout->addItem( spacer ); } void ConfDialog::setupTab2() { - const QString caption = i18n("KRename"); - QFrame* box = addPage( caption, caption, BarIcon("krename") ); - QVBoxLayout* layout = new QVBoxLayout( box ); - QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding ); + const TQString caption = i18n("KRename"); + TQFrame* box = addPage( caption, caption, BarIcon("krename") ); + TQVBoxLayout* tqlayout = new TQVBoxLayout( box ); + TQSpacerItem* spacer = new TQSpacerItem( 20, 20, TQSizePolicy::Minimum, TQSizePolicy::Expanding ); - checkPlugins = new QCheckBox( i18n("&Load file plugins on start"), box ); - checkAutosize = new QCheckBox( i18n("Auto &resize columns in preview"), box ); + checkPlugins = new TQCheckBox( i18n("&Load file plugins on start"), box ); + checkAutosize = new TQCheckBox( i18n("Auto &resize columns in preview"), box ); spinSize = new KIntNumInput( box ); spinSize->setRange( 20, 500, 1, false ); @@ -87,14 +87,14 @@ void ConfDialog::setupTab2() spinHistory->setRange( 2, 500, 1, false ); spinHistory->setLabel( i18n( "&Number of template history items:" ), AlignLeft | AlignVCenter ); - layout->addWidget( checkPlugins ); - layout->addWidget( checkAutosize ); - layout->addItem( spacer ); - layout->addWidget( spinSize ); - layout->addWidget( spinHistory ); - layout->addItem( spacer ); + tqlayout->addWidget( checkPlugins ); + tqlayout->addWidget( checkAutosize ); + tqlayout->addItem( spacer ); + tqlayout->addWidget( spinSize ); + tqlayout->addWidget( spinHistory ); + tqlayout->addItem( spacer ); - QToolTip::add( checkPlugins, i18n("Disabling this option decreases KRename's startup time, because no KFilePlugins are loaded.") ); + TQToolTip::add( checkPlugins, i18n("Disabling this option decreases KRename's startup time, because no KFilePlugins are loaded.") ); } void ConfDialog::defaults() diff --git a/krename/confdialog.h b/krename/confdialog.h index 06c7425..f4a4aeb 100644 --- a/krename/confdialog.h +++ b/krename/confdialog.h @@ -19,7 +19,7 @@ #define CONFDIALOG_H // QT includes -#include <qcheckbox.h> +#include <tqcheckbox.h> // KDE includes #include <kdialogbase.h> @@ -27,14 +27,15 @@ #include "guimodeselector.h" -class QHBoxLayout; -class QVBoxLayout; -class QWidget; +class TQHBoxLayout; +class TQVBoxLayout; +class TQWidget; class KIntNumInput; class ConfDialog : public KDialogBase, public GUIModeSelector { Q_OBJECT + TQ_OBJECT public: - ConfDialog( QWidget* parent = 0, const char* name = 0 ); + ConfDialog( TQWidget* tqparent = 0, const char* name = 0 ); ~ConfDialog(); inline bool loadplugins() const { return checkPlugins->isChecked(); } @@ -55,9 +56,9 @@ class ConfDialog : public KDialogBase, public GUIModeSelector { void setupTab2(); protected: - QCheckBox* checkAsk; - QCheckBox* checkPlugins; - QCheckBox* checkAutosize; + TQCheckBox* checkAsk; + TQCheckBox* checkPlugins; + TQCheckBox* checkAutosize; KIntNumInput* spinSize; KIntNumInput* spinHistory; diff --git a/krename/coorddialog.cpp b/krename/coorddialog.cpp index f67062d..48d5955 100644 --- a/krename/coorddialog.cpp +++ b/krename/coorddialog.cpp @@ -17,29 +17,29 @@ #include "coorddialog.h" -// Qt includes -#include <qcheckbox.h> -#include <qfontmetrics.h> -#include <qlabel.h> -#include <qlayout.h> -#include <qvalidator.h> +// TQt includes +#include <tqcheckbox.h> +#include <tqfontmetrics.h> +#include <tqlabel.h> +#include <tqlayout.h> +#include <tqvalidator.h> // KDE includes #include <kapplication.h> #include <klocale.h> -DSLineEdit::DSLineEdit( QWidget* parent, const char* name ) - : KLineEdit( parent, name ) +DSLineEdit::DSLineEdit( TQWidget* tqparent, const char* name ) + : KLineEdit( tqparent, name ) { } -void DSLineEdit::keyPressEvent( QKeyEvent* e ) +void DSLineEdit::keyPressEvent( TQKeyEvent* e ) { KLineEdit::keyPressEvent( e ); emit changed(); } -void DSLineEdit::mousePressEvent( QMouseEvent* e ) +void DSLineEdit::mousePressEvent( TQMouseEvent* e ) { KLineEdit::mousePressEvent( e ); emit changed(); @@ -47,36 +47,36 @@ void DSLineEdit::mousePressEvent( QMouseEvent* e ) bool CoordDialog::m_inversion = false; -CoordDialog::CoordDialog( const QString & file, QWidget *_parent, const char *name ) +CoordDialog::CoordDialog( const TQString & file, TQWidget *_parent, const char *name ) : KDialogBase( KDialogBase::Plain, "KRename", KDialogBase::Ok | KDialogBase::Cancel, KDialogBase::Ok, _parent, name, true, true ), m_file( file ) { - QFrame* parent = plainPage(); - QVBoxLayout* layout = new QVBoxLayout( parent ); + TQFrame* tqparent = plainPage(); + TQVBoxLayout* tqlayout = new TQVBoxLayout( tqparent ); - filename = new DSLineEdit( parent ); + filename = new DSLineEdit( tqparent ); filename->setText( file ); - filename->setValidator( new QRegExpValidator( QRegExp( file ), this ) ); + filename->setValidator( new TQRegExpValidator( TQRegExp( file ), TQT_TQOBJECT(this) ) ); - preview = new QLabel( parent ); + preview = new TQLabel( tqparent ); - checkInvert = new QCheckBox( i18n("&Invert selection"), plainPage() ); + checkInvert = new TQCheckBox( i18n("&Invert selection"), plainPage() ); checkInvert->setChecked( m_inversion ); - layout->addWidget( new QLabel( i18n("Please select the text you want to insert:"), plainPage() ) ); - layout->addWidget( filename ); - layout->addWidget( checkInvert ); - layout->addWidget( preview ); + tqlayout->addWidget( new TQLabel( i18n("Please select the text you want to insert:"), plainPage() ) ); + tqlayout->addWidget( filename ); + tqlayout->addWidget( checkInvert ); + tqlayout->addWidget( preview ); updateCommand(); - connect( filename, SIGNAL( selectionChanged() ), this, SLOT( updateCommand() ) ); - connect( checkInvert, SIGNAL( clicked() ), this, SLOT( updateCommand() ) ); - connect( filename, SIGNAL( textChanged( const QString & ) ), this, SLOT( resetText() ) ); - connect( filename, SIGNAL( changed() ), this, SLOT( updateCommand() ) ); + connect( filename, TQT_SIGNAL( selectionChanged() ), this, TQT_SLOT( updateCommand() ) ); + connect( checkInvert, TQT_SIGNAL( clicked() ), this, TQT_SLOT( updateCommand() ) ); + connect( filename, TQT_SIGNAL( textChanged( const TQString & ) ), this, TQT_SLOT( resetText() ) ); + connect( filename, TQT_SIGNAL( changed() ), this, TQT_SLOT( updateCommand() ) ); show(); - QFontMetrics fm( filename->font() ); + TQFontMetrics fm( filename->font() ); int w = fm.width( file ); if( w > width() ) resize( @@ -102,26 +102,26 @@ void CoordDialog::updateCommand() start++; end++; if( start > 1 ) - m_command = QString("[$1;%1]").arg(start-1); + m_command = TQString("[$1;%1]").tqarg(start-1); if( end <= (signed int)filename->text().length() ) - m_command.append( QString("[$%1-[length]]").arg(end) ); + m_command.append( TQString("[$%1-[length]]").tqarg(end) ); } } else if( checkInvert->isChecked() && !filename->hasSelectedText() ) { int p = filename->cursorPosition(); - m_command = QString("[$1;%1][$%2-[length]]").arg(p).arg(p+1); + m_command = TQString("[$1;%1][$%2-[length]]").tqarg(p).tqarg(p+1); } else if( !checkInvert->isChecked() && filename->hasSelectedText() ){ if( end ) { start++; end++; if( end <= (signed int)filename->text().length() ) - m_command = QString("[$%1;%2]").arg(start).arg(end-start); + m_command = TQString("[$%1;%2]").tqarg(start).tqarg(end-start); else - m_command = QString("[$%1-[length]]").arg(start); + m_command = TQString("[$%1-[length]]").tqarg(start); } } else if( !checkInvert->isChecked() && !filename->hasSelectedText() ) { int p = filename->cursorPosition(); - m_command = QString("[$%1-[length]]").arg( p ); + m_command = TQString("[$%1-[length]]").tqarg( p ); } } @@ -135,7 +135,7 @@ void CoordDialog::resetText() updateCommand(); } -QString CoordDialog::coords() +TQString CoordDialog::coords() { m_inversion = checkInvert->isChecked(); return m_command; diff --git a/krename/coorddialog.h b/krename/coorddialog.h index e8e5be3..fe5e298 100644 --- a/krename/coorddialog.h +++ b/krename/coorddialog.h @@ -21,23 +21,24 @@ #include <kdialogbase.h> #include <klineedit.h> -class QKeyEvent; +class TQKeyEvent; class DSLineEdit : public KLineEdit { Q_OBJECT + TQ_OBJECT public: - DSLineEdit( QWidget* parent = 0, const char* name = 0 ); + DSLineEdit( TQWidget* tqparent = 0, const char* name = 0 ); signals: void changed(); protected: - void keyPressEvent( QKeyEvent* e ); - void mousePressEvent( QMouseEvent* e ); + void keyPressEvent( TQKeyEvent* e ); + void mousePressEvent( TQMouseEvent* e ); }; -class QCheckBox; -class QLabel; -class QString; +class TQCheckBox; +class TQLabel; +class TQString; /* The name of this class was a very bad choice. * CoordDialog is an abreviation vor Coordinate Dialog, @@ -46,11 +47,12 @@ class QString; */ class CoordDialog : public KDialogBase { Q_OBJECT + TQ_OBJECT public: - CoordDialog( const QString & file, QWidget *_parent=0, const char *name=0); + CoordDialog( const TQString & file, TQWidget *_parent=0, const char *name=0); ~CoordDialog(); - QString coords(); + TQString coords(); static bool m_inversion; @@ -59,12 +61,12 @@ class CoordDialog : public KDialogBase { void resetText(); private: - QString m_file; - QString m_command; + TQString m_file; + TQString m_command; DSLineEdit* filename; - QCheckBox* checkInvert; - QLabel* preview; + TQCheckBox* checkInvert; + TQLabel* preview; }; #endif diff --git a/krename/dateplugin.cpp b/krename/dateplugin.cpp index 0021c94..b296c23 100644 --- a/krename/dateplugin.cpp +++ b/krename/dateplugin.cpp @@ -16,8 +16,8 @@ ***************************************************************************/ #include "dateplugin.h" -// Qt includes -#include <qdatetime.h> +// TQt includes +#include <tqdatetime.h> // KDE includes #include <kfileitem.h> @@ -50,20 +50,20 @@ DatePlugin::DatePlugin() } -QString DatePlugin::processFile(BatchRenamer* b, int i, QString token, int ) +TQString DatePlugin::processFile(BatchRenamer* b, int i, TQString token, int ) { if( !supports( token ) ) - return QString::null; + return TQString(); if( token.lower().startsWith( getPattern() ) ) token = token.mid( getPattern().length(), token.length() - getPattern().length() ); - QDate d = QDate::currentDate(); - QTime t = QTime::currentTime(); - QString tmp, text; - QString format = "dd-MM-yyyy"; - if( token.contains( ";" ) ) + TQDate d = TQDate::tqcurrentDate(); + TQTime t = TQTime::currentTime(); + TQString tmp, text; + TQString format = "dd-MM-yyyy"; + if( token.tqcontains( ";" ) ) { format = token.section( ';', 1, 1 ); token = token.section( ';', 0, 0 ).lower(); @@ -71,15 +71,15 @@ QString DatePlugin::processFile(BatchRenamer* b, int i, QString token, int ) token = token.lower(); if( token == "date" ) { - return QDateTime::currentDateTime().toString( format ); + return TQDateTime::tqcurrentDateTime().toString( format ); } else if( token == "year" ) - return QString( "%1" ).arg( d.year() ); + return TQString( "%1" ).tqarg( d.year() ); else if( token == "month" ) return tmp.sprintf("%0*i", 2, d.month() ); else if( token == "day" ) return tmp.sprintf("%0*i", 2, d.day() ); else if( token == "time" ) - return QString( "%1-%2-%3" ).arg( t.hour() ).arg( QString().sprintf("%0*i", 2, t.minute() ) ).arg( QString().sprintf("%0*i", 2, t.second() ) ); + return TQString( "%1-%2-%3" ).tqarg( t.hour() ).tqarg( TQString().sprintf("%0*i", 2, t.minute() ) ).tqarg( TQString().sprintf("%0*i", 2, t.second() ) ); else if( token == "hour" ) return tmp.sprintf("%0*i", 2, t.hour() ); else if( token == "minute" ) @@ -103,34 +103,34 @@ QString DatePlugin::processFile(BatchRenamer* b, int i, QString token, int ) } - return QString::null; + return TQString(); } -const QString DatePlugin::getAccelName() const +const TQString DatePlugin::getAccelName() const { return i18n("&System Functions"); } -const QString DatePlugin::getName() const +const TQString DatePlugin::getName() const { return i18n("System Functions"); } -const QString DatePlugin::getPattern() const +const TQString DatePlugin::getPattern() const { - return QString::null; + return TQString(); } -const QString DatePlugin::time( time_t time, const QString & format ) +const TQString DatePlugin::time( time_t time, const TQString & format ) { - QDateTime dt; + TQDateTime dt; dt.setTime_t( time ); return dt.toString( format ); } void DatePlugin::addHelp( HelpDialogData* data ) { - QStringList list; + TQStringList list; list.append( "[date];;" + i18n("Insert the current date") ); list.append( "[date;yyyy-MM-dd];;" + i18n("Insert the current date using the formatting string yyyy-MM-dd") ); list.append( "[year];;" + i18n("Insert the current year") ); diff --git a/krename/dateplugin.h b/krename/dateplugin.h index 06eee70..8d8472d 100644 --- a/krename/dateplugin.h +++ b/krename/dateplugin.h @@ -29,15 +29,15 @@ class DatePlugin : public FilePlugin public: DatePlugin(); - QString processFile(BatchRenamer* b, int i, QString token, int mode); - const QString getAccelName() const; - const QString getName() const; - const QString getPattern() const; + TQString processFile(BatchRenamer* b, int i, TQString token, int mode); + const TQString getAccelName() const; + const TQString getName() const; + const TQString getPattern() const; void addHelp( HelpDialogData* data ); private: - const QString time( time_t time, const QString & format ); + const TQString time( time_t time, const TQString & format ); }; diff --git a/krename/datetime.cpp b/krename/datetime.cpp index f06fedb..e8cd9da 100644 --- a/krename/datetime.cpp +++ b/krename/datetime.cpp @@ -18,11 +18,11 @@ #include "datetime.h" // QT includes -#include <qcheckbox.h> -#include <qfileinfo.h> -#include <qlabel.h> -#include <qlayout.h> -#include <qpushbutton.h> +#include <tqcheckbox.h> +#include <tqfileinfo.h> +#include <tqlabel.h> +#include <tqlayout.h> +#include <tqpushbutton.h> // KDE includes #include <kapplication.h> @@ -39,12 +39,12 @@ #include <sys/types.h> #include <sys/stat.h> -const QString MyDatePlugin::getName() const +const TQString MyDatePlugin::getName() const { return i18n("Date & Time"); } -const QString MyDatePlugin::getAccelName() const +const TQString MyDatePlugin::getAccelName() const { return i18n("Date && &Time"); } @@ -59,31 +59,31 @@ bool MyDatePlugin::checkError() return true; } -const QPixmap MyDatePlugin::getIcon() const +const TQPixmap MyDatePlugin::getIcon() const { return kapp->iconLoader()->loadIcon( "kalarm", KIcon::Small ); } -void MyDatePlugin::drawInterface( QWidget* w, QVBoxLayout* l ) +void MyDatePlugin::drawInterface( TQWidget* w, TQVBoxLayout* l ) { m_widget = w; #ifdef BENNY - l->addWidget( new QLabel("Setze Modifiaction Time um eine Stunde zurück", w) ); + l->addWidget( new TQLabel("Setze Modifiaction Time um eine Stunde zurück", w) ); #else - Layout0 = new QHBoxLayout( 0, 0, 6, "Layout0"); - Layout1 = new QVBoxLayout( 0, 0, 6, "Layout1"); - Layout2 = new QHBoxLayout( 0, 0, 6, "Layout2"); + Layout0 = new TQHBoxLayout( 0, 0, 6, "Layout0"); + Layout1 = new TQVBoxLayout( 0, 0, 6, "Layout1"); + Layout2 = new TQHBoxLayout( 0, 0, 6, "Layout2"); kDate = new KDatePicker( w ); - checkAccess = new QCheckBox( w, "checkAccess" ); + checkAccess = new TQCheckBox( w, "checkAccess" ); checkAccess->setText( i18n( "Change &access date && time" ) ); - checkModification = new QCheckBox( w, "checkModification" ); + checkModification = new TQCheckBox( w, "checkModification" ); checkModification->setText( i18n( "Change &modification date && time" ) ); - labelTime = new QLabel( w, "labelTime" ); + labelTime = new TQLabel( w, "labelTime" ); labelTime->setText( i18n( "Time:" ) ); spinHour = new KIntSpinBox( w, "spinHour" ); @@ -98,7 +98,7 @@ void MyDatePlugin::drawInterface( QWidget* w, QVBoxLayout* l ) spinSecond->setSuffix( i18n( "s" ) ); spinSecond->setMaxValue( 59 ); - buttonCurrentDT = new QPushButton( w, "buttonCurrentDT" ); + buttonCurrentDT = new TQPushButton( w, "buttonCurrentDT" ); buttonCurrentDT->setText( i18n( "&Get Current Date && Time" ) ); Layout2->addWidget( labelTime ); @@ -114,12 +114,12 @@ void MyDatePlugin::drawInterface( QWidget* w, QVBoxLayout* l ) Layout0->addLayout( Layout1 ); - QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding ); + TQSpacerItem* spacer = new TQSpacerItem( 20, 20, TQSizePolicy::Minimum, TQSizePolicy::Expanding ); Layout0->addItem( spacer ); l->addLayout( Layout0 ); - connect( buttonCurrentDT, SIGNAL(clicked()), this, SLOT(changeDT())); + connect( buttonCurrentDT, TQT_SIGNAL(clicked()), this, TQT_SLOT(changeDT())); #endif } @@ -135,10 +135,10 @@ void MyDatePlugin::fillStructure() #endif } -QString MyDatePlugin::processFile( BatchRenamer* b, int i, QString, int ) +TQString MyDatePlugin::processFile( BatchRenamer* b, int i, TQString, int ) { #ifdef BENNY - QString filename = b->files()[i].dst.name; + TQString filename = b->files()[i].dst.name; FILE * f; struct utimbuf * t = new utimbuf(); @@ -149,11 +149,11 @@ QString MyDatePlugin::processFile( BatchRenamer* b, int i, QString, int ) f = fopen((const char *)filename, "r"); if( f == NULL ) - return QString( i18n("Can't change date of file %1.") ).arg(filename); + return TQString( i18n("Can't change date of file %1.") ).tqarg(filename); fclose( f ); - QFileInfo info( filename ); + TQFileInfo info( filename ); tmp.tm_mday = info.lastModified().date().day(); tmp.tm_mon = info.lastModified().date().month() - 1; tmp.tm_year = info.lastModified().date().year() - 1900; @@ -165,20 +165,20 @@ QString MyDatePlugin::processFile( BatchRenamer* b, int i, QString, int ) ti = mktime( &tmp ); if( ti == -1 ) - return QString( i18n("Can't change date of file %1.") ).arg(filename); + return TQString( i18n("Can't change date of file %1.") ).tqarg(filename); if( stat( (const char *)filename, &st ) == -1 ) - return QString( i18n("Can't change date of file %1.") ).arg(filename); + return TQString( i18n("Can't change date of file %1.") ).tqarg(filename); t->actime = st.st_atime; t->modtime = ti; if(utime( (const char *)filename, t ) != 0) - return QString( i18n("Can't change date of file %1.") ).arg(filename); + return TQString( i18n("Can't change date of file %1.") ).tqarg(filename); - return QString::null; + return TQString(); #else - QString filename = b->files()[i].dst.name; + TQString filename = b->files()[i].dst.name; FILE * f; struct utimbuf * t = new utimbuf(); @@ -189,7 +189,7 @@ QString MyDatePlugin::processFile( BatchRenamer* b, int i, QString, int ) f = fopen((const char *)filename, "r"); if( f == NULL ) - return QString( i18n("Can't change date of file %1.") ).arg(filename); + return TQString( i18n("Can't change date of file %1.") ).tqarg(filename); fclose( f ); @@ -204,10 +204,10 @@ QString MyDatePlugin::processFile( BatchRenamer* b, int i, QString, int ) ti = mktime( &tmp ); if( ti == -1 ) - return QString( i18n("Can't change date of file %1.") ).arg(filename); + return TQString( i18n("Can't change date of file %1.") ).tqarg(filename); if( stat( (const char *)filename, &st ) == -1 ) - return QString( i18n("Can't change date of file %1.") ).arg(filename); + return TQString( i18n("Can't change date of file %1.") ).tqarg(filename); if(dvals.changeAccess) t->actime = ti; @@ -220,18 +220,18 @@ QString MyDatePlugin::processFile( BatchRenamer* b, int i, QString, int ) t->modtime = st.st_mtime; if(utime( (const char *)filename, t ) != 0) - return QString( i18n("Can't change date of file %1.") ).arg(filename); + return TQString( i18n("Can't change date of file %1.") ).tqarg(filename); - return QString::null; + return TQString(); #endif } void MyDatePlugin::changeDT() { - spinHour->setValue( QTime::currentTime().hour()); - spinMinute->setValue( QTime::currentTime().minute()); - spinSecond->setValue( QTime::currentTime().second()); - kDate->setDate( QDate::currentDate() ); + spinHour->setValue( TQTime::currentTime().hour()); + spinMinute->setValue( TQTime::currentTime().minute()); + spinSecond->setValue( TQTime::currentTime().second()); + kDate->setDate( TQDate::tqcurrentDate() ); } diff --git a/krename/datetime.h b/krename/datetime.h index 769e4c7..6bb485e 100644 --- a/krename/datetime.h +++ b/krename/datetime.h @@ -31,49 +31,50 @@ class KDatePicker; class KIntSpinBox; -class QCheckBox; -class QButtonGroup; -class QGroupBox; -class QLabel; -class QVBoxLayout; -class QHBoxLayout; -class QPushButton; -class QString; -class QWidget; +class TQCheckBox; +class TQButtonGroup; +class TQGroupBox; +class TQLabel; +class TQVBoxLayout; +class TQHBoxLayout; +class TQPushButton; +class TQString; +class TQWidget; class MyDatePlugin: public Plugin { Q_OBJECT + TQ_OBJECT public: - const QString getName() const; - const QString getAccelName() const; + const TQString getName() const; + const TQString getAccelName() const; const int type() const; bool checkError(); - void drawInterface( QWidget* w, QVBoxLayout* l ); + void drawInterface( TQWidget* w, TQVBoxLayout* l ); void fillStructure(); - QString processFile( BatchRenamer*, int, QString token, int ); + TQString processFile( BatchRenamer*, int, TQString token, int ); - const QPixmap getIcon() const; + const TQPixmap getIcon() const; private slots: void changeDT(); protected: - QCheckBox* checkAccess; - QCheckBox* checkModification; + TQCheckBox* checkAccess; + TQCheckBox* checkModification; KDatePicker* kDate; - QLabel* labelTime; + TQLabel* labelTime; KIntSpinBox* spinHour; KIntSpinBox* spinMinute; KIntSpinBox* spinSecond; - QPushButton* buttonCurrentDT; + TQPushButton* buttonCurrentDT; - QHBoxLayout* Layout0; - QVBoxLayout* Layout1; - QHBoxLayout* Layout2; + TQHBoxLayout* Layout0; + TQVBoxLayout* Layout1; + TQHBoxLayout* Layout2; struct datevals { - QDate date; // Date + TQDate date; // Date bool changeModification; // Change modification date bool changeAccess; // Change access date diff --git a/krename/dsdirselectdialog.cpp b/krename/dsdirselectdialog.cpp index c37c88a..2051e7d 100644 --- a/krename/dsdirselectdialog.cpp +++ b/krename/dsdirselectdialog.cpp @@ -17,46 +17,46 @@ #include "dsdirselectdialog.h" -// Qt includes -#include <qcheckbox.h> -#include <qhbox.h> -#include <qlabel.h> -#include <qlayout.h> -#include <qtooltip.h> -#include <qvbox.h> +// TQt includes +#include <tqcheckbox.h> +#include <tqhbox.h> +#include <tqlabel.h> +#include <tqlayout.h> +#include <tqtooltip.h> +#include <tqvbox.h> // KDE includes #include <kdiroperator.h> #include <klocale.h> #include <kurlcombobox.h> -DSDirSelectDialog::DSDirSelectDialog( QWidget* parent ) - : KFileDialog( ":KRename", "*", parent, 0, false ) +DSDirSelectDialog::DSDirSelectDialog( TQWidget* tqparent ) + : KFileDialog( ":KRename", "*", tqparent, 0, false ) { setOperationMode( KFileDialog::Opening ); setMode( KFile::Files | KFile::ExistingOnly ); - QVBox* vbox = new QVBox( this ); + TQVBox* vbox = new TQVBox( this ); - if( layout() ) - layout()->add( vbox ); + if( tqlayout() ) + tqlayout()->add( vbox ); else - qDebug("KFileDialog does not have a layout!!!"); + qDebug("KFileDialog does not have a tqlayout!!!"); - checkDir = new QCheckBox( i18n("Add directory names &with filenames"), vbox ); - check = new QCheckBox( i18n("Add subdirectories &recursively"), vbox ); - QHBox* hbox = new QHBox( vbox ); - QWidget* spacer = new QWidget( hbox ); + checkDir = new TQCheckBox( i18n("Add directory names &with filenames"), vbox ); + check = new TQCheckBox( i18n("Add subdirectories &recursively"), vbox ); + TQHBox* hbox = new TQHBox( vbox ); + TQWidget* spacer = new TQWidget( hbox ); spacer->setMinimumWidth( 20 ); - checkHidden = new QCheckBox( i18n("Add &hidden directories"), hbox ); + checkHidden = new TQCheckBox( i18n("Add &hidden directories"), hbox ); hbox->setStretchFactor( checkHidden, 4 ); - checkOnlyDir = new QCheckBox( i18n("Add directory names only"), vbox ); - connect( check, SIGNAL( clicked() ), this, SLOT( enableControls() )); + checkOnlyDir = new TQCheckBox( i18n("Add directory names only"), vbox ); + connect( check, TQT_SIGNAL( clicked() ), this, TQT_SLOT( enableControls() )); - QToolTip::add( check, i18n("Walk recursively through the directory tree and add also the content of all subdirectories to the list of files to rename.") ); - QToolTip::add( checkHidden, i18n("If not checked, KRename will ignore directories starting with a dot during recursive adding.") ); - QToolTip::add( checkOnlyDir, i18n("Add only the directory names and not the names of the files in the directory to KRename.") ); - QToolTip::add( checkDir, i18n("This option causes KRename to add also the name of the base directory of the selected files to its list.") ); + TQToolTip::add( check, i18n("Walk recursively through the directory tree and add also the content of all subdirectories to the list of files to rename.") ); + TQToolTip::add( checkHidden, i18n("If not checked, KRename will ignore directories starting with a dot during recursive adding.") ); + TQToolTip::add( checkOnlyDir, i18n("Add only the directory names and not the names of the files in the directory to KRename.") ); + TQToolTip::add( checkDir, i18n("This option causes KRename to add also the name of the base directory of the selected files to its list.") ); enableControls(); } diff --git a/krename/dsdirselectdialog.h b/krename/dsdirselectdialog.h index 55dc573..66cd3ba 100644 --- a/krename/dsdirselectdialog.h +++ b/krename/dsdirselectdialog.h @@ -20,16 +20,17 @@ #include <kfiledialog.h> -class QCheckBox; -class QLabel; +class TQCheckBox; +class TQLabel; class KComboBox; -/* A small helper class to allow layout changes in KDirSelectDialog */ +/* A small helper class to allow tqlayout changes in KDirSelectDialog */ class DSDirSelectDialog : public KFileDialog { Q_OBJECT + TQ_OBJECT public: - DSDirSelectDialog( QWidget* parent ); + DSDirSelectDialog( TQWidget* tqparent ); bool recursively() const; bool hidden() const; @@ -44,11 +45,11 @@ class DSDirSelectDialog : public KFileDialog { void slotOk(); private: - QCheckBox* check; - QCheckBox* checkHidden; - QCheckBox* checkDir; - QCheckBox* checkOnlyDir; - QLabel* label; + TQCheckBox* check; + TQCheckBox* checkHidden; + TQCheckBox* checkDir; + TQCheckBox* checkOnlyDir; + TQLabel* label; }; #endif diff --git a/krename/encodingplugin.cpp b/krename/encodingplugin.cpp index 1bbabce..0b160bb 100644 --- a/krename/encodingplugin.cpp +++ b/krename/encodingplugin.cpp @@ -18,11 +18,11 @@ #include "encodingplugin.h" // QT includes -#include <qcheckbox.h> -#include <qlabel.h> -#include <qlayout.h> -#include <qtextcodec.h> -#include <qvgroupbox.h> +#include <tqcheckbox.h> +#include <tqlabel.h> +#include <tqlayout.h> +#include <tqtextcodec.h> +#include <tqvgroupbox.h> // KDE includes @@ -32,12 +32,12 @@ #include <klocale.h> #include <kmessagebox.h> -const QString EncodingPlugin::getName() const +const TQString EncodingPlugin::getName() const { return i18n("Encoding Conversion Plugin"); } -const QString EncodingPlugin::getAccelName() const +const TQString EncodingPlugin::getAccelName() const { return i18n("&Encoding Conversion Plugin"); } @@ -47,32 +47,32 @@ const int EncodingPlugin::type() const return TYPE_FINAL_FILENAME; } -void EncodingPlugin::drawInterface( QWidget* w, QVBoxLayout* l ) +void EncodingPlugin::drawInterface( TQWidget* w, TQVBoxLayout* l ) { // build a list of all available TextCodecs - QStringList codecs; - QTextCodec *codec; - for( int i=0; (codec = QTextCodec::codecForIndex(i));i++) + TQStringList codecs; + TQTextCodec *codec; + for( int i=0; (codec = TQTextCodec::codecForIndex(i));i++) codecs.append( codec->name() ); m_widget = w; - codec = QTextCodec::codecForLocale(); + codec = TQTextCodec::codecForLocale(); m_locale_codec = codec->name(); - QLabel* label = new QLabel( + TQLabel* label = new TQLabel( i18n("<qt>This plugin is able to convert filenames between different " "encodings. For example you can convert filenames from KOI8-R " "to UTF-8 encoding.</qt>"), w ); l->addWidget( label ); - QVGroupBox* groupInput = new QVGroupBox( i18n("Encoding of Input Files:"), w ); - checkInput = new QCheckBox( i18n("&Use local encoding: %1").arg( m_locale_codec), groupInput ); + TQVGroupBox* groupInput = new TQVGroupBox( i18n("Encoding of Input Files:"), w ); + checkInput = new TQCheckBox( i18n("&Use local encoding: %1").tqarg( m_locale_codec), groupInput ); comboInput = new KComboBox( false, groupInput ); comboInput->insertStringList( codecs ); - QVGroupBox* groupOutput = new QVGroupBox( i18n("Encoding of Output Files:"), w ); - checkOutput = new QCheckBox( i18n("&Use local encoding: %1").arg( m_locale_codec), groupOutput ); + TQVGroupBox* groupOutput = new TQVGroupBox( i18n("Encoding of Output Files:"), w ); + checkOutput = new TQCheckBox( i18n("&Use local encoding: %1").tqarg( m_locale_codec), groupOutput ); checkOutput->setChecked( true ); comboOutput = new KComboBox( false, groupOutput ); comboOutput->insertStringList( codecs ); @@ -80,11 +80,11 @@ void EncodingPlugin::drawInterface( QWidget* w, QVBoxLayout* l ) l->addWidget( groupInput ); l->addWidget( groupOutput ); - connect( checkInput, SIGNAL( clicked() ), this, SLOT( enableControls() ) ); - connect( checkOutput, SIGNAL( clicked() ), this, SLOT( enableControls() ) ); + connect( checkInput, TQT_SIGNAL( clicked() ), this, TQT_SLOT( enableControls() ) ); + connect( checkOutput, TQT_SIGNAL( clicked() ), this, TQT_SLOT( enableControls() ) ); - connect( comboOutput, SIGNAL( activated(int) ),this, SLOT( updatePreview() ) ); - connect( comboInput, SIGNAL( activated(int) ),this, SLOT( updatePreview() ) ); + connect( comboOutput, TQT_SIGNAL( activated(int) ),this, TQT_SLOT( updatePreview() ) ); + connect( comboInput, TQT_SIGNAL( activated(int) ),this, TQT_SLOT( updatePreview() ) ); setLocale( comboInput ); setLocale( comboOutput ); @@ -103,16 +103,16 @@ bool EncodingPlugin::checkError() return true; } -QString EncodingPlugin::processFile( BatchRenamer*, int, QString token, int ) +TQString EncodingPlugin::processFile( BatchRenamer*, int, TQString token, int ) { - QString input = token; - QString unicode = QString::null; + TQString input = token; + TQString tqunicode = TQString(); - QTextCodec* toUnicode = QTextCodec::codecForName(m_input_codec); // get the codec for KOI8-R - QTextCodec* fromUnicode = QTextCodec::codecForName(m_output_codec); + TQTextCodec* toUnicode = TQTextCodec::codecForName(m_input_codec); // get the codec for KOI8-R + TQTextCodec* fromUnicode = TQTextCodec::codecForName(m_output_codec); - unicode = toUnicode->toUnicode( input ); - return fromUnicode->fromUnicode( unicode ); + tqunicode = toUnicode->toUnicode( input ); + return fromUnicode->fromUnicode( tqunicode ); } void EncodingPlugin::finished() @@ -120,7 +120,7 @@ void EncodingPlugin::finished() } -const QPixmap EncodingPlugin::getIcon() const +const TQPixmap EncodingPlugin::getIcon() const { return kapp->iconLoader()->loadIcon( "fonts", KIcon::Small ); } diff --git a/krename/encodingplugin.h b/krename/encodingplugin.h index 801dd3f..cae24ea 100644 --- a/krename/encodingplugin.h +++ b/krename/encodingplugin.h @@ -25,22 +25,23 @@ #include "fileoperation.h" class KComboBox; -class QCheckBox; +class TQCheckBox; class EncodingPlugin : public Plugin { Q_OBJECT + TQ_OBJECT public: - const QString getName() const; - const QString getAccelName() const; + const TQString getName() const; + const TQString getAccelName() const; const int type() const; bool checkError(); - void drawInterface( QWidget* w, QVBoxLayout* l ); + void drawInterface( TQWidget* w, TQVBoxLayout* l ); void fillStructure(); - QString processFile( BatchRenamer*, int, QString token, int ); + TQString processFile( BatchRenamer*, int, TQString token, int ); void finished(); - const QPixmap getIcon() const; + const TQPixmap getIcon() const; private slots: void enableControls(); @@ -50,15 +51,15 @@ class EncodingPlugin : public Plugin { FileOperation fop; - QString m_input_codec; - QString m_output_codec; - QString m_locale_codec; + TQString m_input_codec; + TQString m_output_codec; + TQString m_locale_codec; int mib_input; int mib_output; - QCheckBox* checkInput; - QCheckBox* checkOutput; + TQCheckBox* checkInput; + TQCheckBox* checkOutput; KComboBox* comboInput; KComboBox* comboOutput; diff --git a/krename/fileoperation.cpp b/krename/fileoperation.cpp index 23fa405..cfc558b 100644 --- a/krename/fileoperation.cpp +++ b/krename/fileoperation.cpp @@ -22,13 +22,9 @@ #include <kio/job.h> // QT includes -#if QT_VERSION >= 0x030100 - #include <qeventloop.h> -#else - #include <qapplication.h> -#endif +#include <tqeventloop.h> -#include <qfileinfo.h> +#include <tqfileinfo.h> // OS includes #include <stdio.h> @@ -54,7 +50,7 @@ bool FileOperation::start( const KURL & src, const KURL & dest, int mode, bool o result = 0; if( src == dest && !overwrite ) { - m_error = QString( i18n( "File %1 exists already!") ).arg( dest.prettyURL() ); + m_error = TQString( i18n( "File %1 exists already!") ).tqarg( dest.prettyURL() ); return false; } @@ -76,7 +72,7 @@ bool FileOperation::start( const KURL & src, const KURL & dest, int mode, bool o } else { - m_error = i18n("Can't create symlinks on different hosts for file %1.").arg( src.prettyURL() ); + m_error = i18n("Can't create symlinks on different hosts for file %1.").tqarg( src.prettyURL() ); result = true; return !result; } @@ -87,25 +83,21 @@ bool FileOperation::start( const KURL & src, const KURL & dest, int mode, bool o return false; job->setAutoErrorHandlingEnabled( false, 0 ); - connect( job, SIGNAL( result (KIO::Job *) ), - this, SLOT( slotResult (KIO::Job *) ) ); + connect( job, TQT_SIGNAL( result (KIO::Job *) ), + this, TQT_SLOT( slotResult (KIO::Job *) ) ); -#if QT_VERSION >= 0x030100 kapp->eventLoop()->enterLoop(); -#else - kapp->enter_loop(); -#endif return !result; } -bool FileOperation::fcopy( const QString & src, const QString & dest ) +bool FileOperation::fcopy( const TQString & src, const TQString & dest ) { return start( KURL( src ), KURL( dest ), KIO::CopyJob::Copy, false ); } -QString FileOperation::getName( const QString & file ) +TQString FileOperation::getName( const TQString & file ) { - QFileInfo info( file ); + TQFileInfo info( file ); return info.fileName(); } @@ -115,10 +107,6 @@ void FileOperation::slotResult( KIO::Job * job ) if( result ) m_error = job->errorString(); -#if QT_VERSION >= 0x030100 kapp->eventLoop()->exitLoop(); -#else - kapp->exit_loop(); -#endif } diff --git a/krename/fileoperation.h b/krename/fileoperation.h index 32a2552..a9151e8 100644 --- a/krename/fileoperation.h +++ b/krename/fileoperation.h @@ -18,22 +18,23 @@ #ifndef FILEOPERATION_H #define FILEOPERATION_H -#include <qobject.h> +#include <tqobject.h> #include <kio/jobclasses.h> #include <kurl.h> -class QString; -class FileOperation: public QObject { +class TQString; +class FileOperation: public TQObject { Q_OBJECT + TQ_OBJECT public: FileOperation(); ~FileOperation(); bool start( const KURL & src, const KURL & dest, int mode, bool overwrite ); - bool fcopy( const QString & src, const QString & dest ); + bool fcopy( const TQString & src, const TQString & dest ); - inline const QString & error() const; - static QString getName( const QString & file ); + inline const TQString & error() const; + static TQString getName( const TQString & file ); private slots: void slotResult( KIO::Job * job ); @@ -43,10 +44,10 @@ class FileOperation: public QObject { bool canceled; int result; - QString m_error; + TQString m_error; }; -inline const QString & FileOperation::error() const +inline const TQString & FileOperation::error() const { return m_error; } diff --git a/krename/fileplugin.cpp b/krename/fileplugin.cpp index 535b8bb..6c43053 100644 --- a/krename/fileplugin.cpp +++ b/krename/fileplugin.cpp @@ -17,11 +17,11 @@ #include "fileplugin.h" -// Qt includes -#include <qcheckbox.h> -#include <qlabel.h> -#include <qlayout.h> -#include <qregexp.h> +// TQt includes +#include <tqcheckbox.h> +#include <tqlabel.h> +#include <tqlayout.h> +#include <tqregexp.h> // KDE includes #include <kapplication.h> @@ -42,7 +42,7 @@ FilePlugin::FilePlugin( KService* service ) KFileMetaInfoProvider* mip = KFileMetaInfoProvider::self(); m_name = service->name(); m_comment = service->comment(); - QStringList options = service->serviceTypes(); + TQStringList options = service->serviceTypes(); for( unsigned int i = 0; i < options.count(); i++ ) { if( options[i] != "KFilePlugin" ) { m_mimetype = options[i]; @@ -53,7 +53,7 @@ FilePlugin::FilePlugin( KService* service ) fileplugin = mip->plugin( m_mimetype ); KMimeType::Ptr mime = KMimeType::mimeType( m_mimetype ); - m_icon = mime->icon( QString::null, true ); // arguments are unused + m_icon = mime->icon( TQString(), true ); // arguments are unused setPattern( mime ); } @@ -65,7 +65,7 @@ FilePlugin::~FilePlugin() void FilePlugin::setPattern( KMimeType::Ptr mime ) { - QStringList pattern = mime->patterns(); + TQStringList pattern = mime->patterns(); if( pattern.count() ) { m_pattern = pattern[0]; if( m_pattern.startsWith( "*." ) ) @@ -76,11 +76,11 @@ void FilePlugin::setPattern( KMimeType::Ptr mime ) // We need a pattern if( m_pattern.isEmpty() ) { int a = 0; - a = m_name.find( "-" ); + a = m_name.tqfind( "-" ); if( a > -1 ) m_pattern = m_name.left( a ).lower(); else { - a = m_pattern.find( " " ); + a = m_pattern.tqfind( " " ); if( a > -1 ) m_pattern = m_name.left( a ).lower(); else @@ -97,17 +97,17 @@ void FilePlugin::setupKeys() keys[i] = getPattern() + keys[i]; } -const QString FilePlugin::getName() const +const TQString FilePlugin::getName() const { return m_name; } -const QString FilePlugin::getAccelName() const +const TQString FilePlugin::getAccelName() const { return "&" + getName(); } -const QString FilePlugin::getPattern() const +const TQString FilePlugin::getPattern() const { return m_pattern; } @@ -122,22 +122,22 @@ bool FilePlugin::checkError() return true; } -void FilePlugin::drawInterface( QWidget* w, QVBoxLayout* l ) +void FilePlugin::drawInterface( TQWidget* w, TQVBoxLayout* l ) { - QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Expanding ); + TQSpacerItem* spacer = new TQSpacerItem( 20, 20, TQSizePolicy::Expanding, TQSizePolicy::Expanding ); - QHBoxLayout* hbox = new QHBoxLayout( 0, 6, 6 ); + TQHBoxLayout* hbox = new TQHBoxLayout( 0, 6, 6 ); - QLabel* pix = new QLabel( w ); + TQLabel* pix = new TQLabel( w ); pix->setPixmap( kapp->iconLoader()->loadIcon( m_icon, KIcon::Desktop ) ); hbox->addWidget( pix ); - hbox->addWidget( new QLabel( "<qt><b>"+getName()+"</b></qt>", w ) ); + hbox->addWidget( new TQLabel( "<qt><b>"+getName()+"</b></qt>", w ) ); hbox->addItem( spacer ); l->addLayout( hbox ); - l->addWidget( new QLabel( m_comment, w ) ); - l->addWidget( new QLabel( i18n("Supported tokens:"), w ) ); + l->addWidget( new TQLabel( m_comment, w ) ); + l->addWidget( new TQLabel( i18n("Supported tokens:"), w ) ); KListBox* list = new KListBox( w ); list->setColumnMode( KListBox::FitToWidth ); @@ -149,27 +149,27 @@ void FilePlugin::drawInterface( QWidget* w, QVBoxLayout* l ) l->setStretchFactor( list, 2 ); } -QString FilePlugin::processFile( BatchRenamer* b, int i, QString token, int ) +TQString FilePlugin::processFile( BatchRenamer* b, int i, TQString token, int ) { - QString filename = BatchRenamer::buildFilename( &b->files()[i].src ); + TQString filename = BatchRenamer::buildFilename( &b->files()[i].src ); token = token.lower(); /* * Check if we have something cached for this file */ - if( cache.contains( filename + "::" + token ) ) + if( cache.tqcontains( filename + "::" + token ) ) return cache[filename + "::" + token ]; for( unsigned int i = 0; i < keys.count(); i++ ) { if( token.lower() == keys[i].lower() ) { KFileMetaInfo meta( filename ); if( meta.isValid() ) { - QString k = keys[i]; + TQString k = keys[i]; if( k.startsWith( getPattern() ) ) k = k.mid( getPattern().length(), k.length() - getPattern().length() ); - QString ret = meta.item( k ).string( true ).stripWhiteSpace(); + TQString ret = meta.item( k ).string( true ).stripWhiteSpace(); if( cache.count() >= CACHE_MAX ) cache.remove( cache.begin() ); @@ -181,27 +181,27 @@ QString FilePlugin::processFile( BatchRenamer* b, int i, QString token, int ) } } - return QString::null; + return TQString(); } void FilePlugin::addHelp( HelpDialogData* data ) { - QStringList list; + TQStringList list; for( unsigned int i = 0; i < keys.count(); i++ ) list.append( "[" + keys[i] + "]" + ";;" + keys[i] ); data->add( getName(), &list, getIcon() ); } -const QPixmap FilePlugin::getIcon() const +const TQPixmap FilePlugin::getIcon() const { return kapp->iconLoader()->loadIcon( m_icon, KIcon::Small ); } -bool FilePlugin::supports( const QString & token ) +bool FilePlugin::supports( const TQString & token ) { for( unsigned int i = 0; i < keys.count(); i++ ) - if( QRegExp( keys[i].lower() ).exactMatch( token.lower() ) ) + if( TQRegExp( keys[i].lower() ).exactMatch( token.lower() ) ) return true; return false; diff --git a/krename/fileplugin.h b/krename/fileplugin.h index 8931936..b9b2fa7 100644 --- a/krename/fileplugin.h +++ b/krename/fileplugin.h @@ -33,33 +33,34 @@ class KFileMetaInfoProvider; class KFileMimeTypeInfo; class KPushButton; class KService; -class QLabel; -class QWidget; -class QVBoxLayout; +class TQLabel; +class TQWidget; +class TQVBoxLayout; class KFilePlugin; class FilePlugin : public Plugin { Q_OBJECT + TQ_OBJECT public: FilePlugin( KService* service ); ~FilePlugin(); inline bool isValid() const; - virtual const QString getName() const; - virtual const QString getAccelName() const; - virtual const QString getPattern() const; + virtual const TQString getName() const; + virtual const TQString getAccelName() const; + virtual const TQString getPattern() const; virtual const int type() const; virtual bool checkError(); - virtual void drawInterface( QWidget* w, QVBoxLayout* l ); - virtual QString processFile( BatchRenamer* b, int i, QString token, int mode ); + virtual void drawInterface( TQWidget* w, TQVBoxLayout* l ); + virtual TQString processFile( BatchRenamer* b, int i, TQString token, int mode ); virtual void addHelp( HelpDialogData* data ); - virtual const QPixmap getIcon() const; + virtual const TQPixmap getIcon() const; virtual bool alwaysUsed() const { return true; } - virtual const QStringList getKeys() const { return keys; } + virtual const TQStringList getKeys() const { return keys; } virtual void clearCache(); @@ -67,15 +68,15 @@ class FilePlugin : public Plugin { void setPattern( KMimeType::Ptr mime ); protected: - bool supports( const QString & token ); + bool supports( const TQString & token ); void setupKeys(); - QMap<QString,QString> cache; + TQMap<TQString,TQString> cache; KFilePlugin* fileplugin; - QString m_name, m_comment, m_icon, m_mimetype, m_pattern; + TQString m_name, m_comment, m_icon, m_mimetype, m_pattern; - QStringList keys; + TQStringList keys; }; bool FilePlugin::isValid() const diff --git a/krename/firststartdlg.cpp b/krename/firststartdlg.cpp index 39b4941..928d74c 100644 --- a/krename/firststartdlg.cpp +++ b/krename/firststartdlg.cpp @@ -17,9 +17,9 @@ #include "firststartdlg.h" -FirstStartDlg::FirstStartDlg(QWidget *parent, const char *name ) +FirstStartDlg::FirstStartDlg(TQWidget *tqparent, const char *name ) : KDialogBase( KDialogBase::Plain, "KRename", - KDialogBase::Ok, KDialogBase::Ok, parent, name, true, true ), + KDialogBase::Ok, KDialogBase::Ok, tqparent, name, true, true ), GUIModeSelector() { setCaption( guiModeCaption() ); diff --git a/krename/firststartdlg.h b/krename/firststartdlg.h index 998d617..422c69a 100644 --- a/krename/firststartdlg.h +++ b/krename/firststartdlg.h @@ -18,14 +18,15 @@ #ifndef FIRSTSTARTDLG_H #define FIRSTSTARTDLG_H -#include <qwidget.h> +#include <tqwidget.h> #include <kdialogbase.h> #include "guimodeselector.h" class FirstStartDlg : public KDialogBase, public GUIModeSelector { Q_OBJECT + TQ_OBJECT public: - FirstStartDlg(QWidget *parent=0, const char *name=0); + FirstStartDlg(TQWidget *tqparent=0, const char *name=0); ~FirstStartDlg(); }; diff --git a/krename/guimodeselector.cpp b/krename/guimodeselector.cpp index 92b0e94..bdd8603 100644 --- a/krename/guimodeselector.cpp +++ b/krename/guimodeselector.cpp @@ -17,12 +17,12 @@ #include "guimodeselector.h" -// Qt includes -#include <qbuttongroup.h> -#include <qframe.h> -#include <qlabel.h> -#include <qlayout.h> -#include <qradiobutton.h> +// TQt includes +#include <tqbuttongroup.h> +#include <tqframe.h> +#include <tqlabel.h> +#include <tqlayout.h> +#include <tqradiobutton.h> // KDE includes #include <klocale.h> @@ -47,32 +47,32 @@ void GUIModeSelector::setUseWizard( bool b ) optionTabs->setChecked( !b ); } -const QString GUIModeSelector::guiModeCaption() const +const TQString GUIModeSelector::guiModeCaption() const { return i18n("Look and Feel"); } -void GUIModeSelector::createFrame( QFrame* frame ) +void GUIModeSelector::createFrame( TQFrame* frame ) { - QVBoxLayout* layout = new QVBoxLayout( frame ); - QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding ); + TQVBoxLayout* tqlayout = new TQVBoxLayout( frame ); + TQSpacerItem* spacer = new TQSpacerItem( 20, 20, TQSizePolicy::Minimum, TQSizePolicy::Expanding ); - QButtonGroup* group = new QButtonGroup( frame ); + TQButtonGroup* group = new TQButtonGroup( frame ); group->setColumnLayout(0, Qt::Vertical ); - QVBoxLayout* lgroup = new QVBoxLayout( group->layout() ); + TQVBoxLayout* lgroup = new TQVBoxLayout( group->tqlayout() ); - optionWizard = new QRadioButton( group ); + optionWizard = new TQRadioButton( group ); optionWizard->setText( i18n("Use &wizard style GUI (beginners)") ); - optionTabs = new QRadioButton( group ); + optionTabs = new TQRadioButton( group ); optionTabs->setText( i18n("Use &tabbed GUI (advanced users)") ); - lgroup->addWidget( new QLabel( i18n("Configure the look and feel of the KRename GUI:<br>"), group ) ); + lgroup->addWidget( new TQLabel( i18n("Configure the look and feel of the KRename GUI:<br>"), group ) ); lgroup->addWidget( optionWizard ); lgroup->addWidget( optionTabs ); lgroup->addItem( spacer ); - layout->addWidget( group ); - layout->addItem( spacer ); + tqlayout->addWidget( group ); + tqlayout->addItem( spacer ); } diff --git a/krename/guimodeselector.h b/krename/guimodeselector.h index 524319f..565f5e7 100644 --- a/krename/guimodeselector.h +++ b/krename/guimodeselector.h @@ -18,10 +18,10 @@ #ifndef GUIMODESELECTOR_H #define GUIMODESELECTOR_H -#include <qobject.h> +#include <tqobject.h> -class QFrame; -class QRadioButton; +class TQFrame; +class TQRadioButton; class GUIModeSelector { public: GUIModeSelector(); @@ -31,11 +31,11 @@ class GUIModeSelector { void setUseWizard( bool b ); protected: - const QString guiModeCaption() const; - void createFrame( QFrame* frame ); + const TQString guiModeCaption() const; + void createFrame( TQFrame* frame ); - QRadioButton* optionWizard; - QRadioButton* optionTabs; + TQRadioButton* optionWizard; + TQRadioButton* optionTabs; }; #endif diff --git a/krename/helpdialog.cpp b/krename/helpdialog.cpp index 2707f38..9183d7a 100644 --- a/krename/helpdialog.cpp +++ b/krename/helpdialog.cpp @@ -17,10 +17,10 @@ #include "helpdialog.h" #include "krenameimpl.h" -// Qt includes -#include <qcombobox.h> -#include <qlayout.h> -#include <qlineedit.h> +// TQt includes +#include <tqcombobox.h> +#include <tqlayout.h> +#include <tqlineedit.h> // KDE includes #include <klocale.h> @@ -28,9 +28,9 @@ #include <kpushbutton.h> #include <kstdguiitem.h> -void HelpDialogData::remove( const QString & headline ) +void HelpDialogData::remove( const TQString & headline ) { - if( m_map.contains( headline ) ) { + if( m_map.tqcontains( headline ) ) { m_map.remove( headline ); m_icons.remove( headline ); @@ -39,7 +39,7 @@ void HelpDialogData::remove( const QString & headline ) } } -void HelpDialogData::add( const QString & headline, QStringList* commands, const QPixmap & icon, bool first ) +void HelpDialogData::add( const TQString & headline, TQStringList* commands, const TQPixmap & icon, bool first ) { m_map.insert( headline, *commands ); m_icons.insert( headline, icon ); @@ -50,39 +50,31 @@ void HelpDialogData::add( const QString & headline, QStringList* commands, const emit updateItems(); } -QStringList HelpDialogData::tokens() const +TQStringList HelpDialogData::tokens() const { - QStringList list; - -#if QT_VERSION >= 0x030005 - // map.keys() seems only to be avaible in Qt >= 3.0.5 - QStringList keys = m_map.keys(); -#else - QStringList keys; - QMap<QString, QStringList>::Iterator it; - for ( it = m_map.begin(); it != m_map.end(); ++it ) - keys.append( it.key() ); -#endif + TQStringList list; + + TQStringList keys = m_map.keys(); for( unsigned int i = 0; i < keys.count(); i++ ) for( unsigned int z = 0; z < m_map[keys[i]].count(); z++ ) list.append( m_map[keys[i]][z].section( ";;", 0, 0 ) ); - + return list; } -HelpDialog::HelpDialog( HelpDialogData* data, QWidget* parent, +HelpDialog::HelpDialog( HelpDialogData* data, TQWidget* tqparent, const char* name, bool modal, WFlags fl ) - : QDialog( parent, name, modal, fl ) + : TQDialog( tqparent, name, modal, fl ) { text = NULL; resize( 500, 400 ); setCaption( i18n( "Help" ) ); - HelpDialogLayout = new QVBoxLayout( this, 11, 6, "HelpDialogLayout"); + HelpDialogLayout = new TQVBoxLayout( this, 11, 6, "HelpDialogLayout"); - comboHeadline = new QComboBox( FALSE, this, "comboHeadline" ); + comboHeadline = new TQComboBox( FALSE, this, "comboHeadline" ); HelpDialogLayout->addWidget( comboHeadline ); list = new KListView( this, "list" ); @@ -90,8 +82,8 @@ HelpDialog::HelpDialog( HelpDialogData* data, QWidget* parent, list->addColumn( i18n( "Description" ) ); HelpDialogLayout->addWidget( list ); - Layout1 = new QHBoxLayout( 0, 0, 6, "Layout1"); - QSpacerItem* spacer = new QSpacerItem( 91, 0, QSizePolicy::Expanding, QSizePolicy::Minimum ); + Layout1 = new TQHBoxLayout( 0, 0, 6, "Layout1"); + TQSpacerItem* spacer = new TQSpacerItem( 91, 0, TQSizePolicy::Expanding, TQSizePolicy::Minimum ); Layout1->addItem( spacer ); buttonAdd = new KPushButton( this, "buttonAdd" ); @@ -103,20 +95,20 @@ HelpDialog::HelpDialog( HelpDialogData* data, QWidget* parent, HelpDialogLayout->addLayout( Layout1 ); // signals and slots connections - connect( buttonClose, SIGNAL( clicked() ), this, SLOT( accept() ) ); - connect( buttonAdd, SIGNAL( clicked() ), this, SLOT( execute() ) ); - connect( list, SIGNAL( executed(QListViewItem*) ), this, SLOT( execute() ) ); - connect( comboHeadline, SIGNAL( activated(int) ), this, SLOT(updateItems() ) ); + connect( buttonClose, TQT_SIGNAL( clicked() ), this, TQT_SLOT( accept() ) ); + connect( buttonAdd, TQT_SIGNAL( clicked() ), this, TQT_SLOT( execute() ) ); + connect( list, TQT_SIGNAL( executed(TQListViewItem*) ), this, TQT_SLOT( execute() ) ); + connect( comboHeadline, TQT_SIGNAL( activated(int) ), this, TQT_SLOT(updateItems() ) ); m_data = data; - connect( m_data, SIGNAL( updateItems() ), this, SLOT( updateItems() ) ); - connect( m_data, SIGNAL( updateHeadline() ), this, SLOT( updateHeadline() ) ); + connect( m_data, TQT_SIGNAL( updateItems() ), this, TQT_SLOT( updateItems() ) ); + connect( m_data, TQT_SIGNAL( updateHeadline() ), this, TQT_SLOT( updateHeadline() ) ); } HelpDialog::~HelpDialog() { - disconnect( m_data, SIGNAL( updateItems() ), this, SLOT( updateItems() ) ); - disconnect( m_data, SIGNAL( updateHeadline() ), this, SLOT( updateHeadline() ) ); + disconnect( m_data, TQT_SIGNAL( updateItems() ), this, TQT_SLOT( updateItems() ) ); + disconnect( m_data, TQT_SIGNAL( updateHeadline() ), this, TQT_SLOT( updateHeadline() ) ); } void HelpDialog::execute() @@ -124,7 +116,7 @@ void HelpDialog::execute() if(!list->currentItem()) return; - QString t = text->text(); + TQString t = text->text(); t.insert( text->cursorPosition(), list->currentItem()->text( 0 ) ); text->setText( t ); @@ -136,10 +128,10 @@ void HelpDialog::execute() void HelpDialog::updateItems() { list->clear(); - QStringList items = m_data->map()[comboHeadline->currentText()]; + TQStringList items = m_data->map()[comboHeadline->currentText()]; for( unsigned int i = 0; i < items.count(); i++ ) { - QString tmp = items[i]; + TQString tmp = items[i]; new KListViewItem( list, tmp.section( ";;", 0, 0 ), tmp.section( ";;", 1, 1 ) ); } } @@ -147,11 +139,11 @@ void HelpDialog::updateItems() void HelpDialog::updateHeadline() { comboHeadline->clear(); - QMap<QString,QStringList> m = m_data->map(); - QMap<QString,QPixmap> ic = m_data->icons(); + TQMap<TQString,TQStringList> m = m_data->map(); + TQMap<TQString,TQPixmap> ic = m_data->icons(); comboHeadline->insertItem( ic[m_data->first()], m_data->first() ); - QMap<QString, QStringList>::Iterator it; + TQMap<TQString, TQStringList>::Iterator it; for ( it = m.begin(); it != m.end(); ++it ) if( it.key() != m_data->first() ) comboHeadline->insertItem( ic[it.key()], it.key() ); diff --git a/krename/helpdialog.h b/krename/helpdialog.h index f15f541..4e97916 100644 --- a/krename/helpdialog.h +++ b/krename/helpdialog.h @@ -18,44 +18,45 @@ #ifndef HELPDIALOG_H #define HELPDIALOG_H -#include <qdialog.h> -#include <qstringlist.h> -#include <qpixmap.h> -#include <qmap.h> +#include <tqdialog.h> +#include <tqstringlist.h> +#include <tqpixmap.h> +#include <tqmap.h> -class QVBoxLayout; -class QHBoxLayout; -class QGridLayout; -class QComboBox; -class QLineEdit; -class QPixmap; +class TQVBoxLayout; +class TQHBoxLayout; +class TQGridLayout; +class TQComboBox; +class TQLineEdit; +class TQPixmap; class KListView; class KPushButton; -class HelpDialogData : public QObject { +class HelpDialogData : public TQObject { Q_OBJECT + TQ_OBJECT public: HelpDialogData() {} ~HelpDialogData() {} - void add( const QString & headline, QStringList* commands, const QPixmap & icon, bool first = false ); - void remove( const QString & headline ); + void add( const TQString & headline, TQStringList* commands, const TQPixmap & icon, bool first = false ); + void remove( const TQString & headline ); /** returns all available and supported tokens */ - QStringList tokens() const; + TQStringList tokens() const; - inline const QMap<QString,QStringList> & map() const + inline const TQMap<TQString,TQStringList> & map() const { return m_map; } - inline const QMap<QString,QPixmap> & icons() const + inline const TQMap<TQString,TQPixmap> & icons() const { return m_icons; } - inline const QString & first() const + inline const TQString & first() const { return m_first; } @@ -65,21 +66,22 @@ class HelpDialogData : public QObject { void updateItems(); private: - QMap<QString,QStringList> m_map; - QMap<QString,QPixmap> m_icons; + TQMap<TQString,TQStringList> m_map; + TQMap<TQString,TQPixmap> m_icons; - QString m_first; + TQString m_first; }; -class HelpDialog : public QDialog +class HelpDialog : public TQDialog { Q_OBJECT + TQ_OBJECT public: - HelpDialog( HelpDialogData* data, QWidget* parent = 0, + HelpDialog( HelpDialogData* data, TQWidget* tqparent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 ); ~HelpDialog(); - inline void setLineEdit( QLineEdit* lineedit ); + inline void setLineEdit( TQLineEdit* lineedit ); public slots: void updateItems(); @@ -89,7 +91,7 @@ class HelpDialog : public QDialog void execute(); private: - QComboBox* comboHeadline; + TQComboBox* comboHeadline; KListView* list; KPushButton* buttonAdd; KPushButton* buttonClose; @@ -97,13 +99,13 @@ class HelpDialog : public QDialog protected: HelpDialogData* m_data; - QLineEdit* text; + TQLineEdit* text; - QVBoxLayout* HelpDialogLayout; - QHBoxLayout* Layout1; + TQVBoxLayout* HelpDialogLayout; + TQHBoxLayout* Layout1; }; -void HelpDialog::setLineEdit( QLineEdit* lineedit ) +void HelpDialog::setLineEdit( TQLineEdit* lineedit ) { text = lineedit; } diff --git a/krename/kmyhistorycombo.cpp b/krename/kmyhistorycombo.cpp index 604d352..c9409ed 100644 --- a/krename/kmyhistorycombo.cpp +++ b/krename/kmyhistorycombo.cpp @@ -16,7 +16,7 @@ ***************************************************************************/ // QT includes -#include <qlistbox.h> +#include <tqlistbox.h> // Own includes #include "kmyhistorycombo.h" @@ -25,8 +25,8 @@ #include <kconfig.h> #include <klocale.h> -#include <qpopupmenu.h> -#include <qtimer.h> +#include <tqpopupmenu.h> +#include <tqtimer.h> #define TIMER_DELAY 500 @@ -36,18 +36,18 @@ #define KRENAME_NUMBER 5003 #define KRENAME_DATE 5004 -KMyHistoryCombo::KMyHistoryCombo( bool customPopup, QWidget* parent, const char* name) - : KHistoryCombo(parent, name) +KMyHistoryCombo::KMyHistoryCombo( bool customPopup, TQWidget* tqparent, const char* name) + : KHistoryCombo(tqparent, name) { - QStringList history; - QStringList completion; + TQStringList history; + TQStringList completion; KConfig* config = kapp->config(); config->setGroup( name ); this->setDuplicatesEnabled( false ); history = config->readListEntry("History"); completion = config->readListEntry("CompletionItems"); - m_timer = new QTimer(); + m_timer = new TQTimer(); setHistoryItems( history ); @@ -55,11 +55,11 @@ KMyHistoryCombo::KMyHistoryCombo( bool customPopup, QWidget* parent, const char* setCompletionMode( (KGlobalSettings::Completion)config->readNumEntry( "CompletionMode", KGlobalSettings::completionMode() ) ); - connect( this, SIGNAL( textChanged( const QString & ) ), this, SLOT( textChangedGovernor() ) ); - connect( m_timer, SIGNAL( timeout() ), this, SIGNAL( delayedTextChanged() ) ); + connect( this, TQT_SIGNAL( textChanged( const TQString & ) ), this, TQT_SLOT( textChangedGovernor() ) ); + connect( m_timer, TQT_SIGNAL( timeout() ), this, TQT_SIGNAL( delayedTextChanged() ) ); if( customPopup ) - connect( this, SIGNAL( aboutToShowContextMenu( QPopupMenu* ) ), this, SLOT( slotCustomContextMenu( QPopupMenu* ) ) ); + connect( this, TQT_SIGNAL( aboutToShowContextMenu( TQPopupMenu* ) ), this, TQT_SLOT( slotCustomContextMenu( TQPopupMenu* ) ) ); } KMyHistoryCombo::~KMyHistoryCombo() @@ -81,22 +81,22 @@ void KMyHistoryCombo::saveSettings() config->sync(); } -QString KMyHistoryCombo::text( int index ) const +TQString KMyHistoryCombo::text( int index ) const { return this->listBox()->text( index ); } -void KMyHistoryCombo::setText( const QString & text ) +void KMyHistoryCombo::setText( const TQString & text ) { this->lineEdit()->setText( text ); } -void KMyHistoryCombo::add( const QString & text ) +void KMyHistoryCombo::add( const TQString & text ) { int i; for ( i = 0; i < this->count(); i++ ) if( this->text( i ) == text ) { - QString tmp = this->text( i ); + TQString tmp = this->text( i ); this->listBox()->removeItem( i ); this->insertItem( tmp, 0 ); return; @@ -119,16 +119,16 @@ void KMyHistoryCombo::textChangedGovernor() m_timer->start( TIMER_DELAY, true ); } -void KMyHistoryCombo::slotCustomContextMenu( QPopupMenu* p ) +void KMyHistoryCombo::slotCustomContextMenu( TQPopupMenu* p ) { - QPopupMenu* krename = new QPopupMenu( p ); + TQPopupMenu* krename = new TQPopupMenu( p ); krename->insertItem( i18n("&Filename"), KRENAME_FILENAME ); krename->insertItem( i18n("Filename to &lowercase"), KRENAME_FILENAME_LOWER ); krename->insertItem( i18n("Filename to &uppercase"), KRENAME_FILENAME_UPPER ); krename->insertItem( i18n("&Number"), KRENAME_NUMBER ); krename->insertItem( i18n("&Date"), KRENAME_DATE ); - connect( krename, SIGNAL( activated( int ) ), this, SLOT( slotInsertKRenameCommand( int ) ) ); + connect( krename, TQT_SIGNAL( activated( int ) ), this, TQT_SLOT( slotInsertKRenameCommand( int ) ) ); p->insertSeparator( 0 ); p->insertItem( i18n("Insert &KRename token"), krename, 0, 0 ); @@ -136,7 +136,7 @@ void KMyHistoryCombo::slotCustomContextMenu( QPopupMenu* p ) void KMyHistoryCombo::slotInsertKRenameCommand( int id ) { - QString t; + TQString t; // TODO: // also use constants for KRename tokens! diff --git a/krename/kmyhistorycombo.h b/krename/kmyhistorycombo.h index 1f9f4d4..b28d516 100644 --- a/krename/kmyhistorycombo.h +++ b/krename/kmyhistorycombo.h @@ -22,18 +22,19 @@ #include <kcombobox.h> #include <kcompletion.h> -class QPopupMenu; -class QTimer; +class TQPopupMenu; +class TQTimer; class KMyHistoryCombo : public KHistoryCombo { Q_OBJECT + TQ_OBJECT public: /** Create a new KMyHistoryCombo which has automatic KRename default history * handling and a custom popup menu to insert tokens if customPopup is true * * \param customPopup insert custom menu items into context menu. */ - KMyHistoryCombo(bool customPopup, QWidget* parent=0, const char* name=0); + KMyHistoryCombo(bool customPopup, TQWidget* tqparent=0, const char* name=0); ~KMyHistoryCombo(); /** @@ -46,12 +47,12 @@ class KMyHistoryCombo : public KHistoryCombo { */ void saveSettings(); - inline QString text() const; + inline TQString text() const; - QString text( int index ) const; + TQString text( int index ) const; - void setText( const QString & text ); - void add( const QString & text ); + void setText( const TQString & text ); + void add( const TQString & text ); bool isEmpty() const; signals: @@ -59,14 +60,14 @@ class KMyHistoryCombo : public KHistoryCombo { private slots: void textChangedGovernor(); - void slotCustomContextMenu( QPopupMenu* p ); + void slotCustomContextMenu( TQPopupMenu* p ); void slotInsertKRenameCommand( int id ); private: - QTimer* m_timer; + TQTimer* m_timer; }; -inline QString KMyHistoryCombo::text() const +inline TQString KMyHistoryCombo::text() const { return currentText(); } diff --git a/krename/kmylistbox.cpp b/krename/kmylistbox.cpp index c1b63ba..873ba93 100644 --- a/krename/kmylistbox.cpp +++ b/krename/kmylistbox.cpp @@ -16,12 +16,12 @@ ***************************************************************************/ // QT includes -#include <qcursor.h> -#include <qdir.h> -#include <qdragobject.h> -#include <qpainter.h> -#include <qpalette.h> -#include <qregexp.h> +#include <tqcursor.h> +#include <tqdir.h> +#include <tqdragobject.h> +#include <tqpainter.h> +#include <tqpalette.h> +#include <tqregexp.h> // KDE includes #include <kapplication.h> @@ -30,7 +30,7 @@ #include <klocale.h> #include <kio/previewjob.h> #include <kio/netaccess.h> -#include <qptrlist.h> +#include <tqptrlist.h> #include <kurldrag.h> #include <kurllabel.h> #include <kpixmap.h> @@ -43,8 +43,8 @@ using namespace KIO; -KMyListBox::KMyListBox(QWidget* parent, const char* name, WFlags fl) - :KListBox(parent, name, fl) +KMyListBox::KMyListBox(TQWidget* tqparent, const char* name, WFlags fl) + :KListBox(tqparent, name, fl) { m_running_lister_counter = 0; @@ -52,15 +52,15 @@ KMyListBox::KMyListBox(QWidget* parent, const char* name, WFlags fl) moving = false; m_sorting = UNSORTED; - label = new KURLLabel( QString::null, "<br>" + i18n("Please add some files...") + "<br>", this ); - label->setFrameStyle( QFrame::GroupBoxPanel | QFrame::Sunken ); + label = new KURLLabel( TQString(), "<br>" + i18n("Please add some files...") + "<br>", this ); + label->setFrameStyle( TQFrame::GroupBoxPanel | TQFrame::Sunken ); setAcceptDrops( true ); setSelectionMode(Extended); // was extended before 2.9.0 - connect( this, SIGNAL(doubleClicked(QListBoxItem*)), this, SLOT(openFile(QListBoxItem*))); - connect( this, SIGNAL(returnPressed(QListBoxItem*)), this, SLOT(openFile(QListBoxItem*))); - connect( label, SIGNAL( leftClickedURL() ), this, SIGNAL( addFiles() ) ); + connect( this, TQT_SIGNAL(doubleClicked(TQListBoxItem*)), this, TQT_SLOT(openFile(TQListBoxItem*))); + connect( this, TQT_SIGNAL(returnPressed(TQListBoxItem*)), this, TQT_SLOT(openFile(TQListBoxItem*))); + connect( label, TQT_SIGNAL( leftClickedURL() ), this, TQT_SIGNAL( addFiles() ) ); positionLabel(); } @@ -131,7 +131,7 @@ bool KMyListBox::isFile( const KURL & f, bool autoadd ) return true; } -void KMyListBox::addDir( const KURL & dirname, const QString & filter, bool hidden, bool recursively, bool dirnames ) +void KMyListBox::addDir( const KURL & dirname, const TQString & filter, bool hidden, bool recursively, bool dirnames ) { ThreadedLister* thl = new ThreadedLister( &m_add_mutex, &m_running_lister_counter, this ); thl->setDirname( dirname ); @@ -140,13 +140,13 @@ void KMyListBox::addDir( const KURL & dirname, const QString & filter, bool hidd thl->setHidden( hidden ); thl->setRecursive( recursively ); - KApplication::setOverrideCursor( Qt::waitCursor ); + KApplication::setOverrideCursor( TQt::waitCursor ); thl->start(); } -void KMyListBox::addDirName( const KURL & dirname, const QString & filter, bool hidden, bool recursive ) +void KMyListBox::addDirName( const KURL & dirname, const TQString & filter, bool hidden, bool recursive ) { - KApplication::setOverrideCursor( Qt::waitCursor ); + KApplication::setOverrideCursor( TQt::waitCursor ); if( recursive ) { ThreadedLister* thl = new ThreadedLister( &m_add_mutex, &m_running_lister_counter, this ); @@ -160,8 +160,8 @@ void KMyListBox::addDirName( const KURL & dirname, const QString & filter, bool thl->start(); } else { // escape hiden directories - QString name = dirname.fileName(); - if( !hidden && name.right( 1 ) != QString::fromLatin1(".") ) + TQString name = dirname.fileName(); + if( !hidden && name.right( 1 ) != TQString::tqfromLatin1(".") ) if( !isInList( dirname ) ) addDirName( dirname ); @@ -169,16 +169,16 @@ void KMyListBox::addDirName( const KURL & dirname, const QString & filter, bool } } -void KMyListBox::dropEvent(QDropEvent* e) +void KMyListBox::dropEvent(TQDropEvent* e) { if( e->source() != this ) - e->accept(QTextDrag::canDecode(e)); + e->accept(TQTextDrag::canDecode(e)); KURL::List list; if( KURLDrag::decode( e, list ) ) { - KApplication::setOverrideCursor( Qt::waitCursor ); + KApplication::setOverrideCursor( TQt::waitCursor ); setUpdatesEnabled( false ); @@ -190,20 +190,20 @@ void KMyListBox::dropEvent(QDropEvent* e) } } -void KMyListBox::dragEnterEvent(QDragEnterEvent* e) +void KMyListBox::dragEnterEvent(TQDragEnterEvent* e) { if( e->source() != this ) - e->accept(QTextDrag::canDecode(e)); + e->accept(TQTextDrag::canDecode(e)); } -void KMyListBox::viewportMousePressEvent( QMouseEvent* e ) +void KMyListBox::viewportMousePressEvent( TQMouseEvent* e ) { if( moving ) move( index( itemAt( e->pos() ) ) ); else { KListBox::viewportMousePressEvent( e ); - QPoint p( e->pos() ); - QListBoxItem *i = itemAt( p ); + TQPoint p( e->pos() ); + TQListBoxItem *i = itemAt( p ); if ( i ) { presspos = e->pos(); mousePressed = TRUE; @@ -211,17 +211,17 @@ void KMyListBox::viewportMousePressEvent( QMouseEvent* e ) } } -void KMyListBox::viewportMouseMoveEvent( QMouseEvent* e ) +void KMyListBox::viewportMouseMoveEvent( TQMouseEvent* e ) { if ( mousePressed && ( presspos - e->pos() ).manhattanLength() > KApplication::startDragDistance() ) { mousePressed = FALSE; - QListBoxItem *item = itemAt( presspos ); + TQListBoxItem *item = itemAt( presspos ); if ( item ) { - QStringList source = text( index( item ) ); + TQStringList source = text( index( item ) ); for( int i = 0; i < (signed int)count(); i++ ) if( isSelected(i) && (i != index(item) )) source.append( text(i) ); - QUriDrag* ud = new QUriDrag(viewport()); + TQUriDrag* ud = new TQUriDrag(viewport()); ud->setUnicodeUris( source ); ud->drag(); } @@ -229,13 +229,13 @@ void KMyListBox::viewportMouseMoveEvent( QMouseEvent* e ) KListBox::viewportMouseMoveEvent( e ); } -void KMyListBox::viewportMouseReleaseEvent( QMouseEvent* e ) +void KMyListBox::viewportMouseReleaseEvent( TQMouseEvent* e ) { mousePressed = FALSE; KListBox::viewportMouseReleaseEvent( e ); } -void KMyListBox::keyPressEvent( QKeyEvent* e ) +void KMyListBox::keyPressEvent( TQKeyEvent* e ) { /* * TODO: Document all this keyboard commands @@ -275,7 +275,7 @@ void KMyListBox::keyPressEvent( QKeyEvent* e ) emit updatePreview(); } -void KMyListBox::keyReleaseEvent( QKeyEvent* e ) +void KMyListBox::keyReleaseEvent( TQKeyEvent* e ) { if( e->key() == Key_Control ) ctrlPressed = false; @@ -283,7 +283,7 @@ void KMyListBox::keyReleaseEvent( QKeyEvent* e ) shiftPressed = false; } -void KMyListBox::openFile( QListBoxItem* item ) +void KMyListBox::openFile( TQListBoxItem* item ) { if( item ) { KMyListBoxItem* it = static_cast<KMyListBoxItem*>(item); @@ -297,11 +297,11 @@ void KMyListBox::moveMode() { if ( !moving ) { moving = true; - KApplication::setOverrideCursor( Qt::sizeAllCursor ); + KApplication::setOverrideCursor( TQt::sizeAllCursor ); } } -void KMyListBox::select( QListBoxItem* item ) +void KMyListBox::select( TQListBoxItem* item ) { if( !ctrlPressed && !shiftPressed ) /* Single click on the list box, @@ -335,13 +335,13 @@ void KMyListBox::select( QListBoxItem* item ) void KMyListBox::preview( KURL::List list ) { KIO::PreviewJob* job = KIO::filePreview( list, previewSize, previewSize, 0, 100, false, true, 0 ); - connect( job, SIGNAL( gotPreview( const KFileItem*, const QPixmap &) ), this, SLOT( previewDone( const KFileItem*, const QPixmap &) ) ); - connect( job, SIGNAL( failed( const KFileItem*)), this, SLOT( previewFailed( const KFileItem* ) )); - connect( job, SIGNAL( result( KIO::Job * ) ), this, SLOT( previewFinished() ) ); - KApplication::setOverrideCursor( Qt::waitCursor ); + connect( job, TQT_SIGNAL( gotPreview( const KFileItem*, const TQPixmap &) ), this, TQT_SLOT( previewDone( const KFileItem*, const TQPixmap &) ) ); + connect( job, TQT_SIGNAL( failed( const KFileItem*)), this, TQT_SLOT( previewFailed( const KFileItem* ) )); + connect( job, TQT_SIGNAL( result( KIO::Job * ) ), this, TQT_SLOT( previewFinished() ) ); + KApplication::setOverrideCursor( TQt::waitCursor ); } -void KMyListBox::previewDone( const KFileItem* item, const QPixmap &pixmap ) +void KMyListBox::previewDone( const KFileItem* item, const TQPixmap &pixmap ) { for( unsigned int i = 0; i < count(); i++ ) if( url( i ) == item->url() ) { @@ -491,7 +491,7 @@ bool KMyListBox::isInList( KURL text ) return false; } -void KMyListBox::customEvent( QCustomEvent* e ) +void KMyListBox::customEvent( TQCustomEvent* e ) { if( e->type() == ThreadedLister::TYPE() ) { @@ -566,7 +566,7 @@ void KMyListBox::sortNummeric() void KMyListBox::sortList() { - KApplication::setOverrideCursor( Qt::WaitCursor ); + KApplication::setOverrideCursor( TQt::WaitCursor ); if( m_sorting == ASCENDING ) sort( true ); @@ -640,13 +640,13 @@ void KMyListBox::setSorting( int s ) emit updatePreview(); } -int KMyListBox::compareNummeric( const QString & s1, const QString & s2 ) +int KMyListBox::compareNummeric( const TQString & s1, const TQString & s2 ) { unsigned int z = 0; unsigned int max = ( s1.length() > s2.length() ? s1.length() : s2.length() ); - QString num1; - QString num2; + TQString num1; + TQString num2; for( z=0;z<max;z++) { //if( z >= s1.length() || z >= s2.length() ) @@ -675,9 +675,9 @@ int KMyListBox::compareNummeric( const QString & s1, const QString & s2 ) return s1.compare( s2 ); } -const QString KMyListBox::findNumInString( unsigned int pos, const QString & s ) +const TQString KMyListBox::findNumInString( unsigned int pos, const TQString & s ) { - QString num; + TQString num; for( int i = (int)pos; i >= 0; i-- ) if( s[i].isDigit() ) @@ -695,7 +695,7 @@ const QString KMyListBox::findNumInString( unsigned int pos, const QString & s ) return num; } -void KMyListBox::resizeEvent( QResizeEvent* e ) +void KMyListBox::resizeEvent( TQResizeEvent* e ) { KListBox::resizeEvent( e ); positionLabel(); @@ -715,14 +715,14 @@ void KMyListBox::positionLabel() } else { - int x = (width() - label->minimumSizeHint().width()) / 2; - int y = (height() - label->minimumSizeHint().height()) / 2; - label->setGeometry( x, y, label->minimumSizeHint().width(), label->minimumSizeHint().height() ); + int x = (width() - label->tqminimumSizeHint().width()) / 2; + int y = (height() - label->tqminimumSizeHint().height()) / 2; + label->setGeometry( x, y, label->tqminimumSizeHint().width(), label->tqminimumSizeHint().height() ); label->show(); } } -void KMyListBox::paintEvent( QPaintEvent* e ) +void KMyListBox::paintEvent( TQPaintEvent* e ) { // qDebug("Updates=%i", (int)isUpdatesEnabled() ); //if( isUpdatesEnabled() ) @@ -730,7 +730,7 @@ void KMyListBox::paintEvent( QPaintEvent* e ) } KMyListBoxItem::KMyListBoxItem( const KMyListBoxItem* item ) - : QListBoxItem() + : TQListBoxItem() { m_url = item->url(); m_dir = item->dir(); @@ -739,19 +739,19 @@ KMyListBoxItem::KMyListBoxItem( const KMyListBoxItem* item ) } KMyListBoxItem::KMyListBoxItem( const KURL & u, bool b ) - : QListBoxItem() + : TQListBoxItem() { m_url = u; m_dir = b; m_has_preview = false; } -void KMyListBoxItem::setPixmap( const QPixmap & pix ) +void KMyListBoxItem::setPixmap( const TQPixmap & pix ) { KMyListBox* box = static_cast<KMyListBox*>(this->listBox()); pm.resize( box->getPreviewSize(), box->getPreviewSize() ); - pm.fill( box->colorGroup().base() ); - QPainter painter( &pm ); + pm.fill( box->tqcolorGroup().base() ); + TQPainter painter( &pm ); painter.drawPixmap( (pm.width()-pix.width())/2, (pm.height()-pix.height())/2, pix ); m_has_preview = true; } @@ -766,11 +766,11 @@ void KMyListBoxItem::setPreview( bool b ) KMyListBoxItem::m_preview = b; } -void KMyListBoxItem::paint( QPainter *painter ) +void KMyListBoxItem::paint( TQPainter *painter ) { if( !KMyListBoxItem::m_preview ) { int itemHeight = height( listBox() ); - QFontMetrics fm = painter->fontMetrics(); + TQFontMetrics fm = painter->fontMetrics(); int yPos = ( ( itemHeight - fm.height() ) / 2 ) + fm.ascent(); painter->drawText( 3, yPos, text() ); } else { @@ -788,48 +788,48 @@ void KMyListBoxItem::paint( QPainter *painter ) painter->drawPixmap( 3, yPos, pm); else { - KPixmap pix = KPixmapEffect::selectedPixmap( pm, listBox()->colorGroup().highlight() ); + KPixmap pix = KPixmapEffect::selectedPixmap( pm, listBox()->tqcolorGroup().highlight() ); painter->drawPixmap( 3, yPos, pix ); } if( KMyListBoxItem::m_name && !m_url.isEmpty() ) { - QFontMetrics fm = painter->fontMetrics(); + TQFontMetrics fm = painter->fontMetrics(); yPos = ( ( itemHeight - fm.height() ) / 2 ) + fm.ascent(); painter->drawText( pm.width() + 5, yPos, text() ); } } } -int KMyListBoxItem::height( const QListBox* lb ) const +int KMyListBoxItem::height( const TQListBox* lb ) const { if( !KMyListBoxItem::m_preview ) { int h = listBox() ? listBox()->fontMetrics().lineSpacing() + 2 : 0; - return QMAX( h, QApplication::globalStrut().height() ); + return TQMAX( h, TQApplication::globalStrut().height() ); } else { int h; if ( KMyListBoxItem::m_name && !m_url.prettyURL().isEmpty() ) h = pm.height(); else - h = QMAX( pm.height(), lb->fontMetrics().lineSpacing() + 2 ); + h = TQMAX( pm.height(), lb->fontMetrics().lineSpacing() + 2 ); - return QMAX( h, QApplication::globalStrut().height() ); + return TQMAX( h, TQApplication::globalStrut().height() ); } } -int KMyListBoxItem::width( const QListBox* ) const +int KMyListBoxItem::width( const TQListBox* ) const { if( !KMyListBoxItem::m_preview ) { int w = listBox() ? listBox()->fontMetrics().width( text() ) + 6 : 0; - return QMAX( w, QApplication::globalStrut().width() ); + return TQMAX( w, TQApplication::globalStrut().width() ); } else { if ( m_url.path().isEmpty() || !KMyListBoxItem::m_name) - return QMAX( pm.width() + 6, QApplication::globalStrut().width() ); + return TQMAX( pm.width() + 6, TQApplication::globalStrut().width() ); - return QMAX( pm.width() + listBox()->fontMetrics().width( text() ) + 6, QApplication::globalStrut().width() ); + return TQMAX( pm.width() + listBox()->fontMetrics().width( text() ) + 6, TQApplication::globalStrut().width() ); } } -QString KMyListBoxItem::text() const +TQString KMyListBoxItem::text() const { return m_url.prettyURL( 0, m_url.isLocalFile() ? KURL::StripFileProtocol : KURL::NoAdjustements ); } diff --git a/krename/kmylistbox.h b/krename/kmylistbox.h index b0c7a64..4a90cf4 100644 --- a/krename/kmylistbox.h +++ b/krename/kmylistbox.h @@ -23,29 +23,30 @@ #include <kurl.h> #include <kfileitem.h> -// Qt includes -#include <qmutex.h> -#include <qstringlist.h> +// TQt includes +#include <tqmutex.h> +#include <tqstringlist.h> class ThreadedLister; class KFileItem; class KURLLabel; -class QDragObject; -class QPixmap; -class QPainter; -class QPoint; +class TQDragObject; +class TQPixmap; +class TQPainter; +class TQPoint; class KMyListBox : public KListBox { Q_OBJECT + TQ_OBJECT public: enum { ASCENDING = 1, DESCENDING = 2, RANDOM = 3, NUMMERIC = 4, UNSORTED = 0 }; - KMyListBox(QWidget* parent=0, const char* name=0, WFlags fl=0); + KMyListBox(TQWidget* tqparent=0, const char* name=0, WFlags fl=0); ~KMyListBox(); void removeItem( int index ); - void addDir( const KURL & dirname, const QString & m_filter, bool m_hidden, bool recursively, bool dirnames = false ); - void addDirName( const KURL & dirname, const QString & m_filter, bool m_hidden, bool recursive = false ); + void addDir( const KURL & dirname, const TQString & m_filter, bool m_hidden, bool recursively, bool dirnames = false ); + void addDirName( const KURL & dirname, const TQString & m_filter, bool m_hidden, bool recursive = false ); void setPreview( bool prv ); inline int sorting() const { return m_sorting; } @@ -94,13 +95,13 @@ class KMyListBox : public KListBox { private: void preview( KURL::List list ); - void dropEvent( QDropEvent* e ); - void dragEnterEvent( QDragEnterEvent* e ); - void viewportMousePressEvent( QMouseEvent* e ); - void viewportMouseReleaseEvent( QMouseEvent* e ); - void viewportMouseMoveEvent( QMouseEvent* e ); - void keyPressEvent( QKeyEvent* e ); - void keyReleaseEvent( QKeyEvent* e ); + void dropEvent( TQDropEvent* e ); + void dragEnterEvent( TQDragEnterEvent* e ); + void viewportMousePressEvent( TQMouseEvent* e ); + void viewportMouseReleaseEvent( TQMouseEvent* e ); + void viewportMouseMoveEvent( TQMouseEvent* e ); + void keyPressEvent( TQKeyEvent* e ); + void keyReleaseEvent( TQKeyEvent* e ); bool isInList( KURL text ); @@ -112,23 +113,23 @@ class KMyListBox : public KListBox { void sortList(); void setButtonText(); - int compareNummeric( const QString & s1, const QString & s2 ); - const QString findNumInString( unsigned int pos, const QString & s ); + int compareNummeric( const TQString & s1, const TQString & s2 ); + const TQString findNumInString( unsigned int pos, const TQString & s ); private slots: - void openFile( QListBoxItem* item ); - void select( QListBoxItem* item ); + void openFile( TQListBoxItem* item ); + void select( TQListBoxItem* item ); - void previewDone( const KFileItem* item, const QPixmap &pixmap ); + void previewDone( const KFileItem* item, const TQPixmap &pixmap ); void previewFailed( const KFileItem* item ); void previewFinished(); void listerDone( ThreadedLister* lister ); protected: - void resizeEvent( QResizeEvent* e ); - void customEvent( QCustomEvent* e ); - void paintEvent( QPaintEvent* e ); + void resizeEvent( TQResizeEvent* e ); + void customEvent( TQCustomEvent* e ); + void paintEvent( TQPaintEvent* e ); bool drag; bool mousePressed; @@ -139,15 +140,15 @@ class KMyListBox : public KListBox { int m_sorting; unsigned int m_running_lister_counter; - QMutex m_add_mutex; + TQMutex m_add_mutex; KURLLabel* label; - QDragObject* drobj; - QPoint presspos; + TQDragObject* drobj; + TQPoint presspos; }; -class KMyListBoxItem : public QListBoxItem { +class KMyListBoxItem : public TQListBoxItem { public: KMyListBoxItem( const KMyListBoxItem* item ); KMyListBoxItem( const KURL&, bool ); @@ -156,28 +157,28 @@ class KMyListBoxItem : public QListBoxItem { static void setName( bool b ); static void setPreview( bool b ); - void setPixmap( const QPixmap & pix ); + void setPixmap( const TQPixmap & pix ); static bool preview() { return m_preview; } static bool name() { return m_name; } inline bool dir() const { return m_dir; } inline KURL url() const { return m_url; } - inline const QPixmap* pixmap() const { return ± } + inline const TQPixmap* pixmap() const { return ± } private: - QString text() const; + TQString text() const; protected: - virtual void paint( QPainter *painter ); - virtual int width( const QListBox* ) const; - virtual int height( const QListBox* lb ) const; + virtual void paint( TQPainter *painter ); + virtual int width( const TQListBox* ) const; + virtual int height( const TQListBox* lb ) const; private: KURL m_url; bool m_dir; bool m_has_preview; - QPixmap pm; + TQPixmap pm; static bool m_preview; static bool m_name; diff --git a/krename/kmylistview.cpp b/krename/kmylistview.cpp index 6c6cdbc..079cb7b 100644 --- a/krename/kmylistview.cpp +++ b/krename/kmylistview.cpp @@ -24,16 +24,16 @@ #include <kpopupmenu.h> #include <krun.h> -KMyListView::KMyListView( QValueList<manualchanges>* _changes, KMyListBox* _list, QWidget* parent, const char* name ) - :KListView(parent, name ) +KMyListView::KMyListView( TQValueList<manualchanges>* _changes, KMyListBox* _list, TQWidget* tqparent, const char* name ) + :KListView(tqparent, name ) { changes = _changes; list = _list; - connect( this, SIGNAL( doubleClicked(QListViewItem*, const QPoint&, int) ), - this, SLOT( changeItem(QListViewItem*, const QPoint&, int) ) ); - connect( this, SIGNAL( contextMenuRequested(QListViewItem*, const QPoint&, int) ), - this, SLOT( showContext(QListViewItem*, const QPoint&, int) ) ); + connect( this, TQT_SIGNAL( doubleClicked(TQListViewItem*, const TQPoint&, int) ), + this, TQT_SLOT( changeItem(TQListViewItem*, const TQPoint&, int) ) ); + connect( this, TQT_SIGNAL( contextMenuRequested(TQListViewItem*, const TQPoint&, int) ), + this, TQT_SLOT( showContext(TQListViewItem*, const TQPoint&, int) ) ); setAllColumnsShowFocus( true ); } @@ -41,14 +41,14 @@ KMyListView::~KMyListView() { } -void KMyListView::changeItem( QListViewItem* item, const QPoint&, int ) +void KMyListView::changeItem( TQListViewItem* item, const TQPoint&, int ) { if(!item) return; KURL url = list->url( itemIndex( item ) ); bool revertenable = false; - QValueList<manualchanges>::iterator it; + TQValueList<manualchanges>::iterator it; for ( it = changes->begin(); it != changes->end(); ++it ) if( (*it).url == url ) { changes->remove( it ); @@ -73,19 +73,19 @@ void KMyListView::changeItem( QListViewItem* item, const QPoint&, int ) emit itemChanged(); } -void KMyListView::showContext( QListViewItem* item, const QPoint& pos, int ) +void KMyListView::showContext( TQListViewItem* item, const TQPoint& pos, int ) { KPopupMenu* menu = new KPopupMenu( this ); if(item) { menu->insertTitle( list->text( itemIndex( item ) ), 0, 0 ); - menu->insertItem( i18n("&Change Filename Manually"), this, SLOT( changeCurrentItem() ), Key_F2 ); + menu->insertItem( i18n("&Change Filename Manually"), this, TQT_SLOT( changeCurrentItem() ), Key_F2 ); menu->insertSeparator(); - menu->insertItem( BarIcon("exec"), i18n("Open"), this, SLOT( openCurrent() ) ); + menu->insertItem( BarIcon("exec"), i18n("Open"), this, TQT_SLOT( openCurrent() ) ); menu->insertSeparator(); } - menu->insertItem( BarIcon("fileopen"), i18n("&Add..."), this, SLOT( addFiles() ) ); + menu->insertItem( BarIcon("fileopen"), i18n("&Add..."), this, TQT_SLOT( addFiles() ) ); if(item) - menu->insertItem( BarIcon("editdelete"), i18n("&Remove"), this, SLOT( removeCurrentItem() ) ); + menu->insertItem( BarIcon("editdelete"), i18n("&Remove"), this, TQT_SLOT( removeCurrentItem() ) ); menu->popup( pos ); } @@ -103,7 +103,7 @@ void KMyListView::addFiles() void KMyListView::changeCurrentItem() { - changeItem( currentItem(), QPoint( 0, 0 ), 0 ); + changeItem( currentItem(), TQPoint( 0, 0 ), 0 ); } void KMyListView::openCurrent() @@ -114,64 +114,64 @@ void KMyListView::openCurrent() ///////////////////////////////////////////////////////////// -KMyListViewItem::KMyListViewItem(QListView *parent) - : KListViewItem(parent) +KMyListViewItem::KMyListViewItem(TQListView *tqparent) + : KListViewItem(tqparent) { } -KMyListViewItem::KMyListViewItem(QListViewItem *parent) - : KListViewItem(parent) +KMyListViewItem::KMyListViewItem(TQListViewItem *tqparent) + : KListViewItem(tqparent) { } -KMyListViewItem::KMyListViewItem(QListView *parent, QListViewItem *after) - : KListViewItem(parent, after) +KMyListViewItem::KMyListViewItem(TQListView *tqparent, TQListViewItem *after) + : KListViewItem(tqparent, after) { } -KMyListViewItem::KMyListViewItem(QListViewItem *parent, QListViewItem *after) - : KListViewItem(parent, after) +KMyListViewItem::KMyListViewItem(TQListViewItem *tqparent, TQListViewItem *after) + : KListViewItem(tqparent, after) { } -KMyListViewItem::KMyListViewItem(bool m, QListView *parent, - QString label1, QString label2, QString label3, QString label4, - QString label5, QString label6, QString label7, QString label8) - : KListViewItem(parent, label1, label2, label3, label4, label5, label6, label7, label8) +KMyListViewItem::KMyListViewItem(bool m, TQListView *tqparent, + TQString label1, TQString label2, TQString label3, TQString label4, + TQString label5, TQString label6, TQString label7, TQString label8) + : KListViewItem(tqparent, label1, label2, label3, label4, label5, label6, label7, label8) { modified = m; } -KMyListViewItem::KMyListViewItem(bool m, QListViewItem *parent, - QString label1, QString label2, QString label3, QString label4, - QString label5, QString label6, QString label7, QString label8) - : KListViewItem(parent, label1, label2, label3, label4, label5, label6, label7, label8) +KMyListViewItem::KMyListViewItem(bool m, TQListViewItem *tqparent, + TQString label1, TQString label2, TQString label3, TQString label4, + TQString label5, TQString label6, TQString label7, TQString label8) + : KListViewItem(tqparent, label1, label2, label3, label4, label5, label6, label7, label8) { modified = m; } -KMyListViewItem::KMyListViewItem(bool m, QListView *parent, QListViewItem *after, - QString label1, QString label2, QString label3, QString label4, - QString label5, QString label6, QString label7, QString label8) - : KListViewItem(parent, after, label1, label2, label3, label4, label5, label6, label7, label8) +KMyListViewItem::KMyListViewItem(bool m, TQListView *tqparent, TQListViewItem *after, + TQString label1, TQString label2, TQString label3, TQString label4, + TQString label5, TQString label6, TQString label7, TQString label8) + : KListViewItem(tqparent, after, label1, label2, label3, label4, label5, label6, label7, label8) { modified = m; } -KMyListViewItem::KMyListViewItem(QListViewItem *parent, QListViewItem *after, - QString label1, QString label2, QString label3, QString label4, - QString label5, QString label6, QString label7, QString label8) - : KListViewItem(parent, after, label1, label2, label3, label4, label5, label6, label7, label8) +KMyListViewItem::KMyListViewItem(TQListViewItem *tqparent, TQListViewItem *after, + TQString label1, TQString label2, TQString label3, TQString label4, + TQString label5, TQString label6, TQString label7, TQString label8) + : KListViewItem(tqparent, after, label1, label2, label3, label4, label5, label6, label7, label8) { } KMyListViewItem::~KMyListViewItem() { } -void KMyListViewItem::paintCell( QPainter *p, const QColorGroup &cg, - int column, int width, int alignment ) +void KMyListViewItem::paintCell( TQPainter *p, const TQColorGroup &cg, + int column, int width, int tqalignment ) { - QColorGroup _cg( cg ); - QColor c = _cg.text(); + TQColorGroup _cg( cg ); + TQColor c = _cg.text(); if( modified ) - _cg.setColor( QColorGroup::Text, Qt::red ); + _cg.setColor( TQColorGroup::Text, TQt::red ); - KListViewItem::paintCell( p, _cg, column, width, alignment ); - _cg.setColor( QColorGroup::Text, c ); + KListViewItem::paintCell( p, _cg, column, width, tqalignment ); + _cg.setColor( TQColorGroup::Text, c ); } diff --git a/krename/kmylistview.h b/krename/kmylistview.h index da1dd29..bcb0973 100644 --- a/krename/kmylistview.h +++ b/krename/kmylistview.h @@ -21,13 +21,14 @@ #include "batchrenamer.h" #include "kmylistbox.h" #include <klistview.h> -#include <qvaluelist.h> +#include <tqvaluelist.h> -class QMouseEvent; +class TQMouseEvent; class KMyListView : public KListView { Q_OBJECT + TQ_OBJECT public: - KMyListView( QValueList<manualchanges>* _changes, KMyListBox* _list, QWidget* parent=0, const char* name=0 ); + KMyListView( TQValueList<manualchanges>* _changes, KMyListBox* _list, TQWidget* tqparent=0, const char* name=0 ); ~KMyListView(); signals: @@ -36,55 +37,55 @@ class KMyListView : public KListView { void addFile(); private slots: - void changeItem( QListViewItem* item, const QPoint&, int ); - void showContext( QListViewItem* item, const QPoint& pos, int ); + void changeItem( TQListViewItem* item, const TQPoint&, int ); + void showContext( TQListViewItem* item, const TQPoint& pos, int ); void removeCurrentItem(); void addFiles(); void changeCurrentItem(); void openCurrent(); private: - QValueList<manualchanges>* changes; + TQValueList<manualchanges>* changes; KMyListBox* list; }; ///////////////////////////////////////////////////////////// -class QColor; -class QString; +class TQColor; +class TQString; class KMyListViewItem : public KListViewItem { public: - KMyListViewItem(QListView *parent); - KMyListViewItem(QListViewItem *parent); - KMyListViewItem(QListView *parent, QListViewItem *after); - KMyListViewItem(QListViewItem *parent, QListViewItem *after); - - KMyListViewItem(bool m, QListView *parent, - QString, QString = QString::null, - QString = QString::null, QString = QString::null, - QString = QString::null, QString = QString::null, - QString = QString::null, QString = QString::null); - - KMyListViewItem(bool m, QListViewItem *parent, - QString, QString = QString::null, - QString = QString::null, QString = QString::null, - QString = QString::null, QString = QString::null, - QString = QString::null, QString = QString::null); - - KMyListViewItem(bool m, QListView *parent, QListViewItem *after, - QString, QString = QString::null, - QString = QString::null, QString = QString::null, - QString = QString::null, QString = QString::null, - QString = QString::null, QString = QString::null); - - KMyListViewItem(QListViewItem *parent, QListViewItem *after, - QString, QString = QString::null, - QString = QString::null, QString = QString::null, - QString = QString::null, QString = QString::null, - QString = QString::null, QString = QString::null); + KMyListViewItem(TQListView *tqparent); + KMyListViewItem(TQListViewItem *tqparent); + KMyListViewItem(TQListView *tqparent, TQListViewItem *after); + KMyListViewItem(TQListViewItem *tqparent, TQListViewItem *after); + + KMyListViewItem(bool m, TQListView *tqparent, + TQString, TQString = TQString(), + TQString = TQString(), TQString = TQString(), + TQString = TQString(), TQString = TQString(), + TQString = TQString(), TQString = TQString()); + + KMyListViewItem(bool m, TQListViewItem *tqparent, + TQString, TQString = TQString(), + TQString = TQString(), TQString = TQString(), + TQString = TQString(), TQString = TQString(), + TQString = TQString(), TQString = TQString()); + + KMyListViewItem(bool m, TQListView *tqparent, TQListViewItem *after, + TQString, TQString = TQString(), + TQString = TQString(), TQString = TQString(), + TQString = TQString(), TQString = TQString(), + TQString = TQString(), TQString = TQString()); + + KMyListViewItem(TQListViewItem *tqparent, TQListViewItem *after, + TQString, TQString = TQString(), + TQString = TQString(), TQString = TQString(), + TQString = TQString(), TQString = TQString(), + TQString = TQString(), TQString = TQString()); virtual ~KMyListViewItem(); - void paintCell( QPainter *p, const QColorGroup &cg, int column, int width, int alignment ); + void paintCell( TQPainter *p, const TQColorGroup &cg, int column, int width, int tqalignment ); private: bool modified; diff --git a/krename/krecursivelister.cpp b/krename/krecursivelister.cpp index 94d96b4..17843d0 100644 --- a/krename/krecursivelister.cpp +++ b/krename/krecursivelister.cpp @@ -15,11 +15,11 @@ * * ***************************************************************************/ -#include <qtimer.h> +#include <tqtimer.h> #include "krecursivelister.h" -KRecursiveLister::KRecursiveLister(QObject *parent, const char *name ) : QObject(parent,name) { +KRecursiveLister::KRecursiveLister(TQObject *tqparent, const char *name ) : TQObject(tqparent,name) { lister = 0L; filelist.clear(); dirlist.clear(); @@ -27,7 +27,7 @@ KRecursiveLister::KRecursiveLister(QObject *parent, const char *name ) : QObject allItems.setAutoDelete( true ); // only there to delete all items m_hidden = false; m_dirs = false; - m_filter = QString::null; + m_filter = TQString(); } KRecursiveLister::~KRecursiveLister(){ @@ -72,7 +72,7 @@ void KRecursiveLister::slotListingComplete(){ } } - QTimer::singleShot( 0, this, SLOT( listNextDirectory() )); + TQTimer::singleShot( 0, this, TQT_SLOT( listNextDirectory() )); } /** Starts listing the specified url */ @@ -82,7 +82,7 @@ void KRecursiveLister::startListing(const KURL& url){ lister->setShowingDotFiles( m_hidden ); lister->setNameFilter( m_filter ); lister->setDirOnlyMode( m_dirs ); - connect(lister,SIGNAL(completed()), this, SLOT(slotListingComplete()) ); + connect(lister,TQT_SIGNAL(completed()), this, TQT_SLOT(slotListingComplete()) ); } lister->openURL( url, false, false ); diff --git a/krename/krecursivelister.h b/krename/krecursivelister.h index b470772..b676ddb 100644 --- a/krename/krecursivelister.h +++ b/krename/krecursivelister.h @@ -18,11 +18,11 @@ #ifndef KRECURSIVELISTER_H #define KRECURSIVELISTER_H -#include <qwidget.h> -#include <qobject.h> +#include <tqwidget.h> +#include <tqobject.h> #include <kdirlister.h> #include <kfileitem.h> -#include <qguardedptr.h> +#include <tqguardedptr.h> /**A convienience class that recursively lists a directory *@author Jonathon Sim @@ -32,11 +32,12 @@ * and support for listing directories along with files. */ -class KRecursiveLister : public QObject { +class KRecursiveLister : public TQObject { Q_OBJECT + TQ_OBJECT public: - KRecursiveLister(QObject *parent=0, const char *name=0); + KRecursiveLister(TQObject *tqparent=0, const char *name=0); ~KRecursiveLister(); /** Returns the list of fileitems found. */ @@ -46,7 +47,7 @@ public: inline void setShowingDotFiles( bool dotfiles ); /** filter to be used */ - inline void setNameFilter( const QString & filter ); + inline void setNameFilter( const TQString & filter ); /** list only directories */ inline void setDirOnlyMode( bool dirsOnly ); @@ -81,11 +82,11 @@ protected: // Protected methods KFileItemList dirlist; //Dirs remaining to list KFileItemList dirtree; KFileItemList allItems; - QGuardedPtr<KDirLister> lister; //The current KDirLister + TQGuardedPtr<KDirLister> lister; //The current KDirLister bool m_hidden; bool m_dirs; - QString m_filter; + TQString m_filter; }; void KRecursiveLister::setShowingDotFiles( bool dotfiles ) @@ -93,7 +94,7 @@ void KRecursiveLister::setShowingDotFiles( bool dotfiles ) m_hidden = dotfiles; } -void KRecursiveLister::setNameFilter( const QString & filter ) +void KRecursiveLister::setNameFilter( const TQString & filter ) { m_filter = filter; } diff --git a/krename/krenamedcop.h b/krename/krenamedcop.h index 7e4f4ed..ad3f817 100644 --- a/krename/krenamedcop.h +++ b/krename/krenamedcop.h @@ -19,7 +19,7 @@ #define KRENAMEDCOP_H #include <dcopobject.h> -#include <qstringlist.h> +#include <tqstringlist.h> #include <kurl.h> class KRenameDCOP : virtual public DCOPObject @@ -28,15 +28,15 @@ class KRenameDCOP : virtual public DCOPObject public: k_dcop: - virtual void addFileOrDir( const QString & name ) = 0; - virtual void addDir( const QString & name, const QString & filter, bool recursive, bool hidden, bool dirnames ) = 0; + virtual void addFileOrDir( const TQString & name ) = 0; + virtual void addDir( const TQString & name, const TQString & filter, bool recursive, bool hidden, bool dirnames ) = 0; virtual void updatePre() = 0; - virtual void setFileNameTemplate( const QString & t ) = 0; - virtual const QString fileNameTemplate() const = 0; + virtual void setFileNameTemplate( const TQString & t ) = 0; + virtual const TQString fileNameTemplate() const = 0; - virtual void setExtensionTemplate( const QString & t ) = 0; - virtual const QString extensionTemplate() const = 0; + virtual void setExtensionTemplate( const TQString & t ) = 0; + virtual const TQString extensionTemplate() const = 0; virtual void setUseExtension( bool b ) = 0; virtual bool useExtension() const = 0; @@ -46,9 +46,9 @@ class KRenameDCOP : virtual public DCOPObject virtual void start() = 0; - virtual QStringList tokens() const = 0; + virtual TQStringList tokens() const = 0; - virtual QString parseString( const QString & token, const QString & string ) = 0; + virtual TQString parseString( const TQString & token, const TQString & string ) = 0; }; #endif /* KRENAMEDCOP_H */ diff --git a/krename/krenameimpl.cpp b/krename/krenameimpl.cpp index e321185..7618734 100644 --- a/krename/krenameimpl.cpp +++ b/krename/krenameimpl.cpp @@ -56,48 +56,48 @@ #include <kio/netaccess.h> // QT includes -#include <qbuttongroup.h> -#include <qcursor.h> -#include <qgrid.h> -#include <qlabel.h> -#include <qlayout.h> -#include <qradiobutton.h> -#include <qrect.h> -#include <qregexp.h> -#include <qtabwidget.h> -#include <qtimer.h> -#include <qtooltip.h> -#include <qvgroupbox.h> -#include <qvbox.h> -#include <qvbuttongroup.h> -#include <qwidget.h> -#include <qwidgetstack.h> +#include <tqbuttongroup.h> +#include <tqcursor.h> +#include <tqgrid.h> +#include <tqlabel.h> +#include <tqlayout.h> +#include <tqradiobutton.h> +#include <tqrect.h> +#include <tqregexp.h> +#include <tqtabwidget.h> +#include <tqtimer.h> +#include <tqtooltip.h> +#include <tqvgroupbox.h> +#include <tqvbox.h> +#include <tqvbuttongroup.h> +#include <tqwidget.h> +#include <tqwidgetstack.h> #define ID_WIZARD 2905 #define ID_TAB 2904 -QString pageTitle[] = { +TQString pageTitle[] = { I18N_NOOP( "F&iles" ), I18N_NOOP( "Des&tination" ), I18N_NOOP( "P&lugins" ), I18N_NOOP( "File&name" ) }; -KPushButton* createButton( KGuiItem item, QWidget* parent ) +KPushButton* createButton( KGuiItem item, TQWidget* tqparent ) { - return new KPushButton( item.iconSet(), item.text(), parent ); + return new KPushButton( item.iconSet(), item.text(), tqparent ); } -KRenameImpl::KRenameImpl( QWidget* p, KMenuBar* m, QPushButton* finish ) - : DCOPObject( "KRename" ), QObject( (QObject*)p ), - parent( p ), menuBar( m ), finishButton( finish ) +KRenameImpl::KRenameImpl( TQWidget* p, KMenuBar* m, TQPushButton* finish ) + : DCOPObject( "KRename" ), TQObject( (TQObject*)p ), + tqparent( p ), menuBar( m ), finishButton( finish ) { m_hasCommandlineProfile = false; // Load Plugins plugin = PluginLoader::instance(); helpDialogData = new HelpDialogData(); - // Maybe parent instead of 0 but might crash when switching from wizard to tab mode + // Maybe tqparent instead of 0 but might crash when switching from wizard to tab mode helpDialog = new HelpDialog( helpDialogData, NULL, NULL, false ); m_switching = false; @@ -115,52 +115,52 @@ int KRenameImpl::numRealTimePreview = -1; void KRenameImpl::setup( bool wizardmode ) { - parent->setCaption( "KRename" ); // "KRename by Dominik Seichter + tqparent->setCaption( "KRename" ); // "KRename by Dominik Seichter setupActions(); setupPages(); updateCount(); - connect( buttonAdd, SIGNAL( clicked() ), this, SLOT( addFile() )); - connect( buttonRemoveAll, SIGNAL( clicked()), this, SLOT( clearList() )); - connect( buttonRemove, SIGNAL( clicked()), this, SLOT( removeFile() )); - connect( buttonHelp, SIGNAL( clicked()), this, SLOT( showTokenHelp() )); - connect( finishButton, SIGNAL( clicked()), this, SLOT( start() )); - - connect( checkExtension, SIGNAL( clicked()), this, SLOT( enableControls() )); - connect( optionRename, SIGNAL( clicked()), this, SLOT( enableControls() )); - connect( optionMove, SIGNAL( clicked()), this, SLOT( enableControls() )); - connect( optionCopy, SIGNAL( clicked()), this, SLOT( enableControls() )); - connect( optionLink, SIGNAL( clicked()), this, SLOT( enableControls() )); - connect( checkUndoScript, SIGNAL( clicked()), this, SLOT( enableControls() )); - - connect( fileList, SIGNAL( updateCount()), this, SLOT( updateCount() )); - connect( fileList, SIGNAL( updatePreview()), this, SLOT( updatePreview() )); - connect( fileList, SIGNAL( deletePressed()), this, SLOT( removeFile() )); - connect( fileList, SIGNAL( addFiles()), this, SLOT( addFile() )); - connect( buttonUp, SIGNAL( clicked()), fileList, SLOT( moveUp() )); - connect( buttonDown, SIGNAL( clicked()), fileList, SLOT( moveDown() )); - connect( buttonUp, SIGNAL( clicked()), this, SLOT( updatePreview() )); - connect( buttonDown, SIGNAL( clicked()), this, SLOT( updatePreview() )); - connect( buttonUp2, SIGNAL( clicked()), this, SLOT( moveUp() )); - connect( buttonDown2, SIGNAL( clicked()), this, SLOT( moveDown() )); - connect( buttonReplace, SIGNAL( clicked()), this, SLOT( replace() )); - connect( buttonEasyReplace, SIGNAL( clicked()), this, SLOT( replace() )); - connect( buttonCoord, SIGNAL( clicked()), this, SLOT( getCoordinates() )); - connect( comboSort, SIGNAL( activated(int)), fileList, SLOT( setSorting(int) )); + connect( buttonAdd, TQT_SIGNAL( clicked() ), this, TQT_SLOT( addFile() )); + connect( buttonRemoveAll, TQT_SIGNAL( clicked()), this, TQT_SLOT( clearList() )); + connect( buttonRemove, TQT_SIGNAL( clicked()), this, TQT_SLOT( removeFile() )); + connect( buttonHelp, TQT_SIGNAL( clicked()), this, TQT_SLOT( showTokenHelp() )); + connect( finishButton, TQT_SIGNAL( clicked()), this, TQT_SLOT( start() )); + + connect( checkExtension, TQT_SIGNAL( clicked()), this, TQT_SLOT( enableControls() )); + connect( optionRename, TQT_SIGNAL( clicked()), this, TQT_SLOT( enableControls() )); + connect( optionMove, TQT_SIGNAL( clicked()), this, TQT_SLOT( enableControls() )); + connect( optionCopy, TQT_SIGNAL( clicked()), this, TQT_SLOT( enableControls() )); + connect( optionLink, TQT_SIGNAL( clicked()), this, TQT_SLOT( enableControls() )); + connect( checkUndoScript, TQT_SIGNAL( clicked()), this, TQT_SLOT( enableControls() )); + + connect( fileList, TQT_SIGNAL( updateCount()), this, TQT_SLOT( updateCount() )); + connect( fileList, TQT_SIGNAL( updatePreview()), this, TQT_SLOT( updatePreview() )); + connect( fileList, TQT_SIGNAL( deletePressed()), this, TQT_SLOT( removeFile() )); + connect( fileList, TQT_SIGNAL( addFiles()), this, TQT_SLOT( addFile() )); + connect( buttonUp, TQT_SIGNAL( clicked()), fileList, TQT_SLOT( moveUp() )); + connect( buttonDown, TQT_SIGNAL( clicked()), fileList, TQT_SLOT( moveDown() )); + connect( buttonUp, TQT_SIGNAL( clicked()), this, TQT_SLOT( updatePreview() )); + connect( buttonDown, TQT_SIGNAL( clicked()), this, TQT_SLOT( updatePreview() )); + connect( buttonUp2, TQT_SIGNAL( clicked()), this, TQT_SLOT( moveUp() )); + connect( buttonDown2, TQT_SIGNAL( clicked()), this, TQT_SLOT( moveDown() )); + connect( buttonReplace, TQT_SIGNAL( clicked()), this, TQT_SLOT( tqreplace() )); + connect( buttonEasyReplace, TQT_SIGNAL( clicked()), this, TQT_SLOT( tqreplace() )); + connect( buttonCoord, TQT_SIGNAL( clicked()), this, TQT_SLOT( getCoordinates() )); + connect( comboSort, TQT_SIGNAL( activated(int)), fileList, TQT_SLOT( setSorting(int) )); - connect( filename, SIGNAL( delayedTextChanged() ), this, SLOT( updatePreview() )); - connect( extemplate, SIGNAL( delayedTextChanged() ), this, SLOT( updatePreview() )); - connect( checkExtension, SIGNAL( clicked()), this, SLOT( updatePreview() )); - connect( comboExtension, SIGNAL( activated(int) ), this, SLOT( updatePreview() )); - connect( checkPreview, SIGNAL( clicked()), this, SLOT( toggleImagePreview() )); - connect( preview, SIGNAL( itemChanged() ), this, SLOT( updatePreview() )); - connect( preview, SIGNAL( removeItem(int) ), this, SLOT( removeFile(int) )); - connect( preview, SIGNAL( addFile() ), this, SLOT( addFile() )); - connect( undorequester, SIGNAL( urlSelected(const QString &)), this, SLOT( changeUndoScriptName() )); - connect( kapp, SIGNAL( aboutToQuit() ), this, SLOT( saveConfig() ) ); - connect( buttonMove, SIGNAL( clicked()), fileList, SLOT( moveMode() )); - connect( checkName, SIGNAL( clicked()), this, SLOT( toggleName() )); - connect( buttonNumber, SIGNAL( clicked()), this, SLOT( changeNumbers() )); + connect( filename, TQT_SIGNAL( delayedTextChanged() ), this, TQT_SLOT( updatePreview() )); + connect( extemplate, TQT_SIGNAL( delayedTextChanged() ), this, TQT_SLOT( updatePreview() )); + connect( checkExtension, TQT_SIGNAL( clicked()), this, TQT_SLOT( updatePreview() )); + connect( comboExtension, TQT_SIGNAL( activated(int) ), this, TQT_SLOT( updatePreview() )); + connect( checkPreview, TQT_SIGNAL( clicked()), this, TQT_SLOT( toggleImagePreview() )); + connect( preview, TQT_SIGNAL( itemChanged() ), this, TQT_SLOT( updatePreview() )); + connect( preview, TQT_SIGNAL( removeItem(int) ), this, TQT_SLOT( removeFile(int) )); + connect( preview, TQT_SIGNAL( addFile() ), this, TQT_SLOT( addFile() )); + connect( undorequester, TQT_SIGNAL( urlSelected(const TQString &)), this, TQT_SLOT( changeUndoScriptName() )); + connect( kapp, TQT_SIGNAL( aboutToQuit() ), this, TQT_SLOT( saveConfig() ) ); + connect( buttonMove, TQT_SIGNAL( clicked()), fileList, TQT_SLOT( moveMode() )); + connect( checkName, TQT_SIGNAL( clicked()), this, TQT_SLOT( toggleName() )); + connect( buttonNumber, TQT_SIGNAL( clicked()), this, TQT_SLOT( changeNumbers() )); // Load Configuration loadConfig(); @@ -177,7 +177,7 @@ void KRenameImpl::setup( bool wizardmode ) enableControls(); } -const QString KRenameImpl::title( int index ) const +const TQString KRenameImpl::title( int index ) const { return i18n( pageTitle[index] ); } @@ -204,17 +204,17 @@ void KRenameImpl::parseCommandline() // load the profile first, so that we do not overwrite other // commandline settings - QCString templ = args->getOption( "profile" ); + TQCString templ = args->getOption( "profile" ); if( !templ.isEmpty() ) { m_hasCommandlineProfile = true; - ProfileManager::loadProfile( QString( templ ), this ); + ProfileManager::loadProfile( TQString( templ ), this ); } if( !args->isSet( "previewitems" ) ) numRealTimePreview = -1; else - numRealTimePreview = QString( args->getOption( "previewitems" ) ).toInt(); + numRealTimePreview = TQString( args->getOption( "previewitems" ) ).toInt(); templ = args->getOption( "template" ); if( !templ.isEmpty() ) @@ -247,10 +247,10 @@ void KRenameImpl::parseCommandline() for(unsigned int i = 0; i < uselist.count(); i++ ) uselist[i] = uselist[i].lower(); - QPtrListIterator<PluginLoader::PluginLibrary> it( plugin->libs ); + TQPtrListIterator<PluginLoader::PluginLibrary> it( plugin->libs ); while ( it.current() ) { - if( uselist.contains( (*it)->plugin->getName().lower().utf8() ) ) + if( uselist.tqcontains( (*it)->plugin->getName().lower().utf8() ) ) (*it)->check->setChecked( true ); ++it; @@ -287,7 +287,7 @@ void KRenameImpl::parseCommandline() if( fileList->count() ) // start renaming - QTimer::singleShot( 200, this, SLOT( start() ) ); + TQTimer::singleShot( 200, this, TQT_SLOT( start() ) ); } } @@ -295,28 +295,28 @@ void KRenameImpl::setupActions() { KActionCollection* actionCollection = new KActionCollection( this ); - KPopupMenu* mnuExtra = new KPopupMenu( parent ); - KPopupMenu* mnuSettings = new KPopupMenu( parent ); - KHelpMenu* mnuHelp = new KHelpMenu( parent ); + KPopupMenu* mnuExtra = new KPopupMenu( tqparent ); + KPopupMenu* mnuSettings = new KPopupMenu( tqparent ); + KHelpMenu* mnuHelp = new KHelpMenu( tqparent ); menuBar->insertItem( i18n("E&xtras"), mnuExtra ); - mnuExtra->insertItem( i18n("&Profiles..."), this, SLOT( manageProfiles() ) ); + mnuExtra->insertItem( i18n("&Profiles..."), this, TQT_SLOT( manageProfiles() ) ); mnuExtra->insertSeparator(); - mnuExtra->insertItem( SmallIcon("undo"), i18n("&Undo Old Renaming Action..."), this, SLOT( undo() ) ); + mnuExtra->insertItem( SmallIcon("undo"), i18n("&Undo Old Renaming Action..."), this, TQT_SLOT( undo() ) ); menuBar->insertItem( i18n("&Settings"), mnuSettings ); menuBar->insertSeparator(); menuBar->insertItem( i18n("&Help"), mnuHelp->menu() ); - KAction* prefAct = KStdAction::preferences( this, SLOT(preferences()), actionCollection ); - loadPlugins = new KAction( i18n("&Load KDE file plugins"), 0, this, SLOT( loadFilePlugins() ), actionCollection ); - KAction* reloadAct = new KAction( i18n("&Reload Plugin Data"), 0, this, SLOT( reloadFilePluginData() ), actionCollection ); + KAction* prefAct = KStdAction::preferences( this, TQT_SLOT(preferences()), actionCollection ); + loadPlugins = new KAction( i18n("&Load KDE file plugins"), 0, this, TQT_SLOT( loadFilePlugins() ), actionCollection ); + KAction* reloadAct = new KAction( i18n("&Reload Plugin Data"), 0, this, TQT_SLOT( reloadFilePluginData() ), actionCollection ); prefAct->plug( mnuSettings ); mnuSettings->insertSeparator(); loadPlugins->plug( mnuSettings ); reloadAct->plug( mnuSettings ); - connect( mnuHelp, SIGNAL(showAboutApplication()), this, SLOT(about())); + connect( mnuHelp, TQT_SIGNAL(showAboutApplication()), this, TQT_SLOT(about())); } void KRenameImpl::setupPages() @@ -332,15 +332,15 @@ void KRenameImpl::setupPages() void KRenameImpl::setupPage1() { - page_1 = new QWidget( parent ); + page_1 = new TQWidget( tqparent ); - pageLayout = new QHBoxLayout( page_1, 11, 6 ); - Layout3 = new QVBoxLayout( 0, 0, 6 ); - Layout4 = new QHBoxLayout( 0, 0, 6 ); - Layout5 = new QVBoxLayout( 0, 0, 6 ); + pageLayout = new TQHBoxLayout( page_1, 11, 6 ); + Layout3 = new TQVBoxLayout( 0, 0, 6 ); + Layout4 = new TQHBoxLayout( 0, 0, 6 ); + Layout5 = new TQVBoxLayout( 0, 0, 6 ); - QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding ); - QSpacerItem* spacer2 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); + TQSpacerItem* spacer = new TQSpacerItem( 20, 20, TQSizePolicy::Minimum, TQSizePolicy::Expanding ); + TQSpacerItem* spacer2 = new TQSpacerItem( 20, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum ); fileList = new KMyListBox( page_1 ); @@ -360,10 +360,10 @@ void KRenameImpl::setupPage1() comboSort->insertItem( i18n("Sort: Random") ); comboSort->insertItem( i18n("Sort: Numeric") ); - checkPreview = new QCheckBox( page_1 ); + checkPreview = new TQCheckBox( page_1 ); checkPreview->setText( i18n("&Preview") ); - labelCount = new QLabel( page_1 ); + labelCount = new TQLabel( page_1 ); buttonUp = new KPushButton( page_1 ); buttonUp->setPixmap( BarIcon( "1uparrow" ) ); @@ -371,7 +371,7 @@ void KRenameImpl::setupPage1() buttonDown = new KPushButton( page_1 ); buttonDown->setPixmap( BarIcon( "1downarrow" ) ); - checkName = new QCheckBox( page_1 ); + checkName = new TQCheckBox( page_1 ); checkName->setText( i18n("&Display name") ); buttonMove = new KPushButton( page_1 ); @@ -401,51 +401,51 @@ void KRenameImpl::setupPage1() emit pageDone( page_1, i18n( pageTitle[0] ) ); - QToolTip::add( buttonAdd, i18n( "Add one or more files or directories" ) ); - QToolTip::add( buttonRemove, i18n( "Remove selected files" ) ); - QToolTip::add( buttonRemoveAll, i18n( "Remove all files" ) ); - QToolTip::add( checkPreview, i18n( "Enable/disable preview of pictures." ) ); - QToolTip::add( labelCount, i18n( "Displays the number of files in the list." ) ); - QToolTip::add( buttonUp, i18n( "Move selected items up" )); - QToolTip::add( buttonDown, i18n( "Move selected items down" )); - QToolTip::add( checkName, i18n( "Enable/disable display of file name." ) ); - QToolTip::add( buttonMove, i18n( "Move selected items (select the new location with the mouse)" )); + TQToolTip::add( buttonAdd, i18n( "Add one or more files or directories" ) ); + TQToolTip::add( buttonRemove, i18n( "Remove selected files" ) ); + TQToolTip::add( buttonRemoveAll, i18n( "Remove all files" ) ); + TQToolTip::add( checkPreview, i18n( "Enable/disable preview of pictures." ) ); + TQToolTip::add( labelCount, i18n( "Displays the number of files in the list." ) ); + TQToolTip::add( buttonUp, i18n( "Move selected items up" )); + TQToolTip::add( buttonDown, i18n( "Move selected items down" )); + TQToolTip::add( checkName, i18n( "Enable/disable display of file name." ) ); + TQToolTip::add( buttonMove, i18n( "Move selected items (select the new location with the mouse)" )); } void KRenameImpl::setupPage2() { - page_2 = new QWidget( parent ); + page_2 = new TQWidget( tqparent ); - pageLayout_2 = new QVBoxLayout( page_2, 6, 6 ); + pageLayout_2 = new TQVBoxLayout( page_2, 6, 6 ); - QSpacerItem* spacer_3 = new QSpacerItem( 20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding ); + TQSpacerItem* spacer_3 = new TQSpacerItem( 20, 20, TQSizePolicy::Minimum, TQSizePolicy::Expanding ); - groupOptions = new QButtonGroup( page_2 ); + groupOptions = new TQButtonGroup( page_2 ); groupOptions->setTitle( i18n( "O&ptions" ) ); groupOptions->setColumnLayout(0, Qt::Vertical ); - groupOptions->layout()->setSpacing( 6 ); - groupOptions->layout()->setMargin( 11 ); - groupOptionsLayout = new QVBoxLayout( groupOptions->layout() ); - groupOptionsLayout->setAlignment( Qt::AlignTop ); + groupOptions->tqlayout()->setSpacing( 6 ); + groupOptions->tqlayout()->setMargin( 11 ); + groupOptionsLayout = new TQVBoxLayout( groupOptions->tqlayout() ); + groupOptionsLayout->tqsetAlignment( TQt::AlignTop ); - optionRename = new QRadioButton( groupOptions ); + optionRename = new TQRadioButton( groupOptions ); optionRename->setText( i18n( "&Rename input files" ) ); optionRename->setChecked( true ); - optionCopy = new QRadioButton( groupOptions ); + optionCopy = new TQRadioButton( groupOptions ); optionCopy->setText( i18n( "Cop&y files to destination directory" ) ); - optionMove = new QRadioButton( groupOptions ); + optionMove = new TQRadioButton( groupOptions ); optionMove->setText( i18n( "&Move files to destination directory" ) ); - optionLink = new QRadioButton( groupOptions ); + optionLink = new TQRadioButton( groupOptions ); optionLink->setText( i18n("Create symbolic &links in destination directory") ); dirname = new KMyHistoryCombo( false, groupOptions, "Path" ); urlrequester = new KURLRequester( dirname, groupOptions ); urlrequester->setMode( KFile::Directory | KFile::ExistingOnly ); - checkOverwrite = new QCheckBox( groupOptions ); + checkOverwrite = new TQCheckBox( groupOptions ); checkOverwrite->setText( i18n( "&Overwrite existing files" ) ); groupOptionsLayout->addWidget( optionRename ); @@ -456,10 +456,10 @@ void KRenameImpl::setupPage2() groupOptionsLayout->addItem( spacer_3 ); groupOptionsLayout->addWidget( checkOverwrite ); - groupUndo = new QVGroupBox( page_2 ); + groupUndo = new TQVGroupBox( page_2 ); groupUndo->setTitle( i18n("&Undo Renaming") ); - checkUndoScript = new QCheckBox( i18n("&Create an undo script"), groupUndo ); + checkUndoScript = new TQCheckBox( i18n("&Create an undo script"), groupUndo ); undorequester = new KURLRequester( groupUndo ); undorequester->setEnabled( false ); @@ -474,14 +474,14 @@ void KRenameImpl::setupPage2() emit pageDone( page_2, i18n( pageTitle[1] ) ); - QToolTip::add( optionRename, i18n( "Input files will be renamed." ) ); - QToolTip::add( optionCopy, i18n( "Copies all files to the destination directory and renames them." ) ); - QToolTip::add( optionMove, i18n( "Moves all files to the destination directory and renames them." ) ); + TQToolTip::add( optionRename, i18n( "Input files will be renamed." ) ); + TQToolTip::add( optionCopy, i18n( "Copies all files to the destination directory and renames them." ) ); + TQToolTip::add( optionMove, i18n( "Moves all files to the destination directory and renames them." ) ); } void KRenameImpl::setupPage3() { - page_3 = new KJanusWidget( parent, "janus", KJanusWidget::TreeList ); + page_3 = new KJanusWidget( tqparent, "janus", KJanusWidget::TreeList ); page_3->setShowIconsInTreeList( true ); page_3->setTreeListAutoResize( true ); @@ -492,15 +492,15 @@ void KRenameImpl::setupPage3() void KRenameImpl::setupPage4() { - page_4 = new QWidget( parent ); - pageLayout_4 = new QVBoxLayout( page_4, 11, 6 ); + page_4 = new TQWidget( tqparent ); + pageLayout_4 = new TQVBoxLayout( page_4, 11, 6 ); - fileTab = new QWidgetStack( page_4 ); + fileTab = new TQWidgetStack( page_4 ); setupFileTab1(); setupFileTab2(); - Layout22 = new QHBoxLayout( 0, 0, 6 ); - Layout23 = new QVBoxLayout( 0, 0, 6 ); + Layout22 = new TQHBoxLayout( 0, 0, 6 ); + Layout23 = new TQVBoxLayout( 0, 0, 6 ); preview = new KMyListView( &changes, fileList, page_4 ); preview->setSorting( -1 ); @@ -513,7 +513,7 @@ void KRenameImpl::setupPage4() buttonDown2 = new KPushButton( page_4 ); buttonDown2->setPixmap( BarIcon( "1downarrow" ) ); - QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Expanding ); + TQSpacerItem* spacer = new TQSpacerItem( 20, 20, TQSizePolicy::Expanding, TQSizePolicy::Expanding ); Layout23->addItem( spacer ); Layout23->addWidget( buttonUp2 ); @@ -529,29 +529,29 @@ void KRenameImpl::setupPage4() emit pageDone( page_4, i18n( pageTitle[3] ) ); - QToolTip::add( filename, i18n( "Add a template.<br>Example: <i>picture###</i>" ) ); - QToolTip::add( extemplate, i18n( "Add a template for the file extension.<br>It behaves like the filename template.") ); - QToolTip::add( checkExtension, i18n("Checking this checkbox is the same as setting the extension template to $")); - QToolTip::add( buttonUp2, i18n( "Move selected items up" )); - QToolTip::add( buttonDown2, i18n( "Move selected items down" )); - QToolTip::add( preview, i18n( "Double click on an item to modify it." )); - QToolTip::add( buttonHelp, i18n("Help Dialog with all tokens supported by KRename.")); - QToolTip::add( buttonReplace, i18n("<qt>Find and replace characters or part string of the source filename in the destination filename.</qt>") ); - QToolTip::add( buttonEasyReplace, i18n("<qt>Find and replace characters or part string of the source filename in the destination filename.</qt>") ); - QToolTip::add( comboExtension, i18n("<qt>You can use \".gz\" and \".tar.gz\" as file extension of the file backup.tar.gz depending on this setting.</qt>") ); + TQToolTip::add( filename, i18n( "Add a template.<br>Example: <i>picture###</i>" ) ); + TQToolTip::add( extemplate, i18n( "Add a template for the file extension.<br>It behaves like the filename template.") ); + TQToolTip::add( checkExtension, i18n("Checking this checkbox is the same as setting the extension template to $")); + TQToolTip::add( buttonUp2, i18n( "Move selected items up" )); + TQToolTip::add( buttonDown2, i18n( "Move selected items down" )); + TQToolTip::add( preview, i18n( "Double click on an item to modify it." )); + TQToolTip::add( buttonHelp, i18n("Help Dialog with all tokens supported by KRename.")); + TQToolTip::add( buttonReplace, i18n("<qt>Find and replace characters or part string of the source filename in the destination filename.</qt>") ); + TQToolTip::add( buttonEasyReplace, i18n("<qt>Find and replace characters or part string of the source filename in the destination filename.</qt>") ); + TQToolTip::add( comboExtension, i18n("<qt>You can use \".gz\" and \".tar.gz\" as file extension of the file backup.tar.gz depending on this setting.</qt>") ); } void KRenameImpl::setupFileTab1() { - QWidget* tab = new QWidget( fileTab ); + TQWidget* tab = new TQWidget( fileTab ); - labelTemplate = new QLabel( tab ); + labelTemplate = new TQLabel( tab ); labelTemplate->setText( i18n( "&Template:" ) ); filename = new KMyHistoryCombo( true, tab, "Template" ); labelTemplate->setBuddy( filename ); - QLabel* labelDot = new QLabel( tab ); + TQLabel* labelDot = new TQLabel( tab ); labelDot->setText("<b>.</b>"); extemplate = new KMyHistoryCombo( true, tab, "ExTemplate" ); @@ -560,21 +560,21 @@ void KRenameImpl::setupFileTab1() buttonHelp = new KPushButton( i18n("&Functions..."), tab ); buttonHelp->setIconSet( SmallIcon("help") ); - checkExtension = new QCheckBox( tab ); + checkExtension = new TQCheckBox( tab ); checkExtension->setText( i18n( "&Use extension of the input file" ) ); checkExtension->setChecked( TRUE ); comboExtension = new KComboBox( false, tab ); buttonReplace = new KPushButton( i18n("Find &and Replace..."), tab ); - buttonReplace->setIconSet( SmallIconSet("find") ); + buttonReplace->setIconSet( SmallIconSet("tqfind") ); buttonNumber = new KPushButton( i18n("&Numbering..."), tab ); buttonCoord = new KPushButton( i18n("&Insert Part of Filename..."), tab ); helpDialog->setLineEdit( filename->lineEdit() ); - QStringList help; + TQStringList help; help.append("$;;" + i18n("old filename") ); help.append("%;;" + i18n("old filename converted to lower case") ); help.append("&;;" + i18n("old filename converted to upper case") ); @@ -587,7 +587,7 @@ void KRenameImpl::setupFileTab1() help.append("[$x-y];;" + i18n("character x to y of old filename") ); help.append("[$x;y];;" + i18n("y characters of old filename starting at x") ); help.append("[$dirname];;" + i18n("insert name of directory") ); - help.append("[$dirname.];;" + i18n("insert name of parent directory") ); + help.append("[$dirname.];;" + i18n("insert name of tqparent directory") ); help.append("[#length-0];;" + i18n("insert the length of the input filename") ); helpDialogData->add( i18n("Built-in Functions:" ), &help, SmallIcon("krename"), true ); @@ -605,7 +605,7 @@ void KRenameImpl::setupFileTab1() /* //TODO: FIX this tooltip - QToolTip::add( buttonHelp, + TQToolTip::add( buttonHelp, i18n( "<b>$</b> old filename<br><b>%</b> old filename" " converted to lower case<br><b>&</b> old filename converted to upper case<br>" @@ -617,12 +617,12 @@ void KRenameImpl::setupFileTab1() ) ); */ - QSpacerItem* spacer_9 = new QSpacerItem( 200, 20, QSizePolicy::Maximum, QSizePolicy::Maximum ); + TQSpacerItem* spacer_9 = new TQSpacerItem( 200, 20, TQSizePolicy::Maximum, TQSizePolicy::Maximum ); - QVBoxLayout* layout = new QVBoxLayout( tab ); - QHBoxLayout* Layout1 = new QHBoxLayout( 0, 6, 6 ); - QHBoxLayout* Layout2 = new QHBoxLayout( 0, 6, 6 ); - QHBoxLayout* ExtensionLayout = new QHBoxLayout( 0, 6, 6 ); + TQVBoxLayout* tqlayout = new TQVBoxLayout( tab ); + TQHBoxLayout* Layout1 = new TQHBoxLayout( 0, 6, 6 ); + TQHBoxLayout* Layout2 = new TQHBoxLayout( 0, 6, 6 ); + TQHBoxLayout* ExtensionLayout = new TQHBoxLayout( 0, 6, 6 ); Layout1->addWidget( labelTemplate ); Layout1->addWidget( filename ); @@ -638,44 +638,44 @@ void KRenameImpl::setupFileTab1() ExtensionLayout->addWidget( checkExtension ); ExtensionLayout->addItem( spacer_9 ); - ExtensionLayout->addWidget( new QLabel( i18n("File extension starts at:"), tab ) ); + ExtensionLayout->addWidget( new TQLabel( i18n("File extension starts at:"), tab ) ); ExtensionLayout->addWidget( comboExtension ); - layout->addLayout( Layout1 ); - layout->addLayout( ExtensionLayout ); - layout->addLayout( Layout2 ); - layout->addItem( spacer_9 ); + tqlayout->addLayout( Layout1 ); + tqlayout->addLayout( ExtensionLayout ); + tqlayout->addLayout( Layout2 ); + tqlayout->addItem( spacer_9 ); fileTab->addWidget( tab, ID_TAB ); } void KRenameImpl::setupFileTab2() { - QWidget* tab = new QWidget( page_4 ); + TQWidget* tab = new TQWidget( page_4 ); - QHBoxLayout* layout = new QHBoxLayout( tab, 6, 6 ); + TQHBoxLayout* tqlayout = new TQHBoxLayout( tab, 6, 6 ); - QVGroupBox* vgroup1 = new QVGroupBox( i18n("&Filename"), tab ); - QGrid* grid = new QGrid( 4, vgroup1 ); + TQVGroupBox* vgroup1 = new TQVGroupBox( i18n("&Filename"), tab ); + TQGrid* grid = new TQGrid( 4, vgroup1 ); - QLabel* l = new QLabel( i18n("&Prefix:"), grid ); + TQLabel* l = new TQLabel( i18n("&Prefix:"), grid ); comboKRenamePrefix = new KComboBox( false, grid ); comboPrefix = new KMyHistoryCombo( true, grid, "comboPrefix" ); buttonEasy1 = new KPushButton( grid ); l->setBuddy( comboPrefix ); - l = new QLabel( i18n("&Suffix:"), grid ); + l = new TQLabel( i18n("&Suffix:"), grid ); comboKRenameSuffix = new KComboBox( false, grid, "comboSuffix" ); comboSuffix = new KMyHistoryCombo( true, grid ); buttonEasy2 = new KPushButton( grid ); l->setBuddy( comboSuffix ); - QStringList comboItems; + TQStringList comboItems; comboItems.append( i18n("Convert to lower case ") ); comboItems.append( i18n("Convert to upper case") ); comboItems.append( i18n("Capitalize") ); - l = new QLabel( i18n("&Name:"), grid ); + l = new TQLabel( i18n("&Name:"), grid ); comboKRenameFilename = new KComboBox( false, grid ); comboKRenameFilename->insertItem( i18n("Use original name") ); comboKRenameFilename->insertStringList( comboItems ); @@ -685,7 +685,7 @@ void KRenameImpl::setupFileTab2() comboCustom = new KMyHistoryCombo( true, grid, "comboCustom" ); buttonEasy3 = new KPushButton( grid ); - l = new QLabel( i18n("&Extension:"), grid ); + l = new TQLabel( i18n("&Extension:"), grid ); comboKRenameExtension = new KComboBox( false, grid ); comboKRenameExtension->insertItem( i18n("Use original extension") ); comboKRenameExtension->insertStringList( comboItems ); @@ -695,8 +695,8 @@ void KRenameImpl::setupFileTab2() comboCustomExtension = new KMyHistoryCombo( true, grid, "comboCustomExtension" ); buttonEasy4 = new KPushButton( grid ); - QVBox* rightBox = new QVBox( tab ); - QVGroupBox* group = new QVGroupBox( i18n("&Number" ), rightBox ); + TQVBox* rightBox = new TQVBox( tab ); + TQVGroupBox* group = new TQVGroupBox( i18n("&Number" ), rightBox ); spinStart = new KIntNumInput( group ); spinStart->setLabel( i18n( "Start &index:" ), AlignLeft | AlignVCenter ); @@ -706,10 +706,10 @@ void KRenameImpl::setupFileTab2() spinNull->setRange( 1, 100, 1, false ); buttonEasyReplace = new KPushButton( i18n("&Find and Replace..."), rightBox ); - buttonEasyReplace->setIconSet( SmallIconSet("find") ); + buttonEasyReplace->setIconSet( SmallIconSet("tqfind") ); - layout->addWidget( vgroup1 ); - layout->addWidget( rightBox ); + tqlayout->addWidget( vgroup1 ); + tqlayout->addWidget( rightBox ); comboKRenamePrefix->insertItem( "" ); comboKRenamePrefix->insertItem( i18n("Number") ); @@ -721,45 +721,45 @@ void KRenameImpl::setupFileTab2() enableControls(); - connect( comboPrefix, SIGNAL( textChanged( const QString &)), this, SLOT( changed())); - connect( comboSuffix, SIGNAL( textChanged( const QString &)), this, SLOT( changed())); - connect( comboKRenameFilename, SIGNAL( activated(int)), this, SLOT( changed())); - connect( comboCustom, SIGNAL( textChanged( const QString & ) ), this, SLOT( changed() )); - connect( comboKRenamePrefix, SIGNAL(activated(int)), this, SLOT(changed())); - connect( comboKRenameExtension, SIGNAL( activated(int)), this, SLOT( changed())); - connect( comboCustomExtension, SIGNAL( textChanged( const QString & ) ), this, SLOT( changed() )); - connect( comboKRenameSuffix, SIGNAL(activated(int)), this, SLOT(changed())); - connect( spinNull, SIGNAL( valueChanged(int) ), this, SLOT( changed() )); - connect( spinStart, SIGNAL( valueChanged(int) ), this, SLOT( changed() )); + connect( comboPrefix, TQT_SIGNAL( textChanged( const TQString &)), this, TQT_SLOT( changed())); + connect( comboSuffix, TQT_SIGNAL( textChanged( const TQString &)), this, TQT_SLOT( changed())); + connect( comboKRenameFilename, TQT_SIGNAL( activated(int)), this, TQT_SLOT( changed())); + connect( comboCustom, TQT_SIGNAL( textChanged( const TQString & ) ), this, TQT_SLOT( changed() )); + connect( comboKRenamePrefix, TQT_SIGNAL(activated(int)), this, TQT_SLOT(changed())); + connect( comboKRenameExtension, TQT_SIGNAL( activated(int)), this, TQT_SLOT( changed())); + connect( comboCustomExtension, TQT_SIGNAL( textChanged( const TQString & ) ), this, TQT_SLOT( changed() )); + connect( comboKRenameSuffix, TQT_SIGNAL(activated(int)), this, TQT_SLOT(changed())); + connect( spinNull, TQT_SIGNAL( valueChanged(int) ), this, TQT_SLOT( changed() )); + connect( spinStart, TQT_SIGNAL( valueChanged(int) ), this, TQT_SLOT( changed() )); buttonEasy1->setIconSet( SmallIcon("help") ); buttonEasy2->setIconSet( SmallIcon("help") ); buttonEasy3->setIconSet( SmallIcon("help") ); buttonEasy4->setIconSet( SmallIcon("help") ); - buttonEasy1->setSizePolicy( QSizePolicy::Maximum, QSizePolicy::Maximum ); - buttonEasy2->setSizePolicy( QSizePolicy::Maximum, QSizePolicy::Maximum ); - buttonEasy3->setSizePolicy( QSizePolicy::Maximum, QSizePolicy::Maximum ); - buttonEasy4->setSizePolicy( QSizePolicy::Maximum, QSizePolicy::Maximum ); + buttonEasy1->tqsetSizePolicy( TQSizePolicy::Maximum, TQSizePolicy::Maximum ); + buttonEasy2->tqsetSizePolicy( TQSizePolicy::Maximum, TQSizePolicy::Maximum ); + buttonEasy3->tqsetSizePolicy( TQSizePolicy::Maximum, TQSizePolicy::Maximum ); + buttonEasy4->tqsetSizePolicy( TQSizePolicy::Maximum, TQSizePolicy::Maximum ); - const QString easy_text( i18n("<qt>Insert a special KRename command which inserts file information into the filename.</qt>") ); + const TQString easy_text( i18n("<qt>Insert a special KRename command which inserts file information into the filename.</qt>") ); - connect( buttonEasy1, SIGNAL( clicked() ), this, SLOT( slotEasy1() ) ); - connect( buttonEasy2, SIGNAL( clicked() ), this, SLOT( slotEasy2() ) ); - connect( buttonEasy3, SIGNAL( clicked() ), this, SLOT( slotEasy3() ) ); - connect( buttonEasy4, SIGNAL( clicked() ), this, SLOT( slotEasy4() ) ); + connect( buttonEasy1, TQT_SIGNAL( clicked() ), this, TQT_SLOT( slotEasy1() ) ); + connect( buttonEasy2, TQT_SIGNAL( clicked() ), this, TQT_SLOT( slotEasy2() ) ); + connect( buttonEasy3, TQT_SIGNAL( clicked() ), this, TQT_SLOT( slotEasy3() ) ); + connect( buttonEasy4, TQT_SIGNAL( clicked() ), this, TQT_SLOT( slotEasy4() ) ); - QToolTip::add( buttonEasy1, easy_text ); - QToolTip::add( buttonEasy2, easy_text ); - QToolTip::add( buttonEasy3, easy_text ); - QToolTip::add( buttonEasy4, easy_text ); + TQToolTip::add( buttonEasy1, easy_text ); + TQToolTip::add( buttonEasy2, easy_text ); + TQToolTip::add( buttonEasy3, easy_text ); + TQToolTip::add( buttonEasy4, easy_text ); fileTab->addWidget( tab, ID_WIZARD ); } -QString KRenameImpl::easyOptions( KComboBox* combo, KMyHistoryCombo* custom ) +TQString KRenameImpl::easyOptions( KComboBox* combo, KMyHistoryCombo* custom ) { - QString t = QString::null; + TQString t = TQString(); if( combo->currentItem() == 0 ) t = "$"; else if( combo->currentItem() == 1 ) @@ -776,7 +776,7 @@ QString KRenameImpl::easyOptions( KComboBox* combo, KMyHistoryCombo* custom ) void KRenameImpl::changed() { - QString t = easyOptions( comboKRenameFilename, comboCustom ); + TQString t = easyOptions( comboKRenameFilename, comboCustom ); t = comboPrefix->text() + t + comboSuffix->text(); for( int i=0; i<spinNull->value();i++) @@ -793,7 +793,7 @@ void KRenameImpl::changed() if( comboKRenameSuffix->currentItem() == 2 ) t.append( "[date]" ); - QString e = easyOptions( comboKRenameExtension, comboCustomExtension ); + TQString e = easyOptions( comboKRenameExtension, comboCustomExtension ); bool update = false; update = ( counterStart() != spinStart->value() && t == fileNameTemplate() ); @@ -816,9 +816,9 @@ void KRenameImpl::parseWizardMode() * But it works pretty well and is IMHO enough for this * simple dialog. */ - QString t = filename->text(); + TQString t = filename->text(); - spinNull->setValue( t.contains( "#" ) ); + spinNull->setValue( t.tqcontains( "#" ) ); if( t.startsWith( "[date]") ) { @@ -846,13 +846,13 @@ void KRenameImpl::parseWizardMode() } int pos = -1; - if( (pos = t.find( "$" )) > -1 ) + if( (pos = t.tqfind( "$" )) > -1 ) comboKRenameFilename->setCurrentItem( 0 ); - else if( (pos = t.find( "%" )) > -1 ) + else if( (pos = t.tqfind( "%" )) > -1 ) comboKRenameFilename->setCurrentItem( 1 ); - else if( (pos = t.find( "&" )) > -1 ) + else if( (pos = t.tqfind( "&" )) > -1 ) comboKRenameFilename->setCurrentItem( 2 ); - else if( (pos = t.find( "*" )) > -1 ) + else if( (pos = t.tqfind( "*" )) > -1 ) comboKRenameFilename->setCurrentItem( 3 ); else { @@ -875,11 +875,11 @@ void KRenameImpl::setupTab1() * Draw plugin user interfaces */ - QFrame* parent; - QVBoxLayout* Layout; - QVBoxLayout* gLayout; - QGroupBox* g; - QWidget* page; + TQFrame* tqparent; + TQVBoxLayout* Layout; + TQVBoxLayout* gLayout; + TQGroupBox* g; + TQWidget* page; /* strangely I do not have to delete this stuff * after plugins have been reloaded. @@ -888,19 +888,19 @@ void KRenameImpl::setupTab1() while( ( page = page_3->pageWidget( 0 ) ) ) page_3->removePage( page ); - QPtrListIterator<PluginLoader::PluginLibrary> it( plugin->libs ); // iterator for dict + TQPtrListIterator<PluginLoader::PluginLibrary> it( plugin->libs ); // iterator for dict while ( it.current() ) { if( !(*it)->plugin->alwaysUsed() ) { - parent = page_3->addPage( (*it)->plugin->getName(), QString::null, (*it)->plugin->getIcon() ); + tqparent = page_3->addPage( (*it)->plugin->getName(), TQString(), (*it)->plugin->getIcon() ); - Layout = new QVBoxLayout( parent, 11, 6, "Layout"); - g = new QGroupBox( parent ); - gLayout = new QVBoxLayout( g, 11, 6, "gLayout" ); + Layout = new TQVBoxLayout( tqparent, 11, 6, "Layout"); + g = new TQGroupBox( tqparent ); + gLayout = new TQVBoxLayout( g, 11, 6, "gLayout" ); - (*it)->check = new QCheckBox( i18n("&Use this plugin"), parent ); - connect( (*it)->check, SIGNAL( clicked() ), this, SLOT( pluginHelpChanged() ) ); - connect( (*it)->plugin, SIGNAL( previewChanged( Plugin* ) ), this, SLOT( updatePluginPreview( Plugin* ) ) ); + (*it)->check = new TQCheckBox( i18n("&Use this plugin"), tqparent ); + connect( (*it)->check, TQT_SIGNAL( clicked() ), this, TQT_SLOT( pluginHelpChanged() ) ); + connect( (*it)->plugin, TQT_SIGNAL( previewChanged( Plugin* ) ), this, TQT_SLOT( updatePluginPreview( Plugin* ) ) ); Layout->addWidget( (*it)->check ); (*it)->plugin->drawInterface( g, gLayout ); @@ -919,8 +919,8 @@ void KRenameImpl::addFile() { bool auto_up = false; - DSDirSelectDialog* dsd = new DSDirSelectDialog( parent ); - if( dsd->exec() == QDialog::Accepted ) { + DSDirSelectDialog* dsd = new DSDirSelectDialog( tqparent ); + if( dsd->exec() == TQDialog::Accepted ) { KURL::List slist = dsd->selectedURLs(); KURL::List::Iterator it = slist.begin(); @@ -996,7 +996,7 @@ void KRenameImpl::start() return; // Let the plugins check for erorrs - QPtrListIterator<PluginLoader::PluginLibrary> it( plugin->libs ); + TQPtrListIterator<PluginLoader::PluginLibrary> it( plugin->libs ); while ( it.current() ) { if( (*it)->usePlugin && !(*it)->plugin->checkError() ) return; @@ -1004,7 +1004,7 @@ void KRenameImpl::start() } ProgressDialog* p = new ProgressDialog( 0, "p" ); - p->print(QString( i18n("Starting conversion of %1 files.") ).arg(fileList->count())); + p->print(TQString( i18n("Starting conversion of %1 files.") ).tqarg(fileList->count())); // Save History dirname->saveSettings(); @@ -1022,12 +1022,12 @@ void KRenameImpl::start() if( setupBatchRenamer( b, false ) ) { p->show(); - parent->hide(); + tqparent->hide(); b->processFiles( p, this ); } // Memory leak!!! : ?? - //delete parent; + //delete tqparent; } void KRenameImpl::enableControls() @@ -1046,16 +1046,16 @@ void KRenameImpl::enableControls() bool KRenameImpl::checkErrors() { if( filename->text().isEmpty() ) { - KMessageBox::sorry( parent, i18n("Specify a template to use for renaming files.") ); + KMessageBox::sorry( tqparent, i18n("Specify a template to use for renaming files.") ); return false; } if( dirname->text().isEmpty() && !optionRename->isChecked()) { - KMessageBox::sorry( parent, i18n("Please give a destination directory !") ); + KMessageBox::sorry( tqparent, i18n("Please give a destination directory !") ); emit showPage( 2 ); return false; } if( checkUndoScript->isChecked() && !optionCopy->isChecked() && undorequester->url().isEmpty() ) { - KMessageBox::sorry( parent, i18n("Please give the name of the undo script!") ); + KMessageBox::sorry( tqparent, i18n("Please give the name of the undo script!") ); showPage( 2 ); return false; } @@ -1065,7 +1065,7 @@ bool KRenameImpl::checkErrors() void KRenameImpl::updateCount() { - labelCount->setText( QString( i18n("Files: <b>%1</b>") ).arg(fileList->count())); + labelCount->setText( TQString( i18n("Files: <b>%1</b>") ).tqarg(fileList->count())); buttonCoord->setEnabled( (bool)fileList->count() ); buttonReplace->setEnabled( (bool)fileList->count() ); @@ -1084,12 +1084,12 @@ void KRenameImpl::updateCount() void KRenameImpl::fillStructures( BatchRenamer* b, bool preview ) { - QValueList<data> f; + TQValueList<data> f; unsigned int max = (preview && KRenameImpl::numRealTimePreview > -1 ? KRenameImpl::numRealTimePreview : fileList->count()); for( unsigned int i = 0; i < max; i++) { KURL url = fileList->url( i ); - QFileInfo fi( url.path() ); + TQFileInfo fi( url.path() ); data fdata; fdata.dir = fileList->dir( i ); @@ -1120,7 +1120,7 @@ void KRenameImpl::fillStructures( BatchRenamer* b, bool preview ) * Tell plugins that they should fill their structure, too. * Check also which plugins should be used ! */ - QPtrListIterator<PluginLoader::PluginLibrary> it( plugin->libs ); + TQPtrListIterator<PluginLoader::PluginLibrary> it( plugin->libs ); for( int z = 0; it.current(); ++it, z++ ) { if( (*it)->plugin->alwaysUsed() || ((*it)->check && (*it)->check->isChecked()) ) (*it)->plugin->fillStructure(); @@ -1136,7 +1136,7 @@ void KRenameImpl::updatePre() toggleImagePreview(); } -void KRenameImpl::addFileOrDir( const QString & name ) +void KRenameImpl::addFileOrDir( const TQString & name ) { fileList->addFile( name, false ); } @@ -1149,7 +1149,7 @@ void KRenameImpl::addFileOrDir( const KURL & name ) bool KRenameImpl::setupBatchRenamer( BatchRenamer* b, bool preview ) { b->setText( filename->text() ); - b->setExText( ( checkExtension->isChecked() ? QString("$") : extemplate->text() ) ); + b->setExText( ( checkExtension->isChecked() ? TQString("$") : extemplate->text() ) ); b->setIndex( m_index ); b->setResetCounter( m_reset ); b->setStep( m_step ); @@ -1158,20 +1158,20 @@ bool KRenameImpl::setupBatchRenamer( BatchRenamer* b, bool preview ) b->setChanges( changes ); if( !preview ) { - QString url = urlrequester->url(); + TQString url = urlrequester->url(); if( url.right(1) != "/" ) url.append( "/" ); if( !KIO::NetAccess::exists( KURL( url ) ) ) { - int m = KMessageBox::warningContinueCancel( parent, i18n("The directory %1 does not exist. " - "KRename will create it for you.").arg( url ) ); + int m = KMessageBox::warningContinueCancel( tqparent, i18n("The directory %1 does not exist. " + "KRename will create it for you.").tqarg( url ) ); if( m == KMessageBox::Cancel ) return false; int i = 0; - QString d = "/"; - while( (d += url.section( "/", i, i, QString::SectionSkipEmpty )) && ! d.isEmpty() ) { // asignment here! + TQString d = "/"; + while( (d += url.section( "/", i, i, TQString::SectionSkipEmpty )) && ! d.isEmpty() ) { // asignment here! if( !KIO::NetAccess::exists( d ) && !KIO::NetAccess::mkdir( d ) ) { qDebug( "Can't create %s", d.latin1() ); @@ -1211,7 +1211,7 @@ int KRenameImpl::currentRenameMode() void KRenameImpl::updatePluginPreview( Plugin* p ) { - QPtrListIterator<PluginLoader::PluginLibrary> it( plugin->libs ); // iterator for dict + TQPtrListIterator<PluginLoader::PluginLibrary> it( plugin->libs ); // iterator for dict while ( it.current() ) { if( (*it)->plugin == p && (*it)->usePlugin ) { updatePreview(); @@ -1225,7 +1225,7 @@ void KRenameImpl::updatePluginPreview( Plugin* p ) void KRenameImpl::updatePreview() { // is there a number in the filename or extension - if( filename->text().contains( "#" ) || extemplate->text().contains( "#" ) ) + if( filename->text().tqcontains( "#" ) || extemplate->text().tqcontains( "#" ) ) buttonNumber->setEnabled( true ); else buttonNumber->setEnabled( false ); @@ -1244,7 +1244,7 @@ void KRenameImpl::updatePreview() BatchRenamer b; if( setupBatchRenamer( &b, true ) ) { - KApplication::setOverrideCursor( Qt::WaitCursor ); + KApplication::setOverrideCursor( TQt::WaitCursor ); b.createPreview( preview ); KApplication::restoreOverrideCursor(); } @@ -1278,12 +1278,12 @@ void KRenameImpl::loadConfig() CoordDialog::m_inversion = config->readBoolEntry("Inverse", false); m_wizard = config->readBoolEntry( "GUIWizardMode", true ); - int width = config->readNumEntry( "Width", parent->width() ); - int height = config->readNumEntry( "Height", parent->height() ); + int width = config->readNumEntry( "Width", tqparent->width() ); + int height = config->readNumEntry( "Height", tqparent->height() ); if( config->readBoolEntry("Maximized", false ) ) { - parent->showMaximized(); + tqparent->showMaximized(); } else { - parent->resize( width, height ); + tqparent->resize( width, height ); } refreshColumnMode(); @@ -1305,9 +1305,9 @@ void KRenameImpl::loadConfig() checkName->setEnabled( false ); } - //parent->show(); + //tqparent->show(); page_1->setEnabled( false ); - KApplication::setOverrideCursor( Qt::WaitCursor ); + KApplication::setOverrideCursor( TQt::WaitCursor ); plugin->loadPlugins( m_loadplugins ); setupTab1(); config->setGroup("GUISettings"); @@ -1329,11 +1329,11 @@ void KRenameImpl::saveConfig() config->writeEntry("firststart", false ); config->writeEntry("ImagePreview", checkPreview->isChecked() ); config->writeEntry("StartIndex", m_index ); - config->writeEntry("Maximized", parent->isMaximized() ); - config->writeEntry("Width", parent->width() ); - config->writeEntry("Height", parent->height() ); - config->writeEntry("XPos", parent->x() ); - config->writeEntry("YPos", parent->y() ); + config->writeEntry("Maximized", tqparent->isMaximized() ); + config->writeEntry("Width", tqparent->width() ); + config->writeEntry("Height", tqparent->height() ); + config->writeEntry("XPos", tqparent->x() ); + config->writeEntry("YPos", tqparent->y() ); config->writeEntry("LoadFilePlugins", m_loadplugins ); config->writeEntry("ColumnAutosize", m_autosize ); config->writeEntry("Name", checkName->isChecked() ); @@ -1347,10 +1347,10 @@ void KRenameImpl::saveConfig() config->sync(); } -void KRenameImpl::replace() +void KRenameImpl::tqreplace() { - ReplaceDialog* r = new ReplaceDialog( rep, parent ); - if( r->exec() == QDialog::Accepted ) + ReplaceDialog* r = new ReplaceDialog( rep, tqparent ); + if( r->exec() == TQDialog::Accepted ) { rep = r->getList(); updatePreview(); @@ -1359,7 +1359,7 @@ void KRenameImpl::replace() void KRenameImpl::toggleImagePreview() { - KApplication::setOverrideCursor( Qt::waitCursor ); + KApplication::setOverrideCursor( TQt::waitCursor ); fileList->setPreview( checkPreview->isChecked() ); checkName->setEnabled( checkPreview->isChecked() ); if( !checkPreview->isChecked() ) @@ -1370,21 +1370,21 @@ void KRenameImpl::toggleImagePreview() void KRenameImpl::toggleName() { - KApplication::setOverrideCursor( Qt::waitCursor ); + KApplication::setOverrideCursor( TQt::waitCursor ); fileList->setName( checkName->isChecked() ); KApplication::restoreOverrideCursor(); } void KRenameImpl::preferences() { - ConfDialog* cd = new ConfDialog( parent, "cd" ); + ConfDialog* cd = new ConfDialog( tqparent, "cd" ); cd->setLoadPlugins( m_loadplugins ); cd->setThumbSize( fileList->getPreviewSize() ); cd->setAutosize( m_autosize ); cd->setHistoryItems( m_hist ); cd->setUseWizard( m_wizard ); - if( cd->exec() == QDialog::Accepted ) { + if( cd->exec() == TQDialog::Accepted ) { bool oldwiz = m_wizard; m_loadplugins = cd->loadplugins(); @@ -1414,27 +1414,27 @@ void KRenameImpl::changeGUIMode() /* GUI Mode was changed by the user */ saveConfig(); - int x = parent->x(); - int y = parent->y(); - int w = parent->width(); - int h = parent->height(); + int x = tqparent->x(); + int y = tqparent->y(); + int w = tqparent->width(); + int h = tqparent->height(); - QWidget* oldparent = parent; - QWidget* krename = KRenameImpl::launch( QRect( x, y, w, h ), QStringList(), this, false ); + TQWidget* oldtqparent = tqparent; + TQWidget* krename = KRenameImpl::launch( TQRect( x, y, w, h ), TQStringList(), this, false ); m_switching = true; - oldparent->removeChild( this ); - oldparent->hide(); + oldtqparent->removeChild( this ); + oldtqparent->hide(); krename->insertChild( this ); krename->show(); - oldparent->close(); + oldtqparent->close(); m_switching = false; } void KRenameImpl::moveUp() { - QListViewItem* item = preview->selectedItem(); + TQListViewItem* item = preview->selectedItem(); if(item) { int i = preview->itemIndex( item ); fileList->moveUp( i ); @@ -1448,7 +1448,7 @@ void KRenameImpl::moveUp() void KRenameImpl::moveDown() { - QListViewItem* item = preview->selectedItem(); + TQListViewItem* item = preview->selectedItem(); if(item) { int i = preview->itemIndex( item ); fileList->moveDown( i ); @@ -1460,7 +1460,7 @@ void KRenameImpl::moveDown() void KRenameImpl::undo() { - UndoDialog* u = new UndoDialog( parent ); + UndoDialog* u = new UndoDialog( tqparent ); u->exec(); delete u; } @@ -1468,7 +1468,7 @@ void KRenameImpl::undo() void KRenameImpl::changeUndoScriptName() { const char* EXTENSION = ".krename"; - QString script = undorequester->url(); + TQString script = undorequester->url(); if( script.right( 8 ) != EXTENSION ) { script += EXTENSION; undorequester->setURL( script ); @@ -1477,7 +1477,7 @@ void KRenameImpl::changeUndoScriptName() void KRenameImpl::pluginHelpChanged() { - QPtrListIterator<PluginLoader::PluginLibrary> it( plugin->libs ); // iterator for dict + TQPtrListIterator<PluginLoader::PluginLibrary> it( plugin->libs ); // iterator for dict while ( it.current() ) { if( !(*it)->plugin->alwaysUsed() ) { (*it)->plugin->removeHelp( helpDialogData ); @@ -1506,8 +1506,8 @@ void KRenameImpl::showTokenHelp() void KRenameImpl::getCoordinates() { - QString name; - QListViewItem* item = preview->selectedItem(); + TQString name; + TQListViewItem* item = preview->selectedItem(); if( item ) name = item->text( 0 ); else { @@ -1516,12 +1516,12 @@ void KRenameImpl::getCoordinates() name = item->text( 0 ); } - QFileInfo fi( name ); - QString extension; + TQFileInfo fi( name ); + TQString extension; splitFilename( &fi, &name, &extension ); - CoordDialog* cd = new CoordDialog( name, parent ); - if( cd->exec() == QDialog::Accepted ) { - QString t = filename->text(); + CoordDialog* cd = new CoordDialog( name, tqparent ); + if( cd->exec() == TQDialog::Accepted ) { + TQString t = filename->text(); if( filename->text() == "$" ) filename->setText( cd->coords() ); @@ -1534,7 +1534,7 @@ void KRenameImpl::getCoordinates() delete cd; } -void KRenameImpl::splitFilename( QFileInfo* fi, QString* base, QString* extension ) +void KRenameImpl::splitFilename( TQFileInfo* fi, TQString* base, TQString* extension ) { // first dot if( comboExtension->currentItem() == 0 ) { @@ -1551,17 +1551,17 @@ void KRenameImpl::splitFilename( QFileInfo* fi, QString* base, QString* extensio // custom value int dot = comboExtension->currentText().toInt(); - QString file = FileOperation::getName( fi->filePath() ); + TQString file = FileOperation::getName( fi->filePath() ); int p = 0; - if( !file.contains( "." ) || !dot || dot > file.contains( "." ) ) { + if( !file.tqcontains( "." ) || !dot || dot > file.tqcontains( "." ) ) { *base = file; *extension = ""; return; } for( int i = 0; i < dot; i++ ) - p = file.find( ".", p + 1 ); + p = file.tqfind( ".", p + 1 ); *base = file.left( p ); *extension = file.right( file.length() - p - 1 ); @@ -1571,11 +1571,11 @@ void KRenameImpl::splitFilename( QFileInfo* fi, QString* base, QString* extensio void KRenameImpl::refreshColumnMode() { if( !m_autosize ) { - preview->setColumnWidthMode( 0, QListView::Manual ); - preview->setColumnWidthMode( 1, QListView::Manual ); + preview->setColumnWidthMode( 0, TQListView::Manual ); + preview->setColumnWidthMode( 1, TQListView::Manual ); } else { - preview->setColumnWidthMode( 0, QListView::Maximum ); - preview->setColumnWidthMode( 1, QListView::Maximum ); + preview->setColumnWidthMode( 0, TQListView::Maximum ); + preview->setColumnWidthMode( 1, TQListView::Maximum ); } } @@ -1588,7 +1588,7 @@ void KRenameImpl::updateHist() void KRenameImpl::changeNumbers() { - NumberDialog* nd = new NumberDialog( skip, parent ); + NumberDialog* nd = new NumberDialog( skip, tqparent ); nd->spinIndex->setValue( m_index ); nd->spinStep->setValue( m_step ); nd->checkResetCounter->setChecked( m_reset ); @@ -1606,7 +1606,7 @@ void KRenameImpl::changeNumbers() void KRenameImpl::about() { - KAboutApplication * d = new KAboutApplication( kapp->aboutData(), parent ); + KAboutApplication * d = new KAboutApplication( kapp->aboutData(), tqparent ); d->show(); } @@ -1631,25 +1631,25 @@ void KRenameImpl::setWizardMode( bool mode ) parseWizardMode(); } -void KRenameImpl::changeParent( QWidget* p, KMenuBar* m, QPushButton* finish, QRect r ) +void KRenameImpl::changeParent( TQWidget* p, KMenuBar* m, TQPushButton* finish, TQRect r ) { - parent = p; + tqparent = p; menuBar = m; finishButton = finish; - connect( finishButton, SIGNAL( clicked()), this, SLOT( start() )); + connect( finishButton, TQT_SIGNAL( clicked()), this, TQT_SLOT( start() )); if( !r.isNull() ) { - parent->resize( r.size() ); - parent->move( r.x(), r.y() ); + tqparent->resize( r.size() ); + tqparent->move( r.x(), r.y() ); } setupActions(); - page_1->reparent( parent, QPoint( 0, 0 ) ); - page_2->reparent( parent, QPoint( 0, 0 ) ); - page_3->reparent( parent, QPoint( 0, 0 ) ); - page_4->reparent( parent, QPoint( 0, 0 ) ); + page_1->reparent( tqparent, TQPoint( 0, 0 ) ); + page_2->reparent( tqparent, TQPoint( 0, 0 ) ); + page_3->reparent( tqparent, TQPoint( 0, 0 ) ); + page_4->reparent( tqparent, TQPoint( 0, 0 ) ); emit pageDone( page_1, i18n( pageTitle[0] ) ); emit pageDone( page_2, i18n( pageTitle[1] ) ); @@ -1657,7 +1657,7 @@ void KRenameImpl::changeParent( QWidget* p, KMenuBar* m, QPushButton* finish, QR emit pageDone( page_4, i18n( pageTitle[3] ) ); } -QWidget* KRenameImpl::launch( QRect rect, const KURL::List & list, KRenameImpl* impl, bool loadprofile ) +TQWidget* KRenameImpl::launch( TQRect rect, const KURL::List & list, KRenameImpl* impl, bool loadprofile ) { KConfig* config = kapp->config(); config->setGroup("GUISettings"); @@ -1676,17 +1676,17 @@ QWidget* KRenameImpl::launch( QRect rect, const KURL::List & list, KRenameImpl* config->sync(); } - QWidget* w = NULL; + TQWidget* w = NULL; KRenameImpl* k = NULL; if( wizardmode ) { wizard* krename = new wizard( impl, rect ); k = krename->getKRename(); - w = (QWidget*)krename; + w = (TQWidget*)krename; } else { tabs* krename = new tabs( impl, rect ); k = krename->getKRename(); - w = (QWidget*)krename; + w = (TQWidget*)krename; } kapp->setMainWidget( w ); @@ -1715,13 +1715,13 @@ void KRenameImpl::updateDots() unsigned int max = 0; for( unsigned int i = 0; i < fileList->count(); i++ ) { - QString name = fileList->url( i ).fileName(); - int c = name.contains( "." ); + TQString name = fileList->url( i ).fileName(); + int c = name.tqcontains( "." ); max = ( c > (int)max ? c : (int)max); } for( unsigned int i = 2; i <= max; i++ ) - comboExtension->insertItem( QString::number( i ) ); + comboExtension->insertItem( TQString::number( i ) ); comboExtension->setCurrentItem( index ); } @@ -1729,22 +1729,22 @@ void KRenameImpl::updateDots() /** DCOP functions implementation */ -void KRenameImpl::setFileNameTemplate( const QString & t ) +void KRenameImpl::setFileNameTemplate( const TQString & t ) { filename->setText( t ); } -const QString KRenameImpl::fileNameTemplate() const +const TQString KRenameImpl::fileNameTemplate() const { return filename->text(); } -void KRenameImpl::setExtensionTemplate( const QString & t ) +void KRenameImpl::setExtensionTemplate( const TQString & t ) { extemplate->setText( t ); } -const QString KRenameImpl::extensionTemplate() const +const TQString KRenameImpl::extensionTemplate() const { return extemplate->text(); } @@ -1760,12 +1760,12 @@ bool KRenameImpl::useExtension() const return checkExtension->isChecked(); } -QStringList KRenameImpl::tokens() const +TQStringList KRenameImpl::tokens() const { return helpDialogData->tokens(); } -QString KRenameImpl::parseString( const QString & token, const QString & string ) +TQString KRenameImpl::parseString( const TQString & token, const TQString & string ) { BatchRenamer b; b.setIndex( 0 ); @@ -1774,7 +1774,7 @@ QString KRenameImpl::parseString( const QString & token, const QString & string return b.processString( token, string, 0 ); } -void KRenameImpl::addDir( const QString & name, const QString & filter, bool recursive, bool hidden, bool dirnames ) +void KRenameImpl::addDir( const TQString & name, const TQString & filter, bool recursive, bool hidden, bool dirnames ) { fileList->addDir( name, filter, hidden, recursive, dirnames ); } @@ -1786,7 +1786,7 @@ void KRenameImpl::setCounterStart( int index ) void KRenameImpl::loadFilePlugins() { - KApplication::setOverrideCursor( Qt::WaitCursor ); + KApplication::setOverrideCursor( TQt::WaitCursor ); plugin->loadPlugins( true ); KApplication::restoreOverrideCursor(); pluginHelpChanged(); @@ -1802,13 +1802,13 @@ void KRenameImpl::reloadFilePluginData() void KRenameImpl::manageProfiles() { - ProfileDlg dlg( this, parent, "dlg" ); + ProfileDlg dlg( this, tqparent, "dlg" ); dlg.exec(); } -void KRenameImpl::getHelpDialogString( QLineEdit* edit ) +void KRenameImpl::getHelpDialogString( TQLineEdit* edit ) { - HelpDialog hdlg( helpDialogData, parent, "hdlg", true ); + HelpDialog hdlg( helpDialogData, tqparent, "hdlg", true ); hdlg.setLineEdit( edit ); hdlg.updateHeadline(); hdlg.updateItems(); diff --git a/krename/krenameimpl.h b/krename/krenameimpl.h index ae62b7b..f6d728e 100644 --- a/krename/krenameimpl.h +++ b/krename/krenameimpl.h @@ -41,35 +41,36 @@ class MyHelpCombo; class MyLabel; class Plugin; class PluginLoader; -class QButtonGroup; -class QCheckBox; -class QGroupBox; -class QFileInfo; -class QFrame; -class QHBoxLayout; -class QLabel; -class QLineEdit; -class QListView; -class QPushButton; -class QRect; -class QWidgetStack; -class QRadioButton; -class QVBoxLayout; -class QVGroupBox; -class QWidget; +class TQButtonGroup; +class TQCheckBox; +class TQGroupBox; +class TQFileInfo; +class TQFrame; +class TQHBoxLayout; +class TQLabel; +class TQLineEdit; +class TQListView; +class TQPushButton; +class TQRect; +class TQWidgetStack; +class TQRadioButton; +class TQVBoxLayout; +class TQVGroupBox; +class TQWidget; #include <kguiitem.h> -KPushButton* createButton( KGuiItem item, QWidget* parent ); +KPushButton* createButton( KGuiItem item, TQWidget* tqparent ); -class KRenameImpl : public QObject, public KRenameDCOP { +class KRenameImpl : public TQObject, public KRenameDCOP { Q_OBJECT + TQ_OBJECT friend class ProfileManager; friend class ProfileDlg; friend class tabs; public: - KRenameImpl( QWidget* p, KMenuBar* m, QPushButton* finish ); + KRenameImpl( TQWidget* p, KMenuBar* m, TQPushButton* finish ); ~KRenameImpl(); void setWizardMode( bool mode ); @@ -81,27 +82,27 @@ class KRenameImpl : public QObject, public KRenameDCOP { void addFileOrDir( const KURL & name ); void setup( bool wizardmode ); - void changeParent( QWidget* p, KMenuBar* m, QPushButton* finish, QRect r ); - static QWidget* launch( QRect rect, const KURL::List & list, KRenameImpl* impl = 0, bool loadprofile = true ); + void changeParent( TQWidget* p, KMenuBar* m, TQPushButton* finish, TQRect r ); + static TQWidget* launch( TQRect rect, const KURL::List & list, KRenameImpl* impl = 0, bool loadprofile = true ); /** DCOP functions we have to implement */ - void addFileOrDir( const QString & name ); - const QString fileNameTemplate() const; + void addFileOrDir( const TQString & name ); + const TQString fileNameTemplate() const; inline int counterStart() const; - void setExtensionTemplate( const QString & t ); - const QString extensionTemplate() const; + void setExtensionTemplate( const TQString & t ); + const TQString extensionTemplate() const; void setUseExtension( bool b ); bool useExtension() const; - QStringList tokens() const; + TQStringList tokens() const; - QString parseString( const QString & token, const QString & string ); - void addDir( const QString & name, const QString & filter, bool recursive, bool hidden, bool dirnames ); + TQString parseString( const TQString & token, const TQString & string ); + void addDir( const TQString & name, const TQString & filter, bool recursive, bool hidden, bool dirnames ); - const QString title( int index ) const; + const TQString title( int index ) const; /** @returns true if the user has specified a profile on the commandline * other wise false is returned @@ -109,11 +110,11 @@ class KRenameImpl : public QObject, public KRenameDCOP { inline bool hasCommandlineProfile() const; public slots: - void setFileNameTemplate( const QString & t ); + void setFileNameTemplate( const TQString & t ); void setCounterStart( int index ); signals: - void pageDone( QWidget* page, const QString & title ); + void pageDone( TQWidget* page, const TQString & title ); void showPage( int page ); void enableFinish( bool b ); @@ -130,7 +131,7 @@ class KRenameImpl : public QObject, public KRenameDCOP { void removeFile(); void removeFile( int index ); void preferences(); - void replace(); + void tqreplace(); void saveConfig(); void start(); void updateCount(); @@ -147,7 +148,7 @@ class KRenameImpl : public QObject, public KRenameDCOP { void loadFilePlugins(); void reloadFilePluginData(); void manageProfiles(); - QString easyOptions( KComboBox* combo, KMyHistoryCombo* custom ); + TQString easyOptions( KComboBox* combo, KMyHistoryCombo* custom ); void slotEasy1(); void slotEasy2(); void slotEasy3(); @@ -173,7 +174,7 @@ class KRenameImpl : public QObject, public KRenameDCOP { void loadConfig(); void fillStructures( BatchRenamer* b, bool preview ); bool setupBatchRenamer( BatchRenamer* b, bool preview ); - void splitFilename( QFileInfo* fi, QString* base, QString* extension ); + void splitFilename( TQFileInfo* fi, TQString* base, TQString* extension ); void setupActions(); void setupPage1(); @@ -186,29 +187,29 @@ class KRenameImpl : public QObject, public KRenameDCOP { void setupPages(); void updateHist(); void parseCommandline(); - void addTitle( QWidget* p, QVBoxLayout* layout, QString title ); + void addTitle( TQWidget* p, TQVBoxLayout* tqlayout, TQString title ); - QValueList<manualchanges> changes; + TQValueList<manualchanges> changes; void refreshColumnMode(); void parseWizardMode(); - void getHelpDialogString( QLineEdit* edit ); + void getHelpDialogString( TQLineEdit* edit ); protected: - QWidget* parent; + TQWidget* tqparent; KMenuBar* menuBar; KPopupMenu* mnuSort; KAction* loadPlugins; - QPushButton* finishButton; + TQPushButton* finishButton; PluginLoader* plugin; - QWidgetStack* fileTab; + TQWidgetStack* fileTab; - QWidget* page_1; - QWidget* page_2; + TQWidget* page_1; + TQWidget* page_2; KJanusWidget* page_3; - QWidget* page_4; + TQWidget* page_4; bool m_wizard; bool m_loadplugins; @@ -241,27 +242,27 @@ class KRenameImpl : public QObject, public KRenameDCOP { KPushButton* buttonEasy4; KComboBox* comboSort; - QLabel* description; - QLabel* description2; - QLabel* description3; - QLabel* description4; + TQLabel* description; + TQLabel* description2; + TQLabel* description3; + TQLabel* description4; - QLabel* labelTemplate; - QLabel* labelHelp; - QLabel* labelCount; - QLabel* labelPoint; + TQLabel* labelTemplate; + TQLabel* labelHelp; + TQLabel* labelCount; + TQLabel* labelPoint; KMyListBox* fileList; KMyListView* preview; - QButtonGroup* groupOptions; + TQButtonGroup* groupOptions; - QRadioButton* optionCopy; - QRadioButton* optionMove; - QRadioButton* optionRename; - QRadioButton* optionLink; + TQRadioButton* optionCopy; + TQRadioButton* optionMove; + TQRadioButton* optionRename; + TQRadioButton* optionLink; - QGroupBox* groupExtension; - QVGroupBox* groupUndo; + TQGroupBox* groupExtension; + TQVGroupBox* groupUndo; KMyHistoryCombo* dirname; KURLRequester* urlrequester; @@ -269,11 +270,11 @@ class KRenameImpl : public QObject, public KRenameDCOP { KMyHistoryCombo* filename; KMyHistoryCombo* extemplate; - QCheckBox* checkName; - QCheckBox* checkExtension; - QCheckBox* checkOverwrite; - QCheckBox* checkPreview; - QCheckBox* checkUndoScript; + TQCheckBox* checkName; + TQCheckBox* checkExtension; + TQCheckBox* checkOverwrite; + TQCheckBox* checkPreview; + TQCheckBox* checkUndoScript; KComboBox* comboExtension; @@ -282,8 +283,8 @@ class KRenameImpl : public QObject, public KRenameDCOP { HelpDialogData* helpDialogData; BatchRenamer* b; - QValueList<int> skip; - QValueList<replacestrings> rep; + TQValueList<int> skip; + TQValueList<replacestrings> rep; // ========== // Easy mode: @@ -306,37 +307,37 @@ class KRenameImpl : public QObject, public KRenameDCOP { // Layout: // =========== - QHBoxLayout* pageLayout; - QVBoxLayout* pageLayout_2; - QVBoxLayout* pageLayout_3; - QVBoxLayout* pageLayout_4; - - QHBoxLayout* tabLayout_0; - QHBoxLayout* tabLayout_1; - QHBoxLayout* tabLayout_2; - QVBoxLayout* tabLayout_3; - QVBoxLayout* groupAdvancedExtensionLayout; - QVBoxLayout* groupOptionsLayout; - QHBoxLayout* groupDirLayout; - QVBoxLayout* groupNumberLayout; - QHBoxLayout* groupExtensionLayout; + TQHBoxLayout* pageLayout; + TQVBoxLayout* pageLayout_2; + TQVBoxLayout* pageLayout_3; + TQVBoxLayout* pageLayout_4; + + TQHBoxLayout* tabLayout_0; + TQHBoxLayout* tabLayout_1; + TQHBoxLayout* tabLayout_2; + TQVBoxLayout* tabLayout_3; + TQVBoxLayout* groupAdvancedExtensionLayout; + TQVBoxLayout* groupOptionsLayout; + TQHBoxLayout* groupDirLayout; + TQVBoxLayout* groupNumberLayout; + TQHBoxLayout* groupExtensionLayout; // page1 - QHBoxLayout* Layout2; - QVBoxLayout* Layout3; - QHBoxLayout* Layout4; - QVBoxLayout* Layout5; + TQHBoxLayout* Layout2; + TQVBoxLayout* Layout3; + TQHBoxLayout* Layout4; + TQVBoxLayout* Layout5; // page4 - QVBoxLayout* Layout10; - QHBoxLayout* Layout15; - QVBoxLayout* Layout16; - QHBoxLayout* Layout22; - QVBoxLayout* Layout23; + TQVBoxLayout* Layout10; + TQHBoxLayout* Layout15; + TQVBoxLayout* Layout16; + TQHBoxLayout* Layout22; + TQVBoxLayout* Layout23; // tab - QHBoxLayout* Layout100; - QHBoxLayout* Layout101; + TQHBoxLayout* Layout100; + TQHBoxLayout* Layout101; }; diff --git a/krename/main.cpp b/krename/main.cpp index f8df37a..0609a50 100644 --- a/krename/main.cpp +++ b/krename/main.cpp @@ -15,9 +15,9 @@ * * ***************************************************************************/ -// Qt includes -#include <qrect.h> -#include <qwidget.h> +// TQt includes +#include <tqrect.h> +#include <tqwidget.h> // KDE includes #include <kapplication.h> @@ -118,11 +118,11 @@ int main(int argc, char *argv[]) KCmdLineArgs::addCmdLineOptions( options ); KApplication a; - a.connect( &a, SIGNAL( lastWindowClosed() ), &a, SLOT( quit() ) ); + a.connect( &a, TQT_SIGNAL( lastWindowClosed() ), &a, TQT_SLOT( quit() ) ); KImageIO::registerFormats(); - QWidget* krename = KRenameImpl::launch( QRect( 0, 0, 0, 0 ), QStringList() ); + TQWidget* krename = KRenameImpl::launch( TQRect( 0, 0, 0, 0 ), TQStringList() ); /* Check if Krename * was started from root! diff --git a/krename/mydirplugin.cpp b/krename/mydirplugin.cpp index 202079f..1f396bf 100644 --- a/krename/mydirplugin.cpp +++ b/krename/mydirplugin.cpp @@ -25,19 +25,19 @@ #include <klocale.h> // QT includes -#include <qlabel.h> -#include <qlayout.h> -#include <qlineedit.h> -#include <qpushbutton.h> -#include <qgroupbox.h> -#include <qspinbox.h> - -const QString MyDirPlugin::getName() const +#include <tqlabel.h> +#include <tqlayout.h> +#include <tqlineedit.h> +#include <tqpushbutton.h> +#include <tqgroupbox.h> +#include <tqspinbox.h> + +const TQString MyDirPlugin::getName() const { return i18n("Dir Plugin"); } -const QString MyDirPlugin::getAccelName() const +const TQString MyDirPlugin::getAccelName() const { return i18n("&Dir Plugin"); } @@ -52,44 +52,44 @@ bool MyDirPlugin::checkError() return true; } -const QPixmap MyDirPlugin::getIcon() const +const TQPixmap MyDirPlugin::getIcon() const { return kapp->iconLoader()->loadIcon( "folder", KIcon::Small ); } -void MyDirPlugin::drawInterface( QWidget* w, QVBoxLayout* l ) +void MyDirPlugin::drawInterface( TQWidget* w, TQVBoxLayout* l ) { - QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); - QSpacerItem* spacer2 = new QSpacerItem( 20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding ); + TQSpacerItem* spacer = new TQSpacerItem( 20, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum ); + TQSpacerItem* spacer2 = new TQSpacerItem( 20, 20, TQSizePolicy::Minimum, TQSizePolicy::Expanding ); - QVBoxLayout* LayoutA = new QVBoxLayout( 0, 6, 6 ); - QVBoxLayout* LayoutB = new QVBoxLayout( 0, 6, 6 ); + TQVBoxLayout* LayoutA = new TQVBoxLayout( 0, 6, 6 ); + TQVBoxLayout* LayoutB = new TQVBoxLayout( 0, 6, 6 ); m_widget = w; - QLabel* la = new QLabel( w ); + TQLabel* la = new TQLabel( w ); la->setText( i18n("<qt>This plugin sorts files after renaming in subdirectories.</qt>") ); l->addWidget( la ); - groupNumber = new QGroupBox( w ); + groupNumber = new TQGroupBox( w ); groupNumber->setTitle( i18n( "&Options" ) ); groupNumber->setColumnLayout(0, Qt::Vertical ); - groupNumber->layout()->setSpacing( 6 ); - groupNumber->layout()->setMargin( 11 ); - groupNumberLayout = new QHBoxLayout( groupNumber->layout() ); - groupNumberLayout->setAlignment( Qt::AlignTop ); + groupNumber->tqlayout()->setSpacing( 6 ); + groupNumber->tqlayout()->setMargin( 11 ); + groupNumberLayout = new TQHBoxLayout( groupNumber->tqlayout() ); + groupNumberLayout->tqsetAlignment( TQt::AlignTop ); - QLabel* la2 = new QLabel( groupNumber ); + TQLabel* la2 = new TQLabel( groupNumber ); la2->setText( i18n( "Files per directory:" ) ); - spinFiles = new QSpinBox( groupNumber ); + spinFiles = new TQSpinBox( groupNumber ); spinFiles->setRange( 1, 60000 ); spinFiles->setValue( 10 ); - QLabel* la3 = new QLabel( groupNumber ); + TQLabel* la3 = new TQLabel( groupNumber ); la3->setText( i18n( "Start index:" ) ); - spinStart = new QSpinBox( groupNumber ); + spinStart = new TQSpinBox( groupNumber ); spinFiles->setRange( 0, 60000 ); LayoutA->addWidget( la2 ); @@ -101,16 +101,16 @@ void MyDirPlugin::drawInterface( QWidget* w, QVBoxLayout* l ) groupNumberLayout->addLayout( LayoutB ); groupNumberLayout->addItem( spacer ); - groupOutput = new QGroupBox( w ); + groupOutput = new TQGroupBox( w ); groupOutput->setTitle( i18n( "Output &Directory" ) ); groupOutput->setColumnLayout(0, Qt::Vertical ); - groupOutput->layout()->setSpacing( 6 ); - groupOutput->layout()->setMargin( 11 ); - groupOutputLayout = new QHBoxLayout( groupOutput->layout() ); - groupOutputLayout->setAlignment( Qt::AlignTop ); + groupOutput->tqlayout()->setSpacing( 6 ); + groupOutput->tqlayout()->setMargin( 11 ); + groupOutputLayout = new TQHBoxLayout( groupOutput->tqlayout() ); + groupOutputLayout->tqsetAlignment( TQt::AlignTop ); - outputdir = new QLineEdit( groupOutput ); - buttonDir = new QPushButton( groupOutput ); + outputdir = new TQLineEdit( groupOutput ); + buttonDir = new TQPushButton( groupOutput ); buttonDir->setText( "..." ); groupOutputLayout->addWidget( outputdir ); @@ -120,7 +120,7 @@ void MyDirPlugin::drawInterface( QWidget* w, QVBoxLayout* l ) l->addWidget( groupOutput ); l->addItem( spacer2 ); - connect( buttonDir, SIGNAL(clicked()), this, SLOT(chooseDir())); + connect( buttonDir, TQT_SIGNAL(clicked()), this, TQT_SLOT(chooseDir())); } void MyDirPlugin::fillStructure() @@ -131,28 +131,28 @@ void MyDirPlugin::fillStructure() filecounter = 0; dircounter = spinStart->value(); - curdir = dir + QString("/%1/").arg( dircounter ); + curdir = dir + TQString("/%1/").tqarg( dircounter ); - d = new QDir( dir ); + d = new TQDir( dir ); d->mkdir( curdir ); } -QString MyDirPlugin::processFile( BatchRenamer*, int, QString token, int ) +TQString MyDirPlugin::processFile( BatchRenamer*, int, TQString token, int ) { - QString newname; + TQString newname; // token = filename if( filecounter == fpd ) { filecounter = 0; dircounter++; - curdir = dir + QString("/%1/").arg( dircounter ); + curdir = dir + TQString("/%1/").tqarg( dircounter ); d->mkdir( curdir ); } - QFileInfo f( token ); + TQFileInfo f( token ); newname = curdir + f.fileName(); d->rename( token, newname ); filecounter++; - return QString::null; + return TQString(); } void MyDirPlugin::finished() @@ -162,7 +162,7 @@ void MyDirPlugin::finished() void MyDirPlugin::chooseDir() { - QString s (KFileDialog::getExistingDirectory ( QString::null )); + TQString s (KFileDialog::getExistingDirectory ( TQString() )); if(!s.isEmpty()) outputdir->setText( s ); } diff --git a/krename/mydirplugin.h b/krename/mydirplugin.h index 1c27dc7..7dac484 100644 --- a/krename/mydirplugin.h +++ b/krename/mydirplugin.h @@ -23,28 +23,29 @@ #include "plugin.h" #include "helpdialog.h" -class QDir; -class QHBoxLayout; -class QGroupBox; -class QLineEdit; -class QPushButton; -class QSpinBox; -class QString; -class QVBoxLayout; -class QWidget; +class TQDir; +class TQHBoxLayout; +class TQGroupBox; +class TQLineEdit; +class TQPushButton; +class TQSpinBox; +class TQString; +class TQVBoxLayout; +class TQWidget; class MyDirPlugin : public Plugin { Q_OBJECT + TQ_OBJECT public: - const QString getName() const; - const QString getAccelName() const; + const TQString getName() const; + const TQString getAccelName() const; const int type() const; bool checkError(); - void drawInterface( QWidget* w, QVBoxLayout* l ); + void drawInterface( TQWidget* w, TQVBoxLayout* l ); void fillStructure(); - QString processFile( BatchRenamer*, int, QString token, int ); + TQString processFile( BatchRenamer*, int, TQString token, int ); void finished(); - const QPixmap getIcon() const; + const TQPixmap getIcon() const; private slots: void chooseDir(); @@ -53,20 +54,20 @@ class MyDirPlugin : public Plugin { int fpd; // files per dir int filecounter; int dircounter; - QString dir; - QString curdir; - QDir* d; + TQString dir; + TQString curdir; + TQDir* d; - QLineEdit* outputdir; - QPushButton* buttonDir; - QSpinBox* spinFiles; - QSpinBox* spinStart; + TQLineEdit* outputdir; + TQPushButton* buttonDir; + TQSpinBox* spinFiles; + TQSpinBox* spinStart; - QGroupBox* groupOutput; - QHBoxLayout* groupOutputLayout; + TQGroupBox* groupOutput; + TQHBoxLayout* groupOutputLayout; - QGroupBox* groupNumber; - QHBoxLayout* groupNumberLayout; + TQGroupBox* groupNumber; + TQHBoxLayout* groupNumberLayout; }; #endif diff --git a/krename/myinputdialog.cpp b/krename/myinputdialog.cpp index 10428d2..f922bb5 100644 --- a/krename/myinputdialog.cpp +++ b/krename/myinputdialog.cpp @@ -20,26 +20,26 @@ #include <klineedit.h> #include <kpushbutton.h> #include <klocale.h> -#include <qlabel.h> -#include <qlayout.h> -#include <qtooltip.h> +#include <tqlabel.h> +#include <tqlayout.h> +#include <tqtooltip.h> -MyInputDialog::MyInputDialog( QString filename, bool revertEnabled, QWidget* parent ) - : QDialog( parent, 0, true, 0 ) +MyInputDialog::MyInputDialog( TQString filename, bool revertEnabled, TQWidget* tqparent ) + : TQDialog( tqparent, 0, true, 0 ) { // I do not think this has to be translated setCaption( "KRename" ); - MyInputDialogLayout = new QVBoxLayout( this, 11, 6, "MyInputDialogLayout"); - Layout = new QHBoxLayout( 0, 0, 6, "Layout"); + MyInputDialogLayout = new TQVBoxLayout( this, 11, 6, "MyInputDialogLayout"); + Layout = new TQHBoxLayout( 0, 0, 6, "Layout"); - TextLabel1 = new QLabel( this, "TextLabel1" ); + TextLabel1 = new TQLabel( this, "TextLabel1" ); TextLabel1->setText( i18n( "Please input a new filename:" ) ); text = new KLineEdit( this, "text" ); text->setText( filename ); - QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); + TQSpacerItem* spacer = new TQSpacerItem( 20, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum ); buttonKrename = new KPushButton( this, "buttonKrename" ); buttonKrename->setText( i18n( "&Revert Changes" ) ); @@ -67,19 +67,19 @@ MyInputDialog::MyInputDialog( QString filename, bool revertEnabled, QWidget* par MyInputDialogLayout->addWidget( text ); MyInputDialogLayout->addLayout( Layout ); - connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( reject() ) ); - connect( buttonOk, SIGNAL( clicked() ), this, SLOT( accept() ) ); - connect( buttonKrename, SIGNAL( clicked() ), this, SLOT( krename() ) ); - connect( buttonFilename, SIGNAL( clicked() ), this, SLOT( slotFilename() ) ); + connect( buttonCancel, TQT_SIGNAL( clicked() ), this, TQT_SLOT( reject() ) ); + connect( buttonOk, TQT_SIGNAL( clicked() ), this, TQT_SLOT( accept() ) ); + connect( buttonKrename, TQT_SIGNAL( clicked() ), this, TQT_SLOT( krename() ) ); + connect( buttonFilename, TQT_SIGNAL( clicked() ), this, TQT_SLOT( slotFilename() ) ); - QToolTip::add( buttonKrename, i18n("Use the filename that is generated by " + TQToolTip::add( buttonKrename, i18n("Use the filename that is generated by " "KRename instead of your changes." ) ); } MyInputDialog::~MyInputDialog() { } - QString MyInputDialog::filename() const + TQString MyInputDialog::filename() const { return text->text(); } diff --git a/krename/myinputdialog.h b/krename/myinputdialog.h index 689cead..240d26a 100644 --- a/krename/myinputdialog.h +++ b/krename/myinputdialog.h @@ -18,24 +18,25 @@ #ifndef MYINPUTDIALOG_H #define MYINPUTDIALOG_H -#include <qdialog.h> +#include <tqdialog.h> -class QVBoxLayout; -class QHBoxLayout; -class QGridLayout; +class TQVBoxLayout; +class TQHBoxLayout; +class TQGridLayout; class KLineEdit; class KPushButton; -class QLabel; -class QString; -class MyInputDialog : public QDialog +class TQLabel; +class TQString; +class MyInputDialog : public TQDialog { Q_OBJECT + TQ_OBJECT public: - MyInputDialog( QString filename, bool revertEnabled = true, QWidget* parent = 0 ); + MyInputDialog( TQString filename, bool revertEnabled = true, TQWidget* tqparent = 0 ); ~MyInputDialog(); - QString filename() const; - inline void setInputFilename( const QString s ); + TQString filename() const; + inline void setInputFilename( const TQString s ); enum returnCodes { OK, @@ -52,21 +53,21 @@ class MyInputDialog : public QDialog void reject(); private: - QLabel* TextLabel1; + TQLabel* TextLabel1; KLineEdit* text; KPushButton* buttonKrename; KPushButton* buttonFilename; KPushButton* buttonOk; KPushButton* buttonCancel; - QString m_oldfilename; + TQString m_oldfilename; protected: - QVBoxLayout* MyInputDialogLayout; - QHBoxLayout* Layout; + TQVBoxLayout* MyInputDialogLayout; + TQHBoxLayout* Layout; }; -void MyInputDialog::setInputFilename( const QString s ) +void MyInputDialog::setInputFilename( const TQString s ) { m_oldfilename = s; } diff --git a/krename/numberdialog.cpp b/krename/numberdialog.cpp index d7264c9..0e3f327 100644 --- a/krename/numberdialog.cpp +++ b/krename/numberdialog.cpp @@ -18,39 +18,39 @@ #include "numberdialog.h" #include "batchrenamer.h" -// Qt includes -#include <qgroupbox.h> -#include <qlayout.h> -#include <qtooltip.h> +// TQt includes +#include <tqgroupbox.h> +#include <tqlayout.h> +#include <tqtooltip.h> // KDE includes #include <kapplication.h> #include <kconfig.h> #include <klocale.h> #include <kpushbutton.h> -#include <qcheckbox.h> +#include <tqcheckbox.h> -void KMyIntSpinBox::keyPressEvent( QKeyEvent* e ) +void KMyIntSpinBox::keyPressEvent( TQKeyEvent* e ) { if( e->key() == Key_Return ) emit returnPressed(); } -NumberDialog::NumberDialog(QValueList<int> & n,QWidget *parent ) +NumberDialog::NumberDialog(TQValueList<int> & n,TQWidget *tqparent ) : KDialogBase( KDialogBase::Plain, "KRename", - KDialogBase::Ok | KDialogBase::Cancel, KDialogBase::Ok, parent, 0, true, true ) + KDialogBase::Ok | KDialogBase::Cancel, KDialogBase::Ok, tqparent, 0, true, true ) { - QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding ); + TQSpacerItem* spacer = new TQSpacerItem( 20, 20, TQSizePolicy::Minimum, TQSizePolicy::Expanding ); - QVBoxLayout* layout = new QVBoxLayout( plainPage(), 6, 6 ); + TQVBoxLayout* tqlayout = new TQVBoxLayout( plainPage(), 6, 6 ); - QGroupBox* group1 = new QGroupBox( plainPage() ); + TQGroupBox* group1 = new TQGroupBox( plainPage() ); group1->setTitle( i18n("&Numbering") ); group1->setColumnLayout(0, Qt::Vertical ); - group1->layout()->setSpacing( 6 ); - group1->layout()->setMargin( 11 ); - QVBoxLayout* group1Layout = new QVBoxLayout( group1->layout() ); - group1Layout->setAlignment( Qt::AlignTop ); + group1->tqlayout()->setSpacing( 6 ); + group1->tqlayout()->setMargin( 11 ); + TQVBoxLayout* group1Layout = new TQVBoxLayout( group1->tqlayout() ); + group1Layout->tqsetAlignment( TQt::AlignTop ); spinIndex = new KIntNumInput( group1 ); spinIndex->setMaxValue( SPINMAX ); @@ -61,15 +61,15 @@ NumberDialog::NumberDialog(QValueList<int> & n,QWidget *parent ) spinStep->setValue( 1 ); spinStep->setLabel( i18n( "Step &by:" ), AlignLeft | AlignVCenter ); - checkResetCounter = new QCheckBox( i18n("&Reset counter for every directory"), group1 ); + checkResetCounter = new TQCheckBox( i18n("&Reset counter for every directory"), group1 ); - QGroupBox* group2 = new QGroupBox( plainPage() ); + TQGroupBox* group2 = new TQGroupBox( plainPage() ); group2->setTitle( i18n("S&kip Numbers") ); group2->setColumnLayout(0, Qt::Horizontal ); - group2->layout()->setSpacing( 6 ); - group2->layout()->setMargin( 11 ); - QHBoxLayout* group2Layout = new QHBoxLayout( group2->layout() ); - group2Layout->setAlignment( Qt::AlignTop ); + group2->tqlayout()->setSpacing( 6 ); + group2->tqlayout()->setMargin( 11 ); + TQHBoxLayout* group2Layout = new TQHBoxLayout( group2->tqlayout() ); + group2Layout->tqsetAlignment( TQt::AlignTop ); listNumbers = new KListBox( group2 ); @@ -85,35 +85,35 @@ NumberDialog::NumberDialog(QValueList<int> & n,QWidget *parent ) spinNumber->setValue( 0 ); spinNumber->setFocus(); - QVBoxLayout* layout2 = new QVBoxLayout( 0, 6, 6 ); - layout2->addWidget( buttonAdd ); - layout2->addWidget( buttonRemove ); - layout2->addWidget( spinNumber ); - layout2->addItem( spacer ); + TQVBoxLayout* tqlayout2 = new TQVBoxLayout( 0, 6, 6 ); + tqlayout2->addWidget( buttonAdd ); + tqlayout2->addWidget( buttonRemove ); + tqlayout2->addWidget( spinNumber ); + tqlayout2->addItem( spacer ); group1Layout->addWidget( spinIndex ); group1Layout->addWidget( spinStep ); group1Layout->addWidget( checkResetCounter ); group2Layout->addWidget( listNumbers ); - group2Layout->addLayout( layout2 ); + group2Layout->addLayout( tqlayout2 ); - layout->addWidget( group1 ); - layout->addWidget( group2 ); + tqlayout->addWidget( group1 ); + tqlayout->addWidget( group2 ); - QToolTip::add( spinIndex, i18n( "Number of the first file." ) ); - QToolTip::add( spinStep, i18n( "The counter is increased/decreased by this value." ) ); - QToolTip::add( listNumbers, i18n("Add all numbers that should be skipped by krename during the rename process.<br>" + TQToolTip::add( spinIndex, i18n( "Number of the first file." ) ); + TQToolTip::add( spinStep, i18n( "The counter is increased/decreased by this value." ) ); + TQToolTip::add( listNumbers, i18n("Add all numbers that should be skipped by krename during the rename process.<br>" "E.g.: If 2 is skipped files will be numbered: file0, file1, file3, ...") ); - QToolTip::add( checkResetCounter, i18n("<qt>The counter is set to the start index in every directory. " + TQToolTip::add( checkResetCounter, i18n("<qt>The counter is set to the start index in every directory. " "This setting applies to all used counters.</qt>" ) ); - connect( buttonAdd, SIGNAL( clicked() ), this, SLOT( addNumber() ) ); - connect( buttonRemove,SIGNAL( clicked() ), this, SLOT( removeNumber() ) ); - connect( spinNumber, SIGNAL( returnPressed()), this, SLOT( addNumber() ) ); + connect( buttonAdd, TQT_SIGNAL( clicked() ), this, TQT_SLOT( addNumber() ) ); + connect( buttonRemove,TQT_SIGNAL( clicked() ), this, TQT_SLOT( removeNumber() ) ); + connect( spinNumber, TQT_SIGNAL( returnPressed()), this, TQT_SLOT( addNumber() ) ); for( unsigned int i = 0; i < n.count(); i++ ) - listNumbers->insertItem( QString("%1").arg(n[i]), -1 ); + listNumbers->insertItem( TQString("%1").tqarg(n[i]), -1 ); update(); } @@ -124,7 +124,7 @@ NumberDialog::~NumberDialog() void NumberDialog::addNumber() { - QString tmp = QString("%1").arg(spinNumber->value()); + TQString tmp = TQString("%1").tqarg(spinNumber->value()); for( unsigned int i = 0; i < listNumbers->count(); i++ ) if( listNumbers->text(i) == tmp ) return; @@ -145,9 +145,9 @@ void NumberDialog::removeNumber() } while( i < listNumbers->count() ); } -QValueList<int> NumberDialog::getList() +TQValueList<int> NumberDialog::getList() { - QValueList<int> skip; + TQValueList<int> skip; for( unsigned int i = 0; i < listNumbers->count(); i++ ) skip.append( listNumbers->text(i).toInt() ); @@ -162,7 +162,7 @@ void NumberDialog::sort() for( unsigned int i = 0; i < listNumbers->count()-1; i++) { if( listNumbers->text(i).toInt() > listNumbers->text(i+1).toInt() ) { - QString tmp = listNumbers->text(i); + TQString tmp = listNumbers->text(i); listNumbers->removeItem(i); listNumbers->insertItem( tmp, i+1 ); i = 0; diff --git a/krename/numberdialog.h b/krename/numberdialog.h index 9de464c..e4f3adf 100644 --- a/krename/numberdialog.h +++ b/krename/numberdialog.h @@ -18,9 +18,9 @@ #ifndef NUMBERDIALOG_H #define NUMBERDIALOG_H -#include <qwidget.h> +#include <tqwidget.h> #include <kdialogbase.h> -#include <qvaluelist.h> +#include <tqvaluelist.h> // KDE includes #include <knuminput.h> @@ -28,25 +28,27 @@ class KMyIntSpinBox : public KIntSpinBox { Q_OBJECT + TQ_OBJECT public: - KMyIntSpinBox( QWidget* parent ) - : KIntSpinBox( parent ) + KMyIntSpinBox( TQWidget* tqparent ) + : KIntSpinBox( tqparent ) { }; ~KMyIntSpinBox() { }; private: - void keyPressEvent( QKeyEvent* e ); + void keyPressEvent( TQKeyEvent* e ); signals: void returnPressed(); }; -class QCheckBox; +class TQCheckBox; class KIntNumInput; class KListBox; class KPushButton; class NumberDialog : public KDialogBase { Q_OBJECT + TQ_OBJECT public: - NumberDialog(QValueList<int> & n,QWidget *parent=0); + NumberDialog(TQValueList<int> & n,TQWidget *tqparent=0); ~NumberDialog(); // TODO: bad object oriented design!!! @@ -54,9 +56,9 @@ class NumberDialog : public KDialogBase { KIntNumInput* spinIndex; KIntNumInput* spinStep; - QCheckBox* checkResetCounter; + TQCheckBox* checkResetCounter; - QValueList<int> getList(); + TQValueList<int> getList(); private slots: void addNumber(); diff --git a/krename/permission.cpp b/krename/permission.cpp index 918052e..d25a5b6 100644 --- a/krename/permission.cpp +++ b/krename/permission.cpp @@ -18,10 +18,10 @@ #include "permission.h" // QT includes -#include <qcheckbox.h> -#include <qgroupbox.h> -#include <qlabel.h> -#include <qlayout.h> +#include <tqcheckbox.h> +#include <tqgroupbox.h> +#include <tqlabel.h> +#include <tqlayout.h> // KDE includes #include <kapplication.h> @@ -37,12 +37,12 @@ #include <grp.h> #include <unistd.h> -const QString MyPermPlugin::getName() const +const TQString MyPermPlugin::getName() const { return i18n("Permissions"); } -const QString MyPermPlugin::getAccelName() const +const TQString MyPermPlugin::getAccelName() const { return i18n("&Permissions"); } @@ -57,71 +57,71 @@ bool MyPermPlugin::checkError() return true; } -void MyPermPlugin::drawInterface( QWidget* w, QVBoxLayout* l ) +void MyPermPlugin::drawInterface( TQWidget* w, TQVBoxLayout* l ) { int i; unsigned int uid; // Maybe this must be signed int ? struct passwd *user; struct group *ge; - QLabel *la, *cl[3]; - QGridLayout *gl; + TQLabel *la, *cl[3]; + TQGridLayout *gl; - QString strOwner; + TQString strOwner; m_widget = w; - l->setResizeMode( QLayout::FreeResize ); - w->setMinimumSize( QSize( 100, 100 ) ); + l->setResizeMode( TQLayout::FreeResize ); + w->setMinimumSize( TQSize( 100, 100 ) ); - Layout0 = new QVBoxLayout( 0, 0, 6 ); + Layout0 = new TQVBoxLayout( 0, 0, 6 ); - groupPermission = new QGroupBox ( i18n("Access permissions"), w ); + groupPermission = new TQGroupBox ( i18n("Access permissions"), w ); groupPermission->setEnabled( FALSE ); - gl = new QGridLayout (groupPermission, 6, 6, 15); + gl = new TQGridLayout (groupPermission, 6, 6, 15); gl->addRowSpacing(0, 10); - checkPermissions = new QCheckBox( i18n("Change &Permissions"), w ); + checkPermissions = new TQCheckBox( i18n("Change &Permissions"), w ); - la = new QLabel(i18n("Class"), groupPermission); + la = new TQLabel(i18n("Class"), groupPermission); gl->addWidget(la, 1, 0); - la = new QLabel( i18n("Read"), groupPermission ); + la = new TQLabel( i18n("Read"), groupPermission ); gl->addWidget (la, 1, 1); - la = new QLabel( i18n("Write"), groupPermission ); + la = new TQLabel( i18n("Write"), groupPermission ); gl->addWidget (la, 1, 2); - la = new QLabel( i18n("Exec"), groupPermission ); - QSize size = la->sizeHint(); + la = new TQLabel( i18n("Exec"), groupPermission ); + TQSize size = la->tqsizeHint(); size.setWidth(size.width() + 15); la->setFixedSize(size); gl->addWidget (la, 1, 3); - la = new QLabel( i18n("Special"), groupPermission ); + la = new TQLabel( i18n("Special"), groupPermission ); gl->addMultiCellWidget(la, 1, 1, 4, 5); - cl[0] = new QLabel( i18n("User"), groupPermission ); + cl[0] = new TQLabel( i18n("User"), groupPermission ); gl->addWidget (cl[0], 2, 0); - cl[1] = new QLabel( i18n("Group"), groupPermission ); + cl[1] = new TQLabel( i18n("Group"), groupPermission ); gl->addWidget (cl[1], 3, 0); - cl[2] = new QLabel( i18n("Others"), groupPermission ); + cl[2] = new TQLabel( i18n("Others"), groupPermission ); gl->addWidget (cl[2], 4, 0); - la = new QLabel(i18n("UID"), groupPermission); + la = new TQLabel(i18n("UID"), groupPermission); gl->addWidget(la, 2, 5); - la = new QLabel(i18n("GID"), groupPermission); + la = new TQLabel(i18n("GID"), groupPermission); gl->addWidget(la, 3, 5); - la = new QLabel(i18n("Sticky"), groupPermission); + la = new TQLabel(i18n("Sticky"), groupPermission); gl->addWidget(la, 4, 5); for (int row = 0; row < 3 ; ++row) { for (int col = 0; col < 4; ++col) { - QCheckBox *cb = new QCheckBox(groupPermission); + TQCheckBox *cb = new TQCheckBox(groupPermission); permBox[row][col] = cb; gl->addWidget (permBox[row][col], row+2, col+1); @@ -132,23 +132,23 @@ void MyPermPlugin::drawInterface( QWidget* w, QVBoxLayout* l ) gl->setColStretch(6, 10); - checkOwner = new QCheckBox( i18n("Change &Owner"), w ); + checkOwner = new TQCheckBox( i18n("Change &Owner"), w ); - groupOwner = new QGroupBox ( i18n("Ownership"), w ); + groupOwner = new TQGroupBox ( i18n("Ownership"), w ); groupOwner->setEnabled( FALSE ); groupOwner->setColumnLayout(0, Qt::Vertical ); - groupOwner->layout()->setSpacing( 6 ); - groupOwner->layout()->setMargin( 11 ); - groupOwnerLayout = new QVBoxLayout( groupOwner->layout() ); - groupOwnerLayout->setAlignment( Qt::AlignTop ); + groupOwner->tqlayout()->setSpacing( 6 ); + groupOwner->tqlayout()->setMargin( 11 ); + groupOwnerLayout = new TQVBoxLayout( groupOwner->tqlayout() ); + groupOwnerLayout->tqsetAlignment( TQt::AlignTop ); - Layout2 = new QHBoxLayout( 0, 0, 6 ); - Layout3 = new QHBoxLayout( 0, 0, 6 ); - Layout4 = new QHBoxLayout( 0, 0, 6 ); + Layout2 = new TQHBoxLayout( 0, 0, 6 ); + Layout3 = new TQHBoxLayout( 0, 0, 6 ); + Layout4 = new TQHBoxLayout( 0, 0, 6 ); - la = new QLabel( i18n("User:"), groupOwner ); + la = new TQLabel( i18n("User:"), groupOwner ); Layout2->addWidget( la ); - la = new QLabel( i18n("Group:"), groupOwner ); + la = new TQLabel( i18n("Group:"), groupOwner ); Layout3->addWidget( la ); username = new KComboBox( groupOwner ); @@ -157,28 +157,28 @@ void MyPermPlugin::drawInterface( QWidget* w, QVBoxLayout* l ) setpwent(); for (i=0; ((user = getpwent()) != 0L) && (i < MAXENTRIES); i++) { if( uid == 0 ) - username->insertItem(QString::fromLatin1(user->pw_name)); + username->insertItem(TQString::tqfromLatin1(user->pw_name)); else if( user->pw_uid == uid ) - username->insertItem(QString::fromLatin1(user->pw_name)); + username->insertItem(TQString::tqfromLatin1(user->pw_name)); } endpwent(); groupname = new KComboBox( groupOwner ); user = getpwuid(geteuid()); - QString strUser = user->pw_name; + TQString strUser = user->pw_name; setgrent(); for (i=0; ((ge = getgrent()) != 0L) && (i < MAXENTRIES); i++) { if( uid == 0 ) { - groupname->insertItem(QString::fromLatin1(ge->gr_name)); + groupname->insertItem(TQString::tqfromLatin1(ge->gr_name)); } else { char ** members = ge->gr_mem; char * member; while ((member = *members) != 0L) { if (strUser == member) { - groupname->insertItem(QString::fromLatin1(ge->gr_name)); + groupname->insertItem(TQString::tqfromLatin1(ge->gr_name)); break; } @@ -191,7 +191,7 @@ void MyPermPlugin::drawInterface( QWidget* w, QVBoxLayout* l ) /* add the users group */ ge = getgrgid (getegid()); if (ge) { - QString name = QString::fromLatin1(ge->gr_name); + TQString name = TQString::tqfromLatin1(ge->gr_name); if (name.isEmpty()) name.setNum(ge->gr_gid); @@ -201,8 +201,8 @@ void MyPermPlugin::drawInterface( QWidget* w, QVBoxLayout* l ) // make the users group visible groupname->setCurrentItem( groupname->count() ); - QSpacerItem* spacer8 = new QSpacerItem( 20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding ); - QSpacerItem* spacer9 = new QSpacerItem( 20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding ); + TQSpacerItem* spacer8 = new TQSpacerItem( 20, 20, TQSizePolicy::Minimum, TQSizePolicy::Expanding ); + TQSpacerItem* spacer9 = new TQSpacerItem( 20, 20, TQSizePolicy::Minimum, TQSizePolicy::Expanding ); Layout2->addWidget( username ); Layout2->addItem( spacer8 ); @@ -212,7 +212,7 @@ void MyPermPlugin::drawInterface( QWidget* w, QVBoxLayout* l ) groupOwnerLayout->addLayout( Layout2 ); groupOwnerLayout->addLayout( Layout3 ); - QSpacerItem* spacer10 = new QSpacerItem( 20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding ); + TQSpacerItem* spacer10 = new TQSpacerItem( 20, 20, TQSizePolicy::Minimum, TQSizePolicy::Expanding ); Layout4->addWidget( checkPermissions ); Layout4->addWidget( checkOwner ); @@ -222,8 +222,8 @@ void MyPermPlugin::drawInterface( QWidget* w, QVBoxLayout* l ) l->addWidget( groupOwner ); l->addItem( spacer10 ); - connect( checkOwner, SIGNAL(clicked()), this, SLOT(enableControls()) ); - connect( checkPermissions, SIGNAL(clicked()), this, SLOT(enableControls()) ); + connect( checkOwner, TQT_SIGNAL(clicked()), this, TQT_SLOT(enableControls()) ); + connect( checkPermissions, TQT_SIGNAL(clicked()), this, TQT_SLOT(enableControls()) ); } void MyPermPlugin::fillStructure() @@ -240,18 +240,18 @@ void MyPermPlugin::fillStructure() } -QString MyPermPlugin::processFile( BatchRenamer* b, int i, QString, int ) +TQString MyPermPlugin::processFile( BatchRenamer* b, int i, TQString, int ) { - QString filename = b->files()[i].dst.name; + TQString filename = b->files()[i].dst.name; if( perm.changePermissions ) if( chmod( (const char *)filename, (mode_t)perm.newPermission ) == -1 ) - return QString( i18n("Can't chmod %1.") ).arg(filename); + return TQString( i18n("Can't chmod %1.") ).tqarg(filename); if( perm.changeOwner ) if( chown( (const char*)filename, getUid( perm.owner), getGid( perm.group ))) - return QString( i18n("Can't chown %1.") ).arg(filename); + return TQString( i18n("Can't chown %1.") ).tqarg(filename); - return QString::null; + return TQString(); } void MyPermPlugin::finished() @@ -268,18 +268,18 @@ int MyPermPlugin::getPermissions() {S_IROTH, S_IWOTH, S_IXOTH, S_ISVTX} }; - int permissions = 0, mask = 0; + int permissions = 0, tqmask = 0; for (int row = 0;row < 3; ++row) for (int col = 0; col < 4; ++col) { switch (permBox[row][col]->state()) { - case QCheckBox::On: + case TQCheckBox::On: permissions |= fperm[row][col]; //fall through - case QCheckBox::Off: - mask |= fperm[row][col]; + case TQCheckBox::Off: + tqmask |= fperm[row][col]; break; default: break; @@ -289,7 +289,7 @@ int MyPermPlugin::getPermissions() return permissions; } -int MyPermPlugin::getGid( QString group ) +int MyPermPlugin::getGid( TQString group ) { int i, r; struct group *ge; @@ -302,7 +302,7 @@ int MyPermPlugin::getGid( QString group ) return r; } -int MyPermPlugin::getUid( QString owner ) +int MyPermPlugin::getUid( TQString owner ) { int i, r; struct passwd *user; @@ -321,7 +321,7 @@ void MyPermPlugin::enableControls() groupPermission->setEnabled( checkPermissions->isChecked() ); } -const QPixmap MyPermPlugin::getIcon() const +const TQPixmap MyPermPlugin::getIcon() const { return kapp->iconLoader()->loadIcon( "clanbomber", KIcon::Small ); } diff --git a/krename/permission.h b/krename/permission.h index 5bbf66b..9df09e2 100644 --- a/krename/permission.h +++ b/krename/permission.h @@ -30,40 +30,41 @@ #include <stdio.h> class KComboBox; -class QCheckBox; -class QGroupBox; -class QVBoxLayout; -class QHBoxLayout; -class QString; -class QWidget; +class TQCheckBox; +class TQGroupBox; +class TQVBoxLayout; +class TQHBoxLayout; +class TQString; +class TQWidget; // Plugin class starts here class MyPermPlugin: public Plugin { Q_OBJECT + TQ_OBJECT public: - const QString getName() const; - const QString getAccelName() const; + const TQString getName() const; + const TQString getAccelName() const; const int type() const; bool checkError(); - void drawInterface( QWidget* w, QVBoxLayout* l ); + void drawInterface( TQWidget* w, TQVBoxLayout* l ); void fillStructure(); - QString processFile( BatchRenamer* b, int, QString token, int ); + TQString processFile( BatchRenamer* b, int, TQString token, int ); void finished(); - const QPixmap getIcon() const; + const TQPixmap getIcon() const; private: int getPermissions(); - int getGid( QString group ); - int getUid( QString owner ); + int getGid( TQString group ); + int getUid( TQString owner ); struct pervals { bool changePermissions; bool changeOwner; - QString owner; // name of owner - QString group; // name of group + TQString owner; // name of owner + TQString group; // name of group int newPermission; // Permissions }perm; @@ -72,19 +73,19 @@ class MyPermPlugin: public Plugin { void enableControls(); protected: - QGroupBox* groupPermission; - QGroupBox* groupOwner; - QCheckBox* checkPermissions; - QCheckBox* checkOwner; - QCheckBox* permBox[3][4]; + TQGroupBox* groupPermission; + TQGroupBox* groupOwner; + TQCheckBox* checkPermissions; + TQCheckBox* checkOwner; + TQCheckBox* permBox[3][4]; KComboBox* username; KComboBox* groupname; - QVBoxLayout* groupOwnerLayout; - QVBoxLayout* Layout0; - QHBoxLayout* Layout2; - QHBoxLayout* Layout3; - QHBoxLayout* Layout4; + TQVBoxLayout* groupOwnerLayout; + TQVBoxLayout* Layout0; + TQHBoxLayout* Layout2; + TQHBoxLayout* Layout3; + TQHBoxLayout* Layout4; }; #endif diff --git a/krename/pictureplugin.cpp b/krename/pictureplugin.cpp index d0a0bc3..a6387ae 100644 --- a/krename/pictureplugin.cpp +++ b/krename/pictureplugin.cpp @@ -18,7 +18,7 @@ #include "pictureplugin.h" // QT includes -#include <qimage.h> +#include <tqimage.h> // KDE includes #include <kapplication.h> @@ -36,51 +36,51 @@ PicturePlugin::PicturePlugin() m_icon = "image"; } -const QString PicturePlugin::getName() const +const TQString PicturePlugin::getName() const { return i18n("Picture Plugin"); } -const QString PicturePlugin::getAccelName() const +const TQString PicturePlugin::getAccelName() const { return i18n("P&icture Plugin"); } -const QString PicturePlugin::getPattern() const +const TQString PicturePlugin::getPattern() const { return "pic"; } -QString PicturePlugin::processFile( BatchRenamer* b, int i, QString token, int ) +TQString PicturePlugin::processFile( BatchRenamer* b, int i, TQString token, int ) { - QString resolution; - QString xres; - QString yres; - QString bitdepth; + TQString resolution; + TQString xres; + TQString yres; + TQString bitdepth; - QString filename = BatchRenamer::buildFilename( &b->files()[i].src ); + TQString filename = BatchRenamer::buildFilename( &b->files()[i].src ); token = token.lower(); /* * Check if we have something cached for this file */ - if( cache.contains( filename + "::" + token ) ) + if( cache.tqcontains( filename + "::" + token ) ) return cache[filename + "::" + token ]; - QImage img( filename ); + TQImage img( filename ); if( img.isNull() ) - return QString::null; + return TQString(); - resolution = QString( "%1x%2" ).arg(img.width()).arg(img.height()); - xres = QString::number( img.width() ); - yres = QString::number( img.height() ); - bitdepth = QString::number( img.depth() ); + resolution = TQString( "%1x%2" ).tqarg(img.width()).tqarg(img.height()); + xres = TQString::number( img.width() ); + yres = TQString::number( img.height() ); + bitdepth = TQString::number( img.depth() ); if( cache.count() >= CACHE_MAX ) cache.remove( cache.begin() ); - QString ret = QString::null; + TQString ret = TQString(); if( token == getPattern() + "resolution" ) ret = resolution; diff --git a/krename/pictureplugin.h b/krename/pictureplugin.h index 1fcc28f..ce73454 100644 --- a/krename/pictureplugin.h +++ b/krename/pictureplugin.h @@ -22,19 +22,20 @@ #include "pluginloader.h" #include "fileplugin.h" -class QVBoxLayout; -class QHBoxLayout; -class QString; -class QWidget; +class TQVBoxLayout; +class TQHBoxLayout; +class TQString; +class TQWidget; class PicturePlugin : public FilePlugin { Q_OBJECT + TQ_OBJECT public: PicturePlugin(); - const QString getName() const; - const QString getAccelName() const; - const QString getPattern() const; - QString processFile( BatchRenamer* b, int i, QString token, int ); + const TQString getName() const; + const TQString getAccelName() const; + const TQString getPattern() const; + TQString processFile( BatchRenamer* b, int i, TQString token, int ); }; #endif diff --git a/krename/plugin.cpp b/krename/plugin.cpp index 92460d9..10bca7d 100644 --- a/krename/plugin.cpp +++ b/krename/plugin.cpp @@ -18,7 +18,7 @@ #include "plugin.h" #include "helpdialog.h" -#include <qpixmap.h> +#include <tqpixmap.h> Plugin::Plugin() { @@ -41,19 +41,19 @@ bool Plugin::alwaysUsed() const return false; } -const QStringList Plugin::getKeys() const +const TQStringList Plugin::getKeys() const { - return QStringList(); + return TQStringList(); } -const QString Plugin::getPattern() const +const TQString Plugin::getPattern() const { - return QString::null; + return TQString(); }; -const QPixmap Plugin::getIcon() const +const TQPixmap Plugin::getIcon() const { - return QPixmap(); + return TQPixmap(); } void Plugin::clearCache() diff --git a/krename/plugin.h b/krename/plugin.h index 0b987d3..dc96c8c 100644 --- a/krename/plugin.h +++ b/krename/plugin.h @@ -20,30 +20,31 @@ #include "batchrenamer.h" -#include <qobject.h> +#include <tqobject.h> class HelpDialogData; -class QString; -class QStringList; -class QWidget; -class QVBoxLayout; -class Plugin : public QObject { +class TQString; +class TQStringList; +class TQWidget; +class TQVBoxLayout; +class Plugin : public TQObject { Q_OBJECT + TQ_OBJECT public: Plugin(); virtual ~Plugin(); - virtual const QString getName() const = 0; - virtual const QString getAccelName() const = 0; - virtual const QString getPattern() const; + virtual const TQString getName() const = 0; + virtual const TQString getAccelName() const = 0; + virtual const TQString getPattern() const; virtual const int type() const = 0; virtual bool alwaysUsed() const; virtual bool checkError() = 0; - virtual void drawInterface( QWidget* w, QVBoxLayout* l ) = 0; + virtual void drawInterface( TQWidget* w, TQVBoxLayout* l ) = 0; virtual void fillStructure() { } - virtual QString processFile( BatchRenamer* b, int i, QString token, int mode ) = 0; + virtual TQString processFile( BatchRenamer* b, int i, TQString token, int mode ) = 0; virtual void finished() { } virtual void addHelp( HelpDialogData* data ); @@ -51,8 +52,8 @@ class Plugin : public QObject { virtual void clearCache(); - virtual const QPixmap getIcon() const; - virtual const QStringList getKeys() const; + virtual const TQPixmap getIcon() const; + virtual const TQStringList getKeys() const; signals: void previewChanged( Plugin* plugin ); @@ -66,7 +67,7 @@ class Plugin : public QObject { } protected: - QWidget* m_widget; + TQWidget* m_widget; }; #endif diff --git a/krename/pluginloader.cpp b/krename/pluginloader.cpp index 4e5c300..6bfb0d9 100644 --- a/krename/pluginloader.cpp +++ b/krename/pluginloader.cpp @@ -34,8 +34,8 @@ #include "translitplugin.h" // QT includes -#include <qregexp.h> -#include <qstringlist.h> +#include <tqregexp.h> +#include <tqstringlist.h> // KDE includes #include <kapplication.h> @@ -101,10 +101,10 @@ void PluginLoader::loadPlugins( bool fileplugins ) loadFilePlugins(); m_bracket_map.clear(); - QPtrListIterator<PluginLoader::PluginLibrary> it( libs ); + TQPtrListIterator<PluginLoader::PluginLibrary> it( libs ); for( ; it.current(); ++it ) { if( (*it)->plugin->type() == TYPE_BRACKET ) { - const QStringList list = (*it)->plugin->getKeys(); + const TQStringList list = (*it)->plugin->getKeys(); for( unsigned int i = 0; i < list.count(); i++ ) m_bracket_map.insert( list[i].lower(), (*it)->plugin ); } @@ -114,25 +114,25 @@ void PluginLoader::loadPlugins( bool fileplugins ) void PluginLoader::clearCache() { - QPtrListIterator<PluginLoader::PluginLibrary> it( libs ); + TQPtrListIterator<PluginLoader::PluginLibrary> it( libs ); for( ; it.current(); ++it ) (*it)->plugin->clearCache(); } -Plugin* PluginLoader::findPlugin( const QString & token ) +Plugin* PluginLoader::findPlugin( const TQString & token ) { // Optimize a little bit for speed and convert only once to lower() - QString lower = token.lower(); + TQString lower = token.lower(); - if( m_bracket_cache.contains( lower ) ) + if( m_bracket_cache.tqcontains( lower ) ) return m_bracket_cache[lower]; /* The new version is slower than the old one :-( */ - QMap<QString,Plugin*>::Iterator it; + TQMap<TQString,Plugin*>::Iterator it; for ( it = m_bracket_map.begin(); it != m_bracket_map.end(); ++it ) { - if( QRegExp( it.key() ).exactMatch( lower ) ) + if( TQRegExp( it.key() ).exactMatch( lower ) ) { m_bracket_cache.insert( lower, it.data(), true ); if( m_bracket_cache.count() > BRACKET_CACHE_COUNT ) diff --git a/krename/pluginloader.h b/krename/pluginloader.h index 234a35c..72302f7 100644 --- a/krename/pluginloader.h +++ b/krename/pluginloader.h @@ -22,13 +22,13 @@ #include "batchrenamer.h" #include "plugin.h" -#include <qmap.h> -#include <qptrlist.h> +#include <tqmap.h> +#include <tqptrlist.h> -class QCheckBox; -class QVBoxLayout; -class QString; -class QWidget; +class TQCheckBox; +class TQVBoxLayout; +class TQString; +class TQWidget; #define NUM_INTERNAL_PLUGINS 8 @@ -51,15 +51,15 @@ class PluginLoader { * from within KRenameImpl * when the GUI is already constructed! */ - QCheckBox* check; + TQCheckBox* check; }; static PluginLoader* instance(); void loadPlugins( bool fileplugins ); - QPtrList<PluginLoader::PluginLibrary> libs; + TQPtrList<PluginLoader::PluginLibrary> libs; - Plugin* findPlugin( const QString & token ); + Plugin* findPlugin( const TQString & token ); inline bool filePluginsLoaded() const; @@ -77,8 +77,8 @@ class PluginLoader { Plugin* m_internal_plugins[NUM_INTERNAL_PLUGINS]; static PluginLoader* m_plugin; - QMap<QString,Plugin*> m_bracket_map; - QMap<QString,Plugin*> m_bracket_cache; + TQMap<TQString,Plugin*> m_bracket_map; + TQMap<TQString,Plugin*> m_bracket_cache; bool m_loaded; bool m_file; diff --git a/krename/profiledlg.cpp b/krename/profiledlg.cpp index 621d51f..573f460 100644 --- a/krename/profiledlg.cpp +++ b/krename/profiledlg.cpp @@ -33,13 +33,13 @@ #include <kstandarddirs.h> #include <kurlrequester.h> -#include <qcheckbox.h> -#include <qdom.h> -#include <qfile.h> -#include <qlayout.h> -#include <qpainter.h> -#include <qradiobutton.h> -#include <qtooltip.h> +#include <tqcheckbox.h> +#include <tqdom.h> +#include <tqfile.h> +#include <tqlayout.h> +#include <tqpainter.h> +#include <tqradiobutton.h> +#include <tqtooltip.h> #ifdef HAVE_CONFIG_H #include <config.h> @@ -55,11 +55,11 @@ #define PROFILE_WIZARD_NAME i18n("KRename: Wizard default profile") #define PROFILE_TABBED_NAME i18n("KRename: Tabbed default profile") -class ProfileListBoxText : public QListBoxText { +class ProfileListBoxText : public TQListBoxText { public: - ProfileListBoxText( const QString & text = QString::null ) - : QListBoxText( text ) + ProfileListBoxText( const TQString & text = TQString() ) + : TQListBoxText( text ) { m_default = false; } @@ -73,13 +73,13 @@ public: } protected: - void paint( QPainter* painter ) + void paint( TQPainter* painter ) { - QFont f = painter->font(); + TQFont f = painter->font(); f.setBold( m_default ); painter->setFont( f ); - QListBoxText::paint( painter ); + TQListBoxText::paint( painter ); } private: @@ -93,33 +93,33 @@ ProfileManager::ProfileManager( KRenameImpl* krename ) } -const QString ProfileManager::readProfilePath( const QString & name ) +const TQString ProfileManager::readProfilePath( const TQString & name ) { - QString path; + TQString path; KConfig* conf = kapp->config(); conf->setGroup( "Profiles" ); - path = conf->readEntry( name, QString::null ); + path = conf->readEntry( name, TQString() ); return path; } -const QString ProfileManager::getProfilePath( const QString & name ) +const TQString ProfileManager::getProfilePath( const TQString & name ) { - QStringList list; + TQStringList list; if( name == PROFILE_WIZARD_NAME ) return locate( "data", "krename/krename_system_default_wizard.xml" ); else if( name == PROFILE_TABBED_NAME ) return locate( "data", "krename/krename_system_default_tabbed.xml" ); - QString path = locateLocal( "data", QString( "krename/%1.xml" ).arg( name ) ); + TQString path = locateLocal( "data", TQString( "krename/%1.xml" ).tqarg( name ) ); KConfig* conf = kapp->config(); conf->setGroup( "ProfilesHeader" ); list = conf->readListEntry( "list" ); - if( !list.contains( name ) ) + if( !list.tqcontains( name ) ) list.append( name ); conf->writeEntry( "list", list ); @@ -130,10 +130,10 @@ const QString ProfileManager::getProfilePath( const QString & name ) return path; } -void ProfileManager::writeXML( const QString & name ) +void ProfileManager::writeXML( const TQString & name ) { - QString path = getProfilePath( name ); - QFile file( path ); + TQString path = getProfilePath( name ); + TQFile file( path ); if( !file.open( IO_WriteOnly ) ) { @@ -141,73 +141,73 @@ void ProfileManager::writeXML( const QString & name ) return; } - QDomDocument doc( "KRenameProfile" ); - QDomElement root = doc.createElement( "krename" ); + TQDomDocument doc( "KRenameProfile" ); + TQDomElement root = doc.createElement( "krename" ); doc.appendChild( root ); - QDomElement v = doc.createElement( "version" ); + TQDomElement v = doc.createElement( "version" ); v.setAttribute( "version", VERSION ); root.appendChild( v ); // General settings of Krename - QDomElement settings = doc.createElement( "settings" ); + TQDomElement settings = doc.createElement( "settings" ); settings.setAttribute( "wizard", m_krename->m_wizard ); settings.setAttribute( "fileplugins", m_krename->plugin->filePluginsLoaded() ); root.appendChild( settings ); // Filename settings - QDomElement filename = doc.createElement( "filename" ); + TQDomElement filename = doc.createElement( "filename" ); filename.setAttribute( "filename", m_krename->filename->text() ); filename.setAttribute( "extension", m_krename->extemplate->text() ); filename.setAttribute( "extension_enabled", m_krename->checkExtension->isChecked() ); filename.setAttribute( "extension_start", m_krename->comboExtension->currentItem() ); - QDomElement numbering = doc.createElement( "numbering" ); + TQDomElement numbering = doc.createElement( "numbering" ); numbering.setAttribute( "start", m_krename->m_index ); numbering.setAttribute( "step", m_krename->m_step ); numbering.setAttribute( "skip", listToString( m_krename->skip ) ); numbering.setAttribute( "reset", m_krename->m_reset ); - QDomElement replace = doc.createElement( "replace" ); + TQDomElement tqreplace = doc.createElement( "tqreplace" ); for( unsigned int i=0;i<m_krename->rep.count();i++) { - QDomElement r = doc.createElement( "item" ); - r.setAttribute( "find", m_krename->rep[i].find ); - r.setAttribute( "replace", m_krename->rep[i].replace ); + TQDomElement r = doc.createElement( "item" ); + r.setAttribute( "tqfind", m_krename->rep[i].tqfind ); + r.setAttribute( "tqreplace", m_krename->rep[i].tqreplace ); r.setAttribute( "reg", m_krename->rep[i].reg ); - replace.appendChild( r ); + tqreplace.appendChild( r ); } // destination settings - QDomElement dest = doc.createElement( "destination" ); + TQDomElement dest = doc.createElement( "destination" ); dest.setAttribute( "mode", m_krename->currentRenameMode() ); - dest.setAttribute( "overwrite", QString::number( m_krename->checkOverwrite->isChecked() ) ); + dest.setAttribute( "overwrite", TQString::number( m_krename->checkOverwrite->isChecked() ) ); dest.setAttribute( "directory", m_krename->dirname->text() ); - dest.setAttribute( "undo", QString::number( m_krename->checkUndoScript->isChecked() ) ); + dest.setAttribute( "undo", TQString::number( m_krename->checkUndoScript->isChecked() ) ); dest.setAttribute( "undoscript", m_krename->undorequester->url() ); // file adding settings - QDomElement files = doc.createElement( "files" ); - files.setAttribute( "sorting", QString::number( m_krename->comboSort->currentItem() ) ); - files.setAttribute( "preview", QString::number( m_krename->checkPreview->isChecked() ) ); - files.setAttribute( "names", QString::number( m_krename->checkName->isChecked() ) ); + TQDomElement files = doc.createElement( "files" ); + files.setAttribute( "sorting", TQString::number( m_krename->comboSort->currentItem() ) ); + files.setAttribute( "preview", TQString::number( m_krename->checkPreview->isChecked() ) ); + files.setAttribute( "names", TQString::number( m_krename->checkName->isChecked() ) ); - filename.appendChild( replace ); + filename.appendChild( tqreplace ); filename.appendChild( numbering ); root.appendChild( settings ); root.appendChild( filename ); root.appendChild( dest ); root.appendChild( files ); - QCString xml = doc.toCString(); + TQCString xml = doc.toCString(); file.writeBlock( xml, xml.length() ); file.close(); } -bool ProfileManager::loadXML( const QString & path ) +bool ProfileManager::loadXML( const TQString & path ) { - QFile file( path ); + TQFile file( path ); if( !file.open( IO_ReadOnly ) ) { @@ -215,24 +215,24 @@ bool ProfileManager::loadXML( const QString & path ) return false; } - QDomDocument doc( "KRenameProfile" ); + TQDomDocument doc( "KRenameProfile" ); if ( !doc.setContent( &file ) ) { file.close(); return false; } - QDomNode n = doc.documentElement().firstChild(); + TQDomNode n = doc.documentElement().firstChild(); while( !n.isNull() ) { - QDomElement e = n.toElement(); // try to convert the node to an element. + TQDomElement e = n.toElement(); // try to convert the node to an element. if( !e.isNull() ) { if( e.tagName() == "settings" ) { bool wiz, plug; wiz = (bool)e.attribute( "wizard", - QString( "%1" ).arg( m_krename->m_wizard ) ).toInt(); + TQString( "%1" ).tqarg( m_krename->m_wizard ) ).toInt(); m_krename->setWizardMode( wiz ); // if( wiz != m_krename->m_wizard ) @@ -242,7 +242,7 @@ bool ProfileManager::loadXML( const QString & path ) } plug = (bool)e.attribute( "fileplugins", - QString( "%1" ).arg( m_krename->plugin->filePluginsLoaded() ) ).toInt(); + TQString( "%1" ).tqarg( m_krename->plugin->filePluginsLoaded() ) ).toInt(); if( plug && !m_krename->plugin->filePluginsLoaded() ) m_krename->plugin->loadPlugins( true ); } @@ -252,36 +252,36 @@ bool ProfileManager::loadXML( const QString & path ) m_krename->extemplate->setText( e.attribute("extension", m_krename->extemplate->text() ) ); m_krename->checkExtension->setChecked( (bool)e.attribute("extension_enabled", - QString("%1").arg(m_krename->checkExtension->isChecked() ) ).toInt() ); + TQString("%1").tqarg(m_krename->checkExtension->isChecked() ) ).toInt() ); m_krename->comboExtension->setCurrentItem( e.attribute("extension_start", - QString::number( m_krename->comboExtension->currentItem() ) ).toInt() ); + TQString::number( m_krename->comboExtension->currentItem() ) ).toInt() ); - QDomNode n = e.firstChild(); + TQDomNode n = e.firstChild(); while( !n.isNull() ) { - QDomElement e = n.toElement(); // try to convert the node to an element. + TQDomElement e = n.toElement(); // try to convert the node to an element. if( !e.isNull() ) { if( e.tagName() == "numbering" ) { - m_krename->m_index = e.attribute( "start", QString::number( m_krename->m_index ) ).toInt(); - m_krename->m_step = e.attribute( "step", QString::number( m_krename->m_step ) ).toInt(); + m_krename->m_index = e.attribute( "start", TQString::number( m_krename->m_index ) ).toInt(); + m_krename->m_step = e.attribute( "step", TQString::number( m_krename->m_step ) ).toInt(); m_krename->skip = stringToList( e.attribute("skip", listToString( m_krename->skip ) ) ); - m_krename->m_reset = (bool)e.attribute( "reset", QString::number( (int)m_krename->m_reset ) ).toInt(); + m_krename->m_reset = (bool)e.attribute( "reset", TQString::number( (int)m_krename->m_reset ) ).toInt(); } - else if( e.tagName() == "replace" ) + else if( e.tagName() == "tqreplace" ) { m_krename->rep.clear(); - QDomNode n = e.firstChild(); + TQDomNode n = e.firstChild(); while( !n.isNull() ) { - QDomElement e = n.toElement(); // try to convert the node to an element. + TQDomElement e = n.toElement(); // try to convert the node to an element. if( !e.isNull() && e.tagName() == "item" ) { replacestrings r; - r.find = e.attribute( "find", QString::null ); - r.replace = e.attribute( "replace", QString::null ); + r.tqfind = e.attribute( "tqfind", TQString() ); + r.tqreplace = e.attribute( "tqreplace", TQString() ); r.reg = (bool)e.attribute( "reg", "0" ).toInt(); m_krename->rep.append( r ); } @@ -294,7 +294,7 @@ bool ProfileManager::loadXML( const QString & path ) } else if( e.tagName() == "destination" ) { - int mode = e.attribute( "mode", QString::number( m_krename->currentRenameMode() ) ).toInt(); + int mode = e.attribute( "mode", TQString::number( m_krename->currentRenameMode() ) ).toInt(); m_krename->optionRename->setChecked( false ); m_krename->optionCopy->setChecked( false ); m_krename->optionMove->setChecked( false ); @@ -314,20 +314,20 @@ bool ProfileManager::loadXML( const QString & path ) } m_krename->checkOverwrite->setChecked( e.attribute( "overwrite", - QString::number( m_krename->checkOverwrite->isChecked() ) ).toInt() ); + TQString::number( m_krename->checkOverwrite->isChecked() ) ).toInt() ); m_krename->dirname->setText( e.attribute( "directory", m_krename->dirname->text() ) ); m_krename->checkUndoScript->setChecked( e.attribute( "undo", - QString::number( m_krename->checkUndoScript->isChecked() ) ).toInt() ); + TQString::number( m_krename->checkUndoScript->isChecked() ) ).toInt() ); m_krename->undorequester->setURL( e.attribute( "undoscript", m_krename->undorequester->url() ) ); } else if( e.tagName() == "files" ) { m_krename->comboSort->setCurrentItem( e.attribute( "sorting", - QString::number( m_krename->comboSort->currentItem() ) ).toInt() ); + TQString::number( m_krename->comboSort->currentItem() ) ).toInt() ); m_krename->checkPreview->setChecked( e.attribute( "preview", - QString::number( m_krename->checkPreview->isChecked() ) ).toInt() ); + TQString::number( m_krename->checkPreview->isChecked() ) ).toInt() ); m_krename->checkName->setChecked( e.attribute( "names", - QString::number( m_krename->checkName->isChecked() ) ).toInt() ); + TQString::number( m_krename->checkName->isChecked() ) ).toInt() ); } } n = n.nextSibling(); @@ -340,19 +340,19 @@ bool ProfileManager::loadXML( const QString & path ) return true; } -const QString ProfileManager::listToString( QValueList<int> & list ) +const TQString ProfileManager::listToString( TQValueList<int> & list ) { - QString data; + TQString data; for( unsigned int i = 0; i < list.count(); i++ ) - data += QString( "%1;" ).arg( list[i] ); + data += TQString( "%1;" ).tqarg( list[i] ); return data; } -const QValueList<int> ProfileManager::stringToList( const QString & data ) +const TQValueList<int> ProfileManager::stringToList( const TQString & data ) { - QValueList<int> list; - int c = data.contains( ";" ); + TQValueList<int> list; + int c = data.tqcontains( ";" ); if( c > 0 ) { for( int i = 0;i<c;i++) @@ -367,7 +367,7 @@ bool ProfileManager::hasDefaultProfile() KConfig* conf = kapp->config(); conf->setGroup( "ProfilesHeader" ); - QString def = conf->readEntry( "defprofile", QString::null ); + TQString def = conf->readEntry( "defprofile", TQString() ); return (!def.isEmpty()); } @@ -377,13 +377,13 @@ void ProfileManager::loadDefaultProfile( KRenameImpl* krename ) KConfig* conf = kapp->config(); conf->setGroup( "ProfilesHeader" ); - QString def = conf->readEntry( "defprofile", QString::null ); + TQString def = conf->readEntry( "defprofile", TQString() ); if( !def.isEmpty() ) ProfileManager::loadProfile( def, krename ); } -void ProfileManager::loadProfile( const QString & name, KRenameImpl* krename ) +void ProfileManager::loadProfile( const TQString & name, KRenameImpl* krename ) { ProfileManager manager( krename ); manager.loadXML( manager.getProfilePath( name ) ); @@ -391,14 +391,14 @@ void ProfileManager::loadProfile( const QString & name, KRenameImpl* krename ) /////////////////////////////////////////////////////////////////////////////// -ProfileDlg::ProfileDlg(KRenameImpl* krename, QWidget *parent, const char *name) +ProfileDlg::ProfileDlg(KRenameImpl* krename, TQWidget *tqparent, const char *name) : KDialogBase( KDialogBase::Plain, i18n("Profiles"), - KDialogBase::Close, KDialogBase::Close, parent, name, true, true ), ProfileManager( krename ) + KDialogBase::Close, KDialogBase::Close, tqparent, name, true, true ), ProfileManager( krename ) { int i; - QHBoxLayout* layout = new QHBoxLayout( plainPage(), 6, 6 ); - QVBoxLayout* button = new QVBoxLayout( 0, 6, 6 ); + TQHBoxLayout* tqlayout = new TQHBoxLayout( plainPage(), 6, 6 ); + TQVBoxLayout* button = new TQVBoxLayout( 0, 6, 6 ); profiles = new KListBox( plainPage() ); profiles->insertItem( new ProfileListBoxText( PROFILE_WIZARD_NAME ), PROFILE_WIZARD_INDEX ); @@ -407,42 +407,42 @@ ProfileDlg::ProfileDlg(KRenameImpl* krename, QWidget *parent, const char *name) createProfile = new KPushButton( i18n("&Save As Profile..."), plainPage() ); loadProfile = new KPushButton( i18n("&Load Profile"), plainPage() ); deleteProfile = new KPushButton( i18n("&Delete Profile"), plainPage() ); - checkDefault = new QCheckBox( i18n("&Use as default profile on startup"), plainPage() ); + checkDefault = new TQCheckBox( i18n("&Use as default profile on startup"), plainPage() ); createProfile->setIconSet( SmallIconSet( "filesaveas") ); loadProfile->setIconSet( SmallIconSet( "fileopen" ) ); deleteProfile->setIconSet( SmallIconSet( "edittrash" ) ); - QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Expanding ); + TQSpacerItem* spacer = new TQSpacerItem( 20, 20, TQSizePolicy::Expanding, TQSizePolicy::Expanding ); button->addWidget( createProfile ); button->addWidget( loadProfile ); button->addWidget( deleteProfile ); button->addItem( spacer ); button->addWidget( checkDefault ); - layout->addWidget( profiles ); - layout->addLayout( button ); - layout->setStretchFactor( profiles, 2 ); + tqlayout->addWidget( profiles ); + tqlayout->addLayout( button ); + tqlayout->setStretchFactor( profiles, 2 ); - QToolTip::add( createProfile, i18n("<qt>Save KRename's current settings as a new profile. " + TQToolTip::add( createProfile, i18n("<qt>Save KRename's current settings as a new profile. " "The settings are saved and can be restored with Load Profile later.</qt>" ) ); - QToolTip::add( loadProfile, i18n("<qt>Load all settings stored in this profile.</qt>") ); + TQToolTip::add( loadProfile, i18n("<qt>Load all settings stored in this profile.</qt>") ); enableControls(); - connect( createProfile, SIGNAL( clicked() ), this, SLOT( slotCreateProfile() ) ); - connect( loadProfile, SIGNAL( clicked() ), this, SLOT( slotLoadProfile() ) ); - connect( deleteProfile, SIGNAL( clicked() ), this, SLOT( slotDeleteProfile() ) ); - connect( profiles, SIGNAL( selectionChanged () ), this, SLOT( enableControls() ) ); - connect( checkDefault, SIGNAL( clicked() ), this, SLOT( slotSetDefault() ) ); - connect( this, SIGNAL( hidden() ), this, SLOT( slotHidden() ) ); + connect( createProfile, TQT_SIGNAL( clicked() ), this, TQT_SLOT( slotCreateProfile() ) ); + connect( loadProfile, TQT_SIGNAL( clicked() ), this, TQT_SLOT( slotLoadProfile() ) ); + connect( deleteProfile, TQT_SIGNAL( clicked() ), this, TQT_SLOT( slotDeleteProfile() ) ); + connect( profiles, TQT_SIGNAL( selectionChanged () ), this, TQT_SLOT( enableControls() ) ); + connect( checkDefault, TQT_SIGNAL( clicked() ), this, TQT_SLOT( slotSetDefault() ) ); + connect( this, TQT_SIGNAL( hidden() ), this, TQT_SLOT( slotHidden() ) ); KConfig* conf = kapp->config(); conf->setGroup( "ProfilesHeader" ); ProfileListBoxText* item; - QStringList list = conf->readListEntry( "list" ); - QString def = conf->readEntry( "defprofile", QString::null ); + TQStringList list = conf->readListEntry( "list" ); + TQString def = conf->readEntry( "defprofile", TQString() ); for( i=0;i<(int)list.count();i++ ) profiles->insertItem( new ProfileListBoxText( list[i] ) ); @@ -456,7 +456,7 @@ ProfileDlg::ProfileDlg(KRenameImpl* krename, QWidget *parent, const char *name) } } - profiles->repaintContents(); + profiles->tqrepaintContents(); } @@ -494,19 +494,19 @@ void ProfileDlg::slotSetDefault() if( item ) item->setDefault( checkDefault->isChecked() ); - profiles->repaintContents(); + profiles->tqrepaintContents(); } void ProfileDlg::slotLoadProfile() { - QString profile = profiles->currentText(); - QString msg = QString( i18n("Do you really want to load the profile and overwrite the current settings: %1") ).arg( profile ); + TQString profile = profiles->currentText(); + TQString msg = TQString( i18n("Do you really want to load the profile and overwrite the current settings: %1") ).tqarg( profile ); - QString path = getProfilePath( profile ); + TQString path = getProfilePath( profile ); if( path.isEmpty() ) { - KMessageBox::error( this, i18n("The profile \"%1\" could not be found.").arg( profile ) ); + KMessageBox::error( this, i18n("The profile \"%1\" could not be found.").tqarg( profile ) ); return; } @@ -525,14 +525,14 @@ void ProfileDlg::slotLoadProfile() void ProfileDlg::slotCreateProfile() { bool ok = false; - const char* mask = "xXXXXXXXXXXXXXXXXXXX"; // allows for 20 characters - QString name = KInputDialog::getText( i18n("Profile Name"), i18n("Please enter a name for the new profile:"), - "KRename", &ok, this, 0, 0, mask ); + const char* tqmask = "xXXXXXXXXXXXXXXXXXXX"; // allows for 20 characters + TQString name = KInputDialog::getText( i18n("Profile Name"), i18n("Please enter a name for the new profile:"), + "KRename", &ok, this, 0, 0, tqmask ); if( !ok ) return; - if( profiles->findItem( name, Qt::ExactMatch ) ) + if( profiles->tqfindItem( name, TQt::ExactMatch ) ) { KMessageBox::error( this, i18n("This profile does already exist. Please choose another name.") ); slotCreateProfile(); @@ -553,22 +553,22 @@ void ProfileDlg::slotDeleteProfile() return; } - QString profile = profiles->currentText(); - QString msg = QString( i18n("Do you really want to delete the profile: %1") ).arg( profile ); + TQString profile = profiles->currentText(); + TQString msg = TQString( i18n("Do you really want to delete the profile: %1") ).tqarg( profile ); if( KMessageBox::questionYesNo( this, msg ) == KMessageBox::Yes ) { - QString path = readProfilePath( profile ); - QFile::remove( path ); + TQString path = readProfilePath( profile ); + TQFile::remove( path ); - QListBoxItem* item = profiles->findItem( profile, Qt::ExactMatch ); + TQListBoxItem* item = profiles->tqfindItem( profile, TQt::ExactMatch ); if( item ) delete item; KConfig* conf = kapp->config(); conf->setGroup( "ProfilesHeader" ); - QStringList list = conf->readListEntry( "list" ); + TQStringList list = conf->readListEntry( "list" ); list.remove( profile ); conf->writeEntry( "list", list ); conf->sync(); @@ -581,7 +581,7 @@ void ProfileDlg::slotHidden() { int i; KConfig* conf = kapp->config(); - QString def = QString::null; + TQString def = TQString(); ProfileListBoxText* item; for( i=0;i<(int)profiles->count();i++ ) diff --git a/krename/profiledlg.h b/krename/profiledlg.h index a9a29c3..84280ed 100644 --- a/krename/profiledlg.h +++ b/krename/profiledlg.h @@ -23,25 +23,25 @@ class KListBox; class KPushButton; class KRenameImpl; -class QCheckBox; +class TQCheckBox; class ProfileManager { public: ProfileManager( KRenameImpl* krename ); static void loadDefaultProfile( KRenameImpl* krename ); - static void loadProfile( const QString & name, KRenameImpl* krename ); + static void loadProfile( const TQString & name, KRenameImpl* krename ); static bool hasDefaultProfile(); protected: - const QString getProfilePath( const QString & name ); - const QString readProfilePath( const QString & name ); + const TQString getProfilePath( const TQString & name ); + const TQString readProfilePath( const TQString & name ); - const QString listToString( QValueList<int> & list ); - const QValueList<int> stringToList( const QString & ); + const TQString listToString( TQValueList<int> & list ); + const TQValueList<int> stringToList( const TQString & ); - void writeXML( const QString & name ); - bool loadXML( const QString & path ); + void writeXML( const TQString & name ); + bool loadXML( const TQString & path ); protected: KRenameImpl* m_krename; @@ -54,9 +54,10 @@ class ProfileManager { class ProfileDlg : public KDialogBase, public ProfileManager { Q_OBJECT + TQ_OBJECT public: - ProfileDlg(KRenameImpl* krename, QWidget *parent = 0, const char *name = 0); + ProfileDlg(KRenameImpl* krename, TQWidget *tqparent = 0, const char *name = 0); ~ProfileDlg(); private slots: @@ -70,7 +71,7 @@ class ProfileDlg : public KDialogBase, public ProfileManager private: KListBox* profiles; - QCheckBox* checkDefault; + TQCheckBox* checkDefault; KPushButton* createProfile; KPushButton* loadProfile; KPushButton* deleteProfile; diff --git a/krename/replacedialog.cpp b/krename/replacedialog.cpp index 342d4d1..fb875f4 100644 --- a/krename/replacedialog.cpp +++ b/krename/replacedialog.cpp @@ -19,11 +19,11 @@ #include "replacedialog.h" // QT includes -#include <qcheckbox.h> -#include <qlabel.h> -#include <qlineedit.h> -#include <qlayout.h> -#include <qregexp.h> +#include <tqcheckbox.h> +#include <tqlabel.h> +#include <tqlineedit.h> +#include <tqlayout.h> +#include <tqregexp.h> // KDE includes #include <kapplication.h> @@ -35,34 +35,34 @@ #include <kpushbutton.h> #include <kregexpeditorinterface.h> -ReplaceDialog::ReplaceDialog( QValueList<replacestrings> & r, QWidget* parent ) +ReplaceDialog::ReplaceDialog( TQValueList<replacestrings> & r, TQWidget* tqparent ) : KDialogBase( KDialogBase::Plain, i18n( "Find and Replace" ), - KDialogBase::Ok | KDialogBase::Cancel, KDialogBase::Ok, parent, 0, true, true ) + KDialogBase::Ok | KDialogBase::Cancel, KDialogBase::Ok, tqparent, 0, true, true ) { - ReplaceDialogLayout = new QGridLayout( plainPage(), 11, 6); + ReplaceDialogLayout = new TQGridLayout( plainPage(), 11, 6); list = new KListView( plainPage() ); list->addColumn( i18n("Find") ); list->addColumn( i18n("Replace With") ); list->addColumn( i18n("Regular Expression") ); list->addColumn( "regexp" ); // no i18n, because not user visible -// list->setColumnWidthMode( 0, QListView::Manual ); -// list->setColumnWidthMode( 1, QListView::Manual ); -// list->setColumnWidthMode( 2, QListView::Manual ); - list->setColumnWidthMode( 3, QListView::Manual ); +// list->setColumnWidthMode( 0, TQListView::Manual ); +// list->setColumnWidthMode( 1, TQListView::Manual ); +// list->setColumnWidthMode( 2, TQListView::Manual ); + list->setColumnWidthMode( 3, TQListView::Manual ); list->setColumnWidth( 3, 0 ); list->setSorting( -1 ); list->setAllColumnsShowFocus( true ); - TextLabel1 = new QLabel( plainPage() ); + TextLabel1 = new TQLabel( plainPage() ); TextLabel1->setText( i18n( "Find:" ) ); - TextLabel2 = new QLabel( plainPage() ); + TextLabel2 = new TQLabel( plainPage() ); TextLabel2->setText( i18n( "Replace with:" ) ); - text1 = new QLineEdit( plainPage() ); - text2 = new QLineEdit( plainPage() ); + text1 = new TQLineEdit( plainPage() ); + text2 = new TQLineEdit( plainPage() ); - checkReg = new QCheckBox( i18n("&Regular expression"), plainPage() ); + checkReg = new TQCheckBox( i18n("&Regular expression"), plainPage() ); buttonRegEdit = new KPushButton( plainPage() ); buttonRegEdit->setText( i18n( "&Edit..." ) ); buttonRegEdit->setEnabled( false ); @@ -75,7 +75,7 @@ ReplaceDialog::ReplaceDialog( QValueList<replacestrings> & r, QWidget* parent ) buttonRemove = new KPushButton( plainPage() ); buttonRemove->setText( i18n( "&Remove" ) ); - QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding ); + TQSpacerItem* spacer = new TQSpacerItem( 20, 20, TQSizePolicy::Minimum, TQSizePolicy::Expanding ); ReplaceDialogLayout->addWidget( TextLabel1, 0, 0 ); ReplaceDialogLayout->addWidget( text1, 0, 1 ); @@ -96,26 +96,26 @@ ReplaceDialog::ReplaceDialog( QValueList<replacestrings> & r, QWidget* parent ) text1->setFocus(); - connect( buttonAdd, SIGNAL( clicked() ), this, SLOT( add() ) ); - connect( buttonRemove, SIGNAL( clicked() ), this, SLOT( remove() ) ); - connect( list, SIGNAL( clicked( QListViewItem* ) ), this, SLOT( enableControls() ) ); - connect( list, SIGNAL( doubleClicked( QListViewItem* ) ), this, SLOT( slotEdit() ) ); - connect( text2, SIGNAL( returnPressed() ), this, SLOT( add() ) ); - connect( text1, SIGNAL( returnPressed() ), this, SLOT( moveFocus() ) ); - connect( buttonRegEdit, SIGNAL( clicked() ), this, SLOT( invokeRegEdit() ) ); - connect( checkReg, SIGNAL( clicked() ), this, SLOT( enableControls() ) ); - connect( buttonEdit, SIGNAL( clicked() ), this, SLOT( slotEdit() ) ); + connect( buttonAdd, TQT_SIGNAL( clicked() ), this, TQT_SLOT( add() ) ); + connect( buttonRemove, TQT_SIGNAL( clicked() ), this, TQT_SLOT( remove() ) ); + connect( list, TQT_SIGNAL( clicked( TQListViewItem* ) ), this, TQT_SLOT( enableControls() ) ); + connect( list, TQT_SIGNAL( doubleClicked( TQListViewItem* ) ), this, TQT_SLOT( slotEdit() ) ); + connect( text2, TQT_SIGNAL( returnPressed() ), this, TQT_SLOT( add() ) ); + connect( text1, TQT_SIGNAL( returnPressed() ), this, TQT_SLOT( moveFocus() ) ); + connect( buttonRegEdit, TQT_SIGNAL( clicked() ), this, TQT_SLOT( invokeRegEdit() ) ); + connect( checkReg, TQT_SIGNAL( clicked() ), this, TQT_SLOT( enableControls() ) ); + connect( buttonEdit, TQT_SIGNAL( clicked() ), this, TQT_SLOT( slotEdit() ) ); for( unsigned int i = 0; i < r.count(); i++ ) { replacestrings rs = r[i]; - BatchRenamer::unEscape( rs.find ); + BatchRenamer::unEscape( rs.tqfind ); KListViewItem* item = new KListViewItem( list ); - item->setText( 0, encode( rs.find ) ); - item->setText( 1, encode( rs.replace ) ); + item->setText( 0, encode( rs.tqfind ) ); + item->setText( 1, encode( rs.tqreplace ) ); item->setText( 2, rs.reg ? i18n("yes") : i18n("no") ); - item->setText( 3, QString::number( rs.reg ) ); + item->setText( 3, TQString::number( rs.reg ) ); list->insertItem( item ); } @@ -132,7 +132,7 @@ void ReplaceDialog::add() return; } - QListViewItem* it = list->firstChild(); + TQListViewItem* it = list->firstChild(); while( it ) { if( it->text( 0 ) == text1->text() ) { KMessageBox::sorry( this, i18n( "You can't replace the same text twice." ) ); @@ -145,7 +145,7 @@ void ReplaceDialog::add() item->setText( 0, encode( text1->text() ) ); item->setText( 1, encode( text2->text() ) ); item->setText( 2, checkReg->isChecked() ? i18n("yes") : i18n("no") ); - item->setText( 3, QString::number( checkReg->isChecked() ) ); + item->setText( 3, TQString::number( checkReg->isChecked() ) ); list->insertItem( item ); reset(); @@ -156,7 +156,7 @@ void ReplaceDialog::add() void ReplaceDialog::remove() { if( list->selectedItem() ) { - QListViewItem* item = list->selectedItem(); + TQListViewItem* item = list->selectedItem(); list->takeItem( item ); delete item; } @@ -164,17 +164,17 @@ void ReplaceDialog::remove() enableControls(); } -QValueList<replacestrings> ReplaceDialog::getList() +TQValueList<replacestrings> ReplaceDialog::getList() { - QValueList<replacestrings> r; - QListViewItem* item = list->firstChild(); + TQValueList<replacestrings> r; + TQListViewItem* item = list->firstChild(); while( item ) { replacestrings n; - n.find = decode( item->text( 0 ) ); - n.replace = decode( item->text( 1 ) ); + n.tqfind = decode( item->text( 0 ) ); + n.tqreplace = decode( item->text( 1 ) ); n.reg = item->text( 3 ).toInt(); - BatchRenamer::doEscape( n.find ); + BatchRenamer::doEscape( n.tqfind ); r.append( n ); @@ -190,7 +190,7 @@ void ReplaceDialog::moveFocus() void ReplaceDialog::invokeRegEdit() { - QDialog* regExpDialog = KParts::ComponentFactory::createInstanceFromQuery<QDialog>( "KRegExpEditor/KRegExpEditor", QString::null, this ); + TQDialog* regExpDialog = KParts::ComponentFactory::createInstanceFromQuery<TQDialog>( "KRegExpEditor/KRegExpEditor", TQString(), TQT_TQOBJECT(this) ); KRegExpEditorInterface *iface = static_cast<KRegExpEditorInterface *>( regExpDialog->qt_cast( "KRegExpEditorInterface" ) ); if ( !iface ) @@ -202,14 +202,14 @@ void ReplaceDialog::invokeRegEdit() text1->setText( iface->regExp() ); } -QString ReplaceDialog::encode( QString s ) +TQString ReplaceDialog::encode( TQString s ) { s.append("\""); s.prepend("\""); return s; } -QString ReplaceDialog::decode( QString s ) +TQString ReplaceDialog::decode( TQString s ) { if( s[0] == '"' ) s.remove( 0, 1 ); @@ -219,9 +219,9 @@ QString ReplaceDialog::decode( QString s ) return s; } -void ReplaceDialog::resizeEvent( QResizeEvent* e ) +void ReplaceDialog::resizeEvent( TQResizeEvent* e ) { - QDialog::resizeEvent( e ); + TQDialog::resizeEvent( e ); // list->setColumnWidth( 0, TextLabel1->width() + text1->width() ); // list->setColumnWidth( 1, TextLabel2->width() + text2->width() ); } @@ -247,7 +247,7 @@ void ReplaceDialog::slotEdit() text2->setText( decode( list->selectedItem()->text( 1 ) ) ); checkReg->setChecked( list->selectedItem()->text( 3 ).toInt() ); - QListViewItem* item = list->selectedItem(); + TQListViewItem* item = list->selectedItem(); list->takeItem( item ); delete item; diff --git a/krename/replacedialog.h b/krename/replacedialog.h index 0598fcc..13d7542 100644 --- a/krename/replacedialog.h +++ b/krename/replacedialog.h @@ -20,28 +20,29 @@ // QT includes #include <kdialogbase.h> -#include <qvaluelist.h> +#include <tqvaluelist.h> // Own includes #include "batchrenamer.h" -class QCheckBox; -class QGridLayout; -class QGridLayout; -class QLabel; -class QLineEdit; +class TQCheckBox; +class TQGridLayout; +class TQGridLayout; +class TQLabel; +class TQLineEdit; class KPushButton; -class QListViewItem; +class TQListViewItem; class KListView; class ReplaceDialog : public KDialogBase { Q_OBJECT + TQ_OBJECT public: - ReplaceDialog( QValueList<replacestrings> & r, QWidget* parent = 0 ); + ReplaceDialog( TQValueList<replacestrings> & r, TQWidget* tqparent = 0 ); ~ReplaceDialog(); - QValueList<replacestrings> getList(); + TQValueList<replacestrings> getList(); private slots: void add(); @@ -54,25 +55,25 @@ class ReplaceDialog : public KDialogBase private: void reset(); - QLabel* TextLabel1; - QLineEdit* text2; - QLabel* TextLabel2; - QLineEdit* text1; + TQLabel* TextLabel1; + TQLineEdit* text2; + TQLabel* TextLabel2; + TQLineEdit* text1; KListView* list; - QCheckBox* checkReg; + TQCheckBox* checkReg; KPushButton* buttonAdd; KPushButton* buttonRemove; KPushButton* buttonEdit; KPushButton* buttonRegEdit; - QString encode( QString s ); - QString decode( QString s ); + TQString encode( TQString s ); + TQString decode( TQString s ); protected: - void resizeEvent( QResizeEvent* e ); + void resizeEvent( TQResizeEvent* e ); - QGridLayout* ReplaceDialogLayout; + TQGridLayout* ReplaceDialogLayout; }; #endif // REPLACEDIALOG_H diff --git a/krename/tabs.cpp b/krename/tabs.cpp index b6ed00e..bb3543a 100644 --- a/krename/tabs.cpp +++ b/krename/tabs.cpp @@ -19,10 +19,10 @@ #include "krenameimpl.h" #include "kmyhistorycombo.h" -// Qt includes -#include <qlayout.h> -#include <qsizepolicy.h> -#include <qtabwidget.h> +// TQt includes +#include <tqlayout.h> +#include <tqsizepolicy.h> +#include <tqtabwidget.h> // KDE includes #include <kapplication.h> @@ -33,16 +33,16 @@ #include <kpushbutton.h> #include <kstartupinfo.h> -tabs::tabs(KRenameImpl* impl, QRect r, QWidget *parent, const char *name ) - : QDialog(parent,name) +tabs::tabs(KRenameImpl* impl, TQRect r, TQWidget *tqparent, const char *name ) + : TQDialog(tqparent,name) { setIcon( BarIcon( "krename" ) ); - QVBoxLayout* layout = new QVBoxLayout( this, 6, 6 ); - QHBoxLayout* buttons = new QHBoxLayout( 0, 6, 6 ); - QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Expanding ); + TQVBoxLayout* tqlayout = new TQVBoxLayout( this, 6, 6 ); + TQHBoxLayout* buttons = new TQHBoxLayout( 0, 6, 6 ); + TQSpacerItem* spacer = new TQSpacerItem( 20, 20, TQSizePolicy::Expanding, TQSizePolicy::Expanding ); - tab = new QTabWidget( this ); + tab = new TQTabWidget( this ); finishButton = new KPushButton( i18n("&Finish"), this ); finishButton->setIconSet( SmallIconSet( "finish" ) ); finishButton->setDefault( true ); @@ -53,21 +53,21 @@ tabs::tabs(KRenameImpl* impl, QRect r, QWidget *parent, const char *name ) buttons->addWidget( finishButton ); buttons->addWidget( cancelButton ); - layout->addWidget( tab ); - layout->addLayout( buttons ); - layout->setStretchFactor( tab, 2 ); + tqlayout->addWidget( tab ); + tqlayout->addLayout( buttons ); + tqlayout->setStretchFactor( tab, 2 ); menuBar = new KMenuBar( this ); - layout->setMenuBar( menuBar ); + tqlayout->setMenuBar( menuBar ); - connect( cancelButton, SIGNAL( clicked() ), this, SLOT( close() ) ); + connect( cancelButton, TQT_SIGNAL( clicked() ), this, TQT_SLOT( close() ) ); krename = impl ? impl : new KRenameImpl( this, menuBar, finishButton ); - connect( krename, SIGNAL( pageDone( QWidget*, const QString & ) ), this, SLOT( slotAddPage( QWidget*, const QString & ) ) ); - connect( krename, SIGNAL( showPage( int ) ), this, SLOT( slotShowPage( int ) ) ); - connect( krename, SIGNAL( enableFinish( bool ) ), this, SLOT( slotEnableFinish( bool ) ) ); - connect( tab, SIGNAL( currentChanged( QWidget* ) ), this, SLOT( slotTabChanged() ) ); + connect( krename, TQT_SIGNAL( pageDone( TQWidget*, const TQString & ) ), this, TQT_SLOT( slotAddPage( TQWidget*, const TQString & ) ) ); + connect( krename, TQT_SIGNAL( showPage( int ) ), this, TQT_SLOT( slotShowPage( int ) ) ); + connect( krename, TQT_SIGNAL( enableFinish( bool ) ), this, TQT_SLOT( slotEnableFinish( bool ) ) ); + connect( tab, TQT_SIGNAL( currentChanged( TQWidget* ) ), this, TQT_SLOT( slotTabChanged() ) ); if( impl ) { @@ -86,7 +86,7 @@ tabs::~tabs() { } -void tabs::slotAddPage( QWidget* page, const QString & title ) +void tabs::slotAddPage( TQWidget* page, const TQString & title ) { tab->addTab( page, title ); } @@ -110,10 +110,10 @@ void tabs::slotTabChanged() } } -void tabs::keyPressEvent( QKeyEvent *e ) +void tabs::keyPressEvent( TQKeyEvent *e ) { // ESC should not close KRename - if( e->key() == Qt::Key_Escape ) + if( e->key() == TQt::Key_Escape ) e->accept(); else e->ignore(); diff --git a/krename/tabs.h b/krename/tabs.h index 9e52f5c..0c23b7f 100644 --- a/krename/tabs.h +++ b/krename/tabs.h @@ -18,32 +18,33 @@ #ifndef TABS_H #define TABS_H -#include <qwidget.h> -#include <qdialog.h> +#include <tqwidget.h> +#include <tqdialog.h> class KMenuBar; class KRenameImpl; class KPushButton; -class QCloseEvent; -class QRect; -class QString; -class QTabWidget; -class tabs : public QDialog { +class TQCloseEvent; +class TQRect; +class TQString; +class TQTabWidget; +class tabs : public TQDialog { Q_OBJECT + TQ_OBJECT public: - tabs(KRenameImpl* impl, QRect r, QWidget *parent=0, const char *name=0); + tabs(KRenameImpl* impl, TQRect r, TQWidget *tqparent=0, const char *name=0); ~tabs(); inline KRenameImpl* getKRename() { return krename; } private slots: - void slotAddPage( QWidget* page, const QString & title ); + void slotAddPage( TQWidget* page, const TQString & title ); void slotShowPage( int page ); void slotEnableFinish( bool b ); void slotTabChanged(); protected: - virtual void keyPressEvent( QKeyEvent *e ); + virtual void keyPressEvent( TQKeyEvent *e ); protected: KRenameImpl* krename; @@ -51,7 +52,7 @@ class tabs : public QDialog { KPushButton* cancelButton; KMenuBar* menuBar; - QTabWidget* tab; + TQTabWidget* tab; }; #endif diff --git a/krename/threadedlister.cpp b/krename/threadedlister.cpp index 9af929a..322e268 100644 --- a/krename/threadedlister.cpp +++ b/krename/threadedlister.cpp @@ -22,10 +22,10 @@ #include "krecursivelister.h" #include <kapplication.h> -#include <qmutex.h> +#include <tqmutex.h> -ThreadedLister::ThreadedLister( QMutex* mutex, unsigned int* counter, KMyListBox* list ) - : QObject(), QThread(), m_mutex( mutex ), m_counter( counter ), m_list( list ) +ThreadedLister::ThreadedLister( TQMutex* mutex, unsigned int* counter, KMyListBox* list ) + : TQObject(), TQThread(), m_mutex( mutex ), m_counter( counter ), m_list( list ) { m_mutex->lock(); ++(*m_counter); @@ -56,7 +56,7 @@ ThreadedLister::~ThreadedLister() void ThreadedLister::run() { - m_internal = new QMutex(); + m_internal = new TQMutex(); m_internal->lock(); if( m_recursive ) @@ -67,7 +67,7 @@ void ThreadedLister::run() m_reclister->setNameFilter( m_filter ); m_reclister->setDirOnlyMode( m_dironly ); - connect( m_reclister, SIGNAL( completed() ), this, SLOT( reclisterFinished() ) ); + connect( m_reclister, TQT_SIGNAL( completed() ), this, TQT_SLOT( reclisterFinished() ) ); m_reclister->openURL( m_dirname ); } else { @@ -77,7 +77,7 @@ void ThreadedLister::run() m_lister->setShowingDotFiles( m_hidden ); m_lister->setNameFilter( m_filter ); - connect( m_lister, SIGNAL( completed() ), this, SLOT( listerFinished() ) ); + connect( m_lister, TQT_SIGNAL( completed() ), this, TQT_SLOT( listerFinished() ) ); m_lister->openURL( m_dirname, false, false ); } @@ -88,7 +88,7 @@ void ThreadedLister::run() m_internal->lock(); m_internal->unlock(); - KApplication::postEvent( m_list, new QCustomEvent( (QEvent::Type)ThreadedLister::TYPE(), (void*)this ) ); + KApplication::postEvent( m_list, new TQCustomEvent( (TQEvent::Type)ThreadedLister::TYPE(), (void*)this ) ); } @@ -112,8 +112,8 @@ void ThreadedLister::reclisterFinished() if( m_dirnames ) { - QString name = m_dirname.fileName(); - if( !m_hidden && name.right( 1 ) != QString::fromLatin1(".") ) + TQString name = m_dirname.fileName(); + if( !m_hidden && name.right( 1 ) != TQString::tqfromLatin1(".") ) m_list->addDirName( m_dirname ); } @@ -141,8 +141,8 @@ void ThreadedLister::listerFinished() if( m_dirnames ) { - QString name = m_dirname.fileName(); - if( !m_hidden && name.right( 1 ) != QString::fromLatin1(".") ) + TQString name = m_dirname.fileName(); + if( !m_hidden && name.right( 1 ) != TQString::tqfromLatin1(".") ) m_list->addDirName( m_dirname ); } diff --git a/krename/threadedlister.h b/krename/threadedlister.h index 8398e0d..c2272e4 100644 --- a/krename/threadedlister.h +++ b/krename/threadedlister.h @@ -19,39 +19,40 @@ #ifndef THREADEDLISTER_H #define THREADEDLISTER_H -#include <qobject.h> -#include <qthread.h> +#include <tqobject.h> +#include <tqthread.h> #include <kfileitem.h> class KDirLister; class KRecursiveLister; class KMyListBox; -class QMutex; +class TQMutex; -class FileList : public QPtrList<KFileItem> { +class FileList : public TQPtrList<KFileItem> { public: - FileList() : QPtrList<KFileItem>() {} + FileList() : TQPtrList<KFileItem>() {} FileList( KFileItemList list ) - : QPtrList<KFileItem>() { + : TQPtrList<KFileItem>() { KFileItem* it; for( it = list.first(); it; it = list.next() ) this->append( it ); } protected: - int compareItems( QPtrCollection::Item item1, QPtrCollection::Item item2 ) { + int compareItems( TQPtrCollection::Item item1, TQPtrCollection::Item item2 ) { return static_cast<KFileItem*>(item1)->url().url().compare( static_cast<KFileItem*>(item2)->url().url() ); } }; -class ThreadedLister : public QObject, public QThread +class ThreadedLister : public TQObject, public TQThread { Q_OBJECT + TQ_OBJECT public: - ThreadedLister( QMutex* mutex, unsigned int* counter, KMyListBox* list ); + ThreadedLister( TQMutex* mutex, unsigned int* counter, KMyListBox* list ); ~ThreadedLister(); static int TYPE() { return 51984; } @@ -60,12 +61,12 @@ class ThreadedLister : public QObject, public QThread inline const KURL & dirname(); inline bool dirnames(); - inline const QString & filter(); + inline const TQString & filter(); inline bool hidden(); inline void setDirname( const KURL & dirname ); inline void setDirnames( bool names ); - inline void setFilter( const QString & filter ); + inline void setFilter( const TQString & filter ); inline void setHidden( bool h ); inline void setRecursive( bool r ); inline void setRecursiveDirOnlyMode( bool m ); @@ -81,14 +82,14 @@ class ThreadedLister : public QObject, public QThread void listerFinished(); private: - QMutex* m_mutex; - QMutex* m_internal; + TQMutex* m_mutex; + TQMutex* m_internal; unsigned int* m_counter; FileList m_files; KURL m_dirname; - QString m_filter; + TQString m_filter; bool m_hidden; bool m_recursive; bool m_dirnames; @@ -110,7 +111,7 @@ void ThreadedLister::setDirnames( bool names ) m_dirnames = names; } -void ThreadedLister::setFilter( const QString & filter ) +void ThreadedLister::setFilter( const TQString & filter ) { m_filter = filter; } @@ -145,7 +146,7 @@ bool ThreadedLister::dirnames() return m_dirnames; } -const QString & ThreadedLister::filter() +const TQString & ThreadedLister::filter() { return m_filter; } diff --git a/krename/translitplugin.cpp b/krename/translitplugin.cpp index 65031e0..7d08702 100644 --- a/krename/translitplugin.cpp +++ b/krename/translitplugin.cpp @@ -12,33 +12,33 @@ #include "translitplugin.h" #include "translitplugin.moc" -const QString TranslitPlugin::m_strUtf8[] = {"а","б","в","г","д","е","ё","ж","з","и", +const TQString TranslitPlugin::m_strUtf8[] = {"а","б","в","г","д","е","ё","ж","з","и", "й","к","л","м","н","о","п","р","с","т","у","ф","х","ц","ч","ш","щ","ъ","ы","ь", "э","ю","я", "А","Б","В","Г","Д","Е","Ё","Ж","З","И","Й","К","Л","М","Н","О","П", "Р","С","Т","У","Ф","Х","Ц","Ч","Ш","Щ","Ъ","Ы","Ь","Э","Ю","Я", "á","ä","č","ď","é","ě","í","ľ","ĺ","ň","ó","ô","ř","ŕ","š","ť","ú","ů","ý","ž", - "Á","Ä","Č","Ď","É","Ě","Í","Ľ","Ĺ","Ň","Ó","Ô","Ř","Ŕ","Š","Ť","Ú","Ů","Ý","Ž",QString::null}; + "Á","Ä","Č","Ď","É","Ě","Í","Ľ","Ĺ","Ň","Ó","Ô","Ř","Ŕ","Š","Ť","Ú","Ů","Ý","Ž",TQString()}; -const QString TranslitPlugin::m_strEngl[]= {"a","b","v","g","d","e","yo","zh","z","i", +const TQString TranslitPlugin::m_strEngl[]= {"a","b","v","g","d","e","yo","zh","z","i", "j","k","l","m","n","o","p","r","s","t","u","f","h","c","ch","sh","sh","","y","", "e","yu","ya", "A","B","V","G","D","E","Yo","Zh","Z","I","J","K","L","M","N","O","P", "R","S","T","U","F","H","C","Ch","Sh","Sh","","Y","","E","Yu","Ya", "a","a","c","d","e","e","i","l","l","n","o","o","r","r","s","t","u","u","y","z", - "A","A","C","D","E","E","I","L","L","N","O","O","R","R","S","T","U","U","Y","Z",QString::null}; + "A","A","C","D","E","E","I","L","L","N","O","O","R","R","S","T","U","U","Y","Z",TQString()}; -const QString TranslitPlugin::getName() const +const TQString TranslitPlugin::getName() const { return i18n("Transliteration Plugin"); } -const QString TranslitPlugin::getAccelName() const +const TQString TranslitPlugin::getAccelName() const { return i18n("&Transliteration Plugin"); } -const QPixmap TranslitPlugin::getIcon() const +const TQPixmap TranslitPlugin::getIcon() const { return kapp->iconLoader()->loadIcon( "fonts", KIcon::Small ); } @@ -48,13 +48,13 @@ const int TranslitPlugin::type() const return TYPE_FINAL_FILENAME; } -void TranslitPlugin::drawInterface( QWidget* w, QVBoxLayout* l ) +void TranslitPlugin::drawInterface( TQWidget* w, TQVBoxLayout* l ) { - QLabel* label = new QLabel( + TQLabel* label = new TQLabel( i18n("<qt>This plugin transliterates names written with non-english characters.</qt>"), w ); l->addWidget( label ); - label = new QLabel( "<qt><b>WARNING! THIS PLUGIN IS EXPERIMENTAL AND MIGHT CAUSE LOSS OF DATA!</b></qt>", w ); + label = new TQLabel( "<qt><b>WARNING! THIS PLUGIN IS EXPERIMENTAL AND MIGHT CAUSE LOSS OF DATA!</b></qt>", w ); l->addWidget( label ); } @@ -71,22 +71,22 @@ bool TranslitPlugin::checkError() return true; } -QString TranslitPlugin::processFile( BatchRenamer*, int, QString token, int ) +TQString TranslitPlugin::processFile( BatchRenamer*, int, TQString token, int ) { - QString output = translit( token ); + TQString output = translit( token ); return output; // no error } -QString TranslitPlugin::translit(const QString & unicoded) +TQString TranslitPlugin::translit(const TQString & tqunicoded) { int i; - QString transed = ""; + TQString transed = ""; - for (i=0; i<(int)unicoded.length(); i++) { - QString charIn = unicoded.mid(i, 1); + for (i=0; i<(int)tqunicoded.length(); i++) { + TQString charIn = tqunicoded.mid(i, 1); if (m_mapFromUTF8[charIn.utf8()]) { - QString charTrans = m_mapFromUTF8[charIn.utf8()]; + TQString charTrans = m_mapFromUTF8[charIn.utf8()]; transed.append(charTrans); } else { transed.append(charIn); @@ -98,9 +98,9 @@ QString TranslitPlugin::translit(const QString & unicoded) TranslitPlugin::TranslitPlugin() { // Initialize transliteration map int i; - for (i=0; m_strUtf8[i]!=QString::null; i++) { - QString src = m_strUtf8[i]; - QString dst = m_strEngl[i]; + for (i=0; m_strUtf8[i]!=TQString(); i++) { + TQString src = m_strUtf8[i]; + TQString dst = m_strEngl[i]; m_mapFromUTF8[src] = dst; } } diff --git a/krename/translitplugin.h b/krename/translitplugin.h index c385b36..979ba14 100644 --- a/krename/translitplugin.h +++ b/krename/translitplugin.h @@ -17,11 +17,11 @@ #include "batchrenamer.h" // QT includes -#include <qlabel.h> -#include <qlayout.h> -#include <qtextcodec.h> -#include <qvgroupbox.h> -#include <qcheckbox.h> +#include <tqlabel.h> +#include <tqlayout.h> +#include <tqtextcodec.h> +#include <tqvgroupbox.h> +#include <tqcheckbox.h> // KDE includes #include <kapplication.h> @@ -35,25 +35,26 @@ */ class TranslitPlugin : public Plugin { Q_OBJECT + TQ_OBJECT public: - const QString getName() const; - const QString getAccelName() const; + const TQString getName() const; + const TQString getAccelName() const; const int type() const; - const QPixmap getIcon() const; - void drawInterface( QWidget* w, QVBoxLayout* l ); + const TQPixmap getIcon() const; + void drawInterface( TQWidget* w, TQVBoxLayout* l ); void finished(); bool checkError(); void fillStructure(); - QString processFile( BatchRenamer*, int, QString token, int ); + TQString processFile( BatchRenamer*, int, TQString token, int ); TranslitPlugin(); protected: - QString translit(const QString &); + TQString translit(const TQString &); - typedef QMap<QString, QString> TranslitMap; + typedef TQMap<TQString, TQString> TranslitMap; TranslitMap m_mapFromUTF8; - static const QString m_strUtf8[]; - static const QString m_strEngl[]; + static const TQString m_strUtf8[]; + static const TQString m_strEngl[]; }; #endif diff --git a/krename/undodialog.cpp b/krename/undodialog.cpp index 1dcd8b9..d5b549b 100644 --- a/krename/undodialog.cpp +++ b/krename/undodialog.cpp @@ -17,9 +17,9 @@ #include "undodialog.h" -// Qt includes -#include <qlabel.h> -#include <qlayout.h> +// TQt includes +#include <tqlabel.h> +#include <tqlayout.h> // KDE includes #include <kfiledialog.h> @@ -29,13 +29,13 @@ #include <ktextbrowser.h> #include <kurlrequester.h> -UndoDialog::UndoDialog( QWidget* parent ) +UndoDialog::UndoDialog( TQWidget* tqparent ) : KDialogBase( KDialogBase::Plain, i18n("Undo Renaming"), - KDialogBase::User1 | KDialogBase::Close, KDialogBase::User1, parent, 0, false, true ) + KDialogBase::User1 | KDialogBase::Close, KDialogBase::User1, tqparent, 0, false, true ) { - UndoDialogLayout = new QVBoxLayout( plainPage(), 11, 6, "UndoDialogLayout"); + UndoDialogLayout = new TQVBoxLayout( plainPage(), 11, 6, "UndoDialogLayout"); - TextLabel1 = new QLabel( plainPage(), "TextLabel1" ); + TextLabel1 = new TQLabel( plainPage(), "TextLabel1" ); TextLabel1->setText( i18n( "Undo script:" ) ); UndoDialogLayout->addWidget( TextLabel1 ); @@ -47,20 +47,20 @@ UndoDialog::UndoDialog( QWidget* parent ) "*|All Files (*)") ); UndoDialogLayout->addWidget( scriptname ); - TextLabel2 = new QLabel( plainPage(), "TextLabel2" ); + TextLabel2 = new TQLabel( plainPage(), "TextLabel2" ); TextLabel2->setText( i18n( "<qt>Undo Scripts are normal shell scripts which can also be executed manually from the command line.</qt>" ) ); UndoDialogLayout->addWidget( TextLabel2 ); browser = new KTextBrowser( plainPage()); - browser->setWordWrap( QTextEdit::NoWrap ); - browser->setTextFormat( Qt::RichText ); + browser->setWordWrap( TQTextEdit::NoWrap ); + browser->setTextFormat( TQt::RichText ); UndoDialogLayout->addWidget( browser ); setButtonText( KDialogBase::User1, i18n( "&Start" ) ); - connect( this, SIGNAL( user1Clicked() ), this, SLOT( start() ) ); - connect( scriptname, SIGNAL( textChanged( const QString & ) ), this, SLOT( enableControls() ) ); + connect( this, TQT_SIGNAL( user1Clicked() ), this, TQT_SLOT( start() ) ); + connect( scriptname, TQT_SIGNAL( textChanged( const TQString & ) ), this, TQT_SLOT( enableControls() ) ); enableControls(); } @@ -89,14 +89,14 @@ void UndoDialog::start() return; } proc->resume(); - connect( proc, SIGNAL( receivedStdout( KProcess*, char*, int) ), this, SLOT( receive( KProcess*, char*, int ) ) ); - connect( proc, SIGNAL( receivedStderr( KProcess*, char*, int) ), this, SLOT( receiveErr( KProcess*, char*, int ) ) ); - connect( proc, SIGNAL( processExited( KProcess* ) ), this, SLOT( finished( KProcess* ) ) ); + connect( proc, TQT_SIGNAL( receivedStdout( KProcess*, char*, int) ), this, TQT_SLOT( receive( KProcess*, char*, int ) ) ); + connect( proc, TQT_SIGNAL( receivedStderr( KProcess*, char*, int) ), this, TQT_SLOT( receiveErr( KProcess*, char*, int ) ) ); + connect( proc, TQT_SIGNAL( processExited( KProcess* ) ), this, TQT_SLOT( finished( KProcess* ) ) ); } void UndoDialog::receive( KProcess*, char* buffer, int len ) { - QString text; + TQString text; for( int i = 0; i < len; i++ ) text.append( buffer[i] ); @@ -105,7 +105,7 @@ void UndoDialog::receive( KProcess*, char* buffer, int len ) void UndoDialog::receiveErr( KProcess*, char* buffer, int len ) { - QString text = "<b>"; + TQString text = "<b>"; for( int i = 0; i < len; i++ ) text.append( buffer[i] ); @@ -121,12 +121,12 @@ void UndoDialog::finished( KProcess* p ) void UndoDialog::enableControls() { - QFileInfo fi( scriptname->url() ); + TQFileInfo fi( scriptname->url() ); bool b = !scriptname->url().isEmpty() && fi.exists() && fi.isExecutable(); enableButton( KDialogBase::User1, b ); } -void UndoDialog::setUndoScript( const QString & filename ) +void UndoDialog::setUndoScript( const TQString & filename ) { scriptname->setURL( filename ); } diff --git a/krename/undodialog.h b/krename/undodialog.h index e6ad0c8..6cdea12 100644 --- a/krename/undodialog.h +++ b/krename/undodialog.h @@ -24,18 +24,19 @@ class KPushButton; class KProcess; class KTextBrowser; class KURLRequester; -class QVBoxLayout; -class QHBoxLayout; -class QGridLayout; -class QLabel; +class TQVBoxLayout; +class TQHBoxLayout; +class TQGridLayout; +class TQLabel; class UndoDialog : public KDialogBase { Q_OBJECT + TQ_OBJECT public: - UndoDialog( QWidget* parent = 0 ); + UndoDialog( TQWidget* tqparent = 0 ); ~UndoDialog(); - void setUndoScript( const QString & filename ); + void setUndoScript( const TQString & filename ); public slots: void start(); @@ -47,13 +48,13 @@ class UndoDialog : public KDialogBase void enableControls(); private: - QLabel* TextLabel1; + TQLabel* TextLabel1; KURLRequester* scriptname; - QLabel* TextLabel2; + TQLabel* TextLabel2; KTextBrowser* browser; protected: - QVBoxLayout* UndoDialogLayout; + TQVBoxLayout* UndoDialogLayout; }; #endif // UNDODIALOG_H diff --git a/krename/wizard.cpp b/krename/wizard.cpp index 31720c9..17324d1 100644 --- a/krename/wizard.cpp +++ b/krename/wizard.cpp @@ -27,24 +27,24 @@ #include <kmessagebox.h> #include <kstartupinfo.h> -// Qt includes -#include <qlabel.h> -#include <qlayout.h> -#include <qpushbutton.h> -#include <qsizepolicy.h> -#include <qvbox.h> - -wizard::wizard( KRenameImpl* impl, QRect r, QWidget* parent, const char* name ) - : KWizard( parent, name ) +// TQt includes +#include <tqlabel.h> +#include <tqlayout.h> +#include <tqpushbutton.h> +#include <tqsizepolicy.h> +#include <tqvbox.h> + +wizard::wizard( KRenameImpl* impl, TQRect r, TQWidget* tqparent, const char* name ) + : KWizard( tqparent, name ) { setIcon( BarIcon( "krename" ) ); menuBar = new KMenuBar(this); krename = impl ? impl : new KRenameImpl( this, menuBar, this->finishButton() ); - connect( krename, SIGNAL( pageDone( QWidget*, const QString & ) ), this, SLOT( slotAddPage( QWidget*, const QString & ) ) ); - connect( krename, SIGNAL( showPage( int ) ), this, SLOT( slotShowPage( int ) ) ); - connect( krename, SIGNAL( enableFinish( bool ) ), this, SLOT( slotEnableFinish( bool ) ) ); + connect( krename, TQT_SIGNAL( pageDone( TQWidget*, const TQString & ) ), this, TQT_SLOT( slotAddPage( TQWidget*, const TQString & ) ) ); + connect( krename, TQT_SIGNAL( showPage( int ) ), this, TQT_SLOT( slotShowPage( int ) ) ); + connect( krename, TQT_SIGNAL( enableFinish( bool ) ), this, TQT_SLOT( slotEnableFinish( bool ) ) ); if( impl ) { @@ -59,14 +59,14 @@ wizard::wizard( KRenameImpl* impl, QRect r, QWidget* parent, const char* name ) KStartupInfo::sendFinish( id ); // Disable ESC key - cancelButton()->setAccel( QKeySequence() ); + cancelButton()->setAccel( TQKeySequence() ); } wizard::~wizard() { } -void wizard::slotAddPage( QWidget* page, const QString & title ) +void wizard::slotAddPage( TQWidget* page, const TQString & title ) { // exclude page 3 from wizard if( krename->title( 2 ) == title ) @@ -75,18 +75,18 @@ void wizard::slotAddPage( QWidget* page, const QString & title ) return; } - QString t = title + i18n(" - Step %1 of %2").arg( pageCount()+1 ).arg( 3 ); + TQString t = title + i18n(" - Step %1 of %2").tqarg( pageCount()+1 ).tqarg( 3 ); - QVBox* layout = new QVBox( this ); + TQVBox* tqlayout = new TQVBox( this ); - new QLabel( QString( t ).remove( title.find( "&" ), 1 ), layout ); + new TQLabel( TQString( t ).remove( title.tqfind( "&" ), 1 ), tqlayout ); - QFrame* hbar1 = new QFrame( layout, "<hr>", 0 ); - hbar1->setFrameStyle( QFrame::Sunken + QFrame::HLine ); + TQFrame* hbar1 = new TQFrame( tqlayout, "<hr>", 0 ); + hbar1->setFrameStyle( TQFrame::Sunken + TQFrame::HLine ); - page->reparent( layout, QPoint( 0, 0 ) ); - addPage( layout, t ); - setHelpEnabled( layout, false ); + page->reparent( tqlayout, TQPoint( 0, 0 ) ); + addPage( tqlayout, t ); + setHelpEnabled( tqlayout, false ); } void wizard::slotShowPage( int page ) diff --git a/krename/wizard.h b/krename/wizard.h index a415be0..8ca06da 100644 --- a/krename/wizard.h +++ b/krename/wizard.h @@ -20,27 +20,28 @@ // KDE includes #include <kwizard.h> -class QCloseEvent; +class TQCloseEvent; class KRenameImpl; class KMenuBar; -class QCloseEvent; -class QHBoxLayout; -class QRect; -class QString; -class QVBoxLayout; -class QWidget; +class TQCloseEvent; +class TQHBoxLayout; +class TQRect; +class TQString; +class TQVBoxLayout; +class TQWidget; class wizard : public KWizard { Q_OBJECT + TQ_OBJECT public: - wizard( KRenameImpl* impl, QRect r, QWidget* parent = 0, const char* name = 0 ); + wizard( KRenameImpl* impl, TQRect r, TQWidget* tqparent = 0, const char* name = 0 ); ~wizard(); inline KRenameImpl* getKRename() { return krename; } private slots: - void slotAddPage( QWidget* page, const QString & title ); + void slotAddPage( TQWidget* page, const TQString & title ); void slotShowPage( int page ); void slotEnableFinish( bool b ); |