TQt4 port krename

This enables compilation under both Qt3 and Qt4


git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/krename@1238984 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
v3.5.13-sru
tpearson 13 years ago
parent f8b5e2400a
commit ce0c60d7b9

@ -16,14 +16,10 @@
***************************************************************************/ ***************************************************************************/
// QT Includes // QT Includes
#include <qlayout.h> #include <tqlayout.h>
#include <qprogressbar.h> #include <tqprogressbar.h>
#include <qtimer.h> #include <tqtimer.h>
#include <qtooltip.h> #include <tqtooltip.h>
#if QT_VERSION < 0x030100
#include <qregexp.h>
#endif
// KDE includes // KDE includes
#include <kapplication.h> #include <kapplication.h>
@ -34,7 +30,7 @@
#include <kpushbutton.h> #include <kpushbutton.h>
#include <krun.h> #include <krun.h>
#include <qfile.h> #include <tqfile.h>
// Own includes // Own includes
#include "ProgressDialog.h" #include "ProgressDialog.h"
@ -48,8 +44,8 @@
// update user interface every 1/2 second // update user interface every 1/2 second
#define TIMER_INTERVAL 500 #define TIMER_INTERVAL 500
ProgressDialog::ProgressDialog( QWidget* parent, const char* name, WFlags fl ) ProgressDialog::ProgressDialog( TQWidget* tqparent, const char* name, WFlags fl )
: QWidget( parent, name, fl ) : TQWidget( tqparent, name, fl )
{ {
renamedFiles = NULL; renamedFiles = NULL;
@ -57,11 +53,11 @@ ProgressDialog::ProgressDialog( QWidget* parent, const char* name, WFlags fl )
setCaption( i18n("Progress") ); setCaption( i18n("Progress") );
setIcon( BarIcon( "krename" ) ); setIcon( BarIcon( "krename" ) );
ProgressDialogLayout = new QVBoxLayout( this, 11, 6 ); ProgressDialogLayout = new TQVBoxLayout( this, 11, 6 );
Layout1 = new QHBoxLayout( 0, 0, 6 ); Layout1 = new TQHBoxLayout( 0, 0, 6 );
QHBoxLayout* Layout2 = new QHBoxLayout( 0, 6, 6 ); TQHBoxLayout* Layout2 = new TQHBoxLayout( 0, 6, 6 );
bar = new QProgressBar( this ); bar = new TQProgressBar( this );
bar->setProgress( 0 ); bar->setProgress( 0 );
buttonCancel = new KPushButton( i18n("&Cancel"), this ); buttonCancel = new KPushButton( i18n("&Cancel"), this );
@ -69,24 +65,24 @@ ProgressDialog::ProgressDialog( QWidget* parent, const char* name, WFlags fl )
display = new KListView( this ); display = new KListView( this );
display->addColumn( i18n("Messages") ); display->addColumn( i18n("Messages") );
display->addColumn( "sort" ); display->addColumn( "sort" );
display->setColumnWidthMode( 0, QListView::Maximum ); display->setColumnWidthMode( 0, TQListView::Maximum );
display->setColumnWidthMode( 1, QListView::Manual ); display->setColumnWidthMode( 1, TQListView::Manual );
display->setColumnWidth( 1, 0 ); display->setColumnWidth( 1, 0 );
display->setSorting( -1 ); display->setSorting( -1 );
display->setUpdatesEnabled( false ); 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 = new KPushButton( this );
buttonUndo->setText( i18n("&Undo") ); buttonUndo->setText( i18n("&Undo") );
buttonUndo->setEnabled( false ); buttonUndo->setEnabled( false );
mnuButton = new KPopupMenu( this ); mnuButton = new KPopupMenu( this );
mnuButton->insertItem( i18n("Restart KRename..."), this, SLOT( restart() )); mnuButton->insertItem( i18n("Restart KRename..."), this, TQT_SLOT( restart() ));
mnuButton->insertSeparator(); mnuButton->insertSeparator();
mnuButton->insertItem( i18n("Rename Processed Files &Again..."), this, SLOT( again() ), 0, MNU_DONE_ID ); mnuButton->insertItem( i18n("Rename Processed Files &Again..."), this, TQT_SLOT( again() ), 0, MNU_DONE_ID );
mnuButton->insertItem( i18n("Rename Unprocessed Files &Again..."), this, SLOT( unAgain() ), 0, MNU_ERROR_ID ); mnuButton->insertItem( i18n("Rename Unprocessed Files &Again..."), this, TQT_SLOT( unAgain() ), 0, MNU_ERROR_ID );
mnuButton->insertItem( i18n("Rename All Files &Again..."), this, SLOT( allAgain() )); mnuButton->insertItem( i18n("Rename All Files &Again..."), this, TQT_SLOT( allAgain() ));
buttonRestart = new KPushButton( this ); buttonRestart = new KPushButton( this );
buttonRestart->setText( i18n( "&Rename More..." ) ); buttonRestart->setText( i18n( "&Rename More..." ) );
buttonRestart->setPopup( mnuButton ); buttonRestart->setPopup( mnuButton );
@ -114,15 +110,15 @@ ProgressDialog::ProgressDialog( QWidget* parent, const char* name, WFlags fl )
ProgressDialogLayout->addWidget( display ); ProgressDialogLayout->addWidget( display );
ProgressDialogLayout->addLayout( Layout1 ); ProgressDialogLayout->addLayout( Layout1 );
connect( buttonClose, SIGNAL(clicked()), this, SLOT(quitAll())); connect( buttonClose, TQT_SIGNAL(clicked()), this, TQT_SLOT(quitAll()));
connect( buttonOpenDest, SIGNAL(clicked()), this, SLOT(openDest())); connect( buttonOpenDest, TQT_SIGNAL(clicked()), this, TQT_SLOT(openDest()));
connect( buttonCancel, SIGNAL( clicked()), this, SLOT(canceled() )); connect( buttonCancel, TQT_SIGNAL( clicked()), this, TQT_SLOT(canceled() ));
connect( buttonUndo, SIGNAL( clicked() ), this, SLOT( undo() ) ); connect( buttonUndo, TQT_SIGNAL( clicked() ), this, TQT_SLOT( undo() ) );
m_count = 0; m_count = 0;
m_canceled = false; m_canceled = false;
m_timer = new QTimer( this, "m_timer" ); m_timer = new TQTimer( this, "m_timer" );
connect( m_timer, SIGNAL( timeout() ), this, SLOT( slotTimer() ) ); connect( m_timer, TQT_SIGNAL( timeout() ), this, TQT_SLOT( slotTimer() ) );
hide(); hide();
} }
@ -135,11 +131,11 @@ ProgressDialog::~ProgressDialog()
delete [] renamedFiles; delete [] renamedFiles;
} }
void ProgressDialog::print( QString text, QString pixmap ) void ProgressDialog::print( TQString text, TQString pixmap )
{ {
if( !m_timer->isActive() ) if( !m_timer->isActive() )
{ {
KApplication::setOverrideCursor( Qt::waitCursor ); KApplication::setOverrideCursor( TQt::waitCursor );
m_timer->start( TIMER_INTERVAL ); m_timer->start( TIMER_INTERVAL );
} }
@ -152,29 +148,29 @@ void ProgressDialog::print( QString text, QString pixmap )
display->insertItem( item ); display->insertItem( item );
} }
void ProgressDialog::error( QString text ) void ProgressDialog::error( TQString text )
{ {
if( !m_timer->isActive() ) if( !m_timer->isActive() )
{ {
KApplication::setOverrideCursor( Qt::waitCursor ); KApplication::setOverrideCursor( TQt::waitCursor );
m_timer->start( TIMER_INTERVAL ); m_timer->start( TIMER_INTERVAL );
} }
//TODO: simplify this (breaks i18n) //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") ); item->setPixmap( 0, SmallIcon("cancel") );
display->insertItem( item ); display->insertItem( item );
} }
void ProgressDialog::warning( QString text ) void ProgressDialog::warning( TQString text )
{ {
if( !m_timer->isActive() ) if( !m_timer->isActive() )
{ {
KApplication::setOverrideCursor( Qt::waitCursor ); KApplication::setOverrideCursor( TQt::waitCursor );
m_timer->start( TIMER_INTERVAL ); 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") ); item->setPixmap( 0, SmallIcon("idea") );
display->insertItem( item ); display->insertItem( item );
} }
@ -211,7 +207,7 @@ void ProgressDialog::done( int errors, int successfull, bool allowundo )
void ProgressDialog::show() void ProgressDialog::show()
{ {
QWidget::show(); TQWidget::show();
int w = kapp->desktop()->width(); int w = kapp->desktop()->width();
int h = kapp->desktop()->height(); int h = kapp->desktop()->height();
@ -220,7 +216,7 @@ void ProgressDialog::show()
void ProgressDialog::restart() 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(); krename->show();
close(); close();
} }
@ -232,7 +228,7 @@ void ProgressDialog::again()
if( !renamedFiles[i].error ) if( !renamedFiles[i].error )
list.append( renamedFiles[i].dst ); 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(); krename->show();
close(); close();
} }
@ -244,7 +240,7 @@ void ProgressDialog::unAgain()
if( renamedFiles[i].error ) if( renamedFiles[i].error )
list.append( renamedFiles[i].src ); 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(); krename->show();
close(); close();
} }
@ -255,7 +251,7 @@ void ProgressDialog::allAgain()
for( unsigned int i = 0; i < m_size; i++ ) for( unsigned int i = 0; i < m_size; i++ )
list.append( renamedFiles[i].error ? renamedFiles[i].src : renamedFiles[i].dst ); 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(); krename->show();
close(); close();
} }
@ -265,9 +261,9 @@ void ProgressDialog::openDest()
new KRun( m_dest ); new KRun( m_dest );
} }
QString ProgressDialog::count() TQString ProgressDialog::count()
{ {
QString s; TQString s;
return s.sprintf( "%0*i", 7, ++m_count ); return s.sprintf( "%0*i", 7, ++m_count );
} }
@ -290,15 +286,11 @@ void ProgressDialog::canceled()
m_canceled = true; m_canceled = true;
} }
const QString ProgressDialog::simplify( const QString & text ) const TQString ProgressDialog::simplify( const TQString & text )
{ {
// make error messages fit in one line! // make error messages fit in one line!
QString t( text ); TQString t( text );
#if QT_VERSION >= 0x030100
t.remove( '\n' ); t.remove( '\n' );
#else
t.replace( QRegExp("\n"), "" );
#endif
return t; return t;
} }
@ -309,7 +301,7 @@ void ProgressDialog::undo()
FileOperation fop; FileOperation fop;
m_timer->start( TIMER_INTERVAL ); m_timer->start( TIMER_INTERVAL );
KApplication::setOverrideCursor( Qt::waitCursor ); KApplication::setOverrideCursor( TQt::waitCursor );
for( unsigned int i = 0; i < m_size; i++ ) for( unsigned int i = 0; i < m_size; i++ )
{ {
setProgress( i ); setProgress( i );
@ -319,11 +311,11 @@ void ProgressDialog::undo()
if( renamedFiles[i].dir ) { if( renamedFiles[i].dir ) {
/** handle renamed directories and their contents /** handle renamed directories and their contents
*/ */
QString ddir = renamedFiles[i].dst.path(); TQString ddir = renamedFiles[i].dst.path();
QString sdir = renamedFiles[i].src.path(); TQString sdir = renamedFiles[i].src.path();
for( unsigned int c = i+1; c < m_size; c++ ) { for( unsigned int c = i+1; c < m_size; c++ ) {
QString dpath = renamedFiles[c].dst.path(); TQString dpath = renamedFiles[c].dst.path();
QString spath = renamedFiles[c].src.path(); TQString spath = renamedFiles[c].src.path();
if( spath.startsWith( ddir ) ) if( spath.startsWith( ddir ) )
{ {
@ -349,7 +341,7 @@ void ProgressDialog::undo()
m_timer->stop(); m_timer->stop();
KApplication::restoreOverrideCursor(); KApplication::restoreOverrideCursor();
QWidget* krename = KRenameImpl::launch( QRect( 0, 0, 0, 0 ), list ); TQWidget* krename = KRenameImpl::launch( TQRect( 0, 0, 0, 0 ), list );
krename->show(); krename->show();
close(); close();
} }

@ -18,7 +18,7 @@
#ifndef PROGRESSDIALOG_H #ifndef PROGRESSDIALOG_H
#define PROGRESSDIALOG_H #define PROGRESSDIALOG_H
#include <qwidget.h> #include <tqwidget.h>
#include <kurl.h> #include <kurl.h>
typedef struct RenamedList typedef struct RenamedList
@ -34,18 +34,19 @@ class KRenameImpl;
class KListView; class KListView;
class KPopupMenu; class KPopupMenu;
class KPushButton; class KPushButton;
class QProgressBar; class TQProgressBar;
class QStringList; class TQStringList;
class QStrList; class TQStrList;
class QString; class TQString;
class QTimer; class TQTimer;
class QHBoxLayout; class TQHBoxLayout;
class QVBoxLayout; class TQVBoxLayout;
class ProgressDialog : public QWidget class ProgressDialog : public TQWidget
{ {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
ProgressDialog( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); ProgressDialog( TQWidget* tqparent = 0, const char* name = 0, WFlags fl = 0 );
~ProgressDialog(); ~ProgressDialog();
void setProgressTotalSteps( int t ); void setProgressTotalSteps( int t );
@ -57,9 +58,9 @@ class ProgressDialog : public QWidget
inline void setCreatedDirectories( const KURL::List & list ); inline void setCreatedDirectories( const KURL::List & list );
void done( int errors, int successfull, bool allowundo ); void done( int errors, int successfull, bool allowundo );
void print( QString text, QString pixmap = 0 ); void print( TQString text, TQString pixmap = 0 );
void error( QString text ); void error( TQString text );
void warning( QString text ); void warning( TQString text );
public slots: public slots:
void show(); void show();
@ -76,8 +77,8 @@ class ProgressDialog : public QWidget
void slotTimer(); void slotTimer();
private: private:
QString count(); TQString count();
const QString simplify( const QString & text ); const TQString simplify( const TQString & text );
protected: protected:
RenamedList* renamedFiles; RenamedList* renamedFiles;
@ -88,7 +89,7 @@ class ProgressDialog : public QWidget
bool m_canceled; bool m_canceled;
KURL::List m_created; KURL::List m_created;
QTimer* m_timer; TQTimer* m_timer;
KListView* display; KListView* display;
KPushButton* buttonClose; KPushButton* buttonClose;
@ -98,10 +99,10 @@ class ProgressDialog : public QWidget
KPushButton* buttonCancel; KPushButton* buttonCancel;
KPopupMenu* mnuButton; KPopupMenu* mnuButton;
QProgressBar* bar; TQProgressBar* bar;
QVBoxLayout* ProgressDialogLayout; TQVBoxLayout* ProgressDialogLayout;
QHBoxLayout* Layout1; TQHBoxLayout* Layout1;
}; };

@ -33,8 +33,8 @@
#include <sys/stat.h> #include <sys/stat.h>
// QT includes // QT includes
#include <qdir.h> #include <tqdir.h>
#include <qregexp.h> #include <tqregexp.h>
// KDE includes // KDE includes
#include <kapplication.h> #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; delete object;
t.start(); t.start();
@ -76,7 +76,7 @@ void BatchRenamer::processFiles( ProgressDialog* p, QObject* object )
if( m_mode == RENAME ) {// final Path = source Path if( m_mode == RENAME ) {// final Path = source Path
m_files[i].dst.directory = m_files[i].src.directory; 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 = m_files[i].src.url;
m_files[i].dst.url.setFileName( QString::null ); m_files[i].dst.url.setFileName( TQString() );
} else { } else {
m_files[i].dst.directory = dirname.path(); m_files[i].dst.directory = dirname.path();
m_files[i].dst.url = dirname; 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 ) if( m_files[c].src.directory.left( m_files[i].src.name.length() + 1 )
== ( m_files[i].src.name + "/" ) ) { == ( 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 ) ); 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 ); 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! * 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 * Krename will have problems with files
* which contain one of the following * which contain one of the following
* unicode characters: 60000, 60001, 60002 * tqunicode characters: 60000, 60001, 60002
* 60003, 60004, 60005, 60006. * 60003, 60004, 60005, 60006.
* *
* This is not a good solution, if you have a * 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; 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 ); TQPtrListIterator<PluginLoader::PluginLibrary> it( plug->libs );
QString ret = text; TQString ret = text;
if( type == TYPE_FINAL_FILE ) if( type == TYPE_FINAL_FILE )
ret = ""; ret = "";
@ -198,10 +198,10 @@ QString BatchRenamer::parsePlugins( int i, const QString& text, int type )
return ret; return ret;
} }
void BatchRenamer::createPreview( QListView* list ) void BatchRenamer::createPreview( TQListView* list )
{ {
KMyListViewItem* item1 = NULL; KMyListViewItem* item1 = NULL;
QString tmp; TQString tmp;
m_counters.clear(); m_counters.clear();
for( unsigned int i = 0; i < m_files.count(); i++) for( unsigned int i = 0; i < m_files.count(); i++)
@ -218,12 +218,12 @@ void BatchRenamer::createPreview( QListView* list )
bool modified = applyManualChanges( i ); 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, // Let's run the plugins that change the final filename,
// i.e the encodingsplugin // i.e the encodingsplugin
m_files[i].dst.name = parsePlugins( i, m_files[i].dst.name, TYPE_FINAL_FILENAME ); 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 ); item1 = new KMyListViewItem( modified, list, item1, sname, dname );
} }
@ -234,14 +234,14 @@ void BatchRenamer::work( ProgressDialog* p )
// TODO: use CopyJob here // TODO: use CopyJob here
FileOperation fop; FileOperation fop;
QFile* fundo ( NULL ); TQFile* fundo ( NULL );
QTextStream* tundo ( NULL ); TQTextStream* tundo ( NULL );
if( undo ) { if( undo ) {
// Create header for undo script // Create header for undo script
fundo = new QFile( m_undoScript ); fundo = new TQFile( m_undoScript );
if( fundo->open( IO_WriteOnly ) ) { if( fundo->open( IO_WriteOnly ) ) {
tundo = new QTextStream( fundo ); tundo = new TQTextStream( fundo );
writeUndoScript( tundo ); writeUndoScript( tundo );
} else { } else {
undo = false; undo = false;
@ -258,11 +258,11 @@ void BatchRenamer::work( ProgressDialog* p )
* Give the user some information... * Give the user some information...
*/ */
if( m_mode == COPY) 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 ) 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 ) 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 ) else if( m_mode == RENAME )
p->print( i18n("Input files will be renamed.") ); 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! * 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() ) { if( !eplug.isEmpty() ) {
p->error( eplug ); p->error( eplug );
error++; error++;
@ -317,25 +317,25 @@ void BatchRenamer::work( ProgressDialog* p )
(*tundo) << "mv --force -b --suffix=.krename_ \"" << m_files[i].dst.name (*tundo) << "mv --force -b --suffix=.krename_ \"" << m_files[i].dst.name
<< "\" \"" << m_files[i].src.name << "\"" << endl; << "\" \"" << m_files[i].src.name << "\"" << endl;
} else } 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() ) { if( !p->wasCancelled() ) {
QPtrListIterator<PluginLoader::PluginLibrary> it( plug->libs ); TQPtrListIterator<PluginLoader::PluginLibrary> it( plug->libs );
for( ; it.current(); ++it ) { for( ; it.current(); ++it ) {
if( (*it)->usePlugin ) if( (*it)->usePlugin )
(*it)->plugin->finished(); (*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 ); ( i - error ) ? p->print( m ) : p->warning( m );
if( error > 0 ) 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("KRename finished the renaming process."), "krename" );
p->print( i18n("Press close to quit!") ); p->print( i18n("Press close to quit!") );
p->setRenamedFiles( renamedFiles, m_files.count() ); p->setRenamedFiles( renamedFiles, m_files.count() );
@ -356,105 +356,81 @@ void BatchRenamer::work( ProgressDialog* p )
delete this; delete this;
} }
void BatchRenamer::escape( QString & text, const QString & token, const QString & sequence ) void BatchRenamer::escape( TQString & text, const TQString & token, const TQString & sequence )
{ {
/* text.tqreplace( token, 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
} }
QString & BatchRenamer::doEscape( QString & text, bool filename ) TQString & BatchRenamer::doEscape( TQString text, bool filename )
{ {
if( filename ) { if( filename ) {
BatchRenamer::escape( text, "&", QChar( 60000 ) ); BatchRenamer::escape( text, "&", TQChar( 60000 ) );
BatchRenamer::escape( text, "$", QChar( 60001 ) ); BatchRenamer::escape( text, "$", TQChar( 60001 ) );
BatchRenamer::escape( text, "%", QChar( 60002 ) ); BatchRenamer::escape( text, "%", TQChar( 60002 ) );
BatchRenamer::escape( text, "#", QChar( 60004 ) ); BatchRenamer::escape( text, "#", TQChar( 60004 ) );
BatchRenamer::escape( text, "[", QChar( 60005 ) ); BatchRenamer::escape( text, "[", TQChar( 60005 ) );
BatchRenamer::escape( text, "]", QChar( 60006 ) ); BatchRenamer::escape( text, "]", TQChar( 60006 ) );
BatchRenamer::escape( text, "\\", QChar( 60007 ) ); BatchRenamer::escape( text, "\\", TQChar( 60007 ) );
BatchRenamer::escape( text, "/", QChar( 60008 ) ); BatchRenamer::escape( text, "/", TQChar( 60008 ) );
BatchRenamer::escape( text, "{", QChar( 60009 ) ); BatchRenamer::escape( text, "{", TQChar( 60009 ) );
BatchRenamer::escape( text, "}", QChar( 60010 ) ); BatchRenamer::escape( text, "}", TQChar( 60010 ) );
BatchRenamer::escape( text, "*", QChar( 60011 ) ); BatchRenamer::escape( text, "*", TQChar( 60011 ) );
} else { } else {
BatchRenamer::escape( text, "\\&", QChar( 60000 ) ); BatchRenamer::escape( text, "\\&", TQChar( 60000 ) );
BatchRenamer::escape( text, "\\$", QChar( 60001 ) ); BatchRenamer::escape( text, "\\$", TQChar( 60001 ) );
BatchRenamer::escape( text, "\\%", QChar( 60002 ) ); BatchRenamer::escape( text, "\\%", TQChar( 60002 ) );
BatchRenamer::escape( text, "\\#", QChar( 60004 ) ); BatchRenamer::escape( text, "\\#", TQChar( 60004 ) );
BatchRenamer::escape( text, "\\[", QChar( 60005 ) ); BatchRenamer::escape( text, "\\[", TQChar( 60005 ) );
BatchRenamer::escape( text, "\\]", QChar( 60006 ) ); BatchRenamer::escape( text, "\\]", TQChar( 60006 ) );
BatchRenamer::escape( text, "\\\\", QChar( 60007 ) ); BatchRenamer::escape( text, "\\\\", TQChar( 60007 ) );
BatchRenamer::escape( text, "\\/", QChar( 60008 ) ); BatchRenamer::escape( text, "\\/", TQChar( 60008 ) );
BatchRenamer::escape( text, "\\{", QChar( 60009 ) ); BatchRenamer::escape( text, "\\{", TQChar( 60009 ) );
BatchRenamer::escape( text, "\\}", QChar( 60010 ) ); BatchRenamer::escape( text, "\\}", TQChar( 60010 ) );
BatchRenamer::escape( text, "\\*", QChar( 60011 ) ); BatchRenamer::escape( text, "\\*", TQChar( 60011 ) );
} }
return text; return text;
} }
QString & BatchRenamer::unEscape( QString & text ) TQString & BatchRenamer::unEscape( TQString & text )
{ {
BatchRenamer::escape( text, QChar( 60000 ), "&" ); BatchRenamer::escape( text, TQChar( 60000 ), "&" );
BatchRenamer::escape( text, QChar( 60001 ), "$" ); BatchRenamer::escape( text, TQChar( 60001 ), "$" );
BatchRenamer::escape( text, QChar( 60002 ), "%" ); BatchRenamer::escape( text, TQChar( 60002 ), "%" );
BatchRenamer::escape( text, QChar( 60004 ), "#" ); BatchRenamer::escape( text, TQChar( 60004 ), "#" );
BatchRenamer::escape( text, QChar( 60005 ), "[" ); BatchRenamer::escape( text, TQChar( 60005 ), "[" );
BatchRenamer::escape( text, QChar( 60006 ), "]" ); BatchRenamer::escape( text, TQChar( 60006 ), "]" );
BatchRenamer::escape( text, QChar( 60007 ), "\\" ); BatchRenamer::escape( text, TQChar( 60007 ), "\\" );
// %252f == /, it seems that filenames on unix cannot contain // %252f == /, it seems that filenames on unix cannot contain
// a /. So I use %252f, at least konqui displays it correctly // 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 // this was needed, so that plugins that return a slash do not cause errors
BatchRenamer::escape( text, QChar( 60008 ), "%2f" ); BatchRenamer::escape( text, TQChar( 60008 ), "%2f" );
BatchRenamer::escape( text, QChar( 60009 ), "{" ); BatchRenamer::escape( text, TQChar( 60009 ), "{" );
BatchRenamer::escape( text, QChar( 60010 ), "}" ); BatchRenamer::escape( text, TQChar( 60010 ), "}" );
BatchRenamer::escape( text, QChar( 60011 ), "*" ); BatchRenamer::escape( text, TQChar( 60011 ), "*" );
return text; return text;
} }
int BatchRenamer::getCharacters( int n ) int BatchRenamer::getCharacters( int n )
{ {
QString s; TQString s;
s.sprintf( "%i", n ); s.sprintf( "%i", n );
return s.length(); 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 * pos can here be -1 because
* findRev is called with it as a * tqfindRev is called with it as a
* value ! * value !
*/ */
#if QT_VERSION >= 0x030100 text.tqreplace( token, tqreplace );
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
return text; 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 // Rewritten in Version 0.8
// Added numbers skipping in 1.3 // Added numbers skipping in 1.3
@ -464,10 +440,10 @@ QString BatchRenamer::findNumbers( QString text, int count, int i )
countervalues.start = m_index; countervalues.start = m_index;
countervalues.step = m_step; countervalues.step = m_step;
if( text.contains( "#", FALSE ) <= 0 ) if( text.tqcontains( "#", FALSE ) <= 0 )
return text; return text;
pos = text.find("#", pos); pos = text.tqfind("#", pos);
pos++; pos++;
while( text[pos] == '#' ) { while( text[pos] == '#' ) {
text.remove(pos, 1); text.remove(pos, 1);
@ -476,7 +452,7 @@ QString BatchRenamer::findNumbers( QString text, int count, int i )
findNumberAppendix( text, pos, &countervalues.start, &countervalues.step ); findNumberAppendix( text, pos, &countervalues.start, &countervalues.step );
pos = text.find("#", 0); pos = text.tqfind("#", 0);
if( (signed int)m_counters.count() <= m_counter_index ) if( (signed int)m_counters.count() <= m_counter_index )
{ {
@ -488,7 +464,7 @@ QString BatchRenamer::findNumbers( QString text, int count, int i )
do { do {
m_counters[m_counter_index].value += m_counters[m_counter_index].step; 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]; 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 ); temp.sprintf("%0*i", counter, m_counters[m_counter_index].value );
text.replace( pos, 1, temp); text.tqreplace( pos, 1, temp);
++m_counter_index; ++m_counter_index;
return findNumbers( text, count, i ); 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 tmp = 0;
int end = 0; int end = 0;
bool ok = false; bool ok = false;
if( text[pos] == '{' && (end = text.find( "}", pos )) > -1) if( text[pos] == '{' && (end = text.tqfind( "}", pos )) > -1)
{ {
//qDebug("Found an appendix:" + appendix ); //qDebug("Found an appendix:" + appendix );
appendix = text.mid( pos + 1, end - pos - 1); 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; int pos = -1;
do { do {
pos = text.findRev("*", pos); pos = text.tqfindRev("*", pos);
if( pos >= 0 ) { if( pos >= 0 ) {
QString tmp = oldname.lower(); TQString tmp = oldname.lower();
if( tmp[0].isLetter() ) if( tmp[0].isLetter() )
tmp[0] = tmp[0].upper(); 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] != '\'' && tmp[i] != '?' && tmp[i] != '`' )
tmp[i+1] = tmp[i+1].upper(); tmp[i+1] = tmp[i+1].upper();
text.replace( pos, 1, tmp); text.tqreplace( pos, 1, tmp);
} }
} while( pos >= 0 ); } while( pos >= 0 );
return text; 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 [ ] * looks for a statement in brackets [ ]
@ -560,17 +536,17 @@ QString BatchRenamer::findBrackets( QString oldname, QString text, int i )
*/ */
int num, pos = -1, a; 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; return text;
num = text.contains("[", FALSE); num = text.tqcontains("[", FALSE);
if(num <= 0 ) if(num <= 0 )
return text; return text;
pos = text.findRev("[", pos); pos = text.tqfindRev("[", pos);
a = text.find("]", pos ); a = text.tqfind("]", pos );
if( a < 0 && pos >= 0 ) if( a < 0 && pos >= 0 )
return text; return text;
@ -589,9 +565,9 @@ QString BatchRenamer::findBrackets( QString oldname, QString text, int i )
return findBrackets( oldname, text, 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 * Call here all functions that handle
@ -625,10 +601,10 @@ QString BatchRenamer::processToken( QString token, QString oldname, int i )
* Krename simply ignores unknown tokens! * Krename simply ignores unknown tokens!
* Usefull for the MP3 Plugin! * 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 }; enum conversion { LOWER, UPPER, MIXED, STAR, STRIP, NONE, EMPTY, NUMBER };
unsigned int numwidth = 0; unsigned int numwidth = 0;
@ -658,7 +634,7 @@ QString BatchRenamer::findToken( QString oldname, QString token, int i )
if( c != EMPTY && c != NUMBER ) if( c != EMPTY && c != NUMBER )
token.remove( 0, 1 ); token.remove( 0, 1 );
QString save = token; TQString save = token;
token = processToken( token, oldname, i ); token = processToken( token, oldname, i );
switch( c ) { switch( c ) {
@ -670,7 +646,7 @@ QString BatchRenamer::findToken( QString oldname, QString token, int i )
break; break;
case MIXED: case MIXED:
token = token.lower(); token = token.lower();
token.replace( 0, 1, token[0].upper()); token.tqreplace( 0, 1, token[0].upper());
break; break;
case STAR: case STAR:
token = findStar( token, "*" ); token = findStar( token, "*" );
@ -694,20 +670,20 @@ QString BatchRenamer::findToken( QString oldname, QString token, int i )
return token; 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; int pos = -1;
// parse things like [2;4{[dirname]}] // parse things like [2;4{[dirname]}]
if( token.contains( "{" ) >= 1 && token.contains( "}" ) >= 1 ) { if( token.tqcontains( "{" ) >= 1 && token.tqcontains( "}" ) >= 1 ) {
int pos = token.find( "{" ); int pos = token.tqfind( "{" );
oldname = token.mid( pos + 1, token.findRev( "}" ) - pos - 1 ); oldname = token.mid( pos + 1, token.tqfindRev( "}" ) - pos - 1 );
token = token.left( pos ); token = token.left( pos );
} }
if( token.contains("-") ) { if( token.tqcontains("-") ) {
pos = token.find( "-", 0 ); pos = token.tqfind( "-", 0 );
first = token.left( pos ); first = token.left( pos );
// ------- Code OK ^ ! // ------- Code OK ^ !
@ -741,8 +717,8 @@ QString BatchRenamer::findPartStrings( QString oldname, QString token )
x++; x++;
return oldname.mid( first.toInt()-1, x ); return oldname.mid( first.toInt()-1, x );
} else if( token.contains(";") ) { } else if( token.tqcontains(";") ) {
pos = token.find( ";", 0 ); pos = token.tqfind( ";", 0 );
first = token.left( pos ); first = token.left( pos );
second = token.mid( pos+1, token.length() ); second = token.mid( pos+1, token.length() );
@ -753,13 +729,13 @@ QString BatchRenamer::findPartStrings( QString oldname, QString token )
int number = token.toInt( &ok ); int number = token.toInt( &ok );
if( ok && (number <= (signed int)oldname.length() && number > 0 ) ) if( ok && (number <= (signed int)oldname.length() && number > 0 ) )
return QString(oldname[ number -1 ]); return TQString(oldname[ number -1 ]);
else 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( token.left( 7 ).lower() == "dirname" ) {
if( path.right( 1 ) == "/" ) if( path.right( 1 ) == "/" )
@ -768,9 +744,9 @@ QString BatchRenamer::findDirName( QString token, QString path )
int recursion = 1; int recursion = 1;
if( token.length() > 7 ) { if( token.length() > 7 ) {
token = token.right( token.length() - 7 ); token = token.right( token.length() - 7 );
recursion = token.contains( "." ); recursion = token.tqcontains( "." );
if( recursion != (signed int)token.length() ) if( recursion != (signed int)token.length() )
return QString::null; return TQString();
recursion++; recursion++;
} }
@ -778,10 +754,10 @@ QString BatchRenamer::findDirName( QString token, QString path )
return path.section( "/", recursion * -1, recursion * -1); 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" ) ) { if( token.lower().startsWith( "length" ) ) {
int minus = 0; int minus = 0;
@ -792,67 +768,41 @@ QString BatchRenamer::findLength( const QString & token, const QString & name )
minus = 0; 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 // Call for each element in replace strings doReplace with correct values
for( unsigned int i = 0; i < m_replace.count(); i++ ) { for( unsigned int i = 0; i < m_tqreplace.count(); i++ ) {
replacestrings s = m_replace[i]; replacestrings s = m_tqreplace[i];
text = doReplace( text, unEscape( s.find ), s.replace, s.reg ); text = doReplace( text, unEscape( s.tqfind ), s.tqreplace, s.reg );
} }
return text; 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( !reg )
{ {
#if QT_VERSION >= 0x030100
// we use the escaped text here because the user might want // we use the escaped text here because the user might want
// to find a "&" and replace it // to find a "&" and replace it
text.replace( doEscape( find ), replace ); text.tqreplace( doEscape( tqfind ), tqreplace );
#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
} }
else else
{ {
#if QT_VERSION >= 0x030100
// no doEscape() here for the regexp, because it would destroy our regular expression // no doEscape() here for the regexp, because it would destroy our regular expression
// other wise we will not find stuff like $, [ in the text // other wise we will not find stuff like $, [ in the text
text = doEscape( unEscape( text ).replace( QRegExp( find ), replace ) ); text = doEscape( unEscape( text ).tqreplace( TQRegExp( tqfind ), tqreplace ) );
#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
} }
return text; return text;
} }
void BatchRenamer::writeUndoScript( QTextStream* t ) void BatchRenamer::writeUndoScript( TQTextStream* t )
{ {
// write header comments // write header comments
(*t) << "#!/bin/bash" << endl (*t) << "#!/bin/bash" << endl
@ -882,15 +832,15 @@ void BatchRenamer::writeUndoScript( QTextStream* t )
void BatchRenamer::parseSubdirs( data* f ) void BatchRenamer::parseSubdirs( data* f )
{ {
int pos = 0; int pos = 0;
if( (pos = f->dst.name.findRev( "/", -1 ) ) > 0 ) { if( (pos = f->dst.name.tqfindRev( "/", -1 ) ) > 0 ) {
QString dirs = f->dst.name.left( pos ); TQString dirs = f->dst.name.left( pos );
f->dst.name = f->dst.name.right( f->dst.name.length() - pos - 1 ); f->dst.name = f->dst.name.right( f->dst.name.length() - pos - 1 );
f->dst.directory += ( f->dst.directory.right( 1 ) == "/" ) ? "" : "/"; f->dst.directory += ( f->dst.directory.right( 1 ) == "/" ) ? "" : "/";
// create the missing subdir now // create the missing subdir now
int i = 0; int i = 0;
QString d = ""; TQString d = "";
while( (d = dirs.section( "/", i, i, QString::SectionSkipEmpty )) && ! d.isEmpty() ) { // asignment here! while( (d = dirs.section( "/", i, i, TQString::SectionSkipEmpty )) && ! d.isEmpty() ) { // asignment here!
KURL url = f->dst.url; KURL url = f->dst.url;
// it is important to unescape here // it is important to unescape here
// to support dirnames containing "&" or // 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 here as filename is still escaped
unEscape( filename ); unEscape( filename );
return filename; return filename;
@ -929,7 +879,7 @@ bool BatchRenamer::applyManualChanges( int i )
m_files[i].dst.name = m_changes[z].user; m_files[i].dst.name = m_changes[z].user;
// the file extension is already included // the file extension is already included
// in the users name // in the users name
m_files[i].dst.extension = QString::null; m_files[i].dst.extension = TQString();
return true; return true;
} }
} }

@ -18,13 +18,13 @@
#ifndef BATCHRENAMER_H #ifndef BATCHRENAMER_H
#define BATCHRENAMER_H #define BATCHRENAMER_H
#include <qdatetime.h> #include <tqdatetime.h>
#include <qvaluelist.h> #include <tqvaluelist.h>
#include <kurl.h> #include <kurl.h>
class QFile; class TQFile;
class QProgressDialog; class TQProgressDialog;
class QString; class TQString;
/* How many diferrent users and groups /* How many diferrent users and groups
* KRename supports. Values over 1000 * KRename supports. Values over 1000
@ -45,9 +45,9 @@ enum {
}; };
typedef struct fileentry { typedef struct fileentry {
QString name; // filename TQString name; // filename
QString directory; // directory TQString directory; // directory
QString extension; // extension TQString extension; // extension
KURL url; KURL url;
}; };
@ -66,12 +66,12 @@ typedef struct data {
*/ */
typedef struct manualchanges { typedef struct manualchanges {
KURL url; // input filename KURL url; // input filename
QString user; // name the user wants TQString user; // name the user wants
}; };
typedef struct replacestrings { typedef struct replacestrings {
QString find; // Text to replace TQString tqfind; // Text to tqreplace
QString replace; // Replace with TQString tqreplace; // Replace with
bool reg; // is it a reg expression ? bool reg; // is it a reg expression ?
}; };
@ -85,57 +85,57 @@ typedef struct tCounterValues {
*@author Dominik Seichter *@author Dominik Seichter
*/ */
class QObject; class TQObject;
class QListView; class TQListView;
class ProgressDialog; class ProgressDialog;
class PluginLoader; class PluginLoader;
class BatchRenamer { class BatchRenamer {
public: public:
BatchRenamer(); BatchRenamer();
~BatchRenamer(); ~BatchRenamer();
void processFiles( ProgressDialog* p, QObject* object ); void processFiles( ProgressDialog* p, TQObject* object );
void createPreview( QListView* list ); void createPreview( TQListView* list );
inline void setText( const QString & t ) { text = t; doEscape( text, false ); } inline void setText( const TQString & t ) { text = t; doEscape( text, false ); }
inline void setExText( const QString & t ) { extext = t; } inline void setExText( const TQString & t ) { extext = t; }
inline void setDirname( const KURL & url ) { dirname = url; } 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 setUndo( bool b ) { undo = b; }
inline void setOverwrite( bool b ) { overwrite = b; } inline void setOverwrite( bool b ) { overwrite = b; }
inline void setIndex( int i ) { m_index = i; } inline void setIndex( int i ) { m_index = i; }
inline void setStep( int s ) { m_step = s; } inline void setStep( int s ) { m_step = s; }
inline void setResetCounter( bool r ) { m_reset = r; } inline void setResetCounter( bool r ) { m_reset = r; }
inline void setSkipList( const QValueList<int> & s ) { m_skip = s; } inline void setSkipList( const TQValueList<int> & s ) { m_skip = s; }
inline void setReplaceList( const QValueList<replacestrings> & r ) { m_replace = r; } 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 void setFiles( const TQValueList<data> & f ) { m_files = f; } //TODO: use a pointer for more speed
inline QValueList<data> files() const { return m_files; } inline TQValueList<data> files() const { return m_files; }
inline void setChanges( const QValueList<manualchanges> & m ) { m_changes = m; } inline void setChanges( const TQValueList<manualchanges> & m ) { m_changes = m; }
inline void setMode( int m) { m_mode = m; } inline void setMode( int m) { m_mode = m; }
inline int mode() const { return m_mode; } inline int mode() const { return m_mode; }
// Since 2.1 public, because plugins may want to access them to: // Since 2.1 public, because plugins may want to access them to:
QString findAndProcess( const QString & token, QString text, const QString & replace ); TQString findAndProcess( const TQString & token, TQString text, const TQString & tqreplace );
QString findNumbers( QString text, int count, int i ); TQString findNumbers( TQString text, int count, int i );
QString findStar( const QString & oldname, QString text ); TQString findStar( const TQString & oldname, TQString text );
QString findBrackets( QString oldname, QString text, int i ); TQString findBrackets( TQString oldname, TQString text, int i );
QString findToken( QString oldname, QString token, int i ); TQString findToken( TQString oldname, TQString token, int i );
QString processToken( QString token, QString oldname, int i ); TQString processToken( TQString token, TQString oldname, int i );
QString findPartStrings( QString oldname, QString token ); TQString findPartStrings( TQString oldname, TQString token );
static QString findDirName( QString token, QString path ); static TQString findDirName( TQString token, TQString path );
QString findLength( const QString & token, const QString & name ); TQString findLength( const TQString & token, const TQString & name );
QString findReplace( QString text ); // text is here already the new filename ! TQString findReplace( TQString 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 ! TQString doReplace( TQString text, TQString tqfind, TQString tqreplace, bool reg ); // text is here already the new filename !
QString processString( QString text, QString oldname, int i ); TQString processString( TQString text, TQString oldname, int i );
static QString & doEscape( QString & text, bool filename = true ); static TQString & doEscape( TQString text, bool filename = true );
static QString & unEscape( QString & text ); static TQString & unEscape( TQString & text );
static void escape( QString & text, const QString & token, const QString & sequence ); 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: private:
/** /**
@ -147,42 +147,42 @@ class BatchRenamer {
int getCharacters( int n ) ; int getCharacters( int n ) ;
void work( ProgressDialog* p ); void work( ProgressDialog* p );
void writeUndoScript( QTextStream* t ); void writeUndoScript( TQTextStream* t );
void parseSubdirs( data* f ); 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 /** resets all counters to there start value if the directory name at @p i
* in m_files changes. * in m_files changes.
* The caller has to check m_reset before calling this function. * The caller has to check m_reset before calling this function.
*/ */
void findCounterReset( int i ); 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 ); bool applyManualChanges( int i );
QString text; // template TQString text; // template
KURL dirname; // destination dir KURL dirname; // destination dir
QString extext; // Extension template TQString extext; // Extension template
QString m_undoScript; // Filename of undoscript TQString m_undoScript; // Filename of undoscript
bool undo; // create an undo script bool undo; // create an undo script
int m_index; // index for numbers int m_index; // index for numbers
int m_step; // step for numbers int m_step; // step for numbers
bool m_reset; // reset counter on new directories bool m_reset; // reset counter on new directories
bool overwrite; // overwrite existing files bool overwrite; // overwrite existing files
int m_mode; // renaming mode int m_mode; // renaming mode
QValueList<int> m_skip; // Numbers to skip TQValueList<int> m_skip; // Numbers to skip
QValueList<replacestrings> m_replace; // Replace strings TQValueList<replacestrings> m_tqreplace; // Replace strings
QValueList<data> m_files; TQValueList<data> m_files;
QValueList<manualchanges> m_changes; // User made changes TQValueList<manualchanges> m_changes; // User made changes
PluginLoader* plug; PluginLoader* plug;
// a is used in find number and // a is used in find number and
// required for skipping. // required for skipping.
int m_counter_index; int m_counter_index;
QValueList<tCounterValues> m_counters; TQValueList<tCounterValues> m_counters;
protected: protected:
QFile* f; TQFile* f;
QTime t; TQTime t;
QProgressDialog* progress; TQProgressDialog* progress;
}; };
#endif #endif

@ -18,9 +18,9 @@
#include "commandplugin.h" #include "commandplugin.h"
// QT includes // QT includes
#include <qcheckbox.h> #include <tqcheckbox.h>
#include <qlabel.h> #include <tqlabel.h>
#include <qlayout.h> #include <tqlayout.h>
// KDE includes // KDE includes
#include <kapplication.h> #include <kapplication.h>
@ -33,12 +33,12 @@
#include <kpushbutton.h> #include <kpushbutton.h>
#include <kprocess.h> #include <kprocess.h>
const QString CommandPlugin::getName() const const TQString CommandPlugin::getName() const
{ {
return i18n("Command Plugin"); return i18n("Command Plugin");
} }
const QString CommandPlugin::getAccelName() const const TQString CommandPlugin::getAccelName() const
{ {
return i18n("&Command Plugin"); return i18n("&Command Plugin");
} }
@ -58,27 +58,27 @@ bool CommandPlugin::checkError()
return true; return true;
} }
void CommandPlugin::drawInterface( QWidget* w, QVBoxLayout* l ) void CommandPlugin::drawInterface( TQWidget* w, TQVBoxLayout* l )
{ {
m_widget = w; m_widget = w;
QHBoxLayout* hb = new QHBoxLayout( 0, 0, 6 ); TQHBoxLayout* hb = new TQHBoxLayout( 0, 0, 6 );
QVBoxLayout* vb = new QVBoxLayout( 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>") ); la->setText( i18n("<b>Command Plugin</b>") );
l->addWidget( la ); 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. " 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>") ); "Add %1 to the command line arguments to get the filename of the renamed file.</qt>") );
l->addWidget( la ); l->addWidget( la );
l->addWidget( new QLabel( i18n("Command:"), w ) ); l->addWidget( new TQLabel( i18n("Command:"), w ) );
commandline = new KLineEdit( w ); commandline = new KLineEdit( w );
l->addWidget( commandline ); 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 ); l->addWidget( checkNoBlock );
buttonAdd = new KPushButton( i18n("&Add"), w ); buttonAdd = new KPushButton( i18n("&Add"), w );
@ -93,21 +93,21 @@ void CommandPlugin::drawInterface( QWidget* w, QVBoxLayout* l )
vb->setStretchFactor( list, 2 ); vb->setStretchFactor( list, 2 );
l->addLayout( vb ); l->addLayout( vb );
connect( buttonAdd, SIGNAL( clicked() ), this, SLOT( add() ) ); connect( buttonAdd, TQT_SIGNAL( clicked() ), this, TQT_SLOT( add() ) );
connect( buttonRemove, SIGNAL( clicked() ), this, SLOT( remove() ) ); connect( buttonRemove, TQT_SIGNAL( clicked() ), this, TQT_SLOT( remove() ) );
connect( list, SIGNAL( executed( QListBoxItem* ) ), this, SLOT( exec() ) ); connect( list, TQT_SIGNAL( executed( TQListBoxItem* ) ), this, TQT_SLOT( exec() ) );
KConfig* conf = kapp->config(); KConfig* conf = kapp->config();
conf->setGroup("CommandPlugin"); conf->setGroup("CommandPlugin");
list->insertStringList( conf->readListEntry("commandlines" ) ); list->insertStringList( conf->readListEntry("commandlines" ) );
QStringList examples; TQStringList examples;
examples.append( "chmod 0444 %1" ); examples.append( "chmod 0444 %1" );
examples.append( "convert %1 %1.png" ); examples.append( "convert %1 %1.png" );
examples.append( "echo %1 >> $HOME/file.list" ); examples.append( "echo %1 >> $HOME/file.list" );
// examples.append( ") // examples.append( ")
for( unsigned int i = 0; i < examples.count(); i++ ) for( unsigned int i = 0; i < examples.count(); i++ )
if( !list->findItem( examples[i] ) ) if( !list->tqfindItem( examples[i] ) )
list->insertItem( examples[i] ); list->insertItem( examples[i] );
} }
@ -117,24 +117,15 @@ void CommandPlugin::fillStructure()
noblock = checkNoBlock->isChecked(); 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; KShellProcess proc;
#if QT_VERSION >= 0x030100 c = c.tqreplace( "%1", KShellProcess::quote( filename ) );
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
proc << c; proc << c;
@ -146,16 +137,16 @@ QString CommandPlugin::processFile( BatchRenamer* b, int i, QString, int )
proc.resume(); proc.resume();
if( !noblock && proc.exitStatus() ) 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() void CommandPlugin::finished()
{ {
KConfig* conf = kapp->config(); KConfig* conf = kapp->config();
conf->setGroup("CommandPlugin"); conf->setGroup("CommandPlugin");
QStringList slist; TQStringList slist;
for( unsigned int i = 0; i < list->count(); i++ ) for( unsigned int i = 0; i < list->count(); i++ )
slist.append( list->text( i ) ); slist.append( list->text( i ) );
@ -193,7 +184,7 @@ void CommandPlugin::exec()
commandline->setText( list->text( i ) ); commandline->setText( list->text( i ) );
} }
const QPixmap CommandPlugin::getIcon() const const TQPixmap CommandPlugin::getIcon() const
{ {
return kapp->iconLoader()->loadIcon( "konsole", KIcon::Small ); return kapp->iconLoader()->loadIcon( "konsole", KIcon::Small );
} }

@ -23,25 +23,26 @@
#include "plugin.h" #include "plugin.h"
#include "helpdialog.h" #include "helpdialog.h"
class QCheckBox; class TQCheckBox;
class KLineEdit; class KLineEdit;
class KListBox; class KListBox;
class KPushButton; class KPushButton;
class CommandPlugin : public Plugin { class CommandPlugin : public Plugin {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
const QString getName() const; const TQString getName() const;
const QString getAccelName() const; const TQString getAccelName() const;
const int type() const; const int type() const;
bool checkError(); bool checkError();
void drawInterface( QWidget* w, QVBoxLayout* l ); void drawInterface( TQWidget* w, TQVBoxLayout* l );
void fillStructure(); void fillStructure();
QString processFile( BatchRenamer*, int, QString token, int ); TQString processFile( BatchRenamer*, int, TQString token, int );
void finished(); void finished();
bool alwaysUsed() const { return false; } bool alwaysUsed() const { return false; }
const QPixmap getIcon() const; const TQPixmap getIcon() const;
private slots: private slots:
void add(); void add();
@ -50,12 +51,12 @@ class CommandPlugin : public Plugin {
private: private:
KLineEdit* commandline; KLineEdit* commandline;
QCheckBox* checkNoBlock; TQCheckBox* checkNoBlock;
KListBox* list; KListBox* list;
KPushButton* buttonAdd; KPushButton* buttonAdd;
KPushButton* buttonRemove; KPushButton* buttonRemove;
QString command; TQString command;
bool noblock; bool noblock;
}; };

@ -19,25 +19,25 @@
#include "confdialog.h" #include "confdialog.h"
// QT includes // QT includes
#include <qbuttongroup.h> #include <tqbuttongroup.h>
#include <qlabel.h> #include <tqlabel.h>
#include <qlayout.h> #include <tqlayout.h>
#include <qradiobutton.h> #include <tqradiobutton.h>
#include <qtooltip.h> #include <tqtooltip.h>
// KDE includes // KDE includes
#include <kiconloader.h> #include <kiconloader.h>
#include <klocale.h> #include <klocale.h>
ConfDialog::ConfDialog( QWidget* parent, const char* name ) ConfDialog::ConfDialog( TQWidget* tqparent, const char* name )
: KDialogBase( KDialogBase::IconList, "KRename", : 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() GUIModeSelector()
{ {
setupTab1(); setupTab1();
setupTab2(); setupTab2();
connect( this, SIGNAL( defaultClicked() ), this, SLOT( defaults() ) ); connect( this, TQT_SIGNAL( defaultClicked() ), this, TQT_SLOT( defaults() ) );
} }
ConfDialog::~ConfDialog() ConfDialog::~ConfDialog()
@ -46,38 +46,38 @@ ConfDialog::~ConfDialog()
void ConfDialog::setupTab1() void ConfDialog::setupTab1()
{ {
const QString caption = i18n("Look and Feel"); const TQString caption = i18n("Look and Feel");
QFrame* box = addPage( caption, caption, BarIcon("looknfeel") ); TQFrame* box = addPage( caption, caption, BarIcon("looknfeel") );
QVBoxLayout* layout = new QVBoxLayout( box ); TQVBoxLayout* tqlayout = new TQVBoxLayout( box );
QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding ); 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 ); 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)") ); optionWizard->setText( i18n("Use &wizard style GUI (beginners)") );
optionTabs = new QRadioButton( group ); optionTabs = new TQRadioButton( group );
optionTabs->setText( i18n("Use &tabbed GUI (advanced users)") ); 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( optionWizard );
lgroup->addWidget( optionTabs ); lgroup->addWidget( optionTabs );
lgroup->addItem( spacer ); lgroup->addItem( spacer );
layout->addWidget( group ); tqlayout->addWidget( group );
layout->addItem( spacer ); tqlayout->addItem( spacer );
} }
void ConfDialog::setupTab2() void ConfDialog::setupTab2()
{ {
const QString caption = i18n("KRename"); const TQString caption = i18n("KRename");
QFrame* box = addPage( caption, caption, BarIcon("krename") ); TQFrame* box = addPage( caption, caption, BarIcon("krename") );
QVBoxLayout* layout = new QVBoxLayout( box ); TQVBoxLayout* tqlayout = new TQVBoxLayout( box );
QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding ); TQSpacerItem* spacer = new TQSpacerItem( 20, 20, TQSizePolicy::Minimum, TQSizePolicy::Expanding );
checkPlugins = new QCheckBox( i18n("&Load file plugins on start"), box ); checkPlugins = new TQCheckBox( i18n("&Load file plugins on start"), box );
checkAutosize = new QCheckBox( i18n("Auto &resize columns in preview"), box ); checkAutosize = new TQCheckBox( i18n("Auto &resize columns in preview"), box );
spinSize = new KIntNumInput( box ); spinSize = new KIntNumInput( box );
spinSize->setRange( 20, 500, 1, false ); spinSize->setRange( 20, 500, 1, false );
@ -87,14 +87,14 @@ void ConfDialog::setupTab2()
spinHistory->setRange( 2, 500, 1, false ); spinHistory->setRange( 2, 500, 1, false );
spinHistory->setLabel( i18n( "&Number of template history items:" ), AlignLeft | AlignVCenter ); spinHistory->setLabel( i18n( "&Number of template history items:" ), AlignLeft | AlignVCenter );
layout->addWidget( checkPlugins ); tqlayout->addWidget( checkPlugins );
layout->addWidget( checkAutosize ); tqlayout->addWidget( checkAutosize );
layout->addItem( spacer ); tqlayout->addItem( spacer );
layout->addWidget( spinSize ); tqlayout->addWidget( spinSize );
layout->addWidget( spinHistory ); tqlayout->addWidget( spinHistory );
layout->addItem( spacer ); 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() void ConfDialog::defaults()

@ -19,7 +19,7 @@
#define CONFDIALOG_H #define CONFDIALOG_H
// QT includes // QT includes
#include <qcheckbox.h> #include <tqcheckbox.h>
// KDE includes // KDE includes
#include <kdialogbase.h> #include <kdialogbase.h>
@ -27,14 +27,15 @@
#include "guimodeselector.h" #include "guimodeselector.h"
class QHBoxLayout; class TQHBoxLayout;
class QVBoxLayout; class TQVBoxLayout;
class QWidget; class TQWidget;
class KIntNumInput; class KIntNumInput;
class ConfDialog : public KDialogBase, public GUIModeSelector { class ConfDialog : public KDialogBase, public GUIModeSelector {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
ConfDialog( QWidget* parent = 0, const char* name = 0 ); ConfDialog( TQWidget* tqparent = 0, const char* name = 0 );
~ConfDialog(); ~ConfDialog();
inline bool loadplugins() const { return checkPlugins->isChecked(); } inline bool loadplugins() const { return checkPlugins->isChecked(); }
@ -55,9 +56,9 @@ class ConfDialog : public KDialogBase, public GUIModeSelector {
void setupTab2(); void setupTab2();
protected: protected:
QCheckBox* checkAsk; TQCheckBox* checkAsk;
QCheckBox* checkPlugins; TQCheckBox* checkPlugins;
QCheckBox* checkAutosize; TQCheckBox* checkAutosize;
KIntNumInput* spinSize; KIntNumInput* spinSize;
KIntNumInput* spinHistory; KIntNumInput* spinHistory;

@ -17,29 +17,29 @@
#include "coorddialog.h" #include "coorddialog.h"
// Qt includes // TQt includes
#include <qcheckbox.h> #include <tqcheckbox.h>
#include <qfontmetrics.h> #include <tqfontmetrics.h>
#include <qlabel.h> #include <tqlabel.h>
#include <qlayout.h> #include <tqlayout.h>
#include <qvalidator.h> #include <tqvalidator.h>
// KDE includes // KDE includes
#include <kapplication.h> #include <kapplication.h>
#include <klocale.h> #include <klocale.h>
DSLineEdit::DSLineEdit( QWidget* parent, const char* name ) DSLineEdit::DSLineEdit( TQWidget* tqparent, const char* name )
: KLineEdit( parent, name ) : KLineEdit( tqparent, name )
{ {
} }
void DSLineEdit::keyPressEvent( QKeyEvent* e ) void DSLineEdit::keyPressEvent( TQKeyEvent* e )
{ {
KLineEdit::keyPressEvent( e ); KLineEdit::keyPressEvent( e );
emit changed(); emit changed();
} }
void DSLineEdit::mousePressEvent( QMouseEvent* e ) void DSLineEdit::mousePressEvent( TQMouseEvent* e )
{ {
KLineEdit::mousePressEvent( e ); KLineEdit::mousePressEvent( e );
emit changed(); emit changed();
@ -47,36 +47,36 @@ void DSLineEdit::mousePressEvent( QMouseEvent* e )
bool CoordDialog::m_inversion = false; 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( KDialogBase::Plain, "KRename",
KDialogBase::Ok | KDialogBase::Cancel, KDialogBase::Ok, _parent, name, true, true ), m_file( file ) KDialogBase::Ok | KDialogBase::Cancel, KDialogBase::Ok, _parent, name, true, true ), m_file( file )
{ {
QFrame* parent = plainPage(); TQFrame* tqparent = plainPage();
QVBoxLayout* layout = new QVBoxLayout( parent ); TQVBoxLayout* tqlayout = new TQVBoxLayout( tqparent );
filename = new DSLineEdit( parent ); filename = new DSLineEdit( tqparent );
filename->setText( file ); 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 ); checkInvert->setChecked( m_inversion );
layout->addWidget( new QLabel( i18n("Please select the text you want to insert:"), plainPage() ) ); tqlayout->addWidget( new TQLabel( i18n("Please select the text you want to insert:"), plainPage() ) );
layout->addWidget( filename ); tqlayout->addWidget( filename );
layout->addWidget( checkInvert ); tqlayout->addWidget( checkInvert );
layout->addWidget( preview ); tqlayout->addWidget( preview );
updateCommand(); updateCommand();
connect( filename, SIGNAL( selectionChanged() ), this, SLOT( updateCommand() ) ); connect( filename, TQT_SIGNAL( selectionChanged() ), this, TQT_SLOT( updateCommand() ) );
connect( checkInvert, SIGNAL( clicked() ), this, SLOT( updateCommand() ) ); connect( checkInvert, TQT_SIGNAL( clicked() ), this, TQT_SLOT( updateCommand() ) );
connect( filename, SIGNAL( textChanged( const QString & ) ), this, SLOT( resetText() ) ); connect( filename, TQT_SIGNAL( textChanged( const TQString & ) ), this, TQT_SLOT( resetText() ) );
connect( filename, SIGNAL( changed() ), this, SLOT( updateCommand() ) ); connect( filename, TQT_SIGNAL( changed() ), this, TQT_SLOT( updateCommand() ) );
show(); show();
QFontMetrics fm( filename->font() ); TQFontMetrics fm( filename->font() );
int w = fm.width( file ); int w = fm.width( file );
if( w > width() ) if( w > width() )
resize( resize(
@ -102,26 +102,26 @@ void CoordDialog::updateCommand()
start++; start++;
end++; end++;
if( start > 1 ) 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() ) 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() ) { } else if( checkInvert->isChecked() && !filename->hasSelectedText() ) {
int p = filename->cursorPosition(); 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() ){ } else if( !checkInvert->isChecked() && filename->hasSelectedText() ){
if( end ) { if( end ) {
start++; start++;
end++; end++;
if( end <= (signed int)filename->text().length() ) 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 else
m_command = QString("[$%1-[length]]").arg(start); m_command = TQString("[$%1-[length]]").tqarg(start);
} }
} else if( !checkInvert->isChecked() && !filename->hasSelectedText() ) { } else if( !checkInvert->isChecked() && !filename->hasSelectedText() ) {
int p = filename->cursorPosition(); 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(); updateCommand();
} }
QString CoordDialog::coords() TQString CoordDialog::coords()
{ {
m_inversion = checkInvert->isChecked(); m_inversion = checkInvert->isChecked();
return m_command; return m_command;

@ -21,23 +21,24 @@
#include <kdialogbase.h> #include <kdialogbase.h>
#include <klineedit.h> #include <klineedit.h>
class QKeyEvent; class TQKeyEvent;
class DSLineEdit : public KLineEdit { class DSLineEdit : public KLineEdit {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
DSLineEdit( QWidget* parent = 0, const char* name = 0 ); DSLineEdit( TQWidget* tqparent = 0, const char* name = 0 );
signals: signals:
void changed(); void changed();
protected: protected:
void keyPressEvent( QKeyEvent* e ); void keyPressEvent( TQKeyEvent* e );
void mousePressEvent( QMouseEvent* e ); void mousePressEvent( TQMouseEvent* e );
}; };
class QCheckBox; class TQCheckBox;
class QLabel; class TQLabel;
class QString; class TQString;
/* The name of this class was a very bad choice. /* The name of this class was a very bad choice.
* CoordDialog is an abreviation vor Coordinate Dialog, * CoordDialog is an abreviation vor Coordinate Dialog,
@ -46,11 +47,12 @@ class QString;
*/ */
class CoordDialog : public KDialogBase { class CoordDialog : public KDialogBase {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
CoordDialog( const QString & file, QWidget *_parent=0, const char *name=0); CoordDialog( const TQString & file, TQWidget *_parent=0, const char *name=0);
~CoordDialog(); ~CoordDialog();
QString coords(); TQString coords();
static bool m_inversion; static bool m_inversion;
@ -59,12 +61,12 @@ class CoordDialog : public KDialogBase {
void resetText(); void resetText();
private: private:
QString m_file; TQString m_file;
QString m_command; TQString m_command;
DSLineEdit* filename; DSLineEdit* filename;
QCheckBox* checkInvert; TQCheckBox* checkInvert;
QLabel* preview; TQLabel* preview;
}; };
#endif #endif

@ -16,8 +16,8 @@
***************************************************************************/ ***************************************************************************/
#include "dateplugin.h" #include "dateplugin.h"
// Qt includes // TQt includes
#include <qdatetime.h> #include <tqdatetime.h>
// KDE includes // KDE includes
#include <kfileitem.h> #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 ) ) if( !supports( token ) )
return QString::null; return TQString();
if( token.lower().startsWith( getPattern() ) ) if( token.lower().startsWith( getPattern() ) )
token = token.mid( getPattern().length(), token.length() - getPattern().length() ); token = token.mid( getPattern().length(), token.length() - getPattern().length() );
QDate d = QDate::currentDate(); TQDate d = TQDate::tqcurrentDate();
QTime t = QTime::currentTime(); TQTime t = TQTime::currentTime();
QString tmp, text; TQString tmp, text;
QString format = "dd-MM-yyyy"; TQString format = "dd-MM-yyyy";
if( token.contains( ";" ) ) if( token.tqcontains( ";" ) )
{ {
format = token.section( ';', 1, 1 ); format = token.section( ';', 1, 1 );
token = token.section( ';', 0, 0 ).lower(); token = token.section( ';', 0, 0 ).lower();
@ -71,15 +71,15 @@ QString DatePlugin::processFile(BatchRenamer* b, int i, QString token, int )
token = token.lower(); token = token.lower();
if( token == "date" ) { if( token == "date" ) {
return QDateTime::currentDateTime().toString( format ); return TQDateTime::tqcurrentDateTime().toString( format );
} else if( token == "year" ) } else if( token == "year" )
return QString( "%1" ).arg( d.year() ); return TQString( "%1" ).tqarg( d.year() );
else if( token == "month" ) else if( token == "month" )
return tmp.sprintf("%0*i", 2, d.month() ); return tmp.sprintf("%0*i", 2, d.month() );
else if( token == "day" ) else if( token == "day" )
return tmp.sprintf("%0*i", 2, d.day() ); return tmp.sprintf("%0*i", 2, d.day() );
else if( token == "time" ) 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" ) else if( token == "hour" )
return tmp.sprintf("%0*i", 2, t.hour() ); return tmp.sprintf("%0*i", 2, t.hour() );
else if( token == "minute" ) 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"); return i18n("&System Functions");
} }
const QString DatePlugin::getName() const const TQString DatePlugin::getName() const
{ {
return i18n("System Functions"); 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 ); dt.setTime_t( time );
return dt.toString( format ); return dt.toString( format );
} }
void DatePlugin::addHelp( HelpDialogData* data ) void DatePlugin::addHelp( HelpDialogData* data )
{ {
QStringList list; TQStringList list;
list.append( "[date];;" + i18n("Insert the current date") ); 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( "[date;yyyy-MM-dd];;" + i18n("Insert the current date using the formatting string yyyy-MM-dd") );
list.append( "[year];;" + i18n("Insert the current year") ); list.append( "[year];;" + i18n("Insert the current year") );

@ -29,15 +29,15 @@ class DatePlugin : public FilePlugin
public: public:
DatePlugin(); DatePlugin();
QString processFile(BatchRenamer* b, int i, QString token, int mode); TQString processFile(BatchRenamer* b, int i, TQString token, int mode);
const QString getAccelName() const; const TQString getAccelName() const;
const QString getName() const; const TQString getName() const;
const QString getPattern() const; const TQString getPattern() const;
void addHelp( HelpDialogData* data ); void addHelp( HelpDialogData* data );
private: private:
const QString time( time_t time, const QString & format ); const TQString time( time_t time, const TQString & format );
}; };

@ -18,11 +18,11 @@
#include "datetime.h" #include "datetime.h"
// QT includes // QT includes
#include <qcheckbox.h> #include <tqcheckbox.h>
#include <qfileinfo.h> #include <tqfileinfo.h>
#include <qlabel.h> #include <tqlabel.h>
#include <qlayout.h> #include <tqlayout.h>
#include <qpushbutton.h> #include <tqpushbutton.h>
// KDE includes // KDE includes
#include <kapplication.h> #include <kapplication.h>
@ -39,12 +39,12 @@
#include <sys/types.h> #include <sys/types.h>
#include <sys/stat.h> #include <sys/stat.h>
const QString MyDatePlugin::getName() const const TQString MyDatePlugin::getName() const
{ {
return i18n("Date & Time"); return i18n("Date & Time");
} }
const QString MyDatePlugin::getAccelName() const const TQString MyDatePlugin::getAccelName() const
{ {
return i18n("Date && &Time"); return i18n("Date && &Time");
} }
@ -59,31 +59,31 @@ bool MyDatePlugin::checkError()
return true; return true;
} }
const QPixmap MyDatePlugin::getIcon() const const TQPixmap MyDatePlugin::getIcon() const
{ {
return kapp->iconLoader()->loadIcon( "kalarm", KIcon::Small ); return kapp->iconLoader()->loadIcon( "kalarm", KIcon::Small );
} }
void MyDatePlugin::drawInterface( QWidget* w, QVBoxLayout* l ) void MyDatePlugin::drawInterface( TQWidget* w, TQVBoxLayout* l )
{ {
m_widget = w; m_widget = w;
#ifdef BENNY #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 #else
Layout0 = new QHBoxLayout( 0, 0, 6, "Layout0"); Layout0 = new TQHBoxLayout( 0, 0, 6, "Layout0");
Layout1 = new QVBoxLayout( 0, 0, 6, "Layout1"); Layout1 = new TQVBoxLayout( 0, 0, 6, "Layout1");
Layout2 = new QHBoxLayout( 0, 0, 6, "Layout2"); Layout2 = new TQHBoxLayout( 0, 0, 6, "Layout2");
kDate = new KDatePicker( w ); kDate = new KDatePicker( w );
checkAccess = new QCheckBox( w, "checkAccess" ); checkAccess = new TQCheckBox( w, "checkAccess" );
checkAccess->setText( i18n( "Change &access date && time" ) ); checkAccess->setText( i18n( "Change &access date && time" ) );
checkModification = new QCheckBox( w, "checkModification" ); checkModification = new TQCheckBox( w, "checkModification" );
checkModification->setText( i18n( "Change &modification date && time" ) ); checkModification->setText( i18n( "Change &modification date && time" ) );
labelTime = new QLabel( w, "labelTime" ); labelTime = new TQLabel( w, "labelTime" );
labelTime->setText( i18n( "Time:" ) ); labelTime->setText( i18n( "Time:" ) );
spinHour = new KIntSpinBox( w, "spinHour" ); spinHour = new KIntSpinBox( w, "spinHour" );
@ -98,7 +98,7 @@ void MyDatePlugin::drawInterface( QWidget* w, QVBoxLayout* l )
spinSecond->setSuffix( i18n( "s" ) ); spinSecond->setSuffix( i18n( "s" ) );
spinSecond->setMaxValue( 59 ); spinSecond->setMaxValue( 59 );
buttonCurrentDT = new QPushButton( w, "buttonCurrentDT" ); buttonCurrentDT = new TQPushButton( w, "buttonCurrentDT" );
buttonCurrentDT->setText( i18n( "&Get Current Date && Time" ) ); buttonCurrentDT->setText( i18n( "&Get Current Date && Time" ) );
Layout2->addWidget( labelTime ); Layout2->addWidget( labelTime );
@ -114,12 +114,12 @@ void MyDatePlugin::drawInterface( QWidget* w, QVBoxLayout* l )
Layout0->addLayout( Layout1 ); 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 ); Layout0->addItem( spacer );
l->addLayout( Layout0 ); l->addLayout( Layout0 );
connect( buttonCurrentDT, SIGNAL(clicked()), this, SLOT(changeDT())); connect( buttonCurrentDT, TQT_SIGNAL(clicked()), this, TQT_SLOT(changeDT()));
#endif #endif
} }
@ -135,10 +135,10 @@ void MyDatePlugin::fillStructure()
#endif #endif
} }
QString MyDatePlugin::processFile( BatchRenamer* b, int i, QString, int ) TQString MyDatePlugin::processFile( BatchRenamer* b, int i, TQString, int )
{ {
#ifdef BENNY #ifdef BENNY
QString filename = b->files()[i].dst.name; TQString filename = b->files()[i].dst.name;
FILE * f; FILE * f;
struct utimbuf * t = new utimbuf(); struct utimbuf * t = new utimbuf();
@ -149,11 +149,11 @@ QString MyDatePlugin::processFile( BatchRenamer* b, int i, QString, int )
f = fopen((const char *)filename, "r"); f = fopen((const char *)filename, "r");
if( f == NULL ) 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 ); fclose( f );
QFileInfo info( filename ); TQFileInfo info( filename );
tmp.tm_mday = info.lastModified().date().day(); tmp.tm_mday = info.lastModified().date().day();
tmp.tm_mon = info.lastModified().date().month() - 1; tmp.tm_mon = info.lastModified().date().month() - 1;
tmp.tm_year = info.lastModified().date().year() - 1900; tmp.tm_year = info.lastModified().date().year() - 1900;
@ -165,20 +165,20 @@ QString MyDatePlugin::processFile( BatchRenamer* b, int i, QString, int )
ti = mktime( &tmp ); ti = mktime( &tmp );
if( ti == -1 ) 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 ) 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->actime = st.st_atime;
t->modtime = ti; t->modtime = ti;
if(utime( (const char *)filename, t ) != 0) 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 #else
QString filename = b->files()[i].dst.name; TQString filename = b->files()[i].dst.name;
FILE * f; FILE * f;
struct utimbuf * t = new utimbuf(); struct utimbuf * t = new utimbuf();
@ -189,7 +189,7 @@ QString MyDatePlugin::processFile( BatchRenamer* b, int i, QString, int )
f = fopen((const char *)filename, "r"); f = fopen((const char *)filename, "r");
if( f == NULL ) 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 ); fclose( f );
@ -204,10 +204,10 @@ QString MyDatePlugin::processFile( BatchRenamer* b, int i, QString, int )
ti = mktime( &tmp ); ti = mktime( &tmp );
if( ti == -1 ) 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 ) 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) if(dvals.changeAccess)
t->actime = ti; t->actime = ti;
@ -220,18 +220,18 @@ QString MyDatePlugin::processFile( BatchRenamer* b, int i, QString, int )
t->modtime = st.st_mtime; t->modtime = st.st_mtime;
if(utime( (const char *)filename, t ) != 0) 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 #endif
} }
void MyDatePlugin::changeDT() void MyDatePlugin::changeDT()
{ {
spinHour->setValue( QTime::currentTime().hour()); spinHour->setValue( TQTime::currentTime().hour());
spinMinute->setValue( QTime::currentTime().minute()); spinMinute->setValue( TQTime::currentTime().minute());
spinSecond->setValue( QTime::currentTime().second()); spinSecond->setValue( TQTime::currentTime().second());
kDate->setDate( QDate::currentDate() ); kDate->setDate( TQDate::tqcurrentDate() );
} }

@ -31,49 +31,50 @@
class KDatePicker; class KDatePicker;
class KIntSpinBox; class KIntSpinBox;
class QCheckBox; class TQCheckBox;
class QButtonGroup; class TQButtonGroup;
class QGroupBox; class TQGroupBox;
class QLabel; class TQLabel;
class QVBoxLayout; class TQVBoxLayout;
class QHBoxLayout; class TQHBoxLayout;
class QPushButton; class TQPushButton;
class QString; class TQString;
class QWidget; class TQWidget;
class MyDatePlugin: public Plugin { class MyDatePlugin: public Plugin {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
const QString getName() const; const TQString getName() const;
const QString getAccelName() const; const TQString getAccelName() const;
const int type() const; const int type() const;
bool checkError(); bool checkError();
void drawInterface( QWidget* w, QVBoxLayout* l ); void drawInterface( TQWidget* w, TQVBoxLayout* l );
void fillStructure(); 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: private slots:
void changeDT(); void changeDT();
protected: protected:
QCheckBox* checkAccess; TQCheckBox* checkAccess;
QCheckBox* checkModification; TQCheckBox* checkModification;
KDatePicker* kDate; KDatePicker* kDate;
QLabel* labelTime; TQLabel* labelTime;
KIntSpinBox* spinHour; KIntSpinBox* spinHour;
KIntSpinBox* spinMinute; KIntSpinBox* spinMinute;
KIntSpinBox* spinSecond; KIntSpinBox* spinSecond;
QPushButton* buttonCurrentDT; TQPushButton* buttonCurrentDT;
QHBoxLayout* Layout0; TQHBoxLayout* Layout0;
QVBoxLayout* Layout1; TQVBoxLayout* Layout1;
QHBoxLayout* Layout2; TQHBoxLayout* Layout2;
struct datevals { struct datevals {
QDate date; // Date TQDate date; // Date
bool changeModification; // Change modification date bool changeModification; // Change modification date
bool changeAccess; // Change access date bool changeAccess; // Change access date

@ -17,46 +17,46 @@
#include "dsdirselectdialog.h" #include "dsdirselectdialog.h"
// Qt includes // TQt includes
#include <qcheckbox.h> #include <tqcheckbox.h>
#include <qhbox.h> #include <tqhbox.h>
#include <qlabel.h> #include <tqlabel.h>
#include <qlayout.h> #include <tqlayout.h>
#include <qtooltip.h> #include <tqtooltip.h>
#include <qvbox.h> #include <tqvbox.h>
// KDE includes // KDE includes
#include <kdiroperator.h> #include <kdiroperator.h>
#include <klocale.h> #include <klocale.h>
#include <kurlcombobox.h> #include <kurlcombobox.h>
DSDirSelectDialog::DSDirSelectDialog( QWidget* parent ) DSDirSelectDialog::DSDirSelectDialog( TQWidget* tqparent )
: KFileDialog( ":KRename", "*", parent, 0, false ) : KFileDialog( ":KRename", "*", tqparent, 0, false )
{ {
setOperationMode( KFileDialog::Opening ); setOperationMode( KFileDialog::Opening );
setMode( KFile::Files | KFile::ExistingOnly ); setMode( KFile::Files | KFile::ExistingOnly );
QVBox* vbox = new QVBox( this ); TQVBox* vbox = new TQVBox( this );
if( layout() ) if( tqlayout() )
layout()->add( vbox ); tqlayout()->add( vbox );
else 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 ); checkDir = new TQCheckBox( i18n("Add directory names &with filenames"), vbox );
check = new QCheckBox( i18n("Add subdirectories &recursively"), vbox ); check = new TQCheckBox( i18n("Add subdirectories &recursively"), vbox );
QHBox* hbox = new QHBox( vbox ); TQHBox* hbox = new TQHBox( vbox );
QWidget* spacer = new QWidget( hbox ); TQWidget* spacer = new TQWidget( hbox );
spacer->setMinimumWidth( 20 ); spacer->setMinimumWidth( 20 );
checkHidden = new QCheckBox( i18n("Add &hidden directories"), hbox ); checkHidden = new TQCheckBox( i18n("Add &hidden directories"), hbox );
hbox->setStretchFactor( checkHidden, 4 ); hbox->setStretchFactor( checkHidden, 4 );
checkOnlyDir = new QCheckBox( i18n("Add directory names only"), vbox ); checkOnlyDir = new TQCheckBox( i18n("Add directory names only"), vbox );
connect( check, SIGNAL( clicked() ), this, SLOT( enableControls() )); 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.") ); 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.") );
QToolTip::add( checkHidden, i18n("If not checked, KRename will ignore directories starting with a dot during recursive adding.") ); TQToolTip::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.") ); TQToolTip::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( checkDir, i18n("This option causes KRename to add also the name of the base directory of the selected files to its list.") );
enableControls(); enableControls();
} }

@ -20,16 +20,17 @@
#include <kfiledialog.h> #include <kfiledialog.h>
class QCheckBox; class TQCheckBox;
class QLabel; class TQLabel;
class KComboBox; 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 { class DSDirSelectDialog : public KFileDialog {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
DSDirSelectDialog( QWidget* parent ); DSDirSelectDialog( TQWidget* tqparent );
bool recursively() const; bool recursively() const;
bool hidden() const; bool hidden() const;
@ -44,11 +45,11 @@ class DSDirSelectDialog : public KFileDialog {
void slotOk(); void slotOk();
private: private:
QCheckBox* check; TQCheckBox* check;
QCheckBox* checkHidden; TQCheckBox* checkHidden;
QCheckBox* checkDir; TQCheckBox* checkDir;
QCheckBox* checkOnlyDir; TQCheckBox* checkOnlyDir;
QLabel* label; TQLabel* label;
}; };
#endif #endif

@ -18,11 +18,11 @@
#include "encodingplugin.h" #include "encodingplugin.h"
// QT includes // QT includes
#include <qcheckbox.h> #include <tqcheckbox.h>
#include <qlabel.h> #include <tqlabel.h>
#include <qlayout.h> #include <tqlayout.h>
#include <qtextcodec.h> #include <tqtextcodec.h>
#include <qvgroupbox.h> #include <tqvgroupbox.h>
// KDE includes // KDE includes
@ -32,12 +32,12 @@
#include <klocale.h> #include <klocale.h>
#include <kmessagebox.h> #include <kmessagebox.h>
const QString EncodingPlugin::getName() const const TQString EncodingPlugin::getName() const
{ {
return i18n("Encoding Conversion Plugin"); return i18n("Encoding Conversion Plugin");
} }
const QString EncodingPlugin::getAccelName() const const TQString EncodingPlugin::getAccelName() const
{ {
return i18n("&Encoding Conversion Plugin"); return i18n("&Encoding Conversion Plugin");
} }
@ -47,32 +47,32 @@ const int EncodingPlugin::type() const
return TYPE_FINAL_FILENAME; 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 // build a list of all available TextCodecs
QStringList codecs; TQStringList codecs;
QTextCodec *codec; TQTextCodec *codec;
for( int i=0; (codec = QTextCodec::codecForIndex(i));i++) for( int i=0; (codec = TQTextCodec::codecForIndex(i));i++)
codecs.append( codec->name() ); codecs.append( codec->name() );
m_widget = w; m_widget = w;
codec = QTextCodec::codecForLocale(); codec = TQTextCodec::codecForLocale();
m_locale_codec = codec->name(); m_locale_codec = codec->name();
QLabel* label = new QLabel( TQLabel* label = new TQLabel(
i18n("<qt>This plugin is able to convert filenames between different " i18n("<qt>This plugin is able to convert filenames between different "
"encodings. For example you can convert filenames from KOI8-R " "encodings. For example you can convert filenames from KOI8-R "
"to UTF-8 encoding.</qt>"), w ); "to UTF-8 encoding.</qt>"), w );
l->addWidget( label ); l->addWidget( label );
QVGroupBox* groupInput = new QVGroupBox( i18n("Encoding of Input Files:"), w ); TQVGroupBox* groupInput = new TQVGroupBox( i18n("Encoding of Input Files:"), w );
checkInput = new QCheckBox( i18n("&Use local encoding: %1").arg( m_locale_codec), groupInput ); checkInput = new TQCheckBox( i18n("&Use local encoding: %1").tqarg( m_locale_codec), groupInput );
comboInput = new KComboBox( false, groupInput ); comboInput = new KComboBox( false, groupInput );
comboInput->insertStringList( codecs ); comboInput->insertStringList( codecs );
QVGroupBox* groupOutput = new QVGroupBox( i18n("Encoding of Output Files:"), w ); TQVGroupBox* groupOutput = new TQVGroupBox( i18n("Encoding of Output Files:"), w );
checkOutput = new QCheckBox( i18n("&Use local encoding: %1").arg( m_locale_codec), groupOutput ); checkOutput = new TQCheckBox( i18n("&Use local encoding: %1").tqarg( m_locale_codec), groupOutput );
checkOutput->setChecked( true ); checkOutput->setChecked( true );
comboOutput = new KComboBox( false, groupOutput ); comboOutput = new KComboBox( false, groupOutput );
comboOutput->insertStringList( codecs ); comboOutput->insertStringList( codecs );
@ -80,11 +80,11 @@ void EncodingPlugin::drawInterface( QWidget* w, QVBoxLayout* l )
l->addWidget( groupInput ); l->addWidget( groupInput );
l->addWidget( groupOutput ); l->addWidget( groupOutput );
connect( checkInput, SIGNAL( clicked() ), this, SLOT( enableControls() ) ); connect( checkInput, TQT_SIGNAL( clicked() ), this, TQT_SLOT( enableControls() ) );
connect( checkOutput, SIGNAL( clicked() ), this, SLOT( enableControls() ) ); connect( checkOutput, TQT_SIGNAL( clicked() ), this, TQT_SLOT( enableControls() ) );
connect( comboOutput, SIGNAL( activated(int) ),this, SLOT( updatePreview() ) ); connect( comboOutput, TQT_SIGNAL( activated(int) ),this, TQT_SLOT( updatePreview() ) );
connect( comboInput, SIGNAL( activated(int) ),this, SLOT( updatePreview() ) ); connect( comboInput, TQT_SIGNAL( activated(int) ),this, TQT_SLOT( updatePreview() ) );
setLocale( comboInput ); setLocale( comboInput );
setLocale( comboOutput ); setLocale( comboOutput );
@ -103,16 +103,16 @@ bool EncodingPlugin::checkError()
return true; return true;
} }
QString EncodingPlugin::processFile( BatchRenamer*, int, QString token, int ) TQString EncodingPlugin::processFile( BatchRenamer*, int, TQString token, int )
{ {
QString input = token; TQString input = token;
QString unicode = QString::null; TQString tqunicode = TQString();
QTextCodec* toUnicode = QTextCodec::codecForName(m_input_codec); // get the codec for KOI8-R TQTextCodec* toUnicode = TQTextCodec::codecForName(m_input_codec); // get the codec for KOI8-R
QTextCodec* fromUnicode = QTextCodec::codecForName(m_output_codec); TQTextCodec* fromUnicode = TQTextCodec::codecForName(m_output_codec);
unicode = toUnicode->toUnicode( input ); tqunicode = toUnicode->toUnicode( input );
return fromUnicode->fromUnicode( unicode ); return fromUnicode->fromUnicode( tqunicode );
} }
void EncodingPlugin::finished() 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 ); return kapp->iconLoader()->loadIcon( "fonts", KIcon::Small );
} }

@ -25,22 +25,23 @@
#include "fileoperation.h" #include "fileoperation.h"
class KComboBox; class KComboBox;
class QCheckBox; class TQCheckBox;
class EncodingPlugin : public Plugin { class EncodingPlugin : public Plugin {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
const QString getName() const; const TQString getName() const;
const QString getAccelName() const; const TQString getAccelName() const;
const int type() const; const int type() const;
bool checkError(); bool checkError();
void drawInterface( QWidget* w, QVBoxLayout* l ); void drawInterface( TQWidget* w, TQVBoxLayout* l );
void fillStructure(); void fillStructure();
QString processFile( BatchRenamer*, int, QString token, int ); TQString processFile( BatchRenamer*, int, TQString token, int );
void finished(); void finished();
const QPixmap getIcon() const; const TQPixmap getIcon() const;
private slots: private slots:
void enableControls(); void enableControls();
@ -50,15 +51,15 @@ class EncodingPlugin : public Plugin {
FileOperation fop; FileOperation fop;
QString m_input_codec; TQString m_input_codec;
QString m_output_codec; TQString m_output_codec;
QString m_locale_codec; TQString m_locale_codec;
int mib_input; int mib_input;
int mib_output; int mib_output;
QCheckBox* checkInput; TQCheckBox* checkInput;
QCheckBox* checkOutput; TQCheckBox* checkOutput;
KComboBox* comboInput; KComboBox* comboInput;
KComboBox* comboOutput; KComboBox* comboOutput;

@ -22,13 +22,9 @@
#include <kio/job.h> #include <kio/job.h>
// QT includes // QT includes
#if QT_VERSION >= 0x030100 #include <tqeventloop.h>
#include <qeventloop.h>
#else
#include <qapplication.h>
#endif
#include <qfileinfo.h> #include <tqfileinfo.h>
// OS includes // OS includes
#include <stdio.h> #include <stdio.h>
@ -54,7 +50,7 @@ bool FileOperation::start( const KURL & src, const KURL & dest, int mode, bool o
result = 0; result = 0;
if( src == dest && !overwrite ) { 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; return false;
} }
@ -76,7 +72,7 @@ bool FileOperation::start( const KURL & src, const KURL & dest, int mode, bool o
} }
else 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; result = true;
return !result; return !result;
} }
@ -87,25 +83,21 @@ bool FileOperation::start( const KURL & src, const KURL & dest, int mode, bool o
return false; return false;
job->setAutoErrorHandlingEnabled( false, 0 ); job->setAutoErrorHandlingEnabled( false, 0 );
connect( job, SIGNAL( result (KIO::Job *) ), connect( job, TQT_SIGNAL( result (KIO::Job *) ),
this, SLOT( slotResult (KIO::Job *) ) ); this, TQT_SLOT( slotResult (KIO::Job *) ) );
#if QT_VERSION >= 0x030100
kapp->eventLoop()->enterLoop(); kapp->eventLoop()->enterLoop();
#else
kapp->enter_loop();
#endif
return !result; 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 ); 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(); return info.fileName();
} }
@ -115,10 +107,6 @@ void FileOperation::slotResult( KIO::Job * job )
if( result ) if( result )
m_error = job->errorString(); m_error = job->errorString();
#if QT_VERSION >= 0x030100
kapp->eventLoop()->exitLoop(); kapp->eventLoop()->exitLoop();
#else
kapp->exit_loop();
#endif
} }

@ -18,22 +18,23 @@
#ifndef FILEOPERATION_H #ifndef FILEOPERATION_H
#define FILEOPERATION_H #define FILEOPERATION_H
#include <qobject.h> #include <tqobject.h>
#include <kio/jobclasses.h> #include <kio/jobclasses.h>
#include <kurl.h> #include <kurl.h>
class QString; class TQString;
class FileOperation: public QObject { class FileOperation: public TQObject {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
FileOperation(); FileOperation();
~FileOperation(); ~FileOperation();
bool start( const KURL & src, const KURL & dest, int mode, bool overwrite ); 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; inline const TQString & error() const;
static QString getName( const QString & file ); static TQString getName( const TQString & file );
private slots: private slots:
void slotResult( KIO::Job * job ); void slotResult( KIO::Job * job );
@ -43,10 +44,10 @@ class FileOperation: public QObject {
bool canceled; bool canceled;
int result; int result;
QString m_error; TQString m_error;
}; };
inline const QString & FileOperation::error() const inline const TQString & FileOperation::error() const
{ {
return m_error; return m_error;
} }

@ -17,11 +17,11 @@
#include "fileplugin.h" #include "fileplugin.h"
// Qt includes // TQt includes
#include <qcheckbox.h> #include <tqcheckbox.h>
#include <qlabel.h> #include <tqlabel.h>
#include <qlayout.h> #include <tqlayout.h>
#include <qregexp.h> #include <tqregexp.h>
// KDE includes // KDE includes
#include <kapplication.h> #include <kapplication.h>
@ -42,7 +42,7 @@ FilePlugin::FilePlugin( KService* service )
KFileMetaInfoProvider* mip = KFileMetaInfoProvider::self(); KFileMetaInfoProvider* mip = KFileMetaInfoProvider::self();
m_name = service->name(); m_name = service->name();
m_comment = service->comment(); m_comment = service->comment();
QStringList options = service->serviceTypes(); TQStringList options = service->serviceTypes();
for( unsigned int i = 0; i < options.count(); i++ ) { for( unsigned int i = 0; i < options.count(); i++ ) {
if( options[i] != "KFilePlugin" ) { if( options[i] != "KFilePlugin" ) {
m_mimetype = options[i]; m_mimetype = options[i];
@ -53,7 +53,7 @@ FilePlugin::FilePlugin( KService* service )
fileplugin = mip->plugin( m_mimetype ); fileplugin = mip->plugin( m_mimetype );
KMimeType::Ptr mime = KMimeType::mimeType( 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 ); setPattern( mime );
} }
@ -65,7 +65,7 @@ FilePlugin::~FilePlugin()
void FilePlugin::setPattern( KMimeType::Ptr mime ) void FilePlugin::setPattern( KMimeType::Ptr mime )
{ {
QStringList pattern = mime->patterns(); TQStringList pattern = mime->patterns();
if( pattern.count() ) { if( pattern.count() ) {
m_pattern = pattern[0]; m_pattern = pattern[0];
if( m_pattern.startsWith( "*." ) ) if( m_pattern.startsWith( "*." ) )
@ -76,11 +76,11 @@ void FilePlugin::setPattern( KMimeType::Ptr mime )
// We need a pattern // We need a pattern
if( m_pattern.isEmpty() ) { if( m_pattern.isEmpty() ) {
int a = 0; int a = 0;
a = m_name.find( "-" ); a = m_name.tqfind( "-" );
if( a > -1 ) if( a > -1 )
m_pattern = m_name.left( a ).lower(); m_pattern = m_name.left( a ).lower();
else { else {
a = m_pattern.find( " " ); a = m_pattern.tqfind( " " );
if( a > -1 ) if( a > -1 )
m_pattern = m_name.left( a ).lower(); m_pattern = m_name.left( a ).lower();
else else
@ -97,17 +97,17 @@ void FilePlugin::setupKeys()
keys[i] = getPattern() + keys[i]; keys[i] = getPattern() + keys[i];
} }
const QString FilePlugin::getName() const const TQString FilePlugin::getName() const
{ {
return m_name; return m_name;
} }
const QString FilePlugin::getAccelName() const const TQString FilePlugin::getAccelName() const
{ {
return "&" + getName(); return "&" + getName();
} }
const QString FilePlugin::getPattern() const const TQString FilePlugin::getPattern() const
{ {
return m_pattern; return m_pattern;
} }
@ -122,22 +122,22 @@ bool FilePlugin::checkError()
return true; 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 ) ); pix->setPixmap( kapp->iconLoader()->loadIcon( m_icon, KIcon::Desktop ) );
hbox->addWidget( pix ); 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 ); hbox->addItem( spacer );
l->addLayout( hbox ); l->addLayout( hbox );
l->addWidget( new QLabel( m_comment, w ) ); l->addWidget( new TQLabel( m_comment, w ) );
l->addWidget( new QLabel( i18n("Supported tokens:"), w ) ); l->addWidget( new TQLabel( i18n("Supported tokens:"), w ) );
KListBox* list = new KListBox( w ); KListBox* list = new KListBox( w );
list->setColumnMode( KListBox::FitToWidth ); list->setColumnMode( KListBox::FitToWidth );
@ -149,27 +149,27 @@ void FilePlugin::drawInterface( QWidget* w, QVBoxLayout* l )
l->setStretchFactor( list, 2 ); 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(); token = token.lower();
/* /*
* Check if we have something cached for this file * Check if we have something cached for this file
*/ */
if( cache.contains( filename + "::" + token ) ) if( cache.tqcontains( filename + "::" + token ) )
return cache[filename + "::" + token ]; return cache[filename + "::" + token ];
for( unsigned int i = 0; i < keys.count(); i++ ) { for( unsigned int i = 0; i < keys.count(); i++ ) {
if( token.lower() == keys[i].lower() ) { if( token.lower() == keys[i].lower() ) {
KFileMetaInfo meta( filename ); KFileMetaInfo meta( filename );
if( meta.isValid() ) { if( meta.isValid() ) {
QString k = keys[i]; TQString k = keys[i];
if( k.startsWith( getPattern() ) ) if( k.startsWith( getPattern() ) )
k = k.mid( getPattern().length(), k.length() - getPattern().length() ); 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 ) if( cache.count() >= CACHE_MAX )
cache.remove( cache.begin() ); 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 ) void FilePlugin::addHelp( HelpDialogData* data )
{ {
QStringList list; TQStringList list;
for( unsigned int i = 0; i < keys.count(); i++ ) for( unsigned int i = 0; i < keys.count(); i++ )
list.append( "[" + keys[i] + "]" + ";;" + keys[i] ); list.append( "[" + keys[i] + "]" + ";;" + keys[i] );
data->add( getName(), &list, getIcon() ); data->add( getName(), &list, getIcon() );
} }
const QPixmap FilePlugin::getIcon() const const TQPixmap FilePlugin::getIcon() const
{ {
return kapp->iconLoader()->loadIcon( m_icon, KIcon::Small ); 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++ ) 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 true;
return false; return false;

@ -33,33 +33,34 @@ class KFileMetaInfoProvider;
class KFileMimeTypeInfo; class KFileMimeTypeInfo;
class KPushButton; class KPushButton;
class KService; class KService;
class QLabel; class TQLabel;
class QWidget; class TQWidget;
class QVBoxLayout; class TQVBoxLayout;
class KFilePlugin; class KFilePlugin;
class FilePlugin : public Plugin { class FilePlugin : public Plugin {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
FilePlugin( KService* service ); FilePlugin( KService* service );
~FilePlugin(); ~FilePlugin();
inline bool isValid() const; inline bool isValid() const;
virtual const QString getName() const; virtual const TQString getName() const;
virtual const QString getAccelName() const; virtual const TQString getAccelName() const;
virtual const QString getPattern() const; virtual const TQString getPattern() const;
virtual const int type() const; virtual const int type() const;
virtual bool checkError(); virtual bool checkError();
virtual void drawInterface( QWidget* w, QVBoxLayout* l ); virtual void drawInterface( TQWidget* w, TQVBoxLayout* l );
virtual QString processFile( BatchRenamer* b, int i, QString token, int mode ); virtual TQString processFile( BatchRenamer* b, int i, TQString token, int mode );
virtual void addHelp( HelpDialogData* data ); virtual void addHelp( HelpDialogData* data );
virtual const QPixmap getIcon() const; virtual const TQPixmap getIcon() const;
virtual bool alwaysUsed() const { return true; } virtual bool alwaysUsed() const { return true; }
virtual const QStringList getKeys() const { return keys; } virtual const TQStringList getKeys() const { return keys; }
virtual void clearCache(); virtual void clearCache();
@ -67,15 +68,15 @@ class FilePlugin : public Plugin {
void setPattern( KMimeType::Ptr mime ); void setPattern( KMimeType::Ptr mime );
protected: protected:
bool supports( const QString & token ); bool supports( const TQString & token );
void setupKeys(); void setupKeys();
QMap<QString,QString> cache; TQMap<TQString,TQString> cache;
KFilePlugin* fileplugin; 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 bool FilePlugin::isValid() const

@ -17,9 +17,9 @@
#include "firststartdlg.h" #include "firststartdlg.h"
FirstStartDlg::FirstStartDlg(QWidget *parent, const char *name ) FirstStartDlg::FirstStartDlg(TQWidget *tqparent, const char *name )
: KDialogBase( KDialogBase::Plain, "KRename", : KDialogBase( KDialogBase::Plain, "KRename",
KDialogBase::Ok, KDialogBase::Ok, parent, name, true, true ), KDialogBase::Ok, KDialogBase::Ok, tqparent, name, true, true ),
GUIModeSelector() GUIModeSelector()
{ {
setCaption( guiModeCaption() ); setCaption( guiModeCaption() );

@ -18,14 +18,15 @@
#ifndef FIRSTSTARTDLG_H #ifndef FIRSTSTARTDLG_H
#define FIRSTSTARTDLG_H #define FIRSTSTARTDLG_H
#include <qwidget.h> #include <tqwidget.h>
#include <kdialogbase.h> #include <kdialogbase.h>
#include "guimodeselector.h" #include "guimodeselector.h"
class FirstStartDlg : public KDialogBase, public GUIModeSelector { class FirstStartDlg : public KDialogBase, public GUIModeSelector {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
FirstStartDlg(QWidget *parent=0, const char *name=0); FirstStartDlg(TQWidget *tqparent=0, const char *name=0);
~FirstStartDlg(); ~FirstStartDlg();
}; };

@ -17,12 +17,12 @@
#include "guimodeselector.h" #include "guimodeselector.h"
// Qt includes // TQt includes
#include <qbuttongroup.h> #include <tqbuttongroup.h>
#include <qframe.h> #include <tqframe.h>
#include <qlabel.h> #include <tqlabel.h>
#include <qlayout.h> #include <tqlayout.h>
#include <qradiobutton.h> #include <tqradiobutton.h>
// KDE includes // KDE includes
#include <klocale.h> #include <klocale.h>
@ -47,32 +47,32 @@ void GUIModeSelector::setUseWizard( bool b )
optionTabs->setChecked( !b ); optionTabs->setChecked( !b );
} }
const QString GUIModeSelector::guiModeCaption() const const TQString GUIModeSelector::guiModeCaption() const
{ {
return i18n("Look and Feel"); return i18n("Look and Feel");
} }
void GUIModeSelector::createFrame( QFrame* frame ) void GUIModeSelector::createFrame( TQFrame* frame )
{ {
QVBoxLayout* layout = new QVBoxLayout( frame ); TQVBoxLayout* tqlayout = new TQVBoxLayout( frame );
QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding ); 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 ); 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)") ); optionWizard->setText( i18n("Use &wizard style GUI (beginners)") );
optionTabs = new QRadioButton( group ); optionTabs = new TQRadioButton( group );
optionTabs->setText( i18n("Use &tabbed GUI (advanced users)") ); 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( optionWizard );
lgroup->addWidget( optionTabs ); lgroup->addWidget( optionTabs );
lgroup->addItem( spacer ); lgroup->addItem( spacer );
layout->addWidget( group ); tqlayout->addWidget( group );
layout->addItem( spacer ); tqlayout->addItem( spacer );
} }

@ -18,10 +18,10 @@
#ifndef GUIMODESELECTOR_H #ifndef GUIMODESELECTOR_H
#define GUIMODESELECTOR_H #define GUIMODESELECTOR_H
#include <qobject.h> #include <tqobject.h>
class QFrame; class TQFrame;
class QRadioButton; class TQRadioButton;
class GUIModeSelector { class GUIModeSelector {
public: public:
GUIModeSelector(); GUIModeSelector();
@ -31,11 +31,11 @@ class GUIModeSelector {
void setUseWizard( bool b ); void setUseWizard( bool b );
protected: protected:
const QString guiModeCaption() const; const TQString guiModeCaption() const;
void createFrame( QFrame* frame ); void createFrame( TQFrame* frame );
QRadioButton* optionWizard; TQRadioButton* optionWizard;
QRadioButton* optionTabs; TQRadioButton* optionTabs;
}; };
#endif #endif

@ -17,10 +17,10 @@
#include "helpdialog.h" #include "helpdialog.h"
#include "krenameimpl.h" #include "krenameimpl.h"
// Qt includes // TQt includes
#include <qcombobox.h> #include <tqcombobox.h>
#include <qlayout.h> #include <tqlayout.h>
#include <qlineedit.h> #include <tqlineedit.h>
// KDE includes // KDE includes
#include <klocale.h> #include <klocale.h>
@ -28,9 +28,9 @@
#include <kpushbutton.h> #include <kpushbutton.h>
#include <kstdguiitem.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_map.remove( headline );
m_icons.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_map.insert( headline, *commands );
m_icons.insert( headline, icon ); m_icons.insert( headline, icon );
@ -50,39 +50,31 @@ void HelpDialogData::add( const QString & headline, QStringList* commands, const
emit updateItems(); emit updateItems();
} }
QStringList HelpDialogData::tokens() const TQStringList HelpDialogData::tokens() const
{ {
QStringList list; TQStringList list;
#if QT_VERSION >= 0x030005 TQStringList keys = m_map.keys();
// 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
for( unsigned int i = 0; i < keys.count(); i++ ) for( unsigned int i = 0; i < keys.count(); i++ )
for( unsigned int z = 0; z < m_map[keys[i]].count(); z++ ) for( unsigned int z = 0; z < m_map[keys[i]].count(); z++ )
list.append( m_map[keys[i]][z].section( ";;", 0, 0 ) ); list.append( m_map[keys[i]][z].section( ";;", 0, 0 ) );
return list; return list;
} }
HelpDialog::HelpDialog( HelpDialogData* data, QWidget* parent, HelpDialog::HelpDialog( HelpDialogData* data, TQWidget* tqparent,
const char* name, bool modal, WFlags fl ) const char* name, bool modal, WFlags fl )
: QDialog( parent, name, modal, fl ) : TQDialog( tqparent, name, modal, fl )
{ {
text = NULL; text = NULL;
resize( 500, 400 ); resize( 500, 400 );
setCaption( i18n( "Help" ) ); 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 ); HelpDialogLayout->addWidget( comboHeadline );
list = new KListView( this, "list" ); list = new KListView( this, "list" );
@ -90,8 +82,8 @@ HelpDialog::HelpDialog( HelpDialogData* data, QWidget* parent,
list->addColumn( i18n( "Description" ) ); list->addColumn( i18n( "Description" ) );
HelpDialogLayout->addWidget( list ); HelpDialogLayout->addWidget( list );
Layout1 = new QHBoxLayout( 0, 0, 6, "Layout1"); Layout1 = new TQHBoxLayout( 0, 0, 6, "Layout1");
QSpacerItem* spacer = new QSpacerItem( 91, 0, QSizePolicy::Expanding, QSizePolicy::Minimum ); TQSpacerItem* spacer = new TQSpacerItem( 91, 0, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
Layout1->addItem( spacer ); Layout1->addItem( spacer );
buttonAdd = new KPushButton( this, "buttonAdd" ); buttonAdd = new KPushButton( this, "buttonAdd" );
@ -103,20 +95,20 @@ HelpDialog::HelpDialog( HelpDialogData* data, QWidget* parent,
HelpDialogLayout->addLayout( Layout1 ); HelpDialogLayout->addLayout( Layout1 );
// signals and slots connections // signals and slots connections
connect( buttonClose, SIGNAL( clicked() ), this, SLOT( accept() ) ); connect( buttonClose, TQT_SIGNAL( clicked() ), this, TQT_SLOT( accept() ) );
connect( buttonAdd, SIGNAL( clicked() ), this, SLOT( execute() ) ); connect( buttonAdd, TQT_SIGNAL( clicked() ), this, TQT_SLOT( execute() ) );
connect( list, SIGNAL( executed(QListViewItem*) ), this, SLOT( execute() ) ); connect( list, TQT_SIGNAL( executed(TQListViewItem*) ), this, TQT_SLOT( execute() ) );
connect( comboHeadline, SIGNAL( activated(int) ), this, SLOT(updateItems() ) ); connect( comboHeadline, TQT_SIGNAL( activated(int) ), this, TQT_SLOT(updateItems() ) );
m_data = data; m_data = data;
connect( m_data, SIGNAL( updateItems() ), this, SLOT( updateItems() ) ); connect( m_data, TQT_SIGNAL( updateItems() ), this, TQT_SLOT( updateItems() ) );
connect( m_data, SIGNAL( updateHeadline() ), this, SLOT( updateHeadline() ) ); connect( m_data, TQT_SIGNAL( updateHeadline() ), this, TQT_SLOT( updateHeadline() ) );
} }
HelpDialog::~HelpDialog() HelpDialog::~HelpDialog()
{ {
disconnect( m_data, SIGNAL( updateItems() ), this, SLOT( updateItems() ) ); disconnect( m_data, TQT_SIGNAL( updateItems() ), this, TQT_SLOT( updateItems() ) );
disconnect( m_data, SIGNAL( updateHeadline() ), this, SLOT( updateHeadline() ) ); disconnect( m_data, TQT_SIGNAL( updateHeadline() ), this, TQT_SLOT( updateHeadline() ) );
} }
void HelpDialog::execute() void HelpDialog::execute()
@ -124,7 +116,7 @@ void HelpDialog::execute()
if(!list->currentItem()) if(!list->currentItem())
return; return;
QString t = text->text(); TQString t = text->text();
t.insert( text->cursorPosition(), list->currentItem()->text( 0 ) ); t.insert( text->cursorPosition(), list->currentItem()->text( 0 ) );
text->setText( t ); text->setText( t );
@ -136,10 +128,10 @@ void HelpDialog::execute()
void HelpDialog::updateItems() void HelpDialog::updateItems()
{ {
list->clear(); 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++ ) { 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 ) ); new KListViewItem( list, tmp.section( ";;", 0, 0 ), tmp.section( ";;", 1, 1 ) );
} }
} }
@ -147,11 +139,11 @@ void HelpDialog::updateItems()
void HelpDialog::updateHeadline() void HelpDialog::updateHeadline()
{ {
comboHeadline->clear(); comboHeadline->clear();
QMap<QString,QStringList> m = m_data->map(); TQMap<TQString,TQStringList> m = m_data->map();
QMap<QString,QPixmap> ic = m_data->icons(); TQMap<TQString,TQPixmap> ic = m_data->icons();
comboHeadline->insertItem( ic[m_data->first()], m_data->first() ); 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 ) for ( it = m.begin(); it != m.end(); ++it )
if( it.key() != m_data->first() ) if( it.key() != m_data->first() )
comboHeadline->insertItem( ic[it.key()], it.key() ); comboHeadline->insertItem( ic[it.key()], it.key() );

@ -18,44 +18,45 @@
#ifndef HELPDIALOG_H #ifndef HELPDIALOG_H
#define HELPDIALOG_H #define HELPDIALOG_H
#include <qdialog.h> #include <tqdialog.h>
#include <qstringlist.h> #include <tqstringlist.h>
#include <qpixmap.h> #include <tqpixmap.h>
#include <qmap.h> #include <tqmap.h>
class QVBoxLayout; class TQVBoxLayout;
class QHBoxLayout; class TQHBoxLayout;
class QGridLayout; class TQGridLayout;
class QComboBox; class TQComboBox;
class QLineEdit; class TQLineEdit;
class QPixmap; class TQPixmap;
class KListView; class KListView;
class KPushButton; class KPushButton;
class HelpDialogData : public QObject { class HelpDialogData : public TQObject {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
HelpDialogData() {} HelpDialogData() {}
~HelpDialogData() {} ~HelpDialogData() {}
void add( const QString & headline, QStringList* commands, const QPixmap & icon, bool first = false ); void add( const TQString & headline, TQStringList* commands, const TQPixmap & icon, bool first = false );
void remove( const QString & headline ); void remove( const TQString & headline );
/** returns all available and supported tokens /** 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; return m_map;
} }
inline const QMap<QString,QPixmap> & icons() const inline const TQMap<TQString,TQPixmap> & icons() const
{ {
return m_icons; return m_icons;
} }
inline const QString & first() const inline const TQString & first() const
{ {
return m_first; return m_first;
} }
@ -65,21 +66,22 @@ class HelpDialogData : public QObject {
void updateItems(); void updateItems();
private: private:
QMap<QString,QStringList> m_map; TQMap<TQString,TQStringList> m_map;
QMap<QString,QPixmap> m_icons; TQMap<TQString,TQPixmap> m_icons;
QString m_first; TQString m_first;
}; };
class HelpDialog : public QDialog class HelpDialog : public TQDialog
{ {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
HelpDialog( HelpDialogData* data, QWidget* parent = 0, HelpDialog( HelpDialogData* data, TQWidget* tqparent = 0,
const char* name = 0, bool modal = FALSE, WFlags fl = 0 ); const char* name = 0, bool modal = FALSE, WFlags fl = 0 );
~HelpDialog(); ~HelpDialog();
inline void setLineEdit( QLineEdit* lineedit ); inline void setLineEdit( TQLineEdit* lineedit );
public slots: public slots:
void updateItems(); void updateItems();
@ -89,7 +91,7 @@ class HelpDialog : public QDialog
void execute(); void execute();
private: private:
QComboBox* comboHeadline; TQComboBox* comboHeadline;
KListView* list; KListView* list;
KPushButton* buttonAdd; KPushButton* buttonAdd;
KPushButton* buttonClose; KPushButton* buttonClose;
@ -97,13 +99,13 @@ class HelpDialog : public QDialog
protected: protected:
HelpDialogData* m_data; HelpDialogData* m_data;
QLineEdit* text; TQLineEdit* text;
QVBoxLayout* HelpDialogLayout; TQVBoxLayout* HelpDialogLayout;
QHBoxLayout* Layout1; TQHBoxLayout* Layout1;
}; };
void HelpDialog::setLineEdit( QLineEdit* lineedit ) void HelpDialog::setLineEdit( TQLineEdit* lineedit )
{ {
text = lineedit; text = lineedit;
} }

@ -16,7 +16,7 @@
***************************************************************************/ ***************************************************************************/
// QT includes // QT includes
#include <qlistbox.h> #include <tqlistbox.h>
// Own includes // Own includes
#include "kmyhistorycombo.h" #include "kmyhistorycombo.h"
@ -25,8 +25,8 @@
#include <kconfig.h> #include <kconfig.h>
#include <klocale.h> #include <klocale.h>
#include <qpopupmenu.h> #include <tqpopupmenu.h>
#include <qtimer.h> #include <tqtimer.h>
#define TIMER_DELAY 500 #define TIMER_DELAY 500
@ -36,18 +36,18 @@
#define KRENAME_NUMBER 5003 #define KRENAME_NUMBER 5003
#define KRENAME_DATE 5004 #define KRENAME_DATE 5004
KMyHistoryCombo::KMyHistoryCombo( bool customPopup, QWidget* parent, const char* name) KMyHistoryCombo::KMyHistoryCombo( bool customPopup, TQWidget* tqparent, const char* name)
: KHistoryCombo(parent, name) : KHistoryCombo(tqparent, name)
{ {
QStringList history; TQStringList history;
QStringList completion; TQStringList completion;
KConfig* config = kapp->config(); KConfig* config = kapp->config();
config->setGroup( name ); config->setGroup( name );
this->setDuplicatesEnabled( false ); this->setDuplicatesEnabled( false );
history = config->readListEntry("History"); history = config->readListEntry("History");
completion = config->readListEntry("CompletionItems"); completion = config->readListEntry("CompletionItems");
m_timer = new QTimer(); m_timer = new TQTimer();
setHistoryItems( history ); setHistoryItems( history );
@ -55,11 +55,11 @@ KMyHistoryCombo::KMyHistoryCombo( bool customPopup, QWidget* parent, const char*
setCompletionMode( (KGlobalSettings::Completion)config->readNumEntry( "CompletionMode", setCompletionMode( (KGlobalSettings::Completion)config->readNumEntry( "CompletionMode",
KGlobalSettings::completionMode() ) ); KGlobalSettings::completionMode() ) );
connect( this, SIGNAL( textChanged( const QString & ) ), this, SLOT( textChangedGovernor() ) ); connect( this, TQT_SIGNAL( textChanged( const TQString & ) ), this, TQT_SLOT( textChangedGovernor() ) );
connect( m_timer, SIGNAL( timeout() ), this, SIGNAL( delayedTextChanged() ) ); connect( m_timer, TQT_SIGNAL( timeout() ), this, TQT_SIGNAL( delayedTextChanged() ) );
if( customPopup ) if( customPopup )
connect( this, SIGNAL( aboutToShowContextMenu( QPopupMenu* ) ), this, SLOT( slotCustomContextMenu( QPopupMenu* ) ) ); connect( this, TQT_SIGNAL( aboutToShowContextMenu( TQPopupMenu* ) ), this, TQT_SLOT( slotCustomContextMenu( TQPopupMenu* ) ) );
} }
KMyHistoryCombo::~KMyHistoryCombo() KMyHistoryCombo::~KMyHistoryCombo()
@ -81,22 +81,22 @@ void KMyHistoryCombo::saveSettings()
config->sync(); config->sync();
} }
QString KMyHistoryCombo::text( int index ) const TQString KMyHistoryCombo::text( int index ) const
{ {
return this->listBox()->text( index ); return this->listBox()->text( index );
} }
void KMyHistoryCombo::setText( const QString & text ) void KMyHistoryCombo::setText( const TQString & text )
{ {
this->lineEdit()->setText( text ); this->lineEdit()->setText( text );
} }
void KMyHistoryCombo::add( const QString & text ) void KMyHistoryCombo::add( const TQString & text )
{ {
int i; int i;
for ( i = 0; i < this->count(); i++ ) for ( i = 0; i < this->count(); i++ )
if( this->text( i ) == text ) { if( this->text( i ) == text ) {
QString tmp = this->text( i ); TQString tmp = this->text( i );
this->listBox()->removeItem( i ); this->listBox()->removeItem( i );
this->insertItem( tmp, 0 ); this->insertItem( tmp, 0 );
return; return;
@ -119,16 +119,16 @@ void KMyHistoryCombo::textChangedGovernor()
m_timer->start( TIMER_DELAY, true ); 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"), KRENAME_FILENAME );
krename->insertItem( i18n("Filename to &lowercase"), KRENAME_FILENAME_LOWER ); krename->insertItem( i18n("Filename to &lowercase"), KRENAME_FILENAME_LOWER );
krename->insertItem( i18n("Filename to &uppercase"), KRENAME_FILENAME_UPPER ); krename->insertItem( i18n("Filename to &uppercase"), KRENAME_FILENAME_UPPER );
krename->insertItem( i18n("&Number"), KRENAME_NUMBER ); krename->insertItem( i18n("&Number"), KRENAME_NUMBER );
krename->insertItem( i18n("&Date"), KRENAME_DATE ); 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->insertSeparator( 0 );
p->insertItem( i18n("Insert &KRename token"), krename, 0, 0 ); p->insertItem( i18n("Insert &KRename token"), krename, 0, 0 );
@ -136,7 +136,7 @@ void KMyHistoryCombo::slotCustomContextMenu( QPopupMenu* p )
void KMyHistoryCombo::slotInsertKRenameCommand( int id ) void KMyHistoryCombo::slotInsertKRenameCommand( int id )
{ {
QString t; TQString t;
// TODO: // TODO:
// also use constants for KRename tokens! // also use constants for KRename tokens!

@ -22,18 +22,19 @@
#include <kcombobox.h> #include <kcombobox.h>
#include <kcompletion.h> #include <kcompletion.h>
class QPopupMenu; class TQPopupMenu;
class QTimer; class TQTimer;
class KMyHistoryCombo : public KHistoryCombo { class KMyHistoryCombo : public KHistoryCombo {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
/** Create a new KMyHistoryCombo which has automatic KRename default history /** Create a new KMyHistoryCombo which has automatic KRename default history
* handling and a custom popup menu to insert tokens if customPopup is true * handling and a custom popup menu to insert tokens if customPopup is true
* *
* \param customPopup insert custom menu items into context menu. * \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(); ~KMyHistoryCombo();
/** /**
@ -46,12 +47,12 @@ class KMyHistoryCombo : public KHistoryCombo {
*/ */
void saveSettings(); 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 setText( const TQString & text );
void add( const QString & text ); void add( const TQString & text );
bool isEmpty() const; bool isEmpty() const;
signals: signals:
@ -59,14 +60,14 @@ class KMyHistoryCombo : public KHistoryCombo {
private slots: private slots:
void textChangedGovernor(); void textChangedGovernor();
void slotCustomContextMenu( QPopupMenu* p ); void slotCustomContextMenu( TQPopupMenu* p );
void slotInsertKRenameCommand( int id ); void slotInsertKRenameCommand( int id );
private: private:
QTimer* m_timer; TQTimer* m_timer;
}; };
inline QString KMyHistoryCombo::text() const inline TQString KMyHistoryCombo::text() const
{ {
return currentText(); return currentText();
} }

@ -16,12 +16,12 @@
***************************************************************************/ ***************************************************************************/
// QT includes // QT includes
#include <qcursor.h> #include <tqcursor.h>
#include <qdir.h> #include <tqdir.h>
#include <qdragobject.h> #include <tqdragobject.h>
#include <qpainter.h> #include <tqpainter.h>
#include <qpalette.h> #include <tqpalette.h>
#include <qregexp.h> #include <tqregexp.h>
// KDE includes // KDE includes
#include <kapplication.h> #include <kapplication.h>
@ -30,7 +30,7 @@
#include <klocale.h> #include <klocale.h>
#include <kio/previewjob.h> #include <kio/previewjob.h>
#include <kio/netaccess.h> #include <kio/netaccess.h>
#include <qptrlist.h> #include <tqptrlist.h>
#include <kurldrag.h> #include <kurldrag.h>
#include <kurllabel.h> #include <kurllabel.h>
#include <kpixmap.h> #include <kpixmap.h>
@ -43,8 +43,8 @@
using namespace KIO; using namespace KIO;
KMyListBox::KMyListBox(QWidget* parent, const char* name, WFlags fl) KMyListBox::KMyListBox(TQWidget* tqparent, const char* name, WFlags fl)
:KListBox(parent, name, fl) :KListBox(tqparent, name, fl)
{ {
m_running_lister_counter = 0; m_running_lister_counter = 0;
@ -52,15 +52,15 @@ KMyListBox::KMyListBox(QWidget* parent, const char* name, WFlags fl)
moving = false; moving = false;
m_sorting = UNSORTED; m_sorting = UNSORTED;
label = new KURLLabel( QString::null, "<br>" + i18n("Please add some files...") + "<br>", this ); label = new KURLLabel( TQString(), "<br>" + i18n("Please add some files...") + "<br>", this );
label->setFrameStyle( QFrame::GroupBoxPanel | QFrame::Sunken ); label->setFrameStyle( TQFrame::GroupBoxPanel | TQFrame::Sunken );
setAcceptDrops( true ); setAcceptDrops( true );
setSelectionMode(Extended); // was extended before 2.9.0 setSelectionMode(Extended); // was extended before 2.9.0
connect( this, SIGNAL(doubleClicked(QListBoxItem*)), this, SLOT(openFile(QListBoxItem*))); connect( this, TQT_SIGNAL(doubleClicked(TQListBoxItem*)), this, TQT_SLOT(openFile(TQListBoxItem*)));
connect( this, SIGNAL(returnPressed(QListBoxItem*)), this, SLOT(openFile(QListBoxItem*))); connect( this, TQT_SIGNAL(returnPressed(TQListBoxItem*)), this, TQT_SLOT(openFile(TQListBoxItem*)));
connect( label, SIGNAL( leftClickedURL() ), this, SIGNAL( addFiles() ) ); connect( label, TQT_SIGNAL( leftClickedURL() ), this, TQT_SIGNAL( addFiles() ) );
positionLabel(); positionLabel();
} }
@ -131,7 +131,7 @@ bool KMyListBox::isFile( const KURL & f, bool autoadd )
return true; 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 ); ThreadedLister* thl = new ThreadedLister( &m_add_mutex, &m_running_lister_counter, this );
thl->setDirname( dirname ); thl->setDirname( dirname );
@ -140,13 +140,13 @@ void KMyListBox::addDir( const KURL & dirname, const QString & filter, bool hidd
thl->setHidden( hidden ); thl->setHidden( hidden );
thl->setRecursive( recursively ); thl->setRecursive( recursively );
KApplication::setOverrideCursor( Qt::waitCursor ); KApplication::setOverrideCursor( TQt::waitCursor );
thl->start(); 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 ) { if( recursive ) {
ThreadedLister* thl = new ThreadedLister( &m_add_mutex, &m_running_lister_counter, this ); 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(); thl->start();
} else { } else {
// escape hiden directories // escape hiden directories
QString name = dirname.fileName(); TQString name = dirname.fileName();
if( !hidden && name.right( 1 ) != QString::fromLatin1(".") ) if( !hidden && name.right( 1 ) != TQString::tqfromLatin1(".") )
if( !isInList( dirname ) ) if( !isInList( dirname ) )
addDirName( 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 ) if( e->source() != this )
e->accept(QTextDrag::canDecode(e)); e->accept(TQTextDrag::canDecode(e));
KURL::List list; KURL::List list;
if( KURLDrag::decode( e, list ) ) if( KURLDrag::decode( e, list ) )
{ {
KApplication::setOverrideCursor( Qt::waitCursor ); KApplication::setOverrideCursor( TQt::waitCursor );
setUpdatesEnabled( false ); 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 ) 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 ) if( moving )
move( index( itemAt( e->pos() ) ) ); move( index( itemAt( e->pos() ) ) );
else { else {
KListBox::viewportMousePressEvent( e ); KListBox::viewportMousePressEvent( e );
QPoint p( e->pos() ); TQPoint p( e->pos() );
QListBoxItem *i = itemAt( p ); TQListBoxItem *i = itemAt( p );
if ( i ) { if ( i ) {
presspos = e->pos(); presspos = e->pos();
mousePressed = TRUE; 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() ) { if ( mousePressed && ( presspos - e->pos() ).manhattanLength() > KApplication::startDragDistance() ) {
mousePressed = FALSE; mousePressed = FALSE;
QListBoxItem *item = itemAt( presspos ); TQListBoxItem *item = itemAt( presspos );
if ( item ) { if ( item ) {
QStringList source = text( index( item ) ); TQStringList source = text( index( item ) );
for( int i = 0; i < (signed int)count(); i++ ) for( int i = 0; i < (signed int)count(); i++ )
if( isSelected(i) && (i != index(item) )) if( isSelected(i) && (i != index(item) ))
source.append( text(i) ); source.append( text(i) );
QUriDrag* ud = new QUriDrag(viewport()); TQUriDrag* ud = new TQUriDrag(viewport());
ud->setUnicodeUris( source ); ud->setUnicodeUris( source );
ud->drag(); ud->drag();
} }
@ -229,13 +229,13 @@ void KMyListBox::viewportMouseMoveEvent( QMouseEvent* e )
KListBox::viewportMouseMoveEvent( e ); KListBox::viewportMouseMoveEvent( e );
} }
void KMyListBox::viewportMouseReleaseEvent( QMouseEvent* e ) void KMyListBox::viewportMouseReleaseEvent( TQMouseEvent* e )
{ {
mousePressed = FALSE; mousePressed = FALSE;
KListBox::viewportMouseReleaseEvent( e ); KListBox::viewportMouseReleaseEvent( e );
} }
void KMyListBox::keyPressEvent( QKeyEvent* e ) void KMyListBox::keyPressEvent( TQKeyEvent* e )
{ {
/* /*
* TODO: Document all this keyboard commands * TODO: Document all this keyboard commands
@ -275,7 +275,7 @@ void KMyListBox::keyPressEvent( QKeyEvent* e )
emit updatePreview(); emit updatePreview();
} }
void KMyListBox::keyReleaseEvent( QKeyEvent* e ) void KMyListBox::keyReleaseEvent( TQKeyEvent* e )
{ {
if( e->key() == Key_Control ) if( e->key() == Key_Control )
ctrlPressed = false; ctrlPressed = false;
@ -283,7 +283,7 @@ void KMyListBox::keyReleaseEvent( QKeyEvent* e )
shiftPressed = false; shiftPressed = false;
} }
void KMyListBox::openFile( QListBoxItem* item ) void KMyListBox::openFile( TQListBoxItem* item )
{ {
if( item ) { if( item ) {
KMyListBoxItem* it = static_cast<KMyListBoxItem*>(item); KMyListBoxItem* it = static_cast<KMyListBoxItem*>(item);
@ -297,11 +297,11 @@ void KMyListBox::moveMode()
{ {
if ( !moving ) { if ( !moving ) {
moving = true; moving = true;
KApplication::setOverrideCursor( Qt::sizeAllCursor ); KApplication::setOverrideCursor( TQt::sizeAllCursor );
} }
} }
void KMyListBox::select( QListBoxItem* item ) void KMyListBox::select( TQListBoxItem* item )
{ {
if( !ctrlPressed && !shiftPressed ) if( !ctrlPressed && !shiftPressed )
/* Single click on the list box, /* Single click on the list box,
@ -335,13 +335,13 @@ void KMyListBox::select( QListBoxItem* item )
void KMyListBox::preview( KURL::List list ) void KMyListBox::preview( KURL::List list )
{ {
KIO::PreviewJob* job = KIO::filePreview( list, previewSize, previewSize, 0, 100, false, true, 0 ); 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, TQT_SIGNAL( gotPreview( const KFileItem*, const TQPixmap &) ), this, TQT_SLOT( previewDone( const KFileItem*, const TQPixmap &) ) );
connect( job, SIGNAL( failed( const KFileItem*)), this, SLOT( previewFailed( const KFileItem* ) )); connect( job, TQT_SIGNAL( failed( const KFileItem*)), this, TQT_SLOT( previewFailed( const KFileItem* ) ));
connect( job, SIGNAL( result( KIO::Job * ) ), this, SLOT( previewFinished() ) ); connect( job, TQT_SIGNAL( result( KIO::Job * ) ), this, TQT_SLOT( previewFinished() ) );
KApplication::setOverrideCursor( Qt::waitCursor ); 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++ ) for( unsigned int i = 0; i < count(); i++ )
if( url( i ) == item->url() ) { if( url( i ) == item->url() ) {
@ -491,7 +491,7 @@ bool KMyListBox::isInList( KURL text )
return false; return false;
} }
void KMyListBox::customEvent( QCustomEvent* e ) void KMyListBox::customEvent( TQCustomEvent* e )
{ {
if( e->type() == ThreadedLister::TYPE() ) if( e->type() == ThreadedLister::TYPE() )
{ {
@ -566,7 +566,7 @@ void KMyListBox::sortNummeric()
void KMyListBox::sortList() void KMyListBox::sortList()
{ {
KApplication::setOverrideCursor( Qt::WaitCursor ); KApplication::setOverrideCursor( TQt::WaitCursor );
if( m_sorting == ASCENDING ) if( m_sorting == ASCENDING )
sort( true ); sort( true );
@ -640,13 +640,13 @@ void KMyListBox::setSorting( int s )
emit updatePreview(); 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 z = 0;
unsigned int max = ( s1.length() > s2.length() ? s1.length() : s2.length() ); unsigned int max = ( s1.length() > s2.length() ? s1.length() : s2.length() );
QString num1; TQString num1;
QString num2; TQString num2;
for( z=0;z<max;z++) for( z=0;z<max;z++)
{ {
//if( z >= s1.length() || z >= s2.length() ) //if( z >= s1.length() || z >= s2.length() )
@ -675,9 +675,9 @@ int KMyListBox::compareNummeric( const QString & s1, const QString & s2 )
return s1.compare( 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-- ) for( int i = (int)pos; i >= 0; i-- )
if( s[i].isDigit() ) if( s[i].isDigit() )
@ -695,7 +695,7 @@ const QString KMyListBox::findNumInString( unsigned int pos, const QString & s )
return num; return num;
} }
void KMyListBox::resizeEvent( QResizeEvent* e ) void KMyListBox::resizeEvent( TQResizeEvent* e )
{ {
KListBox::resizeEvent( e ); KListBox::resizeEvent( e );
positionLabel(); positionLabel();
@ -715,14 +715,14 @@ void KMyListBox::positionLabel()
} }
else else
{ {
int x = (width() - label->minimumSizeHint().width()) / 2; int x = (width() - label->tqminimumSizeHint().width()) / 2;
int y = (height() - label->minimumSizeHint().height()) / 2; int y = (height() - label->tqminimumSizeHint().height()) / 2;
label->setGeometry( x, y, label->minimumSizeHint().width(), label->minimumSizeHint().height() ); label->setGeometry( x, y, label->tqminimumSizeHint().width(), label->tqminimumSizeHint().height() );
label->show(); label->show();
} }
} }
void KMyListBox::paintEvent( QPaintEvent* e ) void KMyListBox::paintEvent( TQPaintEvent* e )
{ {
// qDebug("Updates=%i", (int)isUpdatesEnabled() ); // qDebug("Updates=%i", (int)isUpdatesEnabled() );
//if( isUpdatesEnabled() ) //if( isUpdatesEnabled() )
@ -730,7 +730,7 @@ void KMyListBox::paintEvent( QPaintEvent* e )
} }
KMyListBoxItem::KMyListBoxItem( const KMyListBoxItem* item ) KMyListBoxItem::KMyListBoxItem( const KMyListBoxItem* item )
: QListBoxItem() : TQListBoxItem()
{ {
m_url = item->url(); m_url = item->url();
m_dir = item->dir(); m_dir = item->dir();
@ -739,19 +739,19 @@ KMyListBoxItem::KMyListBoxItem( const KMyListBoxItem* item )
} }
KMyListBoxItem::KMyListBoxItem( const KURL & u, bool b ) KMyListBoxItem::KMyListBoxItem( const KURL & u, bool b )
: QListBoxItem() : TQListBoxItem()
{ {
m_url = u; m_url = u;
m_dir = b; m_dir = b;
m_has_preview = false; m_has_preview = false;
} }
void KMyListBoxItem::setPixmap( const QPixmap & pix ) void KMyListBoxItem::setPixmap( const TQPixmap & pix )
{ {
KMyListBox* box = static_cast<KMyListBox*>(this->listBox()); KMyListBox* box = static_cast<KMyListBox*>(this->listBox());
pm.resize( box->getPreviewSize(), box->getPreviewSize() ); pm.resize( box->getPreviewSize(), box->getPreviewSize() );
pm.fill( box->colorGroup().base() ); pm.fill( box->tqcolorGroup().base() );
QPainter painter( &pm ); TQPainter painter( &pm );
painter.drawPixmap( (pm.width()-pix.width())/2, (pm.height()-pix.height())/2, pix ); painter.drawPixmap( (pm.width()-pix.width())/2, (pm.height()-pix.height())/2, pix );
m_has_preview = true; m_has_preview = true;
} }
@ -766,11 +766,11 @@ void KMyListBoxItem::setPreview( bool b )
KMyListBoxItem::m_preview = b; KMyListBoxItem::m_preview = b;
} }
void KMyListBoxItem::paint( QPainter *painter ) void KMyListBoxItem::paint( TQPainter *painter )
{ {
if( !KMyListBoxItem::m_preview ) { if( !KMyListBoxItem::m_preview ) {
int itemHeight = height( listBox() ); int itemHeight = height( listBox() );
QFontMetrics fm = painter->fontMetrics(); TQFontMetrics fm = painter->fontMetrics();
int yPos = ( ( itemHeight - fm.height() ) / 2 ) + fm.ascent(); int yPos = ( ( itemHeight - fm.height() ) / 2 ) + fm.ascent();
painter->drawText( 3, yPos, text() ); painter->drawText( 3, yPos, text() );
} else { } else {
@ -788,48 +788,48 @@ void KMyListBoxItem::paint( QPainter *painter )
painter->drawPixmap( 3, yPos, pm); painter->drawPixmap( 3, yPos, pm);
else else
{ {
KPixmap pix = KPixmapEffect::selectedPixmap( pm, listBox()->colorGroup().highlight() ); KPixmap pix = KPixmapEffect::selectedPixmap( pm, listBox()->tqcolorGroup().highlight() );
painter->drawPixmap( 3, yPos, pix ); painter->drawPixmap( 3, yPos, pix );
} }
if( KMyListBoxItem::m_name && !m_url.isEmpty() ) { if( KMyListBoxItem::m_name && !m_url.isEmpty() ) {
QFontMetrics fm = painter->fontMetrics(); TQFontMetrics fm = painter->fontMetrics();
yPos = ( ( itemHeight - fm.height() ) / 2 ) + fm.ascent(); yPos = ( ( itemHeight - fm.height() ) / 2 ) + fm.ascent();
painter->drawText( pm.width() + 5, yPos, text() ); 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 ) { if( !KMyListBoxItem::m_preview ) {
int h = listBox() ? listBox()->fontMetrics().lineSpacing() + 2 : 0; int h = listBox() ? listBox()->fontMetrics().lineSpacing() + 2 : 0;
return QMAX( h, QApplication::globalStrut().height() ); return TQMAX( h, TQApplication::globalStrut().height() );
} else { } else {
int h; int h;
if ( KMyListBoxItem::m_name && !m_url.prettyURL().isEmpty() ) if ( KMyListBoxItem::m_name && !m_url.prettyURL().isEmpty() )
h = pm.height(); h = pm.height();
else 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 ) { if( !KMyListBoxItem::m_preview ) {
int w = listBox() ? listBox()->fontMetrics().width( text() ) + 6 : 0; int w = listBox() ? listBox()->fontMetrics().width( text() ) + 6 : 0;
return QMAX( w, QApplication::globalStrut().width() ); return TQMAX( w, TQApplication::globalStrut().width() );
} else { } else {
if ( m_url.path().isEmpty() || !KMyListBoxItem::m_name) 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 ); return m_url.prettyURL( 0, m_url.isLocalFile() ? KURL::StripFileProtocol : KURL::NoAdjustements );
} }

@ -23,29 +23,30 @@
#include <kurl.h> #include <kurl.h>
#include <kfileitem.h> #include <kfileitem.h>
// Qt includes // TQt includes
#include <qmutex.h> #include <tqmutex.h>
#include <qstringlist.h> #include <tqstringlist.h>
class ThreadedLister; class ThreadedLister;
class KFileItem; class KFileItem;
class KURLLabel; class KURLLabel;
class QDragObject; class TQDragObject;
class QPixmap; class TQPixmap;
class QPainter; class TQPainter;
class QPoint; class TQPoint;
class KMyListBox : public KListBox { class KMyListBox : public KListBox {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
enum { ASCENDING = 1, DESCENDING = 2, RANDOM = 3, NUMMERIC = 4, UNSORTED = 0 }; 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(); ~KMyListBox();
void removeItem( int index ); void removeItem( int index );
void addDir( const KURL & dirname, const QString & m_filter, bool m_hidden, bool recursively, bool dirnames = false ); void addDir( const KURL & dirname, const TQString & 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 addDirName( const KURL & dirname, const TQString & m_filter, bool m_hidden, bool recursive = false );
void setPreview( bool prv ); void setPreview( bool prv );
inline int sorting() const { return m_sorting; } inline int sorting() const { return m_sorting; }
@ -94,13 +95,13 @@ class KMyListBox : public KListBox {
private: private:
void preview( KURL::List list ); void preview( KURL::List list );
void dropEvent( QDropEvent* e ); void dropEvent( TQDropEvent* e );
void dragEnterEvent( QDragEnterEvent* e ); void dragEnterEvent( TQDragEnterEvent* e );
void viewportMousePressEvent( QMouseEvent* e ); void viewportMousePressEvent( TQMouseEvent* e );
void viewportMouseReleaseEvent( QMouseEvent* e ); void viewportMouseReleaseEvent( TQMouseEvent* e );
void viewportMouseMoveEvent( QMouseEvent* e ); void viewportMouseMoveEvent( TQMouseEvent* e );
void keyPressEvent( QKeyEvent* e ); void keyPressEvent( TQKeyEvent* e );
void keyReleaseEvent( QKeyEvent* e ); void keyReleaseEvent( TQKeyEvent* e );
bool isInList( KURL text ); bool isInList( KURL text );
@ -112,23 +113,23 @@ class KMyListBox : public KListBox {
void sortList(); void sortList();
void setButtonText(); void setButtonText();
int compareNummeric( const QString & s1, const QString & s2 ); int compareNummeric( const TQString & s1, const TQString & s2 );
const QString findNumInString( unsigned int pos, const QString & s ); const TQString findNumInString( unsigned int pos, const TQString & s );
private slots: private slots:
void openFile( QListBoxItem* item ); void openFile( TQListBoxItem* item );
void select( QListBoxItem* 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 previewFailed( const KFileItem* item );
void previewFinished(); void previewFinished();
void listerDone( ThreadedLister* lister ); void listerDone( ThreadedLister* lister );
protected: protected:
void resizeEvent( QResizeEvent* e ); void resizeEvent( TQResizeEvent* e );
void customEvent( QCustomEvent* e ); void customEvent( TQCustomEvent* e );
void paintEvent( QPaintEvent* e ); void paintEvent( TQPaintEvent* e );
bool drag; bool drag;
bool mousePressed; bool mousePressed;
@ -139,15 +140,15 @@ class KMyListBox : public KListBox {
int m_sorting; int m_sorting;
unsigned int m_running_lister_counter; unsigned int m_running_lister_counter;
QMutex m_add_mutex; TQMutex m_add_mutex;
KURLLabel* label; KURLLabel* label;
QDragObject* drobj; TQDragObject* drobj;
QPoint presspos; TQPoint presspos;
}; };
class KMyListBoxItem : public QListBoxItem { class KMyListBoxItem : public TQListBoxItem {
public: public:
KMyListBoxItem( const KMyListBoxItem* item ); KMyListBoxItem( const KMyListBoxItem* item );
KMyListBoxItem( const KURL&, bool ); KMyListBoxItem( const KURL&, bool );
@ -156,28 +157,28 @@ class KMyListBoxItem : public QListBoxItem {
static void setName( bool b ); static void setName( bool b );
static void setPreview( 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 preview() { return m_preview; }
static bool name() { return m_name; } static bool name() { return m_name; }
inline bool dir() const { return m_dir; } inline bool dir() const { return m_dir; }
inline KURL url() const { return m_url; } inline KURL url() const { return m_url; }
inline const QPixmap* pixmap() const { return &pm; } inline const TQPixmap* pixmap() const { return &pm; }
private: private:
QString text() const; TQString text() const;
protected: protected:
virtual void paint( QPainter *painter ); virtual void paint( TQPainter *painter );
virtual int width( const QListBox* ) const; virtual int width( const TQListBox* ) const;
virtual int height( const QListBox* lb ) const; virtual int height( const TQListBox* lb ) const;
private: private:
KURL m_url; KURL m_url;
bool m_dir; bool m_dir;
bool m_has_preview; bool m_has_preview;
QPixmap pm; TQPixmap pm;
static bool m_preview; static bool m_preview;
static bool m_name; static bool m_name;

@ -24,16 +24,16 @@
#include <kpopupmenu.h> #include <kpopupmenu.h>
#include <krun.h> #include <krun.h>
KMyListView::KMyListView( QValueList<manualchanges>* _changes, KMyListBox* _list, QWidget* parent, const char* name ) KMyListView::KMyListView( TQValueList<manualchanges>* _changes, KMyListBox* _list, TQWidget* tqparent, const char* name )
:KListView(parent, name ) :KListView(tqparent, name )
{ {
changes = _changes; changes = _changes;
list = _list; list = _list;
connect( this, SIGNAL( doubleClicked(QListViewItem*, const QPoint&, int) ), connect( this, TQT_SIGNAL( doubleClicked(TQListViewItem*, const TQPoint&, int) ),
this, SLOT( changeItem(QListViewItem*, const QPoint&, int) ) ); this, TQT_SLOT( changeItem(TQListViewItem*, const TQPoint&, int) ) );
connect( this, SIGNAL( contextMenuRequested(QListViewItem*, const QPoint&, int) ), connect( this, TQT_SIGNAL( contextMenuRequested(TQListViewItem*, const TQPoint&, int) ),
this, SLOT( showContext(QListViewItem*, const QPoint&, int) ) ); this, TQT_SLOT( showContext(TQListViewItem*, const TQPoint&, int) ) );
setAllColumnsShowFocus( true ); 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; if(!item) return;
KURL url = list->url( itemIndex( item ) ); KURL url = list->url( itemIndex( item ) );
bool revertenable = false; bool revertenable = false;
QValueList<manualchanges>::iterator it; TQValueList<manualchanges>::iterator it;
for ( it = changes->begin(); it != changes->end(); ++it ) for ( it = changes->begin(); it != changes->end(); ++it )
if( (*it).url == url ) { if( (*it).url == url ) {
changes->remove( it ); changes->remove( it );
@ -73,19 +73,19 @@ void KMyListView::changeItem( QListViewItem* item, const QPoint&, int )
emit itemChanged(); 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 ); KPopupMenu* menu = new KPopupMenu( this );
if(item) { if(item) {
menu->insertTitle( list->text( itemIndex( item ) ), 0, 0 ); 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->insertSeparator();
menu->insertItem( BarIcon("exec"), i18n("Open"), this, SLOT( openCurrent() ) ); menu->insertItem( BarIcon("exec"), i18n("Open"), this, TQT_SLOT( openCurrent() ) );
menu->insertSeparator(); menu->insertSeparator();
} }
menu->insertItem( BarIcon("fileopen"), i18n("&Add..."), this, SLOT( addFiles() ) ); menu->insertItem( BarIcon("fileopen"), i18n("&Add..."), this, TQT_SLOT( addFiles() ) );
if(item) if(item)
menu->insertItem( BarIcon("editdelete"), i18n("&Remove"), this, SLOT( removeCurrentItem() ) ); menu->insertItem( BarIcon("editdelete"), i18n("&Remove"), this, TQT_SLOT( removeCurrentItem() ) );
menu->popup( pos ); menu->popup( pos );
} }
@ -103,7 +103,7 @@ void KMyListView::addFiles()
void KMyListView::changeCurrentItem() void KMyListView::changeCurrentItem()
{ {
changeItem( currentItem(), QPoint( 0, 0 ), 0 ); changeItem( currentItem(), TQPoint( 0, 0 ), 0 );
} }
void KMyListView::openCurrent() void KMyListView::openCurrent()
@ -114,64 +114,64 @@ void KMyListView::openCurrent()
///////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////
KMyListViewItem::KMyListViewItem(QListView *parent) KMyListViewItem::KMyListViewItem(TQListView *tqparent)
: KListViewItem(parent) : KListViewItem(tqparent)
{ } { }
KMyListViewItem::KMyListViewItem(QListViewItem *parent) KMyListViewItem::KMyListViewItem(TQListViewItem *tqparent)
: KListViewItem(parent) : KListViewItem(tqparent)
{ } { }
KMyListViewItem::KMyListViewItem(QListView *parent, QListViewItem *after) KMyListViewItem::KMyListViewItem(TQListView *tqparent, TQListViewItem *after)
: KListViewItem(parent, after) : KListViewItem(tqparent, after)
{ } { }
KMyListViewItem::KMyListViewItem(QListViewItem *parent, QListViewItem *after) KMyListViewItem::KMyListViewItem(TQListViewItem *tqparent, TQListViewItem *after)
: KListViewItem(parent, after) : KListViewItem(tqparent, after)
{ } { }
KMyListViewItem::KMyListViewItem(bool m, QListView *parent, KMyListViewItem::KMyListViewItem(bool m, TQListView *tqparent,
QString label1, QString label2, QString label3, QString label4, TQString label1, TQString label2, TQString label3, TQString label4,
QString label5, QString label6, QString label7, QString label8) TQString label5, TQString label6, TQString label7, TQString label8)
: KListViewItem(parent, label1, label2, label3, label4, label5, label6, label7, label8) : KListViewItem(tqparent, label1, label2, label3, label4, label5, label6, label7, label8)
{ {
modified = m; modified = m;
} }
KMyListViewItem::KMyListViewItem(bool m, QListViewItem *parent, KMyListViewItem::KMyListViewItem(bool m, TQListViewItem *tqparent,
QString label1, QString label2, QString label3, QString label4, TQString label1, TQString label2, TQString label3, TQString label4,
QString label5, QString label6, QString label7, QString label8) TQString label5, TQString label6, TQString label7, TQString label8)
: KListViewItem(parent, label1, label2, label3, label4, label5, label6, label7, label8) : KListViewItem(tqparent, label1, label2, label3, label4, label5, label6, label7, label8)
{ {
modified = m; modified = m;
} }
KMyListViewItem::KMyListViewItem(bool m, QListView *parent, QListViewItem *after, KMyListViewItem::KMyListViewItem(bool m, TQListView *tqparent, TQListViewItem *after,
QString label1, QString label2, QString label3, QString label4, TQString label1, TQString label2, TQString label3, TQString label4,
QString label5, QString label6, QString label7, QString label8) TQString label5, TQString label6, TQString label7, TQString label8)
: KListViewItem(parent, after, label1, label2, label3, label4, label5, label6, label7, label8) : KListViewItem(tqparent, after, label1, label2, label3, label4, label5, label6, label7, label8)
{ {
modified = m; modified = m;
} }
KMyListViewItem::KMyListViewItem(QListViewItem *parent, QListViewItem *after, KMyListViewItem::KMyListViewItem(TQListViewItem *tqparent, TQListViewItem *after,
QString label1, QString label2, QString label3, QString label4, TQString label1, TQString label2, TQString label3, TQString label4,
QString label5, QString label6, QString label7, QString label8) TQString label5, TQString label6, TQString label7, TQString label8)
: KListViewItem(parent, after, label1, label2, label3, label4, label5, label6, label7, label8) : KListViewItem(tqparent, after, label1, label2, label3, label4, label5, label6, label7, label8)
{ } { }
KMyListViewItem::~KMyListViewItem() KMyListViewItem::~KMyListViewItem()
{ } { }
void KMyListViewItem::paintCell( QPainter *p, const QColorGroup &cg, void KMyListViewItem::paintCell( TQPainter *p, const TQColorGroup &cg,
int column, int width, int alignment ) int column, int width, int tqalignment )
{ {
QColorGroup _cg( cg ); TQColorGroup _cg( cg );
QColor c = _cg.text(); TQColor c = _cg.text();
if( modified ) if( modified )
_cg.setColor( QColorGroup::Text, Qt::red ); _cg.setColor( TQColorGroup::Text, TQt::red );
KListViewItem::paintCell( p, _cg, column, width, alignment ); KListViewItem::paintCell( p, _cg, column, width, tqalignment );
_cg.setColor( QColorGroup::Text, c ); _cg.setColor( TQColorGroup::Text, c );
} }

@ -21,13 +21,14 @@
#include "batchrenamer.h" #include "batchrenamer.h"
#include "kmylistbox.h" #include "kmylistbox.h"
#include <klistview.h> #include <klistview.h>
#include <qvaluelist.h> #include <tqvaluelist.h>
class QMouseEvent; class TQMouseEvent;
class KMyListView : public KListView { class KMyListView : public KListView {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: 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(); ~KMyListView();
signals: signals:
@ -36,55 +37,55 @@ class KMyListView : public KListView {
void addFile(); void addFile();
private slots: private slots:
void changeItem( QListViewItem* item, const QPoint&, int ); void changeItem( TQListViewItem* item, const TQPoint&, int );
void showContext( QListViewItem* item, const QPoint& pos, int ); void showContext( TQListViewItem* item, const TQPoint& pos, int );
void removeCurrentItem(); void removeCurrentItem();
void addFiles(); void addFiles();
void changeCurrentItem(); void changeCurrentItem();
void openCurrent(); void openCurrent();
private: private:
QValueList<manualchanges>* changes; TQValueList<manualchanges>* changes;
KMyListBox* list; KMyListBox* list;
}; };
///////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////
class QColor; class TQColor;
class QString; class TQString;
class KMyListViewItem : public KListViewItem { class KMyListViewItem : public KListViewItem {
public: public:
KMyListViewItem(QListView *parent); KMyListViewItem(TQListView *tqparent);
KMyListViewItem(QListViewItem *parent); KMyListViewItem(TQListViewItem *tqparent);
KMyListViewItem(QListView *parent, QListViewItem *after); KMyListViewItem(TQListView *tqparent, TQListViewItem *after);
KMyListViewItem(QListViewItem *parent, QListViewItem *after); KMyListViewItem(TQListViewItem *tqparent, TQListViewItem *after);
KMyListViewItem(bool m, QListView *parent, KMyListViewItem(bool m, TQListView *tqparent,
QString, QString = QString::null, TQString, TQString = TQString(),
QString = QString::null, QString = QString::null, TQString = TQString(), TQString = TQString(),
QString = QString::null, QString = QString::null, TQString = TQString(), TQString = TQString(),
QString = QString::null, QString = QString::null); TQString = TQString(), TQString = TQString());
KMyListViewItem(bool m, QListViewItem *parent, KMyListViewItem(bool m, TQListViewItem *tqparent,
QString, QString = QString::null, TQString, TQString = TQString(),
QString = QString::null, QString = QString::null, TQString = TQString(), TQString = TQString(),
QString = QString::null, QString = QString::null, TQString = TQString(), TQString = TQString(),
QString = QString::null, QString = QString::null); TQString = TQString(), TQString = TQString());
KMyListViewItem(bool m, QListView *parent, QListViewItem *after, KMyListViewItem(bool m, TQListView *tqparent, TQListViewItem *after,
QString, QString = QString::null, TQString, TQString = TQString(),
QString = QString::null, QString = QString::null, TQString = TQString(), TQString = TQString(),
QString = QString::null, QString = QString::null, TQString = TQString(), TQString = TQString(),
QString = QString::null, QString = QString::null); TQString = TQString(), TQString = TQString());
KMyListViewItem(QListViewItem *parent, QListViewItem *after, KMyListViewItem(TQListViewItem *tqparent, TQListViewItem *after,
QString, QString = QString::null, TQString, TQString = TQString(),
QString = QString::null, QString = QString::null, TQString = TQString(), TQString = TQString(),
QString = QString::null, QString = QString::null, TQString = TQString(), TQString = TQString(),
QString = QString::null, QString = QString::null); TQString = TQString(), TQString = TQString());
virtual ~KMyListViewItem(); 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: private:
bool modified; bool modified;

@ -15,11 +15,11 @@
* * * *
***************************************************************************/ ***************************************************************************/
#include <qtimer.h> #include <tqtimer.h>
#include "krecursivelister.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; lister = 0L;
filelist.clear(); filelist.clear();
dirlist.clear(); dirlist.clear();
@ -27,7 +27,7 @@ KRecursiveLister::KRecursiveLister(QObject *parent, const char *name ) : QObject
allItems.setAutoDelete( true ); // only there to delete all items allItems.setAutoDelete( true ); // only there to delete all items
m_hidden = false; m_hidden = false;
m_dirs = false; m_dirs = false;
m_filter = QString::null; m_filter = TQString();
} }
KRecursiveLister::~KRecursiveLister(){ 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 */ /** Starts listing the specified url */
@ -82,7 +82,7 @@ void KRecursiveLister::startListing(const KURL& url){
lister->setShowingDotFiles( m_hidden ); lister->setShowingDotFiles( m_hidden );
lister->setNameFilter( m_filter ); lister->setNameFilter( m_filter );
lister->setDirOnlyMode( m_dirs ); 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 ); lister->openURL( url, false, false );

@ -18,11 +18,11 @@
#ifndef KRECURSIVELISTER_H #ifndef KRECURSIVELISTER_H
#define KRECURSIVELISTER_H #define KRECURSIVELISTER_H
#include <qwidget.h> #include <tqwidget.h>
#include <qobject.h> #include <tqobject.h>
#include <kdirlister.h> #include <kdirlister.h>
#include <kfileitem.h> #include <kfileitem.h>
#include <qguardedptr.h> #include <tqguardedptr.h>
/**A convienience class that recursively lists a directory /**A convienience class that recursively lists a directory
*@author Jonathon Sim *@author Jonathon Sim
@ -32,11 +32,12 @@
* and support for listing directories along with files. * and support for listing directories along with files.
*/ */
class KRecursiveLister : public QObject { class KRecursiveLister : public TQObject {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
KRecursiveLister(QObject *parent=0, const char *name=0); KRecursiveLister(TQObject *tqparent=0, const char *name=0);
~KRecursiveLister(); ~KRecursiveLister();
/** Returns the list of fileitems found. */ /** Returns the list of fileitems found. */
@ -46,7 +47,7 @@ public:
inline void setShowingDotFiles( bool dotfiles ); inline void setShowingDotFiles( bool dotfiles );
/** filter to be used */ /** filter to be used */
inline void setNameFilter( const QString & filter ); inline void setNameFilter( const TQString & filter );
/** list only directories */ /** list only directories */
inline void setDirOnlyMode( bool dirsOnly ); inline void setDirOnlyMode( bool dirsOnly );
@ -81,11 +82,11 @@ protected: // Protected methods
KFileItemList dirlist; //Dirs remaining to list KFileItemList dirlist; //Dirs remaining to list
KFileItemList dirtree; KFileItemList dirtree;
KFileItemList allItems; KFileItemList allItems;
QGuardedPtr<KDirLister> lister; //The current KDirLister TQGuardedPtr<KDirLister> lister; //The current KDirLister
bool m_hidden; bool m_hidden;
bool m_dirs; bool m_dirs;
QString m_filter; TQString m_filter;
}; };
void KRecursiveLister::setShowingDotFiles( bool dotfiles ) void KRecursiveLister::setShowingDotFiles( bool dotfiles )
@ -93,7 +94,7 @@ void KRecursiveLister::setShowingDotFiles( bool dotfiles )
m_hidden = dotfiles; m_hidden = dotfiles;
} }
void KRecursiveLister::setNameFilter( const QString & filter ) void KRecursiveLister::setNameFilter( const TQString & filter )
{ {
m_filter = filter; m_filter = filter;
} }

@ -19,7 +19,7 @@
#define KRENAMEDCOP_H #define KRENAMEDCOP_H
#include <dcopobject.h> #include <dcopobject.h>
#include <qstringlist.h> #include <tqstringlist.h>
#include <kurl.h> #include <kurl.h>
class KRenameDCOP : virtual public DCOPObject class KRenameDCOP : virtual public DCOPObject
@ -28,15 +28,15 @@ class KRenameDCOP : virtual public DCOPObject
public: public:
k_dcop: k_dcop:
virtual void addFileOrDir( const QString & name ) = 0; virtual void addFileOrDir( const TQString & name ) = 0;
virtual void addDir( const QString & name, const QString & filter, bool recursive, bool hidden, bool dirnames ) = 0; virtual void addDir( const TQString & name, const TQString & filter, bool recursive, bool hidden, bool dirnames ) = 0;
virtual void updatePre() = 0; virtual void updatePre() = 0;
virtual void setFileNameTemplate( const QString & t ) = 0; virtual void setFileNameTemplate( const TQString & t ) = 0;
virtual const QString fileNameTemplate() const = 0; virtual const TQString fileNameTemplate() const = 0;
virtual void setExtensionTemplate( const QString & t ) = 0; virtual void setExtensionTemplate( const TQString & t ) = 0;
virtual const QString extensionTemplate() const = 0; virtual const TQString extensionTemplate() const = 0;
virtual void setUseExtension( bool b ) = 0; virtual void setUseExtension( bool b ) = 0;
virtual bool useExtension() const = 0; virtual bool useExtension() const = 0;
@ -46,9 +46,9 @@ class KRenameDCOP : virtual public DCOPObject
virtual void start() = 0; 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 */ #endif /* KRENAMEDCOP_H */

File diff suppressed because it is too large Load Diff

@ -41,35 +41,36 @@ class MyHelpCombo;
class MyLabel; class MyLabel;
class Plugin; class Plugin;
class PluginLoader; class PluginLoader;
class QButtonGroup; class TQButtonGroup;
class QCheckBox; class TQCheckBox;
class QGroupBox; class TQGroupBox;
class QFileInfo; class TQFileInfo;
class QFrame; class TQFrame;
class QHBoxLayout; class TQHBoxLayout;
class QLabel; class TQLabel;
class QLineEdit; class TQLineEdit;
class QListView; class TQListView;
class QPushButton; class TQPushButton;
class QRect; class TQRect;
class QWidgetStack; class TQWidgetStack;
class QRadioButton; class TQRadioButton;
class QVBoxLayout; class TQVBoxLayout;
class QVGroupBox; class TQVGroupBox;
class QWidget; class TQWidget;
#include <kguiitem.h> #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 Q_OBJECT
TQ_OBJECT
friend class ProfileManager; friend class ProfileManager;
friend class ProfileDlg; friend class ProfileDlg;
friend class tabs; friend class tabs;
public: public:
KRenameImpl( QWidget* p, KMenuBar* m, QPushButton* finish ); KRenameImpl( TQWidget* p, KMenuBar* m, TQPushButton* finish );
~KRenameImpl(); ~KRenameImpl();
void setWizardMode( bool mode ); void setWizardMode( bool mode );
@ -81,27 +82,27 @@ class KRenameImpl : public QObject, public KRenameDCOP {
void addFileOrDir( const KURL & name ); void addFileOrDir( const KURL & name );
void setup( bool wizardmode ); void setup( bool wizardmode );
void changeParent( QWidget* p, KMenuBar* m, QPushButton* finish, QRect r ); void changeParent( TQWidget* p, KMenuBar* m, TQPushButton* finish, TQRect r );
static QWidget* launch( QRect rect, const KURL::List & list, KRenameImpl* impl = 0, bool loadprofile = true ); static TQWidget* launch( TQRect rect, const KURL::List & list, KRenameImpl* impl = 0, bool loadprofile = true );
/** DCOP functions we have to implement /** DCOP functions we have to implement
*/ */
void addFileOrDir( const QString & name ); void addFileOrDir( const TQString & name );
const QString fileNameTemplate() const; const TQString fileNameTemplate() const;
inline int counterStart() const; inline int counterStart() const;
void setExtensionTemplate( const QString & t ); void setExtensionTemplate( const TQString & t );
const QString extensionTemplate() const; const TQString extensionTemplate() const;
void setUseExtension( bool b ); void setUseExtension( bool b );
bool useExtension() const; bool useExtension() const;
QStringList tokens() const; TQStringList tokens() const;
QString parseString( const QString & token, const QString & string ); TQString parseString( const TQString & token, const TQString & string );
void addDir( const QString & name, const QString & filter, bool recursive, bool hidden, bool dirnames ); 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 /** @returns true if the user has specified a profile on the commandline
* other wise false is returned * other wise false is returned
@ -109,11 +110,11 @@ class KRenameImpl : public QObject, public KRenameDCOP {
inline bool hasCommandlineProfile() const; inline bool hasCommandlineProfile() const;
public slots: public slots:
void setFileNameTemplate( const QString & t ); void setFileNameTemplate( const TQString & t );
void setCounterStart( int index ); void setCounterStart( int index );
signals: signals:
void pageDone( QWidget* page, const QString & title ); void pageDone( TQWidget* page, const TQString & title );
void showPage( int page ); void showPage( int page );
void enableFinish( bool b ); void enableFinish( bool b );
@ -130,7 +131,7 @@ class KRenameImpl : public QObject, public KRenameDCOP {
void removeFile(); void removeFile();
void removeFile( int index ); void removeFile( int index );
void preferences(); void preferences();
void replace(); void tqreplace();
void saveConfig(); void saveConfig();
void start(); void start();
void updateCount(); void updateCount();
@ -147,7 +148,7 @@ class KRenameImpl : public QObject, public KRenameDCOP {
void loadFilePlugins(); void loadFilePlugins();
void reloadFilePluginData(); void reloadFilePluginData();
void manageProfiles(); void manageProfiles();
QString easyOptions( KComboBox* combo, KMyHistoryCombo* custom ); TQString easyOptions( KComboBox* combo, KMyHistoryCombo* custom );
void slotEasy1(); void slotEasy1();
void slotEasy2(); void slotEasy2();
void slotEasy3(); void slotEasy3();
@ -173,7 +174,7 @@ class KRenameImpl : public QObject, public KRenameDCOP {
void loadConfig(); void loadConfig();
void fillStructures( BatchRenamer* b, bool preview ); void fillStructures( BatchRenamer* b, bool preview );
bool setupBatchRenamer( 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 setupActions();
void setupPage1(); void setupPage1();
@ -186,29 +187,29 @@ class KRenameImpl : public QObject, public KRenameDCOP {
void setupPages(); void setupPages();
void updateHist(); void updateHist();
void parseCommandline(); 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 refreshColumnMode();
void parseWizardMode(); void parseWizardMode();
void getHelpDialogString( QLineEdit* edit ); void getHelpDialogString( TQLineEdit* edit );
protected: protected:
QWidget* parent; TQWidget* tqparent;
KMenuBar* menuBar; KMenuBar* menuBar;
KPopupMenu* mnuSort; KPopupMenu* mnuSort;
KAction* loadPlugins; KAction* loadPlugins;
QPushButton* finishButton; TQPushButton* finishButton;
PluginLoader* plugin; PluginLoader* plugin;
QWidgetStack* fileTab; TQWidgetStack* fileTab;
QWidget* page_1; TQWidget* page_1;
QWidget* page_2; TQWidget* page_2;
KJanusWidget* page_3; KJanusWidget* page_3;
QWidget* page_4; TQWidget* page_4;
bool m_wizard; bool m_wizard;
bool m_loadplugins; bool m_loadplugins;
@ -241,27 +242,27 @@ class KRenameImpl : public QObject, public KRenameDCOP {
KPushButton* buttonEasy4; KPushButton* buttonEasy4;
KComboBox* comboSort; KComboBox* comboSort;
QLabel* description; TQLabel* description;
QLabel* description2; TQLabel* description2;
QLabel* description3; TQLabel* description3;
QLabel* description4; TQLabel* description4;
QLabel* labelTemplate; TQLabel* labelTemplate;
QLabel* labelHelp; TQLabel* labelHelp;
QLabel* labelCount; TQLabel* labelCount;
QLabel* labelPoint; TQLabel* labelPoint;
KMyListBox* fileList; KMyListBox* fileList;
KMyListView* preview; KMyListView* preview;
QButtonGroup* groupOptions; TQButtonGroup* groupOptions;
QRadioButton* optionCopy; TQRadioButton* optionCopy;
QRadioButton* optionMove; TQRadioButton* optionMove;
QRadioButton* optionRename; TQRadioButton* optionRename;
QRadioButton* optionLink; TQRadioButton* optionLink;
QGroupBox* groupExtension; TQGroupBox* groupExtension;
QVGroupBox* groupUndo; TQVGroupBox* groupUndo;
KMyHistoryCombo* dirname; KMyHistoryCombo* dirname;
KURLRequester* urlrequester; KURLRequester* urlrequester;
@ -269,11 +270,11 @@ class KRenameImpl : public QObject, public KRenameDCOP {
KMyHistoryCombo* filename; KMyHistoryCombo* filename;
KMyHistoryCombo* extemplate; KMyHistoryCombo* extemplate;
QCheckBox* checkName; TQCheckBox* checkName;
QCheckBox* checkExtension; TQCheckBox* checkExtension;
QCheckBox* checkOverwrite; TQCheckBox* checkOverwrite;
QCheckBox* checkPreview; TQCheckBox* checkPreview;
QCheckBox* checkUndoScript; TQCheckBox* checkUndoScript;
KComboBox* comboExtension; KComboBox* comboExtension;
@ -282,8 +283,8 @@ class KRenameImpl : public QObject, public KRenameDCOP {
HelpDialogData* helpDialogData; HelpDialogData* helpDialogData;
BatchRenamer* b; BatchRenamer* b;
QValueList<int> skip; TQValueList<int> skip;
QValueList<replacestrings> rep; TQValueList<replacestrings> rep;
// ========== // ==========
// Easy mode: // Easy mode:
@ -306,37 +307,37 @@ class KRenameImpl : public QObject, public KRenameDCOP {
// Layout: // Layout:
// =========== // ===========
QHBoxLayout* pageLayout; TQHBoxLayout* pageLayout;
QVBoxLayout* pageLayout_2; TQVBoxLayout* pageLayout_2;
QVBoxLayout* pageLayout_3; TQVBoxLayout* pageLayout_3;
QVBoxLayout* pageLayout_4; TQVBoxLayout* pageLayout_4;
QHBoxLayout* tabLayout_0; TQHBoxLayout* tabLayout_0;
QHBoxLayout* tabLayout_1; TQHBoxLayout* tabLayout_1;
QHBoxLayout* tabLayout_2; TQHBoxLayout* tabLayout_2;
QVBoxLayout* tabLayout_3; TQVBoxLayout* tabLayout_3;
QVBoxLayout* groupAdvancedExtensionLayout; TQVBoxLayout* groupAdvancedExtensionLayout;
QVBoxLayout* groupOptionsLayout; TQVBoxLayout* groupOptionsLayout;
QHBoxLayout* groupDirLayout; TQHBoxLayout* groupDirLayout;
QVBoxLayout* groupNumberLayout; TQVBoxLayout* groupNumberLayout;
QHBoxLayout* groupExtensionLayout; TQHBoxLayout* groupExtensionLayout;
// page1 // page1
QHBoxLayout* Layout2; TQHBoxLayout* Layout2;
QVBoxLayout* Layout3; TQVBoxLayout* Layout3;
QHBoxLayout* Layout4; TQHBoxLayout* Layout4;
QVBoxLayout* Layout5; TQVBoxLayout* Layout5;
// page4 // page4
QVBoxLayout* Layout10; TQVBoxLayout* Layout10;
QHBoxLayout* Layout15; TQHBoxLayout* Layout15;
QVBoxLayout* Layout16; TQVBoxLayout* Layout16;
QHBoxLayout* Layout22; TQHBoxLayout* Layout22;
QVBoxLayout* Layout23; TQVBoxLayout* Layout23;
// tab // tab
QHBoxLayout* Layout100; TQHBoxLayout* Layout100;
QHBoxLayout* Layout101; TQHBoxLayout* Layout101;
}; };

@ -15,9 +15,9 @@
* * * *
***************************************************************************/ ***************************************************************************/
// Qt includes // TQt includes
#include <qrect.h> #include <tqrect.h>
#include <qwidget.h> #include <tqwidget.h>
// KDE includes // KDE includes
#include <kapplication.h> #include <kapplication.h>
@ -118,11 +118,11 @@ int main(int argc, char *argv[])
KCmdLineArgs::addCmdLineOptions( options ); KCmdLineArgs::addCmdLineOptions( options );
KApplication a; KApplication a;
a.connect( &a, SIGNAL( lastWindowClosed() ), &a, SLOT( quit() ) ); a.connect( &a, TQT_SIGNAL( lastWindowClosed() ), &a, TQT_SLOT( quit() ) );
KImageIO::registerFormats(); 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 /* Check if Krename
* was started from root! * was started from root!

@ -25,19 +25,19 @@
#include <klocale.h> #include <klocale.h>
// QT includes // QT includes
#include <qlabel.h> #include <tqlabel.h>
#include <qlayout.h> #include <tqlayout.h>
#include <qlineedit.h> #include <tqlineedit.h>
#include <qpushbutton.h> #include <tqpushbutton.h>
#include <qgroupbox.h> #include <tqgroupbox.h>
#include <qspinbox.h> #include <tqspinbox.h>
const QString MyDirPlugin::getName() const const TQString MyDirPlugin::getName() const
{ {
return i18n("Dir Plugin"); return i18n("Dir Plugin");
} }
const QString MyDirPlugin::getAccelName() const const TQString MyDirPlugin::getAccelName() const
{ {
return i18n("&Dir Plugin"); return i18n("&Dir Plugin");
} }
@ -52,44 +52,44 @@ bool MyDirPlugin::checkError()
return true; return true;
} }
const QPixmap MyDirPlugin::getIcon() const const TQPixmap MyDirPlugin::getIcon() const
{ {
return kapp->iconLoader()->loadIcon( "folder", KIcon::Small ); 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 ); TQSpacerItem* spacer = new TQSpacerItem( 20, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
QSpacerItem* spacer2 = new QSpacerItem( 20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding ); TQSpacerItem* spacer2 = new TQSpacerItem( 20, 20, TQSizePolicy::Minimum, TQSizePolicy::Expanding );
QVBoxLayout* LayoutA = new QVBoxLayout( 0, 6, 6 ); TQVBoxLayout* LayoutA = new TQVBoxLayout( 0, 6, 6 );
QVBoxLayout* LayoutB = new QVBoxLayout( 0, 6, 6 ); TQVBoxLayout* LayoutB = new TQVBoxLayout( 0, 6, 6 );
m_widget = w; 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>") ); la->setText( i18n("<qt>This plugin sorts files after renaming in subdirectories.</qt>") );
l->addWidget( la ); l->addWidget( la );
groupNumber = new QGroupBox( w ); groupNumber = new TQGroupBox( w );
groupNumber->setTitle( i18n( "&Options" ) ); groupNumber->setTitle( i18n( "&Options" ) );
groupNumber->setColumnLayout(0, Qt::Vertical ); groupNumber->setColumnLayout(0, Qt::Vertical );
groupNumber->layout()->setSpacing( 6 ); groupNumber->tqlayout()->setSpacing( 6 );
groupNumber->layout()->setMargin( 11 ); groupNumber->tqlayout()->setMargin( 11 );
groupNumberLayout = new QHBoxLayout( groupNumber->layout() ); groupNumberLayout = new TQHBoxLayout( groupNumber->tqlayout() );
groupNumberLayout->setAlignment( Qt::AlignTop ); groupNumberLayout->tqsetAlignment( TQt::AlignTop );
QLabel* la2 = new QLabel( groupNumber ); TQLabel* la2 = new TQLabel( groupNumber );
la2->setText( i18n( "Files per directory:" ) ); la2->setText( i18n( "Files per directory:" ) );
spinFiles = new QSpinBox( groupNumber ); spinFiles = new TQSpinBox( groupNumber );
spinFiles->setRange( 1, 60000 ); spinFiles->setRange( 1, 60000 );
spinFiles->setValue( 10 ); spinFiles->setValue( 10 );
QLabel* la3 = new QLabel( groupNumber ); TQLabel* la3 = new TQLabel( groupNumber );
la3->setText( i18n( "Start index:" ) ); la3->setText( i18n( "Start index:" ) );
spinStart = new QSpinBox( groupNumber ); spinStart = new TQSpinBox( groupNumber );
spinFiles->setRange( 0, 60000 ); spinFiles->setRange( 0, 60000 );
LayoutA->addWidget( la2 ); LayoutA->addWidget( la2 );
@ -101,16 +101,16 @@ void MyDirPlugin::drawInterface( QWidget* w, QVBoxLayout* l )
groupNumberLayout->addLayout( LayoutB ); groupNumberLayout->addLayout( LayoutB );
groupNumberLayout->addItem( spacer ); groupNumberLayout->addItem( spacer );
groupOutput = new QGroupBox( w ); groupOutput = new TQGroupBox( w );
groupOutput->setTitle( i18n( "Output &Directory" ) ); groupOutput->setTitle( i18n( "Output &Directory" ) );
groupOutput->setColumnLayout(0, Qt::Vertical ); groupOutput->setColumnLayout(0, Qt::Vertical );
groupOutput->layout()->setSpacing( 6 ); groupOutput->tqlayout()->setSpacing( 6 );
groupOutput->layout()->setMargin( 11 ); groupOutput->tqlayout()->setMargin( 11 );
groupOutputLayout = new QHBoxLayout( groupOutput->layout() ); groupOutputLayout = new TQHBoxLayout( groupOutput->tqlayout() );
groupOutputLayout->setAlignment( Qt::AlignTop ); groupOutputLayout->tqsetAlignment( TQt::AlignTop );
outputdir = new QLineEdit( groupOutput ); outputdir = new TQLineEdit( groupOutput );
buttonDir = new QPushButton( groupOutput ); buttonDir = new TQPushButton( groupOutput );
buttonDir->setText( "..." ); buttonDir->setText( "..." );
groupOutputLayout->addWidget( outputdir ); groupOutputLayout->addWidget( outputdir );
@ -120,7 +120,7 @@ void MyDirPlugin::drawInterface( QWidget* w, QVBoxLayout* l )
l->addWidget( groupOutput ); l->addWidget( groupOutput );
l->addItem( spacer2 ); l->addItem( spacer2 );
connect( buttonDir, SIGNAL(clicked()), this, SLOT(chooseDir())); connect( buttonDir, TQT_SIGNAL(clicked()), this, TQT_SLOT(chooseDir()));
} }
void MyDirPlugin::fillStructure() void MyDirPlugin::fillStructure()
@ -131,28 +131,28 @@ void MyDirPlugin::fillStructure()
filecounter = 0; filecounter = 0;
dircounter = spinStart->value(); 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 ); 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 // token = filename
if( filecounter == fpd ) { if( filecounter == fpd ) {
filecounter = 0; filecounter = 0;
dircounter++; dircounter++;
curdir = dir + QString("/%1/").arg( dircounter ); curdir = dir + TQString("/%1/").tqarg( dircounter );
d->mkdir( curdir ); d->mkdir( curdir );
} }
QFileInfo f( token ); TQFileInfo f( token );
newname = curdir + f.fileName(); newname = curdir + f.fileName();
d->rename( token, newname ); d->rename( token, newname );
filecounter++; filecounter++;
return QString::null; return TQString();
} }
void MyDirPlugin::finished() void MyDirPlugin::finished()
@ -162,7 +162,7 @@ void MyDirPlugin::finished()
void MyDirPlugin::chooseDir() void MyDirPlugin::chooseDir()
{ {
QString s (KFileDialog::getExistingDirectory ( QString::null )); TQString s (KFileDialog::getExistingDirectory ( TQString() ));
if(!s.isEmpty()) if(!s.isEmpty())
outputdir->setText( s ); outputdir->setText( s );
} }

@ -23,28 +23,29 @@
#include "plugin.h" #include "plugin.h"
#include "helpdialog.h" #include "helpdialog.h"
class QDir; class TQDir;
class QHBoxLayout; class TQHBoxLayout;
class QGroupBox; class TQGroupBox;
class QLineEdit; class TQLineEdit;
class QPushButton; class TQPushButton;
class QSpinBox; class TQSpinBox;
class QString; class TQString;
class QVBoxLayout; class TQVBoxLayout;
class QWidget; class TQWidget;
class MyDirPlugin : public Plugin { class MyDirPlugin : public Plugin {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
const QString getName() const; const TQString getName() const;
const QString getAccelName() const; const TQString getAccelName() const;
const int type() const; const int type() const;
bool checkError(); bool checkError();
void drawInterface( QWidget* w, QVBoxLayout* l ); void drawInterface( TQWidget* w, TQVBoxLayout* l );
void fillStructure(); void fillStructure();
QString processFile( BatchRenamer*, int, QString token, int ); TQString processFile( BatchRenamer*, int, TQString token, int );
void finished(); void finished();
const QPixmap getIcon() const; const TQPixmap getIcon() const;
private slots: private slots:
void chooseDir(); void chooseDir();
@ -53,20 +54,20 @@ class MyDirPlugin : public Plugin {
int fpd; // files per dir int fpd; // files per dir
int filecounter; int filecounter;
int dircounter; int dircounter;
QString dir; TQString dir;
QString curdir; TQString curdir;
QDir* d; TQDir* d;
QLineEdit* outputdir; TQLineEdit* outputdir;
QPushButton* buttonDir; TQPushButton* buttonDir;
QSpinBox* spinFiles; TQSpinBox* spinFiles;
QSpinBox* spinStart; TQSpinBox* spinStart;
QGroupBox* groupOutput; TQGroupBox* groupOutput;
QHBoxLayout* groupOutputLayout; TQHBoxLayout* groupOutputLayout;
QGroupBox* groupNumber; TQGroupBox* groupNumber;
QHBoxLayout* groupNumberLayout; TQHBoxLayout* groupNumberLayout;
}; };
#endif #endif

@ -20,26 +20,26 @@
#include <klineedit.h> #include <klineedit.h>
#include <kpushbutton.h> #include <kpushbutton.h>
#include <klocale.h> #include <klocale.h>
#include <qlabel.h> #include <tqlabel.h>
#include <qlayout.h> #include <tqlayout.h>
#include <qtooltip.h> #include <tqtooltip.h>
MyInputDialog::MyInputDialog( QString filename, bool revertEnabled, QWidget* parent ) MyInputDialog::MyInputDialog( TQString filename, bool revertEnabled, TQWidget* tqparent )
: QDialog( parent, 0, true, 0 ) : TQDialog( tqparent, 0, true, 0 )
{ {
// I do not think this has to be translated // I do not think this has to be translated
setCaption( "KRename" ); setCaption( "KRename" );
MyInputDialogLayout = new QVBoxLayout( this, 11, 6, "MyInputDialogLayout"); MyInputDialogLayout = new TQVBoxLayout( this, 11, 6, "MyInputDialogLayout");
Layout = new QHBoxLayout( 0, 0, 6, "Layout"); 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:" ) ); TextLabel1->setText( i18n( "Please input a new filename:" ) );
text = new KLineEdit( this, "text" ); text = new KLineEdit( this, "text" );
text->setText( filename ); 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 = new KPushButton( this, "buttonKrename" );
buttonKrename->setText( i18n( "&Revert Changes" ) ); buttonKrename->setText( i18n( "&Revert Changes" ) );
@ -67,19 +67,19 @@ MyInputDialog::MyInputDialog( QString filename, bool revertEnabled, QWidget* par
MyInputDialogLayout->addWidget( text ); MyInputDialogLayout->addWidget( text );
MyInputDialogLayout->addLayout( Layout ); MyInputDialogLayout->addLayout( Layout );
connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( reject() ) ); connect( buttonCancel, TQT_SIGNAL( clicked() ), this, TQT_SLOT( reject() ) );
connect( buttonOk, SIGNAL( clicked() ), this, SLOT( accept() ) ); connect( buttonOk, TQT_SIGNAL( clicked() ), this, TQT_SLOT( accept() ) );
connect( buttonKrename, SIGNAL( clicked() ), this, SLOT( krename() ) ); connect( buttonKrename, TQT_SIGNAL( clicked() ), this, TQT_SLOT( krename() ) );
connect( buttonFilename, SIGNAL( clicked() ), this, SLOT( slotFilename() ) ); 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." ) ); "KRename instead of your changes." ) );
} }
MyInputDialog::~MyInputDialog() MyInputDialog::~MyInputDialog()
{ } { }
QString MyInputDialog::filename() const TQString MyInputDialog::filename() const
{ {
return text->text(); return text->text();
} }

@ -18,24 +18,25 @@
#ifndef MYINPUTDIALOG_H #ifndef MYINPUTDIALOG_H
#define MYINPUTDIALOG_H #define MYINPUTDIALOG_H
#include <qdialog.h> #include <tqdialog.h>
class QVBoxLayout; class TQVBoxLayout;
class QHBoxLayout; class TQHBoxLayout;
class QGridLayout; class TQGridLayout;
class KLineEdit; class KLineEdit;
class KPushButton; class KPushButton;
class QLabel; class TQLabel;
class QString; class TQString;
class MyInputDialog : public QDialog class MyInputDialog : public TQDialog
{ {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
MyInputDialog( QString filename, bool revertEnabled = true, QWidget* parent = 0 ); MyInputDialog( TQString filename, bool revertEnabled = true, TQWidget* tqparent = 0 );
~MyInputDialog(); ~MyInputDialog();
QString filename() const; TQString filename() const;
inline void setInputFilename( const QString s ); inline void setInputFilename( const TQString s );
enum returnCodes { enum returnCodes {
OK, OK,
@ -52,21 +53,21 @@ class MyInputDialog : public QDialog
void reject(); void reject();
private: private:
QLabel* TextLabel1; TQLabel* TextLabel1;
KLineEdit* text; KLineEdit* text;
KPushButton* buttonKrename; KPushButton* buttonKrename;
KPushButton* buttonFilename; KPushButton* buttonFilename;
KPushButton* buttonOk; KPushButton* buttonOk;
KPushButton* buttonCancel; KPushButton* buttonCancel;
QString m_oldfilename; TQString m_oldfilename;
protected: protected:
QVBoxLayout* MyInputDialogLayout; TQVBoxLayout* MyInputDialogLayout;
QHBoxLayout* Layout; TQHBoxLayout* Layout;
}; };
void MyInputDialog::setInputFilename( const QString s ) void MyInputDialog::setInputFilename( const TQString s )
{ {
m_oldfilename = s; m_oldfilename = s;
} }

@ -18,39 +18,39 @@
#include "numberdialog.h" #include "numberdialog.h"
#include "batchrenamer.h" #include "batchrenamer.h"
// Qt includes // TQt includes
#include <qgroupbox.h> #include <tqgroupbox.h>
#include <qlayout.h> #include <tqlayout.h>
#include <qtooltip.h> #include <tqtooltip.h>
// KDE includes // KDE includes
#include <kapplication.h> #include <kapplication.h>
#include <kconfig.h> #include <kconfig.h>
#include <klocale.h> #include <klocale.h>
#include <kpushbutton.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 ) if( e->key() == Key_Return )
emit returnPressed(); emit returnPressed();
} }
NumberDialog::NumberDialog(QValueList<int> & n,QWidget *parent ) NumberDialog::NumberDialog(TQValueList<int> & n,TQWidget *tqparent )
: KDialogBase( KDialogBase::Plain, "KRename", : 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->setTitle( i18n("&Numbering") );
group1->setColumnLayout(0, Qt::Vertical ); group1->setColumnLayout(0, Qt::Vertical );
group1->layout()->setSpacing( 6 ); group1->tqlayout()->setSpacing( 6 );
group1->layout()->setMargin( 11 ); group1->tqlayout()->setMargin( 11 );
QVBoxLayout* group1Layout = new QVBoxLayout( group1->layout() ); TQVBoxLayout* group1Layout = new TQVBoxLayout( group1->tqlayout() );
group1Layout->setAlignment( Qt::AlignTop ); group1Layout->tqsetAlignment( TQt::AlignTop );
spinIndex = new KIntNumInput( group1 ); spinIndex = new KIntNumInput( group1 );
spinIndex->setMaxValue( SPINMAX ); spinIndex->setMaxValue( SPINMAX );
@ -61,15 +61,15 @@ NumberDialog::NumberDialog(QValueList<int> & n,QWidget *parent )
spinStep->setValue( 1 ); spinStep->setValue( 1 );
spinStep->setLabel( i18n( "Step &by:" ), AlignLeft | AlignVCenter ); 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->setTitle( i18n("S&kip Numbers") );
group2->setColumnLayout(0, Qt::Horizontal ); group2->setColumnLayout(0, Qt::Horizontal );
group2->layout()->setSpacing( 6 ); group2->tqlayout()->setSpacing( 6 );
group2->layout()->setMargin( 11 ); group2->tqlayout()->setMargin( 11 );
QHBoxLayout* group2Layout = new QHBoxLayout( group2->layout() ); TQHBoxLayout* group2Layout = new TQHBoxLayout( group2->tqlayout() );
group2Layout->setAlignment( Qt::AlignTop ); group2Layout->tqsetAlignment( TQt::AlignTop );
listNumbers = new KListBox( group2 ); listNumbers = new KListBox( group2 );
@ -85,35 +85,35 @@ NumberDialog::NumberDialog(QValueList<int> & n,QWidget *parent )
spinNumber->setValue( 0 ); spinNumber->setValue( 0 );
spinNumber->setFocus(); spinNumber->setFocus();
QVBoxLayout* layout2 = new QVBoxLayout( 0, 6, 6 ); TQVBoxLayout* tqlayout2 = new TQVBoxLayout( 0, 6, 6 );
layout2->addWidget( buttonAdd ); tqlayout2->addWidget( buttonAdd );
layout2->addWidget( buttonRemove ); tqlayout2->addWidget( buttonRemove );
layout2->addWidget( spinNumber ); tqlayout2->addWidget( spinNumber );
layout2->addItem( spacer ); tqlayout2->addItem( spacer );
group1Layout->addWidget( spinIndex ); group1Layout->addWidget( spinIndex );
group1Layout->addWidget( spinStep ); group1Layout->addWidget( spinStep );
group1Layout->addWidget( checkResetCounter ); group1Layout->addWidget( checkResetCounter );
group2Layout->addWidget( listNumbers ); group2Layout->addWidget( listNumbers );
group2Layout->addLayout( layout2 ); group2Layout->addLayout( tqlayout2 );
layout->addWidget( group1 ); tqlayout->addWidget( group1 );
layout->addWidget( group2 ); tqlayout->addWidget( group2 );
QToolTip::add( spinIndex, i18n( "Number of the first file." ) ); TQToolTip::add( spinIndex, i18n( "Number of the first file." ) );
QToolTip::add( spinStep, i18n( "The counter is increased/decreased by this value." ) ); TQToolTip::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( 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, ...") ); "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>" ) ); "This setting applies to all used counters.</qt>" ) );
connect( buttonAdd, SIGNAL( clicked() ), this, SLOT( addNumber() ) ); connect( buttonAdd, TQT_SIGNAL( clicked() ), this, TQT_SLOT( addNumber() ) );
connect( buttonRemove,SIGNAL( clicked() ), this, SLOT( removeNumber() ) ); connect( buttonRemove,TQT_SIGNAL( clicked() ), this, TQT_SLOT( removeNumber() ) );
connect( spinNumber, SIGNAL( returnPressed()), this, SLOT( addNumber() ) ); connect( spinNumber, TQT_SIGNAL( returnPressed()), this, TQT_SLOT( addNumber() ) );
for( unsigned int i = 0; i < n.count(); i++ ) 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(); update();
} }
@ -124,7 +124,7 @@ NumberDialog::~NumberDialog()
void NumberDialog::addNumber() 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++ ) for( unsigned int i = 0; i < listNumbers->count(); i++ )
if( listNumbers->text(i) == tmp ) if( listNumbers->text(i) == tmp )
return; return;
@ -145,9 +145,9 @@ void NumberDialog::removeNumber()
} while( i < listNumbers->count() ); } 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++ ) for( unsigned int i = 0; i < listNumbers->count(); i++ )
skip.append( listNumbers->text(i).toInt() ); skip.append( listNumbers->text(i).toInt() );
@ -162,7 +162,7 @@ void NumberDialog::sort()
for( unsigned int i = 0; i < listNumbers->count()-1; i++) { for( unsigned int i = 0; i < listNumbers->count()-1; i++) {
if( listNumbers->text(i).toInt() > listNumbers->text(i+1).toInt() ) { if( listNumbers->text(i).toInt() > listNumbers->text(i+1).toInt() ) {
QString tmp = listNumbers->text(i); TQString tmp = listNumbers->text(i);
listNumbers->removeItem(i); listNumbers->removeItem(i);
listNumbers->insertItem( tmp, i+1 ); listNumbers->insertItem( tmp, i+1 );
i = 0; i = 0;

@ -18,9 +18,9 @@
#ifndef NUMBERDIALOG_H #ifndef NUMBERDIALOG_H
#define NUMBERDIALOG_H #define NUMBERDIALOG_H
#include <qwidget.h> #include <tqwidget.h>
#include <kdialogbase.h> #include <kdialogbase.h>
#include <qvaluelist.h> #include <tqvaluelist.h>
// KDE includes // KDE includes
#include <knuminput.h> #include <knuminput.h>
@ -28,25 +28,27 @@
class KMyIntSpinBox : public KIntSpinBox class KMyIntSpinBox : public KIntSpinBox
{ {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
KMyIntSpinBox( QWidget* parent ) KMyIntSpinBox( TQWidget* tqparent )
: KIntSpinBox( parent ) : KIntSpinBox( tqparent )
{ }; { };
~KMyIntSpinBox() { }; ~KMyIntSpinBox() { };
private: private:
void keyPressEvent( QKeyEvent* e ); void keyPressEvent( TQKeyEvent* e );
signals: signals:
void returnPressed(); void returnPressed();
}; };
class QCheckBox; class TQCheckBox;
class KIntNumInput; class KIntNumInput;
class KListBox; class KListBox;
class KPushButton; class KPushButton;
class NumberDialog : public KDialogBase { class NumberDialog : public KDialogBase {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
NumberDialog(QValueList<int> & n,QWidget *parent=0); NumberDialog(TQValueList<int> & n,TQWidget *tqparent=0);
~NumberDialog(); ~NumberDialog();
// TODO: bad object oriented design!!! // TODO: bad object oriented design!!!
@ -54,9 +56,9 @@ class NumberDialog : public KDialogBase {
KIntNumInput* spinIndex; KIntNumInput* spinIndex;
KIntNumInput* spinStep; KIntNumInput* spinStep;
QCheckBox* checkResetCounter; TQCheckBox* checkResetCounter;
QValueList<int> getList(); TQValueList<int> getList();
private slots: private slots:
void addNumber(); void addNumber();

@ -18,10 +18,10 @@
#include "permission.h" #include "permission.h"
// QT includes // QT includes
#include <qcheckbox.h> #include <tqcheckbox.h>
#include <qgroupbox.h> #include <tqgroupbox.h>
#include <qlabel.h> #include <tqlabel.h>
#include <qlayout.h> #include <tqlayout.h>
// KDE includes // KDE includes
#include <kapplication.h> #include <kapplication.h>
@ -37,12 +37,12 @@
#include <grp.h> #include <grp.h>
#include <unistd.h> #include <unistd.h>
const QString MyPermPlugin::getName() const const TQString MyPermPlugin::getName() const
{ {
return i18n("Permissions"); return i18n("Permissions");
} }
const QString MyPermPlugin::getAccelName() const const TQString MyPermPlugin::getAccelName() const
{ {
return i18n("&Permissions"); return i18n("&Permissions");
} }
@ -57,71 +57,71 @@ bool MyPermPlugin::checkError()
return true; return true;
} }
void MyPermPlugin::drawInterface( QWidget* w, QVBoxLayout* l ) void MyPermPlugin::drawInterface( TQWidget* w, TQVBoxLayout* l )
{ {
int i; int i;
unsigned int uid; // Maybe this must be signed int ? unsigned int uid; // Maybe this must be signed int ?
struct passwd *user; struct passwd *user;
struct group *ge; struct group *ge;
QLabel *la, *cl[3]; TQLabel *la, *cl[3];
QGridLayout *gl; TQGridLayout *gl;
QString strOwner; TQString strOwner;
m_widget = w; m_widget = w;
l->setResizeMode( QLayout::FreeResize ); l->setResizeMode( TQLayout::FreeResize );
w->setMinimumSize( QSize( 100, 100 ) ); 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 ); groupPermission->setEnabled( FALSE );
gl = new QGridLayout (groupPermission, 6, 6, 15); gl = new TQGridLayout (groupPermission, 6, 6, 15);
gl->addRowSpacing(0, 10); 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); gl->addWidget(la, 1, 0);
la = new QLabel( i18n("Read"), groupPermission ); la = new TQLabel( i18n("Read"), groupPermission );
gl->addWidget (la, 1, 1); gl->addWidget (la, 1, 1);
la = new QLabel( i18n("Write"), groupPermission ); la = new TQLabel( i18n("Write"), groupPermission );
gl->addWidget (la, 1, 2); gl->addWidget (la, 1, 2);
la = new QLabel( i18n("Exec"), groupPermission ); la = new TQLabel( i18n("Exec"), groupPermission );
QSize size = la->sizeHint(); TQSize size = la->tqsizeHint();
size.setWidth(size.width() + 15); size.setWidth(size.width() + 15);
la->setFixedSize(size); la->setFixedSize(size);
gl->addWidget (la, 1, 3); gl->addWidget (la, 1, 3);
la = new QLabel( i18n("Special"), groupPermission ); la = new TQLabel( i18n("Special"), groupPermission );
gl->addMultiCellWidget(la, 1, 1, 4, 5); 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); 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); 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); gl->addWidget (cl[2], 4, 0);
la = new QLabel(i18n("UID"), groupPermission); la = new TQLabel(i18n("UID"), groupPermission);
gl->addWidget(la, 2, 5); gl->addWidget(la, 2, 5);
la = new QLabel(i18n("GID"), groupPermission); la = new TQLabel(i18n("GID"), groupPermission);
gl->addWidget(la, 3, 5); gl->addWidget(la, 3, 5);
la = new QLabel(i18n("Sticky"), groupPermission); la = new TQLabel(i18n("Sticky"), groupPermission);
gl->addWidget(la, 4, 5); gl->addWidget(la, 4, 5);
for (int row = 0; row < 3 ; ++row) { for (int row = 0; row < 3 ; ++row) {
for (int col = 0; col < 4; ++col) { for (int col = 0; col < 4; ++col) {
QCheckBox *cb = new QCheckBox(groupPermission); TQCheckBox *cb = new TQCheckBox(groupPermission);
permBox[row][col] = cb; permBox[row][col] = cb;
gl->addWidget (permBox[row][col], row+2, col+1); gl->addWidget (permBox[row][col], row+2, col+1);
@ -132,23 +132,23 @@ void MyPermPlugin::drawInterface( QWidget* w, QVBoxLayout* l )
gl->setColStretch(6, 10); 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->setEnabled( FALSE );
groupOwner->setColumnLayout(0, Qt::Vertical ); groupOwner->setColumnLayout(0, Qt::Vertical );
groupOwner->layout()->setSpacing( 6 ); groupOwner->tqlayout()->setSpacing( 6 );
groupOwner->layout()->setMargin( 11 ); groupOwner->tqlayout()->setMargin( 11 );
groupOwnerLayout = new QVBoxLayout( groupOwner->layout() ); groupOwnerLayout = new TQVBoxLayout( groupOwner->tqlayout() );
groupOwnerLayout->setAlignment( Qt::AlignTop ); groupOwnerLayout->tqsetAlignment( TQt::AlignTop );
Layout2 = new QHBoxLayout( 0, 0, 6 ); Layout2 = new TQHBoxLayout( 0, 0, 6 );
Layout3 = new QHBoxLayout( 0, 0, 6 ); Layout3 = new TQHBoxLayout( 0, 0, 6 );
Layout4 = new QHBoxLayout( 0, 0, 6 ); Layout4 = new TQHBoxLayout( 0, 0, 6 );
la = new QLabel( i18n("User:"), groupOwner ); la = new TQLabel( i18n("User:"), groupOwner );
Layout2->addWidget( la ); Layout2->addWidget( la );
la = new QLabel( i18n("Group:"), groupOwner ); la = new TQLabel( i18n("Group:"), groupOwner );
Layout3->addWidget( la ); Layout3->addWidget( la );
username = new KComboBox( groupOwner ); username = new KComboBox( groupOwner );
@ -157,28 +157,28 @@ void MyPermPlugin::drawInterface( QWidget* w, QVBoxLayout* l )
setpwent(); setpwent();
for (i=0; ((user = getpwent()) != 0L) && (i < MAXENTRIES); i++) { for (i=0; ((user = getpwent()) != 0L) && (i < MAXENTRIES); i++) {
if( uid == 0 ) if( uid == 0 )
username->insertItem(QString::fromLatin1(user->pw_name)); username->insertItem(TQString::tqfromLatin1(user->pw_name));
else else
if( user->pw_uid == uid ) if( user->pw_uid == uid )
username->insertItem(QString::fromLatin1(user->pw_name)); username->insertItem(TQString::tqfromLatin1(user->pw_name));
} }
endpwent(); endpwent();
groupname = new KComboBox( groupOwner ); groupname = new KComboBox( groupOwner );
user = getpwuid(geteuid()); user = getpwuid(geteuid());
QString strUser = user->pw_name; TQString strUser = user->pw_name;
setgrent(); setgrent();
for (i=0; ((ge = getgrent()) != 0L) && (i < MAXENTRIES); i++) { for (i=0; ((ge = getgrent()) != 0L) && (i < MAXENTRIES); i++) {
if( uid == 0 ) { if( uid == 0 ) {
groupname->insertItem(QString::fromLatin1(ge->gr_name)); groupname->insertItem(TQString::tqfromLatin1(ge->gr_name));
} else { } else {
char ** members = ge->gr_mem; char ** members = ge->gr_mem;
char * member; char * member;
while ((member = *members) != 0L) { while ((member = *members) != 0L) {
if (strUser == member) { if (strUser == member) {
groupname->insertItem(QString::fromLatin1(ge->gr_name)); groupname->insertItem(TQString::tqfromLatin1(ge->gr_name));
break; break;
} }
@ -191,7 +191,7 @@ void MyPermPlugin::drawInterface( QWidget* w, QVBoxLayout* l )
/* add the users group */ /* add the users group */
ge = getgrgid (getegid()); ge = getgrgid (getegid());
if (ge) { if (ge) {
QString name = QString::fromLatin1(ge->gr_name); TQString name = TQString::tqfromLatin1(ge->gr_name);
if (name.isEmpty()) if (name.isEmpty())
name.setNum(ge->gr_gid); name.setNum(ge->gr_gid);
@ -201,8 +201,8 @@ void MyPermPlugin::drawInterface( QWidget* w, QVBoxLayout* l )
// make the users group visible // make the users group visible
groupname->setCurrentItem( groupname->count() ); groupname->setCurrentItem( groupname->count() );
QSpacerItem* spacer8 = new QSpacerItem( 20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding ); TQSpacerItem* spacer8 = new TQSpacerItem( 20, 20, TQSizePolicy::Minimum, TQSizePolicy::Expanding );
QSpacerItem* spacer9 = new QSpacerItem( 20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding ); TQSpacerItem* spacer9 = new TQSpacerItem( 20, 20, TQSizePolicy::Minimum, TQSizePolicy::Expanding );
Layout2->addWidget( username ); Layout2->addWidget( username );
Layout2->addItem( spacer8 ); Layout2->addItem( spacer8 );
@ -212,7 +212,7 @@ void MyPermPlugin::drawInterface( QWidget* w, QVBoxLayout* l )
groupOwnerLayout->addLayout( Layout2 ); groupOwnerLayout->addLayout( Layout2 );
groupOwnerLayout->addLayout( Layout3 ); 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( checkPermissions );
Layout4->addWidget( checkOwner ); Layout4->addWidget( checkOwner );
@ -222,8 +222,8 @@ void MyPermPlugin::drawInterface( QWidget* w, QVBoxLayout* l )
l->addWidget( groupOwner ); l->addWidget( groupOwner );
l->addItem( spacer10 ); l->addItem( spacer10 );
connect( checkOwner, SIGNAL(clicked()), this, SLOT(enableControls()) ); connect( checkOwner, TQT_SIGNAL(clicked()), this, TQT_SLOT(enableControls()) );
connect( checkPermissions, SIGNAL(clicked()), this, SLOT(enableControls()) ); connect( checkPermissions, TQT_SIGNAL(clicked()), this, TQT_SLOT(enableControls()) );
} }
void MyPermPlugin::fillStructure() 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( perm.changePermissions )
if( chmod( (const char *)filename, (mode_t)perm.newPermission ) == -1 ) 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( perm.changeOwner )
if( chown( (const char*)filename, getUid( perm.owner), getGid( perm.group ))) 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() void MyPermPlugin::finished()
@ -268,18 +268,18 @@ int MyPermPlugin::getPermissions()
{S_IROTH, S_IWOTH, S_IXOTH, S_ISVTX} {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 row = 0;row < 3; ++row)
for (int col = 0; col < 4; ++col) for (int col = 0; col < 4; ++col)
{ {
switch (permBox[row][col]->state()) switch (permBox[row][col]->state())
{ {
case QCheckBox::On: case TQCheckBox::On:
permissions |= fperm[row][col]; permissions |= fperm[row][col];
//fall through //fall through
case QCheckBox::Off: case TQCheckBox::Off:
mask |= fperm[row][col]; tqmask |= fperm[row][col];
break; break;
default: default:
break; break;
@ -289,7 +289,7 @@ int MyPermPlugin::getPermissions()
return permissions; return permissions;
} }
int MyPermPlugin::getGid( QString group ) int MyPermPlugin::getGid( TQString group )
{ {
int i, r; int i, r;
struct group *ge; struct group *ge;
@ -302,7 +302,7 @@ int MyPermPlugin::getGid( QString group )
return r; return r;
} }
int MyPermPlugin::getUid( QString owner ) int MyPermPlugin::getUid( TQString owner )
{ {
int i, r; int i, r;
struct passwd *user; struct passwd *user;
@ -321,7 +321,7 @@ void MyPermPlugin::enableControls()
groupPermission->setEnabled( checkPermissions->isChecked() ); groupPermission->setEnabled( checkPermissions->isChecked() );
} }
const QPixmap MyPermPlugin::getIcon() const const TQPixmap MyPermPlugin::getIcon() const
{ {
return kapp->iconLoader()->loadIcon( "clanbomber", KIcon::Small ); return kapp->iconLoader()->loadIcon( "clanbomber", KIcon::Small );
} }

@ -30,40 +30,41 @@
#include <stdio.h> #include <stdio.h>
class KComboBox; class KComboBox;
class QCheckBox; class TQCheckBox;
class QGroupBox; class TQGroupBox;
class QVBoxLayout; class TQVBoxLayout;
class QHBoxLayout; class TQHBoxLayout;
class QString; class TQString;
class QWidget; class TQWidget;
// Plugin class starts here // Plugin class starts here
class MyPermPlugin: public Plugin { class MyPermPlugin: public Plugin {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
const QString getName() const; const TQString getName() const;
const QString getAccelName() const; const TQString getAccelName() const;
const int type() const; const int type() const;
bool checkError(); bool checkError();
void drawInterface( QWidget* w, QVBoxLayout* l ); void drawInterface( TQWidget* w, TQVBoxLayout* l );
void fillStructure(); void fillStructure();
QString processFile( BatchRenamer* b, int, QString token, int ); TQString processFile( BatchRenamer* b, int, TQString token, int );
void finished(); void finished();
const QPixmap getIcon() const; const TQPixmap getIcon() const;
private: private:
int getPermissions(); int getPermissions();
int getGid( QString group ); int getGid( TQString group );
int getUid( QString owner ); int getUid( TQString owner );
struct pervals { struct pervals {
bool changePermissions; bool changePermissions;
bool changeOwner; bool changeOwner;
QString owner; // name of owner TQString owner; // name of owner
QString group; // name of group TQString group; // name of group
int newPermission; // Permissions int newPermission; // Permissions
}perm; }perm;
@ -72,19 +73,19 @@ class MyPermPlugin: public Plugin {
void enableControls(); void enableControls();
protected: protected:
QGroupBox* groupPermission; TQGroupBox* groupPermission;
QGroupBox* groupOwner; TQGroupBox* groupOwner;
QCheckBox* checkPermissions; TQCheckBox* checkPermissions;
QCheckBox* checkOwner; TQCheckBox* checkOwner;
QCheckBox* permBox[3][4]; TQCheckBox* permBox[3][4];
KComboBox* username; KComboBox* username;
KComboBox* groupname; KComboBox* groupname;
QVBoxLayout* groupOwnerLayout; TQVBoxLayout* groupOwnerLayout;
QVBoxLayout* Layout0; TQVBoxLayout* Layout0;
QHBoxLayout* Layout2; TQHBoxLayout* Layout2;
QHBoxLayout* Layout3; TQHBoxLayout* Layout3;
QHBoxLayout* Layout4; TQHBoxLayout* Layout4;
}; };
#endif #endif

@ -18,7 +18,7 @@
#include "pictureplugin.h" #include "pictureplugin.h"
// QT includes // QT includes
#include <qimage.h> #include <tqimage.h>
// KDE includes // KDE includes
#include <kapplication.h> #include <kapplication.h>
@ -36,51 +36,51 @@ PicturePlugin::PicturePlugin()
m_icon = "image"; m_icon = "image";
} }
const QString PicturePlugin::getName() const const TQString PicturePlugin::getName() const
{ {
return i18n("Picture Plugin"); return i18n("Picture Plugin");
} }
const QString PicturePlugin::getAccelName() const const TQString PicturePlugin::getAccelName() const
{ {
return i18n("P&icture Plugin"); return i18n("P&icture Plugin");
} }
const QString PicturePlugin::getPattern() const const TQString PicturePlugin::getPattern() const
{ {
return "pic"; return "pic";
} }
QString PicturePlugin::processFile( BatchRenamer* b, int i, QString token, int ) TQString PicturePlugin::processFile( BatchRenamer* b, int i, TQString token, int )
{ {
QString resolution; TQString resolution;
QString xres; TQString xres;
QString yres; TQString yres;
QString bitdepth; TQString bitdepth;
QString filename = BatchRenamer::buildFilename( &b->files()[i].src ); TQString filename = BatchRenamer::buildFilename( &b->files()[i].src );
token = token.lower(); token = token.lower();
/* /*
* Check if we have something cached for this file * Check if we have something cached for this file
*/ */
if( cache.contains( filename + "::" + token ) ) if( cache.tqcontains( filename + "::" + token ) )
return cache[filename + "::" + token ]; return cache[filename + "::" + token ];
QImage img( filename ); TQImage img( filename );
if( img.isNull() ) if( img.isNull() )
return QString::null; return TQString();
resolution = QString( "%1x%2" ).arg(img.width()).arg(img.height()); resolution = TQString( "%1x%2" ).tqarg(img.width()).tqarg(img.height());
xres = QString::number( img.width() ); xres = TQString::number( img.width() );
yres = QString::number( img.height() ); yres = TQString::number( img.height() );
bitdepth = QString::number( img.depth() ); bitdepth = TQString::number( img.depth() );
if( cache.count() >= CACHE_MAX ) if( cache.count() >= CACHE_MAX )
cache.remove( cache.begin() ); cache.remove( cache.begin() );
QString ret = QString::null; TQString ret = TQString();
if( token == getPattern() + "resolution" ) if( token == getPattern() + "resolution" )
ret = resolution; ret = resolution;

@ -22,19 +22,20 @@
#include "pluginloader.h" #include "pluginloader.h"
#include "fileplugin.h" #include "fileplugin.h"
class QVBoxLayout; class TQVBoxLayout;
class QHBoxLayout; class TQHBoxLayout;
class QString; class TQString;
class QWidget; class TQWidget;
class PicturePlugin : public FilePlugin { class PicturePlugin : public FilePlugin {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
PicturePlugin(); PicturePlugin();
const QString getName() const; const TQString getName() const;
const QString getAccelName() const; const TQString getAccelName() const;
const QString getPattern() const; const TQString getPattern() const;
QString processFile( BatchRenamer* b, int i, QString token, int ); TQString processFile( BatchRenamer* b, int i, TQString token, int );
}; };
#endif #endif

@ -18,7 +18,7 @@
#include "plugin.h" #include "plugin.h"
#include "helpdialog.h" #include "helpdialog.h"
#include <qpixmap.h> #include <tqpixmap.h>
Plugin::Plugin() Plugin::Plugin()
{ {
@ -41,19 +41,19 @@ bool Plugin::alwaysUsed() const
return false; 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() void Plugin::clearCache()

@ -20,30 +20,31 @@
#include "batchrenamer.h" #include "batchrenamer.h"
#include <qobject.h> #include <tqobject.h>
class HelpDialogData; class HelpDialogData;
class QString; class TQString;
class QStringList; class TQStringList;
class QWidget; class TQWidget;
class QVBoxLayout; class TQVBoxLayout;
class Plugin : public QObject { class Plugin : public TQObject {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
Plugin(); Plugin();
virtual ~Plugin(); virtual ~Plugin();
virtual const QString getName() const = 0; virtual const TQString getName() const = 0;
virtual const QString getAccelName() const = 0; virtual const TQString getAccelName() const = 0;
virtual const QString getPattern() const; virtual const TQString getPattern() const;
virtual const int type() const = 0; virtual const int type() const = 0;
virtual bool alwaysUsed() const; virtual bool alwaysUsed() const;
virtual bool checkError() = 0; virtual bool checkError() = 0;
virtual void drawInterface( QWidget* w, QVBoxLayout* l ) = 0; virtual void drawInterface( TQWidget* w, TQVBoxLayout* l ) = 0;
virtual void fillStructure() { } 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 finished() { }
virtual void addHelp( HelpDialogData* data ); virtual void addHelp( HelpDialogData* data );
@ -51,8 +52,8 @@ class Plugin : public QObject {
virtual void clearCache(); virtual void clearCache();
virtual const QPixmap getIcon() const; virtual const TQPixmap getIcon() const;
virtual const QStringList getKeys() const; virtual const TQStringList getKeys() const;
signals: signals:
void previewChanged( Plugin* plugin ); void previewChanged( Plugin* plugin );
@ -66,7 +67,7 @@ class Plugin : public QObject {
} }
protected: protected:
QWidget* m_widget; TQWidget* m_widget;
}; };
#endif #endif

@ -34,8 +34,8 @@
#include "translitplugin.h" #include "translitplugin.h"
// QT includes // QT includes
#include <qregexp.h> #include <tqregexp.h>
#include <qstringlist.h> #include <tqstringlist.h>
// KDE includes // KDE includes
#include <kapplication.h> #include <kapplication.h>
@ -101,10 +101,10 @@ void PluginLoader::loadPlugins( bool fileplugins )
loadFilePlugins(); loadFilePlugins();
m_bracket_map.clear(); m_bracket_map.clear();
QPtrListIterator<PluginLoader::PluginLibrary> it( libs ); TQPtrListIterator<PluginLoader::PluginLibrary> it( libs );
for( ; it.current(); ++it ) { for( ; it.current(); ++it ) {
if( (*it)->plugin->type() == TYPE_BRACKET ) { 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++ ) for( unsigned int i = 0; i < list.count(); i++ )
m_bracket_map.insert( list[i].lower(), (*it)->plugin ); m_bracket_map.insert( list[i].lower(), (*it)->plugin );
} }
@ -114,25 +114,25 @@ void PluginLoader::loadPlugins( bool fileplugins )
void PluginLoader::clearCache() void PluginLoader::clearCache()
{ {
QPtrListIterator<PluginLoader::PluginLibrary> it( libs ); TQPtrListIterator<PluginLoader::PluginLibrary> it( libs );
for( ; it.current(); ++it ) for( ; it.current(); ++it )
(*it)->plugin->clearCache(); (*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() // 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]; return m_bracket_cache[lower];
/* The new version is slower than the old one :-( /* 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 ) 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 ); m_bracket_cache.insert( lower, it.data(), true );
if( m_bracket_cache.count() > BRACKET_CACHE_COUNT ) if( m_bracket_cache.count() > BRACKET_CACHE_COUNT )

@ -22,13 +22,13 @@
#include "batchrenamer.h" #include "batchrenamer.h"
#include "plugin.h" #include "plugin.h"
#include <qmap.h> #include <tqmap.h>
#include <qptrlist.h> #include <tqptrlist.h>
class QCheckBox; class TQCheckBox;
class QVBoxLayout; class TQVBoxLayout;
class QString; class TQString;
class QWidget; class TQWidget;
#define NUM_INTERNAL_PLUGINS 8 #define NUM_INTERNAL_PLUGINS 8
@ -51,15 +51,15 @@ class PluginLoader {
* from within KRenameImpl * from within KRenameImpl
* when the GUI is already constructed! * when the GUI is already constructed!
*/ */
QCheckBox* check; TQCheckBox* check;
}; };
static PluginLoader* instance(); static PluginLoader* instance();
void loadPlugins( bool fileplugins ); 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; inline bool filePluginsLoaded() const;
@ -77,8 +77,8 @@ class PluginLoader {
Plugin* m_internal_plugins[NUM_INTERNAL_PLUGINS]; Plugin* m_internal_plugins[NUM_INTERNAL_PLUGINS];
static PluginLoader* m_plugin; static PluginLoader* m_plugin;
QMap<QString,Plugin*> m_bracket_map; TQMap<TQString,Plugin*> m_bracket_map;
QMap<QString,Plugin*> m_bracket_cache; TQMap<TQString,Plugin*> m_bracket_cache;
bool m_loaded; bool m_loaded;
bool m_file; bool m_file;

@ -33,13 +33,13 @@
#include <kstandarddirs.h> #include <kstandarddirs.h>
#include <kurlrequester.h> #include <kurlrequester.h>
#include <qcheckbox.h> #include <tqcheckbox.h>
#include <qdom.h> #include <tqdom.h>
#include <qfile.h> #include <tqfile.h>
#include <qlayout.h> #include <tqlayout.h>
#include <qpainter.h> #include <tqpainter.h>
#include <qradiobutton.h> #include <tqradiobutton.h>
#include <qtooltip.h> #include <tqtooltip.h>
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
#include <config.h> #include <config.h>
@ -55,11 +55,11 @@
#define PROFILE_WIZARD_NAME i18n("KRename: Wizard default profile") #define PROFILE_WIZARD_NAME i18n("KRename: Wizard default profile")
#define PROFILE_TABBED_NAME i18n("KRename: Tabbed default profile") #define PROFILE_TABBED_NAME i18n("KRename: Tabbed default profile")
class ProfileListBoxText : public QListBoxText { class ProfileListBoxText : public TQListBoxText {
public: public:
ProfileListBoxText( const QString & text = QString::null ) ProfileListBoxText( const TQString & text = TQString() )
: QListBoxText( text ) : TQListBoxText( text )
{ {
m_default = false; m_default = false;
} }
@ -73,13 +73,13 @@ public:
} }
protected: protected:
void paint( QPainter* painter ) void paint( TQPainter* painter )
{ {
QFont f = painter->font(); TQFont f = painter->font();
f.setBold( m_default ); f.setBold( m_default );
painter->setFont( f ); painter->setFont( f );
QListBoxText::paint( painter ); TQListBoxText::paint( painter );
} }
private: 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(); KConfig* conf = kapp->config();
conf->setGroup( "Profiles" ); conf->setGroup( "Profiles" );
path = conf->readEntry( name, QString::null ); path = conf->readEntry( name, TQString() );
return path; 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 ) if( name == PROFILE_WIZARD_NAME )
return locate( "data", "krename/krename_system_default_wizard.xml" ); return locate( "data", "krename/krename_system_default_wizard.xml" );
else if( name == PROFILE_TABBED_NAME ) else if( name == PROFILE_TABBED_NAME )
return locate( "data", "krename/krename_system_default_tabbed.xml" ); 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(); KConfig* conf = kapp->config();
conf->setGroup( "ProfilesHeader" ); conf->setGroup( "ProfilesHeader" );
list = conf->readListEntry( "list" ); list = conf->readListEntry( "list" );
if( !list.contains( name ) ) if( !list.tqcontains( name ) )
list.append( name ); list.append( name );
conf->writeEntry( "list", list ); conf->writeEntry( "list", list );
@ -130,10 +130,10 @@ const QString ProfileManager::getProfilePath( const QString & name )
return path; return path;
} }
void ProfileManager::writeXML( const QString & name ) void ProfileManager::writeXML( const TQString & name )
{ {
QString path = getProfilePath( name ); TQString path = getProfilePath( name );
QFile file( path ); TQFile file( path );
if( !file.open( IO_WriteOnly ) ) if( !file.open( IO_WriteOnly ) )
{ {
@ -141,73 +141,73 @@ void ProfileManager::writeXML( const QString & name )
return; return;
} }
QDomDocument doc( "KRenameProfile" ); TQDomDocument doc( "KRenameProfile" );
QDomElement root = doc.createElement( "krename" ); TQDomElement root = doc.createElement( "krename" );
doc.appendChild( root ); doc.appendChild( root );
QDomElement v = doc.createElement( "version" ); TQDomElement v = doc.createElement( "version" );
v.setAttribute( "version", VERSION ); v.setAttribute( "version", VERSION );
root.appendChild( v ); root.appendChild( v );
// General settings of Krename // General settings of Krename
QDomElement settings = doc.createElement( "settings" ); TQDomElement settings = doc.createElement( "settings" );
settings.setAttribute( "wizard", m_krename->m_wizard ); settings.setAttribute( "wizard", m_krename->m_wizard );
settings.setAttribute( "fileplugins", m_krename->plugin->filePluginsLoaded() ); settings.setAttribute( "fileplugins", m_krename->plugin->filePluginsLoaded() );
root.appendChild( settings ); root.appendChild( settings );
// Filename settings // Filename settings
QDomElement filename = doc.createElement( "filename" ); TQDomElement filename = doc.createElement( "filename" );
filename.setAttribute( "filename", m_krename->filename->text() ); filename.setAttribute( "filename", m_krename->filename->text() );
filename.setAttribute( "extension", m_krename->extemplate->text() ); filename.setAttribute( "extension", m_krename->extemplate->text() );
filename.setAttribute( "extension_enabled", m_krename->checkExtension->isChecked() ); filename.setAttribute( "extension_enabled", m_krename->checkExtension->isChecked() );
filename.setAttribute( "extension_start", m_krename->comboExtension->currentItem() ); 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( "start", m_krename->m_index );
numbering.setAttribute( "step", m_krename->m_step ); numbering.setAttribute( "step", m_krename->m_step );
numbering.setAttribute( "skip", listToString( m_krename->skip ) ); numbering.setAttribute( "skip", listToString( m_krename->skip ) );
numbering.setAttribute( "reset", m_krename->m_reset ); 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++) for( unsigned int i=0;i<m_krename->rep.count();i++)
{ {
QDomElement r = doc.createElement( "item" ); TQDomElement r = doc.createElement( "item" );
r.setAttribute( "find", m_krename->rep[i].find ); r.setAttribute( "tqfind", m_krename->rep[i].tqfind );
r.setAttribute( "replace", m_krename->rep[i].replace ); r.setAttribute( "tqreplace", m_krename->rep[i].tqreplace );
r.setAttribute( "reg", m_krename->rep[i].reg ); r.setAttribute( "reg", m_krename->rep[i].reg );
replace.appendChild( r ); tqreplace.appendChild( r );
} }
// destination settings // destination settings
QDomElement dest = doc.createElement( "destination" ); TQDomElement dest = doc.createElement( "destination" );
dest.setAttribute( "mode", m_krename->currentRenameMode() ); 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( "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() ); dest.setAttribute( "undoscript", m_krename->undorequester->url() );
// file adding settings // file adding settings
QDomElement files = doc.createElement( "files" ); TQDomElement files = doc.createElement( "files" );
files.setAttribute( "sorting", QString::number( m_krename->comboSort->currentItem() ) ); files.setAttribute( "sorting", TQString::number( m_krename->comboSort->currentItem() ) );
files.setAttribute( "preview", QString::number( m_krename->checkPreview->isChecked() ) ); files.setAttribute( "preview", TQString::number( m_krename->checkPreview->isChecked() ) );
files.setAttribute( "names", QString::number( m_krename->checkName->isChecked() ) ); files.setAttribute( "names", TQString::number( m_krename->checkName->isChecked() ) );
filename.appendChild( replace ); filename.appendChild( tqreplace );
filename.appendChild( numbering ); filename.appendChild( numbering );
root.appendChild( settings ); root.appendChild( settings );
root.appendChild( filename ); root.appendChild( filename );
root.appendChild( dest ); root.appendChild( dest );
root.appendChild( files ); root.appendChild( files );
QCString xml = doc.toCString(); TQCString xml = doc.toCString();
file.writeBlock( xml, xml.length() ); file.writeBlock( xml, xml.length() );
file.close(); 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 ) ) if( !file.open( IO_ReadOnly ) )
{ {
@ -215,24 +215,24 @@ bool ProfileManager::loadXML( const QString & path )
return false; return false;
} }
QDomDocument doc( "KRenameProfile" ); TQDomDocument doc( "KRenameProfile" );
if ( !doc.setContent( &file ) ) if ( !doc.setContent( &file ) )
{ {
file.close(); file.close();
return false; return false;
} }
QDomNode n = doc.documentElement().firstChild(); TQDomNode n = doc.documentElement().firstChild();
while( !n.isNull() ) 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.isNull() )
{ {
if( e.tagName() == "settings" ) if( e.tagName() == "settings" )
{ {
bool wiz, plug; bool wiz, plug;
wiz = (bool)e.attribute( "wizard", 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 ); m_krename->setWizardMode( wiz );
// if( wiz != m_krename->m_wizard ) // if( wiz != m_krename->m_wizard )
@ -242,7 +242,7 @@ bool ProfileManager::loadXML( const QString & path )
} }
plug = (bool)e.attribute( "fileplugins", 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() ) if( plug && !m_krename->plugin->filePluginsLoaded() )
m_krename->plugin->loadPlugins( true ); 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->extemplate->setText( e.attribute("extension", m_krename->extemplate->text() ) );
m_krename->checkExtension->setChecked( m_krename->checkExtension->setChecked(
(bool)e.attribute("extension_enabled", (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( m_krename->comboExtension->setCurrentItem(
e.attribute("extension_start", 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() ) 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.isNull() )
{ {
if( e.tagName() == "numbering" ) if( e.tagName() == "numbering" )
{ {
m_krename->m_index = e.attribute( "start", QString::number( m_krename->m_index ) ).toInt(); m_krename->m_index = e.attribute( "start", TQString::number( m_krename->m_index ) ).toInt();
m_krename->m_step = e.attribute( "step", QString::number( m_krename->m_step ) ).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->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(); m_krename->rep.clear();
QDomNode n = e.firstChild(); TQDomNode n = e.firstChild();
while( !n.isNull() ) 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" ) if( !e.isNull() && e.tagName() == "item" )
{ {
replacestrings r; replacestrings r;
r.find = e.attribute( "find", QString::null ); r.tqfind = e.attribute( "tqfind", TQString() );
r.replace = e.attribute( "replace", QString::null ); r.tqreplace = e.attribute( "tqreplace", TQString() );
r.reg = (bool)e.attribute( "reg", "0" ).toInt(); r.reg = (bool)e.attribute( "reg", "0" ).toInt();
m_krename->rep.append( r ); m_krename->rep.append( r );
} }
@ -294,7 +294,7 @@ bool ProfileManager::loadXML( const QString & path )
} }
else if( e.tagName() == "destination" ) 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->optionRename->setChecked( false );
m_krename->optionCopy->setChecked( false ); m_krename->optionCopy->setChecked( false );
m_krename->optionMove->setChecked( false ); m_krename->optionMove->setChecked( false );
@ -314,20 +314,20 @@ bool ProfileManager::loadXML( const QString & path )
} }
m_krename->checkOverwrite->setChecked( e.attribute( "overwrite", 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->dirname->setText( e.attribute( "directory", m_krename->dirname->text() ) );
m_krename->checkUndoScript->setChecked( e.attribute( "undo", 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() ) ); m_krename->undorequester->setURL( e.attribute( "undoscript", m_krename->undorequester->url() ) );
} }
else if( e.tagName() == "files" ) else if( e.tagName() == "files" )
{ {
m_krename->comboSort->setCurrentItem( e.attribute( "sorting", 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", 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", m_krename->checkName->setChecked( e.attribute( "names",
QString::number( m_krename->checkName->isChecked() ) ).toInt() ); TQString::number( m_krename->checkName->isChecked() ) ).toInt() );
} }
} }
n = n.nextSibling(); n = n.nextSibling();
@ -340,19 +340,19 @@ bool ProfileManager::loadXML( const QString & path )
return true; 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++ ) for( unsigned int i = 0; i < list.count(); i++ )
data += QString( "%1;" ).arg( list[i] ); data += TQString( "%1;" ).tqarg( list[i] );
return data; return data;
} }
const QValueList<int> ProfileManager::stringToList( const QString & data ) const TQValueList<int> ProfileManager::stringToList( const TQString & data )
{ {
QValueList<int> list; TQValueList<int> list;
int c = data.contains( ";" ); int c = data.tqcontains( ";" );
if( c > 0 ) if( c > 0 )
{ {
for( int i = 0;i<c;i++) for( int i = 0;i<c;i++)
@ -367,7 +367,7 @@ bool ProfileManager::hasDefaultProfile()
KConfig* conf = kapp->config(); KConfig* conf = kapp->config();
conf->setGroup( "ProfilesHeader" ); conf->setGroup( "ProfilesHeader" );
QString def = conf->readEntry( "defprofile", QString::null ); TQString def = conf->readEntry( "defprofile", TQString() );
return (!def.isEmpty()); return (!def.isEmpty());
} }
@ -377,13 +377,13 @@ void ProfileManager::loadDefaultProfile( KRenameImpl* krename )
KConfig* conf = kapp->config(); KConfig* conf = kapp->config();
conf->setGroup( "ProfilesHeader" ); conf->setGroup( "ProfilesHeader" );
QString def = conf->readEntry( "defprofile", QString::null ); TQString def = conf->readEntry( "defprofile", TQString() );
if( !def.isEmpty() ) if( !def.isEmpty() )
ProfileManager::loadProfile( def, krename ); ProfileManager::loadProfile( def, krename );
} }
void ProfileManager::loadProfile( const QString & name, KRenameImpl* krename ) void ProfileManager::loadProfile( const TQString & name, KRenameImpl* krename )
{ {
ProfileManager manager( krename ); ProfileManager manager( krename );
manager.loadXML( manager.getProfilePath( name ) ); 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( 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; int i;
QHBoxLayout* layout = new QHBoxLayout( plainPage(), 6, 6 ); TQHBoxLayout* tqlayout = new TQHBoxLayout( plainPage(), 6, 6 );
QVBoxLayout* button = new QVBoxLayout( 0, 6, 6 ); TQVBoxLayout* button = new TQVBoxLayout( 0, 6, 6 );
profiles = new KListBox( plainPage() ); profiles = new KListBox( plainPage() );
profiles->insertItem( new ProfileListBoxText( PROFILE_WIZARD_NAME ), PROFILE_WIZARD_INDEX ); 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() ); createProfile = new KPushButton( i18n("&Save As Profile..."), plainPage() );
loadProfile = new KPushButton( i18n("&Load Profile"), plainPage() ); loadProfile = new KPushButton( i18n("&Load Profile"), plainPage() );
deleteProfile = new KPushButton( i18n("&Delete 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") ); createProfile->setIconSet( SmallIconSet( "filesaveas") );
loadProfile->setIconSet( SmallIconSet( "fileopen" ) ); loadProfile->setIconSet( SmallIconSet( "fileopen" ) );
deleteProfile->setIconSet( SmallIconSet( "edittrash" ) ); 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( createProfile );
button->addWidget( loadProfile ); button->addWidget( loadProfile );
button->addWidget( deleteProfile ); button->addWidget( deleteProfile );
button->addItem( spacer ); button->addItem( spacer );
button->addWidget( checkDefault ); button->addWidget( checkDefault );
layout->addWidget( profiles ); tqlayout->addWidget( profiles );
layout->addLayout( button ); tqlayout->addLayout( button );
layout->setStretchFactor( profiles, 2 ); 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>" ) ); "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(); enableControls();
connect( createProfile, SIGNAL( clicked() ), this, SLOT( slotCreateProfile() ) ); connect( createProfile, TQT_SIGNAL( clicked() ), this, TQT_SLOT( slotCreateProfile() ) );
connect( loadProfile, SIGNAL( clicked() ), this, SLOT( slotLoadProfile() ) ); connect( loadProfile, TQT_SIGNAL( clicked() ), this, TQT_SLOT( slotLoadProfile() ) );
connect( deleteProfile, SIGNAL( clicked() ), this, SLOT( slotDeleteProfile() ) ); connect( deleteProfile, TQT_SIGNAL( clicked() ), this, TQT_SLOT( slotDeleteProfile() ) );
connect( profiles, SIGNAL( selectionChanged () ), this, SLOT( enableControls() ) ); connect( profiles, TQT_SIGNAL( selectionChanged () ), this, TQT_SLOT( enableControls() ) );
connect( checkDefault, SIGNAL( clicked() ), this, SLOT( slotSetDefault() ) ); connect( checkDefault, TQT_SIGNAL( clicked() ), this, TQT_SLOT( slotSetDefault() ) );
connect( this, SIGNAL( hidden() ), this, SLOT( slotHidden() ) ); connect( this, TQT_SIGNAL( hidden() ), this, TQT_SLOT( slotHidden() ) );
KConfig* conf = kapp->config(); KConfig* conf = kapp->config();
conf->setGroup( "ProfilesHeader" ); conf->setGroup( "ProfilesHeader" );
ProfileListBoxText* item; ProfileListBoxText* item;
QStringList list = conf->readListEntry( "list" ); TQStringList list = conf->readListEntry( "list" );
QString def = conf->readEntry( "defprofile", QString::null ); TQString def = conf->readEntry( "defprofile", TQString() );
for( i=0;i<(int)list.count();i++ ) for( i=0;i<(int)list.count();i++ )
profiles->insertItem( new ProfileListBoxText( list[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 ) if( item )
item->setDefault( checkDefault->isChecked() ); item->setDefault( checkDefault->isChecked() );
profiles->repaintContents(); profiles->tqrepaintContents();
} }
void ProfileDlg::slotLoadProfile() void ProfileDlg::slotLoadProfile()
{ {
QString profile = profiles->currentText(); TQString profile = profiles->currentText();
QString msg = QString( i18n("Do you really want to load the profile and overwrite the current settings: %1") ).arg( profile ); 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() ) 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; return;
} }
@ -525,14 +525,14 @@ void ProfileDlg::slotLoadProfile()
void ProfileDlg::slotCreateProfile() void ProfileDlg::slotCreateProfile()
{ {
bool ok = false; bool ok = false;
const char* mask = "xXXXXXXXXXXXXXXXXXXX"; // allows for 20 characters const char* tqmask = "xXXXXXXXXXXXXXXXXXXX"; // allows for 20 characters
QString name = KInputDialog::getText( i18n("Profile Name"), i18n("Please enter a name for the new profile:"), TQString name = KInputDialog::getText( i18n("Profile Name"), i18n("Please enter a name for the new profile:"),
"KRename", &ok, this, 0, 0, mask ); "KRename", &ok, this, 0, 0, tqmask );
if( !ok ) if( !ok )
return; 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.") ); KMessageBox::error( this, i18n("This profile does already exist. Please choose another name.") );
slotCreateProfile(); slotCreateProfile();
@ -553,22 +553,22 @@ void ProfileDlg::slotDeleteProfile()
return; return;
} }
QString profile = profiles->currentText(); TQString profile = profiles->currentText();
QString msg = QString( i18n("Do you really want to delete the profile: %1") ).arg( profile ); TQString msg = TQString( i18n("Do you really want to delete the profile: %1") ).tqarg( profile );
if( KMessageBox::questionYesNo( this, msg ) == KMessageBox::Yes ) if( KMessageBox::questionYesNo( this, msg ) == KMessageBox::Yes )
{ {
QString path = readProfilePath( profile ); TQString path = readProfilePath( profile );
QFile::remove( path ); TQFile::remove( path );
QListBoxItem* item = profiles->findItem( profile, Qt::ExactMatch ); TQListBoxItem* item = profiles->tqfindItem( profile, TQt::ExactMatch );
if( item ) if( item )
delete item; delete item;
KConfig* conf = kapp->config(); KConfig* conf = kapp->config();
conf->setGroup( "ProfilesHeader" ); conf->setGroup( "ProfilesHeader" );
QStringList list = conf->readListEntry( "list" ); TQStringList list = conf->readListEntry( "list" );
list.remove( profile ); list.remove( profile );
conf->writeEntry( "list", list ); conf->writeEntry( "list", list );
conf->sync(); conf->sync();
@ -581,7 +581,7 @@ void ProfileDlg::slotHidden()
{ {
int i; int i;
KConfig* conf = kapp->config(); KConfig* conf = kapp->config();
QString def = QString::null; TQString def = TQString();
ProfileListBoxText* item; ProfileListBoxText* item;
for( i=0;i<(int)profiles->count();i++ ) for( i=0;i<(int)profiles->count();i++ )

@ -23,25 +23,25 @@
class KListBox; class KListBox;
class KPushButton; class KPushButton;
class KRenameImpl; class KRenameImpl;
class QCheckBox; class TQCheckBox;
class ProfileManager { class ProfileManager {
public: public:
ProfileManager( KRenameImpl* krename ); ProfileManager( KRenameImpl* krename );
static void loadDefaultProfile( 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(); static bool hasDefaultProfile();
protected: protected:
const QString getProfilePath( const QString & name ); const TQString getProfilePath( const TQString & name );
const QString readProfilePath( const QString & name ); const TQString readProfilePath( const TQString & name );
const QString listToString( QValueList<int> & list ); const TQString listToString( TQValueList<int> & list );
const QValueList<int> stringToList( const QString & ); const TQValueList<int> stringToList( const TQString & );
void writeXML( const QString & name ); void writeXML( const TQString & name );
bool loadXML( const QString & path ); bool loadXML( const TQString & path );
protected: protected:
KRenameImpl* m_krename; KRenameImpl* m_krename;
@ -54,9 +54,10 @@ class ProfileManager {
class ProfileDlg : public KDialogBase, public ProfileManager class ProfileDlg : public KDialogBase, public ProfileManager
{ {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
ProfileDlg(KRenameImpl* krename, QWidget *parent = 0, const char *name = 0); ProfileDlg(KRenameImpl* krename, TQWidget *tqparent = 0, const char *name = 0);
~ProfileDlg(); ~ProfileDlg();
private slots: private slots:
@ -70,7 +71,7 @@ class ProfileDlg : public KDialogBase, public ProfileManager
private: private:
KListBox* profiles; KListBox* profiles;
QCheckBox* checkDefault; TQCheckBox* checkDefault;
KPushButton* createProfile; KPushButton* createProfile;
KPushButton* loadProfile; KPushButton* loadProfile;
KPushButton* deleteProfile; KPushButton* deleteProfile;

@ -19,11 +19,11 @@
#include "replacedialog.h" #include "replacedialog.h"
// QT includes // QT includes
#include <qcheckbox.h> #include <tqcheckbox.h>
#include <qlabel.h> #include <tqlabel.h>
#include <qlineedit.h> #include <tqlineedit.h>
#include <qlayout.h> #include <tqlayout.h>
#include <qregexp.h> #include <tqregexp.h>
// KDE includes // KDE includes
#include <kapplication.h> #include <kapplication.h>
@ -35,34 +35,34 @@
#include <kpushbutton.h> #include <kpushbutton.h>
#include <kregexpeditorinterface.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( 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 = new KListView( plainPage() );
list->addColumn( i18n("Find") ); list->addColumn( i18n("Find") );
list->addColumn( i18n("Replace With") ); list->addColumn( i18n("Replace With") );
list->addColumn( i18n("Regular Expression") ); list->addColumn( i18n("Regular Expression") );
list->addColumn( "regexp" ); // no i18n, because not user visible list->addColumn( "regexp" ); // no i18n, because not user visible
// list->setColumnWidthMode( 0, QListView::Manual ); // list->setColumnWidthMode( 0, TQListView::Manual );
// list->setColumnWidthMode( 1, QListView::Manual ); // list->setColumnWidthMode( 1, TQListView::Manual );
// list->setColumnWidthMode( 2, QListView::Manual ); // list->setColumnWidthMode( 2, TQListView::Manual );
list->setColumnWidthMode( 3, QListView::Manual ); list->setColumnWidthMode( 3, TQListView::Manual );
list->setColumnWidth( 3, 0 ); list->setColumnWidth( 3, 0 );
list->setSorting( -1 ); list->setSorting( -1 );
list->setAllColumnsShowFocus( true ); list->setAllColumnsShowFocus( true );
TextLabel1 = new QLabel( plainPage() ); TextLabel1 = new TQLabel( plainPage() );
TextLabel1->setText( i18n( "Find:" ) ); TextLabel1->setText( i18n( "Find:" ) );
TextLabel2 = new QLabel( plainPage() ); TextLabel2 = new TQLabel( plainPage() );
TextLabel2->setText( i18n( "Replace with:" ) ); TextLabel2->setText( i18n( "Replace with:" ) );
text1 = new QLineEdit( plainPage() ); text1 = new TQLineEdit( plainPage() );
text2 = new QLineEdit( plainPage() ); text2 = new TQLineEdit( plainPage() );
checkReg = new QCheckBox( i18n("&Regular expression"), plainPage() ); checkReg = new TQCheckBox( i18n("&Regular expression"), plainPage() );
buttonRegEdit = new KPushButton( plainPage() ); buttonRegEdit = new KPushButton( plainPage() );
buttonRegEdit->setText( i18n( "&Edit..." ) ); buttonRegEdit->setText( i18n( "&Edit..." ) );
buttonRegEdit->setEnabled( false ); buttonRegEdit->setEnabled( false );
@ -75,7 +75,7 @@ ReplaceDialog::ReplaceDialog( QValueList<replacestrings> & r, QWidget* parent )
buttonRemove = new KPushButton( plainPage() ); buttonRemove = new KPushButton( plainPage() );
buttonRemove->setText( i18n( "&Remove" ) ); 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( TextLabel1, 0, 0 );
ReplaceDialogLayout->addWidget( text1, 0, 1 ); ReplaceDialogLayout->addWidget( text1, 0, 1 );
@ -96,26 +96,26 @@ ReplaceDialog::ReplaceDialog( QValueList<replacestrings> & r, QWidget* parent )
text1->setFocus(); text1->setFocus();
connect( buttonAdd, SIGNAL( clicked() ), this, SLOT( add() ) ); connect( buttonAdd, TQT_SIGNAL( clicked() ), this, TQT_SLOT( add() ) );
connect( buttonRemove, SIGNAL( clicked() ), this, SLOT( remove() ) ); connect( buttonRemove, TQT_SIGNAL( clicked() ), this, TQT_SLOT( remove() ) );
connect( list, SIGNAL( clicked( QListViewItem* ) ), this, SLOT( enableControls() ) ); connect( list, TQT_SIGNAL( clicked( TQListViewItem* ) ), this, TQT_SLOT( enableControls() ) );
connect( list, SIGNAL( doubleClicked( QListViewItem* ) ), this, SLOT( slotEdit() ) ); connect( list, TQT_SIGNAL( doubleClicked( TQListViewItem* ) ), this, TQT_SLOT( slotEdit() ) );
connect( text2, SIGNAL( returnPressed() ), this, SLOT( add() ) ); connect( text2, TQT_SIGNAL( returnPressed() ), this, TQT_SLOT( add() ) );
connect( text1, SIGNAL( returnPressed() ), this, SLOT( moveFocus() ) ); connect( text1, TQT_SIGNAL( returnPressed() ), this, TQT_SLOT( moveFocus() ) );
connect( buttonRegEdit, SIGNAL( clicked() ), this, SLOT( invokeRegEdit() ) ); connect( buttonRegEdit, TQT_SIGNAL( clicked() ), this, TQT_SLOT( invokeRegEdit() ) );
connect( checkReg, SIGNAL( clicked() ), this, SLOT( enableControls() ) ); connect( checkReg, TQT_SIGNAL( clicked() ), this, TQT_SLOT( enableControls() ) );
connect( buttonEdit, SIGNAL( clicked() ), this, SLOT( slotEdit() ) ); connect( buttonEdit, TQT_SIGNAL( clicked() ), this, TQT_SLOT( slotEdit() ) );
for( unsigned int i = 0; i < r.count(); i++ ) { for( unsigned int i = 0; i < r.count(); i++ ) {
replacestrings rs = r[i]; replacestrings rs = r[i];
BatchRenamer::unEscape( rs.find ); BatchRenamer::unEscape( rs.tqfind );
KListViewItem* item = new KListViewItem( list ); KListViewItem* item = new KListViewItem( list );
item->setText( 0, encode( rs.find ) ); item->setText( 0, encode( rs.tqfind ) );
item->setText( 1, encode( rs.replace ) ); item->setText( 1, encode( rs.tqreplace ) );
item->setText( 2, rs.reg ? i18n("yes") : i18n("no") ); 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 ); list->insertItem( item );
} }
@ -132,7 +132,7 @@ void ReplaceDialog::add()
return; return;
} }
QListViewItem* it = list->firstChild(); TQListViewItem* it = list->firstChild();
while( it ) { while( it ) {
if( it->text( 0 ) == text1->text() ) { if( it->text( 0 ) == text1->text() ) {
KMessageBox::sorry( this, i18n( "You can't replace the same text twice." ) ); 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( 0, encode( text1->text() ) );
item->setText( 1, encode( text2->text() ) ); item->setText( 1, encode( text2->text() ) );
item->setText( 2, checkReg->isChecked() ? i18n("yes") : i18n("no") ); 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 ); list->insertItem( item );
reset(); reset();
@ -156,7 +156,7 @@ void ReplaceDialog::add()
void ReplaceDialog::remove() void ReplaceDialog::remove()
{ {
if( list->selectedItem() ) { if( list->selectedItem() ) {
QListViewItem* item = list->selectedItem(); TQListViewItem* item = list->selectedItem();
list->takeItem( item ); list->takeItem( item );
delete item; delete item;
} }
@ -164,17 +164,17 @@ void ReplaceDialog::remove()
enableControls(); enableControls();
} }
QValueList<replacestrings> ReplaceDialog::getList() TQValueList<replacestrings> ReplaceDialog::getList()
{ {
QValueList<replacestrings> r; TQValueList<replacestrings> r;
QListViewItem* item = list->firstChild(); TQListViewItem* item = list->firstChild();
while( item ) { while( item ) {
replacestrings n; replacestrings n;
n.find = decode( item->text( 0 ) ); n.tqfind = decode( item->text( 0 ) );
n.replace = decode( item->text( 1 ) ); n.tqreplace = decode( item->text( 1 ) );
n.reg = item->text( 3 ).toInt(); n.reg = item->text( 3 ).toInt();
BatchRenamer::doEscape( n.find ); BatchRenamer::doEscape( n.tqfind );
r.append( n ); r.append( n );
@ -190,7 +190,7 @@ void ReplaceDialog::moveFocus()
void ReplaceDialog::invokeRegEdit() 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" ) ); KRegExpEditorInterface *iface = static_cast<KRegExpEditorInterface *>( regExpDialog->qt_cast( "KRegExpEditorInterface" ) );
if ( !iface ) if ( !iface )
@ -202,14 +202,14 @@ void ReplaceDialog::invokeRegEdit()
text1->setText( iface->regExp() ); text1->setText( iface->regExp() );
} }
QString ReplaceDialog::encode( QString s ) TQString ReplaceDialog::encode( TQString s )
{ {
s.append("\""); s.append("\"");
s.prepend("\""); s.prepend("\"");
return s; return s;
} }
QString ReplaceDialog::decode( QString s ) TQString ReplaceDialog::decode( TQString s )
{ {
if( s[0] == '"' ) if( s[0] == '"' )
s.remove( 0, 1 ); s.remove( 0, 1 );
@ -219,9 +219,9 @@ QString ReplaceDialog::decode( QString s )
return 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( 0, TextLabel1->width() + text1->width() );
// list->setColumnWidth( 1, TextLabel2->width() + text2->width() ); // list->setColumnWidth( 1, TextLabel2->width() + text2->width() );
} }
@ -247,7 +247,7 @@ void ReplaceDialog::slotEdit()
text2->setText( decode( list->selectedItem()->text( 1 ) ) ); text2->setText( decode( list->selectedItem()->text( 1 ) ) );
checkReg->setChecked( list->selectedItem()->text( 3 ).toInt() ); checkReg->setChecked( list->selectedItem()->text( 3 ).toInt() );
QListViewItem* item = list->selectedItem(); TQListViewItem* item = list->selectedItem();
list->takeItem( item ); list->takeItem( item );
delete item; delete item;

@ -20,28 +20,29 @@
// QT includes // QT includes
#include <kdialogbase.h> #include <kdialogbase.h>
#include <qvaluelist.h> #include <tqvaluelist.h>
// Own includes // Own includes
#include "batchrenamer.h" #include "batchrenamer.h"
class QCheckBox; class TQCheckBox;
class QGridLayout; class TQGridLayout;
class QGridLayout; class TQGridLayout;
class QLabel; class TQLabel;
class QLineEdit; class TQLineEdit;
class KPushButton; class KPushButton;
class QListViewItem; class TQListViewItem;
class KListView; class KListView;
class ReplaceDialog : public KDialogBase class ReplaceDialog : public KDialogBase
{ {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
ReplaceDialog( QValueList<replacestrings> & r, QWidget* parent = 0 ); ReplaceDialog( TQValueList<replacestrings> & r, TQWidget* tqparent = 0 );
~ReplaceDialog(); ~ReplaceDialog();
QValueList<replacestrings> getList(); TQValueList<replacestrings> getList();
private slots: private slots:
void add(); void add();
@ -54,25 +55,25 @@ class ReplaceDialog : public KDialogBase
private: private:
void reset(); void reset();
QLabel* TextLabel1; TQLabel* TextLabel1;
QLineEdit* text2; TQLineEdit* text2;
QLabel* TextLabel2; TQLabel* TextLabel2;
QLineEdit* text1; TQLineEdit* text1;
KListView* list; KListView* list;
QCheckBox* checkReg; TQCheckBox* checkReg;
KPushButton* buttonAdd; KPushButton* buttonAdd;
KPushButton* buttonRemove; KPushButton* buttonRemove;
KPushButton* buttonEdit; KPushButton* buttonEdit;
KPushButton* buttonRegEdit; KPushButton* buttonRegEdit;
QString encode( QString s ); TQString encode( TQString s );
QString decode( QString s ); TQString decode( TQString s );
protected: protected:
void resizeEvent( QResizeEvent* e ); void resizeEvent( TQResizeEvent* e );
QGridLayout* ReplaceDialogLayout; TQGridLayout* ReplaceDialogLayout;
}; };
#endif // REPLACEDIALOG_H #endif // REPLACEDIALOG_H

@ -19,10 +19,10 @@
#include "krenameimpl.h" #include "krenameimpl.h"
#include "kmyhistorycombo.h" #include "kmyhistorycombo.h"
// Qt includes // TQt includes
#include <qlayout.h> #include <tqlayout.h>
#include <qsizepolicy.h> #include <tqsizepolicy.h>
#include <qtabwidget.h> #include <tqtabwidget.h>
// KDE includes // KDE includes
#include <kapplication.h> #include <kapplication.h>
@ -33,16 +33,16 @@
#include <kpushbutton.h> #include <kpushbutton.h>
#include <kstartupinfo.h> #include <kstartupinfo.h>
tabs::tabs(KRenameImpl* impl, QRect r, QWidget *parent, const char *name ) tabs::tabs(KRenameImpl* impl, TQRect r, TQWidget *tqparent, const char *name )
: QDialog(parent,name) : TQDialog(tqparent,name)
{ {
setIcon( BarIcon( "krename" ) ); setIcon( BarIcon( "krename" ) );
QVBoxLayout* layout = new QVBoxLayout( this, 6, 6 ); TQVBoxLayout* tqlayout = new TQVBoxLayout( this, 6, 6 );
QHBoxLayout* buttons = new QHBoxLayout( 0, 6, 6 ); TQHBoxLayout* buttons = new TQHBoxLayout( 0, 6, 6 );
QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Expanding ); 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 = new KPushButton( i18n("&Finish"), this );
finishButton->setIconSet( SmallIconSet( "finish" ) ); finishButton->setIconSet( SmallIconSet( "finish" ) );
finishButton->setDefault( true ); finishButton->setDefault( true );
@ -53,21 +53,21 @@ tabs::tabs(KRenameImpl* impl, QRect r, QWidget *parent, const char *name )
buttons->addWidget( finishButton ); buttons->addWidget( finishButton );
buttons->addWidget( cancelButton ); buttons->addWidget( cancelButton );
layout->addWidget( tab ); tqlayout->addWidget( tab );
layout->addLayout( buttons ); tqlayout->addLayout( buttons );
layout->setStretchFactor( tab, 2 ); tqlayout->setStretchFactor( tab, 2 );
menuBar = new KMenuBar( this ); 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 ); krename = impl ? impl : new KRenameImpl( this, menuBar, finishButton );
connect( krename, SIGNAL( pageDone( QWidget*, const QString & ) ), this, SLOT( slotAddPage( QWidget*, const QString & ) ) ); connect( krename, TQT_SIGNAL( pageDone( TQWidget*, const TQString & ) ), this, TQT_SLOT( slotAddPage( TQWidget*, const TQString & ) ) );
connect( krename, SIGNAL( showPage( int ) ), this, SLOT( slotShowPage( int ) ) ); connect( krename, TQT_SIGNAL( showPage( int ) ), this, TQT_SLOT( slotShowPage( int ) ) );
connect( krename, SIGNAL( enableFinish( bool ) ), this, SLOT( slotEnableFinish( bool ) ) ); connect( krename, TQT_SIGNAL( enableFinish( bool ) ), this, TQT_SLOT( slotEnableFinish( bool ) ) );
connect( tab, SIGNAL( currentChanged( QWidget* ) ), this, SLOT( slotTabChanged() ) ); connect( tab, TQT_SIGNAL( currentChanged( TQWidget* ) ), this, TQT_SLOT( slotTabChanged() ) );
if( impl ) 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 ); 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 // ESC should not close KRename
if( e->key() == Qt::Key_Escape ) if( e->key() == TQt::Key_Escape )
e->accept(); e->accept();
else else
e->ignore(); e->ignore();

@ -18,32 +18,33 @@
#ifndef TABS_H #ifndef TABS_H
#define TABS_H #define TABS_H
#include <qwidget.h> #include <tqwidget.h>
#include <qdialog.h> #include <tqdialog.h>
class KMenuBar; class KMenuBar;
class KRenameImpl; class KRenameImpl;
class KPushButton; class KPushButton;
class QCloseEvent; class TQCloseEvent;
class QRect; class TQRect;
class QString; class TQString;
class QTabWidget; class TQTabWidget;
class tabs : public QDialog { class tabs : public TQDialog {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: 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(); ~tabs();
inline KRenameImpl* getKRename() { return krename; } inline KRenameImpl* getKRename() { return krename; }
private slots: private slots:
void slotAddPage( QWidget* page, const QString & title ); void slotAddPage( TQWidget* page, const TQString & title );
void slotShowPage( int page ); void slotShowPage( int page );
void slotEnableFinish( bool b ); void slotEnableFinish( bool b );
void slotTabChanged(); void slotTabChanged();
protected: protected:
virtual void keyPressEvent( QKeyEvent *e ); virtual void keyPressEvent( TQKeyEvent *e );
protected: protected:
KRenameImpl* krename; KRenameImpl* krename;
@ -51,7 +52,7 @@ class tabs : public QDialog {
KPushButton* cancelButton; KPushButton* cancelButton;
KMenuBar* menuBar; KMenuBar* menuBar;
QTabWidget* tab; TQTabWidget* tab;
}; };
#endif #endif

@ -22,10 +22,10 @@
#include "krecursivelister.h" #include "krecursivelister.h"
#include <kapplication.h> #include <kapplication.h>
#include <qmutex.h> #include <tqmutex.h>
ThreadedLister::ThreadedLister( QMutex* mutex, unsigned int* counter, KMyListBox* list ) ThreadedLister::ThreadedLister( TQMutex* mutex, unsigned int* counter, KMyListBox* list )
: QObject(), QThread(), m_mutex( mutex ), m_counter( counter ), m_list( list ) : TQObject(), TQThread(), m_mutex( mutex ), m_counter( counter ), m_list( list )
{ {
m_mutex->lock(); m_mutex->lock();
++(*m_counter); ++(*m_counter);
@ -56,7 +56,7 @@ ThreadedLister::~ThreadedLister()
void ThreadedLister::run() void ThreadedLister::run()
{ {
m_internal = new QMutex(); m_internal = new TQMutex();
m_internal->lock(); m_internal->lock();
if( m_recursive ) if( m_recursive )
@ -67,7 +67,7 @@ void ThreadedLister::run()
m_reclister->setNameFilter( m_filter ); m_reclister->setNameFilter( m_filter );
m_reclister->setDirOnlyMode( m_dironly ); 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 ); m_reclister->openURL( m_dirname );
} else { } else {
@ -77,7 +77,7 @@ void ThreadedLister::run()
m_lister->setShowingDotFiles( m_hidden ); m_lister->setShowingDotFiles( m_hidden );
m_lister->setNameFilter( m_filter ); 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 ); m_lister->openURL( m_dirname, false, false );
} }
@ -88,7 +88,7 @@ void ThreadedLister::run()
m_internal->lock(); m_internal->lock();
m_internal->unlock(); 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 ) if( m_dirnames )
{ {
QString name = m_dirname.fileName(); TQString name = m_dirname.fileName();
if( !m_hidden && name.right( 1 ) != QString::fromLatin1(".") ) if( !m_hidden && name.right( 1 ) != TQString::tqfromLatin1(".") )
m_list->addDirName( m_dirname ); m_list->addDirName( m_dirname );
} }
@ -141,8 +141,8 @@ void ThreadedLister::listerFinished()
if( m_dirnames ) if( m_dirnames )
{ {
QString name = m_dirname.fileName(); TQString name = m_dirname.fileName();
if( !m_hidden && name.right( 1 ) != QString::fromLatin1(".") ) if( !m_hidden && name.right( 1 ) != TQString::tqfromLatin1(".") )
m_list->addDirName( m_dirname ); m_list->addDirName( m_dirname );
} }

@ -19,39 +19,40 @@
#ifndef THREADEDLISTER_H #ifndef THREADEDLISTER_H
#define THREADEDLISTER_H #define THREADEDLISTER_H
#include <qobject.h> #include <tqobject.h>
#include <qthread.h> #include <tqthread.h>
#include <kfileitem.h> #include <kfileitem.h>
class KDirLister; class KDirLister;
class KRecursiveLister; class KRecursiveLister;
class KMyListBox; class KMyListBox;
class QMutex; class TQMutex;
class FileList : public QPtrList<KFileItem> { class FileList : public TQPtrList<KFileItem> {
public: public:
FileList() : QPtrList<KFileItem>() {} FileList() : TQPtrList<KFileItem>() {}
FileList( KFileItemList list ) FileList( KFileItemList list )
: QPtrList<KFileItem>() { : TQPtrList<KFileItem>() {
KFileItem* it; KFileItem* it;
for( it = list.first(); it; it = list.next() ) for( it = list.first(); it; it = list.next() )
this->append( it ); this->append( it );
} }
protected: 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() ); 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 Q_OBJECT
TQ_OBJECT
public: public:
ThreadedLister( QMutex* mutex, unsigned int* counter, KMyListBox* list ); ThreadedLister( TQMutex* mutex, unsigned int* counter, KMyListBox* list );
~ThreadedLister(); ~ThreadedLister();
static int TYPE() { return 51984; } static int TYPE() { return 51984; }
@ -60,12 +61,12 @@ class ThreadedLister : public QObject, public QThread
inline const KURL & dirname(); inline const KURL & dirname();
inline bool dirnames(); inline bool dirnames();
inline const QString & filter(); inline const TQString & filter();
inline bool hidden(); inline bool hidden();
inline void setDirname( const KURL & dirname ); inline void setDirname( const KURL & dirname );
inline void setDirnames( bool names ); inline void setDirnames( bool names );
inline void setFilter( const QString & filter ); inline void setFilter( const TQString & filter );
inline void setHidden( bool h ); inline void setHidden( bool h );
inline void setRecursive( bool r ); inline void setRecursive( bool r );
inline void setRecursiveDirOnlyMode( bool m ); inline void setRecursiveDirOnlyMode( bool m );
@ -81,14 +82,14 @@ class ThreadedLister : public QObject, public QThread
void listerFinished(); void listerFinished();
private: private:
QMutex* m_mutex; TQMutex* m_mutex;
QMutex* m_internal; TQMutex* m_internal;
unsigned int* m_counter; unsigned int* m_counter;
FileList m_files; FileList m_files;
KURL m_dirname; KURL m_dirname;
QString m_filter; TQString m_filter;
bool m_hidden; bool m_hidden;
bool m_recursive; bool m_recursive;
bool m_dirnames; bool m_dirnames;
@ -110,7 +111,7 @@ void ThreadedLister::setDirnames( bool names )
m_dirnames = names; m_dirnames = names;
} }
void ThreadedLister::setFilter( const QString & filter ) void ThreadedLister::setFilter( const TQString & filter )
{ {
m_filter = filter; m_filter = filter;
} }
@ -145,7 +146,7 @@ bool ThreadedLister::dirnames()
return m_dirnames; return m_dirnames;
} }
const QString & ThreadedLister::filter() const TQString & ThreadedLister::filter()
{ {
return m_filter; return m_filter;
} }

@ -12,33 +12,33 @@
#include "translitplugin.h" #include "translitplugin.h"
#include "translitplugin.moc" #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","", "j","k","l","m","n","o","p","r","s","t","u","f","h","c","ch","sh","sh","","y","",
"e","yu","ya", "e","yu","ya",
"A","B","V","G","D","E","Yo","Zh","Z","I","J","K","L","M","N","O","P", "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", "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",
"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"); return i18n("Transliteration Plugin");
} }
const QString TranslitPlugin::getAccelName() const const TQString TranslitPlugin::getAccelName() const
{ {
return i18n("&Transliteration Plugin"); return i18n("&Transliteration Plugin");
} }
const QPixmap TranslitPlugin::getIcon() const const TQPixmap TranslitPlugin::getIcon() const
{ {
return kapp->iconLoader()->loadIcon( "fonts", KIcon::Small ); return kapp->iconLoader()->loadIcon( "fonts", KIcon::Small );
} }
@ -48,13 +48,13 @@ const int TranslitPlugin::type() const
return TYPE_FINAL_FILENAME; 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 ); i18n("<qt>This plugin transliterates names written with non-english characters.</qt>"), w );
l->addWidget( label ); 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 ); l->addWidget( label );
} }
@ -71,22 +71,22 @@ bool TranslitPlugin::checkError()
return true; 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 return output; // no error
} }
QString TranslitPlugin::translit(const QString & unicoded) TQString TranslitPlugin::translit(const TQString & tqunicoded)
{ {
int i; int i;
QString transed = ""; TQString transed = "";
for (i=0; i<(int)unicoded.length(); i++) { for (i=0; i<(int)tqunicoded.length(); i++) {
QString charIn = unicoded.mid(i, 1); TQString charIn = tqunicoded.mid(i, 1);
if (m_mapFromUTF8[charIn.utf8()]) { if (m_mapFromUTF8[charIn.utf8()]) {
QString charTrans = m_mapFromUTF8[charIn.utf8()]; TQString charTrans = m_mapFromUTF8[charIn.utf8()];
transed.append(charTrans); transed.append(charTrans);
} else { } else {
transed.append(charIn); transed.append(charIn);
@ -98,9 +98,9 @@ QString TranslitPlugin::translit(const QString & unicoded)
TranslitPlugin::TranslitPlugin() { TranslitPlugin::TranslitPlugin() {
// Initialize transliteration map // Initialize transliteration map
int i; int i;
for (i=0; m_strUtf8[i]!=QString::null; i++) { for (i=0; m_strUtf8[i]!=TQString(); i++) {
QString src = m_strUtf8[i]; TQString src = m_strUtf8[i];
QString dst = m_strEngl[i]; TQString dst = m_strEngl[i];
m_mapFromUTF8[src] = dst; m_mapFromUTF8[src] = dst;
} }
} }

@ -17,11 +17,11 @@
#include "batchrenamer.h" #include "batchrenamer.h"
// QT includes // QT includes
#include <qlabel.h> #include <tqlabel.h>
#include <qlayout.h> #include <tqlayout.h>
#include <qtextcodec.h> #include <tqtextcodec.h>
#include <qvgroupbox.h> #include <tqvgroupbox.h>
#include <qcheckbox.h> #include <tqcheckbox.h>
// KDE includes // KDE includes
#include <kapplication.h> #include <kapplication.h>
@ -35,25 +35,26 @@
*/ */
class TranslitPlugin : public Plugin { class TranslitPlugin : public Plugin {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
const QString getName() const; const TQString getName() const;
const QString getAccelName() const; const TQString getAccelName() const;
const int type() const; const int type() const;
const QPixmap getIcon() const; const TQPixmap getIcon() const;
void drawInterface( QWidget* w, QVBoxLayout* l ); void drawInterface( TQWidget* w, TQVBoxLayout* l );
void finished(); void finished();
bool checkError(); bool checkError();
void fillStructure(); void fillStructure();
QString processFile( BatchRenamer*, int, QString token, int ); TQString processFile( BatchRenamer*, int, TQString token, int );
TranslitPlugin(); TranslitPlugin();
protected: protected:
QString translit(const QString &); TQString translit(const TQString &);
typedef QMap<QString, QString> TranslitMap; typedef TQMap<TQString, TQString> TranslitMap;
TranslitMap m_mapFromUTF8; TranslitMap m_mapFromUTF8;
static const QString m_strUtf8[]; static const TQString m_strUtf8[];
static const QString m_strEngl[]; static const TQString m_strEngl[];
}; };
#endif #endif

@ -17,9 +17,9 @@
#include "undodialog.h" #include "undodialog.h"
// Qt includes // TQt includes
#include <qlabel.h> #include <tqlabel.h>
#include <qlayout.h> #include <tqlayout.h>
// KDE includes // KDE includes
#include <kfiledialog.h> #include <kfiledialog.h>
@ -29,13 +29,13 @@
#include <ktextbrowser.h> #include <ktextbrowser.h>
#include <kurlrequester.h> #include <kurlrequester.h>
UndoDialog::UndoDialog( QWidget* parent ) UndoDialog::UndoDialog( TQWidget* tqparent )
: KDialogBase( KDialogBase::Plain, i18n("Undo Renaming"), : 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:" ) ); TextLabel1->setText( i18n( "Undo script:" ) );
UndoDialogLayout->addWidget( TextLabel1 ); UndoDialogLayout->addWidget( TextLabel1 );
@ -47,20 +47,20 @@ UndoDialog::UndoDialog( QWidget* parent )
"*|All Files (*)") ); "*|All Files (*)") );
UndoDialogLayout->addWidget( scriptname ); 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>" ) ); TextLabel2->setText( i18n( "<qt>Undo Scripts are normal shell scripts which can also be executed manually from the command line.</qt>" ) );
UndoDialogLayout->addWidget( TextLabel2 ); UndoDialogLayout->addWidget( TextLabel2 );
browser = new KTextBrowser( plainPage()); browser = new KTextBrowser( plainPage());
browser->setWordWrap( QTextEdit::NoWrap ); browser->setWordWrap( TQTextEdit::NoWrap );
browser->setTextFormat( Qt::RichText ); browser->setTextFormat( TQt::RichText );
UndoDialogLayout->addWidget( browser ); UndoDialogLayout->addWidget( browser );
setButtonText( KDialogBase::User1, i18n( "&Start" ) ); setButtonText( KDialogBase::User1, i18n( "&Start" ) );
connect( this, SIGNAL( user1Clicked() ), this, SLOT( start() ) ); connect( this, TQT_SIGNAL( user1Clicked() ), this, TQT_SLOT( start() ) );
connect( scriptname, SIGNAL( textChanged( const QString & ) ), this, SLOT( enableControls() ) ); connect( scriptname, TQT_SIGNAL( textChanged( const TQString & ) ), this, TQT_SLOT( enableControls() ) );
enableControls(); enableControls();
} }
@ -89,14 +89,14 @@ void UndoDialog::start()
return; return;
} }
proc->resume(); proc->resume();
connect( proc, SIGNAL( receivedStdout( KProcess*, char*, int) ), this, SLOT( receive( KProcess*, char*, int ) ) ); connect( proc, TQT_SIGNAL( receivedStdout( KProcess*, char*, int) ), this, TQT_SLOT( receive( KProcess*, char*, int ) ) );
connect( proc, SIGNAL( receivedStderr( KProcess*, char*, int) ), this, SLOT( receiveErr( KProcess*, char*, int ) ) ); connect( proc, TQT_SIGNAL( receivedStderr( KProcess*, char*, int) ), this, TQT_SLOT( receiveErr( KProcess*, char*, int ) ) );
connect( proc, SIGNAL( processExited( KProcess* ) ), this, SLOT( finished( KProcess* ) ) ); connect( proc, TQT_SIGNAL( processExited( KProcess* ) ), this, TQT_SLOT( finished( KProcess* ) ) );
} }
void UndoDialog::receive( KProcess*, char* buffer, int len ) void UndoDialog::receive( KProcess*, char* buffer, int len )
{ {
QString text; TQString text;
for( int i = 0; i < len; i++ ) for( int i = 0; i < len; i++ )
text.append( buffer[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 ) void UndoDialog::receiveErr( KProcess*, char* buffer, int len )
{ {
QString text = "<b>"; TQString text = "<b>";
for( int i = 0; i < len; i++ ) for( int i = 0; i < len; i++ )
text.append( buffer[i] ); text.append( buffer[i] );
@ -121,12 +121,12 @@ void UndoDialog::finished( KProcess* p )
void UndoDialog::enableControls() void UndoDialog::enableControls()
{ {
QFileInfo fi( scriptname->url() ); TQFileInfo fi( scriptname->url() );
bool b = !scriptname->url().isEmpty() && fi.exists() && fi.isExecutable(); bool b = !scriptname->url().isEmpty() && fi.exists() && fi.isExecutable();
enableButton( KDialogBase::User1, b ); enableButton( KDialogBase::User1, b );
} }
void UndoDialog::setUndoScript( const QString & filename ) void UndoDialog::setUndoScript( const TQString & filename )
{ {
scriptname->setURL( filename ); scriptname->setURL( filename );
} }

@ -24,18 +24,19 @@ class KPushButton;
class KProcess; class KProcess;
class KTextBrowser; class KTextBrowser;
class KURLRequester; class KURLRequester;
class QVBoxLayout; class TQVBoxLayout;
class QHBoxLayout; class TQHBoxLayout;
class QGridLayout; class TQGridLayout;
class QLabel; class TQLabel;
class UndoDialog : public KDialogBase class UndoDialog : public KDialogBase
{ {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
UndoDialog( QWidget* parent = 0 ); UndoDialog( TQWidget* tqparent = 0 );
~UndoDialog(); ~UndoDialog();
void setUndoScript( const QString & filename ); void setUndoScript( const TQString & filename );
public slots: public slots:
void start(); void start();
@ -47,13 +48,13 @@ class UndoDialog : public KDialogBase
void enableControls(); void enableControls();
private: private:
QLabel* TextLabel1; TQLabel* TextLabel1;
KURLRequester* scriptname; KURLRequester* scriptname;
QLabel* TextLabel2; TQLabel* TextLabel2;
KTextBrowser* browser; KTextBrowser* browser;
protected: protected:
QVBoxLayout* UndoDialogLayout; TQVBoxLayout* UndoDialogLayout;
}; };
#endif // UNDODIALOG_H #endif // UNDODIALOG_H

@ -27,24 +27,24 @@
#include <kmessagebox.h> #include <kmessagebox.h>
#include <kstartupinfo.h> #include <kstartupinfo.h>
// Qt includes // TQt includes
#include <qlabel.h> #include <tqlabel.h>
#include <qlayout.h> #include <tqlayout.h>
#include <qpushbutton.h> #include <tqpushbutton.h>
#include <qsizepolicy.h> #include <tqsizepolicy.h>
#include <qvbox.h> #include <tqvbox.h>
wizard::wizard( KRenameImpl* impl, QRect r, QWidget* parent, const char* name ) wizard::wizard( KRenameImpl* impl, TQRect r, TQWidget* tqparent, const char* name )
: KWizard( parent, name ) : KWizard( tqparent, name )
{ {
setIcon( BarIcon( "krename" ) ); setIcon( BarIcon( "krename" ) );
menuBar = new KMenuBar(this); menuBar = new KMenuBar(this);
krename = impl ? impl : new KRenameImpl( this, menuBar, this->finishButton() ); krename = impl ? impl : new KRenameImpl( this, menuBar, this->finishButton() );
connect( krename, SIGNAL( pageDone( QWidget*, const QString & ) ), this, SLOT( slotAddPage( QWidget*, const QString & ) ) ); connect( krename, TQT_SIGNAL( pageDone( TQWidget*, const TQString & ) ), this, TQT_SLOT( slotAddPage( TQWidget*, const TQString & ) ) );
connect( krename, SIGNAL( showPage( int ) ), this, SLOT( slotShowPage( int ) ) ); connect( krename, TQT_SIGNAL( showPage( int ) ), this, TQT_SLOT( slotShowPage( int ) ) );
connect( krename, SIGNAL( enableFinish( bool ) ), this, SLOT( slotEnableFinish( bool ) ) ); connect( krename, TQT_SIGNAL( enableFinish( bool ) ), this, TQT_SLOT( slotEnableFinish( bool ) ) );
if( impl ) if( impl )
{ {
@ -59,14 +59,14 @@ wizard::wizard( KRenameImpl* impl, QRect r, QWidget* parent, const char* name )
KStartupInfo::sendFinish( id ); KStartupInfo::sendFinish( id );
// Disable ESC key // Disable ESC key
cancelButton()->setAccel( QKeySequence() ); cancelButton()->setAccel( TQKeySequence() );
} }
wizard::~wizard() wizard::~wizard()
{ {
} }
void wizard::slotAddPage( QWidget* page, const QString & title ) void wizard::slotAddPage( TQWidget* page, const TQString & title )
{ {
// exclude page 3 from wizard // exclude page 3 from wizard
if( krename->title( 2 ) == title ) if( krename->title( 2 ) == title )
@ -75,18 +75,18 @@ void wizard::slotAddPage( QWidget* page, const QString & title )
return; 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 ); TQFrame* hbar1 = new TQFrame( tqlayout, "<hr>", 0 );
hbar1->setFrameStyle( QFrame::Sunken + QFrame::HLine ); hbar1->setFrameStyle( TQFrame::Sunken + TQFrame::HLine );
page->reparent( layout, QPoint( 0, 0 ) ); page->reparent( tqlayout, TQPoint( 0, 0 ) );
addPage( layout, t ); addPage( tqlayout, t );
setHelpEnabled( layout, false ); setHelpEnabled( tqlayout, false );
} }
void wizard::slotShowPage( int page ) void wizard::slotShowPage( int page )

@ -20,27 +20,28 @@
// KDE includes // KDE includes
#include <kwizard.h> #include <kwizard.h>
class QCloseEvent; class TQCloseEvent;
class KRenameImpl; class KRenameImpl;
class KMenuBar; class KMenuBar;
class QCloseEvent; class TQCloseEvent;
class QHBoxLayout; class TQHBoxLayout;
class QRect; class TQRect;
class QString; class TQString;
class QVBoxLayout; class TQVBoxLayout;
class QWidget; class TQWidget;
class wizard : public KWizard class wizard : public KWizard
{ {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: 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(); ~wizard();
inline KRenameImpl* getKRename() { return krename; } inline KRenameImpl* getKRename() { return krename; }
private slots: private slots:
void slotAddPage( QWidget* page, const QString & title ); void slotAddPage( TQWidget* page, const TQString & title );
void slotShowPage( int page ); void slotShowPage( int page );
void slotEnableFinish( bool b ); void slotEnableFinish( bool b );

Loading…
Cancel
Save