diff options
721 files changed, 16001 insertions, 16001 deletions
diff --git a/ark/ace.cpp b/ark/ace.cpp index d9cce52..0c8fb14 100644 --- a/ark/ace.cpp +++ b/ark/ace.cpp @@ -22,7 +22,7 @@ */ -#include <qdir.h> +#include <tqdir.h> #include <kglobal.h> #include <klocale.h> @@ -36,7 +36,7 @@ #include "arkwidget.h" #include "settings.h" -AceArch::AceArch( ArkWidget *gui, const QString &filename ) +AceArch::AceArch( ArkWidget *gui, const TQString &filename ) : Arch( gui, filename ) { //m_archiver_program = m_unarchiver_program = "/usr/local/bin/unace"; @@ -49,14 +49,14 @@ AceArch::AceArch( ArkWidget *gui, const QString &filename ) m_dateCol = 3; m_numCols = 5; - m_archCols.append( new ArchColumns( 7, QRegExp( "[0-3][0-9]" ), 2 ) ); // Day - m_archCols.append( new ArchColumns( 6, QRegExp( "[01][0-9]" ), 2 ) ); // Month - m_archCols.append( new ArchColumns( 5, QRegExp( "[0-9][0-9]" ), 4 ) ); // Year - m_archCols.append( new ArchColumns( 8, QRegExp( "[0-9:]+" ), 8 ) ); // Time - m_archCols.append( new ArchColumns( 2, QRegExp( "[0-9]+" ) ) ); // Compressed Size - m_archCols.append( new ArchColumns( 1, QRegExp( "[0-9]+" ) ) ); // Size - m_archCols.append( new ArchColumns( 9, QRegExp( "[0-9][0-9]%" ) ) ); // Ratio - m_archCols.append( new ArchColumns( 0, QRegExp( "[^\\n]+" ), 4096 ) ); // Name + m_archCols.append( new ArchColumns( 7, TQRegExp( "[0-3][0-9]" ), 2 ) ); // Day + m_archCols.append( new ArchColumns( 6, TQRegExp( "[01][0-9]" ), 2 ) ); // Month + m_archCols.append( new ArchColumns( 5, TQRegExp( "[0-9][0-9]" ), 4 ) ); // Year + m_archCols.append( new ArchColumns( 8, TQRegExp( "[0-9:]+" ), 8 ) ); // Time + m_archCols.append( new ArchColumns( 2, TQRegExp( "[0-9]+" ) ) ); // Compressed Size + m_archCols.append( new ArchColumns( 1, TQRegExp( "[0-9]+" ) ) ); // Size + m_archCols.append( new ArchColumns( 9, TQRegExp( "[0-9][0-9]%" ) ) ); // Ratio + m_archCols.append( new ArchColumns( 0, TQRegExp( "[^\\n]+" ), 4096 ) ); // Name } AceArch::~AceArch() @@ -89,20 +89,20 @@ void AceArch::open() kdDebug() << "AceArch::open(): kp->args(): " << kp->args() << endl; - connect( kp, SIGNAL( receivedStdout(KProcess*, char*, int) ), - SLOT( slotReceivedTOC(KProcess*, char*, int) ) ); - connect( kp, SIGNAL( receivedStderr(KProcess*, char*, int) ), - SLOT( slotReceivedOutput(KProcess*, char*, int) ) ); - connect( kp, SIGNAL( processExited(KProcess*) ), - SLOT( slotOpenExited(KProcess*) ) ); + connect( kp, TQT_SIGNAL( receivedStdout(KProcess*, char*, int) ), + TQT_SLOT( slotReceivedTOC(KProcess*, char*, int) ) ); + connect( kp, TQT_SIGNAL( receivedStderr(KProcess*, char*, int) ), + TQT_SLOT( slotReceivedOutput(KProcess*, char*, int) ) ); + connect( kp, TQT_SIGNAL( processExited(KProcess*) ), + TQT_SLOT( slotOpenExited(KProcess*) ) ); - connect( kp, SIGNAL( receivedStdout(KProcess*, char*, int) ), - this, SLOT( catchMeIfYouCan(KProcess*, char*, int) ) ); + connect( kp, TQT_SIGNAL( receivedStdout(KProcess*, char*, int) ), + this, TQT_SLOT( catchMeIfYouCan(KProcess*, char*, int) ) ); if ( !kp->start( KProcess::NotifyOnExit, KProcess::AllOutput ) ) { KMessageBox::error( 0, i18n( "Could not start a subprocess." ) ); - emit sigOpen( this, false, QString::null, 0 ); + emit sigOpen( this, false, TQString::null, 0 ); } } @@ -112,15 +112,15 @@ void AceArch::create() Arch::Extract | Arch::View ); } -void AceArch::addFile( const QStringList & urls ) +void AceArch::addFile( const TQStringList & urls ) { } -void AceArch::addDir( const QString & dirName ) +void AceArch::addDir( const TQString & dirName ) { } -void AceArch::remove( QStringList *list ) +void AceArch::remove( TQStringList *list ) { } @@ -151,19 +151,19 @@ void AceArch::unarchFileInternal( ) // and we then extract everything in the archive. if ( m_fileList ) { - QStringList::Iterator it; + TQStringList::Iterator it; for ( it = m_fileList->begin(); it != m_fileList->end(); ++it ) { *kp << (*it); } } - connect( kp, SIGNAL( receivedStdout(KProcess*, char*, int) ), - SLOT( slotReceivedOutput(KProcess*, char*, int) ) ); - connect( kp, SIGNAL( receivedStderr(KProcess*, char*, int) ), - SLOT( slotReceivedOutput(KProcess*, char*, int) ) ); - connect( kp, SIGNAL( processExited(KProcess*) ), - SLOT( slotExtractExited(KProcess*) ) ); + connect( kp, TQT_SIGNAL( receivedStdout(KProcess*, char*, int) ), + TQT_SLOT( slotReceivedOutput(KProcess*, char*, int) ) ); + connect( kp, TQT_SIGNAL( receivedStderr(KProcess*, char*, int) ), + TQT_SLOT( slotReceivedOutput(KProcess*, char*, int) ) ); + connect( kp, TQT_SIGNAL( processExited(KProcess*) ), + TQT_SLOT( slotExtractExited(KProcess*) ) ); if ( !kp->start( KProcess::NotifyOnExit, KProcess::AllOutput ) ) { @@ -174,7 +174,7 @@ void AceArch::unarchFileInternal( ) void AceArch::catchMeIfYouCan( KProcess*, char *buffer, int buflen ) { - QString myBuf = QString::fromLatin1( buffer, buflen ); + TQString myBuf = TQString::fromLatin1( buffer, buflen ); kdDebug(1601) << " Wololo!: " << myBuf << endl; } @@ -33,16 +33,16 @@ class AceArch : public Arch { Q_OBJECT public: - AceArch( ArkWidget *, const QString & ); + AceArch( ArkWidget *, const TQString & ); virtual ~AceArch(); virtual void open(); virtual void create(); - virtual void addFile( const QStringList & ); - virtual void addDir( const QString & ); + virtual void addFile( const TQStringList & ); + virtual void addDir( const TQString & ); - virtual void remove( QStringList * ); + virtual void remove( TQStringList * ); virtual void unarchFileInternal( ); private slots: @@ -32,7 +32,7 @@ #include <string.h> // QT includes -#include <qdir.h> +#include <tqdir.h> // KDE includes #include <kdebug.h> @@ -45,7 +45,7 @@ #include "settings.h" #include "ar.h" -ArArch::ArArch( ArkWidget *_gui, const QString & _fileName ) +ArArch::ArArch( ArkWidget *_gui, const TQString & _fileName ) : Arch(_gui, _fileName ) { m_archiver_program = m_unarchiver_program = "ar"; @@ -56,14 +56,14 @@ ArArch::ArArch( ArkWidget *_gui, const QString & _fileName ) m_numCols = 5; m_dateCol = 4; m_fixYear = 8; m_repairMonth = 5; m_fixDay = 6; m_fixTime = 7; - m_archCols.append(new ArchColumns(1, QRegExp("[a-zA-Z-]+"), 12)); // Perms - m_archCols.append(new ArchColumns(2, QRegExp("[^\\s]+"), 128)); //User/grp - m_archCols.append(new ArchColumns(3, QRegExp("[0-9]+"))); // Size - m_archCols.append(new ArchColumns(5, QRegExp("[a-zA-Z]+"), 4)); // Month - m_archCols.append(new ArchColumns(6, QRegExp("[0-9]+"), 2)); // Day - m_archCols.append(new ArchColumns(7, QRegExp("[0-9:]+"), 6)); // Time - m_archCols.append(new ArchColumns(8, QRegExp("[0-9]+"), 5)); // Year - m_archCols.append(new ArchColumns(0, QRegExp("[^\\s][^\\n]+"), 4096));// File + m_archCols.append(new ArchColumns(1, TQRegExp("[a-zA-Z-]+"), 12)); // Perms + m_archCols.append(new ArchColumns(2, TQRegExp("[^\\s]+"), 128)); //User/grp + m_archCols.append(new ArchColumns(3, TQRegExp("[0-9]+"))); // Size + m_archCols.append(new ArchColumns(5, TQRegExp("[a-zA-Z]+"), 4)); // Month + m_archCols.append(new ArchColumns(6, TQRegExp("[0-9]+"), 2)); // Day + m_archCols.append(new ArchColumns(7, TQRegExp("[0-9:]+"), 6)); // Time + m_archCols.append(new ArchColumns(8, TQRegExp("[0-9]+"), 5)); // Year + m_archCols.append(new ArchColumns(0, TQRegExp("[^\\s][^\\n]+"), 4096));// File kdDebug(1601) << "ArArch constructor" << endl; } @@ -89,18 +89,18 @@ void ArArch::open() KProcess *kp = m_currentProcess = new KProcess; *kp << m_archiver_program << "vt" << m_filename; - connect( kp, SIGNAL(receivedStdout(KProcess*, char*, int)), - this, SLOT(slotReceivedTOC(KProcess*, char*, int))); - connect( kp, SIGNAL(receivedStderr(KProcess*, char*, int)), - this, SLOT(slotReceivedOutput(KProcess*, char*, int))); + connect( kp, TQT_SIGNAL(receivedStdout(KProcess*, char*, int)), + this, TQT_SLOT(slotReceivedTOC(KProcess*, char*, int))); + connect( kp, TQT_SIGNAL(receivedStderr(KProcess*, char*, int)), + this, TQT_SLOT(slotReceivedOutput(KProcess*, char*, int))); - connect( kp, SIGNAL(processExited(KProcess*)), this, - SLOT(slotOpenExited(KProcess*))); + connect( kp, TQT_SIGNAL(processExited(KProcess*)), this, + TQT_SLOT(slotOpenExited(KProcess*))); if (kp->start(KProcess::NotifyOnExit, KProcess::AllOutput) == false) { KMessageBox::error( 0, i18n("Could not start a subprocess.") ); - emit sigOpen(this, false, QString::null, 0 ); + emit sigOpen(this, false, TQString::null, 0 ); } kdDebug(1601) << "-ArArch::open" << endl; } @@ -111,10 +111,10 @@ void ArArch::create() kp->clearArguments(); *kp << m_archiver_program << "c" << m_filename; - connect( kp, SIGNAL(receivedStdout(KProcess*, char*, int)), - this, SLOT(slotReceivedOutput(KProcess*, char*, int))); - connect( kp, SIGNAL(receivedStderr(KProcess*, char*, int)), - this, SLOT(slotReceivedOutput(KProcess*, char*, int))); + connect( kp, TQT_SIGNAL(receivedStdout(KProcess*, char*, int)), + this, TQT_SLOT(slotReceivedOutput(KProcess*, char*, int))); + connect( kp, TQT_SIGNAL(receivedStderr(KProcess*, char*, int)), + this, TQT_SLOT(slotReceivedOutput(KProcess*, char*, int))); if (kp->start(KProcess::Block) == false) { @@ -129,7 +129,7 @@ void ArArch::create() | Arch::View); } -void ArArch::addFile( const QStringList &urls ) +void ArArch::addFile( const TQStringList &urls ) { kdDebug(1601) << "+ArArch::addFile" << endl; KProcess *kp = m_currentProcess = new KProcess; @@ -143,22 +143,22 @@ void ArArch::addFile( const QStringList &urls ) *kp << m_filename; - QStringList::ConstIterator iter; + TQStringList::ConstIterator iter; KURL url( urls.first() ); - QDir::setCurrent( url.directory() ); + TQDir::setCurrent( url.directory() ); for (iter = urls.begin(); iter != urls.end(); ++iter ) { KURL fileURL( *iter ); *kp << fileURL.fileName(); } - connect( kp, SIGNAL(receivedStdout(KProcess*, char*, int)), - this, SLOT(slotReceivedOutput(KProcess*, char*, int))); - connect( kp, SIGNAL(receivedStderr(KProcess*, char*, int)), - this, SLOT(slotReceivedOutput(KProcess*, char*, int))); + connect( kp, TQT_SIGNAL(receivedStdout(KProcess*, char*, int)), + this, TQT_SLOT(slotReceivedOutput(KProcess*, char*, int))); + connect( kp, TQT_SIGNAL(receivedStderr(KProcess*, char*, int)), + this, TQT_SLOT(slotReceivedOutput(KProcess*, char*, int))); - connect( kp, SIGNAL(processExited(KProcess*)), this, - SLOT(slotAddExited(KProcess*))); + connect( kp, TQT_SIGNAL(processExited(KProcess*)), this, + TQT_SLOT(slotAddExited(KProcess*))); if (kp->start(KProcess::NotifyOnExit, KProcess::AllOutput) == false) { @@ -175,7 +175,7 @@ void ArArch::unarchFileInternal() // if m_destDir is empty, abort with error. kdDebug(1601) << "+ArArch::unarchFile" << endl; - QString dest; + TQString dest; if (m_destDir.isEmpty() || m_destDir.isNull()) { @@ -187,7 +187,7 @@ void ArArch::unarchFileInternal() // ar has no option to specify the destination directory // so I have to change to it. - bool ret = QDir::setCurrent(dest); + bool ret = TQDir::setCurrent(dest); // I already checked the validity of the dir before coming here Q_ASSERT(ret); @@ -202,20 +202,20 @@ void ArArch::unarchFileInternal() // and we then extract everything in the archive. if (m_fileList) { - for ( QStringList::Iterator it = m_fileList->begin(); + for ( TQStringList::Iterator it = m_fileList->begin(); it != m_fileList->end(); ++it ) { *kp << (*it); } } - connect( kp, SIGNAL(receivedStdout(KProcess*, char*, int)), - this, SLOT(slotReceivedOutput(KProcess*, char*, int))); - connect( kp, SIGNAL(receivedStderr(KProcess*, char*, int)), - this, SLOT(slotReceivedOutput(KProcess*, char*, int))); + connect( kp, TQT_SIGNAL(receivedStdout(KProcess*, char*, int)), + this, TQT_SLOT(slotReceivedOutput(KProcess*, char*, int))); + connect( kp, TQT_SIGNAL(receivedStderr(KProcess*, char*, int)), + this, TQT_SLOT(slotReceivedOutput(KProcess*, char*, int))); - connect( kp, SIGNAL(processExited(KProcess*)), this, - SLOT(slotExtractExited(KProcess*))); + connect( kp, TQT_SIGNAL(processExited(KProcess*)), this, + TQT_SLOT(slotExtractExited(KProcess*))); if (kp->start(KProcess::NotifyOnExit, KProcess::AllOutput) == false) { @@ -224,7 +224,7 @@ void ArArch::unarchFileInternal() } } -void ArArch::remove(QStringList *list) +void ArArch::remove(TQStringList *list) { kdDebug(1601) << "+ArArch::remove" << endl; @@ -235,20 +235,20 @@ void ArArch::remove(QStringList *list) kp->clearArguments(); *kp << m_archiver_program << "d" << m_filename; - for ( QStringList::Iterator it = list->begin(); + for ( TQStringList::Iterator it = list->begin(); it != list->end(); ++it ) { - QString str = *it; + TQString str = *it; *kp << str; } - connect( kp, SIGNAL(receivedStdout(KProcess*, char*, int)), - this, SLOT(slotReceivedOutput(KProcess*, char*, int))); - connect( kp, SIGNAL(receivedStderr(KProcess*, char*, int)), - this, SLOT(slotReceivedOutput(KProcess*, char*, int))); + connect( kp, TQT_SIGNAL(receivedStdout(KProcess*, char*, int)), + this, TQT_SLOT(slotReceivedOutput(KProcess*, char*, int))); + connect( kp, TQT_SIGNAL(receivedStderr(KProcess*, char*, int)), + this, TQT_SLOT(slotReceivedOutput(KProcess*, char*, int))); - connect( kp, SIGNAL(processExited(KProcess*)), this, - SLOT(slotDeleteExited(KProcess*))); + connect( kp, TQT_SIGNAL(processExited(KProcess*)), this, + TQT_SLOT(slotDeleteExited(KProcess*))); if (kp->start(KProcess::NotifyOnExit, KProcess::AllOutput) == false) { @@ -42,16 +42,16 @@ class ArArch : public Arch Q_OBJECT public: ArArch( ArkWidget *_gui, - const QString & _fileName ); + const TQString & _fileName ); virtual ~ArArch() {} virtual void open(); virtual void create(); - virtual void addFile( const QStringList & ); - virtual void addDir(const QString &) {} // never gets called + virtual void addFile( const TQStringList & ); + virtual void addDir(const TQString &) {} // never gets called - virtual void remove(QStringList *); + virtual void remove(TQStringList *); virtual void unarchFileInternal(); private: diff --git a/ark/arch.cpp b/ark/arch.cpp index 1916e12..a08484c 100644 --- a/ark/arch.cpp +++ b/ark/arch.cpp @@ -31,8 +31,8 @@ #include <time.h> // QT includes -#include <qapplication.h> -#include <qfile.h> +#include <tqapplication.h> +#include <tqfile.h> // KDE includes #include <kdebug.h> @@ -60,12 +60,12 @@ #include "sevenzip.h" #include "ace.h" -Arch::ArchColumns::ArchColumns( int col, QRegExp reg, int length, bool opt ) +Arch::ArchColumns::ArchColumns( int col, TQRegExp reg, int length, bool opt ) : colRef( col ), pattern( reg ), maxLength( length ), optional( opt ) { } -Arch::Arch( ArkWidget *gui, const QString &filename ) +Arch::Arch( ArkWidget *gui, const TQString &filename ) : m_filename( filename ), m_buffer( "" ), m_gui( gui ), m_bReadOnly( false ), m_bNotifyWhenDeleteFails( true ), m_header_removed( false ), m_finished( false ), @@ -83,18 +83,18 @@ Arch::~Arch() } //Check if a compress utility exists -void Arch::verifyCompressUtilityIsAvailable( const QString &utility ) +void Arch::verifyCompressUtilityIsAvailable( const TQString &utility ) { // see if the utility is in the PATH of the user. - QString cmd = KGlobal::dirs()->findExe( utility ); + TQString cmd = KGlobal::dirs()->findExe( utility ); m_bArchUtilityIsAvailable = !cmd.isEmpty(); } //Check if a utility can uncompress files -void Arch::verifyUncompressUtilityIsAvailable( const QString &utility ) +void Arch::verifyUncompressUtilityIsAvailable( const TQString &utility ) { // see if the utility is in the PATH of the user. - QString cmd = KGlobal::dirs()->findExe( utility ); + TQString cmd = KGlobal::dirs()->findExe( utility ); m_bUnarchUtilityIsAvailable = !cmd.isEmpty(); } @@ -106,7 +106,7 @@ void Arch::slotOpenExited( KProcess* _kp ) { if ( passwordRequired() ) { - QString msg; + TQString msg; if ( !m_password.isEmpty() ) msg = i18n("The password was incorrect. "); if (KPasswordDialog::getPassword( m_password, msg+i18n("You must enter a password to open the file:") ) == KPasswordDialog::Accepted ) @@ -118,7 +118,7 @@ void Arch::slotOpenExited( KProcess* _kp ) return; } m_password = ""; - emit sigOpen( this, false, QString::null, 0 ); + emit sigOpen( this, false, TQString::null, 0 ); delete _kp; _kp = m_currentProcess = 0; return; @@ -140,7 +140,7 @@ void Arch::slotOpenExited( KProcess* _kp ) emit sigOpen( this, true, m_filename, Arch::Extract | Arch::Delete | Arch::Add | Arch::View ); else - emit sigOpen( this, false, QString::null, 0 ); + emit sigOpen( this, false, TQString::null, 0 ); delete _kp; _kp = m_currentProcess = 0; @@ -152,13 +152,13 @@ void Arch::slotDeleteExited( KProcess *_kp ) if ( !success ) { - QApplication::restoreOverrideCursor(); + TQApplication::restoreOverrideCursor(); - QString msg = i18n( "The deletion operation failed." ); + TQString msg = i18n( "The deletion operation failed." ); if ( !getLastShellOutput().isNull() ) { - QStringList list = QStringList::split( "\n", getLastShellOutput() ); + TQStringList list = TQStringList::split( "\n", getLastShellOutput() ); KMessageBox::errorList( m_gui, msg, list ); clearShellOutput(); } @@ -181,7 +181,7 @@ void Arch::slotExtractExited( KProcess *_kp ) { if ( passwordRequired() ) { - QString msg; + TQString msg; if ( !m_password.isEmpty() ) msg = i18n("The password was incorrect. "); if (KPasswordDialog::getPassword( m_password, msg+i18n("You must enter a password to extract the file:") ) == KPasswordDialog::Accepted ) @@ -200,14 +200,14 @@ void Arch::slotExtractExited( KProcess *_kp ) } else if ( m_password.isEmpty() || _kp->exitStatus() > 1 ) { - QApplication::restoreOverrideCursor(); + TQApplication::restoreOverrideCursor(); - QString msg = i18n( "The extraction operation failed." ); + TQString msg = i18n( "The extraction operation failed." ); if ( !getLastShellOutput().isNull() ) { - //getLastShellOutput() is a QString. errorList is expecting QStringLists to show in multiple lines - QStringList list = QStringList::split( "\n", getLastShellOutput() ); + //getLastShellOutput() is a TQString. errorList is expecting QStringLists to show in multiple lines + TQStringList list = TQStringList::split( "\n", getLastShellOutput() ); KMessageBox::errorList( m_gui, msg, list ); clearShellOutput(); } @@ -223,7 +223,7 @@ void Arch::slotExtractExited( KProcess *_kp ) emit sigExtract( success ); } -void Arch::unarchFile( QStringList *fileList, const QString & destDir, +void Arch::unarchFile( TQStringList *fileList, const TQString & destDir, bool viewFriendly ) { m_fileList = fileList; @@ -238,13 +238,13 @@ void Arch::slotAddExited( KProcess *_kp ) if( !success ) { - QApplication::restoreOverrideCursor(); + TQApplication::restoreOverrideCursor(); - QString msg = i18n( "The addition operation failed." ); + TQString msg = i18n( "The addition operation failed." ); if ( !getLastShellOutput().isNull() ) { - QStringList list = QStringList::split( "\n", getLastShellOutput() ); + TQStringList list = TQStringList::split( "\n", getLastShellOutput() ); KMessageBox::errorList( m_gui, msg, list ); clearShellOutput(); } @@ -288,7 +288,7 @@ void Arch::slotReceivedTOC( KProcess*, char* data, int length ) data[ lfChar ] = '\0'; - m_buffer.append( QString::fromUtf8(data + startChar).latin1() ); + m_buffer.append( TQString::fromUtf8(data + startChar).latin1() ); data[ lfChar ] = '\n'; startChar = lfChar + 1; @@ -327,14 +327,14 @@ void Arch::slotReceivedTOC( KProcess*, char* data, int length ) data[ length ] = c; } -bool Arch::processLine( const QCString &line ) +bool Arch::processLine( const TQCString &line ) { - QString columns[ 11 ]; + TQString columns[ 11 ]; unsigned int pos = 0; int strpos, len; // Go through our columns, try to pick out data, return silently on failure - for ( QPtrListIterator <ArchColumns>col( m_archCols ); col.current(); ++col ) + for ( TQPtrListIterator <ArchColumns>col( m_archCols ); col.current(); ++col ) { ArchColumns *curCol = *col; @@ -354,20 +354,20 @@ bool Arch::processLine( const QCString &line ) pos = strpos + len; - columns[curCol->colRef] = QString::fromLocal8Bit( line.mid(strpos, len) ); + columns[curCol->colRef] = TQString::fromLocal8Bit( line.mid(strpos, len) ); } if ( m_dateCol >= 0 ) { - QString year = ( m_repairYear >= 0 ) ? + TQString year = ( m_repairYear >= 0 ) ? ArkUtils::fixYear( columns[ m_repairYear ].ascii()) : columns[ m_fixYear ]; - QString month = ( m_repairMonth >= 0 ) ? - QString( "%1" ) + TQString month = ( m_repairMonth >= 0 ) ? + TQString( "%1" ) .arg( ArkUtils::getMonth( columns[ m_repairMonth ].ascii() ) ) : columns[ m_fixMonth ]; - QString timestamp = QString::fromLatin1( "%1-%2-%3 %4" ) + TQString timestamp = TQString::fromLatin1( "%1-%2-%3 %4" ) .arg( year ) .arg( month ) .arg( columns[ m_fixDay ] ) @@ -376,7 +376,7 @@ bool Arch::processLine( const QCString &line ) columns[ m_dateCol ] = timestamp; } - QStringList list; + TQStringList list; for ( int i = 0; i < m_numCols; ++i ) { @@ -390,8 +390,8 @@ bool Arch::processLine( const QCString &line ) Arch *Arch::archFactory( ArchType aType, - ArkWidget *parent, const QString &filename, - const QString &openAsMimeType ) + ArkWidget *parent, const TQString &filename, + const TQString &openAsMimeType ) { switch( aType ) { @@ -49,12 +49,12 @@ #ifndef ARCH_H #define ARCH_H -#include <qobject.h> -#include <qptrlist.h> // Some very annoying hackery in arkwidgetpart -#include <qregexp.h> -#include <qstring.h> +#include <tqobject.h> +#include <tqptrlist.h> // Some very annoying hackery in arkwidgetpart +#include <tqregexp.h> +#include <tqstring.h> #include <kurl.h> -#include <qpair.h> +#include <tqpair.h> class QCString; class QStringList; @@ -67,7 +67,7 @@ enum ArchType { UNKNOWN_FORMAT, ZIP_FORMAT, TAR_FORMAT, AA_FORMAT, LHA_FORMAT, RAR_FORMAT, ZOO_FORMAT, COMPRESSED_FORMAT, SEVENZIP_FORMAT, ACE_FORMAT }; -typedef QValueList< QPair< QString, Qt::AlignmentFlags > > ColumnList; +typedef TQValueList< QPair< TQString, Qt::AlignmentFlags > > ColumnList; /** * Pure virtual base class for archives - provides a framework as well as @@ -86,23 +86,23 @@ class Arch : public QObject struct ArchColumns { int colRef; // Which column to load to in processLine - QRegExp pattern; + TQRegExp pattern; int maxLength; bool optional; - ArchColumns( int col, QRegExp reg, int length = 64, bool opt = false ); + ArchColumns( int col, TQRegExp reg, int length = 64, bool opt = false ); }; public: - Arch( ArkWidget *_viewer, const QString & _fileName ); + Arch( ArkWidget *_viewer, const TQString & _fileName ); virtual ~Arch(); virtual void open() = 0; virtual void create() = 0; - virtual void remove( QStringList * ) = 0; + virtual void remove( TQStringList * ) = 0; - virtual void addFile( const QStringList & ) = 0; - virtual void addDir( const QString & ) = 0; + virtual void addFile( const TQStringList & ) = 0; + virtual void addDir( const TQString & ) = 0; // unarch the files in m_fileList or all files if m_fileList is empty. // if m_destDir is empty, abort with error. @@ -111,10 +111,10 @@ class Arch : public QObject // returns true if a password is required virtual bool passwordRequired() { return false; } - void unarchFile( QStringList *, const QString & _destDir, + void unarchFile( TQStringList *, const TQString & _destDir, bool viewFriendly = false ); - QString fileName() const { return m_filename; } + TQString fileName() const { return m_filename; } enum EditProperties{ Add = 1, Delete = 2, Extract = 4, View = 8, Integrity = 16 }; @@ -127,28 +127,28 @@ class Arch : public QObject void resetError() { m_error = false; } // check to see if the utility exists in the PATH of the user - void verifyUtilityIsAvailable( const QString &, - const QString & = QString::null ); + void verifyUtilityIsAvailable( const TQString &, + const TQString & = TQString::null ); - void verifyCompressUtilityIsAvailable( const QString &utility ); + void verifyCompressUtilityIsAvailable( const TQString &utility ); - void verifyUncompressUtilityIsAvailable( const QString &utility ); + void verifyUncompressUtilityIsAvailable( const TQString &utility ); bool archUtilityIsAvailable() { return m_bArchUtilityIsAvailable; } bool unarchUtilityIsAvailable() { return m_bUnarchUtilityIsAvailable; } - QString getArchUtility() { return m_archiver_program; } + TQString getArchUtility() { return m_archiver_program; } - QString getUnarchUtility() { return m_unarchiver_program; } + TQString getUnarchUtility() { return m_unarchiver_program; } - void appendShellOutputData( const char * data ) { m_lastShellOutput.append( QString::fromLocal8Bit( data ) ); } + void appendShellOutputData( const char * data ) { m_lastShellOutput.append( TQString::fromLocal8Bit( data ) ); } void clearShellOutput() { m_lastShellOutput.truncate( 0 ); } - const QString& getLastShellOutput() const { return m_lastShellOutput; } + const TQString& getLastShellOutput() const { return m_lastShellOutput; } static Arch *archFactory( ArchType aType, ArkWidget *parent, - const QString &filename, - const QString &openAsMimeType = QString::null ); + const TQString &filename, + const TQString &openAsMimeType = TQString::null ); protected slots: void slotOpenExited( KProcess* ); @@ -158,21 +158,21 @@ class Arch : public QObject void slotReceivedOutput( KProcess *, char*, int ); - virtual bool processLine( const QCString &line ); + virtual bool processLine( const TQCString &line ); virtual void slotReceivedTOC( KProcess *, char *, int ); signals: - void sigOpen( Arch * archive, bool success, const QString &filename, int ); - void sigCreate( Arch *, bool, const QString &, int ); + void sigOpen( Arch * archive, bool success, const TQString &filename, int ); + void sigCreate( Arch *, bool, const TQString &, int ); void sigDelete( bool ); void sigExtract( bool ); void sigAdd( bool ); void headers( const ColumnList& columns ); protected: // data - QString m_filename; - QString m_lastShellOutput; - QCString m_buffer; + TQString m_filename; + TQString m_lastShellOutput; + TQCString m_buffer; ArkWidget *m_gui; bool m_bReadOnly; // for readonly archives bool m_error; @@ -186,20 +186,20 @@ class Arch : public QObject // set to whether if the uncompressing utility is in the user's PATH bool m_bUnarchUtilityIsAvailable; - QString m_archiver_program; - QString m_unarchiver_program; + TQString m_archiver_program; + TQString m_unarchiver_program; // Archive parsing information - QCString m_headerString; + TQCString m_headerString; bool m_header_removed, m_finished; - QPtrList<ArchColumns> m_archCols; + TQPtrList<ArchColumns> m_archCols; int m_numCols, m_dateCol, m_fixYear, m_fixMonth, m_fixDay, m_fixTime; int m_repairYear, m_repairMonth, m_repairTime; KProcess *m_currentProcess; - QStringList *m_fileList; - QString m_destDir; + TQStringList *m_fileList; + TQString m_destDir; bool m_viewFriendly; - QCString m_password; + TQCString m_password; }; // Columns diff --git a/ark/archiveformatdlg.cpp b/ark/archiveformatdlg.cpp index be046fb..5ac942c 100644 --- a/ark/archiveformatdlg.cpp +++ b/ark/archiveformatdlg.cpp @@ -25,17 +25,17 @@ #include <klocale.h> -#include <qlabel.h> -#include <qvbox.h> +#include <tqlabel.h> +#include <tqvbox.h> -ArchiveFormatDlg::ArchiveFormatDlg( QWidget * parent, const QString & defaultType ) +ArchiveFormatDlg::ArchiveFormatDlg( TQWidget * parent, const TQString & defaultType ) :KDialogBase( parent, "archiveformatdialog", true, i18n( "Choose Archive Format" ), KDialogBase::Ok|KDialogBase::Cancel, KDialogBase::Ok), m_combo( 0 ) { - QString defaultDescription = ArchiveFormatInfo::self()->descriptionForMimeType( defaultType ); - QString text; + TQString defaultDescription = ArchiveFormatInfo::self()->descriptionForMimeType( defaultType ); + TQString text; if ( defaultDescription.isNull() ) text = i18n( "This file appears to be of type %1,\n" "which is not a supported archive format.\n" @@ -47,24 +47,24 @@ ArchiveFormatDlg::ArchiveFormatDlg( QWidget * parent, const QString & defaultTyp "If this is not correct, please choose " "the appropriate format." ).arg( defaultDescription ); - QVBox * page = makeVBoxMainWidget(); + TQVBox * page = makeVBoxMainWidget(); - QLabel * label; - label = new QLabel( text, page ); + TQLabel * label; + label = new TQLabel( text, page ); m_combo = new KComboBox( page ); - QStringList list = ArchiveFormatInfo::self()->allDescriptions(); + TQStringList list = ArchiveFormatInfo::self()->allDescriptions(); list.sort(); m_combo->insertStringList( list ); m_combo->setCurrentItem( list.findIndex( defaultDescription ) ); } -QString ArchiveFormatDlg::mimeType() +TQString ArchiveFormatDlg::mimeType() { if (m_combo && !m_combo->currentText().isEmpty()) return ArchiveFormatInfo::self()->mimeTypeForDescription( m_combo->currentText() ); else - return QString(); + return TQString(); } #include "archiveformatdlg.moc" diff --git a/ark/archiveformatdlg.h b/ark/archiveformatdlg.h index c8a2e46..6ef2302 100644 --- a/ark/archiveformatdlg.h +++ b/ark/archiveformatdlg.h @@ -29,8 +29,8 @@ class ArchiveFormatDlg: public KDialogBase { Q_OBJECT public: - ArchiveFormatDlg( QWidget * parent, const QString & defaultType ); - QString mimeType(); + ArchiveFormatDlg( TQWidget * parent, const TQString & defaultType ); + TQString mimeType(); private: KComboBox * m_combo; diff --git a/ark/archiveformatinfo.cpp b/ark/archiveformatinfo.cpp index f2ac14d..4d7eda6 100644 --- a/ark/archiveformatinfo.cpp +++ b/ark/archiveformatinfo.cpp @@ -29,7 +29,7 @@ #include <kdesktopfile.h> #include <kfilterdev.h> -#include <qfile.h> +#include <tqfile.h> ArchiveFormatInfo * ArchiveFormatInfo::m_pSelf = 0; @@ -83,7 +83,7 @@ void ArchiveFormatInfo::buildFormatInfos() addFormatInfo( ACE_FORMAT, "application/x-ace", ".ace" ); } -void ArchiveFormatInfo::addFormatInfo( ArchType type, QString mime, QString stdExt ) +void ArchiveFormatInfo::addFormatInfo( ArchType type, TQString mime, TQString stdExt ) { FormatInfo & info = find( type ); @@ -101,10 +101,10 @@ void ArchiveFormatInfo::addFormatInfo( ArchType type, QString mime, QString stdE } -QString ArchiveFormatInfo::filter() +TQString ArchiveFormatInfo::filter() { - QStringList allExtensions; - QString filter; + TQStringList allExtensions; + TQString filter; InfoList::Iterator it; for ( it = m_formatInfos.begin(); it != m_formatInfos.end(); ++it ) { @@ -116,9 +116,9 @@ QString ArchiveFormatInfo::filter() + filter; } -const QStringList ArchiveFormatInfo::supportedMimeTypes( bool includeCompressed ) +const TQStringList ArchiveFormatInfo::supportedMimeTypes( bool includeCompressed ) { - QStringList list; + TQStringList list; InfoList::Iterator end = m_formatInfos.end(); for ( InfoList::Iterator it = m_formatInfos.begin(); it != end; ++it ) @@ -132,9 +132,9 @@ const QStringList ArchiveFormatInfo::supportedMimeTypes( bool includeCompressed return list; } -QStringList ArchiveFormatInfo::allDescriptions() +TQStringList ArchiveFormatInfo::allDescriptions() { - QStringList descriptions; + TQStringList descriptions; InfoList::Iterator it; for ( it = m_formatInfos.begin(); it != m_formatInfos.end(); ++it ) descriptions += (*it).allDescriptions; @@ -153,10 +153,10 @@ ArchiveFormatInfo::FormatInfo & ArchiveFormatInfo::find( ArchType type ) return ( *m_formatInfos.append( info ) ); } -ArchType ArchiveFormatInfo::archTypeByExtension( const QString & archname ) +ArchType ArchiveFormatInfo::archTypeByExtension( const TQString & archname ) { InfoList::Iterator it = m_formatInfos.begin(); - QStringList::Iterator ext; + TQStringList::Iterator ext; for( ; it != m_formatInfos.end(); ++it ) { ext = (*it).extensions.begin(); @@ -167,7 +167,7 @@ ArchType ArchiveFormatInfo::archTypeByExtension( const QString & archname ) return UNKNOWN_FORMAT; } -ArchType ArchiveFormatInfo::archTypeForMimeType( const QString & mimeType ) +ArchType ArchiveFormatInfo::archTypeForMimeType( const TQString & mimeType ) { InfoList::Iterator it = m_formatInfos.begin(); for( ; it != m_formatInfos.end(); ++it ) @@ -186,10 +186,10 @@ ArchType ArchiveFormatInfo::archTypeForURL( const KURL & url ) if( url.isEmpty() ) return UNKNOWN_FORMAT; - if( !QFile::exists( url.path() ) ) + if( !TQFile::exists( url.path() ) ) return archTypeByExtension( url.path() ); - QString mimeType = KMimeType::findByURL( url, 0, true, true )->name(); + TQString mimeType = KMimeType::findByURL( url, 0, true, true )->name(); kdDebug( 1601 ) << "find by url: " << mimeType << endl; if( mimeType == KMimeType::defaultMimeType() ) { @@ -205,13 +205,13 @@ ArchType ArchiveFormatInfo::archTypeForURL( const KURL & url ) } -QString ArchiveFormatInfo::findMimeType( const KURL & url ) +TQString ArchiveFormatInfo::findMimeType( const KURL & url ) { - QString mimeType = KMimeType::findByURL( url )->name(); + TQString mimeType = KMimeType::findByURL( url )->name(); if ( mimeType != "application/x-bzip2" && mimeType != "application/x-gzip" ) return mimeType; - QIODevice * dev = KFilterDev::deviceForFile( url.path(), mimeType ); + TQIODevice * dev = KFilterDev::deviceForFile( url.path(), mimeType ); if ( !dev ) return mimeType; @@ -232,7 +232,7 @@ QString ArchiveFormatInfo::findMimeType( const KURL & url ) return mimeType; } -QString ArchiveFormatInfo::mimeTypeForDescription( const QString & description ) +TQString ArchiveFormatInfo::mimeTypeForDescription( const TQString & description ) { InfoList::Iterator it = m_formatInfos.begin(); int index; @@ -242,10 +242,10 @@ QString ArchiveFormatInfo::mimeTypeForDescription( const QString & description ) if ( index != -1 ) return (* (*it).mimeTypes.at( index ) ); } - return QString::null; + return TQString::null; } -QString ArchiveFormatInfo::descriptionForMimeType( const QString & mimeType ) +TQString ArchiveFormatInfo::descriptionForMimeType( const TQString & mimeType ) { InfoList::Iterator it = m_formatInfos.begin(); int index; @@ -255,10 +255,10 @@ QString ArchiveFormatInfo::descriptionForMimeType( const QString & mimeType ) if ( index != -1 ) return (* (*it).allDescriptions.at( index ) ); } - return QString::null; + return TQString::null; } -QString ArchiveFormatInfo::defaultExtension( const QString & mimeType ) +TQString ArchiveFormatInfo::defaultExtension( const TQString & mimeType ) { InfoList::Iterator it = m_formatInfos.begin(); int index; @@ -268,7 +268,7 @@ QString ArchiveFormatInfo::defaultExtension( const QString & mimeType ) if ( index != -1 ) return (* (*it).defaultExtensions.at( index ) ); } - return QString::null; + return TQString::null; } bool ArchiveFormatInfo::wasUnknownExtension() diff --git a/ark/archiveformatinfo.h b/ark/archiveformatinfo.h index 5682a11..5ba5ef3 100644 --- a/ark/archiveformatinfo.h +++ b/ark/archiveformatinfo.h @@ -33,35 +33,35 @@ private: public: static ArchiveFormatInfo * self(); - QString filter(); - const QStringList supportedMimeTypes( bool includeCompressed = true ); - QStringList allDescriptions(); - ArchType archTypeForMimeType( const QString & mimeType ); - ArchType archTypeByExtension( const QString & archname ); + TQString filter(); + const TQStringList supportedMimeTypes( bool includeCompressed = true ); + TQStringList allDescriptions(); + ArchType archTypeForMimeType( const TQString & mimeType ); + ArchType archTypeByExtension( const TQString & archname ); ArchType archTypeForURL( const KURL & url ); - QString mimeTypeForDescription( const QString & description ); - QString findMimeType( const KURL & url ); - QString descriptionForMimeType( const QString & mimeType ); - QString defaultExtension( const QString & mimeType ); + TQString mimeTypeForDescription( const TQString & description ); + TQString findMimeType( const KURL & url ); + TQString descriptionForMimeType( const TQString & mimeType ); + TQString defaultExtension( const TQString & mimeType ); bool wasUnknownExtension(); private: void buildFormatInfos(); - void addFormatInfo( ArchType type, QString mime, QString stdExt ); + void addFormatInfo( ArchType type, TQString mime, TQString stdExt ); struct FormatInfo { - QStringList extensions; - QStringList mimeTypes; - QStringList allDescriptions; - QStringList defaultExtensions; - QString description; + TQStringList extensions; + TQStringList mimeTypes; + TQStringList allDescriptions; + TQStringList defaultExtensions; + TQString description; enum ArchType type; }; FormatInfo & find ( ArchType type ); - typedef QValueList<FormatInfo> InfoList; + typedef TQValueList<FormatInfo> InfoList; InfoList m_formatInfos; bool m_lastExtensionUnknown; diff --git a/ark/ark_part.cpp b/ark/ark_part.cpp index a574217..60e7ff0 100644 --- a/ark/ark_part.cpp +++ b/ark/ark_part.cpp @@ -39,8 +39,8 @@ #include <kpushbutton.h> #include <ksqueezedtextlabel.h> -#include <qfile.h> -#include <qtimer.h> +#include <tqfile.h> +#include <tqtimer.h> KAboutData *ArkPart::createAboutData() { @@ -63,8 +63,8 @@ KAboutData *ArkPart::createAboutData() -ArkPart::ArkPart( QWidget *parentWidget, const char * /*widgetName*/, QObject *parent, - const char *name, const QStringList &, bool readWrite ) +ArkPart::ArkPart( TQWidget *parentWidget, const char * /*widgetName*/, TQObject *parent, + const char *name, const TQStringList &, bool readWrite ) : KParts::ReadWritePart(parent, name) { kdDebug(1601)<<"ArkPart::ArkPart"<<endl; @@ -72,12 +72,12 @@ ArkPart::ArkPart( QWidget *parentWidget, const char * /*widgetName*/, QObject *p awidget = new ArkWidget( parentWidget, "ArkWidget" ); setWidget(awidget); - connect( awidget, SIGNAL( fixActions() ), this, SLOT( fixEnables() ) ); - connect( awidget, SIGNAL( disableAllActions() ), this, SLOT( disableActions() ) ); - connect( awidget, SIGNAL( signalFilePopup( const QPoint& ) ), this, SLOT( slotFilePopup( const QPoint& ) ) ); - connect( awidget, SIGNAL( setWindowCaption( const QString & ) ), this, SIGNAL( setWindowCaption( const QString & ) ) ); - connect( awidget, SIGNAL( removeRecentURL( const KURL & ) ), this, SIGNAL( removeRecentURL( const KURL & ) ) ); - connect( awidget, SIGNAL( addRecentURL( const KURL & ) ), this, SIGNAL( addRecentURL( const KURL & ) ) ); + connect( awidget, TQT_SIGNAL( fixActions() ), this, TQT_SLOT( fixEnables() ) ); + connect( awidget, TQT_SIGNAL( disableAllActions() ), this, TQT_SLOT( disableActions() ) ); + connect( awidget, TQT_SIGNAL( signalFilePopup( const TQPoint& ) ), this, TQT_SLOT( slotFilePopup( const TQPoint& ) ) ); + connect( awidget, TQT_SIGNAL( setWindowCaption( const TQString & ) ), this, TQT_SIGNAL( setWindowCaption( const TQString & ) ) ); + connect( awidget, TQT_SIGNAL( removeRecentURL( const KURL & ) ), this, TQT_SIGNAL( removeRecentURL( const KURL & ) ) ); + connect( awidget, TQT_SIGNAL( addRecentURL( const KURL & ) ), this, TQT_SIGNAL( addRecentURL( const KURL & ) ) ); if( readWrite ) setXMLFile( "ark_part.rc" ); @@ -90,22 +90,22 @@ ArkPart::ArkPart( QWidget *parentWidget, const char * /*widgetName*/, QObject *p setupActions(); m_ext = new ArkBrowserExtension( this, "ArkBrowserExtension" ); - connect( awidget, SIGNAL( openURLRequest( const KURL & ) ), - m_ext, SLOT( slotOpenURLRequested( const KURL & ) ) ); + connect( awidget, TQT_SIGNAL( openURLRequest( const KURL & ) ), + m_ext, TQT_SLOT( slotOpenURLRequested( const KURL & ) ) ); m_bar = new ArkStatusBarExtension( this ); - connect( awidget, SIGNAL( setStatusBarText( const QString & ) ), m_bar, - SLOT( slotSetStatusBarText( const QString & ) ) ); - connect( awidget, SIGNAL( setStatusBarSelectedFiles( const QString & ) ), m_bar, - SLOT( slotSetStatusBarSelectedFiles( const QString & ) ) ); - connect( awidget, SIGNAL( setBusy( const QString & ) ), m_bar, - SLOT( slotSetBusy( const QString & ) ) ); - connect( awidget, SIGNAL( setReady() ), m_bar, - SLOT( slotSetReady() ) ); - connect( this, SIGNAL( started(KIO::Job*) ), SLOT( transferStarted(KIO::Job*) ) ); - connect( this, SIGNAL( completed() ), SLOT( transferCompleted() ) ); - connect( this, SIGNAL( canceled(const QString&) ), - SLOT( transferCanceled(const QString&) ) ); + connect( awidget, TQT_SIGNAL( setStatusBarText( const TQString & ) ), m_bar, + TQT_SLOT( slotSetStatusBarText( const TQString & ) ) ); + connect( awidget, TQT_SIGNAL( setStatusBarSelectedFiles( const TQString & ) ), m_bar, + TQT_SLOT( slotSetStatusBarSelectedFiles( const TQString & ) ) ); + connect( awidget, TQT_SIGNAL( setBusy( const TQString & ) ), m_bar, + TQT_SLOT( slotSetBusy( const TQString & ) ) ); + connect( awidget, TQT_SIGNAL( setReady() ), m_bar, + TQT_SLOT( slotSetReady() ) ); + connect( this, TQT_SIGNAL( started(KIO::Job*) ), TQT_SLOT( transferStarted(KIO::Job*) ) ); + connect( this, TQT_SIGNAL( completed() ), TQT_SLOT( transferCompleted() ) ); + connect( this, TQT_SIGNAL( canceled(const TQString&) ), + TQT_SLOT( transferCanceled(const TQString&) ) ); setProgressInfoEnabled( false ); } @@ -117,40 +117,40 @@ void ArkPart::setupActions() { addFileAction = new KAction(i18n("Add &File..."), "ark_addfile", 0, awidget, - SLOT(action_add()), actionCollection(), "addfile"); + TQT_SLOT(action_add()), actionCollection(), "addfile"); addDirAction = new KAction(i18n("Add Folde&r..."), "ark_adddir", 0, awidget, - SLOT(action_add_dir()), actionCollection(), "adddir"); + TQT_SLOT(action_add_dir()), actionCollection(), "adddir"); extractAction = new KAction(i18n("E&xtract..."), "ark_extract", 0, awidget, - SLOT(action_extract()), actionCollection(), "extract"); + TQT_SLOT(action_extract()), actionCollection(), "extract"); deleteAction = new KAction(i18n("De&lete"), "ark_delete", KShortcut(Qt::Key_Delete), awidget, - SLOT(action_delete()), actionCollection(), "delete"); + TQT_SLOT(action_delete()), actionCollection(), "delete"); viewAction = new KAction(i18n("to view something","&View"), "ark_view", 0, awidget, - SLOT(action_view()), actionCollection(), "view"); + TQT_SLOT(action_view()), actionCollection(), "view"); openWithAction = new KAction(i18n("&Open With..."), 0, awidget, - SLOT(slotOpenWith()), actionCollection(), "open_with"); + TQT_SLOT(slotOpenWith()), actionCollection(), "open_with"); editAction = new KAction(i18n("Edit &With..."), 0, awidget, - SLOT(action_edit()), actionCollection(), "edit"); + TQT_SLOT(action_edit()), actionCollection(), "edit"); - selectAllAction = KStdAction::selectAll(awidget->fileList(), SLOT(selectAll()), actionCollection(), "select_all"); + selectAllAction = KStdAction::selectAll(awidget->fileList(), TQT_SLOT(selectAll()), actionCollection(), "select_all"); - deselectAllAction = new KAction(i18n("&Unselect All"), 0, awidget->fileList(), SLOT(unselectAll()), actionCollection(), "deselect_all"); + deselectAllAction = new KAction(i18n("&Unselect All"), 0, awidget->fileList(), TQT_SLOT(unselectAll()), actionCollection(), "deselect_all"); - invertSelectionAction = new KAction(i18n("&Invert Selection"), 0, awidget->fileList(), SLOT(invertSelection()), actionCollection(), "invert_selection"); + invertSelectionAction = new KAction(i18n("&Invert Selection"), 0, awidget->fileList(), TQT_SLOT(invertSelection()), actionCollection(), "invert_selection"); - saveAsAction = KStdAction::saveAs(this, SLOT(file_save_as()), actionCollection()); + saveAsAction = KStdAction::saveAs(this, TQT_SLOT(file_save_as()), actionCollection()); - //KStdAction::preferences(awidget, SLOT(showSettings()), actionCollection()); + //KStdAction::preferences(awidget, TQT_SLOT(showSettings()), actionCollection()); ( void ) new KAction( i18n( "Configure &Ark..." ), "configure" , 0, awidget, - SLOT( showSettings() ), actionCollection(), "options_configure_ark" ); + TQT_SLOT( showSettings() ), actionCollection(), "options_configure_ark" ); showSearchBar = new KToggleAction( i18n( "Show Search Bar" ), KShortcut(), actionCollection(), "options_show_search_bar" ); @@ -158,7 +158,7 @@ ArkPart::setupActions() showSearchBar->setChecked( ArkSettings::showSearchBar() ); - connect( showSearchBar, SIGNAL( toggled( bool ) ), awidget, SLOT( slotShowSearchBarToggled( bool ) ) ); + connect( showSearchBar, TQT_SIGNAL( toggled( bool ) ), awidget, TQT_SLOT( slotShowSearchBarToggled( bool ) ) ); initialEnables(); } @@ -169,7 +169,7 @@ void ArkPart::fixEnables() bool bHaveFiles = ( awidget->getNumFilesInArchive() > 0 ); bool bReadOnly = false; bool bAddDirSupported = true; - QString extension; + TQString extension; if ( awidget->archiveType() == ZOO_FORMAT || awidget->archiveType() == AA_FORMAT || awidget->archiveType() == COMPRESSED_FORMAT) bAddDirSupported = false; @@ -247,9 +247,9 @@ bool ArkPart::openFile() { KURL url; url.setPath( m_file ); - if( !QFile::exists( m_file ) ) + if( !TQFile::exists( m_file ) ) { - emit setWindowCaption( QString::null ); + emit setWindowCaption( TQString::null ); emit removeRecentURL( awidget->realURL() ); return false; } @@ -290,7 +290,7 @@ bool ArkPart::closeURL() if ( !isReadWrite() || !awidget->isModified() || awidget->realURL().isLocalFile() ) return closeArchive(); - QString docName = awidget->realURL().prettyURL(); + TQString docName = awidget->realURL().prettyURL(); int res = KMessageBox::warningYesNoCancel( widget(), i18n( "The archive \"%1\" has been modified.\n" @@ -310,7 +310,7 @@ bool ArkPart::closeURL() } } -void ArkPart::slotFilePopup( const QPoint &pPoint ) +void ArkPart::slotFilePopup( const TQPoint &pPoint ) { if ( factory() ) static_cast<KPopupMenu *>(factory()->container("file_popup", this))->popup(pPoint); @@ -326,10 +326,10 @@ void ArkPart::transferStarted( KIO::Job *job ) if ( job ) { disableActions(); - connect( job, SIGNAL( percent(KIO::Job*, unsigned long) ), - SLOT( progressInformation(KIO::Job*, unsigned long) ) ); - connect( m_bar->cancelButton(), SIGNAL( clicked() ), - SLOT( cancelTransfer() ) ); + connect( job, TQT_SIGNAL( percent(KIO::Job*, unsigned long) ), + TQT_SLOT( progressInformation(KIO::Job*, unsigned long) ) ); + connect( m_bar->cancelButton(), TQT_SIGNAL( clicked() ), + TQT_SLOT( cancelTransfer() ) ); } } @@ -337,15 +337,15 @@ void ArkPart::transferCompleted() { if ( m_job ) { - disconnect( m_job, SIGNAL( percent(KIO::Job*, unsigned long) ), - this, SLOT( progressInformation(KIO::Job*, unsigned long) ) ); + disconnect( m_job, TQT_SIGNAL( percent(KIO::Job*, unsigned long) ), + this, TQT_SLOT( progressInformation(KIO::Job*, unsigned long) ) ); m_job = 0; } m_bar->slotSetReady(); } -void ArkPart::transferCanceled( const QString& errMsg ) +void ArkPart::transferCanceled( const TQString& errMsg ) { m_job = 0; if ( !errMsg.isEmpty() ) @@ -363,12 +363,12 @@ void ArkPart::progressInformation( KIO::Job *, unsigned long progress ) void ArkPart::cancelTransfer() { - disconnect( m_bar->cancelButton(), SIGNAL( clicked() ), - this, SLOT( cancelTransfer() ) ); + disconnect( m_bar->cancelButton(), TQT_SIGNAL( clicked() ), + this, TQT_SLOT( cancelTransfer() ) ); if ( m_job ) { m_job->kill( false ); - transferCanceled( QString() ); + transferCanceled( TQString() ); } } @@ -406,26 +406,26 @@ void ArkStatusBarExtension::setupStatusBar() return; } - m_pTimer = new QTimer( this ); - connect( m_pTimer, SIGNAL( timeout() ), this, SLOT( slotProgress() ) ); + m_pTimer = new TQTimer( this ); + connect( m_pTimer, TQT_SIGNAL( timeout() ), this, TQT_SLOT( slotProgress() ) ); m_pStatusLabelTotal = new KSqueezedTextLabel( statusBar(), "StatusLabelTotal" ); - m_pStatusLabelTotal->setFrameStyle( QFrame::NoFrame ); + m_pStatusLabelTotal->setFrameStyle( TQFrame::NoFrame ); m_pStatusLabelTotal->setAlignment( AlignRight ); m_pStatusLabelTotal->setText( i18n( "Total: 0 files" ) ); - m_pStatusLabelSelect = new QLabel( statusBar(), "StatusLabelSelect" ); - m_pStatusLabelSelect->setFrameStyle( QFrame::NoFrame ); + m_pStatusLabelSelect = new TQLabel( statusBar(), "StatusLabelSelect" ); + m_pStatusLabelSelect->setFrameStyle( TQFrame::NoFrame ); m_pStatusLabelSelect->setAlignment( AlignLeft ); m_pStatusLabelSelect->setText(i18n( "0 files selected" ) ); - m_cancelButton = new KPushButton( SmallIcon( "cancel" ), QString(), statusBar(), "CancelButton" ); + m_cancelButton = new KPushButton( SmallIcon( "cancel" ), TQString(), statusBar(), "CancelButton" ); addStatusBarItem( m_pStatusLabelSelect, 3000, false ); addStatusBarItem( m_pStatusLabelTotal, 3000, false ); } -void ArkStatusBarExtension::slotSetStatusBarText( const QString & text ) +void ArkStatusBarExtension::slotSetStatusBarText( const TQString & text ) { if ( !statusBar() ) return; @@ -434,7 +434,7 @@ void ArkStatusBarExtension::slotSetStatusBarText( const QString & text ) m_pStatusLabelTotal->setText( text ); } -void ArkStatusBarExtension::slotSetStatusBarSelectedFiles( const QString & text ) +void ArkStatusBarExtension::slotSetStatusBarSelectedFiles( const TQString & text ) { if ( !statusBar() ) @@ -444,7 +444,7 @@ void ArkStatusBarExtension::slotSetStatusBarSelectedFiles( const QString & text m_pStatusLabelSelect->setText( text ); } -void ArkStatusBarExtension::slotSetBusy( const QString & text, bool showCancelButton, bool detailedProgress ) +void ArkStatusBarExtension::slotSetBusy( const TQString & text, bool showCancelButton, bool detailedProgress ) { if ( m_bBusy || !statusBar() ) return; @@ -452,10 +452,10 @@ void ArkStatusBarExtension::slotSetBusy( const QString & text, bool showCancelBu setupStatusBar(); if ( !m_pBusyText ) { - m_pBusyText = new QLabel( statusBar() ); + m_pBusyText = new TQLabel( statusBar() ); m_pBusyText->setAlignment( AlignLeft ); - m_pBusyText->setFrameStyle( QFrame::Panel | QFrame::Raised ); + m_pBusyText->setFrameStyle( TQFrame::Panel | TQFrame::Raised ); } if ( !m_pProgressBar ) diff --git a/ark/ark_part.h b/ark/ark_part.h index b5b7f6f..2be1bd8 100644 --- a/ark/ark_part.h +++ b/ark/ark_part.h @@ -30,7 +30,7 @@ #include <kaction.h> #include <kprogress.h> -#include <qlabel.h> +#include <tqlabel.h> class KAboutData; class KPushButton; @@ -63,9 +63,9 @@ public: KPushButton* cancelButton() const { return m_cancelButton; } public slots: - void slotSetStatusBarSelectedFiles( const QString & text ); - void slotSetStatusBarText( const QString & text ); - void slotSetBusy( const QString & text, bool showCancelButton = false, bool detailedProgress = false ); + void slotSetStatusBarSelectedFiles( const TQString & text ); + void slotSetStatusBarText( const TQString & text ); + void slotSetBusy( const TQString & text, bool showCancelButton = false, bool detailedProgress = false ); void slotSetReady(); void slotProgress(); @@ -74,12 +74,12 @@ protected: private: bool m_bBusy; - QLabel *m_pStatusLabelSelect; // How many files are selected - QLabel *m_pStatusLabelTotal; // How many files in archive - QLabel *m_pBusyText; + TQLabel *m_pStatusLabelSelect; // How many files are selected + TQLabel *m_pStatusLabelTotal; // How many files in archive + TQLabel *m_pBusyText; KPushButton *m_cancelButton; // Cancel an operation KProgress *m_pProgressBar; - QTimer *m_pTimer; + TQTimer *m_pTimer; }; @@ -87,8 +87,8 @@ class ArkPart: public KParts::ReadWritePart { Q_OBJECT public: - ArkPart( QWidget *parentWidget, const char *widgetName, QObject *parent, - const char *name, const QStringList &, bool readWrite ); + ArkPart( TQWidget *parentWidget, const char *widgetName, TQObject *parent, + const char *name, const TQStringList &, bool readWrite ); virtual ~ArkPart(); static KAboutData* createAboutData(); @@ -96,14 +96,14 @@ public: public slots: void fixEnables();//rename to slotFixEnables()... void disableActions(); - void slotFilePopup( const QPoint & pPoint ); + void slotFilePopup( const TQPoint & pPoint ); void file_save_as(); bool saveFile(); bool openURL( const KURL & url ); bool closeURL(); void transferStarted( KIO::Job * ); void transferCompleted(); - void transferCanceled( const QString& errMsg ); + void transferCanceled( const TQString& errMsg ); void progressInformation( KIO::Job *, unsigned long ); void cancelTransfer(); diff --git a/ark/arkapp.cpp b/ark/arkapp.cpp index c117d0b..ff6acd8 100644 --- a/ark/arkapp.cpp +++ b/ark/arkapp.cpp @@ -30,7 +30,7 @@ #include <kcmdlineargs.h> #include <klocale.h> #include <unistd.h> -#include <qfile.h> +#include <tqfile.h> #include <errno.h> @@ -43,7 +43,7 @@ ArkApplication *ArkApplication::mInstance = NULL; // to make sure an archive isn't opened twice in different windows // Now, readlink only gives one level so this function recurses. -static QString resolveFilename(const QString & _arkname) +static TQString resolveFilename(const TQString & _arkname) { char *buff; int nread; @@ -52,7 +52,7 @@ static QString resolveFilename(const QString & _arkname) while ( true ) { buff = new char[BUFSIZ*iter]; - nread = readlink( QFile::encodeName(_arkname), buff, BUFSIZ); + nread = readlink( TQFile::encodeName(_arkname), buff, BUFSIZ); if (-1 == nread) { if ( EINVAL == errno ) // not a symbolic link. Stopping condition. @@ -78,7 +78,7 @@ static QString resolveFilename(const QString & _arkname) else { buff[nread] = '\0'; // readlink doesn't null terminate - QString name = QFile::decodeName( buff ); + TQString name = TQFile::decodeName( buff ); delete [] buff; // watch out for relative pathnames @@ -162,7 +162,7 @@ ArkApplication::newInstance() { bool oneFile = (args->count() == 2 ) ; - QString extension = args->arg( 0 ); + TQString extension = args->arg( 0 ); KURL archiveName = args->url( 1 ); // the filename // if more than one file -> use directory name @@ -234,7 +234,7 @@ ArkApplication::newInstance() void ArkApplication::addOpenArk(const KURL & _arkname, MainWindow *_ptr) { - QString realName; + TQString realName; if( _arkname.isLocalFile() ) { realName = resolveFilename( _arkname.path() ); // follow symlink @@ -250,7 +250,7 @@ ArkApplication::addOpenArk(const KURL & _arkname, MainWindow *_ptr) void ArkApplication::removeOpenArk(const KURL & _arkname) { - QString realName; + TQString realName; if ( _arkname.isLocalFile() ) realName = resolveFilename( _arkname.path() ); // follow symlink else @@ -265,7 +265,7 @@ ArkApplication::raiseArk(const KURL & _arkname) { kdDebug( 1601 ) << "ArkApplication::raiseArk " << endl; MainWindow *window; - QString realName; + TQString realName; if( _arkname.isLocalFile() ) realName = resolveFilename(_arkname.path()); // follow symlink else @@ -282,7 +282,7 @@ ArkApplication::raiseArk(const KURL & _arkname) bool ArkApplication::isArkOpenAlready(const KURL & _arkname) { - QString realName; + TQString realName; if ( _arkname.isLocalFile() ) realName = resolveFilename(_arkname.path()); // follow symlink else diff --git a/ark/arkapp.h b/ark/arkapp.h index 1d1b474..f0d4444 100644 --- a/ark/arkapp.h +++ b/ark/arkapp.h @@ -30,7 +30,7 @@ #include "mainwindow.h" // QT includes -#include <qdict.h> +#include <tqdict.h> // KDE includes #include <kuniqueapplication.h> @@ -41,7 +41,7 @@ class QStringList; class EqualKey { public: - bool operator()(const QString & str1, const QString & str2) const + bool operator()(const TQString & str1, const TQString & str2) const { return (str1 == str2); } @@ -78,14 +78,14 @@ class ArkApplication : public KUniqueApplication ArkApplication(); private: - QWidget *m_mainwidget; // to be the parent of all ArkWidgets + TQWidget *m_mainwidget; // to be the parent of all ArkWidgets int m_windowCount; - QStringList openArksList; + TQStringList openArksList; // a hash to obtain the window associated with a filename. - // given a QString key, you get an ArkWidget * pointer. - QDict<MainWindow> m_windowsHash; + // given a TQString key, you get an ArkWidget * pointer. + TQDict<MainWindow> m_windowsHash; static ArkApplication *mInstance; }; diff --git a/ark/arkfactory.cpp b/ark/arkfactory.cpp index 8fcd262..3e17e7a 100644 --- a/ark/arkfactory.cpp +++ b/ark/arkfactory.cpp @@ -38,20 +38,20 @@ ArkFactory::~ArkFactory() s_instance = 0L; } -KParts::Part * ArkFactory::createPartObject( QWidget *parentWidget, - const char *widgetName, QObject *parent, +KParts::Part * ArkFactory::createPartObject( TQWidget *parentWidget, + const char *widgetName, TQObject *parent, const char *name, const char *classname, - const QStringList &args ) + const TQStringList &args ) { bool readWrite = false; // for e.g. Browser/View or KParts::ReadOnlyPart - if ( QCString( classname ) == "KParts::ReadWritePart" - || QCString( classname ) == "ArkPart" ) + if ( TQCString( classname ) == "KParts::ReadWritePart" + || TQCString( classname ) == "ArkPart" ) { readWrite = true; } ArkPart* obj = new ArkPart( parentWidget, widgetName, parent, name, args, readWrite ); - //kdDebug( 1601 ) << "classname is: " << QCString( classname ) << endl; + //kdDebug( 1601 ) << "classname is: " << TQCString( classname ) << endl; return obj; } diff --git a/ark/arkfactory.h b/ark/arkfactory.h index ec3534a..2b5514b 100644 --- a/ark/arkfactory.h +++ b/ark/arkfactory.h @@ -29,10 +29,10 @@ public: ArkFactory() : KParts::Factory() {} virtual ~ArkFactory(); virtual KParts::Part *createPartObject( - QWidget *parentWidget = 0,const char *widgetName = 0, - QObject *parent = 0, const char *name = 0, + TQWidget *parentWidget = 0,const char *widgetName = 0, + TQObject *parent = 0, const char *name = 0, const char *classname = "KParts::Part", - const QStringList &args = QStringList() ); + const TQStringList &args = TQStringList() ); static KInstance* instance(); private: static KInstance* s_instance; diff --git a/ark/arkutils.cpp b/ark/arkutils.cpp index 1b4ed0a..bfe496c 100644 --- a/ark/arkutils.cpp +++ b/ark/arkutils.cpp @@ -70,13 +70,13 @@ #include <klargefile.h> // Qt includes -#include <qfile.h> +#include <tqfile.h> #include "arkutils.h" -QString ArkUtils::getTimeStamp(const QString &_month, - const QString &_day, - const QString &_yearOrTime) +TQString ArkUtils::getTimeStamp(const TQString &_month, + const TQString &_day, + const TQString &_yearOrTime) { // Make the date format sortable. // Month is in _month, day is in _day. @@ -99,7 +99,7 @@ QString ArkUtils::getTimeStamp(const QString &_month, int thisYear = now->tm_year + 1900; int thisMonth = now->tm_mon + 1; - QString year, timestamp; + TQString year, timestamp; if (_yearOrTime.contains(":")) // it has a timestamp so we have to figure out the year @@ -118,7 +118,7 @@ QString ArkUtils::getTimeStamp(const QString &_month, timestamp = "??:??"; } - QString retval; + TQString retval; retval.sprintf("%s-%.2d-%.2d %s", year.utf8().data(), nMonth, nDay, timestamp.utf8().data()); @@ -154,7 +154,7 @@ int ArkUtils::getYear(int theMonth, int thisYear, int thisMonth) return thisYear; } -QString ArkUtils::fixYear(const QString& strYear) +TQString ArkUtils::fixYear(const TQString& strYear) { // returns 4-digit year by guessing from two-char year string. // Remember: this is used for file timestamps. There probably aren't any @@ -173,27 +173,27 @@ QString ArkUtils::fixYear(const QString& strYear) else y += 2000; - return QString::number( y ); + return TQString::number( y ); } else - return QString::null; + return TQString::null; } bool -ArkUtils::haveDirPermissions( const QString &strFile ) +ArkUtils::haveDirPermissions( const TQString &strFile ) { - return ( access( QFile::encodeName( strFile ), W_OK ) == 0 ); + return ( access( TQFile::encodeName( strFile ), W_OK ) == 0 ); } bool -ArkUtils::diskHasSpace(const QString &dir, KIO::filesize_t size) +ArkUtils::diskHasSpace(const TQString &dir, KIO::filesize_t size) // check if disk has enough space to accommodate (a) new file(s) of // the given size in the partition containing the given directory { kdDebug( 1601 ) << "diskHasSpace() " << "dir: " << dir << " Size: " << size << endl; struct STATFS buf; - if (STATFS(QFile::encodeName(dir), &buf) == 0) + if (STATFS(TQFile::encodeName(dir), &buf) == 0) { double nAvailable = (double)buf.f_bavail * buf.f_bsize; if ( nAvailable < (double)size ) @@ -212,17 +212,17 @@ ArkUtils::diskHasSpace(const QString &dir, KIO::filesize_t size) } KIO::filesize_t -ArkUtils::getSizes(QStringList *list) +ArkUtils::getSizes(TQStringList *list) { KIO::filesize_t sum = 0; - QString str; + TQString str; KDE_struct_stat st; - for ( QStringList::Iterator it = list->begin(); it != list->end(); ++it) + for ( TQStringList::Iterator it = list->begin(); it != list->end(); ++it) { str = *it; str = str.right(str.length()-5); - if (KDE_stat(QFile::encodeName(str), &st ) < 0) + if (KDE_stat(TQFile::encodeName(str), &st ) < 0) continue; sum += st.st_size; } diff --git a/ark/arkutils.h b/ark/arkutils.h index 4ddea65..6f1f3e3 100644 --- a/ark/arkutils.h +++ b/ark/arkutils.h @@ -32,7 +32,7 @@ #ifndef ARKUTILS_H #define ARKUTILS_H -#include <qstring.h> +#include <tqstring.h> #include <kio/global.h> @@ -43,14 +43,14 @@ namespace ArkUtils { int getYear(int theMonth, int thisYear, int thisMonth); int getMonth(const char *strMonth); - QString fixYear(const QString& strYear); - - QString getTimeStamp(const QString &month, - const QString &day, - const QString &year); - bool haveDirPermissions(const QString &strFile); - bool diskHasSpace(const QString &dir, KIO::filesize_t size); - KIO::filesize_t getSizes(QStringList *list); + TQString fixYear(const TQString& strYear); + + TQString getTimeStamp(const TQString &month, + const TQString &day, + const TQString &year); + bool haveDirPermissions(const TQString &strFile); + bool diskHasSpace(const TQString &dir, KIO::filesize_t size); + KIO::filesize_t getSizes(TQStringList *list); } #endif diff --git a/ark/arkviewer.cpp b/ark/arkviewer.cpp index 1ea76ac..2f173a8 100644 --- a/ark/arkviewer.cpp +++ b/ark/arkviewer.cpp @@ -29,20 +29,20 @@ #include <kglobal.h> #include <kiconloader.h> -#include <qvbox.h> -#include <qlayout.h> -#include <qlabel.h> -#include <qframe.h> -#include <qurl.h> +#include <tqvbox.h> +#include <tqlayout.h> +#include <tqlabel.h> +#include <tqframe.h> +#include <tqurl.h> -ArkViewer::ArkViewer( QWidget * parent, const char * name ) - : KDialogBase( parent, name, false, QString::null, Close ), m_part( 0 ) +ArkViewer::ArkViewer( TQWidget * parent, const char * name ) + : KDialogBase( parent, name, false, TQString::null, Close ), m_part( 0 ) { - m_widget = new QVBox( this ); + m_widget = new TQVBox( this ); m_widget->layout()->setSpacing( 10 ); - connect( this, SIGNAL( finished() ), this, SLOT( slotFinished() ) ); + connect( this, TQT_SIGNAL( finished() ), this, TQT_SLOT( slotFinished() ) ); setMainWidget( m_widget ); } @@ -65,28 +65,28 @@ bool ArkViewer::view( const KURL& filename ) setCaption( filename.fileName() ); - QSize size = configDialogSize( "ArkViewer" ); + TQSize size = configDialogSize( "ArkViewer" ); if (size.width() < 200) - size = QSize(560, 400); + size = TQSize(560, 400); setInitialSize( size ); - QFrame *header = new QFrame( m_widget ); - QHBoxLayout *headerLayout = new QHBoxLayout( header ); + TQFrame *header = new TQFrame( m_widget ); + TQHBoxLayout *headerLayout = new TQHBoxLayout( header ); headerLayout->setAutoAdd( true ); - QLabel *iconLabel = new QLabel( header ); + TQLabel *iconLabel = new TQLabel( header ); iconLabel->setPixmap( mimetype->pixmap( KIcon::Desktop ) ); - iconLabel->setSizePolicy( QSizePolicy::Fixed, QSizePolicy::Minimum ); + iconLabel->setSizePolicy( TQSizePolicy::Fixed, TQSizePolicy::Minimum ); - QVBox *headerRight = new QVBox( header ); - new QLabel( QString( "<qt><b>%1</b></qt>" ) + TQVBox *headerRight = new TQVBox( header ); + new TQLabel( TQString( "<qt><b>%1</b></qt>" ) .arg( filename.fileName() ), headerRight ); - new QLabel( mimetype->comment(), headerRight ); + new TQLabel( mimetype->comment(), headerRight ); - header->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Maximum ); + header->setSizePolicy( TQSizePolicy::Expanding, TQSizePolicy::Maximum ); - m_part = KParts::ComponentFactory::createPartInstanceFromQuery<KParts::ReadOnlyPart>( mimetype->name(), QString::null, m_widget, 0, this ); + m_part = KParts::ComponentFactory::createPartInstanceFromQuery<KParts::ReadOnlyPart>( mimetype->name(), TQString::null, m_widget, 0, this ); if ( m_part ) { diff --git a/ark/arkviewer.h b/ark/arkviewer.h index e0fda83..3720ffa 100644 --- a/ark/arkviewer.h +++ b/ark/arkviewer.h @@ -30,7 +30,7 @@ class ArkViewer : public KDialogBase Q_OBJECT public: - ArkViewer( QWidget* parent = 0, const char * name = 0 ); + ArkViewer( TQWidget* parent = 0, const char * name = 0 ); ~ArkViewer(); bool view( const KURL& filename ); @@ -40,7 +40,7 @@ class ArkViewer : public KDialogBase private: KParts::ReadOnlyPart *m_part; - QWidget *m_widget; + TQWidget *m_widget; }; #endif // ARKVIEWER_H diff --git a/ark/arkwidget.cpp b/ark/arkwidget.cpp index 5720317..0809a6b 100644 --- a/ark/arkwidget.cpp +++ b/ark/arkwidget.cpp @@ -33,11 +33,11 @@ #include <sys/stat.h> // Qt includes -#include <qlayout.h> -#include <qstringlist.h> -#include <qlabel.h> -#include <qcheckbox.h> -#include <qdir.h> +#include <tqlayout.h> +#include <tqstringlist.h> +#include <tqlabel.h> +#include <tqcheckbox.h> +#include <tqdir.h> // KDE includes #include <kdebug.h> @@ -83,13 +83,13 @@ static void viewInExternalViewer( ArkWidget* parent, const KURL& filename ) { - QString mimetype = KMimeType::findByURL( filename )->name(); + TQString mimetype = KMimeType::findByURL( filename )->name(); bool view = true; if ( KRun::isExecutable( mimetype ) ) { - QString text = i18n( "The file you're trying to view may be an executable. Running untrusted executables may compromise your system's security.\nAre you sure you want to run that file?" ); - view = ( KMessageBox::warningContinueCancel( parent, text, QString::null, i18n("Run Nevertheless") ) == KMessageBox::Continue ); + TQString text = i18n( "The file you're trying to view may be an executable. Running untrusted executables may compromise your system's security.\nAre you sure you want to run that file?" ); + view = ( KMessageBox::warningContinueCancel( parent, text, TQString::null, i18n("Run Nevertheless") ) == KMessageBox::Continue ); } if ( view ) @@ -103,10 +103,10 @@ static void viewInExternalViewer( ArkWidget* parent, const KURL& filename ) // //---------------------------------------------------------------------- -ArkWidget::ArkWidget( QWidget *parent, const char *name ) - : QVBox(parent, name), m_bBusy( false ), m_bBusyHold( false ), +ArkWidget::ArkWidget( TQWidget *parent, const char *name ) + : TQVBox(parent, name), m_bBusy( false ), m_bBusyHold( false ), m_extractOnly( false ), m_extractRemote(false), - m_openAsMimeType(QString::null), m_pTempAddList(NULL), + m_openAsMimeType(TQString::null), m_pTempAddList(NULL), m_bArchivePopupEnabled( false ), m_convert_tmpDir( NULL ), m_convertSuccess( false ), m_createRealArchTmpDir( NULL ), m_extractRemoteTmpDir( NULL ), @@ -130,7 +130,7 @@ ArkWidget::ArkWidget( QWidget *parent, const char *name ) m_searchToolBar = new KToolBar( this, "searchBar" ); m_searchToolBar->boxLayout()->setSpacing( KDialog::spacingHint() ); - QLabel * l1 = new QLabel( i18n( "&Search:" ), m_searchToolBar, "kde toolbar widget" ); + TQLabel * l1 = new TQLabel( i18n( "&Search:" ), m_searchToolBar, "kde toolbar widget" ); m_searchBar = new SearchBar( m_searchToolBar, 0 ); l1->setBuddy( m_searchBar ); @@ -198,13 +198,13 @@ ArkWidget::updateStatusTotals() m_nNumFiles = m_fileListView->totalFiles(); m_nSizeOfFiles = m_fileListView->totalSize(); - QString strInfo = i18n( "%n file %1", "%n files %1", m_nNumFiles ) + TQString strInfo = i18n( "%n file %1", "%n files %1", m_nNumFiles ) .arg( KIO::convertSize( m_nSizeOfFiles ) ); emit setStatusBarText(strInfo); } void -ArkWidget::busy( const QString & text ) +ArkWidget::busy( const TQString & text ) { emit setBusy( text ); @@ -213,7 +213,7 @@ ArkWidget::busy( const QString & text ) m_fileListView->setEnabled( false ); - QApplication::setOverrideCursor( waitCursor ); + TQApplication::setOverrideCursor( waitCursor ); m_bBusy = true; } @@ -224,7 +224,7 @@ ArkWidget::holdBusy() return; m_bBusyHold = true; - QApplication::restoreOverrideCursor(); + TQApplication::restoreOverrideCursor(); } void @@ -234,7 +234,7 @@ ArkWidget::resumeBusy() return; m_bBusyHold = false; - QApplication::setOverrideCursor( waitCursor ); + TQApplication::setOverrideCursor( waitCursor ); } void @@ -245,7 +245,7 @@ ArkWidget::ready() m_fileListView->setEnabled( true ); - QApplication::restoreOverrideCursor(); + TQApplication::restoreOverrideCursor(); emit setReady(); m_bBusyHold = false; m_bBusy = false; @@ -258,14 +258,14 @@ ArkWidget::ready() KURL ArkWidget::getSaveAsFileName() { - QString defaultMimeType; + TQString defaultMimeType; if ( m_openAsMimeType.isNull() ) defaultMimeType = KMimeType::findByPath( m_strArchName )->name(); else defaultMimeType = m_openAsMimeType; KURL u; - QString suggestedName; + TQString suggestedName; if ( m_realURL.isLocalFile() ) suggestedName = m_realURL.url(); else @@ -299,7 +299,7 @@ ArkWidget::convertTo( const KURL & u ) busy( i18n( "Saving..." ) ); m_convert_tmpDir = new KTempDir( tmpDir() + "convtmp" ); m_convert_tmpDir->setAutoDelete( true ); - connect( arch, SIGNAL( sigExtract( bool ) ), this, SLOT( convertSlotExtractDone( bool ) ) ); + connect( arch, TQT_SIGNAL( sigExtract( bool ) ), this, TQT_SLOT( convertSlotExtractDone( bool ) ) ); m_convert_saveAsURL = u; arch->unarchFile( 0, m_convert_tmpDir->name() ); } @@ -308,16 +308,16 @@ void ArkWidget::convertSlotExtractDone( bool ) { kdDebug( 1601 ) << k_funcinfo << endl; - disconnect( arch, SIGNAL( sigExtract( bool ) ), this, SLOT( convertSlotExtractDone( bool ) ) ); - QTimer::singleShot( 0, this, SLOT( convertSlotCreate() ) ); + disconnect( arch, TQT_SIGNAL( sigExtract( bool ) ), this, TQT_SLOT( convertSlotExtractDone( bool ) ) ); + TQTimer::singleShot( 0, this, TQT_SLOT( convertSlotCreate() ) ); } void ArkWidget::convertSlotCreate() { file_close(); - connect( this, SIGNAL( createDone( bool ) ), this, SLOT( convertSlotCreateDone( bool ) ) ); - QString archToCreate; + connect( this, TQT_SIGNAL( createDone( bool ) ), this, TQT_SLOT( convertSlotCreateDone( bool ) ) ); + TQString archToCreate; if ( m_convert_saveAsURL.isLocalFile() ) archToCreate = m_convert_saveAsURL.path(); else @@ -330,18 +330,18 @@ ArkWidget::convertSlotCreate() void ArkWidget::convertSlotCreateDone( bool success ) { - disconnect( this, SIGNAL( createDone( bool ) ), this, SLOT( convertSlotCreateDone( bool ) ) ); + disconnect( this, TQT_SIGNAL( createDone( bool ) ), this, TQT_SLOT( convertSlotCreateDone( bool ) ) ); kdDebug( 1601 ) << k_funcinfo << endl; if ( !success ) { kdWarning( 1601 ) << "Error while converting. (convertSlotCreateDone)" << endl; return; } - QDir dir( m_convert_tmpDir->name() ); - QStringList entries = dir.entryList(); + TQDir dir( m_convert_tmpDir->name() ); + TQStringList entries = dir.entryList(); entries.remove( ".." ); entries.remove( "." ); - QStringList::Iterator it = entries.begin(); + TQStringList::Iterator it = entries.begin(); for ( ; it != entries.end(); ++it ) { /////////////////////////////////////////////////////// @@ -351,13 +351,13 @@ ArkWidget::convertSlotCreateDone( bool success ) // and break the rest of the world' // // hack. See also action_edit ... // // addFile should be: // - // addFile( const QString & baseDir, // - // const QStringList & filesToAdd ) // + // addFile( const TQString & baseDir, // + // const TQStringList & filesToAdd ) // ////////////////////////////////////////////////////// - *it = QString::fromLatin1( "file:" )+ m_convert_tmpDir->name() + *it; + *it = TQString::fromLatin1( "file:" )+ m_convert_tmpDir->name() + *it; } bool bOldRecVal = ArkSettings::rarRecurseSubdirs(); - connect( arch, SIGNAL( sigAdd( bool ) ), this, SLOT( convertSlotAddDone( bool ) ) ); + connect( arch, TQT_SIGNAL( sigAdd( bool ) ), this, TQT_SLOT( convertSlotAddDone( bool ) ) ); arch->addFile( entries ); ArkSettings::setRarRecurseSubdirs( bOldRecVal ); } @@ -365,11 +365,11 @@ ArkWidget::convertSlotCreateDone( bool success ) void ArkWidget::convertSlotAddDone( bool success ) { - disconnect( arch, SIGNAL( sigAdd( bool ) ), this, SLOT( convertSlotAddDone( bool ) ) ); + disconnect( arch, TQT_SIGNAL( sigAdd( bool ) ), this, TQT_SLOT( convertSlotAddDone( bool ) ) ); kdDebug( 1601 ) << k_funcinfo << endl; m_convertSuccess = success; // needed ? (TarArch, lzo) - QTimer::singleShot( 0, this, SLOT( convertFinish() ) ); + TQTimer::singleShot( 0, this, TQT_SLOT( convertFinish() ) ); } void @@ -406,10 +406,10 @@ ArkWidget::allowedArchiveName( const KURL & u ) if (u.isEmpty()) return false; - QString archMimeType = KMimeType::findByURL( m_url )->name(); + TQString archMimeType = KMimeType::findByURL( m_url )->name(); if ( !m_openAsMimeType.isNull() ) archMimeType = m_openAsMimeType; - QString newArchMimeType = KMimeType::findByPath( u.path() )->name(); + TQString newArchMimeType = KMimeType::findByPath( u.path() )->name(); if ( archMimeType == newArchMimeType ) return true; @@ -423,7 +423,7 @@ ArkWidget::extractTo( const KURL & targetDirectory, const KURL & archive, bool b if ( bGuessName ) // suggest an extract directory based on archive name { - const QString fileName = guessName( archive ); + const TQString fileName = guessName( archive ); m_extractTo_targetDirectory.setPath( targetDirectory.path( 1 ) + fileName + '/' ); } @@ -438,16 +438,16 @@ ArkWidget::extractTo( const KURL & targetDirectory, const KURL & archive, bool b } } - connect( this, SIGNAL( openDone( bool ) ), this, SLOT( extractToSlotOpenDone( bool ) ) ); + connect( this, TQT_SIGNAL( openDone( bool ) ), this, TQT_SLOT( extractToSlotOpenDone( bool ) ) ); } const QString ArkWidget::guessName( const KURL &archive ) { - QString fileName = archive.fileName(); - QStringList list = KMimeType::findByPath( fileName )->patterns(); - QStringList::Iterator it = list.begin(); - QString ext; + TQString fileName = archive.fileName(); + TQStringList list = KMimeType::findByPath( fileName )->patterns(); + TQStringList::Iterator it = list.begin(); + TQString ext; for ( ; it != list.end(); ++it ) { ext = (*it).remove( '*' ); @@ -464,7 +464,7 @@ ArkWidget::guessName( const KURL &archive ) void ArkWidget::extractToSlotOpenDone( bool success ) { - disconnect( this, SIGNAL( openDone( bool ) ), this, SLOT( extractToSlotOpenDone( bool ) ) ); + disconnect( this, TQT_SIGNAL( openDone( bool ) ), this, TQT_SLOT( extractToSlotOpenDone( bool ) ) ); if ( !success ) { KMessageBox::error( this, i18n( "An error occurred while opening the archive %1." ).arg( m_url.prettyURL() ) ); @@ -472,7 +472,7 @@ ArkWidget::extractToSlotOpenDone( bool success ) return; } - QString extractDir = m_extractTo_targetDirectory.path(); + TQString extractDir = m_extractTo_targetDirectory.path(); // little code duplication from action_extract(): if ( !m_extractTo_targetDirectory.isLocalFile() ) { @@ -491,8 +491,8 @@ ArkWidget::extractToSlotOpenDone( bool success ) } } - QStringList empty; - QStringList alreadyExisting = existingFiles( extractDir, empty ); + TQStringList empty; + TQStringList alreadyExisting = existingFiles( extractDir, empty ); kdDebug( 1601 ) << "Already existing files count: " << existingFiles( extractDir, empty ).count() << endl; bool keepGoing = true; if ( !ArkSettings::extractOverwrite() && !alreadyExisting.isEmpty() ) @@ -508,7 +508,7 @@ ArkWidget::extractToSlotOpenDone( bool success ) if ( ArkUtils::diskHasSpace( extractDir, m_nSizeOfFiles ) ) { disableAll(); - connect( arch, SIGNAL( sigExtract( bool ) ), this, SLOT( extractToSlotExtractDone( bool ) ) ); + connect( arch, TQT_SIGNAL( sigExtract( bool ) ), this, TQT_SLOT( extractToSlotExtractDone( bool ) ) ); arch->unarchFile( 0, extractDir ); } else @@ -525,7 +525,7 @@ ArkWidget::extractToSlotOpenDone( bool success ) void ArkWidget::extractToSlotExtractDone( bool success ) { - disconnect( arch, SIGNAL( sigExtract( bool ) ), this, SLOT( extractToSlotExtractDone( bool ) ) ); + disconnect( arch, TQT_SIGNAL( sigExtract( bool ) ), this, TQT_SLOT( extractToSlotExtractDone( bool ) ) ); if ( !success ) { kdDebug( 1601 ) << "Last Shell Output" << arch->getLastShellOutput() << endl; @@ -536,7 +536,7 @@ ArkWidget::extractToSlotExtractDone( bool success ) if ( m_extractRemote ) { - connect( this, SIGNAL( extractRemoteMovingDone() ), this, SIGNAL( request_file_quit() ) ); + connect( this, TQT_SIGNAL( extractRemoteMovingDone() ), this, TQT_SIGNAL( request_file_quit() ) ); extractRemoteInitiateMoving( m_extractTo_targetDirectory ); } else @@ -552,9 +552,9 @@ ArkWidget::addToArchive( const KURL::List & filesToAdd, const KURL & archive) { if ( !m_openAsMimeType.isEmpty() ) { - QStringList extensions = KMimeType::mimeType( m_openAsMimeType )->patterns(); - QStringList::Iterator it = extensions.begin(); - QString file = archive.path(); + TQStringList extensions = KMimeType::mimeType( m_openAsMimeType )->patterns(); + TQStringList::Iterator it = extensions.begin(); + TQString file = archive.path(); for ( ; it != extensions.end() && !file.endsWith( ( *it ).remove( '*' ) ); ++it ) ; @@ -565,7 +565,7 @@ ArkWidget::addToArchive( const KURL::List & filesToAdd, const KURL & archive) } } - connect( this, SIGNAL( createDone( bool ) ), this, SLOT( addToArchiveSlotCreateDone( bool ) ) ); + connect( this, TQT_SIGNAL( createDone( bool ) ), this, TQT_SLOT( addToArchiveSlotCreateDone( bool ) ) ); // TODO: remote Archives should be handled by createArchive if ( archive.isLocalFile() ) @@ -581,14 +581,14 @@ ArkWidget::addToArchive( const KURL::List & filesToAdd, const KURL & archive) return true; } - connect( this, SIGNAL( openDone( bool ) ), this, SLOT( addToArchiveSlotOpenDone( bool ) ) ); + connect( this, TQT_SIGNAL( openDone( bool ) ), this, TQT_SLOT( addToArchiveSlotOpenDone( bool ) ) ); return true; } void ArkWidget::addToArchiveSlotCreateDone( bool success ) { - disconnect( this, SIGNAL( createDone( bool ) ), this, SLOT( addToArchiveSlotCreateDone( bool ) ) ); + disconnect( this, TQT_SIGNAL( createDone( bool ) ), this, TQT_SLOT( addToArchiveSlotCreateDone( bool ) ) ); if ( !success ) { kdDebug( 1601 ) << "Could not create the archive" << endl; @@ -602,7 +602,7 @@ void ArkWidget::addToArchiveSlotOpenDone( bool success ) { kdDebug( 1601 ) << k_funcinfo << endl; - disconnect( this, SIGNAL( openDone( bool ) ), this, SLOT( addToArchiveSlotOpenDone( bool ) ) ); + disconnect( this, TQT_SIGNAL( openDone( bool ) ), this, TQT_SLOT( addToArchiveSlotOpenDone( bool ) ) ); // TODO: handle dirs with addDir ( or better+easier: get rid of the need to do that entirely ) if ( !success ) { @@ -612,12 +612,12 @@ ArkWidget::addToArchiveSlotOpenDone( bool success ) if ( m_bIsSimpleCompressedFile && (m_nNumFiles == 1)) { - QString strFilename; + TQString strFilename; KURL url = askToCreateRealArchive(); strFilename = url.path(); if (!strFilename.isEmpty()) { - connect( this, SIGNAL( createRealArchiveDone( bool ) ), this, SLOT( addToArchiveSlotAddDone( bool ) ) ); + connect( this, TQT_SIGNAL( createRealArchiveDone( bool ) ), this, TQT_SLOT( addToArchiveSlotAddDone( bool ) ) ); createRealArchive( strFilename, m_addToArchive_filesToAdd.toStringList() ); return; } @@ -628,7 +628,7 @@ ArkWidget::addToArchiveSlotOpenDone( bool success ) } } -/* QStringList list = m_addToArchive_filesToAdd.toStringList(); +/* TQStringList list = m_addToArchive_filesToAdd.toStringList(); if ( !ArkUtils::diskHasSpace( tmpDir(), ArkUtils::getSizes( &list ) ) ) { KMessageBox::error( this, i18n( "Not enough free disc space to extract the archive." ) ); @@ -639,10 +639,10 @@ ArkWidget::addToArchiveSlotOpenDone( bool success ) disableAll(); // if they are URLs, we have to download them, replace the URLs // with filenames, and remember to delete the temporaries later. -/* for ( QStringList::Iterator it = list.begin(); +/* for ( TQStringList::Iterator it = list.begin(); it != list.end(); ++it) { - QString str = *it; + TQString str = *it; KURL url( toLocalFile( str ) ); *it = url.prettyURL(); } @@ -662,7 +662,7 @@ ArkWidget::addToArchiveSlotOpenDone( bool success ) kdDebug( 1601 ) << "Adding: " << list << endl; - connect( arch, SIGNAL( sigAdd( bool ) ), this, SLOT( addToArchiveSlotAddDone( bool ) ) ); + connect( arch, TQT_SIGNAL( sigAdd( bool ) ), this, TQT_SLOT( addToArchiveSlotAddDone( bool ) ) ); arch->addFile( list.toStringList() ); } @@ -670,7 +670,7 @@ void ArkWidget::addToArchiveSlotAddDone( bool success ) { kdDebug( 1601 ) << k_funcinfo << endl; - disconnect( this, SLOT( addToArchiveSlotAddDone( bool ) ) ); + disconnect( this, TQT_SLOT( addToArchiveSlotAddDone( bool ) ) ); if ( !success ) { KMessageBox::error( this, i18n( "An error occurred while adding the files to the archive." ) ); @@ -681,7 +681,7 @@ ArkWidget::addToArchiveSlotAddDone( bool success ) return; } -void ArkWidget::setOpenAsMimeType( const QString & mimeType ) +void ArkWidget::setOpenAsMimeType( const TQString & mimeType ) { m_openAsMimeType = mimeType; } @@ -705,11 +705,11 @@ ArkWidget::file_open(const KURL& url) } - QString strFile = url.path(); + TQString strFile = url.path(); kdDebug( 1601 ) << "File to open: " << strFile << endl; - QFileInfo fileInfo( strFile ); + TQFileInfo fileInfo( strFile ); if ( !fileInfo.exists() ) { KMessageBox::error(this, i18n("The archive %1 does not exist.").arg(strFile)); @@ -746,17 +746,17 @@ ArkWidget::file_open(const KURL& url) // File menu ///////////////////////////////////////////////////////// KURL -ArkWidget::getCreateFilename(const QString & _caption, - const QString & _defaultMimeType, +ArkWidget::getCreateFilename(const TQString & _caption, + const TQString & _defaultMimeType, bool allowCompressed, - const QString & _suggestedName ) + const TQString & _suggestedName ) { int choice=0; bool fileExists = true; - QString strFile; + TQString strFile; KURL url; - KFileDialog dlg( ":ArkSaveAsDialog", QString::null, this, "SaveAsDialog", true ); + KFileDialog dlg( ":ArkSaveAsDialog", TQString::null, this, "SaveAsDialog", true ); dlg.setCaption( _caption ); dlg.setOperationMode( KFileDialog::Saving ); dlg.setMimeFilter( ArchiveFormatInfo::self()->supportedMimeTypes( allowCompressed ), @@ -775,16 +775,16 @@ ArkWidget::getCreateFilename(const QString & _caption, strFile = url.path(); if (strFile.isEmpty()) - return QString::null; + return TQString::null; //the user chose to save as the current archive //or wanted to create a new one with the same name //no need to do anything if (strFile == m_strArchName && m_bIsArchiveOpen) - return QString::null; + return TQString::null; - QStringList extensions = dlg.currentFilterMimeType()->patterns(); - QStringList::Iterator it = extensions.begin(); + TQStringList extensions = dlg.currentFilterMimeType()->patterns(); + TQStringList::Iterator it = extensions.begin(); for ( ; it != extensions.end() && !strFile.endsWith( ( *it ).remove( '*' ) ); ++it ) ; @@ -795,7 +795,7 @@ ArkWidget::getCreateFilename(const QString & _caption, } kdDebug(1601) << "Trying to create an archive named " << strFile << endl; - fileExists = QFile::exists( strFile ); + fileExists = TQFile::exists( strFile ); if( fileExists ) { choice = KMessageBox::warningYesNoCancel(0, @@ -804,12 +804,12 @@ ArkWidget::getCreateFilename(const QString & _caption, if ( choice == KMessageBox::Yes ) { - QFile::remove( strFile ); + TQFile::remove( strFile ); break; } else if ( choice == KMessageBox::Cancel ) { - return QString::null; + return TQString::null; } else { @@ -822,7 +822,7 @@ ArkWidget::getCreateFilename(const QString & _caption, KMessageBox::error( this, i18n( "You do not have permission" " to write to the directory %1" ).arg(url.directory() ) ); - return QString::null; + return TQString::null; } } // end of while loop @@ -832,7 +832,7 @@ ArkWidget::getCreateFilename(const QString & _caption, void ArkWidget::file_new() { - QString strFile; + TQString strFile; KURL url = getCreateFilename(i18n("Create New Archive") ); strFile = url.path(); if (!strFile.isEmpty()) @@ -858,8 +858,8 @@ ArkWidget::extractOnlyOpenDone() void ArkWidget::slotExtractDone(bool success) { - disconnect( arch, SIGNAL( sigExtract( bool ) ), - this, SLOT( slotExtractDone(bool) ) ); + disconnect( arch, TQT_SIGNAL( sigExtract( bool ) ), + this, TQT_SLOT( slotExtractDone(bool) ) ); ready(); if(m_extractList != 0) @@ -894,19 +894,19 @@ ArkWidget::extractRemoteInitiateMoving( const KURL & target ) { KURL srcDirURL; KURL src; - QString srcDir; + TQString srcDir; srcDir = m_extractRemoteTmpDir->name(); srcDirURL.setPath( srcDir ); - QDir dir( srcDir ); - dir.setFilter( QDir::All | QDir::Hidden ); - QStringList lst( dir.entryList() ); + TQDir dir( srcDir ); + dir.setFilter( TQDir::All | TQDir::Hidden ); + TQStringList lst( dir.entryList() ); lst.remove( "." ); lst.remove( ".." ); KURL::List srcList; - for( QStringList::ConstIterator it = lst.begin(); it != lst.end() ; ++it) + for( TQStringList::ConstIterator it = lst.begin(); it != lst.end() ; ++it) { src = srcDirURL; src.addPath( *it ); @@ -916,8 +916,8 @@ ArkWidget::extractRemoteInitiateMoving( const KURL & target ) m_extractURL.adjustPath( 1 ); KIO::CopyJob *job = KIO::copy( srcList, target, this ); - connect( job, SIGNAL(result(KIO::Job*)), - this, SLOT(slotExtractRemoteDone(KIO::Job*)) ); + connect( job, TQT_SIGNAL(result(KIO::Job*)), + this, TQT_SLOT(slotExtractRemoteDone(KIO::Job*)) ); m_extractRemote = false; } @@ -957,7 +957,7 @@ ArkWidget::file_close() if ( isArchiveOpen() ) { closeArch(); - emit setWindowCaption( QString::null ); + emit setWindowCaption( TQString::null ); emit removeOpenArk( m_strArchName ); updateStatusTotals(); updateStatusSelection(); @@ -968,7 +968,7 @@ ArkWidget::file_close() closeArch(); } - m_strArchName = QString::null; + m_strArchName = TQString::null; m_url = KURL(); } @@ -984,22 +984,22 @@ ArkWidget::askToCreateRealArchive() if (choice == KMessageBox::Yes) { url = getCreateFilename( i18n("Create New Archive"), - QString::null, false ); + TQString::null, false ); } else - url.setPath( QString::null ); + url.setPath( TQString::null ); return url; } void -ArkWidget::createRealArchive( const QString & strFilename, const QStringList & filesToAdd ) +ArkWidget::createRealArchive( const TQString & strFilename, const TQStringList & filesToAdd ) { Arch * newArch = getNewArchive( strFilename ); busy( i18n( "Creating archive..." ) ); if ( !newArch ) return; if ( !filesToAdd.isEmpty() ) - m_pTempAddList = new QStringList( filesToAdd ); + m_pTempAddList = new TQStringList( filesToAdd ); m_compressedFile = static_cast< CompressedFile * >( arch )->tempFileName(); KURL u1, u2; u1.setPath( m_compressedFile ); @@ -1007,28 +1007,28 @@ ArkWidget::createRealArchive( const QString & strFilename, const QStringList & f u2.setPath( m_createRealArchTmpDir->name() + u1.fileName() ); KIO::NetAccess::copy( u1, u2, this ); m_compressedFile = "file:" + u2.path(); // AGAIN THE 5 SPACES Hack :-( - connect( newArch, SIGNAL( sigCreate( Arch *, bool, const QString &, int ) ), - this, SLOT( createRealArchiveSlotCreate( Arch *, bool, - const QString &, int ) ) ); + connect( newArch, TQT_SIGNAL( sigCreate( Arch *, bool, const TQString &, int ) ), + this, TQT_SLOT( createRealArchiveSlotCreate( Arch *, bool, + const TQString &, int ) ) ); file_close(); newArch->create(); } void ArkWidget::createRealArchiveSlotCreate( Arch * newArch, bool success, - const QString & fileName, int nbr ) + const TQString & fileName, int nbr ) { slotCreate( newArch, success, fileName, nbr ); if ( !success ) return; - QStringList listForCompressedFile; + TQStringList listForCompressedFile; listForCompressedFile.append(m_compressedFile); disableAll(); - connect( newArch, SIGNAL( sigAdd( bool ) ), this, - SLOT( createRealArchiveSlotAddDone( bool ) ) ); + connect( newArch, TQT_SIGNAL( sigAdd( bool ) ), this, + TQT_SLOT( createRealArchiveSlotAddDone( bool ) ) ); newArch->addFile(listForCompressedFile); } @@ -1037,8 +1037,8 @@ void ArkWidget::createRealArchiveSlotAddDone( bool success ) { kdDebug( 1601 ) << "createRealArchiveSlotAddDone+, success:" << success << endl; - disconnect( arch, SIGNAL( sigAdd( bool ) ), this, - SLOT( createRealArchiveSlotAddDone( bool ) ) ); + disconnect( arch, TQT_SIGNAL( sigAdd( bool ) ), this, + TQT_SLOT( createRealArchiveSlotAddDone( bool ) ) ); m_createRealArchTmpDir->unlink(); delete m_createRealArchTmpDir; @@ -1058,8 +1058,8 @@ ArkWidget::createRealArchiveSlotAddDone( bool success ) } else { - connect( arch, SIGNAL( sigAdd( bool ) ), this, - SLOT( createRealArchiveSlotAddFilesDone( bool ) ) ); + connect( arch, TQT_SIGNAL( sigAdd( bool ) ), this, + TQT_SLOT( createRealArchiveSlotAddFilesDone( bool ) ) ); // files were dropped in addFile( m_pTempAddList ); } @@ -1069,8 +1069,8 @@ void ArkWidget::createRealArchiveSlotAddFilesDone( bool success ) { //kdDebug( 1601 ) << "createRealArchiveSlotAddFilesDone+, success:" << success << endl; - disconnect( arch, SIGNAL( sigAdd( bool ) ), this, - SLOT( createRealArchiveSlotAddFilesDone( bool ) ) ); + disconnect( arch, TQT_SIGNAL( sigAdd( bool ) ), this, + TQT_SLOT( createRealArchiveSlotAddFilesDone( bool ) ) ); delete m_pTempAddList; m_pTempAddList = NULL; emit createRealArchiveDone( success ); @@ -1086,7 +1086,7 @@ ArkWidget::action_add() { if (m_bIsSimpleCompressedFile && (m_nNumFiles == 1)) { - QString strFilename; + TQString strFilename; KURL url = askToCreateRealArchive(); strFilename = url.path(); if (!strFilename.isEmpty()) @@ -1096,7 +1096,7 @@ ArkWidget::action_add() return; } - KFileDialog fileDlg( ":ArkAddDir", QString::null, this, "adddlg", true ); + KFileDialog fileDlg( ":ArkAddDir", TQString::null, this, "adddlg", true ); fileDlg.setMode( KFile::Mode( KFile::Files | KFile::ExistingOnly ) ); fileDlg.setCaption(i18n("Select Files to Add")); @@ -1104,7 +1104,7 @@ ArkWidget::action_add() { KURL::List addList; addList = fileDlg.selectedURLs(); - QStringList * list = new QStringList(); + TQStringList * list = new TQStringList(); //Here we pre-calculate the end of the list KURL::List::ConstIterator endList = addList.end(); for (KURL::List::ConstIterator it = addList.begin(); it != endList; ++it) @@ -1114,7 +1114,7 @@ ArkWidget::action_add() { if ( m_bIsSimpleCompressedFile && list->count() > 1 ) { - QString strFilename; + TQString strFilename; KURL url = askToCreateRealArchive(); strFilename = url.path(); if (!strFilename.isEmpty()) @@ -1131,7 +1131,7 @@ ArkWidget::action_add() } void -ArkWidget::addFile(QStringList *list) +ArkWidget::addFile(TQStringList *list) { if ( !ArkUtils::diskHasSpace( tmpDir(), ArkUtils::getSizes( list ) ) ) return; @@ -1140,14 +1140,14 @@ ArkWidget::addFile(QStringList *list) busy( i18n( "Adding files..." ) ); // if they are URLs, we have to download them, replace the URLs // with filenames, and remember to delete the temporaries later. - for (QStringList::Iterator it = list->begin(); it != list->end(); ++it) + for (TQStringList::Iterator it = list->begin(); it != list->end(); ++it) { - QString str = *it; + TQString str = *it; *it = toLocalFile(KURL(str)).prettyURL(); } - connect( arch, SIGNAL( sigAdd( bool ) ), this, SLOT( slotAddDone( bool ) ) ); + connect( arch, TQT_SIGNAL( sigAdd( bool ) ), this, TQT_SLOT( slotAddDone( bool ) ) ); arch->addFile( ( *list ) ); } @@ -1158,13 +1158,13 @@ ArkWidget::action_add_dir() false, this, i18n("Select Folder to Add")); - QString dir = KURL::decode_string( u.url(-1) ); + TQString dir = KURL::decode_string( u.url(-1) ); if ( !dir.isEmpty() ) { busy( i18n( "Adding folder..." ) ); disableAll(); u = toLocalFile(u); - connect( arch, SIGNAL( sigAdd( bool ) ), this, SLOT( slotAddDone( bool ) ) ); + connect( arch, TQT_SIGNAL( sigAdd( bool ) ), this, TQT_SLOT( slotAddDone( bool ) ) ); arch->addDir( u.prettyURL() ); } @@ -1173,7 +1173,7 @@ ArkWidget::action_add_dir() void ArkWidget::slotAddDone(bool _bSuccess) { - disconnect( arch, SIGNAL( sigAdd( bool ) ), this, SLOT( slotAddDone( bool ) ) ); + disconnect( arch, TQT_SIGNAL( sigAdd( bool ) ), this, TQT_SLOT( slotAddDone( bool ) ) ); m_fileListView->setUpdatesEnabled(true); m_fileListView->triggerUpdate(); ready(); @@ -1201,9 +1201,9 @@ ArkWidget::toLocalFile( const KURL& url ) if(!url.isLocalFile()) { - QString strURL = url.prettyURL(); + TQString strURL = url.prettyURL(); - QString tempfile = tmpDir(); + TQString tempfile = tmpDir(); tempfile += strURL.right(strURL.length() - strURL.findRev("/") - 1); deleteAfterUse(tempfile); // remember for deletion KURL tempurl; tempurl.setPath( tempfile ); @@ -1215,7 +1215,7 @@ ArkWidget::toLocalFile( const KURL& url ) } void -ArkWidget::deleteAfterUse( const QString& path ) +ArkWidget::deleteAfterUse( const TQString& path ) { mpDownloadedList.append( path ); } @@ -1228,10 +1228,10 @@ ArkWidget::removeDownloadedFiles() // It is necessary to remove those files even if tmpDir() is getting deleted: // not all files in mpDownloadedList are from tmpDir() - e.g. when using --tempfile // But of course we could decide to not add files from tmpDir() into mpDownloadedList. - QStringList::ConstIterator it = mpDownloadedList.begin(); - QStringList::ConstIterator end = mpDownloadedList.end(); + TQStringList::ConstIterator it = mpDownloadedList.begin(); + TQStringList::ConstIterator end = mpDownloadedList.end(); for ( ; it != end ; ++it ) - QFile::remove( *it ); + TQFile::remove( *it ); mpDownloadedList.clear(); } } @@ -1249,13 +1249,13 @@ ArkWidget::action_delete() return; // shouldn't happen - delete should have been disabled! } - QStringList list = m_fileListView->selectedFilenames(); + TQStringList list = m_fileListView->selectedFilenames(); // ask for confirmation if ( KMessageBox::warningContinueCancelList( this, i18n( "Do you really want to delete the selected items?" ), list, - QString::null, + TQString::null, KStdGuiItem::del(), "confirmDelete" ) != KMessageBox::Continue) @@ -1264,7 +1264,7 @@ ArkWidget::action_delete() } // Remove the entries from the list view - QListViewItemIterator it( m_fileListView ); + TQListViewItemIterator it( m_fileListView ); while ( it.current() ) { if ( it.current()->isSelected() ) @@ -1275,7 +1275,7 @@ ArkWidget::action_delete() disableAll(); busy( i18n( "Removing..." ) ); - connect( arch, SIGNAL( sigDelete( bool ) ), this, SLOT( slotDeleteDone( bool ) ) ); + connect( arch, TQT_SIGNAL( sigDelete( bool ) ), this, TQT_SLOT( slotDeleteDone( bool ) ) ); arch->remove(&list); kdDebug(1601) << "-ArkWidget::action_delete" << endl; } @@ -1283,7 +1283,7 @@ ArkWidget::action_delete() void ArkWidget::slotDeleteDone(bool _bSuccess) { - disconnect( arch, SIGNAL( sigDelete( bool ) ), this, SLOT( slotDeleteDone( bool ) ) ); + disconnect( arch, TQT_SIGNAL( sigDelete( bool ) ), this, TQT_SLOT( slotDeleteDone( bool ) ) ); kdDebug(1601) << "+ArkWidget::slotDeleteDone" << endl; m_fileListView->setUpdatesEnabled(true); m_fileListView->triggerUpdate(); @@ -1305,8 +1305,8 @@ ArkWidget::slotDeleteDone(bool _bSuccess) void ArkWidget::slotOpenWith() { - connect( arch, SIGNAL( sigExtract( bool ) ), this, - SLOT( openWithSlotExtractDone( bool ) ) ); + connect( arch, TQT_SIGNAL( sigExtract( bool ) ), this, + TQT_SLOT( openWithSlotExtractDone( bool ) ) ); showCurrentFile(); } @@ -1314,14 +1314,14 @@ ArkWidget::slotOpenWith() void ArkWidget::openWithSlotExtractDone( bool success ) { - disconnect( arch, SIGNAL( sigExtract( bool ) ), this, - SLOT( openWithSlotExtractDone( bool ) ) ); + disconnect( arch, TQT_SIGNAL( sigExtract( bool ) ), this, + TQT_SLOT( openWithSlotExtractDone( bool ) ) ); if ( success ) { KURL::List list; list.append(m_viewURL); - KOpenWithDlg l( list, i18n("Open with:"), QString::null, (QWidget*)0L); + KOpenWithDlg l( list, i18n("Open with:"), TQString::null, (TQWidget*)0L); if ( l.exec() ) { KService::Ptr service = l.service(); @@ -1331,7 +1331,7 @@ ArkWidget::openWithSlotExtractDone( bool success ) } else { - QString exec = l.text(); + TQString exec = l.text(); exec += " %f"; KRun::run( exec, list ); } @@ -1347,22 +1347,22 @@ ArkWidget::openWithSlotExtractDone( bool success ) void -ArkWidget::prepareViewFiles( const QStringList & fileList ) +ArkWidget::prepareViewFiles( const TQStringList & fileList ) { - QString destTmpDirectory; + TQString destTmpDirectory; destTmpDirectory = tmpDir(); // Make sure to delete previous file already there... - for(QStringList::ConstIterator it = fileList.begin(); + for(TQStringList::ConstIterator it = fileList.begin(); it != fileList.end(); ++it) - QFile::remove(destTmpDirectory + *it); + TQFile::remove(destTmpDirectory + *it); - m_viewList = new QStringList( fileList ); + m_viewList = new TQStringList( fileList ); arch->unarchFile( m_viewList, destTmpDirectory, true); } bool -ArkWidget::reportExtractFailures( const QString & _dest, QStringList *_list ) +ArkWidget::reportExtractFailures( const TQString & _dest, TQStringList *_list ) { // reports extract failures when Overwrite = False and the file // exists already in the destination directory. @@ -1370,10 +1370,10 @@ ArkWidget::reportExtractFailures( const QString & _dest, QStringList *_list ) // Otherwise the list contains the files we are to extract. bool redoExtraction = false; - QString strFilename; + TQString strFilename; - QStringList list = *_list; - QStringList filesExisting = existingFiles( _dest, list ); + TQStringList list = *_list; + TQStringList filesExisting = existingFiles( _dest, list ); int numFilesToReport = filesExisting.count(); @@ -1390,11 +1390,11 @@ ArkWidget::reportExtractFailures( const QString & _dest, QStringList *_list ) } QStringList -ArkWidget::existingFiles( const QString & _dest, QStringList & _list ) +ArkWidget::existingFiles( const TQString & _dest, TQStringList & _list ) { - QString strFilename, tmp; + TQString strFilename, tmp; - QString strDestDir = _dest; + TQString strDestDir = _dest; // make sure the destination directory has a / at the end. if ( !strDestDir.endsWith( "/" ) ) @@ -1407,15 +1407,15 @@ ArkWidget::existingFiles( const QString & _dest, QStringList & _list ) _list = m_fileListView->fileNames(); } - QStringList existingFiles; + TQStringList existingFiles; // now the list contains all the names we must verify. - for (QStringList::Iterator it = _list.begin(); it != _list.end(); ++it) + for (TQStringList::Iterator it = _list.begin(); it != _list.end(); ++it) { strFilename = *it; - QString strFullName = strDestDir + strFilename; + TQString strFullName = strDestDir + strFilename; // if the filename ends with an "/", it means it is a directory - if ( QFile::exists( strFullName ) && !strFilename.endsWith("/") ) + if ( TQFile::exists( strFullName ) && !strFilename.endsWith("/") ) { existingFiles.append( strFilename ); } @@ -1441,20 +1441,20 @@ ArkWidget::action_extract() } //if more than one entry in the archive is root level, suggest a path prefix - QString prefix = m_fileListView->childCount() > 1 ? - QChar( '/' ) + guessName( realURL() ) - : QString(); + TQString prefix = m_fileListView->childCount() > 1 ? + TQChar( '/' ) + guessName( realURL() ) + : TQString(); // Should the extraction dialog show an option for extracting only selected files? bool enableSelected = ( m_nNumSelectedFiles > 0 ) && ( m_fileListView->totalFiles() > 1); - QString base = ArkSettings::extractionHistory().isEmpty()? - QString() : ArkSettings::extractionHistory().first(); + TQString base = ArkSettings::extractionHistory().isEmpty()? + TQString() : ArkSettings::extractionHistory().first(); if ( base.isEmpty() ) { // Perhaps the KDE Documents folder is a better choice? - base = QDir::homeDirPath(); + base = TQDir::homeDirPath(); } // Default URL shown in the extraction dialog; @@ -1462,7 +1462,7 @@ ArkWidget::action_extract() if ( m_extractOnly ) { - defaultDir = KURL::fromPathOrURL( QDir::currentDirPath() ); + defaultDir = KURL::fromPathOrURL( TQDir::currentDirPath() ); } ExtractionDialog *dlg = new ExtractionDialog( this, 0, enableSelected, defaultDir, prefix, m_url.fileName() ); @@ -1479,7 +1479,7 @@ ArkWidget::action_extract() //extractDir will either be the real, local extract dir, //or in case of a extract to remote location, a local tmp dir - QString extractDir; + TQString extractDir; if ( !m_extractURL.isLocalFile() ) { @@ -1519,7 +1519,7 @@ ArkWidget::action_extract() { disableAll(); busy( i18n( "Extracting..." ) ); - connect( arch, SIGNAL( sigExtract( bool ) ), this, SLOT( slotExtractDone(bool) ) ); + connect( arch, TQT_SIGNAL( sigExtract( bool ) ), this, TQT_SLOT( slotExtractDone(bool) ) ); arch->unarchFile(0, extractDir); } } @@ -1528,12 +1528,12 @@ ArkWidget::action_extract() { KIO::filesize_t nTotalSize = 0; // make a list to send to unarchFile - QStringList selectedFiles = m_fileListView->selectedFilenames(); - for ( QStringList::const_iterator it = selectedFiles.constBegin(); + TQStringList selectedFiles = m_fileListView->selectedFilenames(); + for ( TQStringList::const_iterator it = selectedFiles.constBegin(); it != selectedFiles.constEnd(); ++it ) { - m_extractList->append( QFile::encodeName( *it ) ); + m_extractList->append( TQFile::encodeName( *it ) ); } if (!bOvwrt) @@ -1546,8 +1546,8 @@ ArkWidget::action_extract() { disableAll(); busy( i18n( "Extracting..." ) ); - connect( arch, SIGNAL( sigExtract( bool ) ), - this, SLOT( slotExtractDone(bool) ) ); + connect( arch, TQT_SIGNAL( sigExtract( bool ) ), + this, TQT_SLOT( slotExtractDone(bool) ) ); arch->unarchFile(m_extractList, extractDir); // extract selected files } } @@ -1580,16 +1580,16 @@ ArkWidget::action_edit() // [hmm, does that really make sense? I'll leave it for now.] busy( i18n( "Extracting..." ) ); - connect( arch, SIGNAL( sigExtract( bool ) ), this, - SLOT( editSlotExtractDone() ) ); + connect( arch, TQT_SIGNAL( sigExtract( bool ) ), this, + TQT_SLOT( editSlotExtractDone() ) ); showCurrentFile(); } void ArkWidget::editSlotExtractDone() { - disconnect( arch, SIGNAL( sigExtract( bool ) ), - this, SLOT( editSlotExtractDone() ) ); + disconnect( arch, TQT_SIGNAL( sigExtract( bool ) ), + this, TQT_SLOT( editSlotExtractDone() ) ); ready(); editStart(); @@ -1608,14 +1608,14 @@ ArkWidget::editStart() KURL::List list; // edit will be in progress until the KProcess terminates. KOpenWithDlg l( list, i18n("Edit with:"), - QString::null, (QWidget*)0L ); + TQString::null, (TQWidget*)0L ); if ( l.exec() ) { KProcess *kp = new KProcess; *kp << l.text() << m_strFileToView; - connect( kp, SIGNAL(processExited(KProcess *)), - this, SLOT(slotEditFinished(KProcess *)) ); + connect( kp, TQT_SIGNAL(processExited(KProcess *)), + this, TQT_SLOT(slotEditFinished(KProcess *)) ); if ( kp->start(KProcess::NotifyOnExit, KProcess::AllOutput) == false ) { KMessageBox::error(0, i18n("Trouble editing the file...")); @@ -1627,9 +1627,9 @@ void ArkWidget::slotEditFinished(KProcess *kp) { kdDebug(1601) << "+ArkWidget::slotEditFinished" << endl; - connect( arch, SIGNAL( sigAdd( bool ) ), this, SLOT( editSlotAddDone( bool ) ) ); + connect( arch, TQT_SIGNAL( sigAdd( bool ) ), this, TQT_SLOT( editSlotAddDone( bool ) ) ); delete kp; - QStringList list; + TQStringList list; // now put the file back into the archive. list.append(m_strFileToView); disableAll(); @@ -1640,16 +1640,16 @@ ArkWidget::slotEditFinished(KProcess *kp) // If the filename has more than three /'s then we should // change to the first level directory so that the paths // come out right. - QStringList::Iterator it = list.begin(); - QString filename = *it; - QString path; + TQStringList::Iterator it = list.begin(); + TQString filename = *it; + TQString path; if (filename.contains('/') > 3) { kdDebug(1601) << "Filename is originally: " << filename << endl; int i = filename.find('/', 5); path = filename.left(1+i); kdDebug(1601) << "Changing to dir: " << path << endl; - QDir::setCurrent(path); + TQDir::setCurrent(path); filename = filename.right(filename.length()-i-1); // HACK!! We need a relative path. If I have "file:", it // will look like an absolute path. So five spaces here to get @@ -1668,15 +1668,15 @@ void ArkWidget::editSlotAddDone( bool success ) { ready(); - disconnect( arch, SIGNAL( sigAdd( bool ) ), this, SLOT( editSlotAddDone( bool ) ) ); + disconnect( arch, TQT_SIGNAL( sigAdd( bool ) ), this, TQT_SLOT( editSlotAddDone( bool ) ) ); slotAddDone( success ); } void ArkWidget::action_view() { - connect( arch, SIGNAL( sigExtract( bool ) ), this, - SLOT( viewSlotExtractDone( bool ) ) ); + connect( arch, TQT_SIGNAL( sigExtract( bool ) ), this, + TQT_SLOT( viewSlotExtractDone( bool ) ) ); busy( i18n( "Extracting file to view" ) ); showCurrentFile(); } @@ -1686,7 +1686,7 @@ ArkWidget::viewSlotExtractDone( bool success ) { if ( success ) { - chmod( QFile::encodeName( m_strFileToView ), 0400 ); + chmod( TQFile::encodeName( m_strFileToView ), 0400 ); bool view = true; if ( ArkSettings::useIntegratedViewer() ) @@ -1695,8 +1695,8 @@ ArkWidget::viewSlotExtractDone( bool success ) if ( !viewer->view( m_viewURL ) ) { - QString text = i18n( "The internal viewer is not able to display this file. Would you like to view it using an external program?" ); - view = ( KMessageBox::warningYesNo( this, text, QString::null, i18n("View Externally"), i18n("Do Not View") ) == KMessageBox::Yes ); + TQString text = i18n( "The internal viewer is not able to display this file. Would you like to view it using an external program?" ); + view = ( KMessageBox::warningYesNo( this, text, TQString::null, i18n("View Externally"), i18n("Do Not View") ) == KMessageBox::Yes ); if ( view ) viewInExternalViewer( this, m_viewURL ); @@ -1708,8 +1708,8 @@ ArkWidget::viewSlotExtractDone( bool success ) } } - disconnect( arch, SIGNAL( sigExtract( bool ) ), this, - SLOT( viewSlotExtractDone( bool ) ) ); + disconnect( arch, TQT_SIGNAL( sigExtract( bool ) ), this, + TQT_SLOT( viewSlotExtractDone( bool ) ) ); delete m_viewList; @@ -1729,21 +1729,21 @@ ArkWidget::showCurrentFile() if ( !m_fileListView->currentItem() ) return; - QString name = m_fileListView->currentItem()->fileName(); + TQString name = m_fileListView->currentItem()->fileName(); - QString fullname = tmpDir(); + TQString fullname = tmpDir(); fullname += name; if(fullname.contains("../")) fullname.remove("../"); - //Convert the QString filename to KURL to escape the bad characters + //Convert the TQString filename to KURL to escape the bad characters m_viewURL.setPath(fullname); m_strFileToView = fullname; kdDebug(1601) << "File to be extracted: " << m_viewURL << endl; - QStringList extractList; + TQStringList extractList; extractList.append(name); if (ArkUtils::diskHasSpace( tmpDir(), m_fileListView->currentItem()->fileSize() ) ) @@ -1762,7 +1762,7 @@ ArkWidget::setArchivePopupEnabled( bool b ) } void -ArkWidget::doPopup( QListViewItem *pItem, const QPoint &pPoint, int nCol ) // slot +ArkWidget::doPopup( TQListViewItem *pItem, const TQPoint &pPoint, int nCol ) // slot // do the right-click popup menus { if ( nCol == 0 || !m_bArchivePopupEnabled ) @@ -1779,7 +1779,7 @@ ArkWidget::doPopup( QListViewItem *pItem, const QPoint &pPoint, int nCol ) // sl void -ArkWidget::viewFile( QListViewItem* item ) // slot +ArkWidget::viewFile( TQListViewItem* item ) // slot // show contents when double click { // Preview, if it is a file @@ -1809,7 +1809,7 @@ ArkWidget::updateStatusSelection() m_nNumSelectedFiles = m_fileListView->selectedFilesCount(); m_nSizeOfSelectedFiles = m_fileListView->selectedSize(); - QString strInfo; + TQString strInfo; if (m_nNumSelectedFiles == 0) { strInfo = i18n("0 files selected"); @@ -1834,7 +1834,7 @@ ArkWidget::updateStatusSelection() // Drag & Drop //////////////////////////////////////////////////////// void -ArkWidget::dragMoveEvent(QDragMoveEvent *e) +ArkWidget::dragMoveEvent(TQDragMoveEvent *e) { if (KURLDrag::canDecode(e) && !m_bDropSourceIsSelf) { @@ -1844,7 +1844,7 @@ ArkWidget::dragMoveEvent(QDragMoveEvent *e) void -ArkWidget::dropEvent(QDropEvent* e) +ArkWidget::dropEvent(TQDropEvent* e) { kdDebug( 1601 ) << "+ArkWidget::dropEvent" << endl; @@ -1852,7 +1852,7 @@ ArkWidget::dropEvent(QDropEvent* e) if ( KURLDrag::decode( e, list ) ) { - QStringList urlList = list.toStringList(); + TQStringList urlList = list.toStringList(); dropAction( urlList ); } @@ -1864,7 +1864,7 @@ ArkWidget::dropEvent(QDropEvent* e) ////////////////////////////////////////////////////////////////////// void -ArkWidget::dropAction( QStringList & list ) +ArkWidget::dropAction( TQStringList & list ) { // Called by dropEvent @@ -1881,8 +1881,8 @@ ArkWidget::dropAction( QStringList & list ) // and don't forget about gzip files. - QString str; - QStringList urls; // to be sent to addFile + TQString str; + TQStringList urls; // to be sent to addFile str = list.first(); @@ -1896,13 +1896,13 @@ ArkWidget::dropAction( QStringList & list ) // one or open it as the new current archive int nRet = KMessageBox::warningYesNoCancel(this, i18n("Do you wish to add this to the current archive or open it as a new archive?"), - QString::null, + TQString::null, i18n("&Add"), i18n("&Open")); if (KMessageBox::Yes == nRet) // add it { if (m_bIsSimpleCompressedFile && (m_nNumFiles == 1)) { - QString strFilename; + TQString strFilename; KURL url = askToCreateRealArchive(); strFilename = url.path(); if (!strFilename.isEmpty()) @@ -1933,7 +1933,7 @@ ArkWidget::dropAction( QStringList & list ) { if (m_bIsSimpleCompressedFile && (m_nNumFiles == 1)) { - QString strFilename; + TQString strFilename; KURL url = askToCreateRealArchive(); strFilename = url.path(); if (!strFilename.isEmpty()) @@ -1950,11 +1950,11 @@ ArkWidget::dropAction( QStringList & list ) // no archive is open, so we ask if the user wants to open one // for this/these file/files. - QString str; + TQString str; str = (list.count() > 1) ? i18n("There is no archive currently open. Do you wish to create one now for these files?") : i18n("There is no archive currently open. Do you wish to create one now for this file?"); - int nRet = KMessageBox::warningYesNo(this, str, QString::null, i18n("Create Archive"), i18n("Do Not Create")); + int nRet = KMessageBox::warningYesNo(this, str, TQString::null, i18n("Create Archive"), i18n("Do Not Create")); if (nRet == KMessageBox::Yes) // yes { file_new(); @@ -1969,22 +1969,22 @@ ArkWidget::dropAction( QStringList & list ) } void -ArkWidget::startDrag( const QStringList & fileList ) +ArkWidget::startDrag( const TQStringList & fileList ) { mDragFiles = fileList; - connect( arch, SIGNAL( sigExtract( bool ) ), this, SLOT( startDragSlotExtractDone( bool ) ) ); + connect( arch, TQT_SIGNAL( sigExtract( bool ) ), this, TQT_SLOT( startDragSlotExtractDone( bool ) ) ); prepareViewFiles( fileList ); } void ArkWidget::startDragSlotExtractDone( bool ) { - disconnect( arch, SIGNAL( sigExtract( bool ) ), - this, SLOT( startDragSlotExtractDone( bool ) ) ); + disconnect( arch, TQT_SIGNAL( sigExtract( bool ) ), + this, TQT_SLOT( startDragSlotExtractDone( bool ) ) ); KURL::List list; - for (QStringList::Iterator it = mDragFiles.begin(); it != mDragFiles.end(); ++it) + for (TQStringList::Iterator it = mDragFiles.begin(); it != mDragFiles.end(); ++it) { KURL url; url.setPath( tmpDir() + *it ); @@ -1999,7 +1999,7 @@ ArkWidget::startDragSlotExtractDone( bool ) void -ArkWidget::arkWarning(const QString& msg) +ArkWidget::arkWarning(const TQString& msg) { KMessageBox::information(this, msg); } @@ -2012,26 +2012,26 @@ ArkWidget::createFileListView() { m_fileListView = new FileListView(this); - connect( m_fileListView, SIGNAL( selectionChanged() ), - this, SLOT( slotSelectionChanged() ) ); - connect( m_fileListView, SIGNAL( rightButtonPressed(QListViewItem *, const QPoint &, int) ), - this, SLOT(doPopup(QListViewItem *, const QPoint &, int))); - connect( m_fileListView, SIGNAL( startDragRequest( const QStringList & ) ), - this, SLOT( startDrag( const QStringList & ) ) ); - connect( m_fileListView, SIGNAL( executed(QListViewItem *, const QPoint &, int ) ), - this, SLOT( viewFile(QListViewItem*) ) ); - connect( m_fileListView, SIGNAL( returnPressed(QListViewItem * ) ), - this, SLOT( viewFile(QListViewItem*) ) ); + connect( m_fileListView, TQT_SIGNAL( selectionChanged() ), + this, TQT_SLOT( slotSelectionChanged() ) ); + connect( m_fileListView, TQT_SIGNAL( rightButtonPressed(TQListViewItem *, const TQPoint &, int) ), + this, TQT_SLOT(doPopup(TQListViewItem *, const TQPoint &, int))); + connect( m_fileListView, TQT_SIGNAL( startDragRequest( const TQStringList & ) ), + this, TQT_SLOT( startDrag( const TQStringList & ) ) ); + connect( m_fileListView, TQT_SIGNAL( executed(TQListViewItem *, const TQPoint &, int ) ), + this, TQT_SLOT( viewFile(TQListViewItem*) ) ); + connect( m_fileListView, TQT_SIGNAL( returnPressed(TQListViewItem * ) ), + this, TQT_SLOT( viewFile(TQListViewItem*) ) ); } m_fileListView->clear(); } -Arch * ArkWidget::getNewArchive( const QString & _fileName, const QString& _mimetype ) +Arch * ArkWidget::getNewArchive( const TQString & _fileName, const TQString& _mimetype ) { Arch * newArch = 0; - QString type = _mimetype.isNull()? KMimeType::findByURL( KURL::fromPathOrURL(_fileName) )->name() : _mimetype; + TQString type = _mimetype.isNull()? KMimeType::findByURL( KURL::fromPathOrURL(_fileName) )->name() : _mimetype; ArchType archtype = ArchiveFormatInfo::self()->archTypeForMimeType(type); kdDebug( 1601 ) << "archtype is recognised as: " << archtype << endl; if(0 == (newArch = Arch::archFactory(archtype, this, @@ -2048,8 +2048,8 @@ Arch * ArkWidget::getNewArchive( const QString & _fileName, const QString& _mime return NULL; } - connect( newArch, SIGNAL(headers(const ColumnList&)), - m_fileListView, SLOT(setHeaders(const ColumnList&))); + connect( newArch, TQT_SIGNAL(headers(const ColumnList&)), + m_fileListView, TQT_SLOT(setHeaders(const ColumnList&))); m_archType = archtype; m_fileListView->setUpdatesEnabled(true); @@ -2062,26 +2062,26 @@ Arch * ArkWidget::getNewArchive( const QString & _fileName, const QString& _mime bool -ArkWidget::createArchive( const QString & _filename ) +ArkWidget::createArchive( const TQString & _filename ) { Arch * newArch = getNewArchive( _filename ); if ( !newArch ) return false; busy( i18n( "Creating archive..." ) ); - connect( newArch, SIGNAL(sigCreate(Arch *, bool, const QString &, int) ), - this, SLOT(slotCreate(Arch *, bool, const QString &, int) ) ); + connect( newArch, TQT_SIGNAL(sigCreate(Arch *, bool, const TQString &, int) ), + this, TQT_SLOT(slotCreate(Arch *, bool, const TQString &, int) ) ); newArch->create(); return true; } void -ArkWidget::slotCreate(Arch * _newarch, bool _success, const QString & _filename, int) +ArkWidget::slotCreate(Arch * _newarch, bool _success, const TQString & _filename, int) { kdDebug( 1601 ) << k_funcinfo << endl; - disconnect( _newarch, SIGNAL( sigCreate( Arch *, bool, const QString &, int ) ), - this, SLOT(slotCreate(Arch *, bool, const QString &, int) ) ); + disconnect( _newarch, TQT_SIGNAL( sigCreate( Arch *, bool, const TQString &, int ) ), + this, TQT_SLOT(slotCreate(Arch *, bool, const TQString &, int) ) ); ready(); if ( _success ) { @@ -2115,7 +2115,7 @@ ArkWidget::slotCreate(Arch * _newarch, bool _success, const QString & _filename, ////////////////////////////////////////////////////////////////////// void -ArkWidget::openArchive( const QString & _filename ) +ArkWidget::openArchive( const TQString & _filename ) { Arch *newArch = 0; ArchType archtype; @@ -2126,9 +2126,9 @@ ArkWidget::openArchive( const QString & _filename ) if ( info->wasUnknownExtension() ) { ArchiveFormatDlg * dlg = new ArchiveFormatDlg( this, info->findMimeType( m_url ) ); - if ( !dlg->exec() == QDialog::Accepted ) + if ( !dlg->exec() == TQDialog::Accepted ) { - emit setWindowCaption( QString::null ); + emit setWindowCaption( TQString::null ); emit removeRecentURL( m_realURL ); delete dlg; file_close(); @@ -2148,7 +2148,7 @@ ArkWidget::openArchive( const QString & _filename ) if( 0 == ( newArch = Arch::archFactory( archtype, this, _filename, m_openAsMimeType) ) ) { - emit setWindowCaption( QString::null ); + emit setWindowCaption( TQString::null ); emit removeRecentURL( m_realURL ); KMessageBox::error( this, i18n("Unknown archive format or corrupted archive") ); return; @@ -2162,10 +2162,10 @@ ArkWidget::openArchive( const QString & _filename ) m_archType = archtype; - connect( newArch, SIGNAL(sigOpen(Arch *, bool, const QString &, int)), - this, SLOT(slotOpen(Arch *, bool, const QString &,int)) ); - connect( newArch, SIGNAL(headers(const ColumnList&)), - m_fileListView, SLOT(setHeaders(const ColumnList&))); + connect( newArch, TQT_SIGNAL(sigOpen(Arch *, bool, const TQString &, int)), + this, TQT_SLOT(slotOpen(Arch *, bool, const TQString &,int)) ); + connect( newArch, TQT_SIGNAL(headers(const ColumnList&)), + m_fileListView, TQT_SLOT(setHeaders(const ColumnList&))); disableAll(); @@ -2177,7 +2177,7 @@ ArkWidget::openArchive( const QString & _filename ) } void -ArkWidget::slotOpen( Arch * /* _newarch */, bool _success, const QString & _filename, int ) +ArkWidget::slotOpen( Arch * /* _newarch */, bool _success, const TQString & _filename, int ) { ready(); m_fileListView->setUpdatesEnabled(true); @@ -2187,8 +2187,8 @@ ArkWidget::slotOpen( Arch * /* _newarch */, bool _success, const QString & _file if ( _success ) { - QFileInfo fi( _filename ); - QString path = fi.dirPath( true ); + TQFileInfo fi( _filename ); + TQString path = fi.dirPath( true ); if ( !fi.isWritable() ) { @@ -2210,7 +2210,7 @@ ArkWidget::slotOpen( Arch * /* _newarch */, bool _success, const QString & _file else { emit removeRecentURL( m_realURL ); - emit setWindowCaption( QString::null ); + emit setWindowCaption( TQString::null ); KMessageBox::error( this, i18n( "An error occurred while trying to open the archive %1" ).arg( _filename ) ); if ( m_extractOnly ) @@ -2257,7 +2257,7 @@ void ArkWidget::showSettings(){ if ( offers.isEmpty() ) genPage->kcfg_KonquerorIntegration->setEnabled( false ); else - genPage->konqIntegrationLabel->setText( QString::null ); + genPage->konqIntegrationLabel->setText( TQString::null ); dialog->show(); diff --git a/ark/arkwidget.h b/ark/arkwidget.h index 435fafa..75f5364 100644 --- a/ark/arkwidget.h +++ b/ark/arkwidget.h @@ -33,7 +33,7 @@ #include <kio/job.h> #include <ktempdir.h> -#include <qvbox.h> +#include <tqvbox.h> #include "arch.h" class QPoint; @@ -60,7 +60,7 @@ class ArkWidget : public QVBox { Q_OBJECT public: - ArkWidget( QWidget *parent=0, const char *name=0 ); + ArkWidget( TQWidget *parent=0, const char *name=0 ); virtual ~ArkWidget(); bool isArchiveOpen() const { return m_bIsArchiveOpen; } @@ -70,12 +70,12 @@ public: void setArkInstanceId( int aid ) { m_arkInstanceId = aid; } void cleanArkTmpDir(); - virtual QString getArchName() const { return m_strArchName; } + virtual TQString getArchName() const { return m_strArchName; } const KURL& realURL() const { return m_realURL; } void setRealURL( const KURL& url ) { m_realURL = url; } - QString tmpDir() const { return m_tmpDir ? m_tmpDir->name() : QString::null; } + TQString tmpDir() const { return m_tmpDir ? m_tmpDir->name() : TQString::null; } FileListView * fileList() const { return m_fileListView; } SearchBar * searchBar() const { return m_searchBar; } @@ -89,13 +89,13 @@ public: void closeArch(); virtual void setExtractOnly(bool extOnly) { m_extractOnly = extOnly; } - virtual void deleteAfterUse( const QString& path ); + virtual void deleteAfterUse( const TQString& path ); bool allowedArchiveName( const KURL & u ); bool file_save_as( const KURL & u ); virtual KURL getSaveAsFileName(); - virtual void setOpenAsMimeType( const QString & mimeType ); - QString & openAsMimeType(){ return m_openAsMimeType; } - void prepareViewFiles( const QStringList & fileList ); + virtual void setOpenAsMimeType( const TQString & mimeType ); + TQString & openAsMimeType(){ return m_openAsMimeType; } + void prepareViewFiles( const TQStringList & fileList ); virtual void setArchivePopupEnabled( bool b ); virtual void extractTo( const KURL & targetDirectory, const KURL & archive, bool bGuessName ); @@ -121,12 +121,12 @@ protected slots: void slotOpenWith(); void action_edit(); - void doPopup(QListViewItem *, const QPoint &, int); // right-click menus - void viewFile(QListViewItem*); // doubleClick view files + void doPopup(TQListViewItem *, const TQPoint &, int); // right-click menus + void viewFile(TQListViewItem*); // doubleClick view files void slotSelectionChanged(); - void slotOpen(Arch *, bool, const QString &, int); - void slotCreate(Arch *, bool, const QString &, int); + void slotOpen(Arch *, bool, const TQString &, int); + void slotCreate(Arch *, bool, const TQString &, int); void slotDeleteDone(bool); void slotExtractDone(bool); void slotExtractRemoteDone(KIO::Job *job); @@ -135,17 +135,17 @@ protected slots: signals: void openURLRequest( const KURL & url ); void request_file_quit(); - void setBusy( const QString & ); + void setBusy( const TQString & ); void setReady(); void fixActions(); void disableAllActions(); - void signalFilePopup( const QPoint & pPoint ); - void signalArchivePopup( const QPoint & pPoint ); - void setStatusBarText( const QString & text ); - void setStatusBarSelectedFiles( const QString & text ); + void signalFilePopup( const TQPoint & pPoint ); + void signalArchivePopup( const TQPoint & pPoint ); + void setStatusBarText( const TQString & text ); + void setStatusBarSelectedFiles( const TQString & text ); void removeRecentURL( const KURL & url ); void addRecentURL( const KURL & url ); - void setWindowCaption( const QString &caption ); + void setWindowCaption( const TQString &caption ); void removeOpenArk( const KURL & ); void addOpenArk( const KURL & ); void createDone( bool ); @@ -156,9 +156,9 @@ signals: protected: // DND - void dragMoveEvent(QDragMoveEvent *e); - void dropEvent(QDropEvent* event); - void dropAction(QStringList & list); + void dragMoveEvent(TQDragMoveEvent *e); + void dropEvent(TQDropEvent* event); + void dropAction(TQStringList & list); private: // methods // disabling/enabling of buttons and menu items @@ -168,7 +168,7 @@ private: // methods void disableAll(); void updateStatusSelection(); void updateStatusTotals(); - void addFile(QStringList *list); + void addFile(TQStringList *list); void removeDownloadedFiles(); // make sure that str is a local file/dir @@ -177,31 +177,31 @@ private: // methods // ask user whether to create a real archive from a compressed file // returns filename if so. Otherwise, empty. KURL askToCreateRealArchive(); - Arch * getNewArchive( const QString & _fileName, const QString& _mimetype = QString() ); - void createRealArchive( const QString &strFilename, - const QStringList & filesToAdd = QStringList() ); - KURL getCreateFilename( const QString & _caption, - const QString & _defaultMimeType = QString::null, + Arch * getNewArchive( const TQString & _fileName, const TQString& _mimetype = TQString() ); + void createRealArchive( const TQString &strFilename, + const TQStringList & filesToAdd = TQStringList() ); + KURL getCreateFilename( const TQString & _caption, + const TQString & _defaultMimeType = TQString::null, bool allowCompressed = true, - const QString & _suggestedName = QString::null ); + const TQString & _suggestedName = TQString::null ); - bool reportExtractFailures(const QString & _dest, QStringList *_list); - QStringList existingFiles( const QString & _dest, QStringList & _list ); + bool reportExtractFailures(const TQString & _dest, TQStringList *_list); + TQStringList existingFiles( const TQString & _dest, TQStringList & _list ); void extractOnlyOpenDone(); void extractRemoteInitiateMoving( const KURL & target ); void editStart(); - void busy( const QString & text ); + void busy( const TQString & text ); void holdBusy(); void resumeBusy(); void ready(); //suggests an extract directory based on archive name - const QString guessName( const KURL & archive ); + const TQString guessName( const KURL & archive ); private slots: - void startDrag( const QStringList & fileList ); + void startDrag( const TQStringList & fileList ); void startDragSlotExtractDone( bool ); void editSlotExtractDone(); void editSlotAddDone( bool success ); @@ -209,7 +209,7 @@ private slots: void openWithSlotExtractDone( bool success ); void createRealArchiveSlotCreate( Arch * newArch, bool success, - const QString & fileName, int nbr ); + const TQString & fileName, int nbr ); void createRealArchiveSlotAddDone( bool success ); void createRealArchiveSlotAddFilesDone( bool success ); @@ -227,14 +227,14 @@ private slots: void addToArchiveSlotAddDone( bool success ); protected: - void arkWarning(const QString& msg); - void arkError(const QString& msg); + void arkWarning(const TQString& msg); + void arkError(const TQString& msg); - void newCaption(const QString& filename); + void newCaption(const TQString& filename); void createFileListView(); - bool createArchive(const QString & name); - void openArchive(const QString & name); + bool createArchive(const TQString & name); + void openArchive(const TQString & name); void showCurrentFile(); @@ -245,10 +245,10 @@ private: // data bool m_settingsAltered; // for use in the edit methods: the url. - QString m_strFileToView; + TQString m_strFileToView; // the compressed file to be added into the new archive - QString m_compressedFile; + TQString m_compressedFile; // Set to true if we are doing an "Extract to Folder" bool m_extractOnly; @@ -263,15 +263,15 @@ private: // data KURL m_viewURL; // the mimetype the user wants to open this archive as - QString m_openAsMimeType; + TQString m_openAsMimeType; // if they're dragging in files, this is the temporary list for when // we have to create an archive: - QStringList *m_pTempAddList; + TQStringList *m_pTempAddList; KRun *m_pKRunPtr; - QStringList mpDownloadedList; + TQStringList mpDownloadedList; bool m_bArchivePopupEnabled; @@ -293,7 +293,7 @@ private: // data SearchBar * m_searchBar; Arch * arch; - QString m_strArchName; + TQString m_strArchName; KURL m_realURL; KURL m_url; ArchType m_archType; @@ -309,9 +309,9 @@ private: // data bool m_bIsSimpleCompressedFile; bool m_bDropSourceIsSelf; - QStringList mDragFiles; - QStringList *m_extractList; - QStringList *m_viewList; + TQStringList mDragFiles; + TQStringList *m_extractList; + TQStringList *m_viewList; KTempDir *m_tmpDir; }; diff --git a/ark/compressedfile.cpp b/ark/compressedfile.cpp index 9ebe283..29d29a9 100644 --- a/ark/compressedfile.cpp +++ b/ark/compressedfile.cpp @@ -29,7 +29,7 @@ #include <fcntl.h> // Qt includes -#include <qdir.h> +#include <tqdir.h> // KDE includes #include <kdebug.h> @@ -53,21 +53,21 @@ // encapsulates the idea of a compressed file -CompressedFile::CompressedFile( ArkWidget *_gui, const QString & _fileName, const QString & _openAsMimeType ) +CompressedFile::CompressedFile( ArkWidget *_gui, const TQString & _fileName, const TQString & _openAsMimeType ) : Arch( _gui, _fileName ) { m_tempDirectory = NULL; m_openAsMimeType = _openAsMimeType; kdDebug(1601) << "CompressedFile constructor" << endl; m_tempDirectory = new KTempDir( _gui->tmpDir() - + QString::fromLatin1( "compressed_file_temp" ) ); + + TQString::fromLatin1( "compressed_file_temp" ) ); m_tempDirectory->setAutoDelete( true ); m_tmpdir = m_tempDirectory->name(); initData(); verifyCompressUtilityIsAvailable( m_archiver_program ); verifyUncompressUtilityIsAvailable( m_unarchiver_program ); - if (!QFile::exists(_fileName)) + if (!TQFile::exists(_fileName)) { KMessageBox::information(0, i18n("You are creating a simple compressed archive which contains only one input file.\n" @@ -97,10 +97,10 @@ void CompressedFile::setHeaders() void CompressedFile::initData() { - m_unarchiver_program = QString::null; - m_archiver_program = QString::null; + m_unarchiver_program = TQString::null; + m_archiver_program = TQString::null; - QString mimeType; + TQString mimeType; if ( !m_openAsMimeType.isNull() ) mimeType = m_openAsMimeType; else @@ -138,12 +138,12 @@ void CompressedFile::initData() } -QString CompressedFile::extension() +TQString CompressedFile::extension() { - QStringList::Iterator it = m_defaultExtensions.begin(); + TQStringList::Iterator it = m_defaultExtensions.begin(); for( ; it != m_defaultExtensions.end(); ++it ) if( m_filename.endsWith( *it ) ) - return QString::null; + return TQString::null; return m_defaultExtensions.first(); } @@ -190,17 +190,17 @@ void CompressedFile::open() kdDebug(1601) << "Command is " << m_unarchiver_program << " " << m_tmpfile<< endl; - connect( kp, SIGNAL(receivedStdout(KProcess*, char*, int)), - this, SLOT(slotReceivedOutput(KProcess*, char*, int))); - connect( kp, SIGNAL(receivedStderr(KProcess*, char*, int)), - this, SLOT(slotReceivedOutput(KProcess*, char*, int))); - connect( kp, SIGNAL(processExited(KProcess*)), this, - SLOT(slotUncompressDone(KProcess*))); + connect( kp, TQT_SIGNAL(receivedStdout(KProcess*, char*, int)), + this, TQT_SLOT(slotReceivedOutput(KProcess*, char*, int))); + connect( kp, TQT_SIGNAL(receivedStderr(KProcess*, char*, int)), + this, TQT_SLOT(slotReceivedOutput(KProcess*, char*, int))); + connect( kp, TQT_SIGNAL(processExited(KProcess*)), this, + TQT_SLOT(slotUncompressDone(KProcess*))); if (kp->start(KProcess::NotifyOnExit, KProcess::AllOutput) == false) { KMessageBox::error( 0, i18n("Could not start a subprocess.") ); - emit sigOpen(this, false, QString::null, 0 ); + emit sigOpen(this, false, TQString::null, 0 ); } kdDebug(1601) << "-CompressedFile::open" << endl; @@ -223,12 +223,12 @@ void CompressedFile::slotUncompressDone(KProcess *_kp) if ( !bSuccess ) { - emit sigOpen( this, false, QString::null, 0 ); + emit sigOpen( this, false, TQString::null, 0 ); return; } - QDir dir( m_tmpdir ); - QStringList lst( dir.entryList() ); + TQDir dir( m_tmpdir ); + TQStringList lst( dir.entryList() ); lst.remove( ".." ); lst.remove( "." ); KURL url; @@ -237,7 +237,7 @@ void CompressedFile::slotUncompressDone(KProcess *_kp) KIO::UDSEntry udsInfo; KIO::NetAccess::stat( url, udsInfo, m_gui ); KFileItem fileItem( udsInfo, url ); - QStringList list; + TQStringList list; list << fileItem.name(); list << fileItem.permissionsString(); list << fileItem.user(); @@ -256,7 +256,7 @@ void CompressedFile::create() | Arch::View); } -void CompressedFile::addFile( const QStringList &urls ) +void CompressedFile::addFile( const TQStringList &urls ) { // only used for adding ONE file to an EMPTY gzip file, i.e., one that // has just been created @@ -269,7 +269,7 @@ void CompressedFile::addFile( const QStringList &urls ) KURL url = KURL::fromPathOrURL(urls.first()); Q_ASSERT(url.isLocalFile()); - QString file; + TQString file; file = url.path(); KProcess proc; @@ -291,18 +291,18 @@ void CompressedFile::addFile( const QStringList &urls ) if ( m_archiver_program == "lzop") kp->setUsePty( KProcess::Stdin, false ); - QString compressor = m_archiver_program; + TQString compressor = m_archiver_program; *kp << compressor << "-c" << file; - connect( kp, SIGNAL(receivedStdout(KProcess*, char*, int)), - this, SLOT(slotAddInProgress(KProcess*, char*, int))); - connect( kp, SIGNAL(receivedStderr(KProcess*, char*, int)), - this, SLOT(slotReceivedOutput(KProcess*, char*, int))); - connect( kp, SIGNAL(processExited(KProcess*)), this, - SLOT(slotAddDone(KProcess*))); + connect( kp, TQT_SIGNAL(receivedStdout(KProcess*, char*, int)), + this, TQT_SLOT(slotAddInProgress(KProcess*, char*, int))); + connect( kp, TQT_SIGNAL(receivedStderr(KProcess*, char*, int)), + this, TQT_SLOT(slotReceivedOutput(KProcess*, char*, int))); + connect( kp, TQT_SIGNAL(processExited(KProcess*)), this, + TQT_SLOT(slotAddDone(KProcess*))); - int f_desc = KDE_open(QFile::encodeName(m_filename), O_CREAT | O_TRUNC | O_WRONLY, 0666); + int f_desc = KDE_open(TQFile::encodeName(m_filename), O_CREAT | O_TRUNC | O_WRONLY, 0666); if (f_desc != -1) fd = fdopen( f_desc, "w" ); else @@ -340,7 +340,7 @@ void CompressedFile::unarchFileInternal() { if (m_destDir != m_tmpdir) { - QString dest; + TQString dest; if (m_destDir.isEmpty() || m_destDir.isNull()) { kdError(1601) << "There was no extract directory given." << endl; @@ -356,14 +356,14 @@ void CompressedFile::unarchFileInternal() emit sigExtract(true); } -void CompressedFile::remove(QStringList *) +void CompressedFile::remove(TQStringList *) { kdDebug(1601) << "+CompressedFile::remove" << endl; - QFile::remove(m_tmpfile); + TQFile::remove(m_tmpfile); // do not delete but truncate the compressed file in case someone // does a reload and finds it no longer exists! - truncate(QFile::encodeName(m_filename), 0); + truncate(TQFile::encodeName(m_filename), 0); m_tmpfile = ""; emit sigDelete(true); diff --git a/ark/compressedfile.h b/ark/compressedfile.h index ceaee6c..9840923 100644 --- a/ark/compressedfile.h +++ b/ark/compressedfile.h @@ -45,19 +45,19 @@ class CompressedFile : public Arch { Q_OBJECT public: - CompressedFile( ArkWidget *_gui, const QString & _fileName, const QString &_openAsMimeType ); + CompressedFile( ArkWidget *_gui, const TQString & _fileName, const TQString &_openAsMimeType ); virtual ~CompressedFile(); virtual void open(); virtual void create(); - virtual void addFile( const QStringList& ); - virtual void addDir(const QString &) { } + virtual void addFile( const TQStringList& ); + virtual void addDir(const TQString &) { } - virtual void remove(QStringList *); + virtual void remove(TQStringList *); virtual void unarchFileInternal(); - QString tempFileName(){ return m_tmpfile; } + TQString tempFileName(){ return m_tmpfile; } private slots: void slotUncompressDone(KProcess *); @@ -68,13 +68,13 @@ private: void initExtract( bool, bool, bool ); void setHeaders(); void initData(); - QString extension(); + TQString extension(); - QString m_openAsMimeType; + TQString m_openAsMimeType; KTempDir * m_tempDirectory; - QString m_tmpdir; - QString m_tmpfile; - QStringList m_defaultExtensions; + TQString m_tmpdir; + TQString m_tmpfile; + TQStringList m_defaultExtensions; // for use with addFile FILE *fd; diff --git a/ark/extractiondialog.cpp b/ark/extractiondialog.cpp index 7892efb..cf95d48 100644 --- a/ark/extractiondialog.cpp +++ b/ark/extractiondialog.cpp @@ -29,12 +29,12 @@ #include "extractiondialog.h" -#include <qvbox.h> -#include <qhbox.h> -#include <qhbuttongroup.h> -#include <qlabel.h> -#include <qradiobutton.h> -#include <qlayout.h> +#include <tqvbox.h> +#include <tqhbox.h> +#include <tqhbuttongroup.h> +#include <tqlabel.h> +#include <tqradiobutton.h> +#include <tqlayout.h> #include <klocale.h> #include <kglobal.h> @@ -51,11 +51,11 @@ #include "arkutils.h" #include "settings.h" -ExtractionDialog::ExtractionDialog( QWidget *parent, const char *name, +ExtractionDialog::ExtractionDialog( TQWidget *parent, const char *name, bool enableSelected, const KURL& defaultExtractionDir, - const QString &prefix, - const QString &archiveName ) + const TQString &prefix, + const TQString &archiveName ) : KDialogBase( parent, name, true, i18n( "Extract" ), Ok | Cancel, Ok ), m_selectedButton( 0 ), m_allButton( 0 ), m_selectedOnly( enableSelected ), m_extractionDirectory( defaultExtractionDir ), @@ -66,37 +66,37 @@ ExtractionDialog::ExtractionDialog( QWidget *parent, const char *name, setCaption( i18n( "Extract Files From %1" ).arg( archiveName ) ); } - QVBox *vbox = makeVBoxMainWidget(); + TQVBox *vbox = makeVBoxMainWidget(); - QHBox *header = new QHBox( vbox ); + TQHBox *header = new TQHBox( vbox ); header->layout()->setSpacing( 10 ); - QLabel *icon = new QLabel( header ); + TQLabel *icon = new TQLabel( header ); icon->setPixmap( DesktopIcon( "ark_extract" ) ); - icon->setSizePolicy( QSizePolicy::Fixed, QSizePolicy::Minimum ); + icon->setSizePolicy( TQSizePolicy::Fixed, TQSizePolicy::Minimum ); if ( enableSelected ) { - QVBox *whichFiles = new QVBox( header ); + TQVBox *whichFiles = new TQVBox( header ); whichFiles->layout()->setSpacing( 6 ); - new QLabel( QString( "<qt><b><font size=\"+1\">%1</font></b></qt>" ) + new TQLabel( TQString( "<qt><b><font size=\"+1\">%1</font></b></qt>" ) .arg( i18n( "Extract:" ) ), whichFiles ); - QHButtonGroup *filesGroup = new QHButtonGroup( whichFiles ); - m_selectedButton = new QRadioButton( i18n( "Selected files only" ), filesGroup ); - m_allButton = new QRadioButton( i18n( "All files" ), filesGroup ); + TQHButtonGroup *filesGroup = new TQHButtonGroup( whichFiles ); + m_selectedButton = new TQRadioButton( i18n( "Selected files only" ), filesGroup ); + m_allButton = new TQRadioButton( i18n( "All files" ), filesGroup ); m_selectedButton->setChecked( true ); } else { - new QLabel( QString( "<qt><b><font size=\"+2\">%1</font></b></qt>" ) + new TQLabel( TQString( "<qt><b><font size=\"+2\">%1</font></b></qt>" ) .arg( i18n( "Extract all files" ) ), header ); } - QHBox *destDirBox = new QHBox( vbox ); + TQHBox *destDirBox = new TQHBox( vbox ); - QLabel *destFolderLabel = new QLabel( i18n( "Destination folder: " ), destDirBox ); - destFolderLabel->setSizePolicy( QSizePolicy::Minimum, QSizePolicy::Fixed ); + TQLabel *destFolderLabel = new TQLabel( i18n( "Destination folder: " ), destDirBox ); + destFolderLabel->setSizePolicy( TQSizePolicy::Minimum, TQSizePolicy::Fixed ); KHistoryCombo *combobox = new KHistoryCombo( true, destDirBox ); combobox->setPixmapProvider( new KURLPixmapProvider ); @@ -108,10 +108,10 @@ ExtractionDialog::ExtractionDialog( QWidget *parent, const char *name, comp->setCompletionMode( KGlobalSettings::CompletionAuto ); combobox->setCompletionObject( comp ); combobox->setMaxCount( 20 ); - combobox->setInsertionPolicy( QComboBox::AtTop ); + combobox->setInsertionPolicy( TQComboBox::AtTop ); m_urlRequester = new KURLRequester( combobox, destDirBox ); - m_urlRequester->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ); + m_urlRequester->setSizePolicy( TQSizePolicy::Expanding, TQSizePolicy::Fixed ); m_urlRequester->setMode( KFile::Directory ); if (!defaultExtractionDir.prettyURL().isEmpty() ) @@ -119,12 +119,12 @@ ExtractionDialog::ExtractionDialog( QWidget *parent, const char *name, m_urlRequester->setKURL( defaultExtractionDir.prettyURL() + prefix ); } - m_viewFolderAfterExtraction = new QCheckBox( i18n( "Open destination folder after extraction" ), vbox ); + m_viewFolderAfterExtraction = new TQCheckBox( i18n( "Open destination folder after extraction" ), vbox ); m_viewFolderAfterExtraction->setChecked( ArkSettings::openDestinationFolder() ); - connect( combobox, SIGNAL( returnPressed( const QString& ) ), combobox, SLOT( addToHistory( const QString& ) ) ); - connect( combobox->lineEdit(), SIGNAL( textChanged( const QString& ) ), - this, SLOT( extractDirChanged( const QString & ) ) ); + connect( combobox, TQT_SIGNAL( returnPressed( const TQString& ) ), combobox, TQT_SLOT( addToHistory( const TQString& ) ) ); + connect( combobox->lineEdit(), TQT_SIGNAL( textChanged( const TQString& ) ), + this, TQT_SLOT( extractDirChanged( const TQString & ) ) ); } ExtractionDialog::~ExtractionDialog() @@ -142,10 +142,10 @@ void ExtractionDialog::accept() //if p isn't local KIO and friends will complain later on if ( p.isLocalFile() ) { - QFileInfo fi( p.path() ); + TQFileInfo fi( p.path() ); if ( !fi.isDir() && !fi.exists() ) { - QString ltext = i18n( "Create folder %1?").arg(p.path()); + TQString ltext = i18n( "Create folder %1?").arg(p.path()); int createDir = KMessageBox::questionYesNo( this, ltext, i18n( "Missing Folder" ) , i18n("Create Folder"), i18n("Do Not Create")); if( createDir == 4 ) { @@ -170,7 +170,7 @@ void ExtractionDialog::accept() m_selectedOnly = m_selectedButton == 0? false : m_selectedButton->isChecked(); // Determine what exactly should be added to the extraction combo list - QString historyURL = p.prettyURL(); + TQString historyURL = p.prettyURL(); if ( historyURL == KURL( m_defaultExtractionDir + m_prefix ).prettyURL() ) { historyURL = m_defaultExtractionDir; @@ -186,7 +186,7 @@ void ExtractionDialog::accept() KDialogBase::accept(); } -void ExtractionDialog::extractDirChanged(const QString &text ) +void ExtractionDialog::extractDirChanged(const TQString &text ) { enableButtonOK(!text.isEmpty()); } diff --git a/ark/extractiondialog.h b/ark/extractiondialog.h index 822c085..b0619b1 100644 --- a/ark/extractiondialog.h +++ b/ark/extractiondialog.h @@ -29,7 +29,7 @@ #ifndef EXTRACTIONDIALOG_H #define EXTRACTIONDIALOG_H -#include <qcheckbox.h> +#include <tqcheckbox.h> #include <kurl.h> #include <kdialogbase.h> @@ -45,11 +45,11 @@ class ExtractionDialog : public KDialogBase /** * Constructor. */ - ExtractionDialog( QWidget *parent = 0, const char *name = 0, + ExtractionDialog( TQWidget *parent = 0, const char *name = 0, bool enableSelected = true, const KURL &defaultExtractionDir = KURL(), - const QString &prefix = QString(), - const QString &archiveName = QString::null ); + const TQString &prefix = TQString(), + const TQString &archiveName = TQString::null ); /** * Destructor. @@ -77,19 +77,19 @@ class ExtractionDialog : public KDialogBase public slots: void accept(); - void extractDirChanged( const QString & ); + void extractDirChanged( const TQString & ); private: - QRadioButton *m_selectedButton; - QRadioButton *m_allButton; - QCheckBox *m_viewFolderAfterExtraction; + TQRadioButton *m_selectedButton; + TQRadioButton *m_allButton; + TQCheckBox *m_viewFolderAfterExtraction; bool m_selectedOnly; KURL m_extractionDirectory; KURLRequester *m_urlRequester; - QString m_defaultExtractionDir; - QString m_prefix; + TQString m_defaultExtractionDir; + TQString m_prefix; }; #endif // EXTRACTIONDIALOG_H diff --git a/ark/filelistview.cpp b/ark/filelistview.cpp index 3668d11..165b128 100644 --- a/ark/filelistview.cpp +++ b/ark/filelistview.cpp @@ -27,9 +27,9 @@ */ // Qt includes -#include <qpainter.h> -#include <qwhatsthis.h> -#include <qheader.h> +#include <tqpainter.h> +#include <tqwhatsthis.h> +#include <tqheader.h> // KDE includes #include <klocale.h> @@ -47,26 +47,26 @@ FileLVI::FileLVI( KListView* lv ) : KListViewItem( lv ), m_fileSize( 0 ), m_packedFileSize( 0 ), - m_ratio( 0 ), m_timeStamp( QDateTime() ), m_entryName( QString() ) + m_ratio( 0 ), m_timeStamp( TQDateTime() ), m_entryName( TQString() ) { } FileLVI::FileLVI( KListViewItem* lvi ) : KListViewItem( lvi ), m_fileSize( 0 ), m_packedFileSize( 0 ), - m_ratio( 0 ), m_timeStamp( QDateTime() ), m_entryName( QString() ) + m_ratio( 0 ), m_timeStamp( TQDateTime() ), m_entryName( TQString() ) { } -QString FileLVI::key( int column, bool ascending ) const +TQString FileLVI::key( int column, bool ascending ) const { if ( column == 0 ) return fileName(); else - return QListViewItem::key( column, ascending ); + return TQListViewItem::key( column, ascending ); } -int FileLVI::compare( QListViewItem * i, int column, bool ascending ) const +int FileLVI::compare( TQListViewItem * i, int column, bool ascending ) const { FileLVI * item = static_cast< FileLVI * >( i ); @@ -119,12 +119,12 @@ int FileLVI::compare( QListViewItem * i, int column, bool ascending ) const } } -void FileLVI::setText( int column, const QString &text ) +void FileLVI::setText( int column, const TQString &text ) { columnName colName = ( static_cast< FileListView * > ( listView() ) )->nameOfColumn( column ); if ( column == 0 ) { - QString name = text; + TQString name = text; if ( name.endsWith( "/" ) ) name = name.left( name.length() - 1 ); if ( name.startsWith( "/" ) ) @@ -132,18 +132,18 @@ void FileLVI::setText( int column, const QString &text ) int pos = name.findRev( '/' ); if ( pos != -1 ) name = name.right( name.length() - pos - 1 ); - QListViewItem::setText( column, name ); + TQListViewItem::setText( column, name ); m_entryName = text; } else if ( colName == sizeCol ) { m_fileSize = text.toULongLong(); - QListViewItem::setText( column, KIO::convertSize( m_fileSize ) ); + TQListViewItem::setText( column, KIO::convertSize( m_fileSize ) ); } else if ( colName == packedStrCol ) { m_packedFileSize = text.toULongLong(); - QListViewItem::setText( column, KIO::convertSize( m_packedFileSize ) ); + TQListViewItem::setText( column, KIO::convertSize( m_packedFileSize ) ); } else if ( colName == ratioStrCol ) { @@ -152,25 +152,25 @@ void FileLVI::setText( int column, const QString &text ) m_ratio = text.left(l).toDouble(); else m_ratio = text.toDouble(); - QListViewItem::setText( column, i18n( "Packed Ratio", "%1 %" ) + TQListViewItem::setText( column, i18n( "Packed Ratio", "%1 %" ) .arg(KGlobal::locale()->formatNumber( m_ratio, 1 ) ) ); } else if ( colName == timeStampStrCol ) { if ( text.isEmpty() ) - QListViewItem::setText(column, text); + TQListViewItem::setText(column, text); else { - m_timeStamp = QDateTime::fromString( text, ISODate ); - QListViewItem::setText( column, KGlobal::locale()->formatDateTime( m_timeStamp ) ); + m_timeStamp = TQDateTime::fromString( text, ISODate ); + TQListViewItem::setText( column, KGlobal::locale()->formatDateTime( m_timeStamp ) ); } } else - QListViewItem::setText(column, text); + TQListViewItem::setText(column, text); } -static FileLVI* folderLVI( KListViewItem *parent, const QString& name ) +static FileLVI* folderLVI( KListViewItem *parent, const TQString& name ) { FileLVI *folder = new FileLVI( parent ); @@ -181,7 +181,7 @@ static FileLVI* folderLVI( KListViewItem *parent, const QString& name ) return folder; } -static FileLVI* folderLVI( KListView *parent, const QString& name ) +static FileLVI* folderLVI( KListView *parent, const TQString& name ) { FileLVI *folder = new FileLVI( parent ); folder->setText( 0, name ); @@ -194,10 +194,10 @@ static FileLVI* folderLVI( KListView *parent, const QString& name ) ///////////////////////////////////////////////////////////////////// -FileListView::FileListView(QWidget *parent, const char* name) +FileListView::FileListView(TQWidget *parent, const char* name) : KListView(parent, name) { - QWhatsThis::add( this, + TQWhatsThis::add( this, i18n( "This area is for displaying information about the files contained within an archive." ) ); @@ -212,7 +212,7 @@ FileListView::FileListView(QWidget *parent, const char* name) m_pressed = false; } -int FileListView::addColumn ( const QString & label, int width ) +int FileListView::addColumn ( const TQString & label, int width ) { int index = KListView::addColumn( label, width ); if ( label == SIZE_COLUMN.first ) @@ -254,9 +254,9 @@ columnName FileListView::nameOfColumn( int index ) return m_columnMap[ index ]; } -QStringList FileListView::selectedFilenames() +TQStringList FileListView::selectedFilenames() { - QStringList files; + TQStringList files; FileLVI *item = static_cast<FileLVI*>( firstChild() ); @@ -299,11 +299,11 @@ QStringList FileListView::selectedFilenames() return files; } -QStringList FileListView::fileNames() +TQStringList FileListView::fileNames() { - QStringList files; + TQStringList files; - QListViewItemIterator it( this ); + TQListViewItemIterator it( this ); while ( it.current() ) { FileLVI *item = static_cast<FileLVI*>( it.current() ); @@ -329,9 +329,9 @@ bool FileListView::isSelectionEmpty() } void -FileListView::contentsMousePressEvent(QMouseEvent *e) +FileListView::contentsMousePressEvent(TQMouseEvent *e) { - if( e->button()==QMouseEvent::LeftButton ) + if( e->button()==TQMouseEvent::LeftButton ) { m_pressed = true; m_presspos = e->pos(); @@ -341,14 +341,14 @@ FileListView::contentsMousePressEvent(QMouseEvent *e) } void -FileListView::contentsMouseReleaseEvent(QMouseEvent *e) +FileListView::contentsMouseReleaseEvent(TQMouseEvent *e) { m_pressed = false; KListView::contentsMouseReleaseEvent(e); } void -FileListView::contentsMouseMoveEvent(QMouseEvent *e) +FileListView::contentsMouseMoveEvent(TQMouseEvent *e) { if(!m_pressed) { @@ -361,20 +361,20 @@ FileListView::contentsMouseMoveEvent(QMouseEvent *e) { return; } - QStringList dragFiles = selectedFilenames(); + TQStringList dragFiles = selectedFilenames(); emit startDragRequest( dragFiles ); KListView::contentsMouseMoveEvent(e); } } FileLVI* -FileListView::item(const QString& filename) const +FileListView::item(const TQString& filename) const { FileLVI * flvi = (FileLVI*) firstChild(); while (flvi) { - QString curFilename = flvi->fileName(); + TQString curFilename = flvi->fileName(); if (curFilename == filename) return flvi; flvi = (FileLVI*) flvi->nextSibling(); @@ -383,7 +383,7 @@ FileListView::item(const QString& filename) const return 0; } -void FileListView::addItem( const QStringList & entries ) +void FileListView::addItem( const TQStringList & entries ) { FileLVI *flvi, *parent = findParent( entries[0] ); if ( parent ) @@ -394,7 +394,7 @@ void FileListView::addItem( const QStringList & entries ) int i = 0; - for (QStringList::ConstIterator it = entries.begin(); it != entries.end(); ++it) + for (TQStringList::ConstIterator it = entries.begin(); it != entries.end(); ++it) { flvi->setText(i, *it); ++i; @@ -406,12 +406,12 @@ void FileListView::addItem( const QStringList & entries ) void FileListView::selectAll() { - QListView::selectAll( true ); + TQListView::selectAll( true ); } void FileListView::unselectAll() { - QListView::selectAll( false ); + TQListView::selectAll( false ); } void FileListView::setHeaders( const ColumnList& columns ) @@ -422,12 +422,12 @@ void FileListView::setHeaders( const ColumnList& columns ) it != columns.constEnd(); ++it ) { - QPair< QString, Qt::AlignmentFlags > pair = *it; + QPair< TQString, Qt::AlignmentFlags > pair = *it; int colnum = addColumn( pair.first ); setColumnAlignment( colnum, pair.second ); } - setResizeMode( QListView::LastColumn ); + setResizeMode( TQListView::LastColumn ); header()->show(); } @@ -445,7 +445,7 @@ int FileListView::totalFiles() { int numFiles = 0; - QListViewItemIterator it( this ); + TQListViewItemIterator it( this ); while ( it.current() ) { if ( it.current()->childCount() == 0 ) @@ -460,7 +460,7 @@ int FileListView::selectedFilesCount() { int numFiles = 0; - QListViewItemIterator it( this, QListViewItemIterator::Selected ); + TQListViewItemIterator it( this, TQListViewItemIterator::Selected ); while ( it.current() ) { ++numFiles; @@ -474,7 +474,7 @@ KIO::filesize_t FileListView::totalSize() { KIO::filesize_t size = 0; - QListViewItemIterator it(this); + TQListViewItemIterator it(this); while ( it.current() ) { FileLVI *item = static_cast<FileLVI*>( it.current() ); @@ -489,7 +489,7 @@ KIO::filesize_t FileListView::selectedSize() { KIO::filesize_t size = 0; - QListViewItemIterator it( this, QListViewItemIterator::Selected ); + TQListViewItemIterator it( this, TQListViewItemIterator::Selected ); while ( it.current() ) { FileLVI *item = static_cast<FileLVI*>( it.current() ); @@ -500,9 +500,9 @@ KIO::filesize_t FileListView::selectedSize() return size; } -FileLVI* FileListView::findParent( const QString& fullname ) +FileLVI* FileListView::findParent( const TQString& fullname ) { - QString name = fullname; + TQString name = fullname; if ( name.endsWith( "/" ) ) name = name.left( name.length() -1 ); @@ -513,11 +513,11 @@ FileLVI* FileListView::findParent( const QString& fullname ) return static_cast< FileLVI* >( 0 ); // Get a list of ancestors - QString parentFullname = name.left( name.findRev( '/' ) ); - QStringList ancestorList = QStringList::split( '/', parentFullname ); + TQString parentFullname = name.left( name.findRev( '/' ) ); + TQStringList ancestorList = TQStringList::split( '/', parentFullname ); // Checks if the listview contains the first item in the list of ancestors - QListViewItem *item = firstChild(); + TQListViewItem *item = firstChild(); while ( item ) { if ( item->text( 0 ) == ancestorList[0] ) @@ -536,7 +536,7 @@ FileLVI* FileListView::findParent( const QString& fullname ) while ( ancestorList.count() > 0 ) { - QString name = ancestorList[0]; + TQString name = ancestorList[0]; FileLVI *parent = static_cast< FileLVI*>( item ); item = parent->firstChild(); @@ -559,10 +559,10 @@ FileLVI* FileListView::findParent( const QString& fullname ) return static_cast< FileLVI* >( item ); } -QStringList FileListView::childrenOf( FileLVI* parent ) +TQStringList FileListView::childrenOf( FileLVI* parent ) { Q_ASSERT( parent ); - QStringList children; + TQStringList children; FileLVI *item = static_cast<FileLVI*>( parent->firstChild() ); diff --git a/ark/filelistview.h b/ark/filelistview.h index 8ea0d48..1de8b7e 100644 --- a/ark/filelistview.h +++ b/ark/filelistview.h @@ -28,9 +28,9 @@ #ifndef FILELISTVIEW_H #define FILELISTVIEW_H -#include <qdatetime.h> -#include <qpair.h> -#include <qvaluelist.h> +#include <tqdatetime.h> +#include <tqpair.h> +#include <tqvaluelist.h> #include <klistview.h> #include <kio/global.h> @@ -51,50 +51,50 @@ class FileLVI : public KListViewItem FileLVI( KListView* lv ); FileLVI( KListViewItem* lvi ); - QString fileName() const { return m_entryName; } + TQString fileName() const { return m_entryName; } KIO::filesize_t fileSize() const { return m_fileSize; } KIO::filesize_t packedFileSize() const { return m_packedFileSize; } double ratio() const { return m_ratio; } - QDateTime timeStamp() const { return m_timeStamp; } + TQDateTime timeStamp() const { return m_timeStamp; } - int compare ( QListViewItem * i, int col, bool ascending ) const; - virtual QString key( int column, bool ) const; - virtual void setText( int column, const QString &text ); + int compare ( TQListViewItem * i, int col, bool ascending ) const; + virtual TQString key( int column, bool ) const; + virtual void setText( int column, const TQString &text ); private: KIO::filesize_t m_fileSize; KIO::filesize_t m_packedFileSize; double m_ratio; - QDateTime m_timeStamp; - QString m_entryName; + TQDateTime m_timeStamp; + TQString m_entryName; }; -typedef QValueList< QPair< QString, Qt::AlignmentFlags > > ColumnList; +typedef TQValueList< QPair< TQString, Qt::AlignmentFlags > > ColumnList; class FileListView: public KListView { Q_OBJECT public: - FileListView( QWidget *parent = 0, const char* name = 0 ); + FileListView( TQWidget *parent = 0, const char* name = 0 ); FileLVI *currentItem() {return ((FileLVI *) KListView::currentItem());} /** * Returns the full names of the selected files. */ - QStringList selectedFilenames(); + TQStringList selectedFilenames(); /** * Return the full names of all files. */ - QStringList fileNames(); + TQStringList fileNames(); /** * Returns true if no file is selected */ bool isSelectionEmpty(); - virtual int addColumn( const QString & label, int width = -1 ); + virtual int addColumn( const TQString & label, int width = -1 ); virtual void removeColumn( int index ); columnName nameOfColumn( int index ); @@ -103,13 +103,13 @@ class FileListView: public KListView * @param filename The filename in question to reference in the archive * @return The requested file's FileLVI */ - FileLVI* item(const QString& filename) const; + FileLVI* item(const TQString& filename) const; /** * Adds a file and stats to the file listing * @param entries A stringlist of the entries for each column of the list. */ - void addItem( const QStringList & entries ); + void addItem( const TQStringList & entries ); /** * Returns the number of files in the archive. @@ -143,20 +143,20 @@ class FileListView: public KListView void clearHeaders(); signals: - void startDragRequest( const QStringList & fileList ); + void startDragRequest( const TQStringList & fileList ); protected: - virtual void contentsMouseReleaseEvent( QMouseEvent *e ); - virtual void contentsMousePressEvent( QMouseEvent *e ); - virtual void contentsMouseMoveEvent( QMouseEvent *e ); + virtual void contentsMouseReleaseEvent( TQMouseEvent *e ); + virtual void contentsMousePressEvent( TQMouseEvent *e ); + virtual void contentsMouseMoveEvent( TQMouseEvent *e ); private: - FileLVI* findParent( const QString& fullname ); - QStringList childrenOf( FileLVI* parent ); + FileLVI* findParent( const TQString& fullname ); + TQStringList childrenOf( FileLVI* parent ); - QMap<int, columnName> m_columnMap; + TQMap<int, columnName> m_columnMap; bool m_pressed; - QPoint m_presspos; // this will save the click pos to correctly recognize drag events + TQPoint m_presspos; // this will save the click pos to correctly recognize drag events }; #endif diff --git a/ark/lha.cpp b/ark/lha.cpp index f890139..1bf3aac 100644 --- a/ark/lha.cpp +++ b/ark/lha.cpp @@ -35,8 +35,8 @@ #include <string.h> // QT includes -#include <qfile.h> -#include <qdir.h> +#include <tqfile.h> +#include <tqdir.h> // KDE includes #include <kdebug.h> @@ -52,7 +52,7 @@ #include "arkutils.h" #include "filelistview.h" -LhaArch::LhaArch( ArkWidget *_gui, const QString & _fileName ) +LhaArch::LhaArch( ArkWidget *_gui, const TQString & _fileName ) : Arch( _gui, _fileName ) { m_archiver_program = "lha"; @@ -61,7 +61,7 @@ LhaArch::LhaArch( ArkWidget *_gui, const QString & _fileName ) m_headerString = "----"; } -bool LhaArch::processLine( const QCString &line ) +bool LhaArch::processLine( const TQCString &line ) { const char *_line = ( const char * ) line; char columns[13][80]; @@ -95,13 +95,13 @@ bool LhaArch::processLine( const QCString &line ) } // make the time stamp sortable - QString massagedTimeStamp = ArkUtils::getTimeStamp( columns[6], columns[7], + TQString massagedTimeStamp = ArkUtils::getTimeStamp( columns[6], columns[7], columns[8] ); strlcpy( columns[6], massagedTimeStamp.ascii(), sizeof( columns[6] ) ); // see if there was a link in filename - QString file = filename; - QString name, link; + TQString file = filename; + TQString name, link; bool bLink = false; int pos = file.find( " -> " ); if ( pos != -1 ) @@ -115,12 +115,12 @@ bool LhaArch::processLine( const QCString &line ) name = file; } - QStringList list; + TQStringList list; list.append( name ); for ( int i = 0; i < 7; i++ ) { - list.append( QString::fromLocal8Bit( columns[i] ) ); + list.append( TQString::fromLocal8Bit( columns[i] ) ); } if ( bLink ) @@ -144,17 +144,17 @@ void LhaArch::open() KProcess *kp = m_currentProcess = new KProcess; *kp << m_archiver_program << "v" << m_filename; - connect( kp, SIGNAL( receivedStdout(KProcess*, char*, int) ), - SLOT( slotReceivedTOC(KProcess*, char*, int) ) ); - connect( kp, SIGNAL( receivedStderr(KProcess*, char*, int) ), - SLOT( slotReceivedOutput(KProcess*, char*, int) ) ); - connect( kp, SIGNAL( processExited(KProcess*) ), - SLOT( slotOpenExited(KProcess*) ) ); + connect( kp, TQT_SIGNAL( receivedStdout(KProcess*, char*, int) ), + TQT_SLOT( slotReceivedTOC(KProcess*, char*, int) ) ); + connect( kp, TQT_SIGNAL( receivedStderr(KProcess*, char*, int) ), + TQT_SLOT( slotReceivedOutput(KProcess*, char*, int) ) ); + connect( kp, TQT_SIGNAL( processExited(KProcess*) ), + TQT_SLOT( slotOpenExited(KProcess*) ) ); if ( !kp->start( KProcess::NotifyOnExit, KProcess::AllOutput ) ) { KMessageBox::error( 0, i18n( "Could not start a subprocess." ) ); - emit sigOpen( this, false, QString::null, 0 ); + emit sigOpen( this, false, TQString::null, 0 ); } } @@ -180,23 +180,23 @@ void LhaArch::create() Arch::Extract | Arch::Delete | Arch::Add | Arch::View ); } -void LhaArch::addDir( const QString & dirName ) +void LhaArch::addDir( const TQString & dirName ) { if ( !dirName.isEmpty() ) { - QStringList list; + TQStringList list; list.append( dirName ); addFile( list ); } } -void LhaArch::addFile( const QStringList &urls ) +void LhaArch::addFile( const TQStringList &urls ) { KProcess *kp = m_currentProcess = new KProcess; kp->clearArguments(); *kp << m_archiver_program; - QString strOptions; + TQString strOptions; if ( ArkSettings::replaceOnlyWithNewer() ) strOptions = "u"; else @@ -205,21 +205,21 @@ void LhaArch::addFile( const QStringList &urls ) *kp << strOptions << m_filename; KURL url( urls.first() ); - QDir::setCurrent( url.directory() ); + TQDir::setCurrent( url.directory() ); - QStringList::ConstIterator iter; + TQStringList::ConstIterator iter; for ( iter = urls.begin(); iter != urls.end(); ++iter ) { KURL fileURL( *iter ); *kp << fileURL.fileName(); } - connect( kp, SIGNAL( receivedStdout(KProcess*, char*, int) ), - SLOT( slotReceivedOutput(KProcess*, char*, int) ) ); - connect( kp, SIGNAL( receivedStderr(KProcess*, char*, int) ), - SLOT( slotReceivedOutput(KProcess*, char*, int) ) ); - connect( kp, SIGNAL( processExited(KProcess*) ), - SLOT( slotAddExited(KProcess*) ) ); + connect( kp, TQT_SIGNAL( receivedStdout(KProcess*, char*, int) ), + TQT_SLOT( slotReceivedOutput(KProcess*, char*, int) ) ); + connect( kp, TQT_SIGNAL( receivedStderr(KProcess*, char*, int) ), + TQT_SLOT( slotReceivedOutput(KProcess*, char*, int) ) ); + connect( kp, TQT_SIGNAL( processExited(KProcess*) ), + TQT_SLOT( slotAddExited(KProcess*) ) ); if ( !kp->start( KProcess::NotifyOnExit, KProcess::AllOutput ) ) { @@ -248,19 +248,19 @@ void LhaArch::unarchFileInternal() // and we then extract everything in the archive. if ( m_fileList ) { - QStringList::Iterator it; + TQStringList::Iterator it; for ( it = m_fileList->begin(); it != m_fileList->end(); ++it ) { *kp << ( *it ); } } - connect( kp, SIGNAL( receivedStdout(KProcess*, char*, int) ), - SLOT( slotReceivedOutput(KProcess*, char*, int) ) ); - connect( kp, SIGNAL( receivedStderr(KProcess*, char*, int) ), - SLOT( slotReceivedOutput(KProcess*, char*, int) ) ); - connect( kp, SIGNAL( processExited(KProcess*) ), - SLOT( slotExtractExited(KProcess*) ) ); + connect( kp, TQT_SIGNAL( receivedStdout(KProcess*, char*, int) ), + TQT_SLOT( slotReceivedOutput(KProcess*, char*, int) ) ); + connect( kp, TQT_SIGNAL( receivedStderr(KProcess*, char*, int) ), + TQT_SLOT( slotReceivedOutput(KProcess*, char*, int) ) ); + connect( kp, TQT_SIGNAL( processExited(KProcess*) ), + TQT_SLOT( slotExtractExited(KProcess*) ) ); if ( !kp->start( KProcess::NotifyOnExit, KProcess::AllOutput ) ) { @@ -269,7 +269,7 @@ void LhaArch::unarchFileInternal() } } -void LhaArch::remove( QStringList *list ) +void LhaArch::remove( TQStringList *list ) { if ( !list ) return; @@ -279,18 +279,18 @@ void LhaArch::remove( QStringList *list ) *kp << m_archiver_program << "df" << m_filename; - QStringList::Iterator it; + TQStringList::Iterator it; for ( it = list->begin(); it != list->end(); ++it ) { *kp << ( *it ); } - connect( kp, SIGNAL( receivedStdout(KProcess*, char*, int) ), - SLOT( slotReceivedOutput(KProcess*, char*, int) ) ); - connect( kp, SIGNAL( receivedStderr(KProcess*, char*, int) ), - SLOT( slotReceivedOutput(KProcess*, char*, int) ) ); - connect( kp, SIGNAL( processExited(KProcess*) ), - SLOT( slotDeleteExited(KProcess*) ) ); + connect( kp, TQT_SIGNAL( receivedStdout(KProcess*, char*, int) ), + TQT_SLOT( slotReceivedOutput(KProcess*, char*, int) ) ); + connect( kp, TQT_SIGNAL( receivedStderr(KProcess*, char*, int) ), + TQT_SLOT( slotReceivedOutput(KProcess*, char*, int) ) ); + connect( kp, TQT_SIGNAL( processExited(KProcess*) ), + TQT_SLOT( slotDeleteExited(KProcess*) ) ); if ( !kp->start( KProcess::NotifyOnExit, KProcess::AllOutput ) ) { @@ -39,20 +39,20 @@ class LhaArch : public Arch { Q_OBJECT public: - LhaArch( ArkWidget *, const QString & ); + LhaArch( ArkWidget *, const TQString & ); virtual ~LhaArch() { } virtual void open(); virtual void create(); - virtual void addFile( const QStringList & ); - virtual void addDir( const QString & ); + virtual void addFile( const TQStringList & ); + virtual void addDir( const TQString & ); - virtual void remove( QStringList * ); + virtual void remove( TQStringList * ); virtual void unarchFileInternal(); protected slots: - virtual bool processLine( const QCString &line ); + virtual bool processLine( const TQCString &line ); private: void setHeaders(); diff --git a/ark/mainwindow.cpp b/ark/mainwindow.cpp index b62422c..5866d18 100644 --- a/ark/mainwindow.cpp +++ b/ark/mainwindow.cpp @@ -22,7 +22,7 @@ */ // QT includes -#include <qlayout.h> +#include <tqlayout.h> // KDE includes #include <kdebug.h> @@ -45,7 +45,7 @@ #include "archiveformatinfo.h" #include "arkwidget.h" -MainWindow::MainWindow( QWidget * /*parent*/, const char *name ) +MainWindow::MainWindow( TQWidget * /*parent*/, const char *name ) : KParts::MainWindow(), progressDialog( 0 ) { setXMLFile( "arkui.rc" ); @@ -58,29 +58,29 @@ MainWindow::MainWindow( QWidget * /*parent*/, const char *name ) setStandardToolBarMenuEnabled( true ); setupActions(); - connect( m_part->widget(), SIGNAL( request_file_quit() ), this, SLOT( file_quit() ) ); - connect( KParts::BrowserExtension::childObject( m_part ), SIGNAL( openURLRequestDelayed + connect( m_part->widget(), TQT_SIGNAL( request_file_quit() ), this, TQT_SLOT( file_quit() ) ); + connect( KParts::BrowserExtension::childObject( m_part ), TQT_SIGNAL( openURLRequestDelayed ( const KURL &, const KParts::URLArgs & ) ), - m_part, SLOT( openURL( const KURL & ) ) ); + m_part, TQT_SLOT( openURL( const KURL & ) ) ); m_widget->setArchivePopupEnabled( true ); - connect( m_part->widget(), SIGNAL( signalArchivePopup( const QPoint & ) ), this, - SLOT( slotArchivePopup( const QPoint & ) ) ); - - connect( m_part, SIGNAL( removeRecentURL( const KURL & ) ), this, - SLOT( slotRemoveRecentURL( const KURL & ) ) ); - connect( m_part, SIGNAL( addRecentURL( const KURL & ) ), this, - SLOT( slotAddRecentURL( const KURL & ) ) ); - connect( m_part, SIGNAL( fixActionState( const bool & ) ), this, - SLOT( slotFixActionState( const bool & ) ) ); - connect( m_widget, SIGNAL( disableAllActions() ), this, - SLOT( slotDisableActions() ) ); + connect( m_part->widget(), TQT_SIGNAL( signalArchivePopup( const TQPoint & ) ), this, + TQT_SLOT( slotArchivePopup( const TQPoint & ) ) ); + + connect( m_part, TQT_SIGNAL( removeRecentURL( const KURL & ) ), this, + TQT_SLOT( slotRemoveRecentURL( const KURL & ) ) ); + connect( m_part, TQT_SIGNAL( addRecentURL( const KURL & ) ), this, + TQT_SLOT( slotAddRecentURL( const KURL & ) ) ); + connect( m_part, TQT_SIGNAL( fixActionState( const bool & ) ), this, + TQT_SLOT( slotFixActionState( const bool & ) ) ); + connect( m_widget, TQT_SIGNAL( disableAllActions() ), this, + TQT_SLOT( slotDisableActions() ) ); ArkApplication::getInstance()->addWindow(); - connect( m_widget, SIGNAL( removeOpenArk( const KURL &) ), this, - SLOT( slotRemoveOpenArk( const KURL & ) ) ); - connect( m_widget, SIGNAL( addOpenArk( const KURL & ) ), this, - SLOT( slotAddOpenArk( const KURL & ) ) ); + connect( m_widget, TQT_SIGNAL( removeOpenArk( const KURL &) ), this, + TQT_SLOT( slotRemoveOpenArk( const KURL & ) ) ); + connect( m_widget, TQT_SIGNAL( addOpenArk( const KURL & ) ), this, + TQT_SLOT( slotAddOpenArk( const KURL & ) ) ); setCentralWidget( m_part->widget() ); createGUI( m_part ); @@ -110,23 +110,23 @@ void MainWindow::setupActions() { newWindowAction = new KAction(i18n("New &Window"), "window_new", KShortcut(), this, - SLOT(file_newWindow()), actionCollection(), "new_window"); + TQT_SLOT(file_newWindow()), actionCollection(), "new_window"); - newArchAction = KStdAction::openNew(this, SLOT(file_new()), actionCollection()); - openAction = KStdAction::open(this, SLOT(file_open()), actionCollection()); + newArchAction = KStdAction::openNew(this, TQT_SLOT(file_new()), actionCollection()); + openAction = KStdAction::open(this, TQT_SLOT(file_open()), actionCollection()); reloadAction = new KAction(i18n("Re&load"), "reload", KStdAccel::shortcut( KStdAccel::Reload ), this, - SLOT(file_reload()), actionCollection(), "reload_arch"); - closeAction = KStdAction::close(this, SLOT(file_close()), actionCollection(), "file_close"); + TQT_SLOT(file_reload()), actionCollection(), "reload_arch"); + closeAction = KStdAction::close(this, TQT_SLOT(file_close()), actionCollection(), "file_close"); - recent = KStdAction::openRecent(this, SLOT(openURL(const KURL&)), actionCollection()); + recent = KStdAction::openRecent(this, TQT_SLOT(openURL(const KURL&)), actionCollection()); recent->loadEntries(kapp->config()); createStandardStatusBarAction(); - KStdAction::quit(this, SLOT(window_close()), actionCollection()); - KStdAction::configureToolbars(this, SLOT(editToolbars()), actionCollection()); - KStdAction::keyBindings(this, SLOT( slotConfigureKeyBindings()), actionCollection()); + KStdAction::quit(this, TQT_SLOT(window_close()), actionCollection()); + KStdAction::configureToolbars(this, TQT_SLOT(editToolbars()), actionCollection()); + KStdAction::keyBindings(this, TQT_SLOT( slotConfigureKeyBindings()), actionCollection()); openAction->setEnabled( true ); recent->setEnabled( true ); @@ -177,9 +177,9 @@ MainWindow::file_reload() void MainWindow::editToolbars() { - saveMainWindowSettings( KGlobal::config(), QString::fromLatin1("MainWindow") ); + saveMainWindowSettings( KGlobal::config(), TQString::fromLatin1("MainWindow") ); KEditToolbar dlg( factory(), this ); - connect(&dlg, SIGNAL( newToolbarConfig() ), this, SLOT( slotNewToolbarConfig() )); + connect(&dlg, TQT_SIGNAL( newToolbarConfig() ), this, TQT_SLOT( slotNewToolbarConfig() )); dlg.exec(); } @@ -187,7 +187,7 @@ void MainWindow::slotNewToolbarConfig() { createGUI( m_part ); - applyMainWindowSettings( KGlobal::config(), QString::fromLatin1("MainWindow") ); + applyMainWindowSettings( KGlobal::config(), TQString::fromLatin1("MainWindow") ); } void @@ -202,7 +202,7 @@ MainWindow::slotConfigureKeyBindings() } void -MainWindow::slotArchivePopup( const QPoint &pPoint) +MainWindow::slotArchivePopup( const TQPoint &pPoint) { static_cast<KPopupMenu *>(factory()->container("archive_popup", this))->popup(pPoint); } @@ -240,29 +240,29 @@ MainWindow::openURL( const KURL & url, bool tempFile ) } KURL -MainWindow::getOpenURL( bool addOnly, const QString & caption, - const QString & startDir, const QString & suggestedName ) +MainWindow::getOpenURL( bool addOnly, const TQString & caption, + const TQString & startDir, const TQString & suggestedName ) { kdDebug( 1601 ) << "startDir is: " << startDir << endl; - QWidget * forceFormatWidget = new QWidget( this ); - QHBoxLayout * l = new QHBoxLayout( forceFormatWidget ); + TQWidget * forceFormatWidget = new TQWidget( this ); + TQHBoxLayout * l = new TQHBoxLayout( forceFormatWidget ); - QLabel * label = new QLabel( forceFormatWidget ); + TQLabel * label = new TQLabel( forceFormatWidget ); label->setText( i18n( "Open &as:" ) ); label->adjustSize(); KComboBox * combo = new KComboBox( forceFormatWidget ); - QStringList list; + TQStringList list; list = ArchiveFormatInfo::self()->allDescriptions(); list.sort(); list.prepend( i18n( "Autodetect (default)" ) ); combo->insertStringList( list ); - QString filter = ArchiveFormatInfo::self()->filter(); + TQString filter = ArchiveFormatInfo::self()->filter(); if ( !suggestedName.isEmpty() ) { - filter = QString::null; + filter = TQString::null; combo->setCurrentItem( list.findIndex( ArchiveFormatInfo::self()->descriptionForMimeType( KMimeType::findByPath( suggestedName, 0, true )->name() ) ) ); } @@ -272,7 +272,7 @@ MainWindow::getOpenURL( bool addOnly, const QString & caption, l->addWidget( label ); l->addWidget( combo, 1 ); - QString dir; + TQString dir; if ( addOnly ) dir = startDir; else @@ -296,7 +296,7 @@ MainWindow::getOpenURL( bool addOnly, const QString & caption, m_widget->setOpenAsMimeType( ArchiveFormatInfo::self()->mimeTypeForDescription( combo->currentText() ) ); else - m_widget->setOpenAsMimeType( QString::null ); + m_widget->setOpenAsMimeType( TQString::null ); return url; } @@ -355,7 +355,7 @@ MainWindow::saveProperties( KConfig* config ) void MainWindow::readProperties( KConfig* config ) { - QString file = config->readPathEntry("SMOpenedFile"); + TQString file = config->readPathEntry("SMOpenedFile"); kdDebug(1601) << "ArkWidget::readProperties( KConfig* config ) file=" << file << endl; if ( !file.isEmpty() ) openURL( KURL::fromPathOrURL( file ) ); @@ -402,7 +402,7 @@ MainWindow::extractTo( const KURL & targetDirectory, const KURL & archive, bool } void -MainWindow::addToArchive( const KURL::List & filesToAdd, const QString & /*cwd*/, +MainWindow::addToArchive( const KURL::List & filesToAdd, const TQString & /*cwd*/, const KURL & archive, bool askForName ) { KURL archiveFile; @@ -416,7 +416,7 @@ MainWindow::addToArchive( const KURL::List & filesToAdd, const QString & /*cwd*/ // like: /dira> ark -add /dirb/file, but well... KURL cwdURL; cwdURL.setPath( filesToAdd.first().path() ); - QString dir = cwdURL.directory( false ); + TQString dir = cwdURL.directory( false ); archiveFile = getOpenURL( true, i18n( "Select Archive to Add Files To" ), dir /*cwd*/, archive.fileName() ); @@ -443,10 +443,10 @@ MainWindow::addToArchive( const KURL::List & filesToAdd, const QString & /*cwd*/ } void -MainWindow::startProgressDialog( const QString & text ) +MainWindow::startProgressDialog( const TQString & text ) { if ( !progressDialog ) - progressDialog = new KProgressDialog( this, "progress_dialog", QString::null, text, false ); + progressDialog = new KProgressDialog( this, "progress_dialog", TQString::null, text, false ); else progressDialog->setLabel( text ); @@ -458,14 +458,14 @@ MainWindow::startProgressDialog( const QString & text ) progressDialog->progressBar()->setTotalSteps( 0 ); progressDialog->progressBar()->setPercentageVisible( false ); -// progressDialog->setInitialSize( QSize(200,100), true ); +// progressDialog->setInitialSize( TQSize(200,100), true ); progressDialog->setMinimumDuration( 500 ); progressDialog->show(); KDialog::centerOnScreen( progressDialog ); - connect( progressDialog, SIGNAL( cancelClicked() ), this, SLOT( window_close() ) ); + connect( progressDialog, TQT_SIGNAL( cancelClicked() ), this, TQT_SLOT( window_close() ) ); - timer = new QTimer( this ); - connect( timer, SIGNAL( timeout() ), this, SLOT( slotProgress() ) ); + timer = new TQTimer( this ); + connect( timer, TQT_SIGNAL( timeout() ), this, TQT_SLOT( slotProgress() ) ); timer->start( 200, false ); } diff --git a/ark/mainwindow.h b/ark/mainwindow.h index 2d25ed0..428167e 100644 --- a/ark/mainwindow.h +++ b/ark/mainwindow.h @@ -25,9 +25,9 @@ #define ARKMAINWINDOW_H // QT includes -#include <qstring.h> -#include <qpopupmenu.h> -#include <qtimer.h> +#include <tqstring.h> +#include <tqpopupmenu.h> +#include <tqtimer.h> // KDE includes #include <kmainwindow.h> @@ -42,12 +42,12 @@ MainWindow: public KParts::MainWindow { Q_OBJECT public: - MainWindow( QWidget *parent=0, const char *name=0 ); + MainWindow( TQWidget *parent=0, const char *name=0 ); virtual ~MainWindow(); void setExtractOnly ( bool b ); void extractTo( const KURL & targetDirectory, const KURL & archive, bool guessName ); - void addToArchive( const KURL::List & filesToAdd, const QString & cwd = QString::null, + void addToArchive( const KURL::List & filesToAdd, const TQString & cwd = TQString::null, const KURL & archive = KURL(), bool askForName = false ); public slots: @@ -65,7 +65,7 @@ public slots: virtual void saveProperties( KConfig* config ); virtual void readProperties( KConfig* config ); void slotSaveProperties(); - void slotArchivePopup( const QPoint &pPoint); + void slotArchivePopup( const TQPoint &pPoint); void slotRemoveRecentURL( const KURL &url ); void slotAddRecentURL( const KURL &url ); void slotFixActionState( const bool & bHaveFiles ); @@ -81,14 +81,14 @@ private: // methods void setupActions(); void setupMenuBar(); - void newCaption(const QString & filename); + void newCaption(const TQString & filename); bool arkAlreadyOpen( const KURL & url ); - KURL getOpenURL( bool addOnly = false , const QString & caption = QString::null, - const QString & startDir = QString::null, - const QString & suggestedName = QString::null ); + KURL getOpenURL( bool addOnly = false , const TQString & caption = TQString::null, + const TQString & startDir = TQString::null, + const TQString & suggestedName = TQString::null ); - void startProgressDialog( const QString & text ); + void startProgressDialog( const TQString & text ); private slots: void slotProgress(); @@ -106,7 +106,7 @@ private: // data //progress dialog for konqs service menus / commmand line KProgressDialog *progressDialog; - QTimer *timer; + TQTimer *timer; }; #endif /* ARKMAINWINDOW_H*/ diff --git a/ark/rar.cpp b/ark/rar.cpp index 071dc9e..554fdfc 100644 --- a/ark/rar.cpp +++ b/ark/rar.cpp @@ -30,8 +30,8 @@ #include <string> // QT includes -#include <qfile.h> -#include <qdir.h> +#include <tqfile.h> +#include <tqdir.h> // KDE includes #include <kdebug.h> @@ -50,7 +50,7 @@ #include "arkutils.h" #include "filelistview.h" -RarArch::RarArch( ArkWidget *_gui, const QString & _fileName ) +RarArch::RarArch( ArkWidget *_gui, const TQString & _fileName ) : Arch( _gui, _fileName ) { // Check if rar is available @@ -87,26 +87,26 @@ RarArch::RarArch( ArkWidget *_gui, const QString & _fileName ) m_isFirstLine = true; } -bool RarArch::processLine( const QCString &line ) +bool RarArch::processLine( const TQCString &line ) { if ( m_isFirstLine ) { - m_entryFilename = QString::fromLocal8Bit( line ); + m_entryFilename = TQString::fromLocal8Bit( line ); m_entryFilename.remove( 0, 1 ); m_isFirstLine = false; return true; } - QStringList list; + TQStringList list; - QStringList l2 = QStringList::split( ' ', line ); + TQStringList l2 = TQStringList::split( ' ', line ); list << m_entryFilename; // filename list << l2[ 0 ]; // size list << l2[ 1 ]; // packed list << l2[ 2 ]; // ratio - QStringList date = QStringList::split( '-', l2[ 3 ] ); + TQStringList date = TQStringList::split( '-', l2[ 3 ] ); list << ArkUtils::fixYear( date[ 2 ].latin1() ) + '-' + date[ 1 ] + '-' + date [ 0 ] + ' ' + l2[4]; // date list << l2[ 5 ]; // attributes list << l2[ 6 ]; // crc @@ -137,17 +137,17 @@ void RarArch::open() *kp << m_filename; - connect( kp, SIGNAL( receivedStdout(KProcess*, char*, int) ), - SLOT( slotReceivedTOC(KProcess*, char*, int) ) ); - connect( kp, SIGNAL( receivedStderr(KProcess*, char*, int) ), - SLOT( slotReceivedOutput(KProcess*, char*, int) ) ); - connect( kp, SIGNAL( processExited(KProcess*) ), - SLOT( slotOpenExited(KProcess*) ) ); + connect( kp, TQT_SIGNAL( receivedStdout(KProcess*, char*, int) ), + TQT_SLOT( slotReceivedTOC(KProcess*, char*, int) ) ); + connect( kp, TQT_SIGNAL( receivedStderr(KProcess*, char*, int) ), + TQT_SLOT( slotReceivedOutput(KProcess*, char*, int) ) ); + connect( kp, TQT_SIGNAL( processExited(KProcess*) ), + TQT_SLOT( slotOpenExited(KProcess*) ) ); if ( !kp->start( KProcess::NotifyOnExit, KProcess::AllOutput ) ) { KMessageBox::error( 0, i18n( "Could not start a subprocess." ) ); - emit sigOpen( this, false, QString::null, 0 ); + emit sigOpen( this, false, TQString::null, 0 ); } } @@ -173,17 +173,17 @@ void RarArch::create() Arch::Extract | Arch::Delete | Arch::Add | Arch::View ); } -void RarArch::addDir( const QString & _dirName ) +void RarArch::addDir( const TQString & _dirName ) { if ( !_dirName.isEmpty() ) { - QStringList list; + TQStringList list; list.append( _dirName ); addFile( list ); } } -void RarArch::addFile( const QStringList & urls ) +void RarArch::addFile( const TQStringList & urls ) { KProcess *kp = m_currentProcess = new KProcess; @@ -203,21 +203,21 @@ void RarArch::addFile( const QStringList & urls ) *kp << m_filename; KURL dir( urls.first() ); - QDir::setCurrent( dir.directory() ); + TQDir::setCurrent( dir.directory() ); - QStringList::ConstIterator iter; + TQStringList::ConstIterator iter; for ( iter = urls.begin(); iter != urls.end(); ++iter ) { KURL url( *iter ); *kp << url.fileName(); } - connect( kp, SIGNAL( receivedStdout(KProcess*, char*, int) ), - SLOT( slotReceivedOutput(KProcess*, char*, int) ) ); - connect( kp, SIGNAL( receivedStderr(KProcess*, char*, int) ), - SLOT( slotReceivedOutput(KProcess*, char*, int) ) ); - connect( kp, SIGNAL( processExited(KProcess*) ), - SLOT( slotAddExited(KProcess*) ) ); + connect( kp, TQT_SIGNAL( receivedStdout(KProcess*, char*, int) ), + TQT_SLOT( slotReceivedOutput(KProcess*, char*, int) ) ); + connect( kp, TQT_SIGNAL( receivedStderr(KProcess*, char*, int) ), + TQT_SLOT( slotReceivedOutput(KProcess*, char*, int) ) ); + connect( kp, TQT_SIGNAL( processExited(KProcess*) ), + TQT_SLOT( slotAddExited(KProcess*) ) ); if ( !kp->start( KProcess::NotifyOnExit, KProcess::AllOutput ) ) { @@ -260,7 +260,7 @@ void RarArch::unarchFileInternal() // and we then extract everything in the archive. if ( m_fileList ) { - QStringList::Iterator it; + TQStringList::Iterator it; for ( it = m_fileList->begin(); it != m_fileList->end(); ++it ) { *kp << (*it); @@ -269,12 +269,12 @@ void RarArch::unarchFileInternal() *kp << m_destDir ; - connect( kp, SIGNAL( receivedStdout(KProcess*, char*, int) ), - SLOT( slotReceivedOutput(KProcess*, char*, int) ) ); - connect( kp, SIGNAL( receivedStderr(KProcess*, char*, int) ), - SLOT( slotReceivedOutput(KProcess*, char*, int) ) ); - connect( kp, SIGNAL( processExited(KProcess*) ), - SLOT( slotExtractExited(KProcess*) ) ); + connect( kp, TQT_SIGNAL( receivedStdout(KProcess*, char*, int) ), + TQT_SLOT( slotReceivedOutput(KProcess*, char*, int) ) ); + connect( kp, TQT_SIGNAL( receivedStderr(KProcess*, char*, int) ), + TQT_SLOT( slotReceivedOutput(KProcess*, char*, int) ) ); + connect( kp, TQT_SIGNAL( processExited(KProcess*) ), + TQT_SLOT( slotExtractExited(KProcess*) ) ); if ( !kp->start( KProcess::NotifyOnExit, KProcess::AllOutput ) ) { @@ -288,7 +288,7 @@ bool RarArch::passwordRequired() return m_lastShellOutput.findRev("password incorrect ?)")+1; } -void RarArch::remove( QStringList *list ) +void RarArch::remove( TQStringList *list ) { if ( !list ) return; @@ -298,19 +298,19 @@ void RarArch::remove( QStringList *list ) *kp << m_archiver_program << "d" << m_filename; - QStringList::Iterator it; + TQStringList::Iterator it; for ( it = list->begin(); it != list->end(); ++it ) { - QString str = *it; + TQString str = *it; *kp << str; } - connect( kp, SIGNAL( receivedStdout(KProcess*, char*, int) ), - SLOT( slotReceivedOutput(KProcess*, char*, int) ) ); - connect( kp, SIGNAL( receivedStderr(KProcess*, char*, int) ), - SLOT( slotReceivedOutput(KProcess*, char*, int) ) ); - connect( kp, SIGNAL( processExited(KProcess*) ), - SLOT( slotDeleteExited(KProcess*) ) ); + connect( kp, TQT_SIGNAL( receivedStdout(KProcess*, char*, int) ), + TQT_SLOT( slotReceivedOutput(KProcess*, char*, int) ) ); + connect( kp, TQT_SIGNAL( receivedStderr(KProcess*, char*, int) ), + TQT_SLOT( slotReceivedOutput(KProcess*, char*, int) ) ); + connect( kp, TQT_SIGNAL( processExited(KProcess*) ), + TQT_SLOT( slotDeleteExited(KProcess*) ) ); if ( !kp->start( KProcess::NotifyOnExit, KProcess::AllOutput ) ) { @@ -36,21 +36,21 @@ class RarArch : public Arch { Q_OBJECT public: - RarArch( ArkWidget *_gui, const QString & _fileName ); + RarArch( ArkWidget *_gui, const TQString & _fileName ); virtual ~RarArch() {} virtual void open(); virtual void create(); - virtual void addFile( const QStringList & ); - virtual void addDir( const QString & ); + virtual void addFile( const TQStringList & ); + virtual void addDir( const TQString & ); - virtual void remove( QStringList * ); + virtual void remove( TQStringList * ); virtual void unarchFileInternal(); virtual bool passwordRequired(); protected slots: - virtual bool processLine( const QCString & ); + virtual bool processLine( const TQCString & ); private: void setHeaders(); @@ -62,7 +62,7 @@ class RarArch : public Arch * Therefore, the variables below are needed. */ bool m_isFirstLine; - QString m_entryFilename; + TQString m_entryFilename; }; #endif // RAR_H diff --git a/ark/searchbar.cpp b/ark/searchbar.cpp index 015a3bf..40fb522 100644 --- a/ark/searchbar.cpp +++ b/ark/searchbar.cpp @@ -28,14 +28,14 @@ #include <kaction.h> #include <kactioncollection.h> -#include <qlabel.h> -#include <qapplication.h> -#include <qvaluelist.h> +#include <tqlabel.h> +#include <tqapplication.h> +#include <tqvaluelist.h> -SearchBar::SearchBar( QWidget* parent, KActionCollection* aC, const char * name ) +SearchBar::SearchBar( TQWidget* parent, KActionCollection* aC, const char * name ) : KListViewSearchLine( parent, 0, name ) { - KAction *resetSearch = new KAction( i18n( "Reset Search" ), QApplication::reverseLayout() ? "clear_left" : "locationbar_erase", 0, this, SLOT( clear() ), aC, "reset_search" ); + KAction *resetSearch = new KAction( i18n( "Reset Search" ), TQApplication::reverseLayout() ? "clear_left" : "locationbar_erase", 0, this, TQT_SLOT( clear() ), aC, "reset_search" ); resetSearch->plug( parent ); resetSearch->setWhatsThis( i18n( "Reset Search\n" diff --git a/ark/searchbar.h b/ark/searchbar.h index 95857ae..c21b4d4 100644 --- a/ark/searchbar.h +++ b/ark/searchbar.h @@ -23,7 +23,7 @@ #include <klistviewsearchline.h> -#include <qwidget.h> +#include <tqwidget.h> class KListView; class KComboBox; @@ -33,7 +33,7 @@ class SearchBar: public KListViewSearchLine { Q_OBJECT public: - SearchBar( QWidget* parent, KActionCollection* aC, const char * name = 0 ); + SearchBar( TQWidget* parent, KActionCollection* aC, const char * name = 0 ); ~SearchBar(); }; diff --git a/ark/sevenzip.cpp b/ark/sevenzip.cpp index 30747a3..99170ac 100644 --- a/ark/sevenzip.cpp +++ b/ark/sevenzip.cpp @@ -24,7 +24,7 @@ */ -#include <qdir.h> +#include <tqdir.h> #include <kglobal.h> #include <klocale.h> @@ -40,7 +40,7 @@ #include "arkutils.h" #include "filelistview.h" -SevenZipArch::SevenZipArch( ArkWidget *gui, const QString &filename ) +SevenZipArch::SevenZipArch( ArkWidget *gui, const TQString &filename ) : Arch( gui, filename ), m_nameColumnPos( -1 ) { // Check if 7z is available @@ -64,13 +64,13 @@ SevenZipArch::SevenZipArch( ArkWidget *gui, const QString &filename ) m_dateCol = 3; m_numCols = 5; - m_archCols.append( new ArchColumns( 5, QRegExp( "[0-2][0-9][0-9][0-9]" ), 4 ) ); // Year - m_archCols.append( new ArchColumns( 6, QRegExp( "[01][0-9]" ), 2 ) ); // Month - m_archCols.append( new ArchColumns( 7, QRegExp( "[0-3][0-9]" ), 2 ) ); // Day - m_archCols.append( new ArchColumns( 8, QRegExp( "[0-9:]+" ), 8 ) ); // Time - m_archCols.append( new ArchColumns( 4, QRegExp( "[^\\s]+" ) ) ); // Attributes - m_archCols.append( new ArchColumns( 1, QRegExp( "[0-9]+" ) ) ); // Size - m_archCols.append( new ArchColumns( 2, QRegExp( "[0-9]+" ), 64, true ) ); // Compressed Size + m_archCols.append( new ArchColumns( 5, TQRegExp( "[0-2][0-9][0-9][0-9]" ), 4 ) ); // Year + m_archCols.append( new ArchColumns( 6, TQRegExp( "[01][0-9]" ), 2 ) ); // Month + m_archCols.append( new ArchColumns( 7, TQRegExp( "[0-3][0-9]" ), 2 ) ); // Day + m_archCols.append( new ArchColumns( 8, TQRegExp( "[0-9:]+" ), 8 ) ); // Time + m_archCols.append( new ArchColumns( 4, TQRegExp( "[^\\s]+" ) ) ); // Attributes + m_archCols.append( new ArchColumns( 1, TQRegExp( "[0-9]+" ) ) ); // Size + m_archCols.append( new ArchColumns( 2, TQRegExp( "[0-9]+" ), 64, true ) ); // Compressed Size } SevenZipArch::~SevenZipArch() @@ -100,17 +100,17 @@ void SevenZipArch::open() KProcess *kp = m_currentProcess = new KProcess; *kp << m_archiver_program << "l" << m_filename; - connect( kp, SIGNAL( receivedStdout(KProcess*, char*, int) ), - SLOT( slotReceivedTOC(KProcess*, char*, int) ) ); - connect( kp, SIGNAL( receivedStderr(KProcess*, char*, int) ), - SLOT( slotReceivedOutput(KProcess*, char*, int) ) ); - connect( kp, SIGNAL( processExited(KProcess*) ), - SLOT( slotOpenExited(KProcess*) ) ); + connect( kp, TQT_SIGNAL( receivedStdout(KProcess*, char*, int) ), + TQT_SLOT( slotReceivedTOC(KProcess*, char*, int) ) ); + connect( kp, TQT_SIGNAL( receivedStderr(KProcess*, char*, int) ), + TQT_SLOT( slotReceivedOutput(KProcess*, char*, int) ) ); + connect( kp, TQT_SIGNAL( processExited(KProcess*) ), + TQT_SLOT( slotOpenExited(KProcess*) ) ); if ( !kp->start( KProcess::NotifyOnExit, KProcess::AllOutput ) ) { KMessageBox::error( 0, i18n( "Could not start a subprocess." ) ); - emit sigOpen( this, false, QString::null, 0 ); + emit sigOpen( this, false, TQString::null, 0 ); } } @@ -120,7 +120,7 @@ void SevenZipArch::create() Arch::Extract | Arch::Delete | Arch::Add | Arch::View ); } -void SevenZipArch::addFile( const QStringList & urls ) +void SevenZipArch::addFile( const TQStringList & urls ) { KProcess *kp = m_currentProcess = new KProcess; @@ -128,23 +128,23 @@ void SevenZipArch::addFile( const QStringList & urls ) *kp << m_archiver_program << "a" ; KURL url( urls.first() ); - QDir::setCurrent( url.directory() ); + TQDir::setCurrent( url.directory() ); *kp << m_filename; - QStringList::ConstIterator iter; + TQStringList::ConstIterator iter; for ( iter = urls.begin(); iter != urls.end(); ++iter ) { KURL url( *iter ); *kp << url.fileName(); } - connect( kp, SIGNAL( receivedStdout(KProcess*, char*, int) ), - SLOT( slotReceivedOutput(KProcess*, char*, int) ) ); - connect( kp, SIGNAL( receivedStderr(KProcess*, char*, int) ), - SLOT( slotReceivedOutput(KProcess*, char*, int) ) ); - connect( kp, SIGNAL( processExited(KProcess*) ), - SLOT( slotAddExited(KProcess*) ) ); + connect( kp, TQT_SIGNAL( receivedStdout(KProcess*, char*, int) ), + TQT_SLOT( slotReceivedOutput(KProcess*, char*, int) ) ); + connect( kp, TQT_SIGNAL( receivedStderr(KProcess*, char*, int) ), + TQT_SLOT( slotReceivedOutput(KProcess*, char*, int) ) ); + connect( kp, TQT_SIGNAL( processExited(KProcess*) ), + TQT_SLOT( slotAddExited(KProcess*) ) ); if ( !kp->start( KProcess::NotifyOnExit, KProcess::AllOutput ) ) { @@ -153,17 +153,17 @@ void SevenZipArch::addFile( const QStringList & urls ) } } -void SevenZipArch::addDir( const QString & dirName ) +void SevenZipArch::addDir( const TQString & dirName ) { if ( !dirName.isEmpty() ) { - QStringList list; + TQStringList list; list.append( dirName ); addFile( list ); } } -void SevenZipArch::remove( QStringList *list ) +void SevenZipArch::remove( TQStringList *list ) { if ( !list ) return; @@ -173,18 +173,18 @@ void SevenZipArch::remove( QStringList *list ) *kp << m_archiver_program << "d" << m_filename; - QStringList::Iterator it; + TQStringList::Iterator it; for ( it = list->begin(); it != list->end(); ++it ) { *kp << *it; } - connect( kp, SIGNAL( receivedStdout(KProcess*, char*, int) ), - SLOT( slotReceivedOutput(KProcess*, char*, int) ) ); - connect( kp, SIGNAL( receivedStderr(KProcess*, char*, int) ), - SLOT( slotReceivedOutput(KProcess*, char*, int) ) ); - connect( kp, SIGNAL( processExited(KProcess*) ), - SLOT( slotDeleteExited(KProcess*) ) ); + connect( kp, TQT_SIGNAL( receivedStdout(KProcess*, char*, int) ), + TQT_SLOT( slotReceivedOutput(KProcess*, char*, int) ) ); + connect( kp, TQT_SIGNAL( receivedStderr(KProcess*, char*, int) ), + TQT_SLOT( slotReceivedOutput(KProcess*, char*, int) ) ); + connect( kp, TQT_SIGNAL( processExited(KProcess*) ), + TQT_SLOT( slotDeleteExited(KProcess*) ) ); if ( !kp->start( KProcess::NotifyOnExit, KProcess::AllOutput ) ) { @@ -218,7 +218,7 @@ void SevenZipArch::unarchFileInternal( ) // and we then extract everything in the archive. if ( m_fileList ) { - QStringList::Iterator it; + TQStringList::Iterator it; for ( it = m_fileList->begin(); it != m_fileList->end(); ++it ) { *kp << (*it); @@ -227,12 +227,12 @@ void SevenZipArch::unarchFileInternal( ) *kp << "-o" + m_destDir ; - connect( kp, SIGNAL( receivedStdout(KProcess*, char*, int) ), - SLOT( slotReceivedOutput(KProcess*, char*, int) ) ); - connect( kp, SIGNAL( receivedStderr(KProcess*, char*, int) ), - SLOT( slotReceivedOutput(KProcess*, char*, int) ) ); - connect( kp, SIGNAL( processExited(KProcess*) ), - SLOT( slotExtractExited(KProcess*) ) ); + connect( kp, TQT_SIGNAL( receivedStdout(KProcess*, char*, int) ), + TQT_SLOT( slotReceivedOutput(KProcess*, char*, int) ) ); + connect( kp, TQT_SIGNAL( receivedStderr(KProcess*, char*, int) ), + TQT_SLOT( slotReceivedOutput(KProcess*, char*, int) ) ); + connect( kp, TQT_SIGNAL( processExited(KProcess*) ), + TQT_SLOT( slotExtractExited(KProcess*) ) ); if ( !kp->start( KProcess::NotifyOnExit, KProcess::AllOutput ) ) { @@ -241,10 +241,10 @@ void SevenZipArch::unarchFileInternal( ) } } -bool SevenZipArch::processLine( const QCString& _line ) +bool SevenZipArch::processLine( const TQCString& _line ) { - QCString line( _line ); - QString columns[ 11 ]; + TQCString line( _line ); + TQString columns[ 11 ]; unsigned int pos = 0; int strpos, len; @@ -252,7 +252,7 @@ bool SevenZipArch::processLine( const QCString& _line ) line.truncate( m_nameColumnPos ); // Go through our columns, try to pick out data, return silently on failure - for ( QPtrListIterator <ArchColumns>col( m_archCols ); col.current(); ++col ) + for ( TQPtrListIterator <ArchColumns>col( m_archCols ); col.current(); ++col ) { ArchColumns *curCol = *col; @@ -278,14 +278,14 @@ bool SevenZipArch::processLine( const QCString& _line ) if ( m_dateCol >= 0 ) { - QString year = ( m_repairYear >= 0 ) ? + TQString year = ( m_repairYear >= 0 ) ? ArkUtils::fixYear( columns[ m_repairYear ].ascii()) : columns[ m_fixYear ]; - QString month = ( m_repairMonth >= 0 ) ? - QString( "%1" ) + TQString month = ( m_repairMonth >= 0 ) ? + TQString( "%1" ) .arg( ArkUtils::getMonth( columns[ m_repairMonth ].ascii() ) ) : columns[ m_fixMonth ]; - QString timestamp = QString::fromLatin1( "%1-%2-%3 %4" ) + TQString timestamp = TQString::fromLatin1( "%1-%2-%3 %4" ) .arg( year ) .arg( month ) .arg( columns[ m_fixDay ] ) @@ -294,7 +294,7 @@ bool SevenZipArch::processLine( const QCString& _line ) columns[ m_dateCol ] = timestamp; } - QStringList list; + TQStringList list; for ( int i = 0; i < m_numCols; ++i ) { diff --git a/ark/sevenzip.h b/ark/sevenzip.h index 4a34c48..f728768 100644 --- a/ark/sevenzip.h +++ b/ark/sevenzip.h @@ -30,20 +30,20 @@ class SevenZipArch : public Arch { Q_OBJECT public: - SevenZipArch( ArkWidget *, const QString & ); + SevenZipArch( ArkWidget *, const TQString & ); virtual ~SevenZipArch(); virtual void open(); virtual void create(); - virtual void addFile( const QStringList & ); - virtual void addDir( const QString & ); + virtual void addFile( const TQStringList & ); + virtual void addDir( const TQString & ); - virtual void remove( QStringList * ); + virtual void remove( TQStringList * ); virtual void unarchFileInternal( ); protected slots: - virtual bool processLine( const QCString& line ); + virtual bool processLine( const TQCString& line ); virtual void slotReceivedTOC( KProcess*, char*, int ); private: diff --git a/ark/tar.cpp b/ark/tar.cpp index 5f104ef..6e599c9 100644 --- a/ark/tar.cpp +++ b/ark/tar.cpp @@ -49,9 +49,9 @@ #include <stdlib.h> // Qt includes -#include <qdir.h> -#include <qregexp.h> -#include <qeventloop.h> +#include <tqdir.h> +#include <tqregexp.h> +#include <tqeventloop.h> // KDE includes #include <kapplication.h> @@ -74,13 +74,13 @@ #include "tarlistingthread.h" TarArch::TarArch( ArkWidget *_gui, - const QString & _filename, const QString & _openAsMimeType) + const TQString & _filename, const TQString & _openAsMimeType) : Arch( _gui, _filename), m_tmpDir( 0 ), createTmpInProgress(false), updateInProgress(false), deleteInProgress(false), fd(0), m_pTmpProc( 0 ), m_pTmpProc2( 0 ), failed( false ), m_dotslash( false ), m_listingThread( 0 ) { - m_filesToAdd = m_filesToRemove = QStringList(); + m_filesToAdd = m_filesToRemove = TQStringList(); m_archiver_program = m_unarchiver_program = ArkSettings::tarExe(); verifyCompressUtilityIsAvailable( m_archiver_program ); verifyUncompressUtilityIsAvailable( m_unarchiver_program ); @@ -106,12 +106,12 @@ TarArch::TarArch( ArkWidget *_gui, { compressed = true; m_tmpDir = new KTempDir( _gui->tmpDir() - + QString::fromLatin1( "temp_tar" ) ); + + TQString::fromLatin1( "temp_tar" ) ); m_tmpDir->setAutoDelete( true ); m_tmpDir->qDir()->cd( m_tmpDir->name() ); // build the temp file name KTempFile *pTempFile = new KTempFile( m_tmpDir->name(), - QString::fromLatin1(".tar") ); + TQString::fromLatin1(".tar") ); tmpfile = pTempFile->name(); delete pTempFile; @@ -143,7 +143,7 @@ void TarArch::updateArch() if (compressed) { updateInProgress = true; - int f_desc = KDE_open(QFile::encodeName(m_filename), O_CREAT | O_TRUNC | O_WRONLY, 0666); + int f_desc = KDE_open(TQFile::encodeName(m_filename), O_CREAT | O_TRUNC | O_WRONLY, 0666); if (f_desc != -1) fd = fdopen( f_desc, "w" ); else @@ -163,13 +163,13 @@ void TarArch::updateArch() *kp << "cat" << tmpfile; - connect(kp, SIGNAL(receivedStdout(KProcess*, char*, int)), - this, SLOT(updateProgress( KProcess *, char *, int ))); - connect( kp, SIGNAL(receivedStderr(KProcess*, char*, int)), - (Arch *)this, SLOT(slotReceivedOutput(KProcess*, char*, int))); + connect(kp, TQT_SIGNAL(receivedStdout(KProcess*, char*, int)), + this, TQT_SLOT(updateProgress( KProcess *, char *, int ))); + connect( kp, TQT_SIGNAL(receivedStderr(KProcess*, char*, int)), + (Arch *)this, TQT_SLOT(slotReceivedOutput(KProcess*, char*, int))); - connect(kp, SIGNAL(processExited(KProcess *)), - this, SLOT(updateFinished(KProcess *)) ); + connect(kp, TQT_SIGNAL(processExited(KProcess *)), + this, TQT_SLOT(updateFinished(KProcess *)) ); if ( !fd || kp->start(KProcess::NotifyOnExit, flag) == false) { @@ -197,46 +197,46 @@ void TarArch::updateProgress( KProcess * _proc, char *_buffer, int _bufflen ) -QString TarArch::getCompressor() +TQString TarArch::getCompressor() { if ( m_fileMimeType == "application/x-tarz" ) - return QString( "compress" ); + return TQString( "compress" ); if ( m_fileMimeType == "application/x-tgz" ) - return QString( "gzip" ); + return TQString( "gzip" ); if ( m_fileMimeType == "application/x-tbz" ) - return QString( "bzip2" ); + return TQString( "bzip2" ); if( m_fileMimeType == "application/x-tzo" ) - return QString( "lzop" ); + return TQString( "lzop" ); - return QString::null; + return TQString::null; } -QString TarArch::getUnCompressor() +TQString TarArch::getUnCompressor() { if ( m_fileMimeType == "application/x-tarz" ) - return QString( "uncompress" ); + return TQString( "uncompress" ); if ( m_fileMimeType == "application/x-tgz" ) - return QString( "gunzip" ); + return TQString( "gunzip" ); if ( m_fileMimeType == "application/x-tbz" ) - return QString( "bunzip2" ); + return TQString( "bunzip2" ); if( m_fileMimeType == "application/x-tzo" ) - return QString( "lzop" ); + return TQString( "lzop" ); - return QString::null; + return TQString::null; } void TarArch::open() { if ( compressed ) - QFile::remove(tmpfile); // just to make sure + TQFile::remove(tmpfile); // just to make sure setHeaders(); clearShellOutput(); @@ -260,12 +260,12 @@ TarArch::open() m_header_removed = false; m_finished = false; - connect(kp, SIGNAL(processExited(KProcess *)), - this, SLOT(slotListingDone(KProcess *))); - connect(kp, SIGNAL(receivedStdout(KProcess*, char*, int)), - this, SLOT(slotReceivedOutput( KProcess *, char *, int ))); - connect( kp, SIGNAL(receivedStderr(KProcess*, char*, int)), - this, SLOT(slotReceivedOutput(KProcess*, char*, int))); + connect(kp, TQT_SIGNAL(processExited(KProcess *)), + this, TQT_SLOT(slotListingDone(KProcess *))); + connect(kp, TQT_SIGNAL(receivedStdout(KProcess*, char*, int)), + this, TQT_SLOT(slotReceivedOutput( KProcess *, char *, int ))); + connect( kp, TQT_SIGNAL(receivedStderr(KProcess*, char*, int)), + this, TQT_SLOT(slotReceivedOutput(KProcess*, char*, int))); if (kp->start(KProcess::NotifyOnExit, KProcess::AllOutput) == false) { @@ -282,7 +282,7 @@ TarArch::open() } else { - connect( this, SIGNAL( createTempDone() ), this, SLOT( openFirstCreateTempDone() ) ); + connect( this, TQT_SIGNAL( createTempDone() ), this, TQT_SLOT( openFirstCreateTempDone() ) ); createTmp(); } } @@ -292,7 +292,7 @@ void TarArch::openFirstCreateTempDone() if ( compressed && ( m_fileMimeType != "application/x-tgz" ) && ( m_fileMimeType != "application/x-tbz" ) ) { - disconnect( this, SIGNAL( createTempDone() ), this, SLOT( openFirstCreateTempDone() ) ); + disconnect( this, TQT_SIGNAL( createTempDone() ), this, TQT_SLOT( openFirstCreateTempDone() ) ); } Q_ASSERT( !m_listingThread ); @@ -302,19 +302,19 @@ void TarArch::openFirstCreateTempDone() void TarArch::slotListingDone(KProcess *_kp) { - const QString list = getLastShellOutput(); + const TQString list = getLastShellOutput(); FileListView *flv = m_gui->fileList(); if (flv!=NULL && flv->totalFiles()>0) { - const QString firstfile = ((FileLVI *) flv->firstChild())->fileName(); - if (list.find(QRegExp(QString("\\s\\./%1[/\\n]").arg(firstfile)))>=0) + const TQString firstfile = ((FileLVI *) flv->firstChild())->fileName(); + if (list.find(TQRegExp(TQString("\\s\\./%1[/\\n]").arg(firstfile)))>=0) { m_dotslash = true; kdDebug(1601) << k_funcinfo << "archive has dot-slash" << endl; } else { - if (list.find(QRegExp(QString("\\s%1[/\\n]").arg(firstfile)))>=0) + if (list.find(TQRegExp(TQString("\\s%1[/\\n]").arg(firstfile)))>=0) { // archive doesn't have dot-slash m_dotslash = false; @@ -356,15 +356,15 @@ void TarArch::createTmp() { if ( compressed ) { - if ( !QFile::exists(tmpfile) ) + if ( !TQFile::exists(tmpfile) ) { - QString strUncompressor = getUnCompressor(); + TQString strUncompressor = getUnCompressor(); // at least lzop doesn't want to pipe zerosize/nonexistent files - QFile originalFile( m_filename ); + TQFile originalFile( m_filename ); if ( strUncompressor != "gunzip" && strUncompressor !="bunzip2" && ( !originalFile.exists() || originalFile.size() == 0 ) ) { - QFile temp( tmpfile ); + TQFile temp( tmpfile ); temp.open( IO_ReadWrite ); temp.close(); emit createTempDone(); @@ -372,7 +372,7 @@ void TarArch::createTmp() } // the tmpfile does not yet exist, so we create it. createTmpInProgress = true; - int f_desc = KDE_open(QFile::encodeName(tmpfile), O_CREAT | O_TRUNC | O_WRONLY, 0666); + int f_desc = KDE_open(TQFile::encodeName(tmpfile), O_CREAT | O_TRUNC | O_WRONLY, 0666); if (f_desc != -1) fd = fdopen( f_desc, "w" ); else @@ -394,16 +394,16 @@ void TarArch::createTmp() } *kp << "-c" << m_filename; - connect(kp, SIGNAL(processExited(KProcess *)), - this, SLOT(createTmpFinished(KProcess *))); - connect(kp, SIGNAL(receivedStdout(KProcess*, char*, int)), - this, SLOT(createTmpProgress( KProcess *, char *, int ))); - connect( kp, SIGNAL(receivedStderr(KProcess*, char*, int)), - this, SLOT(slotReceivedOutput(KProcess*, char*, int))); + connect(kp, TQT_SIGNAL(processExited(KProcess *)), + this, TQT_SLOT(createTmpFinished(KProcess *))); + connect(kp, TQT_SIGNAL(receivedStdout(KProcess*, char*, int)), + this, TQT_SLOT(createTmpProgress( KProcess *, char *, int ))); + connect( kp, TQT_SIGNAL(receivedStderr(KProcess*, char*, int)), + this, TQT_SLOT(slotReceivedOutput(KProcess*, char*, int))); if (kp->start(KProcess::NotifyOnExit, flag ) == false) { KMessageBox::error(0, i18n("Unable to fork a decompressor")); - emit sigOpen( this, false, QString::null, 0 ); + emit sigOpen( this, false, TQString::null, 0 ); } } else @@ -436,13 +436,13 @@ void TarArch::createTmpProgress( KProcess * _proc, char *_buffer, int _bufflen ) } } -void TarArch::deleteOldFiles(const QStringList &urls, bool bAddOnlyNew) +void TarArch::deleteOldFiles(const TQStringList &urls, bool bAddOnlyNew) // because tar is broken. Used when appending: see addFile. { - QStringList list; - QString str; + TQStringList list; + TQString str; - QStringList::ConstIterator iter; + TQStringList::ConstIterator iter; for (iter = urls.begin(); iter != urls.end(); ++iter ) { KURL url( *iter ); @@ -457,9 +457,9 @@ void TarArch::deleteOldFiles(const QStringList &urls, bool bAddOnlyNew) // old. Otherwise we aren't adding it anyway, so we can go on to the next // file with a "continue". - QFileInfo fileInfo( url.path() ); - QDateTime addFileMTime = fileInfo.lastModified(); - QDateTime oldFileMTime = lv->timeStamp(); + TQFileInfo fileInfo( url.path() ); + TQDateTime addFileMTime = fileInfo.lastModified(); + TQDateTime oldFileMTime = lv->timeStamp(); kdDebug(1601) << "Old file: " << oldFileMTime.date().year() << '-' << oldFileMTime.date().month() << '-' << oldFileMTime.date().day() << @@ -489,7 +489,7 @@ void TarArch::deleteOldFiles(const QStringList &urls, bool bAddOnlyNew) } -void TarArch::addFile( const QStringList& urls ) +void TarArch::addFile( const TQStringList& urls ) { m_filesToAdd = urls; // tar is broken. If you add a file that's already there, it gives you @@ -499,23 +499,23 @@ void TarArch::addFile( const QStringList& urls ) // first. So we'll first delete all the old files matching the names of // those in urls. m_bNotifyWhenDeleteFails = false; - connect( this, SIGNAL( removeDone() ), this, SLOT( deleteOldFilesDone() ) ); + connect( this, TQT_SIGNAL( removeDone() ), this, TQT_SLOT( deleteOldFilesDone() ) ); deleteOldFiles(urls, ArkSettings::replaceOnlyWithNewer()); } void TarArch::deleteOldFilesDone() { - disconnect( this, SIGNAL( removeDone() ), this, SLOT( deleteOldFilesDone() ) ); + disconnect( this, TQT_SIGNAL( removeDone() ), this, TQT_SLOT( deleteOldFilesDone() ) ); m_bNotifyWhenDeleteFails = true; - connect( this, SIGNAL( createTempDone() ), this, SLOT( addFileCreateTempDone() ) ); + connect( this, TQT_SIGNAL( createTempDone() ), this, TQT_SLOT( addFileCreateTempDone() ) ); createTmp(); } void TarArch::addFileCreateTempDone() { - disconnect( this, SIGNAL( createTempDone() ), this, SLOT( addFileCreateTempDone() ) ); - QStringList * urls = &m_filesToAdd; + disconnect( this, TQT_SIGNAL( createTempDone() ), this, TQT_SLOT( addFileCreateTempDone() ) ); + TQStringList * urls = &m_filesToAdd; KProcess *kp = m_currentProcess = new KProcess; *kp << m_archiver_program; @@ -530,9 +530,9 @@ void TarArch::addFileCreateTempDone() else *kp << m_filename; - QStringList::ConstIterator iter; + TQStringList::ConstIterator iter; KURL url( urls->first() ); - QDir::setCurrent( url.directory() ); + TQDir::setCurrent( url.directory() ); for (iter = urls->begin(); iter != urls->end(); ++iter ) { KURL fileURL( *iter ); @@ -540,20 +540,20 @@ void TarArch::addFileCreateTempDone() } // debugging info - QValueList<QCString> list = kp->args(); - QValueList<QCString>::Iterator strTemp; + TQValueList<TQCString> list = kp->args(); + TQValueList<TQCString>::Iterator strTemp; for ( strTemp=list.begin(); strTemp != list.end(); ++strTemp ) { kdDebug(1601) << *strTemp << " " << endl; } - connect( kp, SIGNAL(receivedStdout(KProcess*, char*, int)), - this, SLOT(slotReceivedOutput(KProcess*, char*, int))); - connect( kp, SIGNAL(receivedStderr(KProcess*, char*, int)), - this, SLOT(slotReceivedOutput(KProcess*, char*, int))); + connect( kp, TQT_SIGNAL(receivedStdout(KProcess*, char*, int)), + this, TQT_SLOT(slotReceivedOutput(KProcess*, char*, int))); + connect( kp, TQT_SIGNAL(receivedStderr(KProcess*, char*, int)), + this, TQT_SLOT(slotReceivedOutput(KProcess*, char*, int))); - connect( kp, SIGNAL(processExited(KProcess*)), this, - SLOT(slotAddFinished(KProcess*))); + connect( kp, TQT_SIGNAL(processExited(KProcess*)), this, + TQT_SLOT(slotAddFinished(KProcess*))); if (kp->start(KProcess::NotifyOnExit, KProcess::AllOutput) == false) { @@ -564,13 +564,13 @@ void TarArch::addFileCreateTempDone() void TarArch::slotAddFinished(KProcess *_kp) { - disconnect( _kp, SIGNAL(processExited(KProcess*)), this, - SLOT(slotAddFinished(KProcess*))); + disconnect( _kp, TQT_SIGNAL(processExited(KProcess*)), this, + TQT_SLOT(slotAddFinished(KProcess*))); m_pTmpProc = _kp; - m_filesToAdd = QStringList(); + m_filesToAdd = TQStringList(); if ( compressed ) { - connect( this, SIGNAL( updateDone() ), this, SLOT( addFinishedUpdateDone() ) ); + connect( this, TQT_SIGNAL( updateDone() ), this, TQT_SLOT( addFinishedUpdateDone() ) ); updateArch(); } else @@ -580,14 +580,14 @@ void TarArch::slotAddFinished(KProcess *_kp) void TarArch::addFinishedUpdateDone() { if ( compressed ) - disconnect( this, SIGNAL( updateDone() ), this, SLOT( addFinishedUpdateDone() ) ); + disconnect( this, TQT_SIGNAL( updateDone() ), this, TQT_SLOT( addFinishedUpdateDone() ) ); Arch::slotAddExited( m_pTmpProc ); // this will delete _kp m_pTmpProc = NULL; } void TarArch::unarchFileInternal() { - QString dest; + TQString dest; if (m_destDir.isEmpty() || m_destDir.isNull()) { @@ -596,7 +596,7 @@ void TarArch::unarchFileInternal() } else dest = m_destDir; - QString tmp; + TQString tmp; KProcess *kp = m_currentProcess = new KProcess; kp->clearArguments(); @@ -605,7 +605,7 @@ void TarArch::unarchFileInternal() if (compressed) *kp << "--use-compress-program="+getUnCompressor(); - QString options = "-x"; + TQString options = "-x"; if (!ArkSettings::extractOverwrite()) options += "k"; if (ArkSettings::preservePerms()) @@ -619,20 +619,20 @@ void TarArch::unarchFileInternal() // and we then extract everything in the archive. if (m_fileList) { - for ( QStringList::Iterator it = m_fileList->begin(); + for ( TQStringList::Iterator it = m_fileList->begin(); it != m_fileList->end(); ++it ) { - *kp << QString(m_dotslash ? "./" : "")+(*it); + *kp << TQString(m_dotslash ? "./" : "")+(*it); } } - connect( kp, SIGNAL(receivedStdout(KProcess*, char*, int)), - this, SLOT(slotReceivedOutput(KProcess*, char*, int))); - connect( kp, SIGNAL(receivedStderr(KProcess*, char*, int)), - this, SLOT(slotReceivedOutput(KProcess*, char*, int))); + connect( kp, TQT_SIGNAL(receivedStdout(KProcess*, char*, int)), + this, TQT_SLOT(slotReceivedOutput(KProcess*, char*, int))); + connect( kp, TQT_SIGNAL(receivedStderr(KProcess*, char*, int)), + this, TQT_SLOT(slotReceivedOutput(KProcess*, char*, int))); - connect( kp, SIGNAL(processExited(KProcess*)), this, - SLOT(slotExtractExited(KProcess*))); + connect( kp, TQT_SIGNAL(processExited(KProcess*)), this, + TQT_SLOT(slotExtractExited(KProcess*))); if (kp->start(KProcess::NotifyOnExit, KProcess::AllOutput) == false) { @@ -642,19 +642,19 @@ void TarArch::unarchFileInternal() } -void TarArch::remove(QStringList *list) +void TarArch::remove(TQStringList *list) { deleteInProgress = true; m_filesToRemove = *list; - connect( this, SIGNAL( createTempDone() ), this, SLOT( removeCreateTempDone() ) ); + connect( this, TQT_SIGNAL( createTempDone() ), this, TQT_SLOT( removeCreateTempDone() ) ); createTmp(); } void TarArch::removeCreateTempDone() { - disconnect( this, SIGNAL( createTempDone() ), this, SLOT( removeCreateTempDone() ) ); + disconnect( this, TQT_SIGNAL( createTempDone() ), this, TQT_SLOT( removeCreateTempDone() ) ); - QString name, tmp; + TQString name, tmp; KProcess *kp = m_currentProcess = new KProcess; kp->clearArguments(); *kp << m_archiver_program << "--delete" << "-f" ; @@ -663,20 +663,20 @@ void TarArch::removeCreateTempDone() else *kp << m_filename; - QStringList::Iterator it = m_filesToRemove.begin(); + TQStringList::Iterator it = m_filesToRemove.begin(); for ( ; it != m_filesToRemove.end(); ++it ) { - *kp << QString(m_dotslash ? "./" : "")+(*it); + *kp << TQString(m_dotslash ? "./" : "")+(*it); } - m_filesToRemove = QStringList(); + m_filesToRemove = TQStringList(); - connect( kp, SIGNAL(receivedStdout(KProcess*, char*, int)), - this, SLOT(slotReceivedOutput(KProcess*, char*, int))); - connect( kp, SIGNAL(receivedStderr(KProcess*, char*, int)), - this, SLOT(slotReceivedOutput(KProcess*, char*, int))); + connect( kp, TQT_SIGNAL(receivedStdout(KProcess*, char*, int)), + this, TQT_SLOT(slotReceivedOutput(KProcess*, char*, int))); + connect( kp, TQT_SIGNAL(receivedStderr(KProcess*, char*, int)), + this, TQT_SLOT(slotReceivedOutput(KProcess*, char*, int))); - connect( kp, SIGNAL(processExited(KProcess*)), this, - SLOT(slotDeleteExited(KProcess*))); + connect( kp, TQT_SIGNAL(processExited(KProcess*)), this, + TQT_SLOT(slotDeleteExited(KProcess*))); if (kp->start(KProcess::NotifyOnExit, KProcess::AllOutput) == false) { @@ -690,7 +690,7 @@ void TarArch::slotDeleteExited(KProcess *_kp) m_pTmpProc2 = _kp; if ( compressed ) { - connect( this, SIGNAL( updateDone() ), this, SLOT( removeUpdateDone() ) ); + connect( this, TQT_SIGNAL( updateDone() ), this, TQT_SLOT( removeUpdateDone() ) ); updateArch(); } else @@ -700,7 +700,7 @@ void TarArch::slotDeleteExited(KProcess *_kp) void TarArch::removeUpdateDone() { if ( compressed ) - disconnect( this, SIGNAL( updateDone() ), this, SLOT( removeUpdateDone() ) ); + disconnect( this, TQT_SIGNAL( updateDone() ), this, TQT_SLOT( removeUpdateDone() ) ); deleteInProgress = false; emit removeDone(); @@ -708,9 +708,9 @@ void TarArch::removeUpdateDone() m_pTmpProc = NULL; } -void TarArch::addDir(const QString & _dirName) +void TarArch::addDir(const TQString & _dirName) { - QStringList list; + TQStringList list; list.append(_dirName); addFile(list); } @@ -742,7 +742,7 @@ void TarArch::updateFinished( KProcess *_kp ) emit updateDone(); } -void TarArch::customEvent( QCustomEvent *ev ) +void TarArch::customEvent( TQCustomEvent *ev ) { if ( ev->type() == 65442 ) { @@ -757,7 +757,7 @@ void TarArch::customEvent( QCustomEvent *ev ) m_listingThread->wait(); delete m_listingThread; m_listingThread = 0; - emit sigOpen( this, false, QString::null, 0 ); + emit sigOpen( this, false, TQString::null, 0 ); break; case ListingEvent::ListingFinished: @@ -57,22 +57,22 @@ class TarArch : public Arch { Q_OBJECT public: - TarArch( ArkWidget *_gui, const QString & _filename, - const QString & _openAsMimeType ); + TarArch( ArkWidget *_gui, const TQString & _filename, + const TQString & _openAsMimeType ); virtual ~TarArch(); virtual void open(); virtual void create(); - virtual void addFile( const QStringList & ); - virtual void addDir( const QString & ); - virtual void remove( QStringList* ); + virtual void addFile( const TQStringList & ); + virtual void addDir( const TQString & ); + virtual void remove( TQStringList* ); virtual void unarchFileInternal(); virtual int getEditFlag(); - QString getCompressor(); - QString getUnCompressor(); + TQString getCompressor(); + TQString getUnCompressor(); public slots: void updateProgress( KProcess *_kp, char *_buffer, int _bufflen ); @@ -98,21 +98,21 @@ class TarArch : public Arch void removeUpdateDone(); protected: - void customEvent( QCustomEvent * ); + void customEvent( TQCustomEvent * ); private: // methods void updateArch(); void createTmp(); void setHeaders(); - void processDir( const KTarDirectory *tardir, const QString & root ); - void deleteOldFiles( const QStringList &list, bool bAddOnlyNew ); - QString getEntry( const QString & filename ); + void processDir( const KTarDirectory *tardir, const TQString & root ); + void deleteOldFiles( const TQStringList &list, bool bAddOnlyNew ); + TQString getEntry( const TQString & filename ); private: // data // if the tar is compressed, this is the temporary uncompressed tar. KTempDir * m_tmpDir; - QString tmpfile; - QString m_fileMimeType; + TQString tmpfile; + TQString m_fileMimeType; bool compressed; // for use with createTmp and updateArch @@ -122,8 +122,8 @@ class TarArch : public Arch // for use with deleteOldFiles bool deleteInProgress; FILE *fd; - QStringList m_filesToAdd; - QStringList m_filesToRemove; + TQStringList m_filesToAdd; + TQStringList m_filesToRemove; KProcess * m_pTmpProc; KProcess * m_pTmpProc2; bool failed; diff --git a/ark/tarlistingthread.cpp b/ark/tarlistingthread.cpp index 2a98375..3045c4a 100644 --- a/ark/tarlistingthread.cpp +++ b/ark/tarlistingthread.cpp @@ -20,8 +20,8 @@ */ -#include <qstring.h> -#include <qapplication.h> +#include <tqstring.h> +#include <tqapplication.h> #include <karchive.h> #include <ktar.h> @@ -78,8 +78,8 @@ static char *makeAccessString(mode_t mode) return buffer; } -TarListingThread::TarListingThread( QObject *parent, const QString& filename ) - : QThread(), m_parent( parent ) +TarListingThread::TarListingThread( TQObject *parent, const TQString& filename ) + : TQThread(), m_parent( parent ) { Q_ASSERT( m_parent ); m_archive = new KTar( filename ); @@ -95,32 +95,32 @@ void TarListingThread::run() { if (!m_archive->open( IO_ReadOnly )) { - ListingEvent *ev = new ListingEvent( QStringList(), ListingEvent::Error ); + ListingEvent *ev = new ListingEvent( TQStringList(), ListingEvent::Error ); qApp->postEvent( m_parent, ev ); return; } - processDir( m_archive->directory(), QString() ); + processDir( m_archive->directory(), TQString() ); - // Send an empty QStringList in an Event to signal the listing end. - ListingEvent *ev = new ListingEvent( QStringList(), ListingEvent::ListingFinished ); + // Send an empty TQStringList in an Event to signal the listing end. + ListingEvent *ev = new ListingEvent( TQStringList(), ListingEvent::ListingFinished ); qApp->postEvent( m_parent, ev ); } -void TarListingThread::processDir( const KTarDirectory *tardir, const QString & root ) +void TarListingThread::processDir( const KTarDirectory *tardir, const TQString & root ) { - QStringList list = tardir->entries(); + TQStringList list = tardir->entries(); - QStringList::const_iterator itEnd = list.constEnd(); + TQStringList::const_iterator itEnd = list.constEnd(); - for ( QStringList::const_iterator it = list.constBegin(); it != itEnd; ++it ) + for ( TQStringList::const_iterator it = list.constBegin(); it != itEnd; ++it ) { const KTarEntry* tarEntry = tardir->entry((*it)); if (!tarEntry) continue; - QStringList col_list; - QString name; + TQStringList col_list; + TQString name; if (root.isEmpty() || root.isNull()) name = tarEntry->name(); else @@ -128,7 +128,7 @@ void TarListingThread::processDir( const KTarDirectory *tardir, const QString & if ( !tarEntry->isFile() ) name += '/'; col_list.append( name ); - QString perms = makeAccessString(tarEntry->permissions()); + TQString perms = makeAccessString(tarEntry->permissions()); if (!tarEntry->isFile()) perms = "d" + perms; else if (!tarEntry->symlink().isEmpty()) @@ -138,13 +138,13 @@ void TarListingThread::processDir( const KTarDirectory *tardir, const QString & col_list.append(perms); col_list.append( tarEntry->user() ); col_list.append( tarEntry->group() ); - QString strSize = "0"; + TQString strSize = "0"; if (tarEntry->isFile()) { strSize.sprintf("%d", ((KTarFile *)tarEntry)->size()); } col_list.append(strSize); - QString timestamp = tarEntry->datetime().toString(ISODate); + TQString timestamp = tarEntry->datetime().toString(ISODate); col_list.append(timestamp); col_list.append(tarEntry->symlink()); diff --git a/ark/tarlistingthread.h b/ark/tarlistingthread.h index f9de02b..b79f10c 100644 --- a/ark/tarlistingthread.h +++ b/ark/tarlistingthread.h @@ -22,9 +22,9 @@ #ifndef TARLISTINGTHREAD_H #define TARLISTINGTHREAD_H -#include <qthread.h> -#include <qstringlist.h> -#include <qevent.h> +#include <tqthread.h> +#include <tqstringlist.h> +#include <tqevent.h> class QString; class KArchive; @@ -33,31 +33,31 @@ class ListingEvent: public QCustomEvent { public: enum Status { Normal, Error, ListingFinished }; - ListingEvent( const QStringList& data, Status st = Normal ) - : QCustomEvent( 65442 ), m_data( data ), m_status( st ) {} + ListingEvent( const TQStringList& data, Status st = Normal ) + : TQCustomEvent( 65442 ), m_data( data ), m_status( st ) {} - const QStringList& columns() const { return m_data; } + const TQStringList& columns() const { return m_data; } Status status() const { return m_status; } private: - QStringList m_data; + TQStringList m_data; Status m_status; }; class TarListingThread: public QThread { public: - TarListingThread( QObject *parent, const QString& filename ); + TarListingThread( TQObject *parent, const TQString& filename ); ~TarListingThread(); protected: void run(); private: - void processDir( const KTarDirectory *tardir, const QString & root ); + void processDir( const KTarDirectory *tardir, const TQString & root ); KArchive *m_archive; - QObject *m_parent; + TQObject *m_parent; }; #endif // TARLISTINGTHREAD_H diff --git a/ark/zip.cpp b/ark/zip.cpp index 3538d11..f223016 100644 --- a/ark/zip.cpp +++ b/ark/zip.cpp @@ -27,7 +27,7 @@ // Qt includes -#include <qdir.h> +#include <tqdir.h> // KDE includes #include <kdebug.h> @@ -41,7 +41,7 @@ #include "settings.h" -ZipArch::ZipArch( ArkWidget *_gui, const QString & _fileName ) +ZipArch::ZipArch( ArkWidget *_gui, const TQString & _fileName ) : Arch( _gui, _fileName ) { m_archiver_program = "zip"; @@ -54,16 +54,16 @@ ZipArch::ZipArch( ArkWidget *_gui, const QString & _fileName ) m_dateCol = 5; m_numCols = 7; - m_archCols.append( new ArchColumns( 1, QRegExp( "[0-9]+" ) ) ); - m_archCols.append( new ArchColumns( 2, QRegExp( "[^\\s]+" ) ) ); - m_archCols.append( new ArchColumns( 3, QRegExp( "[0-9]+" ) ) ); - m_archCols.append( new ArchColumns( 4, QRegExp( "[0-9.]+%" ) ) ); - m_archCols.append( new ArchColumns( 7, QRegExp( "[01][0-9]" ), 2 ) ); - m_archCols.append( new ArchColumns( 8, QRegExp( "[0-3][0-9]" ), 2 ) ); - m_archCols.append( new ArchColumns( 9, QRegExp( "[0-9][0-9]" ), 2 ) ); - m_archCols.append( new ArchColumns( 10, QRegExp( "[0-9:]+" ), 6 ) ); - m_archCols.append( new ArchColumns( 6, QRegExp( "[a-fA-F0-9]+ {2}" ) ) ); - m_archCols.append( new ArchColumns( 0, QRegExp( "[^\\n]+" ), 4096 ) ); + m_archCols.append( new ArchColumns( 1, TQRegExp( "[0-9]+" ) ) ); + m_archCols.append( new ArchColumns( 2, TQRegExp( "[^\\s]+" ) ) ); + m_archCols.append( new ArchColumns( 3, TQRegExp( "[0-9]+" ) ) ); + m_archCols.append( new ArchColumns( 4, TQRegExp( "[0-9.]+%" ) ) ); + m_archCols.append( new ArchColumns( 7, TQRegExp( "[01][0-9]" ), 2 ) ); + m_archCols.append( new ArchColumns( 8, TQRegExp( "[0-3][0-9]" ), 2 ) ); + m_archCols.append( new ArchColumns( 9, TQRegExp( "[0-9][0-9]" ), 2 ) ); + m_archCols.append( new ArchColumns( 10, TQRegExp( "[0-9:]+" ), 6 ) ); + m_archCols.append( new ArchColumns( 6, TQRegExp( "[a-fA-F0-9]+ {2}" ) ) ); + m_archCols.append( new ArchColumns( 0, TQRegExp( "[^\\n]+" ), 4096 ) ); } @@ -93,17 +93,17 @@ void ZipArch::open() *kp << m_unarchiver_program << "-v" << m_filename; - connect( kp, SIGNAL( receivedStdout(KProcess*, char*, int) ), - SLOT( slotReceivedTOC(KProcess*, char*, int) ) ); - connect( kp, SIGNAL( receivedStderr(KProcess*, char*, int) ), - SLOT( slotReceivedOutput(KProcess*, char*, int) ) ); - connect( kp, SIGNAL( processExited(KProcess*) ), - SLOT( slotOpenExited(KProcess*) ) ); + connect( kp, TQT_SIGNAL( receivedStdout(KProcess*, char*, int) ), + TQT_SLOT( slotReceivedTOC(KProcess*, char*, int) ) ); + connect( kp, TQT_SIGNAL( receivedStderr(KProcess*, char*, int) ), + TQT_SLOT( slotReceivedOutput(KProcess*, char*, int) ) ); + connect( kp, TQT_SIGNAL( processExited(KProcess*) ), + TQT_SLOT( slotOpenExited(KProcess*) ) ); if ( !kp->start( KProcess::NotifyOnExit, KProcess::AllOutput ) ) { KMessageBox::error( 0, i18n( "Could not start a subprocess." ) ); - emit sigOpen( this, false, QString::null, 0 ); + emit sigOpen( this, false, TQString::null, 0 ); } } @@ -114,7 +114,7 @@ void ZipArch::create() Arch::Extract | Arch::Delete | Arch::Add | Arch::View ); } -void ZipArch::addDir( const QString & _dirName ) +void ZipArch::addDir( const TQString & _dirName ) { if ( !_dirName.isEmpty() ) { @@ -122,14 +122,14 @@ void ZipArch::addDir( const QString & _dirName ) // must be true for add directory - otherwise why would user try? ArkSettings::setRarRecurseSubdirs( true ); - QStringList list; + TQStringList list; list.append( _dirName ); addFile( list ); ArkSettings::setRarRecurseSubdirs( bOldRecVal ); // reset to old val } } -void ZipArch::addFile( const QStringList &urls ) +void ZipArch::addFile( const TQStringList &urls ) { KProcess *kp = m_currentProcess = new KProcess; kp->clearArguments(); @@ -156,21 +156,21 @@ void ZipArch::addFile( const QStringList &urls ) *kp << m_filename; - QStringList::ConstIterator iter; + TQStringList::ConstIterator iter; KURL url( urls.first() ); - QDir::setCurrent( url.directory() ); + TQDir::setCurrent( url.directory() ); for ( iter = urls.begin(); iter != urls.end(); ++iter ) { KURL fileURL( *iter ); *kp << fileURL.fileName(); } - connect( kp, SIGNAL( receivedStdout(KProcess*, char*, int) ), - SLOT( slotReceivedOutput(KProcess*, char*, int) ) ); - connect( kp, SIGNAL( receivedStderr(KProcess*, char*, int) ), - SLOT( slotReceivedOutput(KProcess*, char*, int) ) ); - connect( kp, SIGNAL( processExited(KProcess*) ), - SLOT( slotAddExited(KProcess*) ) ); + connect( kp, TQT_SIGNAL( receivedStdout(KProcess*, char*, int) ), + TQT_SLOT( slotReceivedOutput(KProcess*, char*, int) ) ); + connect( kp, TQT_SIGNAL( receivedStderr(KProcess*, char*, int) ), + TQT_SLOT( slotReceivedOutput(KProcess*, char*, int) ) ); + connect( kp, TQT_SIGNAL( processExited(KProcess*) ), + TQT_SLOT( slotAddExited(KProcess*) ) ); if ( !kp->start( KProcess::NotifyOnExit, KProcess::AllOutput ) ) { @@ -214,7 +214,7 @@ void ZipArch::unarchFileInternal() // and we then extract everything in the archive. if ( m_fileList ) { - QStringList::Iterator it; + TQStringList::Iterator it; for ( it = m_fileList->begin(); it != m_fileList->end(); ++it ) { @@ -224,12 +224,12 @@ void ZipArch::unarchFileInternal() *kp << "-d" << m_destDir; - connect( kp, SIGNAL( receivedStdout(KProcess*, char*, int) ), - SLOT( slotReceivedOutput(KProcess*, char*, int) ) ); - connect( kp, SIGNAL( receivedStderr(KProcess*, char*, int) ), - SLOT( slotReceivedOutput(KProcess*, char*, int) ) ); - connect( kp, SIGNAL( processExited(KProcess*) ), - SLOT( slotExtractExited(KProcess*) ) ); + connect( kp, TQT_SIGNAL( receivedStdout(KProcess*, char*, int) ), + TQT_SLOT( slotReceivedOutput(KProcess*, char*, int) ) ); + connect( kp, TQT_SIGNAL( receivedStderr(KProcess*, char*, int) ), + TQT_SLOT( slotReceivedOutput(KProcess*, char*, int) ) ); + connect( kp, TQT_SIGNAL( processExited(KProcess*) ), + TQT_SLOT( slotExtractExited(KProcess*) ) ); if ( !kp->start( KProcess::NotifyOnExit, KProcess::AllOutput ) ) { @@ -243,7 +243,7 @@ bool ZipArch::passwordRequired() return m_lastShellOutput.findRev("unable to get password\n")!=-1 || m_lastShellOutput.endsWith("password inflating\n") || m_lastShellOutput.findRev("password incorrect--reenter:")!=-1 || m_lastShellOutput.endsWith("incorrect password\n"); } -void ZipArch::remove( QStringList *list ) +void ZipArch::remove( TQStringList *list ) { if ( !list ) return; @@ -253,19 +253,19 @@ void ZipArch::remove( QStringList *list ) *kp << m_archiver_program << "-d" << m_filename; - QStringList::Iterator it; + TQStringList::Iterator it; for ( it = list->begin(); it != list->end(); ++it ) { - QString str = *it; + TQString str = *it; *kp << str; } - connect( kp, SIGNAL( receivedStdout(KProcess*, char*, int) ), - SLOT( slotReceivedOutput(KProcess*, char*, int) ) ); - connect( kp, SIGNAL( receivedStderr(KProcess*, char*, int) ), - SLOT( slotReceivedOutput(KProcess*, char*, int) ) ); - connect( kp, SIGNAL( processExited(KProcess*) ), - SLOT( slotDeleteExited(KProcess*) ) ); + connect( kp, TQT_SIGNAL( receivedStdout(KProcess*, char*, int) ), + TQT_SLOT( slotReceivedOutput(KProcess*, char*, int) ) ); + connect( kp, TQT_SIGNAL( receivedStderr(KProcess*, char*, int) ), + TQT_SLOT( slotReceivedOutput(KProcess*, char*, int) ) ); + connect( kp, TQT_SIGNAL( processExited(KProcess*) ), + TQT_SLOT( slotDeleteExited(KProcess*) ) ); if ( !kp->start( KProcess::NotifyOnExit, KProcess::AllOutput ) ) { @@ -39,16 +39,16 @@ class ZipArch : public Arch { Q_OBJECT public: - ZipArch( ArkWidget *_gui, const QString & _fileName ); + ZipArch( ArkWidget *_gui, const TQString & _fileName ); virtual ~ZipArch() { } virtual void open(); virtual void create(); - virtual void addFile( const QStringList & ); - virtual void addDir( const QString & ); + virtual void addFile( const TQStringList & ); + virtual void addDir( const TQString & ); - virtual void remove( QStringList * ); + virtual void remove( TQStringList * ); virtual void unarchFileInternal(); virtual bool passwordRequired(); private: diff --git a/ark/zoo.cpp b/ark/zoo.cpp index 9116ea5..8896251 100644 --- a/ark/zoo.cpp +++ b/ark/zoo.cpp @@ -32,8 +32,8 @@ #include <string.h> // QT includes -#include <qfile.h> -#include <qdir.h> +#include <tqfile.h> +#include <tqdir.h> // KDE includes #include <kdebug.h> @@ -49,9 +49,9 @@ #include "arkutils.h" #include "filelistview.h" -static QString fixTime( const QString &_strTime ); +static TQString fixTime( const TQString &_strTime ); -ZooArch::ZooArch( ArkWidget *gui, const QString & fileName ) +ZooArch::ZooArch( ArkWidget *gui, const TQString & fileName ) : Arch( gui, fileName ) { m_archiver_program = m_unarchiver_program = "zoo"; @@ -61,7 +61,7 @@ ZooArch::ZooArch( ArkWidget *gui, const QString & fileName ) m_headerString = "----"; } -bool ZooArch::processLine( const QCString &line ) +bool ZooArch::processLine( const TQCString &line ) { const char *_line = ( const char * )line; char columns[11][80]; @@ -74,9 +74,9 @@ bool ZooArch::processLine( const QCString &line ) columns[1], columns[0], columns[2], columns[3], columns[7], columns[8], columns[9], columns[4], columns[10], filename ); - QString year = ArkUtils::fixYear( columns[8] ); + TQString year = ArkUtils::fixYear( columns[8] ); - QString strDate; + TQString strDate; strDate.sprintf( "%s-%.2d-%.2d", year.utf8().data(), ArkUtils::getMonth( columns[7] ), atoi( columns[3] ) ); @@ -86,12 +86,12 @@ bool ZooArch::processLine( const QCString &line ) strlcat( columns[3], " ", sizeof( columns[3] ) ); strlcat( columns[3], fixTime( columns[4] ).ascii(), sizeof( columns[3] ) ); - QStringList list; - list.append( QFile::decodeName( filename ) ); + TQStringList list; + list.append( TQFile::decodeName( filename ) ); for ( int i=0; i<4; i++ ) { - list.append( QString::fromLocal8Bit( columns[i] ) ); + list.append( TQString::fromLocal8Bit( columns[i] ) ); } m_gui->fileList()->addItem( list ); // send to GUI @@ -110,17 +110,17 @@ void ZooArch::open() KProcess *kp = m_currentProcess = new KProcess; *kp << m_archiver_program << "l" << m_filename; - connect( kp, SIGNAL( receivedStdout(KProcess*, char*, int) ), - SLOT( slotReceivedTOC(KProcess*, char*, int) ) ); - connect( kp, SIGNAL( receivedStderr(KProcess*, char*, int) ), - SLOT( slotReceivedOutput(KProcess*, char*, int) ) ); - connect( kp, SIGNAL( processExited(KProcess*) ), - SLOT( slotOpenExited(KProcess*) ) ); + connect( kp, TQT_SIGNAL( receivedStdout(KProcess*, char*, int) ), + TQT_SLOT( slotReceivedTOC(KProcess*, char*, int) ) ); + connect( kp, TQT_SIGNAL( receivedStderr(KProcess*, char*, int) ), + TQT_SLOT( slotReceivedOutput(KProcess*, char*, int) ) ); + connect( kp, TQT_SIGNAL( processExited(KProcess*) ), + TQT_SLOT( slotOpenExited(KProcess*) ) ); if ( !kp->start( KProcess::NotifyOnExit, KProcess::AllOutput ) ) { KMessageBox::error( 0, i18n( "Could not start a subprocess." ) ); - emit sigOpen( this, false, QString::null, 0 ); + emit sigOpen( this, false, TQString::null, 0 ); } } @@ -143,17 +143,17 @@ void ZooArch::create() Arch::Extract | Arch::Delete | Arch::Add | Arch::View); } -void ZooArch::addDir( const QString & _dirName ) +void ZooArch::addDir( const TQString & _dirName ) { if ( ! _dirName.isEmpty() ) { - QStringList list; + TQStringList list; list.append( _dirName ); addFile( list ); } } -void ZooArch::addFile( const QStringList &urls ) +void ZooArch::addFile( const TQStringList &urls ) { KProcess *kp = m_currentProcess = new KProcess; kp->clearArguments(); @@ -167,9 +167,9 @@ void ZooArch::addFile( const QStringList &urls ) *kp << m_filename; KURL url( urls.first() ); - QDir::setCurrent( url.directory() ); + TQDir::setCurrent( url.directory() ); - QStringList::ConstIterator iter; + TQStringList::ConstIterator iter; for ( iter = urls.begin(); iter != urls.end(); ++iter ) { @@ -177,12 +177,12 @@ void ZooArch::addFile( const QStringList &urls ) *kp << fileURL.fileName(); } - connect( kp, SIGNAL( receivedStdout(KProcess*, char*, int) ), - SLOT( slotReceivedOutput(KProcess*, char*, int) ) ); - connect( kp, SIGNAL( receivedStderr(KProcess*, char*, int) ), - SLOT( slotReceivedOutput(KProcess*, char*, int) ) ); - connect( kp, SIGNAL( processExited(KProcess*) ), - SLOT( slotAddExited(KProcess*) ) ); + connect( kp, TQT_SIGNAL( receivedStdout(KProcess*, char*, int) ), + TQT_SLOT( slotReceivedOutput(KProcess*, char*, int) ) ); + connect( kp, TQT_SIGNAL( receivedStderr(KProcess*, char*, int) ), + TQT_SLOT( slotReceivedOutput(KProcess*, char*, int) ) ); + connect( kp, TQT_SIGNAL( processExited(KProcess*) ), + TQT_SLOT( slotAddExited(KProcess*) ) ); if ( !kp->start( KProcess::NotifyOnExit, KProcess::AllOutput ) ) { @@ -205,7 +205,7 @@ void ZooArch::unarchFileInternal() // zoo has no option to specify the destination directory // so we have to change to it. - bool ret = QDir::setCurrent( m_destDir ); + bool ret = TQDir::setCurrent( m_destDir ); // We already checked the validity of the dir before coming here Q_ASSERT(ret); @@ -229,19 +229,19 @@ void ZooArch::unarchFileInternal() // and we then extract everything in the archive. if (m_fileList) { - QStringList::Iterator it; + TQStringList::Iterator it; for ( it = m_fileList->begin(); it != m_fileList->end(); ++it ) { *kp << (*it); } } - connect( kp, SIGNAL( receivedStdout(KProcess*, char*, int) ), - SLOT( slotReceivedOutput(KProcess*, char*, int) ) ); - connect( kp, SIGNAL( receivedStderr(KProcess*, char*, int) ), - SLOT( slotReceivedOutput(KProcess*, char*, int) ) ); - connect( kp, SIGNAL( processExited(KProcess*) ), - SLOT( slotExtractExited(KProcess*) ) ); + connect( kp, TQT_SIGNAL( receivedStdout(KProcess*, char*, int) ), + TQT_SLOT( slotReceivedOutput(KProcess*, char*, int) ) ); + connect( kp, TQT_SIGNAL( receivedStderr(KProcess*, char*, int) ), + TQT_SLOT( slotReceivedOutput(KProcess*, char*, int) ) ); + connect( kp, TQT_SIGNAL( processExited(KProcess*) ), + TQT_SLOT( slotExtractExited(KProcess*) ) ); if ( !kp->start( KProcess::NotifyOnExit, KProcess::AllOutput ) ) { @@ -250,7 +250,7 @@ void ZooArch::unarchFileInternal() } } -void ZooArch::remove( QStringList *list ) +void ZooArch::remove( TQStringList *list ) { if (!list) return; @@ -260,19 +260,19 @@ void ZooArch::remove( QStringList *list ) *kp << m_archiver_program << "D" << m_filename; - QStringList::Iterator it; + TQStringList::Iterator it; for ( it = list->begin(); it != list->end(); ++it ) { - QString str = *it; + TQString str = *it; *kp << str; } - connect( kp, SIGNAL( receivedStdout(KProcess*, char*, int) ), - SLOT( slotReceivedOutput(KProcess*, char*, int) ) ); - connect( kp, SIGNAL( receivedStderr(KProcess*, char*, int) ), - SLOT( slotReceivedOutput(KProcess*, char*, int) ) ); - connect( kp, SIGNAL( processExited(KProcess*) ), - SLOT( slotDeleteExited(KProcess*) ) ); + connect( kp, TQT_SIGNAL( receivedStdout(KProcess*, char*, int) ), + TQT_SLOT( slotReceivedOutput(KProcess*, char*, int) ) ); + connect( kp, TQT_SIGNAL( receivedStderr(KProcess*, char*, int) ), + TQT_SLOT( slotReceivedOutput(KProcess*, char*, int) ) ); + connect( kp, TQT_SIGNAL( processExited(KProcess*) ), + TQT_SLOT( slotDeleteExited(KProcess*) ) ); if ( !kp->start( KProcess::NotifyOnExit, KProcess::AllOutput ) ) { @@ -281,17 +281,17 @@ void ZooArch::remove( QStringList *list ) } } -QString fixTime( const QString &_strTime ) +TQString fixTime( const TQString &_strTime ) { // it may have come from a different time zone... get rid of trailing // +3 or -3 etc. - QString strTime = _strTime; + TQString strTime = _strTime; if ( strTime.contains("+") || strTime.contains("-") ) { - QCharRef c = strTime.at( 8 ); + TQCharRef c = strTime.at( 8 ); int offset = strTime.right( strTime.length() - 9 ).toInt(); - QString strHour = strTime.left( 2 ); + TQString strHour = strTime.left( 2 ); int nHour = strHour.toInt(); if ( c == '+' || c == '-' ) { @@ -37,20 +37,20 @@ class ZooArch : public Arch { Q_OBJECT public: - ZooArch( ArkWidget *, const QString & ); + ZooArch( ArkWidget *, const TQString & ); virtual ~ZooArch() { } virtual void open(); virtual void create(); - virtual void addFile( const QStringList & ); - virtual void addDir( const QString & ); + virtual void addFile( const TQStringList & ); + virtual void addDir( const TQString & ); - virtual void remove( QStringList * ); + virtual void remove( TQStringList * ); virtual void unarchFileInternal(); protected slots: - virtual bool processLine( const QCString &line ); + virtual bool processLine( const TQCString &line ); private: void setHeaders(); diff --git a/charselectapplet/charselectapplet.cpp b/charselectapplet/charselectapplet.cpp index f2fccbc..24cc55a 100644 --- a/charselectapplet/charselectapplet.cpp +++ b/charselectapplet/charselectapplet.cpp @@ -23,12 +23,12 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include <math.h> -#include <qlayout.h> -#include <qpainter.h> -#include <qclipboard.h> -#include <qvbox.h> -#include <qspinbox.h> -#include <qlabel.h> +#include <tqlayout.h> +#include <tqpainter.h> +#include <tqclipboard.h> +#include <tqvbox.h> +#include <tqspinbox.h> +#include <tqlabel.h> #include <klocale.h> #include <kglobal.h> @@ -41,7 +41,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. extern "C" { - KDE_EXPORT KPanelApplet* init(QWidget *parent, const QString& configFile) + KDE_EXPORT KPanelApplet* init(TQWidget *parent, const TQString& configFile) { KGlobal::locale()->insertCatalogue("kcharselectapplet"); return new CharSelectApplet(configFile, KPanelApplet::Normal, @@ -54,8 +54,8 @@ static int cell_width = 16; static int cell_height = 16; static int char_count = 0; -CharSelectApplet::CharSelectApplet(const QString& configFile, Type type, int actions, - QWidget *parent, const char *name) +CharSelectApplet::CharSelectApplet(const TQString& configFile, Type type, int actions, + TQWidget *parent, const char *name) : KPanelApplet(configFile, type, actions, parent, name), _aboutData(0), _configDialog(0) { @@ -64,10 +64,10 @@ CharSelectApplet::CharSelectApplet(const QString& configFile, Type type, int act c->setGroup("General"); cell_width = c->readNumEntry("CellWidth", cell_width); cell_height = c->readNumEntry("CellHeight", cell_height); - QString characters = c->readEntry("Characters", "ÄäÖöÜüß©®§"); + TQString characters = c->readEntry("Characters", "ÄäÖöÜüß©®§"); // setup layout - QHBoxLayout *_layout = new QHBoxLayout(this); + TQHBoxLayout *_layout = new TQHBoxLayout(this); _layout->setAutoAdd(true); // setup table view @@ -118,7 +118,7 @@ void CharSelectApplet::preferences() _configDialog->setCharacters(_table->characters()); _configDialog->setCellWidth(cell_width); _configDialog->setCellHeight(cell_height); - _configDialog->setInitialSize(QSize(300, 100)); + _configDialog->setInitialSize(TQSize(300, 100)); _configDialog->exec(); cell_width = _configDialog->cellWidth(); @@ -151,14 +151,14 @@ void CharSelectApplet::about() dialog.exec(); } -CharTable::CharTable(QWidget* parent, const char* name) - : QFrame(parent, name), _rows(2), _cols(2), +CharTable::CharTable(TQWidget* parent, const char* name) + : TQFrame(parent, name), _rows(2), _cols(2), _activeRow(-1), _activeCol(-1), _cWidth(cell_width), _cHeight(cell_height) { - setFrameStyle(QFrame::StyledPanel | QFrame::Sunken); - setFocusPolicy(QWidget::NoFocus); - setBackgroundMode(QWidget::NoBackground); + setFrameStyle(TQFrame::StyledPanel | TQFrame::Sunken); + setFocusPolicy(TQWidget::NoFocus); + setBackgroundMode(TQWidget::NoBackground); } void CharTable::setRowsAndColumns(int r, int c) @@ -167,27 +167,27 @@ void CharTable::setRowsAndColumns(int r, int c) _cols = c; } -void CharTable::insertChar(QChar c) +void CharTable::insertChar(TQChar c) { _map.insert(char_count++, c); } -void CharTable::insertString(QString s) +void CharTable::insertString(TQString s) { for (unsigned int i = 0; i < s.length(); i++) insertChar(s[i]); } -void CharTable::setCharacters(const QString& characters) +void CharTable::setCharacters(const TQString& characters) { _map.clear(); char_count = 0; insertString(characters); } -QString CharTable::characters() +TQString CharTable::characters() { - QString characters; + TQString characters; for (int r = 0; r <_rows; r++) for (int c = 0; c <_cols; c++) characters += _map[c + r * _cols]; @@ -205,15 +205,15 @@ int CharTable::findCol(int x) return x / _cWidth; } -void CharTable::resizeEvent(QResizeEvent*) +void CharTable::resizeEvent(TQResizeEvent*) { _cWidth = contentsRect().width() / _cols; _cHeight = contentsRect().height() / _rows; } -void CharTable::paintEvent(QPaintEvent* e) +void CharTable::paintEvent(TQPaintEvent* e) { - QPainter p(this); + TQPainter p(this); int xoffset = contentsRect().x(); int yoffset = contentsRect().y(); @@ -225,12 +225,12 @@ void CharTable::paintEvent(QPaintEvent* e) paintCell(&p, r, c); } } - QFrame::paintEvent(e); + TQFrame::paintEvent(e); } void CharTable::repaintCell(int r, int c) { - QPainter p(this); + TQPainter p(this); int xoffset = contentsRect().x(); int yoffset = contentsRect().y(); @@ -240,7 +240,7 @@ void CharTable::repaintCell(int r, int c) paintCell(&p, r, c); } -void CharTable::paintCell(QPainter* p, int row, int col) +void CharTable::paintCell(TQPainter* p, int row, int col) { int w = _cWidth; int h = _cHeight; @@ -251,28 +251,28 @@ void CharTable::paintCell(QPainter* p, int row, int col) // draw background if (active) { - p->setBrush(QBrush(colorGroup().highlight())); + p->setBrush(TQBrush(colorGroup().highlight())); p->setPen(NoPen); p->drawRect(0, 0, w, h); p->setPen(colorGroup().highlightedText()); } else { - p->setBrush(QBrush(colorGroup().base())); + p->setBrush(TQBrush(colorGroup().base())); p->setPen(NoPen); p->drawRect(0, 0, w, h); p->setPen(colorGroup().text()); } // set font - QFont f = font(); + TQFont f = font(); f.setPixelSize(10); p->setFont(f); // draw char - p->drawText(0, 0, x2, y2, AlignHCenter | AlignVCenter, QString(_map[col + row * _cols])); + p->drawText(0, 0, x2, y2, AlignHCenter | AlignVCenter, TQString(_map[col + row * _cols])); } -void CharTable::mousePressEvent(QMouseEvent *e) +void CharTable::mousePressEvent(TQMouseEvent *e) { int row = findRow(e->y()); if (row == -1) return; @@ -283,7 +283,7 @@ void CharTable::mousePressEvent(QMouseEvent *e) selectCell(row, col); } -void CharTable::mouseMoveEvent(QMouseEvent *e) +void CharTable::mouseMoveEvent(TQMouseEvent *e) { if(!(e->state() & (LeftButton | RightButton | MidButton))) return; @@ -310,16 +310,16 @@ void CharTable::selectCell(int row, int col) repaintCell(oldRow, oldCol); repaintCell(_activeRow, _activeCol); - QClipboard *cb = QApplication::clipboard(); - QObject::disconnect( cb, SIGNAL(dataChanged()), this, SLOT(clearCell()) ); - QString text = QString(_map[col + row * _cols]); + QClipboard *cb = TQApplication::clipboard(); + TQObject::disconnect( cb, TQT_SIGNAL(dataChanged()), this, TQT_SLOT(clearCell()) ); + TQString text = TQString(_map[col + row * _cols]); bool oldMode = cb->selectionModeEnabled(); cb->setSelectionMode( true ); cb->setText( text ); cb->setSelectionMode( false ); cb->setText( text ); cb->setSelectionMode( oldMode ); - QObject::connect( cb, SIGNAL(dataChanged()), this, SLOT(clearCell()) ); + TQObject::connect( cb, TQT_SIGNAL(dataChanged()), this, TQT_SLOT(clearCell()) ); } void CharTable::clearCell() @@ -332,27 +332,27 @@ void CharTable::clearCell() repaintCell(oldRow, oldCol); - QObject::disconnect( QApplication::clipboard(), SIGNAL(dataChanged()), this, SLOT(clearCell()) ); + TQObject::disconnect( TQApplication::clipboard(), TQT_SIGNAL(dataChanged()), this, TQT_SLOT(clearCell()) ); } -ConfigDialog::ConfigDialog(QWidget* parent, const char* name) +ConfigDialog::ConfigDialog(TQWidget* parent, const char* name) : KDialogBase(parent, name, true, i18n("Configuration"), Ok | Cancel, Ok, true) { - QVBox *page = makeVBoxMainWidget(); + TQVBox *page = makeVBoxMainWidget(); - QHBox *whbox = new QHBox(page); - QHBox *hhbox = new QHBox(page); - QHBox *chbox = new QHBox(page); + TQHBox *whbox = new TQHBox(page); + TQHBox *hhbox = new TQHBox(page); + TQHBox *chbox = new TQHBox(page); - QLabel *wlabel = new QLabel(i18n("Cell width:"), whbox); - QLabel *hlabel = new QLabel(i18n("Cell height:"), hhbox); - (void) new QLabel(i18n("Characters:"), chbox); + TQLabel *wlabel = new TQLabel(i18n("Cell width:"), whbox); + TQLabel *hlabel = new TQLabel(i18n("Cell height:"), hhbox); + (void) new TQLabel(i18n("Characters:"), chbox); - _widthSpinBox = new QSpinBox(whbox); + _widthSpinBox = new TQSpinBox(whbox); _widthSpinBox->setMinValue(1); - _heightSpinBox = new QSpinBox(hhbox); + _heightSpinBox = new TQSpinBox(hhbox); _heightSpinBox->setMinValue(1); _characterInput = new KLineEdit(chbox); diff --git a/charselectapplet/charselectapplet.h b/charselectapplet/charselectapplet.h index b54dc55..12855a1 100644 --- a/charselectapplet/charselectapplet.h +++ b/charselectapplet/charselectapplet.h @@ -24,7 +24,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #ifndef __charselectapplet_h__ #define __charselectapplet_h__ -#include <qmap.h> +#include <tqmap.h> #include <kpanelapplet.h> #include <kdialogbase.h> @@ -38,19 +38,19 @@ class ConfigDialog : public KDialogBase Q_OBJECT public: - ConfigDialog(QWidget* parent = 0, const char* name = 0); + ConfigDialog(TQWidget* parent = 0, const char* name = 0); - void setCharacters(const QString& s) { _characterInput->setText(s); } + void setCharacters(const TQString& s) { _characterInput->setText(s); } void setCellWidth(int w) { _widthSpinBox->setValue(w); } void setCellHeight(int h) { _heightSpinBox->setValue(h); } - QString characters() { return _characterInput->text(); } + TQString characters() { return _characterInput->text(); } int cellWidth() { return _widthSpinBox->value(); } int cellHeight() { return _heightSpinBox->value(); } private: - QSpinBox *_widthSpinBox; - QSpinBox *_heightSpinBox; + TQSpinBox *_widthSpinBox; + TQSpinBox *_heightSpinBox; KLineEdit *_characterInput; }; @@ -59,25 +59,25 @@ class CharTable : public QFrame Q_OBJECT public: - CharTable(QWidget* parent = 0, const char* name = 0); + CharTable(TQWidget* parent = 0, const char* name = 0); void setRowsAndColumns(int, int); - void setCharacters(const QString&); - QString characters(); + void setCharacters(const TQString&); + TQString characters(); protected: - void paintEvent(QPaintEvent*); - void resizeEvent(QResizeEvent*); - void mousePressEvent(QMouseEvent*); - void mouseMoveEvent(QMouseEvent*); + void paintEvent(TQPaintEvent*); + void resizeEvent(TQResizeEvent*); + void mousePressEvent(TQMouseEvent*); + void mouseMoveEvent(TQMouseEvent*); - void paintCell(QPainter*, int, int); + void paintCell(TQPainter*, int, int); void repaintCell(int, int); void selectCell(int row, int col); - void insertString(QString s); - void insertChar(QChar c); + void insertString(TQString s); + void insertChar(TQChar c); int findRow(int y); int findCol(int x); @@ -89,7 +89,7 @@ private: int _activeRow, _activeCol; int _cWidth, _cHeight; int _charcount; - QMap<int, QChar> _map; + TQMap<int, TQChar> _map; }; class CharSelectApplet : public KPanelApplet @@ -97,8 +97,8 @@ class CharSelectApplet : public KPanelApplet Q_OBJECT public: - CharSelectApplet(const QString& configFile, Type t = Stretch, int actions = 0, - QWidget *parent = 0, const char *name = 0); + CharSelectApplet(const TQString& configFile, Type t = Stretch, int actions = 0, + TQWidget *parent = 0, const char *name = 0); int widthForHeight(int height) const; int heightForWidth(int width) const; diff --git a/kcalc/confvalues.h b/kcalc/confvalues.h index 0ec1fae..fcfd5e1 100644 --- a/kcalc/confvalues.h +++ b/kcalc/confvalues.h @@ -28,21 +28,21 @@ typedef struct _DefStruct { - QColor forecolor; - QColor backcolor; - QColor numberButtonColor; - QColor functionButtonColor; - QColor statButtonColor; - QColor hexButtonColor; - QColor memoryButtonColor; - QColor operationButtonColor; + TQColor forecolor; + TQColor backcolor; + TQColor numberButtonColor; + TQColor functionButtonColor; + TQColor statButtonColor; + TQColor hexButtonColor; + TQColor memoryButtonColor; + TQColor operationButtonColor; int precision; int fixedprecision; bool fixed; bool beep; bool capres; - QFont font; + TQFont font; } DefStruct; #endif // _CONF_VALUES_H_ diff --git a/kcalc/dlabel.cpp b/kcalc/dlabel.cpp index 8c6c062..c4dbb17 100644 --- a/kcalc/dlabel.cpp +++ b/kcalc/dlabel.cpp @@ -23,7 +23,7 @@ */ -#include <qglobal.h> +#include <tqglobal.h> #include <kactioncollection.h> #include <kstdaction.h> @@ -34,14 +34,14 @@ -DispLogic::DispLogic(QWidget *parent, const char *name, +DispLogic::DispLogic(TQWidget *parent, const char *name, KActionCollection *coll) :KCalcDisplay(parent,name), _history_index(0) { KNumber::setDefaultFloatOutput(true); KNumber::setDefaultFractionalInput(true); - _back = KStdAction::undo(this, SLOT(history_back()), coll); - _forward = KStdAction::redo(this, SLOT(history_forward()), coll); + _back = KStdAction::undo(this, TQT_SLOT(history_back()), coll); + _forward = KStdAction::redo(this, TQT_SLOT(history_forward()), coll); _forward->setEnabled(false); _back->setEnabled(false); @@ -53,11 +53,11 @@ DispLogic::~DispLogic() void DispLogic::changeSettings() { - QPalette pal = palette(); + TQPalette pal = palette(); - pal.setColor(QColorGroup::Text, KCalcSettings::foreColor()); - pal.setColor(QColorGroup::Foreground, KCalcSettings::foreColor()); - pal.setColor(QColorGroup::Background, KCalcSettings::backColor()); + pal.setColor(TQColorGroup::Text, KCalcSettings::foreColor()); + pal.setColor(TQColorGroup::Foreground, KCalcSettings::foreColor()); + pal.setColor(TQColorGroup::Background, KCalcSettings::backColor()); setPalette(pal); setBackgroundColor(KCalcSettings::backColor()); diff --git a/kcalc/dlabel.h b/kcalc/dlabel.h index a9c33c6..0a7c386 100644 --- a/kcalc/dlabel.h +++ b/kcalc/dlabel.h @@ -28,7 +28,7 @@ #ifndef _D_LABEL_H_ #define _D_LABEL_H_ -#include <qvaluevector.h> +#include <tqvaluevector.h> #include "kcalcdisplay.h" class CalcEngine; @@ -40,7 +40,7 @@ class DispLogic : public KCalcDisplay Q_OBJECT public: - DispLogic(QWidget *parent, const char *name, + DispLogic(TQWidget *parent, const char *name, KActionCollection *coll); ~DispLogic(); @@ -54,7 +54,7 @@ private slots: void history_forward(void); private: - QValueVector<KNumber> _history_list; + TQValueVector<KNumber> _history_list; int _history_index; KAction *_forward; diff --git a/kcalc/kcalc.cpp b/kcalc/kcalc.cpp index e7599cf..515536f 100644 --- a/kcalc/kcalc.cpp +++ b/kcalc/kcalc.cpp @@ -28,15 +28,15 @@ #include <unistd.h> -#include <qbuttongroup.h> -#include <qfont.h> -#include <qhbuttongroup.h> -#include <qlayout.h> -#include <qobjectlist.h> -#include <qradiobutton.h> -#include <qspinbox.h> -#include <qstyle.h> -#include <qtooltip.h> +#include <tqbuttongroup.h> +#include <tqfont.h> +#include <tqhbuttongroup.h> +#include <tqlayout.h> +#include <tqobjectlist.h> +#include <tqradiobutton.h> +#include <tqspinbox.h> +#include <tqstyle.h> +#include <tqtooltip.h> @@ -78,18 +78,18 @@ static const char description[] = I18N_NOOP("KDE Calculator"); static const char version[] = KCALCVERSION; -KCalculator::KCalculator(QWidget *parent, const char *name) +KCalculator::KCalculator(TQWidget *parent, const char *name) : KMainWindow(parent, name), inverse(false), hyp_mode(false), memory_num(0.0), calc_display(NULL), mInternalSpacing(4), core() { /* central widget to contain all the elements */ - QWidget *central = new QWidget(this); + TQWidget *central = new TQWidget(this); setCentralWidget(central); KAcceleratorManager::setNoAccel( central ); // Detect color change - connect(kapp,SIGNAL(kdisplayPaletteChanged()), SLOT(set_colors())); + connect(kapp,TQT_SIGNAL(kdisplayPaletteChanged()), TQT_SLOT(set_colors())); calc_display = new DispLogic(central, "display", actionCollection()); @@ -104,32 +104,32 @@ KCalculator::KCalculator(QWidget *parent, const char *name) toolBar()->close(); // Create Button to select BaseMode - BaseChooseGroup = new QHButtonGroup(i18n("Base"), central); - connect(BaseChooseGroup, SIGNAL(clicked(int)), SLOT(slotBaseSelected(int))); - BaseChooseGroup->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed, false); + BaseChooseGroup = new TQHButtonGroup(i18n("Base"), central); + connect(BaseChooseGroup, TQT_SIGNAL(clicked(int)), TQT_SLOT(slotBaseSelected(int))); + BaseChooseGroup->setSizePolicy(TQSizePolicy::Expanding, TQSizePolicy::Fixed, false); - pbBaseChoose[0] = new QRadioButton(i18n("He&x"), BaseChooseGroup, + pbBaseChoose[0] = new TQRadioButton(i18n("He&x"), BaseChooseGroup, "Hexadecimal-Switch"); - QToolTip::add(pbBaseChoose[0], i18n("Switch base to hexadecimal.")); + TQToolTip::add(pbBaseChoose[0], i18n("Switch base to hexadecimal.")); - pbBaseChoose[1] = new QRadioButton(i18n("&Dec"), BaseChooseGroup, + pbBaseChoose[1] = new TQRadioButton(i18n("&Dec"), BaseChooseGroup, "Decimal-Switch"); - QToolTip::add(pbBaseChoose[1], i18n("Switch base to decimal.")); + TQToolTip::add(pbBaseChoose[1], i18n("Switch base to decimal.")); - pbBaseChoose[2] = new QRadioButton(i18n("&Oct"), BaseChooseGroup, + pbBaseChoose[2] = new TQRadioButton(i18n("&Oct"), BaseChooseGroup, "Octal-Switch"); - QToolTip::add(pbBaseChoose[2], i18n("Switch base to octal.")); + TQToolTip::add(pbBaseChoose[2], i18n("Switch base to octal.")); - pbBaseChoose[3] = new QRadioButton(i18n("&Bin"), BaseChooseGroup, + pbBaseChoose[3] = new TQRadioButton(i18n("&Bin"), BaseChooseGroup, "Binary-Switch"); - QToolTip::add(pbBaseChoose[3], i18n("Switch base to binary.")); + TQToolTip::add(pbBaseChoose[3], i18n("Switch base to binary.")); // Create Button to select AngleMode - pbAngleChoose = new QPushButton(i18n("&Angle"), + pbAngleChoose = new TQPushButton(i18n("&Angle"), central, "ChooseAngleMode-Button"); - QToolTip::add(pbAngleChoose, i18n("Choose the unit for the angle measure")); + TQToolTip::add(pbAngleChoose, i18n("Choose the unit for the angle measure")); pbAngleChoose->setAutoDefault(false); KPopupMenu *angle_menu = new KPopupMenu(pbAngleChoose, "AngleMode-Selection-Menu"); @@ -138,7 +138,7 @@ KCalculator::KCalculator(QWidget *parent, const char *name) angle_menu->insertItem(i18n("Gradians"), 2); angle_menu->setCheckable(true); - connect(angle_menu, SIGNAL(activated(int)), SLOT(slotAngleSelected(int))); + connect(angle_menu, TQT_SIGNAL(activated(int)), TQT_SLOT(slotAngleSelected(int))); pbAngleChoose->setPopup(angle_menu); @@ -146,9 +146,9 @@ KCalculator::KCalculator(QWidget *parent, const char *name) pbInv = new KCalcButton("Inv", central, "Inverse-Button", i18n("Inverse mode")); pbInv->setAccel(Key_I); - connect(pbInv, SIGNAL(toggled(bool)), SLOT(slotInvtoggled(bool))); - connect(this, SIGNAL(switchShowAccels(bool)), - pbInv, SLOT(slotSetAccelDisplayMode(bool))); + connect(pbInv, TQT_SIGNAL(toggled(bool)), TQT_SLOT(slotInvtoggled(bool))); + connect(this, TQT_SIGNAL(switchShowAccels(bool)), + pbInv, TQT_SLOT(slotSetAccelDisplayMode(bool))); pbInv->setToggleButton(true); // @@ -156,8 +156,8 @@ KCalculator::KCalculator(QWidget *parent, const char *name) // // First the widgets that are the parents of the buttons - mSmallPage = new QWidget(central); - mLargePage = new QWidget(central); + mSmallPage = new TQWidget(central); + mLargePage = new TQWidget(central); mNumericPage = setupNumericKeys(central); setupLogicKeys(mSmallPage); @@ -170,25 +170,25 @@ KCalculator::KCalculator(QWidget *parent, const char *name) pbMod->addMode(ModeNormal, "Mod", i18n("Modulo")); pbMod->addMode(ModeInverse, "IntDiv", i18n("Integer division")); pbMod->setAccel(Key_Colon); - connect(this, SIGNAL(switchMode(ButtonModeFlags,bool)), - pbMod, SLOT(slotSetMode(ButtonModeFlags,bool))); - connect(this, SIGNAL(switchShowAccels(bool)), - pbMod, SLOT(slotSetAccelDisplayMode(bool))); - connect(pbMod, SIGNAL(clicked(void)), SLOT(slotModclicked(void))); + connect(this, TQT_SIGNAL(switchMode(ButtonModeFlags,bool)), + pbMod, TQT_SLOT(slotSetMode(ButtonModeFlags,bool))); + connect(this, TQT_SIGNAL(switchShowAccels(bool)), + pbMod, TQT_SLOT(slotSetAccelDisplayMode(bool))); + connect(pbMod, TQT_SIGNAL(clicked(void)), TQT_SLOT(slotModclicked(void))); pbReci = new KCalcButton(mSmallPage, "Reciprocal-Button"); pbReci->addMode(ModeNormal, "1/x", i18n("Reciprocal")); pbReci->setAccel(Key_R); - connect(this, SIGNAL(switchShowAccels(bool)), - pbReci, SLOT(slotSetAccelDisplayMode(bool))); - connect(pbReci, SIGNAL(clicked(void)), SLOT(slotReciclicked(void))); + connect(this, TQT_SIGNAL(switchShowAccels(bool)), + pbReci, TQT_SLOT(slotSetAccelDisplayMode(bool))); + connect(pbReci, TQT_SIGNAL(clicked(void)), TQT_SLOT(slotReciclicked(void))); pbFactorial = new KCalcButton(mSmallPage, "Factorial-Button"); pbFactorial->addMode(ModeNormal, "x!", i18n("Factorial")); pbFactorial->setAccel(Key_Exclam); - connect(this, SIGNAL(switchShowAccels(bool)), - pbFactorial, SLOT(slotSetAccelDisplayMode(bool))); - connect(pbFactorial, SIGNAL(clicked(void)),SLOT(slotFactorialclicked(void))); + connect(this, TQT_SIGNAL(switchShowAccels(bool)), + pbFactorial, TQT_SLOT(slotSetAccelDisplayMode(bool))); + connect(pbFactorial, TQT_SIGNAL(clicked(void)),TQT_SLOT(slotFactorialclicked(void))); // Representation of x^2 is moved to the function // changeRepresentation() that paints the letters When @@ -197,20 +197,20 @@ KCalculator::KCalculator(QWidget *parent, const char *name) pbSquare = new KCalcButton(mSmallPage, "Square-Button"); pbSquare->addMode(ModeNormal, "x<sup>2</sup>", i18n("Square"), true); pbSquare->addMode(ModeInverse, "x<sup>3</sup>", i18n("Third power"), true); - connect(this, SIGNAL(switchShowAccels(bool)), - pbSquare, SLOT(slotSetAccelDisplayMode(bool))); - connect(this, SIGNAL(switchMode(ButtonModeFlags,bool)), - pbSquare, SLOT(slotSetMode(ButtonModeFlags,bool))); - connect(pbSquare, SIGNAL(clicked(void)), SLOT(slotSquareclicked(void))); + connect(this, TQT_SIGNAL(switchShowAccels(bool)), + pbSquare, TQT_SLOT(slotSetAccelDisplayMode(bool))); + connect(this, TQT_SIGNAL(switchMode(ButtonModeFlags,bool)), + pbSquare, TQT_SLOT(slotSetMode(ButtonModeFlags,bool))); + connect(pbSquare, TQT_SIGNAL(clicked(void)), TQT_SLOT(slotSquareclicked(void))); pbRoot = new KSquareButton(mSmallPage, "Square-Button"); pbRoot->addMode(ModeNormal, "sqrt(x)", i18n("Square root")); pbRoot->addMode(ModeInverse, "sqrt[3](x)", i18n("Cube root")); - connect(this, SIGNAL(switchShowAccels(bool)), - pbRoot, SLOT(slotSetAccelDisplayMode(bool))); - connect(this, SIGNAL(switchMode(ButtonModeFlags,bool)), - pbRoot, SLOT(slotSetMode(ButtonModeFlags,bool))); - connect(pbRoot, SIGNAL(clicked(void)), SLOT(slotRootclicked(void))); + connect(this, TQT_SIGNAL(switchShowAccels(bool)), + pbRoot, TQT_SLOT(slotSetAccelDisplayMode(bool))); + connect(this, TQT_SIGNAL(switchMode(ButtonModeFlags,bool)), + pbRoot, TQT_SLOT(slotSetMode(ButtonModeFlags,bool))); + connect(pbRoot, TQT_SIGNAL(clicked(void)), TQT_SLOT(slotRootclicked(void))); // Representation of x^y is moved to the function @@ -219,28 +219,28 @@ KCalculator::KCalculator(QWidget *parent, const char *name) pbPower = new KCalcButton(mSmallPage, "Power-Button"); pbPower->addMode(ModeNormal, "x<sup>y</sup>", i18n("x to the power of y"), true); pbPower->addMode(ModeInverse, "x<sup>1/y</sup>", i18n("x to the power of 1/y"), true); - connect(this, SIGNAL(switchShowAccels(bool)), - pbPower, SLOT(slotSetAccelDisplayMode(bool))); - connect(this, SIGNAL(switchMode(ButtonModeFlags,bool)), - pbPower, SLOT(slotSetMode(ButtonModeFlags,bool))); + connect(this, TQT_SIGNAL(switchShowAccels(bool)), + pbPower, TQT_SLOT(slotSetAccelDisplayMode(bool))); + connect(this, TQT_SIGNAL(switchMode(ButtonModeFlags,bool)), + pbPower, TQT_SLOT(slotSetMode(ButtonModeFlags,bool))); pbPower->setAccel(Key_AsciiCircum); - connect(pbPower, SIGNAL(clicked(void)), SLOT(slotPowerclicked(void))); + connect(pbPower, TQT_SIGNAL(clicked(void)), TQT_SLOT(slotPowerclicked(void))); // // All these layouts are needed because all the groups have their - // own size per row so we can't use one huge QGridLayout (mosfet) + // own size per row so we can't use one huge TQGridLayout (mosfet) // - QGridLayout *smallBtnLayout = new QGridLayout(mSmallPage, 6, 4, 0, + TQGridLayout *smallBtnLayout = new TQGridLayout(mSmallPage, 6, 4, 0, mInternalSpacing); - QGridLayout *largeBtnLayout = new QGridLayout(mLargePage, 5, 2, 0, + TQGridLayout *largeBtnLayout = new TQGridLayout(mLargePage, 5, 2, 0, mInternalSpacing); - QHBoxLayout *topLayout = new QHBoxLayout(); - QHBoxLayout *btnLayout = new QHBoxLayout(); + TQHBoxLayout *topLayout = new TQHBoxLayout(); + TQHBoxLayout *btnLayout = new TQHBoxLayout(); // bring them all together - QVBoxLayout *mainLayout = new QVBoxLayout(central, mInternalSpacing, + TQVBoxLayout *mainLayout = new TQVBoxLayout(central, mInternalSpacing, mInternalSpacing); mainLayout->addLayout(topLayout); @@ -369,8 +369,8 @@ KCalculator::KCalculator(QWidget *parent, const char *name) // Show the result in the app's caption in taskbar (wishlist - bug #52858) if (KCalcSettings::captionResult() == true) connect(calc_display, - SIGNAL(changedText(const QString &)), - SLOT(setCaption(const QString &))); + TQT_SIGNAL(changedText(const TQString &)), + TQT_SLOT(setCaption(const TQString &))); calc_display->changeSettings(); set_precision(); @@ -409,48 +409,48 @@ KCalculator::~KCalculator() void KCalculator::setupMainActions(void) { // file menu - KStdAction::quit(this, SLOT(close()), actionCollection()); + KStdAction::quit(this, TQT_SLOT(close()), actionCollection()); // edit menu - KStdAction::cut(calc_display, SLOT(slotCut()), actionCollection()); - KStdAction::copy(calc_display, SLOT(slotCopy()), actionCollection()); - KStdAction::paste(calc_display, SLOT(slotPaste()), actionCollection()); + KStdAction::cut(calc_display, TQT_SLOT(slotCut()), actionCollection()); + KStdAction::copy(calc_display, TQT_SLOT(slotCopy()), actionCollection()); + KStdAction::paste(calc_display, TQT_SLOT(slotPaste()), actionCollection()); // settings menu actionStatshow = new KToggleAction(i18n("&Statistic Buttons"), 0, actionCollection(), "show_stat"); actionStatshow->setChecked(true); - connect(actionStatshow, SIGNAL(toggled(bool)), - SLOT(slotStatshow(bool))); + connect(actionStatshow, TQT_SIGNAL(toggled(bool)), + TQT_SLOT(slotStatshow(bool))); actionScientificshow = new KToggleAction(i18n("Science/&Engineering Buttons"), 0, actionCollection(), "show_science"); actionScientificshow->setChecked(true); - connect(actionScientificshow, SIGNAL(toggled(bool)), - SLOT(slotScientificshow(bool))); + connect(actionScientificshow, TQT_SIGNAL(toggled(bool)), + TQT_SLOT(slotScientificshow(bool))); actionLogicshow = new KToggleAction(i18n("&Logic Buttons"), 0, actionCollection(), "show_logic"); actionLogicshow->setChecked(true); - connect(actionLogicshow, SIGNAL(toggled(bool)), - SLOT(slotLogicshow(bool))); + connect(actionLogicshow, TQT_SIGNAL(toggled(bool)), + TQT_SLOT(slotLogicshow(bool))); actionConstantsShow = new KToggleAction(i18n("&Constants Buttons"), 0, actionCollection(), "show_constants"); actionConstantsShow->setChecked(true); - connect(actionConstantsShow, SIGNAL(toggled(bool)), - SLOT(slotConstantsShow(bool))); + connect(actionConstantsShow, TQT_SIGNAL(toggled(bool)), + TQT_SLOT(slotConstantsShow(bool))); - (void) new KAction(i18n("&Show All"), 0, this, SLOT(slotShowAll()), + (void) new KAction(i18n("&Show All"), 0, this, TQT_SLOT(slotShowAll()), actionCollection(), "show_all"); - (void) new KAction(i18n("&Hide All"), 0, this, SLOT(slotHideAll()), + (void) new KAction(i18n("&Hide All"), 0, this, TQT_SLOT(slotHideAll()), actionCollection(), "hide_all"); - KStdAction::preferences(this, SLOT(showSettings()), actionCollection()); + KStdAction::preferences(this, TQT_SLOT(showSettings()), actionCollection()); - KStdAction::keyBindings(guiFactory(), SLOT(configureShortcuts()), + KStdAction::keyBindings(guiFactory(), TQT_SLOT(configureShortcuts()), actionCollection()); } @@ -471,141 +471,141 @@ void KCalculator::setupStatusbar(void) statusBar()->setItemAlignment(3, AlignCenter); } -QWidget* KCalculator::setupNumericKeys(QWidget *parent) +TQWidget* KCalculator::setupNumericKeys(TQWidget *parent) { Q_CHECK_PTR(mSmallPage); Q_CHECK_PTR(mLargePage); - QWidget *thisPage = new QWidget(parent); + TQWidget *thisPage = new TQWidget(parent); KCalcButton *tmp_pb; - NumButtonGroup = new QButtonGroup(0, "Num-Button-Group"); - connect(NumButtonGroup, SIGNAL(clicked(int)), - SLOT(slotNumberclicked(int))); + NumButtonGroup = new TQButtonGroup(0, "Num-Button-Group"); + connect(NumButtonGroup, TQT_SIGNAL(clicked(int)), + TQT_SLOT(slotNumberclicked(int))); tmp_pb = new KCalcButton("0", thisPage, "0-Button"); tmp_pb->setAccel(Key_0); - connect(this, SIGNAL(switchShowAccels(bool)), - tmp_pb, SLOT(slotSetAccelDisplayMode(bool))); + connect(this, TQT_SIGNAL(switchShowAccels(bool)), + tmp_pb, TQT_SLOT(slotSetAccelDisplayMode(bool))); NumButtonGroup->insert(tmp_pb, 0); tmp_pb = new KCalcButton("1", thisPage, "1-Button"); tmp_pb->setAccel(Key_1); - connect(this, SIGNAL(switchShowAccels(bool)), - tmp_pb, SLOT(slotSetAccelDisplayMode(bool))); + connect(this, TQT_SIGNAL(switchShowAccels(bool)), + tmp_pb, TQT_SLOT(slotSetAccelDisplayMode(bool))); NumButtonGroup->insert(tmp_pb, 1); tmp_pb = new KCalcButton("2", thisPage, "2-Button"); tmp_pb->setAccel(Key_2); - connect(this, SIGNAL(switchShowAccels(bool)), - tmp_pb, SLOT(slotSetAccelDisplayMode(bool))); + connect(this, TQT_SIGNAL(switchShowAccels(bool)), + tmp_pb, TQT_SLOT(slotSetAccelDisplayMode(bool))); NumButtonGroup->insert(tmp_pb, 2); tmp_pb = new KCalcButton("3", thisPage, "3-Button"); tmp_pb->setAccel(Key_3); - connect(this, SIGNAL(switchShowAccels(bool)), - tmp_pb, SLOT(slotSetAccelDisplayMode(bool))); + connect(this, TQT_SIGNAL(switchShowAccels(bool)), + tmp_pb, TQT_SLOT(slotSetAccelDisplayMode(bool))); NumButtonGroup->insert(tmp_pb, 3); tmp_pb = new KCalcButton("4", thisPage, "4-Button"); tmp_pb->setAccel(Key_4); - connect(this, SIGNAL(switchShowAccels(bool)), - tmp_pb, SLOT(slotSetAccelDisplayMode(bool))); + connect(this, TQT_SIGNAL(switchShowAccels(bool)), + tmp_pb, TQT_SLOT(slotSetAccelDisplayMode(bool))); NumButtonGroup->insert(tmp_pb, 4); tmp_pb = new KCalcButton("5", thisPage, "5-Button"); tmp_pb->setAccel(Key_5); - connect(this, SIGNAL(switchShowAccels(bool)), - tmp_pb, SLOT(slotSetAccelDisplayMode(bool))); + connect(this, TQT_SIGNAL(switchShowAccels(bool)), + tmp_pb, TQT_SLOT(slotSetAccelDisplayMode(bool))); NumButtonGroup->insert(tmp_pb, 5); tmp_pb = new KCalcButton("6", thisPage, "6-Button"); tmp_pb->setAccel(Key_6); - connect(this, SIGNAL(switchShowAccels(bool)), - tmp_pb, SLOT(slotSetAccelDisplayMode(bool))); + connect(this, TQT_SIGNAL(switchShowAccels(bool)), + tmp_pb, TQT_SLOT(slotSetAccelDisplayMode(bool))); NumButtonGroup->insert(tmp_pb, 6); tmp_pb = new KCalcButton("7", thisPage, "7-Button"); tmp_pb->setAccel(Key_7); - connect(this, SIGNAL(switchShowAccels(bool)), - tmp_pb, SLOT(slotSetAccelDisplayMode(bool))); + connect(this, TQT_SIGNAL(switchShowAccels(bool)), + tmp_pb, TQT_SLOT(slotSetAccelDisplayMode(bool))); NumButtonGroup->insert(tmp_pb, 7); tmp_pb = new KCalcButton("8", thisPage, "8-Button"); tmp_pb->setAccel(Key_8); - connect(this, SIGNAL(switchShowAccels(bool)), - tmp_pb, SLOT(slotSetAccelDisplayMode(bool))); + connect(this, TQT_SIGNAL(switchShowAccels(bool)), + tmp_pb, TQT_SLOT(slotSetAccelDisplayMode(bool))); NumButtonGroup->insert(tmp_pb, 8); tmp_pb = new KCalcButton("9", thisPage, "9-Button"); tmp_pb->setAccel(Key_9); - connect(this, SIGNAL(switchShowAccels(bool)), - tmp_pb, SLOT(slotSetAccelDisplayMode(bool))); + connect(this, TQT_SIGNAL(switchShowAccels(bool)), + tmp_pb, TQT_SLOT(slotSetAccelDisplayMode(bool))); NumButtonGroup->insert(tmp_pb, 9); pbEE = new KCalcButton(thisPage, "EE-Button"); pbEE->addMode(ModeNormal, "x<small>" "\xb7" "10</small><sup>y</sup>", i18n("Exponent"), true); pbEE->setAccel(Key_E); - connect(this, SIGNAL(switchShowAccels(bool)), - pbEE, SLOT(slotSetAccelDisplayMode(bool))); - connect(pbEE, SIGNAL(clicked(void)), SLOT(slotEEclicked(void))); + connect(this, TQT_SIGNAL(switchShowAccels(bool)), + pbEE, TQT_SLOT(slotSetAccelDisplayMode(bool))); + connect(pbEE, TQT_SIGNAL(clicked(void)), TQT_SLOT(slotEEclicked(void))); pbParenClose = new KCalcButton(")", mLargePage, "ParenClose-Button"); pbParenClose->setAccel(Key_ParenRight); - connect(this, SIGNAL(switchShowAccels(bool)), - pbParenClose, SLOT(slotSetAccelDisplayMode(bool))); - connect(pbParenClose,SIGNAL(clicked(void)),SLOT(slotParenCloseclicked(void))); + connect(this, TQT_SIGNAL(switchShowAccels(bool)), + pbParenClose, TQT_SLOT(slotSetAccelDisplayMode(bool))); + connect(pbParenClose,TQT_SIGNAL(clicked(void)),TQT_SLOT(slotParenCloseclicked(void))); pbX = new KCalcButton("X", thisPage, "Multiply-Button", i18n("Multiplication")); pbX->setAccel(Key_multiply); - connect(this, SIGNAL(switchShowAccels(bool)), - pbX, SLOT(slotSetAccelDisplayMode(bool))); + connect(this, TQT_SIGNAL(switchShowAccels(bool)), + pbX, TQT_SLOT(slotSetAccelDisplayMode(bool))); accel()->insert("Pressed '*'", i18n("Pressed Multiplication-Button"), - 0, Key_Asterisk, pbX, SLOT(animateClick())); - connect(pbX, SIGNAL(clicked(void)), SLOT(slotXclicked(void))); + 0, Key_Asterisk, pbX, TQT_SLOT(animateClick())); + connect(pbX, TQT_SIGNAL(clicked(void)), TQT_SLOT(slotXclicked(void))); pbDivision = new KCalcButton("/", thisPage, "Division-Button", i18n("Division")); pbDivision->setAccel(Key_Slash); - connect(this, SIGNAL(switchShowAccels(bool)), - pbDivision, SLOT(slotSetAccelDisplayMode(bool))); - connect(pbDivision, SIGNAL(clicked(void)), SLOT(slotDivisionclicked(void))); + connect(this, TQT_SIGNAL(switchShowAccels(bool)), + pbDivision, TQT_SLOT(slotSetAccelDisplayMode(bool))); + connect(pbDivision, TQT_SIGNAL(clicked(void)), TQT_SLOT(slotDivisionclicked(void))); pbPlus = new KCalcButton("+", thisPage, "Plus-Button", i18n("Addition")); - connect(this, SIGNAL(switchShowAccels(bool)), - pbPlus, SLOT(slotSetAccelDisplayMode(bool))); + connect(this, TQT_SIGNAL(switchShowAccels(bool)), + pbPlus, TQT_SLOT(slotSetAccelDisplayMode(bool))); pbPlus->setAccel(Key_Plus); - connect(pbPlus, SIGNAL(clicked(void)), SLOT(slotPlusclicked(void))); + connect(pbPlus, TQT_SIGNAL(clicked(void)), TQT_SLOT(slotPlusclicked(void))); pbMinus = new KCalcButton("-", thisPage, "Minus-Button", i18n("Subtraction")); pbMinus->setAccel(Key_Minus); - connect(this, SIGNAL(switchShowAccels(bool)), - pbMinus, SLOT(slotSetAccelDisplayMode(bool))); - connect(pbMinus, SIGNAL(clicked(void)), SLOT(slotMinusclicked(void))); + connect(this, TQT_SIGNAL(switchShowAccels(bool)), + pbMinus, TQT_SLOT(slotSetAccelDisplayMode(bool))); + connect(pbMinus, TQT_SIGNAL(clicked(void)), TQT_SLOT(slotMinusclicked(void))); pbPeriod = new KCalcButton(KGlobal::locale()->decimalSymbol(), thisPage, "Period-Button", i18n("Decimal point")); - connect(this, SIGNAL(switchShowAccels(bool)), - pbPeriod, SLOT(slotSetAccelDisplayMode(bool))); + connect(this, TQT_SIGNAL(switchShowAccels(bool)), + pbPeriod, TQT_SLOT(slotSetAccelDisplayMode(bool))); accel()->insert("Decimal Point (Period)", i18n("Pressed Decimal Point"), - 0, Key_Period, pbPeriod, SLOT(animateClick())); + 0, Key_Period, pbPeriod, TQT_SLOT(animateClick())); accel()->insert("Decimal Point (Comma)", i18n("Pressed Decimal Point"), - 0, Key_Comma, pbPeriod, SLOT(animateClick())); - connect(pbPeriod, SIGNAL(clicked(void)), SLOT(slotPeriodclicked(void))); + 0, Key_Comma, pbPeriod, TQT_SLOT(animateClick())); + connect(pbPeriod, TQT_SIGNAL(clicked(void)), TQT_SLOT(slotPeriodclicked(void))); pbEqual = new KCalcButton("=", thisPage, "Equal-Button", i18n("Result")); pbEqual->setAccel(Key_Enter); - connect(this, SIGNAL(switchShowAccels(bool)), - pbEqual, SLOT(slotSetAccelDisplayMode(bool))); + connect(this, TQT_SIGNAL(switchShowAccels(bool)), + pbEqual, TQT_SLOT(slotSetAccelDisplayMode(bool))); accel()->insert("Entered Equal", i18n("Pressed Equal-Button"), - 0, Key_Equal, pbEqual, SLOT(animateClick())); + 0, Key_Equal, pbEqual, TQT_SLOT(animateClick())); accel()->insert("Entered Return", i18n("Pressed Equal-Button"), - 0, Key_Return, pbEqual, SLOT(animateClick())); - connect(pbEqual, SIGNAL(clicked(void)), SLOT(slotEqualclicked(void))); + 0, Key_Return, pbEqual, TQT_SLOT(animateClick())); + connect(pbEqual, TQT_SIGNAL(clicked(void)), TQT_SLOT(slotEqualclicked(void))); - QGridLayout *thisLayout = new QGridLayout(thisPage, 5, 4, 0, + TQGridLayout *thisLayout = new TQGridLayout(thisPage, 5, 4, 0, mInternalSpacing); // large button layout @@ -641,107 +641,107 @@ QWidget* KCalculator::setupNumericKeys(QWidget *parent) pbMemRecall = new KCalcButton("MR", mLargePage, "MemRecall-Button", i18n("Memory recall")); - connect(this, SIGNAL(switchShowAccels(bool)), - pbMemRecall, SLOT(slotSetAccelDisplayMode(bool))); - connect(pbMemRecall, SIGNAL(clicked(void)), - SLOT(slotMemRecallclicked(void))); + connect(this, TQT_SIGNAL(switchShowAccels(bool)), + pbMemRecall, TQT_SLOT(slotSetAccelDisplayMode(bool))); + connect(pbMemRecall, TQT_SIGNAL(clicked(void)), + TQT_SLOT(slotMemRecallclicked(void))); pbMemRecall->setDisabled(true); // At start, there is nothing in memory pbMemPlusMinus = new KCalcButton(mLargePage, "MPlusMinus-Button"); pbMemPlusMinus->addMode(ModeNormal, "M+", i18n("Add display to memory")); pbMemPlusMinus->addMode(ModeInverse, "M-", i18n("Subtract from memory")); - connect(this, SIGNAL(switchMode(ButtonModeFlags,bool)), - pbMemPlusMinus, SLOT(slotSetMode(ButtonModeFlags,bool))); - connect(this, SIGNAL(switchShowAccels(bool)), - pbMemPlusMinus, SLOT(slotSetAccelDisplayMode(bool))); - connect(pbMemPlusMinus,SIGNAL(clicked(void)), - SLOT(slotMemPlusMinusclicked(void))); + connect(this, TQT_SIGNAL(switchMode(ButtonModeFlags,bool)), + pbMemPlusMinus, TQT_SLOT(slotSetMode(ButtonModeFlags,bool))); + connect(this, TQT_SIGNAL(switchShowAccels(bool)), + pbMemPlusMinus, TQT_SLOT(slotSetAccelDisplayMode(bool))); + connect(pbMemPlusMinus,TQT_SIGNAL(clicked(void)), + TQT_SLOT(slotMemPlusMinusclicked(void))); pbMemStore = new KCalcButton("MS", mLargePage, "MemStore-Button", i18n("Memory store")); - connect(this, SIGNAL(switchShowAccels(bool)), - pbMemStore, SLOT(slotSetAccelDisplayMode(bool))); - connect(pbMemStore, SIGNAL(clicked(void)), SLOT(slotMemStoreclicked(void))); + connect(this, TQT_SIGNAL(switchShowAccels(bool)), + pbMemStore, TQT_SLOT(slotSetAccelDisplayMode(bool))); + connect(pbMemStore, TQT_SIGNAL(clicked(void)), TQT_SLOT(slotMemStoreclicked(void))); pbMC = new KCalcButton("MC", mLargePage, "MemClear-Button", i18n("Clear memory")); - connect(this, SIGNAL(switchShowAccels(bool)), - pbMC, SLOT(slotSetAccelDisplayMode(bool))); - connect(pbMC, SIGNAL(clicked(void)), SLOT(slotMCclicked(void))); + connect(this, TQT_SIGNAL(switchShowAccels(bool)), + pbMC, TQT_SLOT(slotSetAccelDisplayMode(bool))); + connect(pbMC, TQT_SIGNAL(clicked(void)), TQT_SLOT(slotMCclicked(void))); pbClear = new KCalcButton("C", mLargePage, "Clear-Button", i18n("Clear")); pbClear->setAccel(Key_Prior); - connect(this, SIGNAL(switchShowAccels(bool)), - pbClear, SLOT(slotSetAccelDisplayMode(bool))); + connect(this, TQT_SIGNAL(switchShowAccels(bool)), + pbClear, TQT_SLOT(slotSetAccelDisplayMode(bool))); accel()->insert("Entered 'ESC'", i18n("Pressed ESC-Button"), 0, - Key_Escape, pbClear, SLOT(animateClick())); - connect(pbClear, SIGNAL(clicked(void)), SLOT(slotClearclicked(void))); + Key_Escape, pbClear, TQT_SLOT(animateClick())); + connect(pbClear, TQT_SIGNAL(clicked(void)), TQT_SLOT(slotClearclicked(void))); pbAC = new KCalcButton("AC", mLargePage, "AC-Button", i18n("Clear all")); pbAC->setAccel(Key_Delete); - connect(this, SIGNAL(switchShowAccels(bool)), - pbAC, SLOT(slotSetAccelDisplayMode(bool))); - connect(pbAC, SIGNAL(clicked(void)), SLOT(slotACclicked(void))); + connect(this, TQT_SIGNAL(switchShowAccels(bool)), + pbAC, TQT_SLOT(slotSetAccelDisplayMode(bool))); + connect(pbAC, TQT_SIGNAL(clicked(void)), TQT_SLOT(slotACclicked(void))); pbParenOpen = new KCalcButton("(", mLargePage, "ParenOpen-Button"); pbParenOpen->setAccel(Key_ParenLeft); - connect(this, SIGNAL(switchShowAccels(bool)), - pbParenOpen, SLOT(slotSetAccelDisplayMode(bool))); - connect(pbParenOpen, SIGNAL(clicked(void)),SLOT(slotParenOpenclicked(void))); + connect(this, TQT_SIGNAL(switchShowAccels(bool)), + pbParenOpen, TQT_SLOT(slotSetAccelDisplayMode(bool))); + connect(pbParenOpen, TQT_SIGNAL(clicked(void)),TQT_SLOT(slotParenOpenclicked(void))); pbPercent = new KCalcButton("%", mLargePage, "Percent-Button", i18n("Percent")); pbPercent->setAccel(Key_Percent); - connect(this, SIGNAL(switchShowAccels(bool)), - pbPercent, SLOT(slotSetAccelDisplayMode(bool))); - connect(pbPercent, SIGNAL(clicked(void)), SLOT(slotPercentclicked(void))); + connect(this, TQT_SIGNAL(switchShowAccels(bool)), + pbPercent, TQT_SLOT(slotSetAccelDisplayMode(bool))); + connect(pbPercent, TQT_SIGNAL(clicked(void)), TQT_SLOT(slotPercentclicked(void))); pbPlusMinus = new KCalcButton("\xb1", mLargePage, "Sign-Button", i18n("Change sign")); pbPlusMinus->setAccel(Key_Backslash); - connect(this, SIGNAL(switchShowAccels(bool)), - pbPlusMinus, SLOT(slotSetAccelDisplayMode(bool))); - connect(pbPlusMinus, SIGNAL(clicked(void)), SLOT(slotPlusMinusclicked(void))); + connect(this, TQT_SIGNAL(switchShowAccels(bool)), + pbPlusMinus, TQT_SLOT(slotSetAccelDisplayMode(bool))); + connect(pbPlusMinus, TQT_SIGNAL(clicked(void)), TQT_SLOT(slotPlusMinusclicked(void))); tmp_pb = new KCalcButton("A", mSmallPage, "A-Button"); tmp_pb->setAccel(Key_A); - connect(this, SIGNAL(switchShowAccels(bool)), - tmp_pb, SLOT(slotSetAccelDisplayMode(bool))); + connect(this, TQT_SIGNAL(switchShowAccels(bool)), + tmp_pb, TQT_SLOT(slotSetAccelDisplayMode(bool))); NumButtonGroup->insert(tmp_pb, 0xA); tmp_pb = new KCalcButton("B", mSmallPage, "B-Button"); tmp_pb->setAccel(Key_B); - connect(this, SIGNAL(switchShowAccels(bool)), - tmp_pb, SLOT(slotSetAccelDisplayMode(bool))); + connect(this, TQT_SIGNAL(switchShowAccels(bool)), + tmp_pb, TQT_SLOT(slotSetAccelDisplayMode(bool))); NumButtonGroup->insert(tmp_pb, 0xB); tmp_pb = new KCalcButton("C", mSmallPage, "C-Button"); tmp_pb->setAccel(Key_C); - connect(this, SIGNAL(switchShowAccels(bool)), - tmp_pb, SLOT(slotSetAccelDisplayMode(bool))); + connect(this, TQT_SIGNAL(switchShowAccels(bool)), + tmp_pb, TQT_SLOT(slotSetAccelDisplayMode(bool))); NumButtonGroup->insert(tmp_pb, 0xC); tmp_pb = new KCalcButton("D", mSmallPage, "D-Button"); tmp_pb->setAccel(Key_D); - connect(this, SIGNAL(switchShowAccels(bool)), - tmp_pb, SLOT(slotSetAccelDisplayMode(bool))); + connect(this, TQT_SIGNAL(switchShowAccels(bool)), + tmp_pb, TQT_SLOT(slotSetAccelDisplayMode(bool))); NumButtonGroup->insert(tmp_pb, 0xD); tmp_pb = new KCalcButton("E", mSmallPage, "E-Button"); tmp_pb->setAccel(Key_E); - connect(this, SIGNAL(switchShowAccels(bool)), - tmp_pb, SLOT(slotSetAccelDisplayMode(bool))); + connect(this, TQT_SIGNAL(switchShowAccels(bool)), + tmp_pb, TQT_SLOT(slotSetAccelDisplayMode(bool))); NumButtonGroup->insert(tmp_pb, 0xE); tmp_pb = new KCalcButton("F", mSmallPage, "F-Button"); tmp_pb->setAccel(Key_F); - connect(this, SIGNAL(switchShowAccels(bool)), - tmp_pb, SLOT(slotSetAccelDisplayMode(bool))); + connect(this, TQT_SIGNAL(switchShowAccels(bool)), + tmp_pb, TQT_SLOT(slotSetAccelDisplayMode(bool))); NumButtonGroup->insert(tmp_pb, 0xF); return thisPage; } -void KCalculator::setupLogicKeys(QWidget *parent) +void KCalculator::setupLogicKeys(TQWidget *parent) { Q_CHECK_PTR(parent); @@ -750,51 +750,51 @@ void KCalculator::setupLogicKeys(QWidget *parent) tmp_pb = new KCalcButton("AND", parent, "AND-Button", i18n("Bitwise AND")); pbLogic.insert("AND", tmp_pb); tmp_pb->setAccel(Key_Ampersand); - connect(this, SIGNAL(switchShowAccels(bool)), - tmp_pb, SLOT(slotSetAccelDisplayMode(bool))); - connect(tmp_pb, SIGNAL(clicked(void)), SLOT(slotANDclicked(void))); + connect(this, TQT_SIGNAL(switchShowAccels(bool)), + tmp_pb, TQT_SLOT(slotSetAccelDisplayMode(bool))); + connect(tmp_pb, TQT_SIGNAL(clicked(void)), TQT_SLOT(slotANDclicked(void))); tmp_pb = new KCalcButton("OR", parent, "OR-Button", i18n("Bitwise OR")); pbLogic.insert("OR", tmp_pb); tmp_pb->setAccel(Key_Bar); - connect(this, SIGNAL(switchShowAccels(bool)), - tmp_pb, SLOT(slotSetAccelDisplayMode(bool))); - connect(tmp_pb, SIGNAL(clicked(void)), SLOT(slotORclicked(void))); + connect(this, TQT_SIGNAL(switchShowAccels(bool)), + tmp_pb, TQT_SLOT(slotSetAccelDisplayMode(bool))); + connect(tmp_pb, TQT_SIGNAL(clicked(void)), TQT_SLOT(slotORclicked(void))); tmp_pb = new KCalcButton("XOR", parent, "XOR-Button", i18n("Bitwise XOR")); pbLogic.insert("XOR", tmp_pb); - connect(this, SIGNAL(switchShowAccels(bool)), - tmp_pb, SLOT(slotSetAccelDisplayMode(bool))); - connect(tmp_pb, SIGNAL(clicked(void)), SLOT(slotXORclicked(void))); + connect(this, TQT_SIGNAL(switchShowAccels(bool)), + tmp_pb, TQT_SLOT(slotSetAccelDisplayMode(bool))); + connect(tmp_pb, TQT_SIGNAL(clicked(void)), TQT_SLOT(slotXORclicked(void))); tmp_pb = new KCalcButton("Cmp", parent, "One-Complement-Button", i18n("One's complement")); pbLogic.insert("One-Complement", tmp_pb); tmp_pb->setAccel(Key_AsciiTilde); - connect(this, SIGNAL(switchShowAccels(bool)), - tmp_pb, SLOT(slotSetAccelDisplayMode(bool))); - connect(tmp_pb, SIGNAL(clicked(void)), SLOT(slotNegateclicked(void))); + connect(this, TQT_SIGNAL(switchShowAccels(bool)), + tmp_pb, TQT_SLOT(slotSetAccelDisplayMode(bool))); + connect(tmp_pb, TQT_SIGNAL(clicked(void)), TQT_SLOT(slotNegateclicked(void))); tmp_pb = new KCalcButton("Lsh", parent, "LeftBitShift-Button", i18n("Left bit shift")); tmp_pb->setAccel(Key_Less); pbLogic.insert("LeftShift", tmp_pb); - connect(this, SIGNAL(switchShowAccels(bool)), - tmp_pb, SLOT(slotSetAccelDisplayMode(bool))); - connect(tmp_pb, SIGNAL(clicked(void)), - SLOT(slotLeftShiftclicked(void))); + connect(this, TQT_SIGNAL(switchShowAccels(bool)), + tmp_pb, TQT_SLOT(slotSetAccelDisplayMode(bool))); + connect(tmp_pb, TQT_SIGNAL(clicked(void)), + TQT_SLOT(slotLeftShiftclicked(void))); tmp_pb = new KCalcButton("Rsh", parent, "RightBitShift-Button", i18n("Right bit shift")); tmp_pb->setAccel(Key_Greater); pbLogic.insert("RightShift", tmp_pb); - connect(this, SIGNAL(switchShowAccels(bool)), - tmp_pb, SLOT(slotSetAccelDisplayMode(bool))); - connect(tmp_pb, SIGNAL(clicked(void)), - SLOT(slotRightShiftclicked(void))); + connect(this, TQT_SIGNAL(switchShowAccels(bool)), + tmp_pb, TQT_SLOT(slotSetAccelDisplayMode(bool))); + connect(tmp_pb, TQT_SIGNAL(clicked(void)), + TQT_SLOT(slotRightShiftclicked(void))); } -void KCalculator::setupScientificKeys(QWidget *parent) +void KCalculator::setupScientificKeys(TQWidget *parent) { Q_CHECK_PTR(parent); @@ -803,9 +803,9 @@ void KCalculator::setupScientificKeys(QWidget *parent) tmp_pb = new KCalcButton("Hyp", parent, "Hyp-Button", i18n("Hyperbolic mode")); pbScientific.insert("HypMode", tmp_pb); tmp_pb->setAccel(Key_H); - connect(this, SIGNAL(switchShowAccels(bool)), - tmp_pb, SLOT(slotSetAccelDisplayMode(bool))); - connect(tmp_pb, SIGNAL(toggled(bool)), SLOT(slotHyptoggled(bool))); + connect(this, TQT_SIGNAL(switchShowAccels(bool)), + tmp_pb, TQT_SLOT(slotSetAccelDisplayMode(bool))); + connect(tmp_pb, TQT_SIGNAL(toggled(bool)), TQT_SLOT(slotHyptoggled(bool))); tmp_pb->setToggleButton(true); tmp_pb = new KCalcButton(parent, "Sin-Button"); @@ -816,11 +816,11 @@ void KCalculator::setupScientificKeys(QWidget *parent) tmp_pb->addMode(ButtonModeFlags(ModeInverse | ModeHyperbolic), "Asinh", i18n("Inverse hyperbolic sine")); tmp_pb->setAccel(Key_S); - connect(this, SIGNAL(switchShowAccels(bool)), - tmp_pb, SLOT(slotSetAccelDisplayMode(bool))); - connect(this, SIGNAL(switchMode(ButtonModeFlags,bool)), - tmp_pb, SLOT(slotSetMode(ButtonModeFlags,bool))); - connect(tmp_pb, SIGNAL(clicked(void)), SLOT(slotSinclicked(void))); + connect(this, TQT_SIGNAL(switchShowAccels(bool)), + tmp_pb, TQT_SLOT(slotSetAccelDisplayMode(bool))); + connect(this, TQT_SIGNAL(switchMode(ButtonModeFlags,bool)), + tmp_pb, TQT_SLOT(slotSetMode(ButtonModeFlags,bool))); + connect(tmp_pb, TQT_SIGNAL(clicked(void)), TQT_SLOT(slotSinclicked(void))); tmp_pb = new KCalcButton(parent, "Cos-Button"); pbScientific.insert("Cosine", tmp_pb); @@ -830,11 +830,11 @@ void KCalculator::setupScientificKeys(QWidget *parent) tmp_pb->addMode(ButtonModeFlags(ModeInverse | ModeHyperbolic), "Acosh", i18n("Inverse hyperbolic cosine")); tmp_pb->setAccel(Key_C); - connect(this, SIGNAL(switchShowAccels(bool)), - tmp_pb, SLOT(slotSetAccelDisplayMode(bool))); - connect(this, SIGNAL(switchMode(ButtonModeFlags,bool)), - tmp_pb, SLOT(slotSetMode(ButtonModeFlags,bool))); - connect(tmp_pb, SIGNAL(clicked(void)), SLOT(slotCosclicked(void))); + connect(this, TQT_SIGNAL(switchShowAccels(bool)), + tmp_pb, TQT_SLOT(slotSetAccelDisplayMode(bool))); + connect(this, TQT_SIGNAL(switchMode(ButtonModeFlags,bool)), + tmp_pb, TQT_SLOT(slotSetMode(ButtonModeFlags,bool))); + connect(tmp_pb, TQT_SIGNAL(clicked(void)), TQT_SLOT(slotCosclicked(void))); tmp_pb = new KCalcButton(parent, "Tan-Button"); pbScientific.insert("Tangent", tmp_pb); @@ -844,11 +844,11 @@ void KCalculator::setupScientificKeys(QWidget *parent) tmp_pb->addMode(ButtonModeFlags(ModeInverse | ModeHyperbolic), "Atanh", i18n("Inverse hyperbolic tangent")); tmp_pb->setAccel(Key_T); - connect(this, SIGNAL(switchShowAccels(bool)), - tmp_pb, SLOT(slotSetAccelDisplayMode(bool))); - connect(this, SIGNAL(switchMode(ButtonModeFlags,bool)), - tmp_pb, SLOT(slotSetMode(ButtonModeFlags,bool))); - connect(tmp_pb, SIGNAL(clicked(void)),SLOT(slotTanclicked(void))); + connect(this, TQT_SIGNAL(switchShowAccels(bool)), + tmp_pb, TQT_SLOT(slotSetAccelDisplayMode(bool))); + connect(this, TQT_SIGNAL(switchMode(ButtonModeFlags,bool)), + tmp_pb, TQT_SLOT(slotSetMode(ButtonModeFlags,bool))); + connect(tmp_pb, TQT_SIGNAL(clicked(void)),TQT_SLOT(slotTanclicked(void))); tmp_pb = new KCalcButton(parent, "Ln-Button"); tmp_pb->addMode(ModeNormal, "Ln", i18n("Natural log")); @@ -856,11 +856,11 @@ void KCalculator::setupScientificKeys(QWidget *parent) true); pbScientific.insert("LogNatural", tmp_pb); tmp_pb->setAccel(Key_N); - connect(this, SIGNAL(switchShowAccels(bool)), - tmp_pb, SLOT(slotSetAccelDisplayMode(bool))); - connect(this, SIGNAL(switchMode(ButtonModeFlags,bool)), - tmp_pb, SLOT(slotSetMode(ButtonModeFlags,bool))); - connect(tmp_pb, SIGNAL(clicked(void)), SLOT(slotLnclicked(void))); + connect(this, TQT_SIGNAL(switchShowAccels(bool)), + tmp_pb, TQT_SLOT(slotSetAccelDisplayMode(bool))); + connect(this, TQT_SIGNAL(switchMode(ButtonModeFlags,bool)), + tmp_pb, TQT_SLOT(slotSetMode(ButtonModeFlags,bool))); + connect(tmp_pb, TQT_SIGNAL(clicked(void)), TQT_SLOT(slotLnclicked(void))); tmp_pb = new KCalcButton(parent, "Log-Button"); tmp_pb->addMode(ModeNormal, "Log", i18n("Logarithm to base 10")); @@ -868,15 +868,15 @@ void KCalculator::setupScientificKeys(QWidget *parent) true); pbScientific.insert("Log10", tmp_pb); tmp_pb->setAccel(Key_L); - connect(this, SIGNAL(switchShowAccels(bool)), - tmp_pb, SLOT(slotSetAccelDisplayMode(bool))); - connect(this, SIGNAL(switchMode(ButtonModeFlags,bool)), - tmp_pb, SLOT(slotSetMode(ButtonModeFlags,bool))); - connect(tmp_pb, SIGNAL(clicked(void)), SLOT(slotLogclicked(void))); + connect(this, TQT_SIGNAL(switchShowAccels(bool)), + tmp_pb, TQT_SLOT(slotSetAccelDisplayMode(bool))); + connect(this, TQT_SIGNAL(switchMode(ButtonModeFlags,bool)), + tmp_pb, TQT_SLOT(slotSetMode(ButtonModeFlags,bool))); + connect(tmp_pb, TQT_SIGNAL(clicked(void)), TQT_SLOT(slotLogclicked(void))); } -void KCalculator::setupStatisticKeys(QWidget *parent) +void KCalculator::setupStatisticKeys(TQWidget *parent) { Q_CHECK_PTR(parent); @@ -884,132 +884,132 @@ void KCalculator::setupStatisticKeys(QWidget *parent) tmp_pb = new KCalcButton(parent, "Stat.NumData-Button"); tmp_pb->addMode(ModeNormal, "N", i18n("Number of data entered")); - tmp_pb->addMode(ModeInverse, QString::fromUtf8("\xce\xa3") + tmp_pb->addMode(ModeInverse, TQString::fromUtf8("\xce\xa3") + "x", i18n("Sum of all data items")); pbStat.insert("NumData", tmp_pb); mStatButtonList.append(tmp_pb); - connect(this, SIGNAL(switchShowAccels(bool)), - tmp_pb, SLOT(slotSetAccelDisplayMode(bool))); - connect(this, SIGNAL(switchMode(ButtonModeFlags,bool)), - tmp_pb, SLOT(slotSetMode(ButtonModeFlags,bool))); - connect(tmp_pb, SIGNAL(clicked(void)), SLOT(slotStatNumclicked(void))); + connect(this, TQT_SIGNAL(switchShowAccels(bool)), + tmp_pb, TQT_SLOT(slotSetAccelDisplayMode(bool))); + connect(this, TQT_SIGNAL(switchMode(ButtonModeFlags,bool)), + tmp_pb, TQT_SLOT(slotSetMode(ButtonModeFlags,bool))); + connect(tmp_pb, TQT_SIGNAL(clicked(void)), TQT_SLOT(slotStatNumclicked(void))); tmp_pb = new KCalcButton(parent, "Stat.Median-Button"); tmp_pb->addMode(ModeNormal, "Med", i18n("Median")); pbStat.insert("Median", tmp_pb); mStatButtonList.append(tmp_pb); - QToolTip::add(tmp_pb, i18n("Median")); - connect(this, SIGNAL(switchShowAccels(bool)), - tmp_pb, SLOT(slotSetAccelDisplayMode(bool))); - connect(tmp_pb, SIGNAL(clicked(void)), SLOT(slotStatMedianclicked(void))); + TQToolTip::add(tmp_pb, i18n("Median")); + connect(this, TQT_SIGNAL(switchShowAccels(bool)), + tmp_pb, TQT_SLOT(slotSetAccelDisplayMode(bool))); + connect(tmp_pb, TQT_SIGNAL(clicked(void)), TQT_SLOT(slotStatMedianclicked(void))); tmp_pb = new KCalcButton(parent, "Stat.Mean-Button"); tmp_pb->addMode(ModeNormal, "Mea", i18n("Mean")); - tmp_pb->addMode(ModeInverse, QString::fromUtf8("\xce\xa3") + tmp_pb->addMode(ModeInverse, TQString::fromUtf8("\xce\xa3") + "x<sup>2</sup>", i18n("Sum of all data items squared"), true); pbStat.insert("Mean", tmp_pb); mStatButtonList.append(tmp_pb); - connect(this, SIGNAL(switchShowAccels(bool)), - tmp_pb, SLOT(slotSetAccelDisplayMode(bool))); - connect(this, SIGNAL(switchMode(ButtonModeFlags,bool)), - tmp_pb, SLOT(slotSetMode(ButtonModeFlags,bool))); - connect(tmp_pb, SIGNAL(clicked(void)), SLOT(slotStatMeanclicked(void))); + connect(this, TQT_SIGNAL(switchShowAccels(bool)), + tmp_pb, TQT_SLOT(slotSetAccelDisplayMode(bool))); + connect(this, TQT_SIGNAL(switchMode(ButtonModeFlags,bool)), + tmp_pb, TQT_SLOT(slotSetMode(ButtonModeFlags,bool))); + connect(tmp_pb, TQT_SIGNAL(clicked(void)), TQT_SLOT(slotStatMeanclicked(void))); tmp_pb = new KCalcButton(parent, "Stat.StandardDeviation-Button"); - tmp_pb->addMode(ModeNormal, QString::fromUtf8("σ",-1) + "<sub>N-1</sub>", + tmp_pb->addMode(ModeNormal, TQString::fromUtf8("σ",-1) + "<sub>N-1</sub>", i18n("Sample standard deviation"), true); - tmp_pb->addMode(ModeInverse, QString::fromUtf8("σ",-1) + "<sub>N</sub>", + tmp_pb->addMode(ModeInverse, TQString::fromUtf8("σ",-1) + "<sub>N</sub>", i18n("Standard deviation"), true); pbStat.insert("StandardDeviation", tmp_pb); mStatButtonList.append(tmp_pb); - connect(this, SIGNAL(switchShowAccels(bool)), - tmp_pb, SLOT(slotSetAccelDisplayMode(bool))); - connect(this, SIGNAL(switchMode(ButtonModeFlags,bool)), - tmp_pb, SLOT(slotSetMode(ButtonModeFlags,bool))); - connect(tmp_pb, SIGNAL(clicked(void)), SLOT(slotStatStdDevclicked(void))); + connect(this, TQT_SIGNAL(switchShowAccels(bool)), + tmp_pb, TQT_SLOT(slotSetAccelDisplayMode(bool))); + connect(this, TQT_SIGNAL(switchMode(ButtonModeFlags,bool)), + tmp_pb, TQT_SLOT(slotSetMode(ButtonModeFlags,bool))); + connect(tmp_pb, TQT_SIGNAL(clicked(void)), TQT_SLOT(slotStatStdDevclicked(void))); tmp_pb = new KCalcButton(parent, "Stat.DataInput-Button"); tmp_pb->addMode(ModeNormal, "Dat", i18n("Enter data")); tmp_pb->addMode(ModeInverse, "CDat", i18n("Delete last data item")); pbStat.insert("InputData", tmp_pb); mStatButtonList.append(tmp_pb); - connect(this, SIGNAL(switchShowAccels(bool)), - tmp_pb, SLOT(slotSetAccelDisplayMode(bool))); - connect(this, SIGNAL(switchMode(ButtonModeFlags,bool)), - tmp_pb, SLOT(slotSetMode(ButtonModeFlags,bool))); - connect(tmp_pb, SIGNAL(clicked(void)), SLOT(slotStatDataInputclicked(void))); + connect(this, TQT_SIGNAL(switchShowAccels(bool)), + tmp_pb, TQT_SLOT(slotSetAccelDisplayMode(bool))); + connect(this, TQT_SIGNAL(switchMode(ButtonModeFlags,bool)), + tmp_pb, TQT_SLOT(slotSetMode(ButtonModeFlags,bool))); + connect(tmp_pb, TQT_SIGNAL(clicked(void)), TQT_SLOT(slotStatDataInputclicked(void))); tmp_pb = new KCalcButton(parent, "Stat.ClearData-Button"); tmp_pb->addMode(ModeNormal, "CSt", i18n("Clear data store")); pbStat.insert("ClearData", tmp_pb); mStatButtonList.append(tmp_pb); - connect(this, SIGNAL(switchShowAccels(bool)), - tmp_pb, SLOT(slotSetAccelDisplayMode(bool))); - connect(tmp_pb, SIGNAL(clicked(void)), SLOT(slotStatClearDataclicked(void))); + connect(this, TQT_SIGNAL(switchShowAccels(bool)), + tmp_pb, TQT_SLOT(slotSetAccelDisplayMode(bool))); + connect(tmp_pb, TQT_SIGNAL(clicked(void)), TQT_SLOT(slotStatClearDataclicked(void))); } -void KCalculator::setupConstantsKeys(QWidget *parent) +void KCalculator::setupConstantsKeys(TQWidget *parent) { Q_CHECK_PTR(parent); - ConstButtonGroup = new QButtonGroup(0, "Const-Button-Group"); - connect(ConstButtonGroup, SIGNAL(clicked(int)), SLOT(slotConstclicked(int))); + ConstButtonGroup = new TQButtonGroup(0, "Const-Button-Group"); + connect(ConstButtonGroup, TQT_SIGNAL(clicked(int)), TQT_SLOT(slotConstclicked(int))); KCalcConstButton *tmp_pb; tmp_pb = new KCalcConstButton(parent, 0, "C1"); tmp_pb->setAccel(ALT + Key_1); pbConstant[0] = tmp_pb; - connect(this, SIGNAL(switchShowAccels(bool)), - tmp_pb, SLOT(slotSetAccelDisplayMode(bool))); - connect(this, SIGNAL(switchMode(ButtonModeFlags,bool)), - tmp_pb, SLOT(slotSetMode(ButtonModeFlags,bool))); + connect(this, TQT_SIGNAL(switchShowAccels(bool)), + tmp_pb, TQT_SLOT(slotSetAccelDisplayMode(bool))); + connect(this, TQT_SIGNAL(switchMode(ButtonModeFlags,bool)), + tmp_pb, TQT_SLOT(slotSetMode(ButtonModeFlags,bool))); ConstButtonGroup->insert(tmp_pb, 0); tmp_pb = new KCalcConstButton(parent, 1, "C2"); tmp_pb->setAccel(ALT + Key_2); pbConstant[1] = tmp_pb; - connect(this, SIGNAL(switchShowAccels(bool)), - tmp_pb, SLOT(slotSetAccelDisplayMode(bool))); - connect(this, SIGNAL(switchMode(ButtonModeFlags,bool)), - tmp_pb, SLOT(slotSetMode(ButtonModeFlags,bool))); + connect(this, TQT_SIGNAL(switchShowAccels(bool)), + tmp_pb, TQT_SLOT(slotSetAccelDisplayMode(bool))); + connect(this, TQT_SIGNAL(switchMode(ButtonModeFlags,bool)), + tmp_pb, TQT_SLOT(slotSetMode(ButtonModeFlags,bool))); ConstButtonGroup->insert(tmp_pb, 1); tmp_pb = new KCalcConstButton(parent, 2, "C3"); tmp_pb->setAccel(ALT + Key_3); pbConstant[2] = tmp_pb; - connect(this, SIGNAL(switchShowAccels(bool)), - tmp_pb, SLOT(slotSetAccelDisplayMode(bool))); - connect(this, SIGNAL(switchMode(ButtonModeFlags,bool)), - tmp_pb, SLOT(slotSetMode(ButtonModeFlags,bool))); + connect(this, TQT_SIGNAL(switchShowAccels(bool)), + tmp_pb, TQT_SLOT(slotSetAccelDisplayMode(bool))); + connect(this, TQT_SIGNAL(switchMode(ButtonModeFlags,bool)), + tmp_pb, TQT_SLOT(slotSetMode(ButtonModeFlags,bool))); ConstButtonGroup->insert(tmp_pb, 2); tmp_pb = new KCalcConstButton(parent, 3, "C4"); tmp_pb->setAccel(ALT + Key_4); pbConstant[3] = tmp_pb; - connect(this, SIGNAL(switchShowAccels(bool)), - tmp_pb, SLOT(slotSetAccelDisplayMode(bool))); - connect(this, SIGNAL(switchMode(ButtonModeFlags,bool)), - tmp_pb, SLOT(slotSetMode(ButtonModeFlags,bool))); + connect(this, TQT_SIGNAL(switchShowAccels(bool)), + tmp_pb, TQT_SLOT(slotSetAccelDisplayMode(bool))); + connect(this, TQT_SIGNAL(switchMode(ButtonModeFlags,bool)), + tmp_pb, TQT_SLOT(slotSetMode(ButtonModeFlags,bool))); ConstButtonGroup->insert(tmp_pb, 3); tmp_pb = new KCalcConstButton(parent, 4, "C5"); tmp_pb->setAccel(ALT + Key_5); pbConstant[4] = tmp_pb; - connect(this, SIGNAL(switchShowAccels(bool)), - tmp_pb, SLOT(slotSetAccelDisplayMode(bool))); - connect(this, SIGNAL(switchMode(ButtonModeFlags,bool)), - tmp_pb, SLOT(slotSetMode(ButtonModeFlags,bool))); + connect(this, TQT_SIGNAL(switchShowAccels(bool)), + tmp_pb, TQT_SLOT(slotSetAccelDisplayMode(bool))); + connect(this, TQT_SIGNAL(switchMode(ButtonModeFlags,bool)), + tmp_pb, TQT_SLOT(slotSetMode(ButtonModeFlags,bool))); ConstButtonGroup->insert(tmp_pb, 4); tmp_pb = new KCalcConstButton(parent, 5, "C6"); tmp_pb->setAccel(ALT + Key_6); pbConstant[5] = tmp_pb; - connect(this, SIGNAL(switchShowAccels(bool)), - tmp_pb, SLOT(slotSetAccelDisplayMode(bool))); - connect(this, SIGNAL(switchMode(ButtonModeFlags,bool)), - tmp_pb, SLOT(slotSetMode(ButtonModeFlags,bool))); + connect(this, TQT_SIGNAL(switchShowAccels(bool)), + tmp_pb, TQT_SLOT(slotSetAccelDisplayMode(bool))); + connect(this, TQT_SIGNAL(switchMode(ButtonModeFlags,bool)), + tmp_pb, TQT_SLOT(slotSetMode(ButtonModeFlags,bool))); ConstButtonGroup->insert(tmp_pb, 5); changeButtonNames(); @@ -1017,8 +1017,8 @@ void KCalculator::setupConstantsKeys(QWidget *parent) // add menu with scientific constants KCalcConstMenu *tmp_menu = new KCalcConstMenu(this); menuBar()->insertItem(i18n("&Constants"), tmp_menu, -1, 2); - connect(tmp_menu, SIGNAL(activated(int)), this, - SLOT(slotConstantToDisplay(int))); + connect(tmp_menu, TQT_SIGNAL(activated(int)), this, + TQT_SLOT(slotConstantToDisplay(int))); } void KCalculator::slotConstantToDisplay(int constant) @@ -1030,8 +1030,8 @@ void KCalculator::slotConstantToDisplay(int constant) void KCalculator::updateGeometry(void) { - QObjectList *l; - QSize s; + TQObjectList *l; + TQSize s; int margin; // @@ -1041,16 +1041,16 @@ void KCalculator::updateGeometry(void) s.setHeight(mSmallPage->fontMetrics().lineSpacing()); // why this stupid cast! - l = const_cast<QObjectList *>(mSmallPage->children()); + l = const_cast<TQObjectList *>(mSmallPage->children()); for(uint i=0; i < l->count(); i++) { - QObject *o = l->at(i); + TQObject *o = l->at(i); if( o->isWidgetType() ) { - QWidget *tmp_widget = dynamic_cast<QWidget *>(o); - margin = QApplication::style(). - pixelMetric(QStyle::PM_ButtonMargin, (tmp_widget))*2; + TQWidget *tmp_widget = dynamic_cast<TQWidget *>(o); + margin = TQApplication::style(). + pixelMetric(TQStyle::PM_ButtonMargin, (tmp_widget))*2; tmp_widget->setFixedSize(s.width()+margin, s.height()+margin); //tmp_widget->setMinimumSize(s.width()+margin, s.height()+margin); tmp_widget->installEventFilter( this ); @@ -1059,21 +1059,21 @@ void KCalculator::updateGeometry(void) } // why this stupic cast !! - l = const_cast<QObjectList*>(mLargePage->children()); + l = const_cast<TQObjectList*>(mLargePage->children()); int h1 = (NumButtonGroup->find(0x0F))->minimumSize().height(); int h2 = static_cast<int>( (static_cast<float>(h1) + 4.0) / 5.0 ); s.setWidth(mLargePage->fontMetrics().width("MMM") + - QApplication::style(). - pixelMetric(QStyle::PM_ButtonMargin, NumButtonGroup->find(0x0F))*2); + TQApplication::style(). + pixelMetric(TQStyle::PM_ButtonMargin, NumButtonGroup->find(0x0F))*2); s.setHeight(h1 + h2); for(uint i = 0; i < l->count(); i++) { - QObject *o = l->at(i); + TQObject *o = l->at(i); if(o->isWidgetType()) { - QWidget *tmp_widget = dynamic_cast<QWidget *>(o); + TQWidget *tmp_widget = dynamic_cast<TQWidget *>(o); tmp_widget->setFixedSize(s); tmp_widget->installEventFilter(this); tmp_widget->setAcceptDrops(true); @@ -1086,21 +1086,21 @@ void KCalculator::updateGeometry(void) - l = (QObjectList*)mNumericPage->children(); // silence please + l = (TQObjectList*)mNumericPage->children(); // silence please h1 = (NumButtonGroup->find(0x0F))->minimumSize().height(); h2 = (int)((((float)h1 + 4.0) / 5.0)); s.setWidth(mLargePage->fontMetrics().width("MMM") + - QApplication::style(). - pixelMetric(QStyle::PM_ButtonMargin, NumButtonGroup->find(0x0F))*2); + TQApplication::style(). + pixelMetric(TQStyle::PM_ButtonMargin, NumButtonGroup->find(0x0F))*2); s.setHeight(h1 + h2); for(uint i = 0; i < l->count(); i++) { - QObject *o = l->at(i); + TQObject *o = l->at(i); if(o->isWidgetType()) { - QWidget *tmp_widget = dynamic_cast<QWidget *>(o); + TQWidget *tmp_widget = dynamic_cast<TQWidget *>(o); tmp_widget->setFixedSize(s); tmp_widget->installEventFilter(this); tmp_widget->setAcceptDrops(true); @@ -1108,7 +1108,7 @@ void KCalculator::updateGeometry(void) } // Set Buttons of double size - QSize t(s); + TQSize t(s); t.setWidth(2*s.width()); NumButtonGroup->find(0x00)->setFixedSize(t); t = s; @@ -1185,7 +1185,7 @@ void KCalculator::slotBaseSelected(int base) } } -void KCalculator::keyPressEvent(QKeyEvent *e) +void KCalculator::keyPressEvent(TQKeyEvent *e) { if ( ( e->state() & KeyButtonMask ) == 0 || ( e->state() & ShiftButton ) ) { switch (e->key()) @@ -1215,7 +1215,7 @@ void KCalculator::keyPressEvent(QKeyEvent *e) emit switchShowAccels(true); } -void KCalculator::keyReleaseEvent(QKeyEvent *e) +void KCalculator::keyReleaseEvent(TQKeyEvent *e) { if (e->key() == Key_Control) emit switchShowAccels(false); @@ -1271,7 +1271,7 @@ void KCalculator::slotInvtoggled(bool flag) else { statusBar()->changeItem("NORM", 0); - calc_display->setStatusText(0, QString::null); + calc_display->setStatusText(0, TQString::null); } } @@ -1544,7 +1544,7 @@ void KCalculator::slotMCclicked(void) { memory_num = 0; statusBar()->changeItem(" \xa0\xa0 ",3); - calc_display->setStatusText(3, QString::null); + calc_display->setStatusText(3, TQString::null); pbMemRecall->setDisabled(true); } @@ -1824,10 +1824,10 @@ void KCalculator::showSettings() general->kcfg_Precision->setMaxValue(maxprec); dialog->addPage(general, i18n("General"), "package_settings", i18n("General Settings")); - QWidget *fontWidget = new QWidget(0,"Font"); - QVBoxLayout *fontLayout = new QVBoxLayout(fontWidget); + TQWidget *fontWidget = new TQWidget(0,"Font"); + TQVBoxLayout *fontLayout = new TQVBoxLayout(fontWidget); KFontChooser *mFontChooser = - new KFontChooser(fontWidget, "kcfg_Font", false, QStringList(), false, 6); + new KFontChooser(fontWidget, "kcfg_Font", false, TQStringList(), false, 6); fontLayout->addWidget(mFontChooser); dialog->addPage(fontWidget, i18n("Font"), "fonts", i18n("Select Display Font")); @@ -1844,40 +1844,40 @@ void KCalculator::showSettings() tmp_const = constant; KCalcConstMenu *tmp_menu = new KCalcConstMenu(this); - connect(tmp_menu, SIGNAL(activated(int)), - SLOT(slotChooseScientificConst0(int))); + connect(tmp_menu, TQT_SIGNAL(activated(int)), + TQT_SLOT(slotChooseScientificConst0(int))); (constant->kPushButton0)->setPopup(tmp_menu); tmp_menu = new KCalcConstMenu(this); - connect(tmp_menu, SIGNAL(activated(int)), - SLOT(slotChooseScientificConst1(int))); + connect(tmp_menu, TQT_SIGNAL(activated(int)), + TQT_SLOT(slotChooseScientificConst1(int))); (constant->kPushButton1)->setPopup(tmp_menu); tmp_menu = new KCalcConstMenu(this); - connect(tmp_menu, SIGNAL(activated(int)), - SLOT(slotChooseScientificConst2(int))); + connect(tmp_menu, TQT_SIGNAL(activated(int)), + TQT_SLOT(slotChooseScientificConst2(int))); (constant->kPushButton2)->setPopup(tmp_menu); tmp_menu = new KCalcConstMenu(this); - connect(tmp_menu, SIGNAL(activated(int)), - SLOT(slotChooseScientificConst3(int))); + connect(tmp_menu, TQT_SIGNAL(activated(int)), + TQT_SLOT(slotChooseScientificConst3(int))); (constant->kPushButton3)->setPopup(tmp_menu); tmp_menu = new KCalcConstMenu(this); - connect(tmp_menu, SIGNAL(activated(int)), - SLOT(slotChooseScientificConst4(int))); + connect(tmp_menu, TQT_SIGNAL(activated(int)), + TQT_SLOT(slotChooseScientificConst4(int))); (constant->kPushButton4)->setPopup(tmp_menu); tmp_menu = new KCalcConstMenu(this); - connect(tmp_menu, SIGNAL(activated(int)), - SLOT(slotChooseScientificConst5(int))); + connect(tmp_menu, TQT_SIGNAL(activated(int)), + TQT_SLOT(slotChooseScientificConst5(int))); (constant->kPushButton5)->setPopup(tmp_menu); dialog->addPage(constant, i18n("Constants"), "constants"); // When the user clicks OK or Apply we want to update our settings. - connect(dialog, SIGNAL(settingsChanged()), SLOT(updateSettings())); + connect(dialog, TQT_SIGNAL(settingsChanged()), TQT_SLOT(updateSettings())); // Display the dialog. dialog->show(); @@ -1983,7 +1983,7 @@ void KCalculator::slotScientificshow(bool toggled) pbAngleChoose->hide(); if(statusBar()->hasItem(2)) statusBar()->removeItem(2); - calc_display->setStatusText(2, QString::null); + calc_display->setStatusText(2, TQString::null); } adjustSize(); setFixedSize(sizeHint()); @@ -2022,7 +2022,7 @@ void KCalculator::slotLogicshow(bool toggled) BaseChooseGroup->hide(); if(statusBar()->hasItem(1)) statusBar()->removeItem(1); - calc_display->setStatusText(1, QString::null); + calc_display->setStatusText(1, TQString::null); for (int i=10; i<16; i++) (NumButtonGroup->find(i))->hide(); } @@ -2094,17 +2094,17 @@ void KCalculator::updateSettings() set_colors(); set_precision(); // Show the result in the app's caption in taskbar (wishlist - bug #52858) - disconnect(calc_display, SIGNAL(changedText(const QString &)), + disconnect(calc_display, TQT_SIGNAL(changedText(const TQString &)), this, 0); if (KCalcSettings::captionResult()) { connect(calc_display, - SIGNAL(changedText(const QString &)), - SLOT(setCaption(const QString &))); + TQT_SIGNAL(changedText(const TQString &)), + TQT_SLOT(setCaption(const TQString &))); } else { - setCaption(QString::null); + setCaption(TQString::null); } calc_display->changeSettings(); @@ -2136,44 +2136,44 @@ void KCalculator::UpdateDisplay(bool get_amount_from_core, void KCalculator::set_colors() { - QPushButton *p = NULL; + TQPushButton *p = NULL; calc_display->changeSettings(); - QColor bg = palette().active().background(); + TQColor bg = palette().active().background(); - QPalette numPal(KCalcSettings::numberButtonsColor(), bg); + TQPalette numPal(KCalcSettings::numberButtonsColor(), bg); for(int i=0; i<10; i++) { (NumButtonGroup->find(i))->setPalette(numPal); } - QPalette funcPal(KCalcSettings::functionButtonsColor(), bg); + TQPalette funcPal(KCalcSettings::functionButtonsColor(), bg); for(p = mFunctionButtonList.first(); p; p=mFunctionButtonList.next()) { p->setPalette(funcPal); } - QPalette statPal(KCalcSettings::statButtonsColor(), bg); + TQPalette statPal(KCalcSettings::statButtonsColor(), bg); for(p = mStatButtonList.first(); p; p=mStatButtonList.next()) { p->setPalette(statPal); } - QPalette hexPal(KCalcSettings::hexButtonsColor(), bg); + TQPalette hexPal(KCalcSettings::hexButtonsColor(), bg); for(int i=10; i<16; i++) { (NumButtonGroup->find(i))->setPalette(hexPal); } - QPalette memPal(KCalcSettings::memoryButtonsColor(), bg); + TQPalette memPal(KCalcSettings::memoryButtonsColor(), bg); for(p = mMemButtonList.first(); p; p=mMemButtonList.next()) { p->setPalette(memPal); } - QPalette opPal(KCalcSettings::operationButtonsColor(), bg); + TQPalette opPal(KCalcSettings::operationButtonsColor(), bg); for(p = mOperationButtonList.first(); p; p=mOperationButtonList.next()) { @@ -2187,33 +2187,33 @@ void KCalculator::set_precision() UpdateDisplay(false); } -bool KCalculator::eventFilter(QObject *o, QEvent *e) +bool KCalculator::eventFilter(TQObject *o, TQEvent *e) { - if(e->type() == QEvent::DragEnter) + if(e->type() == TQEvent::DragEnter) { - QDragEnterEvent *ev = (QDragEnterEvent *)e; + TQDragEnterEvent *ev = (TQDragEnterEvent *)e; ev->accept(KColorDrag::canDecode(ev)); return true; } - else if(e->type() == QEvent::DragLeave) + else if(e->type() == TQEvent::DragLeave) { return true; } - else if(e->type() == QEvent::Drop) + else if(e->type() == TQEvent::Drop) { if(!o->isA("KCalcButton")) return false; - QColor c; - QDropEvent *ev = (QDropEvent *)e; + TQColor c; + TQDropEvent *ev = (TQDropEvent *)e; if( KColorDrag::decode(ev, c)) { - QPtrList<KCalcButton> *list; + TQPtrList<KCalcButton> *list; int num_but; if((num_but = NumButtonGroup->id((KCalcButton*)o)) != -1) { - QPalette pal(c, palette().active().background()); + TQPalette pal(c, palette().active().background()); // Was it hex-button or normal digit?? if (num_but <10) @@ -2244,7 +2244,7 @@ bool KCalculator::eventFilter(QObject *o, QEvent *e) else return false; - QPalette pal(c, palette().active().background()); + TQPalette pal(c, palette().active().background()); for(KCalcButton *p = list->first(); p; p=list->next()) p->setPalette(pal); @@ -2296,7 +2296,7 @@ extern "C" KDE_EXPORT int kdemain(int argc, char *argv[]) KCalculator *calc = new KCalculator; app.setTopWidget(calc); - calc->setCaption(QString::null); + calc->setCaption(TQString::null); calc->show(); int exitCode = app.exec(); diff --git a/kcalc/kcalc.h b/kcalc/kcalc.h index 0ede211..442937d 100644 --- a/kcalc/kcalc.h +++ b/kcalc/kcalc.h @@ -63,7 +63,7 @@ class KCalculator : public KMainWindow Q_OBJECT public: - KCalculator(QWidget *parent = 0, const char *name = 0); + KCalculator(TQWidget *parent = 0, const char *name = 0); ~KCalculator(); signals: @@ -72,17 +72,17 @@ signals: void switchShowAccels(bool); private: - virtual bool eventFilter( QObject *o, QEvent *e ); + virtual bool eventFilter( TQObject *o, TQEvent *e ); void updateGeometry(); void setupMainActions(void); void setupStatusbar(void); - QWidget *setupNumericKeys(QWidget *parent); - void setupLogicKeys(QWidget *parent); - void setupScientificKeys(QWidget *parent); - void setupStatisticKeys(QWidget *parent); - void setupConstantsKeys(QWidget *parent); - void keyPressEvent(QKeyEvent *e); - void keyReleaseEvent(QKeyEvent *e); + TQWidget *setupNumericKeys(TQWidget *parent); + void setupLogicKeys(TQWidget *parent); + void setupScientificKeys(TQWidget *parent); + void setupStatisticKeys(TQWidget *parent); + void setupConstantsKeys(TQWidget *parent); + void keyPressEvent(TQKeyEvent *e); + void keyReleaseEvent(TQKeyEvent *e); void set_precision(); void set_style(); void resetBase(void) { (BaseChooseGroup->find(1))->animateClick();}; @@ -172,16 +172,16 @@ private: private: - QWidget *mSmallPage; - QWidget *mLargePage; - QWidget *mNumericPage; + TQWidget *mSmallPage; + TQWidget *mLargePage; + TQWidget *mNumericPage; DispLogic* calc_display; // for historic reasons in "dlabel.h" - QRadioButton* pbBaseChoose[4]; - QPushButton* pbAngleChoose; - QDict<KCalcButton> pbStat; - QDict<KCalcButton> pbScientific; - QDict<KCalcButton> pbLogic; + TQRadioButton* pbBaseChoose[4]; + TQPushButton* pbAngleChoose; + TQDict<KCalcButton> pbStat; + TQDict<KCalcButton> pbScientific; + TQDict<KCalcButton> pbLogic; KCalcConstButton* pbConstant[10]; KCalcButton* pbAC; KCalcButton* pbAND; @@ -215,21 +215,21 @@ private: // buttons would like to remove this, but // don't know how - QHButtonGroup* BaseChooseGroup; + TQHButtonGroup* BaseChooseGroup; // NumButtonGroup: 0-9 = digits, 0xA-0xF = hex-keys - QButtonGroup* NumButtonGroup; + TQButtonGroup* NumButtonGroup; // ConstButtonGroup C1-C6 - QButtonGroup* ConstButtonGroup; + TQButtonGroup* ConstButtonGroup; KToggleAction *actionStatshow; KToggleAction *actionScientificshow; KToggleAction *actionLogicshow; KToggleAction *actionConstantsShow; - QPtrList<KCalcButton> mFunctionButtonList; - QPtrList<KCalcButton> mStatButtonList; - QPtrList<KCalcButton> mMemButtonList; - QPtrList<KCalcButton> mOperationButtonList; + TQPtrList<KCalcButton> mFunctionButtonList; + TQPtrList<KCalcButton> mStatButtonList; + TQPtrList<KCalcButton> mMemButtonList; + TQPtrList<KCalcButton> mOperationButtonList; int mInternalSpacing; diff --git a/kcalc/kcalc_button.cpp b/kcalc/kcalc_button.cpp index 7021a1a..7472f92 100644 --- a/kcalc/kcalc_button.cpp +++ b/kcalc/kcalc_button.cpp @@ -20,32 +20,32 @@ */ -#include <qsimplerichtext.h> -#include <qtooltip.h> -#include <qpainter.h> +#include <tqsimplerichtext.h> +#include <tqtooltip.h> +#include <tqpainter.h> -#include "qdom.h" +#include "tqdom.h" #include "kcalc_button.h" -KCalcButton::KCalcButton(QWidget * parent, const char * name) +KCalcButton::KCalcButton(TQWidget * parent, const char * name) : KPushButton(parent, name), _show_accel_mode(false), _mode_flags(ModeNormal) { setAutoDefault(false); } -KCalcButton::KCalcButton(const QString &label, QWidget * parent, - const char * name, const QString &tooltip) +KCalcButton::KCalcButton(const TQString &label, TQWidget * parent, + const char * name, const TQString &tooltip) : KPushButton(label, parent, name), _show_accel_mode(false), _mode_flags(ModeNormal) { setAutoDefault(false); addMode(ModeNormal, label, tooltip); } -void KCalcButton::addMode(ButtonModeFlags mode, QString label, QString tooltip, bool is_label_richtext) +void KCalcButton::addMode(ButtonModeFlags mode, TQString label, TQString tooltip, bool is_label_richtext) { if (_mode.contains(mode)) _mode.remove(mode); @@ -69,14 +69,14 @@ void KCalcButton::slotSetMode(ButtonModeFlags mode, bool flag) if (_mode.contains(new_mode)) { // save accel, because setting label erases accel - QKeySequence _accel = accel(); + TQKeySequence _accel = accel(); if(_mode[new_mode].is_label_richtext) _label = _mode[new_mode].label; else setText(_mode[new_mode].label); - QToolTip::remove(this); - QToolTip::add(this, _mode[new_mode].tooltip); + TQToolTip::remove(this); + TQToolTip::add(this, _mode[new_mode].tooltip); _mode_flags = new_mode; // restore accel @@ -90,7 +90,7 @@ void KCalcButton::slotSetMode(ButtonModeFlags mode, bool flag) update(); } -static QString escape(QString str) +static TQString escape(TQString str) { str.replace('&', "&&"); return str; @@ -102,10 +102,10 @@ void KCalcButton::slotSetAccelDisplayMode(bool flag) _show_accel_mode = flag; // save accel, because setting label erases accel - QKeySequence _accel = accel(); + TQKeySequence _accel = accel(); if (flag == true) { - setText(escape(QString(accel()))); + setText(escape(TQString(accel()))); } else { setText(_mode[_mode_flags].label); } @@ -114,17 +114,17 @@ void KCalcButton::slotSetAccelDisplayMode(bool flag) setAccel(_accel); } -void KCalcButton::paintLabel(QPainter *paint) +void KCalcButton::paintLabel(TQPainter *paint) { if (_mode[_mode_flags].is_label_richtext) { - QSimpleRichText _text(_label, font()); + TQSimpleRichText _text(_label, font()); _text.draw(paint, width()/2-_text.width()/2, 0, childrenRegion(), colorGroup()); } else { KPushButton::drawButtonLabel(paint); } } -void KCalcButton::drawButtonLabel(QPainter *paint) +void KCalcButton::drawButtonLabel(TQPainter *paint) { if (_show_accel_mode) { KPushButton::drawButtonLabel(paint); @@ -134,7 +134,7 @@ void KCalcButton::drawButtonLabel(QPainter *paint) } -void KSquareButton::paintLabel(QPainter *paint) +void KSquareButton::paintLabel(TQPainter *paint) { int w = width(); int w2 = w/2 - 13; @@ -155,7 +155,7 @@ void KSquareButton::paintLabel(QPainter *paint) } } -void KSquareButton::drawButtonLabel(QPainter *paint) +void KSquareButton::drawButtonLabel(TQPainter *paint) { if (_show_accel_mode) { KPushButton::drawButtonLabel(paint); diff --git a/kcalc/kcalc_button.h b/kcalc/kcalc_button.h index 0998b5f..6f103a3 100644 --- a/kcalc/kcalc_button.h +++ b/kcalc/kcalc_button.h @@ -43,7 +43,7 @@ class ButtonMode { public: ButtonMode(void) {}; - ButtonMode(QString &label, QString &tooltip, bool is_label_richtext) + ButtonMode(TQString &label, TQString &tooltip, bool is_label_richtext) : is_label_richtext(is_label_richtext), tooltip(tooltip) { if (is_label_richtext) @@ -52,9 +52,9 @@ public: this->label = label; }; - QString label; + TQString label; bool is_label_richtext; - QString tooltip; + TQString tooltip; }; @@ -63,27 +63,27 @@ class KCalcButton : public KPushButton Q_OBJECT public: - KCalcButton(QWidget *parent, const char * name = 0); - KCalcButton(const QString &label, QWidget *parent, const char * name = 0, - const QString &tooltip = QString()); + KCalcButton(TQWidget *parent, const char * name = 0); + KCalcButton(const TQString &label, TQWidget *parent, const char * name = 0, + const TQString &tooltip = TQString()); - void addMode(ButtonModeFlags mode, QString label, QString tooltip, bool is_label_richtext = false); + void addMode(ButtonModeFlags mode, TQString label, TQString tooltip, bool is_label_richtext = false); public slots: void slotSetMode(ButtonModeFlags mode, bool flag); void slotSetAccelDisplayMode(bool flag); protected: - virtual void drawButtonLabel(QPainter *paint); - void paintLabel(QPainter *paint); + virtual void drawButtonLabel(TQPainter *paint); + void paintLabel(TQPainter *paint); protected: bool _show_accel_mode; - QString _label; + TQString _label; ButtonModeFlags _mode_flags; - QMap<ButtonModeFlags, ButtonMode> _mode; + TQMap<ButtonModeFlags, ButtonMode> _mode; }; class KSquareButton : public KCalcButton @@ -91,15 +91,15 @@ class KSquareButton : public KCalcButton Q_OBJECT public: - KSquareButton(QWidget *parent, const char * name = 0) + KSquareButton(TQWidget *parent, const char * name = 0) : KCalcButton(parent, name) { }; - KSquareButton(const QString &label, QWidget *parent, const char * name = 0, - const QString &tooltip = QString()) + KSquareButton(const TQString &label, TQWidget *parent, const char * name = 0, + const TQString &tooltip = TQString()) : KCalcButton(label, parent, name, tooltip) { }; protected: - virtual void drawButtonLabel(QPainter *paint); - void paintLabel(QPainter *paint); + virtual void drawButtonLabel(TQPainter *paint); + void paintLabel(TQPainter *paint); }; #endif // _KCALC_BUTTON_H diff --git a/kcalc/kcalc_const_button.cpp b/kcalc/kcalc_const_button.cpp index e9c4216..071bb71 100644 --- a/kcalc/kcalc_const_button.cpp +++ b/kcalc/kcalc_const_button.cpp @@ -19,7 +19,7 @@ */ -#include <qstring.h> +#include <tqstring.h> #include <kcmenumngr.h> @@ -31,7 +31,7 @@ #include "kcalc_settings.h" -KCalcConstButton::KCalcConstButton(QWidget *parent, int but_num, const char * name) +KCalcConstButton::KCalcConstButton(TQWidget *parent, int but_num, const char * name) : KCalcButton(parent, name), _button_num(but_num) { addMode(ModeInverse, "Store", i18n("Write display data into memory")); @@ -40,8 +40,8 @@ KCalcConstButton::KCalcConstButton(QWidget *parent, int but_num, const char * na } -KCalcConstButton::KCalcConstButton(const QString &label, QWidget *parent, int but_num, - const char * name, const QString &tooltip) +KCalcConstButton::KCalcConstButton(const TQString &label, TQWidget *parent, int but_num, + const char * name, const TQString &tooltip) : KCalcButton(label, parent, name, tooltip), _button_num(but_num) { addMode(ModeInverse, "Store", i18n("Write display data into memory")); @@ -49,15 +49,15 @@ KCalcConstButton::KCalcConstButton(const QString &label, QWidget *parent, int bu initPopupMenu(); } -QString KCalcConstButton::constant(void) const +TQString KCalcConstButton::constant(void) const { return KCalcSettings::valueConstant(_button_num); } void KCalcConstButton::setLabelAndTooltip(void) { - QString new_label = QString("C") + QString().setNum(_button_num + 1); - QString new_tooltip; + TQString new_label = TQString("C") + TQString().setNum(_button_num + 1); + TQString new_tooltip; new_label = (KCalcSettings::nameConstant(_button_num).isNull() ? new_label : KCalcSettings::nameConstant(_button_num)); @@ -74,8 +74,8 @@ void KCalcConstButton::initPopupMenu(void) _popup->insertItem(i18n("Set Name"), 0); _popup->insertItem(i18n("Choose From List"), tmp_menu, 1); - connect(_popup, SIGNAL(activated(int)), SLOT(slotConfigureButton(int))); - connect(tmp_menu, SIGNAL(activated(int)), SLOT(slotChooseScientificConst(int))); + connect(_popup, TQT_SIGNAL(activated(int)), TQT_SLOT(slotConfigureButton(int))); + connect(tmp_menu, TQT_SIGNAL(activated(int)), TQT_SLOT(slotChooseScientificConst(int))); KContextMenuManager::insert(this, _popup); } @@ -85,7 +85,7 @@ void KCalcConstButton::slotConfigureButton(int option) if (option == 0) { bool yes_no; - QString input = KInputDialog::text(i18n("New Name for Constant"), i18n("New name:"), + TQString input = KInputDialog::text(i18n("New Name for Constant"), i18n("New name:"), text(), &yes_no, this, "nameUserConstants-Dialog"); if(yes_no) { KCalcSettings::setNameConstant(_button_num, input); diff --git a/kcalc/kcalc_const_button.h b/kcalc/kcalc_const_button.h index 18ebf3e..110df3c 100644 --- a/kcalc/kcalc_const_button.h +++ b/kcalc/kcalc_const_button.h @@ -34,12 +34,12 @@ Q_OBJECT public: - KCalcConstButton(QWidget *parent, int but_num, const char * name = 0); + KCalcConstButton(TQWidget *parent, int but_num, const char * name = 0); - KCalcConstButton(const QString &label, QWidget *parent, int but_num, const char * name = 0, - const QString &tooltip = QString()); + KCalcConstButton(const TQString &label, TQWidget *parent, int but_num, const char * name = 0, + const TQString &tooltip = TQString()); - QString constant(void) const; + TQString constant(void) const; void setLabelAndTooltip(void); diff --git a/kcalc/kcalc_const_menu.cpp b/kcalc/kcalc_const_menu.cpp index 77bb02e..f758c9f 100644 --- a/kcalc/kcalc_const_menu.cpp +++ b/kcalc/kcalc_const_menu.cpp @@ -26,37 +26,37 @@ #define NUM_CONST 17 const struct science_constant KCalcConstMenu::Constants[] = { - {QString::fromUtf8("Ï€"), I18N_NOOP("Pi"), "", + {TQString::fromUtf8("Ï€"), I18N_NOOP("Pi"), "", "3.1415926535897932384626433832795028841971693993751" "05820974944592307816406286208998628034825342117068", Mathematics}, {"e", I18N_NOOP("Euler Number"), "", "2.7182818284590452353602874713526624977572470936999" "59574966967627724076630353547594571382178525166427", Mathematics}, - {QString::fromUtf8("φ"), I18N_NOOP("Golden Ratio"), "", "1.61803398874989484820458683436563811", Mathematics}, + {TQString::fromUtf8("φ"), I18N_NOOP("Golden Ratio"), "", "1.61803398874989484820458683436563811", Mathematics}, {"c", I18N_NOOP("Light Speed"), "", "2.99792458e8", Electromagnetic}, {"h", I18N_NOOP("Planck's Constant"), "", "6.6260693e-34", Nuclear}, {"G", I18N_NOOP("Constant of Gravitation"), "", "6.6742e-11", Gravitation}, {"g", I18N_NOOP("Earth Acceleration"), "", "9.80665", Gravitation}, {"e", I18N_NOOP("Elementary Charge"), "", "1.60217653e-19", ConstantCategory(Electromagnetic|Nuclear)}, {"Z_0", I18N_NOOP("Impedance of Vacuum"), "", "376.730313461", Electromagnetic}, - {QString::fromUtf8("α"), I18N_NOOP("Fine-Structure Constant"), "", "7.297352568e-3", Nuclear}, - {QString::fromUtf8("μ")+"_0", I18N_NOOP("Permeability of Vacuum"), "", "1.2566370614e-6", Electromagnetic}, - {QString::fromUtf8("ε")+"_0", I18N_NOOP("Permittivity of vacuum"), "", "8.854187817e-12", Electromagnetic}, + {TQString::fromUtf8("α"), I18N_NOOP("Fine-Structure Constant"), "", "7.297352568e-3", Nuclear}, + {TQString::fromUtf8("μ")+"_0", I18N_NOOP("Permeability of Vacuum"), "", "1.2566370614e-6", Electromagnetic}, + {TQString::fromUtf8("ε")+"_0", I18N_NOOP("Permittivity of vacuum"), "", "8.854187817e-12", Electromagnetic}, {"k", I18N_NOOP("Boltzmann Constant"), "", "1.3806505e-23", Thermodynamics}, {"1u", I18N_NOOP("Atomic Mass Unit"), "", "1.66053886e-27", Thermodynamics}, {"R", I18N_NOOP("Molar Gas Constant"), "", "8.314472", Thermodynamics}, - {QString::fromUtf8("σ"), I18N_NOOP("Stefan-Boltzmann Constant"), "", "5.670400e-8", Thermodynamics}, + {TQString::fromUtf8("σ"), I18N_NOOP("Stefan-Boltzmann Constant"), "", "5.670400e-8", Thermodynamics}, {"N_A", I18N_NOOP("Avogadro's Number"), "", "6.0221415e23", Thermodynamics} }; -KCalcConstMenu::KCalcConstMenu(QWidget * parent, const char * name) - : QPopupMenu(parent, name) +KCalcConstMenu::KCalcConstMenu(TQWidget * parent, const char * name) + : TQPopupMenu(parent, name) { - QPopupMenu *math_menu = new QPopupMenu(this, "mathematical constants"); - QPopupMenu *em_menu = new QPopupMenu(this, "electromagnetic constants"); - QPopupMenu *nuclear_menu = new QPopupMenu(this, "nuclear constants"); - QPopupMenu *thermo_menu = new QPopupMenu(this, "thermodynamics constants"); - QPopupMenu *gravitation_menu = new QPopupMenu(this, "gravitation constants"); + TQPopupMenu *math_menu = new TQPopupMenu(this, "mathematical constants"); + TQPopupMenu *em_menu = new TQPopupMenu(this, "electromagnetic constants"); + TQPopupMenu *nuclear_menu = new TQPopupMenu(this, "nuclear constants"); + TQPopupMenu *thermo_menu = new TQPopupMenu(this, "thermodynamics constants"); + TQPopupMenu *gravitation_menu = new TQPopupMenu(this, "gravitation constants"); insertItem(i18n("Mathematics"), math_menu); insertItem(i18n("Electromagnetism"), em_menu); @@ -64,11 +64,11 @@ KCalcConstMenu::KCalcConstMenu(QWidget * parent, const char * name) insertItem(i18n("Thermodynamics"), thermo_menu); insertItem(i18n("Gravitation"), gravitation_menu); - connect(math_menu, SIGNAL(activated(int)), this, SLOT(slotPassActivate(int))); - connect(em_menu, SIGNAL(activated(int)), this, SLOT(slotPassActivate(int))); - connect(nuclear_menu, SIGNAL(activated(int)), this, SLOT(slotPassActivate(int))); - connect(thermo_menu, SIGNAL(activated(int)), this, SLOT(slotPassActivate(int))); - connect(gravitation_menu, SIGNAL(activated(int)), this, SLOT(slotPassActivate(int))); + connect(math_menu, TQT_SIGNAL(activated(int)), this, TQT_SLOT(slotPassActivate(int))); + connect(em_menu, TQT_SIGNAL(activated(int)), this, TQT_SLOT(slotPassActivate(int))); + connect(nuclear_menu, TQT_SIGNAL(activated(int)), this, TQT_SLOT(slotPassActivate(int))); + connect(thermo_menu, TQT_SIGNAL(activated(int)), this, TQT_SLOT(slotPassActivate(int))); + connect(gravitation_menu, TQT_SIGNAL(activated(int)), this, TQT_SLOT(slotPassActivate(int))); for (int i = 0; i<NUM_CONST; i++) { diff --git a/kcalc/kcalc_const_menu.h b/kcalc/kcalc_const_menu.h index 4ae8da3..94c8412 100644 --- a/kcalc/kcalc_const_menu.h +++ b/kcalc/kcalc_const_menu.h @@ -23,16 +23,16 @@ #ifndef _KCALC_CONST_MENU_H #define _KCALC_CONST_MENU_H -#include <qpopupmenu.h> -#include <qstring.h> +#include <tqpopupmenu.h> +#include <tqstring.h> enum ConstantCategory {Mathematics = 1, Electromagnetic = 2, Nuclear = 4, Thermodynamics = 8, Gravitation = 16}; struct science_constant{ - QString label; + TQString label; const char * name; - QString whatsthis; - QString value; + TQString whatsthis; + TQString value; ConstantCategory category; }; @@ -41,7 +41,7 @@ class KCalcConstMenu : public QPopupMenu Q_OBJECT public: - KCalcConstMenu(QWidget * parent = 0, const char * name = 0); + KCalcConstMenu(TQWidget * parent = 0, const char * name = 0); static const struct science_constant Constants[]; diff --git a/kcalc/kcalc_core.h b/kcalc/kcalc_core.h index edd33f3..fe818e9 100644 --- a/kcalc/kcalc_core.h +++ b/kcalc/kcalc_core.h @@ -26,7 +26,7 @@ #define _KCALC_CORE_H #include "stats.h" -#include <qvaluestack.h> +#include <tqvaluestack.h> #include "knumber.h" #define POS_ZERO 1e-19L /* What we consider zero is */ @@ -153,7 +153,7 @@ class CalcEngine // into the stack, each time the user opens one. When a bracket is // closed, everything in the stack is evaluated until the first // marker "FUNC_BRACKET" found. - QValueStack<_node> _stack; + TQValueStack<_node> _stack; KNumber _last_number; diff --git a/kcalc/kcalcdisplay.cpp b/kcalc/kcalcdisplay.cpp index 672c363..1f90e03 100644 --- a/kcalc/kcalcdisplay.cpp +++ b/kcalc/kcalcdisplay.cpp @@ -27,9 +27,9 @@ #include <stdlib.h> #include <ctype.h> -#include <qclipboard.h> -#include <qpainter.h> -#include <qregexp.h> +#include <tqclipboard.h> +#include <tqpainter.h> +#include <tqregexp.h> #include <kglobal.h> #include <klocale.h> @@ -39,22 +39,22 @@ #include "kcalcdisplay.moc" -KCalcDisplay::KCalcDisplay(QWidget *parent, const char *name) - :QLabel(parent,name), _beep(false), _groupdigits(false), _button(0), _lit(false), +KCalcDisplay::KCalcDisplay(TQWidget *parent, const char *name) + :TQLabel(parent,name), _beep(false), _groupdigits(false), _button(0), _lit(false), _num_base(NB_DECIMAL), _precision(9), _fixed_precision(-1), _display_amount(0), - selection_timer(new QTimer) + selection_timer(new TQTimer) { - setFrameStyle(QFrame::WinPanel | QFrame::Sunken); + setFrameStyle(TQFrame::WinPanel | TQFrame::Sunken); setAlignment(AlignRight | AlignVCenter); setFocus(); - setFocusPolicy(QWidget::StrongFocus); - setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed, false); + setFocusPolicy(TQWidget::StrongFocus); + setSizePolicy(TQSizePolicy::Expanding, TQSizePolicy::Fixed, false); - connect(this, SIGNAL(clicked()), this, SLOT(slotDisplaySelected())); + connect(this, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotDisplaySelected())); - connect(selection_timer, SIGNAL(timeout()), - this, SLOT(slotSelectionTimedOut())); + connect(selection_timer, TQT_SIGNAL(timeout()), + this, TQT_SLOT(slotSelectionTimedOut())); sendEvent(EventReset); } @@ -71,7 +71,7 @@ bool KCalcDisplay::sendEvent(Event const event) case EventReset: _display_amount = 0; _str_int = "0"; - _str_int_exp = QString::null; + _str_int_exp = TQString::null; _eestate = false; _period = false; @@ -102,16 +102,16 @@ void KCalcDisplay::slotCut(void) void KCalcDisplay::slotCopy(void) { - QString txt = QLabel::text(); + TQString txt = TQLabel::text(); if (_num_base == NB_HEX) txt.prepend( "0x" ); - (QApplication::clipboard())->setText(txt, QClipboard::Clipboard); - (QApplication::clipboard())->setText(txt, QClipboard::Selection); + (TQApplication::clipboard())->setText(txt, QClipboard::Clipboard); + (TQApplication::clipboard())->setText(txt, QClipboard::Selection); } void KCalcDisplay::slotPaste(bool bClipboard) { - QString tmp_str = (QApplication::clipboard())->text(bClipboard ? QClipboard::Clipboard : QClipboard::Selection); + TQString tmp_str = (TQApplication::clipboard())->text(bClipboard ? QClipboard::Clipboard : QClipboard::Selection); if (tmp_str.isNull()) { @@ -173,14 +173,14 @@ void KCalcDisplay::slotSelectionTimedOut(void) void KCalcDisplay::invertColors() { - QColor tmp_col(paletteBackgroundColor()); + TQColor tmp_col(paletteBackgroundColor()); setPaletteBackgroundColor(paletteForegroundColor()); setPaletteForegroundColor(tmp_col); } -void KCalcDisplay::mousePressEvent(QMouseEvent *e) +void KCalcDisplay::mousePressEvent(TQMouseEvent *e) { if(e->button() == LeftButton) { _lit = !_lit; @@ -223,10 +223,10 @@ KNumber const & KCalcDisplay::getAmount(void) const bool KCalcDisplay::setAmount(KNumber const & new_amount) { - QString display_str; + TQString display_str; _str_int = "0"; - _str_int_exp = QString::null; + _str_int_exp = TQString::null; _period = false; _neg_sign = false; _eestate = false; @@ -236,7 +236,7 @@ bool KCalcDisplay::setAmount(KNumber const & new_amount) _display_amount = new_amount.integerPart(); unsigned long long int tmp_workaround = static_cast<unsigned long long int>(_display_amount); - display_str = QString::number(tmp_workaround, _num_base).upper(); + display_str = TQString::number(tmp_workaround, _num_base).upper(); } else // _num_base == NB_DECIMAL || new_amount.type() == // KNumber::SpecialType @@ -246,9 +246,9 @@ bool KCalcDisplay::setAmount(KNumber const & new_amount) display_str = _display_amount.toQString(KCalcSettings::precision(), _fixed_precision); #if 0 else if (_display_amount > 1.0e+16) - display_str = QCString().sprintf(PRINT_LONG_BIG, _precision + 1, _display_amount); + display_str = TQCString().sprintf(PRINT_LONG_BIG, _precision + 1, _display_amount); else - display_str = QCString().sprintf(PRINT_LONG_BIG, _precision, _display_amount); + display_str = TQCString().sprintf(PRINT_LONG_BIG, _precision, _display_amount); #endif } @@ -257,9 +257,9 @@ bool KCalcDisplay::setAmount(KNumber const & new_amount) } -void KCalcDisplay::setText(QString const &string) +void KCalcDisplay::setText(TQString const &string) { - QString localizedString = string; + TQString localizedString = string; // If we aren't in decimal mode, we don't need to modify the string if (_num_base == NB_DECIMAL && _groupdigits) @@ -273,18 +273,18 @@ void KCalcDisplay::setText(QString const &string) } else localizedString = KGlobal::locale()->formatNumber(string, false, 0); // Note: rounding happened already above! - QLabel::setText(localizedString); + TQLabel::setText(localizedString); emit changedText(localizedString); } -QString KCalcDisplay::text() const +TQString KCalcDisplay::text() const { if (_num_base != NB_DECIMAL) - return QLabel::text(); - QString display_str = _display_amount.toQString(KCalcSettings::precision()); + return TQLabel::text(); + TQString display_str = _display_amount.toQString(KCalcSettings::precision()); return display_str; - // return QCString().sprintf(PRINT_LONG_BIG, 40, _display_amount); + // return TQCString().sprintf(PRINT_LONG_BIG, 40, _display_amount); } /* change representation of display to new base (i.e. binary, decimal, @@ -321,7 +321,7 @@ int KCalcDisplay::setBase(NumBase new_base) return _num_base; } -void KCalcDisplay::setStatusText(uint i, const QString& text) +void KCalcDisplay::setStatusText(uint i, const TQString& text) { if (i < NUM_STATUS_TEXT) _str_status[i] = text; @@ -331,7 +331,7 @@ void KCalcDisplay::setStatusText(uint i, const QString& text) bool KCalcDisplay::updateDisplay(void) { // Put sign in front. - QString tmp_string; + TQString tmp_string; if(_neg_sign == true) tmp_string = "-" + _str_int; else @@ -577,16 +577,16 @@ bool KCalcDisplay::changeSign(void) return true; } -void KCalcDisplay::drawContents(QPainter *p) +void KCalcDisplay::drawContents(TQPainter *p) { - QLabel::drawContents(p); + TQLabel::drawContents(p); // draw the status texts using half of the normal // font size but not smaller than 7pt - QFont f(font()); + TQFont f(font()); f.setPointSize(QMAX((f.pointSize() / 2), 7)); p->setFont(f); - QFontMetrics fm(f); + TQFontMetrics fm(f); uint w = fm.width("_____"); uint h = fm.height(); @@ -598,11 +598,11 @@ void KCalcDisplay::drawContents(QPainter *p) // Return the QLabel's normal size hint vertically expanded // by half the font height to make room for the status texts -QSize KCalcDisplay::sizeHint() const +TQSize KCalcDisplay::sizeHint() const { - QFont f(font()); + TQFont f(font()); f.setPointSize(QMAX((f.pointSize() / 2), 7)); - QFontMetrics fm(f); - return QLabel::sizeHint() + QSize(0, fm.height()); + TQFontMetrics fm(f); + return TQLabel::sizeHint() + TQSize(0, fm.height()); } diff --git a/kcalc/kcalcdisplay.h b/kcalc/kcalcdisplay.h index 4f72fb7..6f7233c 100644 --- a/kcalc/kcalcdisplay.h +++ b/kcalc/kcalcdisplay.h @@ -27,8 +27,8 @@ #define _D_KCALCDISPLAY_H_ #include <stdlib.h> -#include <qlabel.h> -#include <qtimer.h> +#include <tqlabel.h> +#include <tqtimer.h> #include "knumber.h" #include "kcalctype.h" @@ -81,12 +81,12 @@ class KCalcDisplay : public QLabel Q_OBJECT public: - KCalcDisplay(QWidget *parent=0, const char *name=0); + KCalcDisplay(TQWidget *parent=0, const char *name=0); ~KCalcDisplay(); protected: - void mousePressEvent ( QMouseEvent *); - virtual void drawContents(QPainter *p); + void mousePressEvent ( TQMouseEvent *); + virtual void drawContents(TQPainter *p); public: enum Event { @@ -105,11 +105,11 @@ public: void setGroupDigits(bool flag); void setFixedPrecision(int precision); void setPrecision(int precision); - void setText(QString const &string); - QString text() const; + void setText(TQString const &string); + TQString text() const; bool updateDisplay(void); - void setStatusText(uint i, const QString& text); - virtual QSize sizeHint() const; + void setStatusText(uint i, const TQString& text); + virtual TQSize sizeHint() const; private: bool _beep; bool _groupdigits; @@ -129,15 +129,15 @@ private: bool _eestate; bool _period; bool _neg_sign; - QString _str_int; - QString _str_int_exp; - QString _str_status[NUM_STATUS_TEXT]; + TQString _str_int; + TQString _str_int_exp; + TQString _str_status[NUM_STATUS_TEXT]; - QTimer* selection_timer; + TQTimer* selection_timer; signals: void clicked(void); - void changedText(QString const &); + void changedText(TQString const &); public slots: void slotCut(void); diff --git a/kcalc/knumber/knumber.cpp b/kcalc/knumber/knumber.cpp index d282b26..80bae1f 100644 --- a/kcalc/knumber/knumber.cpp +++ b/kcalc/knumber/knumber.cpp @@ -22,8 +22,8 @@ #include <config.h> -#include <qregexp.h> -#include <qstring.h> +#include <tqregexp.h> +#include <tqstring.h> #include "knumber.h" @@ -94,17 +94,17 @@ KNumber::KNumber(KNumber const & num) } -KNumber::KNumber(QString const & num) +KNumber::KNumber(TQString const & num) { - if (QRegExp("^(inf|-inf|nan)$").exactMatch(num)) + if (TQRegExp("^(inf|-inf|nan)$").exactMatch(num)) _num = new _knumerror(num); - else if (QRegExp("^[+-]?\\d+$").exactMatch(num)) + else if (TQRegExp("^[+-]?\\d+$").exactMatch(num)) _num = new _knuminteger(num); - else if (QRegExp("^[+-]?\\d+/\\d+$").exactMatch(num)) { + else if (TQRegExp("^[+-]?\\d+/\\d+$").exactMatch(num)) { _num = new _knumfraction(num); simplifyRational(); } - else if (QRegExp("^[+-]?\\d+(\\.\\d*)?(e[+-]?\\d+)?$").exactMatch(num)) + else if (TQRegExp("^[+-]?\\d+(\\.\\d*)?(e[+-]?\\d+)?$").exactMatch(num)) if (_fraction_input == true) { _num = new _knumfraction(num); simplifyRational(); @@ -228,7 +228,7 @@ KNumber & KNumber::operator -=(KNumber const &arg) } // increase the digit at 'position' by one -static void _inc_by_one(QString &str, int position) +static void _inc_by_one(TQString &str, int position) { for (int i = position; i >= 0; i--) { @@ -274,7 +274,7 @@ static void _inc_by_one(QString &str, int position) } // Cut off if more digits in fractional part than 'precision' -static void _round(QString &str, int precision) +static void _round(TQString &str, int precision) { int decimalSymbolPos = str.find('.'); @@ -287,7 +287,7 @@ static void _round(QString &str, int precision) } // fill up with more than enough zeroes (in case fractional part too short) - str.append(QString().fill('0', precision)); + str.append(TQString().fill('0', precision)); // Now decide whether to round up or down char last_char = str[decimalSymbolPos + precision + 1].latin1(); @@ -319,11 +319,11 @@ static void _round(QString &str, int precision) if (precision == 0) str = str.section('.', 0, 0); } -static QString roundNumber(const QString &numStr, int precision) +static TQString roundNumber(const TQString &numStr, int precision) { - QString tmpString = numStr; + TQString tmpString = numStr; if (precision < 0 || - ! QRegExp("^[+-]?\\d+(\\.\\d+)*(e[+-]?\\d+)?$").exactMatch(tmpString)) + ! TQRegExp("^[+-]?\\d+(\\.\\d+)*(e[+-]?\\d+)?$").exactMatch(tmpString)) return numStr; @@ -333,12 +333,12 @@ static QString roundNumber(const QString &numStr, int precision) // Split off exponential part (including 'e'-symbol) - QString mantString = tmpString.section('e', 0, 0, - QString::SectionCaseInsensitiveSeps); - QString expString = tmpString.section('e', 1, 1, - QString::SectionCaseInsensitiveSeps | - QString::SectionIncludeLeadingSep); - if (expString.length() == 1) expString = QString(); + TQString mantString = tmpString.section('e', 0, 0, + TQString::SectionCaseInsensitiveSeps); + TQString expString = tmpString.section('e', 1, 1, + TQString::SectionCaseInsensitiveSeps | + TQString::SectionIncludeLeadingSep); + if (expString.length() == 1) expString = TQString(); _round(mantString, precision); @@ -349,9 +349,9 @@ static QString roundNumber(const QString &numStr, int precision) } -QString const KNumber::toQString(int width, int prec) const +TQString const KNumber::toQString(int width, int prec) const { - QString tmp_str; + TQString tmp_str; if (*this == Zero) // important to avoid infinite loops below return "0"; @@ -363,7 +363,7 @@ QString const KNumber::toQString(int width, int prec) const tmp_str = (KNumber("1.0")*(*this)).toQString(width, -1); _fraction_input = tmp_bool; } else - tmp_str = QString(_num->ascii()); + tmp_str = TQString(_num->ascii()); break; case FractionType: if (_float_output) { @@ -376,13 +376,13 @@ QString const KNumber::toQString(int width, int prec) const // split off integer part KNumber int_part = this->integerPart(); if (int_part == Zero) - tmp_str = QString(_num->ascii()); + tmp_str = TQString(_num->ascii()); else if (int_part < Zero) tmp_str = int_part.toQString() + " " + (int_part - *this)._num->ascii(); else tmp_str = int_part.toQString() + " " + (*this - int_part)._num->ascii(); } else - tmp_str = QString(_num->ascii()); + tmp_str = TQString(_num->ascii()); if (width > 0 && tmp_str.length() > width) { //result needs to be cut-off @@ -396,13 +396,13 @@ QString const KNumber::toQString(int width, int prec) const break; case FloatType: if (width > 0) - tmp_str = QString(_num->ascii(width)); + tmp_str = TQString(_num->ascii(width)); else // rough estimate for maximal decimal precision (10^3 = 2^10) - tmp_str = QString(_num->ascii(3*mpf_get_default_prec()/10)); + tmp_str = TQString(_num->ascii(3*mpf_get_default_prec()/10)); break; default: - return QString(_num->ascii()); + return TQString(_num->ascii()); } if (prec >= 0) diff --git a/kcalc/knumber/knumber.h b/kcalc/knumber/knumber.h index 489a579..b0b4444 100644 --- a/kcalc/knumber/knumber.h +++ b/kcalc/knumber/knumber.h @@ -115,7 +115,7 @@ class KDE_EXPORT KNumber KNumber(KNumber const & num); - KNumber(QString const & num); + KNumber(TQString const & num); ~KNumber() { @@ -142,7 +142,7 @@ class KDE_EXPORT KNumber static void setDefaultFloatOutput(bool flag); /** - * Set whether a number constructed from a QString should be + * Set whether a number constructed from a TQString should be * initialized as a fraction or as a float, e.g. "1.01" would be * treated as 101/100, if this flag is set to true. * @@ -168,7 +168,7 @@ class KDE_EXPORT KNumber static void setSplitoffIntegerForFractionOutput(bool flag); /** - * Return a QString representing the KNumber. + * Return a TQString representing the KNumber. * * @param width This number specifies the maximal length of the * output, before the method switches to exponential notation and @@ -179,7 +179,7 @@ class KDE_EXPORT KNumber * is ignored. * */ - QString const toQString(int width = -1, int prec = -1) const; + TQString const toQString(int width = -1, int prec = -1) const; /** * Compute the absolute value, i.e. @p x.abs() returns the value diff --git a/kcalc/knumber/knumber_priv.cpp b/kcalc/knumber/knumber_priv.cpp index 1326d44..56de7d3 100644 --- a/kcalc/knumber/knumber_priv.cpp +++ b/kcalc/knumber/knumber_priv.cpp @@ -23,8 +23,8 @@ #ifdef HAVE_STDLIB_H #include <stdlib.h> #endif -#include <qregexp.h> -#include <qstring.h> +#include <tqregexp.h> +#include <tqstring.h> #include "knumber_priv.h" @@ -115,7 +115,7 @@ _knumfloat::_knumfloat(_knumber const & num) -_knumerror::_knumerror(QString const & num) +_knumerror::_knumerror(TQString const & num) { if (num == "nan") _error = UndefinedNumber; @@ -125,20 +125,20 @@ _knumerror::_knumerror(QString const & num) _error = MinusInfinity; } -_knuminteger::_knuminteger(QString const & num) +_knuminteger::_knuminteger(TQString const & num) { mpz_init(_mpz); mpz_set_str(_mpz, num.ascii(), 10); } -_knumfraction::_knumfraction(QString const & num) +_knumfraction::_knumfraction(TQString const & num) { mpq_init(_mpq); - if (QRegExp("^[+-]?\\d+(\\.\\d*)?(e[+-]?\\d+)?$").exactMatch(num)) { + if (TQRegExp("^[+-]?\\d+(\\.\\d*)?(e[+-]?\\d+)?$").exactMatch(num)) { // my hand-made conversion is terrible // first me convert the mantissa unsigned long int digits_after_dot = ((num.section( '.', 1, 1)).section('e', 0, 0)).length(); - QString tmp_num = num.section('e', 0, 0).remove('.'); + TQString tmp_num = num.section('e', 0, 0).remove('.'); mpq_set_str(_mpq, tmp_num.ascii(), 10); mpz_t tmp_int; mpz_init(tmp_int); @@ -163,7 +163,7 @@ _knumfraction::_knumfraction(QString const & num) mpq_canonicalize(_mpq); } -_knumfloat::_knumfloat(QString const & num) +_knumfloat::_knumfloat(TQString const & num) { mpf_init(_mpf); mpf_set_str(_mpf, num.ascii(), 10); @@ -178,51 +178,51 @@ _knuminteger const & _knuminteger::operator = (_knuminteger const & num) return *this; } -QString const _knumerror::ascii(int prec) const +TQString const _knumerror::ascii(int prec) const { static_cast<void>(prec); switch(_error) { case UndefinedNumber: - return QString("nan"); + return TQString("nan"); case Infinity: - return QString("inf"); + return TQString("inf"); case MinusInfinity: - return QString("-inf"); + return TQString("-inf"); default: - return QString::null; + return TQString::null; } } -QString const _knuminteger::ascii(int prec) const +TQString const _knuminteger::ascii(int prec) const { static_cast<void>(prec); char *tmp_ptr; gmp_asprintf(&tmp_ptr, "%Zd", _mpz); - QString ret_str = tmp_ptr; + TQString ret_str = tmp_ptr; free(tmp_ptr); return ret_str; } -QString const _knumfraction::ascii(int prec) const +TQString const _knumfraction::ascii(int prec) const { static_cast<void>(prec); char *tmp_ptr = mpq_get_str(0, 10, _mpq); - QString ret_str = tmp_ptr; + TQString ret_str = tmp_ptr; free(tmp_ptr); return ret_str; } -QString const _knumfloat::ascii(int prec) const +TQString const _knumfloat::ascii(int prec) const { - QString ret_str; + TQString ret_str; char *tmp_ptr; if (prec > 0) - gmp_asprintf(&tmp_ptr, ("%." + QString().setNum(prec) + "Fg").ascii(), _mpf); + gmp_asprintf(&tmp_ptr, ("%." + TQString().setNum(prec) + "Fg").ascii(), _mpf); else gmp_asprintf(&tmp_ptr, "%Fg", _mpf); diff --git a/kcalc/knumber/knumber_priv.h b/kcalc/knumber/knumber_priv.h index 7dd58a6..cb6b13b 100644 --- a/kcalc/knumber/knumber_priv.h +++ b/kcalc/knumber/knumber_priv.h @@ -47,7 +47,7 @@ class _knumber virtual NumType type(void) const = 0; - virtual QString const ascii(int prec = -1) const = 0; + virtual TQString const ascii(int prec = -1) const = 0; virtual _knumber * abs(void) const = 0; virtual _knumber * intPart(void) const = 0; @@ -79,7 +79,7 @@ class _knumerror : public _knumber _knumerror(_knumber const & num); - _knumerror(const QString & num); + _knumerror(const TQString & num); //virtual ~_knumerror() { } @@ -92,7 +92,7 @@ class _knumerror : public _knumber virtual NumType type(void) const {return SpecialType;} - virtual QString const ascii(int prec = -1) const; + virtual TQString const ascii(int prec = -1) const; virtual _knumber * abs(void) const; virtual _knumber * intPart(void) const; @@ -150,7 +150,7 @@ class _knuminteger : public _knumber _knuminteger(_knumber const & num); - _knuminteger(const QString & num); + _knuminteger(const TQString & num); virtual ~_knuminteger() { @@ -166,7 +166,7 @@ class _knuminteger : public _knumber virtual NumType type(void) const {return IntegerType;} - virtual QString const ascii(int prec = -1) const; + virtual TQString const ascii(int prec = -1) const; virtual _knumber * abs(void) const; virtual _knumber * intPart(void) const; @@ -213,7 +213,7 @@ class _knumfraction : public _knumber _knumfraction(_knumber const & num); - _knumfraction(QString const & num); + _knumfraction(TQString const & num); virtual ~_knumfraction() { @@ -227,7 +227,7 @@ class _knumfraction : public _knumber virtual NumType type(void) const {return FractionType;} - virtual QString const ascii(int prec = -1) const; + virtual TQString const ascii(int prec = -1) const; bool isInteger(void) const; @@ -267,7 +267,7 @@ class _knumfloat : public _knumber _knumfloat(_knumber const & num); - _knumfloat(QString const & num); + _knumfloat(TQString const & num); virtual ~_knumfloat() { @@ -281,7 +281,7 @@ class _knumfloat : public _knumber virtual NumType type(void) const {return FloatType;} - virtual QString const ascii(int prec = -1) const; + virtual TQString const ascii(int prec = -1) const; virtual _knumber * abs(void) const; virtual _knumber * intPart(void) const; diff --git a/kcalc/knumber/tests/knumbertest.cpp b/kcalc/knumber/tests/knumbertest.cpp index 814410e..e34d94d 100644 --- a/kcalc/knumber/tests/knumbertest.cpp +++ b/kcalc/knumber/tests/knumbertest.cpp @@ -6,29 +6,29 @@ #include <stdio.h> #include <iostream> -#include <qstring.h> +#include <tqstring.h> #include "knumbertest.h" -QString const numtypeToString(KNumber::NumType arg) +TQString const numtypeToString(KNumber::NumType arg) { switch(arg) { case KNumber::SpecialType: - return QString("Special"); + return TQString("Special"); case KNumber::IntegerType: - return QString("Integer"); + return TQString("Integer"); case KNumber::FractionType: - return QString("Fraction"); + return TQString("Fraction"); case KNumber::FloatType: - return QString("Float"); + return TQString("Float"); default: - return QString("Unknown:") + QString::number(static_cast<int>(arg)); + return TQString("Unknown:") + TQString::number(static_cast<int>(arg)); } } -void checkResult(QString const &string, KNumber const & result, - QString const & desired_string, KNumber::NumType desired) +void checkResult(TQString const &string, KNumber const & result, + TQString const & desired_string, KNumber::NumType desired) { std::cout << "Testing result of: " << string.ascii() << " should give " << desired_string.ascii() << " and gives " << @@ -47,7 +47,7 @@ void checkResult(QString const &string, KNumber const & result, exit(1); } -void checkTruth(QString const &string, bool computation, +void checkTruth(TQString const &string, bool computation, bool desired_result) { std::cout << "Testing truth of: " << string.ascii() << @@ -64,7 +64,7 @@ void checkTruth(QString const &string, bool computation, } -void checkType(QString const &string, KNumber::NumType test_arg, +void checkType(TQString const &string, KNumber::NumType test_arg, KNumber::NumType desired) { std::cout << "Testing type of: " << string.ascii() << " should give " << diff --git a/kcalc/stats.cpp b/kcalc/stats.cpp index 909bed6..45da5c3 100644 --- a/kcalc/stats.cpp +++ b/kcalc/stats.cpp @@ -64,7 +64,7 @@ void KStats::clearLast(void) { KNumber KStats::sum(void) { KNumber result = 0; - QValueVector<KNumber>::iterator p; + TQValueVector<KNumber>::iterator p; for(p = mData.begin(); p != mData.end(); ++p) { result += *p; @@ -94,7 +94,7 @@ KNumber KStats::median(void) { return mData.at(0); // need to copy mData-list, because sorting afterwards - QValueVector<KNumber> tmp_mData(mData); + TQValueVector<KNumber> tmp_mData(mData); qHeapSort(tmp_mData); if( bound & 1) { // odd @@ -113,7 +113,7 @@ KNumber KStats::std_kernel(void) { KNumber result = KNumber::Zero; KNumber _mean; - QValueVector<KNumber>::iterator p; + TQValueVector<KNumber>::iterator p; _mean = mean(); @@ -128,7 +128,7 @@ KNumber KStats::std_kernel(void) KNumber KStats::sum_of_squares() { KNumber result = 0; - QValueVector<KNumber>::iterator p; + TQValueVector<KNumber>::iterator p; for(p = mData.begin(); p != mData.end(); ++p) { result += ((*p) * (*p)); diff --git a/kcalc/stats.h b/kcalc/stats.h index 48b7ddc..aba11f4 100644 --- a/kcalc/stats.h +++ b/kcalc/stats.h @@ -26,7 +26,7 @@ #ifndef KSTATS_H #define KSTATS_H -#include <qvaluevector.h> +#include <tqvaluevector.h> #include "knumber.h" class KStats { @@ -50,7 +50,7 @@ public: bool error(); private: - QValueVector<KNumber> mData; + TQValueVector<KNumber> mData; bool error_flag; }; diff --git a/kcharselect/kcharselectdia.cc b/kcharselect/kcharselectdia.cc index 43e13b0..fec2f86 100644 --- a/kcharselect/kcharselectdia.cc +++ b/kcharselect/kcharselectdia.cc @@ -21,84 +21,84 @@ /******************************************************************/ //================================================================== -KCharSelectDia::KCharSelectDia(QWidget *parent,const char *name, - const QChar &_chr,const QString &_font, +KCharSelectDia::KCharSelectDia(TQWidget *parent,const char *name, + const TQChar &_chr,const TQString &_font, int _tableNum, bool direction) : KMainWindow(parent,name), vChr(_chr), vFont(_font) { - setCaption(QString::null); // Standard caption + setCaption(TQString::null); // Standard caption - QWidget *mainWidget = new QWidget(this); + TQWidget *mainWidget = new TQWidget(this); setCentralWidget(mainWidget); - grid = new QGridLayout( mainWidget, 3, 4, KDialog::marginHint(), KDialog::spacingHint() ); + grid = new TQGridLayout( mainWidget, 3, 4, KDialog::marginHint(), KDialog::spacingHint() ); // Add character selection widget from library kdeui charSelect = new KCharSelect(mainWidget,"",vFont,vChr,_tableNum); charSelect->resize(charSelect->sizeHint()); - connect(charSelect,SIGNAL(highlighted(const QChar &)), - SLOT(charChanged(const QChar &))); - connect(charSelect,SIGNAL(activated(const QChar &)), - SLOT(add(const QChar &))); - connect(charSelect,SIGNAL(fontChanged(const QString &)), - SLOT(fontSelected(const QString &))); + connect(charSelect,TQT_SIGNAL(highlighted(const TQChar &)), + TQT_SLOT(charChanged(const TQChar &))); + connect(charSelect,TQT_SIGNAL(activated(const TQChar &)), + TQT_SLOT(add(const TQChar &))); + connect(charSelect,TQT_SIGNAL(fontChanged(const TQString &)), + TQT_SLOT(fontSelected(const TQString &))); grid->addMultiCellWidget(charSelect, 0, 0, 0, 3); // Build line editor - lined = new QLineEdit(mainWidget); + lined = new TQLineEdit(mainWidget); lined->resize(lined->sizeHint()); - QFont font = lined->font(); + TQFont font = lined->font(); font.setFamily( vFont ); lined->setFont( font ); - connect(lined,SIGNAL(textChanged(const QString &)), - SLOT(lineEditChanged())); + connect(lined,TQT_SIGNAL(textChanged(const TQString &)), + TQT_SLOT(lineEditChanged())); grid->addMultiCellWidget(lined, 1, 1, 0, 3); // Build some buttons bHelp = new KPushButton( KStdGuiItem::help(), mainWidget ); - connect(bHelp,SIGNAL(clicked()),this,SLOT(help())); + connect(bHelp,TQT_SIGNAL(clicked()),this,TQT_SLOT(help())); bHelp->setFixedSize( bHelp->sizeHint() ); grid->addWidget( bHelp, 2, 0 ); - QSpacerItem *space = new QSpacerItem( 20, 20, QSizePolicy::Expanding ); + TQSpacerItem *space = new TQSpacerItem( 20, 20, TQSizePolicy::Expanding ); grid->addItem( space, 2, 1 ); bClear = new KPushButton( KStdGuiItem::clear(), mainWidget ); - connect(bClear,SIGNAL(clicked()),this,SLOT(clear())); + connect(bClear,TQT_SIGNAL(clicked()),this,TQT_SLOT(clear())); bClear->setFixedSize( bClear->sizeHint() ); grid->addWidget( bClear, 2, 2 ); bClip = new KPushButton( KGuiItem( i18n( "&To Clipboard" ), "editcopy" ), mainWidget ); bClip->setFixedSize( bClip->sizeHint() ); - connect(bClip,SIGNAL(clicked()),this,SLOT(toClip())); + connect(bClip,TQT_SIGNAL(clicked()),this,TQT_SLOT(toClip())); grid->addWidget( bClip, 2, 3 ); // Build menu - KStdAction::quit( this, SLOT(_exit()), actionCollection() ); + KStdAction::quit( this, TQT_SLOT(_exit()), actionCollection() ); new KAction(i18n("&To Clipboard"), "editcopy", - KStdAccel::shortcut(KStdAccel::Copy), this, SLOT(toClip()), actionCollection(), "copy_clip" ); + KStdAccel::shortcut(KStdAccel::Copy), this, TQT_SLOT(toClip()), actionCollection(), "copy_clip" ); (void)new KAction(i18n("To Clipboard &UTF-8"), 0, this, - SLOT(toClipUTF8()), actionCollection(), "copy_utf_8" ); + TQT_SLOT(toClipUTF8()), actionCollection(), "copy_utf_8" ); (void)new KAction(i18n("To Clipboard &HTML"), 0, this, - SLOT(toClipHTML()), actionCollection(), "copy_html" ); + TQT_SLOT(toClipHTML()), actionCollection(), "copy_html" ); new KAction(i18n("&From Clipboard"), "editpaste", - KStdAccel::shortcut(KStdAccel::Paste), this, SLOT(fromClip()), actionCollection(), "from_clip" ); + KStdAccel::shortcut(KStdAccel::Paste), this, TQT_SLOT(fromClip()), actionCollection(), "from_clip" ); (void)new KAction(i18n("From Clipboard UTF-8"), 0, this, - SLOT(fromClipUTF8()), actionCollection(), "from_clip_utf8" ); + TQT_SLOT(fromClipUTF8()), actionCollection(), "from_clip_utf8" ); i18n("From Clipboard HTML"); // Intended for future use - KStdAction::clear(this, SLOT(clear()), actionCollection(), "clear"); + KStdAction::clear(this, TQT_SLOT(clear()), actionCollection(), "clear"); (void)new KAction(i18n("&Flip"), 0, this, - SLOT(flipText()), actionCollection(), "flip" ); + TQT_SLOT(flipText()), actionCollection(), "flip" ); (void)new KAction(i18n("&Alignment"), 0, this, - SLOT(toggleEntryDirection()), actionCollection(), "alignment" ); + TQT_SLOT(toggleEntryDirection()), actionCollection(), "alignment" ); charSelect->setFocus(); @@ -112,17 +112,17 @@ KCharSelectDia::KCharSelectDia(QWidget *parent,const char *name, } //================================================================== -void KCharSelectDia::charChanged(const QChar &_chr) +void KCharSelectDia::charChanged(const TQChar &_chr) { vChr = _chr; } //================================================================== -void KCharSelectDia::fontSelected(const QString &_font) +void KCharSelectDia::fontSelected(const TQString &_font) { charSelect->setFont(_font); - QFont font = lined->font(); + TQFont font = lined->font(); font.setFamily( _font ); lined->setFont( font ); @@ -130,9 +130,9 @@ void KCharSelectDia::fontSelected(const QString &_font) } //================================================================== -void KCharSelectDia::add(const QChar &_chr) +void KCharSelectDia::add(const TQChar &_chr) { - QString str; + TQString str; int cursorPos; charChanged(_chr); @@ -148,7 +148,7 @@ void KCharSelectDia::add(const QChar &_chr) //================================================================== void KCharSelectDia::toClip() { - QClipboard *cb = QApplication::clipboard(); + QClipboard *cb = TQApplication::clipboard(); cb->setSelectionMode( true ); cb->setText(lined->text()); cb->setSelectionMode( false ); @@ -161,8 +161,8 @@ void KCharSelectDia::toClip() // void KCharSelectDia::toClipUTF8() { - QClipboard *cb = QApplication::clipboard(); - QString str = lined->text(); + QClipboard *cb = TQApplication::clipboard(); + TQString str = lined->text(); cb->setText(str.utf8()); } @@ -174,11 +174,11 @@ void KCharSelectDia::toClipUTF8() // void KCharSelectDia::toClipHTML() { - QClipboard *cb = QApplication::clipboard(); - QString input; - QString html; - QString tempstring; - QChar tempchar; + QClipboard *cb = TQApplication::clipboard(); + TQString input; + TQString html; + TQString tempstring; + TQChar tempchar; uint i; input = lined->text(); @@ -201,7 +201,7 @@ void KCharSelectDia::toClipHTML() // void KCharSelectDia::fromClip() { - QClipboard *cb = QApplication::clipboard(); + QClipboard *cb = TQApplication::clipboard(); lined->setText( cb->text() ); } @@ -213,8 +213,8 @@ void KCharSelectDia::fromClip() // void KCharSelectDia::fromClipUTF8() { - QClipboard *cb = QApplication::clipboard(); - QString str = cb->text(); + QClipboard *cb = TQApplication::clipboard(); + TQString str = cb->text(); lined->setText( str.fromUtf8( str.latin1() ) ); } @@ -227,8 +227,8 @@ void KCharSelectDia::fromClipUTF8() // void KCharSelectDia::flipText() { - QString input; - QString output; + TQString input; + TQString output; uint i; input = lined->text(); diff --git a/kcharselect/kcharselectdia.h b/kcharselect/kcharselectdia.h index a3a0ea1..6427c40 100644 --- a/kcharselect/kcharselectdia.h +++ b/kcharselect/kcharselectdia.h @@ -8,9 +8,9 @@ #define kcharselectdia_h -#include <qlayout.h> -#include <qlineedit.h> -#include <qclipboard.h> +#include <tqlayout.h> +#include <tqlineedit.h> +#include <tqclipboard.h> #include <kpushbutton.h> #include <kcharselect.h> @@ -27,33 +27,33 @@ class KCharSelectDia : public KMainWindow Q_OBJECT public: - KCharSelectDia(QWidget *parent,const char *name,const QChar &_chr,const QString &_font,int _tableNum, bool direction); + KCharSelectDia(TQWidget *parent,const char *name,const TQChar &_chr,const TQString &_font,int _tableNum, bool direction); - static bool selectChar(QString &_font,QChar &_chr,int _tableNum); + static bool selectChar(TQString &_font,TQChar &_chr,int _tableNum); int chr() { return vChr; } - QString font() { return vFont; } + TQString font() { return vFont; } protected: - void closeEvent(QCloseEvent *) { _exit(); } + void closeEvent(TQCloseEvent *) { _exit(); } - QGridLayout *grid; + TQGridLayout *grid; KCharSelect *charSelect; - QLineEdit *lined; + TQLineEdit *lined; KPushButton *bClip,*bClear; KPushButton *bHelp; - QChar vChr; - QString vFont; + TQChar vChr; + TQString vFont; int pointSize; bool entryDirection; protected slots: - void charChanged(const QChar &_chr); - void fontSelected(const QString &_font); + void charChanged(const TQChar &_chr); + void fontSelected(const TQString &_font); void add() { add(vChr); } - void add(const QChar &_chr); + void add(const TQChar &_chr); void toClip(); void toClipUTF8(); void toClipHTML(); diff --git a/kcharselect/main.cc b/kcharselect/main.cc index b3477cc..c3cdd4a 100644 --- a/kcharselect/main.cc +++ b/kcharselect/main.cc @@ -34,8 +34,8 @@ int main(int argc, char **argv) KConfig *config = kapp->config(); config->setGroup("General"); - QString font(config->readEntry("selectedFont", KGlobalSettings::generalFont().family())); - QChar c = QChar(static_cast<unsigned short>(config->readNumEntry("char",33))); + TQString font(config->readEntry("selectedFont", KGlobalSettings::generalFont().family())); + TQChar c = TQChar(static_cast<unsigned short>(config->readNumEntry("char",33))); int tn = config->readNumEntry("table",0); bool direction = config->readNumEntry("entryDirection",0); diff --git a/kdelirc/irkick/irkick.cpp b/kdelirc/irkick/irkick.cpp index 31ec93c..fdcfa3a 100644 --- a/kdelirc/irkick/irkick.cpp +++ b/kdelirc/irkick/irkick.cpp @@ -7,12 +7,12 @@ // This program is free software. -#include <qwidget.h> -#include <qdialog.h> -#include <qtooltip.h> -#include <qregexp.h> -#include <qtimer.h> -#include <qevent.h> +#include <tqwidget.h> +#include <tqdialog.h> +#include <tqtooltip.h> +#include <tqregexp.h> +#include <tqtimer.h> +#include <tqevent.h> #include <kdeversion.h> #include <kapplication.h> @@ -42,12 +42,12 @@ #include "profileserver.h" #include "irkick.h" -void IRKTrayIcon::mousePressEvent(QMouseEvent *e) +void IRKTrayIcon::mousePressEvent(TQMouseEvent *e) { - KSystemTray::mousePressEvent(new QMouseEvent(QEvent::MouseButtonPress, e->pos(), e->globalPos(), e->button() == LeftButton ? RightButton : e->button(), e->state())); + KSystemTray::mousePressEvent(new TQMouseEvent(TQEvent::MouseButtonPress, e->pos(), e->globalPos(), e->button() == LeftButton ? RightButton : e->button(), e->state())); } -IRKick::IRKick(const QCString &obj) : QObject(), DCOPObject(obj), npApp(QString::null) +IRKick::IRKick(const TQCString &obj) : TQObject(), DCOPObject(obj), npApp(TQString::null) { kapp->dcopClient()->setDefaultObject(obj); theClient = new KLircClient(); @@ -55,28 +55,28 @@ IRKick::IRKick(const QCString &obj) : QObject(), DCOPObject(obj), npApp(QString: theTrayIcon = new IRKTrayIcon(); if(theClient->isConnected()) { theTrayIcon->setPixmap(SmallIcon("irkick")); - QToolTip::add(theTrayIcon, i18n("KDE Lirc Server: Ready.")); + TQToolTip::add(theTrayIcon, i18n("KDE Lirc Server: Ready.")); } else { theTrayIcon->setPixmap(SmallIcon("irkickoff")); - QToolTip::add(theTrayIcon, i18n("KDE Lirc Server: No infra-red remote controls found.")); - QTimer::singleShot(10000, this, SLOT(checkLirc())); + TQToolTip::add(theTrayIcon, i18n("KDE Lirc Server: No infra-red remote controls found.")); + TQTimer::singleShot(10000, this, TQT_SLOT(checkLirc())); } - theFlashOff = new QTimer(theTrayIcon); - connect(theFlashOff, SIGNAL(timeout()), SLOT(flashOff())); + theFlashOff = new TQTimer(theTrayIcon); + connect(theFlashOff, TQT_SIGNAL(timeout()), TQT_SLOT(flashOff())); theResetCount = 0; slotReloadConfiguration(); - connect(theClient, SIGNAL(connectionClosed()), this, SLOT(slotClosed())); - connect(theClient, SIGNAL(remotesRead()), this, SLOT(resetModes())); - connect(theClient, SIGNAL(commandReceived(const QString &, const QString &, int)), this, SLOT(gotMessage(const QString &, const QString &, int))); + connect(theClient, TQT_SIGNAL(connectionClosed()), this, TQT_SLOT(slotClosed())); + connect(theClient, TQT_SIGNAL(remotesRead()), this, TQT_SLOT(resetModes())); + connect(theClient, TQT_SIGNAL(commandReceived(const TQString &, const TQString &, int)), this, TQT_SLOT(gotMessage(const TQString &, const TQString &, int))); theTrayIcon->contextMenu()->changeTitle(0, "IRKick"); - theTrayIcon->contextMenu()->insertItem(SmallIcon( "configure" ), i18n("&Configure..."), this, SLOT(slotConfigure())); + theTrayIcon->contextMenu()->insertItem(SmallIcon( "configure" ), i18n("&Configure..."), this, TQT_SLOT(slotConfigure())); theTrayIcon->contextMenu()->insertSeparator(); theTrayIcon->contextMenu()->insertItem(SmallIcon( "help" ), KStdGuiItem::help().text(), (new KHelpMenu(theTrayIcon, KGlobal::instance()->aboutData()))->menu()); - theTrayIcon->actionCollection()->action("file_quit")->disconnect(SIGNAL(activated())); - connect(theTrayIcon->actionCollection()->action("file_quit"), SIGNAL(activated()), SLOT(doQuit())); + theTrayIcon->actionCollection()->action("file_quit")->disconnect(TQT_SIGNAL(activated())); + connect(theTrayIcon->actionCollection()->action("file_quit"), TQT_SIGNAL(activated()), TQT_SLOT(doQuit())); theTrayIcon->show(); } @@ -84,7 +84,7 @@ IRKick::IRKick(const QCString &obj) : QObject(), DCOPObject(obj), npApp(QString: IRKick::~IRKick() { delete theTrayIcon; - for(QMap<QString,IRKTrayIcon *>::iterator i = currentModeIcons.begin(); i != currentModeIcons.end(); ++i) + for(TQMap<TQString,IRKTrayIcon *>::iterator i = currentModeIcons.begin(); i != currentModeIcons.end(); ++i) if(*i) delete *i; } @@ -92,7 +92,7 @@ void IRKick::slotClosed() { theTrayIcon->setPixmap(SmallIcon("irkickoff")); KPassivePopup::message("IRKick", i18n("The infrared system has severed its connection. Remote controls are no longer available."), SmallIcon("irkick"), theTrayIcon); - QTimer::singleShot(1000, this, SLOT(checkLirc())); + TQTimer::singleShot(1000, this, TQT_SLOT(checkLirc())); } void IRKick::checkLirc() @@ -103,7 +103,7 @@ void IRKick::checkLirc() theTrayIcon->setPixmap(SmallIcon("irkick")); } else - QTimer::singleShot(10000, this, SLOT(checkLirc())); + TQTimer::singleShot(10000, this, TQT_SLOT(checkLirc())); } void IRKick::flashOff() @@ -130,8 +130,8 @@ void IRKick::resetModes() if(!theResetCount) allModes.generateNulls(theClient->remotes()); - QStringList remotes = theClient->remotes(); - for(QStringList::iterator i = remotes.begin(); i != remotes.end(); ++i) + TQStringList remotes = theClient->remotes(); + for(TQStringList::iterator i = remotes.begin(); i != remotes.end(); ++i) { currentModes[*i] = allModes.getDefault(*i).name(); if(theResetCount && currentModeIcons[*i]) delete currentModeIcons[*i]; currentModeIcons[*i] = 0; @@ -157,7 +157,7 @@ void IRKick::slotConfigure() void IRKick::updateModeIcons() { - for(QMap<QString,QString>::iterator i = currentModes.begin(); i != currentModes.end(); ++i) + for(TQMap<TQString,TQString>::iterator i = currentModes.begin(); i != currentModes.end(); ++i) { Mode mode = allModes.getMode(i.key(), i.data()); if(mode.iconFile().isNull() || mode.iconFile().isEmpty()) { if(currentModeIcons[i.key()]) @@ -173,12 +173,12 @@ void IRKick::updateModeIcons() currentModeIcons[i.key()]->actionCollection()->action("file_quit")->setEnabled(false); } currentModeIcons[i.key()]->setPixmap(KIconLoader().loadIcon(mode.iconFile(), KIcon::Panel)); - QToolTip::add(currentModeIcons[i.key()], mode.remoteName() + ": <b>" + mode.name() + "</b>"); + TQToolTip::add(currentModeIcons[i.key()], mode.remoteName() + ": <b>" + mode.name() + "</b>"); } } } -bool IRKick::getPrograms(const IRAction &action, QStringList &programs) +bool IRKick::getPrograms(const IRAction &action, TQStringList &programs) { DCOPClient *theDC = KApplication::dcopClient(); programs.clear(); @@ -189,23 +189,23 @@ bool IRKick::getPrograms(const IRAction &action, QStringList &programs) } else { - QRegExp r = QRegExp("^" + action.program() + "-(\\d+)$"); + TQRegExp r = TQRegExp("^" + action.program() + "-(\\d+)$"); // find all instances... QCStringList buf = theDC->registeredApplications(); for(QCStringList::iterator i = buf.begin(); i != buf.end(); ++i) { - QString program = QString::fromUtf8(*i); + TQString program = TQString::fromUtf8(*i); if(program.contains(r)) programs += program; } if(programs.size() > 1 && action.ifMulti() == IM_DONTSEND) return false; else if(programs.size() > 1 && action.ifMulti() == IM_SENDTOTOP) - { QValueList<WId> s = KWinModule().stackingOrder(); + { TQValueList<WId> s = KWinModule().stackingOrder(); // go through all the (ordered) window pids - for(QValueList<WId>::iterator i = s.fromLast(); i != s.end(); i--) + for(TQValueList<WId>::iterator i = s.fromLast(); i != s.end(); i--) { int p = KWin::info(*i).pid; - QString id = action.program() + "-" + QString().setNum(p); + TQString id = action.program() + "-" + TQString().setNum(p); if(programs.contains(id)) { programs.clear(); programs += id; @@ -215,11 +215,11 @@ bool IRKick::getPrograms(const IRAction &action, QStringList &programs) while(programs.size() > 1) programs.remove(programs.begin()); } else if(programs.size() > 1 && action.ifMulti() == IM_SENDTOBOTTOM) - { QValueList<WId> s = KWinModule().stackingOrder(); + { TQValueList<WId> s = KWinModule().stackingOrder(); // go through all the (ordered) window pids - for(QValueList<WId>::iterator i = s.begin(); i != s.end(); ++i) + for(TQValueList<WId>::iterator i = s.begin(); i != s.end(); ++i) { int p = KWin::info(*i).pid; - QString id = action.program() + "-" + QString().setNum(p); + TQString id = action.program() + "-" + TQString().setNum(p); if(programs.contains(id)) { programs.clear(); programs += id; @@ -235,13 +235,13 @@ bool IRKick::getPrograms(const IRAction &action, QStringList &programs) void IRKick::executeAction(const IRAction &action) { DCOPClient *theDC = KApplication::dcopClient(); - QStringList programs; + TQStringList programs; if(!getPrograms(action, programs)) return; // if programs.size()==0 here, then the app is definately not running. if(action.autoStart() && !programs.size()) - { QString sname = ProfileServer::profileServer()->getServiceName(action.program()); + { TQString sname = ProfileServer::profileServer()->getServiceName(action.program()); if(!sname.isNull()) { KPassivePopup::message("IRKick", i18n("Starting <b>%1</b>...").arg(action.application()), SmallIcon("irkick"), theTrayIcon); @@ -252,20 +252,20 @@ void IRKick::executeAction(const IRAction &action) if(!getPrograms(action, programs)) return; - for(QStringList::iterator i = programs.begin(); i != programs.end(); ++i) - { const QString &program = *i; + for(TQStringList::iterator i = programs.begin(); i != programs.end(); ++i) + { const TQString &program = *i; if(theDC->isApplicationRegistered(program.utf8())) - { QByteArray data; QDataStream arg(data, IO_WriteOnly); + { TQByteArray data; TQDataStream arg(data, IO_WriteOnly); kdDebug() << "Sending data (" << program << ", " << action.object() << ", " << action.method().prototypeNR() << endl; for(Arguments::const_iterator j = action.arguments().begin(); j != action.arguments().end(); ++j) { kdDebug() << "Got argument..." << endl; switch((*j).type()) - { case QVariant::Int: arg << (*j).toInt(); break; - case QVariant::CString: arg << (*j).toCString(); break; - case QVariant::StringList: arg << (*j).toStringList(); break; - case QVariant::UInt: arg << (*j).toUInt(); break; - case QVariant::Bool: arg << (*j).toBool(); break; - case QVariant::Double: arg << (*j).toDouble(); break; + { case TQVariant::Int: arg << (*j).toInt(); break; + case TQVariant::CString: arg << (*j).toCString(); break; + case TQVariant::StringList: arg << (*j).toStringList(); break; + case TQVariant::UInt: arg << (*j).toUInt(); break; + case TQVariant::Bool: arg << (*j).toBool(); break; + case TQVariant::Double: arg << (*j).toDouble(); break; default: arg << (*j).toString(); break; } } @@ -274,17 +274,17 @@ void IRKick::executeAction(const IRAction &action) } } -void IRKick::gotMessage(const QString &theRemote, const QString &theButton, int theRepeatCounter) +void IRKick::gotMessage(const TQString &theRemote, const TQString &theButton, int theRepeatCounter) { kdDebug() << "Got message: " << theRemote << ": " << theButton << " (" << theRepeatCounter << ")" << endl; theTrayIcon->setPixmap(SmallIcon("irkickflash")); theFlashOff->start(200, true); if(!npApp.isNull()) { - QString theApp = npApp; - npApp = QString::null; + TQString theApp = npApp; + npApp = TQString::null; // send notifier by DCOP to npApp/npModule/npMethod(theRemote, theButton); - QByteArray data; QDataStream arg(data, IO_WriteOnly); + TQByteArray data; TQDataStream arg(data, IO_WriteOnly); arg << theRemote << theButton; KApplication::dcopClient()->send(theApp.utf8(), npModule.utf8(), npMethod.utf8(), data); } @@ -321,7 +321,7 @@ void IRKick::gotMessage(const QString &theRemote, const QString &theButton, int } } -void IRKick::stealNextPress(QString app, QString module, QString method) +void IRKick::stealNextPress(TQString app, TQString module, TQString method) { npApp = app; npModule = module; @@ -330,7 +330,7 @@ void IRKick::stealNextPress(QString app, QString module, QString method) void IRKick::dontStealNextPress() { - npApp = QString::null; + npApp = TQString::null; } #include "irkick.moc" diff --git a/kdelirc/irkick/irkick.h b/kdelirc/irkick/irkick.h index 875d039..bdcb57e 100644 --- a/kdelirc/irkick/irkick.h +++ b/kdelirc/irkick/irkick.h @@ -14,7 +14,7 @@ #ifndef __IRKICK_H #define __IRKICK_H -#include <qstring.h> +#include <tqstring.h> #include <ksystemtray.h> #include <kdedmodule.h> @@ -30,30 +30,30 @@ class QMouseEvent; class IRKTrayIcon: public KSystemTray { - void mousePressEvent(QMouseEvent *e); + void mousePressEvent(TQMouseEvent *e); public: KPopupMenu* contextMenu() const { return KSystemTray::contextMenu(); } KActionCollection* actionCollection() { return KSystemTray::actionCollection(); } - IRKTrayIcon(QWidget *parent = 0, const char *name = 0): KSystemTray(parent, name) {} + IRKTrayIcon(TQWidget *parent = 0, const char *name = 0): KSystemTray(parent, name) {} }; -class IRKick: public QObject, public DCOPObject +class IRKick: public TQObject, public DCOPObject { Q_OBJECT K_DCOP - QString npApp, npModule, npMethod; - QMap<QString, QString> currentModes; - QMap<QString, IRKTrayIcon *> currentModeIcons; + TQString npApp, npModule, npMethod; + TQMap<TQString, TQString> currentModes; + TQMap<TQString, IRKTrayIcon *> currentModeIcons; IRActions allActions; int theResetCount; Modes allModes; IRKTrayIcon *theTrayIcon; KAboutData *aboutData; - QTimer *theFlashOff; + TQTimer *theFlashOff; void updateModeIcons(); @@ -82,23 +82,23 @@ k_dcop: * * @returns said list. */ - virtual const QStringList remotes() { return theClient->remotes(); } + virtual const TQStringList remotes() { return theClient->remotes(); } /** * Retrieve list of buttons of a praticular remote control. * * @returns said list. */ - virtual const QStringList buttons(QString theRemote) { return theClient->buttons(theRemote); } + virtual const TQStringList buttons(TQString theRemote) { return theClient->buttons(theRemote); } /** * Sends next keypress to given application by DCOP. * * @param The receiving application. * @param The receiving application module. - * @param The method name. Must have two QString parameters. + * @param The method name. Must have two TQString parameters. */ - virtual void stealNextPress(QString app, QString module, QString method); + virtual void stealNextPress(TQString app, TQString module, TQString method); /** * Cancels the proceedings of the previous stealNextPress call, if any. @@ -111,7 +111,7 @@ k_dcop: virtual void reloadConfiguration() { slotReloadConfiguration(); } private slots: - void gotMessage(const QString &theRemote, const QString &theButton, int theRepeatCounter); + void gotMessage(const TQString &theRemote, const TQString &theButton, int theRepeatCounter); void resetModes(); void doQuit(); void flashOff(); @@ -122,10 +122,10 @@ private slots: void slotClosed(); private: void executeAction(const IRAction &action); - bool getPrograms(const IRAction &action, QStringList &populous); + bool getPrograms(const IRAction &action, TQStringList &populous); public: - IRKick(const QCString &obj); + IRKick(const TQCString &obj); virtual ~IRKick(); }; diff --git a/kdelirc/irkick/kdedmodule_stub.h b/kdelirc/irkick/kdedmodule_stub.h index 5f248f8..86f4640 100644 --- a/kdelirc/irkick/kdedmodule_stub.h +++ b/kdelirc/irkick/kdedmodule_stub.h @@ -14,7 +14,7 @@ #define __KDEDMODULE_STUB__ #include <dcopstub.h> -#include <qobject.h> +#include <tqobject.h> #include <dcopobject.h> #include <dcopref.h> #include <ksharedptr.h> @@ -23,8 +23,8 @@ class KDEDModule_stub : virtual public DCOPStub { public: - KDEDModule_stub( const QCString& app, const QCString& id ); - KDEDModule_stub( DCOPClient* client, const QCString& app, const QCString& id ); + KDEDModule_stub( const TQCString& app, const TQCString& id ); + KDEDModule_stub( DCOPClient* client, const TQCString& app, const TQCString& id ); explicit KDEDModule_stub( const DCOPRef& ref ); protected: KDEDModule_stub() : DCOPStub( never_use ) {}; diff --git a/kdelirc/irkick/klircclient.cpp b/kdelirc/irkick/klircclient.cpp index 2876079..897d8fc 100644 --- a/kdelirc/irkick/klircclient.cpp +++ b/kdelirc/irkick/klircclient.cpp @@ -19,12 +19,12 @@ #include <sys/socket.h> #include <errno.h> -#include <qwidget.h> -#include <qdialog.h> -#include <qtooltip.h> -#include <qsocket.h> -#include <qsocketnotifier.h> -#include <qfile.h> +#include <tqwidget.h> +#include <tqdialog.h> +#include <tqtooltip.h> +#include <tqsocket.h> +#include <tqsocketnotifier.h> +#include <tqfile.h> #include <kapplication.h> #include <ksystemtray.h> @@ -43,7 +43,7 @@ #include "klircclient.h" -KLircClient::KLircClient(QWidget *parent, const char *name) : QObject(parent, name), theSocket(0), listIsUpToDate(false) +KLircClient::KLircClient(TQWidget *parent, const char *name) : TQObject(parent, name), theSocket(0), listIsUpToDate(false) { connectToLirc(); } @@ -68,8 +68,8 @@ bool KLircClient::connectToLirc() theSocket = new QSocket; theSocket->setSocket(sock); - connect(theSocket, SIGNAL(readyRead()), SLOT(slotRead())); - connect(theSocket, SIGNAL(connectionClosed()), SLOT(slotClosed())); + connect(theSocket, TQT_SIGNAL(readyRead()), TQT_SLOT(slotRead())); + connect(theSocket, TQT_SIGNAL(connectionClosed()), TQT_SLOT(slotClosed())); updateRemotes(); return true; } @@ -87,16 +87,16 @@ void KLircClient::slotClosed() emit connectionClosed(); } -const QStringList KLircClient::remotes() const +const TQStringList KLircClient::remotes() const { - QStringList remotes; - for(QMap<QString, QStringList>::ConstIterator i = theRemotes.begin(); i != theRemotes.end(); ++i) + TQStringList remotes; + for(TQMap<TQString, TQStringList>::ConstIterator i = theRemotes.begin(); i != theRemotes.end(); ++i) remotes.append(i.key()); remotes.sort(); return remotes; } -const QStringList KLircClient::buttons(const QString &theRemote) const +const TQStringList KLircClient::buttons(const TQString &theRemote) const { return theRemotes[theRemote]; } @@ -105,7 +105,7 @@ void KLircClient::slotRead() { while (theSocket->bytesAvailable()) { - QString line = readLine(); + TQString line = readLine(); if (line == "BEGIN") { // BEGIN @@ -133,7 +133,7 @@ void KLircClient::slotRead() while (!line.isEmpty() && line != "END"); return; } - QStringList remotes; + TQStringList remotes; int count = readLine().toInt(); for (int i = 0; i < count; ++i) remotes.append(readLine()); @@ -141,7 +141,7 @@ void KLircClient::slotRead() while (!line.isEmpty() && line != "END"); if (line.isEmpty()) return; // abort on corrupt data - for (QStringList::ConstIterator it = remotes.begin(); it != remotes.end(); ++it) + for (TQStringList::ConstIterator it = remotes.begin(); it != remotes.end(); ++it) sendCommand("LIST " + *it); return; } @@ -154,13 +154,13 @@ void KLircClient::slotRead() while (!line.isEmpty() && line != "END"); return; } - QString remote = line.mid(5); - QStringList buttons; + TQString remote = line.mid(5); + TQStringList buttons; int count = readLine().toInt(); for (int i = 0; i < count; ++i) { // <code> <name> - QString btn = readLine().mid(17); + TQString btn = readLine().mid(17); if(btn.isNull()) break; if(btn.startsWith("'") && btn.endsWith("'")) btn = btn.mid(1, btn.length() - 2); @@ -186,7 +186,7 @@ void KLircClient::slotRead() pos = line.find(' '); if (pos < 0) return; - QString btn = line.left(pos); + TQString btn = line.left(pos); if(btn.startsWith("'") && btn.endsWith("'")) btn = btn.mid(1, btn.length() - 2); line.remove(0, pos + 1); @@ -206,7 +206,7 @@ void KLircClient::updateRemotes() bool KLircClient::isConnected() const { if(!theSocket) return false; - return theSocket->state() == QSocket::Connected; + return theSocket->state() == TQSocket::Connected; } bool KLircClient::haveFullList() const @@ -214,7 +214,7 @@ bool KLircClient::haveFullList() const return listIsUpToDate; } -const QString KLircClient::readLine() +const TQString KLircClient::readLine() { if (!theSocket->canReadLine()) { bool timeout; @@ -223,18 +223,18 @@ const QString KLircClient::readLine() theSocket->waitForMore(500, &timeout); if (timeout) { // something's wrong. there ain't no line comin! - return QString::null; + return TQString::null; } } - QString line = theSocket->readLine(); + TQString line = theSocket->readLine(); line.truncate(line.length() - 1); return line; } -void KLircClient::sendCommand(const QString &command) +void KLircClient::sendCommand(const TQString &command) { - QString cmd = command + "\n"; - theSocket->writeBlock(QFile::encodeName( cmd ), cmd.length()); + TQString cmd = command + "\n"; + theSocket->writeBlock(TQFile::encodeName( cmd ), cmd.length()); } diff --git a/kdelirc/irkick/klircclient.h b/kdelirc/irkick/klircclient.h index ea5fa75..30f5fe5 100644 --- a/kdelirc/irkick/klircclient.h +++ b/kdelirc/irkick/klircclient.h @@ -13,10 +13,10 @@ #ifndef KLIRCCLIENT_H #define KLIRCCLIENT_H -#include <qobject.h> -#include <qmap.h> -#include <qstring.h> -#include <qstringlist.h> +#include <tqobject.h> +#include <tqmap.h> +#include <tqstring.h> +#include <tqstringlist.h> class QSocket; class QSocketNotifier; @@ -32,14 +32,14 @@ class KLircClient: public QObject private: struct lirc_config *theConfig; - QSocket *theSocket; - QSocketNotifier *theNotifier; - QMap<QString, QStringList> theRemotes; + TQSocket *theSocket; + TQSocketNotifier *theNotifier; + TQMap<TQString, TQStringList> theRemotes; bool listIsUpToDate; void updateRemotes(); - void sendCommand(const QString &command); - const QString readLine(); + void sendCommand(const TQString &command); + const TQString readLine(); private slots: void slotRead(); @@ -62,7 +62,7 @@ signals: * The repeat counter starts with 0 and increases * every time this signal is emitted. */ - void commandReceived(const QString &remote, const QString &button, int repeatCounter); + void commandReceived(const TQString &remote, const TQString &button, int repeatCounter); /** * Emitted when the Lirc connection is closed. @@ -91,14 +91,14 @@ public: * * @returns said list. */ - const QStringList remotes() const; + const TQStringList remotes() const; /** * Retrieve list of buttons of a praticular remote control. * * @returns said list. */ - const QStringList buttons(const QString &theRemote) const; + const TQStringList buttons(const TQString &theRemote) const; /** * Connects to lirc. @@ -107,7 +107,7 @@ public: */ bool connectToLirc(); - KLircClient(QWidget *parent = 0, const char *name = 0); + KLircClient(TQWidget *parent = 0, const char *name = 0); ~KLircClient(); }; diff --git a/kdelirc/kcmlirc/addaction.cpp b/kdelirc/kcmlirc/addaction.cpp index 1a3ecef..f2d6ad3 100644 --- a/kdelirc/kcmlirc/addaction.cpp +++ b/kdelirc/kcmlirc/addaction.cpp @@ -8,12 +8,12 @@ * (at your option) any later version. * ***************************************************************************/ -#include <qregexp.h> -#include <qlabel.h> -#include <qradiobutton.h> -#include <qwidgetstack.h> -#include <qcheckbox.h> -#include <qbuttongroup.h> +#include <tqregexp.h> +#include <tqlabel.h> +#include <tqradiobutton.h> +#include <tqwidgetstack.h> +#include <tqcheckbox.h> +#include <tqbuttongroup.h> #include <kdebug.h> #include <klineedit.h> @@ -32,10 +32,10 @@ #include "profileserver.h" #include "remoteserver.h" -AddAction::AddAction(QWidget *parent, const char *name, const Mode &mode): AddActionBase(parent, name), theMode(mode) +AddAction::AddAction(TQWidget *parent, const char *name, const Mode &mode): AddActionBase(parent, name), theMode(mode) { - connect(this, SIGNAL( selected(const QString &) ), SLOT( updateForPageChange() )); - connect(this, SIGNAL( selected(const QString &) ), SLOT( slotCorrectPage() )); + connect(this, TQT_SIGNAL( selected(const TQString &) ), TQT_SLOT( updateForPageChange() )); + connect(this, TQT_SIGNAL( selected(const TQString &) ), TQT_SLOT( slotCorrectPage() )); curPage = 0; updateProfiles(); updateButtons(); @@ -64,23 +64,23 @@ void AddAction::slotCorrectPage() curPage = indexOf(currentPage()); if(curPage == 2 && theUseProfile->isChecked()) - showPage(((QWizard *)this)->page(lastPage > 1 ? 1 : 3)); + showPage(((TQWizard *)this)->page(lastPage > 1 ? 1 : 3)); if((curPage == 2 || curPage == 5) && theChangeMode->isChecked()) - showPage(((QWizard *)this)->page(lastPage > 1 ? 1 : 6)); + showPage(((TQWizard *)this)->page(lastPage > 1 ? 1 : 6)); if(curPage == 3 && theUseDCOP->isChecked()) - showPage(((QWizard *)this)->page(lastPage == 4 ? 2 : 4)); + showPage(((TQWizard *)this)->page(lastPage == 4 ? 2 : 4)); if(curPage == 4 && ( (theUseDCOP->isChecked() && theFunctions->currentItem() && !Prototype(theFunctions->currentItem()->text(2)).count()) || (theUseProfile->isChecked() && (theProfileFunctions->currentItem() && !theProfileFunctions->currentItem()->text(1).toInt() || theJustStart->isChecked())) )) - showPage(((QWizard *)this)->page(lastPage == 5 ? (theUseDCOP->isChecked() ? 2 : 3) : 5)); + showPage(((TQWizard *)this)->page(lastPage == 5 ? (theUseDCOP->isChecked() ? 2 : 3) : 5)); } void AddAction::requestNextPress() { - IRKick_stub("irkick", "IRKick").stealNextPress(DCOPClient::mainClient()->appId(), "KCMLirc", "gotButton(QString, QString)"); + IRKick_stub("irkick", "IRKick").stealNextPress(DCOPClient::mainClient()->appId(), "KCMLirc", "gotButton(TQString, TQString)"); } void AddAction::cancelRequest() @@ -88,7 +88,7 @@ void AddAction::cancelRequest() IRKick_stub("irkick", "IRKick").dontStealNextPress(); } -void AddAction::updateButton(const QString &remote, const QString &button) +void AddAction::updateButton(const TQString &remote, const TQString &button) { if(theMode.remote() == remote) { // note this isn't the "correct" way of doing it; really i should iterate throughg the items and try to find the item which when put through buttonMap[item] returns the current button name. but i cant be arsed. @@ -109,9 +109,9 @@ void AddAction::updateButtons() theButtons->clear(); buttonMap.clear(); IRKick_stub IRKick("irkick", "IRKick"); - QStringList buttons = IRKick.buttons(theMode.remote()); - for(QStringList::iterator j = buttons.begin(); j != buttons.end(); ++j) - buttonMap[new QListViewItem(theButtons, RemoteServer::remoteServer()->getButtonName(theMode.remote(), *j))] = *j; + TQStringList buttons = IRKick.buttons(theMode.remote()); + for(TQStringList::iterator j = buttons.begin(); j != buttons.end(); ++j) + buttonMap[new TQListViewItem(theButtons, RemoteServer::remoteServer()->getButtonName(theMode.remote(), *j))] = *j; } void AddAction::updateForPageChange() @@ -140,17 +140,17 @@ void AddAction::updateButtonStates() } } -const QStringList AddAction::getFunctions(const QString app, const QString obj) +const TQStringList AddAction::getFunctions(const TQString app, const TQString obj) { - QStringList ret; + TQStringList ret; DCOPClient *theClient = KApplication::kApplication()->dcopClient(); QCStringList theApps = theClient->remoteFunctions(app.utf8(), obj.utf8()); for(QCStringList::iterator i = theApps.begin(); i != theApps.end(); ++i) if( *i != "QCStringList interfaces()" && *i != "QCStringList functions()" && *i != "QCStringList objects()" && - *i != "QCStringList find(QCString)" ) - ret += QString::fromUtf8(*i); + *i != "QCStringList find(TQCString)" ) + ret += TQString::fromUtf8(*i); return ret; } @@ -160,10 +160,10 @@ void AddAction::updateProfiles() theProfiles->clear(); profileMap.clear(); - QDict<Profile> dict = theServer->profiles(); - QDictIterator<Profile> i(dict); + TQDict<Profile> dict = theServer->profiles(); + TQDictIterator<Profile> i(dict); for(; i.current(); ++i) - profileMap[new QListViewItem(theProfiles, i.current()->name())] = i.currentKey(); + profileMap[new TQListViewItem(theProfiles, i.current()->name())] = i.currentKey(); } void AddAction::updateOptions() @@ -180,10 +180,10 @@ void AddAction::updateOptions() else if(theUseDCOP->isChecked()) { if(!theObjects->selectedItem()) return; - QListViewItem* i = theObjects->selectedItem()->parent(); + TQListViewItem* i = theObjects->selectedItem()->parent(); if(!i) return; isUnique = uniqueProgramMap[i]; - QRegExp r("(.*)-[0-9]+"); + TQRegExp r("(.*)-[0-9]+"); program = r.exactMatch(nameProgramMap[i]) ? r.cap(1) : nameProgramMap[i]; im = IM_DONTSEND; } @@ -213,9 +213,9 @@ void AddAction::updateProfileFunctions() if(!theProfiles->currentItem()) return; const Profile *p = theServer->profiles()[profileMap[theProfiles->currentItem()]]; - QDict<ProfileAction> dict = p->actions(); - for(QDictIterator<ProfileAction> i(dict); i.current(); ++i) - profileFunctionMap[new QListViewItem(theProfileFunctions, i.current()->name(), QString().setNum(i.current()->arguments().count()), i.current()->comment())] = i.currentKey(); + TQDict<ProfileAction> dict = p->actions(); + for(TQDictIterator<ProfileAction> i(dict); i.current(); ++i) + profileFunctionMap[new TQListViewItem(theProfileFunctions, i.current()->name(), TQString().setNum(i.current()->arguments().count()), i.current()->comment())] = i.currentKey(); updateParameters(); updateOptions(); } @@ -228,9 +228,9 @@ void AddAction::updateParameters() { Prototype p(theFunctions->currentItem()->text(2)); for(unsigned k = 0; k < p.count(); k++) - { new KListViewItem(theParameters, p.name(k).isEmpty() ? i18n( "<anonymous>" ) : p.name(k), "", p.type(k), QString().setNum(k + 1)); - theArguments.append(QVariant("")); - theArguments.back().cast(QVariant::nameToType(p.type(k).utf8())); + { new KListViewItem(theParameters, p.name(k).isEmpty() ? i18n( "<anonymous>" ) : p.name(k), "", p.type(k), TQString().setNum(k + 1)); + theArguments.append(TQVariant("")); + theArguments.back().cast(TQVariant::nameToType(p.type(k).utf8())); } } else if(theUseProfile->isChecked() && theProfiles->currentItem()) @@ -243,10 +243,10 @@ void AddAction::updateParameters() const ProfileAction *pa = p->actions()[profileFunctionMap[theProfileFunctions->currentItem()]]; int index = 1; - for(QValueList<ProfileActionArgument>::const_iterator i = pa->arguments().begin(); i != pa->arguments().end(); ++i, index++) - { theArguments.append(QVariant((*i).getDefault())); - theArguments.back().cast(QVariant::nameToType((*i).type().utf8())); - new QListViewItem(theParameters, (*i).comment(), theArguments.back().toString(), (*i).type(), QString().setNum(index)); + for(TQValueList<ProfileActionArgument>::const_iterator i = pa->arguments().begin(); i != pa->arguments().end(); ++i, index++) + { theArguments.append(TQVariant((*i).getDefault())); + theArguments.back().cast(TQVariant::nameToType((*i).type().utf8())); + new TQListViewItem(theParameters, (*i).comment(), theArguments.back().toString(), (*i).type(), TQString().setNum(index)); } // quicky update options too... @@ -260,7 +260,7 @@ void AddAction::updateParameters() void AddAction::updateParameter() { if(theParameters->currentItem()) - { QString type = theParameters->currentItem()->text(2); + { TQString type = theParameters->currentItem()->text(2); int index = theParameters->currentItem()->text(3).toInt() - 1; if(type.find("int") != -1 || type.find("short") != -1 || type.find("long") != -1) { theValue->raiseWidget(2); @@ -274,9 +274,9 @@ void AddAction::updateParameter() { theValue->raiseWidget(1); theValueCheckBox->setChecked(theArguments[index].toBool()); } - else if(type.find("QStringList") != -1) + else if(type.find("TQStringList") != -1) { theValue->raiseWidget(4); - QStringList backup = theArguments[index].toStringList(); + TQStringList backup = theArguments[index].toStringList(); // backup needed because calling clear will kill what ever has been saved. theValueEditListBox->clear(); theValueEditListBox->insertStringList(backup); @@ -306,31 +306,31 @@ void AddAction::slotParameterChanged() { if(!theParameters->currentItem()) return; int index = theParameters->currentItem()->text(3).toInt() - 1; - QString type = theParameters->currentItem()->text(2); + TQString type = theParameters->currentItem()->text(2); if(type.find("int") != -1 || type.find("short") != -1 || type.find("long") != -1) theArguments[index].asInt() = theValueIntNumInput->value(); else if(type.find("double") != -1 || type.find("float") != -1) theArguments[index].asDouble() = theValueDoubleNumInput->value(); else if(type.find("bool") != -1) theArguments[index].asBool() = theValueCheckBox->isChecked(); - else if(type.find("QStringList") != -1) + else if(type.find("TQStringList") != -1) theArguments[index].asStringList() = theValueEditListBox->items(); else theArguments[index].asString() = theValueLineEdit->text(); - theArguments[theParameters->currentItem()->text(3).toInt() - 1].cast(QVariant::nameToType(theParameters->currentItem()->text(2).utf8())); + theArguments[theParameters->currentItem()->text(3).toInt() - 1].cast(TQVariant::nameToType(theParameters->currentItem()->text(2).utf8())); updateArgument(theParameters->currentItem()); } // takes theArguments[theIndex] and puts it into theItem -void AddAction::updateArgument(QListViewItem *theItem) +void AddAction::updateArgument(TQListViewItem *theItem) { theItem->setText(1, theArguments[theItem->text(3).toInt() - 1].toString()); } void AddAction::updateObjects() { - QStringList names; + TQStringList names; theObjects->clear(); uniqueProgramMap.clear(); nameProgramMap.clear(); @@ -339,15 +339,15 @@ void AddAction::updateObjects() QCStringList theApps = theClient->registeredApplications(); for(QCStringList::iterator i = theApps.begin(); i != theApps.end(); ++i) { - if(!QString(*i).find("anonymous")) continue; - if(!QString(*i).find(i18n( "anonymous" ))) continue; - QRegExp r("(.*)-[0-9]+"); - QString name = r.exactMatch(QString(*i)) ? r.cap(1) : *i; + if(!TQString(*i).find("anonymous")) continue; + if(!TQString(*i).find(i18n( "anonymous" ))) continue; + TQRegExp r("(.*)-[0-9]+"); + TQString name = r.exactMatch(TQString(*i)) ? r.cap(1) : *i; if(names.contains(name)) continue; names += name; KListViewItem *a = new KListViewItem(theObjects, name); - uniqueProgramMap[a] = name == QString(*i); + uniqueProgramMap[a] = name == TQString(*i); nameProgramMap[a] = *i; QCStringList theObjects = theClient->remoteObjects(*i); @@ -362,9 +362,9 @@ void AddAction::updateFunctions() { theFunctions->clear(); if(theObjects->currentItem() && theObjects->currentItem()->parent()) - { QStringList functions = getFunctions(nameProgramMap[theObjects->currentItem()->parent()], theObjects->currentItem()->text(0)); - for(QStringList::iterator i = functions.begin(); i != functions.end(); ++i) - { Prototype p((QString)(*i)); + { TQStringList functions = getFunctions(nameProgramMap[theObjects->currentItem()->parent()], theObjects->currentItem()->text(0)); + for(TQStringList::iterator i = functions.begin(); i != functions.end(); ++i) + { Prototype p((TQString)(*i)); new KListViewItem(theFunctions, p.name(), p.argumentList(), *i); } } diff --git a/kdelirc/kcmlirc/addaction.h b/kdelirc/kcmlirc/addaction.h index 4d13659..df3d9c7 100644 --- a/kdelirc/kcmlirc/addaction.h +++ b/kdelirc/kcmlirc/addaction.h @@ -10,8 +10,8 @@ #ifndef ADDACTION_H #define ADDACTION_H -#include <qvaluelist.h> -#include <qpair.h> +#include <tqvaluelist.h> +#include <tqpair.h> #include <addactionbase.h> @@ -39,7 +39,7 @@ public slots: // connected to KCMLirc class to receive DCOP calls to tell it what button has been pressed virtual void updateForPageChange(); - virtual void updateButton(const QString &remote, const QString &button); + virtual void updateButton(const TQString &remote, const TQString &button); virtual void updateButtons(); virtual void updateFunctions(); virtual void updateObjects(); @@ -52,21 +52,21 @@ public slots: public: Arguments theArguments; - QString program; + TQString program; bool isUnique; - static const QStringList getFunctions(const QString app, const QString obj); - void updateArgument(QListViewItem *theItem); + static const TQStringList getFunctions(const TQString app, const TQString obj); + void updateArgument(TQListViewItem *theItem); void requestNextPress(); void cancelRequest(); - QMap<QListViewItem *, QString> profileMap; - QMap<QListViewItem *, QString> profileFunctionMap; - QMap<QListViewItem *, QString> buttonMap; - QMap<QListViewItem *, bool> uniqueProgramMap; - QMap<QListViewItem *, QString> nameProgramMap; + TQMap<TQListViewItem *, TQString> profileMap; + TQMap<TQListViewItem *, TQString> profileFunctionMap; + TQMap<TQListViewItem *, TQString> buttonMap; + TQMap<TQListViewItem *, bool> uniqueProgramMap; + TQMap<TQListViewItem *, TQString> nameProgramMap; - AddAction(QWidget *parent, const char *name, const Mode &mode); + AddAction(TQWidget *parent, const char *name, const Mode &mode); ~AddAction(); }; diff --git a/kdelirc/kcmlirc/editaction.cpp b/kdelirc/kcmlirc/editaction.cpp index 5a2a28b..594e4a2 100644 --- a/kdelirc/kcmlirc/editaction.cpp +++ b/kdelirc/kcmlirc/editaction.cpp @@ -10,13 +10,13 @@ // Copyright: See COPYING file that comes with this distribution // // -#include <qregexp.h> -#include <qlabel.h> -#include <qradiobutton.h> -#include <qcombobox.h> -#include <qcheckbox.h> -#include <qwidgetstack.h> -#include <qbuttongroup.h> +#include <tqregexp.h> +#include <tqlabel.h> +#include <tqradiobutton.h> +#include <tqcombobox.h> +#include <tqcheckbox.h> +#include <tqwidgetstack.h> +#include <tqbuttongroup.h> #include <kdebug.h> #include <klineedit.h> @@ -35,7 +35,7 @@ #include "editaction.h" #include "addaction.h" -EditAction::EditAction(IRAIt action, QWidget *parent, const char *name) : EditActionBase(parent, name) +EditAction::EditAction(IRAIt action, TQWidget *parent, const char *name) : EditActionBase(parent, name) { theAction = action; @@ -151,16 +151,16 @@ void EditAction::updateArguments() theArguments->clear(); const ProfileAction *a = ProfileServer::profileServer()->getAction(applicationMap[theApplications->currentText()], functionMap[theFunctions->currentText()]); if(!a) { arguments.clear(); return; } - const QValueList<ProfileActionArgument> &p = a->arguments(); + const TQValueList<ProfileActionArgument> &p = a->arguments(); if(p.count() != arguments.count()) { arguments.clear(); for(unsigned i = 0; i < p.count(); i++) - arguments.append(QVariant("")); + arguments.append(TQVariant("")); } theArguments->setEnabled(p.count()); for(unsigned i = 0; i < p.count(); i++) { theArguments->insertItem(p[i].comment() + " (" + p[i].type() + ")"); - arguments[i].cast(QVariant::nameToType(p[i].type().utf8())); + arguments[i].cast(TQVariant::nameToType(p[i].type().utf8())); } if(p.count()) updateArgument(0); else updateArgument(-1); } @@ -171,12 +171,12 @@ void EditAction::updateArguments() if(p.count() != arguments.count()) { arguments.clear(); for(unsigned i = 0; i < p.count(); i++) - arguments.append(QVariant("")); + arguments.append(TQVariant("")); } theArguments->setEnabled(p.count()); for(unsigned i = 0; i < p.count(); i++) - { theArguments->insertItem(QString().setNum(i + 1) + ": " + (p.name(i).isEmpty() ? p.type(i) : p.name(i) + " (" + p.type(i) + ")")); - arguments[i].cast(QVariant::nameToType(p.type(i).utf8())); + { theArguments->insertItem(TQString().setNum(i + 1) + ": " + (p.name(i).isEmpty() ? p.type(i) : p.name(i) + " (" + p.type(i) + ")")); + arguments[i].cast(TQVariant::nameToType(p.type(i).utf8())); } if(p.count()) updateArgument(0); else updateArgument(-1); } @@ -216,22 +216,22 @@ void EditAction::slotParameterChanged() kdDebug() << type << endl; switch(type) { - case QVariant::Int: case QVariant::UInt: + case TQVariant::Int: case TQVariant::UInt: arguments[theArguments->currentItem()].asInt() = theValueIntNumInput->value(); break; - case QVariant::Double: + case TQVariant::Double: arguments[theArguments->currentItem()].asDouble() = theValueDoubleNumInput->value(); break; - case QVariant::Bool: + case TQVariant::Bool: arguments[theArguments->currentItem()].asBool() = theValueCheckBox->isChecked(); break; - case QVariant::StringList: + case TQVariant::StringList: arguments[theArguments->currentItem()].asStringList() = theValueEditListBox->items(); break; default: arguments[theArguments->currentItem()].asString() = theValueLineEdit->text(); } - arguments[theArguments->currentItem()].cast(QVariant::Type(type)); + arguments[theArguments->currentItem()].cast(TQVariant::Type(type)); kdDebug() << "out: " << arguments[theArguments->currentItem()].toString() << endl; } @@ -242,21 +242,21 @@ void EditAction::updateArgument(int index) if(index >= 0) { switch(arguments[index].type()) { - case QVariant::Int: case QVariant::UInt: + case TQVariant::Int: case TQVariant::UInt: theValue->raiseWidget(2); theValueIntNumInput->setValue(arguments[index].toInt()); break; - case QVariant::Double: + case TQVariant::Double: theValue->raiseWidget(3); theValueDoubleNumInput->setValue(arguments[index].toDouble()); break; - case QVariant::Bool: + case TQVariant::Bool: theValue->raiseWidget(1); theValueCheckBox->setChecked(arguments[index].toBool()); break; - case QVariant::StringList: + case TQVariant::StringList: { theValue->raiseWidget(4); - QStringList backup = arguments[index].toStringList(); + TQStringList backup = arguments[index].toStringList(); // backup needed because calling clear will kill what ever has been saved. theValueEditListBox->clear(); theValueEditListBox->insertStringList(backup); @@ -284,8 +284,8 @@ void EditAction::updateApplications() theApplications->clear(); applicationMap.clear(); - QDict<Profile> dict = theServer->profiles(); - QDictIterator<Profile> i(dict); + TQDict<Profile> dict = theServer->profiles(); + TQDictIterator<Profile> i(dict); for(; i.current(); ++i) { theApplications->insertItem(i.current()->name()); applicationMap[i.current()->name()] = i.currentKey(); @@ -302,8 +302,8 @@ void EditAction::updateFunctions() const Profile *p = theServer->profiles()[applicationMap[theApplications->currentText()]]; - QDict<ProfileAction> dict = p->actions(); - for(QDictIterator<ProfileAction> i(dict); i.current(); ++i) + TQDict<ProfileAction> dict = p->actions(); + for(TQDictIterator<ProfileAction> i(dict); i.current(); ++i) { theFunctions->insertItem(i.current()->name()); functionMap[i.current()->name()] = i.currentKey(); } @@ -312,21 +312,21 @@ void EditAction::updateFunctions() void EditAction::updateDCOPApplications() { - QStringList names; + TQStringList names; theDCOPApplications->clear(); DCOPClient *theClient = KApplication::kApplication()->dcopClient(); QCStringList theApps = theClient->registeredApplications(); for(QCStringList::iterator i = theApps.begin(); i != theApps.end(); ++i) { - if(!QString(*i).find("anonymous")) continue; - QRegExp r("(.*)-[0-9]+"); - QString name = r.exactMatch(QString(*i)) ? r.cap(1) : *i; + if(!TQString(*i).find("anonymous")) continue; + TQRegExp r("(.*)-[0-9]+"); + TQString name = r.exactMatch(TQString(*i)) ? r.cap(1) : *i; if(names.contains(name)) continue; names += name; theDCOPApplications->insertItem(name); - uniqueProgramMap[name] = name == QString(*i); + uniqueProgramMap[name] = name == TQString(*i); nameProgramMap[name] = *i; @@ -343,7 +343,7 @@ void EditAction::updateDCOPObjects() if(!theObjects.size() && theDCOPApplications->currentText() == (*theAction).program()) theDCOPObjects->insertItem((*theAction).object()); for(QCStringList::iterator j = theObjects.begin(); j != theObjects.end(); ++j) if(*j != "ksycoca" && *j != "qt" && AddAction::getFunctions(nameProgramMap[theDCOPApplications->currentText()], *j).count()) - theDCOPObjects->insertItem(QString::fromUtf8(*j)); + theDCOPObjects->insertItem(TQString::fromUtf8(*j)); updateDCOPFunctions(); } @@ -351,9 +351,9 @@ void EditAction::updateDCOPFunctions() { theDCOPFunctions->clear(); if(theDCOPApplications->currentText().isNull() || theDCOPApplications->currentText().isEmpty()) return; - QStringList functions = AddAction::getFunctions(nameProgramMap[theDCOPApplications->currentText()], theDCOPObjects->currentText()); + TQStringList functions = AddAction::getFunctions(nameProgramMap[theDCOPApplications->currentText()], theDCOPObjects->currentText()); if(!functions.size() && theDCOPApplications->currentText() == (*theAction).program()) theDCOPFunctions->insertItem((*theAction).method().prototype()); - for(QStringList::iterator i = functions.begin(); i != functions.end(); ++i) + for(TQStringList::iterator i = functions.begin(); i != functions.end(); ++i) theDCOPFunctions->insertItem(*i); updateArguments(); } diff --git a/kdelirc/kcmlirc/editaction.h b/kdelirc/kcmlirc/editaction.h index 1a7aa00..7efa7ca 100644 --- a/kdelirc/kcmlirc/editaction.h +++ b/kdelirc/kcmlirc/editaction.h @@ -13,7 +13,7 @@ #ifndef EDITACTION_H #define EDITACTION_H -#include <qstring.h> +#include <tqstring.h> #include "iractions.h" #include "editactionbase.h" @@ -27,11 +27,11 @@ class EditAction : public EditActionBase { Q_OBJECT IRAIt theAction; - QMap<QString, QString> applicationMap, functionMap; - QMap<QString, QString> nameProgramMap; - QMap<QString, bool> uniqueProgramMap; + TQMap<TQString, TQString> applicationMap, functionMap; + TQMap<TQString, TQString> nameProgramMap; + TQMap<TQString, bool> uniqueProgramMap; Arguments arguments; - QString program; + TQString program; bool isUnique; public: @@ -48,7 +48,7 @@ public: virtual void updateDCOPObjects(); virtual void updateDCOPFunctions(); - EditAction(IRAIt action, QWidget *parent = 0, const char *name = 0); + EditAction(IRAIt action, TQWidget *parent = 0, const char *name = 0); ~EditAction(); }; diff --git a/kdelirc/kcmlirc/editmode.cpp b/kdelirc/kcmlirc/editmode.cpp index 3fba8f0..aad27da 100644 --- a/kdelirc/kcmlirc/editmode.cpp +++ b/kdelirc/kcmlirc/editmode.cpp @@ -16,7 +16,7 @@ #include "editmode.h" -EditMode::EditMode(QWidget *parent, const char *name, bool modal, WFlags fl) : EditModeBase(parent, name, modal, fl) +EditMode::EditMode(TQWidget *parent, const char *name, bool modal, WFlags fl) : EditModeBase(parent, name, modal, fl) { theIcon->setIconType(KIcon::Panel, KIcon::Any); } @@ -30,7 +30,7 @@ void EditMode::slotClearIcon() theIcon->resetIcon(); } -void EditMode::slotCheckText(const QString &newText) +void EditMode::slotCheckText(const TQString &newText) { theOK->setEnabled(!newText.isEmpty()); } diff --git a/kdelirc/kcmlirc/editmode.h b/kdelirc/kcmlirc/editmode.h index 14a709d..df3c888 100644 --- a/kdelirc/kcmlirc/editmode.h +++ b/kdelirc/kcmlirc/editmode.h @@ -23,10 +23,10 @@ class EditMode : public EditModeBase Q_OBJECT public: - void slotCheckText(const QString &newText); + void slotCheckText(const TQString &newText); void slotClearIcon(); - EditMode(QWidget *parent = 0, const char *name = 0, bool modal = false, WFlags fl = 0); + EditMode(TQWidget *parent = 0, const char *name = 0, bool modal = false, WFlags fl = 0); ~EditMode(); }; diff --git a/kdelirc/kcmlirc/kcmlirc.cpp b/kdelirc/kcmlirc/kcmlirc.cpp index 1686bcd..b248127 100644 --- a/kdelirc/kcmlirc/kcmlirc.cpp +++ b/kdelirc/kcmlirc/kcmlirc.cpp @@ -8,14 +8,14 @@ * (at your option) any later version. * ***************************************************************************/ -#include <qcheckbox.h> -#include <qlabel.h> -#include <qlayout.h> -#include <qlineedit.h> -#include <qradiobutton.h> -#include <qcombobox.h> -#include <qevent.h> -#include <qlistview.h> +#include <tqcheckbox.h> +#include <tqlabel.h> +#include <tqlayout.h> +#include <tqlineedit.h> +#include <tqradiobutton.h> +#include <tqcombobox.h> +#include <tqevent.h> +#include <tqlistview.h> #include <kpushbutton.h> #include <kapplication.h> @@ -46,10 +46,10 @@ #include "modeslist.h" #include "selectprofile.h" -typedef KGenericFactory<KCMLirc, QWidget> theFactory; +typedef KGenericFactory<KCMLirc, TQWidget> theFactory; K_EXPORT_COMPONENT_FACTORY(kcmlirc, theFactory("kcmlirc")) -KCMLirc::KCMLirc(QWidget *parent, const char *name, QStringList /*args*/) : DCOPObject("KCMLirc"), KCModule(parent, name) +KCMLirc::KCMLirc(TQWidget *parent, const char *name, TQStringList /*args*/) : DCOPObject("KCMLirc"), KCModule(parent, name) { KGlobal::locale()->insertCatalogue( "kcmlirc" ); setAboutData(new KAboutData("kcmlirc", I18N_NOOP("KDE Lirc"), VERSION, I18N_NOOP("The KDE IR Remote Control System"), KAboutData::License_GPL_V2, "Copyright (c)2003 Gav Wood", I18N_NOOP("Use this to configure KDE's infrared remote control system in order to control any KDE application with your infrared remote control."), "http://www.kde.org")); @@ -71,22 +71,22 @@ KCMLirc::KCMLirc(QWidget *parent, const char *name, QStringList /*args*/) : DCOP kdDebug() << "OK" << ok << endl; - (new QHBoxLayout(this))->setAutoAdd(true); + (new TQHBoxLayout(this))->setAutoAdd(true); theKCMLircBase = new KCMLircBase(this); - connect(theKCMLircBase->theModes, SIGNAL( selectionChanged(QListViewItem *) ), this, SLOT( updateActions() )); - connect(theKCMLircBase->theModes, SIGNAL( selectionChanged(QListViewItem *) ), this, SLOT( updateModesStatus(QListViewItem *) )); - connect(theKCMLircBase->theActions, SIGNAL( currentChanged(QListViewItem *) ), this, SLOT( updateActionsStatus(QListViewItem *) )); - connect(theKCMLircBase->theExtensions, SIGNAL( selectionChanged(QListViewItem *) ), this, SLOT( updateInformation() )); - connect(theKCMLircBase->theModes, SIGNAL( itemRenamed(QListViewItem *) ), this, SLOT( slotRenamed(QListViewItem *) )); - connect(theKCMLircBase->theModes, SIGNAL(dropped(KListView*, QDropEvent*, QListViewItem*, QListViewItem*)), this, SLOT(slotDrop(KListView*, QDropEvent*, QListViewItem*, QListViewItem*))); - connect((QObject *)(theKCMLircBase->theAddActions), SIGNAL( clicked() ), this, SLOT( slotAddActions() )); - connect((QObject *)(theKCMLircBase->theAddAction), SIGNAL( clicked() ), this, SLOT( slotAddAction() )); - connect((QObject *)(theKCMLircBase->theEditAction), SIGNAL( clicked() ), this, SLOT( slotEditAction() )); - connect((QObject *)(theKCMLircBase->theActions), SIGNAL( doubleClicked(QListViewItem *) ), this, SLOT( slotEditAction() )); - connect((QObject *)(theKCMLircBase->theRemoveAction), SIGNAL( clicked() ), this, SLOT( slotRemoveAction() )); - connect((QObject *)(theKCMLircBase->theAddMode), SIGNAL( clicked() ), this, SLOT( slotAddMode() )); - connect((QObject *)(theKCMLircBase->theEditMode), SIGNAL( clicked() ), this, SLOT( slotEditMode() )); - connect((QObject *)(theKCMLircBase->theRemoveMode), SIGNAL( clicked() ), this, SLOT( slotRemoveMode() )); + connect(theKCMLircBase->theModes, TQT_SIGNAL( selectionChanged(TQListViewItem *) ), this, TQT_SLOT( updateActions() )); + connect(theKCMLircBase->theModes, TQT_SIGNAL( selectionChanged(TQListViewItem *) ), this, TQT_SLOT( updateModesStatus(TQListViewItem *) )); + connect(theKCMLircBase->theActions, TQT_SIGNAL( currentChanged(TQListViewItem *) ), this, TQT_SLOT( updateActionsStatus(TQListViewItem *) )); + connect(theKCMLircBase->theExtensions, TQT_SIGNAL( selectionChanged(TQListViewItem *) ), this, TQT_SLOT( updateInformation() )); + connect(theKCMLircBase->theModes, TQT_SIGNAL( itemRenamed(TQListViewItem *) ), this, TQT_SLOT( slotRenamed(TQListViewItem *) )); + connect(theKCMLircBase->theModes, TQT_SIGNAL(dropped(KListView*, TQDropEvent*, TQListViewItem*, TQListViewItem*)), this, TQT_SLOT(slotDrop(KListView*, TQDropEvent*, TQListViewItem*, TQListViewItem*))); + connect((TQObject *)(theKCMLircBase->theAddActions), TQT_SIGNAL( clicked() ), this, TQT_SLOT( slotAddActions() )); + connect((TQObject *)(theKCMLircBase->theAddAction), TQT_SIGNAL( clicked() ), this, TQT_SLOT( slotAddAction() )); + connect((TQObject *)(theKCMLircBase->theEditAction), TQT_SIGNAL( clicked() ), this, TQT_SLOT( slotEditAction() )); + connect((TQObject *)(theKCMLircBase->theActions), TQT_SIGNAL( doubleClicked(TQListViewItem *) ), this, TQT_SLOT( slotEditAction() )); + connect((TQObject *)(theKCMLircBase->theRemoveAction), TQT_SIGNAL( clicked() ), this, TQT_SLOT( slotRemoveAction() )); + connect((TQObject *)(theKCMLircBase->theAddMode), TQT_SIGNAL( clicked() ), this, TQT_SLOT( slotAddMode() )); + connect((TQObject *)(theKCMLircBase->theEditMode), TQT_SIGNAL( clicked() ), this, TQT_SLOT( slotEditMode() )); + connect((TQObject *)(theKCMLircBase->theRemoveMode), TQT_SIGNAL( clicked() ), this, TQT_SLOT( slotRemoveMode() )); load(); } @@ -94,7 +94,7 @@ KCMLirc::~KCMLirc() { } -void KCMLirc::updateModesStatus(QListViewItem *item) +void KCMLirc::updateModesStatus(TQListViewItem *item) { theKCMLircBase->theModes->setItemsRenameable(item && item->parent()); theKCMLircBase->theAddActions->setEnabled(ProfileServer::profileServer()->profiles().count() && theKCMLircBase->theModes->selectedItem() && RemoteServer::remoteServer()->remotes()[modeMap[theKCMLircBase->theModes->selectedItem()].remote()]); @@ -104,13 +104,13 @@ void KCMLirc::updateModesStatus(QListViewItem *item) theKCMLircBase->theEditMode->setEnabled(item); } -void KCMLirc::updateActionsStatus(QListViewItem *item) +void KCMLirc::updateActionsStatus(TQListViewItem *item) { theKCMLircBase->theRemoveAction->setEnabled(item); theKCMLircBase->theEditAction->setEnabled(item); } -void KCMLirc::slotRenamed(QListViewItem *item) +void KCMLirc::slotRenamed(TQListViewItem *item) { if(!item) return; @@ -127,13 +127,13 @@ void KCMLirc::slotEditAction() if(!theKCMLircBase->theActions->currentItem()) return; EditAction theDialog(actionMap[theKCMLircBase->theActions->currentItem()], this); - QListViewItem *item = theKCMLircBase->theModes->currentItem(); + TQListViewItem *item = theKCMLircBase->theModes->currentItem(); if(item->parent()) item = item->parent(); theDialog.theModes->insertItem(i18n("[Exit current mode]")); for(item = item->firstChild(); item; item = item->nextSibling()) theDialog.theModes->insertItem(item->text(0)); theDialog.readFrom(); - if(theDialog.exec() == QDialog::Accepted) { theDialog.writeBack(); emit changed(true); updateActions(); } + if(theDialog.exec() == TQDialog::Accepted) { theDialog.writeBack(); emit changed(true); updateActions(); } } void KCMLirc::slotAddActions() @@ -144,11 +144,11 @@ void KCMLirc::slotAddActions() SelectProfile theDialog(this, 0); - QMap<QListViewItem *, Profile *> profileMap; - QDict<Profile> dict = ProfileServer::profileServer()->profiles(); - for(QDictIterator<Profile> i(dict); i.current(); ++i) profileMap[new QListViewItem(theDialog.theProfiles, i.current()->name())] = i.current(); + TQMap<TQListViewItem *, Profile *> profileMap; + TQDict<Profile> dict = ProfileServer::profileServer()->profiles(); + for(TQDictIterator<Profile> i(dict); i.current(); ++i) profileMap[new TQListViewItem(theDialog.theProfiles, i.current()->name())] = i.current(); - if(theDialog.exec() == QDialog::Accepted && theDialog.theProfiles->currentItem()) + if(theDialog.exec() == TQDialog::Accepted && theDialog.theProfiles->currentItem()) { autoPopulate(*(profileMap[theDialog.theProfiles->currentItem()]), *(RemoteServer::remoteServer()->remotes()[m.remote()]), m.name()); updateActions(); emit changed(true); @@ -162,10 +162,10 @@ void KCMLirc::slotAddAction() Mode m = modeMap[theKCMLircBase->theModes->selectedItem()]; AddAction theDialog(this, 0, m); - connect(this, SIGNAL(haveButton(const QString &, const QString &)), &theDialog, SLOT(updateButton(const QString &, const QString &))); + connect(this, TQT_SIGNAL(haveButton(const TQString &, const TQString &)), &theDialog, TQT_SLOT(updateButton(const TQString &, const TQString &))); // populate the modes list box - QListViewItem *item = theKCMLircBase->theModes->selectedItem(); + TQListViewItem *item = theKCMLircBase->theModes->selectedItem(); if(item->parent()) item = item->parent(); theDialog.theModes->setEnabled(item->firstChild()); theDialog.theSwitchMode->setEnabled(item->firstChild()); @@ -174,7 +174,7 @@ void KCMLirc::slotAddAction() if(item->isSelected()) { a->setSelected(true); theDialog.theModes->setCurrentItem(a); } } - if(theDialog.exec() == QDialog::Accepted && theDialog.theButtons->selectedItem()) + if(theDialog.exec() == TQDialog::Accepted && theDialog.theButtons->selectedItem()) { IRAction a; a.setRemote(m.remote()); a.setMode(m.name()); @@ -246,10 +246,10 @@ void KCMLirc::slotRemoveAction() emit changed(true); } -void KCMLirc::autoPopulate(const Profile &profile, const Remote &remote, const QString &mode) +void KCMLirc::autoPopulate(const Profile &profile, const Remote &remote, const TQString &mode) { - QDict<RemoteButton> d = remote.buttons(); - for(QDictIterator<RemoteButton> i(d); i.current(); ++i) + TQDict<RemoteButton> d = remote.buttons(); + for(TQDictIterator<RemoteButton> i(d); i.current(); ++i) { const ProfileAction *pa = profile.searchClass(i.current()->getClass()); if(pa) { @@ -267,8 +267,8 @@ void KCMLirc::autoPopulate(const Profile &profile, const Remote &remote, const Q Arguments l; // argument count should be either 0 or 1. undefined if > 1. if(Prototype(pa->prototype()).argumentCount() == 1) - { l.append(QString().setNum(i.current()->parameter().toFloat() * pa->multiplier())); - l.back().cast(QVariant::nameToType(Prototype(pa->prototype()).type(0).utf8())); + { l.append(TQString().setNum(i.current()->parameter().toFloat() * pa->multiplier())); + l.back().cast(TQVariant::nameToType(Prototype(pa->prototype()).type(0).utf8())); } a.setArguments(l); allActions.addAction(a); @@ -281,15 +281,15 @@ void KCMLirc::slotAddMode() if(!theKCMLircBase->theModes->selectedItem()) return; NewMode theDialog(this, 0); - QMap<QListViewItem *, QString> remoteMap; - QListViewItem *tr = theKCMLircBase->theModes->selectedItem(); + TQMap<TQListViewItem *, TQString> remoteMap; + TQListViewItem *tr = theKCMLircBase->theModes->selectedItem(); if(tr) if(tr->parent()) tr = tr->parent(); - for(QListViewItem *i = theKCMLircBase->theModes->firstChild(); i; i = i->nextSibling()) + for(TQListViewItem *i = theKCMLircBase->theModes->firstChild(); i; i = i->nextSibling()) { KListViewItem *a = new KListViewItem(theDialog.theRemotes, i->text(0)); remoteMap[a] = modeMap[i].remote(); if(i == tr) { a->setSelected(true); theDialog.theRemotes->setCurrentItem(a); } } - if(theDialog.exec() == QDialog::Accepted && theDialog.theRemotes->selectedItem() && !theDialog.theName->text().isEmpty()) + if(theDialog.exec() == TQDialog::Accepted && theDialog.theRemotes->selectedItem() && !theDialog.theName->text().isEmpty()) { allModes.add(Mode(remoteMap[theDialog.theRemotes->selectedItem()], theDialog.theName->text())); updateModes(); @@ -313,9 +313,9 @@ void KCMLirc::slotEditMode() theDialog.theDefault->setChecked(allModes.isDefault(mode)); theDialog.theDefault->setEnabled(!allModes.isDefault(mode)); - if(theDialog.exec() == QDialog::Accepted) + if(theDialog.exec() == TQDialog::Accepted) { kdDebug() << "Setting icon : " << theDialog.theIcon->icon() << endl; - mode.setIconFile(theDialog.theIcon->icon().isEmpty() ? QString::null : theDialog.theIcon->icon()); + mode.setIconFile(theDialog.theIcon->icon().isEmpty() ? TQString::null : theDialog.theIcon->icon()); allModes.updateMode(mode); if(!mode.name().isEmpty()) { allActions.renameMode(mode, theDialog.theName->text()); @@ -348,7 +348,7 @@ void KCMLirc::slotSetDefaultMode() emit changed(true); } -void KCMLirc::slotDrop(KListView *, QDropEvent *, QListViewItem *, QListViewItem *after) +void KCMLirc::slotDrop(KListView *, TQDropEvent *, TQListViewItem *, TQListViewItem *after) { Mode m = modeMap[after]; @@ -357,7 +357,7 @@ void KCMLirc::slotDrop(KListView *, QDropEvent *, QListViewItem *, QListViewItem KMessageBox::error(this, i18n("You may only drag the selected items onto a mode of the same remote control"), i18n("You May Not Drag Here")); return; } - for(QListViewItem *i = theKCMLircBase->theActions->firstChild(); i; i = i->nextSibling()) + for(TQListViewItem *i = theKCMLircBase->theActions->firstChild(); i; i = i->nextSibling()) if(i->isSelected()) (*(actionMap[i])).setMode(m.name()); @@ -379,7 +379,7 @@ void KCMLirc::updateActions() theKCMLircBase->theModeLabel->setText(m.remoteName() + ": " + (m.name().isEmpty() ? i18n("Actions <i>always</i> available") : i18n("Actions available only in mode <b>%1</b>").arg(m.name()))); IRAItList l = allActions.findByMode(m); for(IRAItList::iterator i = l.begin(); i != l.end(); ++i) - { QListViewItem *b = new KListViewItem(theKCMLircBase->theActions, (**i).buttonName(), (**i).application(), (**i).function(), (**i).arguments().toString(), (**i).notes()); + { TQListViewItem *b = new KListViewItem(theKCMLircBase->theActions, (**i).buttonName(), (**i).application(), (**i).function(), (**i).arguments().toString(), (**i).notes()); actionMap[b] = *i; if(*i == oldCurrent) { b->setSelected(true); theKCMLircBase->theActions->setCurrentItem(b); } } @@ -389,7 +389,7 @@ void KCMLirc::updateActions() updateActionsStatus(theKCMLircBase->theActions->currentItem()); } -void KCMLirc::gotButton(QString remote, QString button) +void KCMLirc::gotButton(TQString remote, TQString button) { emit haveButton(remote, button); } @@ -403,14 +403,14 @@ void KCMLirc::updateModes() modeMap.clear(); IRKick_stub IRKick("irkick", "IRKick"); - QStringList remotes = IRKick.remotes(); + TQStringList remotes = IRKick.remotes(); if(remotes.begin() == remotes.end()) theKCMLircBase->theMainLabel->setMaximumSize(32767, 32767); else theKCMLircBase->theMainLabel->setMaximumSize(0, 0); - for(QStringList::iterator i = remotes.begin(); i != remotes.end(); ++i) + for(TQStringList::iterator i = remotes.begin(); i != remotes.end(); ++i) { Mode mode = allModes.getMode(*i, ""); - QListViewItem *a = new KListViewItem(theKCMLircBase->theModes, RemoteServer::remoteServer()->getRemoteName(*i), allModes.isDefault(mode) ? "Default" : "", mode.iconFile().isNull() ? "" : ""); + TQListViewItem *a = new KListViewItem(theKCMLircBase->theModes, RemoteServer::remoteServer()->getRemoteName(*i), allModes.isDefault(mode) ? "Default" : "", mode.iconFile().isNull() ? "" : ""); if(!mode.iconFile().isNull()) a->setPixmap(2, KIconLoader().loadIcon(mode.iconFile(), KIcon::Panel)); modeMap[a] = mode; // the null mode @@ -419,7 +419,7 @@ void KCMLirc::updateModes() ModeList l = allModes.getModes(*i); for(ModeList::iterator j = l.begin(); j != l.end(); ++j) if(!(*j).name().isEmpty()) - { QListViewItem *b = new KListViewItem(a, (*j).name(), allModes.isDefault(*j) ? i18n("Default") : "", (*j).iconFile().isNull() ? "" : ""); + { TQListViewItem *b = new KListViewItem(a, (*j).name(), allModes.isDefault(*j) ? i18n("Default") : "", (*j).iconFile().isNull() ? "" : ""); if(!(*j).iconFile().isNull()) b->setPixmap(2, KIconLoader().loadIcon((*j).iconFile(), KIcon::Panel)); modeMap[b] = *j; @@ -437,22 +437,22 @@ void KCMLirc::updateExtensions() theKCMLircBase->theExtensions->clear(); { ProfileServer *theServer = ProfileServer::profileServer(); - QListViewItem *a = new QListViewItem(theKCMLircBase->theExtensions, i18n("Applications")); + TQListViewItem *a = new TQListViewItem(theKCMLircBase->theExtensions, i18n("Applications")); a->setOpen(true); profileMap.clear(); - QDict<Profile> dict = theServer->profiles(); - QDictIterator<Profile> i(dict); + TQDict<Profile> dict = theServer->profiles(); + TQDictIterator<Profile> i(dict); for(; i.current(); ++i) - profileMap[new QListViewItem(a, i.current()->name())] = i.currentKey(); + profileMap[new TQListViewItem(a, i.current()->name())] = i.currentKey(); } { RemoteServer *theServer = RemoteServer::remoteServer(); - QListViewItem *a = new QListViewItem(theKCMLircBase->theExtensions, i18n("Remote Controls")); + TQListViewItem *a = new TQListViewItem(theKCMLircBase->theExtensions, i18n("Remote Controls")); a->setOpen(true); remoteMap.clear(); - QDict<Remote> dict = theServer->remotes(); - QDictIterator<Remote> i(dict); + TQDict<Remote> dict = theServer->remotes(); + TQDictIterator<Remote> i(dict); for(; i.current(); ++i) - remoteMap[new QListViewItem(a, i.current()->name())] = i.currentKey(); + remoteMap[new TQListViewItem(a, i.current()->name())] = i.currentKey(); } updateInformation(); } @@ -468,28 +468,28 @@ void KCMLirc::updateInformation() { theKCMLircBase->theInformationLabel->setText(i18n("Information on <b>%1</b>:").arg(theKCMLircBase->theExtensions->selectedItem()->text(0))); if(theKCMLircBase->theExtensions->selectedItem()->text(0) == i18n("Applications")) - new QListViewItem(theKCMLircBase->theInformation, i18n("Number of Applications"), QString().setNum(theKCMLircBase->theExtensions->selectedItem()->childCount())); + new TQListViewItem(theKCMLircBase->theInformation, i18n("Number of Applications"), TQString().setNum(theKCMLircBase->theExtensions->selectedItem()->childCount())); else if(theKCMLircBase->theExtensions->selectedItem()->text(0) == i18n("Remote Controls")) - new QListViewItem(theKCMLircBase->theInformation, i18n("Number of Remote Controls"), QString().setNum(theKCMLircBase->theExtensions->selectedItem()->childCount())); + new TQListViewItem(theKCMLircBase->theInformation, i18n("Number of Remote Controls"), TQString().setNum(theKCMLircBase->theExtensions->selectedItem()->childCount())); } else if(theKCMLircBase->theExtensions->selectedItem()->parent()->text(0) == i18n("Applications")) { ProfileServer *theServer = ProfileServer::profileServer(); const Profile *p = theServer->profiles()[profileMap[theKCMLircBase->theExtensions->selectedItem()]]; - new QListViewItem(theKCMLircBase->theInformation, i18n("Extension Name"), p->name()); - new QListViewItem(theKCMLircBase->theInformation, i18n("Extension Author"), p->author()); - new QListViewItem(theKCMLircBase->theInformation, i18n("Application Identifier"), p->id()); - new QListViewItem(theKCMLircBase->theInformation, i18n("Number of Actions"), QString().setNum(p->actions().count())); + new TQListViewItem(theKCMLircBase->theInformation, i18n("Extension Name"), p->name()); + new TQListViewItem(theKCMLircBase->theInformation, i18n("Extension Author"), p->author()); + new TQListViewItem(theKCMLircBase->theInformation, i18n("Application Identifier"), p->id()); + new TQListViewItem(theKCMLircBase->theInformation, i18n("Number of Actions"), TQString().setNum(p->actions().count())); theKCMLircBase->theInformationLabel->setText(i18n("Information on <b>%1</b>:").arg(p->name())); } else if(theKCMLircBase->theExtensions->selectedItem()->parent()->text(0) == i18n("Remote Controls")) { RemoteServer *theServer = RemoteServer::remoteServer(); const Remote *p = theServer->remotes()[remoteMap[theKCMLircBase->theExtensions->selectedItem()]]; - new QListViewItem(theKCMLircBase->theInformation, i18n("Extension Name"), p->name()); - new QListViewItem(theKCMLircBase->theInformation, i18n("Extension Author"), p->author()); - new QListViewItem(theKCMLircBase->theInformation, i18n("Remote Control Identifier"), p->id()); - new QListViewItem(theKCMLircBase->theInformation, i18n("Number of Buttons"), QString().setNum(p->buttons().count())); + new TQListViewItem(theKCMLircBase->theInformation, i18n("Extension Name"), p->name()); + new TQListViewItem(theKCMLircBase->theInformation, i18n("Extension Author"), p->author()); + new TQListViewItem(theKCMLircBase->theInformation, i18n("Remote Control Identifier"), p->id()); + new TQListViewItem(theKCMLircBase->theInformation, i18n("Number of Buttons"), TQString().setNum(p->buttons().count())); theKCMLircBase->theInformationLabel->setText(i18n("Information on <b>%1</b>:").arg(p->name())); } } @@ -533,7 +533,7 @@ void KCMLirc::configChanged() // TODO: Take this out when I know how extern "C" { - KDE_EXPORT KCModule *create_kcmlirc(QWidget *parent, const char *) + KDE_EXPORT KCModule *create_kcmlirc(TQWidget *parent, const char *) { KGlobal::locale()->insertCatalogue("kcmlirc"); return new KCMLirc(parent, "KCMLirc"); } diff --git a/kdelirc/kcmlirc/kcmlirc.h b/kdelirc/kcmlirc/kcmlirc.h index ba88ae2..517004f 100644 --- a/kdelirc/kcmlirc/kcmlirc.h +++ b/kdelirc/kcmlirc/kcmlirc.h @@ -11,8 +11,8 @@ #ifndef _KCMLIRC_H_ #define _KCMLIRC_H_ -#include <qstringlist.h> -#include <qmap.h> +#include <tqstringlist.h> +#include <tqmap.h> #include <kcmodule.h> @@ -37,16 +37,16 @@ private: KCMLircBase *theKCMLircBase; IRActions allActions; Modes allModes; - QMap<QListViewItem *, IRAIt > actionMap; - QMap<QListViewItem *, Mode> modeMap; - QMap<QListViewItem *, QString> profileMap, remoteMap; + TQMap<TQListViewItem *, IRAIt > actionMap; + TQMap<TQListViewItem *, Mode> modeMap; + TQMap<TQListViewItem *, TQString> profileMap, remoteMap; - void autoPopulate(const Profile &profile, const Remote &remote, const QString &mode); + void autoPopulate(const Profile &profile, const Remote &remote, const TQString &mode); public slots: void updateActions(); - void updateModesStatus(QListViewItem *); - void updateActionsStatus(QListViewItem *); + void updateModesStatus(TQListViewItem *); + void updateActionsStatus(TQListViewItem *); void updateModes(); void updateExtensions(); void updateInformation(); @@ -57,8 +57,8 @@ public slots: void slotAddActions(); void slotEditAction(); void slotRemoveAction(); - void slotDrop(KListView *, QDropEvent *, QListViewItem *, QListViewItem *after); - void slotRenamed(QListViewItem *item); + void slotDrop(KListView *, TQDropEvent *, TQListViewItem *, TQListViewItem *after); + void slotRenamed(TQListViewItem *item); void slotEditMode(); @@ -66,9 +66,9 @@ public slots: k_dcop: // MOC_SKIP_END // now just used as a proxy to AddAction class - virtual void gotButton(QString remote, QString button); + virtual void gotButton(TQString remote, TQString button); signals: - void haveButton(const QString &remote, const QString &button); + void haveButton(const TQString &remote, const TQString &button); public: virtual void load(); @@ -76,7 +76,7 @@ public: virtual void defaults(); virtual void configChanged(); - KCMLirc(QWidget *parent = 0, const char *name = 0, QStringList args = QStringList()); + KCMLirc(TQWidget *parent = 0, const char *name = 0, TQStringList args = TQStringList()); ~KCMLirc(); }; diff --git a/kdelirc/kcmlirc/kcmlircbase.ui.h b/kdelirc/kcmlirc/kcmlircbase.ui.h index f9082b6..124ab3f 100644 --- a/kdelirc/kcmlirc/kcmlircbase.ui.h +++ b/kdelirc/kcmlirc/kcmlircbase.ui.h @@ -23,7 +23,7 @@ void KCMLircBase::init() { delete theModes; modeLayout->removeItem(modeButtonLayout); - theModes = new ModesList(dynamic_cast<QWidget *>(modeLayout->parent()), "theModes"); + theModes = new ModesList(dynamic_cast<TQWidget *>(modeLayout->parent()), "theModes"); theModes->addColumn(i18n("Remote Control")); theModes->addColumn(i18n("Default")); theModes->addColumn(i18n("Icon")); diff --git a/kdelirc/kcmlirc/modeslist.cpp b/kdelirc/kcmlirc/modeslist.cpp index 6150705..83678d1 100644 --- a/kdelirc/kcmlirc/modeslist.cpp +++ b/kdelirc/kcmlirc/modeslist.cpp @@ -10,20 +10,20 @@ // Copyright: See COPYING file that comes with this distribution // // -#include <qwidget.h> +#include <tqwidget.h> #include <kdebug.h> #include "modeslist.h" -ModesList::ModesList(QWidget *parent, const char *name) : KListView(parent, name) +ModesList::ModesList(TQWidget *parent, const char *name) : KListView(parent, name) { setAcceptDrops(true); setDropVisualizer(false); setDropHighlighter(true); } -bool ModesList::acceptDrag(QDropEvent *) const +bool ModesList::acceptDrag(TQDropEvent *) const { // TODO: make safer by checking source/mime type // TODO: make safer by only allowing drops on the correct remote control's modes diff --git a/kdelirc/kcmlirc/modeslist.h b/kdelirc/kcmlirc/modeslist.h index 2fee458..22e6cc0 100644 --- a/kdelirc/kcmlirc/modeslist.h +++ b/kdelirc/kcmlirc/modeslist.h @@ -26,8 +26,8 @@ class ModesList : public KListView { Q_OBJECT public: - virtual bool acceptDrag(QDropEvent *) const; - ModesList(QWidget *parent = 0, const char *name = 0); + virtual bool acceptDrag(TQDropEvent *) const; + ModesList(TQWidget *parent = 0, const char *name = 0); }; #endif diff --git a/kdelirc/kcmlirc/newmode.ui.h b/kdelirc/kcmlirc/newmode.ui.h index 96c1eb4..2bb2f54 100644 --- a/kdelirc/kcmlirc/newmode.ui.h +++ b/kdelirc/kcmlirc/newmode.ui.h @@ -18,7 +18,7 @@ *****************************************************************************/ -void NewMode::slotTextChanged( const QString &newText ) +void NewMode::slotTextChanged( const TQString &newText ) { kPushButton6->setEnabled(newText != ""); } diff --git a/kdelirc/kdelirc/arguments.cpp b/kdelirc/kdelirc/arguments.cpp index 10fc69b..fc678ce 100644 --- a/kdelirc/kdelirc/arguments.cpp +++ b/kdelirc/kdelirc/arguments.cpp @@ -10,7 +10,7 @@ // Copyright: See COPYING file that comes with this distribution // // -#include <qstring.h> +#include <tqstring.h> #include "arguments.h" @@ -22,11 +22,11 @@ Arguments::~Arguments() { } -const QString Arguments::toString() const +const TQString Arguments::toString() const { - QString ret = ""; + TQString ret = ""; for(Arguments::const_iterator i = begin(); i != end(); ++i) - { QString s = (*i).toString(); + { TQString s = (*i).toString(); if(s.isNull()) s = "..."; if(i != begin()) ret += ", "; ret += s; diff --git a/kdelirc/kdelirc/arguments.h b/kdelirc/kdelirc/arguments.h index 97448a5..dae1f5c 100644 --- a/kdelirc/kdelirc/arguments.h +++ b/kdelirc/kdelirc/arguments.h @@ -13,17 +13,17 @@ #ifndef ARGUMENTS_H #define ARGUMENTS_H -#include <qvaluelist.h> -#include <qvariant.h> +#include <tqvaluelist.h> +#include <tqvariant.h> /** @author Gav Wood */ -class Arguments : public QValueList<QVariant> +class Arguments : public TQValueList<TQVariant> { public: - const QString toString() const; + const TQString toString() const; Arguments(); ~Arguments(); diff --git a/kdelirc/kdelirc/iraction.cpp b/kdelirc/kdelirc/iraction.cpp index 9081a2e..ad558b5 100644 --- a/kdelirc/kdelirc/iraction.cpp +++ b/kdelirc/kdelirc/iraction.cpp @@ -11,7 +11,7 @@ // // -#include <qvariant.h> +#include <tqvariant.h> #include <kconfig.h> #include <klocale.h> @@ -20,7 +20,7 @@ #include "profileserver.h" #include "remoteserver.h" -IRAction::IRAction(const QString &newProgram, const QString &newObject, const QString &newMethod, const Arguments &newArguments, const QString &newRemote, const QString &newMode, const QString &newButton, const bool newRepeat, const bool newAutoStart, const bool newDoBefore, const bool newDoAfter, const bool newUnique, const IfMulti newIfMulti) +IRAction::IRAction(const TQString &newProgram, const TQString &newObject, const TQString &newMethod, const Arguments &newArguments, const TQString &newRemote, const TQString &newMode, const TQString &newButton, const bool newRepeat, const bool newAutoStart, const bool newDoBefore, const bool newDoAfter, const bool newUnique, const IfMulti newIfMulti) { theProgram = newProgram; theObject = newObject; @@ -39,12 +39,12 @@ IRAction::IRAction(const QString &newProgram, const QString &newObject, const QS const IRAction &IRAction::loadFromConfig(KConfig &theConfig, int index) { - QString Binding = "Binding" + QString().setNum(index); + TQString Binding = "Binding" + TQString().setNum(index); int numArguments = theConfig.readNumEntry(Binding + "Arguments"); theArguments.clear(); for(int j = 0; j < numArguments; j++) - { QVariant::Type theType = (QVariant::Type)theConfig.readNumEntry(Binding + "ArgumentType" + QString().setNum(j), QVariant::String); - theArguments += theConfig.readPropertyEntry(Binding + "Argument" + QString().setNum(j), theType == QVariant::CString ? QVariant::String : theType); + { TQVariant::Type theType = (TQVariant::Type)theConfig.readNumEntry(Binding + "ArgumentType" + TQString().setNum(j), TQVariant::String); + theArguments += theConfig.readPropertyEntry(Binding + "Argument" + TQString().setNum(j), theType == TQVariant::CString ? TQVariant::String : theType); theArguments.last().cast(theType); } @@ -66,15 +66,15 @@ const IRAction &IRAction::loadFromConfig(KConfig &theConfig, int index) void IRAction::saveToConfig(KConfig &theConfig, int index) const { - QString Binding = "Binding" + QString().setNum(index); + TQString Binding = "Binding" + TQString().setNum(index); theConfig.writeEntry(Binding + "Arguments", theArguments.count()); for(unsigned j = 0; j < theArguments.count(); j++) - { QVariant arg = theArguments[j]; - QVariant::Type preType = arg.type(); - if(preType == QVariant::CString) arg.cast(QVariant::String); - theConfig.writeEntry(Binding + "Argument" + QString().setNum(j), arg); - theConfig.writeEntry(Binding + "ArgumentType" + QString().setNum(j), preType); + { TQVariant arg = theArguments[j]; + TQVariant::Type preType = arg.type(); + if(preType == TQVariant::CString) arg.cast(TQVariant::String); + theConfig.writeEntry(Binding + "Argument" + TQString().setNum(j), arg); + theConfig.writeEntry(Binding + "ArgumentType" + TQString().setNum(j), preType); } theConfig.writeEntry(Binding + "Program", theProgram); theConfig.writeEntry(Binding + "Object", theObject); @@ -90,7 +90,7 @@ void IRAction::saveToConfig(KConfig &theConfig, int index) const theConfig.writeEntry(Binding + "IfMulti", theIfMulti); } -const QString IRAction::function() const +const TQString IRAction::function() const { ProfileServer *theServer = ProfileServer::profileServer(); if(theProgram.isEmpty()) @@ -111,24 +111,24 @@ const QString IRAction::function() const } } -const QString IRAction::notes() const +const TQString IRAction::notes() const { if(isModeChange()) - return QString(theDoBefore ? i18n("Do actions before. ") : "") + - QString(theDoAfter ? i18n("Do actions after. ") : ""); + return TQString(theDoBefore ? i18n("Do actions before. ") : "") + + TQString(theDoAfter ? i18n("Do actions after. ") : ""); else if(isJustStart()) return ""; else - return QString(theAutoStart ? i18n("Auto-start. ") : "") - + QString(theRepeat ? i18n("Repeatable. ") : "") - + QString(!theUnique ? (theIfMulti == IM_DONTSEND ? i18n("Do nothing if many instances. ") + return TQString(theAutoStart ? i18n("Auto-start. ") : "") + + TQString(theRepeat ? i18n("Repeatable. ") : "") + + TQString(!theUnique ? (theIfMulti == IM_DONTSEND ? i18n("Do nothing if many instances. ") : theIfMulti == IM_SENDTOTOP ? i18n("Send to top instance. ") : theIfMulti == IM_SENDTOBOTTOM ? i18n("Send to bottom instance. ") : i18n("Send to all instances. ")) : ""); } -const QString IRAction::application() const +const TQString IRAction::application() const { ProfileServer *theServer = ProfileServer::profileServer(); if(theProgram.isEmpty()) @@ -143,12 +143,12 @@ const QString IRAction::application() const } } -const QString IRAction::remoteName() const +const TQString IRAction::remoteName() const { return RemoteServer::remoteServer()->getRemoteName(theRemote); } -const QString IRAction::buttonName() const +const TQString IRAction::buttonName() const { return RemoteServer::remoteServer()->getButtonName(theRemote, theButton); } diff --git a/kdelirc/kdelirc/iraction.h b/kdelirc/kdelirc/iraction.h index f7008ff..8fdd44e 100644 --- a/kdelirc/kdelirc/iraction.h +++ b/kdelirc/kdelirc/iraction.h @@ -13,7 +13,7 @@ #ifndef IRACTION_H #define IRACTION_H -#include <qstring.h> +#include <tqstring.h> #include "prototype.h" #include "arguments.h" @@ -27,7 +27,7 @@ class KConfig; class IRAction { - QString theProgram, theObject, theRemote, theButton, theMode; + TQString theProgram, theObject, theRemote, theButton, theMode; Prototype theMethod; Arguments theArguments; bool theRepeat, theAutoStart, theDoBefore, theDoAfter; @@ -40,49 +40,49 @@ public: void saveToConfig(KConfig &theConfig, int index) const; // may be changed to a profile-based representation in the future. - const QString function() const; - const QString application() const; - const QString buttonName() const; - const QString remoteName() const; - const QString notes() const; + const TQString function() const; + const TQString application() const; + const TQString buttonName() const; + const TQString remoteName() const; + const TQString notes() const; // bog standard raw DCOP stuff - const QString &program() const { return theProgram; } - const QString &object() const { return theObject; } + const TQString &program() const { return theProgram; } + const TQString &object() const { return theObject; } const Prototype &method() const { return theMethod; } - const QString &remote() const { return theRemote; } - const QString &mode() const { return theMode; } - const QString &button() const { return theButton; } + const TQString &remote() const { return theRemote; } + const TQString &mode() const { return theMode; } + const TQString &button() const { return theButton; } const Arguments arguments() const { if(theProgram != "" && theObject != "") return theArguments; return Arguments(); } const bool repeat() const { return theRepeat; } const bool autoStart() const { return theAutoStart; } const IfMulti ifMulti() const { return theIfMulti; } const bool unique() const { return theUnique; } - const QString &modeChange() const { return theObject; } + const TQString &modeChange() const { return theObject; } const bool doBefore() const { return theDoBefore; } const bool doAfter() const { return theDoAfter; } bool isModeChange() const { return theProgram == ""; } bool isJustStart() const { return theProgram != "" && theObject == ""; } - void setProgram(const QString &newProgram) { theProgram = newProgram; } - void setObject(const QString &newObject) { theObject = newObject; } + void setProgram(const TQString &newProgram) { theProgram = newProgram; } + void setObject(const TQString &newObject) { theObject = newObject; } void setMethod(const Prototype &newMethod) { theMethod = newMethod; } - void setRemote(const QString &newRemote) { theRemote = newRemote; } - void setMode(const QString &newMode) { theMode = newMode; } - void setButton(const QString &newButton) { theButton = newButton; } + void setRemote(const TQString &newRemote) { theRemote = newRemote; } + void setMode(const TQString &newMode) { theMode = newMode; } + void setButton(const TQString &newButton) { theButton = newButton; } void setArguments(const Arguments &newArguments) { theArguments = newArguments; } void setRepeat(bool newRepeat) { theRepeat = newRepeat; } void setDoBefore(bool a) { theDoBefore = a; } void setDoAfter(bool a) { theDoAfter = a; } void setAutoStart(bool newAutoStart) { theAutoStart = newAutoStart; } - void setModeChange(const QString &a) { theObject = a; } + void setModeChange(const TQString &a) { theObject = a; } void setIfMulti(const IfMulti a) { theIfMulti = a; } void setUnique(const bool a) { theUnique = a; } - IRAction(const QString &newProgram, const QString &newObject, const QString &newMethod, const Arguments &newArguments, const QString &newRemote, const QString &newMode, const QString &newButton, const bool newRepeat, const bool newAutoStart, const bool newDoBefore, const bool newDoAfter, const bool newUnique, const IfMulti newIfMulti); - IRAction() { theProgram = QString::null; } + IRAction(const TQString &newProgram, const TQString &newObject, const TQString &newMethod, const Arguments &newArguments, const TQString &newRemote, const TQString &newMode, const TQString &newButton, const bool newRepeat, const bool newAutoStart, const bool newDoBefore, const bool newDoAfter, const bool newUnique, const IfMulti newIfMulti); + IRAction() { theProgram = TQString::null; } }; #endif diff --git a/kdelirc/kdelirc/iractions.cpp b/kdelirc/kdelirc/iractions.cpp index 9bc03e3..e4ec0da 100644 --- a/kdelirc/kdelirc/iractions.cpp +++ b/kdelirc/kdelirc/iractions.cpp @@ -28,11 +28,11 @@ void IRActions::purgeAllBindings(KConfig &theConfig) { int numBindings = theConfig.readNumEntry("Bindings"); for(int i = 0; i < numBindings; i++) - { QString Binding = "Binding" + QString().setNum(i); + { TQString Binding = "Binding" + TQString().setNum(i); int numArguments = theConfig.readNumEntry(Binding + "Arguments"); for(int j = 0; j < numArguments; j++) - { theConfig.deleteEntry(Binding + "Argument" + QString().setNum(j)); - theConfig.deleteEntry(Binding + "ArgumentType" + QString().setNum(j)); + { theConfig.deleteEntry(Binding + "Argument" + TQString().setNum(j)); + theConfig.deleteEntry(Binding + "ArgumentType" + TQString().setNum(j)); } theConfig.deleteEntry(Binding + "Arguments"); theConfig.deleteEntry(Binding + "Program"); theConfig.deleteEntry(Binding + "Object"); theConfig.deleteEntry(Binding + "Method"); @@ -55,7 +55,7 @@ IRAIt IRActions::addAction(const IRAction &theAction) return append(theAction); } -IRAItList IRActions::findByButton(const QString &remote, const QString &button) +IRAItList IRActions::findByButton(const TQString &remote, const TQString &button) { IRAItList ret; for(iterator i = begin(); i != end(); ++i) @@ -64,7 +64,7 @@ IRAItList IRActions::findByButton(const QString &remote, const QString &button) return ret; } -void IRActions::renameMode(const Mode &mode, const QString &to) +void IRActions::renameMode(const Mode &mode, const TQString &to) { for(iterator i = begin(); i != end(); ++i) { if((*i).remote() == mode.remote() && (*i).mode() == mode.name()) (*i).setMode(to); @@ -80,7 +80,7 @@ IRAItList IRActions::findByMode(const Mode &mode) return ret; } -IRAItList IRActions::findByModeButton(const Mode &mode, const QString &button) +IRAItList IRActions::findByModeButton(const Mode &mode, const TQString &button) { IRAItList ret; for(iterator i = begin(); i != end(); ++i) diff --git a/kdelirc/kdelirc/iractions.h b/kdelirc/kdelirc/iractions.h index 24174d9..8373669 100644 --- a/kdelirc/kdelirc/iractions.h +++ b/kdelirc/kdelirc/iractions.h @@ -13,10 +13,10 @@ #ifndef IRACTIONS_H #define IRACTIONS_H -#include <qvaluelist.h> -#include <qpair.h> -#include <qstring.h> -#include <qmap.h> +#include <tqvaluelist.h> +#include <tqpair.h> +#include <tqstring.h> +#include <tqmap.h> #include "iraction.h" #include "mode.h" @@ -27,22 +27,22 @@ class KConfig; -typedef QValueListIterator<IRAction> IRAIt; -typedef QValueList<IRAIt> IRAItList; +typedef TQValueListIterator<IRAction> IRAIt; +typedef TQValueList<IRAIt> IRAItList; -class IRActions: protected QValueList<IRAction> +class IRActions: protected TQValueList<IRAction> { private: void purgeAllBindings(KConfig &theConfig); public: IRAIt addAction(const IRAction &theAction); - IRAItList findByButton(const QString &remote, const QString &button); + IRAItList findByButton(const TQString &remote, const TQString &button); IRAItList findByMode(const Mode &mode); - IRAItList findByModeButton(const Mode &mode, const QString &button); + IRAItList findByModeButton(const Mode &mode, const TQString &button); - void erase(const IRAIt &action) { QValueList<IRAction>::erase(action); } - void renameMode(const Mode &mode, const QString &to); + void erase(const IRAIt &action) { TQValueList<IRAction>::erase(action); } + void renameMode(const Mode &mode, const TQString &to); void loadFromConfig(KConfig &theConfig); void saveToConfig(KConfig &theConfig); diff --git a/kdelirc/kdelirc/mode.cpp b/kdelirc/kdelirc/mode.cpp index 1f4c34a..71deea8 100644 --- a/kdelirc/kdelirc/mode.cpp +++ b/kdelirc/kdelirc/mode.cpp @@ -16,11 +16,11 @@ #include "modes.h" #include "mode.h" -Mode::Mode() : theName(QString::null) +Mode::Mode() : theName(TQString::null) { } -Mode::Mode(const QString &remote, const QString &name, const QString &iconFile) +Mode::Mode(const TQString &remote, const TQString &name, const TQString &iconFile) { theRemote = remote; theName = name; @@ -33,17 +33,17 @@ Mode::~Mode() const Mode &Mode::loadFromConfig(KConfig &theConfig, int index) { - QString Prefix = "Mode" + QString().setNum(index); + TQString Prefix = "Mode" + TQString().setNum(index); theName = theConfig.readEntry(Prefix + "Name"); theRemote = theConfig.readEntry(Prefix + "Remote"); theIconFile = theConfig.readEntry(Prefix + "IconFile"); - if(theIconFile.isEmpty()) theIconFile = QString::null; + if(theIconFile.isEmpty()) theIconFile = TQString::null; return *this; } void Mode::saveToConfig(KConfig &theConfig, int index) { - QString Prefix = "Mode" + QString().setNum(index); + TQString Prefix = "Mode" + TQString().setNum(index); theConfig.writeEntry(Prefix + "Name", theName); theConfig.writeEntry(Prefix + "Remote", theRemote); theConfig.writeEntry(Prefix + "IconFile", theIconFile); diff --git a/kdelirc/kdelirc/mode.h b/kdelirc/kdelirc/mode.h index e52c042..9a73fbc 100644 --- a/kdelirc/kdelirc/mode.h +++ b/kdelirc/kdelirc/mode.h @@ -13,7 +13,7 @@ #ifndef MODE_H #define MODE_H -#include <qstring.h> +#include <tqstring.h> #include "remoteserver.h" @@ -25,17 +25,17 @@ class KConfig; class Mode { - QString theName, theRemote, theIconFile; + TQString theName, theRemote, theIconFile; public: - void setName(const QString &a) { theName = a; } - void setRemote(const QString &a) { theRemote = a; } - void setIconFile(const QString &a) { theIconFile = a; } + void setName(const TQString &a) { theName = a; } + void setRemote(const TQString &a) { theRemote = a; } + void setIconFile(const TQString &a) { theIconFile = a; } - const QString &name() const { return theName; } - const QString &remote() const { return theRemote; } - const QString &iconFile() const { return theIconFile; } - const QString &remoteName() const { return RemoteServer::remoteServer()->getRemoteName(theRemote); } + const TQString &name() const { return theName; } + const TQString &remote() const { return theRemote; } + const TQString &iconFile() const { return theIconFile; } + const TQString &remoteName() const { return RemoteServer::remoteServer()->getRemoteName(theRemote); } const Mode &loadFromConfig(KConfig &theConfig, int index); void saveToConfig(KConfig &theConfig, int index); @@ -43,7 +43,7 @@ public: bool operator==(const Mode &mode) const { return mode.theName == theName && mode.theRemote == theRemote; } Mode(); - Mode(const QString &remote, const QString &name, const QString &iconFile = QString::null); + Mode(const TQString &remote, const TQString &name, const TQString &iconFile = TQString::null); ~Mode(); }; diff --git a/kdelirc/kdelirc/modes.cpp b/kdelirc/kdelirc/modes.cpp index 1b60647..5346837 100644 --- a/kdelirc/kdelirc/modes.cpp +++ b/kdelirc/kdelirc/modes.cpp @@ -38,9 +38,9 @@ void Modes::loadFromConfig(KConfig &theConfig) theDefaults[i.key()] = theConfig.readEntry("Default" + i.key()); } -void Modes::generateNulls(const QStringList &theRemotes) +void Modes::generateNulls(const TQStringList &theRemotes) { - for(QStringList::const_iterator i = theRemotes.begin(); i != theRemotes.end(); ++i) + for(TQStringList::const_iterator i = theRemotes.begin(); i != theRemotes.end(); ++i) { if(!contains(*i) || !operator[](*i).contains("")) operator[](*i)[""] = Mode(*i, ""); if(!theDefaults.contains(*i)) theDefaults[*i].isEmpty(); } @@ -55,9 +55,9 @@ bool Modes::isDefault(const Mode &mode) const return false; } -const Mode Modes::getDefault(const QString &remote) const +const Mode Modes::getDefault(const TQString &remote) const { -// if(theDefaults[remote] == QString()) +// if(theDefaults[remote] == TQString()) // return Mode(remote, ""); if(contains(remote)) if(operator[](remote).contains(theDefaults[remote])) @@ -71,7 +71,7 @@ void Modes::purgeAllModes(KConfig &theConfig) { int numModes = theConfig.readNumEntry("Modes"); for(int i = 0; i < numModes; i++) - { QString Prefix = "Mode" + QString().setNum(i); + { TQString Prefix = "Mode" + TQString().setNum(i); theConfig.deleteEntry(Prefix + "Name"); theConfig.deleteEntry(Prefix + "Remote"); } @@ -82,26 +82,26 @@ void Modes::saveToConfig(KConfig &theConfig) int index = 0; purgeAllModes(theConfig); for(iterator i = begin(); i != end(); ++i) - for(QMap<QString, Mode>::iterator j = (*i).begin(); j != (*i).end(); ++j,index++) + for(TQMap<TQString, Mode>::iterator j = (*i).begin(); j != (*i).end(); ++j,index++) (*j).saveToConfig(theConfig, index); theConfig.writeEntry("Modes", index); for(iterator i = begin(); i != end(); ++i) - if(theDefaults[i.key()] == QString()) + if(theDefaults[i.key()] == TQString()) theConfig.writeEntry("Default" + i.key(), ""); else theConfig.writeEntry("Default" + i.key(), theDefaults[i.key()]); } -const Mode &Modes::getMode(const QString &remote, const QString &mode) const +const Mode &Modes::getMode(const TQString &remote, const TQString &mode) const { return operator[](remote)[mode]; } -ModeList Modes::getModes(const QString &remote) const +ModeList Modes::getModes(const TQString &remote) const { ModeList ret; - for(QMap<QString, Mode>::const_iterator i = operator[](remote).begin(); i != operator[](remote).end(); ++i) + for(TQMap<TQString, Mode>::const_iterator i = operator[](remote).begin(); i != operator[](remote).end(); ++i) ret += *i; return ret; } @@ -117,7 +117,7 @@ void Modes::add(const Mode &mode) operator[](mode.remote())[mode.name()] = mode; } -void Modes::rename(Mode &mode, const QString name) +void Modes::rename(Mode &mode, const TQString name) { bool was = isDefault(mode); erase(mode); diff --git a/kdelirc/kdelirc/modes.h b/kdelirc/kdelirc/modes.h index 9eabd4b..ce89d43 100644 --- a/kdelirc/kdelirc/modes.h +++ b/kdelirc/kdelirc/modes.h @@ -13,10 +13,10 @@ #ifndef MODES_H #define MODES_H -#include <qstring.h> -#include <qmap.h> -#include <qpair.h> -#include <qvaluelist.h> +#include <tqstring.h> +#include <tqmap.h> +#include <tqpair.h> +#include <tqvaluelist.h> #include "mode.h" @@ -26,21 +26,21 @@ class KConfig; -typedef QValueList<Mode> ModeList; +typedef TQValueList<Mode> ModeList; -class Modes : protected QMap<QString, QMap<QString, Mode> > +class Modes : protected TQMap<TQString, TQMap<TQString, Mode> > { void purgeAllModes(KConfig &theConfig); - QMap<QString, QString> theDefaults; + TQMap<TQString, TQString> theDefaults; public: void loadFromConfig(KConfig &theConfig); void saveToConfig(KConfig &theConfig); - void generateNulls(const QStringList &theRemotes); + void generateNulls(const TQStringList &theRemotes); - const Mode &getMode(const QString &remote, const QString &mode) const; - ModeList getModes(const QString &remote) const; - const Mode getDefault(const QString &remote) const; + const Mode &getMode(const TQString &remote, const TQString &mode) const; + ModeList getModes(const TQString &remote) const; + const Mode getDefault(const TQString &remote) const; bool isDefault(const Mode &mode) const; /** @@ -53,7 +53,7 @@ public: void add(const Mode &mode); // dont use this without renaming all the modes in the actions!!! - void rename(Mode &mode, const QString name); + void rename(Mode &mode, const TQString name); Modes(); ~Modes(); diff --git a/kdelirc/kdelirc/profileserver.cpp b/kdelirc/kdelirc/profileserver.cpp index 484deac..7a72c4d 100644 --- a/kdelirc/kdelirc/profileserver.cpp +++ b/kdelirc/kdelirc/profileserver.cpp @@ -11,8 +11,8 @@ // // -#include <qfile.h> -#include <qxml.h> +#include <tqfile.h> +#include <tqxml.h> #include <kglobal.h> #include <kstandarddirs.h> @@ -34,8 +34,8 @@ ProfileServer::~ProfileServer() void ProfileServer::loadProfiles() { - QStringList theFiles = KGlobal::dirs()->findAllResources("data", "profiles/*.profile.xml"); - for(QStringList::iterator i = theFiles.begin(); i != theFiles.end(); ++i) + TQStringList theFiles = KGlobal::dirs()->findAllResources("data", "profiles/*.profile.xml"); + for(TQStringList::iterator i = theFiles.begin(); i != theFiles.end(); ++i) { kdDebug() << "Found data file: " << *i << endl; Profile *p = new Profile(); p->loadFromFile(*i); @@ -52,27 +52,27 @@ Profile::Profile() theActions.setAutoDelete(true); } -const ProfileAction *Profile::searchClass(const QString &c) const +const ProfileAction *Profile::searchClass(const TQString &c) const { - for(QDictIterator<ProfileAction> i(theActions); i.current(); ++i) + for(TQDictIterator<ProfileAction> i(theActions); i.current(); ++i) if(i.current()->getClass() == c) return i; return 0; } -void Profile::loadFromFile(const QString &fileName) +void Profile::loadFromFile(const TQString &fileName) { charBuffer = ""; curPA = 0; curPAA = 0; - QFile xmlFile(fileName); - QXmlInputSource source(&xmlFile); - QXmlSimpleReader reader; + TQFile xmlFile(fileName); + TQXmlInputSource source(&xmlFile); + TQXmlSimpleReader reader; reader.setContentHandler(this); reader.parse(source); } -const ProfileAction *ProfileServer::getAction(const QString &appId, const QString &actionId) const +const ProfileAction *ProfileServer::getAction(const TQString &appId, const TQString &actionId) const { if(theProfiles[appId]) if(theProfiles[appId]->theActions[actionId]) @@ -80,25 +80,25 @@ const ProfileAction *ProfileServer::getAction(const QString &appId, const QStrin return 0; } -const QString &ProfileServer::getServiceName(const QString &appId) const +const TQString &ProfileServer::getServiceName(const TQString &appId) const { if(theProfiles[appId]) return theProfiles[appId]->serviceName(); - return QString::null; + return TQString::null; } -const ProfileAction *ProfileServer::getAction(const QString &appId, const QString &objId, const QString &prototype) const +const ProfileAction *ProfileServer::getAction(const TQString &appId, const TQString &objId, const TQString &prototype) const { return getAction(appId, objId + "::" + prototype); } -bool Profile::characters(const QString &data) +bool Profile::characters(const TQString &data) { charBuffer += data; return true; } -bool Profile::startElement(const QString &, const QString &, const QString &name, const QXmlAttributes &attributes) +bool Profile::startElement(const TQString &, const TQString &, const TQString &name, const TQXmlAttributes &attributes) { if(name == "profile") { theId = attributes.value("id"); @@ -130,7 +130,7 @@ bool Profile::startElement(const QString &, const QString &, const QString &name return true; } -bool Profile::endElement(const QString &, const QString &, const QString &name) +bool Profile::endElement(const TQString &, const TQString &, const TQString &name) { if(name == "name") if(curPA) diff --git a/kdelirc/kdelirc/profileserver.h b/kdelirc/kdelirc/profileserver.h index f906dd0..0228082 100644 --- a/kdelirc/kdelirc/profileserver.h +++ b/kdelirc/kdelirc/profileserver.h @@ -13,12 +13,12 @@ #ifndef PROFILESERVER_H #define PROFILESERVER_H -#include <qpair.h> -#include <qstring.h> -#include <qvaluelist.h> -#include <qmap.h> -#include <qxml.h> -#include <qdict.h> +#include <tqpair.h> +#include <tqstring.h> +#include <tqvaluelist.h> +#include <tqmap.h> +#include <tqxml.h> +#include <tqdict.h> /** @author Gav Wood @@ -33,19 +33,19 @@ class Profile; class ProfileActionArgument { - QString theComment, theType; + TQString theComment, theType; Range theRange; - QString theDefault; // should be QVariant? + TQString theDefault; // should be QVariant? const ProfileAction *parent; friend class Profile; public: - const QString &comment() const { return theComment; } - void setComment(const QString &a) { theComment = a; } - const QString &type() const { return theType; } - void setType(const QString &a) { theType = a; } - const QString &getDefault() const { return theDefault; } - void setDefault(const QString &a) { theDefault = a; } + const TQString &comment() const { return theComment; } + void setComment(const TQString &a) { theComment = a; } + const TQString &type() const { return theType; } + void setType(const TQString &a) { theType = a; } + const TQString &getDefault() const { return theDefault; } + void setDefault(const TQString &a) { theDefault = a; } const Range &range() const { return theRange; } void setRange(const Range &a) { theRange = a; } @@ -55,31 +55,31 @@ public: class ProfileAction { - QString theObjId, thePrototype, theName, theComment, theClass; + TQString theObjId, thePrototype, theName, theComment, theClass; float theMultiplier; const Profile *parent; bool theRepeat, theAutoStart; - QValueList<ProfileActionArgument> theArguments; + TQValueList<ProfileActionArgument> theArguments; friend class Profile; public: - const QString &objId() const { return theObjId; } - void setObjId(const QString &a) { theObjId = a; } - const QString &prototype() const { return thePrototype; } - void setPrototype(const QString &a) { thePrototype = a; } - const QString &name() const { return theName; } - void setName(const QString &a) { theName = a; } - const QString &comment() const { return theComment; } - void setComment(const QString &a) { theComment = a; } - const QString &getClass() const { return theClass; } - void setClass(const QString &a) { theClass = a; } + const TQString &objId() const { return theObjId; } + void setObjId(const TQString &a) { theObjId = a; } + const TQString &prototype() const { return thePrototype; } + void setPrototype(const TQString &a) { thePrototype = a; } + const TQString &name() const { return theName; } + void setName(const TQString &a) { theName = a; } + const TQString &comment() const { return theComment; } + void setComment(const TQString &a) { theComment = a; } + const TQString &getClass() const { return theClass; } + void setClass(const TQString &a) { theClass = a; } const float multiplier() const { return theMultiplier; } void setMultiplier(const float a) { theMultiplier = a; } bool repeat() const { return theRepeat; } void setRepeat(bool a) { theRepeat = a; } bool autoStart() const { return theAutoStart; } void setAutoStart(bool a) { theAutoStart = a; } - const QValueList<ProfileActionArgument> &arguments() const { return theArguments; } + const TQValueList<ProfileActionArgument> &arguments() const { return theArguments; } const Profile *profile() const { return parent; } void setProfile(const Profile *a) { parent = a; } @@ -87,37 +87,37 @@ public: class Profile : public QXmlDefaultHandler { - QString theId, theName, theAuthor, theServiceName; + TQString theId, theName, theAuthor, theServiceName; IfMulti theIfMulti; bool theUnique; - QString charBuffer; + TQString charBuffer; ProfileAction *curPA; ProfileActionArgument *curPAA; - QDict<ProfileAction> theActions; // objid+"::"+prototype => ProfileAction + TQDict<ProfileAction> theActions; // objid+"::"+prototype => ProfileAction friend class ProfileServer; public: - bool characters(const QString &data); - bool startElement(const QString &, const QString &, const QString &name, const QXmlAttributes &attributes); - bool endElement(const QString &, const QString &, const QString &name); - - const QString &id() const { return theId; } - void setId(const QString &a) { theId = a; } - const QString &name() const { return theName; } - void setName(const QString &a) { theName = a; } - const QString &author() const { return theAuthor; } - void setAuthor(const QString &a) { theAuthor = a; } + bool characters(const TQString &data); + bool startElement(const TQString &, const TQString &, const TQString &name, const TQXmlAttributes &attributes); + bool endElement(const TQString &, const TQString &, const TQString &name); + + const TQString &id() const { return theId; } + void setId(const TQString &a) { theId = a; } + const TQString &name() const { return theName; } + void setName(const TQString &a) { theName = a; } + const TQString &author() const { return theAuthor; } + void setAuthor(const TQString &a) { theAuthor = a; } const bool unique() const { return theUnique; } void setUnique(const bool a) { theUnique = a; } const IfMulti ifMulti() const { return theIfMulti; } void setIfMulti(const IfMulti a) { theIfMulti = a; } - const QString &serviceName() const { if(theServiceName != QString::null) return theServiceName; return theName; } - void setServiceName(const QString &a) { theServiceName = a; } - const QDict<ProfileAction> &actions() const { return theActions; } - const ProfileAction *searchClass(const QString &c) const; + const TQString &serviceName() const { if(theServiceName != TQString::null) return theServiceName; return theName; } + void setServiceName(const TQString &a) { theServiceName = a; } + const TQDict<ProfileAction> &actions() const { return theActions; } + const ProfileAction *searchClass(const TQString &c) const; - void loadFromFile(const QString &fileName); + void loadFromFile(const TQString &fileName); Profile(); }; @@ -126,14 +126,14 @@ class ProfileServer { static ProfileServer *theInstance; void loadProfiles(); - QDict<Profile> theProfiles; // id => Profile + TQDict<Profile> theProfiles; // id => Profile public: static ProfileServer *profileServer() { if(!theInstance) theInstance = new ProfileServer(); return theInstance; } - const QDict<Profile> profiles() const { return theProfiles; } - const ProfileAction *getAction(const QString &appId, const QString &objId, const QString &prototype) const; - const ProfileAction *getAction(const QString &appId, const QString &actionId) const; - const QString &getServiceName(const QString &appId) const; + const TQDict<Profile> profiles() const { return theProfiles; } + const ProfileAction *getAction(const TQString &appId, const TQString &objId, const TQString &prototype) const; + const ProfileAction *getAction(const TQString &appId, const TQString &actionId) const; + const TQString &getServiceName(const TQString &appId) const; ProfileServer(); ~ProfileServer(); diff --git a/kdelirc/kdelirc/prototype.cpp b/kdelirc/kdelirc/prototype.cpp index 9b0a09b..8e2eedf 100644 --- a/kdelirc/kdelirc/prototype.cpp +++ b/kdelirc/kdelirc/prototype.cpp @@ -10,7 +10,7 @@ // Copyright: See COPYING file that comes with this distribution // // -#include <qregexp.h> +#include <tqregexp.h> #include "prototype.h" @@ -19,7 +19,7 @@ Prototype::Prototype() original = ""; } -Prototype::Prototype(const QString &source) +Prototype::Prototype(const TQString &source) { original = source; parse(); @@ -29,17 +29,17 @@ Prototype::~Prototype() { } -const QString Prototype::argumentList() const +const TQString Prototype::argumentList() const { - QString ret = ""; + TQString ret = ""; for(unsigned i = 0; i < theTypes.count(); i++) ret += (i ? ", " : "") + theTypes[i] + " " + theNames[i]; return ret; } -const QString Prototype::argumentListNN() const +const TQString Prototype::argumentListNN() const { - QString ret = ""; + TQString ret = ""; for(unsigned i = 0; i < theTypes.count(); i++) ret += (i ? ", " : "") + theTypes[i]; return ret; @@ -50,14 +50,14 @@ void Prototype::parse() theNames.clear(); theTypes.clear(); - QRegExp main("^(.*) (\\w[\\d\\w]*)\\((.*)\\)"); - QRegExp parameters("^\\s*([^,\\s]+)(\\s+(\\w[\\d\\w]*))?(,(.*))?$"); + TQRegExp main("^(.*) (\\w[\\d\\w]*)\\((.*)\\)"); + TQRegExp parameters("^\\s*([^,\\s]+)(\\s+(\\w[\\d\\w]*))?(,(.*))?$"); if(main.search(original) == -1) return; theReturn = main.cap(1); theName = main.cap(2); - QString args = main.cap(3); + TQString args = main.cap(3); while(parameters.search(args) != -1) { theTypes += parameters.cap(1); theNames += parameters.cap(3); diff --git a/kdelirc/kdelirc/prototype.h b/kdelirc/kdelirc/prototype.h index 22c1123..0a963f7 100644 --- a/kdelirc/kdelirc/prototype.h +++ b/kdelirc/kdelirc/prototype.h @@ -13,9 +13,9 @@ #ifndef PROTOTYPE_H #define PROTOTYPE_H -#include <qstringlist.h> -#include <qpair.h> -#include <qstring.h> +#include <tqstringlist.h> +#include <tqpair.h> +#include <tqstring.h> /** @author Gav Wood @@ -23,29 +23,29 @@ class Prototype { - QString original, theName, theReturn; - QStringList theNames, theTypes; + TQString original, theName, theReturn; + TQStringList theNames, theTypes; void parse(); public: unsigned count() const{ return theTypes.count(); } - const QPair<QString, QString> operator[](int i) const { return qMakePair(theTypes[i], theNames[i]); } - const QString &name(int i) const { return theNames[i]; } - const QString &type(int i) const { return theTypes[i]; } - const QString &returnType() const { return theReturn; } - const QString &name() const { return theName; } - const QString &prototype() const { return original; } - const QString argumentList() const; - const QString argumentListNN() const; + const QPair<TQString, TQString> operator[](int i) const { return qMakePair(theTypes[i], theNames[i]); } + const TQString &name(int i) const { return theNames[i]; } + const TQString &type(int i) const { return theTypes[i]; } + const TQString &returnType() const { return theReturn; } + const TQString &name() const { return theName; } + const TQString &prototype() const { return original; } + const TQString argumentList() const; + const TQString argumentListNN() const; const int argumentCount() { return theTypes.count(); } - const QString prototypeNR() const { return theName + "(" + argumentListNN() + ")"; } + const TQString prototypeNR() const { return theName + "(" + argumentListNN() + ")"; } - void setPrototype(const QString &source) { original = source; parse(); } + void setPrototype(const TQString &source) { original = source; parse(); } - Prototype &operator=(const QString &source) { setPrototype(source); return *this; } + Prototype &operator=(const TQString &source) { setPrototype(source); return *this; } - Prototype(const QString &source); + Prototype(const TQString &source); Prototype(); ~Prototype(); diff --git a/kdelirc/kdelirc/remoteserver.cpp b/kdelirc/kdelirc/remoteserver.cpp index 25d8f44..db33591 100644 --- a/kdelirc/kdelirc/remoteserver.cpp +++ b/kdelirc/kdelirc/remoteserver.cpp @@ -11,8 +11,8 @@ // // -#include <qfile.h> -#include <qxml.h> +#include <tqfile.h> +#include <tqxml.h> #include <kglobal.h> #include <kstandarddirs.h> @@ -34,8 +34,8 @@ RemoteServer::~RemoteServer() void RemoteServer::loadRemotes() { - QStringList theFiles = KGlobal::dirs()->findAllResources("data", "remotes/*.remote.xml"); - for(QStringList::iterator i = theFiles.begin(); i != theFiles.end(); ++i) + TQStringList theFiles = KGlobal::dirs()->findAllResources("data", "remotes/*.remote.xml"); + for(TQStringList::iterator i = theFiles.begin(); i != theFiles.end(); ++i) { kdDebug() << "Found data file: " << *i << endl; Remote *p = new Remote(); p->loadFromFile(*i); @@ -52,25 +52,25 @@ Remote::~Remote() { } -void Remote::loadFromFile(const QString &fileName) +void Remote::loadFromFile(const TQString &fileName) { charBuffer = ""; curRB = 0; - QFile xmlFile(fileName); - QXmlInputSource source(&xmlFile); - QXmlSimpleReader reader; + TQFile xmlFile(fileName); + TQXmlInputSource source(&xmlFile); + TQXmlSimpleReader reader; reader.setContentHandler(this); reader.parse(source); } -bool Remote::characters(const QString &data) +bool Remote::characters(const TQString &data) { charBuffer += data; return true; } -bool Remote::startElement(const QString &, const QString &, const QString &name, const QXmlAttributes &attributes) +bool Remote::startElement(const TQString &, const TQString &, const TQString &name, const TQXmlAttributes &attributes) { if(name == "remote") theId = theName = attributes.value("id"); @@ -89,7 +89,7 @@ bool Remote::startElement(const QString &, const QString &, const QString &name, return true; } -bool Remote::endElement(const QString &, const QString &, const QString &name) +bool Remote::endElement(const TQString &, const TQString &, const TQString &name) { if(name == "name") if(curRB) diff --git a/kdelirc/kdelirc/remoteserver.h b/kdelirc/kdelirc/remoteserver.h index 3700acd..e74b02e 100644 --- a/kdelirc/kdelirc/remoteserver.h +++ b/kdelirc/kdelirc/remoteserver.h @@ -13,9 +13,9 @@ #ifndef REMOTESERVER_H #define REMOTESERVER_H -#include <qstring.h> -#include <qxml.h> -#include <qdict.h> +#include <tqstring.h> +#include <tqxml.h> +#include <tqdict.h> /** @author Gav Wood @@ -24,45 +24,45 @@ class RemoteButton { - QString theName, theId, theClass, theParameter; + TQString theName, theId, theClass, theParameter; friend class Remote; public: - void setName(const QString &a) { theName = a; } - const QString &name(void) const { return theName; } - void setClass(const QString &a) { theClass = a; } - const QString &getClass(void) const { return theClass; } - void setParameter(const QString &a) { theParameter = a; } - const QString ¶meter(void) const { return theParameter; } - void setId(const QString &a) { theId = a; } - const QString &id(void) const { return theId; } + void setName(const TQString &a) { theName = a; } + const TQString &name(void) const { return theName; } + void setClass(const TQString &a) { theClass = a; } + const TQString &getClass(void) const { return theClass; } + void setParameter(const TQString &a) { theParameter = a; } + const TQString ¶meter(void) const { return theParameter; } + void setId(const TQString &a) { theId = a; } + const TQString &id(void) const { return theId; } }; class Remote : public QXmlDefaultHandler { - QString theName, theId, theAuthor; - QDict<RemoteButton> theButtons; + TQString theName, theId, theAuthor; + TQDict<RemoteButton> theButtons; - QString charBuffer; + TQString charBuffer; RemoteButton *curRB; friend class RemoteServer; public: - bool characters(const QString &data); - bool startElement(const QString &, const QString &, const QString &name, const QXmlAttributes &attributes); - bool endElement(const QString &, const QString &, const QString &name); + bool characters(const TQString &data); + bool startElement(const TQString &, const TQString &, const TQString &name, const TQXmlAttributes &attributes); + bool endElement(const TQString &, const TQString &, const TQString &name); - void setName(const QString &a) { theName = a; } - const QString &name(void) const { return theName; } - void setId(const QString &a) { theId = a; } - const QString &id(void) const { return theId; } - void setAuthor(const QString &a) { theAuthor = a; } - const QString &author(void) const { return theAuthor; } - const QDict<RemoteButton> &buttons() const { return theButtons; } + void setName(const TQString &a) { theName = a; } + const TQString &name(void) const { return theName; } + void setId(const TQString &a) { theId = a; } + const TQString &id(void) const { return theId; } + void setAuthor(const TQString &a) { theAuthor = a; } + const TQString &author(void) const { return theAuthor; } + const TQDict<RemoteButton> &buttons() const { return theButtons; } - void loadFromFile(const QString &fileName); + void loadFromFile(const TQString &fileName); - const QString &getButtonName(const QString &id) const { if(theButtons[id]) return theButtons[id]->name(); return id; } + const TQString &getButtonName(const TQString &id) const { if(theButtons[id]) return theButtons[id]->name(); return id; } Remote(); ~Remote(); @@ -72,15 +72,15 @@ class RemoteServer { static RemoteServer *theInstance; void loadRemotes(); - QDict<Remote> theRemotes; + TQDict<Remote> theRemotes; public: static RemoteServer *remoteServer() { if(!theInstance) theInstance = new RemoteServer(); return theInstance; } - const QDict<Remote> &remotes() const { return theRemotes; } + const TQDict<Remote> &remotes() const { return theRemotes; } - const QString &getRemoteName(const QString &id) const { if(theRemotes[id]) return theRemotes[id]->name(); return id; } - const QString &getButtonName(const QString &remote, const QString &button) const { if(theRemotes[remote]) return theRemotes[remote]->getButtonName(button); return button; } + const TQString &getRemoteName(const TQString &id) const { if(theRemotes[id]) return theRemotes[id]->name(); return id; } + const TQString &getButtonName(const TQString &remote, const TQString &button) const { if(theRemotes[remote]) return theRemotes[remote]->getButtonName(button); return button; } RemoteServer(); ~RemoteServer(); diff --git a/kdessh/kdessh.cpp b/kdessh/kdessh.cpp index 6fa10ca..c449004 100644 --- a/kdessh/kdessh.cpp +++ b/kdessh/kdessh.cpp @@ -83,14 +83,14 @@ int main(int argc, char *argv[]) KCmdLineArgs::usage(i18n("No command or host specified.")); // Check if ssh is available - if (KStandardDirs::findExe(QString::fromLatin1("ssh")).isEmpty()) + if (KStandardDirs::findExe(TQString::fromLatin1("ssh")).isEmpty()) { kdError(1511) << "ssh not found\n"; exit(1); } // Get remote userid - QCString user = args->getOption("u"); + TQCString user = args->getOption("u"); if (user.isNull()) { struct passwd *pw = getpwuid(getuid()); @@ -103,11 +103,11 @@ int main(int argc, char *argv[]) } // Remote stub location - QCString stub = args->getOption("s"); + TQCString stub = args->getOption("s"); // Get remote host, command - QCString host = args->arg(0); - QCString command = args->arg(1); + TQCString host = args->arg(0); + TQCString command = args->arg(1); for (int i=2; i<args->count(); i++) { command += " "; @@ -151,22 +151,22 @@ int main(int argc, char *argv[]) // Read configuration KConfig *config = KGlobal::config(); - config->setGroup(QString::fromLatin1("Passwords")); - int timeout = config->readNumEntry(QString::fromLatin1("Timeout"), defTimeout); + config->setGroup(TQString::fromLatin1("Passwords")); + int timeout = config->readNumEntry(TQString::fromLatin1("Timeout"), defTimeout); SshProcess proc(host, user); proc.setStub(stub); int needpw = proc.checkNeedPassword(); if (needpw < 0) { - QString msg = i18n("Ssh returned with an error!\n" + TQString msg = i18n("Ssh returned with an error!\n" "The error message is:\n\n"); msg += proc.error(); KMessageBox::error(0L, msg); exit(1); } - QCString password; + TQCString password; if (needpw != 0) { KDEsshDialog *dlg = new KDEsshDialog(host, user, stub, diff --git a/kdessh/sshdlg.cpp b/kdessh/sshdlg.cpp index a652688..bffc694 100644 --- a/kdessh/sshdlg.cpp +++ b/kdessh/sshdlg.cpp @@ -13,18 +13,18 @@ #include "sshdlg.h" -KDEsshDialog::KDEsshDialog(QCString host, QCString user, QCString stub, - QString prompt, bool enableKeep) +KDEsshDialog::KDEsshDialog(TQCString host, TQCString user, TQCString stub, + TQString prompt, bool enableKeep) : KPasswordDialog(Password, enableKeep, 0) { m_Host = host; m_User = user; m_Stub = stub; - setCaption(QString::fromLatin1("%1@%2").arg(m_User).arg(m_Host)); + setCaption(TQString::fromLatin1("%1@%2").arg(m_User).arg(m_Host)); // Make the prompt a little more polite :-) - if (prompt.lower().left(6) == QString::fromLatin1("enter ")) + if (prompt.lower().left(6) == TQString::fromLatin1("enter ")) prompt.remove(0, 6); int pos = prompt.find(':'); if (pos != -1) diff --git a/kdessh/sshdlg.h b/kdessh/sshdlg.h index 1090312..c552548 100644 --- a/kdessh/sshdlg.h +++ b/kdessh/sshdlg.h @@ -17,15 +17,15 @@ class KDEsshDialog Q_OBJECT public: - KDEsshDialog(QCString host, QCString user, QCString stub, - QString prompt, bool enableKeep); + KDEsshDialog(TQCString host, TQCString user, TQCString stub, + TQString prompt, bool enableKeep); ~KDEsshDialog(); protected: bool checkPassword(const char *password); private: - QCString m_User, m_Host, m_Stub; + TQCString m_User, m_Host, m_Stub; }; diff --git a/kdf/disklist.cpp b/kdf/disklist.cpp index b2718ac..3326320 100644 --- a/kdf/disklist.cpp +++ b/kdf/disklist.cpp @@ -37,8 +37,8 @@ /*************************************************************************** * constructor **/ -DiskList::DiskList(QObject *parent, const char *name) - : QObject(parent,name) +DiskList::DiskList(TQObject *parent, const char *name) + : TQObject(parent,name) { kdDebug() << k_funcinfo << endl; @@ -53,10 +53,10 @@ DiskList::DiskList(QObject *parent, const char *name) // BackgroundProcesses **************************************** dfProc = new KProcess(); Q_CHECK_PTR(dfProc); - connect( dfProc, SIGNAL(receivedStdout(KProcess *, char *, int) ), - this, SLOT (receivedDFStdErrOut(KProcess *, char *, int)) ); - connect(dfProc,SIGNAL(processExited(KProcess *) ), - this, SLOT(dfDone() ) ); + connect( dfProc, TQT_SIGNAL(receivedStdout(KProcess *, char *, int) ), + this, TQT_SLOT (receivedDFStdErrOut(KProcess *, char *, int)) ); + connect(dfProc,TQT_SIGNAL(processExited(KProcess *) ), + this, TQT_SLOT(dfDone() ) ); readingDFStdErrOut=FALSE; config = kapp->config(); @@ -87,9 +87,9 @@ void DiskList::applySettings() { kdDebug() << k_funcinfo << endl; - QString oldgroup=config->group(); + TQString oldgroup=config->group(); config->setGroup("DiskList"); - QString key; + TQString key; DiskEntry *disk; for (disk=disks->first();disk!=0;disk=disks->next()) { key.sprintf("Mount%s%s%s%s",SEPARATOR,disk->deviceName().latin1() @@ -117,7 +117,7 @@ void DiskList::loadSettings() kdDebug() << k_funcinfo << endl; config->setGroup("DiskList"); - QString key; + TQString key; DiskEntry *disk; for (disk=disks->first();disk!=0;disk=disks->next()) { key.sprintf("Mount%s%s%s%s",SEPARATOR,disk->deviceName().latin1() @@ -130,14 +130,14 @@ void DiskList::loadSettings() key.sprintf("Icon%s%s%s%s",SEPARATOR,disk->deviceName().latin1() ,SEPARATOR,disk->mountPoint().latin1()); - QString icon=config->readPathEntry(key); + TQString icon=config->readPathEntry(key); if (!icon.isEmpty()) disk->setIconName(icon); } } -static QString expandEscapes(const QString& s) { -QString rc; +static TQString expandEscapes(const TQString& s) { +TQString rc; for (unsigned int i = 0; i < s.length(); i++) { if (s[i] == '\\') { i++; @@ -172,10 +172,10 @@ int DiskList::readFSTAB() if (readingDFStdErrOut || dfProc->isRunning()) return -1; -QFile f(FSTAB); +TQFile f(FSTAB); if ( f.open(IO_ReadOnly) ) { - QTextStream t (&f); - QString s; + TQTextStream t (&f); + TQString s; DiskEntry *disk; //disks->clear(); // ############ @@ -243,7 +243,7 @@ void DiskList::receivedDFStdErrOut(KProcess *, char *data, int len ) */ - QString tmp = QString::fromLatin1(data, len); + TQString tmp = TQString::fromLatin1(data, len); dfStringErrOut.append(tmp); } @@ -283,12 +283,12 @@ void DiskList::dfDone() for ( DiskEntry *disk=disks->first(); disk != 0; disk=disks->next() ) disk->setMounted(FALSE); // set all devs unmounted - QTextStream t (dfStringErrOut, IO_ReadOnly); - QString s=t.readLine(); + TQTextStream t (dfStringErrOut, IO_ReadOnly); + TQString s=t.readLine(); if ( ( s.isEmpty() ) || ( s.left(10) != "Filesystem" ) ) qFatal("Error running df command... got [%s]",s.latin1()); while ( !t.atEnd() ) { - QString u,v; + TQString u,v; DiskEntry *disk; s=t.readLine(); s=s.simplifyWhiteSpace(); @@ -361,7 +361,7 @@ void DiskList::dfDone() } -void DiskList::deleteAllMountedAt(const QString &mountpoint) +void DiskList::deleteAllMountedAt(const TQString &mountpoint) { kdDebug() << k_funcinfo << endl; @@ -396,8 +396,8 @@ void DiskList::replaceDeviceEntry(DiskEntry *disk) // //int pos=disks->find(disk); - QString deviceRealName = disk->deviceRealName(); - QString realMountPoint = disk->realMountPoint(); + TQString deviceRealName = disk->deviceRealName(); + TQString realMountPoint = disk->realMountPoint(); int pos = -1; for( u_int i=0; i<disks->count(); i++ ) @@ -425,7 +425,7 @@ void DiskList::replaceDeviceEntry(DiskEntry *disk) // cachefs deviceNames have no / behind the host-column // eg. /cache/cache/.cfs_mnt_points/srv:_home_jesus // ^ ^ - QString odiskName = olddisk->deviceName(); + TQString odiskName = olddisk->deviceName(); int ci=odiskName.find(':'); // goto host-column while ((ci =odiskName.find('/',ci)) > 0) { odiskName.replace(ci,1,"_"); @@ -460,7 +460,7 @@ void DiskList::replaceDeviceEntry(DiskEntry *disk) if ( (-1!=olddisk->mountOptions().find("user")) && (-1==disk->mountOptions().find("user")) ) { // add "user" option to new diskEntry - QString s=disk->mountOptions(); + TQString s=disk->mountOptions(); if (s.length()>0) s.append(","); s.append("user"); disk->setMountOptions(s); diff --git a/kdf/disklist.h b/kdf/disklist.h index 7a99841..cd9613c 100644 --- a/kdf/disklist.h +++ b/kdf/disklist.h @@ -31,7 +31,7 @@ //#include <kcontrol.h> // defines the os-type -#include <qglobal.h> +#include <tqglobal.h> #include "disks.h" @@ -55,8 +55,8 @@ #define SEPARATOR "|" /***************************************************************************/ -typedef QPtrList<DiskEntry> DisksBase; -typedef QPtrListIterator<DiskEntry> DisksIterator; +typedef TQPtrList<DiskEntry> DisksBase; +typedef TQPtrListIterator<DiskEntry> DisksIterator; /***************************************************************************/ class Disks : public DisksBase @@ -96,7 +96,7 @@ private: class DiskList : public QObject { Q_OBJECT public: - DiskList( QObject *parent=0, const char *name=0 ); + DiskList( TQObject *parent=0, const char *name=0 ); ~DiskList(); int readFSTAB(); int readDF(); @@ -106,7 +106,7 @@ public: DiskEntry* next() {return disks->next();} uint count() { return disks->count(); } - void deleteAllMountedAt(const QString &mountpoint); + void deleteAllMountedAt(const TQString &mountpoint); void setUpdatesDisabled(bool disable); signals: @@ -126,7 +126,7 @@ private: Disks *disks; KProcess *dfProc; - QString dfStringErrOut; + TQString dfStringErrOut; bool readingDFStdErrOut; KConfig *config; bool updatesDisabled; diff --git a/kdf/disks.cpp b/kdf/disks.cpp index c1a4a0e..ca8f263 100644 --- a/kdf/disks.cpp +++ b/kdf/disks.cpp @@ -21,8 +21,8 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#include <qfileinfo.h> -#include <qdir.h> +#include <tqfileinfo.h> +#include <tqdir.h> #include <kglobal.h> #include <kdebug.h> @@ -56,23 +56,23 @@ void DiskEntry::init() // BackgroundProcesses **************************************** sysProc = new KShellProcess(); Q_CHECK_PTR(sysProc); - connect( sysProc, SIGNAL(receivedStdout(KProcess *, char *, int) ), - this, SLOT (receivedSysStdErrOut(KProcess *, char *, int)) ); - connect( sysProc, SIGNAL(receivedStderr(KProcess *, char *, int) ), - this, SLOT (receivedSysStdErrOut(KProcess *, char *, int)) ); + connect( sysProc, TQT_SIGNAL(receivedStdout(KProcess *, char *, int) ), + this, TQT_SLOT (receivedSysStdErrOut(KProcess *, char *, int)) ); + connect( sysProc, TQT_SIGNAL(receivedStderr(KProcess *, char *, int) ), + this, TQT_SLOT (receivedSysStdErrOut(KProcess *, char *, int)) ); readingSysStdErrOut=FALSE; } -DiskEntry::DiskEntry(QObject *parent, const char *name) - : QObject (parent, name) +DiskEntry::DiskEntry(TQObject *parent, const char *name) + : TQObject (parent, name) { init(); } -DiskEntry::DiskEntry(const QString & deviceName, QObject *parent, const char *name) - : QObject (parent, name) +DiskEntry::DiskEntry(const TQString & deviceName, TQObject *parent, const char *name) + : TQObject (parent, name) { init(); @@ -94,7 +94,7 @@ int DiskEntry::toggleMount() int DiskEntry::mount() { - QString cmdS=mntcmd; + TQString cmdS=mntcmd; if (cmdS.isEmpty()) // generate default mount cmd if (getuid()!=0 ) // user mountable { @@ -104,13 +104,13 @@ int DiskEntry::mount() { // FreeBSD's mount(8) is picky: -o _must_ go before // the device and mountpoint. - cmdS=QString::fromLatin1("mount -t%t -o%o %d %m"); + cmdS=TQString::fromLatin1("mount -t%t -o%o %d %m"); } - cmdS.replace(QString::fromLatin1("%d"),deviceName()); - cmdS.replace(QString::fromLatin1("%m"),mountPoint()); - cmdS.replace(QString::fromLatin1("%t"),fsType()); - cmdS.replace(QString::fromLatin1("%o"),mountOptions()); + cmdS.replace(TQString::fromLatin1("%d"),deviceName()); + cmdS.replace(TQString::fromLatin1("%m"),mountPoint()); + cmdS.replace(TQString::fromLatin1("%t"),fsType()); + cmdS.replace(TQString::fromLatin1("%o"),mountOptions()); kdDebug() << "mount-cmd: [" << cmdS << "]" << endl; int e=sysCall(cmdS); @@ -122,12 +122,12 @@ int DiskEntry::mount() int DiskEntry::umount() { kdDebug() << "umounting" << endl; - QString cmdS=umntcmd; + TQString cmdS=umntcmd; if (cmdS.isEmpty()) // generate default umount cmd cmdS="umount %d"; - cmdS.replace(QString::fromLatin1("%d"),deviceName()); - cmdS.replace(QString::fromLatin1("%m"),mountPoint()); + cmdS.replace(TQString::fromLatin1("%d"),deviceName()); + cmdS.replace(TQString::fromLatin1("%m"),mountPoint()); kdDebug() << "umount-cmd: [" << cmdS << "]" << endl; int e=sysCall(cmdS); @@ -142,7 +142,7 @@ int DiskEntry::remount() if (mntcmd.isEmpty() && umntcmd.isEmpty() // default mount/umount commands && (getuid()==0)) // you are root { - QString oldOpt=options; + TQString oldOpt=options; if (options.isEmpty()) options="remount"; else @@ -157,17 +157,17 @@ int DiskEntry::remount() } } -void DiskEntry::setMountCommand(const QString & mnt) +void DiskEntry::setMountCommand(const TQString & mnt) { mntcmd=mnt; } -void DiskEntry::setUmountCommand(const QString & umnt) +void DiskEntry::setUmountCommand(const TQString & umnt) { umntcmd=umnt; } -void DiskEntry::setIconName(const QString & iconName) +void DiskEntry::setIconName(const TQString & iconName) { iconSetByUser=TRUE; icoName=iconName; @@ -179,9 +179,9 @@ void DiskEntry::setIconName(const QString & iconName) emit iconNameChanged(); } -QString DiskEntry::iconName() +TQString DiskEntry::iconName() { - QString iconName=icoName; + TQString iconName=icoName; if (iconSetByUser) { mounted() ? iconName+="_mount" : iconName+="_unmount"; return iconName; @@ -189,9 +189,9 @@ QString DiskEntry::iconName() return guessIconName(); } -QString DiskEntry::guessIconName() +TQString DiskEntry::guessIconName() { - QString iconName; + TQString iconName; // try to be intelligent if (-1!=mountPoint().find("cdrom",0,FALSE)) iconName+="cdrom"; else if (-1!=deviceName().find("cdrom",0,FALSE)) iconName+="cdrom"; @@ -222,7 +222,7 @@ QString DiskEntry::guessIconName() /*************************************************************************** * starts a command on the underlying system via /bin/sh **/ -int DiskEntry::sysCall(const QString & command) +int DiskEntry::sysCall(const TQString & command) { if (readingSysStdErrOut || sysProc->isRunning() ) return -1; @@ -243,7 +243,7 @@ int DiskEntry::sysCall(const QString & command) **/ void DiskEntry::receivedSysStdErrOut(KProcess *, char *data, int len) { - QString tmp = QString::fromLocal8Bit(data, len); + TQString tmp = TQString::fromLocal8Bit(data, len); sysStringErrOut.append(tmp); } @@ -256,19 +256,19 @@ float DiskEntry::percentFull() const } } -void DiskEntry::setDeviceName(const QString & deviceName) +void DiskEntry::setDeviceName(const TQString & deviceName) { device=deviceName; emit deviceNameChanged(); } -QString DiskEntry::deviceRealName() const +TQString DiskEntry::deviceRealName() const { - QFileInfo inf( device ); - QDir dir( inf.dirPath( true ) ); - QString relPath = inf.fileName(); + TQFileInfo inf( device ); + TQDir dir( inf.dirPath( true ) ); + TQString relPath = inf.fileName(); if ( inf.isSymLink() ) { - QString link = inf.readLink(); + TQString link = inf.readLink(); if ( link.startsWith( "/" ) ) return link; relPath = link; @@ -276,25 +276,25 @@ QString DiskEntry::deviceRealName() const return dir.canonicalPath() + "/" + relPath; } -void DiskEntry::setMountPoint(const QString & mountPoint) +void DiskEntry::setMountPoint(const TQString & mountPoint) { mountedOn=mountPoint; emit mountPointChanged(); } -QString DiskEntry::realMountPoint() const +TQString DiskEntry::realMountPoint() const { - QDir dir( mountedOn ); + TQDir dir( mountedOn ); return dir.canonicalPath(); } -void DiskEntry::setMountOptions(const QString & mountOptions) +void DiskEntry::setMountOptions(const TQString & mountOptions) { options=mountOptions; emit mountOptionsChanged(); } -void DiskEntry::setFsType(const QString & fsType) +void DiskEntry::setFsType(const TQString & fsType) { type=fsType; emit fsTypeChanged(); diff --git a/kdf/disks.h b/kdf/disks.h index 9899927..ed80c3d 100644 --- a/kdf/disks.h +++ b/kdf/disks.h @@ -25,12 +25,12 @@ #ifndef __DISKS_H__ #define __DISKS_H__ -#include <qobject.h> -#include <qstring.h> -#include <qlabel.h> -#include <qpushbutton.h> -#include <qprogressbar.h> -#include <qfile.h> +#include <tqobject.h> +#include <tqstring.h> +#include <tqlabel.h> +#include <tqpushbutton.h> +#include <tqprogressbar.h> +#include <tqfile.h> #include <kio/global.h> #include <kprogress.h> @@ -41,17 +41,17 @@ class DiskEntry : public QObject { Q_OBJECT public: - DiskEntry(QObject *parent=0, const char *name=0); - DiskEntry(const QString & deviceName, QObject *parent=0, const char *name=0); + DiskEntry(TQObject *parent=0, const char *name=0); + DiskEntry(const TQString & deviceName, TQObject *parent=0, const char *name=0); ~DiskEntry(); - QString lastSysError() {return sysStringErrOut; } - QString deviceName() const { return device; } + TQString lastSysError() {return sysStringErrOut; } + TQString deviceName() const { return device; } // The real device (in case deviceName() is a symlink) - QString deviceRealName() const; - QString mountPoint() const { return mountedOn; } - QString mountOptions() const { return options; } + TQString deviceRealName() const; + TQString mountPoint() const { return mountedOn; } + TQString mountOptions() const { return options; } // The real device (in case deviceName() is a symlink) - QString realMountPoint() const; + TQString realMountPoint() const; /** * sets the used mountCommand for the actual DiskEntry. * @param mntcmd is a string containing the executable file and @@ -63,7 +63,7 @@ public: * all this information is gained from the objects' data * if no mountCommand is set it defaults to "mount %d" **/ - QString mountCommand() const { return mntcmd; } + TQString mountCommand() const { return mntcmd; } /** * sets the used umountCommand for the actual DiskEntry. * @param mntcmd is a string containing the executable file and @@ -73,17 +73,17 @@ public: * all this information is gained from the objects' data * if no umountCommand is set it defaults to "umount %d" **/ - QString umountCommand() const { return umntcmd; } - QString fsType() const { return type; } + TQString umountCommand() const { return umntcmd; } + TQString fsType() const { return type; } bool mounted() const { return isMounted; } int kBSize() const { return size; } - QString iconName(); - QString realIconName() { return icoName; } - QString prettyKBSize() const { return KIO::convertSizeFromKB(size); } + TQString iconName(); + TQString realIconName() { return icoName; } + TQString prettyKBSize() const { return KIO::convertSizeFromKB(size); } int kBUsed() const { return used; } - QString prettyKBUsed() const { return KIO::convertSizeFromKB(used); } + TQString prettyKBUsed() const { return KIO::convertSizeFromKB(used); } int kBAvail() const { return avail; } - QString prettyKBAvail() const { return KIO::convertSizeFromKB(avail); } + TQString prettyKBAvail() const { return KIO::convertSizeFromKB(avail); } float percentFull() const; signals: @@ -104,32 +104,32 @@ public slots: int mount(); int umount(); int remount(); - void setMountCommand(const QString & mnt); - void setUmountCommand(const QString & umnt); - void setDeviceName(const QString & deviceName); - void setMountPoint(const QString & mountPoint); - void setIconName(const QString & iconName); - void setMountOptions(const QString & mountOptions); - void setFsType(const QString & fsType); + void setMountCommand(const TQString & mnt); + void setUmountCommand(const TQString & umnt); + void setDeviceName(const TQString & deviceName); + void setMountPoint(const TQString & mountPoint); + void setIconName(const TQString & iconName); + void setMountOptions(const TQString & mountOptions); + void setFsType(const TQString & fsType); void setMounted(bool nowMounted); void setKBSize(int kb_size); void setKBUsed(int kb_used); void setKBAvail(int kb_avail); - QString guessIconName(); + TQString guessIconName(); private slots: void receivedSysStdErrOut(KProcess *, char *data, int len); private: void init(); - int sysCall(const QString & command); - QString prettyPrint(int kBValue) const; + int sysCall(const TQString & command); + TQString prettyPrint(int kBValue) const; KShellProcess *sysProc; - QString sysStringErrOut; + TQString sysStringErrOut; bool readingSysStdErrOut; - QString device, + TQString device, type, mountedOn, options, diff --git a/kdf/kcmdf.cpp b/kdf/kcmdf.cpp index 3c30a01..2e26113 100644 --- a/kdf/kcmdf.cpp +++ b/kdf/kcmdf.cpp @@ -28,16 +28,16 @@ #include <kdialog.h> -#include <qlayout.h> +#include <tqlayout.h> #include "kcmdf.h" -KDiskFreeWidget::KDiskFreeWidget( QWidget *parent, const char *name ) +KDiskFreeWidget::KDiskFreeWidget( TQWidget *parent, const char *name ) : KCModule( parent, name ) { setButtons(Help); - QVBoxLayout *topLayout = new QVBoxLayout( this, 0, KDialog::spacingHint() ); + TQVBoxLayout *topLayout = new TQVBoxLayout( this, 0, KDialog::spacingHint() ); mKdf = new KDFWidget( this, "kdf", false ); topLayout->addWidget( mKdf ); @@ -48,7 +48,7 @@ KDiskFreeWidget::~KDiskFreeWidget() mKdf->applySettings(); } -QString KDiskFreeWidget::quickHelp() const +TQString KDiskFreeWidget::quickHelp() const { return i18n("<h3>Hardware Information</h3><br> All the information modules return information" " about a certain aspect of your computer hardware or your operating system." @@ -57,7 +57,7 @@ QString KDiskFreeWidget::quickHelp() const extern "C" { - KDE_EXPORT KCModule* create_kdf( QWidget *parent, const char * /*name*/ ) + KDE_EXPORT KCModule* create_kdf( TQWidget *parent, const char * /*name*/ ) { return new KDiskFreeWidget( parent , "kdf" ); } diff --git a/kdf/kcmdf.h b/kdf/kcmdf.h index c3e2b58..030b7dd 100644 --- a/kdf/kcmdf.h +++ b/kdf/kcmdf.h @@ -28,17 +28,17 @@ #include "mntconfig.h" #include <kcmodule.h> -#include <qtabwidget.h> +#include <tqtabwidget.h> class KDiskFreeWidget : public KCModule { Q_OBJECT public: - KDiskFreeWidget( QWidget *parent=0, const char *name=0 ); + KDiskFreeWidget( TQWidget *parent=0, const char *name=0 ); ~KDiskFreeWidget(); - QString quickHelp() const; + TQString quickHelp() const; private: KDFWidget *mKdf; diff --git a/kdf/kconftest.cpp b/kdf/kconftest.cpp index 75d13fd..6ee63f0 100644 --- a/kdf/kconftest.cpp +++ b/kdf/kconftest.cpp @@ -32,8 +32,8 @@ #include <iostream> -#include <qstring.h> -#include <qdict.h> +#include <tqstring.h> +#include <tqdict.h> #include <kconfig.h> #include <kdebug.h> #include <kapplication.h> @@ -52,15 +52,15 @@ main(int argc, char ** argv) KApplication app; KConfig * cfg = kapp->config(); - QDict<char> dict; + TQDict<char> dict; dict.insert("Blah", "Arse"); dict.insert("Blah", "Smack"); dict.insert("Blah", "Monkey"); - QDictIterator<char> it(dict); + TQDictIterator<char> it(dict); - QString key = "TestConfigItem"; + TQString key = "TestConfigItem"; for (; it.current(); ++it) { diff --git a/kdf/kdf.cpp b/kdf/kdf.cpp index f48cf48..606c44e 100644 --- a/kdf/kdf.cpp +++ b/kdf/kdf.cpp @@ -36,16 +36,16 @@ static const char version[] = "v0.5"; /***************************************************************/ -KDFTopLevel::KDFTopLevel(QWidget *, const char *name) +KDFTopLevel::KDFTopLevel(TQWidget *, const char *name) : KMainWindow(0, name) { kdf = new KDFWidget(this,"kdf",FALSE); Q_CHECK_PTR(kdf); - (void) new KAction( i18n( "&Update" ), 0, kdf, SLOT( updateDF() ), actionCollection(), "updatedf" ); + (void) new KAction( i18n( "&Update" ), 0, kdf, TQT_SLOT( updateDF() ), actionCollection(), "updatedf" ); - KStdAction::quit(this, SLOT(close()), actionCollection()); - KStdAction::preferences(kdf, SLOT(settingsBtnClicked()), actionCollection()); - KStdAction::keyBindings(guiFactory(), SLOT(configureShortcuts()), + KStdAction::quit(this, TQT_SLOT(close()), actionCollection()); + KStdAction::preferences(kdf, TQT_SLOT(settingsBtnClicked()), actionCollection()); + KStdAction::keyBindings(guiFactory(), TQT_SLOT(configureShortcuts()), actionCollection()); setCentralWidget(kdf); // kdf->setMinimumSize(kdf->sizeHint()); @@ -33,7 +33,7 @@ class KDFTopLevel : public KMainWindow Q_OBJECT public: - KDFTopLevel(QWidget *parent=0, const char *name=0); + KDFTopLevel(TQWidget *parent=0, const char *name=0); ~KDFTopLevel() { }; protected slots: diff --git a/kdf/kdfconfig.cpp b/kdf/kdfconfig.cpp index 499e2e3..e13ebcd 100644 --- a/kdf/kdfconfig.cpp +++ b/kdf/kdfconfig.cpp @@ -24,16 +24,16 @@ // // 1999-11-29 Espen Sand -// Converted to QLayout and QListView + cleanups +// Converted to TQLayout and TQListView + cleanups // -#include <qcheckbox.h> -#include <qheader.h> -#include <qlabel.h> -#include <qlayout.h> -#include <qlcdnumber.h> -#include <qlineedit.h> +#include <tqcheckbox.h> +#include <tqheader.h> +#include <tqlabel.h> +#include <tqlayout.h> +#include <tqlcdnumber.h> +#include <tqlineedit.h> #include <kapplication.h> #include <kconfig.h> @@ -50,8 +50,8 @@ static bool GUI; #endif -KDFConfigWidget::KDFConfigWidget(QWidget *parent, const char *name, bool init) - : QWidget( parent, name) +KDFConfigWidget::KDFConfigWidget(TQWidget *parent, const char *name, bool init) + : TQWidget( parent, name) { mTabName.resize(8); @@ -68,24 +68,24 @@ KDFConfigWidget::KDFConfigWidget(QWidget *parent, const char *name, bool init) GUI = !init; if(GUI) { - QString text; - QVBoxLayout *topLayout = new QVBoxLayout( this, 0, KDialog::spacingHint()); + TQString text; + TQVBoxLayout *topLayout = new TQVBoxLayout( this, 0, KDialog::spacingHint()); mList = new CListView( this, "list", 1 ); mList->setAllColumnsShowFocus(true); - mList->setFrameStyle( QFrame::WinPanel + QFrame::Sunken ); + mList->setFrameStyle( TQFrame::WinPanel + TQFrame::Sunken ); mList->header()->setMovingEnabled(false); for( uint i=0; i < mTabName.size(); i++ ) { mList->addColumn( mTabName[i]->mName ); } - connect( mList, SIGNAL(clicked(QListViewItem *, const QPoint &, int)), - this, SLOT(toggleListText(QListViewItem *,const QPoint &,int))); - connect( mList, SIGNAL(clicked(QListViewItem *, const QPoint &, int)), - this, SLOT(slotChanged())); + connect( mList, TQT_SIGNAL(clicked(TQListViewItem *, const TQPoint &, int)), + this, TQT_SLOT(toggleListText(TQListViewItem *,const TQPoint &,int))); + connect( mList, TQT_SIGNAL(clicked(TQListViewItem *, const TQPoint &, int)), + this, TQT_SLOT(slotChanged())); topLayout->addWidget( mList ); - QListViewItem *mListItem = new QListViewItem( mList ); + TQListViewItem *mListItem = new TQListViewItem( mList ); for( uint i=mList->header()->count(); i>0; i-- ) { mListItem->setText(i-1, i18n("visible") ); @@ -93,51 +93,51 @@ KDFConfigWidget::KDFConfigWidget(QWidget *parent, const char *name, bool init) } mList->setSelected( mListItem, true ); - QGridLayout *gl = new QGridLayout( 2, 2 ); + TQGridLayout *gl = new TQGridLayout( 2, 2 ); topLayout->addLayout( gl ); gl->setColStretch( 1, 10 ); - mScroll = new QScrollBar( this ); + mScroll = new TQScrollBar( this ); Q_CHECK_PTR(mScroll); - mScroll->setOrientation( QScrollBar::Horizontal ); + mScroll->setOrientation( TQScrollBar::Horizontal ); mScroll->setSteps(1,20); mScroll->setRange(0, 180 ); gl->addWidget( mScroll, 1, 1 ); - connect(mScroll,SIGNAL(valueChanged(int)),this,SLOT(slotChanged())); + connect(mScroll,TQT_SIGNAL(valueChanged(int)),this,TQT_SLOT(slotChanged())); - mLCD = new QLCDNumber( this ); + mLCD = new TQLCDNumber( this ); Q_CHECK_PTR(mLCD); mLCD->setNumDigits( 3 ); - mLCD->setSegmentStyle(QLCDNumber::Filled); - connect(mScroll,SIGNAL(valueChanged(int)),mLCD,SLOT(display(int))); + mLCD->setSegmentStyle(TQLCDNumber::Filled); + connect(mScroll,TQT_SIGNAL(valueChanged(int)),mLCD,TQT_SLOT(display(int))); gl->addMultiCellWidget( mLCD, 0, 1, 0, 0 ); text = i18n("Update frequency [seconds]. The value 0 disables update" ); - QLabel *label = new QLabel( text, this ); + TQLabel *label = new TQLabel( text, this ); Q_CHECK_PTR(label); gl->addWidget( label, 0, 1 ); - label = new QLabel( i18n("File manager (e.g. konsole -e mc %m):") ,this); + label = new TQLabel( i18n("File manager (e.g. konsole -e mc %m):") ,this); Q_CHECK_PTR(label); topLayout->addWidget( label ); - mFileManagerEdit = new QLineEdit( this ); + mFileManagerEdit = new TQLineEdit( this ); Q_CHECK_PTR(mFileManagerEdit); topLayout->addWidget( mFileManagerEdit ); - connect(mFileManagerEdit,SIGNAL(textChanged (const QString &)),this,SLOT(slotChanged())); + connect(mFileManagerEdit,TQT_SIGNAL(textChanged (const TQString &)),this,TQT_SLOT(slotChanged())); text = i18n("Open file manager automatically on mount"); - mOpenMountCheck = new QCheckBox(text, this ); + mOpenMountCheck = new TQCheckBox(text, this ); Q_CHECK_PTR(mOpenMountCheck); topLayout->addWidget( mOpenMountCheck ); - connect(mOpenMountCheck,SIGNAL(toggled(bool)),this,SLOT(slotChanged())); + connect(mOpenMountCheck,TQT_SIGNAL(toggled(bool)),this,TQT_SLOT(slotChanged())); text = i18n("Pop up a window when a disk gets critically full"); - mPopupFullCheck = new QCheckBox( text, this ); + mPopupFullCheck = new TQCheckBox( text, this ); Q_CHECK_PTR(mPopupFullCheck); topLayout->addWidget( mPopupFullCheck ); - connect(mPopupFullCheck,SIGNAL(toggled(bool)),this,SLOT(slotChanged())); + connect(mPopupFullCheck,TQT_SIGNAL(toggled(bool)),this,TQT_SLOT(slotChanged())); } loadSettings(); @@ -153,7 +153,7 @@ KDFConfigWidget::~KDFConfigWidget() } -void KDFConfigWidget::closeEvent(QCloseEvent *) +void KDFConfigWidget::closeEvent(TQCloseEvent *) { applySettings(); kapp->quit(); @@ -176,7 +176,7 @@ void KDFConfigWidget::applySettings( void ) mStd.setOpenFileManager( mOpenMountCheck->isChecked() ); mStd.writeConfiguration(); - QListViewItem *item = mList->firstChild(); + TQListViewItem *item = mList->firstChild(); if( item != 0 ) { for( int i=mList->header()->count(); i>0; i-- ) @@ -208,7 +208,7 @@ void KDFConfigWidget::loadSettings( void ) mOpenMountCheck->setChecked( mStd.openFileManager() ); mFileManagerEdit->setText( mStd.fileManager() ); - QListViewItem *item = mList->firstChild(); + TQListViewItem *item = mList->firstChild(); if( item != 0 ) { for( int i=mList->header()->count(); i>0; i-- ) @@ -232,7 +232,7 @@ void KDFConfigWidget::defaultsBtnClicked( void ) mOpenMountCheck->setChecked( mStd.openFileManager() ); mFileManagerEdit->setText( mStd.fileManager() ); - QListViewItem *item = mList->firstChild(); + TQListViewItem *item = mList->firstChild(); if( item != 0 ) { for( int i=mList->header()->count(); i>0; i-- ) @@ -245,11 +245,11 @@ void KDFConfigWidget::defaultsBtnClicked( void ) } -void KDFConfigWidget::toggleListText( QListViewItem *item, const QPoint &, +void KDFConfigWidget::toggleListText( TQListViewItem *item, const TQPoint &, int column ) { if (!item) return; - QString text = item->text( column ); + TQString text = item->text( column ); item->setText(column, text==i18n("visible")?i18n("hidden"):i18n("visible")); item->setPixmap( column, text==i18n("visible") ? UserIcon ( "delete" ) : UserIcon ( "tick" ) ); diff --git a/kdf/kdfconfig.h b/kdf/kdfconfig.h index 34aa7d4..7cc82c5 100644 --- a/kdf/kdfconfig.h +++ b/kdf/kdfconfig.h @@ -25,8 +25,8 @@ #ifndef __KDFCONFIG_H__ #define __KDFCONFIG_H__ -#include <qmemarray.h> -#include <qstring.h> +#include <tqmemarray.h> +#include <tqstring.h> #include "stdoption.h" @@ -46,7 +46,7 @@ class KDFConfigWidget : public QWidget class CTabName { public: - CTabName( const QString &res, const QString &name ) + CTabName( const TQString &res, const TQString &name ) { mRes = res; mName = name; @@ -54,12 +54,12 @@ class KDFConfigWidget : public QWidget CTabName( void ) { } ~CTabName( void ) { } - QString mRes; - QString mName; + TQString mRes; + TQString mName; }; public: - KDFConfigWidget( QWidget *parent=0, const char *name=0, bool init=false); + KDFConfigWidget( TQWidget *parent=0, const char *name=0, bool init=false); ~KDFConfigWidget(); public slots: @@ -71,19 +71,19 @@ class KDFConfigWidget : public QWidget void slotChanged(); private slots: - void toggleListText( QListViewItem *item, const QPoint &, int column ); + void toggleListText( TQListViewItem *item, const TQPoint &, int column ); protected: - void closeEvent( QCloseEvent * ); + void closeEvent( TQCloseEvent * ); private: - QMemArray<CTabName*> mTabName; + TQMemArray<CTabName*> mTabName; CListView *mList; - QScrollBar *mScroll; - QLCDNumber *mLCD; - QLineEdit *mFileManagerEdit; - QCheckBox *mOpenMountCheck; - QCheckBox *mPopupFullCheck; + TQScrollBar *mScroll; + TQLCDNumber *mLCD; + TQLineEdit *mFileManagerEdit; + TQCheckBox *mOpenMountCheck; + TQCheckBox *mPopupFullCheck; CStdOption mStd; signals: diff --git a/kdf/kdfwidget.cpp b/kdf/kdfwidget.cpp index ea7aee9..00f1968 100644 --- a/kdf/kdfwidget.cpp +++ b/kdf/kdfwidget.cpp @@ -23,17 +23,17 @@ // // 1999-11-29 Espen Sand -// Converted to QLayout and QListView + cleanups +// Converted to TQLayout and TQListView + cleanups // 1999-12-05 Espen Sand // Usage bars should work again. // #include <stdlib.h> -#include <qheader.h> -#include <qtimer.h> -#include <qlayout.h> -#include <qpainter.h> +#include <tqheader.h> +#include <tqtimer.h> +#include <tqlayout.h> +#include <tqpainter.h> #include <kapplication.h> #include <kcmenumngr.h> @@ -56,13 +56,13 @@ static bool GUI; /**************************************************************/ -CListViewItem::CListViewItem( CListView * parent, QListViewItem * after ) - :QListViewItem( parent, after ) +CListViewItem::CListViewItem( CListView * parent, TQListViewItem * after ) + :TQListViewItem( parent, after ) {} -int CListViewItem::compare ( QListViewItem *i, int column, bool ) const +int CListViewItem::compare ( TQListViewItem *i, int column, bool ) const { - QString tmp; + TQString tmp; CListViewItem *c = static_cast<CListViewItem*>(i); @@ -92,13 +92,13 @@ void CListViewItem::setKeys (int kb_size, int kb_avail, float percent_full) /**************************************************************/ -KDFWidget::KDFWidget( QWidget *parent, const char *name, bool init ) - : QWidget(parent, name), mOptionDialog(0), mPopup(0), mTimer(0) +KDFWidget::KDFWidget( TQWidget *parent, const char *name, bool init ) + : TQWidget(parent, name), mOptionDialog(0), mPopup(0), mTimer(0) { - connect(&mDiskList , SIGNAL(readDFDone() ), - this, SLOT (updateDFDone()) ); - connect(&mDiskList , SIGNAL(criticallyFull(DiskEntry*)), - this, SLOT (criticallyFull(DiskEntry*)) ); + connect(&mDiskList , TQT_SIGNAL(readDFDone() ), + this, TQT_SLOT (updateDFDone()) ); + connect(&mDiskList , TQT_SIGNAL(criticallyFull(DiskEntry*)), + this, TQT_SLOT (criticallyFull(DiskEntry*)) ); mTabProp.resize(8); mTabProp[0] = new CTabEntry( "Icon", i18n("Icon"), true, 32); @@ -114,24 +114,24 @@ KDFWidget::KDFWidget( QWidget *parent, const char *name, bool init ) GUI = !init; if( GUI ) { - QVBoxLayout *topLayout = new QVBoxLayout( this, 0, 0 ); + TQVBoxLayout *topLayout = new TQVBoxLayout( this, 0, 0 ); mList = new CListView( this, "list" ); topLayout->addWidget( mList ); mList->setAllColumnsShowFocus( true ); - mList->setFrameStyle( QFrame::WinPanel + QFrame::Sunken ); + mList->setFrameStyle( TQFrame::WinPanel + TQFrame::Sunken ); mList->setShowSortIndicator(true); connect( mList, - SIGNAL( rightButtonPressed( QListViewItem *, const QPoint &, int )), - this, SLOT( rightButtonPressed( QListViewItem *, const QPoint &, int ))); + TQT_SIGNAL( rightButtonPressed( TQListViewItem *, const TQPoint &, int )), + this, TQT_SLOT( rightButtonPressed( TQListViewItem *, const TQPoint &, int ))); connect( mList, - SIGNAL( rightButtonClicked( QListViewItem *, const QPoint &, int )), - this, SLOT( rightButtonClicked( QListViewItem *, const QPoint &, int ))); - connect( mList->header(), SIGNAL(sizeChange(int, int, int)), - this, SLOT(columnSizeChanged(int, int, int)) ); + TQT_SIGNAL( rightButtonClicked( TQListViewItem *, const TQPoint &, int )), + this, TQT_SLOT( rightButtonClicked( TQListViewItem *, const TQPoint &, int ))); + connect( mList->header(), TQT_SIGNAL(sizeChange(int, int, int)), + this, TQT_SLOT(columnSizeChanged(int, int, int)) ); makeColumns(); - mIsTopLevel = QString(parent->className()) == "KDFTopLevel" ? true : false; + mIsTopLevel = TQString(parent->className()) == "KDFTopLevel" ? true : false; } loadSettings(); @@ -183,7 +183,7 @@ void KDFWidget::makeColumns( void ) /******************************************************************/ -void KDFWidget::closeEvent(QCloseEvent *) +void KDFWidget::closeEvent(TQCloseEvent *) { applySettings(); kapp->quit(); @@ -266,8 +266,8 @@ void KDFWidget::settingsBtnClicked( void ) { mOptionDialog = new COptionDialog( this, "options", false ); if( mOptionDialog == 0 ) { return; } - connect( mOptionDialog, SIGNAL(valueChanged()), - this, SLOT(settingsChanged()) ); + connect( mOptionDialog, TQT_SIGNAL(valueChanged()), + this, TQT_SLOT(settingsChanged()) ); } mOptionDialog->show(); } @@ -293,7 +293,7 @@ void KDFWidget::setUpdateFrequency( int frequency ) /*************************************************************************** * Update (reread) all disk-dependencies **/ -void KDFWidget::timerEvent(QTimerEvent *) +void KDFWidget::timerEvent(TQTimerEvent *) { updateDF(); } @@ -329,7 +329,7 @@ void KDFWidget::updateDFDone( void ){ for( DiskEntry *disk=mDiskList.first(); disk!=0; disk=mDiskList.next() ) { i++; - QString size, percent; + TQString size, percent; if( disk->kBSize() > 0 ) { percent = KGlobal::locale()->formatNumber(disk->percentFull(), 1) + '%'; @@ -362,7 +362,7 @@ void KDFWidget::updateDFDone( void ){ /*************************************************************************** * Update display **/ -void KDFWidget::resizeEvent( QResizeEvent * ) +void KDFWidget::resizeEvent( TQResizeEvent * ) { updateDiskBarPixmaps(); } @@ -376,7 +376,7 @@ void KDFWidget::criticallyFull( DiskEntry *disk ) { if( mStd.popupIfFull() == true ) { - QString msg = i18n("Device [%1] on [%2] is getting critically full!"). + TQString msg = i18n("Device [%1] on [%2] is getting critically full!"). arg(disk->deviceName()).arg(disk->mountPoint()); KMessageBox::sorry( this, msg, i18n("Warning")); } @@ -386,7 +386,7 @@ void KDFWidget::criticallyFull( DiskEntry *disk ) /************************************************************************** * find correct disk related to list item **/ -DiskEntry *KDFWidget::selectedDisk( QListViewItem *item ) +DiskEntry *KDFWidget::selectedDisk( TQListViewItem *item ) { if( item == 0 ) { @@ -426,7 +426,7 @@ DiskEntry *KDFWidget::selectedDisk( QListViewItem *item ) // return(0); } -void KDFWidget::rightButtonPressed( QListViewItem *item, const QPoint &p, int ) +void KDFWidget::rightButtonPressed( TQListViewItem *item, const TQPoint &p, int ) { if( KContextMenuManager::showOnButtonPress() == true ) { @@ -435,7 +435,7 @@ void KDFWidget::rightButtonPressed( QListViewItem *item, const QPoint &p, int ) } -void KDFWidget::rightButtonClicked( QListViewItem *item, const QPoint &p, int ) +void KDFWidget::rightButtonClicked( TQListViewItem *item, const TQPoint &p, int ) { if( KContextMenuManager::showOnButtonPress() == false ) { @@ -447,7 +447,7 @@ void KDFWidget::rightButtonClicked( QListViewItem *item, const QPoint &p, int ) /************************************************************************** * pops up and asks for mount/umount right-clicked device **/ -void KDFWidget::popupMenu( QListViewItem *item, const QPoint &p ) +void KDFWidget::popupMenu( TQListViewItem *item, const TQPoint &p ) { if (mPopup) //The user may even be able to popup another menu while this open is active... return; @@ -514,7 +514,7 @@ void KDFWidget::popupMenu( QListViewItem *item, const QPoint &p ) kdDebug() << "opening filemanager" << endl; if( mStd.fileManager().isEmpty() == false ) { - QString cmd = mStd.fileManager(); + TQString cmd = mStd.fileManager(); int pos = cmd.find("%m"); if( pos > 0 ) { @@ -524,7 +524,7 @@ void KDFWidget::popupMenu( QListViewItem *item, const QPoint &p ) { cmd += " " + KProcess::quote(disk->mountPoint()) +" &"; } - system( QFile::encodeName(cmd) ); + system( TQFile::encodeName(cmd) ); } } @@ -567,7 +567,7 @@ void KDFWidget::updateDiskBarPixmaps( void ) } int i=0; - for(QListViewItem *it=mList->firstChild(); it!=0;it=it->nextSibling(),i++ ) + for(TQListViewItem *it=mList->firstChild(); it!=0;it=it->nextSibling(),i++ ) { // I can't get find() to work. The Disks::compareItems(..) is // never called. @@ -601,14 +601,14 @@ void KDFWidget::updateDiskBarPixmaps( void ) int w = mList->columnWidth(usageCol)-2; if( w <= 0 ) { continue; } - QPixmap *pix = new QPixmap( w, h ); + TQPixmap *pix = new TQPixmap( w, h ); if( pix == 0 ) { continue; } pix->fill(white); - QPainter p(pix); + TQPainter p(pix); p.setPen(black); p.drawRect(0,0,w,h); - QColor c; + TQColor c; if ( (disk->iconName().find("cdrom") != -1) || (disk->iconName().find("writer") != -1) ) c = gray; @@ -631,8 +631,8 @@ void KDFWidget::columnSizeChanged( int, int, int ) if( mTimer == 0 ) { - mTimer = new QTimer( this ); - connect( mTimer, SIGNAL(timeout()), this, SLOT(updateDiskBarPixmaps()) ); + mTimer = new TQTimer( this ); + connect( mTimer, TQT_SIGNAL(timeout()), this, TQT_SLOT(updateDiskBarPixmaps()) ); } else if( mTimer->isActive() == true ) { diff --git a/kdf/kdfwidget.h b/kdf/kdfwidget.h index 13e14ed..2882408 100644 --- a/kdf/kdfwidget.h +++ b/kdf/kdfwidget.h @@ -25,10 +25,10 @@ #ifndef __KDFWIDGET_H__ #define __KDFWIDGET_H__ -#include <qmemarray.h> -#include <qglobal.h> -#include <qstring.h> -#include <qlistview.h> +#include <tqmemarray.h> +#include <tqglobal.h> +#include <tqstring.h> +#include <tqlistview.h> #include "disks.h" #include "disklist.h" @@ -46,7 +46,7 @@ class KPopupMenu; class CTabEntry { public: - CTabEntry( const QString &res, const QString &name, bool visible, + CTabEntry( const TQString &res, const TQString &name, bool visible, uint width ) { mRes = res; @@ -58,8 +58,8 @@ class CTabEntry ~CTabEntry( void ) { } - QString mRes; - QString mName; + TQString mRes; + TQString mName; bool mVisible; uint mWidth; }; @@ -75,9 +75,9 @@ class CTabEntry class CListViewItem : public QListViewItem { public: - CListViewItem ( CListView * parent, QListViewItem * after ); + CListViewItem ( CListView * parent, TQListViewItem * after ); - virtual int compare ( QListViewItem* i, int col, bool) const; + virtual int compare ( TQListViewItem* i, int col, bool) const; void setKeys ( int kb_size, int kb_avail, float percent_full ) ; @@ -107,7 +107,7 @@ class KDFWidget : public QWidget }; public: - KDFWidget( QWidget *parent=0, const char *name=0, bool init=false); + KDFWidget( TQWidget *parent=0, const char *name=0, bool init=false); ~KDFWidget( void ); public slots: @@ -120,30 +120,30 @@ class KDFWidget : public QWidget private slots: void criticallyFull( DiskEntry *disk ); - void rightButtonPressed( QListViewItem *item, const QPoint &p, int ); - void rightButtonClicked( QListViewItem *item, const QPoint &p, int ); - void popupMenu( QListViewItem *item, const QPoint &p ); + void rightButtonPressed( TQListViewItem *item, const TQPoint &p, int ); + void rightButtonClicked( TQListViewItem *item, const TQPoint &p, int ); + void popupMenu( TQListViewItem *item, const TQPoint &p ); void setUpdateFrequency( int frequency ); void columnSizeChanged( int column, int, int newSize ); void updateDiskBarPixmaps( void ); void invokeHelp( void ); protected: - void timerEvent( QTimerEvent * ); - void closeEvent( QCloseEvent * ); - void resizeEvent( QResizeEvent * ); + void timerEvent( TQTimerEvent * ); + void closeEvent( TQCloseEvent * ); + void resizeEvent( TQResizeEvent * ); private: void makeColumns( void ); - DiskEntry *selectedDisk( QListViewItem *item=0 ); + DiskEntry *selectedDisk( TQListViewItem *item=0 ); private: bool readingDF; - QMemArray<CTabEntry*> mTabProp; + TQMemArray<CTabEntry*> mTabProp; CListView *mList; COptionDialog *mOptionDialog; KPopupMenu *mPopup; - QTimer *mTimer; + TQTimer *mTimer; DiskList mDiskList; bool mIsTopLevel; CStdOption mStd; diff --git a/kdf/kwikdisk.cpp b/kdf/kwikdisk.cpp index d287b16..5ca97f5 100644 --- a/kdf/kwikdisk.cpp +++ b/kdf/kwikdisk.cpp @@ -31,9 +31,9 @@ #include <stdlib.h> -#include <qpen.h> -#include <qbitmap.h> -#include <qpainter.h> +#include <tqpen.h> +#include <tqbitmap.h> +#include <tqpainter.h> #include <kmainwindow.h> #include <klocale.h> @@ -69,11 +69,11 @@ KwikDisk::KwikDisk() setPixmap(KSystemTray::loadIcon("kdf")); show(); - connect( &m_diskList, SIGNAL(readDFDone()), this, SLOT(updateDFDone()) ); - connect( &m_diskList, SIGNAL(criticallyFull(DiskEntry*)), - this, SLOT(criticallyFull(DiskEntry*)) ); + connect( &m_diskList, TQT_SIGNAL(readDFDone()), this, TQT_SLOT(updateDFDone()) ); + connect( &m_diskList, TQT_SIGNAL(criticallyFull(DiskEntry*)), + this, TQT_SLOT(criticallyFull(DiskEntry*)) ); - connect( contextMenu(), SIGNAL(aboutToHide()), this, SLOT(aboutToHide()) ); + connect( contextMenu(), TQT_SIGNAL(aboutToHide()), this, TQT_SLOT(aboutToHide()) ); loadSettings(); updateDF(); @@ -86,19 +86,19 @@ void KwikDisk::aboutToHide() m_menuVisible = FALSE; } -void KwikDisk::enterEvent(QEvent *) +void KwikDisk::enterEvent(TQEvent *) { kdDebug() << k_funcinfo << endl; m_inside = TRUE; } -void KwikDisk::leaveEvent(QEvent *) +void KwikDisk::leaveEvent(TQEvent *) { kdDebug() << k_funcinfo << endl; m_inside = FALSE; } -void KwikDisk::mousePressEvent(QMouseEvent *me) +void KwikDisk::mousePressEvent(TQMouseEvent *me) { kdDebug() << k_funcinfo << endl; @@ -146,7 +146,7 @@ void KwikDisk::setUpdateFrequency(int frequency) * popup menu is about to become visible. Note: A current visible popup * will not be updated now. */ -void KwikDisk::timerEvent(QTimerEvent *) +void KwikDisk::timerEvent(TQTimerEvent *) { kdDebug() << k_funcinfo << endl; m_dirty = TRUE; @@ -175,20 +175,20 @@ void KwikDisk::updateDFDone() for( DiskEntry *disk = m_diskList.first(); disk != 0; disk = m_diskList.next() ) { // FIXME: tool tips are unused atm - QString toolTipText = i18n("%1 (%2) %3 on %4") + TQString toolTipText = i18n("%1 (%2) %3 on %4") .arg( disk->mounted() ? i18n("Unmount") : i18n("Mount")) .arg(disk->fsType()).arg(disk->deviceName()).arg(disk->mountPoint()); - QString entryName = disk->mountPoint(); + TQString entryName = disk->mountPoint(); if( disk->mounted() ) { - entryName += QString("\t\t\t[%1]").arg(disk->prettyKBAvail()); + entryName += TQString("\t\t\t[%1]").arg(disk->prettyKBAvail()); } - int id = contextMenu()->insertItem("", this, SLOT(toggleMount(int)) ); + int id = contextMenu()->insertItem("", this, TQT_SLOT(toggleMount(int)) ); contextMenu()->setItemParameter(id, itemNo); itemNo++; - QPixmap *pix = new QPixmap(KSystemTray::loadIcon(disk->iconName())); + TQPixmap *pix = new TQPixmap(KSystemTray::loadIcon(disk->iconName())); if( getuid() !=0 && disk->mountOptions().find("user",0, false) == -1 ) { @@ -197,25 +197,25 @@ void KwikDisk::updateDFDone() // // 2000-01-23 Espen Sand // Careful here: If the mask has not been defined we can - // not use QPixmap::mask() because it returns 0 => segfault + // not use TQPixmap::mask() because it returns 0 => segfault // if( pix->mask() != 0 ) { - QBitmap *bm = new QBitmap(*(pix->mask())); + TQBitmap *bm = new TQBitmap(*(pix->mask())); if( bm != 0 ) { - QPainter qp( bm ); - qp.setPen(QPen(white,1)); + TQPainter qp( bm ); + qp.setPen(TQPen(white,1)); qp.drawRect(0,0,bm->width(),bm->height()); qp.end(); pix->setMask(*bm); } - QPainter qp( pix ); - qp.setPen(QPen(red,1)); + TQPainter qp( pix ); + qp.setPen(TQPen(red,1)); qp.drawRect(0,0,pix->width(),pix->height()); qp.end(); } - contextMenu()->disconnectItem(id,disk,SLOT(toggleMount())); + contextMenu()->disconnectItem(id,disk,TQT_SLOT(toggleMount())); toolTipText = i18n("You must login as root to mount this disk"); } @@ -226,21 +226,21 @@ void KwikDisk::updateDFDone() contextMenu()->insertItem( KSystemTray::loadIcon("kdf"), - i18n("&Start KDiskFree"), this, SLOT(startKDF()),0); + i18n("&Start KDiskFree"), this, TQT_SLOT(startKDF()),0); contextMenu()->insertItem( KSystemTray::loadIcon("configure"), - i18n("&Configure KwikDisk..."), this, SLOT(changeSettings()),0); + i18n("&Configure KwikDisk..."), this, TQT_SLOT(changeSettings()),0); contextMenu()->insertItem( KSystemTray::loadIcon("help"), - KStdGuiItem::help().text(), this, SLOT(invokeHelp()),0); + KStdGuiItem::help().text(), this, TQT_SLOT(invokeHelp()),0); contextMenu()->insertSeparator(); contextMenu()->insertItem( KSystemTray::loadIcon("exit"), - KStdGuiItem::quit().text(), this, SIGNAL(quitSelected()) ); + KStdGuiItem::quit().text(), this, TQT_SIGNAL(quitSelected()) ); } void KwikDisk::toggleMount(int item) @@ -263,7 +263,7 @@ void KwikDisk::toggleMount(int item) kdDebug() << "opening filemanager" << endl; if( m_options.fileManager().isEmpty() == false ) { - QString cmd = m_options.fileManager(); + TQString cmd = m_options.fileManager(); int pos = cmd.find("%m"); if( pos > 0 ) { @@ -273,7 +273,7 @@ void KwikDisk::toggleMount(int item) { cmd += " " + KProcess::quote(disk->mountPoint()) +" &"; } - system( QFile::encodeName(cmd) ); + system( TQFile::encodeName(cmd) ); } } m_dirty = TRUE; @@ -285,7 +285,7 @@ void KwikDisk::criticallyFull(DiskEntry *disk) if( m_options.popupIfFull() == true ) { - QString msg = i18n("Device [%1] on [%2] is getting critically full!") + TQString msg = i18n("Device [%1] on [%2] is getting critically full!") .arg(disk->deviceName()).arg(disk->mountPoint()); KMessageBox::sorry( this, msg, i18n("Warning")); } @@ -297,8 +297,8 @@ void KwikDisk::changeSettings() { m_optionDialog = new COptionDialog(this, "options", FALSE); if( !m_optionDialog ) return; - connect(m_optionDialog, SIGNAL(valueChanged()), - this, SLOT(loadSettings())); + connect(m_optionDialog, TQT_SIGNAL(valueChanged()), + this, TQT_SLOT(loadSettings())); } m_optionDialog->show(); } @@ -335,7 +335,7 @@ int main(int argc, char **argv) KwikDisk *mainWin = 0; mainWin = new KwikDisk; - QObject::connect(mainWin, SIGNAL(quitSelected()), &app, SLOT(quit())); + TQObject::connect(mainWin, TQT_SIGNAL(quitSelected()), &app, TQT_SLOT(quit())); // mainWin has WDestructiveClose flag by default, so it will delete itself. return app.exec(); diff --git a/kdf/kwikdisk.h b/kdf/kwikdisk.h index 09066cc..c404e84 100644 --- a/kdf/kwikdisk.h +++ b/kdf/kwikdisk.h @@ -56,10 +56,10 @@ class KwikDisk : public KSystemTray void aboutToHide(); private: - void mousePressEvent(QMouseEvent *); - void timerEvent(QTimerEvent *); - void enterEvent(QEvent *); - void leaveEvent(QEvent *); + void mousePressEvent(TQMouseEvent *); + void timerEvent(TQTimerEvent *); + void enterEvent(TQEvent *); + void leaveEvent(TQEvent *); void setUpdateFrequency(int frequency); diff --git a/kdf/listview.cpp b/kdf/listview.cpp index b522a22..0334101 100644 --- a/kdf/listview.cpp +++ b/kdf/listview.cpp @@ -24,17 +24,17 @@ // 2) Provide a pixmap collection // -#include <qbitmap.h> -#include <qheader.h> -#include <qpainter.h> +#include <tqbitmap.h> +#include <tqheader.h> +#include <tqpainter.h> #include <kiconloader.h> #include "listview.h" -template class QDict<QPixmap>; +template class TQDict<TQPixmap>; -CListView::CListView( QWidget *parent, const char *name, int visibleItem ) +CListView::CListView( TQWidget *parent, const char *name, int visibleItem ) :KListView( parent, name ), mVisibleItem(QMAX( 1, visibleItem )) { setVisibleItem(visibleItem); @@ -46,15 +46,15 @@ void CListView::setVisibleItem( int visibleItem, bool updateSize ) mVisibleItem = QMAX( 1, visibleItem ); if( updateSize == true ) { - QSize s = sizeHint(); + TQSize s = sizeHint(); setMinimumSize( s.width() + verticalScrollBar()->sizeHint().width() + lineWidth() * 2, s.height() ); } } -QSize CListView::sizeHint( void ) const +TQSize CListView::sizeHint( void ) const { - QSize s = QListView::sizeHint(); + TQSize s = TQListView::sizeHint(); int h = fontMetrics().height() + 2*itemMargin(); if( h % 2 > 0 ) { h++; } @@ -65,34 +65,34 @@ QSize CListView::sizeHint( void ) const -const QPixmap &CListView::icon( const QString &iconName, bool drawBorder ) +const TQPixmap &CListView::icon( const TQString &iconName, bool drawBorder ) { - QPixmap *pix = mPixDict[ iconName ]; + TQPixmap *pix = mPixDict[ iconName ]; if( pix == 0 ) { - pix = new QPixmap( SmallIcon( iconName ) ); + pix = new TQPixmap( SmallIcon( iconName ) ); if( drawBorder == true ) { // // 2000-01-23 Espen Sand // Careful here: If the mask has not been defined we can - // not use QPixmap::mask() because it returns 0 => segfault + // not use TQPixmap::mask() because it returns 0 => segfault // if( pix->mask() != 0 ) { - QBitmap *bm = new QBitmap(*(pix->mask())); + TQBitmap *bm = new TQBitmap(*(pix->mask())); if( bm != 0 ) { - QPainter qp(bm); - qp.setPen(QPen(white,1)); + TQPainter qp(bm); + qp.setPen(TQPen(white,1)); qp.drawRect(0,0,bm->width(),bm->height()); qp.end(); pix->setMask(*bm); } - QPainter qp(pix); - qp.setPen(QPen(red,1)); + TQPainter qp(pix); + qp.setPen(TQPen(red,1)); qp.drawRect(0,0,pix->width(),pix->height()); qp.end(); delete bm; diff --git a/kdf/listview.h b/kdf/listview.h index 0bb4bc5..d051fdf 100644 --- a/kdf/listview.h +++ b/kdf/listview.h @@ -20,8 +20,8 @@ #ifndef _LISTVIEW_H_ #define _LISTVIEW_H_ -#include <qdict.h> -#include <qpixmap.h> +#include <tqdict.h> +#include <tqpixmap.h> #include <klistview.h> @@ -30,15 +30,15 @@ class CListView : public KListView Q_OBJECT public: - CListView( QWidget *parent=0, const char *name=0, int visibleItem=10 ); + CListView( TQWidget *parent=0, const char *name=0, int visibleItem=10 ); void setVisibleItem( int visibleItem, bool updateSize=true ); - virtual QSize sizeHint( void ) const; - const QPixmap &icon( const QString &iconName, bool drawBorder ); + virtual TQSize sizeHint( void ) const; + const TQPixmap &icon( const TQString &iconName, bool drawBorder ); private: int mVisibleItem; - QDict<QPixmap> mPixDict; + TQDict<TQPixmap> mPixDict; }; diff --git a/kdf/mntconfig.cpp b/kdf/mntconfig.cpp index c1c1bbe..0186cc4 100644 --- a/kdf/mntconfig.cpp +++ b/kdf/mntconfig.cpp @@ -24,13 +24,13 @@ // // 1999-11-29 Espen Sand -// Converted to QLayout and QListView + cleanups +// Converted to TQLayout and TQListView + cleanups // -#include <qgroupbox.h> -#include <qheader.h> -#include <qlayout.h> -#include <qlineedit.h> +#include <tqgroupbox.h> +#include <tqheader.h> +#include <tqlayout.h> +#include <tqlineedit.h> #undef Unsorted @@ -47,8 +47,8 @@ static bool GUI; #endif -MntConfigWidget::MntConfigWidget(QWidget *parent, const char *name, bool init) - : QWidget(parent, name) +MntConfigWidget::MntConfigWidget(TQWidget *parent, const char *name, bool init) + : TQWidget(parent, name) { mInitializing = false; @@ -59,10 +59,10 @@ MntConfigWidget::MntConfigWidget(QWidget *parent, const char *name, bool init) mDiskList.readFSTAB(); mDiskList.readDF(); mInitializing = true; - connect( &mDiskList,SIGNAL(readDFDone()),this,SLOT(readDFDone())); + connect( &mDiskList,TQT_SIGNAL(readDFDone()),this,TQT_SLOT(readDFDone())); - QString text; - QVBoxLayout *topLayout = new QVBoxLayout( this, 0, KDialog::spacingHint()); + TQString text; + TQVBoxLayout *topLayout = new TQVBoxLayout( this, 0, KDialog::spacingHint()); mList = new CListView( this, "list", 8 ); mList->setAllColumnsShowFocus( true ); @@ -71,69 +71,69 @@ MntConfigWidget::MntConfigWidget(QWidget *parent, const char *name, bool init) mList->addColumn( i18n("Mount Point") ); mList->addColumn( i18n("Mount Command") ); mList->addColumn( i18n("Unmount Command") ); - mList->setFrameStyle( QFrame::WinPanel + QFrame::Sunken ); - connect( mList, SIGNAL(selectionChanged(QListViewItem *)), - this, SLOT(clicked(QListViewItem *))); + mList->setFrameStyle( TQFrame::WinPanel + TQFrame::Sunken ); + connect( mList, TQT_SIGNAL(selectionChanged(TQListViewItem *)), + this, TQT_SLOT(clicked(TQListViewItem *))); topLayout->addWidget( mList ); - text = QString("%1: %2 %3: %4"). + text = TQString("%1: %2 %3: %4"). arg(mList->header()->label(DEVCOL)). arg(i18n("None")). arg(mList->header()->label(MNTPNTCOL)). arg(i18n("None")); - mGroupBox = new QGroupBox( text, this ); + mGroupBox = new TQGroupBox( text, this ); Q_CHECK_PTR(mGroupBox); topLayout->addWidget(mGroupBox); - QGridLayout *gl = new QGridLayout(mGroupBox, 3, 4, KDialog::spacingHint()); + TQGridLayout *gl = new TQGridLayout(mGroupBox, 3, 4, KDialog::spacingHint()); if( gl == 0 ) { return; } gl->addRowSpacing( 0, fontMetrics().lineSpacing() ); - mIconLineEdit = new QLineEdit(mGroupBox); + mIconLineEdit = new TQLineEdit(mGroupBox); Q_CHECK_PTR(mIconLineEdit); mIconLineEdit->setMinimumWidth( fontMetrics().maxWidth()*10 ); - connect( mIconLineEdit, SIGNAL(textChanged(const QString&)), - this,SLOT(iconChanged(const QString&))); - connect( mIconLineEdit, SIGNAL(textChanged(const QString&)), - this,SLOT(slotChanged())); + connect( mIconLineEdit, TQT_SIGNAL(textChanged(const TQString&)), + this,TQT_SLOT(iconChanged(const TQString&))); + connect( mIconLineEdit, TQT_SIGNAL(textChanged(const TQString&)), + this,TQT_SLOT(slotChanged())); gl->addWidget( mIconLineEdit, 2, 0 ); mIconButton = new KIconButton(mGroupBox); mIconButton->setIconType(KIcon::Small, KIcon::Device); Q_CHECK_PTR(mIconButton); mIconButton->setFixedWidth( mIconButton->sizeHint().height() ); - connect(mIconButton,SIGNAL(iconChanged(QString)),this,SLOT(iconChangedButton(QString))); + connect(mIconButton,TQT_SIGNAL(iconChanged(TQString)),this,TQT_SLOT(iconChangedButton(TQString))); gl->addWidget( mIconButton, 2, 1 ); //Mount - mMountButton = new QPushButton( i18n("Get Mount Command"), mGroupBox ); + mMountButton = new TQPushButton( i18n("Get Mount Command"), mGroupBox ); Q_CHECK_PTR(mMountButton); - connect(mMountButton,SIGNAL(clicked()),this,SLOT(selectMntFile())); + connect(mMountButton,TQT_SIGNAL(clicked()),this,TQT_SLOT(selectMntFile())); gl->addWidget( mMountButton, 1, 2 ); - mMountLineEdit = new QLineEdit(mGroupBox); + mMountLineEdit = new TQLineEdit(mGroupBox); Q_CHECK_PTR(mMountLineEdit); mMountLineEdit->setMinimumWidth( fontMetrics().maxWidth()*10 ); - connect(mMountLineEdit,SIGNAL(textChanged(const QString&)), - this,SLOT(mntCmdChanged(const QString&))); - connect( mMountLineEdit, SIGNAL(textChanged(const QString&)), - this,SLOT(slotChanged())); + connect(mMountLineEdit,TQT_SIGNAL(textChanged(const TQString&)), + this,TQT_SLOT(mntCmdChanged(const TQString&))); + connect( mMountLineEdit, TQT_SIGNAL(textChanged(const TQString&)), + this,TQT_SLOT(slotChanged())); gl->addWidget( mMountLineEdit, 1, 3 ); //Umount - mUmountButton = new QPushButton(i18n("Get Unmount Command"), mGroupBox ); + mUmountButton = new TQPushButton(i18n("Get Unmount Command"), mGroupBox ); Q_CHECK_PTR( mUmountButton ); - connect(mUmountButton,SIGNAL(clicked()),this,SLOT(selectUmntFile())); + connect(mUmountButton,TQT_SIGNAL(clicked()),this,TQT_SLOT(selectUmntFile())); gl->addWidget( mUmountButton, 2, 2 ); - mUmountLineEdit=new QLineEdit(mGroupBox); + mUmountLineEdit=new TQLineEdit(mGroupBox); Q_CHECK_PTR(mUmountLineEdit); mUmountLineEdit->setMinimumWidth( fontMetrics().maxWidth()*10 ); - connect(mUmountLineEdit,SIGNAL(textChanged(const QString&)), - this,SLOT(umntCmdChanged(const QString&))); - connect( mUmountLineEdit, SIGNAL(textChanged(const QString&)), - this,SLOT(slotChanged())); + connect(mUmountLineEdit,TQT_SIGNAL(textChanged(const TQString&)), + this,TQT_SLOT(umntCmdChanged(const TQString&))); + connect( mUmountLineEdit, TQT_SIGNAL(textChanged(const TQString&)), + this,TQT_SLOT(slotChanged())); gl->addWidget( mUmountLineEdit, 2, 3 ); } @@ -161,10 +161,10 @@ void MntConfigWidget::readDFDone( void ) mDiskLookup.resize(mDiskList.count()); int i=0; - QListViewItem *item = 0; + TQListViewItem *item = 0; for( DiskEntry *disk=mDiskList.first(); disk!=0; disk=mDiskList.next(),++i ) { - item = new QListViewItem( mList, item, QString::null, disk->deviceName(), + item = new TQListViewItem( mList, item, TQString::null, disk->deviceName(), disk->mountPoint(), disk->mountCommand(), disk->umountCommand() ); item->setPixmap( ICONCOL, SmallIcon( disk->iconName() ) ); mDiskLookup[i] = item; @@ -203,7 +203,7 @@ void MntConfigWidget::loadSettings( void ) resize(w,h); } - QListViewItem *item = mList->selectedItem(); + TQListViewItem *item = mList->selectedItem(); if( item != 0 ) { clicked( item ); @@ -212,17 +212,17 @@ void MntConfigWidget::loadSettings( void ) } -void MntConfigWidget::clicked( QListViewItem *item ) +void MntConfigWidget::clicked( TQListViewItem *item ) { mGroupBox->setEnabled( true ); - mGroupBox->setTitle( QString("%1: %2 %3: %4"). + mGroupBox->setTitle( TQString("%1: %2 %3: %4"). arg(mList->header()->label(DEVCOL)). arg(item->text(DEVCOL)). arg(mList->header()->label(MNTPNTCOL)). arg(item->text(MNTPNTCOL)) ); - const QPixmap *pix = item->pixmap(ICONCOL); + const TQPixmap *pix = item->pixmap(ICONCOL); if( pix != 0 ) { mIconButton->setPixmap( *pix ); @@ -245,17 +245,17 @@ void MntConfigWidget::clicked( QListViewItem *item ) } -void MntConfigWidget::iconChangedButton(QString iconName) +void MntConfigWidget::iconChangedButton(TQString iconName) { iconChanged(iconName); } -void MntConfigWidget::iconChanged(const QString &iconName) +void MntConfigWidget::iconChanged(const TQString &iconName) { if( iconName.findRev('_') == 0 || (iconName.right(iconName.length()-iconName.findRev('_'))!="_mount" && iconName.right(iconName.length()-iconName.findRev('_'))!="_unmount")) { - QString msg = i18n("" + TQString msg = i18n("" "This filename is not valid: %1\n" "It must end with " "\"_mount\" or \"_unmount\".").arg(iconName); @@ -263,7 +263,7 @@ void MntConfigWidget::iconChanged(const QString &iconName) return; } - QListViewItem *item = mList->selectedItem(); + TQListViewItem *item = mList->selectedItem(); for(unsigned i=0 ; i < mDiskList.count() ; ++i) { if (mDiskLookup[i] == item) @@ -314,9 +314,9 @@ void MntConfigWidget::selectUmntFile() mUmountLineEdit->setText( url.path() ); } -void MntConfigWidget::mntCmdChanged( const QString &data ) +void MntConfigWidget::mntCmdChanged( const TQString &data ) { - QListViewItem *item = mList->selectedItem(); + TQListViewItem *item = mList->selectedItem(); for(unsigned i=0 ; i < mDiskList.count() ; ++i) { if (mDiskLookup[i] == item) @@ -333,9 +333,9 @@ void MntConfigWidget::mntCmdChanged( const QString &data ) } -void MntConfigWidget::umntCmdChanged( const QString &data ) +void MntConfigWidget::umntCmdChanged( const TQString &data ) { - QListViewItem *item = mList->selectedItem(); + TQListViewItem *item = mList->selectedItem(); for(unsigned i=0 ; i < mDiskList.count() ; ++i) { if (mDiskLookup[i] == item) @@ -352,7 +352,7 @@ void MntConfigWidget::umntCmdChanged( const QString &data ) } -void MntConfigWidget::closeEvent(QCloseEvent *) +void MntConfigWidget::closeEvent(TQCloseEvent *) { } diff --git a/kdf/mntconfig.h b/kdf/mntconfig.h index d24c8b1..757d196 100644 --- a/kdf/mntconfig.h +++ b/kdf/mntconfig.h @@ -58,7 +58,7 @@ class MntConfigWidget : public QWidget }; public: - MntConfigWidget( QWidget *parent=0, const char *name=0, bool init=false ); + MntConfigWidget( TQWidget *parent=0, const char *name=0, bool init=false ); ~MntConfigWidget(); public slots: @@ -70,29 +70,29 @@ class MntConfigWidget : public QWidget private slots: void readDFDone( void ); - void clicked( QListViewItem *item ); + void clicked( TQListViewItem *item ); void selectMntFile( void ); void selectUmntFile( void ); - void iconChangedButton(QString); - void iconChanged( const QString & ); - void mntCmdChanged( const QString & ); - void umntCmdChanged( const QString & ); + void iconChangedButton(TQString); + void iconChanged( const TQString & ); + void mntCmdChanged( const TQString & ); + void umntCmdChanged( const TQString & ); protected: - void closeEvent( QCloseEvent * ); + void closeEvent( TQCloseEvent * ); private: CListView *mList; - QGroupBox *mGroupBox; - QLineEdit *mIconLineEdit; - QLineEdit *mMountLineEdit; - QLineEdit *mUmountLineEdit; - QPushButton *mMountButton; - QPushButton *mUmountButton; + TQGroupBox *mGroupBox; + TQLineEdit *mIconLineEdit; + TQLineEdit *mMountLineEdit; + TQLineEdit *mUmountLineEdit; + TQPushButton *mMountButton; + TQPushButton *mUmountButton; KIconButton *mIconButton; DiskList mDiskList; bool mInitializing; - QMemArray<QListViewItem*> mDiskLookup; + TQMemArray<TQListViewItem*> mDiskLookup; signals: void configChanged(); diff --git a/kdf/optiondialog.cpp b/kdf/optiondialog.cpp index 05c5570..8da8dc2 100644 --- a/kdf/optiondialog.cpp +++ b/kdf/optiondialog.cpp @@ -17,29 +17,29 @@ * */ -#include <qlayout.h> +#include <tqlayout.h> #include "kdfconfig.h" #include "mntconfig.h" #include "optiondialog.h" -COptionDialog::COptionDialog( QWidget *parent, const char *name, bool modal ) +COptionDialog::COptionDialog( TQWidget *parent, const char *name, bool modal ) :KDialogBase( Tabbed, i18n("Configure"), Help|Apply|Ok|Cancel, Ok, parent, name, modal ) { - setHelp( "kcontrol/kdf/index.html", QString::null ); + setHelp( "kcontrol/kdf/index.html", TQString::null ); - QFrame *f1 = addPage( i18n("General Settings") ); - QVBoxLayout *l1 = new QVBoxLayout( f1 ); + TQFrame *f1 = addPage( i18n("General Settings") ); + TQVBoxLayout *l1 = new TQVBoxLayout( f1 ); mConf = new KDFConfigWidget( f1, "kdfconf" ); l1->addWidget(mConf); - connect( mConf, SIGNAL( configChanged() ), this, SLOT( slotChanged() ) ); + connect( mConf, TQT_SIGNAL( configChanged() ), this, TQT_SLOT( slotChanged() ) ); - QFrame *f2 = addPage( i18n("Mount Commands") ); - QVBoxLayout *l2 = new QVBoxLayout( f2 ); + TQFrame *f2 = addPage( i18n("Mount Commands") ); + TQVBoxLayout *l2 = new TQVBoxLayout( f2 ); mMnt = new MntConfigWidget( f2, "mntconf"); l2->addWidget(mMnt); - connect( mMnt, SIGNAL( configChanged() ), this, SLOT( slotChanged() ) ); + connect( mMnt, TQT_SIGNAL( configChanged() ), this, TQT_SLOT( slotChanged() ) ); enableButton( Apply, false ); dataChanged = false; } diff --git a/kdf/optiondialog.h b/kdf/optiondialog.h index d1a7a5c..6a4bb74 100644 --- a/kdf/optiondialog.h +++ b/kdf/optiondialog.h @@ -30,7 +30,7 @@ class COptionDialog : public KDialogBase Q_OBJECT public: - COptionDialog( QWidget *parent=0, const char *name=0, bool modal=true ); + COptionDialog( TQWidget *parent=0, const char *name=0, bool modal=true ); ~COptionDialog( void ); protected slots: diff --git a/kdf/stdoption.cpp b/kdf/stdoption.cpp index 16a9e07..04b75f5 100644 --- a/kdf/stdoption.cpp +++ b/kdf/stdoption.cpp @@ -31,7 +31,7 @@ #include "stdoption.h" -QString CStdOption::mDefaultFileManager = "kfmclient openURL %m"; +TQString CStdOption::mDefaultFileManager = "kfmclient openURL %m"; int CStdOption::mDefaultUpdateFrequency = 60; CStdOption::CStdOption( void ) @@ -82,7 +82,7 @@ void CStdOption::writeDefaultFileManager( void ) -QString CStdOption::fileManager( void ) +TQString CStdOption::fileManager( void ) { return( mFileManager ); } @@ -115,7 +115,7 @@ void CStdOption::setDefault( void ) } -void CStdOption::setFileManager( const QString &fileManager ) +void CStdOption::setFileManager( const TQString &fileManager ) { mFileManager = fileManager; } diff --git a/kdf/stdoption.h b/kdf/stdoption.h index 282a16b..9ebd09d 100644 --- a/kdf/stdoption.h +++ b/kdf/stdoption.h @@ -27,7 +27,7 @@ #ifndef _STD_OPTION_H_ #define _STD_OPTION_H_ -#include <qstring.h> +#include <tqstring.h> class CStdOption { @@ -39,22 +39,22 @@ class CStdOption void writeConfiguration( void ); void writeDefaultFileManager( void ); - QString fileManager( void ); + TQString fileManager( void ); int updateFrequency( void ); bool popupIfFull( void ); bool openFileManager( void ); void setDefault( void ); - void setFileManager( const QString &fileManager ); + void setFileManager( const TQString &fileManager ); void setUpdateFrequency( int frequency ); void setPopupIfFull( bool popupIfFull ); void setOpenFileManager( bool openFileManagerOnMount ); private: - static QString mDefaultFileManager; + static TQString mDefaultFileManager; static int mDefaultUpdateFrequency; - QString mFileManager; + TQString mFileManager; int mUpdateFrequency; bool mPopupIfFull; bool mOpenFileManagerOnMount; diff --git a/kedit/kedit.cpp b/kedit/kedit.cpp index a255cd9..239f92b 100644 --- a/kedit/kedit.cpp +++ b/kedit/kedit.cpp @@ -25,10 +25,10 @@ #include <stdlib.h> #include <unistd.h> -#include <qlayout.h> -#include <qtimer.h> -#include <qpaintdevicemetrics.h> -#include <qpainter.h> +#include <tqlayout.h> +#include <tqtimer.h> +#include <tqpaintdevicemetrics.h> +#include <tqpainter.h> #include <kaboutdata.h> #include <kaction.h> @@ -56,25 +56,25 @@ #include <kdebug.h> -QPtrList<TopLevel> *TopLevel::windowList = 0; +TQPtrList<TopLevel> *TopLevel::windowList = 0; int default_open = TopLevel::OPEN_READWRITE; -TopLevel::TopLevel (QWidget *, const char *name) +TopLevel::TopLevel (TQWidget *, const char *name) : KMainWindow ( 0,name ), kspellconfigOptions(0), eframe(0), newWindow(false), kspell(0) { if (!windowList) { - windowList = new QPtrList<TopLevel>; + windowList = new TQPtrList<TopLevel>; windowList->setAutoDelete( FALSE ); } windowList->append( this ); - statusbar_timer = new QTimer(this); - connect(statusbar_timer, SIGNAL(timeout()),this,SLOT(timer_slot())); + statusbar_timer = new TQTimer(this); + connect(statusbar_timer, TQT_SIGNAL(timeout()),this,TQT_SLOT(timer_slot())); - connect(kapp,SIGNAL(kdisplayPaletteChanged()),this,SLOT(set_colors())); + connect(kapp,TQT_SIGNAL(kdisplayPaletteChanged()),this,TQT_SLOT(set_colors())); setupStatusBar(); setupActions(); @@ -84,7 +84,7 @@ TopLevel::TopLevel (QWidget *, const char *name) setupEditWidget(); if (!initialGeometrySet()) - resize( QSize(550, 400).expandedTo(minimumSizeHint())); + resize( TQSize(550, 400).expandedTo(minimumSizeHint())); setupGUI(ToolBar | Keys | StatusBar | Create); setAutoSaveSettings(); @@ -107,24 +107,24 @@ void TopLevel::setupEditWidget() eframe = new KEdit (this, "eframe"); eframe->setOverwriteEnabled(true); - connect(eframe, SIGNAL(CursorPositionChanged()),this, - SLOT(statusbar_slot())); - connect(eframe, SIGNAL(toggle_overwrite_signal()),this, - SLOT(toggle_overwrite())); - connect(eframe, SIGNAL(gotUrlDrop(QDropEvent*)), this, - SLOT(urlDrop_slot(QDropEvent*))); - connect(eframe, SIGNAL(undoAvailable(bool)),undoAction, - SLOT(setEnabled(bool))); - connect(eframe, SIGNAL(redoAvailable(bool)),redoAction, - SLOT(setEnabled(bool))); - connect(eframe, SIGNAL(copyAvailable(bool)),cutAction, - SLOT(setEnabled(bool))); - connect(eframe, SIGNAL(copyAvailable(bool)),copyAction, - SLOT(setEnabled(bool))); - connect( eframe, SIGNAL(selectionChanged()),this, - SLOT(slotSelectionChanged())); - connect( eframe, SIGNAL(modificationChanged( bool)), - SLOT(setFileCaption())); + connect(eframe, TQT_SIGNAL(CursorPositionChanged()),this, + TQT_SLOT(statusbar_slot())); + connect(eframe, TQT_SIGNAL(toggle_overwrite_signal()),this, + TQT_SLOT(toggle_overwrite())); + connect(eframe, TQT_SIGNAL(gotUrlDrop(TQDropEvent*)), this, + TQT_SLOT(urlDrop_slot(TQDropEvent*))); + connect(eframe, TQT_SIGNAL(undoAvailable(bool)),undoAction, + TQT_SLOT(setEnabled(bool))); + connect(eframe, TQT_SIGNAL(redoAvailable(bool)),redoAction, + TQT_SLOT(setEnabled(bool))); + connect(eframe, TQT_SIGNAL(copyAvailable(bool)),cutAction, + TQT_SLOT(setEnabled(bool))); + connect(eframe, TQT_SIGNAL(copyAvailable(bool)),copyAction, + TQT_SLOT(setEnabled(bool))); + connect( eframe, TQT_SIGNAL(selectionChanged()),this, + TQT_SLOT(slotSelectionChanged())); + connect( eframe, TQT_SIGNAL(modificationChanged( bool)), + TQT_SLOT(setFileCaption())); undoAction->setEnabled(false); redoAction->setEnabled(false); @@ -137,16 +137,16 @@ void TopLevel::setupEditWidget() if( Prefs::wrapMode() == Prefs::EnumWrapMode::FixedColumnWrap ) { - eframe->setWordWrap(QMultiLineEdit::FixedColumnWidth); + eframe->setWordWrap(TQMultiLineEdit::FixedColumnWidth); eframe->setWrapColumnOrWidth(Prefs::wrapColumn()); } else if( Prefs::wrapMode() == Prefs::EnumWrapMode::SoftWrap ) { - eframe->setWordWrap(QMultiLineEdit::WidgetWidth); + eframe->setWordWrap(TQMultiLineEdit::WidgetWidth); } else { - eframe->setWordWrap(QMultiLineEdit::NoWrap); + eframe->setWordWrap(TQMultiLineEdit::NoWrap); } eframe->setFont( Prefs::font() ); @@ -165,20 +165,20 @@ void TopLevel::setupEditWidget() right_mouse_button = new QPopupMenu; right_mouse_button->insertItem (i18n("Open..."), - this, SLOT(file_open())); + this, TQT_SLOT(file_open())); right_mouse_button->insertItem (SmallIcon("filesave"),i18n("Save"), - this, SLOT(file_save())); + this, TQT_SLOT(file_save())); right_mouse_button->insertItem (SmallIcon("filesaveas"),i18n("Save As..."), - this, SLOT(file_save_as())); + this, TQT_SLOT(file_save_as())); right_mouse_button->insertSeparator(-1); right_mouse_button->insertItem(i18n("Copy"), - this, SLOT(copy())); + this, TQT_SLOT(copy())); right_mouse_button->insertItem(i18n("Paste"), - this, SLOT(paste())); + this, TQT_SLOT(paste())); right_mouse_button->insertItem(i18n("Cut"), - this, SLOT(cut())); + this, TQT_SLOT(cut())); right_mouse_button->insertItem(i18n("Select All"), - this, SLOT(select_all())); + this, TQT_SLOT(select_all())); eframe->installRBPopup(right_mouse_button); */ } @@ -195,42 +195,42 @@ void TopLevel::slotSelectionChanged() void TopLevel::setupActions() { // setup File menu - KStdAction::openNew(this, SLOT(file_new()), actionCollection()); - KStdAction::open(this, SLOT(file_open()), actionCollection()); - recent = KStdAction::openRecent(this, SLOT(openRecent(const KURL&)), + KStdAction::openNew(this, TQT_SLOT(file_new()), actionCollection()); + KStdAction::open(this, TQT_SLOT(file_open()), actionCollection()); + recent = KStdAction::openRecent(this, TQT_SLOT(openRecent(const KURL&)), actionCollection()); - KStdAction::save(this, SLOT(file_save()), actionCollection()); - KStdAction::saveAs(this, SLOT(file_save_as()), actionCollection()); - KStdAction::close(this, SLOT(file_close()), actionCollection()); - KStdAction::print(this, SLOT(print()), actionCollection()); - KStdAction::mail(this, SLOT(mail()), actionCollection()); - KStdAction::quit(this, SLOT(close()), actionCollection()); + KStdAction::save(this, TQT_SLOT(file_save()), actionCollection()); + KStdAction::saveAs(this, TQT_SLOT(file_save_as()), actionCollection()); + KStdAction::close(this, TQT_SLOT(file_close()), actionCollection()); + KStdAction::print(this, TQT_SLOT(print()), actionCollection()); + KStdAction::mail(this, TQT_SLOT(mail()), actionCollection()); + KStdAction::quit(this, TQT_SLOT(close()), actionCollection()); // setup edit menu - undoAction = KStdAction::undo(this, SLOT(undo()), actionCollection()); - redoAction = KStdAction::redo(this, SLOT(redo()), actionCollection()); - cutAction = KStdAction::cut(this, SLOT(cut()), actionCollection()); - copyAction = KStdAction::copy(this, SLOT(copy()), actionCollection()); - KStdAction::pasteText(this, SLOT(paste()), actionCollection()); - KStdAction::selectAll(this, SLOT(select_all()), actionCollection()); - KStdAction::find(this, SLOT(search()), actionCollection()); - KStdAction::findNext(this, SLOT(search_again()), actionCollection()); - KStdAction::replace(this, SLOT(replace()), actionCollection()); - - (void)new KAction(i18n("&Insert File..."), 0, this, SLOT(file_insert()), + undoAction = KStdAction::undo(this, TQT_SLOT(undo()), actionCollection()); + redoAction = KStdAction::redo(this, TQT_SLOT(redo()), actionCollection()); + cutAction = KStdAction::cut(this, TQT_SLOT(cut()), actionCollection()); + copyAction = KStdAction::copy(this, TQT_SLOT(copy()), actionCollection()); + KStdAction::pasteText(this, TQT_SLOT(paste()), actionCollection()); + KStdAction::selectAll(this, TQT_SLOT(select_all()), actionCollection()); + KStdAction::find(this, TQT_SLOT(search()), actionCollection()); + KStdAction::findNext(this, TQT_SLOT(search_again()), actionCollection()); + KStdAction::replace(this, TQT_SLOT(replace()), actionCollection()); + + (void)new KAction(i18n("&Insert File..."), 0, this, TQT_SLOT(file_insert()), actionCollection(), "insert_file"); - (void)new KAction(i18n("In&sert Date"), 0, this, SLOT(insertDate()), + (void)new KAction(i18n("In&sert Date"), 0, this, TQT_SLOT(insertDate()), actionCollection(), "insert_date"); - (void)new KAction(i18n("Cl&ean Spaces"), 0, this, SLOT(clean_space()), + (void)new KAction(i18n("Cl&ean Spaces"), 0, this, TQT_SLOT(clean_space()), actionCollection(), "clean_spaces"); // setup Tools menu - KStdAction::spelling(this, SLOT(spellcheck()), actionCollection()); + KStdAction::spelling(this, TQT_SLOT(spellcheck()), actionCollection()); // setup Go menu - KStdAction::gotoLine(this, SLOT(gotoLine()), actionCollection()); + KStdAction::gotoLine(this, TQT_SLOT(gotoLine()), actionCollection()); - KStdAction::preferences(this, SLOT(showSettings()), actionCollection()); + KStdAction::preferences(this, TQT_SLOT(showSettings()), actionCollection()); } void TopLevel::setupStatusBar() @@ -263,10 +263,10 @@ void TopLevel::saveProperties(KConfig* config) if(eframe->isModified()) { - QString name = m_url.url(); + TQString name = m_url.url(); if (name.isEmpty()) - name = QString("kedit%1-%2").arg(getpid()).arg((long)this); - QString tmplocation = kapp->tempSaveName(m_url.url()); + name = TQString("kedit%1-%2").arg(getpid()).arg((long)this); + TQString tmplocation = kapp->tempSaveName(m_url.url()); config->writeEntry("saved_to",tmplocation); saveFile(tmplocation, false, m_url.fileEncoding()); } @@ -275,9 +275,9 @@ void TopLevel::saveProperties(KConfig* config) void TopLevel::readProperties(KConfig* config){ KURL url = config->readPathEntry("url"); - QString filename = config->readPathEntry("saved_to"); + TQString filename = config->readPathEntry("saved_to"); - QString encoding = url.fileEncoding(); + TQString encoding = url.fileEncoding(); int modified = config->readNumEntry("modified",0); int line = config->readNumEntry("current_line", 0); int col = config->readNumEntry("current_column", 0); @@ -340,8 +340,8 @@ void TopLevel::insertDate(){ int line, column; - QString string; - QDate dt = QDate::currentDate(); + TQString string; + TQDate dt = TQDate::currentDate(); string = KGlobal::locale()->formatDate(dt); eframe->getCursorPosition(&line,&column); @@ -391,19 +391,19 @@ void TopLevel::spellcheck() initSpellConfig(); kspell = new KSpell(this, i18n("Spellcheck"), this, - SLOT( spell_started(KSpell *)), kspellconfigOptions); + TQT_SLOT( spell_started(KSpell *)), kspellconfigOptions); - connect (kspell, SIGNAL ( death()), - this, SLOT ( spell_finished( ))); + connect (kspell, TQT_SIGNAL ( death()), + this, TQT_SLOT ( spell_finished( ))); - connect (kspell, SIGNAL (progress (unsigned int)), - this, SLOT (spell_progress (unsigned int))); - connect (kspell, SIGNAL (misspelling (const QString &, const QStringList &, unsigned int)), - eframe, SLOT (misspelling (const QString &, const QStringList &, unsigned int))); - connect (kspell, SIGNAL (corrected (const QString &, const QString &, unsigned int)), - eframe, SLOT (corrected (const QString &, const QString &, unsigned int))); - connect (kspell, SIGNAL (done(const QString&)), - this, SLOT (spell_done(const QString&))); + connect (kspell, TQT_SIGNAL (progress (unsigned int)), + this, TQT_SLOT (spell_progress (unsigned int))); + connect (kspell, TQT_SIGNAL (misspelling (const TQString &, const TQStringList &, unsigned int)), + eframe, TQT_SLOT (misspelling (const TQString &, const TQStringList &, unsigned int))); + connect (kspell, TQT_SIGNAL (corrected (const TQString &, const TQString &, unsigned int)), + eframe, TQT_SLOT (corrected (const TQString &, const TQString &, unsigned int))); + connect (kspell, TQT_SIGNAL (done(const TQString&)), + this, TQT_SLOT (spell_done(const TQString&))); } @@ -417,14 +417,14 @@ void TopLevel::spell_started( KSpell *) void TopLevel::spell_progress (unsigned int percent) { - QString s; + TQString s; s = i18n("Spellcheck: %1% complete").arg(percent); statusBar()->changeItem (s, ID_GENERAL); } -void TopLevel::spell_done(const QString& newtext) +void TopLevel::spell_done(const TQString& newtext) { eframe->spellcheck_stop(); if (kspell->dlgResult() == 0) @@ -441,7 +441,7 @@ void TopLevel::spell_done(const QString& newtext) // Replace ISpell with the name of the actual spell checker. // TODO: Use %1 in the original string instead when string freeze is over. -QString TopLevel::replaceISpell(QString msg, int client) +TQString TopLevel::replaceISpell(TQString msg, int client) { switch(client) { @@ -479,7 +479,7 @@ void TopLevel::file_open( void ) while( 1 ) { KURL url = KTextFileDialog::getOpenURLwithEncoding( - QString::null, QString::null, this, + TQString::null, TQString::null, this, i18n("Open File")); if( url.isEmpty() ) { @@ -514,7 +514,7 @@ void TopLevel::file_open( void ) toplevel = this; } - QString tmpfile; + TQString tmpfile; KIO::NetAccess::download( url, tmpfile, toplevel ); int result = toplevel->openFile( tmpfile, 0, url.fileEncoding()); @@ -549,14 +549,14 @@ void TopLevel::file_insert() while( 1 ) { KURL url = KTextFileDialog::getOpenURLwithEncoding( - QString::null, QString::null, this, + TQString::null, TQString::null, this, i18n("Insert File"), "", KStdGuiItem::insert().text()); if( url.isEmpty() ) { return; } - QString tmpfile; + TQString tmpfile; KIO::NetAccess::download( url, tmpfile, this ); int result = openFile( tmpfile, OPEN_INSERT, url.fileEncoding(), true ); KIO::NetAccess::removeTempFile( tmpfile ); @@ -594,10 +594,10 @@ bool TopLevel::queryClose() if ( !eframe->isModified() ) return true; - QString msg = i18n("" + TQString msg = i18n("" "This document has been modified.\n" "Would you like to save it?" ); - switch( KMessageBox::warningYesNoCancel( this, msg, QString::null, + switch( KMessageBox::warningYesNoCancel( this, msg, TQString::null, KStdGuiItem::save(), KStdGuiItem::discard() ) ) { case KMessageBox::Yes: // Save, then exit @@ -618,7 +618,7 @@ bool TopLevel::queryClose() msg = i18n("" "Could not save the file.\n" "Exit anyways?"); - switch( KMessageBox::warningContinueCancel( this, msg, QString::null, KStdGuiItem::quit() ) ) + switch( KMessageBox::warningContinueCancel( this, msg, TQString::null, KStdGuiItem::quit() ) ) { case KMessageBox::Continue: return true; // Exit. @@ -658,9 +658,9 @@ void TopLevel::file_close() { if( eframe->isModified() ) { - QString msg = i18n("This document has been modified.\n" + TQString msg = i18n("This document has been modified.\n" "Would you like to save it?" ); - switch( KMessageBox::warningYesNoCancel( this, msg, QString::null, + switch( KMessageBox::warningYesNoCancel( this, msg, TQString::null, KStdGuiItem::save(), KStdGuiItem::discard() ) ) { case KMessageBox::Yes: // Save, then close @@ -698,14 +698,14 @@ void TopLevel::file_save() result = saveURL(m_url); // error messages are handled by saveFile if ( result == KEDIT_OK ){ - QString string; + TQString string; string = i18n("Wrote: %1").arg(m_caption); setGeneralStatusField(string); } } -void TopLevel::setGeneralStatusField(const QString &text){ +void TopLevel::setGeneralStatusField(const TQString &text){ statusbar_timer->stop(); @@ -721,7 +721,7 @@ void TopLevel::file_save_as() while(true) { u = KTextFileDialog::getSaveURLwithEncoding( - m_url.url(), QString::null, this, + m_url.url(), TQString::null, this, i18n("Save File As"), m_url.fileEncoding()); @@ -748,7 +748,7 @@ void TopLevel::file_save_as() { m_url = u; setFileCaption(); - QString string = i18n("Saved as: %1").arg(m_caption); + TQString string = i18n("Saved as: %1").arg(m_caption); setGeneralStatusField(string); recent->addURL( u ); } @@ -761,34 +761,34 @@ void TopLevel::mail() // // Default subject string // - QString defaultsubject = name(); + TQString defaultsubject = name(); int index = defaultsubject.findRev('/'); if( index != -1) defaultsubject = defaultsubject.right(defaultsubject.length() - index - 1 ); - kapp->invokeMailer( QString::null, QString::null, QString::null, + kapp->invokeMailer( TQString::null, TQString::null, TQString::null, defaultsubject, eframe->text() ); } /* void TopLevel::fancyprint(){ - QPrinter prt; + TQPrinter prt; char buf[200]; if ( prt.setup(0) ) { int y =10; - QPainter p; + TQPainter p; p.begin( &prt ); p.setFont( eframe->font() ); - QFontMetrics fm = p.fontMetrics(); + TQFontMetrics fm = p.fontMetrics(); int numlines = eframe->numLines(); for(int i = 0; i< numlines; i++){ y += fm.ascent(); - QString line; + TQString line; line = eframe->textLine(i); - line.replace( QRegExp("\t"), " " ); + line.replace( TQRegExp("\t"), " " ); strncpy(buf,line.local8Bit(),160); for (int j = 0 ; j <150; j++){ if (!isprint(buf[j])) @@ -833,7 +833,7 @@ void TopLevel::showSettings() initSpellConfig(); KConfigDialog* dialog = new SettingsDialog(this, "settings", Prefs::self(), kspellconfigOptions); - connect(dialog, SIGNAL(settingsChanged()), this, SLOT(updateSettings())); + connect(dialog, TQT_SIGNAL(settingsChanged()), this, TQT_SLOT(updateSettings())); dialog->show(); } @@ -859,7 +859,7 @@ void TopLevel::setFileCaption() { if (m_url.isLocalFile()) { - if (QDir::currentDirPath() == m_url.directory()) + if (TQDir::currentDirPath() == m_url.directory()) m_caption = m_url.fileName(); else m_caption = m_url.path(); @@ -867,12 +867,12 @@ void TopLevel::setFileCaption() else { KURL url(m_url); - url.setQuery(QString::null); + url.setQuery(TQString::null); m_caption = url.prettyURL(); } - QString encoding = m_url.fileEncoding(); + TQString encoding = m_url.fileEncoding(); if (!encoding.isEmpty()) - m_caption += QString(" (%1)").arg(encoding); + m_caption += TQString(" (%1)").arg(encoding); } setCaption(m_caption, eframe->isModified()); } @@ -884,7 +884,7 @@ void TopLevel::gotoLine() { void TopLevel::statusbar_slot(){ - QString linenumber; + TQString linenumber; linenumber = i18n("Line: %1 Col: %2") .arg(eframe->currentLine() + 1) @@ -896,16 +896,16 @@ void TopLevel::statusbar_slot(){ void TopLevel::print() { bool aborted = false; - QString headerLeft = i18n("Date: %1").arg(KGlobal::locale()->formatDate(QDate::currentDate(),true)); - QString headerMid = i18n("File: %1").arg(m_caption); - QString headerRight; + TQString headerLeft = i18n("Date: %1").arg(KGlobal::locale()->formatDate(TQDate::currentDate(),true)); + TQString headerMid = i18n("File: %1").arg(m_caption); + TQString headerRight; - QFont printFont = eframe->font(); - QFont headerFont(printFont); + TQFont printFont = eframe->font(); + TQFont headerFont(printFont); headerFont.setBold(true); - QFontMetrics printFontMetrics(printFont); - QFontMetrics headerFontMetrics(headerFont); + TQFontMetrics printFontMetrics(printFont); + TQFontMetrics headerFontMetrics(headerFont); KPrinter *printer = new KPrinter; if(printer->setup(this, i18n("Print %1").arg(m_caption))) { @@ -915,10 +915,10 @@ void TopLevel::print() if ( !m_caption.isEmpty() ) printer->setDocName(m_caption); - QPainter *p = new QPainter; + TQPainter *p = new QPainter; p->begin( printer ); - QPaintDeviceMetrics metrics( printer ); + TQPaintDeviceMetrics metrics( printer ); int dy = 0; @@ -932,15 +932,15 @@ void TopLevel::print() while(true) { - headerRight = QString("#%1").arg(page); + headerRight = TQString("#%1").arg(page); dy = headerFontMetrics.lineSpacing(); - QRect body( 0, dy*2, metrics.width(), metrics.height()-dy*2); + TQRect body( 0, dy*2, metrics.width(), metrics.height()-dy*2); p->drawText(0, 0, metrics.width(), dy, Qt::AlignLeft, headerLeft); p->drawText(0, 0, metrics.width(), dy, Qt::AlignHCenter, headerMid); p->drawText(0, 0, metrics.width(), dy, Qt::AlignRight, headerRight); - QPen pen; + TQPen pen; pen.setWidth(3); p->setPen(pen); @@ -948,18 +948,18 @@ void TopLevel::print() int y = dy*2; while(lineCount < maxLineCount) { - QString text = eframe->textLine(lineCount); + TQString text = eframe->textLine(lineCount); if( text.isEmpty() ) text = " "; // don't ignore empty lines - QRect r = p->boundingRect(0, y, body.width(), body.height(), - QPainter::ExpandTabs | QPainter::WordBreak, text); + TQRect r = p->boundingRect(0, y, body.width(), body.height(), + TQPainter::ExpandTabs | TQPainter::WordBreak, text); dy = r.height(); if (y+dy > metrics.height()) break; p->drawText(0, y, metrics.width(), metrics.height() - y, - QPainter::ExpandTabs | QPainter::WordBreak, text); + TQPainter::ExpandTabs | TQPainter::WordBreak, text); y += dy; lineCount++; @@ -1017,9 +1017,9 @@ int TopLevel::saveURL( const KURL& _url ) } -int TopLevel::openFile( const QString& _filename, int _mode, const QString &encoding, bool _undoAction ) +int TopLevel::openFile( const TQString& _filename, int _mode, const TQString &encoding, bool _undoAction ) { - QFileInfo info(_filename); + TQFileInfo info(_filename); if(info.isDir()) { @@ -1035,7 +1035,7 @@ int TopLevel::openFile( const QString& _filename, int _mode, const QString &enco return KEDIT_RETRY; } - QFile file(_filename); + TQFile file(_filename); if(!file.open(IO_ReadOnly)) { @@ -1043,12 +1043,12 @@ int TopLevel::openFile( const QString& _filename, int _mode, const QString &enco return KEDIT_RETRY; } - QTextStream stream(&file); - QTextCodec *codec; + TQTextStream stream(&file); + TQTextCodec *codec; if (!encoding.isEmpty()) - codec = QTextCodec::codecForName(encoding.latin1()); + codec = TQTextCodec::codecForName(encoding.latin1()); else - codec = QTextCodec::codecForLocale(); + codec = TQTextCodec::codecForLocale(); stream.setCodec(codec); if ((_mode & OPEN_INSERT) == 0) @@ -1069,9 +1069,9 @@ int TopLevel::openFile( const QString& _filename, int _mode, const QString &enco } -int TopLevel::saveFile( const QString& _filename, bool backup, const QString& encoding ) +int TopLevel::saveFile( const TQString& _filename, bool backup, const TQString& encoding ) { - QFileInfo info(_filename); + TQFileInfo info(_filename); bool bSoftWrap = (Prefs::wrapMode() == Prefs::EnumWrapMode::SoftWrap); if(info.isDir()) @@ -1080,7 +1080,7 @@ int TopLevel::saveFile( const QString& _filename, bool backup, const QString& en return KEDIT_RETRY; } - if (backup && Prefs::backupCopies() && QFile::exists(_filename)) + if (backup && Prefs::backupCopies() && TQFile::exists(_filename)) { if (!KSaveFile::backupFile(_filename)) { @@ -1092,19 +1092,19 @@ int TopLevel::saveFile( const QString& _filename, bool backup, const QString& en // links when saving. Most applications don't care about this, but an // editor is supposed to preserve such things. - QFile file(_filename); + TQFile file(_filename); if(!file.open(IO_WriteOnly)) { KMessageBox::sorry(this, i18n("Unable to write to file.")); return KEDIT_RETRY; } - QTextStream textStream(&file); - QTextCodec *codec; + TQTextStream textStream(&file); + TQTextCodec *codec; if (!encoding.isEmpty()) - codec = QTextCodec::codecForName(encoding.latin1()); + codec = TQTextCodec::codecForName(encoding.latin1()); else - codec = QTextCodec::codecForLocale(); + codec = TQTextCodec::codecForLocale(); textStream.setCodec(codec); eframe->saveText( &textStream, bSoftWrap ); @@ -1124,14 +1124,14 @@ void TopLevel::openURL( const KURL& _url, int _mode ) { if ( !_url.isValid() ) { - QString string; + TQString string; string = i18n( "Malformed URL\n%1").arg(_url.url()); KMessageBox::sorry(this, string); return; } - QString target; + TQString target; int result = KEDIT_OK; if (KIO::NetAccess::download(_url, target, this)) { @@ -1155,17 +1155,17 @@ void TopLevel::openURL( const KURL& _url, int _mode ) } } -void TopLevel::urlDrop_slot(QDropEvent* e) { +void TopLevel::urlDrop_slot(TQDropEvent* e) { dropEvent(e); } -void TopLevel::dragEnterEvent(QDragEnterEvent* e) +void TopLevel::dragEnterEvent(TQDragEnterEvent* e) { e->accept(KURLDrag::canDecode(e)); } -void TopLevel::dropEvent(QDropEvent* e) +void TopLevel::dropEvent(TQDropEvent* e) { KURL::List list; @@ -1204,19 +1204,19 @@ void TopLevel::timer_slot(){ void TopLevel::set_colors() { - QPalette mypalette = (eframe->palette()).copy(); + TQPalette mypalette = (eframe->palette()).copy(); - QColorGroup ncgrp( mypalette.active() ); + TQColorGroup ncgrp( mypalette.active() ); if (Prefs::customColor()) { - ncgrp.setColor(QColorGroup::Text, Prefs::textColor()); - ncgrp.setColor(QColorGroup::Base, Prefs::backgroundColor()); + ncgrp.setColor(TQColorGroup::Text, Prefs::textColor()); + ncgrp.setColor(TQColorGroup::Base, Prefs::backgroundColor()); } else { - ncgrp.setColor(QColorGroup::Text, KGlobalSettings::textColor()); - ncgrp.setColor(QColorGroup::Base, KGlobalSettings::baseColor()); + ncgrp.setColor(TQColorGroup::Text, KGlobalSettings::textColor()); + ncgrp.setColor(TQColorGroup::Base, KGlobalSettings::baseColor()); } mypalette.setActive(ncgrp); @@ -1288,9 +1288,9 @@ extern "C" KDE_EXPORT int kdemain (int argc, char **argv) have_top_window = false; KCmdLineArgs *args = KCmdLineArgs::parsedArgs(); - const QString encoding = args->getOption("encoding"); + const TQString encoding = args->getOption("encoding"); const bool doEncoding = args->isSet("encoding") && - QTextCodec::codecForName(encoding.latin1()); + TQTextCodec::codecForName(encoding.latin1()); for(int i = 0; i < args->count(); i++) { @@ -1317,14 +1317,14 @@ extern "C" KDE_EXPORT int kdemain (int argc, char **argv) return a.exec (); } -SettingsDialog::SettingsDialog(QWidget *parent, const char *name,KConfigSkeleton *config, KSpellConfig *_spellConfig) +SettingsDialog::SettingsDialog(TQWidget *parent, const char *name,KConfigSkeleton *config, KSpellConfig *_spellConfig) : KConfigDialog(parent, name, config), spellConfig(_spellConfig), spellConfigChanged(false) { // Font - QWidget *font = new QWidget(0, "FontSetting"); - QVBoxLayout *topLayout = new QVBoxLayout(font, 0, KDialog::spacingHint()); - KFontChooser *mFontChooser = new KFontChooser(font, "kcfg_Font", false, QStringList(), false, 6); + TQWidget *font = new TQWidget(0, "FontSetting"); + TQVBoxLayout *topLayout = new TQVBoxLayout(font, 0, KDialog::spacingHint()); + KFontChooser *mFontChooser = new KFontChooser(font, "kcfg_Font", false, TQStringList(), false, 6); topLayout->addWidget(mFontChooser); addPage(font, i18n("Font"), "fonts", i18n("Editor Font")); @@ -1335,7 +1335,7 @@ SettingsDialog::SettingsDialog(QWidget *parent, const char *name,KConfigSkeleton // Spelling addPage(spellConfig, i18n("Spelling"), "spellcheck", i18n("Spelling Checker")); - connect(spellConfig, SIGNAL(configChanged()), this, SLOT(slotSpellConfigChanged())); + connect(spellConfig, TQT_SIGNAL(configChanged()), this, TQT_SLOT(slotSpellConfigChanged())); // Miscellaneous Misc *miscOptions = new Misc(0, "MiscSettings"); diff --git a/kedit/kedit.h b/kedit/kedit.h index a39eb4d..fc986f7 100644 --- a/kedit/kedit.h +++ b/kedit/kedit.h @@ -24,8 +24,8 @@ #ifndef _KEDIT_H_ #define _KEDIT_H_ -#include <qtextcodec.h> -#include <qptrdict.h> +#include <tqtextcodec.h> +#include <tqptrdict.h> #include "version.h" @@ -61,7 +61,7 @@ public: OPEN_INSERT = 4, OPEN_NEW = 8 }; - TopLevel( QWidget *parent=0, const char *name=0 ); + TopLevel( TQWidget *parent=0, const char *name=0 ); ~TopLevel(); /** @@ -69,14 +69,14 @@ public: * * @return KEDIT_OK on success */ - int openFile( const QString& _filename, int _mode, const QString &encoding, bool _undoAction = false ); + int openFile( const TQString& _filename, int _mode, const TQString &encoding, bool _undoAction = false ); /** * Saves the edit widget to a file. * * @return KEDIT_OK on success */ - int saveFile( const QString& _filename, bool backup, const QString &encoding); + int saveFile( const TQString& _filename, bool backup, const TQString &encoding); /** * Works like openFile but is able to open remote files @@ -102,8 +102,8 @@ public: void setUrl(const KURL &url) { m_url = url; } /// List of all windows - static QPtrList<TopLevel> *windowList; - //QPopupMenu *right_mouse_button; + static TQPtrList<TopLevel> *windowList; + //TQPopupMenu *right_mouse_button; bool queryExit( void ); bool queryClose( void ); @@ -122,11 +122,11 @@ public: // Should not be! KEdit *eframe; private: KURL m_url; - QString m_caption; + TQString m_caption; bool newWindow; int statusID, toolID, indentID; - QTimer *statusbar_timer; + TQTimer *statusbar_timer; KRecentFilesAction *recent; KAction *cutAction; KAction *copyAction; @@ -143,9 +143,9 @@ private: * The source, the destination of the copy, and the open mode * for each job being run (job ptr is the dict key). */ - QPtrDict <QString> m_sNet; - QPtrDict <QString> m_sLocal; - QPtrDict <int> m_openMode; + TQPtrDict <TQString> m_sNet; + TQPtrDict <TQString> m_sLocal; + TQPtrDict <int> m_openMode; // Session management void saveProperties(KConfig*); @@ -155,7 +155,7 @@ public slots: void openRecent(const KURL&); void gotoLine(); void mail(); - void setGeneralStatusField(const QString &string); + void setGeneralStatusField(const TQString &string); void undo(); void redo(); void copy(); @@ -183,31 +183,31 @@ public slots: void spellcheck(); void spell_started ( KSpell *); void spell_progress (unsigned int percent); - void spell_done(const QString&); + void spell_done(const TQString&); void spell_finished(); - void urlDrop_slot(QDropEvent* e); + void urlDrop_slot(TQDropEvent* e); void set_colors(); protected: /// Drag and Drop - void dragEnterEvent(QDragEnterEvent* e); - void dropEvent(QDropEvent* e); + void dragEnterEvent(TQDragEnterEvent* e); + void dropEvent(TQDropEvent* e); private slots: void updateSettings(); void readSettings(); void showSettings(); void slotSelectionChanged(); - QString replaceISpell(QString msg, int client); + TQString replaceISpell(TQString msg, int client); }; class SettingsDialog: public KConfigDialog { Q_OBJECT public: - SettingsDialog(QWidget *parent, const char *name,KConfigSkeleton *config, KSpellConfig *_spellConfig); + SettingsDialog(TQWidget *parent, const char *name,KConfigSkeleton *config, KSpellConfig *_spellConfig); protected slots: void updateSettings(); diff --git a/kedit/ktextfiledlg.cpp b/kedit/ktextfiledlg.cpp index 1e1a322..794fff9 100644 --- a/kedit/ktextfiledlg.cpp +++ b/kedit/ktextfiledlg.cpp @@ -18,8 +18,8 @@ Boston, MA 02110-1301, USA. */ -#include <qlabel.h> -#include <qvbox.h> +#include <tqlabel.h> +#include <tqvbox.h> #include <klocale.h> #include <kcharsets.h> @@ -30,9 +30,9 @@ #include "ktextfiledlg.h" -KTextFileDialog::KTextFileDialog(const QString& startDir, - const QString& filter, - QWidget *parent, const char* name, +KTextFileDialog::KTextFileDialog(const TQString& startDir, + const TQString& filter, + TQWidget *parent, const char* name, bool modal) : KFileDialog(startDir, filter, parent, name, modal) { @@ -40,14 +40,14 @@ KTextFileDialog::KTextFileDialog(const QString& startDir, // insert encoding action into toolbar KSelectAction *mEncoding = new KSelectAction( i18n( "Set &Encoding" ), 0, this, - SLOT( slotSetEncoding() ), this, + TQT_SLOT( slotSetEncoding() ), this, "encoding" ); - QStringList encodings = KGlobal::charsets()->descriptiveEncodingNames(); + TQStringList encodings = KGlobal::charsets()->descriptiveEncodingNames(); encodings.prepend( i18n( "Default encoding" ) ); mEncoding->setItems( encodings ); mEncoding->setCurrentItem(0); - QStringList::Iterator it; + TQStringList::Iterator it; int i = 0; for( it = encodings.begin(); it != encodings.end(); ++it) { if ( (*it).contains( encodingStr ) ) { @@ -63,9 +63,9 @@ KTextFileDialog::KTextFileDialog(const QString& startDir, KAction* mEncoding = new KAction( i18n("Select Encoding..."), 0, - this, SLOT( slotShowEncCombo() ), this, "encoding"); + this, TQT_SLOT( slotShowEncCombo() ), this, "encoding"); - mEncoding->setIcon( QString::fromLatin1("charset") ); + mEncoding->setIcon( TQString::fromLatin1("charset") ); KToolBar *tb = toolBar(); mEncoding->plug( tb, pathComboIndex() - 1 ); @@ -73,7 +73,7 @@ KTextFileDialog::KTextFileDialog(const QString& startDir, KTextFileDialog::~KTextFileDialog() {} -void KTextFileDialog::setEncoding(const QString& encoding) { +void KTextFileDialog::setEncoding(const TQString& encoding) { enc = encoding; } @@ -84,30 +84,30 @@ void KTextFileDialog::slotShowEncCombo() // Modal widget asking the user about charset // KDialogBase *encDlg; - QLabel *label; - QComboBox *encCombo; - QVBox *vbox; + TQLabel *label; + TQComboBox *encCombo; + TQVBox *vbox; // Create widgets, and display using geometry management encDlg = new KDialogBase( this, "Encoding Dialog", true, i18n("Select Encoding"), KDialogBase::Ok | KDialogBase::Cancel ); - vbox = new QVBox( encDlg ); + vbox = new TQVBox( encDlg ); vbox->setSpacing( KDialog::spacingHint() ); encDlg->setMainWidget( vbox ); - label = new QLabel( vbox ); + label = new TQLabel( vbox ); label->setAlignment( AlignLeft | AlignVCenter ); label->setText(i18n("Select encoding for text file: ")); - encCombo = new QComboBox(vbox); - encCombo->setInsertionPolicy(QComboBox::NoInsertion); + encCombo = new TQComboBox(vbox); + encCombo->setInsertionPolicy(TQComboBox::NoInsertion); encCombo->insertItem(i18n("Default Encoding")); - QStringList encodings = KGlobal::charsets()->descriptiveEncodingNames(); + TQStringList encodings = KGlobal::charsets()->descriptiveEncodingNames(); encodings.prepend( i18n( "Default encoding" ) ); encCombo->insertStringList( encodings ); encCombo->setCurrentItem(0); - QStringList::Iterator it; + TQStringList::Iterator it; int i = 1; for( it = encodings.begin(); it != encodings.end(); ++it) { @@ -119,14 +119,14 @@ void KTextFileDialog::slotShowEncCombo() i++; } - connect( encDlg->actionButton( KDialogBase::Ok ), SIGNAL(clicked()), - encDlg, SLOT(accept()) ); - connect( encDlg->actionButton( KDialogBase::Cancel ), SIGNAL(clicked()), - encDlg, SLOT(reject()) ); + connect( encDlg->actionButton( KDialogBase::Ok ), TQT_SIGNAL(clicked()), + encDlg, TQT_SLOT(accept()) ); + connect( encDlg->actionButton( KDialogBase::Cancel ), TQT_SIGNAL(clicked()), + encDlg, TQT_SLOT(reject()) ); encDlg->setMinimumSize( 300, 120); - if ( encDlg->exec() == QDialog::Accepted ) { + if ( encDlg->exec() == TQDialog::Accepted ) { // set encoding if (encCombo->currentItem() == 0) { // Default setEncoding(""); @@ -142,12 +142,12 @@ void KTextFileDialog::slotShowEncCombo() KURL KTextFileDialog::getOpenURLwithEncoding( - const QString& startDir, - const QString& filter, - QWidget *parent, - const QString& caption, - const QString& encoding, - const QString& buttontext) + const TQString& startDir, + const TQString& filter, + TQWidget *parent, + const TQString& caption, + const TQString& encoding, + const TQString& buttontext) { KTextFileDialog dlg(startDir, filter, parent, "filedialog", true); dlg.setEncoding(encoding); @@ -174,10 +174,10 @@ KURL KTextFileDialog::getOpenURLwithEncoding( } KURL KTextFileDialog::getSaveURLwithEncoding( - const QString& dir, const QString& filter, - QWidget *parent, - const QString& caption, - const QString& encoding) + const TQString& dir, const TQString& filter, + TQWidget *parent, + const TQString& caption, + const TQString& encoding) { KTextFileDialog dlg(dir, filter, parent, "filedialog", true); dlg.setEncoding(encoding); diff --git a/kedit/ktextfiledlg.h b/kedit/ktextfiledlg.h index ba15be2..c280ccd 100644 --- a/kedit/ktextfiledlg.h +++ b/kedit/ktextfiledlg.h @@ -40,34 +40,34 @@ class KTextFileDialog : public KFileDialog Q_OBJECT public: - KTextFileDialog(const QString& startDir, const QString& filter, - QWidget *parent, const char *name, + KTextFileDialog(const TQString& startDir, const TQString& filter, + TQWidget *parent, const char *name, bool modal); ~KTextFileDialog(); static KURL getOpenURLwithEncoding( - const QString& startDir = QString::null, - const QString& filter= QString::null, - QWidget *parent= 0, - const QString& caption = QString::null, - const QString& encoding = QString::null, - const QString& buttonText = QString::null); + const TQString& startDir = TQString::null, + const TQString& filter= TQString::null, + TQWidget *parent= 0, + const TQString& caption = TQString::null, + const TQString& encoding = TQString::null, + const TQString& buttonText = TQString::null); static KURL getSaveURLwithEncoding( - const QString& dir, const QString& filter, - QWidget *parent, - const QString& caption, - const QString& encoding = QString::null); + const TQString& dir, const TQString& filter, + TQWidget *parent, + const TQString& caption, + const TQString& encoding = TQString::null); - QString &encoding() { return enc; } - void setEncoding(const QString& encoding); + TQString &encoding() { return enc; } + void setEncoding(const TQString& encoding); protected slots: void slotShowEncCombo(); private: - QString enc; + TQString enc; }; diff --git a/kfloppy/floppy.cpp b/kfloppy/floppy.cpp index 043f2f0..5075025 100644 --- a/kfloppy/floppy.cpp +++ b/kfloppy/floppy.cpp @@ -22,13 +22,13 @@ */ -#include <qlayout.h> -#include <qcheckbox.h> -#include <qlabel.h> -#include <qcursor.h> -#include <qradiobutton.h> -#include <qbuttongroup.h> -#include <qwhatsthis.h> +#include <tqlayout.h> +#include <tqcheckbox.h> +#include <tqlabel.h> +#include <tqcursor.h> +#include <tqradiobutton.h> +#include <tqbuttongroup.h> +#include <tqwhatsthis.h> #include <kconfig.h> @@ -48,7 +48,7 @@ #include "floppy.h" #include "format.h" -FloppyData::FloppyData(QWidget * parent, const char * name) +FloppyData::FloppyData(TQWidget * parent, const char * name) : KDialog( parent, name ), formatActions(0L), m_canLowLevel(false), m_canZeroOut( false ) { @@ -57,17 +57,17 @@ FloppyData::FloppyData(QWidget * parent, const char * name) //abort = false; blocks = 0; - QVBoxLayout* ml = new QVBoxLayout( this, 10 ); + TQVBoxLayout* ml = new TQVBoxLayout( this, 10 ); - QHBoxLayout* h1 = new QHBoxLayout( ml ); + TQHBoxLayout* h1 = new TQHBoxLayout( ml ); - QVBoxLayout* v1 = new QVBoxLayout( h1 ); + TQVBoxLayout* v1 = new TQVBoxLayout( h1 ); h1->addSpacing( 5 ); - QGridLayout* g1 = new QGridLayout( v1, 3, 2 ); + TQGridLayout* g1 = new TQGridLayout( v1, 3, 2 ); deviceComboBox = new KComboBox( false, this, "ComboBox_1" ); - label1 = new QLabel( deviceComboBox, i18n("Floppy &drive:"), this ); + label1 = new TQLabel( deviceComboBox, i18n("Floppy &drive:"), this ); g1->addWidget( label1, 0, 0, AlignLeft ); g1->addWidget( deviceComboBox, 0, 1 ); @@ -77,14 +77,14 @@ FloppyData::FloppyData(QWidget * parent, const char * name) deviceComboBox->insertItem(i18n("Primary")); deviceComboBox->insertItem(i18n("Secondary")); - const QString deviceWhatsThis = i18n("<qt>Select the floppy drive.</qt>"); + const TQString deviceWhatsThis = i18n("<qt>Select the floppy drive.</qt>"); - QWhatsThis::add(label1, deviceWhatsThis); - QWhatsThis::add(deviceComboBox, deviceWhatsThis); + TQWhatsThis::add(label1, deviceWhatsThis); + TQWhatsThis::add(deviceComboBox, deviceWhatsThis); densityComboBox = new KComboBox( false, this, "ComboBox_1" ); - label2 = new QLabel( densityComboBox, i18n("&Size:"), this); + label2 = new TQLabel( densityComboBox, i18n("&Size:"), this); g1->addWidget( label2, 1, 0, AlignLeft ); g1->addWidget( densityComboBox, 1, 1 ); @@ -96,34 +96,34 @@ FloppyData::FloppyData(QWidget * parent, const char * name) densityComboBox->insertItem(i18n("5.25\" 1.2MB")); densityComboBox->insertItem(i18n("5.25\" 360KB")); - const QString densityWhatsThis = + const TQString densityWhatsThis = i18n("<qt>This allows you to select the " "floppy disk's size and density.</qt>"); - QWhatsThis::add(label2, densityWhatsThis); - QWhatsThis::add(densityComboBox, densityWhatsThis); + TQWhatsThis::add(label2, densityWhatsThis); + TQWhatsThis::add(densityComboBox, densityWhatsThis); filesystemComboBox = new KComboBox( false, this, "ComboBox_2" ); - label3 = new QLabel( filesystemComboBox, i18n("F&ile system:"), this); + label3 = new TQLabel( filesystemComboBox, i18n("F&ile system:"), this); g1->addWidget( label3, 2, 0, AlignLeft ); g1->addWidget( filesystemComboBox, 2, 1 ); g1->setColStretch(1, 1); #if defined(ANY_LINUX) - QWhatsThis::add( label3, + TQWhatsThis::add( label3, i18n( "Linux", "KFloppy supports three file formats under Linux: MS-DOS, Ext2, and Minix" ) ); #elif defined(ANY_BSD) - QWhatsThis::add( label3, + TQWhatsThis::add( label3, i18n( "BSD", "KFloppy supports three file formats under BSD: MS-DOS, UFS, and Ext2" ) ); #endif // If you modify the user visible string, change them also (far) below - QString userFeedBack; + TQString userFeedBack; uint numFileSystems = 0; #if defined(ANY_LINUX) - QWhatsThis::add( filesystemComboBox, + TQWhatsThis::add( filesystemComboBox, i18n( "Linux", "KFloppy supports three file formats under Linux: MS-DOS, Ext2, and Minix" ) ); if (FATFilesystem::runtimeCheck()) { filesystemComboBox->insertItem(i18n("DOS")); @@ -152,7 +152,7 @@ FloppyData::FloppyData(QWidget * parent, const char * name) userFeedBack += i18n( "Linux", "Program mkfs.minix <b>not found</b>. Minix formatting <b>not available</b>" ); } #elif defined(ANY_BSD) - QWhatsThis::add( filesystemComboBox, + TQWhatsThis::add( filesystemComboBox, i18n( "BSD", "KFloppy supports two file formats under BSD: MS-DOS and UFS" ) ); if (FATFilesystem::runtimeCheck()) { filesystemComboBox->insertItem(i18n("DOS")); @@ -184,20 +184,20 @@ FloppyData::FloppyData(QWidget * parent, const char * name) v1->addSpacing( 10 ); - buttongroup = new QButtonGroup( 3, Qt::Vertical, i18n("&Formatting"), this, "ButtonGroup_1" ); + buttongroup = new TQButtonGroup( 3, Qt::Vertical, i18n("&Formatting"), this, "ButtonGroup_1" ); - quick = new QRadioButton( i18n( "Q&uick format" ), buttongroup, "RadioButton_2" ); - QWhatsThis::add( quick, + quick = new TQRadioButton( i18n( "Q&uick format" ), buttongroup, "RadioButton_2" ); + TQWhatsThis::add( quick, i18n("<qt>Quick format is only a high-level format:" " it creates only a file system.</qt>") ); - zerooutformat = new QRadioButton( i18n( "&Zero out and quick format"), buttongroup, "RadioButton_ZeroOutFormat" ); - QWhatsThis::add( zerooutformat, + zerooutformat = new TQRadioButton( i18n( "&Zero out and quick format"), buttongroup, "RadioButton_ZeroOutFormat" ); + TQWhatsThis::add( zerooutformat, i18n("<qt>This first erases the floppy by writing zeros and then it creates the file system.</qt>") ); - fullformat = new QRadioButton( i18n( "Fu&ll format"), buttongroup, "RadioButton_3" ); - QWhatsThis::add( fullformat, + fullformat = new TQRadioButton( i18n( "Fu&ll format"), buttongroup, "RadioButton_3" ); + TQWhatsThis::add( fullformat, i18n("Full format is a low-level and high-level format. It erases everything on the disk.") ); v1->addWidget( buttongroup ); @@ -226,23 +226,23 @@ FloppyData::FloppyData(QWidget * parent, const char * name) userFeedBack += i18n( "Program dd <b>not found</b>. Zeroing-out <b>disabled</b>." ); } - verifylabel = new QCheckBox( this, "CheckBox_Integrity" ); + verifylabel = new TQCheckBox( this, "CheckBox_Integrity" ); verifylabel->setText(i18n( "&Verify integrity" )); verifylabel->setChecked(true); v1->addWidget( verifylabel, AlignLeft ); - QWhatsThis::add( verifylabel, + TQWhatsThis::add( verifylabel, i18n("<qt>Check this if you want the floppy disk to be checked after formatting." " Please note that the floppy will be checked twice if you have selected full formatting.</qt>") ); - labellabel = new QCheckBox( this, "Checkbox_Label" ); + labellabel = new TQCheckBox( this, "Checkbox_Label" ); labellabel->setText(i18n( "Volume la&bel:") ); labellabel->setChecked(true); v1->addWidget( labellabel, AlignLeft ); - QWhatsThis::add( labellabel, + TQWhatsThis::add( labellabel, i18n("<qt>Check this if you want a volume label for your floppy." " Please note that Minix does not support labels at all.</qt>") ); - QHBoxLayout* h2 = new QHBoxLayout( v1 ); + TQHBoxLayout* h2 = new TQHBoxLayout( v1 ); h2->addSpacing( 20 ); lineedit = new KLineEdit( this, "Lineedit" ); @@ -250,23 +250,23 @@ FloppyData::FloppyData(QWidget * parent, const char * name) lineedit->setText(i18n( "Volume label, maximal 11 characters", "KDE Floppy" ) ); lineedit->setMaxLength(11); h2->addWidget( lineedit, AlignRight ); - QWhatsThis::add( lineedit, + TQWhatsThis::add( lineedit, i18n("<qt>This is for the volume label." " Due to a limitation of MS-DOS the label can only be 11 characters long." " Please note that Minix does not support labels, whatever you enter here.</qt>") ); - connect(labellabel,SIGNAL(toggled(bool)),lineedit,SLOT(setEnabled(bool))); + connect(labellabel,TQT_SIGNAL(toggled(bool)),lineedit,TQT_SLOT(setEnabled(bool))); - QVBoxLayout* v3 = new QVBoxLayout( h1 ); + TQVBoxLayout* v3 = new TQVBoxLayout( h1 ); formatbutton = new KPushButton( this, "PushButton_3" ); formatbutton->setText(i18n( "&Format") ); formatbutton->setAutoRepeat( false ); if (!numFileSystems) formatbutton->setDisabled(false); // We have not any helper program for creating any file system - connect(formatbutton,SIGNAL(clicked()),this,SLOT(format())); + connect(formatbutton,TQT_SIGNAL(clicked()),this,TQT_SLOT(format())); v3->addWidget( formatbutton ); - QWhatsThis::add( formatbutton, + TQWhatsThis::add( formatbutton, i18n("<qt>Click here to start formatting.</qt>") ); v3->addStretch( 1 ); @@ -281,18 +281,18 @@ FloppyData::FloppyData(QWidget * parent, const char * name) quitbutton = new KPushButton( KStdGuiItem::quit(), this ); quitbutton->setAutoRepeat( false ); - connect(quitbutton,SIGNAL(clicked()),this,SLOT(quit())); + connect(quitbutton,TQT_SIGNAL(clicked()),this,TQT_SLOT(quit())); v3->addWidget( quitbutton ); ml->addSpacing( 10 ); - frame = new QLabel( this, "NewsWindow" ); - frame->setFrameStyle(QFrame::Panel | QFrame::Sunken); + frame = new TQLabel( this, "NewsWindow" ); + frame->setFrameStyle(TQFrame::Panel | TQFrame::Sunken); frame->setAlignment(WordBreak|ExpandTabs); - QWhatsThis::add( frame, + TQWhatsThis::add( frame, i18n("<qt>This is the status window, where error messages are displayed.</qt>") ); - QString frameText( userFeedBack ); + TQString frameText( userFeedBack ); frameText.prepend( "<qt>" ); frameText.append( "</qt>" ); frame->setText( frameText ); @@ -303,14 +303,14 @@ FloppyData::FloppyData(QWidget * parent, const char * name) progress->setDisabled( true ); ml->addWidget( progress ); - QWhatsThis::add(progress, + TQWhatsThis::add(progress, i18n("<qt>Shows progress of the format.</qt>")); readSettings(); setWidgets(); if (!numFileSystems) { - QString errorMessage; + TQString errorMessage; errorMessage += "<qt>"; errorMessage += i18n("KFloppy cannot find any of the needed programs for creating file systems; please check your installation.<br><br>Log:"); errorMessage += "<br>"; @@ -326,12 +326,12 @@ FloppyData::~FloppyData() delete formatActions; } -void FloppyData::closeEvent(QCloseEvent*) +void FloppyData::closeEvent(TQCloseEvent*) { quit(); } -void FloppyData::keyPressEvent(QKeyEvent *e) +void FloppyData::keyPressEvent(TQKeyEvent *e) { switch(e->key()) { case Qt::Key_F1: @@ -388,21 +388,21 @@ bool FloppyData::findDevice() return true; } -bool FloppyData::setInitialDevice(const QString& dev) +bool FloppyData::setInitialDevice(const TQString& dev) { - QString newDevice = dev; + TQString newDevice = dev; KURL url( newDevice ); if( url.isValid() && ( url.protocol() == "media" || url.protocol() == "system" ) ) { - QString name = url.fileName(); + TQString name = url.fileName(); DCOPRef mediamanager( "kded", "mediamanager" ); - DCOPReply reply = mediamanager.call("properties(QString)", name); + DCOPReply reply = mediamanager.call("properties(TQString)", name); if (!reply.isValid()) { kdError() << "Invalid reply from mediamanager" << endl; } else { - QStringList properties = reply; + TQStringList properties = reply; newDevice = properties[5]; } } @@ -433,7 +433,7 @@ void FloppyData::setEnabled(bool b) if (b) unsetCursor(); else - setCursor(QCursor(WaitCursor)); + setCursor(TQCursor(WaitCursor)); label1->setEnabled(b); deviceComboBox->setEnabled(b); label2->setEnabled(b); @@ -481,7 +481,7 @@ void FloppyData::format(){ frame->clear(); - const QString currentComboBoxDevice ( deviceComboBox->currentText() ); + const TQString currentComboBoxDevice ( deviceComboBox->currentText() ); const bool userDevice = ( currentComboBoxDevice.startsWith ("/dev/") ); #ifdef ANY_BSD @@ -524,7 +524,7 @@ void FloppyData::format(){ setEnabled(false); // Erase text box - frame->setText( QString::null ); + frame->setText( TQString::null ); if ( !userDevice ) { @@ -538,10 +538,10 @@ void FloppyData::format(){ if (formatActions) delete formatActions; formatActions = new KFActionQueue(this); - connect(formatActions,SIGNAL(status(const QString &,int)), - this,SLOT(formatStatus(const QString &,int))); - connect(formatActions,SIGNAL(done(KFAction *,bool)), - this,SLOT(reset())); + connect(formatActions,TQT_SIGNAL(status(const TQString &,int)), + this,TQT_SLOT(formatStatus(const TQString &,int))); + connect(formatActions,TQT_SIGNAL(done(KFAction *,bool)), + this,TQT_SLOT(reset())); if ( quick->isChecked()) { @@ -642,12 +642,12 @@ void FloppyData::format(){ formatActions->exec(); } -void FloppyData::formatStatus(const QString &s,int p) +void FloppyData::formatStatus(const TQString &s,int p) { kdDebug(2002) << "FloppyData::formatStatus: " << s << " : " << p << endl; if (!s.isEmpty()) { - const QString oldText ( frame->text() ); + const TQString oldText ( frame->text() ); if ( oldText.isEmpty() ) { frame->setText( s ); diff --git a/kfloppy/floppy.h b/kfloppy/floppy.h index 2d4d519..705193a 100644 --- a/kfloppy/floppy.h +++ b/kfloppy/floppy.h @@ -46,7 +46,7 @@ class FloppyData : public KDialog Q_OBJECT public: - FloppyData(QWidget* parent = 0, const char * name = 0); + FloppyData(TQWidget* parent = 0, const char * name = 0); virtual ~FloppyData(); /// Need to overload normal show() in order to mangle caption @@ -54,18 +54,18 @@ public: /// Maps combobox selection to drive and density bool findDevice(); /// set default device - bool setInitialDevice(const QString& dev); + bool setInitialDevice(const TQString& dev); /** Override closeEvent() in order to properly close the entire application.*/ - void closeEvent(QCloseEvent*); + void closeEvent(TQCloseEvent*); /// Writing the user-visible settings. void writeSettings(); /// Reading the user-visible settings. void readSettings(); /// Map stored settings to widget status void setWidgets(); - /// A kind of QString::find() - int findKeyWord(QString &, const QString &); + /// A kind of TQString::find() + int findKeyWord(TQString &, const TQString &); /// Enable/disable all UI elements void setEnabled(bool); @@ -74,18 +74,18 @@ public slots: void format(); void reset(); - void formatStatus(const QString &,int); + void formatStatus(const TQString &,int); protected slots: private: int verifyconfig; int labelconfig; - QString labelnameconfig; + TQString labelnameconfig; int quickformatconfig; - QString driveconfig; - QString densityconfig; - QString filesystemconfig; + TQString driveconfig; + TQString densityconfig; + TQString filesystemconfig; KConfig *config; int drive; @@ -95,24 +95,24 @@ private: bool formating; //bool abort; - QGroupBox* outerframe; - QLabel* label1; - QLabel* label2; - QLabel* label3; - QButtonGroup* buttongroup; - QCheckBox* verifylabel; - QCheckBox* labellabel; - QLineEdit* lineedit; - QRadioButton* quick; - QRadioButton* zerooutformat; + TQGroupBox* outerframe; + TQLabel* label1; + TQLabel* label2; + TQLabel* label3; + TQButtonGroup* buttongroup; + TQCheckBox* verifylabel; + TQCheckBox* labellabel; + TQLineEdit* lineedit; + TQRadioButton* quick; + TQRadioButton* zerooutformat; KPushButton* quitbutton; KPushButton* helpbutton; - QRadioButton* fullformat; + TQRadioButton* fullformat; KPushButton* formatbutton; - QLabel* frame; - QComboBox* deviceComboBox; - QComboBox* filesystemComboBox; - QComboBox* densityComboBox; + TQLabel* frame; + TQComboBox* deviceComboBox; + TQComboBox* filesystemComboBox; + TQComboBox* densityComboBox; KProgress* progress; KHelpMenu* helpMenu; @@ -121,7 +121,7 @@ private: bool m_canLowLevel; ///< Low level formatting is possible (i.e. was fdformat found?) bool m_canZeroOut; ///< Is zero-out possible (i.e. was dd found?) protected: - void keyPressEvent(QKeyEvent *e); + void keyPressEvent(TQKeyEvent *e); }; diff --git a/kfloppy/format.cpp b/kfloppy/format.cpp index 6d76de3..485acc3 100644 --- a/kfloppy/format.cpp +++ b/kfloppy/format.cpp @@ -24,8 +24,8 @@ #include <unistd.h> #include <stdlib.h> -#include <qtimer.h> -#include <qregexp.h> +#include <tqtimer.h> +#include <tqregexp.h> #include <klocale.h> #include <kprocess.h> @@ -34,13 +34,13 @@ #include "format.h" -static QString extPath = QString::null; +static TQString extPath = TQString::null; -/* static */ QString findExecutable(const QString &e) +/* static */ TQString findExecutable(const TQString &e) { if (extPath.isEmpty()) { - QString path = getenv("PATH"); + TQString path = getenv("PATH"); if (!path.isEmpty()) path.append(":"); path.append("/usr/sbin:/sbin"); extPath = path; @@ -51,8 +51,8 @@ static QString extPath = QString::null; -KFAction::KFAction(QObject *parent) : - QObject(parent) +KFAction::KFAction(TQObject *parent) : + TQObject(parent) { DEBUGSETUP; } @@ -76,10 +76,10 @@ KFAction::~KFAction() class KFActionQueue_p { public: - QPtrList<KFAction> list; + TQPtrList<KFAction> list; } ; -KFActionQueue::KFActionQueue(QObject *parent) : +KFActionQueue::KFActionQueue(TQObject *parent) : KFAction(parent), d(new KFActionQueue_p) { @@ -146,12 +146,12 @@ void KFActionQueue::queue(KFAction *p) else { kdDebug(KFAREA) << "Running action " << next->name() << endl; - QObject::connect(next,SIGNAL(done(KFAction *,bool)), - this,SLOT(actionDone(KFAction *,bool))); + TQObject::connect(next,TQT_SIGNAL(done(KFAction *,bool)), + this,TQT_SLOT(actionDone(KFAction *,bool))); // Propagate signals - QObject::connect(next,SIGNAL(status(const QString &,int)), - this,SIGNAL(status(const QString &,int))); - QTimer::singleShot(0,next,SLOT(exec())); + TQObject::connect(next,TQT_SIGNAL(status(const TQString &,int)), + this,TQT_SIGNAL(status(const TQString &,int))); + TQTimer::singleShot(0,next,TQT_SLOT(exec())); } } @@ -232,7 +232,7 @@ fdinfo fdtable[] = } ; -FloppyAction::FloppyAction(QObject *p) : +FloppyAction::FloppyAction(TQObject *p) : KFAction(p), deviceInfo(0L), theProcess(0L) @@ -249,7 +249,7 @@ void FloppyAction::quit() KFAction::quit(); } -bool FloppyAction::configureDevice( const QString& newDeviceName ) +bool FloppyAction::configureDevice( const TQString& newDeviceName ) { deviceInfo = 0; // We have not any idea what the device is deviceName = newDeviceName; @@ -262,7 +262,7 @@ bool FloppyAction::configureDevice(int drive,int density) const char *devicename = 0L; deviceInfo=0L; - deviceName = QString::null; + deviceName = TQString::null; if ((drive<0) || (drive>1)) { @@ -311,7 +311,7 @@ bool FloppyAction::configureDevice(int drive,int density) if (!devicename) { - const QString str = i18n( + const TQString str = i18n( "Cannot access %1\nMake sure that the device exists and that " "you have write permission to it.").arg(deviceinfo->devices[0]); emit status(str,-1); @@ -338,7 +338,7 @@ void FloppyAction::processDone(KProcess *p) { if (p->exitStatus() == 0) { - emit status(QString::null,100); + emit status(TQString::null,100); emit done(this,true); } else @@ -358,7 +358,7 @@ void FloppyAction::processStdOut(KProcess *, char *b, int l) { Q_UNUSED(b); Q_UNUSED(l); - kdDebug(KFAREA) << "stdout:" << QString::fromLatin1(b,l) << endl; + kdDebug(KFAREA) << "stdout:" << TQString::fromLatin1(b,l) << endl; } void FloppyAction::processStdErr(KProcess *p, char *b, int l) @@ -370,12 +370,12 @@ bool FloppyAction::startProcess() { DEBUGSETUP; - connect(theProcess,SIGNAL(processExited(KProcess *)), - this,SLOT(processDone(KProcess *))); - connect(theProcess,SIGNAL(receivedStdout(KProcess *,char *,int)), - this,SLOT(processStdOut(KProcess *,char *,int))); - connect(theProcess,SIGNAL(receivedStderr(KProcess *,char *,int)), - this,SLOT(processStdErr(KProcess *,char *,int))); + connect(theProcess,TQT_SIGNAL(processExited(KProcess *)), + this,TQT_SLOT(processDone(KProcess *))); + connect(theProcess,TQT_SIGNAL(receivedStdout(KProcess *,char *,int)), + this,TQT_SLOT(processStdOut(KProcess *,char *,int))); + connect(theProcess,TQT_SIGNAL(receivedStderr(KProcess *,char *,int)), + this,TQT_SLOT(processStdErr(KProcess *,char *,int))); theProcess->setEnvironment( "LC_ALL", "C" ); // We need the untranslated output of the tool return theProcess->start(KProcess::NotifyOnExit, @@ -383,14 +383,14 @@ bool FloppyAction::startProcess() } -/* static */ QString FDFormat::fdformatName = QString::null; +/* static */ TQString FDFormat::fdformatName = TQString::null; -FDFormat::FDFormat(QObject *p) : +FDFormat::FDFormat(TQObject *p) : FloppyAction(p), doVerify(true) { DEBUGSETUP; - theProcessName = QString::fromLatin1("fdformat"); + theProcessName = TQString::fromLatin1("fdformat"); setName("FDFormat"); } @@ -441,7 +441,7 @@ bool FDFormat::configure(bool v) *theProcess << "-y" << "-f" - << QString::number(deviceInfo->blocks) ; + << TQString::number(deviceInfo->blocks) ; #elif defined(ANY_LINUX) // No Linux-specific flags #endif @@ -467,13 +467,13 @@ bool FDFormat::configure(bool v) void FDFormat::processStdOut(KProcess *, char *b, int l) { DEBUGSETUP; - QString s; + TQString s; #ifdef ANY_BSD if (b[0]=='F') { formatTrackCount++; - emit status(QString::null, + emit status(TQString::null, formatTrackCount * 100 / deviceInfo->tracks); } else if (b[0]=='E') @@ -482,7 +482,7 @@ void FDFormat::processStdOut(KProcess *, char *b, int l) } else { - s = QString::fromLatin1(b,l); + s = TQString::fromLatin1(b,l); if (s.contains("ioctl(FD_FORM)")) { emit status (i18n( @@ -499,9 +499,9 @@ void FDFormat::processStdOut(KProcess *, char *b, int l) DEBUGS(s); } #elif defined(ANY_LINUX) - s = QString::fromLatin1(b,l); + s = TQString::fromLatin1(b,l); DEBUGS(s); - QRegExp regexp( "([0-9]+)" ); + TQRegExp regexp( "([0-9]+)" ); if ( s.startsWith( "bad data at cyl" ) || ( s.find( "Problem reading cylinder" ) != -1 ) ) { if ( regexp.search( s ) > -1 ) @@ -542,7 +542,7 @@ void FDFormat::processStdOut(KProcess *, char *b, int l) const int p = regexp.cap(1).toInt(); if ((p>=0) && (p<deviceInfo->tracks)) { - emit status(QString::null, + emit status(TQString::null, p * 100 / deviceInfo->tracks); } } @@ -551,13 +551,13 @@ void FDFormat::processStdOut(KProcess *, char *b, int l) } -/* static */ QString DDZeroOut::m_ddName = QString::null; +/* static */ TQString DDZeroOut::m_ddName = TQString::null; -DDZeroOut::DDZeroOut(QObject *p) : +DDZeroOut::DDZeroOut(TQObject *p) : FloppyAction(p) { kdDebug(KFAREA) << (__PRETTY_FUNCTION__) << endl; - theProcessName = QString::fromLatin1("dd"); + theProcessName = TQString::fromLatin1("dd"); setName("DD"); } @@ -617,15 +617,15 @@ void DDZeroOut::processDone(KProcess *p) * * ### TODO: really check if the exit is not on an other error and then abort the formatting */ - emit status(QString::null,100); + emit status(TQString::null,100); emit done(this,true); } -/* static */ QString FATFilesystem::newfs_fat = QString::null ; +/* static */ TQString FATFilesystem::newfs_fat = TQString::null ; -FATFilesystem::FATFilesystem(QObject *parent) : +FATFilesystem::FATFilesystem(TQObject *parent) : FloppyAction(parent) { DEBUGSETUP; @@ -649,14 +649,14 @@ FATFilesystem::FATFilesystem(QObject *parent) : return !newfs_fat.isEmpty(); } -bool FATFilesystem::configure(bool v,bool l,const QString &lbl) +bool FATFilesystem::configure(bool v,bool l,const TQString &lbl) { doVerify=v; doLabel=l; if (l) label=lbl.simplifyWhiteSpace(); else - label=QString::null; + label=TQString::null; return true; } @@ -689,7 +689,7 @@ void FATFilesystem::exec() *p << newfs_fat; #ifdef ANY_BSD - *p << "-f" << QString::number(deviceInfo->blocks); + *p << "-f" << TQString::number(deviceInfo->blocks); if (doLabel) { *p << "-L" << label ; @@ -720,7 +720,7 @@ void FATFilesystem::processStdOut(KProcess *, char *b, int l) #ifdef ANY_BSD // ### TODO: do some checks #elif defined(ANY_LINUX) - QString s ( QString::fromLatin1( b, l ) ); + TQString s ( TQString::fromLatin1( b, l ) ); kdDebug(KFAREA) << s << endl; if (s.find("mounted file system")!=-1) // "/dev/fd0 contains a mounted file system { @@ -747,9 +747,9 @@ void FATFilesystem::processStdOut(KProcess *, char *b, int l) #ifdef ANY_BSD -/* static */ QString UFSFilesystem::newfs = QString::null ; +/* static */ TQString UFSFilesystem::newfs = TQString::null ; -UFSFilesystem::UFSFilesystem(QObject *parent) : +UFSFilesystem::UFSFilesystem(TQObject *parent) : FloppyAction(parent) { DEBUGSETUP; @@ -792,7 +792,7 @@ void UFSFilesystem::exec() // ### TODO: is it still needed? (FreeBSD 5.3's man page says: "For backward compatibility.") if ( deviceInfo ) - *p << "-T" << QString("fd%1").arg(deviceInfo->blocks); + *p << "-T" << TQString("fd%1").arg(deviceInfo->blocks); *p << deviceName; @@ -806,9 +806,9 @@ void UFSFilesystem::exec() -/* static */ QString Ext2Filesystem::newfs = QString::null ; +/* static */ TQString Ext2Filesystem::newfs = TQString::null ; -Ext2Filesystem::Ext2Filesystem(QObject *parent) : +Ext2Filesystem::Ext2Filesystem(TQObject *parent) : FloppyAction(parent) { DEBUGSETUP; @@ -826,7 +826,7 @@ Ext2Filesystem::Ext2Filesystem(QObject *parent) : return !newfs.isEmpty(); } -bool Ext2Filesystem::configure(bool v,bool l,const QString &lbl) +bool Ext2Filesystem::configure(bool v,bool l,const TQString &lbl) { doVerify=v; doLabel=l; @@ -836,7 +836,7 @@ bool Ext2Filesystem::configure(bool v,bool l,const QString &lbl) } else { - label=QString::null; + label=TQString::null; } return true; @@ -886,7 +886,7 @@ void Ext2Filesystem::processStdOut(KProcess *, char *b, int l) #ifdef ANY_BSD // ### TODO: do some checks #elif defined(ANY_LINUX) - QString s ( QString::fromLatin1( b, l ) ); + TQString s ( TQString::fromLatin1( b, l ) ); kdDebug(KFAREA) << s << endl; if (s.find("mounted")!=-1) // "/dev/fd0 is mounted; will not make a filesystem here!" { @@ -904,9 +904,9 @@ void Ext2Filesystem::processStdOut(KProcess *, char *b, int l) #ifdef ANY_LINUX -/* static */ QString MinixFilesystem::newfs = QString::null ; +/* static */ TQString MinixFilesystem::newfs = TQString::null ; -MinixFilesystem::MinixFilesystem(QObject *parent) : +MinixFilesystem::MinixFilesystem(TQObject *parent) : FloppyAction(parent) { DEBUGSETUP; @@ -924,7 +924,7 @@ MinixFilesystem::MinixFilesystem(QObject *parent) : return !newfs.isEmpty(); } -bool MinixFilesystem::configure(bool v,bool l,const QString &lbl) +bool MinixFilesystem::configure(bool v,bool l,const TQString &lbl) { doVerify=v; doLabel=l; @@ -934,7 +934,7 @@ bool MinixFilesystem::configure(bool v,bool l,const QString &lbl) } else { - label=QString::null; + label=TQString::null; } return true; @@ -977,7 +977,7 @@ void MinixFilesystem::exec() void MinixFilesystem::processStdOut(KProcess *, char *b, int l) { - QString s ( QString::fromLatin1( b, l ) ); + TQString s ( TQString::fromLatin1( b, l ) ); kdDebug(KFAREA) << s << endl; if (s.find("mounted")!=-1) // "mkfs.minix: /dev/fd0 is mounted; will not make a filesystem here!" { diff --git a/kfloppy/format.h b/kfloppy/format.h index 0200d22..6f8de58 100644 --- a/kfloppy/format.h +++ b/kfloppy/format.h @@ -54,7 +54,7 @@ */ #include "debug.h" -#include <qobject.h> +#include <tqobject.h> /** * \brief Abstract base class of actions to be undertaken. @@ -68,7 +68,7 @@ class KFAction : public QObject Q_OBJECT public: - KFAction(QObject *parent = 0L); + KFAction(TQObject *parent = 0L); virtual ~KFAction(); public slots: @@ -99,12 +99,12 @@ signals: * indicates the action's progress (if that can be determined) * and sending -1 leaves the visible indicator unchanged. */ - void status(const QString &msg, int progress); + void status(const TQString &msg, int progress); /** error() displays a box. It interrupts * the user's work and should be used with care. */ - void error(const QString &msg, const QString &details); + void error(const TQString &msg, const TQString &details); } ; @@ -117,7 +117,7 @@ class KFActionQueue : public KFAction Q_OBJECT public: - KFActionQueue(QObject *parent = 0L); + KFActionQueue(TQObject *parent = 0L); virtual ~KFActionQueue(); /** @@ -176,7 +176,7 @@ class FloppyAction : public KFAction Q_OBJECT public: - FloppyAction(QObject *parent = 0L); + FloppyAction(TQObject *parent = 0L); /** * Kills the running process, if one exists. @@ -206,11 +206,11 @@ public: * * \note It does not work for each type of FloppyAction yet */ - bool configureDevice( const QString& newDeviceName ); + bool configureDevice( const TQString& newDeviceName ); protected: fdinfo *deviceInfo; ///< Configuration info (Pointer into list of "/dev/..." entries) - QString deviceName; ///< Name of the device + TQString deviceName; ///< Name of the device protected slots: /** @@ -232,7 +232,7 @@ protected slots: protected: KProcess *theProcess; - QString theProcessName; ///< human-readable + TQString theProcessName; ///< human-readable /** * Sets up connections, calls KProcess::run(). @@ -249,7 +249,7 @@ protected: class FDFormat : public FloppyAction { public: - FDFormat(QObject *parent = 0L); + FDFormat(TQObject *parent = 0L); virtual void exec(); @@ -273,7 +273,7 @@ public: virtual void processStdOut(KProcess *, char *,int); protected: - static QString fdformatName; ///< path to executable. + static TQString fdformatName; ///< path to executable. int formatTrackCount; ///< How many tracks formatted. bool doVerify; } ; @@ -285,7 +285,7 @@ protected: class DDZeroOut : public FloppyAction { public: - DDZeroOut(QObject *parent = 0L); + DDZeroOut(TQObject *parent = 0L); virtual void exec(); @@ -305,7 +305,7 @@ protected: */ virtual void processDone(KProcess *); protected: - static QString m_ddName; ///< path to executable. + static TQString m_ddName; ///< path to executable. } ; @@ -315,7 +315,7 @@ protected: class FATFilesystem : public FloppyAction { public: - FATFilesystem(QObject *parent = 0L); + FATFilesystem(TQObject *parent = 0L); virtual void exec(); @@ -327,16 +327,16 @@ public: * verify with @p verify. Disks can be labeled (@p label) with the * remaining parameters (@p l). */ - bool configure(bool verify, bool label, const QString &l); + bool configure(bool verify, bool label, const TQString &l); /// Parse output virtual void processStdOut(KProcess*, char* b, int l); protected: - static QString newfs_fat; + static TQString newfs_fat; bool doVerify,doLabel; - QString label; + TQString label; } ; @@ -346,23 +346,23 @@ protected: class Ext2Filesystem : public FloppyAction { public: - Ext2Filesystem(QObject *parent = 0L); + Ext2Filesystem(TQObject *parent = 0L); virtual void exec(); static bool runtimeCheck(); /// Same args as FATFilesystem::configure - bool configure(bool verify, bool label, const QString &l); + bool configure(bool verify, bool label, const TQString &l); /// Parse output virtual void processStdOut(KProcess*, char* b, int l); protected: - static QString newfs; + static TQString newfs; bool doVerify,doLabel; - QString label; + TQString label; } ; #ifdef ANY_BSD @@ -374,17 +374,17 @@ protected: class UFSFilesystem : public FloppyAction { public: - UFSFilesystem(QObject *parent = 0L); + UFSFilesystem(TQObject *parent = 0L); virtual void exec(); static bool runtimeCheck(); protected: - static QString newfs; + static TQString newfs; bool doVerify,doLabel; - QString label; + TQString label; } ; #endif @@ -396,22 +396,22 @@ protected: class MinixFilesystem : public FloppyAction { public: - MinixFilesystem(QObject *parent = 0L); + MinixFilesystem(TQObject *parent = 0L); virtual void exec(); static bool runtimeCheck(); /// Same args as FATFilesystem::configure - bool configure(bool verify, bool label, const QString &l); + bool configure(bool verify, bool label, const TQString &l); /// Parse output virtual void processStdOut(KProcess*, char* b, int l); protected: - static QString newfs; + static TQString newfs; bool doVerify,doLabel; - QString label; + TQString label; } ; #endif @@ -420,7 +420,7 @@ protected: * and in /sbin and /usr/sbin. */ -QString findExecutable(const QString &); +TQString findExecutable(const TQString &); #endif diff --git a/kfloppy/main.cpp b/kfloppy/main.cpp index f6aa98f..f888bcd 100644 --- a/kfloppy/main.cpp +++ b/kfloppy/main.cpp @@ -60,7 +60,7 @@ int main( int argc, char *argv[] ) KCmdLineArgs::addCmdLineOptions( options ); KCmdLineArgs *args = KCmdLineArgs::parsedArgs(); - QString device; + TQString device; if (args->count()) { device = args->arg(0); } diff --git a/kfloppy/zip.cpp b/kfloppy/zip.cpp index 8a0ff29..51da7ef 100644 --- a/kfloppy/zip.cpp +++ b/kfloppy/zip.cpp @@ -33,16 +33,16 @@ #include "debug.h" #include "zip.moc" -#include <qcheckbox.h> -#include <qlayout.h> -#include <qtimer.h> -#include <qwhatsthis.h> +#include <tqcheckbox.h> +#include <tqlayout.h> +#include <tqtimer.h> +#include <tqwhatsthis.h> #include <klocale.h> #include <kprocess.h> #include <kconfig.h> -ZipFormat::ZipFormat(QWidget *w,const char *n) : +ZipFormat::ZipFormat(TQWidget *w,const char *n) : DiskFormat(w,n), zeroWholeDisk(0L), p(0L), @@ -51,15 +51,15 @@ ZipFormat::ZipFormat(QWidget *w,const char *n) : { DEBUGSETUP; - QGridLayout *grid = new QGridLayout(this,1,1,10); + TQGridLayout *grid = new TQGridLayout(this,1,1,10); - zeroWholeDisk = new QCheckBox(i18n("Zero entire disk"),this); - QWhatsThis::add(zeroWholeDisk, + zeroWholeDisk = new TQCheckBox(i18n("Zero entire disk"),this); + TQWhatsThis::add(zeroWholeDisk, i18n("Try to write zeroes to the entire disk " "before adding a filesystem, in order " "to check the disk's integrity.")); grid->addWidget(zeroWholeDisk,0,0); - enableSoftUpdates = new QCheckBox(i18n("Enable softupdates"),this); + enableSoftUpdates = new TQCheckBox(i18n("Enable softupdates"),this); grid->addWidget(enableSoftUpdates,1,0); // Remember the stretch at the bottom to clear @@ -90,8 +90,8 @@ FilesystemList ZipFormat::FSLabels() const return !newfs.isEmpty() && !dd.isEmpty(); } -/* static */ QString ZipFormat::dd; -/* static */ QString ZipFormat::newfs; +/* static */ TQString ZipFormat::dd; +/* static */ TQString ZipFormat::newfs; /* virtual slot */ void ZipFormat::setEnabled(bool b) { @@ -141,16 +141,16 @@ void ZipFormat::quit() p = new KProcess(); if (statusTimer) delete statusTimer; - statusTimer = new QTimer(this); + statusTimer = new TQTimer(this); - connect(p,SIGNAL(processExited(KProcess *)), - this,SLOT(transition())); - connect(p,SIGNAL(receivedStdout(KProcess *,char *,int)), - this,SLOT(processResult(KProcess *,char *,int))); - connect(p,SIGNAL(receivedStderr(KProcess *,char *,int)), - this,SLOT(processResult(KProcess *,char *,int))); - connect(statusTimer,SIGNAL(timeout()), - this,SLOT(statusRequest())); + connect(p,TQT_SIGNAL(processExited(KProcess *)), + this,TQT_SLOT(transition())); + connect(p,TQT_SIGNAL(receivedStdout(KProcess *,char *,int)), + this,TQT_SLOT(processResult(KProcess *,char *,int))); + connect(p,TQT_SIGNAL(receivedStderr(KProcess *,char *,int)), + this,TQT_SLOT(processResult(KProcess *,char *,int))); + connect(statusTimer,TQT_SIGNAL(timeout()), + this,TQT_SLOT(statusRequest())); transition(); } @@ -173,8 +173,8 @@ void ZipFormat::transition() // Zeroing whole disk takes about 2 min. // No point in making a dizzy display of it. statusTimer->start(10000); - QTimer::singleShot(1000,this, - SLOT(statusRequest())); + TQTimer::singleShot(1000,this, + TQT_SLOT(statusRequest())); totalBlocks=12288; // 196608 * 512b = 12288 * 8192b ; } else @@ -188,7 +188,7 @@ void ZipFormat::transition() << "if=/dev/zero" << "of=/dev/afd0c" << "bs=8192" ; - *p << QString("count=%1").arg(totalBlocks); + *p << TQString("count=%1").arg(totalBlocks); if (!p->start(KProcess::NotifyOnExit,KProcess::AllOutput)) { emit statusMessage(i18n("Cannot start dd to zero disk.")); @@ -250,8 +250,8 @@ void ZipFormat::processResult(KProcess *, char *b, int l) DEBUGSETUP; #ifdef DEBUG - QString o = QString::fromLatin1(b,l); - DEBUGS(QString(" %1").arg(o).latin1()); + TQString o = TQString::fromLatin1(b,l); + DEBUGS(TQString(" %1").arg(o).latin1()); #endif switch(formatStep) @@ -283,7 +283,7 @@ void ZipFormat::processResult(KProcess *, char *b, int l) // emit setProgress(1); - // QString myBuf = QString::fromLatin1(b, l); + // TQString myBuf = TQString::fromLatin1(b, l); // DEBUGS(myBuf.latin1()); } break; diff --git a/kfloppy/zip.h b/kfloppy/zip.h index 0054c50..5db0532 100644 --- a/kfloppy/zip.h +++ b/kfloppy/zip.h @@ -49,7 +49,7 @@ class ZipFormat : public DiskFormat Q_OBJECT public: - ZipFormat(QWidget *w, const char *n); + ZipFormat(TQWidget *w, const char *n); // All the virtuals we need to make // a concrete DiskFormat class. See @@ -68,17 +68,17 @@ public: static bool runtimeCheck(); protected: - QCheckBox *zeroWholeDisk; - QCheckBox *enableSoftUpdates; + TQCheckBox *zeroWholeDisk; + TQCheckBox *enableSoftUpdates; - static QString newfs,dd; + static TQString newfs,dd; KProcess *p; ///< dd or newfs, doing the real work int formatStep; ///< keeps track of what phase we are in // Variables for the zeroing phase int totalBlocks; - QTimer *statusTimer; + TQTimer *statusTimer; protected slots: /** diff --git a/kgpg/dcopiface.h b/kgpg/dcopiface.h index d9b3455..8cd8752 100644 --- a/kgpg/dcopiface.h +++ b/kgpg/dcopiface.h @@ -24,8 +24,8 @@ class KeyInterface : virtual public DCOPObject { K_DCOP k_dcop: - virtual void showKeyInfo(QString keyID) =0; - virtual bool importRemoteKey(QString keyID)=0; + virtual void showKeyInfo(TQString keyID) =0; + virtual bool importRemoteKey(TQString keyID)=0; virtual void showOptions()=0; virtual void showKeyServer()=0; virtual void showKeyManager()=0; diff --git a/kgpg/detailedconsole.cpp b/kgpg/detailedconsole.cpp index 985ca01..3251056 100644 --- a/kgpg/detailedconsole.cpp +++ b/kgpg/detailedconsole.cpp @@ -16,10 +16,10 @@ ***************************************************************************/ -#include <qlayout.h> -#include <qlabel.h> -#include <qvgroupbox.h> -#include <qtextedit.h> +#include <tqlayout.h> +#include <tqlabel.h> +#include <tqvgroupbox.h> +#include <tqtextedit.h> #include <kmessagebox.h> #include <klocale.h> @@ -30,18 +30,18 @@ #include "detailedconsole.h" -KDetailedConsole::KDetailedConsole(QWidget *parent, const char *name,const QString &boxLabel,const QString &errormessage) +KDetailedConsole::KDetailedConsole(TQWidget *parent, const char *name,const TQString &boxLabel,const TQString &errormessage) : KDialogBase(parent,name,true,i18n("Sorry"),KDialogBase::Details|KDialogBase::Ok|KDialogBase::Cancel, KDialogBase::Ok) { - QWidget *page = new QWidget( this ); + TQWidget *page = new TQWidget( this ); setMainWidget(page); - QVBoxLayout *vbox=new QVBoxLayout(page,0, spacingHint() ); + TQVBoxLayout *vbox=new TQVBoxLayout(page,0, spacingHint() ); - QLabel *lab1=new QLabel(page); + TQLabel *lab1=new TQLabel(page); lab1->setText(boxLabel); - QVGroupBox *detailsGroup = new QVGroupBox( i18n("Details"), page); - (void) new QLabel(errormessage,detailsGroup); + TQVGroupBox *detailsGroup = new TQVGroupBox( i18n("Details"), page); + (void) new TQLabel(errormessage,detailsGroup); //labdetails->setMinimumSize(labdetails->sizeHint()); setDetailsWidget(detailsGroup); vbox->addWidget(lab1); @@ -51,12 +51,12 @@ KDetailedConsole::KDetailedConsole(QWidget *parent, const char *name,const QStri KDetailedConsole::~KDetailedConsole() {} -KDetailedInfo::KDetailedInfo(QWidget *parent, const char *name , const QString &boxLabel,const QString &errormessage,QStringList keysList) +KDetailedInfo::KDetailedInfo(TQWidget *parent, const char *name , const TQString &boxLabel,const TQString &errormessage,TQStringList keysList) : KDialogBase(Swallow, i18n("Info"),KDialogBase::Details|KDialogBase::Ok, KDialogBase::Ok,parent,name,true) { bool checkboxResult; - KMessageBox::createKMessageBox(this, QMessageBox::Information, - boxLabel, keysList,QString::null,&checkboxResult, 0,errormessage); + KMessageBox::createKMessageBox(this, TQMessageBox::Information, + boxLabel, keysList,TQString::null,&checkboxResult, 0,errormessage); } KDetailedInfo::~KDetailedInfo() diff --git a/kgpg/detailedconsole.h b/kgpg/detailedconsole.h index 5d0e669..282516c 100644 --- a/kgpg/detailedconsole.h +++ b/kgpg/detailedconsole.h @@ -24,7 +24,7 @@ class KDetailedConsole : public KDialogBase { public: - KDetailedConsole(QWidget *parent=0, const char *name=0,const QString &boxLabel=QString::null,const QString &errormessage=QString::null); + KDetailedConsole(TQWidget *parent=0, const char *name=0,const TQString &boxLabel=TQString::null,const TQString &errormessage=TQString::null); ~KDetailedConsole(); }; @@ -34,7 +34,7 @@ class KDetailedInfo : public KDialogBase { public: - KDetailedInfo(QWidget *parent=0, const char *name=0,const QString &boxLabel=QString::null,const QString &errormessage=QString::null,QStringList keysList=QStringList()); + KDetailedInfo(TQWidget *parent=0, const char *name=0,const TQString &boxLabel=TQString::null,const TQString &errormessage=TQString::null,TQStringList keysList=TQStringList()); ~KDetailedInfo(); }; diff --git a/kgpg/keygener.cpp b/kgpg/keygener.cpp index 739bb55..26ecebe 100644 --- a/kgpg/keygener.cpp +++ b/kgpg/keygener.cpp @@ -18,43 +18,43 @@ /////////////////////////////////////////////// code for new key generation -#include <qwhatsthis.h> -#include <qlayout.h> -#include <qlabel.h> -#include <qvbox.h> +#include <tqwhatsthis.h> +#include <tqlayout.h> +#include <tqlabel.h> +#include <tqvbox.h> #include <kcombobox.h> #include <klineedit.h> -#include <qcheckbox.h> -#include <qbuttongroup.h> -#include <qhbuttongroup.h> -#include <qvbuttongroup.h> +#include <tqcheckbox.h> +#include <tqbuttongroup.h> +#include <tqhbuttongroup.h> +#include <tqvbuttongroup.h> #include <kmessagebox.h> #include <klocale.h> #include "keygener.h" /////////////////////// main window -keyGenerate::keyGenerate(QWidget *parent, const char *name):KDialogBase( parent, name, true,i18n("Key Generation"),Apply | Ok | Cancel) +keyGenerate::keyGenerate(TQWidget *parent, const char *name):KDialogBase( parent, name, true,i18n("Key Generation"),Apply | Ok | Cancel) { expert=false; setButtonApply(i18n("Expert Mode")); - QWidget *page = new QWidget(this); - QVBoxLayout *vbox=new QVBoxLayout(page); + TQWidget *page = new TQWidget(this); + TQVBoxLayout *vbox=new TQVBoxLayout(page); - QVButtonGroup *bgroup1=new QVButtonGroup(i18n("Generate Key Pair"),page); + TQVButtonGroup *bgroup1=new TQVButtonGroup(i18n("Generate Key Pair"),page); - (void) new QLabel(i18n("Name:"),bgroup1); + (void) new TQLabel(i18n("Name:"),bgroup1); kname=new KLineEdit("",bgroup1); kname->setFocus(); - (void) new QLabel(i18n("Email:"),bgroup1); + (void) new TQLabel(i18n("Email:"),bgroup1); mail=new KLineEdit("",bgroup1); - (void) new QLabel(i18n("Comment (optional):"),bgroup1); + (void) new TQLabel(i18n("Comment (optional):"),bgroup1); comment=new KLineEdit("",bgroup1); - (void) new QLabel(i18n("Expiration:"),bgroup1); - QHButtonGroup *bgroup=new QHButtonGroup(bgroup1); + (void) new TQLabel(i18n("Expiration:"),bgroup1); + TQHButtonGroup *bgroup=new TQHButtonGroup(bgroup1); numb=new KLineEdit("0",bgroup); numb->setMaxLength(4); numb->setDisabled(true); @@ -65,9 +65,9 @@ keyGenerate::keyGenerate(QWidget *parent, const char *name):KDialogBase( parent, keyexp->insertItem(i18n("Months"),3); keyexp->insertItem(i18n("Years"),4); keyexp->setMinimumSize(keyexp->sizeHint()); - connect(keyexp,SIGNAL(activated(int)),this,SLOT(activateexp(int))); + connect(keyexp,TQT_SIGNAL(activated(int)),this,TQT_SLOT(activateexp(int))); - (void) new QLabel(i18n("Key size:"),bgroup1); + (void) new TQLabel(i18n("Key size:"),bgroup1); keysize = new KComboBox(bgroup1); keysize->insertItem("768"); keysize->insertItem("1024"); @@ -76,7 +76,7 @@ keyGenerate::keyGenerate(QWidget *parent, const char *name):KDialogBase( parent, keysize->setCurrentItem("1024"); keysize->setMinimumSize(keysize->sizeHint()); - (void) new QLabel(i18n("Algorithm:"),bgroup1); + (void) new TQLabel(i18n("Algorithm:"),bgroup1); keykind = new KComboBox(bgroup1); keykind->insertItem("DSA & ElGamal"); keykind->insertItem("RSA"); @@ -90,11 +90,11 @@ keyGenerate::keyGenerate(QWidget *parent, const char *name):KDialogBase( parent, void keyGenerate::slotOk() { - if (QString(kname->text()).stripWhiteSpace().isEmpty()) { + if (TQString(kname->text()).stripWhiteSpace().isEmpty()) { KMessageBox::sorry(this,i18n("You must give a name.")); return; } - QString vmail=mail->text(); + TQString vmail=mail->text(); if (vmail.isEmpty()) { if (KMessageBox::warningContinueCancel(this,i18n("You are about to create a key with no email address"))!=KMessageBox::Continue) return; @@ -126,12 +126,12 @@ bool keyGenerate::getmode() } -QString keyGenerate::getkeytype() +TQString keyGenerate::getkeytype() { return(keykind->currentText()); } -QString keyGenerate::getkeysize() +TQString keyGenerate::getkeysize() { return(keysize->currentText()); } @@ -141,7 +141,7 @@ int keyGenerate::getkeyexp() return(keyexp->currentItem()); } -QString keyGenerate::getkeynumb() +TQString keyGenerate::getkeynumb() { if (numb->text()!=NULL) return(numb->text()); @@ -149,7 +149,7 @@ QString keyGenerate::getkeynumb() return (""); } -QString keyGenerate::getkeyname() +TQString keyGenerate::getkeyname() { if (kname->text()!=NULL) return(kname->text()); @@ -157,7 +157,7 @@ QString keyGenerate::getkeyname() return (""); } -QString keyGenerate::getkeymail() +TQString keyGenerate::getkeymail() { if (mail->text()!=NULL) return(mail->text()); @@ -165,7 +165,7 @@ QString keyGenerate::getkeymail() return (""); } -QString keyGenerate::getkeycomm() +TQString keyGenerate::getkeycomm() { if (comment->text()!=NULL) return(comment->text()); diff --git a/kgpg/keygener.h b/kgpg/keygener.h index 0c1cd89..f9d662d 100644 --- a/kgpg/keygener.h +++ b/kgpg/keygener.h @@ -26,7 +26,7 @@ class keyGenerate : public KDialogBase { Q_OBJECT public: - keyGenerate(QWidget *parent=0, const char *name=0); + keyGenerate(TQWidget *parent=0, const char *name=0); KComboBox *keykind,*keysize,*keyexp; KLineEdit *numb,*comment,*kname,*mail; @@ -37,12 +37,12 @@ public slots: void slotApply(); void activateexp(int state); bool getmode(); - QString getkeycomm(); - QString getkeynumb(); - QString getkeymail(); - QString getkeyname(); - QString getkeysize(); - QString getkeytype(); + TQString getkeycomm(); + TQString getkeynumb(); + TQString getkeymail(); + TQString getkeyname(); + TQString getkeysize(); + TQString getkeytype(); int getkeyexp(); }; diff --git a/kgpg/keyinfowidget.cpp b/kgpg/keyinfowidget.cpp index 4704eba..21dbb1c 100644 --- a/kgpg/keyinfowidget.cpp +++ b/kgpg/keyinfowidget.cpp @@ -17,21 +17,21 @@ #include <klocale.h> #include <kprocess.h> -#include <qdatetime.h> -#include <qfile.h> +#include <tqdatetime.h> +#include <tqfile.h> #include <kprocio.h> #include <kpassivepopup.h> #include <kaction.h> -#include <qregexp.h> +#include <tqregexp.h> #include <ktempfile.h> -#include <qimage.h> +#include <tqimage.h> #include <kdatepicker.h> -#include <qpushbutton.h> +#include <tqpushbutton.h> #include <kcombobox.h> -#include <qlabel.h> +#include <tqlabel.h> #include <kiconloader.h> -#include <qcheckbox.h> -#include <qlayout.h> +#include <tqcheckbox.h> +#include <tqlayout.h> #include <kactivelabel.h> #include <klineedit.h> #include <ktrader.h> @@ -43,20 +43,20 @@ #include "kgpgsettings.h" #include "kgpginterface.h" -KgpgKeyInfo::KgpgKeyInfo(QWidget *parent, const char *name,QString sigkey):KDialogBase( Swallow, i18n("Key Properties"), Close, Close, parent, name,true) +KgpgKeyInfo::KgpgKeyInfo(TQWidget *parent, const char *name,TQString sigkey):KDialogBase( Swallow, i18n("Key Properties"), Close, Close, parent, name,true) { FILE *pass; char line[200]=""; - QString gpgOutput,fullID; + TQString gpgOutput,fullID; hasPhoto=false; bool isSecret=false; keyWasChanged=false; prop=new KeyProperties(); setMainWidget(prop); - QString gpgcmd="gpg --no-tty --no-secmem-warning --with-colon --list-secret-key "+KShellProcess::quote(sigkey); - pass=popen(QFile::encodeName(gpgcmd),"r"); + TQString gpgcmd="gpg --no-tty --no-secmem-warning --with-colon --list-secret-key "+KShellProcess::quote(sigkey); + pass=popen(TQFile::encodeName(gpgcmd),"r"); while ( fgets( line, sizeof(line), pass)) { gpgOutput=line; if (gpgOutput.startsWith("sec")) isSecret=true; @@ -72,18 +72,18 @@ KgpgKeyInfo::KgpgKeyInfo(QWidget *parent, const char *name,QString sigkey):KDial if (hasPhoto) { KgpgInterface *photoProcess=new KgpgInterface(); photoProcess->KgpgGetPhotoList(displayedKeyID); - connect(photoProcess,SIGNAL(signalPhotoList(QStringList)),this,SLOT(slotSetMainPhoto(QStringList))); + connect(photoProcess,TQT_SIGNAL(signalPhotoList(TQStringList)),this,TQT_SLOT(slotSetMainPhoto(TQStringList))); } else prop->comboId->setEnabled(false); - connect(prop->changeExp,SIGNAL(clicked()),this,SLOT(slotChangeExp())); - connect(this,SIGNAL(closeClicked()),this,SLOT(slotPreOk())); - connect(prop->changePass,SIGNAL(clicked()),this,SLOT(slotChangePass())); - connect(prop->comboId,SIGNAL(activated (const QString &)),this,SLOT(reloadMainPhoto(const QString &))); - connect(prop->cbDisabled,SIGNAL(toggled(bool)),this,SLOT(slotDisableKey(bool))); - connect(prop->kCOwnerTrust,SIGNAL(activated (int)),this,SLOT(slotChangeTrust(int))); - connect(this,SIGNAL(changeMainPhoto(const QPixmap&)),this,SLOT(slotSetPhoto(const QPixmap&))); + connect(prop->changeExp,TQT_SIGNAL(clicked()),this,TQT_SLOT(slotChangeExp())); + connect(this,TQT_SIGNAL(closeClicked()),this,TQT_SLOT(slotPreOk())); + connect(prop->changePass,TQT_SIGNAL(clicked()),this,TQT_SLOT(slotChangePass())); + connect(prop->comboId,TQT_SIGNAL(activated (const TQString &)),this,TQT_SLOT(reloadMainPhoto(const TQString &))); + connect(prop->cbDisabled,TQT_SIGNAL(toggled(bool)),this,TQT_SLOT(slotDisableKey(bool))); + connect(prop->kCOwnerTrust,TQT_SIGNAL(activated (int)),this,TQT_SLOT(slotChangeTrust(int))); + connect(this,TQT_SIGNAL(changeMainPhoto(const TQPixmap&)),this,TQT_SLOT(slotSetPhoto(const TQPixmap&))); //prop->setMinimumSize(prop->sizeHint()); } @@ -104,23 +104,23 @@ loadKey(displayedKeyID); keyWasChanged=true; } -void KgpgKeyInfo::loadKey(QString Keyid) +void KgpgKeyInfo::loadKey(TQString Keyid) { -QColor trustColor; -QString fingervalue=QString::null; +TQColor trustColor; +TQString fingervalue=TQString::null; FILE *pass; char line[200]=""; -QString gpgOutput,fullID; +TQString gpgOutput,fullID; -QString gpgcmd="gpg --no-tty --no-secmem-warning --with-colon --with-fingerprint --list-key "+KShellProcess::quote(Keyid); +TQString gpgcmd="gpg --no-tty --no-secmem-warning --with-colon --with-fingerprint --list-key "+KShellProcess::quote(Keyid); - pass=popen(QFile::encodeName(gpgcmd),"r"); + pass=popen(TQFile::encodeName(gpgcmd),"r"); while ( fgets( line, sizeof(line), pass)) { - gpgOutput=QString::fromUtf8(line); + gpgOutput=TQString::fromUtf8(line); if (gpgOutput.startsWith("uat")) hasPhoto=true; if (gpgOutput.startsWith("pub")) { - QString algo=gpgOutput.section(':',3,3); + TQString algo=gpgOutput.section(':',3,3); switch( algo.toInt() ) { case 1: algo="RSA"; @@ -133,13 +133,13 @@ QString gpgcmd="gpg --no-tty --no-secmem-warning --with-colon --with-fingerprint algo="DSA"; break; default: - algo=QString("#" + algo); + algo=TQString("#" + algo); break; } prop->tLAlgo->setText(algo); - const QString trust=gpgOutput.section(':',1,1); - QString tr; + const TQString trust=gpgOutput.section(':',1,1); + TQString tr; switch( trust[0] ) { case 'o': tr= i18n("Unknown"); @@ -202,22 +202,22 @@ QString gpgcmd="gpg --no-tty --no-secmem-warning --with-colon --with-fingerprint displayedKeyID=fullID.right(8); prop->tLID->setText(fullID); - QString fullname=gpgOutput.section(':',9,9); + TQString fullname=gpgOutput.section(':',9,9); - QDate date = QDate::fromString(gpgOutput.section(':',5,5), Qt::ISODate); + TQDate date = TQDate::fromString(gpgOutput.section(':',5,5), Qt::ISODate); prop->tLCreation->setText(KGlobal::locale()->formatDate(date)); if (gpgOutput.section(':',6,6).isEmpty()) expirationDate=i18n("Unlimited"); else { - date = QDate::fromString(gpgOutput.section(':',6,6), Qt::ISODate); + date = TQDate::fromString(gpgOutput.section(':',6,6), Qt::ISODate); expirationDate=KGlobal::locale()->formatDate(date); } prop->tLExpiration->setText(expirationDate); prop->tLLength->setText(gpgOutput.section(':',2,2)); - const QString otrust=gpgOutput.section(':',8,8); + const TQString otrust=gpgOutput.section(':',8,8); int ownerTrust=0; /* Don't know=1; Do NOT trust=2; Marginally=3; Fully=4; Ultimately=5; */ @@ -242,7 +242,7 @@ QString gpgcmd="gpg --no-tty --no-secmem-warning --with-colon --with-fingerprint prop->kCOwnerTrust->setCurrentItem(ownerTrust); if (fullname.find("<")!=-1) { - QString kmail=fullname; + TQString kmail=fullname; if (fullname.find(")")!=-1) kmail=kmail.section(')',1); kmail=kmail.section('<',1); @@ -256,16 +256,16 @@ QString gpgcmd="gpg --no-tty --no-secmem-warning --with-colon --with-fingerprint } else prop->tLMail->setText(i18n("none")); - QString kname=fullname.section('<',0,0); + TQString kname=fullname.section('<',0,0); if (fullname.find("(")!=-1) { kname=kname.section('(',0,0); - QString comment=fullname.section('(',1,1); + TQString comment=fullname.section('(',1,1); comment=comment.section(')',0,0); prop->tLComment->setText(KgpgInterface::checkForUtf8(comment)); } else prop->tLComment->setText(i18n("none")); - prop->tLName->setText("<qt><b>"+KgpgInterface::checkForUtf8(kname).replace(QRegExp("<"),"<")+"</b></qt>"); + prop->tLName->setText("<qt><b>"+KgpgInterface::checkForUtf8(kname).replace(TQRegExp("<"),"<")+"</b></qt>"); } if (gpgOutput.startsWith("fpr") && (fingervalue.isNull())) { @@ -281,23 +281,23 @@ QString gpgcmd="gpg --no-tty --no-secmem-warning --with-colon --with-fingerprint pclose(pass); } -void KgpgKeyInfo::slotSetMainPhoto(QStringList list) +void KgpgKeyInfo::slotSetMainPhoto(TQStringList list) { prop->comboId->insertStringList(list); reloadMainPhoto(prop->comboId->currentText()); } -void KgpgKeyInfo::reloadMainPhoto(const QString &uid) +void KgpgKeyInfo::reloadMainPhoto(const TQString &uid) { kgpginfotmp=new KTempFile(); kgpginfotmp->setAutoDelete(true); - QString pgpgOutput="cp %i "+kgpginfotmp->name(); + TQString pgpgOutput="cp %i "+kgpginfotmp->name(); KProcIO *p=new KProcIO(); - *p<<"gpg"<<"--no-tty"<<"--show-photos"<<"--photo-viewer"<<QFile::encodeName(pgpgOutput); + *p<<"gpg"<<"--no-tty"<<"--show-photos"<<"--photo-viewer"<<TQFile::encodeName(pgpgOutput); *p<<"--edit-key"<<displayedKeyID<<"uid"<<uid<<"showphoto"; - QObject::connect(p, SIGNAL(readReady(KProcIO *)),this, SLOT(finishphotoreadprocess(KProcIO *))); - QObject::connect(p, SIGNAL(processExited(KProcess *)),this, SLOT(slotMainImageRead(KProcess *))); + TQObject::connect(p, TQT_SIGNAL(readReady(KProcIO *)),this, TQT_SLOT(finishphotoreadprocess(KProcIO *))); + TQObject::connect(p, TQT_SIGNAL(processExited(KProcess *)),this, TQT_SLOT(slotMainImageRead(KProcess *))); p->start(KProcess::NotifyOnExit,true); } @@ -306,7 +306,7 @@ void KgpgKeyInfo::reloadMainPhoto(const QString &uid) void KgpgKeyInfo::slotMainImageRead(KProcess *p) { p->deleteLater(); - QPixmap pixmap; + TQPixmap pixmap; pixmap.load(kgpginfotmp->name()); emit changeMainPhoto(pixmap); kgpginfotmp->unlink(); @@ -317,11 +317,11 @@ KgpgKeyInfo::~KgpgKeyInfo() { } -void KgpgKeyInfo::slotSetPhoto(const QPixmap &pix) +void KgpgKeyInfo::slotSetPhoto(const TQPixmap &pix) { -QImage dup=pix.convertToImage(); -QPixmap dup2; -dup2.convertFromImage(dup.scale(prop->pLPhoto->width(),prop->pLPhoto->height(),QImage::ScaleMin)); +TQImage dup=pix.convertToImage(); +TQPixmap dup2; +dup2.convertFromImage(dup.scale(prop->pLPhoto->width(),prop->pLPhoto->height(),TQImage::ScaleMin)); prop->pLPhoto->setPixmap(dup2); } @@ -330,7 +330,7 @@ prop->pLPhoto->setPixmap(dup2); void KgpgKeyInfo::finishphotoreadprocess(KProcIO *p) { - QString required=QString::null; + TQString required=TQString::null; while (p->readln(required,true)!=-1) if (required.find("keyedit.prompt")!=-1) { p->writeStdin("quit"); @@ -346,15 +346,15 @@ void KgpgKeyInfo::openPhoto() KService::Ptr ptr = offers.first(); //KMessageBox::sorry(0,ptr->desktopEntryName()); KProcIO *p=new KProcIO(); - *p<<"gpg"<<"--show-photos"<<"--photo-viewer"<<QFile::encodeName(ptr->desktopEntryName()+" %i")<<"--list-keys"<<displayedKeyID; + *p<<"gpg"<<"--show-photos"<<"--photo-viewer"<<TQFile::encodeName(ptr->desktopEntryName()+" %i")<<"--list-keys"<<displayedKeyID; p->start(KProcess::DontCare,true); } void KgpgKeyInfo::slotChangeExp() { chdate=new KDialogBase( this, "choose_date", true,i18n("Choose New Expiration"),KDialogBase::Ok | KDialogBase::Cancel); -QWidget *page = new QWidget(chdate); -kb= new QCheckBox(i18n("Unlimited"),page ); +TQWidget *page = new TQWidget(chdate); +kb= new TQCheckBox(i18n("Unlimited"),page ); if (prop->tLExpiration->text()==i18n("Unlimited")) { @@ -364,31 +364,31 @@ kdt->setEnabled(false); } else kdt= new KDatePicker(page,KGlobal::locale()->readDate(prop->tLExpiration->text())); -QVBoxLayout *vbox=new QVBoxLayout(page,3); +TQVBoxLayout *vbox=new TQVBoxLayout(page,3); vbox->addWidget(kdt); vbox->addWidget(kb); -connect(kb,SIGNAL(toggled(bool)),this,SLOT(slotEnableDate(bool))); -connect(chdate,SIGNAL(okClicked()),this,SLOT(slotChangeDate())); -connect(kdt,SIGNAL(dateChanged(QDate)),this,SLOT(slotCheckDate(QDate))); -connect(kdt,SIGNAL(dateEntered(QDate)),this,SLOT(slotCheckDate(QDate))); +connect(kb,TQT_SIGNAL(toggled(bool)),this,TQT_SLOT(slotEnableDate(bool))); +connect(chdate,TQT_SIGNAL(okClicked()),this,TQT_SLOT(slotChangeDate())); +connect(kdt,TQT_SIGNAL(dateChanged(TQDate)),this,TQT_SLOT(slotCheckDate(TQDate))); +connect(kdt,TQT_SIGNAL(dateEntered(TQDate)),this,TQT_SLOT(slotCheckDate(TQDate))); chdate->setMainWidget(page); chdate->show(); } -void KgpgKeyInfo::slotCheckDate(QDate date) +void KgpgKeyInfo::slotCheckDate(TQDate date) { -chdate->enableButtonOK(date>=QDate::currentDate ()); +chdate->enableButtonOK(date>=TQDate::currentDate ()); } void KgpgKeyInfo::slotChangeDate() { KgpgInterface *KeyExpirationProcess=new KgpgInterface(); if (kb->isChecked()) - KeyExpirationProcess->KgpgKeyExpire(displayedKeyID,QDate::currentDate(),true); + KeyExpirationProcess->KgpgKeyExpire(displayedKeyID,TQDate::currentDate(),true); else KeyExpirationProcess->KgpgKeyExpire(displayedKeyID,kdt->date(),false); - connect(KeyExpirationProcess,SIGNAL(expirationFinished(int)),this,SLOT(slotInfoExpirationChanged(int))); + connect(KeyExpirationProcess,TQT_SIGNAL(expirationFinished(int)),this,TQT_SLOT(slotInfoExpirationChanged(int))); } void KgpgKeyInfo::slotEnableDate(bool isOn) @@ -401,13 +401,13 @@ chdate->enableButtonOK(true); else { kdt->setEnabled(true); -chdate->enableButtonOK(kdt->date()>=QDate::currentDate ()); +chdate->enableButtonOK(kdt->date()>=TQDate::currentDate ()); } } void KgpgKeyInfo::slotinfoimgread(KProcess *) { - QPixmap pixmap; + TQPixmap pixmap; pixmap.load(kgpginfotmp->name()); emit signalPhotoId(pixmap); kgpginfotmp->unlink(); @@ -417,32 +417,32 @@ void KgpgKeyInfo::slotChangePass() { KgpgInterface *ChangeKeyPassProcess=new KgpgInterface(); ChangeKeyPassProcess->KgpgChangePass(displayedKeyID); - connect(ChangeKeyPassProcess,SIGNAL(passwordChanged()),this,SLOT(slotInfoPasswordChanged())); + connect(ChangeKeyPassProcess,TQT_SIGNAL(passwordChanged()),this,TQT_SLOT(slotInfoPasswordChanged())); } void KgpgKeyInfo::slotChangeTrust(int newTrust) { KgpgInterface *KeyTrustProcess=new KgpgInterface(); KeyTrustProcess->KgpgTrustExpire(displayedKeyID,newTrust); - connect(KeyTrustProcess,SIGNAL(trustfinished()),this,SLOT(slotInfoTrustChanged())); + connect(KeyTrustProcess,TQT_SIGNAL(trustfinished()),this,TQT_SLOT(slotInfoTrustChanged())); } void KgpgKeyInfo::slotInfoPasswordChanged() { -KPassivePopup::message(i18n("Passphrase for the key was changed"),QString::null,KGlobal::iconLoader()->loadIcon("kgpg",KIcon::Desktop),this); +KPassivePopup::message(i18n("Passphrase for the key was changed"),TQString::null,KGlobal::iconLoader()->loadIcon("kgpg",KIcon::Desktop),this); } void KgpgKeyInfo::slotInfoTrustChanged() { keyWasChanged=true; loadKey(displayedKeyID); -//KPassivePopup::message(i18n("Owner trust of the key was changed"),QString::null,KGlobal::iconLoader()->loadIcon("kgpg",KIcon::Desktop),this,0,600); +//KPassivePopup::message(i18n("Owner trust of the key was changed"),TQString::null,KGlobal::iconLoader()->loadIcon("kgpg",KIcon::Desktop),this,0,600); } void KgpgKeyInfo::slotInfoExpirationChanged(int res) { -QString infoMessage,infoText; +TQString infoMessage,infoText; if (res==3) { keyWasChanged=true; diff --git a/kgpg/keyinfowidget.h b/kgpg/keyinfowidget.h index af8ba64..832670a 100644 --- a/kgpg/keyinfowidget.h +++ b/kgpg/keyinfowidget.h @@ -19,7 +19,7 @@ #define KEYINFOWIDGET_H #include <kdialogbase.h> -#include <qpixmap.h> +#include <tqpixmap.h> class KTempFile; class QLabel; @@ -36,7 +36,7 @@ class KgpgKeyInfo : public KDialogBase public: - KgpgKeyInfo( QWidget *parent = 0, const char *name = 0,QString sigkey=0); + KgpgKeyInfo( TQWidget *parent = 0, const char *name = 0,TQString sigkey=0); ~KgpgKeyInfo(); KeyProperties *prop; @@ -47,35 +47,35 @@ private slots: void slotChangeExp(); void slotEnableDate(bool isOn); void slotChangeDate(); - void slotCheckDate(QDate date); + void slotCheckDate(TQDate date); void openPhoto(); - void slotSetPhoto(const QPixmap &pix); + void slotSetPhoto(const TQPixmap &pix); void finishphotoreadprocess(KProcIO *p); void slotMainImageRead(KProcess *); - void slotSetMainPhoto(QStringList list); - void reloadMainPhoto(const QString &uid); + void slotSetMainPhoto(TQStringList list); + void reloadMainPhoto(const TQString &uid); void slotInfoPasswordChanged(); void slotInfoExpirationChanged(int res); void slotInfoTrustChanged(); void slotChangeTrust(int newTrust); - void loadKey(QString Keyid); + void loadKey(TQString Keyid); void slotDisableKey(bool isOn); private: KTempFile *kgpginfotmp; - QLabel *keyinfoPhoto; - QString displayedKeyID; - QString expirationDate; + TQLabel *keyinfoPhoto; + TQString displayedKeyID; + TQString expirationDate; bool hasPhoto,keyWasChanged; KDialogBase *chdate; - QCheckBox *kb; + TQCheckBox *kb; KDatePicker *kdt; int counter; signals: - void signalPhotoId(const QPixmap&); - void changeMainPhoto(const QPixmap&); + void signalPhotoId(const TQPixmap&); + void changeMainPhoto(const TQPixmap&); void keyNeedsRefresh(); }; diff --git a/kgpg/keyservers.cpp b/kgpg/keyservers.cpp index 1afd9d3..bbe22bd 100644 --- a/kgpg/keyservers.cpp +++ b/kgpg/keyservers.cpp @@ -17,23 +17,23 @@ #include <stdlib.h> -#include <qfile.h> -#include <qcheckbox.h> +#include <tqfile.h> +#include <tqcheckbox.h> #include <kapplication.h> #include <kiconloader.h> #include <kcombobox.h> #include <kdialogbase.h> #include <kmessagebox.h> -#include <qtextcodec.h> -#include <qlayout.h> -#include <qlabel.h> -#include <qdialog.h> -#include <qpushbutton.h> -#include <qbuttongroup.h> -#include <qhbuttongroup.h> -#include <qvbuttongroup.h> -#include <qregexp.h> -#include <qcursor.h> +#include <tqtextcodec.h> +#include <tqlayout.h> +#include <tqlabel.h> +#include <tqdialog.h> +#include <tqpushbutton.h> +#include <tqbuttongroup.h> +#include <tqhbuttongroup.h> +#include <tqvbuttongroup.h> +#include <tqregexp.h> +#include <tqcursor.h> #include <klocale.h> #include <kprocess.h> @@ -52,7 +52,7 @@ #include "detailedconsole.h" #include "keyservers.h" -keyServer::keyServer(QWidget *parent, const char *name,bool modal,bool autoClose):KDialogBase( Swallow, i18n("Key Server"), Close, Close, parent, name,modal) +keyServer::keyServer(TQWidget *parent, const char *name,bool modal,bool autoClose):KDialogBase( Swallow, i18n("Key Server"), Close, Close, parent, name,modal) { autoCloseWindow=autoClose; config=new KSimpleConfig ("kgpgrc"); @@ -62,15 +62,15 @@ keyServer::keyServer(QWidget *parent, const char *name,bool modal,bool autoClose syncCombobox(); page->kLEimportid->setFocus(); - connect(page->Buttonimport,SIGNAL(clicked()),this,SLOT(slotImport())); - connect(page->Buttonsearch,SIGNAL(clicked()),this,SLOT(slotSearch())); - connect(page->Buttonexport,SIGNAL(clicked()),this,SLOT(slotPreExport())); - connect(this,SIGNAL(okClicked()),this,SLOT(slotOk())); + connect(page->Buttonimport,TQT_SIGNAL(clicked()),this,TQT_SLOT(slotImport())); + connect(page->Buttonsearch,TQT_SIGNAL(clicked()),this,TQT_SLOT(slotSearch())); + connect(page->Buttonexport,TQT_SIGNAL(clicked()),this,TQT_SLOT(slotPreExport())); + connect(this,TQT_SIGNAL(okClicked()),this,TQT_SLOT(slotOk())); - connect(page->cBproxyI,SIGNAL(toggled(bool)),this,SLOT(slotEnableProxyI(bool))); - connect(page->cBproxyE,SIGNAL(toggled(bool)),this,SLOT(slotEnableProxyE(bool))); + connect(page->cBproxyI,TQT_SIGNAL(toggled(bool)),this,TQT_SLOT(slotEnableProxyI(bool))); + connect(page->cBproxyE,TQT_SIGNAL(toggled(bool)),this,TQT_SLOT(slotEnableProxyE(bool))); - connect(page->kLEimportid, SIGNAL( textChanged ( const QString & )), this, SLOT( slotTextChanged( const QString &))); + connect(page->kLEimportid, TQT_SIGNAL( textChanged ( const TQString & )), this, TQT_SLOT( slotTextChanged( const TQString &))); page->cBproxyI->setChecked(KGpgSettings::useProxy()); page->cBproxyE->setChecked(KGpgSettings::useProxy()); const char *httpproxy = getenv("http_proxy"); @@ -82,9 +82,9 @@ keyServer::keyServer(QWidget *parent, const char *name,bool modal,bool autoClose } - KProcIO *encid=new KProcIO(QTextCodec::codecForLocale()); + KProcIO *encid=new KProcIO(TQTextCodec::codecForLocale()); *encid << "gpg"<<"--no-secmem-warning"<<"--no-tty"<<"--with-colon"<<"--list-keys"; - QObject::connect(encid, SIGNAL(readReady(KProcIO *)),this, SLOT(slotprocread(KProcIO *))); + TQObject::connect(encid, TQT_SIGNAL(readReady(KProcIO *)),this, TQT_SLOT(slotprocread(KProcIO *))); encid->start(KProcess::NotifyOnExit,true); page->Buttonimport->setEnabled( !page->kLEimportid->text().isEmpty()); page->Buttonsearch->setEnabled( !page->kLEimportid->text().isEmpty()); @@ -96,7 +96,7 @@ keyServer::~keyServer() {} -void keyServer::slotTextChanged( const QString &text) +void keyServer::slotTextChanged( const TQString &text) { page->Buttonimport->setEnabled( !text.isEmpty()); page->Buttonsearch->setEnabled( !text.isEmpty()); @@ -118,13 +118,13 @@ void keyServer::slotprocread(KProcIO *p) { ///////////////////////////////////////////////////////////////// extract encryption keys bool dead; - QString tst; - //QPixmap pixkeySingle(KGlobal::iconLoader()->loadIcon("kgpg_key1",KIcon::Small,20)); + TQString tst; + //TQPixmap pixkeySingle(KGlobal::iconLoader()->loadIcon("kgpg_key1",KIcon::Small,20)); while (p->readln(tst)!=-1) { //tst=tst.stripWhiteSpace(); if (tst.startsWith("pub")) { - const QString trust=tst.section(':',1,1); - QString id=QString("0x"+tst.section(':',4,4).right(8)); + const TQString trust=tst.section(':',1,1); + TQString id=TQString("0x"+tst.section(':',4,4).right(8)); switch( trust[0] ) { case 'i': dead=true; @@ -171,22 +171,22 @@ void keyServer::slotSearch() dialogServer->setButtonText(KDialogBase::Ok,i18n("&Import")); dialogServer->enableButtonOK(false); listpop=new searchRes(); - listpop->kLVsearch->setColumnWidthMode(0,QListView::Manual); - listpop->kLVsearch->setColumnWidthMode(1,QListView::Manual); + listpop->kLVsearch->setColumnWidthMode(0,TQListView::Manual); + listpop->kLVsearch->setColumnWidthMode(1,TQListView::Manual); listpop->kLVsearch->setColumnWidth(0,150); listpop->kLVsearch->setColumnWidth(1,130); listpop->statusText->setText(i18n("Connecting to the server...")); - connect(listpop->kLVsearch,SIGNAL(selectionChanged()),this,SLOT(transferKeyID())); - connect(dialogServer,SIGNAL(okClicked()),this,SLOT(preimport())); - connect(listpop->kLVsearch,SIGNAL(doubleClicked(QListViewItem *,const QPoint &,int)),dialogServer,SIGNAL(okClicked())); + connect(listpop->kLVsearch,TQT_SIGNAL(selectionChanged()),this,TQT_SLOT(transferKeyID())); + connect(dialogServer,TQT_SIGNAL(okClicked()),this,TQT_SLOT(preimport())); + connect(listpop->kLVsearch,TQT_SIGNAL(doubleClicked(TQListViewItem *,const TQPoint &,int)),dialogServer,TQT_SIGNAL(okClicked())); - connect(dialogServer,SIGNAL(closeClicked()),this,SLOT(handleQuit())); - connect( listpop , SIGNAL( destroyed() ) , this, SLOT( abortSearch())); + connect(dialogServer,TQT_SIGNAL(closeClicked()),this,TQT_SLOT(handleQuit())); + connect( listpop , TQT_SIGNAL( destroyed() ) , this, TQT_SLOT( abortSearch())); count=0; cycle=false; - readmessage=QString::null; - searchproc=new KProcIO(QTextCodec::codecForLocale()); - QString keyserv=page->kCBimportks->currentText(); + readmessage=TQString::null; + searchproc=new KProcIO(TQTextCodec::codecForLocale()); + TQString keyserv=page->kCBimportks->currentText(); *searchproc<<"gpg"<<"--utf8-strings"; if (page->cBproxyI->isChecked()) { searchproc->setEnvironment("http_proxy",page->kLEproxyI->text()); @@ -196,10 +196,10 @@ void keyServer::slotSearch() *searchproc<<"--keyserver"<<keyserv<<"--command-fd=0"<<"--status-fd=2"<<"--search-keys"<<page->kLEimportid->text().stripWhiteSpace(); keyNumbers=0; - QObject::connect(searchproc, SIGNAL(processExited(KProcess *)),this, SLOT(slotsearchresult(KProcess *))); - QObject::connect(searchproc, SIGNAL(readReady(KProcIO *)),this, SLOT(slotsearchread(KProcIO *))); + TQObject::connect(searchproc, TQT_SIGNAL(processExited(KProcess *)),this, TQT_SLOT(slotsearchresult(KProcess *))); + TQObject::connect(searchproc, TQT_SIGNAL(readReady(KProcIO *)),this, TQT_SLOT(slotsearchread(KProcIO *))); searchproc->start(KProcess::NotifyOnExit,true); - QApplication::setOverrideCursor(QCursor(Qt::BusyCursor)); + TQApplication::setOverrideCursor(TQCursor(Qt::BusyCursor)); dialogServer->setMainWidget(listpop); listpop->setMinimumSize(listpop->sizeHint()); listpop->setMinimumWidth(550); @@ -210,7 +210,7 @@ void keyServer::handleQuit() { if (searchproc->isRunning()) { - QApplication::restoreOverrideCursor(); + TQApplication::restoreOverrideCursor(); disconnect(searchproc,0,0,0); searchproc->kill(); } @@ -242,9 +242,9 @@ void keyServer::transferKeyID() { if (!listpop->kLVsearch->firstChild()) return; - QString kid,keysToSearch; + TQString kid,keysToSearch; listpop->kLEID->clear(); - QPtrList< QListViewItem >searchList=listpop->kLVsearch->selectedItems(); + TQPtrList< TQListViewItem >searchList=listpop->kLVsearch->selectedItems(); for ( uint i = 0; i < searchList.count(); ++i ) { @@ -257,9 +257,9 @@ void keyServer::transferKeyID() void keyServer::slotsearchresult(KProcess *) { - QString nb; + TQString nb; dialogServer->enableButtonOK(true); - QApplication::restoreOverrideCursor(); + TQApplication::restoreOverrideCursor(); nb=nb.setNum(keyNumbers); //listpop->kLVsearch->setColumnText(0,i18n("Found %1 matching keys").arg(nb)); listpop->statusText->setText(i18n("Found %1 matching keys").arg(nb)); @@ -273,10 +273,10 @@ void keyServer::slotsearchresult(KProcess *) void keyServer::slotsearchread(KProcIO *p) { - QString required; - QString keymail,keyname; + TQString required; + TQString keymail,keyname; while (p->readln(required,true)!=-1) { - //required=QString::fromUtf8(required); + //required=TQString::fromUtf8(required); if (required.find("keysearch.prompt")!=-1) { if (count<4) @@ -285,39 +285,39 @@ void keyServer::slotsearchread(KProcIO *p) p->writeStdin("Q"); p->closeWhenDone(); } - required=QString::null; + required=TQString::null; } if (required.find("GOT_IT")!=-1) { count++; - required=QString::null; + required=TQString::null; } if (required.find("(")==0) { cycle=true; - QString fullname=required.remove(0,required.find(")")+1).stripWhiteSpace(); + TQString fullname=required.remove(0,required.find(")")+1).stripWhiteSpace(); if (fullname.find("<")!=-1) { keymail=fullname.section('<',-1,-1); if (keymail.endsWith(">")) keymail.truncate(keymail.length()-1); keyname=fullname.section('<',0,0); } else { - keymail=QString::null; + keymail=TQString::null; keyname=fullname; } - kitem=new KListViewItem(listpop->kLVsearch,keyname,keymail,QString::null,QString::null); + kitem=new KListViewItem(listpop->kLVsearch,keyname,keymail,TQString::null,TQString::null); keyNumbers++; count=0; - required=QString::null; + required=TQString::null; } if ((cycle) && (!required.isEmpty())) { - QString subkey=required.stripWhiteSpace(); + TQString subkey=required.stripWhiteSpace(); if (subkey.find(" key ")!=-1 && subkey.at(0).isDigit ()) { - QString kid=subkey.section(",",0,0).stripWhiteSpace(); + TQString kid=subkey.section(",",0,0).stripWhiteSpace(); kid=kid.right(8); kitem->setText(3,kid); - QString creation=subkey.section("created",1,1); + TQString creation=subkey.section("created",1,1); if (creation.startsWith(":")) creation=creation.right(creation.length()-1); kitem->setText(2,creation); cycle=false; @@ -329,29 +329,29 @@ void keyServer::slotsearchread(KProcIO *p) if (keymail.endsWith(">")) keymail.truncate(keymail.length()-1); keyname=subkey.section('<',0,0); } else { - keymail=QString::null; + keymail=TQString::null; keyname=subkey; } - KListViewItem *subk = new KListViewItem(kitem,keyname,keymail,QString::null,QString::null); + KListViewItem *subk = new KListViewItem(kitem,keyname,keymail,TQString::null,TQString::null); subk->setSelectable(false); } - required=QString::null; + required=TQString::null; } } } void keyServer::slotPreExport() { - slotExport(QStringList(page->kCBexportkey->currentText().section(':', 0, 0))); + slotExport(TQStringList(page->kCBexportkey->currentText().section(':', 0, 0))); } -void keyServer::slotExport(QStringList keyIds) +void keyServer::slotExport(TQStringList keyIds) { if (page->kCBexportks->currentText().isEmpty()) return; - readmessage=QString::null; - exportproc=new KProcIO(QTextCodec::codecForLocale()); - QString keyserv=page->kCBexportks->currentText(); + readmessage=TQString::null; + exportproc=new KProcIO(TQTextCodec::codecForLocale()); + TQString keyserv=page->kCBexportks->currentText(); *exportproc<<"gpg"<<"--utf8-strings"; if (!page->exportAttributes->isChecked()) @@ -364,27 +364,27 @@ void keyServer::slotExport(QStringList keyIds) *exportproc<< "--keyserver-options"<<"no-honor-http-proxy"; *exportproc << "--status-fd=2" << "--keyserver" << keyserv << "--send-keys" << keyIds; - QObject::connect(exportproc, SIGNAL(processExited(KProcess *)),this, SLOT(slotexportresult(KProcess *))); - QObject::connect(exportproc, SIGNAL(readReady(KProcIO *)),this, SLOT(slotimportread(KProcIO *))); + TQObject::connect(exportproc, TQT_SIGNAL(processExited(KProcess *)),this, TQT_SLOT(slotexportresult(KProcess *))); + TQObject::connect(exportproc, TQT_SIGNAL(readReady(KProcIO *)),this, TQT_SLOT(slotimportread(KProcIO *))); exportproc->start(KProcess::NotifyOnExit,true); - QApplication::setOverrideCursor(QCursor(Qt::BusyCursor)); - importpop = new QDialog( this,0,true,Qt::WDestructiveClose); - QVBoxLayout *vbox=new QVBoxLayout(importpop,3); - QLabel *tex=new QLabel(importpop); + TQApplication::setOverrideCursor(TQCursor(Qt::BusyCursor)); + importpop = new TQDialog( this,0,true,Qt::WDestructiveClose); + TQVBoxLayout *vbox=new TQVBoxLayout(importpop,3); + TQLabel *tex=new TQLabel(importpop); tex->setText(i18n("<b>Connecting to the server...</b>")); - QPushButton *Buttonabort=new QPushButton(i18n("&Abort"),importpop); + TQPushButton *Buttonabort=new TQPushButton(i18n("&Abort"),importpop); vbox->addWidget(tex); vbox->addWidget(Buttonabort); importpop->setMinimumWidth(250); importpop->adjustSize(); importpop->show(); - connect(importpop,SIGNAL(destroyed ()),this,SLOT(abortExport())); - connect(Buttonabort,SIGNAL(clicked ()),importpop,SLOT(close())); + connect(importpop,TQT_SIGNAL(destroyed ()),this,TQT_SLOT(abortExport())); + connect(Buttonabort,TQT_SIGNAL(clicked ()),importpop,TQT_SLOT(close())); } void keyServer::abortExport() { - QApplication::restoreOverrideCursor(); + TQApplication::restoreOverrideCursor(); if (exportproc->isRunning()) { disconnect(exportproc,0,0,0); @@ -394,7 +394,7 @@ void keyServer::abortExport() void keyServer::slotexportresult(KProcess*) { - QApplication::restoreOverrideCursor(); + TQApplication::restoreOverrideCursor(); KMessageBox::information(0,readmessage); if (importpop) delete importpop; @@ -409,9 +409,9 @@ void keyServer::slotImport() KMessageBox::sorry(this,i18n("You must enter a search string.")); return; } - readmessage=QString::null; - importproc=new KProcIO(QTextCodec::codecForLocale()); - QString keyserv=page->kCBimportks->currentText(); + readmessage=TQString::null; + importproc=new KProcIO(TQTextCodec::codecForLocale()); + TQString keyserv=page->kCBimportks->currentText(); *importproc<<"gpg"<<"--utf8-strings"; if (page->cBproxyI->isChecked()) { @@ -421,56 +421,56 @@ void keyServer::slotImport() *importproc<< "--keyserver-options"<<"no-honor-http-proxy"; *importproc<<"--status-fd=2"<<"--keyserver"<<keyserv<<"--recv-keys"; - QString keyNames=page->kLEimportid->text(); + TQString keyNames=page->kLEimportid->text(); keyNames=keyNames.stripWhiteSpace(); keyNames=keyNames.simplifyWhiteSpace(); while (!keyNames.isEmpty()) { - QString fkeyNames=keyNames.section(' ',0,0); + TQString fkeyNames=keyNames.section(' ',0,0); keyNames.remove(0,fkeyNames.length()); keyNames=keyNames.stripWhiteSpace(); - *importproc<<QFile::encodeName(fkeyNames); + *importproc<<TQFile::encodeName(fkeyNames); } - QObject::connect(importproc, SIGNAL(processExited(KProcess *)),this, SLOT(slotimportresult(KProcess *))); - QObject::connect(importproc, SIGNAL(readReady(KProcIO *)),this, SLOT(slotimportread(KProcIO *))); + TQObject::connect(importproc, TQT_SIGNAL(processExited(KProcess *)),this, TQT_SLOT(slotimportresult(KProcess *))); + TQObject::connect(importproc, TQT_SIGNAL(readReady(KProcIO *)),this, TQT_SLOT(slotimportread(KProcIO *))); importproc->start(KProcess::NotifyOnExit,true); importproc->closeWhenDone(); - QApplication::setOverrideCursor(QCursor(Qt::BusyCursor)); - importpop = new QDialog( this,0,true,Qt::WDestructiveClose); - QVBoxLayout *vbox=new QVBoxLayout(importpop,3); - QLabel *tex=new QLabel(importpop); + TQApplication::setOverrideCursor(TQCursor(Qt::BusyCursor)); + importpop = new TQDialog( this,0,true,Qt::WDestructiveClose); + TQVBoxLayout *vbox=new TQVBoxLayout(importpop,3); + TQLabel *tex=new TQLabel(importpop); tex->setText(i18n("<b>Connecting to the server...</b>")); - QPushButton *Buttonabort=new QPushButton(i18n("&Abort"),importpop); + TQPushButton *Buttonabort=new TQPushButton(i18n("&Abort"),importpop); vbox->addWidget(tex); vbox->addWidget(Buttonabort); importpop->setMinimumWidth(250); importpop->adjustSize(); importpop->show(); - connect(Buttonabort,SIGNAL(clicked()),importpop,SLOT(close())); - connect(importpop,SIGNAL(destroyed ()),this,SLOT(abortImport())); + connect(Buttonabort,TQT_SIGNAL(clicked()),importpop,TQT_SLOT(close())); + connect(importpop,TQT_SIGNAL(destroyed ()),this,TQT_SLOT(abortImport())); } void keyServer::abortImport() { - QApplication::restoreOverrideCursor(); + TQApplication::restoreOverrideCursor(); if (importproc->isRunning()) { disconnect(importproc,0,0,0); importproc->kill(); - emit importFinished(QString::null); + emit importFinished(TQString::null); } if (autoCloseWindow) close(); } void keyServer::slotimportresult(KProcess*) { - QApplication::restoreOverrideCursor(); - QString importedNb,importedNbSucess,importedNbProcess,resultMessage, parsedOutput,importedNbUnchanged,importedNbSig; - QString notImportesNbSec,importedNbMissing,importedNbRSA,importedNbUid,importedNbSub,importedNbRev,readNbSec; - QString importedNbSec,dupNbSec; + TQApplication::restoreOverrideCursor(); + TQString importedNb,importedNbSucess,importedNbProcess,resultMessage, parsedOutput,importedNbUnchanged,importedNbSig; + TQString notImportesNbSec,importedNbMissing,importedNbRSA,importedNbUid,importedNbSub,importedNbRev,readNbSec; + TQString importedNbSec,dupNbSec; parsedOutput=readmessage; - QStringList importedKeys; + TQStringList importedKeys; while (parsedOutput.find("IMPORTED")!=-1) { parsedOutput.remove(0,parsedOutput.find("IMPORTED")+8); @@ -521,7 +521,7 @@ void keyServer::slotimportresult(KProcess*) } else resultMessage=i18n("No key imported... \nCheck detailed log for more infos"); - QString lastID=QString("0x"+importedKeys.last().section(" ",0,0).right(8)); + TQString lastID=TQString("0x"+importedKeys.last().section(" ",0,0).right(8)); if (!lastID.isEmpty()) { //kdDebug(2100)<<"++++++++++imported key"<<lastID<<endl; @@ -539,7 +539,7 @@ void keyServer::slotimportresult(KProcess*) void keyServer::slotimportread(KProcIO *p) { - QString required; + TQString required; while (p->readln(required,true)!=-1) readmessage+=required+"\n"; } @@ -547,9 +547,9 @@ void keyServer::slotimportread(KProcIO *p) void keyServer::syncCombobox() { config->setGroup("Servers"); - QString serverList=config->readEntry("Server_List"); + TQString serverList=config->readEntry("Server_List"); - QString optionsServer=KgpgInterface::getGpgSetting("keyserver", KGpgSettings::gpgConfigPath()); + TQString optionsServer=KgpgInterface::getGpgSetting("keyserver", KGpgSettings::gpgConfigPath()); page->kCBexportks->clear(); page->kCBimportks->clear(); @@ -561,8 +561,8 @@ void keyServer::syncCombobox() else if ( serverList.isEmpty() ) serverList = "hkp://wwwkeys.eu.pgp.net,hkp://search.keyserver.net,hkp://wwwkeys.pgp.net,hkp://pgp.dtype.org,hkp://wwwkeys.us.pgp.net"; // same as ini kgpgoptions.cpp - page->kCBexportks->insertStringList(QStringList::split(",",serverList)); - page->kCBimportks->insertStringList(QStringList::split(",",serverList)); + page->kCBexportks->insertStringList(TQStringList::split(",",serverList)); + page->kCBimportks->insertStringList(TQStringList::split(",",serverList)); } void keyServer::slotOk() diff --git a/kgpg/keyservers.h b/kgpg/keyservers.h index e17af85..c1935f3 100644 --- a/kgpg/keyservers.h +++ b/kgpg/keyservers.h @@ -32,7 +32,7 @@ class keyServer : public KDialogBase { Q_OBJECT public: - keyServer(QWidget *parent=0, const char *name=0,bool modal=false,bool autoClose=false); + keyServer(TQWidget *parent=0, const char *name=0,bool modal=false,bool autoClose=false); ~keyServer(); keyServerWidget *page; @@ -51,20 +51,20 @@ public slots: void slotimportread(KProcIO *p); void slotprocread(KProcIO *p); void slotPreExport(); - void slotExport(QStringList keyIds); + void slotExport(TQStringList keyIds); void preimport(); void slotsearchresult(KProcess *); void slotEnableProxyI(bool on); void slotEnableProxyE(bool on); void handleQuit(); - void slotTextChanged( const QString &text); + void slotTextChanged( const TQString &text); private: - QDialog *importpop; + TQDialog *importpop; KSimpleConfig *config; uint keyNumbers; - QString readmessage; + TQString readmessage; KProcIO *importproc,*exportproc; KProcIO *searchproc; searchRes *listpop; @@ -74,7 +74,7 @@ private: KDialogBase *dialogServer; signals: - void importFinished(QString); + void importFinished(TQString); }; #endif // KEYSERVERS_H diff --git a/kgpg/kgpg.cpp b/kgpg/kgpg.cpp index a14ab64..223d7bd 100644 --- a/kgpg/kgpg.cpp +++ b/kgpg/kgpg.cpp @@ -17,15 +17,15 @@ #include <stdlib.h> -#include <qlabel.h> -#include <qclipboard.h> -#include <qfile.h> -#include <qpopupmenu.h> -#include <qwidget.h> -#include <qcheckbox.h> -#include <qmovie.h> -#include <qcstring.h> -#include <qhbuttongroup.h> +#include <tqlabel.h> +#include <tqclipboard.h> +#include <tqfile.h> +#include <tqpopupmenu.h> +#include <tqwidget.h> +#include <tqcheckbox.h> +#include <tqmovie.h> +#include <tqcstring.h> +#include <tqhbuttongroup.h> #include <kglobal.h> #include <kactivelabel.h> #include <kdeversion.h> @@ -34,16 +34,16 @@ #include <kapplication.h> #include <kmessagebox.h> #include <kcombobox.h> -#include <qregexp.h> +#include <tqregexp.h> #include <kcmdlineargs.h> -#include <qtooltip.h> +#include <tqtooltip.h> #include <kdebug.h> #include <kurlrequesterdlg.h> #include <klineedit.h> #include <kio/renamedlg.h> #include <kpassivepopup.h> -#include <qlayout.h> -#include <qbuttongroup.h> +#include <tqlayout.h> +#include <tqbuttongroup.h> #include <kiconloader.h> #include <ktempfile.h> #include <kwin.h> @@ -59,7 +59,7 @@ #include <kstandarddirs.h> #include <kfiledialog.h> #include <kpopupmenu.h> -#include <qcursor.h> +#include <tqcursor.h> #include <kdesktopfile.h> #include "kgpgeditor.h" @@ -74,31 +74,31 @@ #include "kgpglibrary.h" #include "kgpgwizard.h" -MyView::MyView( QWidget *parent, const char *name ) - : QLabel( parent, name ) +MyView::MyView( TQWidget *parent, const char *name ) + : TQLabel( parent, name ) { setBackgroundMode( X11ParentRelative ); openTasks=0; - KAction *saveDecrypt=new KAction(i18n("&Decrypt && Save File"),"decrypted",0,this, SLOT(decryptDroppedFile()),this,"decrypt_file"); - KAction *showDecrypt=new KAction(i18n("&Show Decrypted File"),"edit",0,this, SLOT(showDroppedFile()),this,"show_file"); - KAction *encrypt=new KAction(i18n("&Encrypt File"),"encrypted",0,this, SLOT(encryptDroppedFile()),this,"encrypt_file"); - KAction *sign=new KAction(i18n("&Sign File"), "signature",0,this, SLOT(signDroppedFile()),this,"sign_file"); - //QToolTip::add(this,i18n("KGpg drag & drop encryption applet")); + KAction *saveDecrypt=new KAction(i18n("&Decrypt && Save File"),"decrypted",0,this, TQT_SLOT(decryptDroppedFile()),this,"decrypt_file"); + KAction *showDecrypt=new KAction(i18n("&Show Decrypted File"),"edit",0,this, TQT_SLOT(showDroppedFile()),this,"show_file"); + KAction *encrypt=new KAction(i18n("&Encrypt File"),"encrypted",0,this, TQT_SLOT(encryptDroppedFile()),this,"encrypt_file"); + KAction *sign=new KAction(i18n("&Sign File"), "signature",0,this, TQT_SLOT(signDroppedFile()),this,"sign_file"); + //TQToolTip::add(this,i18n("KGpg drag & drop encryption applet")); readOptions(); resize(24,24); setPixmap( KSystemTray::loadIcon("kgpg_docked")); setAcceptDrops(true); - droppopup=new QPopupMenu(); + droppopup=new TQPopupMenu(); showDecrypt->plug(droppopup); saveDecrypt->plug(droppopup); - udroppopup=new QPopupMenu(); + udroppopup=new TQPopupMenu(); encrypt->plug(udroppopup); sign->plug(udroppopup); - QToolTip::add(this, i18n("KGpg - encryption tool")); + TQToolTip::add(this, i18n("KGpg - encryption tool")); } MyView::~MyView() @@ -114,26 +114,26 @@ MyView::~MyView() void MyView::clipEncrypt() { popupPublic *dialoguec=new popupPublic(0, "public_keys", 0,false,goDefaultKey); - connect(dialoguec,SIGNAL(selectedKey(QStringList,QStringList,bool,bool)),this,SLOT(encryptClipboard(QStringList,QStringList,bool,bool))); + connect(dialoguec,TQT_SIGNAL(selectedKey(TQStringList,TQStringList,bool,bool)),this,TQT_SLOT(encryptClipboard(TQStringList,TQStringList,bool,bool))); dialoguec->exec(); delete dialoguec; } void MyView::clipDecrypt() { - QString clippie=kapp->clipboard()->text(clipboardMode).stripWhiteSpace(); + TQString clippie=kapp->clipboard()->text(clipboardMode).stripWhiteSpace(); droppedtext(clippie,false); } void MyView::clipSign(bool openEditor) { - QString clippie=kapp->clipboard()->text(clipboardMode).stripWhiteSpace(); + TQString clippie=kapp->clipboard()->text(clipboardMode).stripWhiteSpace(); if (!clippie.isEmpty()) { KgpgApp *kgpgtxtedit = new KgpgApp(0, "editor",WDestructiveClose,goDefaultKey); - connect(this,SIGNAL(setFont(QFont)),kgpgtxtedit,SLOT(slotSetFont(QFont))); - connect(kgpgtxtedit,SIGNAL(encryptFiles(KURL::List)),this,SLOT(encryptFiles(KURL::List))); + connect(this,TQT_SIGNAL(setFont(TQFont)),kgpgtxtedit,TQT_SLOT(slotSetFont(TQFont))); + connect(kgpgtxtedit,TQT_SIGNAL(encryptFiles(KURL::List)),this,TQT_SLOT(encryptFiles(KURL::List))); if (!openEditor) - connect(kgpgtxtedit->view,SIGNAL(verifyFinished()),kgpgtxtedit,SLOT(closeWindow())); + connect(kgpgtxtedit->view,TQT_SIGNAL(verifyFinished()),kgpgtxtedit,TQT_SLOT(closeWindow())); kgpgtxtedit->view->editor->setText(clippie); kgpgtxtedit->view->clearSign(); kgpgtxtedit->show(); @@ -145,23 +145,23 @@ void MyView::clipSign(bool openEditor) void MyView::encryptDroppedFolder() { compressionScheme=0; - kgpgfoldertmp=new KTempFile(QString::null); + kgpgfoldertmp=new KTempFile(TQString::null); kgpgfoldertmp->setAutoDelete(true); if (KMessageBox::warningContinueCancel(0,i18n("<qt>KGpg will now create a temporary archive file:<br><b>%1</b> to process the encryption. The file will be deleted after the encryption is finished.</qt>").arg(kgpgfoldertmp->name()),i18n("Temporary File Creation"),KStdGuiItem::cont(),"FolderTmpFile")==KMessageBox::Cancel) return; dialogue=new popupPublic(0,"Public keys",droppedUrls.first().fileName(),true,goDefaultKey); - QHButtonGroup *bGroup = new QHButtonGroup(dialogue->plainPage()); - (void) new QLabel(i18n("Compression method for archive:"),bGroup); + TQHButtonGroup *bGroup = new TQHButtonGroup(dialogue->plainPage()); + (void) new TQLabel(i18n("Compression method for archive:"),bGroup); KComboBox *optionbx=new KComboBox(bGroup); optionbx->insertItem(i18n("Zip")); optionbx->insertItem(i18n("Gzip")); optionbx->insertItem(i18n("Bzip2")); bGroup->show(); - connect(dialogue,SIGNAL(keyListFilled ()),dialogue,SLOT(slotSetVisible())); - connect(optionbx,SIGNAL(activated (int)),this,SLOT(slotSetCompression(int))); - connect(dialogue,SIGNAL(selectedKey(QStringList,QStringList,bool,bool)),this,SLOT(startFolderEncode(QStringList,QStringList,bool,bool))); + connect(dialogue,TQT_SIGNAL(keyListFilled ()),dialogue,TQT_SLOT(slotSetVisible())); + connect(optionbx,TQT_SIGNAL(activated (int)),this,TQT_SLOT(slotSetCompression(int))); + connect(dialogue,TQT_SIGNAL(selectedKey(TQStringList,TQStringList,bool,bool)),this,TQT_SLOT(startFolderEncode(TQStringList,TQStringList,bool,bool))); dialogue->CBshred->setEnabled(false); dialogue->exec(); dialogue=0L; @@ -172,9 +172,9 @@ void MyView::slotSetCompression(int cp) compressionScheme=cp; } -void MyView::startFolderEncode(QStringList selec,QStringList encryptOptions,bool ,bool symetric) +void MyView::startFolderEncode(TQStringList selec,TQStringList encryptOptions,bool ,bool symetric) { -QString extension; +TQString extension; if (compressionScheme==0) extension=".zip"; @@ -191,11 +191,11 @@ if (encryptOptions.find("armor")!=encryptOptions.end () ) extension+=".gpg"; KURL encryptedFile(droppedUrls.first().path()+extension); -QFile encryptedFolder(droppedUrls.first().path()+extension); +TQFile encryptedFolder(droppedUrls.first().path()+extension); if (encryptedFolder.exists()) { dialogue->hide(); - KIO::RenameDlg *over=new KIO::RenameDlg(0,i18n("File Already Exists"),QString::null,encryptedFile.path(),KIO::M_OVERWRITE); - if (over->exec()==QDialog::Rejected) + KIO::RenameDlg *over=new KIO::RenameDlg(0,i18n("File Already Exists"),TQString::null,encryptedFile.path(),KIO::M_OVERWRITE); + if (over->exec()==TQDialog::Rejected) { delete over; return; @@ -232,8 +232,8 @@ pop = new KPassivePopup(); KgpgInterface *folderprocess=new KgpgInterface(); folderprocess->KgpgEncryptFile(selec,KURL(kgpgfoldertmp->name()),encryptedFile,encryptOptions,symetric); - connect(folderprocess,SIGNAL(encryptionfinished(KURL)),this,SLOT(slotFolderFinished(KURL))); - connect(folderprocess,SIGNAL(errormessage(QString)),this,SLOT(slotFolderFinishedError(QString))); + connect(folderprocess,TQT_SIGNAL(encryptionfinished(KURL)),this,TQT_SLOT(slotFolderFinished(KURL))); + connect(folderprocess,TQT_SIGNAL(errormessage(TQString)),this,TQT_SLOT(slotFolderFinishedError(TQString))); } void MyView::slotFolderFinished(KURL) @@ -242,22 +242,22 @@ void MyView::slotFolderFinished(KURL) delete kgpgfoldertmp; } -void MyView::slotFolderFinishedError(QString errmsge) +void MyView::slotFolderFinishedError(TQString errmsge) { delete pop; delete kgpgfoldertmp; KMessageBox::sorry(0,errmsge); } -void MyView::busyMessage(QString mssge,bool reset) +void MyView::busyMessage(TQString mssge,bool reset) { if (reset) openTasks=0; if (!mssge.isEmpty()) { openTasks++; -QToolTip::remove(this); -QToolTip::add(this, mssge); -setMovie(QMovie(locate("appdata","pics/kgpg_docked.gif"))); +TQToolTip::remove(this); +TQToolTip::add(this, mssge); +setMovie(TQMovie(locate("appdata","pics/kgpg_docked.gif"))); } else openTasks--; @@ -266,18 +266,18 @@ else openTasks--; if (openTasks<=0) { setPixmap( KSystemTray::loadIcon("kgpg_docked")); -QToolTip::remove(this); -QToolTip::add(this, i18n("KGpg - encryption tool")); +TQToolTip::remove(this); +TQToolTip::add(this, i18n("KGpg - encryption tool")); openTasks=0; } } void MyView::encryptDroppedFile() { - QStringList opts; + TQStringList opts; KgpgLibrary *lib=new KgpgLibrary(this,KGpgSettings::pgpExtension()); - connect(lib,SIGNAL(systemMessage(QString,bool)),this,SLOT(busyMessage(QString,bool))); - if (KGpgSettings::fileKey()!=QString::null) { + connect(lib,TQT_SIGNAL(systemMessage(TQString,bool)),this,TQT_SLOT(busyMessage(TQString,bool))); + if (KGpgSettings::fileKey()!=TQString::null) { if (KGpgSettings::allowUntrustedKeys()) opts<<"--always-trust"; if (KGpgSettings::asciiArmor()) @@ -286,9 +286,9 @@ void MyView::encryptDroppedFile() opts<<"--throw-keyid"; if (KGpgSettings::pgpCompatibility()) opts<<"--pgp6"; - lib->slotFileEnc(droppedUrls,opts,QStringList::split(" ",KGpgSettings::fileKey()),goDefaultKey); + lib->slotFileEnc(droppedUrls,opts,TQStringList::split(" ",KGpgSettings::fileKey()),goDefaultKey); } else - lib->slotFileEnc(droppedUrls,QString::null,QString::null,goDefaultKey); + lib->slotFileEnc(droppedUrls,TQString::null,TQString::null,goDefaultKey); } void MyView::encryptFiles(KURL::List urls) @@ -300,18 +300,18 @@ encryptDroppedFile(); void MyView::shredDroppedFile() { KDialogBase *shredConfirm=new KDialogBase( this, "confirm_shred", true,i18n("Shred Files"),KDialogBase::Ok | KDialogBase::Cancel); -QWidget *page = new QWidget(shredConfirm); +TQWidget *page = new TQWidget(shredConfirm); shredConfirm->setMainWidget(page); -QBoxLayout *layout=new QBoxLayout(page,QBoxLayout::TopToBottom,0); +TQBoxLayout *layout=new TQBoxLayout(page,TQBoxLayout::TopToBottom,0); layout->setAutoAdd(true); (void) new KActiveLabel( i18n("Do you really want to <a href=\"whatsthis:%1\">shred</a> these files?").arg(i18n( "<qt><p>You must be aware that <b>shredding is not secure</b> on all file systems, and that parts of the file may have been saved in a temporary file or in the spooler of your printer if you previously opened it in an editor or tried to print it. Only works on files (not on folders).</p></qt>")),page); KListBox *lb=new KListBox(page); lb->insertStringList(droppedUrls.toStringList()); -if (shredConfirm->exec()==QDialog::Accepted) +if (shredConfirm->exec()==TQDialog::Accepted) { KgpgLibrary *lib=new KgpgLibrary(this); - connect(lib,SIGNAL(systemMessage(QString,bool)),this,SLOT(busyMessage(QString,bool))); + connect(lib,TQT_SIGNAL(systemMessage(TQString,bool)),this,TQT_SLOT(busyMessage(TQString,bool))); lib->shredprocessenc(droppedUrls); } delete shredConfirm; @@ -324,17 +324,17 @@ void MyView::slotVerifyFile() if (droppedUrl.isEmpty()) return; - QString sigfile=QString::null; + TQString sigfile=TQString::null; ////////////////////////////////////// try to find detached signature. if (!droppedUrl.fileName().endsWith(".sig")) { sigfile=droppedUrl.path()+".sig"; - QFile fsig(sigfile); + TQFile fsig(sigfile); if (!fsig.exists()) { sigfile=droppedUrl.path()+".asc"; - QFile fsig(sigfile); + TQFile fsig(sigfile); ////////////// if no .asc or .sig signature file included, assume the file is internally signed if (!fsig.exists()) - sigfile=QString::null; + sigfile=TQString::null; } } else { sigfile=droppedUrl.path(); @@ -344,10 +344,10 @@ void MyView::slotVerifyFile() ///////////////////////// pipe gpg command KgpgInterface *verifyFileProcess=new KgpgInterface(); verifyFileProcess->KgpgVerifyFile(droppedUrl,KURL(sigfile)); - connect (verifyFileProcess,SIGNAL(verifyquerykey(QString)),this,SLOT(importSignature(QString))); + connect (verifyFileProcess,TQT_SIGNAL(verifyquerykey(TQString)),this,TQT_SLOT(importSignature(TQString))); } -void MyView::importSignature(QString ID) +void MyView::importSignature(TQString ID) { keyServer *kser=new keyServer(0,"server_dialog",false); kser->page->kLEimportid->setText(ID); @@ -360,17 +360,17 @@ void MyView::signDroppedFile() if (droppedUrl.isEmpty()) return; - QString signKeyID; + TQString signKeyID; ////////////////// select a private key to sign file --> listkeys.cpp KgpgSelKey *opts=new KgpgSelKey(0,"select_secret"); - if (opts->exec()==QDialog::Accepted) + if (opts->exec()==TQDialog::Accepted) signKeyID=opts->getkeyID(); else { delete opts; return; } delete opts; - QStringList Options; + TQStringList Options; if (KGpgSettings::asciiArmor()) Options<<"--armor"; if (KGpgSettings::pgpCompatibility()) @@ -389,7 +389,7 @@ void MyView::decryptDroppedFile() decryptNextFile(); } - QString oldname=droppedUrls.first().fileName(); + TQString oldname=droppedUrls.first().fileName(); if (oldname.endsWith(".gpg") || oldname.endsWith(".asc") || oldname.endsWith(".pgp")) oldname.truncate(oldname.length()-4); else @@ -397,17 +397,17 @@ void MyView::decryptDroppedFile() /* if (oldname.endsWith(".tar.gz")) { isFolder=true; - kgpgFolderExtract=new KTempFile(QString::null,".tar.gz"); + kgpgFolderExtract=new KTempFile(TQString::null,".tar.gz"); kgpgFolderExtract->setAutoDelete(true); swapname=KURL(kgpgFolderExtract->name()); if (KMessageBox::warningContinueCancel(0,i18n("<qt>The file to decrypt is an archive. KGpg will create a temporary unencrypted archive file:<br><b>%1</b> before processing the archive extraction. This temporary file will be deleted after the decryption is finished.</qt>").arg(kgpgFolderExtract->name()),i18n("Temporary File Creation"),KStdGuiItem::cont(),"FolderTmpDecFile")==KMessageBox::Cancel) return; } else*/ { swapname=KURL(droppedUrls.first().directory(0,0)+oldname); - QFile fgpg(swapname.path()); + TQFile fgpg(swapname.path()); if (fgpg.exists()) { - KIO::RenameDlg *over=new KIO::RenameDlg(0,i18n("File Already Exists"),QString::null,swapname.path(),KIO::M_OVERWRITE); - if (over->exec()==QDialog::Rejected) + KIO::RenameDlg *over=new KIO::RenameDlg(0,i18n("File Already Exists"),TQString::null,swapname.path(),KIO::M_OVERWRITE); + if (over->exec()==TQDialog::Rejected) { delete over; decryptNextFile(); @@ -419,10 +419,10 @@ void MyView::decryptDroppedFile() } KgpgLibrary *lib=new KgpgLibrary(this); lib->slotFileDec(droppedUrls.first(),swapname,KGpgSettings::customDecrypt()); - connect(lib,SIGNAL(importOver(QStringList)),this,SIGNAL(importedKeys(QStringList))); - connect(lib,SIGNAL(systemMessage(QString,bool)),this,SLOT(busyMessage(QString,bool))); + connect(lib,TQT_SIGNAL(importOver(TQStringList)),this,TQT_SIGNAL(importedKeys(TQStringList))); + connect(lib,TQT_SIGNAL(systemMessage(TQString,bool)),this,TQT_SLOT(busyMessage(TQString,bool))); // if (isFolder) - connect(lib,SIGNAL(decryptionOver()),this,SLOT(decryptNextFile())); + connect(lib,TQT_SIGNAL(decryptionOver()),this,TQT_SLOT(decryptNextFile())); } @@ -446,7 +446,7 @@ void MyView::unArchive() //KURL savePath=KURL::getURL(droppedUrl,this,i18n("")); KURLRequesterDlg *savePath=new KURLRequesterDlg(droppedUrl.directory(false),i18n("Extract to: "),0,"extract"); savePath->fileDialog()->setMode(KFile::Directory); - if (!savePath->exec()==QDialog::Accepted) { + if (!savePath->exec()==TQDialog::Accepted) { delete kgpgFolderExtract; return; } @@ -462,10 +462,10 @@ void MyView::showDroppedFile() kdDebug(2100)<<"------Show dropped file"<<endl; KgpgApp *kgpgtxtedit = new KgpgApp(0, "editor",WDestructiveClose,goDefaultKey); kgpgtxtedit->view->editor->slotDroppedFile(droppedUrls.first()); - connect(kgpgtxtedit,SIGNAL(encryptFiles(KURL::List)),this,SLOT(encryptFiles(KURL::List))); - connect(this,SIGNAL(setFont(QFont)),kgpgtxtedit,SLOT(slotSetFont(QFont))); - connect(kgpgtxtedit,SIGNAL(refreshImported(QStringList)),this,SIGNAL(importedKeys(QStringList))); - connect(kgpgtxtedit->view->editor,SIGNAL(refreshImported(QStringList)),this,SIGNAL(importedKeys(QStringList))); + connect(kgpgtxtedit,TQT_SIGNAL(encryptFiles(KURL::List)),this,TQT_SLOT(encryptFiles(KURL::List))); + connect(this,TQT_SIGNAL(setFont(TQFont)),kgpgtxtedit,TQT_SLOT(slotSetFont(TQFont))); + connect(kgpgtxtedit,TQT_SIGNAL(refreshImported(TQStringList)),this,TQT_SIGNAL(importedKeys(TQStringList))); + connect(kgpgtxtedit->view->editor,TQT_SIGNAL(refreshImported(TQStringList)),this,TQT_SIGNAL(importedKeys(TQStringList))); kgpgtxtedit->show(); } @@ -493,7 +493,7 @@ void MyView::droppedfile (KURL::List url) showDroppedFile(); break; case KGpgSettings::EnumEncryptedDropEvent::Ask: - droppopup->exec(QCursor::pos ()); + droppopup->exec(TQCursor::pos ()); kdDebug(2100)<<"Drop menu--------"<<endl; break; } @@ -508,19 +508,19 @@ void MyView::droppedfile (KURL::List url) signDroppedFile(); break; case KGpgSettings::EnumUnencryptedDropEvent::Ask: - udroppopup->exec(QCursor::pos ()); + udroppopup->exec(TQCursor::pos ()); break; } } -void MyView::droppedtext (QString inputText,bool allowEncrypt) +void MyView::droppedtext (TQString inputText,bool allowEncrypt) { if (inputText.startsWith("-----BEGIN PGP MESSAGE")) { KgpgApp *kgpgtxtedit = new KgpgApp(0, "editor",WDestructiveClose,goDefaultKey); - connect(kgpgtxtedit,SIGNAL(encryptFiles(KURL::List)),this,SLOT(encryptFiles(KURL::List))); - connect(this,SIGNAL(setFont(QFont)),kgpgtxtedit,SLOT(slotSetFont(QFont))); + connect(kgpgtxtedit,TQT_SIGNAL(encryptFiles(KURL::List)),this,TQT_SLOT(encryptFiles(KURL::List))); + connect(this,TQT_SIGNAL(setFont(TQFont)),kgpgtxtedit,TQT_SLOT(slotSetFont(TQFont))); kgpgtxtedit->view->editor->setText(inputText); kgpgtxtedit->view->slotdecode(); kgpgtxtedit->show(); @@ -533,7 +533,7 @@ void MyView::droppedtext (QString inputText,bool allowEncrypt) else { KgpgInterface *importKeyProcess=new KgpgInterface(); importKeyProcess->importKey(inputText); - connect(importKeyProcess,SIGNAL(importfinished(QStringList)),this,SIGNAL(importedKeys(QStringList))); + connect(importKeyProcess,TQT_SIGNAL(importfinished(TQStringList)),this,TQT_SIGNAL(importedKeys(TQStringList))); return; } } @@ -546,21 +546,21 @@ void MyView::droppedtext (QString inputText,bool allowEncrypt) } -void MyView::dragEnterEvent(QDragEnterEvent *e) +void MyView::dragEnterEvent(TQDragEnterEvent *e) { - e->accept (KURLDrag::canDecode(e) || QTextDrag::canDecode (e)); + e->accept (KURLDrag::canDecode(e) || TQTextDrag::canDecode (e)); } -void MyView::dropEvent (QDropEvent *o) +void MyView::dropEvent (TQDropEvent *o) { KURL::List list; - QString text; + TQString text; if ( KURLDrag::decode( o, list ) ) droppedfile(list); - else if ( QTextDrag::decode(o, text) ) + else if ( TQTextDrag::decode(o, text) ) { - QApplication::clipboard()->setText(text,clipboardMode); + TQApplication::clipboard()->setText(text,clipboardMode); droppedtext(text); } } @@ -575,12 +575,12 @@ void MyView::readOptions() if (KGpgSettings::firstRun()) { firstRun(); } else { - QString path = KGpgSettings::gpgConfigPath(); + TQString path = KGpgSettings::gpgConfigPath(); if (path.isEmpty()) { - if (KMessageBox::questionYesNo(0,i18n("<qt>You have not set a path to your GnuPG config file.<br>This may cause some surprising results in KGpg's execution.<br>Would you like to start KGpg's Wizard to fix this problem?</qt>"),QString::null,i18n("Start Wizard"),i18n("Do Not Start"))==KMessageBox::Yes) + if (KMessageBox::questionYesNo(0,i18n("<qt>You have not set a path to your GnuPG config file.<br>This may cause some surprising results in KGpg's execution.<br>Would you like to start KGpg's Wizard to fix this problem?</qt>"),TQString::null,i18n("Start Wizard"),i18n("Do Not Start"))==KMessageBox::Yes) startWizard(); } else { - QStringList groups=KgpgInterface::getGpgGroupNames(path); + TQStringList groups=KgpgInterface::getGpgGroupNames(path); if (!groups.isEmpty()) KGpgSettings::setGroups(groups.join(",")); } @@ -597,10 +597,10 @@ void MyView::firstRun() } -static QString getGpgHome() +static TQString getGpgHome() { char *env=getenv("GNUPGHOME"); - QString gpgHome(env ? env : QDir::homeDirPath()+"/.gnupg/"); + TQString gpgHome(env ? env : TQDir::homeDirPath()+"/.gnupg/"); gpgHome.replace("//", "/"); @@ -616,29 +616,29 @@ void MyView::startWizard() { kdDebug(2100)<<"Starting Wizard"<<endl; wiz=new KgpgWizard(0,"wizard"); - QString gpgHome(getGpgHome()); - QString confPath=gpgHome+"options"; - if (!QFile(confPath).exists()) { + TQString gpgHome(getGpgHome()); + TQString confPath=gpgHome+"options"; + if (!TQFile(confPath).exists()) { confPath=gpgHome+"gpg.conf"; - if (!QFile(confPath).exists()) { - if (KMessageBox::questionYesNo(this,i18n("<qt><b>The GnuPG configuration file was not found</b>. Please make sure you have GnuPG installed. Should KGpg try to create a config file ?</qt>"),QString::null,i18n("Create Config"),i18n("Do Not Create"))==KMessageBox::Yes) { + if (!TQFile(confPath).exists()) { + if (KMessageBox::questionYesNo(this,i18n("<qt><b>The GnuPG configuration file was not found</b>. Please make sure you have GnuPG installed. Should KGpg try to create a config file ?</qt>"),TQString::null,i18n("Create Config"),i18n("Do Not Create"))==KMessageBox::Yes) { confPath=gpgHome+"options"; - QFile file(confPath); + TQFile file(confPath); if ( file.open( IO_WriteOnly ) ) { - QTextStream stream( &file ); + TQTextStream stream( &file ); stream <<"# GnuPG config file created by KGpg"<< "\n"; file.close(); } } else { wiz->text_optionsfound->setText(i18n("<qt><b>The GnuPG configuration file was not found</b>. Please make sure you have GnuPG installed and give the path to the config file.</qt>")); - confPath=QString::null; + confPath=TQString::null; } } } int gpgVersion=KgpgInterface::getGpgVersion(); if (gpgVersion<120) wiz->txtGpgVersion->setText(i18n("Your GnuPG version seems to be older than 1.2.0. Photo Id's and Key Groups will not work properly. Please consider upgrading GnuPG (http://gnupg.org).")); - else wiz->txtGpgVersion->setText(QString::null); + else wiz->txtGpgVersion->setText(TQString::null); wiz->kURLRequester1->setURL(confPath); /* @@ -646,20 +646,20 @@ void MyView::startWizard() wiz->kURLRequester2->setMode(2);*/ FILE *fp,*fp2; - QString tst,tst2,name,trustedvals="idre-"; - QString firstKey=QString::null; + TQString tst,tst2,name,trustedvals="idre-"; + TQString firstKey=TQString::null; char line[300]; bool counter=false; fp = popen("gpg --display-charset=utf-8 --no-tty --with-colon --list-secret-keys", "r"); while ( fgets( line, sizeof(line), fp)) { - tst=QString::fromUtf8(line); + tst=TQString::fromUtf8(line); if (tst.startsWith("sec")) { name=KgpgInterface::checkForUtf8(tst.section(':',9,9)); if (!name.isEmpty()) { - fp2 = popen("gpg --display-charset=utf-8 --no-tty --with-colon --list-keys "+QFile::encodeName(tst.section(':',4,4)), "r"); + fp2 = popen("gpg --display-charset=utf-8 --no-tty --with-colon --list-keys "+TQFile::encodeName(tst.section(':',4,4)), "r"); while ( fgets( line, sizeof(line), fp2)) { - tst2=QString::fromUtf8(line); + tst2=TQString::fromUtf8(line); if (tst2.startsWith("pub") && (trustedvals.find(tst2.section(':',1,1))==-1)) { counter=true; wiz->CBdefault->insertItem(tst.section(':',4,4).right(8)+": "+name); @@ -674,17 +674,17 @@ void MyView::startWizard() } pclose(fp); wiz->CBdefault->setCurrentItem(firstKey); - //connect(wiz->pushButton4,SIGNAL(clicked()),this,SLOT(slotGenKey())); + //connect(wiz->pushButton4,TQT_SIGNAL(clicked()),this,TQT_SLOT(slotGenKey())); if (!counter) - connect(wiz->finishButton(),SIGNAL(clicked()),this,SLOT(slotGenKey())); + connect(wiz->finishButton(),TQT_SIGNAL(clicked()),this,TQT_SLOT(slotGenKey())); else { wiz->textGenerate->hide(); wiz->setTitle(wiz->page_4,i18n("Step Three: Select your Default Private Key")); - connect(wiz->finishButton(),SIGNAL(clicked()),this,SLOT(slotSaveOptionsPath())); + connect(wiz->finishButton(),TQT_SIGNAL(clicked()),this,TQT_SLOT(slotSaveOptionsPath())); } - connect(wiz->nextButton(),SIGNAL(clicked()),this,SLOT(slotWizardChange())); - connect( wiz , SIGNAL( destroyed() ) , this, SLOT( slotWizardClose())); - connect(wiz,SIGNAL(helpClicked()),this,SLOT(help())); + connect(wiz->nextButton(),TQT_SIGNAL(clicked()),this,TQT_SLOT(slotWizardChange())); + connect( wiz , TQT_SIGNAL( destroyed() ) , this, TQT_SLOT( slotWizardClose())); + connect(wiz,TQT_SIGNAL(helpClicked()),this,TQT_SLOT(help())); wiz->setFinishEnabled(wiz->page_4,true); wiz->show(); @@ -692,17 +692,17 @@ void MyView::startWizard() void MyView::slotWizardChange() { - QString tst,name; + TQString tst,name; char line[300]; FILE *fp; if (wiz->indexOf(wiz->currentPage())==2) { - QString defaultID=KgpgInterface::getGpgSetting("default-key",wiz->kURLRequester1->url()); + TQString defaultID=KgpgInterface::getGpgSetting("default-key",wiz->kURLRequester1->url()); if (defaultID.isEmpty()) return; - fp = popen("gpg --display-charset=utf-8 --no-tty --with-colon --list-secret-keys "+QFile::encodeName(defaultID), "r"); + fp = popen("gpg --display-charset=utf-8 --no-tty --with-colon --list-secret-keys "+TQFile::encodeName(defaultID), "r"); while ( fgets( line, sizeof(line), fp)) { - tst=QString::fromUtf8(line); + tst=TQString::fromUtf8(line); if (tst.startsWith("sec")) { name=KgpgInterface::checkForUtf8(tst.section(':',9,9)); wiz->CBdefault->setCurrentItem(tst.section(':',4,4).right(8)+": "+name); @@ -737,7 +737,7 @@ qWarning("Save wizard settings..."); KGpgSettings::setGpgConfigPath( wiz->kURLRequester1->url() ); KGpgSettings::setFirstRun( false ); - QString defaultID=wiz->CBdefault->currentText().section(':',0,0); + TQString defaultID=wiz->CBdefault->currentText().section(':',0,0); /* if (!defaultID.isEmpty()) { KGpgSettings::setDefaultKey(defaultID); }*/ @@ -771,25 +771,25 @@ void MyView::help() kapp->invokeHelp(0,"kgpg"); } -kgpgapplet::kgpgapplet(QWidget *parent, const char *name) +kgpgapplet::kgpgapplet(TQWidget *parent, const char *name) : KSystemTray(parent,name) { w=new MyView(this); w->show(); KPopupMenu *conf_menu=contextMenu(); - KgpgEncryptClipboard = new KAction(i18n("&Encrypt Clipboard"), "kgpg", 0,w, SLOT(clipEncrypt()),actionCollection(),"clip_encrypt"); - KgpgDecryptClipboard = new KAction(i18n("&Decrypt Clipboard"), 0, 0,w, SLOT(clipDecrypt()),actionCollection(),"clip_decrypt"); - KgpgSignClipboard = new KAction(i18n("&Sign/Verify Clipboard"), "signature", 0,w, SLOT(clipSign()),actionCollection(),"clip_sign"); + KgpgEncryptClipboard = new KAction(i18n("&Encrypt Clipboard"), "kgpg", 0,w, TQT_SLOT(clipEncrypt()),actionCollection(),"clip_encrypt"); + KgpgDecryptClipboard = new KAction(i18n("&Decrypt Clipboard"), 0, 0,w, TQT_SLOT(clipDecrypt()),actionCollection(),"clip_decrypt"); + KgpgSignClipboard = new KAction(i18n("&Sign/Verify Clipboard"), "signature", 0,w, TQT_SLOT(clipSign()),actionCollection(),"clip_sign"); KAction *KgpgOpenEditor; if (KGpgSettings::leftClick()==KGpgSettings::EnumLeftClick::KeyManager) - KgpgOpenEditor = new KAction(i18n("&Open Editor"), "edit", 0,parent, SLOT(slotOpenEditor()),actionCollection(),"kgpg_editor"); + KgpgOpenEditor = new KAction(i18n("&Open Editor"), "edit", 0,parent, TQT_SLOT(slotOpenEditor()),actionCollection(),"kgpg_editor"); else - KgpgOpenEditor = new KAction(i18n("&Open Key Manager"), "kgpg", 0,this, SLOT(slotOpenKeyManager()),actionCollection(),"kgpg_editor"); + KgpgOpenEditor = new KAction(i18n("&Open Key Manager"), "kgpg", 0,this, TQT_SLOT(slotOpenKeyManager()),actionCollection(),"kgpg_editor"); - KAction *KgpgOpenServer = new KAction(i18n("&Key Server Dialog"), "network", 0,this, SLOT(slotOpenServerDialog()),actionCollection(),"kgpg_server"); - KAction *KgpgPreferences=KStdAction::preferences(this, SLOT(showOptions()), actionCollection()); + KAction *KgpgOpenServer = new KAction(i18n("&Key Server Dialog"), "network", 0,this, TQT_SLOT(slotOpenServerDialog()),actionCollection(),"kgpg_server"); + KAction *KgpgPreferences=KStdAction::preferences(this, TQT_SLOT(showOptions()), actionCollection()); - connect (conf_menu,SIGNAL(aboutToShow()),this,SLOT(checkMenu())); + connect (conf_menu,TQT_SIGNAL(aboutToShow()),this,TQT_SLOT(checkMenu())); KgpgEncryptClipboard->plug(conf_menu); KgpgDecryptClipboard->plug(conf_menu); @@ -820,21 +820,21 @@ void kgpgapplet::checkMenu() void kgpgapplet::showOptions() { -QByteArray data; +TQByteArray data; if (!kapp->dcopClient()->send("kgpg", "KeyInterface", "showOptions()",data)) kdDebug(2100) <<"there was some error using DCOP."<<endl; } void kgpgapplet::slotOpenKeyManager() { -QByteArray data; +TQByteArray data; if (!kapp->dcopClient()->send("kgpg", "KeyInterface", "showKeyManager()",data)) kdDebug(2100) <<"there was some error using DCOP."<<endl; } void kgpgapplet::slotOpenServerDialog() { -QByteArray data; +TQByteArray data; if (!kapp->dcopClient()->send("kgpg", "KeyInterface", "showKeyServer()",data)) kdDebug(2100) <<"there was some error using DCOP."<<endl; } @@ -876,7 +876,7 @@ s_keyManager->keysList2->saveLayout(KGlobal::config(),"KeyView"); quit(); } -void KgpgAppletApp::wizardOver(QString defaultKeyId) +void KgpgAppletApp::wizardOver(TQString defaultKeyId) { if (defaultKeyId.length()==10) s_keyManager->slotSetDefaultKey(defaultKeyId); @@ -897,9 +897,9 @@ int KgpgAppletApp::newInstance() s_keyManager=new listKeys(0, "key_manager"); - QString gpgPath= KGpgSettings::gpgConfigPath(); - if (!gpgPath.isEmpty() && KURL(gpgPath).directory(false)!=QDir::homeDirPath()+"/.gnupg/") - setenv("GNUPGHOME", QFile::encodeName(KURL::fromPathOrURL(gpgPath).directory(false)), 1); + TQString gpgPath= KGpgSettings::gpgConfigPath(); + if (!gpgPath.isEmpty() && KURL(gpgPath).directory(false)!=TQDir::homeDirPath()+"/.gnupg/") + setenv("GNUPGHOME", TQFile::encodeName(KURL::fromPathOrURL(gpgPath).directory(false)), 1); s_keyManager->refreshkey(); @@ -909,16 +909,16 @@ int KgpgAppletApp::newInstance() { kgpg_applet=new kgpgapplet(s_keyManager->s_kgpgEditor,"kgpg_systrayapplet"); } - connect(s_keyManager,SIGNAL(encryptFiles(KURL::List)),kgpg_applet->w,SLOT(encryptFiles(KURL::List))); - connect(s_keyManager,SIGNAL(installShredder()),kgpg_applet->w,SLOT(installShred())); - connect(s_keyManager->s_kgpgEditor,SIGNAL(encryptFiles(KURL::List)),kgpg_applet->w,SLOT(encryptFiles(KURL::List))); - - connect( kgpg_applet, SIGNAL(quitSelected()), this, SLOT(slotHandleQuit())); - connect(s_keyManager,SIGNAL(readAgainOptions()),kgpg_applet->w,SLOT(readOptions())); - connect(kgpg_applet->w,SIGNAL(updateDefault(QString)),this,SLOT(wizardOver(QString))); - connect(kgpg_applet->w,SIGNAL(createNewKey()),s_keyManager,SLOT(slotgenkey())); - connect(s_keyManager,SIGNAL(fontChanged(QFont)),kgpg_applet->w,SIGNAL(setFont(QFont))); - connect(kgpg_applet->w,SIGNAL(importedKeys(QStringList)),s_keyManager->keysList2,SLOT(slotReloadKeys(QStringList))); + connect(s_keyManager,TQT_SIGNAL(encryptFiles(KURL::List)),kgpg_applet->w,TQT_SLOT(encryptFiles(KURL::List))); + connect(s_keyManager,TQT_SIGNAL(installShredder()),kgpg_applet->w,TQT_SLOT(installShred())); + connect(s_keyManager->s_kgpgEditor,TQT_SIGNAL(encryptFiles(KURL::List)),kgpg_applet->w,TQT_SLOT(encryptFiles(KURL::List))); + + connect( kgpg_applet, TQT_SIGNAL(quitSelected()), this, TQT_SLOT(slotHandleQuit())); + connect(s_keyManager,TQT_SIGNAL(readAgainOptions()),kgpg_applet->w,TQT_SLOT(readOptions())); + connect(kgpg_applet->w,TQT_SIGNAL(updateDefault(TQString)),this,TQT_SLOT(wizardOver(TQString))); + connect(kgpg_applet->w,TQT_SIGNAL(createNewKey()),s_keyManager,TQT_SLOT(slotgenkey())); + connect(s_keyManager,TQT_SIGNAL(fontChanged(TQFont)),kgpg_applet->w,TQT_SIGNAL(setFont(TQFont))); + connect(kgpg_applet->w,TQT_SIGNAL(importedKeys(TQStringList)),s_keyManager->keysList2,TQT_SLOT(slotReloadKeys(TQStringList))); kgpg_applet->show(); @@ -954,8 +954,8 @@ int KgpgAppletApp::newInstance() kgpg_applet->w->droppedUrl=urlList.first(); bool directoryInside=false; - QStringList lst=urlList.toStringList(); - for ( QStringList::Iterator it = lst.begin(); it != lst.end(); ++it ) { + TQStringList lst=urlList.toStringList(); + for ( TQStringList::Iterator it = lst.begin(); it != lst.end(); ++it ) { if (KMimeType::findByURL(KURL( *it ))->name()=="inode/directory") directoryInside=true; } @@ -1006,10 +1006,10 @@ int KgpgAppletApp::newInstance() ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -void MyView::encryptClipboard(QStringList selec,QStringList encryptOptions,bool,bool symmetric) +void MyView::encryptClipboard(TQStringList selec,TQStringList encryptOptions,bool,bool symmetric) { if (kapp->clipboard()->text(clipboardMode).isEmpty()) { - KPassivePopup::message(i18n("Clipboard is empty."),QString::null,KGlobal::iconLoader()->loadIcon("kgpg",KIcon::Desktop),this); + KPassivePopup::message(i18n("Clipboard is empty."),TQString::null,KGlobal::iconLoader()->loadIcon("kgpg",KIcon::Desktop),this); return; } if (KGpgSettings::pgpCompatibility()) @@ -1018,34 +1018,34 @@ void MyView::encryptClipboard(QStringList selec,QStringList encryptOptions,bool, if (symmetric) selec.clear(); KgpgInterface *txtEncrypt=new KgpgInterface(); - connect (txtEncrypt,SIGNAL(txtencryptionfinished(QString)),this,SLOT(slotSetClip(QString))); - connect (txtEncrypt,SIGNAL(txtencryptionstarted()),this,SLOT(slotPassiveClip())); + connect (txtEncrypt,TQT_SIGNAL(txtencryptionfinished(TQString)),this,TQT_SLOT(slotSetClip(TQString))); + connect (txtEncrypt,TQT_SIGNAL(txtencryptionstarted()),this,TQT_SLOT(slotPassiveClip())); txtEncrypt->KgpgEncryptText(kapp->clipboard()->text(clipboardMode),selec,encryptOptions); } void MyView::slotPassiveClip() { -QString newtxt=kapp->clipboard()->text(clipboardMode); +TQString newtxt=kapp->clipboard()->text(clipboardMode); if (newtxt.length()>300) - newtxt=QString(newtxt.left(250).stripWhiteSpace())+"...\n"+QString(newtxt.right(40).stripWhiteSpace()); + newtxt=TQString(newtxt.left(250).stripWhiteSpace())+"...\n"+TQString(newtxt.right(40).stripWhiteSpace()); - newtxt.replace(QRegExp("<"),"<"); ///// disable html tags - newtxt.replace(QRegExp("\n"),"<br>"); + newtxt.replace(TQRegExp("<"),"<"); ///// disable html tags + newtxt.replace(TQRegExp("\n"),"<br>"); pop = new KPassivePopup( this); pop->setView(i18n("Encrypted following text:"),newtxt,KGlobal::iconLoader()->loadIcon("kgpg",KIcon::Desktop)); pop->setTimeout(3200); pop->show(); - QRect qRect(QApplication::desktop()->screenGeometry()); + TQRect qRect(TQApplication::desktop()->screenGeometry()); int iXpos=qRect.width()/2-pop->width()/2; int iYpos=qRect.height()/2-pop->height()/2; pop->move(iXpos,iYpos); } -void MyView::slotSetClip(QString newtxt) +void MyView::slotSetClip(TQString newtxt) { if (newtxt.isEmpty()) return; - QApplication::clipboard()->setText(newtxt,clipboardMode);//,QClipboard::Clipboard); QT 3.1 only + TQApplication::clipboard()->setText(newtxt,clipboardMode);//,QClipboard::Clipboard); QT 3.1 only } diff --git a/kgpg/kgpg.h b/kgpg/kgpg.h index aff3d18..94d8f59 100644 --- a/kgpg/kgpg.h +++ b/kgpg/kgpg.h @@ -28,9 +28,9 @@ #include <kurl.h> #include <kshortcut.h> -#include <qlabel.h> -#include <qstringlist.h> -#include <qclipboard.h> +#include <tqlabel.h> +#include <tqstringlist.h> +#include <tqclipboard.h> class QPopupMenu; @@ -46,7 +46,7 @@ class MyView : public QLabel Q_OBJECT public: - MyView( QWidget *parent = 0, const char *name = 0); + MyView( TQWidget *parent = 0, const char *name = 0); ~MyView(); KURL droppedUrl; @@ -56,9 +56,9 @@ public: QClipboard::Mode clipboardMode; private: - QPopupMenu *droppopup,*udroppopup; + TQPopupMenu *droppopup,*udroppopup; KAboutData *_aboutData; - QStringList customDecrypt; + TQStringList customDecrypt; KgpgWizard *wiz; KPassivePopup *pop; KTempFile *kgpgFolderExtract; @@ -66,7 +66,7 @@ private: popupPublic *dialogue; public slots: - void busyMessage(QString mssge,bool reset=false); + void busyMessage(TQString mssge,bool reset=false); void encryptDroppedFile(); void decryptDroppedFile(); void slotVerifyFile(); @@ -77,9 +77,9 @@ public slots: void clipEncrypt(); void shredDroppedFile(); void encryptDroppedFolder(); - void startFolderEncode(QStringList selec,QStringList encryptOptions,bool ,bool symetric); + void startFolderEncode(TQStringList selec,TQStringList encryptOptions,bool ,bool symetric); void slotFolderFinished(KURL); - void slotFolderFinishedError(QString errmsge); + void slotFolderFinishedError(TQString errmsge); void encryptFiles(KURL::List urls); void installShred(); @@ -89,33 +89,33 @@ private slots: void slotWizardChange(); void slotSaveOptionsPath(); void slotGenKey(); - void importSignature(QString ID); - void slotSetClip(QString newtxt); + void importSignature(TQString ID); + void slotSetClip(TQString newtxt); void slotPassiveClip(); - void encryptClipboard(QStringList selec,QStringList encryptOptions,bool,bool symmetric); + void encryptClipboard(TQStringList selec,TQStringList encryptOptions,bool,bool symmetric); void help(); void about(); void firstRun(); void readOptions(); void droppedfile (KURL::List); - void droppedtext (QString inputText, bool allowEncrypt=true); + void droppedtext (TQString inputText, bool allowEncrypt=true); void unArchive(); void slotSetCompression(int cp); void decryptNextFile(); protected: - virtual void dragEnterEvent(QDragEnterEvent *); - virtual void dropEvent (QDropEvent*); + virtual void dragEnterEvent(TQDragEnterEvent *); + virtual void dropEvent (TQDropEvent*); protected slots: signals: - void setFont(QFont); + void setFont(TQFont); void readAgain2(); void createNewKey(); - void updateDefault(QString); - void importedKeys(QStringList); + void updateDefault(TQString); + void importedKeys(TQStringList); }; class kgpgapplet : public KSystemTray//KUniqueApplication @@ -123,7 +123,7 @@ class kgpgapplet : public KSystemTray//KUniqueApplication Q_OBJECT public: - kgpgapplet( QWidget *parent = 0, const char *name = 0); + kgpgapplet( TQWidget *parent = 0, const char *name = 0); /** destructor */ ~kgpgapplet(); MyView *w; @@ -161,7 +161,7 @@ private: private slots: void slotHandleQuit(); - void wizardOver(QString defaultKeyId); + void wizardOver(TQString defaultKeyId); }; #endif // KGPGAPPLET_H diff --git a/kgpg/kgpgeditor.cpp b/kgpg/kgpgeditor.cpp index 9db9ce3..269f5ea 100644 --- a/kgpg/kgpgeditor.cpp +++ b/kgpg/kgpgeditor.cpp @@ -21,20 +21,20 @@ #include <kfiledialog.h> #include <klocale.h> #include <dcopclient.h> -#include <qpaintdevicemetrics.h> -#include <qcstring.h> +#include <tqpaintdevicemetrics.h> +#include <tqcstring.h> #include <kencodingfiledialog.h> -#include <qradiobutton.h> -#include <qclipboard.h> -#include <qtextcodec.h> -#include <qpainter.h> +#include <tqradiobutton.h> +#include <tqclipboard.h> +#include <tqtextcodec.h> +#include <tqpainter.h> #include <kprinter.h> #include <kmessagebox.h> #include <kdebug.h> #include <klineedit.h> -#include <qcheckbox.h> +#include <tqcheckbox.h> #include <kurlrequester.h> #include <ktempfile.h> #include <kio/netaccess.h> @@ -53,10 +53,10 @@ #include "listkeys.h" #include "kgpglibrary.h" -KgpgApp::KgpgApp(QWidget *parent, const char *name, WFlags f,KShortcut goHome,bool mainWindow):KMainWindow(parent, name,f) +KgpgApp::KgpgApp(TQWidget *parent, const char *name, WFlags f,KShortcut goHome,bool mainWindow):KMainWindow(parent, name,f) { isMainWindow=mainWindow; - textEncoding=QString::null; + textEncoding=TQString::null; readOptions(); goDefaultKey=goHome; // call inits to invoke all other construction parts @@ -77,19 +77,19 @@ delete view; void KgpgApp::slotOptions() { -QByteArray data; +TQByteArray data; if (!kapp->dcopClient()->send("kgpg", "KeyInterface", "showOptions()",data)) kdDebug(2100) <<"there was some error using DCOP."<<endl; } void KgpgApp::slotKeyManager() { -QByteArray data; +TQByteArray data; if (!kapp->dcopClient()->send("kgpg", "KeyInterface", "showKeyManager()",data)) kdDebug(2100) <<"there was some error using DCOP."<<endl; } -void KgpgApp::closeEvent ( QCloseEvent * e ) +void KgpgApp::closeEvent ( TQCloseEvent * e ) { if (!isMainWindow) { @@ -114,10 +114,10 @@ void KgpgApp::saveOptions() void KgpgApp::readOptions(bool doresize) { - customDecrypt=QStringList::split(QString(" "), KGpgSettings::customDecrypt().simplifyWhiteSpace()); + customDecrypt=TQStringList::split(TQString(" "), KGpgSettings::customDecrypt().simplifyWhiteSpace()); if (doresize) { - QSize size= KGpgSettings::editorGeometry(); + TQSize size= KGpgSettings::editorGeometry(); if (!size.isEmpty()) resize(size); } @@ -126,36 +126,36 @@ void KgpgApp::readOptions(bool doresize) void KgpgApp::initActions() { - KStdAction::openNew(this, SLOT(slotFileNew()), actionCollection()); - KStdAction::open(this, SLOT(slotFileOpen()), actionCollection()); - KStdAction::saveAs(this, SLOT(slotFileSaveAs()), actionCollection()); - KStdAction::quit(this, SLOT(slotFileQuit()), actionCollection()); - KStdAction::cut(this, SLOT(slotEditCut()), actionCollection()); - KStdAction::copy(this, SLOT(slotEditCopy()), actionCollection()); - KStdAction::paste(this, SLOT(slotEditPaste()), actionCollection()); - KStdAction::selectAll(this, SLOT(slotSelectAll()), actionCollection()); - KStdAction::preferences(this, SLOT(slotOptions()), actionCollection(),"kgpg_config"); - - //KStdAction::keyBindings(guiFactory(), SLOT(configureShortcuts()), actionCollection()); - //KStdAction::configureToolbars(this, SLOT(slotConfigureToolbars()), actionCollection()); - - fileSave = KStdAction::save(this, SLOT(slotFileSave()), actionCollection()); - (void) new KAction(i18n("&Encrypt File..."), "encrypted", 0,this, SLOT(slotFilePreEnc()), actionCollection(),"file_encrypt"); - (void) new KAction(i18n("&Decrypt File..."), "decrypted", 0,this, SLOT(slotFilePreDec()), actionCollection(),"file_decrypt"); - (void) new KAction(i18n("&Open Key Manager"), "kgpg", 0,this, SLOT(slotKeyManager()), actionCollection(),"key_manage"); - editUndo = KStdAction::undo(this, SLOT(slotundo()), actionCollection()); - editRedo = KStdAction::redo(this, SLOT(slotredo()), actionCollection()); - //(void) new KAction(i18n("&Manage Keys"), "kgpg_manage", CTRL+Key_K,this, SLOT(slotManageKey()), actionCollection(),"keys_manage"); - (void) new KAction(i18n("&Generate Signature..."),0, this, SLOT(slotPreSignFile()), actionCollection(), "sign_generate"); - (void) new KAction(i18n("&Verify Signature..."),0, this, SLOT(slotPreVerifyFile()), actionCollection(), "sign_verify"); - (void) new KAction(i18n("&Check MD5 Sum..."), 0,this, SLOT(slotCheckMd5()), actionCollection(), "sign_check"); - KStdAction::print(this, SLOT(slotFilePrint()), actionCollection()); + KStdAction::openNew(this, TQT_SLOT(slotFileNew()), actionCollection()); + KStdAction::open(this, TQT_SLOT(slotFileOpen()), actionCollection()); + KStdAction::saveAs(this, TQT_SLOT(slotFileSaveAs()), actionCollection()); + KStdAction::quit(this, TQT_SLOT(slotFileQuit()), actionCollection()); + KStdAction::cut(this, TQT_SLOT(slotEditCut()), actionCollection()); + KStdAction::copy(this, TQT_SLOT(slotEditCopy()), actionCollection()); + KStdAction::paste(this, TQT_SLOT(slotEditPaste()), actionCollection()); + KStdAction::selectAll(this, TQT_SLOT(slotSelectAll()), actionCollection()); + KStdAction::preferences(this, TQT_SLOT(slotOptions()), actionCollection(),"kgpg_config"); + + //KStdAction::keyBindings(guiFactory(), TQT_SLOT(configureShortcuts()), actionCollection()); + //KStdAction::configureToolbars(this, TQT_SLOT(slotConfigureToolbars()), actionCollection()); + + fileSave = KStdAction::save(this, TQT_SLOT(slotFileSave()), actionCollection()); + (void) new KAction(i18n("&Encrypt File..."), "encrypted", 0,this, TQT_SLOT(slotFilePreEnc()), actionCollection(),"file_encrypt"); + (void) new KAction(i18n("&Decrypt File..."), "decrypted", 0,this, TQT_SLOT(slotFilePreDec()), actionCollection(),"file_decrypt"); + (void) new KAction(i18n("&Open Key Manager"), "kgpg", 0,this, TQT_SLOT(slotKeyManager()), actionCollection(),"key_manage"); + editUndo = KStdAction::undo(this, TQT_SLOT(slotundo()), actionCollection()); + editRedo = KStdAction::redo(this, TQT_SLOT(slotredo()), actionCollection()); + //(void) new KAction(i18n("&Manage Keys"), "kgpg_manage", CTRL+Key_K,this, TQT_SLOT(slotManageKey()), actionCollection(),"keys_manage"); + (void) new KAction(i18n("&Generate Signature..."),0, this, TQT_SLOT(slotPreSignFile()), actionCollection(), "sign_generate"); + (void) new KAction(i18n("&Verify Signature..."),0, this, TQT_SLOT(slotPreVerifyFile()), actionCollection(), "sign_verify"); + (void) new KAction(i18n("&Check MD5 Sum..."), 0,this, TQT_SLOT(slotCheckMd5()), actionCollection(), "sign_check"); + KStdAction::print(this, TQT_SLOT(slotFilePrint()), actionCollection()); // comment out for now, only confusing - //encodingAction=new KToggleAction(i18n("&Unicode (utf-8) Encoding"), 0, 0,this, SLOT(slotSetCharset()),actionCollection(),"charsets"); + //encodingAction=new KToggleAction(i18n("&Unicode (utf-8) Encoding"), 0, 0,this, TQT_SLOT(slotSetCharset()),actionCollection(),"charsets"); } -void KgpgApp::slotSetFont(QFont myFont) +void KgpgApp::slotSetFont(TQFont myFont) { view->editor->setFont (myFont); } @@ -165,10 +165,10 @@ void KgpgApp::slotSetCharset() { //////// work in progress //if (encodingAction->isChecked()) -//view->editor->setText(QString::fromUtf8(view->editor->text().ascii())); +//view->editor->setText(TQString::fromUtf8(view->editor->text().ascii())); //else { -if (checkEncoding(QTextCodec::codecForLocale ())) return; +if (checkEncoding(TQTextCodec::codecForLocale ())) return; view->editor->setText(view->editor->text().utf8()); } } @@ -181,7 +181,7 @@ void KgpgApp::initView() view = new KgpgView(this,0); // doc->addView(view); - connect(view,SIGNAL(resetEncoding(bool)),this,SLOT(slotResetEncoding(bool))); + connect(view,TQT_SIGNAL(resetEncoding(bool)),this,TQT_SLOT(slotResetEncoding(bool))); setCentralWidget(view); setCaption(i18n("Untitled"),false); /// doc->URL().fileName(),false); @@ -204,19 +204,19 @@ void KgpgApp::slotFileNew() { ////// delete all text from editor - view->editor->setText(QString::null); + view->editor->setText(TQString::null); editRedo->setEnabled(false); editUndo->setEnabled(false); setCaption(i18n("Untitled"), false); fileSave->setEnabled(false); - Docname=QString::null; + Docname=TQString::null; slotResetEncoding(false); } void KgpgApp::slotFilePreEnc() { - QStringList opts; - KURL::List urls=KFileDialog::getOpenURLs(QString::null, + TQStringList opts; + KURL::List urls=KFileDialog::getOpenURLs(TQString::null, i18n("*|All Files"), this, i18n("Open File to Encode")); if (urls.isEmpty()) return; @@ -226,14 +226,14 @@ void KgpgApp::slotFilePreEnc() void KgpgApp::slotFilePreDec() { - KURL url=KFileDialog::getOpenURL(QString::null, + KURL url=KFileDialog::getOpenURL(TQString::null, i18n("*|All Files"), this, i18n("Open File to Decode")); if (url.isEmpty()) return; - QString oldname=url.fileName(); + TQString oldname=url.fileName(); - QString newname; + TQString newname; if (oldname.endsWith(".gpg") || oldname.endsWith(".asc") || oldname.endsWith(".pgp")) oldname.truncate(oldname.length()-4); @@ -252,7 +252,7 @@ void KgpgApp::slotFilePreDec() page->checkClipboard->setText(i18n("Editor")); page->resize(page->minimumSize()); popn->resize(popn->minimumSize()); - if (popn->exec()==QDialog::Accepted) { + if (popn->exec()==TQDialog::Accepted) { if (page->checkFile->isChecked()) newname=page->newFilename->url(); } else { @@ -263,10 +263,10 @@ void KgpgApp::slotFilePreDec() if (!newname.isEmpty()) { - QFile fgpg(newname); + TQFile fgpg(newname); if (fgpg.exists()) { - KIO::RenameDlg *over=new KIO::RenameDlg(0,i18n("File Already Exists"),QString::null,newname,KIO::M_OVERWRITE); - if (over->exec()==QDialog::Rejected) + KIO::RenameDlg *over=new KIO::RenameDlg(0,i18n("File Already Exists"),TQString::null,newname,KIO::M_OVERWRITE); + if (over->exec()==TQDialog::Rejected) { delete over; return; @@ -276,7 +276,7 @@ void KgpgApp::slotFilePreDec() } KgpgLibrary *lib=new KgpgLibrary(this); lib->slotFileDec(url,KURL(newname), customDecrypt); - connect(lib,SIGNAL(importOver(QStringList)),this,SIGNAL(refreshImported(QStringList))); + connect(lib,TQT_SIGNAL(importOver(TQStringList)),this,TQT_SIGNAL(refreshImported(TQStringList))); } else openEncryptedDocumentFile(url); } @@ -284,7 +284,7 @@ void KgpgApp::slotFilePreDec() void KgpgApp::slotFileOpen() { KEncodingFileDialog::Result loadResult; - loadResult=KEncodingFileDialog::getOpenURLAndEncoding(QString::null,QString::null,QString::null,this); + loadResult=KEncodingFileDialog::getOpenURLAndEncoding(TQString::null,TQString::null,TQString::null,this); KURL url=loadResult.URLs.first(); textEncoding=loadResult.encoding; @@ -298,7 +298,7 @@ void KgpgApp::slotFileOpen() } -bool KgpgApp::checkEncoding(QTextCodec *codec) +bool KgpgApp::checkEncoding(TQTextCodec *codec) { ///////////// KGlobal::locale()->encoding()->name() return codec->canEncode(view->editor->text()); @@ -306,12 +306,12 @@ return codec->canEncode(view->editor->text()); void KgpgApp::slotFileSave() { - QString filn=Docname.path(); + TQString filn=Docname.path(); if (filn.isEmpty()) { slotFileSaveAs(); return; } - QTextCodec*cod=QTextCodec::codecForName (textEncoding.ascii()); + TQTextCodec*cod=TQTextCodec::codecForName (textEncoding.ascii()); // slotStatusMsg(i18n("Saving file...")); if (!checkEncoding(cod)) { KMessageBox::sorry(this,i18n("The document could not been saved, as the selected encoding cannot encode every unicode character in it.")); @@ -320,31 +320,31 @@ void KgpgApp::slotFileSave() KTempFile tmpfile; if (Docname.isLocalFile()) { - QFile f(filn); + TQFile f(filn); if ( !f.open( IO_WriteOnly ) ) { KMessageBox::sorry(this,i18n("The document could not be saved, please check your permissions and disk space.")); return; } - QTextStream t( &f ); + TQTextStream t( &f ); t.setCodec(cod); - //t.setEncoding( QTextStream::Latin1 ); + //t.setEncoding( TQTextStream::Latin1 ); t << view->editor->text();//.utf8(); f.close(); } else { /*FIXME use following code: - QFile f( fName ); + TQFile f( fName ); 00983 if ( !f.open( IO_ReadOnly ) ) 00984 return; -00985 QFileInfo info ( f ); -00986 smModificationTime = new QTime( info.lastModified().time() ); -00987 QTextStream t(&f); -00988 t.setEncoding( QTextStream::Latin1 ); -00989 QString s = t.readLine(); +00985 TQFileInfo info ( f ); +00986 smModificationTime = new TQTime( info.lastModified().time() ); +00987 TQTextStream t(&f); +00988 t.setEncoding( TQTextStream::Latin1 ); +00989 TQString s = t.readLine(); 00990 f.close(); */ - QTextStream *stream = tmpfile.textStream(); + TQTextStream *stream = tmpfile.textStream(); stream->setCodec(cod); *stream << view->editor->text();//.utf8(); tmpfile.close(); @@ -364,20 +364,20 @@ void KgpgApp::slotFileSave() void KgpgApp::slotFileSaveAs() { - //KURL url=KFileDialog::getSaveURL(QDir::currentDirPath(),i18n("*|All Files"), this, i18n("Save As")); + //KURL url=KFileDialog::getSaveURL(TQDir::currentDirPath(),i18n("*|All Files"), this, i18n("Save As")); KEncodingFileDialog::Result saveResult; - saveResult=KEncodingFileDialog::getSaveURLAndEncoding (QString::null,QString::null,QString::null,this); + saveResult=KEncodingFileDialog::getSaveURLAndEncoding (TQString::null,TQString::null,TQString::null,this); KURL url=saveResult.URLs.first(); - QString selectedEncoding=saveResult.encoding; + TQString selectedEncoding=saveResult.encoding; if(!url.isEmpty()) { if (url.isLocalFile()) { - QString filn=url.path(); - QFile f(filn); + TQString filn=url.path(); + TQFile f(filn); if (f.exists()) { - QString message=i18n("Overwrite existing file %1?").arg(url.fileName()); - int result=KMessageBox::warningContinueCancel(this,QString(message),i18n("Warning"),i18n("Overwrite")); + TQString message=i18n("Overwrite existing file %1?").arg(url.fileName()); + int result=KMessageBox::warningContinueCancel(this,TQString(message),i18n("Warning"),i18n("Overwrite")); if (result==KMessageBox::Cancel) return; } @@ -385,8 +385,8 @@ void KgpgApp::slotFileSaveAs() } else if (KIO::NetAccess::exists(url,false,this)) { - QString message=i18n("Overwrite existing file %1?").arg(url.fileName()); - int result=KMessageBox::warningContinueCancel(this,QString(message),i18n("Warning"),i18n("Overwrite")); + TQString message=i18n("Overwrite existing file %1?").arg(url.fileName()); + int result=KMessageBox::warningContinueCancel(this,TQString(message),i18n("Warning"),i18n("Overwrite")); if (result==KMessageBox::Cancel) return; } @@ -396,15 +396,15 @@ void KgpgApp::slotFileSaveAs() } } -void KgpgApp::openDocumentFile(const KURL& url,QString encoding) +void KgpgApp::openDocumentFile(const KURL& url,TQString encoding) { -QString tempOpenFile; +TQString tempOpenFile; ///////////////////////////////////////////////// if( KIO::NetAccess::download( url, tempOpenFile,this ) ) { - QFile qfile(tempOpenFile); + TQFile qfile(tempOpenFile); if (qfile.open(IO_ReadOnly)) { - QTextStream t( &qfile ); - t.setCodec(QTextCodec::codecForName (encoding.ascii())); + TQTextStream t( &qfile ); + t.setCodec(TQTextCodec::codecForName (encoding.ascii())); view->editor->setText(t.read()); qfile.close(); fileSave->setEnabled(false); @@ -419,8 +419,8 @@ void KgpgApp::slotFilePrint() KPrinter prt; //kdDebug(2100)<<"Printing..."<<endl; if (prt.setup(this)) { - QPainter painter(&prt); - QPaintDeviceMetrics metrics(painter.device()); + TQPainter painter(&prt); + TQPaintDeviceMetrics metrics(painter.device()); painter.drawText( 0, 0, metrics.width(), metrics.height(), AlignLeft|AlignTop|DontClip,view->editor->text() ); } } @@ -463,14 +463,14 @@ void KgpgApp::slotCheckMd5() { ///////////////////////////////////////////////////////////////////////// display md5 sum for a chosen file - KURL url=KFileDialog::getOpenURL(QString::null, + KURL url=KFileDialog::getOpenURL(TQString::null, i18n("*|All Files"), this, i18n("Open File to Verify")); if (!url.isEmpty()) { Md5Widget *mdwidget=new Md5Widget(this,0,url); mdwidget->exec(); delete mdwidget; - // KMessageBox::information(this,QString("MD5 sum for "+url.fileName()+" is:\n"+checkfile.hexDigest().data())); + // KMessageBox::information(this,TQString("MD5 sum for "+url.fileName()+" is:\n"+checkfile.hexDigest().data())); } } @@ -478,7 +478,7 @@ void KgpgApp::slotCheckMd5() void KgpgApp::slotPreSignFile() { ////////////////////////////////////// create a detached signature for a chosen file - KURL url=KFileDialog::getOpenURL(QString::null,i18n("*|All Files"), this, i18n("Open File to Sign")); + KURL url=KFileDialog::getOpenURL(TQString::null,i18n("*|All Files"), this, i18n("Open File to Sign")); if (!url.isEmpty()) slotSignFile(url); } @@ -486,18 +486,18 @@ void KgpgApp::slotPreSignFile() void KgpgApp::slotSignFile(KURL url) { ////////////////////////////////////// create a detached signature for a chosen file - QString signKeyID; + TQString signKeyID; if (!url.isEmpty()) { ////////////////// select a private key to sign file --> listkeys.cpp KgpgSelKey *opts=new KgpgSelKey(this,"select_secret"); - if (opts->exec()==QDialog::Accepted) + if (opts->exec()==TQDialog::Accepted) signKeyID=opts->getkeyID(); else { delete opts; return; } delete opts; - QString Options; + TQString Options; if (KGpgSettings::asciiArmor()) Options="--armor"; if (KGpgSettings::pgpCompatibility()) @@ -509,7 +509,7 @@ void KgpgApp::slotSignFile(KURL url) void KgpgApp::slotPreVerifyFile() { - KURL url=KFileDialog::getOpenURL(QString::null, + KURL url=KFileDialog::getOpenURL(TQString::null, i18n("*|All Files"), this, i18n("Open File to Verify")); slotVerifyFile(url); } @@ -517,28 +517,28 @@ void KgpgApp::slotPreVerifyFile() void KgpgApp::slotVerifyFile(KURL url) { /////////////////////////////////// check file signature - QString sigfile=QString::null; + TQString sigfile=TQString::null; if (!url.isEmpty()) { ////////////////////////////////////// try to find detached signature. if (!url.fileName().endsWith(".sig")) { sigfile=url.path()+".sig"; - QFile fsig(sigfile); + TQFile fsig(sigfile); if (!fsig.exists()) { sigfile=url.path()+".asc"; - QFile fsig(sigfile); + TQFile fsig(sigfile); ////////////// if no .asc or .sig signature file included, assume the file is internally signed if (!fsig.exists()) - sigfile=QString::null; + sigfile=TQString::null; } } ///////////////////////// pipe gpg command KgpgInterface *verifyFileProcess=new KgpgInterface(); verifyFileProcess->KgpgVerifyFile(url,KURL(sigfile)); - connect (verifyFileProcess,SIGNAL(verifyquerykey(QString)),this,SLOT(importSignatureKey(QString))); + connect (verifyFileProcess,TQT_SIGNAL(verifyquerykey(TQString)),this,TQT_SLOT(importSignatureKey(TQString))); } } -void KgpgApp::importSignatureKey(QString ID) +void KgpgApp::importSignatureKey(TQString ID) { keyServer *kser=new keyServer(0,"server_dialog",false); kser->page->kLEimportid->setText(ID); diff --git a/kgpg/kgpgeditor.h b/kgpg/kgpgeditor.h index 0e8cda9..31af386 100644 --- a/kgpg/kgpgeditor.h +++ b/kgpg/kgpgeditor.h @@ -24,7 +24,7 @@ #include <kmainwindow.h> -#include <qstringlist.h> +#include <tqstringlist.h> #include <kurl.h> class KPassivePopup; @@ -42,18 +42,18 @@ class KgpgApp : public KMainWindow public: /** construtor of KgpgApp, calls all init functions to create the application. */ - KgpgApp(QWidget *parent=0, const char *name=0,WFlags f = 0,KShortcut goHome=QKeySequence(CTRL+Qt::Key_Home),bool mainWindow=false); + KgpgApp(TQWidget *parent=0, const char *name=0,WFlags f = 0,KShortcut goHome=TQKeySequence(CTRL+Qt::Key_Home),bool mainWindow=false); ~KgpgApp(); /** opens a file specified by commandline option */ - void openDocumentFile(const KURL& url,QString encoding=QString::null); + void openDocumentFile(const KURL& url,TQString encoding=TQString::null); void openEncryptedDocumentFile(const KURL& url); /** returns a pointer to the current document connected to the KTMainWindow instance and is used by * the View class to access the document object's methods */ KURL Docname; int version; - QString messages; + TQString messages; KgpgView *view; KShortcut goDefaultKey; @@ -63,7 +63,7 @@ protected: void saveOptions(); void initActions(); void initView(); - void closeEvent( QCloseEvent * e ); + void closeEvent( TQCloseEvent * e ); private slots: //void slotOptions(); @@ -86,34 +86,34 @@ private slots: void slotSignFile(KURL url); void slotVerifyFile(KURL url); void slotPreVerifyFile(); - void importSignatureKey(QString ID); + void importSignatureKey(TQString ID); void slotundo(); void slotredo(); void slotSetCharset(); - bool checkEncoding(QTextCodec *codec); + bool checkEncoding(TQTextCodec *codec); void slotOptions(); void slotKeyManager(); public slots: - void slotSetFont(QFont myFont); + void slotSetFont(TQFont myFont); void closeWindow(); private: - QStringList customDecrypt; + TQStringList customDecrypt; //KToggleAction *encodingAction ; KURL urlselected; KAction* fileSave, *editUndo, *editRedo; KComboBox *fontCombo; bool isMainWindow; - QString textEncoding; + TQString textEncoding; signals: -void refreshImported(QStringList); +void refreshImported(TQStringList); void openChangeFont(); void openConfigDialog(); void encryptFiles(KURL::List fileList); diff --git a/kgpg/kgpginterface.cpp b/kgpg/kgpginterface.cpp index 5286c3c..d02c2a5 100644 --- a/kgpg/kgpginterface.cpp +++ b/kgpg/kgpginterface.cpp @@ -17,15 +17,15 @@ #include <stdio.h> -#include <qdialog.h> -#include <qclipboard.h> -#include <qlayout.h> -#include <qregexp.h> -#include <qstring.h> -#include <qlabel.h> -#include <qapplication.h> +#include <tqdialog.h> +#include <tqclipboard.h> +#include <tqlayout.h> +#include <tqregexp.h> +#include <tqstring.h> +#include <tqlabel.h> +#include <tqapplication.h> #include <kio/netaccess.h> -#include <qcheckbox.h> +#include <tqcheckbox.h> #include <kmessagebox.h> #include <klocale.h> @@ -36,11 +36,11 @@ #include <kpassivepopup.h> #include <kiconloader.h> #include <kaction.h> -#include <qtextcodec.h> +#include <tqtextcodec.h> #include <kprocess.h> #include <kprocio.h> #include <kconfig.h> -#include <qfile.h> +#include <tqfile.h> #include <kled.h> #include <kdebug.h> #include <ktempfile.h> @@ -56,13 +56,13 @@ KgpgInterface::KgpgInterface() int KgpgInterface::getGpgVersion() { FILE *fp; - QString readResult,gpgString; + TQString readResult,gpgString; char buffer[200]; bool readLine=true; - QString gpgcmd="gpg --version"; + TQString gpgcmd="gpg --version"; - fp = popen(QFile::encodeName(gpgcmd), "r"); + fp = popen(TQFile::encodeName(gpgcmd), "r"); while ( fgets( buffer, sizeof(buffer), fp)) { readResult=buffer; if (readLine) { @@ -74,13 +74,13 @@ FILE *fp; return (100*gpgString.section('.',0,0).toInt()+10*gpgString.section('.',1,1).toInt()+gpgString.section('.',2,2).toInt()); } -void KgpgInterface::updateIDs(QString txtString) +void KgpgInterface::updateIDs(TQString txtString) { int cut=txtString.find(' ',22,false); txtString.remove(0,cut); if (txtString.find("(",0,false)!=-1) txtString=txtString.section('(',0,0)+txtString.section(')',-1); - txtString.replace(QRegExp("<"),"<"); + txtString.replace(TQRegExp("<"),"<"); if (userIDs.find(txtString)==-1) { if (!userIDs.isEmpty()) @@ -89,30 +89,30 @@ void KgpgInterface::updateIDs(QString txtString) } } -void KgpgInterface::KgpgEncryptFile(QStringList encryptKeys,KURL srcUrl,KURL destUrl, QStringList Options, bool symetrical) +void KgpgInterface::KgpgEncryptFile(TQStringList encryptKeys,KURL srcUrl,KURL destUrl, TQStringList Options, bool symetrical) { sourceFile=srcUrl; - message=QString::null; + message=TQString::null; - KProcIO *proc=new KProcIO(QTextCodec::codecForLocale()); + KProcIO *proc=new KProcIO(TQTextCodec::codecForLocale()); *proc<<"gpg"<<"--no-tty"<<"--no-secmem-warning"<<"--status-fd=2"<<"--command-fd=0"<<"--utf8-strings"; - for ( QStringList::Iterator it = Options.begin(); it != Options.end(); ++it ) - if (!QFile::encodeName(*it).isEmpty()) *proc<< QFile::encodeName(*it); + for ( TQStringList::Iterator it = Options.begin(); it != Options.end(); ++it ) + if (!TQFile::encodeName(*it).isEmpty()) *proc<< TQFile::encodeName(*it); - *proc<<"--output"<<QFile::encodeName(destUrl.path()); + *proc<<"--output"<<TQFile::encodeName(destUrl.path()); if (!symetrical) { *proc<<"-e"; - for ( QStringList::Iterator it = encryptKeys.begin(); it != encryptKeys.end(); ++it ) + for ( TQStringList::Iterator it = encryptKeys.begin(); it != encryptKeys.end(); ++it ) *proc<<"--recipient"<< *it; } else //////////// symetrical encryption, prompt for password *proc<<"-c"; - *proc<<QFile::encodeName(srcUrl.path()); + *proc<<TQFile::encodeName(srcUrl.path()); ///////// when process ends, update dialog infos - QObject::connect(proc, SIGNAL(processExited(KProcess *)),this,SLOT(encryptfin(KProcess *))); - QObject::connect(proc,SIGNAL(readReady(KProcIO *)),this,SLOT(readencprocess(KProcIO *))); + TQObject::connect(proc, TQT_SIGNAL(processExited(KProcess *)),this,TQT_SLOT(encryptfin(KProcess *))); + TQObject::connect(proc,TQT_SIGNAL(readReady(KProcIO *)),this,TQT_SLOT(readencprocess(KProcIO *))); proc->start(KProcess::NotifyOnExit,true); } @@ -132,7 +132,7 @@ void KgpgInterface::encryptfin(KProcess *) void KgpgInterface::readencprocess(KProcIO *p) { - QString required; + TQString required; while (p->readln(required,true)!=-1) { if (required.find("BEGIN_ENCRYPTION",0,false)!=-1) emit processstarted(sourceFile.path()); @@ -140,9 +140,9 @@ void KgpgInterface::readencprocess(KProcIO *p) if (required.find("openfile.overwrite.okay")!=-1) p->writeStdin("Yes"); else if ((required.find("passphrase.enter")!=-1)) { - QCString passphrase; + TQCString passphrase; int code=KPasswordDialog::getNewPassword(passphrase,i18n("Enter passphrase for your file (symmetrical encryption):")); - if (code!=QDialog::Accepted) { + if (code!=TQDialog::Accepted) { p->deleteLater(); emit processaborted(true); return; @@ -160,28 +160,28 @@ void KgpgInterface::readencprocess(KProcIO *p) ////////////////////////////////////////////////////////////////////////////////////////////////////////// File decryption -void KgpgInterface::KgpgDecryptFile(KURL srcUrl,KURL destUrl,QStringList Options) +void KgpgInterface::KgpgDecryptFile(KURL srcUrl,KURL destUrl,TQStringList Options) { - message=QString::null; + message=TQString::null; step=3; decryptUrl=srcUrl.path(); - userIDs=QString::null; + userIDs=TQString::null; anonymous=false; - KProcIO *proc=new KProcIO(QTextCodec::codecForLocale()); + KProcIO *proc=new KProcIO(TQTextCodec::codecForLocale()); *proc<<"gpg"<<"--no-tty"<<"--no-secmem-warning"<<"--status-fd=2"<<"--command-fd=0"<<"--utf8-strings"; - for ( QStringList::Iterator it = Options.begin(); it != Options.end(); ++it ) - if (!QFile::encodeName(*it).isEmpty()) *proc<< QFile::encodeName(*it); + for ( TQStringList::Iterator it = Options.begin(); it != Options.end(); ++it ) + if (!TQFile::encodeName(*it).isEmpty()) *proc<< TQFile::encodeName(*it); if (!destUrl.fileName().isEmpty()) // a filename was entered - *proc<<"-o"<<QFile::encodeName(destUrl.path()); + *proc<<"-o"<<TQFile::encodeName(destUrl.path()); - *proc<<"-d"<<QFile::encodeName(srcUrl.path()); + *proc<<"-d"<<TQFile::encodeName(srcUrl.path()); - QObject::connect(proc, SIGNAL(processExited(KProcess *)),this,SLOT(decryptfin(KProcess *))); - QObject::connect(proc,SIGNAL(readReady(KProcIO *)),this,SLOT(readdecprocess(KProcIO *))); + TQObject::connect(proc, TQT_SIGNAL(processExited(KProcess *)),this,TQT_SLOT(decryptfin(KProcess *))); + TQObject::connect(proc,TQT_SIGNAL(readReady(KProcIO *)),this,TQT_SLOT(readdecprocess(KProcIO *))); proc->start(KProcess::NotifyOnExit,true); } @@ -196,7 +196,7 @@ void KgpgInterface::decryptfin(KProcess *) void KgpgInterface::readdecprocess(KProcIO *p) { - QString required; + TQString required; while (p->readln(required,true)!=-1) { if (required.find("BEGIN_DECRYPTION",0,false)!=-1) emit processstarted(decryptUrl); @@ -213,9 +213,9 @@ void KgpgInterface::readdecprocess(KProcIO *p) else if ((required.find("passphrase.enter")!=-1)) { if (userIDs.isEmpty()) userIDs=i18n("[No user id found]"); - userIDs.replace(QRegExp("<"),"<"); - QCString passphrase; - QString passdlgmessage; + userIDs.replace(TQRegExp("<"),"<"); + TQCString passphrase; + TQString passdlgmessage; if (anonymous) passdlgmessage=i18n("<b>No user id found</b>. Trying all secret keys.<br>"); if ((step<3) && (!anonymous)) @@ -223,13 +223,13 @@ void KgpgInterface::readdecprocess(KProcIO *p) passdlgmessage+=i18n("Enter passphrase for <b>%1</b>").arg(userIDs); int code=KPasswordDialog::getPassword(passphrase,passdlgmessage); - if (code!=QDialog::Accepted) { + if (code!=TQDialog::Accepted) { p->deleteLater(); emit processaborted(true); return; } p->writeStdin(passphrase,true); - userIDs=QString::null; + userIDs=TQString::null; if (step>1) step--; else step=3; } else { @@ -245,24 +245,24 @@ void KgpgInterface::readdecprocess(KProcIO *p) ////////////////////////////////////////////////////////////////////////////////////////////////////////// Text encryption -void KgpgInterface::KgpgEncryptText(QString text,QStringList userIDs, QStringList Options) +void KgpgInterface::KgpgEncryptText(TQString text,TQStringList userIDs, TQStringList Options) { - message=QString::null; - //QTextCodec *codec = KGlobal::charsets()->codecForName(KGlobal::locale()->encoding()); - QTextCodec *codec =QTextCodec::codecForLocale (); + message=TQString::null; + //TQTextCodec *codec = KGlobal::charsets()->codecForName(KGlobal::locale()->encoding()); + TQTextCodec *codec =TQTextCodec::codecForLocale (); if (codec->canEncode(text)) txtToEncrypt=text; else txtToEncrypt=text.utf8(); - KProcIO *proc=new KProcIO(QTextCodec::codecForLocale()); + KProcIO *proc=new KProcIO(TQTextCodec::codecForLocale()); *proc<<"gpg"<<"--no-tty"<<"--no-secmem-warning"<<"--command-fd=0"<<"--status-fd=1"<<"--utf8-strings"; - for ( QStringList::Iterator it = Options.begin(); it != Options.end(); ++it ) - if (!QFile::encodeName(*it).isEmpty()) *proc<< QFile::encodeName(*it); + for ( TQStringList::Iterator it = Options.begin(); it != Options.end(); ++it ) + if (!TQFile::encodeName(*it).isEmpty()) *proc<< TQFile::encodeName(*it); if (!userIDs.isEmpty()) { *proc<<"-e"; - for ( QStringList::Iterator it = userIDs.begin(); it != userIDs.end(); ++it ) + for ( TQStringList::Iterator it = userIDs.begin(); it != userIDs.end(); ++it ) *proc<<"--recipient"<< *it; } else @@ -270,8 +270,8 @@ void KgpgInterface::KgpgEncryptText(QString text,QStringList userIDs, QStringLis ///////// when process ends, update dialog infos - QObject::connect(proc, SIGNAL(processExited(KProcess *)),this,SLOT(txtencryptfin(KProcess *))); - QObject::connect(proc,SIGNAL(readReady(KProcIO *)),this,SLOT(txtreadencprocess(KProcIO *))); + TQObject::connect(proc, TQT_SIGNAL(processExited(KProcess *)),this,TQT_SLOT(txtencryptfin(KProcess *))); + TQObject::connect(proc,TQT_SIGNAL(readReady(KProcIO *)),this,TQT_SLOT(txtreadencprocess(KProcIO *))); proc->start(KProcess::NotifyOnExit,false); emit txtencryptionstarted(); } @@ -282,26 +282,26 @@ void KgpgInterface::txtencryptfin(KProcess *) if (!message.isEmpty()) emit txtencryptionfinished(message); else - emit txtencryptionfinished(QString::null); + emit txtencryptionfinished(TQString::null); } void KgpgInterface::txtreadencprocess(KProcIO *p) { - QString required; + TQString required; while (p->readln(required,true)!=-1) { if (required.find("BEGIN_ENCRYPTION",0,false)!=-1) { p->writeStdin(txtToEncrypt,false); - txtToEncrypt=QString::null; + txtToEncrypt=TQString::null; p->closeWhenDone(); } else if ((required.find("passphrase.enter")!=-1)) { - QCString passphrase; - QString passdlgmessage=i18n("Enter passphrase (symmetrical encryption)"); + TQCString passphrase; + TQString passdlgmessage=i18n("Enter passphrase (symmetrical encryption)"); int code=KPasswordDialog::getNewPassword(passphrase,passdlgmessage); - if (code!=QDialog::Accepted) + if (code!=TQDialog::Accepted) { p->deleteLater(); return; @@ -316,13 +316,13 @@ void KgpgInterface::txtreadencprocess(KProcIO *p) ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////// Text decryption -void KgpgInterface::KgpgDecryptText(QString text,QStringList Options) +void KgpgInterface::KgpgDecryptText(TQString text,TQStringList Options) { - gpgOutput=QString::null; - log=QString::null; + gpgOutput=TQString::null; + log=TQString::null; - message=QString::null; - userIDs=QString::null; + message=TQString::null; + userIDs=TQString::null; step=3; anonymous=false; decfinished=false; @@ -330,15 +330,15 @@ void KgpgInterface::KgpgDecryptText(QString text,QStringList Options) badmdc=false; KProcess *proc=new KProcess(); *proc<<"gpg"<<"--no-tty"<<"--no-secmem-warning"<<"--command-fd=0"<<"--status-fd=2"<<"--no-batch"<<"--utf8-strings"; - for ( QStringList::Iterator it = Options.begin(); it != Options.end(); ++it ) - if (!QFile::encodeName(*it).isEmpty()) *proc<< QFile::encodeName(*it); + for ( TQStringList::Iterator it = Options.begin(); it != Options.end(); ++it ) + if (!TQFile::encodeName(*it).isEmpty()) *proc<< TQFile::encodeName(*it); *proc<<"-d"; ///////// when process ends, update dialog infos - QObject::connect(proc, SIGNAL(processExited(KProcess *)),this,SLOT(txtdecryptfin(KProcess *))); - connect(proc, SIGNAL(receivedStdout(KProcess *, char *, int)),this, SLOT(getOutput(KProcess *, char *, int))); - connect(proc, SIGNAL(receivedStderr(KProcess *, char *, int)),this, SLOT(getCmdOutput(KProcess *, char *, int))); + TQObject::connect(proc, TQT_SIGNAL(processExited(KProcess *)),this,TQT_SLOT(txtdecryptfin(KProcess *))); + connect(proc, TQT_SIGNAL(receivedStdout(KProcess *, char *, int)),this, TQT_SLOT(getOutput(KProcess *, char *, int))); + connect(proc, TQT_SIGNAL(receivedStderr(KProcess *, char *, int)),this, TQT_SLOT(getCmdOutput(KProcess *, char *, int))); proc->start(KProcess::NotifyOnExit,KProcess::All); proc->writeStdin(text.utf8(), text.length()); } @@ -360,19 +360,19 @@ emit txtdecryptionfailed(log); void KgpgInterface::getOutput(KProcess *, char *data, int ) { - message.append(QString::fromUtf8(data)); + message.append(TQString::fromUtf8(data)); } void KgpgInterface::getCmdOutput(KProcess *p, char *data, int ) { - gpgOutput.append(QString::fromUtf8(data)); + gpgOutput.append(TQString::fromUtf8(data)); log.append(data); int pos; while ((pos=gpgOutput.find("\n"))!=-1) { - QString required=gpgOutput.left(pos); + TQString required=gpgOutput.left(pos); gpgOutput.remove(0,pos+2); if (required.find("USERID_HINT",0,false)!=-1) @@ -390,15 +390,15 @@ void KgpgInterface::getCmdOutput(KProcess *p, char *data, int ) { if (userIDs.isEmpty()) userIDs=i18n("[No user id found]"); - QCString passphrase; - QString passdlgmessage; + TQCString passphrase; + TQString passdlgmessage; if (anonymous) passdlgmessage=i18n("<b>No user id found</b>. Trying all secret keys.<br>"); if ((step<3) && (!anonymous)) passdlgmessage=i18n("<b>Bad passphrase</b>. You have %1 tries left.<br>").arg(step); passdlgmessage+=i18n("Enter passphrase for <b>%1</b>").arg(userIDs); int code=KPasswordDialog::getPassword(passphrase,passdlgmessage); - if (code!=QDialog::Accepted) + if (code!=TQDialog::Accepted) { p->deleteLater(); emit processaborted(true); @@ -406,7 +406,7 @@ void KgpgInterface::getCmdOutput(KProcess *p, char *data, int ) } passphrase.append("\n"); p->writeStdin(passphrase,passphrase.length()); - userIDs=QString::null; + userIDs=TQString::null; if (step>1) step--; else step=3; } @@ -420,7 +420,7 @@ void KgpgInterface::getCmdOutput(KProcess *p, char *data, int ) if (required.find("BEGIN_DECRYPTION")!=-1) { p->closeStdin(); - required=QString::null; + required=TQString::null; } if (required.find("END_DECRYPTION")!=-1) decfinished=true; @@ -432,26 +432,26 @@ void KgpgInterface::getCmdOutput(KProcess *p, char *data, int ) ////////////////////////////////////////////////////////////////////////////////////////////////////////// Text signing -void KgpgInterface::KgpgSignText(QString text,QString userIDs, QStringList Options) +void KgpgInterface::KgpgSignText(TQString text,TQString userIDs, TQStringList Options) { - message=QString::null; + message=TQString::null; step=4; - QString txtprocess; - QTextCodec *codec =QTextCodec::codecForLocale (); + TQString txtprocess; + TQTextCodec *codec =TQTextCodec::codecForLocale (); if (codec->canEncode(text)) txtprocess=text; else txtprocess=text.utf8(); - KProcIO *proc=new KProcIO(QTextCodec::codecForLocale()); + KProcIO *proc=new KProcIO(TQTextCodec::codecForLocale()); *proc<<"gpg"<<"--no-tty"<<"--no-secmem-warning"<<"--command-fd=0"<<"--status-fd=1"<<"--utf8-strings"; - for ( QStringList::Iterator it = Options.begin(); it != Options.end(); ++it ) - if (!QFile::encodeName(*it).isEmpty()) *proc<< QFile::encodeName(*it); + for ( TQStringList::Iterator it = Options.begin(); it != Options.end(); ++it ) + if (!TQFile::encodeName(*it).isEmpty()) *proc<< TQFile::encodeName(*it); *proc<<"--clearsign"<<"-u"<<userIDs; ///////// when process ends, update dialog infos - QObject::connect(proc, SIGNAL(processExited(KProcess *)),this,SLOT(txtsignfin(KProcess *))); - QObject::connect(proc,SIGNAL(readReady(KProcIO *)),this,SLOT(txtsignprocess(KProcIO *))); + TQObject::connect(proc, TQT_SIGNAL(processExited(KProcess *)),this,TQT_SLOT(txtsignfin(KProcess *))); + TQObject::connect(proc,TQT_SIGNAL(readReady(KProcIO *)),this,TQT_SLOT(txtsignprocess(KProcIO *))); //emit txtsigningstarted(); @@ -473,12 +473,12 @@ void KgpgInterface::txtsignfin(KProcess *) if (!message.isEmpty()) emit txtSignOver(message); else - emit txtSignOver(QString::null); + emit txtSignOver(TQString::null); } void KgpgInterface::txtsignprocess(KProcIO *p) { - QString required; + TQString required; while (p->readln(required,true)!=-1) { // kdDebug(2100)<<"SIGNING: "<<required<<endl; @@ -488,7 +488,7 @@ void KgpgInterface::txtsignprocess(KProcIO *p) if (required.find("GOOD_PASSPHRASE")!=-1) { p->writeStdin(message,true); - message=QString::null; + message=TQString::null; p->closeWhenDone(); } @@ -498,13 +498,13 @@ void KgpgInterface::txtsignprocess(KProcIO *p) else step=3; if (userIDs.isEmpty()) userIDs=i18n("[No user id found]"); - QCString passphrase; - QString passdlgmessage; + TQCString passphrase; + TQString passdlgmessage; if (step<3) passdlgmessage=i18n("<b>Bad passphrase</b>. You have %1 tries left.<br>").arg(step); passdlgmessage+=i18n("Enter passphrase for <b>%1</b>").arg(userIDs); int code=KPasswordDialog::getPassword(passphrase,passdlgmessage); - if (code!=QDialog::Accepted) + if (code!=TQDialog::Accepted) { p->deleteLater(); return; @@ -519,11 +519,11 @@ void KgpgInterface::txtsignprocess(KProcIO *p) //////////////////////////////////////////////// decrypt file to text -void KgpgInterface::KgpgDecryptFileToText(KURL srcUrl,QStringList Options) +void KgpgInterface::KgpgDecryptFileToText(KURL srcUrl,TQStringList Options) { - message=QString::null; - userIDs=QString::null; + message=TQString::null; + userIDs=TQString::null; step=3; anonymous=false; decfinished=false; @@ -532,16 +532,16 @@ badmdc=false; KProcess *proc=new KProcess(); *proc<<"gpg"<<"--no-tty"<<"--utf8-strings"<<"--no-secmem-warning"<<"--command-fd=0"<<"--status-fd=2"<<"--no-batch"<<"-o"<<"-"; - for ( QStringList::Iterator it = Options.begin(); it != Options.end(); ++it ) { - if (!QFile::encodeName(*it).isEmpty()) *proc<< QFile::encodeName(*it); + for ( TQStringList::Iterator it = Options.begin(); it != Options.end(); ++it ) { + if (!TQFile::encodeName(*it).isEmpty()) *proc<< TQFile::encodeName(*it); } - *proc<<"-d"<<QFile::encodeName(srcUrl.path()); + *proc<<"-d"<<TQFile::encodeName(srcUrl.path()); ///////// when process ends, update dialog infos - connect(proc, SIGNAL(processExited(KProcess *)),this,SLOT(txtdecryptfin(KProcess *))); - connect(proc, SIGNAL(receivedStdout(KProcess *, char *, int)),this, SLOT(getOutput(KProcess *, char *, int))); - connect(proc, SIGNAL(receivedStderr(KProcess *, char *, int)),this, SLOT(getCmdOutput(KProcess *, char *, int))); + connect(proc, TQT_SIGNAL(processExited(KProcess *)),this,TQT_SLOT(txtdecryptfin(KProcess *))); + connect(proc, TQT_SIGNAL(receivedStdout(KProcess *, char *, int)),this, TQT_SLOT(getOutput(KProcess *, char *, int))); + connect(proc, TQT_SIGNAL(receivedStderr(KProcess *, char *, int)),this, TQT_SLOT(getCmdOutput(KProcess *, char *, int))); proc->start(KProcess::NotifyOnExit,KProcess::All); } @@ -549,18 +549,18 @@ badmdc=false; /////////////////////////////////////////////////////// verify text -void KgpgInterface::KgpgVerifyText(QString text) +void KgpgInterface::KgpgVerifyText(TQString text) { - QTextCodec *codec =QTextCodec::codecForLocale (); + TQTextCodec *codec =TQTextCodec::codecForLocale (); if (!codec->canEncode(text)) text=text.utf8(); signmiss=false; - signID=QString::null; - message=QString::null; - KProcIO *verifyproc=new KProcIO(QTextCodec::codecForLocale()); + signID=TQString::null; + message=TQString::null; + KProcIO *verifyproc=new KProcIO(TQTextCodec::codecForLocale()); *verifyproc<<"gpg"<<"--no-secmem-warning"<<"--status-fd=2"<<"--command-fd=0"<<"--utf8-strings"<<"--verify"; - connect(verifyproc, SIGNAL(processExited(KProcess *)),this, SLOT(slotverifyresult(KProcess *))); - connect(verifyproc, SIGNAL(readReady(KProcIO *)),this, SLOT(slotverifyread(KProcIO *))); + connect(verifyproc, TQT_SIGNAL(processExited(KProcess *)),this, TQT_SLOT(slotverifyresult(KProcess *))); + connect(verifyproc, TQT_SIGNAL(readReady(KProcIO *)),this, TQT_SLOT(slotverifyread(KProcIO *))); verifyproc->start(KProcess::NotifyOnExit,true); verifyproc->writeStdin (text); verifyproc->closeWhenDone(); @@ -579,20 +579,20 @@ if (signmiss) emit missingSignature(signID); void KgpgInterface::slotverifyread(KProcIO *p) { -QString required; +TQString required; while (p->readln(required,true)!=-1) { message+=required+"\n"; required=required.section("]",1,-1).stripWhiteSpace(); if (required.startsWith("GOODSIG")) { - QString userName=required.section(" ",2,-1).replace(QRegExp("<"),"<"); + TQString userName=required.section(" ",2,-1).replace(TQRegExp("<"),"<"); userName=checkForUtf8(userName); signID=i18n("<qt>Good signature from:<br><b>%1</b><br>Key ID: %2</qt>").arg(userName).arg("0x"+required.section(" ",1,1).right(8)); } if (required.startsWith("BADSIG")) { - signID=i18n("<qt><b>Bad signature</b> from:<br>%1<br>Key ID: %2<br><br><b>Text is corrupted.</b></qt>").arg(required.section(" ",2,-1).replace(QRegExp("<"),"<")).arg("0x"+required.section(" ",1,1).right(8)); + signID=i18n("<qt><b>Bad signature</b> from:<br>%1<br>Key ID: %2<br><br><b>Text is corrupted.</b></qt>").arg(required.section(" ",2,-1).replace(TQRegExp("<"),"<")).arg("0x"+required.section(" ",1,1).right(8)); } if (required.startsWith("NO_PUBKEY")) { @@ -611,45 +611,45 @@ QString required; /////////////////////////////////////////////////////////////////////////////////////////////////// MD5 -Md5Widget::Md5Widget(QWidget *parent, const char *name,KURL url):KDialogBase( parent, name, true,i18n("MD5 Checksum"),Apply | Close) +Md5Widget::Md5Widget(TQWidget *parent, const char *name,KURL url):KDialogBase( parent, name, true,i18n("MD5 Checksum"),Apply | Close) { setButtonApply(i18n("Compare MD5 with Clipboard")); - mdSum=QString::null; - QFile f(url.path()); + mdSum=TQString::null; + TQFile f(url.path()); f.open( IO_ReadOnly); KMD5 checkfile; checkfile.reset(); checkfile.update(f); mdSum=checkfile.hexDigest().data(); f.close(); - QWidget *page = new QWidget(this); + TQWidget *page = new TQWidget(this); resize( 360, 150 ); - QGridLayout *MyDialogLayout = new QGridLayout( page, 1, 1, 5, 6, "MyDialogLayout"); + TQGridLayout *MyDialogLayout = new TQGridLayout( page, 1, 1, 5, 6, "MyDialogLayout"); - QLabel *TextLabel1 = new QLabel( page, "TextLabel1" ); + TQLabel *TextLabel1 = new TQLabel( page, "TextLabel1" ); TextLabel1->setText(i18n("MD5 sum for <b>%1</b> is:").arg(url.fileName())); MyDialogLayout->addWidget( TextLabel1, 0, 0 ); KLineEdit *KRestrictedLine1 = new KLineEdit(mdSum,page); KRestrictedLine1->setReadOnly(true); - KRestrictedLine1->setPaletteBackgroundColor(QColor(255,255,255)); + KRestrictedLine1->setPaletteBackgroundColor(TQColor(255,255,255)); MyDialogLayout->addWidget( KRestrictedLine1, 1, 0 ); - QHBoxLayout *Layout4 = new QHBoxLayout( 0, 0, 6, "Layout4"); + TQHBoxLayout *Layout4 = new TQHBoxLayout( 0, 0, 6, "Layout4"); - KLed1=new KLed(QColor(80,80,80),KLed::Off,KLed::Sunken,KLed::Circular,page,"KLed1"); + KLed1=new KLed(TQColor(80,80,80),KLed::Off,KLed::Sunken,KLed::Circular,page,"KLed1"); KLed1->off(); - KLed1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, KLed1->sizePolicy().hasHeightForWidth() ) ); + KLed1->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)0, (TQSizePolicy::SizeType)0, 0, 0, KLed1->sizePolicy().hasHeightForWidth() ) ); Layout4->addWidget( KLed1 ); - TextLabel1_2 = new QLabel( page, "TextLabel1_2" ); + TextLabel1_2 = new TQLabel( page, "TextLabel1_2" ); TextLabel1_2->setText(i18n( "<b>Unknown status</b>" ) ); Layout4->addWidget( TextLabel1_2 ); MyDialogLayout->addLayout( Layout4, 2, 0 ); - QSpacerItem* spacer = new QSpacerItem( 0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding ); + TQSpacerItem* spacer = new TQSpacerItem( 0, 0, TQSizePolicy::Minimum, TQSizePolicy::Expanding ); MyDialogLayout->addItem( spacer, 3, 0 ); page->show(); @@ -664,8 +664,8 @@ Md5Widget::~Md5Widget() void Md5Widget::slotApply() { - QClipboard *cb = QApplication::clipboard(); - QString text; + QClipboard *cb = TQApplication::clipboard(); + TQString text; // Copy text from the clipboard (paste) text = cb->text(QClipboard::Clipboard); if ( !text.isEmpty() ) { @@ -674,14 +674,14 @@ void Md5Widget::slotApply() text.remove(text.find(' '),1); if (text==mdSum) { TextLabel1_2->setText(i18n("<b>Correct checksum</b>, file is ok.")); - KLed1->setColor(QColor(0,255,0)); + KLed1->setColor(TQColor(0,255,0)); KLed1->on(); }//KMessageBox::sorry(0,"OK"); else if (text.length()!=mdSum.length()) KMessageBox::sorry(0,i18n("Clipboard content is not a MD5 sum.")); else { TextLabel1_2->setText(i18n("<b>Wrong checksum, FILE CORRUPTED</b>")); - KLed1->setColor(QColor(255,0,0)); + KLed1->setColor(TQColor(255,0,0)); KLed1->on(); } } @@ -690,23 +690,23 @@ void Md5Widget::slotApply() ///////////////////////////////////////////////////////////////////////////////////////////// signatures -void KgpgInterface::KgpgSignFile(QString keyID,KURL srcUrl,QStringList Options) +void KgpgInterface::KgpgSignFile(TQString keyID,KURL srcUrl,TQStringList Options) { ////////////////////////////////////// create a detached signature for a chosen file - message=QString::null; + message=TQString::null; step=3; ///////////// create gpg command - KProcIO *proc=new KProcIO(QTextCodec::codecForLocale()); + KProcIO *proc=new KProcIO(TQTextCodec::codecForLocale()); keyID=keyID.stripWhiteSpace(); *proc<<"gpg"<<"--no-tty"<<"--no-secmem-warning"<<"--utf8-strings"<<"--status-fd=2"<<"--command-fd=0"<<"-u"<<keyID.local8Bit(); - for ( QStringList::Iterator it = Options.begin(); it != Options.end(); ++it ) - if (!QFile::encodeName(*it).isEmpty()) *proc<< QFile::encodeName(*it); + for ( TQStringList::Iterator it = Options.begin(); it != Options.end(); ++it ) + if (!TQFile::encodeName(*it).isEmpty()) *proc<< TQFile::encodeName(*it); - *proc<<"--output"<<QFile::encodeName(srcUrl.path()+".sig"); - *proc<<"--detach-sig"<<QFile::encodeName(srcUrl.path()); + *proc<<"--output"<<TQFile::encodeName(srcUrl.path()+".sig"); + *proc<<"--detach-sig"<<TQFile::encodeName(srcUrl.path()); - QObject::connect(proc, SIGNAL(processExited(KProcess *)),this,SLOT(signfin(KProcess *))); - QObject::connect(proc,SIGNAL(readReady(KProcIO *)),this,SLOT(readsignprocess(KProcIO *))); + TQObject::connect(proc, TQT_SIGNAL(processExited(KProcess *)),this,TQT_SLOT(signfin(KProcess *))); + TQObject::connect(proc,TQT_SIGNAL(readReady(KProcIO *)),this,TQT_SLOT(readsignprocess(KProcIO *))); proc->start(KProcess::NotifyOnExit,true); } @@ -726,7 +726,7 @@ void KgpgInterface::signfin(KProcess *) void KgpgInterface::readsignprocess(KProcIO *p) { - QString required; + TQString required; while (p->readln(required,true)!=-1) { if (required.find("USERID_HINT",0,false)!=-1) updateIDs(required); @@ -737,19 +737,19 @@ void KgpgInterface::readsignprocess(KProcIO *p) else if ((required.find("passphrase.enter")!=-1)) { if (userIDs.isEmpty()) userIDs=i18n("[No user id found]"); - QCString passphrase; - QString passdlgmessage; + TQCString passphrase; + TQString passdlgmessage; if (step<3) passdlgmessage=i18n("<b>Bad passphrase</b>. you have %1 tries left.<br>").arg(step); passdlgmessage+=i18n("Enter passphrase for <b>%1</b>").arg(userIDs); int code=KPasswordDialog::getPassword(passphrase,passdlgmessage); - if (code!=QDialog::Accepted) { + if (code!=TQDialog::Accepted) { p->deleteLater(); emit signfinished(); return; } p->writeStdin(passphrase,true); - userIDs=QString::null; + userIDs=TQString::null; if (step>1) step--; else step=3; } else { @@ -767,26 +767,26 @@ void KgpgInterface::readsignprocess(KProcIO *p) void KgpgInterface::KgpgVerifyFile(KURL sigUrl,KURL srcUrl) { ////////////////////////////////////// verify signature for a chosen file - message=QString::null; - signID=QString::null; + message=TQString::null; + signID=TQString::null; signmiss=false; ///////////// create gpg command - KProcIO *proc=new KProcIO(QTextCodec::codecForLocale()); + KProcIO *proc=new KProcIO(TQTextCodec::codecForLocale()); file=sigUrl; *proc<<"gpg"<<"--no-tty"<<"--utf8-strings"<<"--no-secmem-warning"<<"--status-fd=2"<<"--verify"; if (!srcUrl.isEmpty()) - *proc<<QFile::encodeName(srcUrl.path()); - *proc<<QFile::encodeName(sigUrl.path()); + *proc<<TQFile::encodeName(srcUrl.path()); + *proc<<TQFile::encodeName(sigUrl.path()); - QObject::connect(proc, SIGNAL(processExited(KProcess *)),this,SLOT(verifyfin(KProcess *))); - QObject::connect(proc,SIGNAL(readReady(KProcIO *)),this,SLOT(readprocess(KProcIO *))); + TQObject::connect(proc, TQT_SIGNAL(processExited(KProcess *)),this,TQT_SLOT(verifyfin(KProcess *))); + TQObject::connect(proc,TQT_SIGNAL(readReady(KProcIO *)),this,TQT_SLOT(readprocess(KProcIO *))); proc->start(KProcess::NotifyOnExit,true); } void KgpgInterface::readprocess(KProcIO *p) { -QString required; +TQString required; while (p->readln(required,true)!=-1) { message+=required+"\n"; @@ -799,12 +799,12 @@ QString required; signID=i18n("No signature found."); if (required.startsWith("GOODSIG")) { - signID=i18n("<qt>Good signature from:<br><b>%1</b><br>Key ID: %2</qt>").arg(required.section(" ",2,-1).replace(QRegExp("<"),"<")).arg("0x"+required.section(" ",1,1).right(8)); + signID=i18n("<qt>Good signature from:<br><b>%1</b><br>Key ID: %2</qt>").arg(required.section(" ",2,-1).replace(TQRegExp("<"),"<")).arg("0x"+required.section(" ",1,1).right(8)); } if (required.startsWith("BADSIG")) { signID=i18n("<qt><b>BAD signature</b> from:<br> %1<br>Key id: %2<br><br>" - "<b>The file is corrupted!</b></qt>").arg(required.section(" ",2,-1).replace(QRegExp("<"),"<")).arg("0x"+required.section(" ",1,1).right(8)); + "<b>The file is corrupted!</b></qt>").arg(required.section(" ",2,-1).replace(TQRegExp("<"),"<")).arg("0x"+required.section(" ",1,1).right(8)); } if (required.startsWith("NO_PUBKEY")) { @@ -827,7 +827,7 @@ void KgpgInterface::verifyfin(KProcess *) } else { if (KMessageBox::questionYesNo(0,i18n("<qt><b>Missing signature:</b><br>Key id: %1<br><br>" - "Do you want to import this key from a keyserver?</qt>").arg(signID),file.fileName(),QString::null, i18n("Import"), i18n("Do Not Import"))==KMessageBox::Yes) + "Do you want to import this key from a keyserver?</qt>").arg(signID),file.fileName(),TQString::null, i18n("Import"), i18n("Do Not Import"))==KMessageBox::Yes) emit verifyquerykey(signID); } emit verifyfinished(); @@ -837,14 +837,14 @@ void KgpgInterface::verifyfin(KProcess *) //////////////////////////////////////////////////////////// sign a key -void KgpgInterface::KgpgSignKey(QString keyID,QString signKeyID,QString signKeyMail,bool local,int checking) +void KgpgInterface::KgpgSignKey(TQString keyID,TQString signKeyID,TQString signKeyMail,bool local,int checking) { - signKeyMail.replace(QRegExp("<"),"<"); + signKeyMail.replace(TQRegExp("<"),"<"); konsChecked=checking; konsLocal=local; konsSignKey=signKeyID; konsKeyID=keyID; - errMessage=QString::null; + errMessage=TQString::null; if (checkuid(keyID)>0) { openSignConsole(); @@ -853,20 +853,20 @@ void KgpgInterface::KgpgSignKey(QString keyID,QString signKeyID,QString signKeyM signSuccess=0; step=1; - output=QString::null; - KProcIO *conprocess=new KProcIO(QTextCodec::codecForLocale()); + output=TQString::null; + KProcIO *conprocess=new KProcIO(TQTextCodec::codecForLocale()); *conprocess<<"gpg"<<"--no-secmem-warning"<<"--no-tty"<<"--utf8-strings"<<"--command-fd=0"<<"--status-fd=2"<<"-u"<<signKeyID; *conprocess<<"--edit-key"<<keyID; if (local) *conprocess<<"lsign"; else *conprocess<<"sign"; - QObject::connect(conprocess,SIGNAL(readReady(KProcIO *)),this,SLOT(sigprocess(KProcIO *))); - QObject::connect(conprocess, SIGNAL(processExited(KProcess *)),this, SLOT(signover(KProcess *))); + TQObject::connect(conprocess,TQT_SIGNAL(readReady(KProcIO *)),this,TQT_SLOT(sigprocess(KProcIO *))); + TQObject::connect(conprocess, TQT_SIGNAL(processExited(KProcess *)),this, TQT_SLOT(signover(KProcess *))); conprocess->start(KProcess::NotifyOnExit,true); } void KgpgInterface::sigprocess(KProcIO *p) { - QString required=QString::null; + TQString required=TQString::null; while (p->readln(required,true)!=-1) { @@ -889,44 +889,44 @@ void KgpgInterface::sigprocess(KProcIO *p) if (required.find("sign_uid.expire")!=-1) { p->writeStdin("Never"); - required=QString::null; + required=TQString::null; } if (required.find("sign_uid.class")!=-1) { - p->writeStdin(QString::number(konsChecked)); - required=QString::null; + p->writeStdin(TQString::number(konsChecked)); + required=TQString::null; } if (required.find("sign_uid.okay")!=-1) { p->writeStdin("Y"); - required=QString::null; + required=TQString::null; } if (required.find("sign_all.okay")!=-1) { p->writeStdin("Y"); - required=QString::null; + required=TQString::null; } if (required.find("passphrase.enter")!=-1) { - QCString signpass; + TQCString signpass; int code=KPasswordDialog::getPassword(signpass,i18n("<qt>%1 Enter passphrase for <b>%2</b>:</qt>") .arg(errMessage).arg(userIDs)); - if (code!=QDialog::Accepted) { + if (code!=TQDialog::Accepted) { signSuccess=4; ///// aborted by user mode - required=QString::null; + required=TQString::null; p->writeStdin("quit"); p->closeWhenDone(); return; } p->writeStdin(signpass,true); - required=QString::null; + required=TQString::null; // step=2; } if ((step==2) && (required.find("keyedit.prompt")!=-1)) { p->writeStdin("save"); - required=QString::null; + required=TQString::null; } if (required.find("BAD_PASSPHRASE")!=-1) { errMessage=i18n("<b>Bad passphrase</b>. Try again.</br>"); - required=QString::null; + required=TQString::null; signSuccess=2; ///// bad passphrase } if (required.find("GET_")!=-1) /////// gpg asks for something unusal, turn to konsole mode @@ -948,7 +948,7 @@ void KgpgInterface::signover(KProcess *) else { KDetailedConsole *q=new KDetailedConsole(0,"sign_error",i18n("<qt>Signing key <b>%1</b> with key <b>%2</b> failed.<br>" "Do you want to try signing the key in console mode?</qt>").arg(konsKeyID).arg(konsSignKey),output); - if (q->exec()==QDialog::Accepted) + if (q->exec()==TQDialog::Accepted) openSignConsole(); else emit signatureFinished(0); @@ -975,7 +975,7 @@ void KgpgInterface::openSignConsole() //////////////////////////////////////////////////////////////////////////// delete signature -void KgpgInterface::KgpgDelSignature(QString keyID,QString signKeyID) +void KgpgInterface::KgpgDelSignature(TQString keyID,TQString signKeyID) { if (checkuid(keyID)>0) { KMessageBox::sorry(0,i18n("This key has more than one user ID.\nEdit the key manually to delete signature.")); @@ -987,13 +987,13 @@ void KgpgInterface::KgpgDelSignature(QString keyID,QString signKeyID) step=0; FILE *fp; - QString encResult; + TQString encResult; char buffer[200]; signb=0; sigsearch=0; - QString gpgcmd="gpg --no-tty --no-secmem-warning --with-colon --list-sigs "+keyID; - fp = popen(QFile::encodeName(gpgcmd), "r"); + TQString gpgcmd="gpg --no-tty --no-secmem-warning --with-colon --list-sigs "+keyID; + fp = popen(TQFile::encodeName(gpgcmd), "r"); while ( fgets( buffer, sizeof(buffer), fp)) { encResult=buffer; if (encResult.startsWith("sig")) { @@ -1004,11 +1004,11 @@ void KgpgInterface::KgpgDelSignature(QString keyID,QString signKeyID) signb++; } pclose(fp); - KProcIO *conprocess=new KProcIO(QTextCodec::codecForLocale()); + KProcIO *conprocess=new KProcIO(TQTextCodec::codecForLocale()); *conprocess<<"gpg"<<"--no-secmem-warning"<<"--no-tty"<<"--utf8-strings"<<"--command-fd=0"<<"--status-fd=2"; *conprocess<<"--edit-key"<<keyID<<"uid 1"<<"delsig"; - QObject::connect(conprocess,SIGNAL(readReady(KProcIO *)),this,SLOT(delsigprocess(KProcIO *))); - QObject::connect(conprocess, SIGNAL(processExited(KProcess *)),this, SLOT(delsignover(KProcess *))); + TQObject::connect(conprocess,TQT_SIGNAL(readReady(KProcIO *)),this,TQT_SLOT(delsigprocess(KProcIO *))); + TQObject::connect(conprocess, TQT_SIGNAL(processExited(KProcess *)),this, TQT_SLOT(delsignover(KProcess *))); conprocess->start(KProcess::NotifyOnExit,true); } @@ -1016,7 +1016,7 @@ void KgpgInterface::KgpgDelSignature(QString keyID,QString signKeyID) void KgpgInterface::delsigprocess(KProcIO *p) { - QString required=QString::null; + TQString required=TQString::null; while (p->readln(required,true)!=-1) { if (required.find("keyedit.delsig")!=-1){ @@ -1027,11 +1027,11 @@ void KgpgInterface::delsigprocess(KProcIO *p) } else p->writeStdin("n"); sigsearch++; - required=QString::null; + required=TQString::null; } if ((step==1) && (required.find("keyedit.prompt")!=-1)) { p->writeStdin("save"); - required=QString::null; + required=TQString::null; deleteSuccess=true; } if (required.find("GET_LINE")!=-1) { @@ -1049,16 +1049,16 @@ void KgpgInterface::delsignover(KProcess *) /////////////////////////////////////////////////// check if a key has more than one id -int KgpgInterface::checkuid(QString KeyID) +int KgpgInterface::checkuid(TQString KeyID) { FILE *fp; - QString encResult; + TQString encResult; char buffer[200]; int uidcnt=0; - QString gpgcmd="gpg --no-tty --no-secmem-warning --with-colon --list-sigs "+KeyID; + TQString gpgcmd="gpg --no-tty --no-secmem-warning --with-colon --list-sigs "+KeyID; ////////// encode with untrusted keys or armor if checked by user - fp = popen(QFile::encodeName(gpgcmd), "r"); + fp = popen(TQFile::encodeName(gpgcmd), "r"); while (fgets(buffer, sizeof(buffer), fp)) { encResult=buffer; if (encResult.startsWith("uid")) @@ -1072,27 +1072,27 @@ int KgpgInterface::checkuid(QString KeyID) /////////////////////////////////////////////////////////////// change key expiration -void KgpgInterface::KgpgKeyExpire(QString keyID,QDate date,bool unlimited) +void KgpgInterface::KgpgKeyExpire(TQString keyID,TQDate date,bool unlimited) { expSuccess=0; step=0; if (unlimited) expirationDelay=0; else - expirationDelay=QDate::currentDate().daysTo(date); - output=QString::null; - KProcIO *conprocess=new KProcIO(QTextCodec::codecForLocale()); + expirationDelay=TQDate::currentDate().daysTo(date); + output=TQString::null; + KProcIO *conprocess=new KProcIO(TQTextCodec::codecForLocale()); *conprocess<<"gpg"<<"--no-secmem-warning"<<"--no-tty"<<"--command-fd=0"<<"--status-fd=2"<<"--utf8-strings"; *conprocess<<"--edit-key"<<keyID<<"expire"; - QObject::connect(conprocess,SIGNAL(readReady(KProcIO *)),this,SLOT(expprocess(KProcIO *))); - QObject::connect(conprocess, SIGNAL(processExited(KProcess *)),this, SLOT(expover(KProcess *))); + TQObject::connect(conprocess,TQT_SIGNAL(readReady(KProcIO *)),this,TQT_SLOT(expprocess(KProcIO *))); + TQObject::connect(conprocess, TQT_SIGNAL(processExited(KProcess *)),this, TQT_SLOT(expover(KProcess *))); conprocess->start(KProcess::NotifyOnExit,KProcess::AllOutput); } void KgpgInterface::expprocess(KProcIO *p) { - QString required=QString::null; + TQString required=TQString::null; while (p->readln(required,true)!=-1) { output+=required+"\n"; @@ -1106,32 +1106,32 @@ void KgpgInterface::expprocess(KProcIO *p) } if (required.find("keygen.valid")!=-1) { - p->writeStdin(QString::number(expirationDelay)); - required=QString::null; + p->writeStdin(TQString::number(expirationDelay)); + required=TQString::null; } if (required.find("passphrase.enter")!=-1) { - QCString signpass; + TQCString signpass; int code=KPasswordDialog::getPassword(signpass,i18n("<qt>Enter passphrase for <b>%1</b>:</qt>").arg(userIDs)); - if (code!=QDialog::Accepted) { + if (code!=TQDialog::Accepted) { expSuccess=3; ///// aborted by user mode p->writeStdin("quit"); p->closeWhenDone(); return; } p->writeStdin(signpass,true); - required=QString::null; + required=TQString::null; // step=2; } if ((step==2) && (required.find("keyedit.prompt")!=-1)) { p->writeStdin("save"); p->closeWhenDone(); - required=QString::null; + required=TQString::null; } if ((step==2) && (required.find("keyedit.save.okay")!=-1)) { p->writeStdin("YES"); p->closeWhenDone(); - required=QString::null; + required=TQString::null; } if (required.find("BAD_PASSPHRASE")!=-1) { p->writeStdin("quit"); @@ -1157,7 +1157,7 @@ void KgpgInterface::expover(KProcess *) else { KDetailedConsole *q=new KDetailedConsole(0,"sign_error",i18n("<qt><b>Changing expiration failed.</b><br>" "Do you want to try changing the key expiration in console mode?</qt>"),output); - if (q->exec()==QDialog::Accepted) + if (q->exec()==TQDialog::Accepted) KMessageBox::sorry(0,"work in progress..."); //openSignConsole(); else @@ -1169,40 +1169,40 @@ void KgpgInterface::expover(KProcess *) /////////////////////////////////////////////////////////////// change key trust -void KgpgInterface::KgpgTrustExpire(QString keyID,int keyTrust) +void KgpgInterface::KgpgTrustExpire(TQString keyID,int keyTrust) { trustValue=keyTrust+1; /* Don't know=1; Do NOT trust=2; Marginally=3; Fully=4; Ultimately=5; */ - output=QString::null; - KProcIO *conprocess=new KProcIO(QTextCodec::codecForLocale()); + output=TQString::null; + KProcIO *conprocess=new KProcIO(TQTextCodec::codecForLocale()); *conprocess<<"gpg"<<"--no-secmem-warning"<<"--no-tty"<<"--command-fd=0"<<"--status-fd=2"<<"--utf8-strings"; *conprocess<<"--edit-key"<<keyID<<"trust"; - QObject::connect(conprocess,SIGNAL(readReady(KProcIO *)),this,SLOT(trustprocess(KProcIO *))); - QObject::connect(conprocess, SIGNAL(processExited(KProcess *)),this, SLOT(trustover(KProcess *))); + TQObject::connect(conprocess,TQT_SIGNAL(readReady(KProcIO *)),this,TQT_SLOT(trustprocess(KProcIO *))); + TQObject::connect(conprocess, TQT_SIGNAL(processExited(KProcess *)),this, TQT_SLOT(trustover(KProcess *))); conprocess->start(KProcess::NotifyOnExit,true); } void KgpgInterface::trustprocess(KProcIO *p) { - QString required=QString::null; + TQString required=TQString::null; while (p->readln(required,true)!=-1) { output+=required+"\n"; if (required.find("edit_ownertrust.set_ultimate.okay")!=-1) { p->writeStdin("YES"); - required=QString::null; + required=TQString::null; } if (required.find("edit_ownertrust.value")!=-1) { - p->writeStdin(QString::number(trustValue)); - required=QString::null; + p->writeStdin(TQString::number(trustValue)); + required=TQString::null; } if (required.find("keyedit.prompt")!=-1) { p->writeStdin("save"); p->closeWhenDone(); - required=QString::null; + required=TQString::null; } if (required.find("GET_")!=-1) /////// gpg asks for something unusal, turn to konsole mode @@ -1226,23 +1226,23 @@ void KgpgInterface::trustover(KProcess *) /////////////////////////////////////////////////////////////// change passphrase -void KgpgInterface::KgpgChangePass(QString keyID) +void KgpgInterface::KgpgChangePass(TQString keyID) { step=1; - output=QString::null; - message=QString::null; - KProcIO *conprocess=new KProcIO(QTextCodec::codecForLocale()); + output=TQString::null; + message=TQString::null; + KProcIO *conprocess=new KProcIO(TQTextCodec::codecForLocale()); *conprocess<<"gpg"<<"--no-secmem-warning"<<"--no-tty"<<"--no-use-agent"<<"--command-fd=0"<<"--status-fd=2"<<"--utf8-strings"; *conprocess<<"--edit-key"<<keyID<<"passwd"; - QObject::connect(conprocess,SIGNAL(readReady(KProcIO *)),this,SLOT(passprocess(KProcIO *))); - QObject::connect(conprocess, SIGNAL(processExited(KProcess *)),this, SLOT(passover(KProcess *))); + TQObject::connect(conprocess,TQT_SIGNAL(readReady(KProcIO *)),this,TQT_SLOT(passprocess(KProcIO *))); + TQObject::connect(conprocess, TQT_SIGNAL(processExited(KProcess *)),this, TQT_SLOT(passover(KProcess *))); conprocess->start(KProcess::NotifyOnExit,KProcess::AllOutput); } void KgpgInterface::passprocess(KProcIO *p) { - QString required=QString::null; + TQString required=TQString::null; while (p->readln(required,true)!=-1) { output+=required+"\n"; @@ -1257,7 +1257,7 @@ void KgpgInterface::passprocess(KProcIO *p) p->writeStdin("save"); } else p->writeStdin("quit"); - required=QString::null; + required=TQString::null; } if ((required.find("GOOD_PASSPHRASE")!=-1) && (step==2)) @@ -1271,13 +1271,13 @@ void KgpgInterface::passprocess(KProcIO *p) if ((required.find("passphrase.enter")!=-1)) { if (userIDs.isEmpty()) userIDs=i18n("[No user id found]"); - userIDs.replace(QRegExp("<"),"<"); + userIDs.replace(TQRegExp("<"),"<"); if (step==1) { - QCString passphrase; + TQCString passphrase; int code=KPasswordDialog::getPassword(passphrase,i18n("<qt>%1 Enter passphrase for <b>%2</b></qt>") .arg(message).arg(userIDs)); - if (code!=QDialog::Accepted) { + if (code!=TQDialog::Accepted) { p->writeStdin("quit"); // p->closeWhenDone(); emit processaborted(true); @@ -1289,9 +1289,9 @@ void KgpgInterface::passprocess(KProcIO *p) } if (step==3) { - QCString passphrase; + TQCString passphrase; int code=KPasswordDialog::getNewPassword(passphrase,i18n("<qt>Enter new passphrase for <b>%1</b><br>If you forget this passphrase, all your encrypted files and messages will be lost !<br></qt>").arg(userIDs)); - if (code!=QDialog::Accepted) { + if (code!=TQDialog::Accepted) { step=4; p->writeStdin("quit"); p->writeStdin("quit"); @@ -1300,10 +1300,10 @@ void KgpgInterface::passprocess(KProcIO *p) return; } p->writeStdin(passphrase,true); - userIDs=QString::null; + userIDs=TQString::null; } - required=QString::null; + required=TQString::null; } @@ -1327,18 +1327,18 @@ void KgpgInterface::passover(KProcess *) ////////////////////////////////////////////////////////////// key export -QString KgpgInterface::getKey(QStringList IDs, bool attributes) +TQString KgpgInterface::getKey(TQStringList IDs, bool attributes) { - keyString=QString::null; - KProcIO *proc=new KProcIO(QTextCodec::codecForLocale()); + keyString=TQString::null; + KProcIO *proc=new KProcIO(TQTextCodec::codecForLocale()); *proc<< "gpg"<<"--no-tty"<<"--no-secmem-warning"<<"--utf8-strings"; *proc<<"--export"<<"--armor"; if (!attributes) *proc<<"--export-options"<<"no-include-attributes"; - for ( QStringList::Iterator it = IDs.begin(); it != IDs.end(); ++it ) + for ( TQStringList::Iterator it = IDs.begin(); it != IDs.end(); ++it ) *proc << *it; - QObject::connect(proc, SIGNAL(readReady(KProcIO *)),this, SLOT(slotReadKey(KProcIO *))); + TQObject::connect(proc, TQT_SIGNAL(readReady(KProcIO *)),this, TQT_SLOT(slotReadKey(KProcIO *))); proc->start(KProcess::Block,false); return keyString; } @@ -1346,7 +1346,7 @@ QString KgpgInterface::getKey(QStringList IDs, bool attributes) void KgpgInterface::slotReadKey(KProcIO *p) { - QString outp; + TQString outp; while (p->readln(outp)!=-1) if (!outp.startsWith("gpg:")) keyString+=outp+"\n"; } @@ -1359,26 +1359,26 @@ void KgpgInterface::importKeyURL(KURL url) ///////////// import a key if( KIO::NetAccess::download( url, tempKeyFile,0) ) { - message=QString::null; - KProcIO *conprocess=new KProcIO(QTextCodec::codecForLocale()); + message=TQString::null; + KProcIO *conprocess=new KProcIO(TQTextCodec::codecForLocale()); *conprocess<< "gpg"<<"--no-tty"<<"--no-secmem-warning"<<"--status-fd=2"<<"--utf8-strings"<<"--import"; *conprocess<<"--allow-secret-key-import"; *conprocess<<tempKeyFile; - QObject::connect(conprocess, SIGNAL(processExited(KProcess *)),this, SLOT(importURLover(KProcess *))); - QObject::connect(conprocess, SIGNAL(readReady(KProcIO *)),this, SLOT(importprocess(KProcIO *))); + TQObject::connect(conprocess, TQT_SIGNAL(processExited(KProcess *)),this, TQT_SLOT(importURLover(KProcess *))); + TQObject::connect(conprocess, TQT_SIGNAL(readReady(KProcIO *)),this, TQT_SLOT(importprocess(KProcIO *))); conprocess->start(KProcess::NotifyOnExit,true); } } -void KgpgInterface::importKey(QString keystr) +void KgpgInterface::importKey(TQString keystr) { ///////////// import a key - message=QString::null; - KProcIO *conprocess=new KProcIO(QTextCodec::codecForLocale()); + message=TQString::null; + KProcIO *conprocess=new KProcIO(TQTextCodec::codecForLocale()); *conprocess<< "gpg"<<"--no-tty"<<"--no-secmem-warning"<<"--status-fd=2"<<"--import"; *conprocess<<"--allow-secret-key-import"; - QObject::connect(conprocess, SIGNAL(processExited(KProcess *)),this, SLOT(importover(KProcess *))); - QObject::connect(conprocess, SIGNAL(readReady(KProcIO *)),this, SLOT(importprocess(KProcIO *))); + TQObject::connect(conprocess, TQT_SIGNAL(processExited(KProcess *)),this, TQT_SLOT(importover(KProcess *))); + TQObject::connect(conprocess, TQT_SIGNAL(readReady(KProcIO *)),this, TQT_SLOT(importprocess(KProcIO *))); conprocess->start(KProcess::NotifyOnExit,true); conprocess->writeStdin(keystr, true); conprocess->closeWhenDone(); @@ -1386,13 +1386,13 @@ void KgpgInterface::importKey(QString keystr) void KgpgInterface::importover(KProcess *) { -QStringList importedKeysIds; -QStringList messageList; -QString resultMessage; +TQStringList importedKeysIds; +TQStringList messageList; +TQString resultMessage; bool secretImport=false; kdDebug(2100)<<"Importing is over"<<endl; - QString parsedOutput=message; - QStringList importedKeys; + TQString parsedOutput=message; + TQStringList importedKeys; while (parsedOutput.find("IMPORTED")!=-1) { parsedOutput.remove(0,parsedOutput.find("IMPORTED")+8); @@ -1403,7 +1403,7 @@ kdDebug(2100)<<"Importing is over"<<endl; if (message.find("IMPORT_RES")!=-1) { parsedOutput=message.section("IMPORT_RES",-1,-1).stripWhiteSpace(); - messageList=QStringList::split(" ",parsedOutput,true); + messageList=TQStringList::split(" ",parsedOutput,true); resultMessage=i18n("<qt>%n key processed.<br></qt>","<qt>%n keys processed.<br></qt>",messageList[0].toULong()); if (messageList[4]!="0") @@ -1458,7 +1458,7 @@ void KgpgInterface::importURLover(KProcess *p) void KgpgInterface::importprocess(KProcIO *p) { - QString outp; + TQString outp; while (p->readln(outp)!=-1) { if (outp.find("http-proxy")==-1) message+=outp+"\n"; @@ -1469,19 +1469,19 @@ void KgpgInterface::importprocess(KProcIO *p) /////////////////////////////////////////////////////////////////////////////////////// User ID's -void KgpgInterface::KgpgAddUid(QString keyID,QString name,QString email,QString comment) +void KgpgInterface::KgpgAddUid(TQString keyID,TQString name,TQString email,TQString comment) { uidName=name; uidComment=comment; uidEmail=email; -output=QString::null; +output=TQString::null; addSuccess=true; - KProcIO *conprocess=new KProcIO(QTextCodec::codecForLocale()); + KProcIO *conprocess=new KProcIO(TQTextCodec::codecForLocale()); *conprocess<< "gpg"<<"--no-tty"<<"--status-fd=2"<<"--command-fd=0"<<"--utf8-strings"; *conprocess<<"--edit-key"<<keyID<<"adduid"; - QObject::connect(conprocess, SIGNAL(processExited(KProcess *)),this, SLOT(adduidover(KProcess *))); - QObject::connect(conprocess, SIGNAL(readReady(KProcIO *)),this, SLOT(adduidprocess(KProcIO *))); + TQObject::connect(conprocess, TQT_SIGNAL(processExited(KProcess *)),this, TQT_SLOT(adduidover(KProcess *))); + TQObject::connect(conprocess, TQT_SIGNAL(readReady(KProcIO *)),this, TQT_SLOT(adduidprocess(KProcIO *))); conprocess->start(KProcess::NotifyOnExit,true); } @@ -1493,7 +1493,7 @@ else emit addUidError(output); void KgpgInterface::adduidprocess(KProcIO *p) { - QString required=QString::null; + TQString required=TQString::null; while (p->readln(required,true)!=-1) { output+=required+"\n"; if (required.find("USERID_HINT",0,false)!=-1) @@ -1501,37 +1501,37 @@ void KgpgInterface::adduidprocess(KProcIO *p) if (required.find("keygen.name")!=-1) { p->writeStdin(uidName); - required=QString::null; + required=TQString::null; } if (required.find("keygen.email")!=-1) { p->writeStdin(uidEmail); - required=QString::null; + required=TQString::null; } if (required.find("keygen.comment")!=-1) { p->writeStdin(uidComment); - required=QString::null; + required=TQString::null; } if (required.find("passphrase.enter")!=-1) { - QCString delpass; + TQCString delpass; int code=KPasswordDialog::getPassword(delpass,i18n("<qt>Enter passphrase for <b>%1</b>:</qt>") .arg(userIDs)); - if (code!=QDialog::Accepted) { + if (code!=TQDialog::Accepted) { //addSuccess=false; p->writeStdin("quit"); p->closeWhenDone(); return; } p->writeStdin(delpass,true); - required=QString::null; + required=TQString::null; } if (required.find("keyedit.prompt")!=-1) { p->writeStdin("save"); - required=QString::null; + required=TQString::null; } if ((required.find("GET_")!=-1)) /////// gpg asks for something unusal, turn to konsole mode @@ -1554,24 +1554,24 @@ void KgpgInterface::adduidprocess(KProcIO *p) ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// photo id's -void KgpgInterface::KgpgGetPhotoList(QString keyID) +void KgpgInterface::KgpgGetPhotoList(TQString keyID) { photoList.clear(); -output=QString::null; +output=TQString::null; photoCount=1; userIDs=keyID; - KProcIO *conprocess=new KProcIO(QTextCodec::codecForLocale()); + KProcIO *conprocess=new KProcIO(TQTextCodec::codecForLocale()); *conprocess<< "gpg"<<"--no-tty"<<"--status-fd=2"<<"--command-fd=0"; *conprocess<<"--with-colon"<<"--list-keys"<<keyID; - QObject::connect(conprocess, SIGNAL(processExited(KProcess *)),this, SLOT(photoreadover(KProcess *))); - QObject::connect(conprocess, SIGNAL(readReady(KProcIO *)),this, SLOT(photoreadprocess(KProcIO *))); + TQObject::connect(conprocess, TQT_SIGNAL(processExited(KProcess *)),this, TQT_SLOT(photoreadover(KProcess *))); + TQObject::connect(conprocess, TQT_SIGNAL(readReady(KProcIO *)),this, TQT_SLOT(photoreadprocess(KProcIO *))); conprocess->start(KProcess::NotifyOnExit,true); } void KgpgInterface::photoreadprocess(KProcIO *p) { - QString required=QString::null; + TQString required=TQString::null; while (p->readln(required,true)!=-1) { output+=required+"\n"; if (required.startsWith("uat") || required.startsWith("uid")) photoCount++; @@ -1582,7 +1582,7 @@ void KgpgInterface::photoreadprocess(KProcIO *p) void KgpgInterface::photoreadover(KProcess *) { for (int i=1;i<photoCount+1;i++) -if (isPhotoId(i)) photoList+=QString::number(i); +if (isPhotoId(i)) photoList+=TQString::number(i); emit signalPhotoList(photoList); } @@ -1591,11 +1591,11 @@ bool KgpgInterface::isPhotoId(int uid) { KTempFile *kgpginfotmp=new KTempFile(); kgpginfotmp->setAutoDelete(true); - QString pgpgOutput="cp %i "+kgpginfotmp->name(); + TQString pgpgOutput="cp %i "+kgpginfotmp->name(); -KProcIO *conprocess=new KProcIO(QTextCodec::codecForLocale()); +KProcIO *conprocess=new KProcIO(TQTextCodec::codecForLocale()); *conprocess<< "gpg"<<"--no-tty"<<"--status-fd=2"<<"--command-fd=0"<<"--utf8-strings"; - *conprocess<<"--photo-viewer"<<QFile::encodeName(pgpgOutput)<<"--edit-key"<<userIDs<<"uid"<<QString::number(uid)<<"showphoto"; + *conprocess<<"--photo-viewer"<<TQFile::encodeName(pgpgOutput)<<"--edit-key"<<userIDs<<"uid"<<TQString::number(uid)<<"showphoto"; conprocess->start(KProcess::Block); if (kgpginfotmp->file()->size()>0) { @@ -1606,15 +1606,15 @@ KProcIO *conprocess=new KProcIO(QTextCodec::codecForLocale()); return false; } -void KgpgInterface::KgpgDeletePhoto(QString keyID,QString uid) +void KgpgInterface::KgpgDeletePhoto(TQString keyID,TQString uid) { delSuccess=true; - output=QString::null; - KProcIO *conprocess=new KProcIO(QTextCodec::codecForLocale()); + output=TQString::null; + KProcIO *conprocess=new KProcIO(TQTextCodec::codecForLocale()); *conprocess<< "gpg"<<"--no-tty"<<"--status-fd=2"<<"--command-fd=0"<<"--utf8-strings"; *conprocess<<"--edit-key"<<keyID<<"uid"<<uid<<"deluid"; - QObject::connect(conprocess, SIGNAL(processExited(KProcess *)),this, SLOT(delphotoover(KProcess *))); - QObject::connect(conprocess, SIGNAL(readReady(KProcIO *)),this, SLOT(delphotoprocess(KProcIO *))); + TQObject::connect(conprocess, TQT_SIGNAL(processExited(KProcess *)),this, TQT_SLOT(delphotoover(KProcess *))); + TQObject::connect(conprocess, TQT_SIGNAL(readReady(KProcIO *)),this, TQT_SLOT(delphotoprocess(KProcIO *))); conprocess->start(KProcess::NotifyOnExit,true); } @@ -1626,7 +1626,7 @@ else emit delPhotoError(output); void KgpgInterface::delphotoprocess(KProcIO *p) { - QString required=QString::null; + TQString required=TQString::null; while (p->readln(required,true)!=-1) { output+=required+"\n"; if (required.find("USERID_HINT",0,false)!=-1) @@ -1634,26 +1634,26 @@ void KgpgInterface::delphotoprocess(KProcIO *p) if (required.find("keyedit.remove.uid.okay")!=-1) { p->writeStdin("YES"); - required=QString::null; + required=TQString::null; } if (required.find("passphrase.enter")!=-1) { - QCString delpass; + TQCString delpass; int code=KPasswordDialog::getPassword(delpass,i18n("<qt>Enter passphrase for <b>%1</b>:</qt>").arg(userIDs)); - if (code!=QDialog::Accepted) { + if (code!=TQDialog::Accepted) { //deleteSuccess=false; p->writeStdin("quit"); p->closeWhenDone(); return; } p->writeStdin(delpass,true); - required=QString::null; + required=TQString::null; } if (required.find("keyedit.prompt")!=-1) { p->writeStdin("save"); - required=QString::null; + required=TQString::null; } if ((required.find("GET_")!=-1)) /////// gpg asks for something unusal, turn to konsole mode @@ -1668,16 +1668,16 @@ void KgpgInterface::delphotoprocess(KProcIO *p) } -void KgpgInterface::KgpgAddPhoto(QString keyID,QString imagePath) +void KgpgInterface::KgpgAddPhoto(TQString keyID,TQString imagePath) { photoUrl=imagePath; -output=QString::null; +output=TQString::null; addSuccess=true; - KProcIO *conprocess=new KProcIO(QTextCodec::codecForLocale()); + KProcIO *conprocess=new KProcIO(TQTextCodec::codecForLocale()); *conprocess<< "gpg"<<"--no-tty"<<"--status-fd=2"<<"--command-fd=0"<<"--utf8-strings"; *conprocess<<"--edit-key"<<keyID<<"addphoto"; - QObject::connect(conprocess, SIGNAL(processExited(KProcess *)),this, SLOT(addphotoover(KProcess *))); - QObject::connect(conprocess, SIGNAL(readReady(KProcIO *)),this, SLOT(addphotoprocess(KProcIO *))); + TQObject::connect(conprocess, TQT_SIGNAL(processExited(KProcess *)),this, TQT_SLOT(addphotoover(KProcess *))); + TQObject::connect(conprocess, TQT_SIGNAL(readReady(KProcIO *)),this, TQT_SLOT(addphotoprocess(KProcIO *))); conprocess->start(KProcess::NotifyOnExit,true); } @@ -1689,7 +1689,7 @@ else emit addPhotoError(output); void KgpgInterface::addphotoprocess(KProcIO *p) { - QString required=QString::null; + TQString required=TQString::null; while (p->readln(required,true)!=-1) { output+=required+"\n"; if (required.find("USERID_HINT",0,false)!=-1) @@ -1697,11 +1697,11 @@ void KgpgInterface::addphotoprocess(KProcIO *p) if (required.find("photoid.jpeg.add")!=-1) { p->writeStdin(photoUrl); - required=QString::null; + required=TQString::null; } if (required.find("photoid.jpeg.size")!=-1) { - if (KMessageBox::questionYesNo(0,i18n("This image is very large. Use it anyway?"), QString::null, i18n("Use Anyway"), i18n("Do Not Use"))==KMessageBox::Yes) + if (KMessageBox::questionYesNo(0,i18n("This image is very large. Use it anyway?"), TQString::null, i18n("Use Anyway"), i18n("Do Not Use"))==KMessageBox::Yes) p->writeStdin("Yes"); else { @@ -1709,26 +1709,26 @@ void KgpgInterface::addphotoprocess(KProcIO *p) p->writeStdin(""); p->writeStdin("quit"); } - required=QString::null; + required=TQString::null; } if (required.find("passphrase.enter")!=-1) { - QCString delpass; + TQCString delpass; int code=KPasswordDialog::getPassword(delpass,i18n("<qt>Enter passphrase for <b>%1</b>:</qt>").arg(userIDs)); - if (code!=QDialog::Accepted) { + if (code!=TQDialog::Accepted) { //deleteSuccess=false; p->writeStdin("quit"); p->closeWhenDone(); return; } p->writeStdin(delpass,true); - required=QString::null; + required=TQString::null; } if (required.find("keyedit.prompt")!=-1) { p->writeStdin("save"); - required=QString::null; + required=TQString::null; } if ((required.find("GET_")!=-1)) /////// gpg asks for something unusal, turn to konsole mode @@ -1745,20 +1745,20 @@ void KgpgInterface::addphotoprocess(KProcIO *p) ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// key revocation -void KgpgInterface::KgpgRevokeKey(QString keyID,QString revokeUrl,int reason,QString description) +void KgpgInterface::KgpgRevokeKey(TQString keyID,TQString revokeUrl,int reason,TQString description) { revokeReason=reason; revokeSuccess=false; revokeDescription=description; certificateUrl=revokeUrl; - output=QString::null; - KProcIO *conprocess=new KProcIO(QTextCodec::codecForLocale()); + output=TQString::null; + KProcIO *conprocess=new KProcIO(TQTextCodec::codecForLocale()); *conprocess<< "gpg"<<"--no-tty"<<"--status-fd=2"<<"--logger-fd=2"<<"--command-fd=0"<<"--utf8-strings"; if (!revokeUrl.isEmpty()) *conprocess<<"-o"<<revokeUrl; *conprocess<<"--gen-revoke"<<keyID; - QObject::connect(conprocess, SIGNAL(processExited(KProcess *)),this, SLOT(revokeover(KProcess *))); - QObject::connect(conprocess, SIGNAL(readReady(KProcIO *)),this, SLOT(revokeprocess(KProcIO *))); + TQObject::connect(conprocess, TQT_SIGNAL(processExited(KProcess *)),this, TQT_SLOT(revokeover(KProcess *))); + TQObject::connect(conprocess, TQT_SIGNAL(readReady(KProcIO *)),this, TQT_SLOT(revokeprocess(KProcIO *))); conprocess->start(KProcess::NotifyOnExit,true); } @@ -1778,7 +1778,7 @@ void KgpgInterface::revokeover(KProcess *) void KgpgInterface::revokeprocess(KProcIO *p) { - QString required=QString::null; + TQString required=TQString::null; while (p->readln(required,true)!=-1) { output+=required+"\n"; @@ -1790,32 +1790,32 @@ void KgpgInterface::revokeprocess(KProcIO *p) if ((required.find("gen_revoke.okay")!=-1) || (required.find("ask_revocation_reason.okay")!=-1) || (required.find("openfile.overwrite.okay")!=-1)) { p->writeStdin("YES"); - required=QString::null; + required=TQString::null; } if (required.find("ask_revocation_reason.code")!=-1) { - p->writeStdin(QString::number(revokeReason)); - required=QString::null; + p->writeStdin(TQString::number(revokeReason)); + required=TQString::null; } if (required.find("passphrase.enter")!=-1) { - QCString signpass; + TQCString signpass; int code=KPasswordDialog::getPassword(signpass,i18n("<qt>Enter passphrase for <b>%1</b>:</qt>").arg(userIDs)); - if (code!=QDialog::Accepted) { + if (code!=TQDialog::Accepted) { expSuccess=3; ///// aborted by user mode p->writeStdin("quit"); p->closeWhenDone(); return; } p->writeStdin(signpass,true); - required=QString::null; + required=TQString::null; } if (required.find("ask_revocation_reason.text")!=-1) { // kdDebug(2100)<<"description"<<endl; p->writeStdin(revokeDescription); - revokeDescription=QString::null; - required=QString::null; + revokeDescription=TQString::null; + required=TQString::null; } if ((required.find("GET_")!=-1)) /////// gpg asks for something unusal, turn to konsole mode { @@ -1831,13 +1831,13 @@ void KgpgInterface::revokeprocess(KProcIO *p) /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// parsing of ./gnupg/options file -QString KgpgInterface::getGpgSetting(QString name,QString configFile) +TQString KgpgInterface::getGpgSetting(TQString name,TQString configFile) { name=name.stripWhiteSpace()+" "; - QFile qfile(QFile::encodeName(configFile)); + TQFile qfile(TQFile::encodeName(configFile)); if (qfile.open(IO_ReadOnly) && (qfile.exists())) { - QString result; - QTextStream t( &qfile ); + TQString result; + TQTextStream t( &qfile ); result=t.readLine(); while (result!=NULL) { if (result.stripWhiteSpace().startsWith(name)) { @@ -1850,26 +1850,26 @@ QString KgpgInterface::getGpgSetting(QString name,QString configFile) } qfile.close(); } - return QString::null; + return TQString::null; } -QString KgpgInterface::getGpgMultiSetting(QString name,QString configFile) +TQString KgpgInterface::getGpgMultiSetting(TQString name,TQString configFile) { // get GnuPG setting for item that can have multiple entries (eg. encrypt-to) -QString parsedResult=QString::null; +TQString parsedResult=TQString::null; name=name.stripWhiteSpace()+" "; - QFile qfile(QFile::encodeName(configFile)); + TQFile qfile(TQFile::encodeName(configFile)); if (qfile.open(IO_ReadOnly) && (qfile.exists())) { - QString result; - QTextStream t( &qfile ); + TQString result; + TQTextStream t( &qfile ); result=t.readLine(); while (result!=NULL) { if (result.stripWhiteSpace().startsWith(name)) { result=result.stripWhiteSpace(); result.remove(0,name.length()); - if (parsedResult!=QString::null) + if (parsedResult!=TQString::null) parsedResult+=" "+result.stripWhiteSpace(); else parsedResult+=result.stripWhiteSpace(); @@ -1882,53 +1882,53 @@ QString parsedResult=QString::null; return parsedResult; } -void KgpgInterface::delGpgGroup(QString name, QString configFile) +void KgpgInterface::delGpgGroup(TQString name, TQString configFile) { - QString textToWrite; - QFile qfile(QFile::encodeName(configFile)); + TQString textToWrite; + TQFile qfile(TQFile::encodeName(configFile)); if (qfile.open(IO_ReadOnly) && (qfile.exists())) { - QString result; - QTextStream t( &qfile ); + TQString result; + TQTextStream t( &qfile ); result=t.readLine(); while (result!=NULL) { if (result.stripWhiteSpace().startsWith("group ")) { - QString result2=result.stripWhiteSpace(); + TQString result2=result.stripWhiteSpace(); result2.remove(0,6); result2=result2.stripWhiteSpace(); if (result2.startsWith(name) && (result2.remove(0,name.length()).stripWhiteSpace().startsWith("="))) - result=QString::null; + result=TQString::null; } - if (result!=QString::null) textToWrite+=result+"\n"; + if (result!=TQString::null) textToWrite+=result+"\n"; result=t.readLine(); } qfile.close(); if (qfile.open(IO_WriteOnly)) { - QTextStream t( &qfile); + TQTextStream t( &qfile); t << textToWrite; qfile.close(); } } } -void KgpgInterface::setGpgGroupSetting(QString name,QStringList values, QString configFile) +void KgpgInterface::setGpgGroupSetting(TQString name,TQStringList values, TQString configFile) { - QString textToWrite; + TQString textToWrite; bool found=false; - QFile qfile(QFile::encodeName(configFile)); + TQFile qfile(TQFile::encodeName(configFile)); kdDebug(2100)<<"Changing group: "<<name<<endl; if (qfile.open(IO_ReadOnly) && (qfile.exists())) { - QString result; - QTextStream t( &qfile ); + TQString result; + TQTextStream t( &qfile ); result=t.readLine(); while (result!=NULL) { if (result.stripWhiteSpace().startsWith("group ")) { - QString result2=result.stripWhiteSpace(); + TQString result2=result.stripWhiteSpace(); result2.remove(0,6); result2=result2.stripWhiteSpace(); if (result2.startsWith(name) && (result2.remove(0,name.length()).stripWhiteSpace().startsWith("="))) { // kdDebug(2100)<<"Found group: "<<name<<endl; //kdDebug(2100)<<"New values: "<<values<<endl; - result=QString("group %1=%2").arg(name).arg(values.join(" ")); + result=TQString("group %1=%2").arg(name).arg(values.join(" ")); found=true; } } @@ -1937,10 +1937,10 @@ void KgpgInterface::setGpgGroupSetting(QString name,QStringList values, QString } qfile.close(); if (!found) - textToWrite+="\n"+QString("group %1=%2").arg(name).arg(values.join(" ")); + textToWrite+="\n"+TQString("group %1=%2").arg(name).arg(values.join(" ")); if (qfile.open(IO_WriteOnly)) { - QTextStream t( &qfile); + TQTextStream t( &qfile); t << textToWrite; qfile.close(); } @@ -1949,13 +1949,13 @@ void KgpgInterface::setGpgGroupSetting(QString name,QStringList values, QString -QStringList KgpgInterface::getGpgGroupSetting(QString name,QString configFile) +TQStringList KgpgInterface::getGpgGroupSetting(TQString name,TQString configFile) { - QFile qfile(QFile::encodeName(configFile)); + TQFile qfile(TQFile::encodeName(configFile)); if (qfile.open(IO_ReadOnly) && (qfile.exists())) { - QString result; - QTextStream t( &qfile ); + TQString result; + TQTextStream t( &qfile ); result=t.readLine(); while (result!=NULL) { result=result.stripWhiteSpace(); @@ -1966,23 +1966,23 @@ QStringList KgpgInterface::getGpgGroupSetting(QString name,QString configFile) kdDebug(2100)<<"Found group: "<<name<<endl; result=result.section('=',1); result=result.section('#',0,0); - return QStringList::split (" ",result); + return TQStringList::split (" ",result); } } result=t.readLine(); } qfile.close(); } - return QString::null; + return TQString::null; } -QStringList KgpgInterface::getGpgGroupNames(QString configFile) +TQStringList KgpgInterface::getGpgGroupNames(TQString configFile) { - QStringList groups; - QFile qfile(QFile::encodeName(configFile)); + TQStringList groups; + TQFile qfile(TQFile::encodeName(configFile)); if (qfile.open(IO_ReadOnly) && (qfile.exists())) { - QString result; - QTextStream t( &qfile ); + TQString result; + TQTextStream t( &qfile ); result=t.readLine(); while (result!=NULL) { result=result.stripWhiteSpace(); @@ -1998,13 +1998,13 @@ QStringList KgpgInterface::getGpgGroupNames(QString configFile) } -bool KgpgInterface::getGpgBoolSetting(QString name,QString configFile) +bool KgpgInterface::getGpgBoolSetting(TQString name,TQString configFile) { name=name; - QFile qfile(QFile::encodeName(configFile)); + TQFile qfile(TQFile::encodeName(configFile)); if (qfile.open(IO_ReadOnly) && (qfile.exists())) { - QString result; - QTextStream t( &qfile ); + TQString result; + TQTextStream t( &qfile ); result=t.readLine(); while (result!=NULL) { if (result.stripWhiteSpace().startsWith(name)) { @@ -2017,26 +2017,26 @@ bool KgpgInterface::getGpgBoolSetting(QString name,QString configFile) return false; } -void KgpgInterface::setGpgSetting(QString name,QString value,QString url) +void KgpgInterface::setGpgSetting(TQString name,TQString value,TQString url) { name=name+" "; - QString textToWrite; + TQString textToWrite; bool found=false; - QFile qfile(QFile::encodeName(url)); + TQFile qfile(TQFile::encodeName(url)); if (qfile.open(IO_ReadOnly) && (qfile.exists())) { - QString result; - QTextStream t( &qfile ); + TQString result; + TQTextStream t( &qfile ); result=t.readLine(); while (result!=NULL) { if (result.stripWhiteSpace().startsWith(name)) { if (!value.isEmpty()) result=name+" "+value; else - result=QString::null; + result=TQString::null; found=true; } - if (result!=QString::null) textToWrite+=result+"\n"; + if (result!=TQString::null) textToWrite+=result+"\n"; result=t.readLine(); } qfile.close(); @@ -2044,7 +2044,7 @@ void KgpgInterface::setGpgSetting(QString name,QString value,QString url) textToWrite+="\n"+name+" "+value; if (qfile.open(IO_WriteOnly)) { - QTextStream t( &qfile); + TQTextStream t( &qfile); t << textToWrite; qfile.close(); } @@ -2052,16 +2052,16 @@ void KgpgInterface::setGpgSetting(QString name,QString value,QString url) } -void KgpgInterface::setGpgMultiSetting(QString name,QStringList values,QString url) +void KgpgInterface::setGpgMultiSetting(TQString name,TQStringList values,TQString url) { name=name+" "; - QString textToWrite; + TQString textToWrite; bool found=false; - QFile qfile(QFile::encodeName(url)); + TQFile qfile(TQFile::encodeName(url)); if (qfile.open(IO_ReadOnly) && (qfile.exists())) { - QString result; - QTextStream t( &qfile ); + TQString result; + TQTextStream t( &qfile ); result=t.readLine(); while (result!=NULL) { if (!result.stripWhiteSpace().startsWith(name)) @@ -2077,32 +2077,32 @@ void KgpgInterface::setGpgMultiSetting(QString name,QStringList values,QString u } if (qfile.open(IO_WriteOnly)) { - QTextStream t( &qfile); + TQTextStream t( &qfile); t << textToWrite; qfile.close(); } } } -void KgpgInterface::setGpgBoolSetting(QString name,bool enable,QString url) +void KgpgInterface::setGpgBoolSetting(TQString name,bool enable,TQString url) { - QString textToWrite; + TQString textToWrite; bool found=false; - QFile qfile(QFile::encodeName(url)); + TQFile qfile(TQFile::encodeName(url)); if (qfile.open(IO_ReadOnly) && (qfile.exists())) { - QString result; - QTextStream t( &qfile ); + TQString result; + TQTextStream t( &qfile ); result=t.readLine(); while (result!=NULL) { if (result.stripWhiteSpace().startsWith(name)) { if (enable) result=name; else - result=QString::null; + result=TQString::null; found=true; } - if (result!=QString::null) textToWrite+=result+"\n"; + if (result!=TQString::null) textToWrite+=result+"\n"; result=t.readLine(); } qfile.close(); @@ -2110,26 +2110,26 @@ void KgpgInterface::setGpgBoolSetting(QString name,bool enable,QString url) textToWrite+=name; if (qfile.open(IO_WriteOnly)) { - QTextStream t( &qfile); + TQTextStream t( &qfile); t << textToWrite; qfile.close(); } } } -QString KgpgInterface::checkForUtf8bis(QString txt) +TQString KgpgInterface::checkForUtf8bis(TQString txt) { if (strchr (txt.ascii(), 0xc3) || (txt.find("\\x")!=-1)) txt=checkForUtf8(txt); else { txt=checkForUtf8(txt); - txt=QString::fromUtf8(txt.ascii()); + txt=TQString::fromUtf8(txt.ascii()); } return txt; } -QString KgpgInterface::checkForUtf8(QString txt) +TQString KgpgInterface::checkForUtf8(TQString txt) { // code borrowed from gpa const char *s; @@ -2137,7 +2137,7 @@ QString KgpgInterface::checkForUtf8(QString txt) /* Make sure the encoding is UTF-8. * Test structure suggested by Werner Koch */ if (txt.isEmpty()) - return QString::null; + return TQString::null; for (s = txt.ascii(); *s && !(*s & 0x80); s++) ; @@ -2147,17 +2147,17 @@ QString KgpgInterface::checkForUtf8(QString txt) /* The string is not in UTF-8 */ //if (strchr (txt.ascii(), 0xc3)) return (txt+" +++"); if (txt.find("\\x")==-1) - return QString::fromUtf8(txt.ascii()); + return TQString::fromUtf8(txt.ascii()); // if (!strchr (txt.ascii(), 0xc3) || (txt.find("\\x")!=-1)) { for ( int idx = 0 ; (idx = txt.find( "\\x", idx )) >= 0 ; ++idx ) { char str[2] = "x"; - str[0] = (char) QString( txt.mid( idx + 2, 2 ) ).toShort( 0, 16 ); + str[0] = (char) TQString( txt.mid( idx + 2, 2 ) ).toShort( 0, 16 ); txt.replace( idx, 4, str ); } if (!strchr (txt.ascii(), 0xc3)) - return QString::fromUtf8(txt.ascii()); + return TQString::fromUtf8(txt.ascii()); else - return QString::fromUtf8(QString::fromUtf8(txt.ascii()).ascii()); // perform Utf8 twice, or some keys display badly + return TQString::fromUtf8(TQString::fromUtf8(txt.ascii()).ascii()); // perform Utf8 twice, or some keys display badly return txt; } diff --git a/kgpg/kgpginterface.h b/kgpg/kgpginterface.h index 4fb21b2..e9b9452 100644 --- a/kgpg/kgpginterface.h +++ b/kgpg/kgpginterface.h @@ -19,10 +19,10 @@ #define KGPGINTERFACE_H -#include <qobject.h> +#include <tqobject.h> #include <kdialogbase.h> #include <kurl.h> -#include <qdatetime.h> +#include <tqdatetime.h> class QLabel; class KProcIO; @@ -58,7 +58,7 @@ public slots: * @param Options String with the wanted gpg options. ex: "--armor" * @param symetrical bool whether the encryption should be symmetrical. */ - void KgpgEncryptFile(QStringList encryptKeys,KURL srcUrl,KURL destUrl,QStringList Options=QString::null,bool symetrical=false); + void KgpgEncryptFile(TQStringList encryptKeys,KURL srcUrl,KURL destUrl,TQStringList Options=TQString::null,bool symetrical=false); /**Encrypt file function * @param userIDs the key user identification. @@ -66,14 +66,14 @@ public slots: * @param destUrl Kurl for the decrypted file. * @param chances int number of trials left for decryption (used only as an info displayed in the password dialog) */ - void KgpgDecryptFile(KURL srcUrl,KURL destUrl,QStringList Options=QStringList()); + void KgpgDecryptFile(KURL srcUrl,KURL destUrl,TQStringList Options=TQStringList()); /**Sign file function - * @param keyID QString the signing key ID. + * @param keyID TQString the signing key ID. * @param srcUrl Kurl of the file to sign. * @param Options String with the wanted gpg options. ex: "--armor" */ - void KgpgSignFile(QString keyID,KURL srcUrl,QStringList Options=QStringList()); + void KgpgSignFile(TQString keyID,KURL srcUrl,TQStringList Options=TQStringList()); /**Verify file function * @param sigUrl Kurl of the signature file. @@ -81,7 +81,7 @@ public slots: */ void KgpgVerifyFile(KURL sigUrl,KURL srcUrl=KURL()) ; - void KgpgVerifyText(QString text); + void KgpgVerifyText(TQString text); void slotverifyread(KProcIO *p); void slotverifyresult(KProcess*); @@ -91,77 +91,77 @@ public slots: */ void importKeyURL(KURL url); /**Import key function - * @param keystr QString containing th key. Allows public & secret key import. + * @param keystr TQString containing th key. Allows public & secret key import. */ - void importKey(QString keystr); + void importKey(TQString keystr); /**Key signature function - * @param keyID QString the ID of the key to be signed - * @param signKeyID QString the ID of the signing key - * @param signKeyMail QString the name of the signing key (only used to prompt user for passphrase) + * @param keyID TQString the ID of the key to be signed + * @param signKeyID TQString the ID of the signing key + * @param signKeyMail TQString the name of the signing key (only used to prompt user for passphrase) * @param local bool should the signature be local */ - void KgpgSignKey(QString keyID,QString signKeyID,QString signKeyMail=QString::null,bool local=false,int checking=0); + void KgpgSignKey(TQString keyID,TQString signKeyID,TQString signKeyMail=TQString::null,bool local=false,int checking=0); /**Key signature deletion function - * @param keyID QString the ID of the key - * @param signKeyID QString the ID of the signature key + * @param keyID TQString the ID of the key + * @param signKeyID TQString the ID of the signature key */ - void KgpgDelSignature(QString keyID,QString signKeyID); + void KgpgDelSignature(TQString keyID,TQString signKeyID); /**Encrypt text function - * @param text QString text to be encrypted. + * @param text TQString text to be encrypted. * @param userIDs the recipients key id's. * @param Options String with the wanted gpg options. ex: "--armor" * returns the encrypted text or empty string if encyption failed */ - void KgpgEncryptText(QString text,QStringList userIDs, QStringList Options=QString::null); + void KgpgEncryptText(TQString text,TQStringList userIDs, TQStringList Options=TQString::null); /**Decrypt text function - * @param text QString text to be decrypted. - * @param userID QString the name of the decryption key (only used to prompt user for passphrase) + * @param text TQString text to be decrypted. + * @param userID TQString the name of the decryption key (only used to prompt user for passphrase) */ - //static QString KgpgDecryptText(QString text,QString userID); - void KgpgDecryptText(QString text,QStringList Options=QString::null); + //static TQString KgpgDecryptText(TQString text,TQString userID); + void KgpgDecryptText(TQString text,TQStringList Options=TQString::null); void txtdecryptfin(KProcess *); /**Extract list of photographic user id's * @param keyID the recipients key id's. */ - void KgpgGetPhotoList(QString keyID); + void KgpgGetPhotoList(TQString keyID); void getOutput(KProcess *, char *data, int ); void getCmdOutput(KProcess *p, char *data, int ); - QString getKey(QStringList IDs, bool attributes); + TQString getKey(TQStringList IDs, bool attributes); - void KgpgKeyExpire(QString keyID,QDate date,bool unlimited); - void KgpgTrustExpire(QString keyID,int keyTrust); - void KgpgChangePass(QString keyID); + void KgpgKeyExpire(TQString keyID,TQDate date,bool unlimited); + void KgpgTrustExpire(TQString keyID,int keyTrust); + void KgpgChangePass(TQString keyID); - void KgpgRevokeKey(QString keyID,QString revokeUrl,int reason,QString description); + void KgpgRevokeKey(TQString keyID,TQString revokeUrl,int reason,TQString description); void revokeover(KProcess *); void revokeprocess(KProcIO *p); - void KgpgDeletePhoto(QString keyID,QString uid); - void KgpgAddPhoto(QString keyID,QString imagePath); + void KgpgDeletePhoto(TQString keyID,TQString uid); + void KgpgAddPhoto(TQString keyID,TQString imagePath); - void KgpgAddUid(QString keyID,QString name,QString email,QString comment); + void KgpgAddUid(TQString keyID,TQString name,TQString email,TQString comment); - void KgpgDecryptFileToText(KURL srcUrl,QStringList Options); - void KgpgSignText(QString text,QString userIDs, QStringList Options); - - static QString getGpgSetting(QString name,QString configFile); - static QString getGpgMultiSetting(QString name,QString configFile); - static void setGpgSetting(QString name,QString ID,QString url); - static void setGpgMultiSetting(QString name,QStringList values,QString url); - static bool getGpgBoolSetting(QString name,QString configFile); - static void setGpgBoolSetting(QString name,bool enable,QString url); - static QStringList getGpgGroupNames(QString configFile); - static QStringList getGpgGroupSetting(QString name,QString configFile); - static void setGpgGroupSetting(QString name,QStringList values, QString configFile); - static void delGpgGroup(QString name, QString configFile); - static QString checkForUtf8(QString txt); - static QString checkForUtf8bis(QString txt); + void KgpgDecryptFileToText(KURL srcUrl,TQStringList Options); + void KgpgSignText(TQString text,TQString userIDs, TQStringList Options); + + static TQString getGpgSetting(TQString name,TQString configFile); + static TQString getGpgMultiSetting(TQString name,TQString configFile); + static void setGpgSetting(TQString name,TQString ID,TQString url); + static void setGpgMultiSetting(TQString name,TQStringList values,TQString url); + static bool getGpgBoolSetting(TQString name,TQString configFile); + static void setGpgBoolSetting(TQString name,bool enable,TQString url); + static TQStringList getGpgGroupNames(TQString configFile); + static TQStringList getGpgGroupSetting(TQString name,TQString configFile); + static void setGpgGroupSetting(TQString name,TQStringList values, TQString configFile); + static void delGpgGroup(TQString name, TQString configFile); + static TQString checkForUtf8(TQString txt); + static TQString checkForUtf8bis(TQString txt); static int getGpgVersion(); @@ -196,7 +196,7 @@ private slots: /** * Checks the number of uid's for a key-> if greater than one, key signature will switch to konsole mode */ - int checkuid(QString KeyID); + int checkuid(TQString KeyID); /** * Reads output of the delete signature process @@ -259,7 +259,7 @@ private slots: void photoreadover(KProcess *); void photoreadprocess(KProcIO *p); bool isPhotoId(int uid); - void updateIDs(QString txtString); + void updateIDs(TQString txtString); void txtsignprocess(KProcIO *p); void txtsignfin(KProcess *); @@ -269,13 +269,13 @@ private slots: signals: - void missingSignature(QString); - void verifyOver(QString,QString); + void missingSignature(TQString); + void verifyOver(TQString,TQString); /** * emitted when a txt decryption failed. returns log output */ - void txtdecryptionfailed(QString); + void txtdecryptionfailed(TQString); /** * emitted when a txt encryption starts. */ @@ -284,15 +284,15 @@ signals: /** * emitted when a txt decryption finished. returns decrypted text */ - void txtdecryptionfinished(QString); + void txtdecryptionfinished(TQString); /** * emitted when a txt encryption finished. returns encrypted text */ - void txtencryptionfinished(QString); + void txtencryptionfinished(TQString); /** * emitted when an error occurred */ - void errormessage(QString); + void errormessage(TQString); /** * true if encryption successful, false on error. */ @@ -313,7 +313,7 @@ signals: /** * emitted when the process starts */ - void processstarted(QString); + void processstarted(TQString); /** * true if decryption successful, false on error. */ @@ -325,7 +325,7 @@ signals: /** * true if import successful, false on error. */ - void importfinished(QStringList); + void importfinished(TQStringList); /** * true if verify successful, false on error. */ @@ -333,51 +333,51 @@ signals: /** * emmitted if signature key is missing & user want to import it from keyserver */ - void verifyquerykey(QString ID); + void verifyquerykey(TQString ID); /** * true if signature successful, false on error. */ void signfinished(); void delPhotoFinished(); - void delPhotoError(QString); + void delPhotoError(TQString); void addPhotoFinished(); - void addPhotoError(QString); + void addPhotoError(TQString); void refreshOrphaned(); void addUidFinished(); - void addUidError(QString); + void addUidError(TQString); void trustfinished(); - void revokecertificate(QString); - void revokeurl(QString); + void revokecertificate(TQString); + void revokeurl(TQString); void expirationFinished(int); - void signalPhotoList(QStringList); + void signalPhotoList(TQStringList); void passwordChanged(); - void txtSignOver(QString); + void txtSignOver(TQString); private: /** * @internal structure for communication */ - QString message,tempKeyFile,userIDs,output,keyString,txtToEncrypt,log; - QCString passphrase; + TQString message,tempKeyFile,userIDs,output,keyString,txtToEncrypt,log; + TQCString passphrase; bool deleteSuccess,konsLocal,anonymous,decfinished,decok,badmdc,revokeSuccess,addSuccess,delSuccess; bool signmiss; - QString signID; + TQString signID; int signSuccess,expSuccess,trustValue,konsChecked; int step,signb,sigsearch,expirationDelay; - QString konsSignKey, konsKeyID,errMessage; + TQString konsSignKey, konsKeyID,errMessage; int revokeReason,photoCount; - QString revokeDescription,certificateUrl,photoUrl; - QStringList photoList; - QString uidName, uidEmail, uidComment; + TQString revokeDescription,certificateUrl,photoUrl; + TQStringList photoList; + TQString uidName, uidEmail, uidComment; KURL sourceFile; - QString decryptUrl; + TQString decryptUrl; - QString gpgOutput; + TQString gpgOutput; /** * @internal structure for the file information @@ -390,14 +390,14 @@ class Md5Widget :public KDialogBase { Q_OBJECT public: - Md5Widget(QWidget *parent=0, const char *name=0,KURL url=KURL()); + Md5Widget(TQWidget *parent=0, const char *name=0,KURL url=KURL()); ~Md5Widget(); public slots: void slotApply(); private: - QString mdSum; + TQString mdSum; KLed *KLed1; - QLabel *TextLabel1_2; + TQLabel *TextLabel1_2; }; #endif // KGPGINTERFACE_HKGPGINTERFACE_H diff --git a/kgpg/kgpglibrary.cpp b/kgpg/kgpglibrary.cpp index 55455f9..419eca0 100644 --- a/kgpg/kgpglibrary.cpp +++ b/kgpg/kgpglibrary.cpp @@ -15,15 +15,15 @@ * * ***************************************************************************/ -#include <qhbox.h> -#include <qvbox.h> +#include <tqhbox.h> +#include <tqvbox.h> #include <klocale.h> #include <kapplication.h> #include <kconfig.h> #include <kmessagebox.h> #include <krun.h> -#include <qfile.h> +#include <tqfile.h> #include <kpassivepopup.h> #include <kiconloader.h> #include "kgpglibrary.h" @@ -31,7 +31,7 @@ #include "kgpginterface.h" #include <kio/renamedlg.h> -KgpgLibrary::KgpgLibrary(QWidget *parent, bool pgpExtension) +KgpgLibrary::KgpgLibrary(TQWidget *parent, bool pgpExtension) { if (pgpExtension) extension=".pgp"; @@ -45,16 +45,16 @@ KgpgLibrary::~KgpgLibrary() {} -void KgpgLibrary::slotFileEnc(KURL::List urls,QStringList opts,QStringList defaultKey,KShortcut goDefaultKey) +void KgpgLibrary::slotFileEnc(KURL::List urls,TQStringList opts,TQStringList defaultKey,KShortcut goDefaultKey) { ///////////////////////////////////////////////////////////////////////// encode file file if (!urls.empty()) { urlselecteds=urls; if (defaultKey.isEmpty()) { - QString fileNames=urls.first().fileName(); + TQString fileNames=urls.first().fileName(); if (urls.count()>1) fileNames+=",..."; popupPublic *dialogue=new popupPublic(0,"Public keys",fileNames,true,goDefaultKey); - connect(dialogue,SIGNAL(selectedKey(QStringList,QStringList,bool,bool)),this,SLOT(startencode(QStringList,QStringList,bool,bool))); + connect(dialogue,TQT_SIGNAL(selectedKey(TQStringList,TQStringList,bool,bool)),this,TQT_SLOT(startencode(TQStringList,TQStringList,bool,bool))); dialogue->exec(); delete dialogue; } else @@ -62,7 +62,7 @@ void KgpgLibrary::slotFileEnc(KURL::List urls,QStringList opts,QStringList defau } } -void KgpgLibrary::startencode(QStringList encryptKeys,QStringList encryptOptions,bool shred,bool symetric) +void KgpgLibrary::startencode(TQStringList encryptKeys,TQStringList encryptOptions,bool shred,bool symetric) { popIsActive=false; //KURL::List::iterator it; @@ -75,7 +75,7 @@ void KgpgLibrary::startencode(QStringList encryptKeys,QStringList encryptOptions } -void KgpgLibrary::fastencode(KURL &fileToCrypt,QStringList selec,QStringList encryptOptions,bool symetric) +void KgpgLibrary::fastencode(KURL &fileToCrypt,TQStringList selec,TQStringList encryptOptions,bool symetric) { ////////////////// encode from file if ((selec.isEmpty()) && (!symetric)) { @@ -89,14 +89,14 @@ void KgpgLibrary::fastencode(KURL &fileToCrypt,QStringList selec,QStringList enc else dest.setPath(urlselected.path()+extension); - QFile fgpg(dest.path()); + TQFile fgpg(dest.path()); if (fgpg.exists()) { - KIO::RenameDlg *over=new KIO::RenameDlg(0,i18n("File Already Exists"),QString::null,dest.path(),KIO::M_OVERWRITE); - if (over->exec()==QDialog::Rejected) + KIO::RenameDlg *over=new KIO::RenameDlg(0,i18n("File Already Exists"),TQString::null,dest.path(),KIO::M_OVERWRITE); + if (over->exec()==TQDialog::Rejected) { delete over; - emit systemMessage(QString::null,true); + emit systemMessage(TQString::null,true); return; } dest=over->newDestURL(); @@ -111,20 +111,20 @@ void KgpgLibrary::fastencode(KURL &fileToCrypt,QStringList selec,QStringList enc cryptFileProcess->KgpgEncryptFile(selec,urlselected,dest,encryptOptions,symetric); if (!popIsActive) { - //connect(cryptFileProcess,SIGNAL(processstarted(QString)),this,SLOT(processpopup2(QString))); + //connect(cryptFileProcess,TQT_SIGNAL(processstarted(TQString)),this,TQT_SLOT(processpopup2(TQString))); popIsActive=true; } - connect(cryptFileProcess,SIGNAL(encryptionfinished(KURL)),this,SLOT(processenc(KURL))); - connect(cryptFileProcess,SIGNAL(errormessage(QString)),this,SLOT(processencerror(QString))); + connect(cryptFileProcess,TQT_SIGNAL(encryptionfinished(KURL)),this,TQT_SLOT(processenc(KURL))); + connect(cryptFileProcess,TQT_SIGNAL(errormessage(TQString)),this,TQT_SLOT(processencerror(TQString))); } -void KgpgLibrary::processpopup2(QString fileName) +void KgpgLibrary::processpopup2(TQString fileName) { //pop->setTimeout(0); pop->setView(i18n("Processing encryption (%1)").arg(fileName),i18n("Please wait..."),KGlobal::iconLoader()->loadIcon("kgpg",KIcon::Desktop)); pop->show(); - /*QRect qRect(QApplication::desktop()->screenGeometry()); + /*TQRect qRect(TQApplication::desktop()->screenGeometry()); int iXpos=qRect.width()/2-pop->width()/2; int iYpos=qRect.height()/2-pop->height()/2; pop->move(iXpos,iYpos);*/ @@ -134,7 +134,7 @@ void KgpgLibrary::processpopup2(QString fileName) void KgpgLibrary::shredpreprocessenc(KURL fileToShred) { popIsActive=false; - emit systemMessage(QString::null); + emit systemMessage(TQString::null); shredprocessenc(fileToShred); } @@ -144,16 +144,16 @@ emit systemMessage(i18n("Shredding %n file","Shredding %n files",filesToShred.co KIO::Job *job; job = KIO::del( filesToShred, true ); -connect( job, SIGNAL( result( KIO::Job * ) ),SLOT( slotShredResult( KIO::Job * ) ) ); +connect( job, TQT_SIGNAL( result( KIO::Job * ) ),TQT_SLOT( slotShredResult( KIO::Job * ) ) ); } void KgpgLibrary::slotShredResult( KIO::Job * job ) { - emit systemMessage(QString::null); + emit systemMessage(TQString::null); if (job && job->error()) { - job->showErrorDialog( (QWidget*)parent() ); - emit systemMessage(QString::null,true); + job->showErrorDialog( (TQWidget*)parent() ); + emit systemMessage(TQString::null,true); KPassivePopup::message(i18n("KGpg Error"),i18n("Process halted, not all files were shredded."),KGlobal::iconLoader()->loadIcon("kgpg",KIcon::Desktop),panel,"kgpg_error",0); } } @@ -161,42 +161,42 @@ void KgpgLibrary::slotShredResult( KIO::Job * job ) void KgpgLibrary::processenc(KURL) { - emit systemMessage(QString::null); + emit systemMessage(TQString::null); if (_shred) shredprocessenc(urlselecteds.first()); urlselecteds.pop_front (); if (urlselecteds.count()>0) fastencode(urlselecteds.first(),_encryptKeys,_encryptOptions,_symetric); } -void KgpgLibrary::processencerror(QString mssge) +void KgpgLibrary::processencerror(TQString mssge) { popIsActive=false; - emit systemMessage(QString::null,true); + emit systemMessage(TQString::null,true); KMessageBox::detailedSorry(panel,i18n("<b>Process halted</b>.<br>Not all files were encrypted."),mssge); } -void KgpgLibrary::slotFileDec(KURL srcUrl,KURL destUrl,QStringList customDecryptOption) +void KgpgLibrary::slotFileDec(KURL srcUrl,KURL destUrl,TQStringList customDecryptOption) { ////////////////////////////////////////////////////////////////// decode file from konqueror or menu KgpgInterface *decryptFileProcess=new KgpgInterface(); pop = new KPassivePopup(); urlselected=srcUrl; decryptFileProcess->KgpgDecryptFile(srcUrl,destUrl,customDecryptOption); - connect(decryptFileProcess,SIGNAL(processaborted(bool)),this,SLOT(processdecover())); - connect(decryptFileProcess,SIGNAL(processstarted(QString)),this,SLOT(processpopup(QString))); - connect(decryptFileProcess,SIGNAL(decryptionfinished()),this,SLOT(processdecover())); - connect(decryptFileProcess,SIGNAL(errormessage(QString)),this,SLOT(processdecerror(QString))); + connect(decryptFileProcess,TQT_SIGNAL(processaborted(bool)),this,TQT_SLOT(processdecover())); + connect(decryptFileProcess,TQT_SIGNAL(processstarted(TQString)),this,TQT_SLOT(processpopup(TQString))); + connect(decryptFileProcess,TQT_SIGNAL(decryptionfinished()),this,TQT_SLOT(processdecover())); + connect(decryptFileProcess,TQT_SIGNAL(errormessage(TQString)),this,TQT_SLOT(processdecerror(TQString))); } -void KgpgLibrary::processpopup(QString fileName) +void KgpgLibrary::processpopup(TQString fileName) { emit systemMessage(i18n("Decrypting %1").arg(fileName)); pop->setTimeout(0); pop->setView(i18n("Processing decryption"),i18n("Please wait..."),KGlobal::iconLoader()->loadIcon("kgpg",KIcon::Desktop)); pop->show(); - QRect qRect(QApplication::desktop()->screenGeometry()); + TQRect qRect(TQApplication::desktop()->screenGeometry()); int iXpos=qRect.width()/2-pop->width()/2; int iYpos=qRect.height()/2-pop->height()/2; pop->move(iXpos,iYpos); @@ -204,21 +204,21 @@ void KgpgLibrary::processpopup(QString fileName) void KgpgLibrary::processdecover() { - emit systemMessage(QString::null); + emit systemMessage(TQString::null); delete pop; emit decryptionOver(); } -void KgpgLibrary::processdecerror(QString mssge) +void KgpgLibrary::processdecerror(TQString mssge) { delete pop; - emit systemMessage(QString::null); + emit systemMessage(TQString::null); ///// test if file is a public key - QFile qfile(QFile::encodeName(urlselected.path())); + TQFile qfile(TQFile::encodeName(urlselected.path())); if (qfile.open(IO_ReadOnly)) { - QTextStream t( &qfile ); - QString result(t.read()); + TQTextStream t( &qfile ); + TQString result(t.read()); qfile.close(); ////////////// if pgp data found, decode it if (result.startsWith("-----BEGIN PGP PUBLIC KEY BLOCK")) {////// dropped file is a public key, ask for import @@ -228,7 +228,7 @@ void KgpgLibrary::processdecerror(QString mssge) else { KgpgInterface *importKeyProcess=new KgpgInterface(); importKeyProcess->importKeyURL(urlselected); - connect(importKeyProcess,SIGNAL(importfinished(QStringList)),this,SIGNAL(importOver(QStringList))); + connect(importKeyProcess,TQT_SIGNAL(importfinished(TQStringList)),this,TQT_SIGNAL(importOver(TQStringList))); return; } } else if (result.startsWith("-----BEGIN PGP PRIVATE KEY BLOCK")) {////// dropped file is a public key, ask for import diff --git a/kgpg/kgpglibrary.h b/kgpg/kgpglibrary.h index 1892f5f..7eb7364 100644 --- a/kgpg/kgpglibrary.h +++ b/kgpg/kgpglibrary.h @@ -19,7 +19,7 @@ #ifndef KGPGLIBRARY_H #define KGPGLIBRARY_H -#include <qobject.h> +#include <tqobject.h> #include <kurl.h> #include <kshortcut.h> #include <kio/job.h> @@ -36,45 +36,45 @@ public: /** * Initialize the class */ - KgpgLibrary(QWidget *parent=0,bool pgpExtension=false); + KgpgLibrary(TQWidget *parent=0,bool pgpExtension=false); ~KgpgLibrary(); KURL::List urlselecteds; public slots: - void slotFileEnc(KURL::List urls=KURL(""),QStringList opts=QString::null,QStringList defaultKey=QString::null,KShortcut goDefaultKey=QKeySequence(CTRL+Qt::Key_Home)); - void slotFileDec(KURL srcUrl,KURL destUrl,QStringList customDecryptOption=QStringList()); + void slotFileEnc(KURL::List urls=KURL(""),TQStringList opts=TQString::null,TQStringList defaultKey=TQString::null,KShortcut goDefaultKey=TQKeySequence(CTRL+Qt::Key_Home)); + void slotFileDec(KURL srcUrl,KURL destUrl,TQStringList customDecryptOption=TQStringList()); void shredprocessenc(KURL::List filesToShred); private slots: - void startencode(QStringList encryptKeys,QStringList encryptOptions,bool shred,bool symetric); - void fastencode(KURL &fileToCrypt,QStringList selec,QStringList encryptOptions,bool symetric); -// void startencode(QString &selec,QString encryptOptions,bool shred,bool symetric); + void startencode(TQStringList encryptKeys,TQStringList encryptOptions,bool shred,bool symetric); + void fastencode(KURL &fileToCrypt,TQStringList selec,TQStringList encryptOptions,bool symetric); +// void startencode(TQString &selec,TQString encryptOptions,bool shred,bool symetric); void slotShredResult( KIO::Job * job ); void shredpreprocessenc(KURL fileToShred); void processenc(KURL); void processdecover(); - void processdecerror(QString mssge); - void processencerror(QString mssge); - void processpopup(QString fileName); - void processpopup2(QString fileName); + void processdecerror(TQString mssge); + void processencerror(TQString mssge); + void processpopup(TQString fileName); + void processpopup2(TQString fileName); private: - QString customDecrypt,tempFile,extension; + TQString customDecrypt,tempFile,extension; KURL urlselected; KPassivePopup *pop; KProgress *shredProgressBar; bool popIsActive; - QWidget *panel; - QStringList _encryptKeys; - QStringList _encryptOptions; + TQWidget *panel; + TQStringList _encryptKeys; + TQStringList _encryptOptions; bool _shred; bool _symetric; signals: void decryptionOver(); - void importOver(QStringList); - void systemMessage(QString,bool reset=false); + void importOver(TQStringList); + void systemMessage(TQString,bool reset=false); }; #endif // KGPGLIBRARY_H diff --git a/kgpg/kgpgoptions.cpp b/kgpg/kgpgoptions.cpp index a45e8a6..8667c1d 100644 --- a/kgpg/kgpgoptions.cpp +++ b/kgpg/kgpgoptions.cpp @@ -18,19 +18,19 @@ /////////////////////////////////////////////// code for the option dialog box #include <config.h> -#include <qlayout.h> -#include <qtabwidget.h> -#include <qlabel.h> -#include <qtoolbutton.h> -#include <qfile.h> +#include <tqlayout.h> +#include <tqtabwidget.h> +#include <tqlabel.h> +#include <tqtoolbutton.h> +#include <tqfile.h> #include <kconfig.h> #include <kdeversion.h> #include <klocale.h> #include <kprocio.h> -#include <qcheckbox.h> -#include <qradiobutton.h> -#include <qpushbutton.h> -#include <qfont.h> +#include <tqcheckbox.h> +#include <tqradiobutton.h> +#include <tqpushbutton.h> +#include <tqfont.h> #include <kaction.h> #include <kmessagebox.h> #include <klineedit.h> @@ -62,7 +62,7 @@ class QTabWidget; /////////////////////// main window -kgpgOptions::kgpgOptions(QWidget *parent, const char *name) +kgpgOptions::kgpgOptions(TQWidget *parent, const char *name) : KConfigDialog( parent, name, KGpgSettings::self()) { defaultServerList="hkp://wwwkeys.eu.pgp.net "; @@ -70,17 +70,17 @@ kgpgOptions::kgpgOptions(QWidget *parent, const char *name) defaultServerList+=",hkp://search.keyserver.net,hkp://wwwkeys.pgp.net,hkp://pgp.dtype.org,hkp://wwwkeys.us.pgp.net"; config = new KConfig ("kgpgrc"); config->setGroup("Servers"); - serverList=QStringList::split (",",config->readEntry("Server_List",defaultServerList)); + serverList=TQStringList::split (",",config->readEntry("Server_List",defaultServerList)); keyServer = KgpgInterface::getGpgSetting("keyserver", KGpgSettings::gpgConfigPath()); if (!keyServer.isEmpty()) serverList.prepend(keyServer+" "+i18n("(Default)")); - defaultHomePath=QDir::homeDirPath()+"/.gnupg/"; - if (QFile(defaultHomePath+"options").exists()) defaultConfigPath="options"; + defaultHomePath=TQDir::homeDirPath()+"/.gnupg/"; + if (TQFile(defaultHomePath+"options").exists()) defaultConfigPath="options"; else { - if (QFile(defaultHomePath+"gpg.conf").exists()) defaultConfigPath="gpg.conf"; - else defaultConfigPath=QString::null; + if (TQFile(defaultHomePath+"gpg.conf").exists()) defaultConfigPath="gpg.conf"; + else defaultConfigPath=TQString::null; } kdDebug(2100)<<"Adding pages"<<endl; @@ -90,8 +90,8 @@ kdDebug(2100)<<"Adding pages"<<endl; page4=new GPGConf(); page6=new ServerConf(); page7=new MiscConf(); - QBoxLayout *fontLayout=new QBoxLayout(page3->tabWidget3->page(1),QBoxLayout::TopToBottom,10); - kfc=new KFontChooser(page3->tabWidget3->page(1),"kcfg_Font",false,QStringList(),false); + TQBoxLayout *fontLayout=new TQBoxLayout(page3->tabWidget3->page(1),TQBoxLayout::TopToBottom,10); + kfc=new KFontChooser(page3->tabWidget3->page(1),"kcfg_Font",false,TQStringList(),false); fontLayout->addWidget(kfc); page7->shredInfo->setText(i18n( "<qt><p>You must be aware that <b>shredding is not secure</b> on all file systems, and that parts of the file may have been saved in a temporary file or in the spooler of your printer if you previously opened it in an editor or tried to print it. Only works on files (not on folders).</p></qt>")); @@ -105,30 +105,30 @@ kdDebug(2100)<<"Adding pages"<<endl; addPage(page6, i18n("Key Servers"), "network"); addPage(page7, i18n("Misc"), "misc"); - page1->clear_akey->setIconSet(QIconSet(QPixmap(SmallIcon("clear_left")))); - page1->clear_fkey->setIconSet(QIconSet(QPixmap(SmallIcon("clear_left")))); + page1->clear_akey->setIconSet(TQIconSet(TQPixmap(SmallIcon("clear_left")))); + page1->clear_fkey->setIconSet(TQIconSet(TQPixmap(SmallIcon("clear_left")))); // The following widgets are managed manually. - connect(page1->change_fkey, SIGNAL(clicked()), this, SLOT(insertFileKey())); - connect(page1->clear_fkey, SIGNAL(clicked()), page1->kcfg_FileKey, SLOT(clear())); - connect(page1->change_akey, SIGNAL(clicked()), this, SLOT(insertAlwaysKey())); - connect(page1->clear_akey, SIGNAL(clicked()), page1->alwaysKey, SLOT(clear())); - connect(page1->alwaysKey, SIGNAL(textChanged(const QString&)), this, SLOT(updateButtons())); - connect(page4->gpg_conf_path, SIGNAL(textChanged(const QString&)), this, SLOT(updateButtons())); - connect(page4->gpg_home_path, SIGNAL(textChanged(const QString&)), this, SLOT(updateButtons())); - connect(page4->use_agent, SIGNAL(toggled(bool)), this, SLOT(updateButtons())); - connect(page4->changeHome, SIGNAL(clicked()), this, SLOT(slotChangeHome())); - connect(page4->kcfg_PubKeyring, SIGNAL(toggled (bool)), page4->kcfg_PubKeyringUrl, SLOT(setEnabled(bool))); - connect(page4->kcfg_PubKeyring, SIGNAL(toggled (bool)), this, SLOT(checkAdditionalState(bool))); - connect(page4->kcfg_PrivKeyring, SIGNAL(toggled (bool)), page4->kcfg_PrivKeyringUrl, SLOT(setEnabled(bool))); - connect(page4->kcfg_PrivKeyring, SIGNAL(toggled (bool)), this, SLOT(checkAdditionalState(bool))); - connect(page6->server_add, SIGNAL(clicked()), this, SLOT(slotAddKeyServer())); - connect(page6->server_del, SIGNAL(clicked()), this, SLOT(slotDelKeyServer())); - connect(page6->server_default, SIGNAL(clicked()), this, SLOT(slotDefaultKeyServer())); - connect(page6->ServerBox, SIGNAL(currentChanged ( QListBoxItem *)), this, SLOT(updateButtons())); - connect(page7->pushShredder, SIGNAL(clicked ()), this, SIGNAL(installShredder())); - - //connect(this, SIGNAL(settingsChanged()), SLOT(updateSettings())); + connect(page1->change_fkey, TQT_SIGNAL(clicked()), this, TQT_SLOT(insertFileKey())); + connect(page1->clear_fkey, TQT_SIGNAL(clicked()), page1->kcfg_FileKey, TQT_SLOT(clear())); + connect(page1->change_akey, TQT_SIGNAL(clicked()), this, TQT_SLOT(insertAlwaysKey())); + connect(page1->clear_akey, TQT_SIGNAL(clicked()), page1->alwaysKey, TQT_SLOT(clear())); + connect(page1->alwaysKey, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(updateButtons())); + connect(page4->gpg_conf_path, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(updateButtons())); + connect(page4->gpg_home_path, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(updateButtons())); + connect(page4->use_agent, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(updateButtons())); + connect(page4->changeHome, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotChangeHome())); + connect(page4->kcfg_PubKeyring, TQT_SIGNAL(toggled (bool)), page4->kcfg_PubKeyringUrl, TQT_SLOT(setEnabled(bool))); + connect(page4->kcfg_PubKeyring, TQT_SIGNAL(toggled (bool)), this, TQT_SLOT(checkAdditionalState(bool))); + connect(page4->kcfg_PrivKeyring, TQT_SIGNAL(toggled (bool)), page4->kcfg_PrivKeyringUrl, TQT_SLOT(setEnabled(bool))); + connect(page4->kcfg_PrivKeyring, TQT_SIGNAL(toggled (bool)), this, TQT_SLOT(checkAdditionalState(bool))); + connect(page6->server_add, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotAddKeyServer())); + connect(page6->server_del, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotDelKeyServer())); + connect(page6->server_default, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotDefaultKeyServer())); + connect(page6->ServerBox, TQT_SIGNAL(currentChanged ( TQListBoxItem *)), this, TQT_SLOT(updateButtons())); + connect(page7->pushShredder, TQT_SIGNAL(clicked ()), this, TQT_SIGNAL(installShredder())); + + //connect(this, TQT_SIGNAL(settingsChanged()), TQT_SLOT(updateSettings())); keyGood=KGpgSettings::colorGood(); keyUnknown=KGpgSettings::colorUnknown(); @@ -155,11 +155,11 @@ page4->kcfg_OnlyAdditional->setEnabled(false); void kgpgOptions::insertFileKey() { - QString signKeyID; + TQString signKeyID; ///// open key selection dialog KgpgSelKey *opts=new KgpgSelKey(this,0,true,page1->kcfg_FileKey->text()); - if (opts->exec()==QDialog::Accepted) { + if (opts->exec()==TQDialog::Accepted) { page1->kcfg_FileKey->setText(opts->getkeyID()); } else { delete opts; @@ -170,11 +170,11 @@ void kgpgOptions::insertFileKey() void kgpgOptions::insertAlwaysKey() { - QString signKeyID; + TQString signKeyID; ///// open key selection dialog KgpgSelKey *opts=new KgpgSelKey(this,0,true,page1->alwaysKey->text()); - if (opts->exec()==QDialog::Accepted) { + if (opts->exec()==TQDialog::Accepted) { page1->alwaysKey->setText(opts->getkeyID()); } else { delete opts; @@ -185,13 +185,13 @@ void kgpgOptions::insertAlwaysKey() void kgpgOptions::slotChangeHome() { -QString gpgHome=KFileDialog::getExistingDirectory(page4->gpg_home_path->text(),this,i18n("New GnuPG Home Location")); +TQString gpgHome=KFileDialog::getExistingDirectory(page4->gpg_home_path->text(),this,i18n("New GnuPG Home Location")); if (gpgHome.isEmpty()) return; if (!gpgHome.endsWith("/")) gpgHome.append("/"); - QString confPath="options"; - if (!QFile(gpgHome+confPath).exists()) { + TQString confPath="options"; + if (!TQFile(gpgHome+confPath).exists()) { confPath="gpg.conf"; - if (!QFile(gpgHome+confPath).exists()) + if (!TQFile(gpgHome+confPath).exists()) { if (KMessageBox::questionYesNo(this,i18n("No configuration file was found in the selected location.\nDo you want to create it now ?\n\nWithout configuration file, neither KGpg nor Gnupg will work properly."),i18n("No Configuration File Found"),i18n("Create"),i18n("Ignore"))==KMessageBox::Yes) ////////// Try to create config File by running gpg once { @@ -199,19 +199,19 @@ if (!gpgHome.endsWith("/")) gpgHome.append("/"); *p<<"gpg"<<"--homedir"<<gpgHome<<"--no-tty"<<"--list-secret-keys"; p->start(KProcess::Block); //// start gnupg so that it will create a config file confPath="gpg.conf"; - QFile confFile(gpgHome+confPath); + TQFile confFile(gpgHome+confPath); if (!confFile.open(IO_WriteOnly)) {KMessageBox::sorry(this,i18n("Cannot create configuration file. Please check if destination media is mounted and if you have write access")); return; } else { - QTextStream stream( &confFile ); + TQTextStream stream( &confFile ); stream<<"# Config file created by KGpg\n\n"; confFile.close(); } } - else confPath=QString::null; + else confPath=TQString::null; } } page4->gpg_conf_path->setText(confPath); @@ -220,7 +220,7 @@ if (!gpgHome.endsWith("/")) gpgHome.append("/"); void kgpgOptions::updateWidgets() { -QString pubKeyring,privKeyring; +TQString pubKeyring,privKeyring; gpgConfigPath = KGpgSettings::gpgConfigPath(); page4->gpg_conf_path->setText(KURL(gpgConfigPath).fileName()); @@ -278,15 +278,15 @@ void kgpgOptions::updateWidgetsDefault() page4->gpg_conf_path->setText(defaultConfigPath); page4->gpg_home_path->setText(defaultHomePath); - page4->kcfg_PubKeyringUrl->setURL(QString::null); + page4->kcfg_PubKeyringUrl->setURL(TQString::null); page4->kcfg_PubKeyring->setChecked(false); - page4->kcfg_PrivKeyringUrl->setURL(QString::null); + page4->kcfg_PrivKeyringUrl->setURL(TQString::null); page4->kcfg_PrivKeyring->setChecked(false); page4->kcfg_OnlyAdditional->setChecked(false); page6->ServerBox->clear(); - page6->ServerBox->insertStringList(QStringList::split(",",defaultServerList)); + page6->ServerBox->insertStringList(TQStringList::split(",",defaultServerList)); kdDebug(2100)<<"Finishing default options"<<endl; } @@ -305,7 +305,7 @@ bool kgpgOptions::isDefault() if (page4->use_agent->isChecked() != defaultUseAgent) return false; - QString currList; + TQString currList; for (uint i=0;i<page6->ServerBox->count();i++) currList+=page6->ServerBox->text(i)+","; currList.truncate(currList.length()-1); @@ -328,7 +328,7 @@ bool kgpgOptions::hasChanged() if (page4->use_agent->isChecked() != useAgent) return true; - QStringList currList; + TQStringList currList; for (uint i=0;i<page6->ServerBox->count();i++) currList.append(page6->ServerBox->text(i)); if (currList!=serverList) return true; @@ -345,7 +345,7 @@ void kgpgOptions::updateSettings() if (page4->gpg_home_path->text()!=KURL(gpgConfigPath).directory(false)) { if (page4->gpg_home_path->text()!=defaultHomePath) - setenv("GNUPGHOME", QFile::encodeName(page4->gpg_home_path->text()), 1); + setenv("GNUPGHOME", TQFile::encodeName(page4->gpg_home_path->text()), 1); else setenv("GNUPGHOME","",1); emit homeChanged(); gpgConfigPath = KGpgSettings::gpgConfigPath(); @@ -364,7 +364,7 @@ void kgpgOptions::updateSettings() else { if (KgpgInterface::getGpgSetting("keyring", gpgConfigPath)!="") emitReload=true; - KgpgInterface::setGpgSetting("keyring",QString::null, gpgConfigPath); + KgpgInterface::setGpgSetting("keyring",TQString::null, gpgConfigPath); } if (page4->kcfg_PrivKeyring->isChecked()) @@ -375,7 +375,7 @@ void kgpgOptions::updateSettings() else { if (KgpgInterface::getGpgSetting("secret-keyring", gpgConfigPath)!="") emitReload=true; - KgpgInterface::setGpgSetting("secret-keyring",QString::null, gpgConfigPath); + KgpgInterface::setGpgSetting("secret-keyring",TQString::null, gpgConfigPath); } emit changeFont(kfc->font()); @@ -392,7 +392,7 @@ void kgpgOptions::updateSettings() else slotRemoveMenu("decryptfile.desktop"); - KgpgInterface::setGpgMultiSetting("encrypt-to",QStringList::split(" ",page1->alwaysKey->text()),KGpgSettings::gpgConfigPath()); + KgpgInterface::setGpgMultiSetting("encrypt-to",TQStringList::split(" ",page1->alwaysKey->text()),KGpgSettings::gpgConfigPath()); alwaysKeyID = page1->alwaysKey->text(); useAgent = page4->use_agent->isChecked(); @@ -411,11 +411,11 @@ void kgpgOptions::updateSettings() ////////////////// save key servers - QString currList; - serverList=QStringList (); + TQString currList; + serverList=TQStringList (); for (uint i=0;i<page6->ServerBox->count();i++) { - QString currItem=page6->ServerBox->text(i); + TQString currItem=page6->ServerBox->text(i); if (currItem.find(" ")!=-1) // it is the default keyserver keyServer=currItem.section(" ",0,0); else @@ -443,10 +443,10 @@ void kgpgOptions::updateSettings() } -void kgpgOptions::slotInstallSign(QString mimetype) +void kgpgOptions::slotInstallSign(TQString mimetype) { - QString path=locateLocal("data","konqueror/servicemenus/signfile.desktop"); + TQString path=locateLocal("data","konqueror/servicemenus/signfile.desktop"); KDesktopFile configl2(path, false); if (configl2.isImmutable() ==false) { configl2.setGroup("Desktop Entry"); @@ -460,10 +460,10 @@ void kgpgOptions::slotInstallSign(QString mimetype) } } -void kgpgOptions::slotInstallDecrypt(QString mimetype) +void kgpgOptions::slotInstallDecrypt(TQString mimetype) { - QString path=locateLocal("data","konqueror/servicemenus/decryptfile.desktop"); + TQString path=locateLocal("data","konqueror/servicemenus/decryptfile.desktop"); KDesktopFile configl2(path, false); if (configl2.isImmutable() ==false) { configl2.setGroup("Desktop Entry"); @@ -478,11 +478,11 @@ void kgpgOptions::slotInstallDecrypt(QString mimetype) } -void kgpgOptions::slotRemoveMenu(QString menu) +void kgpgOptions::slotRemoveMenu(TQString menu) { - QString path=locateLocal("data","konqueror/servicemenus/"+menu); - QFile qfile(path); + TQString path=locateLocal("data","konqueror/servicemenus/"+menu); + TQFile qfile(path); if (qfile.exists()) qfile.remove(); { @@ -493,23 +493,23 @@ void kgpgOptions::slotRemoveMenu(QString menu) } -QString kgpgOptions::namecode(QString kid) +TQString kgpgOptions::namecode(TQString kid) { for ( uint counter = 0; counter<names.count(); counter++ ) - if (QString(ids[counter].right(8))==kid) + if (TQString(ids[counter].right(8))==kid) return names[counter]; - return QString::null; + return TQString::null; } -QString kgpgOptions::idcode(QString kname) +TQString kgpgOptions::idcode(TQString kname) { for ( uint counter = 0; counter<names.count(); counter++ ) if (names[counter]==kname) - return QString(ids[counter].right(8)); - return QString::null; + return TQString(ids[counter].right(8)); + return TQString::null; } @@ -518,7 +518,7 @@ void kgpgOptions::listkey() //////// update display of keys in main management window FILE *fp; - QString tst,name,trustedvals="idre-",issec; + TQString tst,name,trustedvals="idre-",issec; int counter=0; char line[300]; @@ -526,7 +526,7 @@ void kgpgOptions::listkey() fp2 = popen("gpg --no-secmem-warning --no-tty --with-colon --list-secret-keys", "r"); while ( fgets( line, sizeof(line), fp2)) { - QString lineRead=line; + TQString lineRead=line; if (lineRead.startsWith("sec")) issec+=lineRead.section(':',4,4); } @@ -569,7 +569,7 @@ void kgpgOptions::listkey() void kgpgOptions::slotAddKeyServer() { -QString newServer=KInputDialog::getText(i18n("Add New Key Server"),i18n("Server URL:")); +TQString newServer=KInputDialog::getText(i18n("Add New Key Server"),i18n("Server URL:")); if (!newServer.isEmpty()) page6->ServerBox->insertItem(newServer.stripWhiteSpace()); page6->ServerBox->setSelected(page6->ServerBox->findItem(newServer.stripWhiteSpace()),true); diff --git a/kgpg/kgpgoptions.h b/kgpg/kgpgoptions.h index 05a7b32..14b0300 100644 --- a/kgpg/kgpgoptions.h +++ b/kgpg/kgpgoptions.h @@ -40,9 +40,9 @@ class kgpgOptions : public KConfigDialog { Q_OBJECT public: - kgpgOptions(QWidget *parent=0, const char *name=0); + kgpgOptions(TQWidget *parent=0, const char *name=0); ~kgpgOptions(); - QStringList names,ids; + TQStringList names,ids; Encryption *page1; Decryption *page2; UIConf *page3; @@ -53,22 +53,22 @@ public: private: KConfig *config; - QString alwaysKeyID,alwaysKeyName; + TQString alwaysKeyID,alwaysKeyName; bool firstDisplay; - QPixmap pixkeySingle,pixkeyDouble; - QString fileEncryptionKey; - QString gpgConfigPath; - QString keyServer,defaultServerList; - QString defaultKeyServer; - QFont startFont; + TQPixmap pixkeySingle,pixkeyDouble; + TQString fileEncryptionKey; + TQString gpgConfigPath; + TQString keyServer,defaultServerList; + TQString defaultKeyServer; + TQFont startFont; bool useAgent; bool defaultUseAgent; bool encryptToAlways; bool defaultEncryptToAlways; - QStringList serverList; - QString defaultConfigPath,defaultHomePath; - QColor keyGood,keyBad,keyUnknown,keyRev; + TQStringList serverList; + TQString defaultConfigPath,defaultHomePath; + TQColor keyGood,keyBad,keyUnknown,keyRev; private: bool hasChanged(); @@ -86,18 +86,18 @@ private slots: void insertFileKey(); void listkey(); - QString namecode(QString kid); - QString idcode(QString kname); - void slotInstallDecrypt(QString mimetype); - void slotInstallSign(QString mimetype); - void slotRemoveMenu(QString menu); + TQString namecode(TQString kid); + TQString idcode(TQString kname); + void slotInstallDecrypt(TQString mimetype); + void slotInstallSign(TQString mimetype); + void slotRemoveMenu(TQString menu); void slotChangeHome(); signals: void updateDisplay(); void settingsUpdated(); - void changeFont(QFont); + void changeFont(TQFont); void homeChanged(); - void refreshTrust(int, QColor); + void refreshTrust(int, TQColor); void installShredder(); void reloadKeyList(); }; diff --git a/kgpg/kgpgsettings_addons.h b/kgpg/kgpgsettings_addons.h index 6b2e8f5..63ff09a 100644 --- a/kgpg/kgpgsettings_addons.h +++ b/kgpg/kgpgsettings_addons.h @@ -17,7 +17,7 @@ public: static - QString defaultKey() + TQString defaultKey() { if (self()->mDefaultKey.isEmpty()) { @@ -29,7 +29,7 @@ public: } static - void setDefaultKey(const QString &_defaultKey) + void setDefaultKey(const TQString &_defaultKey) { self()->mDefaultKey = _defaultKey; KgpgInterface::setGpgSetting("default-key",_defaultKey.right(8),gpgConfigPath()); @@ -38,4 +38,4 @@ public: } private: - QString mDefaultKey; + TQString mDefaultKey; diff --git a/kgpg/kgpgview.cpp b/kgpg/kgpgview.cpp index c9bff6a..9aa23ea 100644 --- a/kgpg/kgpgview.cpp +++ b/kgpg/kgpgview.cpp @@ -18,12 +18,12 @@ ////////////////////////////////////////////////////////////// code for the main view (editor) // include files for Qt -//#include <qprinter.h> +//#include <tqprinter.h> // application specific includes -#include <qscrollview.h> -#include <qregexp.h> +#include <tqscrollview.h> +#include <tqregexp.h> #include <kio/netaccess.h> #include <klocale.h> @@ -31,13 +31,13 @@ #include <kurldrag.h> #include <kmessagebox.h> -#include <qfile.h> -#include <qlayout.h> +#include <tqfile.h> +#include <tqlayout.h> #include <kbuttonbox.h> #include <unistd.h> #include <kaction.h> #include <klineedit.h> -#include <qtextcodec.h> +#include <tqtextcodec.h> #include "kgpgsettings.h" @@ -53,7 +53,7 @@ //////////////// configuration for editor -MyEditor::MyEditor( QWidget *parent, const char *name ) +MyEditor::MyEditor( TQWidget *parent, const char *name ) : KTextEdit( parent, name ) { setTextFormat(PlainText); @@ -61,34 +61,34 @@ MyEditor::MyEditor( QWidget *parent, const char *name ) setAcceptDrops(true); } -void MyEditor::contentsDragEnterEvent( QDragEnterEvent *e ) +void MyEditor::contentsDragEnterEvent( TQDragEnterEvent *e ) { //////////////// if a file is dragged into editor ... - e->accept (KURLDrag::canDecode(e) || QTextDrag::canDecode (e)); - //e->accept (QTextDrag::canDecode (e)); + e->accept (KURLDrag::canDecode(e) || TQTextDrag::canDecode (e)); + //e->accept (TQTextDrag::canDecode (e)); } -void MyEditor::contentsDropEvent( QDropEvent *e ) +void MyEditor::contentsDropEvent( TQDropEvent *e ) { ///////////////// decode dropped file KURL::List list; - QString text; + TQString text; if ( KURLDrag::decode( e, list ) ) slotDroppedFile(list.first()); - else if ( QTextDrag::decode(e, text) ) + else if ( TQTextDrag::decode(e, text) ) insert(text); } void MyEditor::slotDroppedFile(KURL url) { ///////////////// decide what to do with dropped file - QString text; + TQString text; if (!tempFile.isEmpty()) { KIO::NetAccess::removeTempFile(tempFile); - tempFile=QString::null; + tempFile=TQString::null; } if (url.isLocalFile()) @@ -111,14 +111,14 @@ void MyEditor::slotDroppedFile(KURL url) } -bool MyEditor::slotCheckContent(QString fileToCheck, bool checkForPgpMessage) +bool MyEditor::slotCheckContent(TQString fileToCheck, bool checkForPgpMessage) { -QFile qfile(fileToCheck); +TQFile qfile(fileToCheck); if (qfile.open(IO_ReadOnly)) { ////////// open file - QTextStream t( &qfile ); - QString result(t.read()); + TQTextStream t( &qfile ); + TQString result(t.read()); ////////////// if pgp data found, decode it if ((checkForPgpMessage) && (result.startsWith("-----BEGIN PGP MESSAGE"))) { qfile.close(); @@ -134,7 +134,7 @@ QFile qfile(fileToCheck); } else { KgpgInterface *importKeyProcess=new KgpgInterface(); importKeyProcess->importKeyURL(KURL(fileToCheck)); - connect(importKeyProcess,SIGNAL(importfinished(QStringList)),this,SLOT(slotProcessResult(QStringList))); + connect(importKeyProcess,TQT_SIGNAL(importfinished(TQStringList)),this,TQT_SLOT(slotProcessResult(TQStringList))); return true; } } else { @@ -154,50 +154,50 @@ QFile qfile(fileToCheck); } -void MyEditor::editorUpdateDecryptedtxt(QString newtxt) +void MyEditor::editorUpdateDecryptedtxt(TQString newtxt) { setText(newtxt); } -void MyEditor::editorFailedDecryptedtxt(QString newtxt) +void MyEditor::editorFailedDecryptedtxt(TQString newtxt) { if (!slotCheckContent(tempFile,false)) KMessageBox::detailedSorry(this,i18n("Decryption failed."),newtxt); } -void MyEditor::slotDecodeFile(QString fname) +void MyEditor::slotDecodeFile(TQString fname) { //////////////// decode file from given url into editor - QFile qfile(QFile::encodeName(fname)); + TQFile qfile(TQFile::encodeName(fname)); if (qfile.open(IO_ReadOnly)) { KgpgInterface *txtDecrypt=new KgpgInterface(); - connect (txtDecrypt,SIGNAL(txtdecryptionfinished(QString)),this,SLOT(editorUpdateDecryptedtxt(QString))); - connect (txtDecrypt,SIGNAL(txtdecryptionfailed(QString)),this,SLOT(editorFailedDecryptedtxt(QString))); - txtDecrypt->KgpgDecryptFileToText(KURL(fname),QStringList::split(QString(" "),KGpgSettings::customDecrypt().simplifyWhiteSpace())); + connect (txtDecrypt,TQT_SIGNAL(txtdecryptionfinished(TQString)),this,TQT_SLOT(editorUpdateDecryptedtxt(TQString))); + connect (txtDecrypt,TQT_SIGNAL(txtdecryptionfailed(TQString)),this,TQT_SLOT(editorFailedDecryptedtxt(TQString))); + txtDecrypt->KgpgDecryptFileToText(KURL(fname),TQStringList::split(TQString(" "),KGpgSettings::customDecrypt().simplifyWhiteSpace())); } else KMessageBox::sorry(this,i18n("Unable to read file.")); } -void MyEditor::slotProcessResult(QStringList iKeys) +void MyEditor::slotProcessResult(TQStringList iKeys) { emit refreshImported(iKeys); KIO::NetAccess::removeTempFile(tempFile); - tempFile=QString::null; + tempFile=TQString::null; } ////////////////////////// main view configuration -KgpgView::KgpgView(QWidget *parent, const char *name) : QWidget(parent, name) +KgpgView::KgpgView(TQWidget *parent, const char *name) : TQWidget(parent, name) { editor=new MyEditor(this); windowAutoClose=true; ///// layout - QVBoxLayout *vbox=new QVBoxLayout(this,3); + TQVBoxLayout *vbox=new TQVBoxLayout(this,3); editor->setReadOnly( false ); editor->setUndoRedoEnabled(true); @@ -208,11 +208,11 @@ KgpgView::KgpgView(QWidget *parent, const char *name) : QWidget(parent, name) KButtonBox *boutonbox=new KButtonBox(this,KButtonBox::Horizontal,15,12); boutonbox->addStretch(1); - bouton0=boutonbox->addButton(i18n("S&ign/Verify"),this,SLOT(clearSign()),TRUE); - bouton1=boutonbox->addButton(i18n("En&crypt"),this,SLOT(popuppublic()),TRUE); - bouton2=boutonbox->addButton(i18n("&Decrypt"),this,SLOT(slotdecode()),TRUE); + bouton0=boutonbox->addButton(i18n("S&ign/Verify"),this,TQT_SLOT(clearSign()),TRUE); + bouton1=boutonbox->addButton(i18n("En&crypt"),this,TQT_SLOT(popuppublic()),TRUE); + bouton2=boutonbox->addButton(i18n("&Decrypt"),this,TQT_SLOT(slotdecode()),TRUE); - QObject::connect(editor,SIGNAL(textChanged()),this,SLOT(modified())); + TQObject::connect(editor,TQT_SIGNAL(textChanged()),this,TQT_SLOT(modified())); boutonbox->layout(); editor->resize(editor->maximumSize()); @@ -226,7 +226,7 @@ void KgpgView::modified() /////////////// notify for changes in editor window KgpgApp *win=(KgpgApp *) parent(); if (win->fileSave->isEnabled()==false) { - QString capt=win->Docname.fileName(); + TQString capt=win->Docname.fileName(); if (capt.isEmpty()) capt=i18n("untitled"); win->setCaption(capt,true); @@ -236,10 +236,10 @@ void KgpgView::modified() } -void KgpgView::slotAskForImport(QString ID) +void KgpgView::slotAskForImport(TQString ID) { if (KMessageBox::questionYesNo(0,i18n("<qt><b>Missing signature:</b><br>Key id: %1<br><br>" - "Do you want to import this key from a keyserver?</qt>").arg(ID),i18n("Missing Key"), QString::null, i18n("Import"), i18n("Do Not Import"))==KMessageBox::Yes) { + "Do you want to import this key from a keyserver?</qt>").arg(ID),i18n("Missing Key"), TQString::null, i18n("Import"), i18n("Do Not Import"))==KMessageBox::Yes) { keyServer *kser=new keyServer(0,"server_dialog",false,true); kser->page->kLEimportid->setText(ID); kser->slotImport(); @@ -248,7 +248,7 @@ if (KMessageBox::questionYesNo(0,i18n("<qt><b>Missing signature:</b><br>Key id: else emit verifyFinished(); } -void KgpgView::slotVerifyResult(QString mssge,QString log) +void KgpgView::slotVerifyResult(TQString mssge,TQString log) { emit verifyFinished(); //KMessageBox::information(0,mssge); @@ -257,21 +257,21 @@ emit verifyFinished(); void KgpgView::clearSign() { - QString mess=editor->text(); + TQString mess=editor->text(); if (mess.startsWith("-----BEGIN PGP SIGNED")) { ////////////////////// this is a signed message, verify it KgpgInterface *verifyProcess=new KgpgInterface(); - connect(verifyProcess,SIGNAL(missingSignature(QString)),this,SLOT(slotAskForImport(QString))); - connect(verifyProcess,SIGNAL(verifyOver(QString,QString)),this,SLOT(slotVerifyResult(QString,QString))); + connect(verifyProcess,TQT_SIGNAL(missingSignature(TQString)),this,TQT_SLOT(slotAskForImport(TQString))); + connect(verifyProcess,TQT_SIGNAL(verifyOver(TQString,TQString)),this,TQT_SLOT(slotVerifyResult(TQString,TQString))); verifyProcess->KgpgVerifyText(mess); } else { ///// Sign the text in Editor - QString signKeyID; + TQString signKeyID; ///// open key selection dialog KgpgSelKey *opts=new KgpgSelKey(this,0); - if (opts->exec()==QDialog::Accepted) { + if (opts->exec()==TQDialog::Accepted) { signKeyID=opts->getkeyID(); } else { delete opts; @@ -280,8 +280,8 @@ void KgpgView::clearSign() delete opts; KgpgInterface *signProcess=new KgpgInterface(); - connect(signProcess,SIGNAL(txtSignOver(QString)),this,SLOT(slotSignResult(QString))); - QStringList options=NULL; + connect(signProcess,TQT_SIGNAL(txtSignOver(TQString)),this,TQT_SLOT(slotSignResult(TQString))); + TQStringList options=NULL; if (KGpgSettings::pgpCompatibility()) options<<"--pgp6"; signProcess->KgpgSignText(mess,signKeyID,options); @@ -289,7 +289,7 @@ void KgpgView::clearSign() } -void KgpgView::slotSignResult(QString signResult) +void KgpgView::slotSignResult(TQString signResult) { if (signResult.isEmpty()) KMessageBox::sorry(this,i18n("Signing not possible: bad passphrase or missing key")); @@ -312,7 +312,7 @@ void KgpgView::popuppublic() //////// open dialog --> popuppublic.cpp popupPublic *dialogue=new popupPublic(this, "public_keys", 0,false,((KgpgApp *) parent())->goDefaultKey); - connect(dialogue,SIGNAL(selectedKey(QStringList,QStringList,bool,bool)),this,SLOT(encodetxt(QStringList,QStringList,bool,bool))); + connect(dialogue,TQT_SIGNAL(selectedKey(TQStringList,TQStringList,bool,bool)),this,TQT_SLOT(encodetxt(TQStringList,TQStringList,bool,bool))); dialogue->exec(); delete dialogue; } @@ -324,14 +324,14 @@ void KgpgView::slotdecode() { /////////////// decode data from the editor. triggered by the decode button - QString dests,encUsers; - messages=QString::null; + TQString dests,encUsers; + messages=TQString::null; - //QString resultat=KgpgInterface::KgpgDecryptText(editor->text(),encUsers); + //TQString resultat=KgpgInterface::KgpgDecryptText(editor->text(),encUsers); KgpgInterface *txtDecrypt=new KgpgInterface(); - connect (txtDecrypt,SIGNAL(txtdecryptionfinished(QString)),this,SLOT(updateDecryptedtxt(QString))); - connect (txtDecrypt,SIGNAL(txtdecryptionfailed(QString)),this,SLOT(failedDecryptedtxt(QString))); - txtDecrypt->KgpgDecryptText(editor->text(),QStringList::split(QString(" "),KGpgSettings::customDecrypt().simplifyWhiteSpace())); + connect (txtDecrypt,TQT_SIGNAL(txtdecryptionfinished(TQString)),this,TQT_SLOT(updateDecryptedtxt(TQString))); + connect (txtDecrypt,TQT_SIGNAL(txtdecryptionfailed(TQString)),this,TQT_SLOT(failedDecryptedtxt(TQString))); + txtDecrypt->KgpgDecryptText(editor->text(),TQStringList::split(TQString(" "),KGpgSettings::customDecrypt().simplifyWhiteSpace())); /* KgpgApp *win=(KgpgApp *) parent(); @@ -342,27 +342,27 @@ void KgpgView::slotdecode() }*/ } -void KgpgView::updateDecryptedtxt(QString newtxt) +void KgpgView::updateDecryptedtxt(TQString newtxt) { //kdDebug(2100)<<"UTF8 Test Result--------------"<<KgpgView::checkForUtf8()<<endl; editor->setText(newtxt); emit resetEncoding(false); } -bool KgpgView::checkForUtf8(QString text) +bool KgpgView::checkForUtf8(TQString text) { //// try to guess if the decrypted text uses utf-8 encoding - QTextCodec *codec =QTextCodec::codecForLocale (); + TQTextCodec *codec =TQTextCodec::codecForLocale (); if (codec->canEncode(text)) return true; return false; } -void KgpgView::failedDecryptedtxt(QString newtxt) +void KgpgView::failedDecryptedtxt(TQString newtxt) { KMessageBox::detailedSorry(this,i18n("Decryption failed."),newtxt); } -void KgpgView::encodetxt(QStringList selec,QStringList encryptOptions,bool, bool symmetric) +void KgpgView::encodetxt(TQStringList selec,TQStringList encryptOptions,bool, bool symmetric) { ////////////////// encode from editor if (KGpgSettings::pgpCompatibility()) @@ -371,7 +371,7 @@ void KgpgView::encodetxt(QStringList selec,QStringList encryptOptions,bool, bool if (symmetric) selec.clear(); KgpgInterface *txtCrypt=new KgpgInterface(); - connect (txtCrypt,SIGNAL(txtencryptionfinished(QString)),this,SLOT(updatetxt(QString))); + connect (txtCrypt,TQT_SIGNAL(txtencryptionfinished(TQString)),this,TQT_SLOT(updatetxt(TQString))); txtCrypt->KgpgEncryptText(editor->text(),selec,encryptOptions); //KMessageBox::sorry(0,"OVER"); @@ -380,7 +380,7 @@ void KgpgView::encodetxt(QStringList selec,QStringList encryptOptions,bool, bool //else KMessageBox::sorry(this,i18n("Decryption failed.")); } -void KgpgView::updatetxt(QString newtxt) +void KgpgView::updatetxt(TQString newtxt) { if (!newtxt.isEmpty()) editor->setText(newtxt); @@ -395,9 +395,9 @@ delete editor; } /* -void KgpgView::print(QPrinter *pPrinter) +void KgpgView::print(TQPrinter *pPrinter) { - QPainter printpainter; + TQPainter printpainter; printpainter.begin(pPrinter); // TODO: add your printing code here diff --git a/kgpg/kgpgview.h b/kgpg/kgpgview.h index d6183bb..87ff206 100644 --- a/kgpg/kgpgview.h +++ b/kgpg/kgpgview.h @@ -30,7 +30,7 @@ class QDragEnterEvent; //class KgpgDoc; /** The KgpgView class provides the view widget for the KgpgApp instance. - * The View instance inherits QWidget as a base class and represents the view object of a KTMainWindow. As KgpgView is part of the + * The View instance inherits TQWidget as a base class and represents the view object of a KTMainWindow. As KgpgView is part of the * docuement-view model, it needs a reference to the document object connected with it by the KgpgApp class to manipulate and display * the document structure provided by the KgpgDoc class. * @@ -43,25 +43,25 @@ class MyEditor : public KTextEdit Q_OBJECT public: - MyEditor( QWidget *parent = 0, const char *name = 0); + MyEditor( TQWidget *parent = 0, const char *name = 0); private: - QString message,messages,tempFile; + TQString message,messages,tempFile; public slots: - void slotDecodeFile(QString); + void slotDecodeFile(TQString); void slotDroppedFile(KURL url); - void slotProcessResult(QStringList iKeys); - bool slotCheckContent(QString fileToCheck, bool checkForPgpMessage=true); + void slotProcessResult(TQStringList iKeys); + bool slotCheckContent(TQString fileToCheck, bool checkForPgpMessage=true); protected: - void contentsDragEnterEvent( QDragEnterEvent *e ); - void contentsDropEvent( QDropEvent *e ); + void contentsDragEnterEvent( TQDragEnterEvent *e ); + void contentsDropEvent( TQDropEvent *e ); private slots: - void editorUpdateDecryptedtxt(QString newtxt); - void editorFailedDecryptedtxt(QString newtxt); + void editorUpdateDecryptedtxt(TQString newtxt); + void editorFailedDecryptedtxt(TQString newtxt); signals: - void refreshImported(QStringList); + void refreshImported(TQStringList); }; @@ -71,7 +71,7 @@ class KgpgView : public QWidget friend class MyEditor; public: /** Constructor for the main view */ - KgpgView(QWidget *parent = 0, const char *name=0); + KgpgView(TQWidget *parent = 0, const char *name=0); /** Destructor for the main view */ ~KgpgView(); @@ -82,34 +82,34 @@ public: */ // KgpgDoc *getDocument() const; - // QTextEdit *editor; + // TQTextEdit *editor; MyEditor *editor; KURL fselected; bool windowAutoClose; /** contains the implementation for printing functionality */ - // void print(QPrinter *pPrinter); + // void print(TQPrinter *pPrinter); - QPushButton *bouton1,*bouton2,*bouton0; + TQPushButton *bouton1,*bouton2,*bouton0; private: - QString messages; + TQString messages; public slots: void slotdecode(); void clearSign(); private slots: - void slotVerifyResult(QString mssge,QString log); - void slotSignResult(QString signResult); - void slotAskForImport(QString ID); + void slotVerifyResult(TQString mssge,TQString log); + void slotSignResult(TQString signResult); + void slotAskForImport(TQString ID); void popuppublic(); void modified(); - void encodetxt(QStringList selec,QStringList encryptOptions,bool, bool symmetric); - void updatetxt(QString); - void updateDecryptedtxt(QString newtxt); - void failedDecryptedtxt(QString newtxt); - bool checkForUtf8(QString text); + void encodetxt(TQStringList selec,TQStringList encryptOptions,bool, bool symmetric); + void updatetxt(TQString); + void updateDecryptedtxt(TQString newtxt); + void failedDecryptedtxt(TQString newtxt); + bool checkForUtf8(TQString text); signals: void resetEncoding(bool); diff --git a/kgpg/listkeys.cpp b/kgpg/listkeys.cpp index 2a10a1c..1a7ace8 100644 --- a/kgpg/listkeys.cpp +++ b/kgpg/listkeys.cpp @@ -21,32 +21,32 @@ #include <unistd.h> #include <sys/wait.h> -#include <qdir.h> -#include <qfile.h> -#include <qlayout.h> -#include <qvariant.h> -#include <qregexp.h> -#include <qpainter.h> -#include <qvbox.h> -#include <qclipboard.h> -#include <qkeysequence.h> -#include <qtextcodec.h> +#include <tqdir.h> +#include <tqfile.h> +#include <tqlayout.h> +#include <tqvariant.h> +#include <tqregexp.h> +#include <tqpainter.h> +#include <tqvbox.h> +#include <tqclipboard.h> +#include <tqkeysequence.h> +#include <tqtextcodec.h> #include <kstatusbar.h> -#include <qtimer.h> -#include <qpaintdevicemetrics.h> -#include <qtooltip.h> -#include <qheader.h> +#include <tqtimer.h> +#include <tqpaintdevicemetrics.h> +#include <tqtooltip.h> +#include <tqheader.h> #include <ktempfile.h> #include <kdebug.h> #include <kprocess.h> #include <kprocio.h> -#include <qwidget.h> +#include <tqwidget.h> #include <kaction.h> -#include <qcheckbox.h> -#include <qlabel.h> -#include <qtoolbutton.h> -#include <qradiobutton.h> -#include <qpopupmenu.h> +#include <tqcheckbox.h> +#include <tqlabel.h> +#include <tqtoolbutton.h> +#include <tqradiobutton.h> +#include <tqpopupmenu.h> #include <kurlrequester.h> #include <kio/netaccess.h> @@ -70,8 +70,8 @@ #include <kdesktopfile.h> #include <kmimetype.h> #include <kstandarddirs.h> -#include <qcombobox.h> -#include <qtabwidget.h> +#include <tqcombobox.h> +#include <tqtabwidget.h> #include <kinputdialog.h> #include <kpassdlg.h> #include <kpassivepopup.h> @@ -102,15 +102,15 @@ class UpdateViewItem : public KListViewItem { public: - UpdateViewItem(QListView *parent, QString name,QString email, QString tr, QString val, QString size, QString creat, QString id,bool isdefault,bool isexpired); - UpdateViewItem(QListViewItem *parent=0, QString name=QString::null,QString email=QString::null, QString tr=QString::null, QString val=QString::null, QString size=QString::null, QString creat=QString::null, QString id=QString::null); - virtual void paintCell(QPainter *p, const QColorGroup &cg,int col, int width, int align); - virtual int compare( QListViewItem * item, int c, bool ascending ) const; - virtual QString key( int column, bool ) const; + UpdateViewItem(TQListView *parent, TQString name,TQString email, TQString tr, TQString val, TQString size, TQString creat, TQString id,bool isdefault,bool isexpired); + UpdateViewItem(TQListViewItem *parent=0, TQString name=TQString::null,TQString email=TQString::null, TQString tr=TQString::null, TQString val=TQString::null, TQString size=TQString::null, TQString creat=TQString::null, TQString id=TQString::null); + virtual void paintCell(TQPainter *p, const TQColorGroup &cg,int col, int width, int align); + virtual int compare( TQListViewItem * item, int c, bool ascending ) const; + virtual TQString key( int column, bool ) const; bool def,exp; }; -UpdateViewItem::UpdateViewItem(QListView *parent, QString name,QString email, QString tr, QString val, QString size, QString creat, QString id,bool isdefault,bool isexpired) +UpdateViewItem::UpdateViewItem(TQListView *parent, TQString name,TQString email, TQString tr, TQString val, TQString size, TQString creat, TQString id,bool isdefault,bool isexpired) : KListViewItem(parent) { def=isdefault; @@ -124,7 +124,7 @@ UpdateViewItem::UpdateViewItem(QListView *parent, QString name,QString email, QS setText(6,id); } -UpdateViewItem::UpdateViewItem(QListViewItem *parent, QString name,QString email, QString tr, QString val, QString size, QString creat, QString id) +UpdateViewItem::UpdateViewItem(TQListViewItem *parent, TQString name,TQString email, TQString tr, TQString val, TQString size, TQString creat, TQString id) : KListViewItem(parent) { setText(0,name); @@ -137,21 +137,21 @@ UpdateViewItem::UpdateViewItem(QListViewItem *parent, QString name,QString email } -void UpdateViewItem::paintCell(QPainter *p, const QColorGroup &cg,int column, int width, int alignment) +void UpdateViewItem::paintCell(TQPainter *p, const TQColorGroup &cg,int column, int width, int alignment) { - QColorGroup _cg( cg ); + TQColorGroup _cg( cg ); if (depth()==0) { if ((def) && (column<2)) { - QFont font(p->font()); + TQFont font(p->font()); font.setBold(true); p->setFont(font); } - else if ((exp) && (column==3)) _cg.setColor( QColorGroup::Text, Qt::red ); + else if ((exp) && (column==3)) _cg.setColor( TQColorGroup::Text, Qt::red ); } else if (column<2) { - QFont font(p->font()); + TQFont font(p->font()); font.setItalic(true); p->setFont(font); } @@ -163,12 +163,12 @@ void UpdateViewItem::paintCell(QPainter *p, const QColorGroup &cg,int column, in #include <iostream> using namespace std; -int UpdateViewItem :: compare( QListViewItem * item, int c, bool ascending ) const +int UpdateViewItem :: compare( TQListViewItem * item, int c, bool ascending ) const { int rc = 0; if ((c==3) || (c==5)) { - QDate d = KGlobal::locale()->readDate(text(c)); - QDate itemDate = KGlobal::locale()->readDate(item->text(c)); + TQDate d = KGlobal::locale()->readDate(text(c)); + TQDate itemDate = KGlobal::locale()->readDate(item->text(c)); bool itemDateValid = itemDate.isValid(); if (d.isValid()) { if (itemDateValid) { @@ -184,8 +184,8 @@ int UpdateViewItem :: compare( QListViewItem * item, int c, bool ascending ) co } if (c==2) /* sorting by pixmap */ { - const QPixmap* pix = pixmap(c); - const QPixmap* itemPix = item->pixmap(c); + const TQPixmap* pix = pixmap(c); + const TQPixmap* itemPix = item->pixmap(c); int serial,itemSerial; if (!pix) serial=0; @@ -201,10 +201,10 @@ int UpdateViewItem :: compare( QListViewItem * item, int c, bool ascending ) co rc=1; return rc; } - return QListViewItem::compare(item,c,ascending); + return TQListViewItem::compare(item,c,ascending); } -QString UpdateViewItem::key( int column, bool ) const +TQString UpdateViewItem::key( int column, bool ) const { return text( column ).lower(); } @@ -213,12 +213,12 @@ QString UpdateViewItem::key( int column, bool ) const //////////////////////////////////////////////////////////////////////////////////////////////////// //////////////// Secret key selection dialog, used when user wants to sign a key -KgpgSelKey::KgpgSelKey(QWidget *parent, const char *name,bool allowMultipleSelection, QString preselected): +KgpgSelKey::KgpgSelKey(TQWidget *parent, const char *name,bool allowMultipleSelection, TQString preselected): KDialogBase( parent, name, true,i18n("Private Key List"),Ok | Cancel) { - QString keyname; - page = new QWidget(this); - QLabel *labeltxt; + TQString keyname; + page = new TQWidget(this); + TQLabel *labeltxt; KIconLoader *loader = KGlobal::iconLoader(); keyPair=loader->loadIcon("kgpg_key2",KIcon::Small,20); @@ -231,15 +231,15 @@ KDialogBase( parent, name, true,i18n("Private Key List"),Ok | Cancel) keysListpr->setShowSortIndicator(true); keysListpr->setFullWidth(true); keysListpr->setAllColumnsShowFocus(true); - if (allowMultipleSelection) keysListpr->setSelectionMode(QListView::Extended); + if (allowMultipleSelection) keysListpr->setSelectionMode(TQListView::Extended); - labeltxt=new QLabel(i18n("Choose secret key:"),page); - vbox=new QVBoxLayout(page); + labeltxt=new TQLabel(i18n("Choose secret key:"),page); + vbox=new TQVBoxLayout(page); - if (preselected==QString::null) preselected = KGpgSettings::defaultKey(); + if (preselected==TQString::null) preselected = KGpgSettings::defaultKey(); FILE *fp,*fp2; - QString fullname,tst,tst2; + TQString fullname,tst,tst2; char line[300]; bool selectedok=false; @@ -248,21 +248,21 @@ KDialogBase( parent, name, true,i18n("Private Key List"),Ok | Cancel) fp = popen("gpg --no-tty --with-colons --list-secret-keys", "r"); while ( fgets( line, sizeof(line), fp)) { - tst=QString::fromUtf8(line); + tst=TQString::fromUtf8(line); if (tst.startsWith("sec")) { - QStringList keyString=QStringList::split(":",tst,true); - QString val=keyString[6]; - QString id=QString("0x"+keyString[4].right(8)); + TQStringList keyString=TQStringList::split(":",tst,true); + TQString val=keyString[6]; + TQString id=TQString("0x"+keyString[4].right(8)); if (val.isEmpty()) val=i18n("Unlimited"); fullname=keyString[9]; - fp2 = popen(QFile::encodeName(QString("gpg --no-tty --with-colons --list-key %1").arg(KShellProcess::quote(id))), "r"); + fp2 = popen(TQFile::encodeName(TQString("gpg --no-tty --with-colons --list-key %1").arg(KShellProcess::quote(id))), "r"); bool dead=true; while ( fgets( line, sizeof(line), fp2)) { - tst2=QString::fromUtf8(line); + tst2=TQString::fromUtf8(line); if (tst2.startsWith("pub")) { - const QString trust2=tst2.section(':',1,1); + const TQString trust2=tst2.section(':',1,1); switch( trust2[0] ) { case 'f': dead=false; @@ -283,13 +283,13 @@ KDialogBase( parent, name, true,i18n("Private Key List"),Ok | Cancel) } pclose(fp2); if (!fullname.isEmpty() && (!dead)) { - QString keyMail,keyName; + TQString keyMail,keyName; if (fullname.find("<")!=-1) { keyMail=fullname.section('<',-1,-1); keyMail.truncate(keyMail.length()-1); keyName=fullname.section('<',0,0); } else { - keyMail=QString::null; + keyMail=TQString::null; keyName=fullname; } @@ -313,10 +313,10 @@ KDialogBase( parent, name, true,i18n("Private Key List"),Ok | Cancel) if (warn) { - KMessageBox::information(this,i18n("<qt><b>Some of your secret keys are untrusted.</b><br>Change their trust if you want to use them for signing.</qt>"),QString::null,"warnUntrusted"); + KMessageBox::information(this,i18n("<qt><b>Some of your secret keys are untrusted.</b><br>Change their trust if you want to use them for signing.</qt>"),TQString::null,"warnUntrusted"); } - QObject::connect(keysListpr,SIGNAL(doubleClicked(QListViewItem *,const QPoint &,int)),this,SLOT(slotpreOk())); - QObject::connect(keysListpr,SIGNAL(clicked(QListViewItem *)),this,SLOT(slotSelect(QListViewItem *))); + TQObject::connect(keysListpr,TQT_SIGNAL(doubleClicked(TQListViewItem *,const TQPoint &,int)),this,TQT_SLOT(slotpreOk())); + TQObject::connect(keysListpr,TQT_SIGNAL(clicked(TQListViewItem *)),this,TQT_SLOT(slotSelect(TQListViewItem *))); if (!selectedok) @@ -347,7 +347,7 @@ void KgpgSelKey::slotOk() accept(); } -void KgpgSelKey::slotSelect(QListViewItem *item) +void KgpgSelKey::slotSelect(TQListViewItem *item) { if (item==NULL) return; @@ -358,14 +358,14 @@ void KgpgSelKey::slotSelect(QListViewItem *item) } -QString KgpgSelKey::getkeyID() +TQString KgpgSelKey::getkeyID() { ///// emit selected key if (keysListpr->currentItem()==NULL) - return(QString::null); - QString result; - QPtrList< QListViewItem > list = keysListpr->selectedItems(false); - QListViewItem *item; + return(TQString::null); + TQString result; + TQPtrList< TQListViewItem > list = keysListpr->selectedItems(false); + TQListViewItem *item; for ( item = list.first(); item; item = list.next() ) { result.append(item->text(2)); @@ -374,12 +374,12 @@ QString KgpgSelKey::getkeyID() return(result); } -QString KgpgSelKey::getkeyMail() +TQString KgpgSelKey::getkeyMail() { - QString username; + TQString username; ///// emit selected key if (keysListpr->currentItem()==NULL) - return(QString::null); + return(TQString::null); else { username=keysListpr->currentItem()->text(0); //username=username.section(' ',0,0); @@ -392,7 +392,7 @@ QString KgpgSelKey::getkeyMail() ///////////////////////////////////////////////////////////////////////////////////////////// -KeyView::KeyView( QWidget *parent, const char *name ) +KeyView::KeyView( TQWidget *parent, const char *name ) : KListView( parent, name ) { KIconLoader *loader = KGlobal::iconLoader(); @@ -405,7 +405,7 @@ KeyView::KeyView( QWidget *parent, const char *name ) pixuserid=loader->loadIcon("kgpg_identity",KIcon::Small,20); pixuserphoto=loader->loadIcon("kgpg_photo",KIcon::Small,20); pixRevoke=loader->loadIcon("stop",KIcon::Small,20); - QPixmap blankFrame; + TQPixmap blankFrame; blankFrame.load(locate("appdata", "pics/kgpg_blank.png")); trustunknown.load(locate("appdata", "pics/kgpg_fill.png")); @@ -413,18 +413,18 @@ KeyView::KeyView( QWidget *parent, const char *name ) bitBlt(&trustunknown,0,0,&blankFrame,0,0,50,15); trustbad.load(locate("appdata", "pics/kgpg_fill.png")); - trustbad.fill(KGpgSettings::colorBad());//QColor(172,0,0)); + trustbad.fill(KGpgSettings::colorBad());//TQColor(172,0,0)); bitBlt(&trustbad,0,0,&blankFrame,0,0,50,15); trustrevoked.load(locate("appdata", "pics/kgpg_fill.png")); - trustrevoked.fill(KGpgSettings::colorRev());//QColor(30,30,30)); + trustrevoked.fill(KGpgSettings::colorRev());//TQColor(30,30,30)); bitBlt(&trustrevoked,0,0,&blankFrame,0,0,50,15); trustgood.load(locate("appdata", "pics/kgpg_fill.png")); - trustgood.fill(KGpgSettings::colorGood());//QColor(144,255,0)); + trustgood.fill(KGpgSettings::colorGood());//TQColor(144,255,0)); bitBlt(&trustgood,0,0,&blankFrame,0,0,50,15); - connect(this,SIGNAL(expanded (QListViewItem *)),this,SLOT(expandKey(QListViewItem *))); + connect(this,TQT_SIGNAL(expanded (TQListViewItem *)),this,TQT_SLOT(expandKey(TQListViewItem *))); header()->setMovingEnabled(false); setAcceptDrops(true); setDragEnabled(true); @@ -434,20 +434,20 @@ KeyView::KeyView( QWidget *parent, const char *name ) void KeyView::droppedfile (KURL url) { - if (KMessageBox::questionYesNo(this,i18n("<p>Do you want to import file <b>%1</b> into your key ring?</p>").arg(url.path()), QString::null, i18n("Import"), i18n("Do Not Import"))!=KMessageBox::Yes) + if (KMessageBox::questionYesNo(this,i18n("<p>Do you want to import file <b>%1</b> into your key ring?</p>").arg(url.path()), TQString::null, i18n("Import"), i18n("Do Not Import"))!=KMessageBox::Yes) return; KgpgInterface *importKeyProcess=new KgpgInterface(); importKeyProcess->importKeyURL(url); - connect(importKeyProcess,SIGNAL(importfinished(QStringList)),this,SLOT(slotReloadKeys(QStringList))); + connect(importKeyProcess,TQT_SIGNAL(importfinished(TQStringList)),this,TQT_SLOT(slotReloadKeys(TQStringList))); } -void KeyView::contentsDragMoveEvent(QDragMoveEvent *e) +void KeyView::contentsDragMoveEvent(TQDragMoveEvent *e) { e->accept (KURLDrag::canDecode(e)); } -void KeyView::contentsDropEvent (QDropEvent *o) +void KeyView::contentsDropEvent (TQDropEvent *o) { KURL::List list; if ( KURLDrag::decode( o, list ) ) @@ -458,25 +458,25 @@ void KeyView::startDrag() { FILE *fp; char line[200]=""; - QString keyid=currentItem()->text(6); + TQString keyid=currentItem()->text(6); if (!keyid.startsWith("0x")) return; - QString gpgcmd="gpg --display-charset=utf-8 --no-tty --export --armor "+KShellProcess::quote(keyid.local8Bit()); + TQString gpgcmd="gpg --display-charset=utf-8 --no-tty --export --armor "+KShellProcess::quote(keyid.local8Bit()); - QString keytxt; - fp=popen(QFile::encodeName(gpgcmd),"r"); + TQString keytxt; + fp=popen(TQFile::encodeName(gpgcmd),"r"); while ( fgets( line, sizeof(line), fp)) /// read output - if (!QString(line).startsWith("gpg:")) - keytxt+=QString::fromUtf8(line); + if (!TQString(line).startsWith("gpg:")) + keytxt+=TQString::fromUtf8(line); pclose(fp); - QDragObject *d = new QTextDrag( keytxt, this ); + TQDragObject *d = new TQTextDrag( keytxt, this ); d->dragCopy(); // do NOT delete d. } -mySearchLine::mySearchLine(QWidget *parent, KeyView *listView, const char *name) +mySearchLine::mySearchLine(TQWidget *parent, KeyView *listView, const char *name) :KListViewSearchLine(parent,listView,name) { searchListView=listView; @@ -487,7 +487,7 @@ mySearchLine::~ mySearchLine() {} -bool mySearchLine::itemMatches(const QListViewItem *item, const QString & s) const +bool mySearchLine::itemMatches(const TQListViewItem *item, const TQString & s) const { if (item->depth()!=0) return true; else return KListViewSearchLine::itemMatches(item,s); @@ -495,13 +495,13 @@ else return KListViewSearchLine::itemMatches(item,s); -void mySearchLine::updateSearch(const QString& s) +void mySearchLine::updateSearch(const TQString& s) { KListViewSearchLine::updateSearch(s); if (searchListView->displayOnlySecret || !searchListView->displayDisabled) { int disabledSerial=searchListView->trustbad.serialNumber(); - QListViewItem *item=searchListView->firstChild(); + TQListViewItem *item=searchListView->firstChild(); while (item) { if (item->isVisible() && !(item->text(6).isEmpty())) @@ -519,12 +519,12 @@ void mySearchLine::updateSearch(const QString& s) /////////////////////////////////////////////////////////////////////////////////////// main window for key management -listKeys::listKeys(QWidget *parent, const char *name) : DCOPObject( "KeyInterface" ), KMainWindow(parent, name,0) +listKeys::listKeys(TQWidget *parent, const char *name) : DCOPObject( "KeyInterface" ), KMainWindow(parent, name,0) { //KWin::setType(Qt::WDestructiveClose); keysList2 = new KeyView(this); - keysList2->photoKeysList=QString::null; + keysList2->photoKeysList=TQString::null; keysList2->groupNb=0; keyStatusBar=NULL; readOptions(); @@ -533,67 +533,67 @@ listKeys::listKeys(QWidget *parent, const char *name) : DCOPObject( "KeyInterfac installEventFilter(this); setCaption(i18n("Key Management")); - (void) new KAction(i18n("&Open Editor"), "edit",0,this, SLOT(slotOpenEditor()),actionCollection(),"kgpg_editor"); - KAction *exportPublicKey = new KAction(i18n("E&xport Public Keys..."), "kgpg_export", KStdAccel::shortcut(KStdAccel::Copy),this, SLOT(slotexport()),actionCollection(),"key_export"); - KAction *deleteKey = new KAction(i18n("&Delete Keys"),"editdelete", Qt::Key_Delete,this, SLOT(confirmdeletekey()),actionCollection(),"key_delete"); - signKey = new KAction(i18n("&Sign Keys..."), "kgpg_sign", 0,this, SLOT(signkey()),actionCollection(),"key_sign"); - KAction *delSignKey = new KAction(i18n("Delete Sign&ature"),"editdelete", 0,this, SLOT(delsignkey()),actionCollection(),"key_delsign"); - KAction *infoKey = new KAction(i18n("&Edit Key"), "kgpg_info", Qt::Key_Return,this, SLOT(listsigns()),actionCollection(),"key_info"); - KAction *importKey = new KAction(i18n("&Import Key..."), "kgpg_import", KStdAccel::shortcut(KStdAccel::Paste),this, SLOT(slotPreImportKey()),actionCollection(),"key_import"); - KAction *setDefaultKey = new KAction(i18n("Set as De&fault Key"),0, 0,this, SLOT(slotSetDefKey()),actionCollection(),"key_default"); - importSignatureKey = new KAction(i18n("Import Key From Keyserver"),"network", 0,this, SLOT(preimportsignkey()),actionCollection(),"key_importsign"); - importAllSignKeys = new KAction(i18n("Import &Missing Signatures From Keyserver"),"network", 0,this, SLOT(importallsignkey()),actionCollection(),"key_importallsign"); - refreshKey = new KAction(i18n("&Refresh Keys From Keyserver"),"reload", 0,this, SLOT(refreshKeyFromServer()),actionCollection(),"key_server_refresh"); - - KAction *createGroup=new KAction(i18n("&Create Group with Selected Keys..."), 0, 0,this, SLOT(createNewGroup()),actionCollection(),"create_group"); - KAction *delGroup= new KAction(i18n("&Delete Group"), 0, 0,this, SLOT(deleteGroup()),actionCollection(),"delete_group"); - KAction *editCurrentGroup= new KAction(i18n("&Edit Group"), 0, 0,this, SLOT(editGroup()),actionCollection(),"edit_group"); - - KAction *newContact=new KAction(i18n("&Create New Contact in Address Book"), "kaddressbook", 0,this, SLOT(addToKAB()),actionCollection(),"add_kab"); - (void) new KAction(i18n("&Go to Default Key"), "gohome",QKeySequence(CTRL+Qt::Key_Home) ,this, SLOT(slotGotoDefaultKey()),actionCollection(),"go_default_key"); - - KStdAction::quit(this, SLOT(quitApp()), actionCollection()); - KStdAction::find(this, SLOT(findKey()), actionCollection()); - KStdAction::findNext(this, SLOT(findNextKey()), actionCollection()); - (void) new KAction(i18n("&Refresh List"), "reload", KStdAccel::reload(),this, SLOT(refreshkey()),actionCollection(),"key_refresh"); - KAction *openPhoto= new KAction(i18n("&Open Photo"), "image", 0,this, SLOT(slotShowPhoto()),actionCollection(),"key_photo"); - KAction *deletePhoto= new KAction(i18n("&Delete Photo"), "delete", 0,this, SLOT(slotDeletePhoto()),actionCollection(),"delete_photo"); - KAction *addPhoto= new KAction(i18n("&Add Photo"), 0, 0,this, SLOT(slotAddPhoto()),actionCollection(),"add_photo"); - - KAction *addUid= new KAction(i18n("&Add User Id"), 0, 0,this, SLOT(slotAddUid()),actionCollection(),"add_uid"); - KAction *delUid= new KAction(i18n("&Delete User Id"), 0, 0,this, SLOT(slotDelUid()),actionCollection(),"del_uid"); - - KAction *editKey = new KAction(i18n("Edit Key in &Terminal"), "kgpg_term", QKeySequence(ALT+Qt::Key_Return),this, SLOT(slotedit()),actionCollection(),"key_edit"); - KAction *exportSecretKey = new KAction(i18n("Export Secret Key..."), 0, 0,this, SLOT(slotexportsec()),actionCollection(),"key_sexport"); - KAction *revokeKey = new KAction(i18n("Revoke Key..."), 0, 0,this, SLOT(revokeWidget()),actionCollection(),"key_revoke"); - - KAction *deleteKeyPair = new KAction(i18n("Delete Key Pair"), 0, 0,this, SLOT(deleteseckey()),actionCollection(),"key_pdelete"); - KAction *generateKey = new KAction(i18n("&Generate Key Pair..."), "kgpg_gen", KStdAccel::shortcut(KStdAccel::New),this, SLOT(slotgenkey()),actionCollection(),"key_gener"); - - KAction *regeneratePublic = new KAction(i18n("&Regenerate Public Key"), 0, 0,this, SLOT(slotregenerate()),actionCollection(),"key_regener"); - - (void) new KAction(i18n("&Key Server Dialog"), "network", 0,this, SLOT(showKeyServer()),actionCollection(),"key_server"); - KStdAction::preferences(this, SLOT(showOptions()), actionCollection(),"options_configure"); - (void) new KAction(i18n("Tip of the &Day"), "idea", 0,this, SLOT(slotTip()), actionCollection(),"help_tipofday"); - (void) new KAction(i18n("View GnuPG Manual"), "contents", 0,this, SLOT(slotManpage()),actionCollection(),"gpg_man"); - - (void) new KToggleAction(i18n("&Show only Secret Keys"), "kgpg_show", 0,this, SLOT(slotToggleSecret()),actionCollection(),"show_secret"); + (void) new KAction(i18n("&Open Editor"), "edit",0,this, TQT_SLOT(slotOpenEditor()),actionCollection(),"kgpg_editor"); + KAction *exportPublicKey = new KAction(i18n("E&xport Public Keys..."), "kgpg_export", KStdAccel::shortcut(KStdAccel::Copy),this, TQT_SLOT(slotexport()),actionCollection(),"key_export"); + KAction *deleteKey = new KAction(i18n("&Delete Keys"),"editdelete", Qt::Key_Delete,this, TQT_SLOT(confirmdeletekey()),actionCollection(),"key_delete"); + signKey = new KAction(i18n("&Sign Keys..."), "kgpg_sign", 0,this, TQT_SLOT(signkey()),actionCollection(),"key_sign"); + KAction *delSignKey = new KAction(i18n("Delete Sign&ature"),"editdelete", 0,this, TQT_SLOT(delsignkey()),actionCollection(),"key_delsign"); + KAction *infoKey = new KAction(i18n("&Edit Key"), "kgpg_info", Qt::Key_Return,this, TQT_SLOT(listsigns()),actionCollection(),"key_info"); + KAction *importKey = new KAction(i18n("&Import Key..."), "kgpg_import", KStdAccel::shortcut(KStdAccel::Paste),this, TQT_SLOT(slotPreImportKey()),actionCollection(),"key_import"); + KAction *setDefaultKey = new KAction(i18n("Set as De&fault Key"),0, 0,this, TQT_SLOT(slotSetDefKey()),actionCollection(),"key_default"); + importSignatureKey = new KAction(i18n("Import Key From Keyserver"),"network", 0,this, TQT_SLOT(preimportsignkey()),actionCollection(),"key_importsign"); + importAllSignKeys = new KAction(i18n("Import &Missing Signatures From Keyserver"),"network", 0,this, TQT_SLOT(importallsignkey()),actionCollection(),"key_importallsign"); + refreshKey = new KAction(i18n("&Refresh Keys From Keyserver"),"reload", 0,this, TQT_SLOT(refreshKeyFromServer()),actionCollection(),"key_server_refresh"); + + KAction *createGroup=new KAction(i18n("&Create Group with Selected Keys..."), 0, 0,this, TQT_SLOT(createNewGroup()),actionCollection(),"create_group"); + KAction *delGroup= new KAction(i18n("&Delete Group"), 0, 0,this, TQT_SLOT(deleteGroup()),actionCollection(),"delete_group"); + KAction *editCurrentGroup= new KAction(i18n("&Edit Group"), 0, 0,this, TQT_SLOT(editGroup()),actionCollection(),"edit_group"); + + KAction *newContact=new KAction(i18n("&Create New Contact in Address Book"), "kaddressbook", 0,this, TQT_SLOT(addToKAB()),actionCollection(),"add_kab"); + (void) new KAction(i18n("&Go to Default Key"), "gohome",TQKeySequence(CTRL+Qt::Key_Home) ,this, TQT_SLOT(slotGotoDefaultKey()),actionCollection(),"go_default_key"); + + KStdAction::quit(this, TQT_SLOT(quitApp()), actionCollection()); + KStdAction::find(this, TQT_SLOT(findKey()), actionCollection()); + KStdAction::findNext(this, TQT_SLOT(findNextKey()), actionCollection()); + (void) new KAction(i18n("&Refresh List"), "reload", KStdAccel::reload(),this, TQT_SLOT(refreshkey()),actionCollection(),"key_refresh"); + KAction *openPhoto= new KAction(i18n("&Open Photo"), "image", 0,this, TQT_SLOT(slotShowPhoto()),actionCollection(),"key_photo"); + KAction *deletePhoto= new KAction(i18n("&Delete Photo"), "delete", 0,this, TQT_SLOT(slotDeletePhoto()),actionCollection(),"delete_photo"); + KAction *addPhoto= new KAction(i18n("&Add Photo"), 0, 0,this, TQT_SLOT(slotAddPhoto()),actionCollection(),"add_photo"); + + KAction *addUid= new KAction(i18n("&Add User Id"), 0, 0,this, TQT_SLOT(slotAddUid()),actionCollection(),"add_uid"); + KAction *delUid= new KAction(i18n("&Delete User Id"), 0, 0,this, TQT_SLOT(slotDelUid()),actionCollection(),"del_uid"); + + KAction *editKey = new KAction(i18n("Edit Key in &Terminal"), "kgpg_term", TQKeySequence(ALT+Qt::Key_Return),this, TQT_SLOT(slotedit()),actionCollection(),"key_edit"); + KAction *exportSecretKey = new KAction(i18n("Export Secret Key..."), 0, 0,this, TQT_SLOT(slotexportsec()),actionCollection(),"key_sexport"); + KAction *revokeKey = new KAction(i18n("Revoke Key..."), 0, 0,this, TQT_SLOT(revokeWidget()),actionCollection(),"key_revoke"); + + KAction *deleteKeyPair = new KAction(i18n("Delete Key Pair"), 0, 0,this, TQT_SLOT(deleteseckey()),actionCollection(),"key_pdelete"); + KAction *generateKey = new KAction(i18n("&Generate Key Pair..."), "kgpg_gen", KStdAccel::shortcut(KStdAccel::New),this, TQT_SLOT(slotgenkey()),actionCollection(),"key_gener"); + + KAction *regeneratePublic = new KAction(i18n("&Regenerate Public Key"), 0, 0,this, TQT_SLOT(slotregenerate()),actionCollection(),"key_regener"); + + (void) new KAction(i18n("&Key Server Dialog"), "network", 0,this, TQT_SLOT(showKeyServer()),actionCollection(),"key_server"); + KStdAction::preferences(this, TQT_SLOT(showOptions()), actionCollection(),"options_configure"); + (void) new KAction(i18n("Tip of the &Day"), "idea", 0,this, TQT_SLOT(slotTip()), actionCollection(),"help_tipofday"); + (void) new KAction(i18n("View GnuPG Manual"), "contents", 0,this, TQT_SLOT(slotManpage()),actionCollection(),"gpg_man"); + + (void) new KToggleAction(i18n("&Show only Secret Keys"), "kgpg_show", 0,this, TQT_SLOT(slotToggleSecret()),actionCollection(),"show_secret"); keysList2->displayOnlySecret=false; - (void) new KToggleAction(i18n("&Hide Expired/Disabled Keys"),0, 0,this, SLOT(slotToggleDisabled()),actionCollection(),"hide_disabled"); + (void) new KToggleAction(i18n("&Hide Expired/Disabled Keys"),0, 0,this, TQT_SLOT(slotToggleDisabled()),actionCollection(),"hide_disabled"); keysList2->displayDisabled=true; - sTrust=new KToggleAction(i18n("Trust"),0, 0,this, SLOT(slotShowTrust()),actionCollection(),"show_trust"); - sSize=new KToggleAction(i18n("Size"),0, 0,this, SLOT(slotShowSize()),actionCollection(),"show_size"); - sCreat=new KToggleAction(i18n("Creation"),0, 0,this, SLOT(slotShowCreat()),actionCollection(),"show_creat"); - sExpi=new KToggleAction(i18n("Expiration"),0, 0,this, SLOT(slotShowExpi()),actionCollection(),"show_expi"); + sTrust=new KToggleAction(i18n("Trust"),0, 0,this, TQT_SLOT(slotShowTrust()),actionCollection(),"show_trust"); + sSize=new KToggleAction(i18n("Size"),0, 0,this, TQT_SLOT(slotShowSize()),actionCollection(),"show_size"); + sCreat=new KToggleAction(i18n("Creation"),0, 0,this, TQT_SLOT(slotShowCreat()),actionCollection(),"show_creat"); + sExpi=new KToggleAction(i18n("Expiration"),0, 0,this, TQT_SLOT(slotShowExpi()),actionCollection(),"show_expi"); photoProps = new KSelectAction(i18n("&Photo ID's"),"kgpg_photo", actionCollection(), "photo_settings"); - connect(photoProps, SIGNAL(activated(int)), this, SLOT(slotSetPhotoSize(int))); + connect(photoProps, TQT_SIGNAL(activated(int)), this, TQT_SLOT(slotSetPhotoSize(int))); // Keep the list in kgpg.kcfg in sync with this one! - QStringList list; + TQStringList list; list.append(i18n("Disable")); list.append(i18n("Small")); list.append(i18n("Medium")); @@ -619,7 +619,7 @@ listKeys::listKeys(QWidget *parent, const char *name) : DCOPObject( "KeyInterfac keysList2->setSelectionModeExt(KListView::Extended); - popup=new QPopupMenu(); + popup=new TQPopupMenu(); exportPublicKey->plug(popup); deleteKey->plug(popup); signKey->plug(popup); @@ -630,7 +630,7 @@ listKeys::listKeys(QWidget *parent, const char *name) : DCOPObject( "KeyInterfac popup->insertSeparator(); importAllSignKeys->plug(popup); - popupsec=new QPopupMenu(); + popupsec=new TQPopupMenu(); exportPublicKey->plug(popupsec); signKey->plug(popupsec); infoKey->plug(popupsec); @@ -646,26 +646,26 @@ listKeys::listKeys(QWidget *parent, const char *name) : DCOPObject( "KeyInterfac deleteKeyPair->plug(popupsec); revokeKey->plug(popupsec); - popupgroup=new QPopupMenu(); + popupgroup=new TQPopupMenu(); editCurrentGroup->plug(popupgroup); delGroup->plug(popupgroup); - popupout=new QPopupMenu(); + popupout=new TQPopupMenu(); importKey->plug(popupout); generateKey->plug(popupout); - popupsig=new QPopupMenu(); + popupsig=new TQPopupMenu(); importSignatureKey->plug(popupsig); delSignKey->plug(popupsig); - popupphoto=new QPopupMenu(); + popupphoto=new TQPopupMenu(); openPhoto->plug(popupphoto); deletePhoto->plug(popupphoto); - popupuid=new QPopupMenu(); + popupuid=new TQPopupMenu(); delUid->plug(popupuid); - popuporphan=new QPopupMenu(); + popuporphan=new TQPopupMenu(); regeneratePublic->plug(popuporphan); deleteKeyPair->plug(popuporphan); @@ -682,12 +682,12 @@ listKeys::listKeys(QWidget *parent, const char *name) : DCOPObject( "KeyInterfac setCentralWidget(keysList2); keysList2->restoreLayout(KGlobal::config(), "KeyView"); - QObject::connect(keysList2,SIGNAL(returnPressed(QListViewItem *)),this,SLOT(listsigns())); - QObject::connect(keysList2,SIGNAL(doubleClicked(QListViewItem *,const QPoint &,int)),this,SLOT(listsigns())); - QObject::connect(keysList2,SIGNAL(selectionChanged ()),this,SLOT(checkList())); - QObject::connect(keysList2,SIGNAL(contextMenuRequested(QListViewItem *,const QPoint &,int)), - this,SLOT(slotmenu(QListViewItem *,const QPoint &,int))); - QObject::connect(keysList2,SIGNAL(destroyed()),this,SLOT(annule())); + TQObject::connect(keysList2,TQT_SIGNAL(returnPressed(TQListViewItem *)),this,TQT_SLOT(listsigns())); + TQObject::connect(keysList2,TQT_SIGNAL(doubleClicked(TQListViewItem *,const TQPoint &,int)),this,TQT_SLOT(listsigns())); + TQObject::connect(keysList2,TQT_SIGNAL(selectionChanged ()),this,TQT_SLOT(checkList())); + TQObject::connect(keysList2,TQT_SIGNAL(contextMenuRequested(TQListViewItem *,const TQPoint &,int)), + this,TQT_SLOT(slotmenu(TQListViewItem *,const TQPoint &,int))); + TQObject::connect(keysList2,TQT_SIGNAL(destroyed()),this,TQT_SLOT(annule())); /////////////// get all keys data @@ -696,35 +696,35 @@ listKeys::listKeys(QWidget *parent, const char *name) : DCOPObject( "KeyInterfac setupGUI(KMainWindow::Create | Save | ToolBar | StatusBar | Keys, "listkeys.rc"); toolBar()->insertLineSeparator(); - QToolButton *clearSearch = new QToolButton(toolBar()); + TQToolButton *clearSearch = new TQToolButton(toolBar()); clearSearch->setTextLabel(i18n("Clear Search"), true); - clearSearch->setIconSet(SmallIconSet(QApplication::reverseLayout() ? "clear_left" + clearSearch->setIconSet(SmallIconSet(TQApplication::reverseLayout() ? "clear_left" : "locationbar_erase")); - (void) new QLabel(i18n("Search: "),toolBar()); + (void) new TQLabel(i18n("Search: "),toolBar()); listViewSearch = new mySearchLine(toolBar(),keysList2); - connect(clearSearch, SIGNAL(pressed()), listViewSearch, SLOT(clear())); + connect(clearSearch, TQT_SIGNAL(pressed()), listViewSearch, TQT_SLOT(clear())); - (void)new KAction(i18n("Filter Search"), Qt::Key_F6, listViewSearch, SLOT(setFocus()),actionCollection(), "search_focus"); + (void)new KAction(i18n("Filter Search"), Qt::Key_F6, listViewSearch, TQT_SLOT(setFocus()),actionCollection(), "search_focus"); sTrust->setChecked(KGpgSettings::showTrust()); sSize->setChecked(KGpgSettings::showSize()); sCreat->setChecked(KGpgSettings::showCreat()); sExpi->setChecked(KGpgSettings::showExpi()); - statusbarTimer = new QTimer(this); + statusbarTimer = new TQTimer(this); keyStatusBar->insertItem("",0,1); keyStatusBar->insertFixedItem(i18n("00000 Keys, 000 Groups"),1,true); keyStatusBar->setItemAlignment(0, AlignLeft); keyStatusBar->changeItem("",1); - QObject::connect(keysList2,SIGNAL(statusMessage(QString,int,bool)),this,SLOT(changeMessage(QString,int,bool))); - QObject::connect(statusbarTimer,SIGNAL(timeout()),this,SLOT(statusBarTimeout())); + TQObject::connect(keysList2,TQT_SIGNAL(statusMessage(TQString,int,bool)),this,TQT_SLOT(changeMessage(TQString,int,bool))); + TQObject::connect(statusbarTimer,TQT_SIGNAL(timeout()),this,TQT_SLOT(statusBarTimeout())); s_kgpgEditor= new KgpgApp(parent, "editor",WType_Dialog,actionCollection()->action("go_default_key")->shortcut(),true); - connect(s_kgpgEditor,SIGNAL(refreshImported(QStringList)),keysList2,SLOT(slotReloadKeys(QStringList))); - connect(this,SIGNAL(fontChanged(QFont)),s_kgpgEditor,SLOT(slotSetFont(QFont))); - connect(s_kgpgEditor->view->editor,SIGNAL(refreshImported(QStringList)),keysList2,SLOT(slotReloadKeys(QStringList))); + connect(s_kgpgEditor,TQT_SIGNAL(refreshImported(TQStringList)),keysList2,TQT_SLOT(slotReloadKeys(TQStringList))); + connect(this,TQT_SIGNAL(fontChanged(TQFont)),s_kgpgEditor,TQT_SLOT(slotSetFont(TQFont))); + connect(s_kgpgEditor->view->editor,TQT_SIGNAL(refreshImported(TQStringList)),keysList2,TQT_SLOT(slotReloadKeys(TQStringList))); } @@ -739,10 +739,10 @@ show(); void listKeys::slotOpenEditor() { KgpgApp *kgpgtxtedit = new KgpgApp(this, "editor",WType_TopLevel | WDestructiveClose,actionCollection()->action("go_default_key")->shortcut()); - connect(kgpgtxtedit,SIGNAL(refreshImported(QStringList)),keysList2,SLOT(slotReloadKeys(QStringList))); - connect(kgpgtxtedit,SIGNAL(encryptFiles(KURL::List)),this,SIGNAL(encryptFiles(KURL::List))); - connect(this,SIGNAL(fontChanged(QFont)),kgpgtxtedit,SLOT(slotSetFont(QFont))); - connect(kgpgtxtedit->view->editor,SIGNAL(refreshImported(QStringList)),keysList2,SLOT(slotReloadKeys(QStringList))); + connect(kgpgtxtedit,TQT_SIGNAL(refreshImported(TQStringList)),keysList2,TQT_SLOT(slotReloadKeys(TQStringList))); + connect(kgpgtxtedit,TQT_SIGNAL(encryptFiles(KURL::List)),this,TQT_SIGNAL(encryptFiles(KURL::List))); + connect(this,TQT_SIGNAL(fontChanged(TQFont)),kgpgtxtedit,TQT_SLOT(slotSetFont(TQFont))); + connect(kgpgtxtedit->view->editor,TQT_SIGNAL(refreshImported(TQStringList)),keysList2,TQT_SLOT(slotReloadKeys(TQStringList))); kgpgtxtedit->show(); } @@ -751,7 +751,7 @@ void listKeys::statusBarTimeout() keyStatusBar->changeItem("",0); } -void listKeys::changeMessage(QString msg, int nb, bool keep) +void listKeys::changeMessage(TQString msg, int nb, bool keep) { statusbarTimer->stop(); if ((nb==0) & (!keep)) @@ -806,10 +806,10 @@ void listKeys::slotShowCreat() } -bool listKeys::eventFilter( QObject *, QEvent *e ) +bool listKeys::eventFilter( TQObject *, TQEvent *e ) { - if ((e->type() == QEvent::Show) && (showTipOfDay)) { - KTipDialog::showTip(this, QString("kgpg/tips"), false); + if ((e->type() == TQEvent::Show) && (showTipOfDay)) { + KTipDialog::showTip(this, TQString("kgpg/tips"), false); showTipOfDay=false; } return FALSE; @@ -818,7 +818,7 @@ bool listKeys::eventFilter( QObject *, QEvent *e ) void listKeys::slotToggleSecret() { - QListViewItem *item=keysList2->firstChild(); + TQListViewItem *item=keysList2->firstChild(); if (!item) return; @@ -828,7 +828,7 @@ void listKeys::slotToggleSecret() void listKeys::slotToggleDisabled() { - QListViewItem *item=keysList2->firstChild(); + TQListViewItem *item=keysList2->firstChild(); if (!item) return; @@ -838,7 +838,7 @@ void listKeys::slotToggleDisabled() void listKeys::slotGotoDefaultKey() { - QListViewItem *myDefaulKey = keysList2->findItem(KGpgSettings::defaultKey(),6); + TQListViewItem *myDefaulKey = keysList2->findItem(KGpgSettings::defaultKey(),6); keysList2->clearSelection(); keysList2->setCurrentItem(myDefaulKey); keysList2->setSelected(myDefaulKey,true); @@ -851,7 +851,7 @@ void listKeys::refreshKeyFromServer() { if (keysList2->currentItem()==NULL) return; - QString keyIDS; + TQString keyIDS; keysList=keysList2->selectedItems(); bool keyDepth=true; for ( uint i = 0; i < keysList.count(); ++i ) @@ -868,7 +868,7 @@ void listKeys::refreshKeyFromServer() kServer=new keyServer(0,"server_dialog",false); kServer->page->kLEimportid->setText(keyIDS); kServer->slotImport(); - connect( kServer, SIGNAL( importFinished(QString) ) , this, SLOT(refreshFinished())); + connect( kServer, TQT_SIGNAL( importFinished(TQString) ) , this, TQT_SLOT(refreshFinished())); } @@ -885,7 +885,7 @@ void listKeys::refreshFinished() void listKeys::slotDelUid() { - QListViewItem *item=keysList2->currentItem(); + TQListViewItem *item=keysList2->currentItem(); while (item->depth()>0) item=item->parent(); @@ -903,16 +903,16 @@ void listKeys::slotDelUid() void listKeys::slotregenerate() { FILE *fp; - QString tst; + TQString tst; char line[300]; - QString cmd="gpg --display-charset=utf-8 --no-secmem-warning --export-secret-key "+keysList2->currentItem()->text(6)+" | gpgsplit --no-split --secret-to-public | gpg --import"; + TQString cmd="gpg --display-charset=utf-8 --no-secmem-warning --export-secret-key "+keysList2->currentItem()->text(6)+" | gpgsplit --no-split --secret-to-public | gpg --import"; - fp = popen(QFile::encodeName(cmd), "r"); + fp = popen(TQFile::encodeName(cmd), "r"); while ( fgets( line, sizeof(line), fp)) { - tst+=QString::fromUtf8(line); + tst+=TQString::fromUtf8(line); } pclose(fp); - QString regID=keysList2->currentItem()->text(6); + TQString regID=keysList2->currentItem()->text(6); keysList2->takeItem(keysList2->currentItem()); keysList2->refreshcurrentkey(regID); } @@ -925,16 +925,16 @@ void listKeys::slotAddUid() addUidWidget->setMainWidget(keyUid); //keyUid->setMinimumSize(keyUid->sizeHint()); keyUid->setMinimumWidth(300); - connect(keyUid->kLineEdit1,SIGNAL(textChanged ( const QString & )),this,SLOT(slotAddUidEnable(const QString & ))); - if (addUidWidget->exec()!=QDialog::Accepted) + connect(keyUid->kLineEdit1,TQT_SIGNAL(textChanged ( const TQString & )),this,TQT_SLOT(slotAddUidEnable(const TQString & ))); + if (addUidWidget->exec()!=TQDialog::Accepted) return; KgpgInterface *addUidProcess=new KgpgInterface(); addUidProcess->KgpgAddUid(keysList2->currentItem()->text(6),keyUid->kLineEdit1->text(),keyUid->kLineEdit2->text(),keyUid->kLineEdit3->text()); - connect(addUidProcess,SIGNAL(addUidFinished()),keysList2,SLOT(refreshselfkey())); - connect(addUidProcess,SIGNAL(addUidError(QString)),this,SLOT(slotGpgError(QString))); + connect(addUidProcess,TQT_SIGNAL(addUidFinished()),keysList2,TQT_SLOT(refreshselfkey())); + connect(addUidProcess,TQT_SIGNAL(addUidError(TQString)),this,TQT_SLOT(slotGpgError(TQString))); } -void listKeys::slotAddUidEnable(const QString & name) +void listKeys::slotAddUidEnable(const TQString & name) { addUidWidget->enableButtonOK(name.length()>4); } @@ -942,23 +942,23 @@ void listKeys::slotAddUidEnable(const QString & name) void listKeys::slotAddPhoto() { - QString mess=i18n("The image must be a JPEG file. Remember that the image is stored within your public key." + TQString mess=i18n("The image must be a JPEG file. Remember that the image is stored within your public key." "If you use a very large picture, your key will become very large as well! Keeping the image " "close to 240x288 is a good size to use."); if (KMessageBox::warningContinueCancel(this,mess)!=KMessageBox::Continue) return; - QString imagePath=KFileDialog::getOpenFileName (QString::null,"image/jpeg",this); + TQString imagePath=KFileDialog::getOpenFileName (TQString::null,"image/jpeg",this); if (imagePath.isEmpty()) return; KgpgInterface *addPhotoProcess=new KgpgInterface(); addPhotoProcess->KgpgAddPhoto(keysList2->currentItem()->text(6),imagePath); - connect(addPhotoProcess,SIGNAL(addPhotoFinished()),this,SLOT(slotUpdatePhoto())); - connect(addPhotoProcess,SIGNAL(addPhotoError(QString)),this,SLOT(slotGpgError(QString))); + connect(addPhotoProcess,TQT_SIGNAL(addPhotoFinished()),this,TQT_SLOT(slotUpdatePhoto())); + connect(addPhotoProcess,TQT_SIGNAL(addPhotoError(TQString)),this,TQT_SLOT(slotGpgError(TQString))); } -void listKeys::slotGpgError(QString errortxt) +void listKeys::slotGpgError(TQString errortxt) { KMessageBox::detailedSorry(this,i18n("Something unexpected happened during the requested operation.\nPlease check details for full log output."),errortxt); } @@ -971,8 +971,8 @@ void listKeys::slotDeletePhoto() KgpgInterface *delPhotoProcess=new KgpgInterface(); delPhotoProcess->KgpgDeletePhoto(keysList2->currentItem()->parent()->text(6),keysList2->currentItem()->text(6)); - connect(delPhotoProcess,SIGNAL(delPhotoFinished()),this,SLOT(slotUpdatePhoto())); - connect(delPhotoProcess,SIGNAL(delPhotoError(QString)),this,SLOT(slotGpgError(QString))); + connect(delPhotoProcess,TQT_SIGNAL(delPhotoFinished()),this,TQT_SLOT(slotUpdatePhoto())); + connect(delPhotoProcess,TQT_SIGNAL(delPhotoError(TQString)),this,TQT_SLOT(slotGpgError(TQString))); } void listKeys::slotUpdatePhoto() @@ -1004,12 +1004,12 @@ void listKeys::slotSetPhotoSize(int size) ///////////////////////////// refresh keys with photo id - QListViewItem *newdef = keysList2->firstChild(); + TQListViewItem *newdef = keysList2->firstChild(); while (newdef) { //if ((keysList2->photoKeysList.find(newdef->text(6))!=-1) && (newdef->childCount ()>0)) if (newdef->childCount ()>0) { bool hasphoto=false; - QListViewItem *newdefChild = newdef->firstChild(); + TQListViewItem *newdefChild = newdef->firstChild(); while (newdefChild) { if (newdefChild->text(0)==i18n("Photo id")) { hasphoto=true; @@ -1030,7 +1030,7 @@ void listKeys::slotSetPhotoSize(int size) void listKeys::findKey() { KFindDialog fd(this,"find_dialog",0,""); - if ( fd.exec() != QDialog::Accepted ) + if ( fd.exec() != TQDialog::Accepted ) return; searchString=fd.pattern(); searchOptions=fd.options(); @@ -1042,10 +1042,10 @@ void listKeys::findFirstKey() if (searchString.isEmpty()) return; bool foundItem=true; - QListViewItem *item=keysList2->firstChild(); + TQListViewItem *item=keysList2->firstChild(); if (!item) return; - QString searchText=item->text(0)+" "+item->text(1)+" "+item->text(6); + TQString searchText=item->text(0)+" "+item->text(1)+" "+item->text(6); // @@ -1081,13 +1081,13 @@ void listKeys::findNextKey() return; } bool foundItem=true; - QListViewItem *item=keysList2->currentItem(); + TQListViewItem *item=keysList2->currentItem(); if (!item) return; while(item->depth() > 0) item = item->parent(); item=item->nextSibling(); - QString searchText=item->text(0)+" "+item->text(1)+" "+item->text(6); + TQString searchText=item->text(0)+" "+item->text(1)+" "+item->text(6); //kdDebug(2100)<<"Next string:"<<searchText<<endl; //kdDebug(2100)<<"Search:"<<searchString<<endl; //kdDebug(2100)<<"OPts:"<<searchOptions<<endl; @@ -1121,8 +1121,8 @@ void listKeys::addToKAB() { KABC::Key key; if (!keysList2->currentItem()) return; - //QString email=extractKeyMail(keysList2->currentItem()).stripWhiteSpace(); - QString email=keysList2->currentItem()->text(1); + //TQString email=extractKeyMail(keysList2->currentItem()).stripWhiteSpace(); + TQString email=keysList2->currentItem()->text(1); KABC::AddressBook *ab = KABC::StdAddressBook::self(); if ( !ab->load() ) { @@ -1134,10 +1134,10 @@ void listKeys::addToKAB() kapp->startServiceByDesktopName( "kaddressbook" ); DCOPRef call( "kaddressbook", "KAddressBookIface" ); if( !addresseeList.isEmpty() ) { - call.send( "showContactEditor(QString)", addresseeList.first().uid() ); + call.send( "showContactEditor(TQString)", addresseeList.first().uid() ); } else { - call.send( "addEmail(QString)", QString (keysList2->currentItem()->text(0))+" <"+email+">" ); + call.send( "addEmail(TQString)", TQString (keysList2->currentItem()->text(0))+" <"+email+">" ); } } @@ -1145,8 +1145,8 @@ void listKeys::addToKAB() void listKeys::allToKAB() { KABC::Key key; - QString email; - QStringList keylist; + TQString email; + TQStringList keylist; KABC::Addressee a; KABC::AddressBook *ab = KABC::StdAddressBook::self(); @@ -1155,7 +1155,7 @@ void listKeys::allToKAB() return; } - QListViewItem * myChild = keysList2->firstChild(); + TQListViewItem * myChild = keysList2->firstChild(); while( myChild ) { //email=extractKeyMail(myChild).stripWhiteSpace(); email=myChild->text(1); @@ -1181,15 +1181,15 @@ void listKeys::allToKAB() void listKeys::slotManpage() { - kapp->startServiceByDesktopName("khelpcenter", QString("man:/gpg"), 0, 0, 0, "", true); + kapp->startServiceByDesktopName("khelpcenter", TQString("man:/gpg"), 0, 0, 0, "", true); } void listKeys::slotTip() { - KTipDialog::showTip(this, QString("kgpg/tips"), true); + KTipDialog::showTip(this, TQString("kgpg/tips"), true); } -void listKeys::closeEvent ( QCloseEvent * e ) +void listKeys::closeEvent ( TQCloseEvent * e ) { //kapp->ref(); // prevent KMainWindow from closing the app //KMainWindow::closeEvent( e ); @@ -1201,7 +1201,7 @@ void listKeys::closeEvent ( QCloseEvent * e ) void listKeys::showKeyServer() { keyServer *ks=new keyServer(this); - connect(ks,SIGNAL( importFinished(QString) ) , keysList2, SLOT(refreshcurrentkey(QString))); + connect(ks,TQT_SIGNAL( importFinished(TQString) ) , keysList2, TQT_SLOT(refreshcurrentkey(TQString))); ks->exec(); if (ks) delete ks; @@ -1211,7 +1211,7 @@ void listKeys::showKeyServer() void listKeys::checkList() { - QPtrList<QListViewItem> exportList=keysList2->selectedItems(); + TQPtrList<TQListViewItem> exportList=keysList2->selectedItems(); if (exportList.count()>1) { stateChanged("multi_selected"); @@ -1271,7 +1271,7 @@ void listKeys::readOptions() clipboardMode=QClipboard::Selection; /////// re-read groups in case the config file location was changed - QStringList groups=KgpgInterface::getGpgGroupNames(KGpgSettings::gpgConfigPath()); + TQStringList groups=KgpgInterface::getGpgGroupNames(KGpgSettings::gpgConfigPath()); KGpgSettings::setGroups(groups.join(",")); keysList2->groupNb=groups.count(); if (keyStatusBar) @@ -1286,12 +1286,12 @@ void listKeys::showOptions() if (KConfigDialog::showDialog("settings")) return; kgpgOptions *optionsDialog=new kgpgOptions(this,"settings"); - connect(optionsDialog,SIGNAL(settingsUpdated()),this,SLOT(readAllOptions())); - connect(optionsDialog,SIGNAL(homeChanged()),this,SLOT(refreshkey())); - connect(optionsDialog,SIGNAL(reloadKeyList()),this,SLOT(refreshkey())); - connect(optionsDialog,SIGNAL(refreshTrust(int,QColor)),keysList2,SLOT(refreshTrust(int,QColor))); - connect(optionsDialog,SIGNAL(changeFont(QFont)),this,SIGNAL(fontChanged(QFont))); - connect(optionsDialog,SIGNAL(installShredder()),this,SIGNAL(installShredder())); + connect(optionsDialog,TQT_SIGNAL(settingsUpdated()),this,TQT_SLOT(readAllOptions())); + connect(optionsDialog,TQT_SIGNAL(homeChanged()),this,TQT_SLOT(refreshkey())); + connect(optionsDialog,TQT_SIGNAL(reloadKeyList()),this,TQT_SLOT(refreshkey())); + connect(optionsDialog,TQT_SIGNAL(refreshTrust(int,TQColor)),keysList2,TQT_SLOT(refreshTrust(int,TQColor))); + connect(optionsDialog,TQT_SIGNAL(changeFont(TQFont)),this,TQT_SIGNAL(fontChanged(TQFont))); + connect(optionsDialog,TQT_SIGNAL(installShredder()),this,TQT_SIGNAL(installShredder())); optionsDialog->exec(); delete optionsDialog; } @@ -1307,14 +1307,14 @@ void listKeys::slotSetDefKey() slotSetDefaultKey(keysList2->currentItem()); } -void listKeys::slotSetDefaultKey(QString newID) +void listKeys::slotSetDefaultKey(TQString newID) { - QListViewItem *newdef = keysList2->findItem(newID,6); + TQListViewItem *newdef = keysList2->findItem(newID,6); if (newdef) slotSetDefaultKey(newdef); } -void listKeys::slotSetDefaultKey(QListViewItem *newdef) +void listKeys::slotSetDefaultKey(TQListViewItem *newdef) { //kdDebug(2100)<<"------------------start ------------"<<endl; if ((!newdef) || (newdef->pixmap(2)==NULL)) @@ -1328,7 +1328,7 @@ void listKeys::slotSetDefaultKey(QListViewItem *newdef) return; } - QListViewItem *olddef = keysList2->findItem(KGpgSettings::defaultKey(),6); + TQListViewItem *olddef = keysList2->findItem(KGpgSettings::defaultKey(),6); KGpgSettings::setDefaultKey(newdef->text(6)); KGpgSettings::writeConfig(); @@ -1340,12 +1340,12 @@ void listKeys::slotSetDefaultKey(QListViewItem *newdef) -void listKeys::slotmenu(QListViewItem *sel, const QPoint &pos, int ) +void listKeys::slotmenu(TQListViewItem *sel, const TQPoint &pos, int ) { //////////// popup a different menu depending on which key is selected if (sel!=NULL) { if (keysList2->selectedItems().count()>1) { - QPtrList<QListViewItem> exportList=keysList2->selectedItems(); + TQPtrList<TQListViewItem> exportList=keysList2->selectedItems(); bool keyDepth=true; for ( uint i = 0; i < exportList.count(); ++i ) if ( exportList.at(i) ) @@ -1398,7 +1398,7 @@ void listKeys::slotmenu(QListViewItem *sel, const QPoint &pos, int ) -void listKeys::slotrevoke(QString keyID,QString revokeUrl,int reason,QString description) +void listKeys::slotrevoke(TQString keyID,TQString revokeUrl,int reason,TQString description) { revKeyProcess=new KgpgInterface(); revKeyProcess->KgpgRevokeKey(keyID,revokeUrl,reason,description); @@ -1412,69 +1412,69 @@ void listKeys::revokeWidget() KgpgRevokeWidget *keyRevoke=new KgpgRevokeWidget(); keyRevoke->keyID->setText(keysList2->currentItem()->text(0)+" ("+keysList2->currentItem()->text(1)+") "+i18n("ID: ")+keysList2->currentItem()->text(6)); - keyRevoke->kURLRequester1->setURL(QDir::homeDirPath()+"/"+keysList2->currentItem()->text(1).section('@',0,0)+".revoke"); + keyRevoke->kURLRequester1->setURL(TQDir::homeDirPath()+"/"+keysList2->currentItem()->text(1).section('@',0,0)+".revoke"); keyRevoke->kURLRequester1->setMode(KFile::File); keyRevoke->setMinimumSize(keyRevoke->sizeHint()); keyRevoke->show(); keyRevokeWidget->setMainWidget(keyRevoke); - if (keyRevokeWidget->exec()!=QDialog::Accepted) + if (keyRevokeWidget->exec()!=TQDialog::Accepted) return; if (keyRevoke->cbSave->isChecked()) { slotrevoke(keysList2->currentItem()->text(6),keyRevoke->kURLRequester1->url(),keyRevoke->comboBox1->currentItem(),keyRevoke->textDescription->text()); if (keyRevoke->cbPrint->isChecked()) - connect(revKeyProcess,SIGNAL(revokeurl(QString)),this,SLOT(doFilePrint(QString))); + connect(revKeyProcess,TQT_SIGNAL(revokeurl(TQString)),this,TQT_SLOT(doFilePrint(TQString))); if (keyRevoke->cbImport->isChecked()) - connect(revKeyProcess,SIGNAL(revokeurl(QString)),this,SLOT(slotImportRevoke(QString))); + connect(revKeyProcess,TQT_SIGNAL(revokeurl(TQString)),this,TQT_SLOT(slotImportRevoke(TQString))); } else { - slotrevoke(keysList2->currentItem()->text(6),QString::null,keyRevoke->comboBox1->currentItem(),keyRevoke->textDescription->text()); + slotrevoke(keysList2->currentItem()->text(6),TQString::null,keyRevoke->comboBox1->currentItem(),keyRevoke->textDescription->text()); if (keyRevoke->cbPrint->isChecked()) - connect(revKeyProcess,SIGNAL(revokecertificate(QString)),this,SLOT(doPrint(QString))); + connect(revKeyProcess,TQT_SIGNAL(revokecertificate(TQString)),this,TQT_SLOT(doPrint(TQString))); if (keyRevoke->cbImport->isChecked()) - connect(revKeyProcess,SIGNAL(revokecertificate(QString)),this,SLOT(slotImportRevokeTxt(QString))); + connect(revKeyProcess,TQT_SIGNAL(revokecertificate(TQString)),this,TQT_SLOT(slotImportRevokeTxt(TQString))); } } -void listKeys::slotImportRevoke(QString url) +void listKeys::slotImportRevoke(TQString url) { KgpgInterface *importKeyProcess=new KgpgInterface(); importKeyProcess->importKeyURL(KURL::fromPathOrURL( url )); - connect(importKeyProcess,SIGNAL(importfinished(QStringList)),keysList2,SLOT(refreshselfkey())); + connect(importKeyProcess,TQT_SIGNAL(importfinished(TQStringList)),keysList2,TQT_SLOT(refreshselfkey())); } -void listKeys::slotImportRevokeTxt(QString revokeText) +void listKeys::slotImportRevokeTxt(TQString revokeText) { KgpgInterface *importKeyProcess=new KgpgInterface(); importKeyProcess->importKey(revokeText); - connect(importKeyProcess,SIGNAL(importfinished(QStringList)),keysList2,SLOT(refreshselfkey())); + connect(importKeyProcess,TQT_SIGNAL(importfinished(TQStringList)),keysList2,TQT_SLOT(refreshselfkey())); } void listKeys::slotexportsec() { ////////////////////// export secret key - QString warn=i18n("Secret keys SHOULD NOT be saved in an unsafe place.\n" + TQString warn=i18n("Secret keys SHOULD NOT be saved in an unsafe place.\n" "If someone else can access this file, encryption with this key will be compromised!\nContinue key export?"); int result=KMessageBox::questionYesNo(this,warn,i18n("Warning"), i18n("Export"), i18n("Do Not Export")); if (result!=KMessageBox::Yes) return; - QString sname=keysList2->currentItem()->text(1).section('@',0,0); + TQString sname=keysList2->currentItem()->text(1).section('@',0,0); sname=sname.section('.',0,0); if (sname.isEmpty()) sname=keysList2->currentItem()->text(0).section(' ',0,0); sname.append(".asc"); - sname.prepend(QDir::homeDirPath()+"/"); + sname.prepend(TQDir::homeDirPath()+"/"); KURL url=KFileDialog::getSaveURL(sname,"*.asc|*.asc Files", this, i18n("Export PRIVATE KEY As")); if(!url.isEmpty()) { - QFile fgpg(url.path()); + TQFile fgpg(url.path()); if (fgpg.exists()) fgpg.remove(); - KProcIO *p=new KProcIO(QTextCodec::codecForLocale()); - *p<<"gpg"<<"--no-tty"<<"--output"<<QFile::encodeName(url.path())<<"--armor"<<"--export-secret-keys"<<keysList2->currentItem()->text(6); + KProcIO *p=new KProcIO(TQTextCodec::codecForLocale()); + *p<<"gpg"<<"--no-tty"<<"--output"<<TQFile::encodeName(url.path())<<"--armor"<<"--export-secret-keys"<<keysList2->currentItem()->text(6); p->start(KProcess::Block); if (fgpg.exists()) @@ -1495,11 +1495,11 @@ void listKeys::slotexport() return; - QPtrList<QListViewItem> exportList=keysList2->selectedItems(); + TQPtrList<TQListViewItem> exportList=keysList2->selectedItems(); if (exportList.count()==0) return; - QString sname; + TQString sname; if (exportList.count()==1) { sname=keysList2->currentItem()->text(1).section('@',0,0); @@ -1509,7 +1509,7 @@ void listKeys::slotexport() } else sname="keyring"; sname.append(".asc"); - sname.prepend(QDir::homeDirPath()+"/"); + sname.prepend(TQDir::homeDirPath()+"/"); KDialogBase *dial=new KDialogBase( KDialogBase::Swallow, i18n("Public Key Export"), KDialogBase::Ok | KDialogBase::Cancel, KDialogBase::Ok, this, "key_export",true); @@ -1520,29 +1520,29 @@ void listKeys::slotexport() page->newFilename->setMode(KFile::File); page->show(); - if (dial->exec()==QDialog::Accepted) { + if (dial->exec()==TQDialog::Accepted) { ////////////////////////// export to file - QString expname; + TQString expname; bool exportAttr=page->exportAttributes->isChecked(); if (page->checkServer->isChecked()) { keyServer *expServer=new keyServer(0,"server_export",false); expServer->page->exportAttributes->setChecked(exportAttr); - QStringList exportKeysList; + TQStringList exportKeysList; for ( uint i = 0; i < exportList.count(); ++i ) if ( exportList.at(i) ) exportKeysList << exportList.at(i)->text(6).stripWhiteSpace(); expServer->slotExport(exportKeysList); return; } - KProcIO *p=new KProcIO(QTextCodec::codecForLocale()); + KProcIO *p=new KProcIO(TQTextCodec::codecForLocale()); *p<<"gpg"<<"--no-tty"; if (page->checkFile->isChecked()) { expname=page->newFilename->url().stripWhiteSpace(); if (!expname.isEmpty()) { - QFile fgpg(expname); + TQFile fgpg(expname); if (fgpg.exists()) fgpg.remove(); - *p<<"--output"<<QFile::encodeName(expname)<<"--export"<<"--armor"; + *p<<"--output"<<TQFile::encodeName(expname)<<"--export"<<"--armor"; if (!exportAttr) *p<<"--export-options"<<"no-include-attributes"; @@ -1559,7 +1559,7 @@ void listKeys::slotexport() } } else { - QStringList klist; + TQStringList klist; for ( uint i = 0; i < exportList.count(); ++i ) if ( exportList.at(i) ) @@ -1567,13 +1567,13 @@ void listKeys::slotexport() KgpgInterface *kexp=new KgpgInterface(); - QString result=kexp->getKey(klist,exportAttr); + TQString result=kexp->getKey(klist,exportAttr); if (page->checkClipboard->isChecked()) slotProcessExportClip(result); - //connect(kexp,SIGNAL(publicKeyString(QString)),this,SLOT(slotProcessExportClip(QString))); + //connect(kexp,TQT_SIGNAL(publicKeyString(TQString)),this,TQT_SLOT(slotProcessExportClip(TQString))); else slotProcessExportMail(result); - //connect(kexp,SIGNAL(publicKeyString(QString)),this,SLOT(slotProcessExportMail(QString))); + //connect(kexp,TQT_SIGNAL(publicKeyString(TQString)),this,TQT_SLOT(slotProcessExportMail(TQString))); } } @@ -1582,22 +1582,22 @@ void listKeys::slotexport() -void listKeys::slotProcessExportMail(QString keys) +void listKeys::slotProcessExportMail(TQString keys) { /// start default Mail application - kapp->invokeMailer(QString::null, QString::null, QString::null, QString::null, + kapp->invokeMailer(TQString::null, TQString::null, TQString::null, TQString::null, keys, //body - QString::null, - QString::null); // attachments + TQString::null, + TQString::null); // attachments } -void listKeys::slotProcessExportClip(QString keys) +void listKeys::slotProcessExportClip(TQString keys) { kapp->clipboard()->setText(keys,clipboardMode); } -void listKeys::showKeyInfo(QString keyID) +void listKeys::showKeyInfo(TQString keyID) { KgpgKeyInfo *opts=new KgpgKeyInfo(this,"key_props",keyID); opts->show(); @@ -1609,8 +1609,8 @@ void listKeys::slotShowPhoto() KTrader::OfferList offers = KTrader::self()->query("image/jpeg", "Type == 'Application'"); KService::Ptr ptr = offers.first(); //KMessageBox::sorry(0,ptr->desktopEntryName()); - KProcIO *p=new KProcIO(QTextCodec::codecForLocale()); - *p<<"gpg"<<"--no-tty"<<"--photo-viewer"<<QFile::encodeName(ptr->desktopEntryName()+" %i")<<"--edit-key"<<keysList2->currentItem()->parent()->text(6)<<"uid"<<keysList2->currentItem()->text(6)<<"showphoto"<<"quit"; + KProcIO *p=new KProcIO(TQTextCodec::codecForLocale()); + *p<<"gpg"<<"--no-tty"<<"--photo-viewer"<<TQFile::encodeName(ptr->desktopEntryName()+" %i")<<"--edit-key"<<keysList2->currentItem()->parent()->text(6)<<"uid"<<keysList2->currentItem()->text(6)<<"showphoto"<<"quit"; p->start(KProcess::DontCare,true); } @@ -1629,16 +1629,16 @@ void listKeys::listsigns() if (keysList2->currentItem()->pixmap(0)->serialNumber()==keysList2->pixkeyOrphan.serialNumber()) { if (KMessageBox::questionYesNo(this,i18n("This key is an orphaned secret key (secret key without public key.) It is currently not usable.\n\n" - "Would you like to regenerate the public key?"), QString::null, i18n("Generate"), i18n("Do Not Generate"))==KMessageBox::Yes) + "Would you like to regenerate the public key?"), TQString::null, i18n("Generate"), i18n("Do Not Generate"))==KMessageBox::Yes) slotregenerate(); return; } ///////////// open a key info dialog (KgpgKeyInfo, see begining of this file) - QString key=keysList2->currentItem()->text(6); + TQString key=keysList2->currentItem()->text(6); if (!key.isEmpty()) { KgpgKeyInfo *opts=new KgpgKeyInfo(this,"key_props",key); - connect(opts,SIGNAL(keyNeedsRefresh()),keysList2,SLOT(refreshselfkey())); + connect(opts,TQT_SIGNAL(keyNeedsRefresh()),keysList2,TQT_SLOT(refreshselfkey())); opts->exec(); } else editGroup(); @@ -1646,7 +1646,7 @@ void listKeys::listsigns() void listKeys::groupAdd() { - QPtrList<QListViewItem> addList=gEdit->availableKeys->selectedItems(); + TQPtrList<TQListViewItem> addList=gEdit->availableKeys->selectedItems(); for ( uint i = 0; i < addList.count(); ++i ) if ( addList.at(i) ) { gEdit->groupKeys->insertItem(addList.at(i)); @@ -1655,7 +1655,7 @@ void listKeys::groupAdd() void listKeys::groupRemove() { - QPtrList<QListViewItem> remList=gEdit->groupKeys->selectedItems(); + TQPtrList<TQListViewItem> remList=gEdit->groupKeys->selectedItems(); for ( uint i = 0; i < remList.count(); ++i ) if ( remList.at(i) ) { gEdit->availableKeys->insertItem(remList.at(i)); @@ -1671,14 +1671,14 @@ void listKeys::deleteGroup() if (result!=KMessageBox::Continue) return; KgpgInterface::delGpgGroup(keysList2->currentItem()->text(0), KGpgSettings::gpgConfigPath()); - QListViewItem *item=keysList2->currentItem()->nextSibling(); + TQListViewItem *item=keysList2->currentItem()->nextSibling(); delete keysList2->currentItem(); if (!item) item=keysList2->lastChild(); keysList2->setCurrentItem(item); keysList2->setSelected(item,true); - QStringList groups=KgpgInterface::getGpgGroupNames(KGpgSettings::gpgConfigPath()); + TQStringList groups=KgpgInterface::getGpgGroupNames(KGpgSettings::gpgConfigPath()); KGpgSettings::setGroups(groups.join(",")); keysList2->groupNb=groups.count(); changeMessage(i18n("%1 Keys, %2 Groups").arg(keysList2->childCount()-keysList2->groupNb).arg(keysList2->groupNb),1); @@ -1686,8 +1686,8 @@ void listKeys::deleteGroup() void listKeys::groupChange() { - QStringList selected; - QListViewItem *item=gEdit->groupKeys->firstChild(); + TQStringList selected; + TQListViewItem *item=gEdit->groupKeys->firstChild(); while (item) { selected+=item->text(2); item=item->nextSibling(); @@ -1697,10 +1697,10 @@ void listKeys::groupChange() void listKeys::createNewGroup() { - QStringList badkeys,keysGroup; + TQStringList badkeys,keysGroup; if (keysList2->selectedItems().count()>0) { - QPtrList<QListViewItem> groupList=keysList2->selectedItems(); + TQPtrList<TQListViewItem> groupList=keysList2->selectedItems(); bool keyDepth=true; for ( uint i = 0; i < groupList.count(); ++i ) if ( groupList.at(i) ) { @@ -1720,17 +1720,17 @@ void listKeys::createNewGroup() KMessageBox::sorry(this,i18n("<qt>You cannot create a group containing signatures, subkeys or other groups.</qt>")); return; } - QString groupName=KInputDialog::getText(i18n("Create New Group"),i18n("Enter new group name:"),QString::null,0,this); + TQString groupName=KInputDialog::getText(i18n("Create New Group"),i18n("Enter new group name:"),TQString::null,0,this); if (groupName.isEmpty()) return; if (!keysGroup.isEmpty()) { if (!badkeys.isEmpty()) KMessageBox::informationList(this,i18n("Following keys are not valid or not trusted and will not be added to the group:"),badkeys); KgpgInterface::setGpgGroupSetting(groupName,keysGroup,KGpgSettings::gpgConfigPath()); - QStringList groups=KgpgInterface::getGpgGroupNames(KGpgSettings::gpgConfigPath()); + TQStringList groups=KgpgInterface::getGpgGroupNames(KGpgSettings::gpgConfigPath()); KGpgSettings::setGroups(groups.join(",")); keysList2->refreshgroups(); - QListViewItem *newgrp = keysList2->findItem(groupName,0); + TQListViewItem *newgrp = keysList2->findItem(groupName,0); keysList2->clearSelection(); keysList2->setCurrentItem(newgrp); @@ -1743,19 +1743,19 @@ void listKeys::createNewGroup() } } -void listKeys::groupInit(QStringList keysGroup) +void listKeys::groupInit(TQStringList keysGroup) { kdDebug(2100)<<"preparing group"<<endl; - QStringList lostKeys; + TQStringList lostKeys; bool foundId; - for ( QStringList::Iterator it = keysGroup.begin(); it != keysGroup.end(); ++it ) { + for ( TQStringList::Iterator it = keysGroup.begin(); it != keysGroup.end(); ++it ) { - QListViewItem *item=gEdit->availableKeys->firstChild(); + TQListViewItem *item=gEdit->availableKeys->firstChild(); foundId=false; while (item) { kdDebug(2100)<<"Searching in key: "<<item->text(0)<<endl; - if (QString(*it).right(8).lower()==item->text(2).right(8).lower()) { + if (TQString(*it).right(8).lower()==item->text(2).right(8).lower()) { gEdit->groupKeys->insertItem(item); foundId=true; break; @@ -1763,7 +1763,7 @@ void listKeys::groupInit(QStringList keysGroup) item=item->nextSibling(); } if (!foundId) - lostKeys+=QString(*it); + lostKeys+=TQString(*it); } if (!lostKeys.isEmpty()) KMessageBox::informationList(this,i18n("Following keys are in the group but are not valid or not in your keyring. They will be removed from the group."),lostKeys); @@ -1773,7 +1773,7 @@ void listKeys::editGroup() { if (!keysList2->currentItem() || !keysList2->currentItem()->text(6).isEmpty()) return; - QStringList keysGroup; + TQStringList keysGroup; //KDialogBase *dialogGroupEdit=new KDialogBase( this, "edit_group", true,i18n("Group Properties"),KDialogBase::Ok | KDialogBase::Cancel); KDialogBase *dialogGroupEdit=new KDialogBase(KDialogBase::Swallow, i18n("Group Properties"), KDialogBase::Ok | KDialogBase::Cancel,KDialogBase::Ok,this,0,true); @@ -1781,12 +1781,12 @@ void listKeys::editGroup() gEdit->buttonAdd->setPixmap(KGlobal::iconLoader()->loadIcon("down",KIcon::Small,20)); gEdit->buttonRemove->setPixmap(KGlobal::iconLoader()->loadIcon("up",KIcon::Small,20)); - connect(gEdit->buttonAdd,SIGNAL(clicked()),this,SLOT(groupAdd())); - connect(gEdit->buttonRemove,SIGNAL(clicked()),this,SLOT(groupRemove())); - // connect(dialogGroupEdit->okClicked(),SIGNAL(clicked()),this,SLOT(groupChange())); - connect(gEdit->availableKeys,SIGNAL(doubleClicked (QListViewItem *, const QPoint &, int)),this,SLOT(groupAdd())); - connect(gEdit->groupKeys,SIGNAL(doubleClicked (QListViewItem *, const QPoint &, int)),this,SLOT(groupRemove())); - QListViewItem *item=keysList2->firstChild(); + connect(gEdit->buttonAdd,TQT_SIGNAL(clicked()),this,TQT_SLOT(groupAdd())); + connect(gEdit->buttonRemove,TQT_SIGNAL(clicked()),this,TQT_SLOT(groupRemove())); + // connect(dialogGroupEdit->okClicked(),TQT_SIGNAL(clicked()),this,TQT_SLOT(groupChange())); + connect(gEdit->availableKeys,TQT_SIGNAL(doubleClicked (TQListViewItem *, const TQPoint &, int)),this,TQT_SLOT(groupAdd())); + connect(gEdit->groupKeys,TQT_SIGNAL(doubleClicked (TQListViewItem *, const TQPoint &, int)),this,TQT_SLOT(groupRemove())); + TQListViewItem *item=keysList2->firstChild(); if (item==NULL) return; if (item->pixmap(2)) { @@ -1806,20 +1806,20 @@ void listKeys::editGroup() gEdit->availableKeys->setColumnWidth(0,200); gEdit->availableKeys->setColumnWidth(1,200); gEdit->availableKeys->setColumnWidth(2,100); - gEdit->availableKeys->setColumnWidthMode(0,QListView::Manual); - gEdit->availableKeys->setColumnWidthMode(1,QListView::Manual); - gEdit->availableKeys->setColumnWidthMode(2,QListView::Manual); + gEdit->availableKeys->setColumnWidthMode(0,TQListView::Manual); + gEdit->availableKeys->setColumnWidthMode(1,TQListView::Manual); + gEdit->availableKeys->setColumnWidthMode(2,TQListView::Manual); gEdit->groupKeys->setColumnWidth(0,200); gEdit->groupKeys->setColumnWidth(1,200); gEdit->groupKeys->setColumnWidth(2,100); - gEdit->groupKeys->setColumnWidthMode(0,QListView::Manual); - gEdit->groupKeys->setColumnWidthMode(1,QListView::Manual); - gEdit->groupKeys->setColumnWidthMode(2,QListView::Manual); + gEdit->groupKeys->setColumnWidthMode(0,TQListView::Manual); + gEdit->groupKeys->setColumnWidthMode(1,TQListView::Manual); + gEdit->groupKeys->setColumnWidthMode(2,TQListView::Manual); gEdit->setMinimumSize(gEdit->sizeHint()); gEdit->show(); - if (dialogGroupEdit->exec()==QDialog::Accepted) + if (dialogGroupEdit->exec()==TQDialog::Accepted) groupChange(); delete dialogGroupEdit; } @@ -1847,11 +1847,11 @@ void listKeys::signkey() if (signList.count()==1) { FILE *pass; char line[200]=""; - QString opt,fingervalue; - QString gpgcmd="gpg --no-tty --no-secmem-warning --with-colons --fingerprint "+KShellProcess::quote(keysList2->currentItem()->text(6)); - pass=popen(QFile::encodeName(gpgcmd),"r"); + TQString opt,fingervalue; + TQString gpgcmd="gpg --no-tty --no-secmem-warning --with-colons --fingerprint "+KShellProcess::quote(keysList2->currentItem()->text(6)); + pass=popen(TQFile::encodeName(gpgcmd),"r"); while ( fgets( line, sizeof(line), pass)) { - opt=QString::fromUtf8(line); + opt=TQString::fromUtf8(line); if (opt.startsWith("fpr")) { fingervalue=opt.section(':',9,9); // format fingervalue in 4-digit groups @@ -1870,7 +1870,7 @@ void listKeys::signkey() return; } else { - QStringList signKeyList; + TQStringList signKeyList; for ( uint i = 0; i < signList.count(); ++i ) if ( signList.at(i) ) signKeyList+=signList.at(i)->text(0)+" ("+signList.at(i)->text(1)+")"+": "+signList.at(i)->text(6); @@ -1882,35 +1882,35 @@ void listKeys::signkey() ////////////////// open a secret key selection dialog (KgpgSelKey, see begining of this file) KgpgSelKey *opts=new KgpgSelKey(this); - QLabel *signCheck = new QLabel("<qt>"+i18n("How carefully have you checked that the key really " + TQLabel *signCheck = new TQLabel("<qt>"+i18n("How carefully have you checked that the key really " "belongs to the person with whom you wish to communicate:", "How carefully have you checked that the %n keys really " "belong to the people with whom you wish to communicate:",signList.count()),opts->page); opts->vbox->addWidget(signCheck); - QComboBox *signTrust=new QComboBox(opts->page); + TQComboBox *signTrust=new TQComboBox(opts->page); signTrust->insertItem(i18n("I Will Not Answer")); signTrust->insertItem(i18n("I Have Not Checked at All")); signTrust->insertItem(i18n("I Have Done Casual Checking")); signTrust->insertItem(i18n("I Have Done Very Careful Checking")); opts->vbox->addWidget(signTrust); - QCheckBox *localSign = new QCheckBox(i18n("Local signature (cannot be exported)"),opts->page); + TQCheckBox *localSign = new TQCheckBox(i18n("Local signature (cannot be exported)"),opts->page); opts->vbox->addWidget(localSign); - QCheckBox *terminalSign = new QCheckBox(i18n("Do not sign all user id's (open terminal)"),opts->page); + TQCheckBox *terminalSign = new TQCheckBox(i18n("Do not sign all user id's (open terminal)"),opts->page); opts->vbox->addWidget(terminalSign); if (signList.count()!=1) terminalSign->setEnabled(false); opts->setMinimumHeight(300); - if (opts->exec()!=QDialog::Accepted) { + if (opts->exec()!=TQDialog::Accepted) { delete opts; return; } - globalkeyID=QString(opts->getkeyID()); - globalkeyMail=QString(opts->getkeyMail()); + globalkeyID=TQString(opts->getkeyID()); + globalkeyMail=TQString(opts->getkeyMail()); globalisLocal=localSign->isChecked(); globalChecked=signTrust->currentItem(); keyCount=0; @@ -1946,7 +1946,7 @@ void listKeys::signLoop() kdDebug(2100)<<"Sign process for key: "<<keyCount<<" on a total of "<<signList.count()<<endl; if ( signList.at(keyCount) ) { KgpgInterface *signKeyProcess=new KgpgInterface(); - QObject::connect(signKeyProcess,SIGNAL(signatureFinished(int)),this,SLOT(signatureResult(int))); + TQObject::connect(signKeyProcess,TQT_SIGNAL(signatureFinished(int)),this,TQT_SLOT(signatureResult(int))); signKeyProcess->KgpgSignKey(signList.at(keyCount)->text(6),globalkeyID,globalkeyMail,globalisLocal,globalChecked); } } @@ -1973,8 +1973,8 @@ void listKeys::importallsignkey() keysList2->currentItem()->setOpen(true); keysList2->currentItem()->setOpen(false); } - QString missingKeysList; - QListViewItem *current = keysList2->currentItem()->firstChild(); + TQString missingKeysList; + TQListViewItem *current = keysList2->currentItem()->firstChild(); while (current) { if ((current->text(0).startsWith("[")) && (current->text(0).endsWith("]"))) ////// ugly hack to detect unknown keys missingKeysList+=current->text(6)+" "; @@ -1995,7 +1995,7 @@ void listKeys::preimportsignkey() importsignkey(keysList2->currentItem()->text(6)); } -bool listKeys::importRemoteKey(QString keyID) +bool listKeys::importRemoteKey(TQString keyID) { kServer=new keyServer(0,"server_dialog",false,true); @@ -2004,7 +2004,7 @@ bool listKeys::importRemoteKey(QString keyID) kServer->page->tabWidget2->setTabEnabled(kServer->page->tabWidget2->page(1),false); kServer->show(); kServer->raise(); - connect( kServer, SIGNAL( importFinished(QString) ) , this, SLOT( dcopImportFinished())); + connect( kServer, TQT_SIGNAL( importFinished(TQString) ) , this, TQT_SLOT( dcopImportFinished())); return true; } @@ -2015,14 +2015,14 @@ void listKeys::dcopImportFinished() { if (kServer) kServer=0L; - QByteArray params; - QDataStream stream(params, IO_WriteOnly); + TQByteArray params; + TQDataStream stream(params, IO_WriteOnly); stream << true; kapp->dcopClient()->emitDCOPSignal("keyImported(bool)", params); refreshkey(); } -void listKeys::importsignkey(QString importKeyId) +void listKeys::importsignkey(TQString importKeyId) { /////////////// sign a key kServer=new keyServer(0,"server_dialog",false); @@ -2030,7 +2030,7 @@ void listKeys::importsignkey(QString importKeyId) //kServer->Buttonimport->setDefault(true); kServer->slotImport(); //kServer->show(); - connect( kServer, SIGNAL( importFinished(QString) ) , this, SLOT( importfinished())); + connect( kServer, TQT_SIGNAL( importFinished(TQString) ) , this, TQT_SLOT( importfinished())); } @@ -2052,7 +2052,7 @@ void listKeys::delsignkey() return; } - QString signID,parentKey,signMail,parentMail; + TQString signID,parentKey,signMail,parentMail; ////////////////// open a key selection dialog (KgpgSelKey, see begining of this file) parentKey=keysList2->currentItem()->parent()->text(6); @@ -2064,19 +2064,19 @@ void listKeys::delsignkey() KMessageBox::sorry(this,i18n("Edit key manually to delete a self-signature.")); return; } - QString ask=i18n("<qt>Are you sure you want to delete signature<br><b>%1</b> from key:<br><b>%2</b>?</qt>").arg(signMail).arg(parentMail); + TQString ask=i18n("<qt>Are you sure you want to delete signature<br><b>%1</b> from key:<br><b>%2</b>?</qt>").arg(signMail).arg(parentMail); - if (KMessageBox::questionYesNo(this,ask,QString::null,KStdGuiItem::del(),KStdGuiItem::cancel())!=KMessageBox::Yes) + if (KMessageBox::questionYesNo(this,ask,TQString::null,KStdGuiItem::del(),KStdGuiItem::cancel())!=KMessageBox::Yes) return; KgpgInterface *delSignKeyProcess=new KgpgInterface(); delSignKeyProcess->KgpgDelSignature(parentKey,signID); - connect(delSignKeyProcess,SIGNAL(delsigfinished(bool)),this,SLOT(delsignatureResult(bool))); + connect(delSignKeyProcess,TQT_SIGNAL(delsigfinished(bool)),this,TQT_SLOT(delsignatureResult(bool))); } void listKeys::delsignatureResult(bool success) { if (success) { - QListViewItem *top=keysList2->currentItem(); + TQListViewItem *top=keysList2->currentItem(); while (top->depth()!=0) top=top->parent(); while (top->firstChild()!=0) @@ -2116,26 +2116,26 @@ void listKeys::slotgenkey() { ////////// generate key keyGenerate *genkey=new keyGenerate(this,0); - if (genkey->exec()==QDialog::Accepted) { + if (genkey->exec()==TQDialog::Accepted) { if (!genkey->getmode()) /// normal mode { //// extract data - QString ktype=genkey->getkeytype(); - QString ksize=genkey->getkeysize(); + TQString ktype=genkey->getkeytype(); + TQString ksize=genkey->getkeysize(); int kexp=genkey->getkeyexp(); - QString knumb=genkey->getkeynumb(); + TQString knumb=genkey->getkeynumb(); newKeyName=genkey->getkeyname(); newKeyMail=genkey->getkeymail(); - QString kcomment=genkey->getkeycomm(); + TQString kcomment=genkey->getkeycomm(); delete genkey; //genkey->delayedDestruct(); - QCString password; + TQCString password; bool goodpass=false; while (!goodpass) { int code=KPasswordDialog::getNewPassword(password,i18n("<b>Enter passphrase for %1</b>:<br>Passphrase should include non alphanumeric characters and random sequences").arg(newKeyName+" <"+newKeyMail+">")); - if (code!=QDialog::Accepted) + if (code!=TQDialog::Accepted) return; if (password.length()<5) KMessageBox::sorry(this,i18n("This passphrase is not secure enough.\nMinimum length= 5 characters")); @@ -2143,20 +2143,20 @@ void listKeys::slotgenkey() goodpass=true; } - pop = new KPassivePopup((QWidget *)parent(),"new_key"); + pop = new KPassivePopup((TQWidget *)parent(),"new_key"); pop->setTimeout(0); - QWidget *wid=new QWidget(pop); - QVBoxLayout *vbox=new QVBoxLayout(wid,3); + TQWidget *wid=new TQWidget(pop); + TQVBoxLayout *vbox=new TQVBoxLayout(wid,3); - QVBox *passiveBox=pop->standardView(i18n("Generating new key pair."),QString::null,KGlobal::iconLoader()->loadIcon("kgpg",KIcon::Desktop),wid); + TQVBox *passiveBox=pop->standardView(i18n("Generating new key pair."),TQString::null,KGlobal::iconLoader()->loadIcon("kgpg",KIcon::Desktop),wid); - QMovie anim; - anim=QMovie(locate("appdata", "pics/kgpg_anim.gif")); + TQMovie anim; + anim=TQMovie(locate("appdata", "pics/kgpg_anim.gif")); - QLabel *tex=new QLabel(wid); - QLabel *tex2=new QLabel(wid); + TQLabel *tex=new TQLabel(wid); + TQLabel *tex2=new TQLabel(wid); tex->setAlignment(AlignHCenter); tex->setMovie(anim); tex2->setText(i18n("\nPlease wait...")); @@ -2169,17 +2169,17 @@ void listKeys::slotgenkey() pop->show(); changeMessage(i18n("Generating New Key..."),0,true); - QRect qRect(QApplication::desktop()->screenGeometry()); + TQRect qRect(TQApplication::desktop()->screenGeometry()); int iXpos=qRect.width()/2-pop->width()/2; int iYpos=qRect.height()/2-pop->height()/2; pop->move(iXpos,iYpos); pop->setAutoDelete(false); - KProcIO *proc=new KProcIO(QTextCodec::codecForLocale()); - message=QString::null; + KProcIO *proc=new KProcIO(TQTextCodec::codecForLocale()); + message=TQString::null; //*proc<<"gpg"<<"--no-tty"<<"--no-secmem-warning"<<"--batch"<<"--passphrase-fd"<<res<<"--gen-key"<<"-a"<<"kgpg.tmp"; *proc<<"gpg"<<"--no-tty"<<"--status-fd=2"<<"--no-secmem-warning"<<"--batch"<<"--gen-key"<<"--utf8-strings"; ///////// when process ends, update dialog infos - QObject::connect(proc, SIGNAL(processExited(KProcess *)),this, SLOT(genover(KProcess *))); + TQObject::connect(proc, TQT_SIGNAL(processExited(KProcess *)),this, TQT_SLOT(genover(KProcess *))); proc->start(KProcess::NotifyOnExit,true); if (ktype=="RSA") @@ -2188,29 +2188,29 @@ void listKeys::slotgenkey() { proc->writeStdin("Key-Type: DSA"); proc->writeStdin("Subkey-Type: ELG-E"); - proc->writeStdin(QString("Subkey-Length:%1").arg(ksize)); + proc->writeStdin(TQString("Subkey-Length:%1").arg(ksize)); } - proc->writeStdin(QString("Passphrase:%1").arg(password)); - proc->writeStdin(QString("Key-Length:%1").arg(ksize)); - proc->writeStdin(QString("Name-Real:%1").arg(newKeyName)); + proc->writeStdin(TQString("Passphrase:%1").arg(password)); + proc->writeStdin(TQString("Key-Length:%1").arg(ksize)); + proc->writeStdin(TQString("Name-Real:%1").arg(newKeyName)); if (!newKeyMail.isEmpty()) - proc->writeStdin(QString("Name-Email:%1").arg(newKeyMail)); + proc->writeStdin(TQString("Name-Email:%1").arg(newKeyMail)); if (!kcomment.isEmpty()) - proc->writeStdin(QString("Name-Comment:%1").arg(kcomment)); + proc->writeStdin(TQString("Name-Comment:%1").arg(kcomment)); if (kexp==0) - proc->writeStdin(QString("Expire-Date:0")); + proc->writeStdin(TQString("Expire-Date:0")); if (kexp==1) - proc->writeStdin(QString("Expire-Date:%1").arg(knumb)); + proc->writeStdin(TQString("Expire-Date:%1").arg(knumb)); if (kexp==2) - proc->writeStdin(QString("Expire-Date:%1w").arg(knumb)); + proc->writeStdin(TQString("Expire-Date:%1w").arg(knumb)); if (kexp==3) - proc->writeStdin(QString("Expire-Date:%1m").arg(knumb)); + proc->writeStdin(TQString("Expire-Date:%1m").arg(knumb)); if (kexp==4) - proc->writeStdin(QString("Expire-Date:%1y").arg(knumb)); + proc->writeStdin(TQString("Expire-Date:%1y").arg(knumb)); proc->writeStdin("%commit"); - QObject::connect(proc,SIGNAL(readReady(KProcIO *)),this,SLOT(readgenprocess(KProcIO *))); + TQObject::connect(proc,TQT_SIGNAL(readReady(KProcIO *)),this,TQT_SLOT(readgenprocess(KProcIO *))); proc->closeWhenDone(); } else ////// start expert (=konsole) mode { @@ -2230,7 +2230,7 @@ void listKeys::slotgenkey() void listKeys::readgenprocess(KProcIO *p) { - QString required; + TQString required; while (p->readln(required,true)!=-1) { if (required.find("KEY_CREATED")!=-1) newkeyFinger=required.stripWhiteSpace().section(' ',-1); @@ -2242,20 +2242,20 @@ void listKeys::readgenprocess(KProcIO *p) void listKeys::genover(KProcess *) { - newkeyID=QString::null; + newkeyID=TQString::null; continueSearch=true; - KProcIO *conprocess=new KProcIO(QTextCodec::codecForLocale()); + KProcIO *conprocess=new KProcIO(TQTextCodec::codecForLocale()); *conprocess<< "gpg"; *conprocess<<"--no-secmem-warning"<<"--with-colons"<<"--fingerprint"<<"--list-keys"<<newKeyName; - QObject::connect(conprocess,SIGNAL(readReady(KProcIO *)),this,SLOT(slotReadFingerProcess(KProcIO *))); - QObject::connect(conprocess, SIGNAL(processExited(KProcess *)),this, SLOT(newKeyDone(KProcess *))); + TQObject::connect(conprocess,TQT_SIGNAL(readReady(KProcIO *)),this,TQT_SLOT(slotReadFingerProcess(KProcIO *))); + TQObject::connect(conprocess, TQT_SIGNAL(processExited(KProcess *)),this, TQT_SLOT(newKeyDone(KProcess *))); conprocess->start(KProcess::NotifyOnExit,true); } void listKeys::slotReadFingerProcess(KProcIO *p) { - QString outp; + TQString outp; while (p->readln(outp)!=-1) { if (outp.startsWith("pub") && (continueSearch)) { newkeyID=outp.section(':',4,4).right(8).prepend("0x"); @@ -2287,9 +2287,9 @@ void listKeys::newKeyDone(KProcess *) page->TLname->setText("<b>"+newKeyName+"</b>"); page->TLemail->setText("<b>"+newKeyMail+"</b>"); if (!newKeyMail.isEmpty()) - page->kURLRequester1->setURL(QDir::homeDirPath()+"/"+newKeyMail.section("@",0,0)+".revoke"); + page->kURLRequester1->setURL(TQDir::homeDirPath()+"/"+newKeyMail.section("@",0,0)+".revoke"); else - page->kURLRequester1->setURL(QDir::homeDirPath()+"/"+newKeyName.section(" ",0,0)+".revoke"); + page->kURLRequester1->setURL(TQDir::homeDirPath()+"/"+newKeyName.section(" ",0,0)+".revoke"); page->TLid->setText("<b>"+newkeyID+"</b>"); page->LEfinger->setText(newkeyFinger); page->CBdefault->setChecked(true); @@ -2299,7 +2299,7 @@ void listKeys::newKeyDone(KProcess *) delete pop; keyCreated->exec(); - QListViewItem *newdef = keysList2->findItem(newkeyID,6); + TQListViewItem *newdef = keysList2->findItem(newkeyID,6); if (newdef) if (page->CBdefault->isChecked()) slotSetDefaultKey(newdef); @@ -2312,30 +2312,30 @@ void listKeys::newKeyDone(KProcess *) if (page->CBsave->isChecked()) { slotrevoke(newkeyID,page->kURLRequester1->url(),0,i18n("backup copy")); if (page->CBprint->isChecked()) - connect(revKeyProcess,SIGNAL(revokeurl(QString)),this,SLOT(doFilePrint(QString))); + connect(revKeyProcess,TQT_SIGNAL(revokeurl(TQString)),this,TQT_SLOT(doFilePrint(TQString))); } else if (page->CBprint->isChecked()) { - slotrevoke(newkeyID,QString::null,0,i18n("backup copy")); - connect(revKeyProcess,SIGNAL(revokecertificate(QString)),this,SLOT(doPrint(QString))); + slotrevoke(newkeyID,TQString::null,0,i18n("backup copy")); + connect(revKeyProcess,TQT_SIGNAL(revokecertificate(TQString)),this,TQT_SLOT(doPrint(TQString))); } } -void listKeys::doFilePrint(QString url) +void listKeys::doFilePrint(TQString url) { - QFile qfile(url); + TQFile qfile(url); if (qfile.open(IO_ReadOnly)) { - QTextStream t( &qfile ); + TQTextStream t( &qfile ); doPrint(t.read()); } else KMessageBox::sorry(this,i18n("<qt>Cannot open file <b>%1</b> for printing...</qt>").arg(url)); } -void listKeys::doPrint(QString txt) +void listKeys::doPrint(TQString txt) { KPrinter prt; //kdDebug(2100)<<"Printing..."<<endl; if (prt.setup(this)) { - QPainter painter(&prt); - QPaintDeviceMetrics metrics(painter.device()); + TQPainter painter(&prt); + TQPaintDeviceMetrics metrics(painter.device()); painter.drawText( 0, 0, metrics.width(), metrics.height(), AlignLeft|AlignTop|DontClip,txt ); } } @@ -2343,7 +2343,7 @@ void listKeys::doPrint(QString txt) void listKeys::deleteseckey() { //////////////////////// delete a key - QString res=keysList2->currentItem()->text(0)+" ("+keysList2->currentItem()->text(1)+")"; + TQString res=keysList2->currentItem()->text(0)+" ("+keysList2->currentItem()->text(1)+")"; int result=KMessageBox::warningContinueCancel(this, i18n("<p>Delete <b>SECRET KEY</b> pair <b>%1</b>?</p>Deleting this key pair means you will never be able to decrypt files encrypted with this key again.").arg(res), i18n("Warning"), @@ -2358,7 +2358,7 @@ void listKeys::deleteseckey() *conprocess<<"-e"<<"gpg" <<"--no-secmem-warning" <<"--delete-secret-key"<<keysList2->currentItem()->text(6); - QObject::connect(conprocess, SIGNAL(processExited(KProcess *)),this, SLOT(reloadSecretKeys())); + TQObject::connect(conprocess, TQT_SIGNAL(processExited(KProcess *)),this, TQT_SLOT(reloadSecretKeys())); conprocess->start(KProcess::NotifyOnExit,KProcess::AllOutput); } @@ -2366,10 +2366,10 @@ void listKeys::reloadSecretKeys() { FILE *fp; char line[300]; - keysList2->secretList=QString::null; + keysList2->secretList=TQString::null; fp = popen("gpg --no-secmem-warning --no-tty --with-colons --list-secret-keys", "r"); while ( fgets( line, sizeof(line), fp)) { - QString lineRead=QString::fromUtf8(line); + TQString lineRead=TQString::fromUtf8(line); if (lineRead.startsWith("sec")) keysList2->secretList+="0x"+lineRead.section(':',4,4).right(8)+","; } @@ -2391,9 +2391,9 @@ void listKeys::confirmdeletekey() if (((keysList2->secretList.find(keysList2->currentItem()->text(6))!=-1) || (keysList2->orphanList.find(keysList2->currentItem()->text(6))!=-1)) && (keysList2->selectedItems().count()==1)) deleteseckey(); else { - QStringList keysToDelete; - QString secList; - QPtrList<QListViewItem> exportList=keysList2->selectedItems(); + TQStringList keysToDelete; + TQString secList; + TQPtrList<TQListViewItem> exportList=keysList2->selectedItems(); bool secretKeyInside=false; for ( uint i = 0; i < exportList.count(); ++i ) if ( exportList.at(i) ) { @@ -2422,7 +2422,7 @@ void listKeys::confirmdeletekey() void listKeys::deletekey() { - QPtrList<QListViewItem> exportList=keysList2->selectedItems(); + TQPtrList<TQListViewItem> exportList=keysList2->selectedItems(); if (exportList.count()==0) return; KProcess gp; @@ -2441,14 +2441,14 @@ void listKeys::deletekey() if ( exportList.at(i) ) keysList2->refreshcurrentkey(exportList.at(i)); if (keysList2->currentItem()) { - QListViewItem * myChild = keysList2->currentItem(); + TQListViewItem * myChild = keysList2->currentItem(); while(!myChild->isVisible()) { myChild = myChild->nextSibling(); if (!myChild) break; } if (!myChild) { - QListViewItem * myChild = keysList2->firstChild(); + TQListViewItem * myChild = keysList2->firstChild(); while(!myChild->isVisible()) { myChild = myChild->nextSibling(); if (!myChild) @@ -2476,25 +2476,25 @@ void listKeys::slotPreImportKey() page->resize(page->minimumSize()); dial->resize(dial->minimumSize()); - if (dial->exec()==QDialog::Accepted) { + if (dial->exec()==TQDialog::Accepted) { if (page->checkFile->isChecked()) { - QString impname=page->newFilename->url().stripWhiteSpace(); + TQString impname=page->newFilename->url().stripWhiteSpace(); if (!impname.isEmpty()) { changeMessage(i18n("Importing..."),0,true); ////////////////////////// import from file KgpgInterface *importKeyProcess=new KgpgInterface(); importKeyProcess->importKeyURL(KURL::fromPathOrURL( impname )); - connect(importKeyProcess,SIGNAL(importfinished(QStringList)),keysList2,SLOT(slotReloadKeys(QStringList))); - connect(importKeyProcess,SIGNAL(refreshOrphaned()),keysList2,SLOT(slotReloadOrphaned())); + connect(importKeyProcess,TQT_SIGNAL(importfinished(TQStringList)),keysList2,TQT_SLOT(slotReloadKeys(TQStringList))); + connect(importKeyProcess,TQT_SIGNAL(refreshOrphaned()),keysList2,TQT_SLOT(slotReloadOrphaned())); } } else { - QString keystr = kapp->clipboard()->text(clipboardMode); + TQString keystr = kapp->clipboard()->text(clipboardMode); if (!keystr.isEmpty()) { changeMessage(i18n("Importing..."),0,true); KgpgInterface *importKeyProcess=new KgpgInterface(); importKeyProcess->importKey(keystr); - connect(importKeyProcess,SIGNAL(importfinished(QStringList)),keysList2,SLOT(slotReloadKeys(QStringList))); - connect(importKeyProcess,SIGNAL(refreshOrphaned()),keysList2,SLOT(slotReloadOrphaned())); + connect(importKeyProcess,TQT_SIGNAL(importfinished(TQStringList)),keysList2,TQT_SLOT(slotReloadKeys(TQStringList))); + connect(importKeyProcess,TQT_SIGNAL(refreshOrphaned()),keysList2,TQT_SLOT(slotReloadOrphaned())); } } } @@ -2502,54 +2502,54 @@ void listKeys::slotPreImportKey() } -void KeyView::expandGroup(QListViewItem *item) +void KeyView::expandGroup(TQListViewItem *item) { - QStringList keysGroup=KgpgInterface::getGpgGroupSetting(item->text(0),KGpgSettings::gpgConfigPath()); + TQStringList keysGroup=KgpgInterface::getGpgGroupSetting(item->text(0),KGpgSettings::gpgConfigPath()); kdDebug(2100)<<keysGroup<<endl; - for ( QStringList::Iterator it = keysGroup.begin(); it != keysGroup.end(); ++it ) { - UpdateViewItem *item2=new UpdateViewItem(item,QString(*it),QString::null,QString::null,QString::null,QString::null,QString::null,QString::null); + for ( TQStringList::Iterator it = keysGroup.begin(); it != keysGroup.end(); ++it ) { + UpdateViewItem *item2=new UpdateViewItem(item,TQString(*it),TQString::null,TQString::null,TQString::null,TQString::null,TQString::null,TQString::null); item2->setPixmap(0,pixkeyGroup); item2->setExpandable(false); } } -QPixmap KeyView::slotGetPhoto(QString photoId,bool mini) +TQPixmap KeyView::slotGetPhoto(TQString photoId,bool mini) { KTempFile *phototmp=new KTempFile(); - QString popt="cp %i "+phototmp->name(); - KProcIO *p=new KProcIO(QTextCodec::codecForLocale()); - *p<<"gpg"<<"--show-photos"<<"--photo-viewer"<<QFile::encodeName(popt)<<"--list-keys"<<photoId; + TQString popt="cp %i "+phototmp->name(); + KProcIO *p=new KProcIO(TQTextCodec::codecForLocale()); + *p<<"gpg"<<"--show-photos"<<"--photo-viewer"<<TQFile::encodeName(popt)<<"--list-keys"<<photoId; p->start(KProcess::Block); - QPixmap pixmap; + TQPixmap pixmap; pixmap.load(phototmp->name()); - QImage dup=pixmap.convertToImage(); - QPixmap dup2; + TQImage dup=pixmap.convertToImage(); + TQPixmap dup2; if (!mini) - dup2.convertFromImage(dup.scale(previewSize+5,previewSize,QImage::ScaleMin)); + dup2.convertFromImage(dup.scale(previewSize+5,previewSize,TQImage::ScaleMin)); else - dup2.convertFromImage(dup.scale(22,22,QImage::ScaleMin)); + dup2.convertFromImage(dup.scale(22,22,TQImage::ScaleMin)); phototmp->unlink(); delete phototmp; return dup2; } -void KeyView::expandKey(QListViewItem *item) +void KeyView::expandKey(TQListViewItem *item) { if (item->childCount()!=0) return; // key has already been expanded FILE *fp; - QString cycle; - QStringList tst; + TQString cycle; + TQStringList tst; char tmpline[300]; UpdateViewItem *itemsub=NULL; UpdateViewItem *itemuid=NULL; UpdateViewItem *itemsig=NULL; UpdateViewItem *itemrev=NULL; - QPixmap keyPhotoId; + TQPixmap keyPhotoId; int uidNumber=2; bool dropFirstUid=false; @@ -2557,11 +2557,11 @@ void KeyView::expandKey(QListViewItem *item) cycle="pub"; bool noID=false; - fp = popen(QFile::encodeName(QString("gpg --no-secmem-warning --no-tty --with-colons --list-sigs "+item->text(6))), "r"); + fp = popen(TQFile::encodeName(TQString("gpg --no-secmem-warning --no-tty --with-colons --list-sigs "+item->text(6))), "r"); while ( fgets( tmpline, sizeof(tmpline), fp)) { - QString line = QString::fromUtf8( tmpline ); - tst=QStringList::split(":",line,true); + TQString line = TQString::fromUtf8( tmpline ); + tst=TQStringList::split(":",line,true); if ((tst[0]=="pub") && (tst[9].isEmpty())) /// Primary User Id is separated from public key uidNumber=1; if (tst[0]=="uid" || tst[0]=="uat") { @@ -2572,20 +2572,20 @@ void KeyView::expandKey(QListViewItem *item) if (tst[0]=="uat") { kdDebug(2100)<<"Found photo at uid "<<uidNumber<<endl; - itemuid= new UpdateViewItem(item,i18n("Photo id"),QString::null,QString::null,"-","-","-",QString::number(uidNumber)); + itemuid= new UpdateViewItem(item,i18n("Photo id"),TQString::null,TQString::null,"-","-","-",TQString::number(uidNumber)); if (displayPhoto) { kgpgphototmp=new KTempFile(); kgpgphototmp->setAutoDelete(true); - QString pgpgOutput="cp %i "+kgpgphototmp->name(); - KProcIO *p=new KProcIO(QTextCodec::codecForLocale()); - *p<<"gpg"<<"--no-tty"<<"--photo-viewer"<<QFile::encodeName(pgpgOutput); - *p<<"--edit-key"<<item->text(6)<<"uid"<<QString::number(uidNumber)<<"showphoto"<<"quit"; + TQString pgpgOutput="cp %i "+kgpgphototmp->name(); + KProcIO *p=new KProcIO(TQTextCodec::codecForLocale()); + *p<<"gpg"<<"--no-tty"<<"--photo-viewer"<<TQFile::encodeName(pgpgOutput); + *p<<"--edit-key"<<item->text(6)<<"uid"<<TQString::number(uidNumber)<<"showphoto"<<"quit"; p->start(KProcess::Block); - QPixmap pixmap; + TQPixmap pixmap; pixmap.load(kgpgphototmp->name()); - QImage dup=pixmap.convertToImage(); - QPixmap dup2; - dup2.convertFromImage(dup.scale(previewSize+5,previewSize,QImage::ScaleMin)); + TQImage dup=pixmap.convertToImage(); + TQPixmap dup2; + dup2.convertFromImage(dup.scale(previewSize+5,previewSize,TQImage::ScaleMin)); itemuid->setPixmap(0,dup2); delete kgpgphototmp; //itemuid->setPixmap(0,keyPhotoId); @@ -2595,7 +2595,7 @@ void KeyView::expandKey(QListViewItem *item) cycle="uid"; } else { kdDebug(2100)<<"Found uid at "<<uidNumber<<endl; - itemuid= new UpdateViewItem(item,uidKey.gpgkeyname,uidKey.gpgkeymail,QString::null,"-","-","-","-"); + itemuid= new UpdateViewItem(item,uidKey.gpgkeyname,uidKey.gpgkeymail,TQString::null,"-","-","-","-"); itemuid->setPixmap(2,uidKey.trustpic); if (noID) { item->setText(0,uidKey.gpgkeyname); @@ -2638,7 +2638,7 @@ void KeyView::expandKey(QListViewItem *item) } else if (tst[0]=="sub") { gpgKey subKey=extractKey(line); - itemsub= new UpdateViewItem(item,i18n("%1 subkey").arg(subKey.gpgkeyalgo),QString::null,QString::null,subKey.gpgkeyexpiration,subKey.gpgkeysize,subKey.gpgkeycreation,subKey.gpgkeyid); + itemsub= new UpdateViewItem(item,i18n("%1 subkey").arg(subKey.gpgkeyalgo),TQString::null,TQString::null,subKey.gpgkeyexpiration,subKey.gpgkeysize,subKey.gpgkeycreation,subKey.gpgkeyid); itemsub->setPixmap(0,pixkeySingle); itemsub->setPixmap(2,subKey.trustpic); cycle="sub"; @@ -2661,15 +2661,15 @@ void KeyView::refreshkeylist() kapp->processEvents(); //////// update display of keys in main management window kdDebug(2100)<<"Refreshing key list"<<endl; - QString tst; + TQString tst; char line[300]; UpdateViewItem *item=NULL; bool noID=false; bool emptyList=true; - QString openKeys; + TQString openKeys; // get current position. - QListViewItem *current = currentItem(); + TQListViewItem *current = currentItem(); if(current != NULL) { while(current->depth() > 0) { current = current->parent(); @@ -2680,22 +2680,22 @@ void KeyView::refreshkeylist() // refill clear(); FILE *fp2,*fp; - QStringList issec; - secretList=QString::null; - orphanList=QString::null; + TQStringList issec; + secretList=TQString::null; + orphanList=TQString::null; fp2 = popen("gpg --no-secmem-warning --no-tty --with-colons --list-secret-keys", "r"); while ( fgets( line, sizeof(line), fp2)) { - QString lineRead=QString::fromUtf8(line); + TQString lineRead=TQString::fromUtf8(line); kdDebug(2100) << k_funcinfo << "Read one secret key line: " << lineRead << endl; if (lineRead.startsWith("sec")) issec<<lineRead.section(':',4,4).right(8); } pclose(fp2); - QString defaultKey = KGpgSettings::defaultKey(); + TQString defaultKey = KGpgSettings::defaultKey(); fp = popen("gpg --no-secmem-warning --no-tty --with-colons --list-keys", "r"); while ( fgets( line, sizeof(line), fp)) { - tst=QString::fromUtf8(line); + tst=TQString::fromUtf8(line); kdDebug(2100) << k_funcinfo << "Read one public key line: " << tst << endl; if (tst.startsWith("pub")) { emptyList=false; @@ -2711,13 +2711,13 @@ void KeyView::refreshkeylist() if (pubKey.gpgkeyname.isEmpty()) noID=true; - item=new UpdateViewItem(this,pubKey.gpgkeyname,pubKey.gpgkeymail,QString::null,pubKey.gpgkeyexpiration,pubKey.gpgkeysize,pubKey.gpgkeycreation,pubKey.gpgkeyid,isbold,isexpired); + item=new UpdateViewItem(this,pubKey.gpgkeyname,pubKey.gpgkeymail,TQString::null,pubKey.gpgkeyexpiration,pubKey.gpgkeysize,pubKey.gpgkeycreation,pubKey.gpgkeyid,isbold,isexpired); item->setPixmap(2,pubKey.trustpic); item->setExpandable(true); - QStringList::Iterator ite; + TQStringList::Iterator ite; ite=issec.find(pubKey.gpgkeyid.right(8)); if (ite!=issec.end()) { item->setPixmap(0,pixkeyPair); @@ -2739,17 +2739,17 @@ void KeyView::refreshkeylist() return; } kdDebug(2100)<<"Checking Groups"<<endl; - QStringList groups=KgpgInterface::getGpgGroupNames(KGpgSettings::gpgConfigPath()); + TQStringList groups=KgpgInterface::getGpgGroupNames(KGpgSettings::gpgConfigPath()); groupNb=groups.count(); - for ( QStringList::Iterator it = groups.begin(); it != groups.end(); ++it ) - if (!QString(*it).isEmpty()) { - item=new UpdateViewItem(this,QString(*it),QString::null,QString::null,QString::null,QString::null,QString::null,QString::null,false,false); + for ( TQStringList::Iterator it = groups.begin(); it != groups.end(); ++it ) + if (!TQString(*it).isEmpty()) { + item=new UpdateViewItem(this,TQString(*it),TQString::null,TQString::null,TQString::null,TQString::null,TQString::null,TQString::null,false,false); item->setPixmap(0,pixkeyGroup); item->setExpandable(false); } kdDebug(2100)<<"Finished Groups"<<endl; - QListViewItem *newPos=0L; + TQListViewItem *newPos=0L; if(current != NULL) { // select previous selected if (!current->text(6).isEmpty()) @@ -2773,7 +2773,7 @@ void KeyView::refreshkeylist() kdDebug(2100)<<"Refresh Finished"<<endl; } -void KeyView::insertOrphan(QString currentID) +void KeyView::insertOrphan(TQString currentID) { FILE *fp; char line[300]; @@ -2781,7 +2781,7 @@ void KeyView::insertOrphan(QString currentID) bool keyFound=false; fp = popen("gpg --no-secmem-warning --no-tty --with-colons --list-secret-keys", "r"); while ( fgets( line, sizeof(line), fp)) { - QString lineRead=QString::fromUtf8(line); + TQString lineRead=TQString::fromUtf8(line); if ((lineRead.startsWith("sec")) && (lineRead.section(':',4,4).right(8))==currentID.right(8)) { gpgKey orphanedKey=extractKey(lineRead); keyFound=true; @@ -2794,7 +2794,7 @@ void KeyView::insertOrphan(QString currentID) // if (orphanedKey.gpgkeyname.isEmpty()) // noID=true; - item=new UpdateViewItem(this,orphanedKey.gpgkeyname,orphanedKey.gpgkeymail,QString::null,orphanedKey.gpgkeyexpiration,orphanedKey.gpgkeysize,orphanedKey.gpgkeycreation,orphanedKey.gpgkeyid,isbold,isexpired); + item=new UpdateViewItem(this,orphanedKey.gpgkeyname,orphanedKey.gpgkeymail,TQString::null,orphanedKey.gpgkeyexpiration,orphanedKey.gpgkeysize,orphanedKey.gpgkeycreation,orphanedKey.gpgkeyid,isbold,isexpired); item->setPixmap(0,pixkeyOrphan); } } @@ -2809,13 +2809,13 @@ void KeyView::insertOrphan(QString currentID) setSelected(item,true); } -void KeyView::insertOrphanedKeys(QStringList orphans) +void KeyView::insertOrphanedKeys(TQStringList orphans) { FILE *fp; char line[300]; fp = popen("gpg --no-secmem-warning --no-tty --with-colons --list-secret-keys", "r"); while ( fgets( line, sizeof(line), fp)) { - QString lineRead=QString::fromUtf8(line); + TQString lineRead=TQString::fromUtf8(line); if ((lineRead.startsWith("sec")) && (orphans.find(lineRead.section(':',4,4).right(8))!=orphans.end())) { gpgKey orphanedKey=extractKey(lineRead); @@ -2828,7 +2828,7 @@ void KeyView::insertOrphanedKeys(QStringList orphans) // if (orphanedKey.gpgkeyname.isEmpty()) // noID=true; orphanList+=orphanedKey.gpgkeyid+","; - UpdateViewItem *item=new UpdateViewItem(this,orphanedKey.gpgkeyname,orphanedKey.gpgkeymail,QString::null,orphanedKey.gpgkeyexpiration,orphanedKey.gpgkeysize,orphanedKey.gpgkeycreation,orphanedKey.gpgkeyid,isbold,isexpired); + UpdateViewItem *item=new UpdateViewItem(this,orphanedKey.gpgkeyname,orphanedKey.gpgkeymail,TQString::null,orphanedKey.gpgkeyexpiration,orphanedKey.gpgkeysize,orphanedKey.gpgkeycreation,orphanedKey.gpgkeyid,isbold,isexpired); item->setPixmap(0,pixkeyOrphan); } } @@ -2837,21 +2837,21 @@ void KeyView::insertOrphanedKeys(QStringList orphans) void KeyView::refreshgroups() { - QListViewItem *item=firstChild(); + TQListViewItem *item=firstChild(); while (item) { if (item->text(6).isEmpty()) { - QListViewItem *item2=item->nextSibling(); + TQListViewItem *item2=item->nextSibling(); delete item; item=item2; } else item=item->nextSibling(); } - QStringList groups=KgpgInterface::getGpgGroupNames(KGpgSettings::gpgConfigPath()); + TQStringList groups=KgpgInterface::getGpgGroupNames(KGpgSettings::gpgConfigPath()); groupNb=groups.count(); - for ( QStringList::Iterator it = groups.begin(); it != groups.end(); ++it ) - if (!QString(*it).isEmpty()) { - item=new UpdateViewItem(this,QString(*it),QString::null,QString::null,QString::null,QString::null,QString::null,QString::null,false,false); + for ( TQStringList::Iterator it = groups.begin(); it != groups.end(); ++it ) + if (!TQString(*it).isEmpty()) { + item=new UpdateViewItem(this,TQString(*it),TQString::null,TQString::null,TQString::null,TQString::null,TQString::null,TQString::null,false,false); item->setPixmap(0,pixkeyGroup); item->setExpandable(false); } @@ -2868,7 +2868,7 @@ void KeyView::refreshselfkey() refreshcurrentkey(currentItem()->parent()); } -void KeyView::slotReloadKeys(QStringList keyIDs) +void KeyView::slotReloadKeys(TQStringList keyIDs) { if (keyIDs.isEmpty()) return; @@ -2877,7 +2877,7 @@ void KeyView::slotReloadKeys(QStringList keyIDs) refreshkeylist(); return; } - for ( QStringList::Iterator it = keyIDs.begin(); it != keyIDs.end(); ++it ) { + for ( TQStringList::Iterator it = keyIDs.begin(); it != keyIDs.end(); ++it ) { refreshcurrentkey(*it); } kdDebug(2100)<<"Refreshing key:--------"<<(keyIDs.last()).right(8).prepend("0x")<<endl; @@ -2888,13 +2888,13 @@ void KeyView::slotReloadKeys(QStringList keyIDs) void KeyView::slotReloadOrphaned() { - QStringList issec; + TQStringList issec; FILE *fp,*fp2; char line[300]; fp2 = popen("gpg --no-secmem-warning --no-tty --with-colons --list-secret-keys", "r"); while ( fgets( line, sizeof(line), fp2)) { - QString lineRead=QString::fromUtf8(line); + TQString lineRead=TQString::fromUtf8(line); if (lineRead.startsWith("sec")) issec<<"0x"+lineRead.section(':',4,4).right(8); } @@ -2902,13 +2902,13 @@ void KeyView::slotReloadOrphaned() fp = popen("gpg --no-secmem-warning --no-tty --with-colons --list-keys", "r"); while ( fgets( line, sizeof(line), fp)) { - QString lineRead=QString::fromUtf8(line); + TQString lineRead=TQString::fromUtf8(line); if (lineRead.startsWith("pub")) issec.remove("0x"+lineRead.section(':',4,4).right(8)); } pclose(fp); - QStringList::Iterator it; + TQStringList::Iterator it; for ( it = issec.begin(); it != issec.end(); ++it ) { if (findItem(*it,6)==0) { @@ -2921,30 +2921,30 @@ void KeyView::slotReloadOrphaned() emit statusMessage(i18n("Ready"),0); } -void KeyView::refreshcurrentkey(QString currentID) +void KeyView::refreshcurrentkey(TQString currentID) { if (currentID.isNull()) return; UpdateViewItem *item=NULL; - QString issec=QString::null; + TQString issec=TQString::null; FILE *fp,*fp2; char line[300]; fp2 = popen("gpg --no-secmem-warning --no-tty --with-colons --list-secret-keys", "r"); while ( fgets( line, sizeof(line), fp2)) { - QString lineRead=QString::fromUtf8(line); + TQString lineRead=TQString::fromUtf8(line); if (lineRead.startsWith("sec")) issec+=lineRead.section(':',4,4); } pclose(fp2); - QString defaultKey = KGpgSettings::defaultKey(); + TQString defaultKey = KGpgSettings::defaultKey(); - QString tst; + TQString tst; bool keyFound=false; - QString cmd="gpg --no-secmem-warning --no-tty --with-colons --list-keys "+currentID; - fp = popen(QFile::encodeName(cmd), "r"); + TQString cmd="gpg --no-secmem-warning --no-tty --with-colons --list-keys "+currentID; + fp = popen(TQFile::encodeName(cmd), "r"); while ( fgets( line, sizeof(line), fp)) { - tst=QString::fromUtf8(line); + tst=TQString::fromUtf8(line); if (tst.startsWith("pub")) { gpgKey pubKey=extractKey(tst); keyFound=true; @@ -2954,7 +2954,7 @@ void KeyView::refreshcurrentkey(QString currentID) isbold=true; if (pubKey.gpgkeytrust==i18n("Expired")) isexpired=true; - item=new UpdateViewItem(this,pubKey.gpgkeyname,pubKey.gpgkeymail,QString::null,pubKey.gpgkeyexpiration,pubKey.gpgkeysize,pubKey.gpgkeycreation,pubKey.gpgkeyid,isbold,isexpired); + item=new UpdateViewItem(this,pubKey.gpgkeyname,pubKey.gpgkeymail,TQString::null,pubKey.gpgkeyexpiration,pubKey.gpgkeysize,pubKey.gpgkeycreation,pubKey.gpgkeyid,isbold,isexpired); item->setPixmap(2,pubKey.trustpic); item->setVisible(true); item->setExpandable(true); @@ -2982,12 +2982,12 @@ void KeyView::refreshcurrentkey(QString currentID) } -void KeyView::refreshcurrentkey(QListViewItem *current) +void KeyView::refreshcurrentkey(TQListViewItem *current) { if (!current) return; bool keyIsOpen=false; - QString keyUpdate=current->text(6); + TQString keyUpdate=current->text(6); if (keyUpdate.isEmpty()) return; if (current->isOpen()) @@ -3000,10 +3000,10 @@ void KeyView::refreshcurrentkey(QListViewItem *current) } -void KeyView::refreshTrust(int color,QColor newColor) +void KeyView::refreshTrust(int color,TQColor newColor) { if (!newColor.isValid()) return; -QPixmap blankFrame,newtrust; +TQPixmap blankFrame,newtrust; int trustFinger=0; blankFrame.load(locate("appdata", "pics/kgpg_blank.png")); newtrust.load(locate("appdata", "pics/kgpg_fill.png")); @@ -3028,7 +3028,7 @@ trustFinger=trustrevoked.serialNumber(); trustrevoked=newtrust; break; } -QListViewItem *item=firstChild(); +TQListViewItem *item=firstChild(); while (item) { if (item->pixmap(2)) { @@ -3038,41 +3038,41 @@ QListViewItem *item=firstChild(); } } -gpgKey KeyView::extractKey(QString keyColon) +gpgKey KeyView::extractKey(TQString keyColon) { - QStringList keyString=QStringList::split(":",keyColon,true); + TQStringList keyString=TQStringList::split(":",keyColon,true); gpgKey ret; ret.gpgkeysize=keyString[2]; ret.gpgkeycreation=keyString[5]; if(!ret.gpgkeycreation.isEmpty()) { - QDate date = QDate::fromString(ret.gpgkeycreation, Qt::ISODate); + TQDate date = TQDate::fromString(ret.gpgkeycreation, Qt::ISODate); ret.gpgkeycreation=KGlobal::locale()->formatDate(date, true); } - QString tid=keyString[4]; - ret.gpgkeyid=QString("0x"+tid.right(8)); + TQString tid=keyString[4]; + ret.gpgkeyid=TQString("0x"+tid.right(8)); ret.gpgkeyexpiration=keyString[6]; if (ret.gpgkeyexpiration.isEmpty()) ret.gpgkeyexpiration=i18n("Unlimited"); else { - QDate date = QDate::fromString(ret.gpgkeyexpiration, Qt::ISODate); + TQDate date = TQDate::fromString(ret.gpgkeyexpiration, Qt::ISODate); ret.gpgkeyexpiration=KGlobal::locale()->formatDate(date, true); } - QString fullname=keyString[9]; + TQString fullname=keyString[9]; if (fullname.find("<")!=-1) { ret.gpgkeymail=fullname.section('<',-1,-1); ret.gpgkeymail.truncate(ret.gpgkeymail.length()-1); ret.gpgkeyname=fullname.section('<',0,0); //ret.gpgkeyname=ret.gpgkeyname.section('(',0,0); } else { - ret.gpgkeymail=QString::null; + ret.gpgkeymail=TQString::null; ret.gpgkeyname=fullname; //ret.gpgkeyname=fullname.section('(',0,0); } //ret.gpgkeyname=KgpgInterface::checkForUtf8(ret.gpgkeyname); // FIXME lukas - QString algo=keyString[3]; + TQString algo=keyString[3]; if (!algo.isEmpty()) switch( algo.toInt() ) { case 1: @@ -3086,12 +3086,12 @@ gpgKey KeyView::extractKey(QString keyColon) algo=i18n("DSA"); break; default: - algo=QString("#" + algo); + algo=TQString("#" + algo); break; } ret.gpgkeyalgo=algo; - const QString trust=keyString[1]; + const TQString trust=keyString[1]; switch( trust[0] ) { case 'o': ret.gpgkeytrust=i18n("Unknown"); diff --git a/kgpg/listkeys.h b/kgpg/listkeys.h index b2610db..33b246b 100644 --- a/kgpg/listkeys.h +++ b/kgpg/listkeys.h @@ -24,15 +24,15 @@ #include <klistviewsearchline.h> #include <kactionclasses.h> -#include <qclipboard.h> +#include <tqclipboard.h> #include "dcopiface.h" -#include <qptrlist.h> -#include <qstringlist.h> +#include <tqptrlist.h> +#include <tqstringlist.h> #include <kurl.h> -#include <qcheckbox.h> +#include <tqcheckbox.h> #include <kmainwindow.h> class QPushButton; @@ -53,16 +53,16 @@ class KSelectAction; struct gpgKey { - QString gpgkeymail; - QString gpgkeyname; - QString gpgkeyid; - QString gpgkeytrust; - QString gpgkeyvalidity; - QString gpgkeysize; - QString gpgkeycreation; - QString gpgkeyexpiration; - QString gpgkeyalgo; - QPixmap trustpic; + TQString gpgkeymail; + TQString gpgkeyname; + TQString gpgkeyid; + TQString gpgkeytrust; + TQString gpgkeyvalidity; + TQString gpgkeysize; + TQString gpgkeycreation; + TQString gpgkeyexpiration; + TQString gpgkeyalgo; + TQPixmap trustpic; }; class KgpgSelKey : public KDialogBase @@ -70,20 +70,20 @@ class KgpgSelKey : public KDialogBase Q_OBJECT public: - KgpgSelKey( QWidget *parent = 0, const char *name = 0,bool allowMultipleSelection=false, QString preselected=QString::null); + KgpgSelKey( TQWidget *parent = 0, const char *name = 0,bool allowMultipleSelection=false, TQString preselected=TQString::null); KListView *keysListpr; - QPixmap keyPair; - QCheckBox *local; - QVBoxLayout *vbox; - QWidget *page; + TQPixmap keyPair; + TQCheckBox *local; + TQVBoxLayout *vbox; + TQWidget *page; private slots: void slotOk(); void slotpreOk(); - void slotSelect(QListViewItem *item); + void slotSelect(TQListViewItem *item); public slots: - QString getkeyID(); - QString getkeyMail(); + TQString getkeyID(); + TQString getkeyMail(); }; @@ -93,19 +93,19 @@ class KeyView : public KListView Q_OBJECT friend class listKeys; public: - KeyView( QWidget *parent = 0, const char *name = 0); + KeyView( TQWidget *parent = 0, const char *name = 0); bool displayPhoto,displayOnlySecret,displayDisabled; int previewSize; - QString secretList; - QPixmap trustbad; + TQString secretList; + TQPixmap trustbad; private: - QString orphanList; - QString photoKeysList; - QPixmap pixkeyPair, pixkeySingle, pixkeyGroup, pixsignature, pixuserid, pixuserphoto; - QPixmap trustunknown, trustrevoked, trustgood, pixRevoke, pixkeyOrphan; - QListViewItem *itemToOpen; + TQString orphanList; + TQString photoKeysList; + TQPixmap pixkeyPair, pixkeySingle, pixkeyGroup, pixsignature, pixuserid, pixuserphoto; + TQPixmap trustunknown, trustrevoked, trustgood, pixRevoke, pixkeyOrphan; + TQListViewItem *itemToOpen; KTempFile *kgpgphototmp; int groupNb; @@ -114,44 +114,44 @@ public slots: void slotAddColumn(int c); private slots: - void refreshTrust(int color,QColor newColor); + void refreshTrust(int color,TQColor newColor); void droppedfile (KURL); void refreshkeylist(); - gpgKey extractKey(QString keyColon); - void expandKey(QListViewItem *item); - void expandGroup(QListViewItem *item); - void refreshcurrentkey(QListViewItem *current); - void refreshcurrentkey(QString currentID); + gpgKey extractKey(TQString keyColon); + void expandKey(TQListViewItem *item); + void expandGroup(TQListViewItem *item); + void refreshcurrentkey(TQListViewItem *current); + void refreshcurrentkey(TQString currentID); void refreshselfkey(); void refreshgroups(); - void insertOrphanedKeys(QStringList orpans); - void insertOrphan(QString currentID); - QPixmap slotGetPhoto(QString photoId,bool mini=false); - void slotReloadKeys(QStringList keyIDs); + void insertOrphanedKeys(TQStringList orpans); + void insertOrphan(TQString currentID); + TQPixmap slotGetPhoto(TQString photoId,bool mini=false); + void slotReloadKeys(TQStringList keyIDs); void slotReloadOrphaned(); signals: - void statusMessage(QString,int,bool keep=false); + void statusMessage(TQString,int,bool keep=false); protected: virtual void startDrag(); - virtual void contentsDragMoveEvent(QDragMoveEvent *e); - virtual void contentsDropEvent (QDropEvent*); + virtual void contentsDragMoveEvent(TQDragMoveEvent *e); + virtual void contentsDropEvent (TQDropEvent*); }; class mySearchLine: public KListViewSearchLine { Q_OBJECT public: - mySearchLine(QWidget *parent = 0, KeyView *listView = 0, const char *name = 0); + mySearchLine(TQWidget *parent = 0, KeyView *listView = 0, const char *name = 0); virtual ~mySearchLine(); private: KeyView *searchListView; public slots: -virtual void updateSearch(const QString &s = QString::null); +virtual void updateSearch(const TQString &s = TQString::null); protected: -virtual bool itemMatches(const QListViewItem *item, const QString & s) const; +virtual bool itemMatches(const TQListViewItem *item, const TQString & s) const; }; @@ -161,13 +161,13 @@ class listKeys : public KMainWindow, virtual public KeyInterface Q_OBJECT public: - listKeys(QWidget *parent=0, const char *name=0); + listKeys(TQWidget *parent=0, const char *name=0); ~listKeys(); - QLabel *keyPhoto; + TQLabel *keyPhoto; KeyView *keysList2; - QPopupMenu *popup,*popupsec,*popupout,*popupsig,*popupgroup,*popupphoto,*popupuid,*popuporphan; - QString message; - QStringList keynames; + TQPopupMenu *popup,*popupsec,*popupout,*popupsig,*popupgroup,*popupphoto,*popupuid,*popuporphan; + TQString message; + TQStringList keynames; KPassivePopup *pop; KToggleAction *sTrust,*sCreat,*sExpi,*sSize; KSelectAction *photoProps; @@ -175,45 +175,45 @@ public: KgpgApp *s_kgpgEditor; private: - QPushButton *bouton1,*bouton2,*bouton0; - QString tempKeyFile,newKeyMail,newKeyName,newkeyFinger,newkeyID; + TQPushButton *bouton1,*bouton2,*bouton0; + TQString tempKeyFile,newKeyMail,newKeyName,newkeyFinger,newkeyID; KListViewSearchLine* listViewSearch; bool continueSearch; bool showPhoto; keyServer *kServer; KTempFile *kgpgtmp; KAction *importSignatureKey,*importAllSignKeys,*signKey,*refreshKey; - QPtrList<QListViewItem> signList,keysList; + TQPtrList<TQListViewItem> signList,keysList; uint globalCount,keyCount; int globalChecked; bool globalisLocal,showTipOfDay; - QString globalkeyMail,globalkeyID,searchString; + TQString globalkeyMail,globalkeyID,searchString; long searchOptions; groupEdit *gEdit; KgpgInterface *revKeyProcess; KDialogBase *addUidWidget; QClipboard::Mode clipboardMode; - QTimer *statusbarTimer; + TQTimer *statusbarTimer; protected: - void closeEvent( QCloseEvent * e ); - bool eventFilter( QObject *, QEvent *e ); + void closeEvent( TQCloseEvent * e ); + bool eventFilter( TQObject *, TQEvent *e ); public slots: void slotgenkey(); void refreshkey(); void readAllOptions(); - void showKeyInfo(QString keyID); + void showKeyInfo(TQString keyID); void findKey(); void findFirstKey(); void findNextKey(); - void slotSetDefaultKey(QString newID); + void slotSetDefaultKey(TQString newID); private slots: void quitApp(); void slotOpenEditor(); - void changeMessage(QString,int, bool keep=false); + void changeMessage(TQString,int, bool keep=false); void statusBarTimeout(); void slotShowTrust(); void slotShowSize(); @@ -224,8 +224,8 @@ private slots: void slotGotoDefaultKey(); void slotDelUid(); void slotAddUid(); - void slotAddUidEnable(const QString & name); - void slotGpgError(QString errortxt); + void slotAddUidEnable(const TQString & name); + void slotGpgError(TQString errortxt); void slotUpdatePhoto(); void slotDeletePhoto(); void slotAddPhoto(); @@ -233,10 +233,10 @@ private slots: void slotShowPhoto(); void readgenprocess(KProcIO *p); void newKeyDone(KProcess *); - void slotrevoke(QString keyID,QString revokeUrl,int reason,QString description); + void slotrevoke(TQString keyID,TQString revokeUrl,int reason,TQString description); void revokeWidget(); - void doFilePrint(QString url); - void doPrint(QString txt); + void doFilePrint(TQString url); + void doPrint(TQString txt); void checkList(); void signLoop(); void slotManpage(); @@ -244,13 +244,13 @@ private slots: void showKeyServer(); void showKeyManager(); void slotReadFingerProcess(KProcIO *p); - void slotProcessExportMail(QString keys); - void slotProcessExportClip(QString keys); + void slotProcessExportMail(TQString keys); + void slotProcessExportClip(TQString keys); void readOptions(); void genover(KProcess *p); void showOptions(); void slotSetDefKey(); - void slotSetDefaultKey(QListViewItem *newdef); + void slotSetDefaultKey(TQListViewItem *newdef); void annule(); void confirmdeletekey(); void deletekey(); @@ -258,8 +258,8 @@ private slots: void signkey(); void delsignkey(); void preimportsignkey(); - bool importRemoteKey(QString keyID); - void importsignkey(QString importKeyId); + bool importRemoteKey(TQString keyID); + void importsignkey(TQString importKeyId); void importallsignkey(); void importfinished(); void signatureResult(int success); @@ -267,7 +267,7 @@ private slots: void listsigns(); void slotexport(); void slotexportsec(); - void slotmenu(QListViewItem *,const QPoint &,int); + void slotmenu(TQListViewItem *,const TQPoint &,int); void slotPreImportKey(); void slotedit(); void addToKAB(); @@ -275,12 +275,12 @@ private slots: void editGroup(); void groupAdd(); void groupRemove(); - void groupInit(QStringList keysGroup); + void groupInit(TQStringList keysGroup); void groupChange(); void createNewGroup(); void deleteGroup(); - void slotImportRevoke(QString url); - void slotImportRevokeTxt(QString revokeText); + void slotImportRevoke(TQString url); + void slotImportRevokeTxt(TQString revokeText); void refreshKeyFromServer(); void refreshFinished(); void slotregenerate(); @@ -289,9 +289,9 @@ private slots: signals: void readAgainOptions(); - void certificate(QString); + void certificate(TQString); void closeAsked(); - void fontChanged(QFont); + void fontChanged(TQFont); void encryptFiles(KURL::List); void installShredder(); diff --git a/kgpg/main.cpp b/kgpg/main.cpp index 622739f..e0bce49 100644 --- a/kgpg/main.cpp +++ b/kgpg/main.cpp @@ -15,7 +15,7 @@ * * ***************************************************************************/ -#include <qstring.h> +#include <tqstring.h> #include <kmessagebox.h> @@ -55,7 +55,7 @@ int main(int argc, char *argv[]) KUniqueApplication::addCmdLineOptions(); - //KMessageBox::sorry(0,"nombre: "+QString::number(i)); + //KMessageBox::sorry(0,"nombre: "+TQString::number(i)); if (!KUniqueApplication::start()) return 0; diff --git a/kgpg/popuppublic.cpp b/kgpg/popuppublic.cpp index 167423c..3a1461d 100644 --- a/kgpg/popuppublic.cpp +++ b/kgpg/popuppublic.cpp @@ -16,17 +16,17 @@ ***************************************************************************/ //////////////////////////////////////////////////////// code for choosing a public key from a list for encryption -#include <qlayout.h> -#include <qpushbutton.h> -#include <qptrlist.h> -#include <qwhatsthis.h> -#include <qpainter.h> -#include <qiconset.h> -#include <qbuttongroup.h> -#include <qcheckbox.h> -#include <qhbuttongroup.h> -#include <qtoolbutton.h> -#include <qtextcodec.h> +#include <tqlayout.h> +#include <tqpushbutton.h> +#include <tqptrlist.h> +#include <tqwhatsthis.h> +#include <tqpainter.h> +#include <tqiconset.h> +#include <tqbuttongroup.h> +#include <tqcheckbox.h> +#include <tqhbuttongroup.h> +#include <tqtoolbutton.h> +#include <tqtextcodec.h> #include <kdeversion.h> #include <klistview.h> @@ -54,13 +54,13 @@ class UpdateViewItem2 : public KListViewItem { public: - UpdateViewItem2(QListView *parent, QString name,QString mail,QString id,bool isDefault); - virtual void paintCell(QPainter *p, const QColorGroup &cg,int col, int width, int align); - virtual QString key(int c,bool ) const; + UpdateViewItem2(TQListView *parent, TQString name,TQString mail,TQString id,bool isDefault); + virtual void paintCell(TQPainter *p, const TQColorGroup &cg,int col, int width, int align); + virtual TQString key(int c,bool ) const; bool def; }; -UpdateViewItem2::UpdateViewItem2(QListView *parent, QString name,QString mail,QString id,bool isDefault) +UpdateViewItem2::UpdateViewItem2(TQListView *parent, TQString name,TQString mail,TQString id,bool isDefault) : KListViewItem(parent) { def=isDefault; @@ -70,29 +70,29 @@ def=isDefault; } -void UpdateViewItem2::paintCell(QPainter *p, const QColorGroup &cg,int column, int width, int alignment) +void UpdateViewItem2::paintCell(TQPainter *p, const TQColorGroup &cg,int column, int width, int alignment) { if ((def) && (column<2)) { - QFont font(p->font()); + TQFont font(p->font()); font.setBold(true); p->setFont(font); } KListViewItem::paintCell(p, cg, column, width, alignment); } -QString UpdateViewItem2 :: key(int c,bool ) const +TQString UpdateViewItem2 :: key(int c,bool ) const { return text(c).lower(); } /////////////// main view -popupPublic::popupPublic(QWidget *parent, const char *name,QString sfile,bool filemode,KShortcut goDefaultKey): +popupPublic::popupPublic(TQWidget *parent, const char *name,TQString sfile,bool filemode,KShortcut goDefaultKey): KDialogBase( Plain, i18n("Select Public Key"), Details | Ok | Cancel, Ok, parent, name,true) { - QWidget *page = plainPage(); - QVBoxLayout *vbox=new QVBoxLayout(page,0,spacingHint()); + TQWidget *page = plainPage(); + TQVBoxLayout *vbox=new TQVBoxLayout(page,0,spacingHint()); vbox->setAutoAdd(true); setButtonText(KDialogBase::Details,i18n("Options")); @@ -109,18 +109,18 @@ KDialogBase( Plain, i18n("Select Public Key"), Details | Ok | Cancel, Ok, parent if (filemode) setCaption(i18n("Select Public Key for %1").arg(sfile)); fmode=filemode; - QHButtonGroup *hBar=new QHButtonGroup(page); - //hBar->setFrameStyle(QFrame::NoFrame); + TQHButtonGroup *hBar=new TQHButtonGroup(page); + //hBar->setFrameStyle(TQFrame::NoFrame); hBar->setMargin(0); #if KDE_IS_VERSION( 3, 2, 90 ) - QToolButton *clearSearch = new QToolButton(hBar); + TQToolButton *clearSearch = new TQToolButton(hBar); clearSearch->setTextLabel(i18n("Clear Search"), true); - clearSearch->setIconSet(SmallIconSet(QApplication::reverseLayout() ? "clear_left" + clearSearch->setIconSet(SmallIconSet(TQApplication::reverseLayout() ? "clear_left" : "locationbar_erase")); - (void) new QLabel(i18n("Search: "),hBar); + (void) new TQLabel(i18n("Search: "),hBar); KListViewSearchLine* listViewSearch = new KListViewSearchLine(hBar); - connect(clearSearch, SIGNAL(pressed()), listViewSearch, SLOT(clear())); + connect(clearSearch, TQT_SIGNAL(pressed()), listViewSearch, TQT_SLOT(clear())); #endif keysList = new KListView( page ); @@ -138,54 +138,54 @@ KDialogBase( Plain, i18n("Select Public Key"), Details | Ok | Cancel, Ok, parent keysList->setFullWidth(true); keysList->setAllColumnsShowFocus(true); keysList->setSelectionModeExt(KListView::Extended); - keysList->setColumnWidthMode(0,QListView::Manual); - keysList->setColumnWidthMode(1,QListView::Manual); + keysList->setColumnWidthMode(0,TQListView::Manual); + keysList->setColumnWidthMode(1,TQListView::Manual); keysList->setColumnWidth(0,210); keysList->setColumnWidth(1,210); - boutonboxoptions=new QButtonGroup(5,Qt::Vertical ,page,0); + boutonboxoptions=new TQButtonGroup(5,Qt::Vertical ,page,0); KActionCollection *actcol=new KActionCollection(this); - (void) new KAction(i18n("&Go to Default Key"),goDefaultKey, this, SLOT(slotGotoDefaultKey()),actcol,"go_default_key"); + (void) new KAction(i18n("&Go to Default Key"),goDefaultKey, this, TQT_SLOT(slotGotoDefaultKey()),actcol,"go_default_key"); - CBarmor=new QCheckBox(i18n("ASCII armored encryption"),boutonboxoptions); - CBuntrusted=new QCheckBox(i18n("Allow encryption with untrusted keys"),boutonboxoptions); - CBhideid=new QCheckBox(i18n("Hide user id"),boutonboxoptions); + CBarmor=new TQCheckBox(i18n("ASCII armored encryption"),boutonboxoptions); + CBuntrusted=new TQCheckBox(i18n("Allow encryption with untrusted keys"),boutonboxoptions); + CBhideid=new TQCheckBox(i18n("Hide user id"),boutonboxoptions); setDetailsWidget(boutonboxoptions); - QWhatsThis::add + TQWhatsThis::add (keysList,i18n("<b>Public keys list</b>: select the key that will be used for encryption.")); - QWhatsThis::add + TQWhatsThis::add (CBarmor,i18n("<b>ASCII encryption</b>: makes it possible to open the encrypted file/message in a text editor")); - QWhatsThis::add + TQWhatsThis::add (CBhideid,i18n("<b>Hide user ID</b>: Do not put the keyid into encrypted packets. This option hides the receiver " "of the message and is a countermeasure against traffic analysis. It may slow down the decryption process because " "all available secret keys are tried.")); - QWhatsThis::add + TQWhatsThis::add (CBuntrusted,i18n("<b>Allow encryption with untrusted keys</b>: when you import a public key, it is usually " "marked as untrusted and you cannot use it unless you sign it in order to make it 'trusted'. Checking this " "box enables you to use any key, even if it has not be signed.")); if (filemode) { - QWidget *parentBox=new QWidget(boutonboxoptions); - QHBoxLayout *shredBox=new QHBoxLayout(parentBox,0); - //shredBox->setFrameStyle(QFrame::NoFrame); + TQWidget *parentBox=new TQWidget(boutonboxoptions); + TQHBoxLayout *shredBox=new TQHBoxLayout(parentBox,0); + //shredBox->setFrameStyle(TQFrame::NoFrame); //shredBox->setMargin(0); - CBshred=new QCheckBox(i18n("Shred source file"),parentBox); - QWhatsThis::add + CBshred=new TQCheckBox(i18n("Shred source file"),parentBox); + TQWhatsThis::add (CBshred,i18n("<b>Shred source file</b>: permanently remove source file. No recovery will be possible")); - QString shredWhatsThis = i18n( "<qt><b>Shred source file:</b><br /><p>Checking this option will shred (overwrite several times before erasing) the files you have encrypted. This way, it is almost impossible that the source file is recovered.</p><p><b>But you must be aware that this is not secure</b> on all file systems, and that parts of the file may have been saved in a temporary file or in the spooler of your printer if you previously opened it in an editor or tried to print it. Only works on files (not on folders).</p></qt>"); + TQString shredWhatsThis = i18n( "<qt><b>Shred source file:</b><br /><p>Checking this option will shred (overwrite several times before erasing) the files you have encrypted. This way, it is almost impossible that the source file is recovered.</p><p><b>But you must be aware that this is not secure</b> on all file systems, and that parts of the file may have been saved in a temporary file or in the spooler of your printer if you previously opened it in an editor or tried to print it. Only works on files (not on folders).</p></qt>"); KActiveLabel *warn= new KActiveLabel( i18n("<a href=\"whatsthis:%1\">Read this before using shredding</a>").arg(shredWhatsThis),parentBox ); shredBox->addWidget(CBshred); shredBox->addWidget(warn); } - CBsymmetric=new QCheckBox(i18n("Symmetrical encryption"),boutonboxoptions); - QWhatsThis::add + CBsymmetric=new TQCheckBox(i18n("Symmetrical encryption"),boutonboxoptions); + TQWhatsThis::add (CBsymmetric,i18n("<b>Symmetrical encryption</b>: encryption does not use keys. You just need to give a password " "to encrypt/decrypt the file")); - QObject::connect(CBsymmetric,SIGNAL(toggled(bool)),this,SLOT(isSymetric(bool))); + TQObject::connect(CBsymmetric,TQT_SIGNAL(toggled(bool)),this,TQT_SLOT(isSymetric(bool))); CBarmor->setChecked( KGpgSettings::asciiArmor() ); CBuntrusted->setChecked( KGpgSettings::allowUntrustedKeys() ); @@ -193,27 +193,27 @@ KDialogBase( Plain, i18n("Select Public Key"), Details | Ok | Cancel, Ok, parent if (filemode) CBshred->setChecked( KGpgSettings::shredSource() ); if (KGpgSettings::allowCustomEncryptionOptions()) { - QHButtonGroup *bGroup = new QHButtonGroup(page); - //bGroup->setFrameStyle(QFrame::NoFrame); - (void) new QLabel(i18n("Custom option:"),bGroup); + TQHButtonGroup *bGroup = new TQHButtonGroup(page); + //bGroup->setFrameStyle(TQFrame::NoFrame); + (void) new TQLabel(i18n("Custom option:"),bGroup); KLineEdit *optiontxt=new KLineEdit(bGroup); optiontxt->setText(customOptions); - QWhatsThis::add + TQWhatsThis::add (optiontxt,i18n("<b>Custom option</b>: for experienced users only, allows you to enter a gpg command line option, like: '--armor'")); - QObject::connect(optiontxt,SIGNAL(textChanged ( const QString & )),this,SLOT(customOpts(const QString & ))); + TQObject::connect(optiontxt,TQT_SIGNAL(textChanged ( const TQString & )),this,TQT_SLOT(customOpts(const TQString & ))); } - QObject::connect(keysList,SIGNAL(doubleClicked(QListViewItem *,const QPoint &,int)),this,SLOT(slotOk())); -// QObject::connect(this,SIGNAL(okClicked()),this,SLOT(crypte())); - QObject::connect(CBuntrusted,SIGNAL(toggled(bool)),this,SLOT(refresh(bool))); + TQObject::connect(keysList,TQT_SIGNAL(doubleClicked(TQListViewItem *,const TQPoint &,int)),this,TQT_SLOT(slotOk())); +// TQObject::connect(this,TQT_SIGNAL(okClicked()),this,TQT_SLOT(crypte())); + TQObject::connect(CBuntrusted,TQT_SIGNAL(toggled(bool)),this,TQT_SLOT(refresh(bool))); char line[200]="\0"; FILE *fp2; - seclist=QString::null; + seclist=TQString::null; fp2 = popen("gpg --no-secmem-warning --no-tty --with-colon --list-secret-keys ", "r"); while ( fgets( line, sizeof(line), fp2)) { - QString readLine=QString::fromUtf8(line); + TQString readLine=TQString::fromUtf8(line); if (readLine.startsWith("sec")) seclist+=", 0x"+readLine.section(":",4,4).right(8); } pclose(fp2); @@ -238,7 +238,7 @@ accept(); void popupPublic::enable() { - QListViewItem *current = keysList->firstChild(); + TQListViewItem *current = keysList->firstChild(); if (current==NULL) return; current->setVisible(true); @@ -252,7 +252,7 @@ void popupPublic::enable() void popupPublic::sort() { bool reselect=false; - QListViewItem *current = keysList->firstChild(); + TQListViewItem *current = keysList->firstChild(); if (current==NULL) return; @@ -276,7 +276,7 @@ void popupPublic::sort() } if (reselect || !keysList->currentItem()->isVisible()) { - QListViewItem *firstvisible; + TQListViewItem *firstvisible; firstvisible=keysList->firstChild(); while (firstvisible->isVisible()!=true) { firstvisible=firstvisible->nextSibling(); @@ -297,14 +297,14 @@ void popupPublic::isSymetric(bool state) } -void popupPublic::customOpts(const QString &str) +void popupPublic::customOpts(const TQString &str) { customOptions=str; } void popupPublic::slotGotoDefaultKey() { - QListViewItem *myDefaulKey = keysList->findItem(KGpgSettings::defaultKey(),2); + TQListViewItem *myDefaulKey = keysList->findItem(KGpgSettings::defaultKey(),2); keysList->clearSelection(); keysList->setCurrentItem(myDefaulKey); keysList->setSelected(myDefaulKey,true); @@ -322,29 +322,29 @@ void popupPublic::refresh(bool state) void popupPublic::refreshkeys() { keysList->clear(); - QStringList groups= QStringList::split(",", KGpgSettings::groups()); + TQStringList groups= TQStringList::split(",", KGpgSettings::groups()); if (!groups.isEmpty()) { - for ( QStringList::Iterator it = groups.begin(); it != groups.end(); ++it ) + for ( TQStringList::Iterator it = groups.begin(); it != groups.end(); ++it ) { - if (!QString(*it).isEmpty()) + if (!TQString(*it).isEmpty()) { - UpdateViewItem2 *item=new UpdateViewItem2(keysList,QString(*it),QString::null,QString::null,false); + UpdateViewItem2 *item=new UpdateViewItem2(keysList,TQString(*it),TQString::null,TQString::null,false); item->setPixmap(0,keyGroup); } } } - KProcIO *encid=new KProcIO(QTextCodec::codecForLocale()); + KProcIO *encid=new KProcIO(TQTextCodec::codecForLocale()); *encid << "gpg"<<"--no-secmem-warning"<<"--no-tty"<<"--with-colon"<<"--list-keys"; ///////// when process ends, update dialog infos - QObject::connect(encid, SIGNAL(processExited(KProcess *)),this, SLOT(slotpreselect())); - QObject::connect(encid, SIGNAL(readReady(KProcIO *)),this, SLOT(slotprocread(KProcIO *))); + TQObject::connect(encid, TQT_SIGNAL(processExited(KProcess *)),this, TQT_SLOT(slotpreselect())); + TQObject::connect(encid, TQT_SIGNAL(readReady(KProcIO *)),this, TQT_SLOT(slotprocread(KProcIO *))); encid->start(KProcess::NotifyOnExit,true); } void popupPublic::slotpreselect() { -QListViewItem *it=NULL; +TQListViewItem *it=NULL; if (!keysList->firstChild()) return; if (fmode) it=keysList->findItem(KGpgSettings::defaultKey(),2); if (!trusted) @@ -368,20 +368,20 @@ void popupPublic::slotprocread(KProcIO *p) { ///////////////////////////////////////////////////////////////// extract encryption keys bool dead; - QString tst,keyname,keymail; + TQString tst,keyname,keymail; - QString defaultKey = KGpgSettings::defaultKey().right(8); + TQString defaultKey = KGpgSettings::defaultKey().right(8); while (p->readln(tst)!=-1) { if (tst.startsWith("pub")) { - QStringList keyString=QStringList::split(":",tst,true); + TQStringList keyString=TQStringList::split(":",tst,true); dead=false; - const QString trust=keyString[1]; - QString val=keyString[6]; - QString id=QString("0x"+keyString[4].right(8)); + const TQString trust=keyString[1]; + TQString val=keyString[6]; + TQString id=TQString("0x"+keyString[4].right(8)); if (val.isEmpty()) val=i18n("Unlimited"); - QString tr; + TQString tr; switch( trust[0] ) { case 'o': untrustedList<<id; @@ -424,7 +424,7 @@ void popupPublic::slotprocread(KProcIO *p) //if (keyname.find("(")!=-1) // keyname=keyname.section('(',0,0); } else { - keymail=QString::null; + keymail=TQString::null; keyname=tst;//.section('(',0,0); } if ((!dead) && (!tst.isEmpty())) { @@ -447,9 +447,9 @@ void popupPublic::slotOk() { ////// emit selected data kdDebug(2100)<<"Ok pressed"<<endl; - QStringList selectedKeys; - QString userid; - QPtrList<QListViewItem> list=keysList->selectedItems(); + TQStringList selectedKeys; + TQString userid; + TQPtrList<TQListViewItem> list=keysList->selectedItems(); for ( uint i = 0; i < list.count(); ++i ) if ( list.at(i) && list.at(i)->isVisible()) { @@ -460,7 +460,7 @@ kdDebug(2100)<<"Ok pressed"<<endl; return; if (CBsymmetric->isChecked()) selectedKeys=NULL; kdDebug(2100)<<"Selected Key:"<<selectedKeys<<endl; - QStringList returnOptions; + TQStringList returnOptions; if (CBuntrusted->isChecked()) returnOptions<<"--always-trust"; if (CBarmor->isChecked()) @@ -468,7 +468,7 @@ kdDebug(2100)<<"Selected Key:"<<selectedKeys<<endl; if (CBhideid->isChecked()) returnOptions<<"--throw-keyid"; if ((KGpgSettings::allowCustomEncryptionOptions()) && (!customOptions.stripWhiteSpace().isEmpty())) - returnOptions.operator+ (QStringList::split(QString(" "),customOptions.simplifyWhiteSpace())); + returnOptions.operator+ (TQStringList::split(TQString(" "),customOptions.simplifyWhiteSpace())); //hide(); if (fmode) emit selectedKey(selectedKeys,returnOptions,CBshred->isChecked(),CBsymmetric->isChecked()); diff --git a/kgpg/popuppublic.h b/kgpg/popuppublic.h index e0d2bb5..e158adc 100644 --- a/kgpg/popuppublic.h +++ b/kgpg/popuppublic.h @@ -34,22 +34,22 @@ class popupPublic : public KDialogBase //QDialog Q_OBJECT public: - popupPublic(QWidget *parent=0, const char *name=0,QString sfile="",bool filemode=false,KShortcut goDefaultKey=QKeySequence(CTRL+Qt::Key_Home)); + popupPublic(TQWidget *parent=0, const char *name=0,TQString sfile="",bool filemode=false,KShortcut goDefaultKey=TQKeySequence(CTRL+Qt::Key_Home)); ~popupPublic(); KListView *keysList; - QCheckBox *CBarmor,*CBuntrusted,*CBshred,*CBsymmetric,*CBhideid; + TQCheckBox *CBarmor,*CBuntrusted,*CBshred,*CBsymmetric,*CBhideid; bool fmode,trusted; - QPixmap keyPair,keySingle,keyGroup; - QString seclist; - QStringList untrustedList; + TQPixmap keyPair,keySingle,keyGroup; + TQString seclist; + TQStringList untrustedList; private: KConfig *config; - QButtonGroup *boutonboxoptions; - QString customOptions; + TQButtonGroup *boutonboxoptions; + TQString customOptions; private slots: - void customOpts(const QString &); + void customOpts(const TQString &); void slotprocread(KProcIO *); void slotpreselect(); void refreshkeys(); @@ -67,7 +67,7 @@ protected slots: virtual void slotOk(); signals: - void selectedKey(QStringList ,QStringList,bool,bool); + void selectedKey(TQStringList ,TQStringList,bool,bool); void keyListFilled(); }; diff --git a/khexedit/bitswapwidget.cc b/khexedit/bitswapwidget.cc index 212d126..70a5a22 100644 --- a/khexedit/bitswapwidget.cc +++ b/khexedit/bitswapwidget.cc @@ -18,14 +18,14 @@ * */ -#include <qpainter.h> +#include <tqpainter.h> #include <kglobalsettings.h> #include "bitswapwidget.h" -CDigitLabel::CDigitLabel( QWidget *parent, uint digit, const char *name ) - :QLabel(parent, name), mDigit( digit ), mDotPosition( 0 ) +CDigitLabel::CDigitLabel( TQWidget *parent, uint digit, const char *name ) + :TQLabel(parent, name), mDigit( digit ), mDotPosition( 0 ) { setFocusPolicy( StrongFocus ); initialize(); @@ -38,13 +38,13 @@ CDigitLabel::~CDigitLabel( void ) void CDigitLabel::initialize( void ) { - QFont font( KGlobalSettings::generalFont() ); + TQFont font( KGlobalSettings::generalFont() ); font.setBold( true ); setFont( font ); } -void CDigitLabel::paletteChange( const QPalette & ) +void CDigitLabel::paletteChange( const TQPalette & ) { update(); } @@ -81,10 +81,10 @@ void CDigitLabel::setDotPosition( uint dotPosition ) -QSize CDigitLabel::sizeHint( void ) const +TQSize CDigitLabel::sizeHint( void ) const { int h = fontMetrics().height(); - QSize s( h, h ); // Retangular + TQSize s( h, h ); // Retangular return( s ); } @@ -92,9 +92,9 @@ QSize CDigitLabel::sizeHint( void ) const #include <stdio.h> -void CDigitLabel::drawContents( QPainter *p ) +void CDigitLabel::drawContents( TQPainter *p ) { - QRect cr = contentsRect(); + TQRect cr = contentsRect(); if( hasFocus() == true ) { @@ -130,7 +130,7 @@ void CDigitLabel::drawContents( QPainter *p ) */ } - QString text; + TQString text; text.setNum( mDigit ); p->drawText( 0, 0, cr.width(), cr.height(), alignment(), text ); @@ -139,7 +139,7 @@ void CDigitLabel::drawContents( QPainter *p ) } -void CDigitLabel::keyPressEvent( QKeyEvent *e ) +void CDigitLabel::keyPressEvent( TQKeyEvent *e ) { switch ( e->key() ) { @@ -174,22 +174,22 @@ void CDigitLabel::keyPressEvent( QKeyEvent *e ) -CByteWidget::CByteWidget( QWidget *parent, const char *name ) - :QWidget(parent, name) +CByteWidget::CByteWidget( TQWidget *parent, const char *name ) + :TQWidget(parent, name) { - mHBox = new QHBoxLayout( this, 0 ); + mHBox = new TQHBoxLayout( this, 0 ); for( uint i=0; i<8; i++ ) { mDigit[i] = new CDigitLabel( this, 7-i ); mDigit[i]->setLineWidth( 1 ); mDigit[i]->setFixedSize( mDigit[i]->sizeHint()*2 ); - mDigit[i]->setFrameStyle( QFrame::Panel | QFrame::Sunken ); + mDigit[i]->setFrameStyle( TQFrame::Panel | TQFrame::Sunken ); mDigit[i]->setAlignment( AlignCenter ); - connect( mDigit[i], SIGNAL(stepCell(const QObject *, bool )), - this, SLOT(stepCell(const QObject *, bool ))); - connect( mDigit[i], SIGNAL(valueChanged(const QObject *, uint, bool )), - this, SLOT(valueChanged(const QObject *, uint, bool ))); + connect( mDigit[i], TQT_SIGNAL(stepCell(const TQObject *, bool )), + this, TQT_SLOT(stepCell(const TQObject *, bool ))); + connect( mDigit[i], TQT_SIGNAL(valueChanged(const TQObject *, uint, bool )), + this, TQT_SLOT(valueChanged(const TQObject *, uint, bool ))); mHBox->addWidget( mDigit[i] ); } @@ -202,7 +202,7 @@ CByteWidget::~CByteWidget( void ) delete mHBox; } -void CByteWidget::stepCell( const QObject *obj, bool next ) +void CByteWidget::stepCell( const TQObject *obj, bool next ) { for( uint i=0; i<8; i++ ) { @@ -222,7 +222,7 @@ void CByteWidget::stepCell( const QObject *obj, bool next ) -void CByteWidget::valueChanged( const QObject *obj, uint val, bool after ) +void CByteWidget::valueChanged( const TQObject *obj, uint val, bool after ) { if( after == false ) { @@ -278,7 +278,7 @@ void CByteWidget::reset( void ) } -void CByteWidget::setBuddy( const QObject *obj ) +void CByteWidget::setBuddy( const TQObject *obj ) { for( uint i=0; i<8; i++ ) { @@ -298,7 +298,7 @@ void CByteWidget::setBuddy( const QObject *obj ) -bool CByteWidget::flag( QByteArray &buf ) +bool CByteWidget::flag( TQByteArray &buf ) { bool swapPresent = false; uint i, j; diff --git a/khexedit/bitswapwidget.h b/khexedit/bitswapwidget.h index f1d3582..9f54ab6 100644 --- a/khexedit/bitswapwidget.h +++ b/khexedit/bitswapwidget.h @@ -21,9 +21,9 @@ #ifndef _BITSWAP_WIDGET_H_ #define _BITSWAP_WIDGET_H_ -#include <qlabel.h> -#include <qlayout.h> -#include <qstring.h> +#include <tqlabel.h> +#include <tqlayout.h> +#include <tqstring.h> class CDigitLabel : public QLabel @@ -31,24 +31,24 @@ class CDigitLabel : public QLabel Q_OBJECT public: - CDigitLabel( QWidget *parent, uint digit = 0, const char *name=0 ); + CDigitLabel( TQWidget *parent, uint digit = 0, const char *name=0 ); ~CDigitLabel( void ); - virtual QSize sizeHint() const; + virtual TQSize sizeHint() const; inline uint value( void ); signals: - void stepCell( const QObject *obj, bool next ); - void valueChanged( const QObject *obj, uint newVal, bool after ); + void stepCell( const TQObject *obj, bool next ); + void valueChanged( const TQObject *obj, uint newVal, bool after ); public slots: void setValue( uint digit, bool notify ); void setDotPosition( uint dotPosition ); protected: - void paletteChange( const QPalette & ); - void drawContents( QPainter * ); - virtual void keyPressEvent( QKeyEvent *e ); + void paletteChange( const TQPalette & ); + void drawContents( TQPainter * ); + virtual void keyPressEvent( TQKeyEvent *e ); private: void initialize( void ); @@ -72,23 +72,23 @@ class CByteWidget : public QWidget Q_OBJECT public: - CByteWidget( QWidget *parent, const char *name=0 ); + CByteWidget( TQWidget *parent, const char *name=0 ); ~CByteWidget( void ); - bool flag( QByteArray &buf ); + bool flag( TQByteArray &buf ); public slots: void reset( void ); private slots: - void stepCell( const QObject *obj, bool next ); - void valueChanged( const QObject *obj, uint newVal, bool after ); + void stepCell( const TQObject *obj, bool next ); + void valueChanged( const TQObject *obj, uint newVal, bool after ); private: - void setBuddy( const QObject *obj ); + void setBuddy( const TQObject *obj ); private: - QHBoxLayout *mHBox; + TQHBoxLayout *mHBox; CDigitLabel *mDigit[8]; }; diff --git a/khexedit/chartabledialog.cc b/khexedit/chartabledialog.cc index 1914750..3f67b0e 100644 --- a/khexedit/chartabledialog.cc +++ b/khexedit/chartabledialog.cc @@ -20,10 +20,10 @@ #include <limits.h> -#include <qlabel.h> -#include <qheader.h> -#include <qlayout.h> -#include <qspinbox.h> +#include <tqlabel.h> +#include <tqheader.h> +#include <tqlayout.h> +#include <tqspinbox.h> #include <kglobalsettings.h> #include <klocale.h> @@ -32,16 +32,16 @@ #include "chartabledialog.h" -CCharTableDialog::CCharTableDialog( QWidget *parent, const char *name, +CCharTableDialog::CCharTableDialog( TQWidget *parent, const char *name, bool modal ) :KDialogBase( Plain, i18n("Character Table"), Help|User1|Cancel, User1, parent, name, modal, true, KStdGuiItem::insert()) { updateGeometry(); - setHelp( "khexedit/khexedit.html", QString::null ); + setHelp( "khexedit/khexedit.html", TQString::null ); - QString text; - QVBoxLayout *topLayout = new QVBoxLayout( plainPage(), 0, spacingHint() ); + TQString text; + TQVBoxLayout *topLayout = new TQVBoxLayout( plainPage(), 0, spacingHint() ); if( topLayout == 0 ) { return; } mCharacterList = new CListView( plainPage(), "characterList" ); @@ -52,27 +52,27 @@ CCharTableDialog::CCharTableDialog( QWidget *parent, const char *name, mCharacterList->addColumn( i18n("Binary") ); mCharacterList->addColumn( i18n("Text") ); mCharacterList->setAllColumnsShowFocus( true ); - mCharacterList->setFrameStyle( QFrame::WinPanel + QFrame::Sunken ); + mCharacterList->setFrameStyle( TQFrame::WinPanel + TQFrame::Sunken ); mCharacterList->setSorting( -1 ); // // I am setting the min. size below // - //connect( mCharacterList, SIGNAL(doubleClicked(QListViewItem *) ), - //SLOT(startAssign(QListViewItem *))); + //connect( mCharacterList, TQT_SIGNAL(doubleClicked(TQListViewItem *) ), + //TQT_SLOT(startAssign(TQListViewItem *))); topLayout->addWidget( mCharacterList, 10 ); - QHBoxLayout *hbox = new QHBoxLayout(); + TQHBoxLayout *hbox = new TQHBoxLayout(); if( hbox == 0 ) { return; } topLayout->addLayout( hbox ); text = i18n("Insert this number of characters:"); - QLabel *label = new QLabel( text, plainPage() ); + TQLabel *label = new TQLabel( text, plainPage() ); label->setFixedWidth( label->sizeHint().width() ); hbox->addWidget( label ); - mInputCountSpin = new QSpinBox( plainPage(), "spin" ); + mInputCountSpin = new TQSpinBox( plainPage(), "spin" ); mInputCountSpin->setMinimumWidth( fontMetrics().maxWidth()*7 ); mInputCountSpin->setRange( 1, INT_MAX ); mInputCountSpin->setValue( 1 ); @@ -106,8 +106,8 @@ const char *printBinary( uint val ) void CCharTableDialog::createListData( void ) { - QString d, h, o, b, c; - QListViewItem *item = 0; + TQString d, h, o, b, c; + TQListViewItem *item = 0; char buf[10]; memset( buf, 0, sizeof( buf ) ); @@ -119,16 +119,16 @@ void CCharTableDialog::createListData( void ) o.sprintf("%03o", i ); b.sprintf("%s", printBinary(i) ); - if( QChar((char)i).isPrint() == true ) + if( TQChar((char)i).isPrint() == true ) { - c = QChar((char)i); + c = TQChar((char)i); } else { - c = QChar('.'); + c = TQChar('.'); } - item = new QListViewItem( mCharacterList, item, d, h, o, b, c ); + item = new TQListViewItem( mCharacterList, item, d, h, o, b, c ); if( i == 0 ) { mCharacterList->setSelected( item, true ); @@ -140,7 +140,7 @@ void CCharTableDialog::createListData( void ) void CCharTableDialog::slotUser1( void ) // Insert { - QListViewItem *item = mCharacterList->selectedItem(); + TQListViewItem *item = mCharacterList->selectedItem(); if( item != 0 ) { startAssign( item ); @@ -148,9 +148,9 @@ void CCharTableDialog::slotUser1( void ) // Insert } -void CCharTableDialog::startAssign( QListViewItem *item ) +void CCharTableDialog::startAssign( TQListViewItem *item ) { - QByteArray buf; + TQByteArray buf; if( buf.fill( item->text(0).toInt(), mInputCountSpin->value() ) == false ) { return; @@ -161,7 +161,7 @@ void CCharTableDialog::startAssign( QListViewItem *item ) void CCharTableDialog::setColumnWidth( void ) { - const QFontMetrics &fm = mCharacterList->fontMetrics(); + const TQFontMetrics &fm = mCharacterList->fontMetrics(); int w0, w1, w2, w3, w4; w0 = -fm.minLeftBearing() - fm.minRightBearing() + 8 + fm.maxWidth(); @@ -195,13 +195,13 @@ void CCharTableDialog::setColumnWidth( void ) } -void CCharTableDialog::resizeEvent( QResizeEvent * ) +void CCharTableDialog::resizeEvent( TQResizeEvent * ) { setColumnWidth(); } -void CCharTableDialog::showEvent( QShowEvent *e ) +void CCharTableDialog::showEvent( TQShowEvent *e ) { KDialogBase::showEvent(e); setColumnWidth(); diff --git a/khexedit/chartabledialog.h b/khexedit/chartabledialog.h index a35246b..09f1485 100644 --- a/khexedit/chartabledialog.h +++ b/khexedit/chartabledialog.h @@ -37,26 +37,26 @@ class CCharTableDialog : public KDialogBase Q_OBJECT public: - CCharTableDialog( QWidget *parent=0, const char *name=0,bool modal=false ); + CCharTableDialog( TQWidget *parent=0, const char *name=0,bool modal=false ); ~CCharTableDialog( void ); signals: - void assign( const QByteArray &buf ); + void assign( const TQByteArray &buf ); protected slots: virtual void slotUser1( void ); - virtual void startAssign( QListViewItem * ); + virtual void startAssign( TQListViewItem * ); protected: - virtual void resizeEvent( QResizeEvent *e ); - virtual void showEvent( QShowEvent *e ); + virtual void resizeEvent( TQResizeEvent *e ); + virtual void showEvent( TQShowEvent *e ); private: void createListData( void ); void setColumnWidth( void ); private: - QSpinBox *mInputCountSpin; + TQSpinBox *mInputCountSpin; CListView *mCharacterList; }; diff --git a/khexedit/conversion.cc b/khexedit/conversion.cc index 7a5c25c..7eeea5d 100644 --- a/khexedit/conversion.cc +++ b/khexedit/conversion.cc @@ -41,9 +41,9 @@ const SEncodeState &CConversion::state( void ) return( mState ); } -QString CConversion::names( unsigned int index ) +TQString CConversion::names( unsigned int index ) { - static const QString strings[4] = + static const TQString strings[4] = { i18n("Default encoding", "Default"), i18n("EBCDIC"), @@ -298,7 +298,7 @@ void CConversion::setMode( EMode cnvMode ) -int CConversion::convert( QByteArray &buf, EMode newMode, CProgress &p ) +int CConversion::convert( TQByteArray &buf, EMode newMode, CProgress &p ) { if( newMode == mode() ) { @@ -316,7 +316,7 @@ int CConversion::convert( QByteArray &buf, EMode newMode, CProgress &p ) // // Make backup // - const QByteArray tmp( buf.copy() ); + const TQByteArray tmp( buf.copy() ); if( tmp.isEmpty() ) { p.finish(); diff --git a/khexedit/conversion.h b/khexedit/conversion.h index ef453ca..76a055b 100644 --- a/khexedit/conversion.h +++ b/khexedit/conversion.h @@ -21,7 +21,7 @@ #ifndef _CONVERSION_H_ #define _CONVERSION_H_ -#include <qstring.h> +#include <tqstring.h> #include "progress.h" @@ -29,7 +29,7 @@ struct SEncodeState { unsigned int mode; - QString name; + TQString name; }; @@ -46,7 +46,7 @@ class CConversion public: CConversion( void ); - int convert( QByteArray &buf, EMode mode, CProgress &p ); + int convert( TQByteArray &buf, EMode mode, CProgress &p ); bool lossless( EMode cnvMode ); EMode mode( void ); @@ -58,7 +58,7 @@ class CConversion } private: - QString names( unsigned int index ); + TQString names( unsigned int index ); const unsigned char *tables( EMode cnvMode ); void setMode( EMode cnvMode ); diff --git a/khexedit/converterdialog.cc b/khexedit/converterdialog.cc index f8dd9be..6f3a82e 100644 --- a/khexedit/converterdialog.cc +++ b/khexedit/converterdialog.cc @@ -19,8 +19,8 @@ */ -#include <qlabel.h> -#include <qlayout.h> +#include <tqlabel.h> +#include <tqlayout.h> #include <klocale.h> @@ -28,14 +28,14 @@ #include "hexvalidator.h" -CValidateLineEdit::CValidateLineEdit( QWidget *parent, int validateType, +CValidateLineEdit::CValidateLineEdit( TQWidget *parent, int validateType, const char *name ) - :QLineEdit( parent, name ), mBusy(false) + :TQLineEdit( parent, name ), mBusy(false) { mValidator = new CHexValidator( this, (CHexValidator::EState)validateType ); setValidator( mValidator ); - connect( this, SIGNAL(textChanged(const QString &)), - this, SLOT(convertText(const QString &)) ); + connect( this, TQT_SIGNAL(textChanged(const TQString &)), + this, TQT_SLOT(convertText(const TQString &)) ); } @@ -44,20 +44,20 @@ CValidateLineEdit::~CValidateLineEdit( void ) } -void CValidateLineEdit::setData( const QByteArray &buf ) +void CValidateLineEdit::setData( const TQByteArray &buf ) { if( mBusy == false ) { - QString text; + TQString text; mValidator->format( text, buf ); setText( text ); } } -void CValidateLineEdit::convertText( const QString &text ) +void CValidateLineEdit::convertText( const TQString &text ) { - QByteArray buf; + TQByteArray buf; mValidator->convert( buf, text ); mBusy = true; // Don't update while editing emit dataChanged( buf ); @@ -66,27 +66,27 @@ void CValidateLineEdit::convertText( const QString &text ) -CConverterDialog::CConverterDialog( QWidget *parent, const char *name, +CConverterDialog::CConverterDialog( TQWidget *parent, const char *name, bool modal ) :KDialogBase( parent, name, modal, i18n("Converter"), Cancel|User2|User1, Cancel, true, KStdGuiItem::clear(), i18n("&On Cursor") ) { - QWidget *page = new QWidget( this ); + TQWidget *page = new TQWidget( this ); setMainWidget( page ); - QGridLayout *topLayout = new QGridLayout( page, 6, 2, 0, spacingHint() ); + TQGridLayout *topLayout = new TQGridLayout( page, 6, 2, 0, spacingHint() ); topLayout->setRowStretch( 5, 10 ); topLayout->setColStretch( 1, 10 ); - QLabel *label = new QLabel( i18n("Hexadecimal:"), page ); + TQLabel *label = new TQLabel( i18n("Hexadecimal:"), page ); topLayout->addWidget( label, 0, 0 ); - label = new QLabel( i18n("Decimal:"), page ); + label = new TQLabel( i18n("Decimal:"), page ); topLayout->addWidget( label, 1, 0 ); - label = new QLabel( i18n("Octal:"), page ); + label = new TQLabel( i18n("Octal:"), page ); topLayout->addWidget( label, 2, 0 ); - label = new QLabel( i18n("Binary:"), page ); + label = new TQLabel( i18n("Binary:"), page ); topLayout->addWidget( label, 3, 0 ); - label = new QLabel( i18n("Text:"), page ); + label = new TQLabel( i18n("Text:"), page ); topLayout->addWidget( label, 4, 0 ); mHexInput = new CValidateLineEdit( page, CHexValidator::hexadecimal ); @@ -101,16 +101,16 @@ CConverterDialog::CConverterDialog( QWidget *parent, const char *name, mTxtInput = new CValidateLineEdit( page, CHexValidator::regularText ); topLayout->addWidget( mTxtInput, 4, 1 ); - connect( mHexInput, SIGNAL(dataChanged(const QByteArray &)), - this, SLOT(setData(const QByteArray &)) ); - connect( mDecInput, SIGNAL(dataChanged(const QByteArray &)), - this, SLOT(setData(const QByteArray &)) ); - connect( mOctInput, SIGNAL(dataChanged(const QByteArray &)), - this, SLOT(setData(const QByteArray &)) ); - connect( mBinInput, SIGNAL(dataChanged(const QByteArray &)), - this, SLOT(setData(const QByteArray &)) ); - connect( mTxtInput, SIGNAL(dataChanged(const QByteArray &)), - this, SLOT(setData(const QByteArray &)) ); + connect( mHexInput, TQT_SIGNAL(dataChanged(const TQByteArray &)), + this, TQT_SLOT(setData(const TQByteArray &)) ); + connect( mDecInput, TQT_SIGNAL(dataChanged(const TQByteArray &)), + this, TQT_SLOT(setData(const TQByteArray &)) ); + connect( mOctInput, TQT_SIGNAL(dataChanged(const TQByteArray &)), + this, TQT_SLOT(setData(const TQByteArray &)) ); + connect( mBinInput, TQT_SIGNAL(dataChanged(const TQByteArray &)), + this, TQT_SLOT(setData(const TQByteArray &)) ); + connect( mTxtInput, TQT_SIGNAL(dataChanged(const TQByteArray &)), + this, TQT_SLOT(setData(const TQByteArray &)) ); } @@ -120,14 +120,14 @@ CConverterDialog::~CConverterDialog( void ) } -void CConverterDialog::showEvent( QShowEvent *e ) +void CConverterDialog::showEvent( TQShowEvent *e ) { KDialogBase::showEvent(e); mHexInput->setFocus(); } -void CConverterDialog::setData( const QByteArray &data ) +void CConverterDialog::setData( const TQByteArray &data ) { mHexInput->blockSignals(true); mDecInput->blockSignals(true); @@ -148,13 +148,13 @@ void CConverterDialog::setData( const QByteArray &data ) void CConverterDialog::slotUser1( void ) // Clear { - QByteArray buf; + TQByteArray buf; setData( buf ); } void CConverterDialog::slotUser2( void ) // On Cursor { - QByteArray buf; + TQByteArray buf; emit probeCursorValue( buf, 1 ); setData( buf ); } diff --git a/khexedit/converterdialog.h b/khexedit/converterdialog.h index f84fe66..abcc432 100644 --- a/khexedit/converterdialog.h +++ b/khexedit/converterdialog.h @@ -21,28 +21,28 @@ #ifndef _CONVERTER_DIALOG_H_ #define _CONVERTER_DIALOG_H_ -#include <qlineedit.h> +#include <tqlineedit.h> #include <kdialogbase.h> class CHexValidator; -class CValidateLineEdit : public QLineEdit +class CValidateLineEdit : public TQLineEdit { Q_OBJECT public: - CValidateLineEdit( QWidget *parent, int validateType, const char *name=0 ); + CValidateLineEdit( TQWidget *parent, int validateType, const char *name=0 ); ~CValidateLineEdit( void ); public slots: - void setData( const QByteArray &buf ); + void setData( const TQByteArray &buf ); private slots: - void convertText( const QString &text ); + void convertText( const TQString &text ); signals: - void dataChanged( const QByteArray &buf ); + void dataChanged( const TQByteArray &buf ); private: bool mBusy; @@ -55,21 +55,21 @@ class CConverterDialog : public KDialogBase Q_OBJECT public: - CConverterDialog( QWidget *parent, const char *name=0, bool modal=true ); + CConverterDialog( TQWidget *parent, const char *name=0, bool modal=true ); ~CConverterDialog( void ); protected: - void showEvent( QShowEvent *e ); + void showEvent( TQShowEvent *e ); protected slots: virtual void slotUser1( void ); virtual void slotUser2( void ); private slots: - void setData( const QByteArray &data ); + void setData( const TQByteArray &data ); signals: - void probeCursorValue( QByteArray &buf, uint size ); + void probeCursorValue( TQByteArray &buf, uint size ); private: CValidateLineEdit *mHexInput; diff --git a/khexedit/dialog.cc b/khexedit/dialog.cc index 6ef1273..8bc2cbe 100644 --- a/khexedit/dialog.cc +++ b/khexedit/dialog.cc @@ -22,10 +22,10 @@ #include <iostream> #include <limits.h> -#include <qbuttongroup.h> -#include <qfileinfo.h> -#include <qlayout.h> -#include <qvalidator.h> +#include <tqbuttongroup.h> +#include <tqfileinfo.h> +#include <tqlayout.h> +#include <tqvalidator.h> #include <kfiledialog.h> #include <klocale.h> @@ -34,47 +34,47 @@ #include <kstdguiitem.h> #include "dialog.h" -#include <qpushbutton.h> +#include <tqpushbutton.h> -static const QStringList &formatStrings( void ); -static const QStringList &operationStrings( void ); +static const TQStringList &formatStrings( void ); +static const TQStringList &operationStrings( void ); -CGotoDialog::CGotoDialog( QWidget *parent, const char *name, bool modal ) +CGotoDialog::CGotoDialog( TQWidget *parent, const char *name, bool modal ) :KDialogBase( Plain, i18n("Goto Offset"), Ok|Cancel, Ok, parent, name, modal ) { - QVBoxLayout *topLayout = new QVBoxLayout( plainPage(), 0, spacingHint() ); + TQVBoxLayout *topLayout = new TQVBoxLayout( plainPage(), 0, spacingHint() ); if( topLayout == 0 ) { return; } - QVBoxLayout *vbox = new QVBoxLayout(); + TQVBoxLayout *vbox = new TQVBoxLayout(); if( vbox == 0 ) { return; } topLayout->addLayout( vbox ); - mComboBox = new QComboBox( true, plainPage() ); + mComboBox = new TQComboBox( true, plainPage() ); if( mComboBox == 0 ) { return; } mComboBox->setMaxCount( 10 ); - mComboBox->setInsertionPolicy( QComboBox::AtTop ); + mComboBox->setInsertionPolicy( TQComboBox::AtTop ); mComboBox->setMinimumWidth( fontMetrics().maxWidth()*17 ); - QLabel *label = new QLabel( mComboBox, i18n("O&ffset:"), plainPage() ); + TQLabel *label = new TQLabel( mComboBox, i18n("O&ffset:"), plainPage() ); if( label == 0 ) { return; } vbox->addWidget( label ); vbox->addWidget( mComboBox ); - QButtonGroup *group = new QButtonGroup( i18n("Options"), plainPage() ); + TQButtonGroup *group = new TQButtonGroup( i18n("Options"), plainPage() ); if( group == 0 ) { return; } topLayout->addWidget( group, 10 ); - QGridLayout *gbox = new QGridLayout( group, 4, 2, spacingHint() ); + TQGridLayout *gbox = new TQGridLayout( group, 4, 2, spacingHint() ); if( gbox == 0 ) { return; } gbox->addRowSpacing( 0, fontMetrics().lineSpacing() ); - mCheckFromCursor = new QCheckBox( i18n("&From cursor"), group ); + mCheckFromCursor = new TQCheckBox( i18n("&From cursor"), group ); gbox->addWidget( mCheckFromCursor, 1, 0 ); - mCheckBackward = new QCheckBox( i18n("&Backwards"), group ); + mCheckBackward = new TQCheckBox( i18n("&Backwards"), group ); gbox->addWidget( mCheckBackward, 1, 1 ); - mCheckVisible = new QCheckBox( i18n("&Stay visible"), group ); + mCheckVisible = new TQCheckBox( i18n("&Stay visible"), group ); gbox->addWidget( mCheckVisible, 2, 0 ); gbox->setRowStretch( 3, 10 ); @@ -99,7 +99,7 @@ CGotoDialog::~CGotoDialog( void ) -void CGotoDialog::showEvent( QShowEvent *e ) +void CGotoDialog::showEvent( TQShowEvent *e ) { KDialogBase::showEvent(e); mComboBox->setFocus(); @@ -118,7 +118,7 @@ void CGotoDialog::slotOk( void ) bool success = stringToOffset( mComboBox->currentText(), offset ); if( success == false ) { - showEntryFailure( this, QString("") ); + showEntryFailure( this, TQString("") ); return; } @@ -174,61 +174,61 @@ void CGotoDialog::slotOk( void ) -CFindDialog::CFindDialog( QWidget *parent, const char *name, bool modal ) +CFindDialog::CFindDialog( TQWidget *parent, const char *name, bool modal ) :KDialogBase( Plain, i18n("Find"), Ok|Cancel, Ok, parent, name, modal ) { - QVBoxLayout *topLayout = new QVBoxLayout( plainPage(), 0, spacingHint() ); + TQVBoxLayout *topLayout = new TQVBoxLayout( plainPage(), 0, spacingHint() ); if( topLayout == 0 ) { return; } - QVBoxLayout *vbox = new QVBoxLayout(); + TQVBoxLayout *vbox = new TQVBoxLayout(); if( vbox == 0 ) { return; } topLayout->addLayout( vbox ); - mSelector = new QComboBox( false, plainPage() ); + mSelector = new TQComboBox( false, plainPage() ); if( mSelector == 0 ) { return; } mSelector->setMinimumWidth( fontMetrics().maxWidth()*17 ); mSelector->insertStringList( formatStrings() ); - connect( mSelector, SIGNAL(activated(int)), SLOT(selectorChanged(int)) ); + connect( mSelector, TQT_SIGNAL(activated(int)), TQT_SLOT(selectorChanged(int)) ); - QLabel *label = new QLabel( mSelector, i18n("Fo&rmat:"), plainPage() ); + TQLabel *label = new TQLabel( mSelector, i18n("Fo&rmat:"), plainPage() ); if( label == 0 ) { return; } vbox->addWidget( label ); vbox->addWidget( mSelector ); - mInput = new QLineEdit( plainPage() ); + mInput = new TQLineEdit( plainPage() ); if( mInput == 0 ) { return; } mInput->setMinimumWidth( fontMetrics().maxWidth()*17 ); - connect( mInput, SIGNAL(textChanged(const QString&)), - SLOT(inputChanged(const QString&)) ); + connect( mInput, TQT_SIGNAL(textChanged(const TQString&)), + TQT_SLOT(inputChanged(const TQString&)) ); mFindValidator = new CHexValidator( this, CHexValidator::regularText ); if( mFindValidator == 0 ) { return; } mInput->setValidator( mFindValidator ); - label = new QLabel( mInput, i18n("F&ind:"), plainPage() ); + label = new TQLabel( mInput, i18n("F&ind:"), plainPage() ); if( label == 0 ) { return; } vbox->addWidget( label ); vbox->addWidget( mInput ); - QButtonGroup *group = new QButtonGroup( i18n("Options"), plainPage() ); + TQButtonGroup *group = new TQButtonGroup( i18n("Options"), plainPage() ); if( group == 0 ) { return; } topLayout->addWidget( group, 10 ); - QGridLayout *gbox = new QGridLayout( group, 5, 2, spacingHint() ); + TQGridLayout *gbox = new TQGridLayout( group, 5, 2, spacingHint() ); if( gbox == 0 ) { return; } gbox->addRowSpacing( 0, fontMetrics().lineSpacing() ); - mCheckFromCursor = new QCheckBox( i18n("&From cursor"), group ); + mCheckFromCursor = new TQCheckBox( i18n("&From cursor"), group ); gbox->addWidget( mCheckFromCursor, 1, 0 ); - mCheckBackward = new QCheckBox( i18n("&Backwards"), group ); + mCheckBackward = new TQCheckBox( i18n("&Backwards"), group ); gbox->addWidget( mCheckBackward, 1, 1 ); - mCheckInSelection = new QCheckBox( i18n("&In selection"), group ); + mCheckInSelection = new TQCheckBox( i18n("&In selection"), group ); gbox->addWidget( mCheckInSelection, 2, 0 ); - mCheckUseNavigator = new QCheckBox( i18n("&Use navigator"),group); + mCheckUseNavigator = new TQCheckBox( i18n("&Use navigator"),group); gbox->addWidget( mCheckUseNavigator, 2, 1 ); - mCheckIgnoreCase = new QCheckBox( i18n("Ignore c&ase"),group); + mCheckIgnoreCase = new TQCheckBox( i18n("Ignore c&ase"),group); gbox->addWidget( mCheckIgnoreCase, 3, 0 ); gbox->setRowStretch( 4, 10 ); @@ -268,7 +268,7 @@ void CFindDialog::selectorChanged( int index ) } -void CFindDialog::inputChanged( const QString &text ) +void CFindDialog::inputChanged( const TQString &text ) { mFindString[ mSelector->currentItem() ] = text; mFindValidator->convert( mFindData, @@ -277,7 +277,7 @@ void CFindDialog::inputChanged( const QString &text ) } -void CFindDialog::showEvent( QShowEvent *e ) +void CFindDialog::showEvent( TQShowEvent *e ) { KDialogBase::showEvent(e); mInput->setFocus(); @@ -294,7 +294,7 @@ void CFindDialog::slotOk( void ) { if( isEmpty() == true ) { - showEntryFailure( this, QString("") ); + showEntryFailure( this, TQString("") ); return; } @@ -315,7 +315,7 @@ void CFindDialog::findAgain( EOperation operation ) { if( isEmpty() == true ) { - showEntryFailure( this, QString("") ); + showEntryFailure( this, TQString("") ); return; } @@ -343,29 +343,29 @@ void CFindDialog::findAgain( EOperation operation ) -CFindNavigatorDialog::CFindNavigatorDialog( QWidget *parent, const char *name, +CFindNavigatorDialog::CFindNavigatorDialog( TQWidget *parent, const char *name, bool modal ) :KDialogBase( Plain, i18n("Find (Navigator)"), User3|User2|User1|Close, User2, parent, name, modal, true, i18n("New &Key"), i18n("&Next"), i18n("&Previous") ) { - QString text; - QBoxLayout *topLayout = new QVBoxLayout( plainPage(), 0, spacingHint() ); + TQString text; + TQBoxLayout *topLayout = new TQVBoxLayout( plainPage(), 0, spacingHint() ); if( topLayout == 0 ) { return; } topLayout->addSpacing( spacingHint() ); // A little bit extra space - QHBoxLayout *hbox = new QHBoxLayout(); + TQHBoxLayout *hbox = new TQHBoxLayout(); if( hbox == 0 ) { return; } topLayout->addLayout( hbox ); text = i18n("Searching for:"); - QLabel *label = new QLabel( text, plainPage() ); + TQLabel *label = new TQLabel( text, plainPage() ); hbox->addWidget( label ); - mKey = new QLineEdit( plainPage() ); + mKey = new TQLineEdit( plainPage() ); mKey->setMinimumWidth( fontMetrics().width("M") * 20 ); - mKey->setFocusPolicy( QWidget::NoFocus ); + mKey->setFocusPolicy( TQWidget::NoFocus ); hbox->addWidget( mKey ); topLayout->addSpacing( spacingHint() ); // A little bit extra space @@ -391,7 +391,7 @@ void CFindNavigatorDialog::defineData( SSearchControl &sc ) if( mSearchControl.keyType == 0 ) { - QString str; + TQString str; for( uint i=0; i<mSearchControl.key.size(); i++ ) { str += mSearchControl.key[i]; @@ -401,19 +401,19 @@ void CFindNavigatorDialog::defineData( SSearchControl &sc ) } else if( mSearchControl.keyType == 1 ) { - QString str("0x "); + TQString str("0x "); for( uint i=0; i<mSearchControl.key.size(); i++ ) { - str += QString().sprintf("%02X ", (unsigned char)mSearchControl.key[i]); + str += TQString().sprintf("%02X ", (unsigned char)mSearchControl.key[i]); } mKey->setText( str ); } else if( mSearchControl.keyType == 2 ) { - QString str; + TQString str; for( uint i=0; i<mSearchControl.key.size(); i++ ) { - str += QString().sprintf("%03o ", (unsigned char)mSearchControl.key[i]); + str += TQString().sprintf("%03o ", (unsigned char)mSearchControl.key[i]); } mKey->setText( str ); } @@ -422,7 +422,7 @@ void CFindNavigatorDialog::defineData( SSearchControl &sc ) char buf[10]; memset( buf, 0, sizeof( buf ) ); buf[8] = ' '; - QString str; + TQString str; for( uint i=0; i<mSearchControl.key.size(); i++ ) { unsigned char data = (unsigned char)mSearchControl.key[i]; @@ -481,95 +481,95 @@ void CFindNavigatorDialog::done( int resultCode ) -CReplaceDialog::CReplaceDialog( QWidget *parent, const char *name, bool modal ) +CReplaceDialog::CReplaceDialog( TQWidget *parent, const char *name, bool modal ) :KDialogBase( Plain, i18n("Find & Replace"), Ok|Cancel, Ok, parent, name, modal ) { - QString text; - QVBoxLayout *topLayout = new QVBoxLayout( plainPage(), 0, spacingHint() ); + TQString text; + TQVBoxLayout *topLayout = new TQVBoxLayout( plainPage(), 0, spacingHint() ); if( topLayout == 0 ) { return; } - QVBoxLayout *vbox = new QVBoxLayout(); + TQVBoxLayout *vbox = new TQVBoxLayout(); if( vbox == 0 ) { return; } topLayout->addLayout( vbox ); - mFindSelector = new QComboBox( false, plainPage() ); + mFindSelector = new TQComboBox( false, plainPage() ); if( mFindSelector == 0 ) { return; } mFindSelector->setMinimumWidth( fontMetrics().maxWidth()*17 ); mFindSelector->insertStringList( formatStrings() ); - connect( mFindSelector, SIGNAL(activated(int)), - SLOT(findSelectorChanged(int)) ); + connect( mFindSelector, TQT_SIGNAL(activated(int)), + TQT_SLOT(findSelectorChanged(int)) ); text = i18n("Fo&rmat (find):"); - QLabel *label = new QLabel( mFindSelector, text, plainPage() ); + TQLabel *label = new TQLabel( mFindSelector, text, plainPage() ); if( label == 0 ) { return; } vbox->addWidget( label ); vbox->addWidget( mFindSelector ); - mFindInput = new QLineEdit( plainPage() ); + mFindInput = new TQLineEdit( plainPage() ); if( mFindInput == 0 ) { return; } mFindInput->setMinimumWidth( fontMetrics().maxWidth()*17 ); mFindValidator = new CHexValidator( this, CHexValidator::regularText ); if( mFindValidator == 0 ) { return; } mFindInput->setValidator( mFindValidator ); - connect( mFindInput, SIGNAL(textChanged(const QString&)), - SLOT(findInputChanged(const QString&)) ); + connect( mFindInput, TQT_SIGNAL(textChanged(const TQString&)), + TQT_SLOT(findInputChanged(const TQString&)) ); - label = new QLabel( mFindInput, i18n("F&ind:"), plainPage() ); + label = new TQLabel( mFindInput, i18n("F&ind:"), plainPage() ); if( label == 0 ) { return; } vbox->addWidget( label ); vbox->addWidget( mFindInput ); - mReplaceSelector = new QComboBox( false, plainPage() ); + mReplaceSelector = new TQComboBox( false, plainPage() ); if( mReplaceSelector == 0 ) { return; } mReplaceSelector->setMinimumWidth( fontMetrics().maxWidth()*17 ); mReplaceSelector->insertStringList( formatStrings() ); - connect( mReplaceSelector, SIGNAL(activated(int)), - SLOT(replaceSelectorChanged(int)) ); + connect( mReplaceSelector, TQT_SIGNAL(activated(int)), + TQT_SLOT(replaceSelectorChanged(int)) ); text = i18n("For&mat (replace):"); - label = new QLabel( mReplaceSelector, text, plainPage() ); + label = new TQLabel( mReplaceSelector, text, plainPage() ); if( label == 0 ) { return; } label->setFixedHeight( label->sizeHint().height() ); vbox->addWidget( label ); vbox->addWidget( mReplaceSelector ); - mReplaceInput = new QLineEdit( plainPage() ); + mReplaceInput = new TQLineEdit( plainPage() ); if( mReplaceInput == 0 ) { return; } mReplaceInput->setMinimumWidth( fontMetrics().maxWidth()*17 ); mReplaceValidator = new CHexValidator( this, CHexValidator::regularText ); if( mReplaceValidator == 0 ) { return; } mReplaceInput->setValidator( mReplaceValidator ); - connect( mReplaceInput, SIGNAL(textChanged(const QString&)), - SLOT(replaceInputChanged(const QString&)) ); + connect( mReplaceInput, TQT_SIGNAL(textChanged(const TQString&)), + TQT_SLOT(replaceInputChanged(const TQString&)) ); - label = new QLabel( mReplaceInput, i18n("Rep&lace:"), plainPage() ); + label = new TQLabel( mReplaceInput, i18n("Rep&lace:"), plainPage() ); if( label == 0 ) { return; } label->setFixedHeight( label->sizeHint().height() ); vbox->addWidget( label ); vbox->addWidget( mReplaceInput ); - QButtonGroup *group = new QButtonGroup( i18n("Options"), plainPage() ); + TQButtonGroup *group = new TQButtonGroup( i18n("Options"), plainPage() ); if( group == 0 ) { return; } topLayout->addWidget( group, 10 ); - QGridLayout *gbox = new QGridLayout( group, 5, 2, spacingHint() ); + TQGridLayout *gbox = new TQGridLayout( group, 5, 2, spacingHint() ); if( gbox == 0 ) { return; } gbox->addRowSpacing( 0, fontMetrics().lineSpacing() ); - mCheckFromCursor = new QCheckBox( i18n("&From cursor"), group ); + mCheckFromCursor = new TQCheckBox( i18n("&From cursor"), group ); gbox->addWidget( mCheckFromCursor, 1, 0 ); - mCheckBackward = new QCheckBox( i18n("&Backwards"), group ); + mCheckBackward = new TQCheckBox( i18n("&Backwards"), group ); gbox->addWidget( mCheckBackward, 1, 1 ); - mCheckInSelection = new QCheckBox( i18n("&In selection"), group ); + mCheckInSelection = new TQCheckBox( i18n("&In selection"), group ); gbox->addWidget( mCheckInSelection, 2, 0 ); - mCheckPrompt = new QCheckBox( i18n("&Prompt"), group ); + mCheckPrompt = new TQCheckBox( i18n("&Prompt"), group ); gbox->addWidget( mCheckPrompt, 2, 1 ); - mCheckIgnoreCase = new QCheckBox( i18n("Ignore c&ase"), group ); + mCheckIgnoreCase = new TQCheckBox( i18n("Ignore c&ase"), group ); gbox->addWidget( mCheckIgnoreCase, 3, 0 ); gbox->setRowStretch( 4, 10 ); @@ -613,7 +613,7 @@ void CReplaceDialog::findSelectorChanged( int index ) } -void CReplaceDialog::findInputChanged( const QString &text ) +void CReplaceDialog::findInputChanged( const TQString &text ) { mFindString[ mFindSelector->currentItem() ] = text; mFindValidator->convert( mFindData, @@ -629,7 +629,7 @@ void CReplaceDialog::replaceSelectorChanged( int index ) } -void CReplaceDialog::replaceInputChanged( const QString &text ) +void CReplaceDialog::replaceInputChanged( const TQString &text ) { mReplaceString[ mReplaceSelector->currentItem() ] = text; mReplaceValidator->convert( mReplaceData, @@ -637,7 +637,7 @@ void CReplaceDialog::replaceInputChanged( const QString &text ) } -void CReplaceDialog::showEvent( QShowEvent *e ) +void CReplaceDialog::showEvent( TQShowEvent *e ) { KDialogBase::showEvent(e); mFindInput->setFocus(); @@ -648,7 +648,7 @@ void CReplaceDialog::slotOk( void ) { if( mFindData.isEmpty() == true ) { - showEntryFailure( this, QString("") ); + showEntryFailure( this, TQString("") ); return; } @@ -676,20 +676,20 @@ void CReplaceDialog::slotOk( void ) -CReplacePromptDialog::CReplacePromptDialog( QWidget *parent, const char *name, +CReplacePromptDialog::CReplacePromptDialog( TQWidget *parent, const char *name, bool modal ) :KDialogBase( Plain, i18n("Find & Replace"), User3|User2|User1|Close, User2, parent, name, modal, true, i18n("Replace &All"), i18n("Do Not Replace"), i18n("Replace")) { - QString text; - QBoxLayout *topLayout = new QVBoxLayout( plainPage(), 0, spacingHint() ); + TQString text; + TQBoxLayout *topLayout = new TQVBoxLayout( plainPage(), 0, spacingHint() ); if( topLayout == 0 ) { return; } topLayout->addSpacing( spacingHint() ); // A little bit extra space text = i18n("Replace marked data at cursor position?"); - QLabel* label = new QLabel( text, plainPage() ); + TQLabel* label = new TQLabel( text, plainPage() ); topLayout->addWidget( label ); topLayout->addSpacing( spacingHint() ); // A little bit extra space @@ -757,39 +757,39 @@ void CReplacePromptDialog::done( int returnCode ) -CFilterDialog::CFilterDialog( QWidget *parent, const char *name, bool modal ) +CFilterDialog::CFilterDialog( TQWidget *parent, const char *name, bool modal ) :KDialogBase( Plain, i18n("Binary Filter"), Ok|Cancel, Ok, parent, name, modal ) { - QString text; - QVBoxLayout *topLayout = new QVBoxLayout( plainPage(), 0, spacingHint() ); + TQString text; + TQVBoxLayout *topLayout = new TQVBoxLayout( plainPage(), 0, spacingHint() ); if( topLayout == 0 ) { return; } - QVBoxLayout *vbox = new QVBoxLayout(); + TQVBoxLayout *vbox = new TQVBoxLayout(); if( vbox == 0 ) { return; } topLayout->addLayout( vbox ); - mOperationSelector = new QComboBox( false, plainPage() ); + mOperationSelector = new TQComboBox( false, plainPage() ); if( mOperationSelector == 0 ) { return; } mOperationSelector->setMinimumWidth( fontMetrics().maxWidth()*17 ); mOperationSelector->insertStringList( operationStrings() ); - connect( mOperationSelector, SIGNAL(activated(int)), - SLOT(operationSelectorChanged(int)) ); + connect( mOperationSelector, TQT_SIGNAL(activated(int)), + TQT_SLOT(operationSelectorChanged(int)) ); text = i18n("O&peration:"); - QLabel *label = new QLabel( mOperationSelector, text, plainPage() ); + TQLabel *label = new TQLabel( mOperationSelector, text, plainPage() ); if( label == 0 ) { return; } vbox->addWidget( label ); vbox->addWidget( mOperationSelector ); KSeparator *separator = new KSeparator( plainPage() ); - separator->setOrientation( QFrame::HLine ); + separator->setOrientation( TQFrame::HLine ); vbox->addWidget( separator ); - mWidgetStack = new QWidgetStack( plainPage(), "pagestack" ); + mWidgetStack = new TQWidgetStack( plainPage(), "pagestack" ); if( mWidgetStack == 0 ) { return; } vbox->addWidget( mWidgetStack ); @@ -800,20 +800,20 @@ CFilterDialog::CFilterDialog( QWidget *parent, const char *name, bool modal ) mWidgetStack->raiseWidget( (int)OperandPage ); - QButtonGroup *group = new QButtonGroup( i18n("Options"), plainPage() ); + TQButtonGroup *group = new TQButtonGroup( i18n("Options"), plainPage() ); if( group == 0 ) { return; } topLayout->addWidget( group, 10 ); - QGridLayout *gbox = new QGridLayout( group, 4, 2, spacingHint() ); + TQGridLayout *gbox = new TQGridLayout( group, 4, 2, spacingHint() ); if( gbox == 0 ) { return; } gbox->addRowSpacing( 0, fontMetrics().lineSpacing() ); - mCheckFromCursor = new QCheckBox( i18n("&From cursor"), group ); + mCheckFromCursor = new TQCheckBox( i18n("&From cursor"), group ); gbox->addWidget( mCheckFromCursor, 1, 0 ); - mCheckBackward = new QCheckBox( i18n("&Backwards"), group ); + mCheckBackward = new TQCheckBox( i18n("&Backwards"), group ); gbox->addWidget( mCheckBackward, 1, 1 ); - mCheckInSelection = new QCheckBox( i18n("&In selection"), group ); + mCheckInSelection = new TQCheckBox( i18n("&In selection"), group ); gbox->addWidget( mCheckInSelection, 2, 0 ); - mCheckVisible = new QCheckBox( i18n("&Stay visible"), group ); + mCheckVisible = new TQCheckBox( i18n("&Stay visible"), group ); gbox->addWidget( mCheckVisible, 2, 1 ); gbox->setRowStretch( 3, 10 ); } @@ -827,7 +827,7 @@ CFilterDialog::~CFilterDialog( void ) void CFilterDialog::makeEmptyLayout( void ) { - QFrame *page = new QFrame( plainPage() ); + TQFrame *page = new TQFrame( plainPage() ); if( page == 0 ) { return; } mWidgetStack->addWidget( page, EmptyPage ); } @@ -835,40 +835,40 @@ void CFilterDialog::makeEmptyLayout( void ) void CFilterDialog::makeOperandLayout( void ) { - QString text; + TQString text; - QFrame *page = new QFrame( plainPage() ); + TQFrame *page = new TQFrame( plainPage() ); if( page == 0 ) { return; } mWidgetStack->addWidget( page, OperandPage ); - QVBoxLayout *vbox = new QVBoxLayout( page, 0, spacingHint() ); + TQVBoxLayout *vbox = new TQVBoxLayout( page, 0, spacingHint() ); if( vbox == 0 ) { return; } - mOperandSelector = new QComboBox( false, page ); + mOperandSelector = new TQComboBox( false, page ); if( mOperandSelector == 0 ) { return; } mOperandSelector->setFixedHeight( mOperandSelector->sizeHint().height()); mOperandSelector->setMinimumWidth( fontMetrics().width("M")*20 ); mOperandSelector->insertStringList( formatStrings() ); - connect( mOperandSelector, SIGNAL(activated(int)), - SLOT(operandSelectorChanged(int)) ); + connect( mOperandSelector, TQT_SIGNAL(activated(int)), + TQT_SLOT(operandSelectorChanged(int)) ); text = i18n("Fo&rmat (operand):"); - mOperandFormatLabel = new QLabel( mOperandSelector, text, page ); + mOperandFormatLabel = new TQLabel( mOperandSelector, text, page ); if( mOperandFormatLabel == 0 ) { return; } vbox->addWidget( mOperandFormatLabel ); vbox->addWidget( mOperandSelector ); - mOperandInput = new QLineEdit( page ); + mOperandInput = new TQLineEdit( page ); if( mOperandInput == 0 ) { return; } mOperandInput->setMinimumWidth( fontMetrics().width("M") * 20 ); mOperandValidator = new CHexValidator( this, CHexValidator::regularText ); if( mOperandValidator == 0 ) { return; } mOperandInput->setValidator( mOperandValidator ); - connect( mOperandInput, SIGNAL(textChanged(const QString&)), - SLOT(operandInputChanged(const QString&)) ); + connect( mOperandInput, TQT_SIGNAL(textChanged(const TQString&)), + TQT_SLOT(operandInputChanged(const TQString&)) ); - mOperandInputLabel = new QLabel( mOperandInput, i18n("O&perand:"), page ); + mOperandInputLabel = new TQLabel( mOperandInput, i18n("O&perand:"), page ); if( mOperandInputLabel == 0 ) { return; } vbox->addWidget( mOperandInputLabel ); @@ -879,17 +879,17 @@ void CFilterDialog::makeOperandLayout( void ) void CFilterDialog::makeBitSwapLayout( void ) { - QString text; + TQString text; - QFrame *page = new QFrame( plainPage() ); + TQFrame *page = new TQFrame( plainPage() ); if( page == 0 ) { return; } mWidgetStack->addWidget( page, BitSwapPage ); - QVBoxLayout *vbox = new QVBoxLayout( page, 0, spacingHint() ); + TQVBoxLayout *vbox = new TQVBoxLayout( page, 0, spacingHint() ); if( vbox == 0 ) { return; } text = i18n("Swap rule"); - QLabel *label = new QLabel( text, page ); + TQLabel *label = new TQLabel( text, page ); if( label == 0 ) { return; } label->setFixedHeight( label->sizeHint().height() ); vbox->addWidget( label ); @@ -897,13 +897,13 @@ void CFilterDialog::makeBitSwapLayout( void ) mByteWidget = new CByteWidget( page ); vbox->addWidget( mByteWidget ); - QHBoxLayout *hbox = new QHBoxLayout( 0 ); + TQHBoxLayout *hbox = new TQHBoxLayout( 0 ); vbox->addLayout( hbox ); text = i18n("&Reset"); - QPushButton *resetButton = new QPushButton( text, page ); + TQPushButton *resetButton = new TQPushButton( text, page ); resetButton->setFixedHeight( resetButton->sizeHint().height() ); - connect( resetButton, SIGNAL(clicked()), mByteWidget, SLOT(reset()) ); + connect( resetButton, TQT_SIGNAL(clicked()), mByteWidget, TQT_SLOT(reset()) ); hbox->addWidget( resetButton ); hbox->addStretch( 10 ); @@ -912,34 +912,34 @@ void CFilterDialog::makeBitSwapLayout( void ) void CFilterDialog::makeRotateLayout( void ) { - QString text; + TQString text; - QFrame *page = new QFrame( plainPage() ); + TQFrame *page = new TQFrame( plainPage() ); if( page == 0 ) { return; } mWidgetStack->addWidget( page, RotatePage ); - QVBoxLayout *vbox = new QVBoxLayout( page, 0, spacingHint() ); + TQVBoxLayout *vbox = new TQVBoxLayout( page, 0, spacingHint() ); if( vbox == 0 ) { return; } - mGroupSpin = new QSpinBox( page ); + mGroupSpin = new TQSpinBox( page ); if( mGroupSpin == 0 ) { return; } mGroupSpin->setMinimumWidth( fontMetrics().width("M")*20 ); mGroupSpin->setRange(1, INT_MAX ); text = i18n("&Group size [bytes]"); - QLabel *label = new QLabel( mGroupSpin, text, page ); + TQLabel *label = new TQLabel( mGroupSpin, text, page ); if( label == 0 ) { return; } vbox->addWidget( label ); vbox->addWidget( mGroupSpin ); - mBitSpin = new QSpinBox( page ); + mBitSpin = new TQSpinBox( page ); if( mBitSpin == 0 ) { return; } mBitSpin->setMinimumWidth( fontMetrics().width("M")*20 ); mBitSpin->setRange(INT_MIN, INT_MAX); text = i18n("S&hift size [bits]"); - label = new QLabel( mBitSpin, text, page ); + label = new TQLabel( mBitSpin, text, page ); if( label == 0 ) { return; } vbox->addWidget( label ); @@ -948,7 +948,7 @@ void CFilterDialog::makeRotateLayout( void ) -void CFilterDialog::showEvent( QShowEvent *e ) +void CFilterDialog::showEvent( TQShowEvent *e ) { KDialogBase::showEvent(e); mOperandInput->setFocus(); @@ -966,7 +966,7 @@ void CFilterDialog::slotOk( void ) case SFilterControl::OperandXorData: if( mOperandData.isEmpty() == true ) { - showEntryFailure( this, QString("") ); + showEntryFailure( this, TQString("") ); return; } fc.operand = mOperandData; @@ -982,7 +982,7 @@ void CFilterDialog::slotOk( void ) fc.rotate[1] = mBitSpin->value(); if( fc.rotate[1] == 0 ) { - QString msg = i18n("Shift size is zero."); + TQString msg = i18n("Shift size is zero."); showEntryFailure( this, msg ); return; } @@ -991,7 +991,7 @@ void CFilterDialog::slotOk( void ) case SFilterControl::SwapBits: if( mByteWidget->flag( fc.operand ) == false ) { - QString msg = i18n("Swap rule does not define any swapping."); + TQString msg = i18n("Swap rule does not define any swapping."); showEntryFailure( this, msg ); return; } @@ -1031,7 +1031,7 @@ void CFilterDialog::operandSelectorChanged( int index ) } -void CFilterDialog::operandInputChanged( const QString &text ) +void CFilterDialog::operandInputChanged( const TQString &text ) { mOperandString[ mOperandSelector->currentItem() ] = text; mOperandValidator->convert( mOperandData, @@ -1066,84 +1066,84 @@ void CFilterDialog::operationSelectorChanged( int index ) -CInsertDialog::CInsertDialog( QWidget *parent, const char *name, bool modal ) +CInsertDialog::CInsertDialog( TQWidget *parent, const char *name, bool modal ) :KDialogBase( Plain, i18n("Insert Pattern"), Ok|Cancel, Ok, parent, name, modal ) { setButtonOKText(i18n("&Insert")); - QString text; - QVBoxLayout *topLayout = new QVBoxLayout( plainPage(), 0, spacingHint() ); + TQString text; + TQVBoxLayout *topLayout = new TQVBoxLayout( plainPage(), 0, spacingHint() ); if( topLayout == 0 ) { return; } - QVBoxLayout *vbox = new QVBoxLayout(); + TQVBoxLayout *vbox = new TQVBoxLayout(); if( vbox == 0 ) { return; } topLayout->addLayout( vbox ); - mSizeBox = new QSpinBox( plainPage() ); + mSizeBox = new TQSpinBox( plainPage() ); if( mSizeBox == 0 ) { return; } mSizeBox->setMinimumWidth( fontMetrics().maxWidth()*17 ); mSizeBox->setRange( 1, INT_MAX ); mSizeBox->setValue( 1 ); - QLabel *label = new QLabel( mSizeBox, i18n("&Size:"), plainPage() ); + TQLabel *label = new TQLabel( mSizeBox, i18n("&Size:"), plainPage() ); if( label == 0 ) { return; } vbox->addWidget( label ); vbox->addWidget( mSizeBox ); - mPatternSelector = new QComboBox( false, plainPage() ); + mPatternSelector = new TQComboBox( false, plainPage() ); if( mPatternSelector == 0 ) { return; } mPatternSelector->setMinimumWidth( fontMetrics().maxWidth()*17 ); mPatternSelector->insertStringList( formatStrings() ); - connect( mPatternSelector, SIGNAL(activated(int)), - SLOT(patternSelectorChanged(int)) ); + connect( mPatternSelector, TQT_SIGNAL(activated(int)), + TQT_SLOT(patternSelectorChanged(int)) ); text = i18n("Fo&rmat (pattern):"); - label = new QLabel( mPatternSelector, text, plainPage() ); + label = new TQLabel( mPatternSelector, text, plainPage() ); if( label == 0 ) { return; } vbox->addWidget( label ); vbox->addWidget( mPatternSelector ); - mPatternInput = new QLineEdit( plainPage() ); + mPatternInput = new TQLineEdit( plainPage() ); if( mPatternInput == 0 ) { return; } mPatternInput->setMinimumWidth( fontMetrics().maxWidth()*17 ); mPatternValidator = new CHexValidator( this, CHexValidator::regularText ); if( mPatternValidator == 0 ) { return; } mPatternInput->setValidator( mPatternValidator ); - connect( mPatternInput, SIGNAL(textChanged(const QString&)), - SLOT(patternInputChanged(const QString&)) ); + connect( mPatternInput, TQT_SIGNAL(textChanged(const TQString&)), + TQT_SLOT(patternInputChanged(const TQString&)) ); - label = new QLabel( mPatternInput, i18n("&Pattern:"), plainPage() ); + label = new TQLabel( mPatternInput, i18n("&Pattern:"), plainPage() ); if( label == 0 ) { return; } vbox->addWidget( label ); vbox->addWidget( mPatternInput ); - mOffsetInput = new QLineEdit( plainPage() ); + mOffsetInput = new TQLineEdit( plainPage() ); mOffsetInput->setMinimumWidth( fontMetrics().maxWidth()*17 ); - mOffsetLabel = new QLabel( mOffsetInput, i18n("&Offset:"), plainPage() ); + mOffsetLabel = new TQLabel( mOffsetInput, i18n("&Offset:"), plainPage() ); if( mOffsetLabel == 0 ) { return; } vbox->addWidget( mOffsetLabel ); vbox->addWidget( mOffsetInput ); - QButtonGroup *group = new QButtonGroup( i18n("Options"), plainPage() ); + TQButtonGroup *group = new TQButtonGroup( i18n("Options"), plainPage() ); if( group == 0 ) { return; } topLayout->addWidget( group, 10 ); - QGridLayout *gbox = new QGridLayout( group, 4, 2, spacingHint() ); + TQGridLayout *gbox = new TQGridLayout( group, 4, 2, spacingHint() ); if( gbox == 0 ) { return; } gbox->addRowSpacing( 0, fontMetrics().lineSpacing() ); - mCheckPattern = new QCheckBox( i18n("R&epeat pattern"), group ); + mCheckPattern = new TQCheckBox( i18n("R&epeat pattern"), group ); gbox->addWidget( mCheckPattern, 1, 0 ); - mCheckOnCursor = new QCheckBox( i18n("&Insert on cursor position"), group ); + mCheckOnCursor = new TQCheckBox( i18n("&Insert on cursor position"), group ); gbox->addWidget( mCheckOnCursor, 2, 0 ); - connect( mCheckOnCursor, SIGNAL(clicked()), SLOT(cursorCheck()) ); + connect( mCheckOnCursor, TQT_SIGNAL(clicked()), TQT_SLOT(cursorCheck()) ); gbox->setRowStretch( 3, 10 ); KConfig &config = *kapp->config(); @@ -1168,7 +1168,7 @@ CInsertDialog::~CInsertDialog( void ) } -void CInsertDialog::showEvent( QShowEvent *e ) +void CInsertDialog::showEvent( TQShowEvent *e ) { KDialogBase::showEvent(e); mPatternInput->setFocus(); @@ -1182,7 +1182,7 @@ void CInsertDialog::patternSelectorChanged( int index ) } -void CInsertDialog::patternInputChanged( const QString &text ) +void CInsertDialog::patternInputChanged( const TQString &text ) { mPatternString[ mPatternSelector->currentItem() ] = text; mPatternValidator->convert( mPatternData, @@ -1194,7 +1194,7 @@ void CInsertDialog::slotOk( void ) { if( mPatternData.isEmpty() == true ) { - showEntryFailure( this, QString("") ); + showEntryFailure( this, TQString("") ); return; } @@ -1209,7 +1209,7 @@ void CInsertDialog::slotOk( void ) bool success = stringToOffset( mOffsetInput->text(), id.offset ); if( success == false ) { - showEntryFailure( this, QString("") ); + showEntryFailure( this, TQString("") ); return; } } @@ -1229,15 +1229,15 @@ void CInsertDialog::cursorCheck( void ) -void centerDialog( QWidget *widget, QWidget *centerParent ) +void centerDialog( TQWidget *widget, TQWidget *centerParent ) { if( centerParent == 0 || widget == 0 ) { return; } - QPoint point = centerParent->mapToGlobal( QPoint(0,0) ); - QRect pos = centerParent->geometry(); + TQPoint point = centerParent->mapToGlobal( TQPoint(0,0) ); + TQRect pos = centerParent->geometry(); widget->setGeometry( point.x() + pos.width()/2 - widget->width()/2, point.y() + pos.height()/2 - widget->height()/2, @@ -1245,15 +1245,15 @@ void centerDialog( QWidget *widget, QWidget *centerParent ) } -void centerDialogBottom( QWidget *widget, QWidget *centerParent ) +void centerDialogBottom( TQWidget *widget, TQWidget *centerParent ) { if( centerParent == 0 || widget == 0 ) { return; } - QPoint point = centerParent->mapToGlobal( QPoint(0,0) ); - QRect pos = centerParent->geometry(); + TQPoint point = centerParent->mapToGlobal( TQPoint(0,0) ); + TQRect pos = centerParent->geometry(); widget->setGeometry( point.x() + pos.width()/2 - widget->width()/2, point.y() + pos.height() - widget->height(), @@ -1261,7 +1261,7 @@ void centerDialogBottom( QWidget *widget, QWidget *centerParent ) } -void comboMatchText( QComboBox *combo, const QString &text ) +void comboMatchText( TQComboBox *combo, const TQString &text ) { for( int i=0; i < combo->count(); i++ ) { @@ -1278,9 +1278,9 @@ void comboMatchText( QComboBox *combo, const QString &text ) -void showEntryFailure( QWidget *parent, const QString &msg ) +void showEntryFailure( TQWidget *parent, const TQString &msg ) { - QString message; + TQString message; message += i18n("Your request can not be processed."); message += "\n"; if( msg.isNull() == true || msg.isEmpty() == true ) @@ -1295,34 +1295,34 @@ void showEntryFailure( QWidget *parent, const QString &msg ) } -bool verifyFileDestnation( QWidget *parent, const QString &title, - const QString &path ) +bool verifyFileDestnation( TQWidget *parent, const TQString &title, + const TQString &path ) { if( path.isEmpty() == true ) { - QString msg = i18n("You must specify a destination file."); + TQString msg = i18n("You must specify a destination file."); KMessageBox::sorry( parent, msg, title ); return( false ); } - QFileInfo info( path ); + TQFileInfo info( path ); if( info.exists() == true ) { if( info.isDir() == true ) { - QString msg = i18n("You have specified an existing folder."); + TQString msg = i18n("You have specified an existing folder."); KMessageBox::sorry( parent, msg, title ); return( false ); } if( info.isWritable() == false ) { - QString msg = i18n("You do not have write permission to this file."); + TQString msg = i18n("You do not have write permission to this file."); KMessageBox::sorry( parent, msg, title ); return( false ); } - QString msg = i18n( "" + TQString msg = i18n( "" "You have specified an existing file.\n" "Overwrite current file?" ); int reply = KMessageBox::warningContinueCancel( parent, msg, title, i18n("Overwrite") ); @@ -1337,7 +1337,7 @@ bool verifyFileDestnation( QWidget *parent, const QString &title, -bool stringToOffset( const QString & text, uint &offset ) +bool stringToOffset( const TQString & text, uint &offset ) { if( text.isEmpty() ) { @@ -1393,9 +1393,9 @@ bool stringToOffset( const QString & text, uint &offset ) } -static const QStringList &formatStrings( void ) +static const TQStringList &formatStrings( void ) { - static QStringList list; + static TQStringList list; if( list.isEmpty() == true ) { list.append( i18n( "Hexadecimal" ) ); @@ -1408,9 +1408,9 @@ static const QStringList &formatStrings( void ) } -static const QStringList &operationStrings( void ) +static const TQStringList &operationStrings( void ) { - static QStringList list; + static TQStringList list; if( list.isEmpty() == true ) { list.append( i18n( "operand AND data" ) ); diff --git a/khexedit/dialog.h b/khexedit/dialog.h index 6a6aae1..226825e 100644 --- a/khexedit/dialog.h +++ b/khexedit/dialog.h @@ -26,15 +26,15 @@ #endif -#include <qcheckbox.h> -#include <qcombobox.h> -#include <qdialog.h> -#include <qlabel.h> -#include <qlineedit.h> -#include <qradiobutton.h> -#include <qspinbox.h> -#include <qstring.h> -#include <qwidgetstack.h> +#include <tqcheckbox.h> +#include <tqcombobox.h> +#include <tqdialog.h> +#include <tqlabel.h> +#include <tqlineedit.h> +#include <tqradiobutton.h> +#include <tqspinbox.h> +#include <tqstring.h> +#include <tqwidgetstack.h> #include <kdialogbase.h> @@ -42,10 +42,10 @@ #include "hexbuffer.h" #include "hexvalidator.h" -const int repYes = QDialog::Accepted; +const int repYes = TQDialog::Accepted; const int repNo = 11; const int repAll = 12; -const int repClose = QDialog::Rejected; +const int repClose = TQDialog::Rejected; const int repNext = 13; const int repPrevious = 14; const int repNewKey = 15; @@ -66,11 +66,11 @@ class CGotoDialog : public KDialogBase Q_OBJECT public: - CGotoDialog( QWidget *parent, const char *name = 0, bool modal = false ); + CGotoDialog( TQWidget *parent, const char *name = 0, bool modal = false ); ~CGotoDialog( void ); protected: - virtual void showEvent( QShowEvent *e ); + virtual void showEvent( TQShowEvent *e ); private slots: void slotOk( void ); @@ -79,10 +79,10 @@ class CGotoDialog : public KDialogBase void gotoOffset( uint offset, uint bit, bool fromCursor, bool forward ); private: - QComboBox *mComboBox; - QCheckBox *mCheckBackward; - QCheckBox *mCheckFromCursor; - QCheckBox *mCheckVisible; + TQComboBox *mComboBox; + TQCheckBox *mCheckBackward; + TQCheckBox *mCheckFromCursor; + TQCheckBox *mCheckVisible; }; @@ -100,7 +100,7 @@ class CFindDialog : public KDialogBase }; public: - CFindDialog( QWidget *parent=0, const char *name=0, bool modal=false ); + CFindDialog( TQWidget *parent=0, const char *name=0, bool modal=false ); ~CFindDialog( void ); bool isEmpty( void ); @@ -108,27 +108,27 @@ class CFindDialog : public KDialogBase void findAgain( EOperation operation ); protected: - virtual void showEvent( QShowEvent *e ); + virtual void showEvent( TQShowEvent *e ); private slots: void slotOk( void ); void selectorChanged( int index ); - void inputChanged( const QString &text ); + void inputChanged( const TQString &text ); signals: void findData( SSearchControl &sc, uint mode, bool navigator ); private: - QComboBox *mSelector; - QLineEdit *mInput; - QCheckBox *mCheckBackward; - QCheckBox *mCheckFromCursor; - QCheckBox *mCheckInSelection; - QCheckBox *mCheckUseNavigator; - QCheckBox *mCheckIgnoreCase; - - QString mFindString[5]; - QByteArray mFindData; + TQComboBox *mSelector; + TQLineEdit *mInput; + TQCheckBox *mCheckBackward; + TQCheckBox *mCheckFromCursor; + TQCheckBox *mCheckInSelection; + TQCheckBox *mCheckUseNavigator; + TQCheckBox *mCheckIgnoreCase; + + TQString mFindString[5]; + TQByteArray mFindData; CHexValidator *mFindValidator; }; @@ -139,7 +139,7 @@ class CFindNavigatorDialog : public KDialogBase Q_OBJECT public: - CFindNavigatorDialog( QWidget *parent=0, const char *name=0, + CFindNavigatorDialog( TQWidget *parent=0, const char *name=0, bool modal=false ); ~CFindNavigatorDialog( void ); void defineData( SSearchControl &sc ); @@ -158,7 +158,7 @@ class CFindNavigatorDialog : public KDialogBase void makeKey( void ); private: - QLineEdit *mKey; + TQLineEdit *mKey; SSearchControl mSearchControl; }; @@ -168,38 +168,38 @@ class CReplaceDialog : public KDialogBase Q_OBJECT public: - CReplaceDialog( QWidget *parent=0, const char *name=0, bool modal=false ); + CReplaceDialog( TQWidget *parent=0, const char *name=0, bool modal=false ); ~CReplaceDialog( void ); protected: - virtual void showEvent( QShowEvent *e ); + virtual void showEvent( TQShowEvent *e ); private slots: void slotOk( void ); void findSelectorChanged( int index ); - void findInputChanged( const QString &text ); + void findInputChanged( const TQString &text ); void replaceSelectorChanged( int index ); - void replaceInputChanged( const QString &text ); + void replaceInputChanged( const TQString &text ); signals: void replaceData( SSearchControl &sc, uint mode ); private: - QComboBox *mFindSelector; - QComboBox *mReplaceSelector; - QLineEdit *mFindInput; - QLineEdit *mReplaceInput; - - QCheckBox *mCheckBackward; - QCheckBox *mCheckFromCursor; - QCheckBox *mCheckInSelection; - QCheckBox *mCheckPrompt; - QCheckBox *mCheckIgnoreCase; - - QString mFindString[5]; - QString mReplaceString[5]; - QByteArray mFindData; - QByteArray mReplaceData; + TQComboBox *mFindSelector; + TQComboBox *mReplaceSelector; + TQLineEdit *mFindInput; + TQLineEdit *mReplaceInput; + + TQCheckBox *mCheckBackward; + TQCheckBox *mCheckFromCursor; + TQCheckBox *mCheckInSelection; + TQCheckBox *mCheckPrompt; + TQCheckBox *mCheckIgnoreCase; + + TQString mFindString[5]; + TQString mReplaceString[5]; + TQByteArray mFindData; + TQByteArray mReplaceData; CHexValidator *mFindValidator; CHexValidator *mReplaceValidator; }; @@ -211,7 +211,7 @@ class CReplacePromptDialog : public KDialogBase Q_OBJECT public: - CReplacePromptDialog( QWidget *parent=0, const char *name=0, + CReplacePromptDialog( TQWidget *parent=0, const char *name=0, bool modal=false ); ~CReplacePromptDialog( void ); void defineData( SSearchControl &sc ); @@ -249,11 +249,11 @@ class CFilterDialog : public KDialogBase }; public: - CFilterDialog( QWidget *parent=0, const char *name=0, bool modal=false ); + CFilterDialog( TQWidget *parent=0, const char *name=0, bool modal=false ); ~CFilterDialog( void ); protected: - virtual void showEvent( QShowEvent *e ); + virtual void showEvent( TQShowEvent *e ); private: void makeEmptyLayout( void ); @@ -264,30 +264,30 @@ class CFilterDialog : public KDialogBase private slots: void slotOk( void ); void operandSelectorChanged( int index ); - void operandInputChanged( const QString &text ); + void operandInputChanged( const TQString &text ); void operationSelectorChanged( int index ); signals: void filterData( SFilterControl &fc ); private: - QWidgetStack *mWidgetStack; - QLabel *mOperandFormatLabel; - QLabel *mOperandInputLabel; - QComboBox *mOperandSelector; - QLineEdit *mOperandInput; - QComboBox *mOperationSelector; - QSpinBox *mGroupSpin; - QSpinBox *mBitSpin; + TQWidgetStack *mWidgetStack; + TQLabel *mOperandFormatLabel; + TQLabel *mOperandInputLabel; + TQComboBox *mOperandSelector; + TQLineEdit *mOperandInput; + TQComboBox *mOperationSelector; + TQSpinBox *mGroupSpin; + TQSpinBox *mBitSpin; CByteWidget *mByteWidget; - QCheckBox *mCheckBackward; - QCheckBox *mCheckFromCursor; - QCheckBox *mCheckInSelection; - QCheckBox *mCheckVisible; + TQCheckBox *mCheckBackward; + TQCheckBox *mCheckFromCursor; + TQCheckBox *mCheckInSelection; + TQCheckBox *mCheckVisible; - QString mOperandString[5]; - QByteArray mOperandData; + TQString mOperandString[5]; + TQByteArray mOperandData; CHexValidator *mOperandValidator; }; @@ -299,46 +299,46 @@ class CInsertDialog : public KDialogBase Q_OBJECT public: - CInsertDialog( QWidget *parent=0, const char *name=0, bool modal=false ); + CInsertDialog( TQWidget *parent=0, const char *name=0, bool modal=false ); ~CInsertDialog( void ); protected: - virtual void showEvent( QShowEvent *e ); + virtual void showEvent( TQShowEvent *e ); private slots: void slotOk( void ); void cursorCheck( void ); void patternSelectorChanged( int index ); - void patternInputChanged( const QString &text ); + void patternInputChanged( const TQString &text ); signals: void execute( SInsertData &id ); private: - QSpinBox *mSizeBox; - QLabel *mOffsetLabel; - QComboBox *mPatternSelector; - QLineEdit *mPatternInput; - QLineEdit *mOffsetInput; - QCheckBox *mCheckPattern; - QCheckBox *mCheckOnCursor; - - QString mPatternString[5]; - QByteArray mPatternData; + TQSpinBox *mSizeBox; + TQLabel *mOffsetLabel; + TQComboBox *mPatternSelector; + TQLineEdit *mPatternInput; + TQLineEdit *mOffsetInput; + TQCheckBox *mCheckPattern; + TQCheckBox *mCheckOnCursor; + + TQString mPatternString[5]; + TQByteArray mPatternData; CHexValidator *mPatternValidator; }; -void centerDialog( QWidget *widget, QWidget *centerParent ); -void centerDialogBottom( QWidget *widget, QWidget *centerParent ); -void comboMatchText( QComboBox *combo, const QString &text ); -bool stringToOffset( const QString & text, uint &offset ); +void centerDialog( TQWidget *widget, TQWidget *centerParent ); +void centerDialogBottom( TQWidget *widget, TQWidget *centerParent ); +void comboMatchText( TQComboBox *combo, const TQString &text ); +bool stringToOffset( const TQString & text, uint &offset ); -void showEntryFailure( QWidget *parent, const QString &msg ); -bool verifyFileDestnation( QWidget *parent, const QString &title, - const QString &path ); +void showEntryFailure( TQWidget *parent, const TQString &msg ); +bool verifyFileDestnation( TQWidget *parent, const TQString &title, + const TQString &path ); diff --git a/khexedit/draglabel.cc b/khexedit/draglabel.cc index e20088c..8a98945 100644 --- a/khexedit/draglabel.cc +++ b/khexedit/draglabel.cc @@ -20,16 +20,16 @@ #include <stdlib.h> -#include <qbitmap.h> -#include <qpainter.h> +#include <tqbitmap.h> +#include <tqpainter.h> #include <kurldrag.h> #include "draglabel.h" -CDragLabel::CDragLabel( QWidget *parent ) - : QLabel( "draglabel", parent, "kde toolbar widget" ) +CDragLabel::CDragLabel( TQWidget *parent ) + : TQLabel( "draglabel", parent, "kde toolbar widget" ) { mValid = true; mDragPending = false; @@ -42,7 +42,7 @@ CDragLabel::~CDragLabel( void ) } -void CDragLabel::mousePressEvent( QMouseEvent *e ) +void CDragLabel::mousePressEvent( TQMouseEvent *e ) { if( mValid == false || e->button() != LeftButton || mUrl.isEmpty() == true ) { @@ -54,7 +54,7 @@ void CDragLabel::mousePressEvent( QMouseEvent *e ) } -void CDragLabel::mouseMoveEvent( QMouseEvent *e ) +void CDragLabel::mouseMoveEvent( TQMouseEvent *e ) { if( mDragPending == true ) { @@ -78,19 +78,19 @@ void CDragLabel::mouseMoveEvent( QMouseEvent *e ) } } -void CDragLabel::mouseReleaseEvent( QMouseEvent * ) +void CDragLabel::mouseReleaseEvent( TQMouseEvent * ) { mDragPending = false; } -void CDragLabel::setUrl( const QString &url ) +void CDragLabel::setUrl( const TQString &url ) { mUrl = url; } -void CDragLabel::setDragMask( const QPixmap pix ) +void CDragLabel::setDragMask( const TQPixmap pix ) { mDragMask = pix; } @@ -103,7 +103,7 @@ void CDragLabel::prepPixmap( KURLDrag &uriDrag ) return; } - QString text; + TQString text; int index = mUrl.findRev( '/', mUrl.length() ); if( index < 0 ) { @@ -115,16 +115,16 @@ void CDragLabel::prepPixmap( KURLDrag &uriDrag ) } int sep = 2; - QRect rect = fontMetrics().boundingRect(text); + TQRect rect = fontMetrics().boundingRect(text); int w = pixmap()->width() + rect.width() + sep + 2; int h = fontMetrics().lineSpacing(); if( pixmap()->height() > h ) { h = pixmap()->height(); } - QBitmap mask( w, h, TRUE ); - QPixmap dragPixmap( w, h ); + TQBitmap mask( w, h, TRUE ); + TQPixmap dragPixmap( w, h ); dragPixmap.fill( black ); - QPainter p; + TQPainter p; p.begin( &mask ); p.setPen( white ); p.drawPixmap( 0, 0, mDragMask ); @@ -138,7 +138,7 @@ void CDragLabel::prepPixmap( KURLDrag &uriDrag ) dragPixmap.setMask( mask ); - QPoint hotspot( pixmap()->width(), pixmap()->height()/2 ); + TQPoint hotspot( pixmap()->width(), pixmap()->height()/2 ); uriDrag.setPixmap( dragPixmap, hotspot ); } diff --git a/khexedit/draglabel.h b/khexedit/draglabel.h index d90b5ed..441473e 100644 --- a/khexedit/draglabel.h +++ b/khexedit/draglabel.h @@ -21,11 +21,11 @@ #ifndef _DRAG_SOURCE_H_ #define _DRAG_SOURCE_H_ -#include <qdropsite.h> -#include <qlabel.h> -#include <qbitmap.h> -#include <qstring.h> -#include <qstrlist.h> +#include <tqdropsite.h> +#include <tqlabel.h> +#include <tqbitmap.h> +#include <tqstring.h> +#include <tqstrlist.h> class KURLDrag; @@ -34,26 +34,26 @@ class CDragLabel: public QLabel Q_OBJECT public: - CDragLabel( QWidget *parent ); + CDragLabel( TQWidget *parent ); ~CDragLabel( void ); - void setUrl( const QString &url ); - void setDragMask( const QPixmap pix ); + void setUrl( const TQString &url ); + void setDragMask( const TQPixmap pix ); protected: - void mousePressEvent( QMouseEvent * ); - void mouseMoveEvent( QMouseEvent * ); - void mouseReleaseEvent( QMouseEvent * ); + void mousePressEvent( TQMouseEvent * ); + void mouseMoveEvent( TQMouseEvent * ); + void mouseReleaseEvent( TQMouseEvent * ); private: void prepPixmap( KURLDrag &uriDrag ); private: bool mValid; - QString mUrl; - QBitmap mDragMask; + TQString mUrl; + TQBitmap mDragMask; bool mDragPending; - QPoint mDragOrigin; + TQPoint mDragOrigin; }; diff --git a/khexedit/exportdialog.cc b/khexedit/exportdialog.cc index a178319..3d13d7c 100644 --- a/khexedit/exportdialog.cc +++ b/khexedit/exportdialog.cc @@ -19,8 +19,8 @@ */ #include <limits.h> -#include <qbuttongroup.h> -#include <qlineedit.h> +#include <tqbuttongroup.h> +#include <tqlineedit.h> #include <kfiledialog.h> #include <klocale.h> @@ -28,14 +28,14 @@ #include "dialog.h" #include "exportdialog.h" -#include <qpushbutton.h> +#include <tqpushbutton.h> -CExportDialog::CExportDialog( QWidget *parent, char *name, bool modal ) +CExportDialog::CExportDialog( TQWidget *parent, char *name, bool modal ) :KDialogBase( Tabbed, i18n("Export Document"), Help|Ok|Cancel, Ok, parent, name, modal ) { - setHelp( "khexedit/khexedit.html", QString::null ); + setHelp( "khexedit/khexedit.html", TQString::null ); mFrame[ page_destination ] = addPage( i18n("Destination") ); mFrame[ page_option ] = addPage( i18n("Options") ); @@ -46,7 +46,7 @@ CExportDialog::CExportDialog( QWidget *parent, char *name, bool modal ) mConfig = 0; readConfiguration(); - QString path = mDestination.fileInput->text(); + TQString path = mDestination.fileInput->text(); int index = path.findRev( '/' ); if( index != -1 ) { mWorkDir = path.left( index+1 ); } } @@ -59,7 +59,7 @@ CExportDialog::~CExportDialog( void ) } -void CExportDialog::showEvent( QShowEvent *e ) +void CExportDialog::showEvent( TQShowEvent *e ) { KDialogBase::showEvent(e); showPage(0); @@ -71,7 +71,7 @@ void CExportDialog::readConfiguration( void ) { if( mConfig != 0 ) { return; } - mConfig = new KSimpleConfig( QString("hexexport") ); + mConfig = new KSimpleConfig( TQString("hexexport") ); if( mConfig == 0 ) { return; } mConfig->setGroup( "Destination" ); @@ -83,7 +83,7 @@ void CExportDialog::readConfiguration( void ) mConfig->setGroup( "Option" ); val = mConfig->readNumEntry( "HtmlLine", 80 ); mHtml.lineSpin->setValue( val ); - QString text = mConfig->readEntry( "HtmlPrefix", "table" ); + TQString text = mConfig->readEntry( "HtmlPrefix", "table" ); mHtml.prefixInput->setText( text ); val = mConfig->readNumEntry( "HtmlHeader", 1 ); mHtml.topCombo->setCurrentItem( val < 0 || val >= 4 ? 0 : val ); @@ -148,113 +148,113 @@ void CExportDialog::writeConfiguration( void ) void CExportDialog::setupDestinationPage( void ) { - QString text; - QFrame *page = mFrame[ page_destination ]; + TQString text; + TQFrame *page = mFrame[ page_destination ]; - QVBoxLayout *topLayout = new QVBoxLayout( page, 0, spacingHint() ); + TQVBoxLayout *topLayout = new TQVBoxLayout( page, 0, spacingHint() ); if( topLayout == 0 ) { return; } - QStringList formatList; + TQStringList formatList; formatList.append( i18n("Plain Text") ); formatList.append( i18n("HTML Tables") ); formatList.append( i18n("Rich Text (RTF)") ); formatList.append( i18n("C Array") ); - mDestination.formatCombo = new QComboBox( false, page ); + mDestination.formatCombo = new TQComboBox( false, page ); mDestination.formatCombo->insertStringList( formatList ); mDestination.formatCombo->setMinimumWidth( fontMetrics().maxWidth()*10 ); - connect( mDestination.formatCombo, SIGNAL(activated(int)), - SLOT(formatChanged(int)) ); + connect( mDestination.formatCombo, TQT_SIGNAL(activated(int)), + TQT_SLOT(formatChanged(int)) ); text = i18n("&Format:"); - QLabel *label = new QLabel( mDestination.formatCombo, text, page ); + TQLabel *label = new TQLabel( mDestination.formatCombo, text, page ); topLayout->addWidget( label ); topLayout->addWidget( mDestination.formatCombo ); - QHBoxLayout *hbox = new QHBoxLayout(); + TQHBoxLayout *hbox = new TQHBoxLayout(); topLayout->addLayout( hbox ); text = i18n("&Destination:"); - label = new QLabel( text, page ); + label = new TQLabel( text, page ); hbox->addWidget( label ); text = i18n("(Package folder)"); - mDestination.fileExtraLabel = new QLabel( text, page ); + mDestination.fileExtraLabel = new TQLabel( text, page ); hbox->addWidget( mDestination.fileExtraLabel, 10, AlignLeft|AlignVCenter ); - hbox = new QHBoxLayout(); + hbox = new TQHBoxLayout(); topLayout->addLayout( hbox ); - mDestination.fileInput = new QLineEdit( page ); + mDestination.fileInput = new TQLineEdit( page ); hbox->addWidget( mDestination.fileInput ); - connect(mDestination.fileInput, SIGNAL(textChanged ( const QString & )),this,SLOT(destinationChanged(const QString &))); + connect(mDestination.fileInput, TQT_SIGNAL(textChanged ( const TQString & )),this,TQT_SLOT(destinationChanged(const TQString &))); text = i18n("Choose..."); - QPushButton *browseButton = new QPushButton( text, page, "browse" ); + TQPushButton *browseButton = new TQPushButton( text, page, "browse" ); hbox->addWidget( browseButton ); - connect( browseButton, SIGNAL(clicked()), SLOT(browserClicked()) ); + connect( browseButton, TQT_SIGNAL(clicked()), TQT_SLOT(browserClicked()) ); mDestination.fileInput->setMinimumWidth( fontMetrics().maxWidth()*15 ); label->setBuddy(mDestination.fileInput); - hbox = new QHBoxLayout(); + hbox = new TQHBoxLayout(); topLayout->addLayout( hbox, 10 ); - mDestination.rangeBox = new QButtonGroup( i18n("Export Range"), page ); + mDestination.rangeBox = new TQButtonGroup( i18n("Export Range"), page ); hbox->addWidget( mDestination.rangeBox ); - QButtonGroup *group = mDestination.rangeBox; // convenience + TQButtonGroup *group = mDestination.rangeBox; // convenience - QVBoxLayout *vbox = new QVBoxLayout( group, spacingHint() ); + TQVBoxLayout *vbox = new TQVBoxLayout( group, spacingHint() ); vbox->addSpacing( fontMetrics().lineSpacing() ); - QRadioButton *radio1 = new QRadioButton( i18n("&Everything"), group ); + TQRadioButton *radio1 = new TQRadioButton( i18n("&Everything"), group ); radio1->setFixedSize( radio1->sizeHint() ); mDestination.rangeBox->insert( radio1, 0 ); vbox->addWidget( radio1, 0, AlignLeft ); - QRadioButton *radio2 = new QRadioButton( i18n("&Selection"), group ); + TQRadioButton *radio2 = new TQRadioButton( i18n("&Selection"), group ); radio2->setFixedSize( radio2->sizeHint() ); mDestination.rangeBox->insert( radio2, 1 ); vbox->addWidget( radio2, 0, AlignLeft ); - QRadioButton *radio3 = new QRadioButton( i18n("&Range"), group ); + TQRadioButton *radio3 = new TQRadioButton( i18n("&Range"), group ); radio3->setFixedSize( radio3->sizeHint() ); mDestination.rangeBox->insert( radio3, 2 ); vbox->addWidget( radio3, 0, AlignLeft ); - QGridLayout *gbox = new QGridLayout( 2, 2, spacingHint() ); + TQGridLayout *gbox = new TQGridLayout( 2, 2, spacingHint() ); vbox->addLayout( gbox ); - mDestination.fromInput = new QLineEdit( group ); + mDestination.fromInput = new TQLineEdit( group ); text = i18n("&From offset:"); - mDestination.fromLabel = new QLabel( mDestination.fromInput, text, group ); + mDestination.fromLabel = new TQLabel( mDestination.fromInput, text, group ); gbox->addWidget( mDestination.fromLabel, 0, 0 ); gbox->addWidget( mDestination.fromInput, 0, 1 ); - mDestination.toInput = new QLineEdit( group ); + mDestination.toInput = new TQLineEdit( group ); text = i18n("&To offset:"); - mDestination.toLabel = new QLabel( mDestination.toInput, text, group ); + mDestination.toLabel = new TQLabel( mDestination.toInput, text, group ); gbox->addWidget( mDestination.toLabel, 1, 0 ); gbox->addWidget( mDestination.toInput, 1, 1 ); - connect( group, SIGNAL(clicked(int)), SLOT(rangeChanged(int)) ); + connect( group, TQT_SIGNAL(clicked(int)), TQT_SLOT(rangeChanged(int)) ); group->setButton(0); rangeChanged(0); enableButtonOK( !mDestination.fileInput->text().isEmpty() ); } -void CExportDialog::destinationChanged(const QString &_text) +void CExportDialog::destinationChanged(const TQString &_text) { enableButtonOK( !_text.isEmpty() ); } void CExportDialog::setupOptionPage( void ) { - QFrame *page = mFrame[ page_option ]; - QVBoxLayout *topLayout = new QVBoxLayout( page, 0, spacingHint() ); + TQFrame *page = mFrame[ page_option ]; + TQVBoxLayout *topLayout = new TQVBoxLayout( page, 0, spacingHint() ); if( topLayout == 0 ) { return; } - mOptionStack = new QWidgetStack( page, "stack" ); + mOptionStack = new TQWidgetStack( page, "stack" ); if( mOptionStack == 0 ) { return; } topLayout->addWidget( mOptionStack ); @@ -264,100 +264,100 @@ void CExportDialog::setupOptionPage( void ) makeCArrayOption(); mOptionStack->raiseWidget( (int)option_text ); - QSize size = mOptionStack->sizeHint(); - size += QSize(spacingHint()*2, spacingHint()*2); + TQSize size = mOptionStack->sizeHint(); + size += TQSize(spacingHint()*2, spacingHint()*2); page->setMinimumSize( size ); } void CExportDialog::makeTextOption( void ) { - QFrame *page = new QFrame( mFrame[ page_option ] ); + TQFrame *page = new TQFrame( mFrame[ page_option ] ); if( page == 0 ) { return; } mOptionStack->addWidget( page, option_text ); - QVBoxLayout *topLayout = new QVBoxLayout( page, 0, spacingHint() ); - QString text = i18n("No options for this format."); - QLabel *label = new QLabel( text, page ); + TQVBoxLayout *topLayout = new TQVBoxLayout( page, 0, spacingHint() ); + TQString text = i18n("No options for this format."); + TQLabel *label = new TQLabel( text, page ); topLayout->addWidget( label, 0, AlignCenter ); } void CExportDialog::makeHtmlOption( void ) { - QFrame *page = new QFrame( mFrame[ page_option ] ); + TQFrame *page = new TQFrame( mFrame[ page_option ] ); if( page == 0 ) { return; } mOptionStack->addWidget( page, option_html ); - QString text; - QVBoxLayout *topLayout = new QVBoxLayout( page, 0, spacingHint() ); + TQString text; + TQVBoxLayout *topLayout = new TQVBoxLayout( page, 0, spacingHint() ); if( topLayout == 0 ) { return; } text = i18n("HTML Options (one table per page)"); - QLabel *label = new QLabel( text, page ); + TQLabel *label = new TQLabel( text, page ); topLayout->addWidget( label ); - QFrame *hline = new QFrame( page ); - hline->setFrameStyle( QFrame::Sunken | QFrame::HLine ); + TQFrame *hline = new TQFrame( page ); + hline->setFrameStyle( TQFrame::Sunken | TQFrame::HLine ); topLayout->addWidget( hline ); - QFrame *frame = new QFrame( page ); + TQFrame *frame = new TQFrame( page ); if( frame == 0 ) { return; } topLayout->addWidget( frame ); - QGridLayout *gbox = new QGridLayout( frame, 4, 2, 0, spacingHint() ); + TQGridLayout *gbox = new TQGridLayout( frame, 4, 2, 0, spacingHint() ); if( gbox == 0 ) { return; } gbox->setColStretch( 1, 10 ); - mHtml.lineSpin = new QSpinBox( frame ); + mHtml.lineSpin = new TQSpinBox( frame ); mHtml.lineSpin->setMinimumWidth( fontMetrics().maxWidth()*10 ); mHtml.lineSpin->setRange( 5, INT_MAX ); gbox->addWidget( mHtml.lineSpin, 0, 1 ); text = i18n("&Lines per table:"); - label = new QLabel( mHtml.lineSpin, text, frame ); + label = new TQLabel( mHtml.lineSpin, text, frame ); gbox->addWidget( label, 0, 0 ); - mHtml.prefixInput = new QLineEdit( frame, "prefix" ); + mHtml.prefixInput = new TQLineEdit( frame, "prefix" ); mHtml.prefixInput->setMinimumWidth( fontMetrics().maxWidth()*10 ); gbox->addWidget( mHtml.prefixInput, 1, 1 ); text = i18n("Filename &prefix (in package):"); - label = new QLabel( mHtml.prefixInput, text, frame ); + label = new TQLabel( mHtml.prefixInput, text, frame ); gbox->addWidget( label, 1, 0 ); - QStringList headerList; + TQStringList headerList; headerList.append( i18n("None") ); headerList.append( i18n("Filename with Path") ); headerList.append( i18n("Filename") ); headerList.append( i18n("Page Number") ); - mHtml.topCombo = new QComboBox( false, frame ); + mHtml.topCombo = new TQComboBox( false, frame ); mHtml.topCombo->insertStringList( headerList ); gbox->addWidget( mHtml.topCombo, 2, 1 ); text = i18n("Header &above text:"); - label = new QLabel( mHtml.topCombo, text, frame ); + label = new TQLabel( mHtml.topCombo, text, frame ); gbox->addWidget( label, 2, 0 ); - mHtml.bottomCombo = new QComboBox( false, frame ); + mHtml.bottomCombo = new TQComboBox( false, frame ); mHtml.bottomCombo->insertStringList( headerList ); gbox->addWidget( mHtml.bottomCombo, 3, 1 ); text = i18n("&Footer below text:"); - label = new QLabel( mHtml.bottomCombo, text, frame ); + label = new TQLabel( mHtml.bottomCombo, text, frame ); gbox->addWidget( label, 3, 0 ); text = i18n("Link \"index.html\" to &table of contents file"); - mHtml.symlinkCheck = new QCheckBox( text, page ); + mHtml.symlinkCheck = new TQCheckBox( text, page ); topLayout->addWidget( mHtml.symlinkCheck ); text = i18n("&Include navigator bar"); - mHtml.navigatorCheck = new QCheckBox( text, page ); + mHtml.navigatorCheck = new TQCheckBox( text, page ); topLayout->addWidget( mHtml.navigatorCheck ); text = i18n("&Use black and white only"); - mHtml.bwCheck = new QCheckBox( text, page ); + mHtml.bwCheck = new TQCheckBox( text, page ); topLayout->addWidget( mHtml.bwCheck ); topLayout->addStretch(10); @@ -366,44 +366,44 @@ void CExportDialog::makeHtmlOption( void ) void CExportDialog::makeRtfOption( void ) { - QFrame *page = new QFrame( mFrame[ page_option ] ); + TQFrame *page = new TQFrame( mFrame[ page_option ] ); if( page == 0 ) { return; } mOptionStack->addWidget( page, option_rtf ); - QVBoxLayout *topLayout = new QVBoxLayout( page, 0, spacingHint() ); - QString text = i18n("No options for this format."); - QLabel *label = new QLabel( text, page ); + TQVBoxLayout *topLayout = new TQVBoxLayout( page, 0, spacingHint() ); + TQString text = i18n("No options for this format."); + TQLabel *label = new TQLabel( text, page ); topLayout->addWidget( label, 0, AlignCenter ); } void CExportDialog::makeCArrayOption( void ) { - QFrame *page = new QFrame( mFrame[ page_option ] ); + TQFrame *page = new TQFrame( mFrame[ page_option ] ); mOptionStack->addWidget( page, option_carray ); - QString text; - QVBoxLayout *topLayout = new QVBoxLayout( page, 0, spacingHint() ); + TQString text; + TQVBoxLayout *topLayout = new TQVBoxLayout( page, 0, spacingHint() ); text = i18n("C Array Options"); - QLabel *label = new QLabel( text, page ); + TQLabel *label = new TQLabel( text, page ); topLayout->addWidget( label, 0, AlignLeft ); - QFrame *hline = new QFrame( page ); - hline->setFrameStyle( QFrame::Sunken | QFrame::HLine ); + TQFrame *hline = new TQFrame( page ); + hline->setFrameStyle( TQFrame::Sunken | TQFrame::HLine ); topLayout->addWidget( hline ); - QGridLayout *gbox = new QGridLayout( 3, 2, spacingHint() ); + TQGridLayout *gbox = new TQGridLayout( 3, 2, spacingHint() ); topLayout->addLayout( gbox ); gbox->setColStretch( 1, 10 ); - mArray.nameInput = new QLineEdit( page ); + mArray.nameInput = new TQLineEdit( page ); gbox->addWidget( mArray.nameInput, 0, 1 ); text = i18n("Array name:"); - label = new QLabel( mArray.nameInput, text, page ); + label = new TQLabel( mArray.nameInput, text, page ); gbox->addWidget( label, 0, 0 ); - QStringList typeList; + TQStringList typeList; typeList.append( i18n("char") ); typeList.append( i18n("unsigned char") ); typeList.append( i18n("short") ); @@ -412,24 +412,24 @@ void CExportDialog::makeCArrayOption( void ) typeList.append( i18n("unsigned int") ); typeList.append( i18n("float") ); typeList.append( i18n("double") ); - mArray.typeCombo = new QComboBox( false, page ); + mArray.typeCombo = new TQComboBox( false, page ); mArray.typeCombo->insertStringList( typeList ); mArray.typeCombo->setMinimumWidth( fontMetrics().maxWidth()*10 ); gbox->addWidget( mArray.typeCombo, 1, 1 ); text = i18n("Element type:"); - label = new QLabel( mArray.typeCombo, text, page ); + label = new TQLabel( mArray.typeCombo, text, page ); gbox->addWidget( label, 1, 0 ); - mArray.lineSizeSpin = new QSpinBox( page ); + mArray.lineSizeSpin = new TQSpinBox( page ); mArray.lineSizeSpin->setMinimumWidth( fontMetrics().maxWidth()*10 ); mArray.lineSizeSpin->setRange( 1, INT_MAX ); gbox->addWidget( mArray.lineSizeSpin, 2, 1 ); text = i18n("Elements per line:"); - label = new QLabel( mArray.lineSizeSpin, text, page ); + label = new TQLabel( mArray.lineSizeSpin, text, page ); gbox->addWidget( label, 2, 0 ); text = i18n("Print unsigned values as hexadecimal"); - mArray.hexadecimalCheck = new QCheckBox( text, page ); + mArray.hexadecimalCheck = new TQCheckBox( text, page ); topLayout->addWidget( mArray.hexadecimalCheck ); topLayout->addStretch(10); @@ -459,7 +459,7 @@ void CExportDialog::rangeChanged( int id ) void CExportDialog::browserClicked( void ) { - QString url; + TQString url; if( mDestination.formatCombo->currentItem() == option_html ) { url = KFileDialog::getExistingDirectory( mWorkDir, topLevelWidget() ); @@ -485,7 +485,7 @@ void CExportDialog::browserClicked( void ) void CExportDialog::slotOk( void ) { - QString path( mDestination.fileInput->text() ); + TQString path( mDestination.fileInput->text() ); int format = mDestination.formatCombo->currentItem(); if( format == option_text ) @@ -499,7 +499,7 @@ void CExportDialog::slotOk( void ) uint mode; if( collectRange( mode, e.range.start, e.range.stop ) == false ) { - showEntryFailure( this, QString("") ); + showEntryFailure( this, TQString("") ); return; } e.range.mode = (SExportRange::EMode)mode; // FIXME @@ -514,25 +514,25 @@ void CExportDialog::slotOk( void ) uint mode; if( collectRange( mode, e.range.start, e.range.stop ) == false ) { - showEntryFailure( this, QString("") ); + showEntryFailure( this, TQString("") ); return; } e.range.mode = (SExportRange::EMode)mode; // FIXME - const QString str = mHtml.prefixInput->text().stripWhiteSpace(); + const TQString str = mHtml.prefixInput->text().stripWhiteSpace(); mHtml.prefixInput->setText( str ); if( mHtml.prefixInput->text().isEmpty() == true ) { mHtml.prefixInput->setText( "table" ); } - const QString prefix = mHtml.prefixInput->text(); + const TQString prefix = mHtml.prefixInput->text(); for( uint i=0; i<prefix.length(); i++ ) { - QChar c = prefix[i]; + TQChar c = prefix[i]; if( c.isSpace() == true || c.isPunct() == true ) { - QString msg = i18n("The filename prefix can not contain empty letters " + TQString msg = i18n("The filename prefix can not contain empty letters " "or punctuation marks."); KMessageBox::sorry( this, msg, i18n("Export Document") ); return; @@ -558,7 +558,7 @@ void CExportDialog::slotOk( void ) } else if( format == option_rtf ) { - QString msg = i18n("This format is not yet supported."); + TQString msg = i18n("This format is not yet supported."); KMessageBox::sorry( this, msg ); } else if( format == option_carray ) @@ -572,7 +572,7 @@ void CExportDialog::slotOk( void ) uint mode; if( collectRange( mode, e.range.start, e.range.stop ) == false ) { - showEntryFailure( this, QString("") ); + showEntryFailure( this, TQString("") ); return; } e.range.mode = (SExportRange::EMode)mode; // FIXME @@ -591,7 +591,7 @@ void CExportDialog::slotOk( void ) bool CExportDialog::collectRange( uint &mode, uint &start, uint &stop ) { - QButton *b = mDestination.rangeBox->selected(); + TQButton *b = mDestination.rangeBox->selected(); if( b == 0 ) { return( false ); @@ -629,24 +629,24 @@ bool CExportDialog::collectRange( uint &mode, uint &start, uint &stop ) // This one will attempt to create a directory if 'path' // specifies a nonexistent name. // -bool CExportDialog::verifyPackage( const QString &path ) +bool CExportDialog::verifyPackage( const TQString &path ) { - const QString title = i18n("Export Document"); + const TQString title = i18n("Export Document"); if( path.isEmpty() == true ) { - QString msg = i18n("You must specify a destination."); + TQString msg = i18n("You must specify a destination."); KMessageBox::sorry( this, msg, title ); return( false ); } - QFileInfo info( path ); + TQFileInfo info( path ); if( info.exists() == false ) { - QDir directory; + TQDir directory; if( directory.mkdir( path ) == false ) { - QString msg; + TQString msg; msg += i18n("Unable to create a new folder"); msg += "\n"; msg += path; @@ -658,7 +658,7 @@ bool CExportDialog::verifyPackage( const QString &path ) { if( info.isDir() == false ) { - QString msg = i18n("You have specified an existing file"); + TQString msg = i18n("You have specified an existing file"); KMessageBox::sorry( this, msg, title ); return( false ); } @@ -666,17 +666,17 @@ bool CExportDialog::verifyPackage( const QString &path ) { if( info.isWritable() == false ) { - QString msg = i18n( "" + TQString msg = i18n( "" "You do not have write permission to this folder."); KMessageBox::sorry( this, msg, title ); return( false ); } - const QString prefix = mHtml.prefixInput->text(); - QString f1 = QString("%1%2.html").arg(prefix).arg("00000000"); - QString f2 = QString("%1%2.html").arg(prefix).arg("99999999"); + const TQString prefix = mHtml.prefixInput->text(); + TQString f1 = TQString("%1%2.html").arg(prefix).arg("00000000"); + TQString f2 = TQString("%1%2.html").arg(prefix).arg("99999999"); - QString msg = i18n( "" + TQString msg = i18n( "" "You have specified an existing folder.\n" "If you continue, any existing file in the range " "\"%1\" to \"%2\" can be lost.\n" diff --git a/khexedit/exportdialog.h b/khexedit/exportdialog.h index 6d89ac3..91716f0 100644 --- a/khexedit/exportdialog.h +++ b/khexedit/exportdialog.h @@ -57,46 +57,46 @@ class CExportDialog : public KDialogBase option_max }; - CExportDialog( QWidget *parent = 0, char *name = 0, bool modal = false ); + CExportDialog( TQWidget *parent = 0, char *name = 0, bool modal = false ); ~CExportDialog( void ); void writeConfiguration( void ); protected: - void showEvent( QShowEvent *e ); + void showEvent( TQShowEvent *e ); protected slots: virtual void slotOk( void ); - void destinationChanged(const QString &); + void destinationChanged(const TQString &); private: struct SDestinationWidgets { - QComboBox *formatCombo; - QLabel *fileExtraLabel; - QLineEdit *fileInput; - QLabel *fromLabel; - QLabel *toLabel; - QButtonGroup *rangeBox; - QLineEdit *fromInput; - QLineEdit *toInput; + TQComboBox *formatCombo; + TQLabel *fileExtraLabel; + TQLineEdit *fileInput; + TQLabel *fromLabel; + TQLabel *toLabel; + TQButtonGroup *rangeBox; + TQLineEdit *fromInput; + TQLineEdit *toInput; }; struct SHtmlWidgets { - QSpinBox *lineSpin; - QLineEdit *prefixInput; - QComboBox *topCombo; - QComboBox *bottomCombo; - QCheckBox *navigatorCheck; - QCheckBox *symlinkCheck; - QCheckBox *bwCheck; + TQSpinBox *lineSpin; + TQLineEdit *prefixInput; + TQComboBox *topCombo; + TQComboBox *bottomCombo; + TQCheckBox *navigatorCheck; + TQCheckBox *symlinkCheck; + TQCheckBox *bwCheck; }; struct SArrayWidgets { - QLineEdit *nameInput; - QComboBox *typeCombo; - QSpinBox *lineSizeSpin; - QCheckBox *hexadecimalCheck; + TQLineEdit *nameInput; + TQComboBox *typeCombo; + TQSpinBox *lineSizeSpin; + TQCheckBox *hexadecimalCheck; }; private slots: @@ -113,7 +113,7 @@ class CExportDialog : public KDialogBase void makeCArrayOption( void ); void readConfiguration( void ); bool collectRange( uint &mode, uint &start, uint &stop ); - bool verifyPackage( const QString &path ); + bool verifyPackage( const TQString &path ); signals: void exportText( const SExportText &e ); @@ -121,14 +121,14 @@ class CExportDialog : public KDialogBase void exportCArray( const SExportCArray &e ); private: - QFrame *mFrame[ page_max ]; - QWidgetStack *mOptionStack; + TQFrame *mFrame[ page_max ]; + TQWidgetStack *mOptionStack; SDestinationWidgets mDestination; SHtmlWidgets mHtml; SArrayWidgets mArray; KSimpleConfig *mConfig; - QString mWorkDir; + TQString mWorkDir; }; diff --git a/khexedit/fileinfodialog.cc b/khexedit/fileinfodialog.cc index b9dff60..465c7f3 100644 --- a/khexedit/fileinfodialog.cc +++ b/khexedit/fileinfodialog.cc @@ -18,9 +18,9 @@ * */ -#include <qheader.h> -#include <qlabel.h> -#include <qlayout.h> +#include <tqheader.h> +#include <tqlabel.h> +#include <tqlayout.h> #include <kglobalsettings.h> #include <kglobal.h> @@ -33,15 +33,15 @@ class CStatisticListViewItem : public QListViewItem { public: - CStatisticListViewItem( QListView * parent, QListViewItem * after, - QString label1, QString label2, QString label3, QString label4, - QString label5, QString label6, QString label7, int i, int o) - : QListViewItem( parent, after, label1, label2, label3, label4, label5, label6, label7), + CStatisticListViewItem( TQListView * parent, TQListViewItem * after, + TQString label1, TQString label2, TQString label3, TQString label4, + TQString label5, TQString label6, TQString label7, int i, int o) + : TQListViewItem( parent, after, label1, label2, label3, label4, label5, label6, label7), item( i ), occurrence( o ) {} - virtual int compare( QListViewItem *i, int col, bool ascending/*Qt doc says: ignore this one*/ ) const + virtual int compare( TQListViewItem *i, int col, bool ascending/*Qt doc says: ignore this one*/ ) const { // occurrence column (or the percent one)? if( col == 5 || col == 6 ) @@ -57,7 +57,7 @@ class CStatisticListViewItem : public QListViewItem } // default else - return QListViewItem::compare(i,col,ascending); + return TQListViewItem::compare(i,col,ascending); } protected: @@ -69,33 +69,33 @@ class CStatisticListViewItem : public QListViewItem -CFileInfoDialog::CFileInfoDialog( QWidget *parent,const char *name,bool modal) +CFileInfoDialog::CFileInfoDialog( TQWidget *parent,const char *name,bool modal) :KDialogBase( Plain, i18n("Statistics"), Help|User1|Cancel, User1, parent, name, modal, true, i18n("&Update") ), mBusy(false), mDirty(false) { - setHelp( "khexedit/khexedit.html", QString::null ); + setHelp( "khexedit/khexedit.html", TQString::null ); - QString text; - QVBoxLayout *topLayout = new QVBoxLayout( plainPage(), 0, spacingHint() ); + TQString text; + TQVBoxLayout *topLayout = new TQVBoxLayout( plainPage(), 0, spacingHint() ); if( topLayout == 0 ) { return; } - QGridLayout *gbox = new QGridLayout( 2, 2, spacingHint() ); + TQGridLayout *gbox = new TQGridLayout( 2, 2, spacingHint() ); if( gbox == 0 ) { return; } topLayout->addLayout( gbox ); gbox->setColStretch( 1, 10 ); text = i18n("File name: "); - QLabel *label = new QLabel( text, plainPage() ); + TQLabel *label = new TQLabel( text, plainPage() ); gbox->addWidget( label, 0, 0 ); text = i18n("Size [bytes]: "); - label = new QLabel( text, plainPage() ); + label = new TQLabel( text, plainPage() ); gbox->addWidget( label, 1, 0 ); - mFileNameLabel = new QLabel( plainPage() ); - mFileSizeLabel = new QLabel( plainPage() ); + mFileNameLabel = new TQLabel( plainPage() ); + mFileSizeLabel = new TQLabel( plainPage() ); gbox->addWidget( mFileNameLabel, 0, 1 ); gbox->addWidget( mFileSizeLabel, 1, 1 ); @@ -110,10 +110,10 @@ CFileInfoDialog::CFileInfoDialog( QWidget *parent,const char *name,bool modal) mFrequencyList->addColumn( i18n("Occurrence") ); mFrequencyList->addColumn( i18n("Percent") ); mFrequencyList->setAllColumnsShowFocus( true ); - mFrequencyList->setFrameStyle( QFrame::WinPanel + QFrame::Sunken ); + mFrequencyList->setFrameStyle( TQFrame::WinPanel + TQFrame::Sunken ); topLayout->addWidget( mFrequencyList, 10 ); - mDirtyLabel = new QLabel( plainPage() ); + mDirtyLabel = new TQLabel( plainPage() ); mDirtyLabel->setFixedHeight( fontMetrics().height() ); topLayout->addWidget( mDirtyLabel ); @@ -189,9 +189,9 @@ void CFileInfoDialog::setStatistics() // Default mFileNameLabel->clear(); mFileSizeLabel->clear(); - static const QString u("?"); - QString d, h, o, b, c; - QListViewItem *item = 0; + static const TQString u("?"); + TQString d, h, o, b, c; + TQListViewItem *item = 0; char buf[10]; memset( buf, 0, sizeof( buf ) ); @@ -203,8 +203,8 @@ void CFileInfoDialog::setStatistics() // Default o.sprintf("%03o", i ); b.sprintf("%s", printBin(i) ); - const QChar _i((char)i); - c = _i.isPrint() ? _i : QChar('.'); + const TQChar _i((char)i); + c = _i.isPrint() ? _i : TQChar('.'); item = new CStatisticListViewItem( mFrequencyList, item, h, d, o, b, c, u, u, i, -1 ); if( i == 0 ) @@ -221,8 +221,8 @@ void CFileInfoDialog::setStatistics( SStatisticControl &sc ) mFileNameLabel->setText( sc.documentName ); mFileSizeLabel->setText( KGlobal::locale()->formatNumber(sc.documentSize, 0) ); - QString d, h, o, b, c, n, p; - QListViewItem *item = 0; + TQString d, h, o, b, c, n, p; + TQListViewItem *item = 0; uint size, pre, i; // find width of occurrence @@ -239,17 +239,17 @@ void CFileInfoDialog::setStatistics( SStatisticControl &sc ) o.sprintf("%03o", i ); b.sprintf("%s", printBin(i) ); - n = QString("%1").arg( sc.occurrence[i], pre ); + n = TQString("%1").arg( sc.occurrence[i], pre ); if( sc.documentSize == 0 ) p = "0.00"; else { double val = 100.0*((double)sc.occurrence[i]/(double)sc.documentSize); - p = QString("%1").arg( val, 6, 'f', 2 ); + p = TQString("%1").arg( val, 6, 'f', 2 ); } - const QChar _i((char)i); - c = _i.isPrint() ? _i : QChar('.'); + const TQChar _i((char)i); + c = _i.isPrint() ? _i : TQChar('.'); item = new CStatisticListViewItem( mFrequencyList, item, h, d, o, b, c, n, p, i, sc.occurrence[i] ); if( i == 0 ) @@ -261,7 +261,7 @@ void CFileInfoDialog::setStatistics( SStatisticControl &sc ) void CFileInfoDialog::setColumnWidth( void ) { - const QFontMetrics &fm = mFrequencyList->fontMetrics(); + const TQFontMetrics &fm = mFrequencyList->fontMetrics(); int w0, w1, w2, w3, w4; w0 = -fm.minLeftBearing() - fm.minRightBearing() + 8 + fm.maxWidth(); @@ -305,13 +305,13 @@ void CFileInfoDialog::setColumnWidth( void ) } -void CFileInfoDialog::resizeEvent( QResizeEvent * ) +void CFileInfoDialog::resizeEvent( TQResizeEvent * ) { setColumnWidth(); } -void CFileInfoDialog::showEvent( QShowEvent *e ) +void CFileInfoDialog::showEvent( TQShowEvent *e ) { KDialogBase::showEvent(e); setColumnWidth(); @@ -319,7 +319,7 @@ void CFileInfoDialog::showEvent( QShowEvent *e ) } -void CFileInfoDialog::timerEvent( QTimerEvent * ) +void CFileInfoDialog::timerEvent( TQTimerEvent * ) { killTimers(); slotUser1(); diff --git a/khexedit/fileinfodialog.h b/khexedit/fileinfodialog.h index c994d48..3c2b6bf 100644 --- a/khexedit/fileinfodialog.h +++ b/khexedit/fileinfodialog.h @@ -38,7 +38,7 @@ class CFileInfoDialog : public KDialogBase Q_OBJECT public: - CFileInfoDialog( QWidget *parent=0, const char *name=0,bool modal=false ); + CFileInfoDialog( TQWidget *parent=0, const char *name=0,bool modal=false ); ~CFileInfoDialog( void ); void setStatistics( void ); @@ -52,9 +52,9 @@ class CFileInfoDialog : public KDialogBase virtual void slotUser1( void ); protected: - virtual void resizeEvent( QResizeEvent * ); - virtual void showEvent( QShowEvent * ); - virtual void timerEvent( QTimerEvent * ); + virtual void resizeEvent( TQResizeEvent * ); + virtual void showEvent( TQShowEvent * ); + virtual void timerEvent( TQTimerEvent * ); private: void setColumnWidth( void ); @@ -66,9 +66,9 @@ class CFileInfoDialog : public KDialogBase bool mBusy; bool mDirty; CListView *mFrequencyList; - QLabel *mFileNameLabel; - QLabel *mFileSizeLabel; - QLabel *mDirtyLabel; + TQLabel *mFileNameLabel; + TQLabel *mFileSizeLabel; + TQLabel *mDirtyLabel; }; #endif diff --git a/khexedit/hexbuffer.cc b/khexedit/hexbuffer.cc index 0c1d598..81b8fe6 100644 --- a/khexedit/hexbuffer.cc +++ b/khexedit/hexbuffer.cc @@ -24,7 +24,7 @@ #include <time.h> #include <unistd.h> -#include <qfileinfo.h> +#include <tqfileinfo.h> #include <klocale.h> #include <kglobal.h> @@ -37,7 +37,7 @@ // // There are some comments marked with a "// ##" at various places. // These indicate a patch from Sergey A. Sukiyazov which I have applied -// "as is" for now. The number of QString::fromLocal8Bit in this modification +// "as is" for now. The number of TQString::fromLocal8Bit in this modification // indicates that I should perhaps modify code elsewhere as well // (espen 2000-11-26) // @@ -430,7 +430,7 @@ const char *SExportCArray::printFormatted( const char *b, uint maxSize ) const } -QString SExportCArray::variableName( uint range ) const +TQString SExportCArray::variableName( uint range ) const { const char *typeString[] = { @@ -447,7 +447,7 @@ QString SExportCArray::variableName( uint range ) const uint es = elementSize(); uint numElement = range / es + ((range % es) ? 1 : 0); - return( QString("%1 %2[%2]").arg(typeString[elementType]). + return( TQString("%1 %2[%2]").arg(typeString[elementType]). arg(arrayName).arg(numElement) ); } @@ -510,7 +510,7 @@ SFileState CHexBuffer::mFileState; CHexBuffer::CHexBuffer( void ) - :QByteArray() + :TQByteArray() { mColorIndex = 0; mPrintBuf = 0; @@ -748,7 +748,7 @@ bool CHexBuffer::matchWidth( uint width ) } -void CHexBuffer::setNonPrintChar( QChar nonPrintChar ) +void CHexBuffer::setNonPrintChar( TQChar nonPrintChar ) { mFontInfo.nonPrintChar = nonPrintChar; } @@ -913,7 +913,7 @@ void CHexBuffer::setBookmarkVisibility( bool showInColumn, bool showInEditor ) mShowBookmarkInEditor = showInEditor; } -int CHexBuffer::writeFile( QFile &file, CProgress &p ) +int CHexBuffer::writeFile( TQFile &file, CProgress &p ) { uint offset = 0; uint remaining = documentSize(); @@ -950,7 +950,7 @@ int CHexBuffer::writeFile( QFile &file, CProgress &p ) } -int CHexBuffer::readFile( QFile &file, const QString &url, CProgress &p ) +int CHexBuffer::readFile( TQFile &file, const TQString &url, CProgress &p ) { if( resize( file.size() + 100 ) == false ) { @@ -1010,7 +1010,7 @@ int CHexBuffer::readFile( QFile &file, const QString &url, CProgress &p ) } -int CHexBuffer::insertFile( QFile &file, CProgress &p ) +int CHexBuffer::insertFile( TQFile &file, CProgress &p ) { if( file.size() == 0 ) { @@ -1018,7 +1018,7 @@ int CHexBuffer::insertFile( QFile &file, CProgress &p ) return( Err_Success ); } - QByteArray array( file.size() ); + TQByteArray array( file.size() ); if( array.isNull() == true ) { p.finish(); @@ -1062,7 +1062,7 @@ int CHexBuffer::insertFile( QFile &file, CProgress &p ) } -int CHexBuffer::newFile( const QString &url ) +int CHexBuffer::newFile( const TQString &url ) { if( resize( 100 ) == 0 ) { @@ -1090,7 +1090,7 @@ void CHexBuffer::closeFile( void ) setDocumentSize(0); mDocumentModified = false; - QString emptyUrl; + TQString emptyUrl; setUrl( emptyUrl ); mSelect.reset(); @@ -1100,9 +1100,9 @@ void CHexBuffer::closeFile( void ) } -void CHexBuffer::registerDiskModifyTime( const QFile &file ) +void CHexBuffer::registerDiskModifyTime( const TQFile &file ) { - QFileInfo fileInfo( file ); + TQFileInfo fileInfo( file ); mDiskModifyTime = fileInfo.lastModified(); } @@ -1111,18 +1111,18 @@ void CHexBuffer::registerDiskModifyTime( const QFile &file ) void CHexBuffer::setFont( const SDisplayFontInfo &fontInfo ) { mFontInfo = fontInfo; - QFontMetrics fm( mFontInfo.font ); + TQFontMetrics fm( mFontInfo.font ); mFontHeight = fm.height(); mFontAscent = fm.ascent(); computeLineWidth(); for( int i=0; i < 256; i++ ) { - mCharValid[i] = QChar(i).isPrint(); + mCharValid[i] = TQChar(i).isPrint(); } /* - QFontInfo info( mFontInfo.font ); + TQFontInfo info( mFontInfo.font ); puts("CHexBuffer mCharValid broken"); KCharset charset( info.charSet() ); @@ -1154,7 +1154,7 @@ int CHexBuffer::setEncoding( CConversion::EMode mode, CProgress &p ) void CHexBuffer::computeLineWidth( void ) { - QFontMetrics fm( mFontInfo.font ); + TQFontMetrics fm( mFontInfo.font ); mUnitWidth = fm.width( "M" ); if( mLayout.primaryMode == SDisplayLayout::textOnly ) @@ -1335,7 +1335,7 @@ void CHexBuffer::computeNumLines( void ) -void CHexBuffer::drawSelection( QPainter &paint, QColor &color, uint start, +void CHexBuffer::drawSelection( TQPainter &paint, TQColor &color, uint start, uint stop, int sx ) { if( start >= stop ) { return; } @@ -1371,7 +1371,7 @@ void CHexBuffer::drawSelection( QPainter &paint, QColor &color, uint start, -void CHexBuffer::drawText( QPainter &paint, uint line, int sx, int x1, int x2 ) +void CHexBuffer::drawText( TQPainter &paint, uint line, int sx, int x1, int x2 ) { uint fileOffset = line * mLayout.lineSize; if( documentPresent() == false || mLoadingData == true ) @@ -1488,7 +1488,7 @@ void CHexBuffer::drawText( QPainter &paint, uint line, int sx, int x1, int x2 ) // ## paint.drawText(offset,mFontAscent,&mPrintBuf[mOffsetIndex], // mOffsetSize); paint.drawText( offset, mFontAscent, - QString::fromLocal8Bit(&mPrintBuf[mOffsetIndex]), + TQString::fromLocal8Bit(&mPrintBuf[mOffsetIndex]), mOffsetSize ); } offset += s0; @@ -1500,7 +1500,7 @@ void CHexBuffer::drawText( QPainter &paint, uint line, int sx, int x1, int x2 ) int s2 = mLayout.leftSeparatorWidth + mLayout.separatorMarginWidth; if( x1 < offset + s2 && x2 >= offset ) { - QPen pen( mColor.leftSeparatorFg, mLayout.leftSeparatorWidth ); + TQPen pen( mColor.leftSeparatorFg, mLayout.leftSeparatorWidth ); paint.setPen( pen ); int center = offset + mLayout.leftSeparatorWidth/2; paint.drawLine( center, 0, center, lineHeight() ); @@ -1541,7 +1541,7 @@ void CHexBuffer::drawText( QPainter &paint, uint line, int sx, int x1, int x2 ) // ## paint.drawText( localOffset, mFontAscent, mPrintBuf, mNumCell ); paint.drawText( localOffset, mFontAscent, - QString::fromLocal8Bit(mPrintBuf), mNumCell ); + TQString::fromLocal8Bit(mPrintBuf), mNumCell ); } localOffset += s; @@ -1568,7 +1568,7 @@ void CHexBuffer::drawText( QPainter &paint, uint line, int sx, int x1, int x2 ) int s = mLayout.separatorMarginWidth + mLayout.rightSeparatorWidth; if( x1 < offset + s && x2 >= offset ) { - QPen pen( mColor.rightSeparatorFg, mLayout.rightSeparatorWidth ); + TQPen pen( mColor.rightSeparatorFg, mLayout.rightSeparatorWidth ); paint.setPen( pen ); int center = offset + mLayout.rightSeparatorWidth/2; paint.drawLine( center, 0, center, lineHeight() ); @@ -1601,7 +1601,7 @@ void CHexBuffer::drawText( QPainter &paint, uint line, int sx, int x1, int x2 ) // ## paint.drawText( offset, mFontAscent, mPrintBuf, 1 ); paint.drawText( offset, mFontAscent, - QString::fromLocal8Bit(mPrintBuf), 1 ); + TQString::fromLocal8Bit(mPrintBuf), 1 ); } offset += s; } @@ -1630,7 +1630,7 @@ void CHexBuffer::drawText( QPainter &paint, uint line, int sx, int x1, int x2 ) int s1 = s0 + mLayout.separatorMarginWidth + mLayout.edgeMarginWidth - sx; if( x1 < s1 && x2 > 0 ) { - QColor bg = mShowBookmarkInOffsetColumn && + TQColor bg = mShowBookmarkInOffsetColumn && (bookmarkPosition & BookmarkOnLine) ? mColor.bookmarkBg : mColor.offsetBg; if( outsideText == true ) @@ -1655,7 +1655,7 @@ void CHexBuffer::drawText( QPainter &paint, uint line, int sx, int x1, int x2 ) // ## paint.drawText(offset,mFontAscent,&mPrintBuf[mOffsetIndex], // mOffsetSize); paint.drawText( offset, mFontAscent, - QString::fromLocal8Bit(&mPrintBuf[mOffsetIndex]), + TQString::fromLocal8Bit(&mPrintBuf[mOffsetIndex]), mOffsetSize ); } @@ -1668,7 +1668,7 @@ void CHexBuffer::drawText( QPainter &paint, uint line, int sx, int x1, int x2 ) int s2 = mLayout.leftSeparatorWidth + mLayout.separatorMarginWidth; if( x1 < offset + s2 && x2 >= offset ) { - QPen pen( mColor.leftSeparatorFg, mLayout.leftSeparatorWidth ); + TQPen pen( mColor.leftSeparatorFg, mLayout.leftSeparatorWidth ); paint.setPen( pen ); int center = offset + mLayout.leftSeparatorWidth/2; paint.drawLine( center, 0, center, lineHeight() ); @@ -1694,7 +1694,7 @@ void CHexBuffer::drawText( QPainter &paint, uint line, int sx, int x1, int x2 ) -void CHexBuffer::drawText( QPainter &paint, uint line, int x1, int x2, int y, +void CHexBuffer::drawText( TQPainter &paint, uint line, int x1, int x2, int y, bool useBlackWhite ) { uint fileOffset = line * mLayout.lineSize; @@ -1722,7 +1722,7 @@ void CHexBuffer::drawText( QPainter &paint, uint line, int x1, int x2, int y, if( mLayout.horzGridWidth > 0 && outsideText == false ) { - QPen pen( useBlackWhite == true ? Qt::black : mColor.gridFg, + TQPen pen( useBlackWhite == true ? Qt::black : mColor.gridFg, mLayout.horzGridWidth ); paint.setPen( pen ); paint.drawLine( x1, y+mFontHeight, x2+x1, y+mFontHeight ); @@ -1758,7 +1758,7 @@ void CHexBuffer::drawText( QPainter &paint, uint line, int x1, int x2, int y, // ## paint.drawText( offset, mFontAscent+y, &mPrintBuf[mOffsetIndex], // mOffsetSize ); paint.drawText( offset, mFontAscent+y, - QString::fromLocal8Bit(&mPrintBuf[mOffsetIndex]), + TQString::fromLocal8Bit(&mPrintBuf[mOffsetIndex]), mOffsetSize ); } offset += s1; @@ -1768,7 +1768,7 @@ void CHexBuffer::drawText( QPainter &paint, uint line, int x1, int x2, int y, offset += mLayout.separatorMarginWidth; int s2 = mLayout.leftSeparatorWidth + mLayout.separatorMarginWidth; - QPen pen( useBlackWhite == true ? Qt::black : mColor.leftSeparatorFg, + TQPen pen( useBlackWhite == true ? Qt::black : mColor.leftSeparatorFg, mLayout.leftSeparatorWidth ); paint.setPen( pen ); int center = offset + mLayout.leftSeparatorWidth/2; @@ -1797,14 +1797,14 @@ void CHexBuffer::drawText( QPainter &paint, uint line, int x1, int x2, int y, } // ## paint.drawText( localOffset, mFontAscent+y, mPrintBuf, mNumCell ); paint.drawText( localOffset, mFontAscent+y, - QString::fromLocal8Bit(mPrintBuf), mNumCell ); + TQString::fromLocal8Bit(mPrintBuf), mNumCell ); localOffset += s; if( mLayout.vertGridWidth > 0 && i+1 < dataSize ) { if( (i+1) % mLayout.columnSize == 0 ) { - QPen pen( useBlackWhite == true ? Qt::black : mColor.gridFg, + TQPen pen( useBlackWhite == true ? Qt::black : mColor.gridFg, mLayout.vertGridWidth ); paint.setPen( pen ); int x = localOffset - (mSplitWidth+1) / 2; @@ -1822,7 +1822,7 @@ void CHexBuffer::drawText( QPainter &paint, uint line, int x1, int x2, int y, { offset += mLayout.separatorMarginWidth; int s = mLayout.separatorMarginWidth + mLayout.rightSeparatorWidth; - QPen pen( useBlackWhite == true ? Qt::black : mColor.rightSeparatorFg, + TQPen pen( useBlackWhite == true ? Qt::black : mColor.rightSeparatorFg, mLayout.rightSeparatorWidth ); paint.setPen( pen ); int center = offset + mLayout.rightSeparatorWidth/2; @@ -1849,7 +1849,7 @@ void CHexBuffer::drawText( QPainter &paint, uint line, int x1, int x2, int y, } // ## paint.drawText( offset, mFontAscent+y, mPrintBuf, 1 ); paint.drawText( offset, mFontAscent+y, - QString::fromLocal8Bit(mPrintBuf), 1 ); + TQString::fromLocal8Bit(mPrintBuf), 1 ); offset += s; } } @@ -1857,22 +1857,22 @@ void CHexBuffer::drawText( QPainter &paint, uint line, int x1, int x2, int y, } -int CHexBuffer::headerHeight( QPainter &paint ) +int CHexBuffer::headerHeight( TQPainter &paint ) { - QFont font( paint.font() ); + TQFont font( paint.font() ); paint.setFont( KGlobalSettings::generalFont() ); - const QFontMetrics &fm = paint.fontMetrics(); + const TQFontMetrics &fm = paint.fontMetrics(); int height = fm.height(); paint.setFont( font ); return( height ); } -int CHexBuffer::headerMargin( QPainter &paint ) +int CHexBuffer::headerMargin( TQPainter &paint ) { - QFont font( paint.font() ); + TQFont font( paint.font() ); paint.setFont( KGlobalSettings::generalFont() ); - const QFontMetrics &fm = paint.fontMetrics(); + const TQFontMetrics &fm = paint.fontMetrics(); int margin = fm.height() / 2; paint.setFont( font ); @@ -1880,13 +1880,13 @@ int CHexBuffer::headerMargin( QPainter &paint ) } -void CHexBuffer::drawHeader( QPainter &paint, int sx, int width, int y, +void CHexBuffer::drawHeader( TQPainter &paint, int sx, int width, int y, bool isFooter, const SPageHeader &header, const SPagePosition &position ) { - QFont font( paint.font() ); + TQFont font( paint.font() ); paint.setFont( KGlobalSettings::generalFont() ); - const QFontMetrics &fm = paint.fontMetrics(); + const TQFontMetrics &fm = paint.fontMetrics(); paint.fillRect( sx, y, width, fm.height(), Qt::white ); paint.setPen( Qt::black ); @@ -1908,15 +1908,15 @@ void CHexBuffer::drawHeader( QPainter &paint, int sx, int width, int y, int pos[3] = { - QPainter::AlignLeft, QPainter::AlignHCenter, QPainter::AlignRight + TQPainter::AlignLeft, TQPainter::AlignHCenter, TQPainter::AlignRight }; - QString msg; + TQString msg; for( int i=0; i<3; i++ ) { if( header.pos[i] == SPageHeader::DateTime ) { - QDateTime datetime; + TQDateTime datetime; datetime.setTime_t( position.now ); msg = KGlobal::locale()->formatDateTime(datetime); } @@ -1935,10 +1935,10 @@ void CHexBuffer::drawHeader( QPainter &paint, int sx, int width, int y, continue; } - if( 0 && pos[i] == QPainter::AlignRight ) + if( 0 && pos[i] == TQPainter::AlignRight ) { - //const QFontMetrics &f = QFontMetrics( KGlobalSettings::generalFont() ); - //QRect r = paint.boundingRect(sx, y, width, fm.height(), pos[i], msg ); + //const TQFontMetrics &f = TQFontMetrics( KGlobalSettings::generalFont() ); + //TQRect r = paint.boundingRect(sx, y, width, fm.height(), pos[i], msg ); //printf("R: %d, %d, %d, %d\n", r.x(), r.y(), r.width(), r.height() ); int x = sx + width - /*r.width();*/ fm.width(msg); @@ -1960,7 +1960,7 @@ void CHexBuffer::drawHeader( QPainter &paint, int sx, int width, int y, -int CHexBuffer::drawBookmarks( QPainter &paint, uint line, int startx ) +int CHexBuffer::drawBookmarks( TQPainter &paint, uint line, int startx ) { if( documentPresent() == false || mLoadingData == true ) { @@ -1969,8 +1969,8 @@ int CHexBuffer::drawBookmarks( QPainter &paint, uint line, int startx ) uint start = line*mLayout.lineSize; uint stop = start+mLayout.lineSize; - QColor bg = mColor.bookmarkBg; - QColor fg = mColor.bookmarkFg; + TQColor bg = mColor.bookmarkBg; + TQColor fg = mColor.bookmarkFg; int bookmarkPosition = 0; @@ -2019,14 +2019,14 @@ int CHexBuffer::drawBookmarks( QPainter &paint, uint line, int startx ) paint.setPen( flag == 0 ? fg : mColor.nonPrintFg ); // ## paint.drawText( x1-startx, mFontAscent, mPrintBuf, mNumCell ); paint.drawText( x1-startx, mFontAscent, - QString::fromLocal8Bit(mPrintBuf), mNumCell ); + TQString::fromLocal8Bit(mPrintBuf), mNumCell ); if( mLayout.secondaryMode != SDisplayLayout::hide ) { flag = printAsciiCell( mPrintBuf, c ); paint.setPen( flag == 0 ? fg : mColor.nonPrintFg ); // ## paint.drawText( x2-startx, mFontAscent, mPrintBuf, 1 ); paint.drawText( x2-startx, mFontAscent, - QString::fromLocal8Bit(mPrintBuf), 1 ); + TQString::fromLocal8Bit(mPrintBuf), 1 ); } } } @@ -2036,7 +2036,7 @@ int CHexBuffer::drawBookmarks( QPainter &paint, uint line, int startx ) -void CHexBuffer::drawCursor( QPainter &paint, uint line, int startx, +void CHexBuffer::drawCursor( TQPainter &paint, uint line, int startx, bool onBookmark ) { if( documentPresent() == false || mLoadingData == true ) @@ -2049,7 +2049,7 @@ void CHexBuffer::drawCursor( QPainter &paint, uint line, int startx, // // Draw the cursor in primary edit area. // - QColor bg, fg; + TQColor bg, fg; bool useFg; if( mMark.inside( c.offset ) == true ) { @@ -2070,8 +2070,8 @@ void CHexBuffer::drawCursor( QPainter &paint, uint line, int startx, useFg = false; // Can be true later. } - QColor cbg = mColor.cursorBg; - QColor cfg = mColor.cursorFg; + TQColor cbg = mColor.cursorBg; + TQColor cfg = mColor.cursorFg; // // Fill in the general backround color @@ -2144,7 +2144,7 @@ void CHexBuffer::drawCursor( QPainter &paint, uint line, int startx, // ## paint.drawText( c.x1-startx, mFontAscent, &mPrintBuf[c.cell], // mNumCell-c.cell ); paint.drawText( c.x1-startx, mFontAscent, - QString::fromLocal8Bit(&mPrintBuf[c.cell]), + TQString::fromLocal8Bit(&mPrintBuf[c.cell]), mNumCell-c.cell ); } @@ -2153,7 +2153,7 @@ void CHexBuffer::drawCursor( QPainter &paint, uint line, int startx, paint.setPen( flag == 0 || useFg == true ? fg : mColor.nonPrintFg ); // ## paint.drawText( c.x1 - startx, mFontAscent, &mPrintBuf[c.cell], 1); paint.drawText( c.x1 - startx, mFontAscent, - QString::fromLocal8Bit(&mPrintBuf[c.cell]), 1 ); + TQString::fromLocal8Bit(&mPrintBuf[c.cell]), 1 ); } } @@ -2261,14 +2261,14 @@ void CHexBuffer::drawCursor( QPainter &paint, uint line, int startx, paint.setPen( flag == 0 ? mColor.bookmarkFg : mColor.nonPrintFg ); // ## paint.drawText( c.x2-startx, mFontAscent, mPrintBuf, 1 ); paint.drawText( c.x2-startx, mFontAscent, - QString::fromLocal8Bit(mPrintBuf), 1 ); + TQString::fromLocal8Bit(mPrintBuf), 1 ); } if( transparent == false || onBookmark == false ) { paint.setPen( flag == 0 || useFg == true ? fg : mColor.nonPrintFg ); // ## paint.drawText( c.x2 - startx, mFontAscent, mPrintBuf, 1 ); paint.drawText( c.x2 - startx, mFontAscent, - QString::fromLocal8Bit(mPrintBuf), 1 ); + TQString::fromLocal8Bit(mPrintBuf), 1 ); } } @@ -2507,7 +2507,7 @@ bool CHexBuffer::setCursorPosition( int x, int y, bool init, bool cellLevel ) -bool CHexBuffer::inputAtCursor( QChar c ) +bool CHexBuffer::inputAtCursor( TQChar c ) { if( documentPresent() == false || mInputMode.noInput() == true ) { @@ -2552,7 +2552,7 @@ bool CHexBuffer::inputAtCursor( QChar c ) { // ## if( THIS_FPTR(inputCell)( &dest, c.latin1(), mCursor.curr.cell ) //== false ) - if( THIS_FPTR(inputCell)( &dest, QString(c).local8Bit()[0], + if( THIS_FPTR(inputCell)( &dest, TQString(c).local8Bit()[0], mCursor.curr.cell ) == false ) { inputSound(); @@ -2562,7 +2562,7 @@ bool CHexBuffer::inputAtCursor( QChar c ) else if( mActiveEditor == edit_secondary ) { // ## if( inputAscii( &dest, c.latin1(), mCursor.curr.cell ) == false ) - if( !inputAscii( &dest, QString(c).local8Bit()[0], mCursor.curr.cell ) ) + if( !inputAscii( &dest, TQString(c).local8Bit()[0], mCursor.curr.cell ) ) { inputSound(); return( false ); @@ -2584,7 +2584,7 @@ bool CHexBuffer::inputAtCursor( QChar c ) -int CHexBuffer::inputAtCursor( const QByteArray &buf, uint oldSize ) +int CHexBuffer::inputAtCursor( const TQByteArray &buf, uint oldSize ) { if( documentPresent() == false ) { @@ -2716,7 +2716,7 @@ int CHexBuffer::exportText( const SExportText &ex, CProgress &p ) return( errCode ); } - QFile file( ex.destFile ); + TQFile file( ex.destFile ); if( file.open( IO_WriteOnly ) == false ) { p.finish(); @@ -2740,7 +2740,7 @@ int CHexBuffer::exportText( const SExportText &ex, CProgress &p ) uint bytePerLine = mOffsetSize + 1 + (mNumCell + 2)*mLayout.lineSize + 1; uint linePerStep = 20; - QByteArray array( bytePerLine * linePerStep + 1 ); // Line is 0 terminated + TQByteArray array( bytePerLine * linePerStep + 1 ); // Line is 0 terminated if( array.isEmpty() == true ) { p.finish(); @@ -2817,21 +2817,21 @@ int CHexBuffer::exportHtml( const SExportHtml &ex, CProgress &p ) uint numFiles = remaining/linePerPage + (remaining%linePerPage ? 1 : 0); uint fileCount = 0; - QStringList fileNames, offsets; - QString name, offset; + TQStringList fileNames, offsets; + TQString name, offset; for( uint i=0; i < numFiles; i++ ) { name.sprintf( "%08d.html", i+1 ); - fileNames.append( QString("%1/%2%3").arg(ex.package).arg(ex.prefix). + fileNames.append( TQString("%1/%2%3").arg(ex.package).arg(ex.prefix). arg(name)); } name.sprintf( "%08d.html", 0 ); - QString tocName =QString("%1/%2%3").arg(ex.package).arg(ex.prefix).arg(name); + TQString tocName =TQString("%1/%2%3").arg(ex.package).arg(ex.prefix).arg(name); - QString linkName; + TQString linkName; if( ex.symLink == true ) { - linkName = QString("%1/%2").arg(ex.package).arg("index.html"); + linkName = TQString("%1/%2").arg(ex.package).arg("index.html"); } while( remaining > 0 ) @@ -2849,7 +2849,7 @@ int CHexBuffer::exportHtml( const SExportHtml &ex, CProgress &p ) THIS_FPTR(printOffset)( mPrintBuf, (startLine-1)*mLayout.lineSize ); mPrintBuf[mOffsetSize]=0; - offset += QString(" %1 [%2]").arg(i18n("to")).arg(mPrintBuf); + offset += TQString(" %1 [%2]").arg(i18n("to")).arg(mPrintBuf); offsets.append(offset); if( p.expired() == true ) @@ -2881,7 +2881,7 @@ int CHexBuffer::exportCArray( const SExportCArray &ex, CProgress &p ) return( errCode ); } - QFile file( ex.destFile ); + TQFile file( ex.destFile ); if( file.open( IO_WriteOnly ) == false ) { p.finish(); @@ -2903,7 +2903,7 @@ int CHexBuffer::exportCArray( const SExportCArray &ex, CProgress &p ) uint elementSize = ex.elementSize(); uint elementOnThisLine = 0; - QTextStream dest( &file ); + TQTextStream dest( &file ); dest << ex.variableName(stop-start).latin1() << "={" << endl; for( unsigned int i=start; i<stop; i+=elementSize ) @@ -2942,7 +2942,7 @@ int CHexBuffer::exportCArray( const SExportCArray &ex, CProgress &p ) -int CHexBuffer::copySelectedText( QByteArray &array, int columnSegment ) +int CHexBuffer::copySelectedText( TQByteArray &array, int columnSegment ) { SExportRange range; range.mode = SExportRange::Selection; @@ -2950,7 +2950,7 @@ int CHexBuffer::copySelectedText( QByteArray &array, int columnSegment ) } -int CHexBuffer::copyAllText( QByteArray &array ) +int CHexBuffer::copyAllText( TQByteArray &array ) { SExportRange range; range.mode = SExportRange::All; @@ -2958,7 +2958,7 @@ int CHexBuffer::copyAllText( QByteArray &array ) } -int CHexBuffer::copyText( QByteArray &array, const SExportRange &range, +int CHexBuffer::copyText( TQByteArray &array, const SExportRange &range, int columnSegment ) { uint start, stop; @@ -3010,7 +3010,7 @@ int CHexBuffer::copyText( QByteArray &array, const SExportRange &range, } -int CHexBuffer::copySelectedData( QByteArray &array ) +int CHexBuffer::copySelectedData( TQByteArray &array ) { uint start = mSelect.start(); uint stop = mSelect.stop(); @@ -3036,7 +3036,7 @@ int CHexBuffer::copySelectedData( QByteArray &array ) uint CHexBuffer::numPage( CHexPrinter &printer ) { - QPainter paint( &printer ); + TQPainter paint( &printer ); paint.setFont( font() ); SPageMargin margin = printer.pageMargin(); @@ -3074,7 +3074,7 @@ int CHexBuffer::print( CHexPrinter &printer, CProgress &p ) { printer.setDocName( mUrl ); - QPainter paint( &printer ); + TQPainter paint( &printer ); paint.setFont( font() ); SPageMargin margin = printer.pageMargin(); @@ -4251,7 +4251,7 @@ int CHexBuffer::filter( SFilterControl &fc ) } if( start >= stop ) { return( Err_IllegalRange ); } - QByteArray buf( stop - start ); + TQByteArray buf( stop - start ); if( buf.isEmpty() == true ) { return( Err_NoMemory ); } int errCode = fc.execute((uchar*)&buf[0],(uchar*)&data()[start],buf.size()); @@ -4284,7 +4284,7 @@ int CHexBuffer::collectStrings( CStringCollectControl &sc ) { if( on == true && i-start >= sc.minLength ) { - QByteArray a( i-start ); + TQByteArray a( i-start ); for( uint j=0; j<(i-start); a[j]=data()[start+j], j++ ); sc.add( start, a ); } @@ -4299,7 +4299,7 @@ int CHexBuffer::collectStrings( CStringCollectControl &sc ) if( on == true && i-start >= sc.minLength ) { - QByteArray a( i-start ); + TQByteArray a( i-start ); for( uint j=0; j<(i-start); a[j]=data()[start+j], j++ ); sc.add( start, a ); } @@ -4668,7 +4668,7 @@ int CHexBuffer::resizeBuffer( uint newSize ) if( newSize >= size() ) { - QByteArray tmp; + TQByteArray tmp; tmp.duplicate( data(), size() ); if( tmp.isNull() == true ) { @@ -4692,7 +4692,7 @@ void CHexBuffer::inputSound( void ) { if( mInputErrorSound == true ) { - KNotifyClient::beep( QObject::tr("Edit operation failed") ); + KNotifyClient::beep( TQObject::tr("Edit operation failed") ); } } @@ -4701,13 +4701,13 @@ void CHexBuffer::fatalSound( void ) { if( mFatalErrorSound == true ) { - KNotifyClient::beep( QObject::tr("Could not allocate memory") ); + KNotifyClient::beep( TQObject::tr("Could not allocate memory") ); } } -int CHexBuffer::printHtmlDataPage( const QString &tocName, - const QStringList &fileNames, uint index, +int CHexBuffer::printHtmlDataPage( const TQString &tocName, + const TQStringList &fileNames, uint index, const SExportHtml &ex, uint line, uint numLine ) { @@ -4721,16 +4721,16 @@ int CHexBuffer::printHtmlDataPage( const QString &tocName, index = fileNames.count()-1; } - QFile file( fileNames[index] ); + TQFile file( fileNames[index] ); if( file.open( IO_WriteOnly ) == false ) { return( Err_OperationAborted ); } - QTextStream os( &file ); - const QString *next = index+1 >= fileNames.count() ? 0 : &fileNames[index+1]; - const QString *prev = index == 0 ? 0 : &fileNames[index-1]; - const QString *toc = tocName.length() == 0 ? 0 : &tocName; + TQTextStream os( &file ); + const TQString *next = index+1 >= fileNames.count() ? 0 : &fileNames[index+1]; + const TQString *prev = index == 0 ? 0 : &fileNames[index-1]; + const TQString *toc = tocName.length() == 0 ? 0 : &tocName; printHtmlHeader( os, true ); if( ex.navigator == true ) @@ -4752,10 +4752,10 @@ int CHexBuffer::printHtmlDataPage( const QString &tocName, } -void CHexBuffer::printHtmlTocPage( const QString &tocName, - const QString &linkName, - const QStringList &fileNames, - const QStringList &offsets, +void CHexBuffer::printHtmlTocPage( const TQString &tocName, + const TQString &linkName, + const TQStringList &fileNames, + const TQStringList &offsets, uint numPage ) { if( numPage == 0 || fileNames.count() == 0 ) @@ -4767,13 +4767,13 @@ void CHexBuffer::printHtmlTocPage( const QString &tocName, numPage = fileNames.count() - 1; } - QFile file( tocName ); + TQFile file( tocName ); if( file.open( IO_WriteOnly ) == false ) { return; } - QTextStream os( &file ); + TQTextStream os( &file ); printHtmlHeader( os, true ); os << "<P ALIGN=\"CENTER\">" << endl; @@ -4785,7 +4785,7 @@ void CHexBuffer::printHtmlTocPage( const QString &tocName, os << "<P ALIGN=\"CENTER\"><TT>" << endl; for( uint i=0; i<=numPage; i++ ) { - QString n( fileNames[i].right( fileNames[i].length() - + TQString n( fileNames[i].right( fileNames[i].length() - fileNames[i].findRev('/') - 1) ); os << "<A HREF=\"" << n << "\">" << i18n("Page") << i+1; os << "</A>"; @@ -4802,7 +4802,7 @@ void CHexBuffer::printHtmlTocPage( const QString &tocName, // Make a symlink. We ignore any error here. I don't consider // it to be fatal. // - QString n( tocName.right( tocName.length() - tocName.findRev('/') - 1) ); + TQString n( tocName.right( tocName.length() - tocName.findRev('/') - 1) ); symlink( n.latin1(), linkName.latin1() ); } @@ -4810,10 +4810,10 @@ void CHexBuffer::printHtmlTocPage( const QString &tocName, -void CHexBuffer::printHtmlCaption( QTextStream &os, uint captionType, +void CHexBuffer::printHtmlCaption( TQTextStream &os, uint captionType, uint curPage, uint numPage ) { - QString caption; + TQString caption; switch( captionType ) { case 0: @@ -4842,8 +4842,8 @@ void CHexBuffer::printHtmlCaption( QTextStream &os, uint captionType, -void CHexBuffer::printHtmlNavigator( QTextStream &os, const QString *next, - const QString *prev, const QString *toc ) +void CHexBuffer::printHtmlNavigator( TQTextStream &os, const TQString *next, + const TQString *prev, const TQString *toc ) { os << "<TABLE BORDER=\"0\" CELLSPACING=\"0\" WIDTH=\"100%\">" << endl; os << "<TR>" << endl; @@ -4854,7 +4854,7 @@ void CHexBuffer::printHtmlNavigator( QTextStream &os, const QString *next, } else { - QString n( next->right( next->length() - next->findRev('/') - 1) ); + TQString n( next->right( next->length() - next->findRev('/') - 1) ); os << "<A HREF=\"" << n << "\">" << i18n("Next") << "</A>" << " "; } @@ -4864,7 +4864,7 @@ void CHexBuffer::printHtmlNavigator( QTextStream &os, const QString *next, } else { - QString p( prev->right( prev->length() - prev->findRev('/') - 1) ); + TQString p( prev->right( prev->length() - prev->findRev('/') - 1) ); os << "<A HREF=\"" << p << "\">" << i18n("Previous") << "</A>" << " "; } @@ -4874,7 +4874,7 @@ void CHexBuffer::printHtmlNavigator( QTextStream &os, const QString *next, } else { - QString t( toc->right( toc->length() - toc->findRev('/') - 1) ); + TQString t( toc->right( toc->length() - toc->findRev('/') - 1) ); os << "<A HREF=\"" << t << "\">" << i18n("Contents"); os << "</A>" << " "; } @@ -4891,7 +4891,7 @@ void CHexBuffer::printHtmlNavigator( QTextStream &os, const QString *next, } -int CHexBuffer::printHtmlHeader( QTextStream &os, bool isFront ) +int CHexBuffer::printHtmlHeader( TQTextStream &os, bool isFront ) { if( isFront == true ) { @@ -4910,11 +4910,11 @@ int CHexBuffer::printHtmlHeader( QTextStream &os, bool isFront ) } -int CHexBuffer::printHtmlTable( QTextStream &os, uint line, uint numLine, +int CHexBuffer::printHtmlTable( TQTextStream &os, uint line, uint numLine, bool bw ) { uint i; - QColor color; + TQColor color; int numCol = 1; @@ -4969,13 +4969,13 @@ int CHexBuffer::printHtmlTable( QTextStream &os, uint line, uint numLine, } -int CHexBuffer::printHtmlLine( QTextStream &os, uint line, bool isPrimary, +int CHexBuffer::printHtmlLine( TQTextStream &os, uint line, bool isPrimary, bool bw ) { uint offset = line * mLayout.lineSize; - QColor prevColor; + TQColor prevColor; - QColor color; + TQColor color; if( bw == true ) { color = Qt::white; diff --git a/khexedit/hexbuffer.h b/khexedit/hexbuffer.h index ea11d95..755cca1 100644 --- a/khexedit/hexbuffer.h +++ b/khexedit/hexbuffer.h @@ -28,14 +28,14 @@ #include <iostream> #include <time.h> -#include <qbitarray.h> -#include <qdatetime.h> -#include <qfile.h> -#include <qfont.h> -#include <qptrlist.h> -#include <qpainter.h> -#include <qstring.h> -#include <qtextstream.h> +#include <tqbitarray.h> +#include <tqdatetime.h> +#include <tqfile.h> +#include <tqfont.h> +#include <tqptrlist.h> +#include <tqpainter.h> +#include <tqstring.h> +#include <tqtextstream.h> #include <kapplication.h> @@ -51,8 +51,8 @@ struct SSearchControl { - QByteArray key; - QByteArray val; + TQByteArray key; + TQByteArray val; uint keyType; bool fromCursor; bool inSelection; @@ -84,7 +84,7 @@ struct SFilterControl int execute( uchar *dest, uchar *src, uint size ); - QByteArray operand; + TQByteArray operand; int rotate[2]; Operation operation; bool fromCursor; @@ -96,7 +96,7 @@ struct SFilterControl struct SInsertData { uint size; - QByteArray pattern; + TQByteArray pattern; uint offset; bool repeatPattern; bool onCursor; @@ -121,15 +121,15 @@ struct SExportRange struct SExportText { SExportRange range; - QString destFile; + TQString destFile; }; struct SExportHtml { SExportRange range; - QString package; - QString prefix; + TQString package; + TQString prefix; uint linePerPage; uint topCaption; uint bottomCaption; @@ -154,12 +154,12 @@ struct SExportCArray }; const char *printFormatted( const char *b, uint maxSize ) const; - QString variableName( uint range ) const; + TQString variableName( uint range ) const; int elementSize( void ) const; SExportRange range; - QString destFile; - QString arrayName; + TQString destFile; + TQString arrayName; int elementType; uint elementPerLine; bool unsignedAsHexadecimal; @@ -176,7 +176,7 @@ struct SStatisticControl uint documentSize; uint occurrence[256]; - QString documentName; + TQString documentName; }; @@ -233,9 +233,9 @@ class CStringCollectControl mList.setAutoDelete( true ); } - int add( uint offset, const QByteArray &a ) + int add( uint offset, const TQByteArray &a ) { - QString *s = new QString(); + TQString *s = new TQString(); if( s == 0 ) { return( Err_NoMemory ); @@ -250,7 +250,7 @@ class CStringCollectControl s->sprintf( "%04x:%04x", offset>>16, offset&0x0000FFFF ); } - *s += QString( a ); + *s += TQString( a ); mList.append( s ); return( Err_Success ); @@ -266,7 +266,7 @@ class CStringCollectControl mList.clear(); } - const QString *get( uint index ) + const TQString *get( uint index ) { return( mList.at( index ) ); } @@ -276,7 +276,7 @@ class CStringCollectControl return( mList.count() ); } - QPtrList<QString> &list( void ) + TQPtrList<TQString> &list( void ) { return( mList ); } @@ -287,7 +287,7 @@ class CStringCollectControl bool allow8bit; private: - QPtrList<QString> mList; + TQPtrList<TQString> mList; }; @@ -1079,7 +1079,7 @@ class CHexBuffer : public QByteArray bool matchWidth( uint width ); - void setNonPrintChar( QChar nonPrintChar ); + void setNonPrintChar( TQChar nonPrintChar ); void setShowCursor( bool showCursor ); void setDisableCursor( bool disableCursor ); void setCursorShapeModifier( bool alwaysBlock, bool thickInsert ); @@ -1096,37 +1096,37 @@ class CHexBuffer : public QByteArray bool setCursorPosition( int x, int y, bool init, bool cellLevel ); - int readFile( QFile &file, const QString &url, CProgress &p ); - int insertFile( QFile &file, CProgress &p ); - int writeFile( QFile &file, CProgress &p ); - int newFile( const QString &url ); + int readFile( TQFile &file, const TQString &url, CProgress &p ); + int insertFile( TQFile &file, CProgress &p ); + int writeFile( TQFile &file, CProgress &p ); + int newFile( const TQString &url ); void closeFile( void ); - void registerDiskModifyTime( const QFile &file ); + void registerDiskModifyTime( const TQFile &file ); bool changedOnDisk( void ); - void drawText( QPainter &paint, uint line, int sx, int x, int w ); - void drawText( QPainter &paint, uint line, int x1, int x2, int y, + void drawText( TQPainter &paint, uint line, int sx, int x, int w ); + void drawText( TQPainter &paint, uint line, int x1, int x2, int y, bool useBlackWhite ); - void drawHeader( QPainter &paint, int sx, int width, int y, bool isFooter, + void drawHeader( TQPainter &paint, int sx, int width, int y, bool isFooter, const SPageHeader &header,const SPagePosition &position ); - int headerHeight( QPainter &paint ); - int headerMargin( QPainter &paint ); + int headerHeight( TQPainter &paint ); + int headerMargin( TQPainter &paint ); - bool inputAtCursor( QChar c ); - int inputAtCursor( const QByteArray &buf, uint oldSize ); + bool inputAtCursor( TQChar c ); + int inputAtCursor( const TQByteArray &buf, uint oldSize ); bool removeAtCursor( bool beforeCursor ); int locateRange( const SExportRange &range, uint &start, uint &stop ); int exportText( const SExportText &ex, CProgress &p ); int exportHtml( const SExportHtml &ex, CProgress &p ); int exportCArray( const SExportCArray &ex, CProgress &p ); - int copySelectedText( QByteArray &array, int columnSegment=VisibleColumn); - int copyAllText( QByteArray &array ); - int copyText( QByteArray &array, const SExportRange &range, + int copySelectedText( TQByteArray &array, int columnSegment=VisibleColumn); + int copyAllText( TQByteArray &array ); + int copyText( TQByteArray &array, const SExportRange &range, int columnSegment ); - int copySelectedData( QByteArray &array ); + int copySelectedData( TQByteArray &array ); uint numPage( CHexPrinter &printer ); int print( CHexPrinter &printer, CProgress &p ); @@ -1154,12 +1154,12 @@ class CHexBuffer : public QByteArray void doAction( CHexAction *action ); inline SCursorState &cursorState( void ); - inline void valueOnCursor( QByteArray &buf, uint size ); + inline void valueOnCursor( TQByteArray &buf, uint size ); inline SFileState &fileState( void ); inline const SDisplayLayout &layout( void ); inline const SDisplayInputMode &inputMode( void ); - inline QPtrList<SCursorOffset> &bookmarkList( void ); + inline TQPtrList<SCursorOffset> &bookmarkList( void ); inline bool documentPresent( void ); inline bool modified( void ); @@ -1169,11 +1169,11 @@ class CHexBuffer : public QByteArray inline const SEncodeState &encoding( void ); inline bool losslessEncoding( CConversion::EMode mode ); - inline QString &url( void ); + inline TQString &url( void ); bool hasFileName( void ); - inline void setUrl( const QString &url ); + inline void setUrl( const TQString &url ); inline void setModified( bool modified ); - inline const QDateTime &diskModifyTime( void ); + inline const TQDateTime &diskModifyTime( void ); @@ -1185,9 +1185,9 @@ class CHexBuffer : public QByteArray inline int unitWidth( void ); inline int numLines( void ); inline int totalHeight( void ); - inline const QFont &font( void ); + inline const TQFont &font( void ); inline SCursor *textCursor( void ); - inline const QColor &backgroundColor( void ); + inline const TQColor &backgroundColor( void ); inline int startX( void ); inline int startY( void ); inline void setStartX( int val ); @@ -1239,10 +1239,10 @@ class CHexBuffer : public QByteArray void computeNumLines( void ); void cursorCompute( void ); - void drawSelection( QPainter &paint, QColor &color, uint start, uint stop, + void drawSelection( TQPainter &paint, TQColor &color, uint start, uint stop, int sx ); - int drawBookmarks(QPainter &paint, uint line, int startx); - void drawCursor( QPainter &paint, uint line, int startx, bool onBookmark ); + int drawBookmarks(TQPainter &paint, uint line, int startx); + void drawCursor( TQPainter &paint, uint line, int startx, bool onBookmark ); void recordStart( SCursor &cursor ); void recordReplace( SCursor &cursor, uint size, char *data, uint dataSize); @@ -1251,7 +1251,7 @@ class CHexBuffer : public QByteArray int scanData( SSearchControl &sc, bool init ); int initScanData( SSearchControl &sc ); - inline const QColor &foregroundColor( uint column ); + inline const TQColor &foregroundColor( uint column ); inline int printDummyCell( char *buf, unsigned char data ); inline int printHexadecimalBigCell( char *buf, unsigned char data ); inline int printHexadecimalSmallCell( char *buf, unsigned char data ); @@ -1277,27 +1277,27 @@ class CHexBuffer : public QByteArray void inputSound( void ); void fatalSound( void ); - int printHtmlDataPage( const QString &tocName, - const QStringList &fileNames, uint index, + int printHtmlDataPage( const TQString &tocName, + const TQStringList &fileNames, uint index, const SExportHtml &ex, uint line, uint numLine ); - void printHtmlCaption( QTextStream &os, uint captionType, uint curPage, + void printHtmlCaption( TQTextStream &os, uint captionType, uint curPage, uint numPage ); - void printHtmlNavigator( QTextStream &os, const QString *next, - const QString *prev, const QString *toc ); - void printHtmlTocPage( const QString &tocName, - const QString &linkName, - const QStringList &fileNames, - const QStringList &offsets, uint numPage ); - int printHtmlHeader( QTextStream &os, bool isFront ); - int printHtmlTable( QTextStream &os, uint line, uint numLine, bool bw ); - int printHtmlLine( QTextStream &os, uint offset, bool isPrimary, bool bw ); + void printHtmlNavigator( TQTextStream &os, const TQString *next, + const TQString *prev, const TQString *toc ); + void printHtmlTocPage( const TQString &tocName, + const TQString &linkName, + const TQStringList &fileNames, + const TQStringList &offsets, uint numPage ); + int printHtmlHeader( TQTextStream &os, bool isFront ); + int printHtmlTable( TQTextStream &os, uint line, uint numLine, bool bw ); + int printHtmlLine( TQTextStream &os, uint offset, bool isPrimary, bool bw ); signals: void fileSize( uint size ); private: - QString mUrl; - QDateTime mDiskModifyTime; + TQString mUrl; + TQDateTime mDiskModifyTime; SDisplayLayout mLayout; SDisplayColor mColor; SDisplayFontInfo mFontInfo; @@ -1349,9 +1349,9 @@ class CHexBuffer : public QByteArray uint mUndoLimit; uint mUndoIndex; - QPtrList<CHexActionGroup> mUndoList; - QPtrList<SCursorOffset> mBookmarkList; - QBitArray mBookmarkMap; + TQPtrList<CHexActionGroup> mUndoList; + TQPtrList<SCursorOffset> mBookmarkList; + TQBitArray mBookmarkMap; PrintCellFunc printCell; PrintOffsetFunc printOffset; @@ -1401,7 +1401,7 @@ inline SCursorState &CHexBuffer::cursorState( void ) } -inline void CHexBuffer::valueOnCursor( QByteArray &buf, uint size ) +inline void CHexBuffer::valueOnCursor( TQByteArray &buf, uint size ) { int offset = cursorOffset(); if( offset + size >= mDocumentSize ) @@ -1429,7 +1429,7 @@ inline const SDisplayInputMode &CHexBuffer::inputMode( void ) return( mInputMode ); } -inline QPtrList<SCursorOffset> &CHexBuffer::bookmarkList( void ) +inline TQPtrList<SCursorOffset> &CHexBuffer::bookmarkList( void ) { return( mBookmarkList ); } @@ -1502,7 +1502,7 @@ inline bool CHexBuffer::losslessEncoding( CConversion::EMode mode ) return( mEncode.lossless(mode) ); } -inline QString &CHexBuffer::url( void ) +inline TQString &CHexBuffer::url( void ) { return( mUrl ); } @@ -1512,12 +1512,12 @@ inline bool CHexBuffer::documentPresent( void ) return( size() == 0 ? false : true ); } -inline void CHexBuffer::setUrl( const QString &url ) +inline void CHexBuffer::setUrl( const TQString &url ) { mUrl = url; } -inline const QDateTime &CHexBuffer::diskModifyTime( void ) +inline const TQDateTime &CHexBuffer::diskModifyTime( void ) { return( mDiskModifyTime ); } @@ -1527,7 +1527,7 @@ inline uint CHexBuffer::calculateLine( uint offset ) return( mLayout.lineSize == 0 ? 0 : offset / mLayout.lineSize ); } -inline const QColor &CHexBuffer::foregroundColor( uint column ) +inline const TQColor &CHexBuffer::foregroundColor( uint column ) { if( column > mLayout.lineSize ) { @@ -1999,7 +1999,7 @@ inline int CHexBuffer::totalHeight( void ) return( mNumLines * (mFontHeight+mLayout.horzGridWidth) ); } -inline const QFont &CHexBuffer::font( void ) +inline const TQFont &CHexBuffer::font( void ) { return( mFontInfo.font ); } @@ -2009,7 +2009,7 @@ inline SCursor *CHexBuffer::textCursor( void ) return( &mCursor ); } -inline const QColor &CHexBuffer::backgroundColor( void ) +inline const TQColor &CHexBuffer::backgroundColor( void ) { return( documentPresent() == true ? mColor.textBg : mColor.inactiveBg ); } diff --git a/khexedit/hexclipboard.cc b/khexedit/hexclipboard.cc index 0de70d6..4732647 100644 --- a/khexedit/hexclipboard.cc +++ b/khexedit/hexclipboard.cc @@ -87,7 +87,7 @@ CHexClipboard::~CHexClipboard( void ) } -bool CHexClipboard::encode( QByteArray &dst, QByteArray &src ) +bool CHexClipboard::encode( TQByteArray &dst, TQByteArray &src ) { if( src.size() == 0 ) { @@ -165,7 +165,7 @@ bool CHexClipboard::encode( QByteArray &dst, QByteArray &src ) -bool CHexClipboard::decode( QByteArray &dst, QString &src ) +bool CHexClipboard::decode( TQByteArray &dst, TQString &src ) { uint mimeSize = strlen( mimeHeader() ); if( src.length() <= mimeSize ) @@ -240,7 +240,7 @@ bool CHexClipboard::decode( QByteArray &dst, QString &src ) } -bool CHexClipboard::plainDecode( QByteArray &dst, QString &src ) +bool CHexClipboard::plainDecode( TQByteArray &dst, TQString &src ) { dst.resize( src.length() ); if( dst.isNull() == true ) diff --git a/khexedit/hexclipboard.h b/khexedit/hexclipboard.h index 9a7710d..3c45f79 100644 --- a/khexedit/hexclipboard.h +++ b/khexedit/hexclipboard.h @@ -21,7 +21,7 @@ #ifndef _HEX_CLIPBOARD_H_ #define _HEX_CLIPBOARD_H_ -#include <qstring.h> +#include <tqstring.h> class CHexClipboard { @@ -29,11 +29,11 @@ class CHexClipboard CHexClipboard( void ); ~CHexClipboard( void ); - bool encode( QByteArray &dst, QByteArray &src ); - bool decode( QByteArray &dst, QString &src ); + bool encode( TQByteArray &dst, TQByteArray &src ); + bool decode( TQByteArray &dst, TQString &src ); private: - bool plainDecode( QByteArray &dst, QString &src ); + bool plainDecode( TQByteArray &dst, TQString &src ); }; diff --git a/khexedit/hexdrag.cc b/khexedit/hexdrag.cc index d09b28d..19cb34e 100644 --- a/khexedit/hexdrag.cc +++ b/khexedit/hexdrag.cc @@ -23,23 +23,23 @@ static const char *mediaString = "application/octet-stream"; -CHexDrag::CHexDrag( const QByteArray &data, QWidget *dragSource, +CHexDrag::CHexDrag( const TQByteArray &data, TQWidget *dragSource, const char *name ) - :QDragObject(dragSource,name) + :TQDragObject(dragSource,name) { setData( data ); prepPixmap(); } -CHexDrag::CHexDrag( QWidget *dragSource, const char *name ) - :QDragObject(dragSource,name) +CHexDrag::CHexDrag( TQWidget *dragSource, const char *name ) + :TQDragObject(dragSource,name) { prepPixmap(); } -void CHexDrag::setData( const QByteArray &data ) +void CHexDrag::setData( const TQByteArray &data ) { mData = data; } @@ -53,9 +53,9 @@ void CHexDrag::prepPixmap(void) // /* KIconLoader &loader = *KGlobal::iconLoader(); - QPixmap pix = loader.loadIcon( "binary.xpm" ); + TQPixmap pix = loader.loadIcon( "binary.xpm" ); - QPoint hotspot( pix.width()-20,pix.height()/2 ); + TQPoint hotspot( pix.width()-20,pix.height()/2 ); setPixmap( pix, hotspot ); */ } @@ -75,7 +75,7 @@ const char *CHexDrag::format( int i ) const } -QByteArray CHexDrag::encodedData( const char *fmt ) const +TQByteArray CHexDrag::encodedData( const char *fmt ) const { if( fmt != 0 ) { @@ -85,18 +85,18 @@ QByteArray CHexDrag::encodedData( const char *fmt ) const } } - QByteArray buf; + TQByteArray buf; return( buf ); } -bool CHexDrag::canDecode( const QMimeSource *e ) +bool CHexDrag::canDecode( const TQMimeSource *e ) { return( e->provides(mediaString) ); } -bool CHexDrag::decode( const QMimeSource *e, QByteArray &dest ) +bool CHexDrag::decode( const TQMimeSource *e, TQByteArray &dest ) { dest = e->encodedData(mediaString); return( dest.size() == 0 ? false : true ); diff --git a/khexedit/hexdrag.h b/khexedit/hexdrag.h index b29b197..2705124 100644 --- a/khexedit/hexdrag.h +++ b/khexedit/hexdrag.h @@ -22,31 +22,31 @@ #define _HEX_DRAG_H_ -#include <qdragobject.h> -#include <qstring.h> +#include <tqdragobject.h> +#include <tqstring.h> class CHexDrag : public QDragObject { Q_OBJECT public: - CHexDrag( const QByteArray &data, QWidget *dragSource = 0, + CHexDrag( const TQByteArray &data, TQWidget *dragSource = 0, const char *name = 0 ); - CHexDrag( QWidget *dragSource = 0, const char *name = 0 ); + CHexDrag( TQWidget *dragSource = 0, const char *name = 0 ); - void setData( const QByteArray &data ); + void setData( const TQByteArray &data ); const char* format ( int i ) const; - QByteArray encodedData( const char *fmt ) const; + TQByteArray encodedData( const char *fmt ) const; - static bool canDecode( const QMimeSource *e ); - static bool decode( const QMimeSource *e, QByteArray &dest ); + static bool canDecode( const TQMimeSource *e ); + static bool decode( const TQMimeSource *e, TQByteArray &dest ); private: void prepPixmap( void ); private: - QByteArray mData; + TQByteArray mData; }; diff --git a/khexedit/hexeditorwidget.cc b/khexedit/hexeditorwidget.cc index 16b62a4..60107f3 100644 --- a/khexedit/hexeditorwidget.cc +++ b/khexedit/hexeditorwidget.cc @@ -47,8 +47,8 @@ -CHexEditorWidget::CHexEditorWidget( QWidget *parent, const char *name ) - : QWidget( parent, name ) +CHexEditorWidget::CHexEditorWidget( TQWidget *parent, const char *name ) + : TQWidget( parent, name ) { CHexBuffer *hexBuffer = new CHexBuffer; if( hexBuffer == 0 ) { return; } @@ -60,16 +60,16 @@ CHexEditorWidget::CHexEditorWidget( QWidget *parent, const char *name ) mHexView = new CHexViewWidget( this, "hexview", hexBuffer ); if( mHexView == 0 || mHexView->widgetValid() == false ) { return; } - connect( mHexView, SIGNAL(pleaseOpenNewFile()), SLOT( newFile()) ); - connect( mHexView, SIGNAL(pleaseOpenFile( const QString&, bool, uint )), - SLOT( open(const QString&, bool, uint)) ); - connect( mHexView, SIGNAL(pleaseStepFile(bool)), SLOT( stepFile(bool)) ); - connect( kapp, SIGNAL( kdisplayFontChanged() ), SLOT( fontChanged() ) ); - connect( kapp, SIGNAL( kdisplayPaletteChanged() ),SLOT( paletteChanged()) ); - connect( mHexView, SIGNAL( layoutChanged( const SDisplayLayout & ) ), - SLOT( layoutChanged( const SDisplayLayout & ) ) ); - connect( mHexView, SIGNAL( inputModeChanged( const SDisplayInputMode & ) ), - this, SLOT( inputModeChanged( const SDisplayInputMode & ) ) ); + connect( mHexView, TQT_SIGNAL(pleaseOpenNewFile()), TQT_SLOT( newFile()) ); + connect( mHexView, TQT_SIGNAL(pleaseOpenFile( const TQString&, bool, uint )), + TQT_SLOT( open(const TQString&, bool, uint)) ); + connect( mHexView, TQT_SIGNAL(pleaseStepFile(bool)), TQT_SLOT( stepFile(bool)) ); + connect( kapp, TQT_SIGNAL( kdisplayFontChanged() ), TQT_SLOT( fontChanged() ) ); + connect( kapp, TQT_SIGNAL( kdisplayPaletteChanged() ),TQT_SLOT( paletteChanged()) ); + connect( mHexView, TQT_SIGNAL( layoutChanged( const SDisplayLayout & ) ), + TQT_SLOT( layoutChanged( const SDisplayLayout & ) ) ); + connect( mHexView, TQT_SIGNAL( inputModeChanged( const SDisplayInputMode & ) ), + this, TQT_SLOT( inputModeChanged( const SDisplayInputMode & ) ) ); mHexView->setFocus(); setBackgroundColor( palette().active().base() ); @@ -379,7 +379,7 @@ void CHexEditorWidget::readConfiguration( KConfig &config ) -void CHexEditorWidget::resizeEvent( QResizeEvent *e ) +void CHexEditorWidget::resizeEvent( TQResizeEvent *e ) { mHexView->resize( e->size().width(), e->size().height() ); } @@ -557,7 +557,7 @@ void CHexEditorWidget::setTextMode( void ) -void CHexEditorWidget::saveWorkingDirectory( const QString &url ) +void CHexEditorWidget::saveWorkingDirectory( const TQString &url ) { if( url.isEmpty() == true ) { @@ -580,7 +580,7 @@ void CHexEditorWidget::newFile( void ) return; } - QString url = i18n("Untitled %1").arg( mUntitledCount ); + TQString url = i18n("Untitled %1").arg( mUntitledCount ); // // If the url is already present in the document list (should not happen), @@ -604,7 +604,7 @@ void CHexEditorWidget::newFile( void ) int errCode = mHexView->newFile( url ); if( errCode != Err_Success ) { - QString msg = i18n("Unable to create new document."); + TQString msg = i18n("Unable to create new document."); KMessageBox::sorry( topLevelWidget(), msg, i18n("Operation Failed") ); return; } @@ -615,7 +615,7 @@ void CHexEditorWidget::newFile( void ) -void CHexEditorWidget::newFile( const QByteArray &data ) +void CHexEditorWidget::newFile( const TQByteArray &data ) { newFile(); mHexView->append( data ); @@ -631,7 +631,7 @@ void CHexEditorWidget::open() if( file.isEmpty() ) return; - QString url = file.url(); + TQString url = file.url(); saveWorkingDirectory( url ); @@ -665,7 +665,7 @@ void CHexEditorWidget::open() -void CHexEditorWidget::open( const QString &url, bool reloadWhenChanged, +void CHexEditorWidget::open( const TQString &url, bool reloadWhenChanged, uint offset ) { if( busy( true ) == true ) @@ -727,7 +727,7 @@ void CHexEditorWidget::stepFile( bool next ) -bool CHexEditorWidget::isOpen( const QString &url, uint &offset ) +bool CHexEditorWidget::isOpen( const TQString &url, uint &offset ) { CHexBuffer *hexBuffer = documentItem( url ); if( hexBuffer == 0 ) @@ -739,7 +739,7 @@ bool CHexEditorWidget::isOpen( const QString &url, uint &offset ) } -bool CHexEditorWidget::selectDocument( const QString &url, +bool CHexEditorWidget::selectDocument( const TQString &url, bool reloadWhenChanged ) { CHexBuffer *hexBuffer = documentItem( url ); @@ -764,7 +764,7 @@ bool CHexEditorWidget::selectDocument( const QString &url, void CHexEditorWidget::insertFile( void ) { - KFileDialog fdlg(mWorkDir, QString::null, topLevelWidget(), 0, TRUE); + KFileDialog fdlg(mWorkDir, TQString::null, topLevelWidget(), 0, TRUE); fdlg.setOperationMode( KFileDialog::Opening ); fdlg.okButton()->setGuiItem( KStdGuiItem::insert() ); fdlg.setCaption(i18n("Insert File")); @@ -781,7 +781,7 @@ void CHexEditorWidget::insertFile( void ) return; } - QString url = file.path(); + TQString url = file.path(); saveWorkingDirectory( url ); @@ -865,10 +865,10 @@ bool CHexEditorWidget::querySave( void ) return( true ); } - QString msg = i18n("" + TQString msg = i18n("" "The current document has been modified.\n" "Do you want to save it?" ); - int reply = KMessageBox::warningYesNoCancel( topLevelWidget(), msg, QString::null, KStdGuiItem::save(), KStdGuiItem::discard() ); + int reply = KMessageBox::warningYesNoCancel( topLevelWidget(), msg, TQString::null, KStdGuiItem::save(), KStdGuiItem::discard() ); if( reply == KMessageBox::Yes ) { return( save() ); @@ -897,8 +897,8 @@ bool CHexEditorWidget::backup( void ) return( false ); } - const QString currentName = kurl.path(); - QString backupName = currentName + '~'; + const TQString currentName = kurl.path(); + TQString backupName = currentName + '~'; int errCode = rename( currentName.latin1(), backupName.latin1() ); if( errCode != 0 ) @@ -930,7 +930,7 @@ bool CHexEditorWidget::save( void ) { if( modifiedByAlien( mHexView->url() ) == true ) { - QString msg = i18n("" + TQString msg = i18n("" "Current document has been changed on disk.\n" "If you save now, those changes will be lost.\n" "Proceed?" ); @@ -978,12 +978,12 @@ bool CHexEditorWidget::saveAs( void ) if( url.isLocalFile() ) { - QString name( url.path() ); - QFileInfo info( name ); + TQString name( url.path() ); + TQFileInfo info( name ); if( info.exists() ) { - QString msg = i18n("" + TQString msg = i18n("" "A document with this name already exists.\n" "Do you want to overwrite it?" ); int reply = KMessageBox::warningContinueCancel( topLevelWidget(), msg, @@ -996,7 +996,7 @@ bool CHexEditorWidget::saveAs( void ) } } - QString symbolicName( url.url() ); + TQString symbolicName( url.url() ); // KURL::decode( symbolicName ); mHexView->setUrl( symbolicName ); @@ -1020,14 +1020,14 @@ void CHexEditorWidget::reload( void ) if( mHexView->urlValid() == false ) { - QString msg = i18n( "The current document does not exist on the disk." ); + TQString msg = i18n( "The current document does not exist on the disk." ); KMessageBox::sorry( topLevelWidget(), msg, i18n("Reload") ); return; } if( mHexView->modified() == true ) { - QString msg; + TQString msg; if( modifiedByAlien( mHexView->url() ) == true ) { msg = i18n( "The current document has changed on the disk and " @@ -1047,7 +1047,7 @@ void CHexEditorWidget::reload( void ) } } - QString url( mHexView->url() ); + TQString url( mHexView->url() ); uint offset = mHexView->offset(); //mHexView->closeFile(); @@ -1108,7 +1108,7 @@ void CHexEditorWidget::printPostscript( CHexPrinter &printer ) // No i18n() on this one! // Constants come from config.h // - QString creator( PACKAGE ); + TQString creator( PACKAGE ); creator += " "; creator += VERSION; @@ -1120,7 +1120,7 @@ void CHexEditorWidget::printPostscript( CHexPrinter &printer ) errCode = mHexView->print( printer, mProgressData ); } - QString msg = i18n("Could not print data.\n"); + TQString msg = i18n("Could not print data.\n"); msg += hexError( errCode ); if( errCode != Err_Success ) @@ -1140,7 +1140,7 @@ bool CHexEditorWidget::confirmPrintPageNumber( CHexPrinter &printer ) if( numPageSelected > mDisplayState.misc.thresholdValue ) { - QString msg = i18n( + TQString msg = i18n( "<qt>Print threshold exceeded.<br>" "You are about to print one page.<br>" "Proceed?</qt>", @@ -1167,12 +1167,12 @@ void CHexEditorWidget::exportDialog( void ) { mExportDialog = new CExportDialog( topLevelWidget(), 0, false ); if( mExportDialog == 0 ) { return; } - connect( mExportDialog, SIGNAL( exportText(const SExportText &)), - this, SLOT( exportText( const SExportText &)) ); - connect( mExportDialog, SIGNAL( exportHtml(const SExportHtml &)), - this, SLOT( exportHtml( const SExportHtml &)) ); - connect( mExportDialog, SIGNAL( exportCArray(const SExportCArray &)), - this, SLOT( exportCArray( const SExportCArray &)) ); + connect( mExportDialog, TQT_SIGNAL( exportText(const SExportText &)), + this, TQT_SLOT( exportText( const SExportText &)) ); + connect( mExportDialog, TQT_SIGNAL( exportHtml(const SExportHtml &)), + this, TQT_SLOT( exportHtml( const SExportHtml &)) ); + connect( mExportDialog, TQT_SIGNAL( exportCArray(const SExportCArray &)), + this, TQT_SLOT( exportCArray( const SExportCArray &)) ); } mExportDialog->show(); } @@ -1189,7 +1189,7 @@ void CHexEditorWidget::exportText( const SExportText &ex ) if( errCode != Err_Success ) { - QString msg = i18n("Unable to export data.\n"); + TQString msg = i18n("Unable to export data.\n"); msg += hexError( errCode ); KMessageBox::sorry( topLevelWidget(), msg, i18n("Export") ); } @@ -1206,7 +1206,7 @@ void CHexEditorWidget::exportHtml( const SExportHtml &ex ) if( errCode != Err_Success ) { - QString msg = i18n("Unable to export data.\n"); + TQString msg = i18n("Unable to export data.\n"); msg += hexError( errCode ); KMessageBox::sorry( topLevelWidget(), msg, i18n("Export") ); } @@ -1223,7 +1223,7 @@ void CHexEditorWidget::exportCArray( const SExportCArray &ex ) if( errCode != Err_Success ) { - QString msg = i18n("Unable to export data.\n"); + TQString msg = i18n("Unable to export data.\n"); msg += hexError( errCode ); KMessageBox::sorry( topLevelWidget(), msg, i18n("Export") ); } @@ -1234,7 +1234,7 @@ void CHexEditorWidget::encode( CConversion::EMode mode ) { if( mHexView->losslessEncoding( mode ) == false ) { - QString msg = i18n("" + TQString msg = i18n("" "The encoding you have selected is not reversible.\n" "If you revert to the original encoding later, there is no " "guarantee that the data can be restored to the original state."); @@ -1256,7 +1256,7 @@ void CHexEditorWidget::encode( CConversion::EMode mode ) if( errCode != Err_Success ) { - QString msg = i18n("Could not encode data.\n"); + TQString msg = i18n("Could not encode data.\n"); msg += hexError( errCode ); KMessageBox::sorry( topLevelWidget(), msg, i18n("Encode") ); } @@ -1409,7 +1409,7 @@ void CHexEditorWidget::removeAllBookmark( void ) { if( mHexView->bookmarkCount() > 0 ) { - QString msg = i18n("" + TQString msg = i18n("" "Deleted bookmarks can not be restored.\n" "Proceed?" ); int reply = KMessageBox::warningContinueCancel( topLevelWidget(), msg ); @@ -1449,8 +1449,8 @@ void CHexEditorWidget::gotoOffset( void ) { mGotoDialog = new CGotoDialog( topLevelWidget(), 0, false ); if( mGotoDialog == 0 ) { return; } - connect( mGotoDialog, SIGNAL(gotoOffset( uint, uint, bool, bool )), - mHexView, SLOT(gotoOffset( uint, uint, bool, bool )) ); + connect( mGotoDialog, TQT_SIGNAL(gotoOffset( uint, uint, bool, bool )), + mHexView, TQT_SLOT(gotoOffset( uint, uint, bool, bool )) ); } mGotoDialog->show(); } @@ -1468,8 +1468,8 @@ void CHexEditorWidget::find( void ) mFindDialog = new CFindDialog( topLevelWidget(), 0, false ); if( mFindDialog == 0 ) { return; } connect( mFindDialog, - SIGNAL(findData(SSearchControl &, uint, bool)), - SLOT(findData(SSearchControl &, uint, bool)) ); + TQT_SIGNAL(findData(SSearchControl &, uint, bool)), + TQT_SLOT(findData(SSearchControl &, uint, bool)) ); } mFindDialog->show(); } @@ -1525,7 +1525,7 @@ void CHexEditorWidget::findData( SSearchControl &sc, uint mode, bool navigator) if( mode == Find_First ) { - QString msg = i18n( "Search key not found in document." ); + TQString msg = i18n( "Search key not found in document." ); KMessageBox::sorry( topLevelWidget(), msg, i18n("Find") ); } } @@ -1559,14 +1559,14 @@ void CHexEditorWidget::findPrevious( void ) } -bool CHexEditorWidget::askWrap( bool fwd, const QString &header ) +bool CHexEditorWidget::askWrap( bool fwd, const TQString &header ) { if( mDisplayState.misc.confirmWrap == false ) { return( true ); // Never ask the user } - QString msg; + TQString msg; if( fwd == true ) { msg += i18n("" @@ -1591,7 +1591,7 @@ bool CHexEditorWidget::canFind( bool showError ) { if( showError == true ) { - QString msg = i18n("" + TQString msg = i18n("" "Your request can not be processed.\n" "No search pattern defined." ); KMessageBox::sorry( topLevelWidget(), msg, i18n("Find") ); @@ -1616,10 +1616,10 @@ void CHexEditorWidget::findNavigator( SSearchControl &sc ) mFindNavigatorDialog = new CFindNavigatorDialog(topLevelWidget(),0,false); if( mFindNavigatorDialog == 0 ) { return; } connect( mFindNavigatorDialog, - SIGNAL(findData(SSearchControl &, uint, bool)), - SLOT(findData(SSearchControl &, uint, bool)) ); - connect( mFindNavigatorDialog, SIGNAL(makeKey(void)), - SLOT(find()) ); + TQT_SIGNAL(findData(SSearchControl &, uint, bool)), + TQT_SLOT(findData(SSearchControl &, uint, bool)) ); + connect( mFindNavigatorDialog, TQT_SIGNAL(makeKey(void)), + TQT_SLOT(find()) ); } if( mFindNavigatorDialog->isVisible() == false ) { @@ -1639,8 +1639,8 @@ void CHexEditorWidget::replace( void ) mReplaceDialog = new CReplaceDialog( topLevelWidget(), 0, false ); if( mReplaceDialog == 0 ) { return; } connect( mReplaceDialog, - SIGNAL( replaceData( SSearchControl &, uint)), - SLOT( replaceData( SSearchControl &, uint))); + TQT_SIGNAL( replaceData( SSearchControl &, uint)), + TQT_SLOT( replaceData( SSearchControl &, uint))); } mReplaceDialog->show(); } @@ -1729,8 +1729,8 @@ void CHexEditorWidget::replacePrompt( SSearchControl &sc ) mReplacePromptDialog = new CReplacePromptDialog(topLevelWidget(), 0,false); if( mReplacePromptDialog == 0 ) { return; } connect( mReplacePromptDialog, - SIGNAL( replaceData( SSearchControl &, uint)), - SLOT( replaceData( SSearchControl &, uint))); + TQT_SIGNAL( replaceData( SSearchControl &, uint)), + TQT_SLOT( replaceData( SSearchControl &, uint))); } if( mReplacePromptDialog->isVisible() == false ) { @@ -1756,7 +1756,7 @@ void CHexEditorWidget::replaceResult( SSearchControl &sc ) if( sc.match == false ) { - QString msg; + TQString msg; if( sc.inSelection == true ) { msg += i18n( "Search key not found in selected area." ); @@ -1769,7 +1769,7 @@ void CHexEditorWidget::replaceResult( SSearchControl &sc ) } else { - const QString msg = i18n( + const TQString msg = i18n( "<qt>Operation complete.<br><br>One replacement was made.</qt>", "<qt>Operation complete.<br><br>%n replacements were made.</qt>", sc.numReplace ); KMessageBox::information( topLevelWidget(), msg, i18n("Find & Replace")); @@ -1783,8 +1783,8 @@ void CHexEditorWidget::insertPattern( void ) { mInsertDialog = new CInsertDialog( topLevelWidget(), 0, false ); if( mInsertDialog == 0 ) { return; } - connect( mInsertDialog, SIGNAL(execute( SInsertData & )), - mHexView, SLOT(insert( SInsertData & )) ); + connect( mInsertDialog, TQT_SIGNAL(execute( SInsertData & )), + mHexView, TQT_SLOT(insert( SInsertData & )) ); } mInsertDialog->show(); } @@ -1792,7 +1792,7 @@ void CHexEditorWidget::insertPattern( void ) void CHexEditorWidget::encoding( void ) { - QString msg = i18n("" + TQString msg = i18n("" "Not available yet!\n" "Define your own encoding" ); KMessageBox::sorry( topLevelWidget(), msg, i18n("Encoding") ); @@ -1805,13 +1805,13 @@ void CHexEditorWidget::strings( void ) { mStringDialog = new CStringDialog( topLevelWidget(), 0, false ); if( mStringDialog == 0 ) { return; } - connect( mStringDialog, SIGNAL(markText( uint, uint, bool )), - mHexView, SLOT(setMark( uint, uint, bool )) ); - connect( mStringDialog, SIGNAL(collect()), SLOT(collectStrings()) ); - connect( mHexView, SIGNAL(fileName( const QString &, bool ) ), - mStringDialog, SLOT( removeList() ) ); - connect( mHexView, SIGNAL(dataChanged()), - mStringDialog, SLOT(setDirty()) ); + connect( mStringDialog, TQT_SIGNAL(markText( uint, uint, bool )), + mHexView, TQT_SLOT(setMark( uint, uint, bool )) ); + connect( mStringDialog, TQT_SIGNAL(collect()), TQT_SLOT(collectStrings()) ); + connect( mHexView, TQT_SIGNAL(fileName( const TQString &, bool ) ), + mStringDialog, TQT_SLOT( removeList() ) ); + connect( mHexView, TQT_SIGNAL(dataChanged()), + mStringDialog, TQT_SLOT(setDirty()) ); } mStringDialog->show(); } @@ -1828,7 +1828,7 @@ void CHexEditorWidget::collectStrings( void ) if( errCode != Err_Success && errCode != Err_Stop ) { - QString msg = i18n("Could not collect strings.\n"); + TQString msg = i18n("Could not collect strings.\n"); msg += hexError( errCode ); KMessageBox::sorry( topLevelWidget(), msg, i18n("Collect Strings") ); } @@ -1839,7 +1839,7 @@ void CHexEditorWidget::collectStrings( void ) void CHexEditorWidget::recordView( void ) { - QString msg = i18n("" + TQString msg = i18n("" "Not available yet!\n" "Define a record (structure) and fill it with data from the document." ); KMessageBox::sorry( topLevelWidget(), msg, i18n("Record Viewer") ); @@ -1851,8 +1851,8 @@ void CHexEditorWidget::filter( void ) { mFilterDialog = new CFilterDialog( topLevelWidget(), 0, false ); if( mFilterDialog == 0 ) { return; } - connect( mFilterDialog, SIGNAL(filterData( SFilterControl & )), - mHexView, SLOT(filter( SFilterControl & )) ); + connect( mFilterDialog, TQT_SIGNAL(filterData( SFilterControl & )), + mHexView, TQT_SLOT(filter( SFilterControl & )) ); } mFilterDialog->show(); } @@ -1864,8 +1864,8 @@ void CHexEditorWidget::chart( void ) { mCharTableDialog = new CCharTableDialog( topLevelWidget(), 0, false ); if( mCharTableDialog == 0 ) { return; } - connect( mCharTableDialog, SIGNAL(assign( const QByteArray & )), - mHexView, SLOT(insert( const QByteArray & )) ); + connect( mCharTableDialog, TQT_SIGNAL(assign( const TQByteArray & )), + mHexView, TQT_SLOT(insert( const TQByteArray & )) ); } mCharTableDialog->show(); } @@ -1876,8 +1876,8 @@ void CHexEditorWidget::converter( void ) if( mConverterDialog == 0 ) { mConverterDialog = new CConverterDialog( this, "converter", false ); - connect( mConverterDialog, SIGNAL(probeCursorValue(QByteArray &, uint)), - mHexView, SLOT(valueOnCursor(QByteArray &, uint)) ); + connect( mConverterDialog, TQT_SIGNAL(probeCursorValue(TQByteArray &, uint)), + mHexView, TQT_SLOT(valueOnCursor(TQByteArray &, uint)) ); } mConverterDialog->show(); } @@ -1889,10 +1889,10 @@ void CHexEditorWidget::statistics( void ) { mFileInfoDialog = new CFileInfoDialog( topLevelWidget(), 0, false ); if( mFileInfoDialog == 0 ) { return; } - connect( mFileInfoDialog, SIGNAL(collectStatistic(SStatisticControl &)), - SLOT(collectStatistics(SStatisticControl &))); - connect( mHexView, SIGNAL(dataChanged()), - mFileInfoDialog, SLOT(setDirty()) ); + connect( mFileInfoDialog, TQT_SIGNAL(collectStatistic(SStatisticControl &)), + TQT_SLOT(collectStatistics(SStatisticControl &))); + connect( mHexView, TQT_SIGNAL(dataChanged()), + mFileInfoDialog, TQT_SLOT(setDirty()) ); } mFileInfoDialog->show(); } @@ -1914,7 +1914,7 @@ void CHexEditorWidget::collectStatistics( SStatisticControl &sc ) { mFileInfoDialog->setStatistics(); // Default values - QString msg = i18n("Could not collect document statistics.\n"); + TQString msg = i18n("Could not collect document statistics.\n"); msg += hexError( errCode ); KMessageBox::sorry( topLevelWidget(), msg, i18n("Collect Document Statistics") ); @@ -1930,20 +1930,20 @@ void CHexEditorWidget::options( void ) mOptionDialog = new COptionDialog( topLevelWidget(), 0, false ); if( mOptionDialog == 0 ) { return; } - connect( mOptionDialog, SIGNAL(lineSizeChoice(const SDisplayLine &)), - SLOT(setLineSize(const SDisplayLine &)) ); - connect( mOptionDialog, SIGNAL(layoutChoice(const SDisplayLayout &)), - SLOT(setLayout(const SDisplayLayout &)) ); - connect( mOptionDialog, SIGNAL(fontChoice(const SDisplayFont &)), - SLOT(setFont(const SDisplayFont &)) ); - connect( mOptionDialog, SIGNAL(colorChoice(const SDisplayColor &)), - SLOT(setColor(const SDisplayColor &)) ); - connect( mOptionDialog, SIGNAL(cursorChoice(const SDisplayCursor &)), - SLOT(setCursor(const SDisplayCursor &)) ); - connect( mOptionDialog, SIGNAL(miscChoice(const SDisplayMisc &)), - SLOT(setMisc(const SDisplayMisc &)) ); - connect( mOptionDialog, SIGNAL(removeRecentFiles()), - SIGNAL(removeRecentFiles()) ); + connect( mOptionDialog, TQT_SIGNAL(lineSizeChoice(const SDisplayLine &)), + TQT_SLOT(setLineSize(const SDisplayLine &)) ); + connect( mOptionDialog, TQT_SIGNAL(layoutChoice(const SDisplayLayout &)), + TQT_SLOT(setLayout(const SDisplayLayout &)) ); + connect( mOptionDialog, TQT_SIGNAL(fontChoice(const SDisplayFont &)), + TQT_SLOT(setFont(const SDisplayFont &)) ); + connect( mOptionDialog, TQT_SIGNAL(colorChoice(const SDisplayColor &)), + TQT_SLOT(setColor(const SDisplayColor &)) ); + connect( mOptionDialog, TQT_SIGNAL(cursorChoice(const SDisplayCursor &)), + TQT_SLOT(setCursor(const SDisplayCursor &)) ); + connect( mOptionDialog, TQT_SIGNAL(miscChoice(const SDisplayMisc &)), + TQT_SLOT(setMisc(const SDisplayMisc &)) ); + connect( mOptionDialog, TQT_SIGNAL(removeRecentFiles()), + TQT_SIGNAL(removeRecentFiles()) ); } if( mOptionDialog->isVisible() == false ) { @@ -1956,7 +1956,7 @@ void CHexEditorWidget::options( void ) void CHexEditorWidget::favorites( void ) { - QString msg = i18n("" + TQString msg = i18n("" "Not available yet!\n" "Save or retrive your favorite layout" ); KMessageBox::sorry( topLevelWidget(), msg, i18n("Profiles") ); @@ -1978,7 +1978,7 @@ int CHexEditorWidget::readURL( const KURL &url, bool insert ) // if( !url.isValid() ) { - QString msg = i18n("Malformed URL\n%1").arg( url.url() ); + TQString msg = i18n("Malformed URL\n%1").arg( url.url() ); KMessageBox::sorry( topLevelWidget(), msg, i18n("Read URL") ); return( Err_IllegalArgument ); } @@ -1986,7 +1986,7 @@ int CHexEditorWidget::readURL( const KURL &url, bool insert ) // // 3) Load the file. // - QString tmpfile; + TQString tmpfile; if ( !KIO::NetAccess::download( url, tmpfile, this ) ) return Err_ReadFailed; @@ -1998,7 +1998,7 @@ int CHexEditorWidget::readURL( const KURL &url, bool insert ) } -void CHexEditorWidget::writeURL( QString &url ) +void CHexEditorWidget::writeURL( TQString &url ) { KURL kurl( url ); if( kurl.isLocalFile() ) @@ -2012,13 +2012,13 @@ void CHexEditorWidget::writeURL( QString &url ) if( !KIO::NetAccess::upload(tf.name(),url,this) ) { mHexView->setModified( modified ); - QString msg = i18n("Could not save remote file."); + TQString msg = i18n("Could not save remote file."); KMessageBox::sorry( topLevelWidget(), msg, i18n("Write Failure") ); } } } -bool CHexEditorWidget::modifiedByAlien( const QString &url ) +bool CHexEditorWidget::modifiedByAlien( const TQString &url ) { KURL kurl( url ); if( kurl.isLocalFile() == false ) @@ -2026,7 +2026,7 @@ bool CHexEditorWidget::modifiedByAlien( const QString &url ) return( false ); } - QFileInfo fileInfo( kurl.path() ); + TQFileInfo fileInfo( kurl.path() ); if( fileInfo.exists() == false ) { return( false ); @@ -2042,36 +2042,36 @@ bool CHexEditorWidget::modifiedByAlien( const QString &url ) -bool CHexEditorWidget::readFile( const QString &diskPath, const QString &url, +bool CHexEditorWidget::readFile( const TQString &diskPath, const TQString &url, bool insert ) { - QFileInfo info( diskPath ); + TQFileInfo info( diskPath ); if( info.exists() == false ) { - const QString msg = i18n("The specified file does not exist.\n%1").arg( diskPath ); + const TQString msg = i18n("The specified file does not exist.\n%1").arg( diskPath ); KMessageBox::sorry( topLevelWidget(), msg, i18n("Read") ); return( false ); } if( info.isDir() == true ) { - const QString msg = i18n("You have specified a folder.\n%1").arg( diskPath ); + const TQString msg = i18n("You have specified a folder.\n%1").arg( diskPath ); KMessageBox::sorry( topLevelWidget(), msg, i18n("Read") ); return( false ); } if( info.isReadable() == false ) { - const QString msg = i18n("You do not have read permission to this file.\n%1").arg( diskPath ); + const TQString msg = i18n("You do not have read permission to this file.\n%1").arg( diskPath ); KMessageBox::sorry( topLevelWidget(), msg, i18n("Read") ); return( false ); } - QFile file( diskPath ); + TQFile file( diskPath ); if( file.open( IO_ReadOnly | IO_Raw ) == false ) { - const QString msg = i18n("An error occurred while trying to open the file.\n%1").arg( diskPath ); + const TQString msg = i18n("An error occurred while trying to open the file.\n%1").arg( diskPath ); KMessageBox::sorry( topLevelWidget(), msg, i18n("Read") ); return( false ); } @@ -2099,8 +2099,8 @@ bool CHexEditorWidget::readFile( const QString &diskPath, const QString &url, if( errCode != Err_Success ) { - QString header = insert == true ? i18n("Insert") : i18n("Read"); - QString msg = i18n("Could not read file.\n"); + TQString header = insert == true ? i18n("Insert") : i18n("Read"); + TQString msg = i18n("Could not read file.\n"); msg += hexError( errCode ); KMessageBox::sorry( topLevelWidget(), msg, header ); } @@ -2112,30 +2112,30 @@ bool CHexEditorWidget::readFile( const QString &diskPath, const QString &url, -bool CHexEditorWidget::writeFile( const QString &diskPath ) +bool CHexEditorWidget::writeFile( const TQString &diskPath ) { - QFileInfo info( diskPath ); + TQFileInfo info( diskPath ); if( info.exists() == true ) { if( info.isDir() == true ) { - QString msg = i18n("You have specified a folder."); + TQString msg = i18n("You have specified a folder."); KMessageBox::sorry( topLevelWidget(), msg, i18n("Write Failure") ); return( false ); } if( info.isWritable() == false ) { - QString msg = i18n("You do not have write permission."); + TQString msg = i18n("You do not have write permission."); KMessageBox::sorry( topLevelWidget(), msg, i18n("Write Failure") ); return( false ); } } - QFile file( diskPath ); + TQFile file( diskPath ); if( file.open( IO_WriteOnly | IO_Raw | IO_Truncate ) == false ) { - QString msg = i18n("An error occurred while trying to open the file."); + TQString msg = i18n("An error occurred while trying to open the file."); KMessageBox::sorry( topLevelWidget(), msg, i18n("Write Failure") ); return( false ); } @@ -2147,7 +2147,7 @@ bool CHexEditorWidget::writeFile( const QString &diskPath ) } if( errCode != Err_Success ) { - QString msg = i18n("Could not write data to disk.\n"); + TQString msg = i18n("Could not write data to disk.\n"); msg += hexError( errCode ); KMessageBox::sorry( topLevelWidget(), msg, i18n("Write Failure") ); } @@ -2157,9 +2157,9 @@ bool CHexEditorWidget::writeFile( const QString &diskPath ) } -CHexBuffer *CHexEditorWidget::documentItem( const QString &url ) +CHexBuffer *CHexEditorWidget::documentItem( const TQString &url ) { - QString symbolicName( url ); + TQString symbolicName( url ); // KURL::decode( symbolicName ); for( CHexBuffer *hexBuffer = mDocumentList.first(); hexBuffer != 0; @@ -2175,14 +2175,14 @@ CHexBuffer *CHexEditorWidget::documentItem( const QString &url ) } -CHexBuffer *CHexEditorWidget::documentItem( const QString &url, bool next ) +CHexBuffer *CHexEditorWidget::documentItem( const TQString &url, bool next ) { if( mDocumentList.count() <= 1 ) { return( 0 ); } - QString symbolicName( url ); + TQString symbolicName( url ); // KURL::decode( symbolicName ); if( next == true ) @@ -2229,7 +2229,7 @@ bool CHexEditorWidget::createBuffer( void ) CHexBuffer *hexBuffer = new CHexBuffer; if( hexBuffer == 0 ) { - QString msg = i18n( "Can not create text buffer.\n" ); + TQString msg = i18n( "Can not create text buffer.\n" ); msg += hexError( Err_NoMemory ); KMessageBox::error( topLevelWidget(), msg, i18n("Loading Failed" ) ); return( false ); @@ -2304,7 +2304,7 @@ int CHexEditorWidget::prepareProgressData( EProgressMode mode ) mProgressStop = false; enableInputLock( true ); - static QString names[] = + static TQString names[] = { i18n("Reading"), i18n("Writing"), @@ -2317,7 +2317,7 @@ int CHexEditorWidget::prepareProgressData( EProgressMode mode ) }; mProgressData.define( progressReceiver, this ); - emit setProgressText( QString(names[mode]) ); + emit setProgressText( TQString(names[mode]) ); emit operationChanged( true ); return( Err_Success ); @@ -2368,7 +2368,7 @@ int CHexEditorWidget::progressParse( const SProgressData &pd ) return( Err_Success ); } - QString msg, header; + TQString msg, header; switch( mProgressMode ) { case pg_read: @@ -2429,7 +2429,7 @@ bool CHexEditorWidget::busy( bool showWarning ) { if( mProgressBusy == true && showWarning == true ) { - QString msg = i18n("Could not finish operation.\n"); + TQString msg = i18n("Could not finish operation.\n"); msg += hexError( Err_Busy ); KMessageBox::sorry( topLevelWidget(), msg ); } diff --git a/khexedit/hexeditorwidget.h b/khexedit/hexeditorwidget.h index 5c4d86a..04701f6 100644 --- a/khexedit/hexeditorwidget.h +++ b/khexedit/hexeditorwidget.h @@ -26,8 +26,8 @@ #endif -#include <qvariant.h> -#include <qptrdict.h> +#include <tqvariant.h> +#include <tqptrdict.h> #include <kapplication.h> #include "hexbuffer.h" @@ -70,14 +70,14 @@ class CHexEditorWidget : public QWidget }; public: - CHexEditorWidget( QWidget *parent = 0, const char *name = 0 ); + CHexEditorWidget( TQWidget *parent = 0, const char *name = 0 ); ~CHexEditorWidget( void ); void initialize( void ); void writeConfiguration( KConfig &config ); void readConfiguration( KConfig &config ); - bool isOpen( const QString &url, uint &offset ); + bool isOpen( const TQString &url, uint &offset ); bool modified( void ); inline int defaultTextWidth( void ); @@ -91,11 +91,11 @@ class CHexEditorWidget : public QWidget inline bool gotoReloadOffset( void ); signals: - void errorLoadFile( const QString &url ); + void errorLoadFile( const TQString &url ); void setProgress( int percent ); void setProgress( int curPage, int maxPage ); void enableProgressText( bool state ); - void setProgressText( const QString &msg ); + void setProgressText( const TQString &msg ); void operationChanged( bool state ); void removeRecentFiles( void ); @@ -105,9 +105,9 @@ class CHexEditorWidget : public QWidget void setOctalMode( void ); void setTextMode( void ); void setBinaryMode( void ); - void open( const QString &url, bool reloadWhenChanged, uint offset ); + void open( const TQString &url, bool reloadWhenChanged, uint offset ); void newFile( void ); - void newFile( const QByteArray &data ); + void newFile( const TQByteArray &data ); void stepFile( bool next ); void open( void ); void insertFile( void ); @@ -191,28 +191,28 @@ class CHexEditorWidget : public QWidget void collectStatistics( SStatisticControl &sc ); protected: - void resizeEvent( QResizeEvent *e ); + void resizeEvent( TQResizeEvent *e ); private: - bool selectDocument( const QString &url, bool reloadWhenChanged ); + bool selectDocument( const TQString &url, bool reloadWhenChanged ); bool querySave( void ); int readURL( const KURL &url, bool insert ); - void writeURL( QString &url ); - bool readFile( const QString &diskPath, const QString &url, bool insert ); - bool writeFile( const QString &diskPath ); - void saveWorkingDirectory( const QString &url ); + void writeURL( TQString &url ); + bool readFile( const TQString &diskPath, const TQString &url, bool insert ); + bool writeFile( const TQString &diskPath ); + void saveWorkingDirectory( const TQString &url ); bool confirmPrintPageNumber( CHexPrinter &printer ); - CHexBuffer *documentItem( const QString &url ); - CHexBuffer *documentItem( const QString &url, bool next ); + CHexBuffer *documentItem( const TQString &url ); + CHexBuffer *documentItem( const TQString &url, bool next ); bool createBuffer( void ); void removeBuffer( void ); - bool askWrap( bool fwd, const QString &header ); + bool askWrap( bool fwd, const TQString &header ); bool canFind( bool showError ); void hideReplacePrompt( void ); - bool modifiedByAlien( const QString &url ); + bool modifiedByAlien( const TQString &url ); void enableInputLock( bool inputLock ); int prepareProgressData( EProgressMode mode ); @@ -221,10 +221,10 @@ class CHexEditorWidget : public QWidget bool busy( bool showWarning ); private: - QString mWorkDir; // Remembers last directroy used by file dialogs + TQString mWorkDir; // Remembers last directroy used by file dialogs uint mUntitledCount; - QPtrList<CHexBuffer> mDocumentList; + TQPtrList<CHexBuffer> mDocumentList; SDisplayState mDisplayState; CProgress mProgressData; diff --git a/khexedit/hexeditstate.h b/khexedit/hexeditstate.h index f3f8fff..13a6c66 100644 --- a/khexedit/hexeditstate.h +++ b/khexedit/hexeditstate.h @@ -22,8 +22,8 @@ #define _HEX_EDIT_STATE_H_ #include <kapplication.h> -#include <qfont.h> -#include <qpalette.h> +#include <tqfont.h> +#include <tqpalette.h> #include <kglobalsettings.h> @@ -137,7 +137,7 @@ class SDisplayLayout } } - QString modeStrings( uint index ) + TQString modeStrings( uint index ) { if( index == hexadecimal ) { @@ -166,23 +166,23 @@ class SDisplayLayout } - QString primaryModeString( void ) + TQString primaryModeString( void ) { return( modeStrings( primaryMode > textOnly ? hexadecimal : primaryMode )); } - QString secondaryModeString( void ) + TQString secondaryModeString( void ) { return( modeStrings( secondaryMode == textOnly ? textOnly : hide ) ); } - QString offsetModeString( void ) + TQString offsetModeString( void ) { return( modeStrings( offsetMode == hexadecimal ? hexadecimal : hide ) ); } - QString gridModeString( void ) + TQString gridModeString( void ) { if( horzGridWidth == 0 && vertGridWidth == 0 ) { @@ -202,7 +202,7 @@ class SDisplayLayout } } - void setPrimaryMode( const QString & str ) + void setPrimaryMode( const TQString & str ) { if( str.isNull() || str == "hexadecimal" ) { @@ -230,7 +230,7 @@ class SDisplayLayout } } - void setSecondaryMode( const QString & str ) + void setSecondaryMode( const TQString & str ) { if( str.isNull() || str == "textOnly" ) { @@ -242,7 +242,7 @@ class SDisplayLayout } } - void setOffsetMode( const QString & str ) + void setOffsetMode( const TQString & str ) { if( str.isNull() || str == "hexadecimal" ) { @@ -254,7 +254,7 @@ class SDisplayLayout } } - void setGridMode( const QString & str ) + void setGridMode( const TQString & str ) { if( str.isNull() || str == "none" ) { @@ -322,7 +322,7 @@ class SDisplayCursor thickInsertShape = true; } - QString modeStrings( uint index ) + TQString modeStrings( uint index ) { if( index == hide ) { @@ -338,12 +338,12 @@ class SDisplayCursor } } - QString focusModeString( void ) + TQString focusModeString( void ) { return( modeStrings( focusMode > ignore ? stopBlinking : focusMode )); } - void setFocusMode( const QString & str ) + void setFocusMode( const TQString & str ) { if( str.isNull() || str == "hide" ) { @@ -401,25 +401,25 @@ class SDisplayColor } bool useSystemColor; - QColor offsetBg; - QColor textBg; - QColor secondTextBg; - QColor inactiveBg; - QColor selectBg; - QColor selectFg; - QColor markBg; - QColor markFg; - QColor primaryFg[2]; - QColor offsetFg; - QColor secondaryFg; - QColor nonPrintFg; - QColor gridFg; - QColor leftSeparatorFg; - QColor rightSeparatorFg; - QColor cursorBg; - QColor cursorFg; - QColor bookmarkBg; - QColor bookmarkFg; + TQColor offsetBg; + TQColor textBg; + TQColor secondTextBg; + TQColor inactiveBg; + TQColor selectBg; + TQColor selectFg; + TQColor markBg; + TQColor markFg; + TQColor primaryFg[2]; + TQColor offsetFg; + TQColor secondaryFg; + TQColor nonPrintFg; + TQColor gridFg; + TQColor leftSeparatorFg; + TQColor rightSeparatorFg; + TQColor cursorBg; + TQColor cursorFg; + TQColor bookmarkBg; + TQColor bookmarkFg; }; @@ -434,8 +434,8 @@ class SDisplayFontInfo return( *this ); } - QFont font; - QChar nonPrintChar; + TQFont font; + TQChar nonPrintChar; }; class SDisplayFont @@ -449,8 +449,8 @@ class SDisplayFont } bool useSystemFont; - QFont localFont; - QChar nonPrintChar; + TQFont localFont; + TQChar nonPrintChar; }; @@ -487,7 +487,7 @@ class SDisplayMisc } - QString fileStrings( uint index ) + TQString fileStrings( uint index ) { if( index == mostRecent ) { @@ -504,12 +504,12 @@ class SDisplayMisc } - QString openFileString( void ) + TQString openFileString( void ) { return( fileStrings( openFile > allRecent ? none : openFile )); } - void setOpenFile( const QString &str ) + void setOpenFile( const TQString &str ) { if( str.isNull() == true || str == "none" ) { diff --git a/khexedit/hexerror.cc b/khexedit/hexerror.cc index ac179e6..ed05b4b 100644 --- a/khexedit/hexerror.cc +++ b/khexedit/hexerror.cc @@ -22,12 +22,12 @@ #include "hexerror.h" -static QString message; +static TQString message; -const QString &hexError( int index ) +const TQString &hexError( int index ) { - static QString messages[ Err_MAXERROR - Err_NoData ] = + static TQString messages[ Err_MAXERROR - Err_NoData ] = { i18n("No data"), // Err_NoData i18n("Insufficient memory"), // Err_NoMemory diff --git a/khexedit/hexerror.h b/khexedit/hexerror.h index d17d302..4d9d209 100644 --- a/khexedit/hexerror.h +++ b/khexedit/hexerror.h @@ -51,7 +51,7 @@ enum EHexError Err_MAXERROR // Must be the last }; -const QString &hexError( int index ); +const TQString &hexError( int index ); #endif diff --git a/khexedit/hexmanagerwidget.cc b/khexedit/hexmanagerwidget.cc index 1073b95..b5fe32c 100644 --- a/khexedit/hexmanagerwidget.cc +++ b/khexedit/hexmanagerwidget.cc @@ -19,15 +19,15 @@ */ #include <klocale.h> -#include <qlayout.h> +#include <tqlayout.h> #include "hexmanagerwidget.h" #include "searchbar.h" -CHexManagerWidget::CHexManagerWidget( QWidget *parent, const char *name, +CHexManagerWidget::CHexManagerWidget( TQWidget *parent, const char *name, EConversionPosition conversionPosition, EPosition tabBarPosition, EPosition searchBarPosition ) - : QWidget( parent, name ) + : TQWidget( parent, name ) { mValid = false; @@ -38,18 +38,18 @@ CHexManagerWidget::CHexManagerWidget( QWidget *parent, const char *name, mConverter = new CHexToolWidget( this ); - connect( mEditor->view(), SIGNAL(fileName(const QString &, bool)), - this, SLOT( addName(const QString &))); - connect( mEditor->view(), SIGNAL( fileClosed(const QString &)), - this, SLOT( removeName(const QString &))); - connect( mEditor->view(),SIGNAL(fileRename(const QString &,const QString &)), - this, SLOT(changeName(const QString &,const QString &))); - connect( mEditor->view(), SIGNAL( cursorChanged( SCursorState & ) ), - mConverter, SLOT( cursorChanged( SCursorState & ) ) ); - connect( mConverter, SIGNAL( closed(void) ), - this, SIGNAL( conversionClosed(void) ) ); - connect( mTabBar, SIGNAL(selected(const QString &)), - this, SLOT(open(const QString &))); + connect( mEditor->view(), TQT_SIGNAL(fileName(const TQString &, bool)), + this, TQT_SLOT( addName(const TQString &))); + connect( mEditor->view(), TQT_SIGNAL( fileClosed(const TQString &)), + this, TQT_SLOT( removeName(const TQString &))); + connect( mEditor->view(),TQT_SIGNAL(fileRename(const TQString &,const TQString &)), + this, TQT_SLOT(changeName(const TQString &,const TQString &))); + connect( mEditor->view(), TQT_SIGNAL( cursorChanged( SCursorState & ) ), + mConverter, TQT_SLOT( cursorChanged( SCursorState & ) ) ); + connect( mConverter, TQT_SIGNAL( closed(void) ), + this, TQT_SIGNAL( conversionClosed(void) ) ); + connect( mTabBar, TQT_SIGNAL(selected(const TQString &)), + this, TQT_SLOT(open(const TQString &))); mValid = true; setConversionVisibility( conversionPosition ); @@ -71,7 +71,7 @@ void CHexManagerWidget::updateLayout( void ) if( mValid == false ) { return; } delete layout(); - QVBoxLayout *vlay = new QVBoxLayout( this, 0, 0 ); + TQVBoxLayout *vlay = new TQVBoxLayout( this, 0, 0 ); if( mSearchBar && mSearchBarPosition == AboveEditor ) { @@ -125,9 +125,9 @@ void CHexManagerWidget::setConversionVisibility( EConversionPosition position ) } else if( mConversionPosition == Float ) { - QPoint point = mapToGlobal( QPoint(0,0) ); - QRect rect = geometry(); - QPoint p; + TQPoint point = mapToGlobal( TQPoint(0,0) ); + TQRect rect = geometry(); + TQPoint p; p.setX(point.x() + rect.width()/2 - mConverter->minimumSize().width()/2); p.setY(point.y() + rect.height()/2 - mConverter->minimumSize().height()/2); @@ -139,7 +139,7 @@ void CHexManagerWidget::setConversionVisibility( EConversionPosition position ) { mConversionPosition = Embed; uint utilHeight = mConverter->minimumSize().height(); - QPoint p( 0, height() - utilHeight ); + TQPoint p( 0, height() - utilHeight ); mConverter->reparent( this, 0, p, true ); } @@ -154,11 +154,11 @@ void CHexManagerWidget::setTabBarPosition( EPosition position ) { if( mTabPosition == AboveEditor ) { - mTabBar->setShape( QTabBar::RoundedAbove ); + mTabBar->setShape( TQTabBar::RoundedAbove ); } else { - mTabBar->setShape( QTabBar::RoundedBelow ); + mTabBar->setShape( TQTabBar::RoundedBelow ); } mTabBar->show(); } @@ -179,11 +179,11 @@ void CHexManagerWidget::setSearchBarPosition( EPosition position ) if( mSearchBar == 0 ) { mSearchBar = new CSearchBar( this ); - connect( mSearchBar, SIGNAL(hidden()), this, SLOT(searchBarHidden()) ); - connect( mSearchBar, SIGNAL(findData(SSearchControl &, uint, bool)), - mEditor, SLOT(findData(SSearchControl &, uint, bool)) ); - connect( editor()->view(), SIGNAL( cursorChanged( SCursorState & ) ), - mSearchBar, SLOT( cursorMoved() ) ); + connect( mSearchBar, TQT_SIGNAL(hidden()), this, TQT_SLOT(searchBarHidden()) ); + connect( mSearchBar, TQT_SIGNAL(findData(SSearchControl &, uint, bool)), + mEditor, TQT_SLOT(findData(SSearchControl &, uint, bool)) ); + connect( editor()->view(), TQT_SIGNAL( cursorChanged( SCursorState & ) ), + mSearchBar, TQT_SLOT( cursorMoved() ) ); } mSearchBar->show(); } @@ -207,7 +207,7 @@ void CHexManagerWidget::searchBarHidden( void ) } -void CHexManagerWidget::addName( const QString &name ) +void CHexManagerWidget::addName( const TQString &name ) { if( name.isEmpty() == true ) { @@ -222,7 +222,7 @@ void CHexManagerWidget::addName( const QString &name ) } -void CHexManagerWidget::removeName( const QString &name ) +void CHexManagerWidget::removeName( const TQString &name ) { mTabBar->removeName( name ); if( mTabBar->isVisible() == true && mTabBar->count() == 0 ) @@ -232,14 +232,14 @@ void CHexManagerWidget::removeName( const QString &name ) } -void CHexManagerWidget::changeName( const QString &curName, - const QString &newName ) +void CHexManagerWidget::changeName( const TQString &curName, + const TQString &newName ) { mTabBar->changeName( curName, newName ); } -void CHexManagerWidget::open( const QString &name ) +void CHexManagerWidget::open( const TQString &name ) { mEditor->open( name, false, 0 ); } @@ -258,21 +258,21 @@ int CHexManagerWidget::preferredWidth( void ) -CTabBar::CTabBar( QWidget *parent, char *name ) - :QTabBar( parent, name ) +CTabBar::CTabBar( TQWidget *parent, char *name ) + :TQTabBar( parent, name ) { - connect( this, SIGNAL(selected(int)), this, SLOT(slotSelected(int)) ); + connect( this, TQT_SIGNAL(selected(int)), this, TQT_SLOT(slotSelected(int)) ); } -void CTabBar::addName( const QString &name ) +void CTabBar::addName( const TQString &name ) { - QString n( name.right(name.length()-name.findRev('/')-1) ); + TQString n( name.right(name.length()-name.findRev('/')-1) ); - QTab *t = find( n ); + TQTab *t = find( n ); if( t == 0 ) { - t = new QTab(); + t = new TQTab(); t->setText( n); int id = addTab( t ); mFileList.append( CFileKey(name,id) ); @@ -281,16 +281,16 @@ void CTabBar::addName( const QString &name ) } -void CTabBar::removeName( const QString &name ) +void CTabBar::removeName( const TQString &name ) { - QString n( name.right(name.length()-name.findRev('/')-1) ); - QTab *t = find(n); + TQString n( name.right(name.length()-name.findRev('/')-1) ); + TQTab *t = find(n); if( t == 0 ) { return; } - QValueList<CFileKey>::Iterator it; + TQValueList<CFileKey>::Iterator it; for( it = mFileList.begin(); it != mFileList.end(); ++it ) { if( (*it).id() == t->identifier() ) @@ -304,21 +304,21 @@ void CTabBar::removeName( const QString &name ) } -void CTabBar::changeName( const QString &curName, const QString &newName ) +void CTabBar::changeName( const TQString &curName, const TQString &newName ) { - QString n( curName.right(curName.length()-curName.findRev('/')-1) ); - QTab *t = find(n); + TQString n( curName.right(curName.length()-curName.findRev('/')-1) ); + TQTab *t = find(n); if( t == 0 ) { return; } - QValueList<CFileKey>::Iterator it; + TQValueList<CFileKey>::Iterator it; for( it = mFileList.begin(); it != mFileList.end(); ++it ) { if( (*it).id() == t->identifier() ) { - QString m( newName.right(newName.length()-newName.findRev('/')-1) ); + TQString m( newName.right(newName.length()-newName.findRev('/')-1) ); t->setText(m); mFileList.remove(it); @@ -331,10 +331,10 @@ void CTabBar::changeName( const QString &curName, const QString &newName ) } -QTab *CTabBar::find( const QString &name ) +TQTab *CTabBar::find( const TQString &name ) { - QPtrList<QTab> &list = *tabList(); - for( QTab *t = list.first(); t != 0; t = list.next() ) + TQPtrList<TQTab> &list = *tabList(); + for( TQTab *t = list.first(); t != 0; t = list.next() ) { if( t->text() == name ) { @@ -354,7 +354,7 @@ int CTabBar::count( void ) void CTabBar::slotSelected( int id ) { - QValueList<CFileKey>::Iterator it; + TQValueList<CFileKey>::Iterator it; for( it = mFileList.begin(); it != mFileList.end(); ++it ) { if( (*it).id() == id ) diff --git a/khexedit/hexmanagerwidget.h b/khexedit/hexmanagerwidget.h index 08924da..2d90233 100644 --- a/khexedit/hexmanagerwidget.h +++ b/khexedit/hexmanagerwidget.h @@ -25,9 +25,9 @@ #include <config.h> #endif -#include <qtabbar.h> -#include <qvaluelist.h> -#include <qwidget.h> +#include <tqtabbar.h> +#include <tqvaluelist.h> +#include <tqwidget.h> #include "hexeditorwidget.h" #include "hextoolwidget.h" @@ -38,7 +38,7 @@ class CSearchBar; class CFileKey { public: - CFileKey( const QString &fname, int fid ) + CFileKey( const TQString &fname, int fid ) { mFilename = fname; mId = fid; @@ -54,7 +54,7 @@ class CFileKey { } - QString filename( void ) const + TQString filename( void ) const { return( mFilename ); } @@ -65,7 +65,7 @@ class CFileKey } private: - QString mFilename; + TQString mFilename; int mId; }; @@ -77,23 +77,23 @@ class CTabBar : public QTabBar Q_OBJECT public: - CTabBar( QWidget *parent=0, char *name=0 ); - void addName( const QString &name ); - void removeName( const QString &name ); - void changeName( const QString &curName, const QString &newName ); + CTabBar( TQWidget *parent=0, char *name=0 ); + void addName( const TQString &name ); + void removeName( const TQString &name ); + void changeName( const TQString &curName, const TQString &newName ); int count( void ); protected slots: void slotSelected( int id ); private: - QTab *find( const QString &name ); + TQTab *find( const TQString &name ); private: - QValueList<CFileKey> mFileList; + TQValueList<CFileKey> mFileList; signals: - void selected( const QString &filename ); + void selected( const TQString &filename ); }; @@ -117,7 +117,7 @@ class CHexManagerWidget : public QWidget }; public: - CHexManagerWidget( QWidget *parent = 0, const char *name = 0, + CHexManagerWidget( TQWidget *parent = 0, const char *name = 0, EConversionPosition state = Embed, EPosition tabBarPosition = HideItem, EPosition searchBarPosition = HideItem ); @@ -136,12 +136,12 @@ class CHexManagerWidget : public QWidget void setConversionVisibility( EConversionPosition position ); void setTabBarPosition( EPosition position ); void setSearchBarPosition( EPosition position ); - void addName( const QString &name ); - void removeName( const QString &name ); - void changeName( const QString &curName, const QString &newName ); + void addName( const TQString &name ); + void removeName( const TQString &name ); + void changeName( const TQString &curName, const TQString &newName ); protected slots: - void open( const QString &name ); + void open( const TQString &name ); void searchBarHidden( void ); private: diff --git a/khexedit/hexprinter.cc b/khexedit/hexprinter.cc index 0127751..2d55a6a 100644 --- a/khexedit/hexprinter.cc +++ b/khexedit/hexprinter.cc @@ -107,7 +107,7 @@ void CHexPrinter::setPageFooter( bool enable, uint left, uint center, SPageMargin CHexPrinter::pageMargin( void ) { - QPaintDeviceMetrics metric( this ); + TQPaintDeviceMetrics metric( this ); float f = (float)metric.width()/(float)metric.widthMM(); SPageMargin margin; @@ -128,7 +128,7 @@ SPageMargin CHexPrinter::pageMarginMM( void ) SPageSize CHexPrinter::pageFullSize( void ) { - QPaintDeviceMetrics metric( this ); + TQPaintDeviceMetrics metric( this ); SPageSize size; size.width = metric.width(); size.height = metric.height(); @@ -139,7 +139,7 @@ SPageSize CHexPrinter::pageFullSize( void ) SPageSize CHexPrinter::pageUsableSize( void ) { - QPaintDeviceMetrics metric( this ); + TQPaintDeviceMetrics metric( this ); SPageMargin margin = pageMargin(); SPageSize size; diff --git a/khexedit/hexprinter.h b/khexedit/hexprinter.h index 2d6eeba..f27d4b8 100644 --- a/khexedit/hexprinter.h +++ b/khexedit/hexprinter.h @@ -22,7 +22,7 @@ #define _HEX_PRINTER_H_ #include <kprinter.h> -#include <qpaintdevicemetrics.h> +#include <tqpaintdevicemetrics.h> struct SPageSize { diff --git a/khexedit/hextoolwidget.cc b/khexedit/hextoolwidget.cc index f0baf09..b5e918e 100644 --- a/khexedit/hextoolwidget.cc +++ b/khexedit/hextoolwidget.cc @@ -22,81 +22,81 @@ #include <klocale.h> #include "hextoolwidget.h" -#include <qlabel.h> -#include <qlayout.h> -#include <qlineedit.h> -#include <qcheckbox.h> -#include <qcombobox.h> +#include <tqlabel.h> +#include <tqlayout.h> +#include <tqlineedit.h> +#include <tqcheckbox.h> +#include <tqcombobox.h> -CHexToolWidget::CHexToolWidget( QWidget *parent, const char *name ) - : QFrame( parent, name ) +CHexToolWidget::CHexToolWidget( TQWidget *parent, const char *name ) + : TQFrame( parent, name ) { - setFrameStyle( QFrame::Panel | QFrame::Raised ); + setFrameStyle( TQFrame::Panel | TQFrame::Raised ); setLineWidth( 1 ); - QString text; - mUtilBox = new QGridLayout( this, 5, 4, KDialog::marginHint(), KDialog::spacingHint() ); + TQString text; + mUtilBox = new TQGridLayout( this, 5, 4, KDialog::marginHint(), KDialog::spacingHint() ); mUtilBox->setColStretch( 3, 10 ); - QString msg1[4] = + TQString msg1[4] = { i18n("Signed 8 bit:"), i18n("Unsigned 8 bit:"), i18n("Signed 16 bit:"), i18n("Unsigned 16 bit:") }; - QString msg2[4] = + TQString msg2[4] = { i18n("Signed 32 bit:"), i18n("Unsigned 32 bit:"), i18n("32 bit float:"), i18n("64 bit float:") }; - QString msg3[4] = + TQString msg3[4] = { i18n("Hexadecimal:"), i18n("Octal:"), i18n("Binary:"), i18n("Text:") }; - QGridLayout *ValuesBox = new QGridLayout( this, 4, 6, 0, KDialog::spacingHint() ); + TQGridLayout *ValuesBox = new TQGridLayout( this, 4, 6, 0, KDialog::spacingHint() ); ValuesBox->setColStretch( 2, 10 ); ValuesBox->setColStretch( 5, 10 ); for( int i=0; i<4; i++ ) { - QLabel *Label = new QLabel( msg1[i], this ); + TQLabel *Label = new TQLabel( msg1[i], this ); Label->setAlignment( AlignRight|AlignVCenter ); ValuesBox->addWidget( Label, i, 0 ); - mText1[i] = new QLineEdit( this ); + mText1[i] = new TQLineEdit( this ); mText1[i]->setReadOnly( true ); mText1[i]->setAlignment( AlignRight ); ValuesBox->addWidget( mText1[i], i, 1 ); - Label = new QLabel( msg2[i], this ); + Label = new TQLabel( msg2[i], this ); Label->setAlignment( AlignRight|AlignVCenter ); ValuesBox->addWidget( Label, i, 3 ); - mText2[i] = new QLineEdit( this ); + mText2[i] = new TQLineEdit( this ); mText2[i]->setReadOnly( true ); mText2[i]->setAlignment( AlignRight ); ValuesBox->addWidget( mText2[i], i, 4 ); - Label = new QLabel( msg3[i], this ); + Label = new TQLabel( msg3[i], this ); Label->setAlignment( AlignRight|AlignVCenter ); mUtilBox->addWidget( Label, i, 1 ); - mText3[i] = new QLineEdit( this ); + mText3[i] = new TQLineEdit( this ); mText3[i]->setReadOnly( true ); mText3[i]->setAlignment( AlignRight ); mUtilBox->addWidget( mText3[i], i, 2 ); } - QBoxLayout * SettingsBox = new QHBoxLayout( this, 0, KDialog::spacingHint() ); + TQBoxLayout * SettingsBox = new TQHBoxLayout( this, 0, KDialog::spacingHint() ); text = i18n("Show little endian decoding"); - mCheckIntelFormat = new QCheckBox( text, this ); + mCheckIntelFormat = new TQCheckBox( text, this ); mCheckIntelFormat->setMinimumSize( mCheckIntelFormat->sizeHint() ); - connect( mCheckIntelFormat, SIGNAL(clicked()), this, SLOT(intelFormat()) ); + connect( mCheckIntelFormat, TQT_SIGNAL(clicked()), this, TQT_SLOT(intelFormat()) ); SettingsBox->addWidget( mCheckIntelFormat, 0, AlignVCenter ); mCheckIntelFormat->setChecked( // default value to please endian system users #ifdef WORDS_BIGENDIAN @@ -108,9 +108,9 @@ CHexToolWidget::CHexToolWidget( QWidget *parent, const char *name ) // TODO: make this a pulldown box, adding PDP endianess text = i18n("Show unsigned as hexadecimal"); - mCheckHexadecimal = new QCheckBox( text, this ); + mCheckHexadecimal = new TQCheckBox( text, this ); mCheckHexadecimal->setMinimumSize( mCheckHexadecimal->sizeHint() ); - connect( mCheckHexadecimal, SIGNAL(clicked()), this, SLOT(unsignedFormat()) ); + connect( mCheckHexadecimal, TQT_SIGNAL(clicked()), this, TQT_SLOT(unsignedFormat()) ); SettingsBox->addWidget( mCheckHexadecimal, 0, AlignVCenter ); mUtilBox->addMultiCellLayout( ValuesBox, 0, 3, 0, 0, AlignLeft|AlignVCenter ); @@ -119,11 +119,11 @@ CHexToolWidget::CHexToolWidget( QWidget *parent, const char *name ) // // Variable bitwidth. Based on Craig Graham's work. // - QLabel *bitLabel = new QLabel( i18n("Stream length:"), this ); + TQLabel *bitLabel = new TQLabel( i18n("Stream length:"), this ); bitLabel->setAlignment( AlignRight|AlignVCenter ); mUtilBox->addWidget( bitLabel, 4, 1 ); - mBitCombo = new QComboBox( false, this ); + mBitCombo = new TQComboBox( false, this ); text = i18n("Fixed 8 Bit" ); mBitCombo->insertItem( text ); for( int i=0; i<16; i++ ) @@ -133,7 +133,7 @@ CHexToolWidget::CHexToolWidget( QWidget *parent, const char *name ) mBitCombo->insertItem( text ); } mBitCombo->setMinimumSize( mBitCombo->sizeHint() ); - connect( mBitCombo, SIGNAL(activated(int)), SLOT(bitWidthChanged(int))); + connect( mBitCombo, TQT_SIGNAL(activated(int)), TQT_SLOT(bitWidthChanged(int))); mUtilBox->addWidget( mBitCombo, 4, 2 ); /* load font metrics */ @@ -141,8 +141,8 @@ CHexToolWidget::CHexToolWidget( QWidget *parent, const char *name ) mUtilBox->activate(); - connect( kapp, SIGNAL( kdisplayFontChanged() ), - SLOT( fontChanged() ) ); + connect( kapp, TQT_SIGNAL( kdisplayFontChanged() ), + TQT_SLOT( fontChanged() ) ); mCursorState.valid = false; mViewHexCaps = true; @@ -253,7 +253,7 @@ void CHexToolWidget::cursorChanged( SCursorState &state ) { if( state.valid == true ) { - QString buf; + TQString buf; // change by Kossebau[03.11.2003]: // checking for system endianess, using the compiler for the byte interpretation and cutting bloaded code // TODO: add PDP endianess @@ -332,7 +332,7 @@ void CHexToolWidget::cursorChanged( SCursorState &state ) bitBuf[7-i] = (data&(1<<i)) ? '1' : '0'; bitBuf[8] = 0; - mText3[2]->setText( QString(bitBuf) ); + mText3[2]->setText( TQString(bitBuf) ); } else { @@ -348,20 +348,20 @@ void CHexToolWidget::cursorChanged( SCursorState &state ) for( int i = 0; i<numBits; i++ ) bitBuf[numBits-i-1] = (data&(1L<<i)) ? '1' : '0'; bitBuf[numBits] = 0; - mText3[2]->setText( QString(bitBuf) ); + mText3[2]->setText( TQString(bitBuf) ); } // Fix by Sergey A. Sukiyazov unsigned char data[2] = { 0, 0 }; data[0] = state.charValid == false ? '.' : (char)((unsigned char)state.data[0]&0xff ); - buf = QString::fromLocal8Bit( (const char *)data ); + buf = TQString::fromLocal8Bit( (const char *)data ); mText3[3]->setText( buf ); } else { - QString str; + TQString str; for( int i=0; i<4; i++) { mText1[i]->setText( str ); @@ -376,7 +376,7 @@ void CHexToolWidget::cursorChanged( SCursorState &state ) void CHexToolWidget::fontChanged( void ) { - QFontMetrics fm( mText1[0]->font() ); + TQFontMetrics fm( mText1[0]->font() ); int W1 = fm.width( "XXXXXXXX" ); int W2 = fm.width( "XXXXXXXXXXXX" ); int W3 = fm.width( "888888888888888888" ); @@ -401,13 +401,13 @@ void CHexToolWidget::unsignedFormat( void ) } -void CHexToolWidget::resizeEvent( QResizeEvent */*e*/ ) +void CHexToolWidget::resizeEvent( TQResizeEvent */*e*/ ) { } -void CHexToolWidget::closeEvent( QCloseEvent *e ) +void CHexToolWidget::closeEvent( TQCloseEvent *e ) { e->accept(); emit closed(); diff --git a/khexedit/hextoolwidget.h b/khexedit/hextoolwidget.h index d2ce892..eaf4e3c 100644 --- a/khexedit/hextoolwidget.h +++ b/khexedit/hextoolwidget.h @@ -29,14 +29,14 @@ class QLineEdit; class QCheckBox; #include "hexbuffer.h" -#include <qframe.h> +#include <tqframe.h> class CHexToolWidget : public QFrame { Q_OBJECT public: - CHexToolWidget( QWidget *parent = 0, const char *name = 0 ); + CHexToolWidget( TQWidget *parent = 0, const char *name = 0 ); ~CHexToolWidget( void ); void writeConfiguration( KConfig &config ); @@ -44,8 +44,8 @@ class CHexToolWidget : public QFrame unsigned long bitValue( SCursorState &state, int n ); protected: - void resizeEvent( QResizeEvent *e ); - void closeEvent( QCloseEvent *e ); + void resizeEvent( TQResizeEvent *e ); + void closeEvent( TQCloseEvent *e ); public slots: void cursorChanged( SCursorState &state ); @@ -64,13 +64,13 @@ class CHexToolWidget : public QFrame SCursorState mCursorState; bool mViewHexCaps; - QGridLayout *mUtilBox; - QLineEdit *mText1[4]; - QLineEdit *mText2[4]; - QLineEdit *mText3[4]; - QCheckBox *mCheckIntelFormat; - QCheckBox *mCheckHexadecimal; - QComboBox *mBitCombo; + TQGridLayout *mUtilBox; + TQLineEdit *mText1[4]; + TQLineEdit *mText2[4]; + TQLineEdit *mText3[4]; + TQCheckBox *mCheckIntelFormat; + TQCheckBox *mCheckHexadecimal; + TQComboBox *mBitCombo; }; diff --git a/khexedit/hexvalidator.cc b/khexedit/hexvalidator.cc index e8c1731..96cd982 100644 --- a/khexedit/hexvalidator.cc +++ b/khexedit/hexvalidator.cc @@ -20,12 +20,12 @@ #include <ctype.h> #include <stdio.h> -#include <qwidget.h> +#include <tqwidget.h> #include "hexvalidator.h" -CHexValidator::CHexValidator( QWidget *parent, EState state, +CHexValidator::CHexValidator( TQWidget *parent, EState state, const char *name ) - :QValidator( parent, name ) + :TQValidator( parent, name ) { setState( state ); } @@ -34,7 +34,7 @@ CHexValidator::~CHexValidator( void ) { } -QValidator::State CHexValidator::validate( QString &string, int &/*pos*/ ) const +TQValidator::State CHexValidator::validate( TQString &string, int &/*pos*/ ) const { if( mState == hexadecimal ) { @@ -43,10 +43,10 @@ QValidator::State CHexValidator::validate( QString &string, int &/*pos*/ ) const int val = string[i].latin1(); if( isxdigit( val ) == 0 && isspace( val ) == 0 ) { - return( QValidator::Invalid ); + return( TQValidator::Invalid ); } } - return( QValidator::Valid ); + return( TQValidator::Valid ); } if( mState == decimal ) { @@ -55,10 +55,10 @@ QValidator::State CHexValidator::validate( QString &string, int &/*pos*/ ) const int val = string[i].latin1(); if( isdigit( val ) == 0 && isspace( val ) == 0 ) { - return( QValidator::Invalid ); + return( TQValidator::Invalid ); } } - return( QValidator::Valid ); + return( TQValidator::Valid ); } else if( mState == octal ) { @@ -68,10 +68,10 @@ QValidator::State CHexValidator::validate( QString &string, int &/*pos*/ ) const if( (isdigit( val ) == 0 || val == '8' || val == '9') && isspace( val ) == 0 ) { - return( QValidator::Invalid ); + return( TQValidator::Invalid ); } } - return( QValidator::Valid ); + return( TQValidator::Valid ); } else if( mState == binary ) { @@ -80,18 +80,18 @@ QValidator::State CHexValidator::validate( QString &string, int &/*pos*/ ) const int val = string[i].latin1(); if( val != '0' && val != '1' && isspace( val ) == 0 ) { - return( QValidator::Invalid ); + return( TQValidator::Invalid ); } } - return( QValidator::Valid ); + return( TQValidator::Valid ); } else if( mState == regularText ) { - return( QValidator::Valid ); + return( TQValidator::Valid ); } else { - return( QValidator::Invalid ); + return( TQValidator::Invalid ); } } @@ -103,7 +103,7 @@ void CHexValidator::setState( EState state ) } -void CHexValidator::convert( QByteArray &dest, const QString &src ) +void CHexValidator::convert( TQByteArray &dest, const TQString &src ) { uint value; uint k=0; @@ -286,29 +286,29 @@ void CHexValidator::convert( QByteArray &dest, const QString &src ) -void CHexValidator::format( QString &dest, const QByteArray &src ) +void CHexValidator::format( TQString &dest, const TQByteArray &src ) { for( uint i=0; i<src.size(); ++i ) { unsigned char srcCh = (unsigned char)src[i]; - QString formattedCh; + TQString formattedCh; switch( mState ) { case hexadecimal: - formattedCh = zeroExtend( QString::number( srcCh, 16 ), 2 ); + formattedCh = zeroExtend( TQString::number( srcCh, 16 ), 2 ); break; case decimal: - formattedCh = zeroExtend( QString::number( srcCh, 10), 3 ); + formattedCh = zeroExtend( TQString::number( srcCh, 10), 3 ); break; case octal: - formattedCh = zeroExtend( QString::number( srcCh, 8), 3 ); + formattedCh = zeroExtend( TQString::number( srcCh, 8), 3 ); break; case binary: - formattedCh = zeroExtend( QString::number( srcCh, 2), 8 ); + formattedCh = zeroExtend( TQString::number( srcCh, 2), 8 ); break; case regularText: - formattedCh = QString( QChar( srcCh ) ); + formattedCh = TQString( TQChar( srcCh ) ); break; } @@ -317,12 +317,12 @@ void CHexValidator::format( QString &dest, const QByteArray &src ) } -QString CHexValidator::zeroExtend( const QString &src, unsigned destLen) const +TQString CHexValidator::zeroExtend( const TQString &src, unsigned destLen) const { if( src.length() >= destLen ) return src; - QString zeroes; + TQString zeroes; zeroes.fill( '0', destLen - src.length() ); return zeroes + src; } diff --git a/khexedit/hexvalidator.h b/khexedit/hexvalidator.h index cfe9f95..69b6fc1 100644 --- a/khexedit/hexvalidator.h +++ b/khexedit/hexvalidator.h @@ -21,7 +21,7 @@ #ifndef _HEX_VALIDATOR_H_ #define _HEX_VALIDATOR_H_ -#include <qvalidator.h> +#include <tqvalidator.h> class CHexValidator: public QValidator { @@ -38,12 +38,12 @@ class CHexValidator: public QValidator }; public: - CHexValidator( QWidget *parent, EState state, const char *name = 0 ); + CHexValidator( TQWidget *parent, EState state, const char *name = 0 ); ~CHexValidator( void ); - QValidator::State validate( QString &string, int &pos ) const; + TQValidator::State validate( TQString &string, int &pos ) const; void setState( EState state ); - void convert( QByteArray &dest, const QString &src ); - void format( QString &dest, const QByteArray &src ); + void convert( TQByteArray &dest, const TQString &src ); + void format( TQString &dest, const TQByteArray &src ); private: /** @@ -52,7 +52,7 @@ class CHexValidator: public QValidator * * e.g. zeroExtend( "32", 3 ) => "032" */ - QString zeroExtend( const QString &src, unsigned destLen ) const; + TQString zeroExtend( const TQString &src, unsigned destLen ) const; EState mState; diff --git a/khexedit/hexviewwidget.cc b/khexedit/hexviewwidget.cc index 12226ed..5f3e32c 100644 --- a/khexedit/hexviewwidget.cc +++ b/khexedit/hexviewwidget.cc @@ -20,8 +20,8 @@ #include <iostream> -#include <qclipboard.h> -#include <qdrawutil.h> +#include <tqclipboard.h> +#include <tqdrawutil.h> #include <kglobalsettings.h> @@ -80,7 +80,7 @@ void CDragManager::setup( int x, int y ) mPending = true; } -bool CDragManager::start( QMouseEvent *e ) +bool CDragManager::start( TQMouseEvent *e ) { if( mPending == false ) { @@ -131,7 +131,7 @@ bool CDragManager::clear( void ) return( true ); } -void CDragManager::timerEvent( QTimerEvent *e ) +void CDragManager::timerEvent( TQTimerEvent *e ) { if( e->timerId() == mTimerId ) { @@ -167,9 +167,9 @@ void CDragManager::setupTimer( void ) // // This widget will use the entire space of the parent widget // -CHexViewWidget::CHexViewWidget( QWidget *parent, const char *name, +CHexViewWidget::CHexViewWidget( TQWidget *parent, const char *name, CHexBuffer *hexBuffer ) - : QFrame( parent, name, + : TQFrame( parent, name, #ifdef USE_NORTHWEST_GRAVITY Qt::WStaticContents #else @@ -190,19 +190,19 @@ CHexViewWidget::CHexViewWidget( QWidget *parent, const char *name, // I tried to do a // "while( mHorzScroll->isVisible() ) { mHorzScroll->hide(); }" // but then the loop never ended. The "CScrollBar" emits a "hidden()" - // signal whenever is receives a QHideEvent. + // signal whenever is receives a TQHideEvent. // - mVertScroll = new CScrollBar( QScrollBar::Vertical, this ); + mVertScroll = new CScrollBar( TQScrollBar::Vertical, this ); if( mVertScroll == 0 ) { return; } - mHorzScroll = new CScrollBar( QScrollBar::Horizontal, this ); + mHorzScroll = new CScrollBar( TQScrollBar::Horizontal, this ); if( mHorzScroll == 0 ) { return; } - mCorner = new QWidget( this ); + mCorner = new TQWidget( this ); if( mCorner == 0 ) { return; } - connect( mHorzScroll, SIGNAL(valueChanged(int)), SLOT(changeXPos(int)) ); - connect( mVertScroll, SIGNAL(valueChanged(int)), SLOT(changeYPos(int)) ); - connect( mHorzScroll, SIGNAL(hidden()), SLOT(update()) ); - connect( mVertScroll, SIGNAL(hidden()), SLOT(update()) ); + connect( mHorzScroll, TQT_SIGNAL(valueChanged(int)), TQT_SLOT(changeXPos(int)) ); + connect( mVertScroll, TQT_SIGNAL(valueChanged(int)), TQT_SLOT(changeYPos(int)) ); + connect( mHorzScroll, TQT_SIGNAL(hidden()), TQT_SLOT(update()) ); + connect( mVertScroll, TQT_SIGNAL(hidden()), TQT_SLOT(update()) ); mHorzScroll->hide(); mVertScroll->hide(); @@ -213,9 +213,9 @@ CHexViewWidget::CHexViewWidget( QWidget *parent, const char *name, #else mDragManager->setActivateMode( CDragManager::Timer ); #endif - connect( mDragManager, SIGNAL(startDrag(bool)), SLOT(startDrag(bool)) ); + connect( mDragManager, TQT_SIGNAL(startDrag(bool)), TQT_SLOT(startDrag(bool)) ); - setFrameStyle( QFrame::WinPanel|QFrame::Sunken ); + setFrameStyle( TQFrame::WinPanel|TQFrame::Sunken ); setWFlags( WResizeNoErase ); setFocusPolicy( StrongFocus ); @@ -247,7 +247,7 @@ CHexViewWidget::~CHexViewWidget( void ) } -int CHexViewWidget::readFile( QFile &file, const QString &url, CProgress &p ) +int CHexViewWidget::readFile( TQFile &file, const TQString &url, CProgress &p ) { int errCode = mHexBuffer->readFile( file, url, p ); if( errCode != Err_Success ) @@ -260,7 +260,7 @@ int CHexViewWidget::readFile( QFile &file, const QString &url, CProgress &p ) } -int CHexViewWidget::insertFile( QFile &file, CProgress &p ) +int CHexViewWidget::insertFile( TQFile &file, CProgress &p ) { int errCode = mHexBuffer->insertFile( file, p ); if( errCode != Err_Success ) @@ -277,7 +277,7 @@ int CHexViewWidget::insertFile( QFile &file, CProgress &p ) } -int CHexViewWidget::newFile( const QString &url ) +int CHexViewWidget::newFile( const TQString &url ) { int errCode = mHexBuffer->newFile( url ); if( errCode != Err_Success ) @@ -290,7 +290,7 @@ int CHexViewWidget::newFile( const QString &url ) } -int CHexViewWidget::writeFile( QFile &file, CProgress &p ) +int CHexViewWidget::writeFile( TQFile &file, CProgress &p ) { int errCode = mHexBuffer->writeFile( file, p ); if( errCode == Err_Success ) @@ -392,7 +392,7 @@ void CHexViewWidget::changeXPos( int p ) } else { - QWidget::update(); + TQWidget::update(); } // @@ -420,7 +420,7 @@ void CHexViewWidget::changeYPos( int p ) } else { - QWidget::update(); + TQWidget::update(); } // @@ -438,8 +438,8 @@ void CHexViewWidget::changeYPos( int p ) void CHexViewWidget::clipboardChanged( void ) { - disconnect(QApplication::clipboard(),SIGNAL(dataChanged()), - this,SLOT(clipboardChanged())); + disconnect(TQApplication::clipboard(),TQT_SIGNAL(dataChanged()), + this,TQT_SLOT(clipboardChanged())); unselect(); } @@ -481,7 +481,7 @@ void CHexViewWidget::insert( SInsertData &id ) return; } - QByteArray buf( id.size ); + TQByteArray buf( id.size ); if( buf.isNull() == true ) { return; @@ -513,7 +513,7 @@ void CHexViewWidget::insert( SInsertData &id ) } -void CHexViewWidget::insert( const QByteArray &buf ) +void CHexViewWidget::insert( const TQByteArray &buf ) { if( mHexBuffer->documentPresent() == false ) { @@ -534,7 +534,7 @@ void CHexViewWidget::insert( const QByteArray &buf ) } -void CHexViewWidget::append( const QByteArray &buf ) +void CHexViewWidget::append( const TQByteArray &buf ) { if( mHexBuffer->documentPresent() == false ) { @@ -556,7 +556,7 @@ void CHexViewWidget::append( const QByteArray &buf ) } -void CHexViewWidget::valueOnCursor( QByteArray &buf, uint size ) +void CHexViewWidget::valueOnCursor( TQByteArray &buf, uint size ) { mHexBuffer->valueOnCursor( buf, size ); } @@ -702,14 +702,14 @@ void CHexViewWidget::updateView( bool redraw, bool fixCursor ) if( redraw == true ) { - QWidget::update(); + TQWidget::update(); } } -void CHexViewWidget::setPalette( const QPalette &p ) +void CHexViewWidget::setPalette( const TQPalette &p ) { - QWidget::setPalette( p ); + TQWidget::setPalette( p ); mCorner->setPalette( p ); mVertScroll->setPalette( p ); mHorzScroll->setPalette( p ); @@ -779,7 +779,7 @@ void CHexViewWidget::setMisc( SDisplayMisc &misc ) misc.bookmarkEditor ); if( mHexBuffer->documentPresent() == true ) { - QWidget::update(); + TQWidget::update(); } } @@ -934,14 +934,14 @@ int CHexViewWidget::exportCArray( const SExportCArray &ex, CProgress &p ) void CHexViewWidget::startDrag( bool asText ) { - QByteArray buf; + TQByteArray buf; if( asText == true ) { if( mHexBuffer->copySelectedText( buf ) != Err_Success ) { return; } - QDragObject *d = new QTextDrag( buf.data(), this ); + TQDragObject *d = new TQTextDrag( buf.data(), this ); d->dragCopy(); } else @@ -950,7 +950,7 @@ void CHexViewWidget::startDrag( bool asText ) { return; } - QDragObject *d = new CHexDrag( buf, this ); + TQDragObject *d = new CHexDrag( buf, this ); d->dragCopy(); } } @@ -959,13 +959,13 @@ void CHexViewWidget::startDrag( bool asText ) void CHexViewWidget::copy( void ) { - QByteArray buf; + TQByteArray buf; if( mHexBuffer->copySelectedData( buf ) != Err_Success ) { return; } - disconnect(QApplication::clipboard(),SIGNAL(dataChanged()), - this,SLOT(clipboardChanged())); + disconnect(TQApplication::clipboard(),TQT_SIGNAL(dataChanged()), + this,TQT_SLOT(clipboardChanged())); // // Note: Do no give the CHexDrag a parent != 0. The clipboard // owns the current dragdata and will destroy it on exit or @@ -974,45 +974,45 @@ void CHexViewWidget::copy( void ) // is destroyed. We will then have a double destroy situation // when the app. is closed (=> segfault). // - QApplication::clipboard()->setData(new CHexDrag( buf )); - connect(QApplication::clipboard(),SIGNAL(dataChanged()), - this,SLOT(clipboardChanged())); + TQApplication::clipboard()->setData(new CHexDrag( buf )); + connect(TQApplication::clipboard(),TQT_SIGNAL(dataChanged()), + this,TQT_SLOT(clipboardChanged())); } void CHexViewWidget::copyText( int columnSegment ) { - QByteArray buf; + TQByteArray buf; if( mHexBuffer->copySelectedText( buf, columnSegment ) != Err_Success ) { return; } - disconnect(QApplication::clipboard(),SIGNAL(dataChanged()), - this,SLOT(clipboardChanged())); - QApplication::clipboard()->setText( buf.data() ); - connect(QApplication::clipboard(),SIGNAL(dataChanged()), - this,SLOT(clipboardChanged())); + disconnect(TQApplication::clipboard(),TQT_SIGNAL(dataChanged()), + this,TQT_SLOT(clipboardChanged())); + TQApplication::clipboard()->setText( buf.data() ); + connect(TQApplication::clipboard(),TQT_SIGNAL(dataChanged()), + this,TQT_SLOT(clipboardChanged())); } void CHexViewWidget::paste( void ) { - QMimeSource *data = QApplication::clipboard()->data(); + TQMimeSource *data = TQApplication::clipboard()->data(); if( data != 0 ) { - QByteArray buf; + TQByteArray buf; if( CHexDrag::decode( data, buf ) == true ) { insert( buf ); return; } - QString text; - if( QTextDrag::decode( data, text ) == true ) + TQString text; + if( TQTextDrag::decode( data, text ) == true ) { - QByteArray buf; + TQByteArray buf; if( mClipConvert.decode( buf, text ) == true ) { insert( buf ); @@ -1082,15 +1082,15 @@ void CHexViewWidget::addBookmark( int position ) -int CHexViewWidget::bookmarkMenu( const QString &title ) +int CHexViewWidget::bookmarkMenu( const TQString &title ) { - QPtrList<SCursorOffset> &list = mHexBuffer->bookmarkList(); + TQPtrList<SCursorOffset> &list = mHexBuffer->bookmarkList(); if( list.count() == 0 ) { return( -1 ); } - QString text; + TQString text; KPopupMenu *popup = new KPopupMenu( 0 ); popup->insertTitle( title ); for( uint i=0; i < list.count(); i++ ) @@ -1099,12 +1099,12 @@ int CHexViewWidget::bookmarkMenu( const QString &title ) if( p == 0 ) { continue; } text.sprintf("%04X:%04X", p->offset>>16, p->offset&0x0000FFFF ); - text.prepend( QString("[%1] %2: ").arg(i+1).arg(i18n("Offset")) ); + text.prepend( TQString("[%1] %2: ").arg(i+1).arg(i18n("Offset")) ); popup->insertItem( text, i ); } - QSize s(popup->sizeHint()); - QPoint center( (width()-s.width())/2, (height()-s.height())/2 ); + TQSize s(popup->sizeHint()); + TQPoint center( (width()-s.width())/2, (height()-s.height())/2 ); int position = popup->exec( mapToGlobal(center) ); delete popup; @@ -1121,7 +1121,7 @@ void CHexViewWidget::removeBookmark( bool all ) { return; } - QWidget::update(); // Redraw visisble area. + TQWidget::update(); // Redraw visisble area. } else { @@ -1149,7 +1149,7 @@ void CHexViewWidget::removeBookmark( bool all ) void CHexViewWidget::replaceBookmark( void ) { - QPtrList<SCursorOffset> &list = mHexBuffer->bookmarkList(); + TQPtrList<SCursorOffset> &list = mHexBuffer->bookmarkList(); if( list.count() == 0 ) { return; @@ -1166,7 +1166,7 @@ void CHexViewWidget::replaceBookmark( void ) void CHexViewWidget::gotoBookmark( uint position ) { - QPtrList<SCursorOffset> &list = mHexBuffer->bookmarkList(); + TQPtrList<SCursorOffset> &list = mHexBuffer->bookmarkList(); if( position >= list.count() ) { return; @@ -1186,7 +1186,7 @@ void CHexViewWidget::gotoBookmark( uint position ) void CHexViewWidget::gotoNextBookmark( bool next ) { - QPtrList<SCursorOffset> &list = mHexBuffer->bookmarkList(); + TQPtrList<SCursorOffset> &list = mHexBuffer->bookmarkList(); uint offset = mHexBuffer->cursorOffset(); uint diff = ~0; @@ -1298,7 +1298,7 @@ void CHexViewWidget::benchmark( void ) -void CHexViewWidget::resizeEvent( QResizeEvent * ) +void CHexViewWidget::resizeEvent( TQResizeEvent * ) { setTextBufferSize(); @@ -1330,7 +1330,7 @@ void CHexViewWidget::resizeEvent( QResizeEvent * ) #ifdef USE_NORTHWEST_GRAVITY if( w != dataWidth() ) { - QWidget::update(); + TQWidget::update(); } else { @@ -1342,7 +1342,7 @@ void CHexViewWidget::resizeEvent( QResizeEvent * ) -void CHexViewWidget::paintEvent( QPaintEvent *e ) +void CHexViewWidget::paintEvent( TQPaintEvent *e ) { paintText( e->rect(), true ); } @@ -1356,14 +1356,14 @@ void CHexViewWidget::updateFrameSize( void ) int h = height() - (mHorzScroll->isVisible() ? mScrollBarSize : 0); if( h < 0 ) { h = 0; } - setFrameRect( QRect(0,0,w,h) ); + setFrameRect( TQRect(0,0,w,h) ); } void CHexViewWidget::paintFrame( void ) { - QPainter paint; + TQPainter paint; paint.begin( this ); drawFrame( &paint ); paint.end(); @@ -1371,7 +1371,7 @@ void CHexViewWidget::paintFrame( void ) -void CHexViewWidget::drawFrame( QPainter *p ) +void CHexViewWidget::drawFrame( TQPainter *p ) { // // 2000-01-10 Espen Sand @@ -1379,21 +1379,21 @@ void CHexViewWidget::drawFrame( QPainter *p ) // accepts a drop. The setPalette() function causes quite a bit of flicker // in the scrollbars (even when PropagationMode is NoChildren), so I // draw the frame manually when it can accept a drop. Note that the - // code below is for the frame shape "QFrame::WinPanel|QFrame::Plain" + // code below is for the frame shape "TQFrame::WinPanel|TQFrame::Plain" // if( mDropHighlight == true ) { - qDrawPlainRect( p, frameRect(), QColor("SteelBlue2"), lineWidth() ); + qDrawPlainRect( p, frameRect(), TQColor("SteelBlue2"), lineWidth() ); } else { - QFrame::drawFrame(p); // Use standard drawFrame + TQFrame::drawFrame(p); // Use standard drawFrame } } -void CHexViewWidget::keyPressEvent( QKeyEvent *e ) +void CHexViewWidget::keyPressEvent( TQKeyEvent *e ) { SCursorConfig cc; cc.state = e->state(); @@ -1514,7 +1514,7 @@ void CHexViewWidget::keyPressEvent( QKeyEvent *e ) } -void CHexViewWidget::keyReleaseEvent( QKeyEvent *e ) +void CHexViewWidget::keyReleaseEvent( TQKeyEvent *e ) { if( ( e->state() & ShiftButton ) && shiftButtonState() == false ) { @@ -1528,7 +1528,7 @@ void CHexViewWidget::keyReleaseEvent( QKeyEvent *e ) } -void CHexViewWidget::mousePressEvent( QMouseEvent *e ) +void CHexViewWidget::mousePressEvent( TQMouseEvent *e ) { // // The RMB popup menu is managed by the KContextMenuManager @@ -1557,7 +1557,7 @@ void CHexViewWidget::mousePressEvent( QMouseEvent *e ) } -void CHexViewWidget::mouseMoveEvent( QMouseEvent *e ) +void CHexViewWidget::mouseMoveEvent( TQMouseEvent *e ) { if( e->state() & LeftButton ) { @@ -1569,7 +1569,7 @@ void CHexViewWidget::mouseMoveEvent( QMouseEvent *e ) } } -void CHexViewWidget::mouseReleaseEvent( QMouseEvent *e ) +void CHexViewWidget::mouseReleaseEvent( TQMouseEvent *e ) { // // The RMB popup menu is managed by the KContextMenuManager @@ -1606,18 +1606,18 @@ void CHexViewWidget::mouseReleaseEvent( QMouseEvent *e ) -void CHexViewWidget::wheelEvent( QWheelEvent *e ) +void CHexViewWidget::wheelEvent( TQWheelEvent *e ) { if( mVertScroll->isVisible() == true ) { - QApplication::sendEvent( mVertScroll, e ); + TQApplication::sendEvent( mVertScroll, e ); } } -void CHexViewWidget::dragEnterEvent( QDragEnterEvent *e ) +void CHexViewWidget::dragEnterEvent( TQDragEnterEvent *e ) { - if( QTextDrag::canDecode(e) || CHexDrag::canDecode(e) || + if( TQTextDrag::canDecode(e) || CHexDrag::canDecode(e) || KURLDrag::canDecode(e)) { e->accept(); @@ -1626,17 +1626,17 @@ void CHexViewWidget::dragEnterEvent( QDragEnterEvent *e ) } -void CHexViewWidget::dragLeaveEvent( QDragLeaveEvent * ) +void CHexViewWidget::dragLeaveEvent( TQDragLeaveEvent * ) { setDropHighlight( false ); } -void CHexViewWidget::dragMoveEvent( QDragMoveEvent *e ) +void CHexViewWidget::dragMoveEvent( TQDragMoveEvent *e ) { // // Move the cursor if we are dragging (readable) text or binary - // data. Note: the QTextDrag::canDecode() will return true if we + // data. Note: the TQTextDrag::canDecode() will return true if we // are dragging a file so we have to test for KURLDrag::canDecode() // first. // @@ -1646,7 +1646,7 @@ void CHexViewWidget::dragMoveEvent( QDragMoveEvent *e ) return; } - if( QTextDrag::canDecode(e) == true || CHexDrag::canDecode(e) == true ) + if( TQTextDrag::canDecode(e) == true || CHexDrag::canDecode(e) == true ) { int x = startX() + e->pos().x(); int y = startY() + e->pos().y(); @@ -1660,9 +1660,9 @@ void CHexViewWidget::dragMoveEvent( QDragMoveEvent *e ) } -void CHexViewWidget::dropEvent( QDropEvent *e ) +void CHexViewWidget::dropEvent( TQDropEvent *e ) { - QMimeSource &m = *(QDropEvent*)e; + TQMimeSource &m = *(TQDropEvent*)e; setDropHighlight( false ); KURL::List list; @@ -1679,15 +1679,15 @@ void CHexViewWidget::dropEvent( QDropEvent *e ) return; } - QByteArray buf; + TQByteArray buf; if( CHexDrag::decode( &m, buf ) == true ) { insert( buf ); return; } - QString text; - if( QTextDrag::decode( &m, text ) == true ) + TQString text; + if( TQTextDrag::decode( &m, text ) == true ) { bool success = mClipConvert.decode( buf, text ); if( success == true ) @@ -1700,7 +1700,7 @@ void CHexViewWidget::dropEvent( QDropEvent *e ) } -void CHexViewWidget::showEvent( QShowEvent * ) +void CHexViewWidget::showEvent( TQShowEvent * ) { // Currently we do nothing here. } @@ -1708,7 +1708,7 @@ void CHexViewWidget::showEvent( QShowEvent * ) -void CHexViewWidget::timerEvent( QTimerEvent *e ) +void CHexViewWidget::timerEvent( TQTimerEvent *e ) { if( e->timerId() == mCursorTimerId ) { @@ -1740,13 +1740,13 @@ void CHexViewWidget::timerEvent( QTimerEvent *e ) } } -void CHexViewWidget::focusInEvent( QFocusEvent * ) +void CHexViewWidget::focusInEvent( TQFocusEvent * ) { setupCursorTimer(); paintCursor( CHexBuffer::cursor_curr ); } -void CHexViewWidget::focusOutEvent( QFocusEvent * ) +void CHexViewWidget::focusOutEvent( TQFocusEvent * ) { if( mCursor.focusMode != SDisplayCursor::ignore ) { @@ -1893,14 +1893,14 @@ void CHexViewWidget::redrawLines( uint docLine, int numLine ) int t = docLine * lineHeight - startY() + frameWidth(); if( mEditMode == CHexBuffer::EditInsert ) { - QRect r = contentsRect(); + TQRect r = contentsRect(); r.setTop( t ); paintText( contentsRect().intersect( r ), false ); } else { int h = (numLine + (startY() % lineHeight ? 1 : 0)) * lineHeight; - QRect r( contentsRect().left(), t, contentsRect().width(), h ); + TQRect r( contentsRect().left(), t, contentsRect().width(), h ); paintText( contentsRect().intersect( r ), false ); } } @@ -1915,14 +1915,14 @@ void CHexViewWidget::redrawFromOffset( uint offset, bool finishWindow ) int t = docLine * lineHeight - startY() + frameWidth(); if( finishWindow == true ) { - QRect r = contentsRect(); + TQRect r = contentsRect(); r.setTop( t ); paintText( contentsRect().intersect( r ), false ); } else { int h = t + lineHeight; - QRect r( contentsRect().left(), t, contentsRect().width(), h ); + TQRect r( contentsRect().left(), t, contentsRect().width(), h ); paintText( contentsRect().intersect( r ), false ); } } @@ -1930,9 +1930,9 @@ void CHexViewWidget::redrawFromOffset( uint offset, bool finishWindow ) -void CHexViewWidget::paintText( const QRect &rect, bool expand ) +void CHexViewWidget::paintText( const TQRect &rect, bool expand ) { - QRect r = rect; + TQRect r = rect; if( expand == true ) { @@ -1957,7 +1957,7 @@ void CHexViewWidget::paintText( const QRect &rect, bool expand ) if( r.right() > maxX ) { r.setRight( maxX ); } if( r.bottom() > maxY ) { r.setBottom( maxY ); } - QPainter paint( &mTextBuffer ); + TQPainter paint( &mTextBuffer ); paint.setFont( mHexBuffer->font() ); int lineHeight = mHexBuffer->lineHeight(); @@ -1999,7 +1999,7 @@ void CHexViewWidget::paintText( const QRect &rect, bool expand ) void CHexViewWidget::paintCursor( int cursorMode ) { - QPainter paint; + TQPainter paint; paint.begin( &mTextBuffer ); paint.setFont( mHexBuffer->font() ); @@ -2233,7 +2233,7 @@ void CHexViewWidget::cursorBackspace( SCursorConfig &/*cc*/ ) } -void CHexViewWidget::cursorInput( QChar c ) +void CHexViewWidget::cursorInput( TQChar c ) { uint cursorLine = mHexBuffer->cursorLine(); bool success = mHexBuffer->inputAtCursor( c ); @@ -2269,15 +2269,15 @@ void CHexViewWidget::setDropHighlight( bool dropHighlight ) { // // 2000-01-10 Espen Sand - // Highlight. I have reimplemented QFrame::drawFrame(QPainter *) + // Highlight. I have reimplemented TQFrame::drawFrame(TQPainter *) // to support a custom frame color. I assume the frame shape is - // "QFrame::WinPanel|QFrame::Plain" in that function. + // "TQFrame::WinPanel|TQFrame::Plain" in that function. // - setFrameStyle( QFrame::WinPanel|QFrame::Plain ); + setFrameStyle( TQFrame::WinPanel|TQFrame::Plain ); } else { - setFrameStyle( QFrame::WinPanel|QFrame::Sunken ); + setFrameStyle( TQFrame::WinPanel|TQFrame::Sunken ); } } diff --git a/khexedit/hexviewwidget.h b/khexedit/hexviewwidget.h index 9dc55e4..d0050e8 100644 --- a/khexedit/hexviewwidget.h +++ b/khexedit/hexviewwidget.h @@ -26,10 +26,10 @@ #endif -#include <qframe.h> -#include <qpixmap.h> -#include <qpopupmenu.h> -#include <qscrollbar.h> +#include <tqframe.h> +#include <tqpixmap.h> +#include <tqpopupmenu.h> +#include <tqscrollbar.h> #include <kapplication.h> #include <kcmenumngr.h> @@ -42,8 +42,8 @@ class CScrollBar : public QScrollBar Q_OBJECT public: - CScrollBar( Orientation o, QWidget *parent, const char *name = 0 ) - : QScrollBar( o, parent, name ) + CScrollBar( Orientation o, TQWidget *parent, const char *name = 0 ) + : TQScrollBar( o, parent, name ) { } @@ -51,7 +51,7 @@ class CScrollBar : public QScrollBar void hidden( void ); protected: - virtual void hideEvent( QHideEvent * ) + virtual void hideEvent( TQHideEvent * ) { emit hidden(); } @@ -73,11 +73,11 @@ class CDragManager : public QWidget CDragManager( void ); void setActivateMode( EDragActivateMode mode ); void setup( int x, int y ); - bool start( QMouseEvent *e ); + bool start( TQMouseEvent *e ); bool clear( void ); protected: - virtual void timerEvent( QTimerEvent *e ); + virtual void timerEvent( TQTimerEvent *e ); private: void removeTimer( void ); @@ -90,7 +90,7 @@ class CDragManager : public QWidget EDragActivateMode mActivateMode; bool mPending; int mTimerId; - QPoint mOrigin; + TQPoint mOrigin; }; @@ -100,14 +100,14 @@ class CHexViewWidget : public QFrame Q_OBJECT public: - CHexViewWidget( QWidget *parent, const char *name, CHexBuffer *hexBuffer ); + CHexViewWidget( TQWidget *parent, const char *name, CHexBuffer *hexBuffer ); ~CHexViewWidget( void ); inline bool widgetValid( void ); - int readFile( QFile &file, const QString &url, CProgress &p ); - int insertFile( QFile &file, CProgress &p ); - int writeFile( QFile &file, CProgress &p ); - int newFile( const QString &url ); + int readFile( TQFile &file, const TQString &url, CProgress &p ); + int insertFile( TQFile &file, CProgress &p ); + int writeFile( TQFile &file, CProgress &p ); + int newFile( const TQString &url ); void closeFile( void ); void initFile( void ); void setBuffer( CHexBuffer *hexBuffer ); @@ -135,7 +135,7 @@ class CHexViewWidget : public QFrame void gotoNextBookmark( bool next ); void benchmark( void ); - virtual void setPalette( const QPalette & ); + virtual void setPalette( const TQPalette & ); void setInputMode( SDisplayInputMode &mode ); void setLayout( SDisplayLayout &layout ); void setCursor( const SDisplayCursor &cursor, bool updateDisplay ); @@ -155,8 +155,8 @@ class CHexViewWidget : public QFrame int collectStatistic( SStatisticControl &sc, CProgress &p ); - inline void setPopupMenu( QPopupMenu *popupMenu ); - inline void setDocumentMenu( QPopupMenu *popupMenu ); + inline void setPopupMenu( TQPopupMenu *popupMenu ); + inline void setDocumentMenu( TQPopupMenu *popupMenu ); inline bool insertMode( void ); inline int scrollBarWidth( void ); inline int dataWidth( void ); @@ -165,21 +165,21 @@ class CHexViewWidget : public QFrame inline uint bookmarkCount( void ); inline bool modified( void ); inline void setModified( bool modified ); - inline const QDateTime &diskModifyTime( void ); + inline const TQDateTime &diskModifyTime( void ); inline bool losslessEncoding( CConversion::EMode mode ); inline const SEncodeState &encoding( void ); inline bool documentPresent( void ); inline bool urlValid( void ); - inline QString &url( void ); - inline void setUrl( QString &url ); + inline TQString &url( void ); + inline void setUrl( TQString &url ); inline const CHexBuffer *hexBuffer( void ); public slots: void filter( SFilterControl &fc ); void insert( SInsertData &id ); - void insert( const QByteArray &buf ); - void append( const QByteArray &buf ); - void valueOnCursor( QByteArray &buf, uint size ); + void insert( const TQByteArray &buf ); + void append( const TQByteArray &buf ); + void valueOnCursor( TQByteArray &buf, uint size ); void paletteChanged( void ); void fontChanged( void ); void gotoOffset( uint offset, uint bit, bool fromCursor, bool forward ); @@ -188,23 +188,23 @@ class CHexViewWidget : public QFrame void setDropHighlight( bool mode ); protected: - virtual void drawFrame( QPainter *p ); - virtual void paintEvent( QPaintEvent *e ); - virtual void resizeEvent( QResizeEvent *e ); - virtual void keyPressEvent( QKeyEvent *e ); - virtual void keyReleaseEvent( QKeyEvent *e ); - virtual void mousePressEvent( QMouseEvent *e ); - virtual void mouseMoveEvent( QMouseEvent *e ); - virtual void wheelEvent( QWheelEvent * ); - virtual void mouseReleaseEvent( QMouseEvent *e ); - virtual void dragEnterEvent( QDragEnterEvent *e ); - virtual void dragLeaveEvent( QDragLeaveEvent *e ); - virtual void dragMoveEvent( QDragMoveEvent *e ); - virtual void dropEvent( QDropEvent *e ); - virtual void showEvent( QShowEvent * ); - virtual void timerEvent( QTimerEvent *e ); - virtual void focusInEvent( QFocusEvent *e ); - virtual void focusOutEvent( QFocusEvent *e ); + virtual void drawFrame( TQPainter *p ); + virtual void paintEvent( TQPaintEvent *e ); + virtual void resizeEvent( TQResizeEvent *e ); + virtual void keyPressEvent( TQKeyEvent *e ); + virtual void keyReleaseEvent( TQKeyEvent *e ); + virtual void mousePressEvent( TQMouseEvent *e ); + virtual void mouseMoveEvent( TQMouseEvent *e ); + virtual void wheelEvent( TQWheelEvent * ); + virtual void mouseReleaseEvent( TQMouseEvent *e ); + virtual void dragEnterEvent( TQDragEnterEvent *e ); + virtual void dragLeaveEvent( TQDragLeaveEvent *e ); + virtual void dragMoveEvent( TQDragMoveEvent *e ); + virtual void dropEvent( TQDropEvent *e ); + virtual void showEvent( TQShowEvent * ); + virtual void timerEvent( TQTimerEvent *e ); + virtual void focusInEvent( TQFocusEvent *e ); + virtual void focusOutEvent( TQFocusEvent *e ); protected slots: void changeXPos( int pos ); @@ -217,17 +217,17 @@ class CHexViewWidget : public QFrame void dataChanged( void ); void layoutChanged( const SDisplayLayout &layout ); void inputModeChanged( const SDisplayInputMode &mode ); - void bookmarkChanged( QPtrList<SCursorOffset> &list ); + void bookmarkChanged( TQPtrList<SCursorOffset> &list ); void editMode( CHexBuffer::EEditMode editMode ); void encodingChanged( const SEncodeState &state ); void textWidth( uint width ); - void fileName( const QString &url, bool onDisk ); - void fileRename( const QString &curName, const QString &newName ); - void fileClosed( const QString &url ); + void fileName( const TQString &url, bool onDisk ); + void fileRename( const TQString &curName, const TQString &newName ); + void fileClosed( const TQString &url ); void pleaseOpenNewFile( void ); void pleaseStepFile( bool next ); - void pleaseOpenFile(const QString &url,bool reloadWhenChanged,uint offset); + void pleaseOpenFile(const TQString &url,bool reloadWhenChanged,uint offset); private: void setSelection( uint offset, bool init ); @@ -242,7 +242,7 @@ class CHexViewWidget : public QFrame void redrawInterval( uint start, uint stop ); void redrawLines( uint docLine, int numLine ); void redrawFromOffset( uint offset, bool finishWindow ); - void paintText( const QRect &r, bool expand ); + void paintText( const TQRect &r, bool expand ); void paintCursor( int cursorMode ); @@ -259,9 +259,9 @@ class CHexViewWidget : public QFrame void cursorInsert( SCursorConfig &cc ); void cursorDelete( SCursorConfig &cc ); void cursorBackspace( SCursorConfig &cc ); - void cursorInput( QChar c ); + void cursorInput( TQChar c ); - int bookmarkMenu( const QString &title ); + int bookmarkMenu( const TQString &title ); static inline bool shiftButtonState( void ); @@ -283,17 +283,17 @@ class CHexViewWidget : public QFrame private: CScrollBar *mVertScroll; CScrollBar *mHorzScroll; - QWidget *mCorner; + TQWidget *mCorner; CHexBuffer *mHexBuffer; - QPixmap mTextBuffer; + TQPixmap mTextBuffer; SDisplayLayout mLayout; SDisplayCursor mCursor; SDisplayColor mColor; SDisplayFontInfo mFontInfo; SDisplayMisc mMisc; - QPopupMenu *mDocumentMenu; + TQPopupMenu *mDocumentMenu; int mScrollBarSize; CHexBuffer::EEditMode mEditMode; @@ -367,13 +367,13 @@ inline void CHexViewWidget::setupCursorTimer( void ) mHexBuffer->setShowCursor( mShowCursor ); } -inline void CHexViewWidget::setPopupMenu( QPopupMenu *popupMenu ) +inline void CHexViewWidget::setPopupMenu( TQPopupMenu *popupMenu ) { KContextMenuManager::insert( this, popupMenu ); } -inline void CHexViewWidget::setDocumentMenu( QPopupMenu *popupMenu ) +inline void CHexViewWidget::setDocumentMenu( TQPopupMenu *popupMenu ) { mDocumentMenu = popupMenu; } @@ -517,7 +517,7 @@ inline uint CHexViewWidget::offset( void ) inline uint CHexViewWidget::bookmarkCount( void ) { - const QPtrList<SCursorOffset> &list = mHexBuffer->bookmarkList(); + const TQPtrList<SCursorOffset> &list = mHexBuffer->bookmarkList(); return( list.count() ); } @@ -532,7 +532,7 @@ inline void CHexViewWidget::setModified( bool modified ) emit fileState( mHexBuffer->fileState() ); } -inline const QDateTime &CHexViewWidget::diskModifyTime( void ) +inline const TQDateTime &CHexViewWidget::diskModifyTime( void ) { return( mHexBuffer->diskModifyTime() ); } @@ -557,12 +557,12 @@ inline bool CHexViewWidget::urlValid( void ) return( mHexBuffer->hasFileName() ); } -inline QString &CHexViewWidget::url( void ) +inline TQString &CHexViewWidget::url( void ) { return( mHexBuffer->url() ); } -inline void CHexViewWidget::setUrl( QString &url ) +inline void CHexViewWidget::setUrl( TQString &url ) { if( mHexBuffer->url() != url ) { diff --git a/khexedit/lib/codecs/kbinarybytecodec.cpp b/khexedit/lib/codecs/kbinarybytecodec.cpp index d665a05..a49a460 100644 --- a/khexedit/lib/codecs/kbinarybytecodec.cpp +++ b/khexedit/lib/codecs/kbinarybytecodec.cpp @@ -21,13 +21,13 @@ using namespace KHE; -void KBinaryByteCodec::encode( QString &Digits, unsigned int Pos, const unsigned char Char ) const +void KBinaryByteCodec::encode( TQString &Digits, unsigned int Pos, const unsigned char Char ) const { for( unsigned char M=1<<7; M>0; M>>=1 ) Digits.at(Pos++) = (Char & M) ? '1' : '0'; } -void KBinaryByteCodec::encodeShort( QString &Digits, unsigned int Pos, unsigned char Char ) const +void KBinaryByteCodec::encodeShort( TQString &Digits, unsigned int Pos, unsigned char Char ) const { unsigned char M = 1<<7; // find first set bit diff --git a/khexedit/lib/codecs/kbinarybytecodec.h b/khexedit/lib/codecs/kbinarybytecodec.h index d0354fa..631fa74 100644 --- a/khexedit/lib/codecs/kbinarybytecodec.h +++ b/khexedit/lib/codecs/kbinarybytecodec.h @@ -41,9 +41,9 @@ class KBinaryByteCodec : public KByteCodec virtual unsigned char digitsFilledLimit() const { return 128; } /** encodes the Char and writes the result to */ - virtual void encode( QString &Digits, unsigned int Pos, const unsigned char Char ) const; + virtual void encode( TQString &Digits, unsigned int Pos, const unsigned char Char ) const; /** */ - virtual void encodeShort( QString &Digits, unsigned int Pos, const unsigned char Char ) const; + virtual void encodeShort( TQString &Digits, unsigned int Pos, const unsigned char Char ) const; /** */ virtual bool appendDigit( unsigned char *Byte, const unsigned char Digit ) const; /** */ diff --git a/khexedit/lib/codecs/kbytecodec.cpp b/khexedit/lib/codecs/kbytecodec.cpp index dc5137f..f4847ba 100644 --- a/khexedit/lib/codecs/kbytecodec.cpp +++ b/khexedit/lib/codecs/kbytecodec.cpp @@ -38,9 +38,9 @@ KByteCodec *KByteCodec::createCodec( KCoding C ) return Codec; } -unsigned int KByteCodec::decode( unsigned char *Char, const QString &Digits, uint Pos ) const +unsigned int KByteCodec::decode( unsigned char *Char, const TQString &Digits, uint Pos ) const { - //kdDebug() << QString("KByteCodec::decode(%1,%2)").arg(Digits).arg(Pos) << endl; + //kdDebug() << TQString("KByteCodec::decode(%1,%2)").arg(Digits).arg(Pos) << endl; const uint P = Pos; // remove leading 0s diff --git a/khexedit/lib/codecs/kcharcodec.cpp b/khexedit/lib/codecs/kcharcodec.cpp index 5a58320..1aab79b 100644 --- a/khexedit/lib/codecs/kcharcodec.cpp +++ b/khexedit/lib/codecs/kcharcodec.cpp @@ -23,9 +23,9 @@ using namespace KHE; -QStringList KCharCodec::CodecNames; +TQStringList KCharCodec::CodecNames; -const QStringList &KCharCodec::codecNames() +const TQStringList &KCharCodec::codecNames() { // first call? if( CodecNames.isEmpty() ) @@ -38,7 +38,7 @@ const QStringList &KCharCodec::codecNames() } -KCharCodec *KCharCodec::createCodec( const QString &Name ) +KCharCodec *KCharCodec::createCodec( const TQString &Name ) { KCharCodec *Codec = 0; diff --git a/khexedit/lib/codecs/kdecimalbytecodec.cpp b/khexedit/lib/codecs/kdecimalbytecodec.cpp index 9470382..c556875 100644 --- a/khexedit/lib/codecs/kdecimalbytecodec.cpp +++ b/khexedit/lib/codecs/kdecimalbytecodec.cpp @@ -21,7 +21,7 @@ using namespace KHE; -void KDecimalByteCodec::encode( QString &Digits, unsigned int Pos, unsigned char Char ) const +void KDecimalByteCodec::encode( TQString &Digits, unsigned int Pos, unsigned char Char ) const { unsigned char C = Char / 100; Digits.at(Pos++) = '0'+C; @@ -33,7 +33,7 @@ void KDecimalByteCodec::encode( QString &Digits, unsigned int Pos, unsigned char } -void KDecimalByteCodec::encodeShort( QString &Digits, unsigned int Pos, unsigned char Char ) const +void KDecimalByteCodec::encodeShort( TQString &Digits, unsigned int Pos, unsigned char Char ) const { unsigned char C; if( (C = Char / 100) ) diff --git a/khexedit/lib/codecs/kdecimalbytecodec.h b/khexedit/lib/codecs/kdecimalbytecodec.h index 31f61d0..b91e6a8 100644 --- a/khexedit/lib/codecs/kdecimalbytecodec.h +++ b/khexedit/lib/codecs/kdecimalbytecodec.h @@ -41,9 +41,9 @@ class KDecimalByteCodec : public KByteCodec virtual unsigned char digitsFilledLimit() const { return 26; } /** encodes the Char and writes the result to */ - virtual void encode( QString &Digits, unsigned int Pos, const unsigned char Char ) const; + virtual void encode( TQString &Digits, unsigned int Pos, const unsigned char Char ) const; /** */ - virtual void encodeShort( QString &Digits, unsigned int Pos, const unsigned char Char ) const; + virtual void encodeShort( TQString &Digits, unsigned int Pos, const unsigned char Char ) const; /** */ virtual bool appendDigit( unsigned char *Byte, const unsigned char Digit ) const; /** */ diff --git a/khexedit/lib/codecs/kebcdic1047charcodec.cpp b/khexedit/lib/codecs/kebcdic1047charcodec.cpp index f26da37..d1002c3 100644 --- a/khexedit/lib/codecs/kebcdic1047charcodec.cpp +++ b/khexedit/lib/codecs/kebcdic1047charcodec.cpp @@ -96,7 +96,7 @@ static unsigned char EBCDICChars[256] = static const char KEBCDIC1047CharCodecName[] = "EBCDIC 1047"; -bool KEBCDIC1047CharCodec::encode( char *D, const QChar &C ) const +bool KEBCDIC1047CharCodec::encode( char *D, const TQChar &C ) const { int I = C.unicode(); // not in range? @@ -109,16 +109,16 @@ bool KEBCDIC1047CharCodec::encode( char *D, const QChar &C ) const KHEChar KEBCDIC1047CharCodec::decode( char Byte ) const { - return QChar(UnicodeChars[(unsigned char)Byte]); + return TQChar(UnicodeChars[(unsigned char)Byte]); } -const QString& KEBCDIC1047CharCodec::name() const +const TQString& KEBCDIC1047CharCodec::name() const { return codecName(); } -const QString& KEBCDIC1047CharCodec::codecName() +const TQString& KEBCDIC1047CharCodec::codecName() { - static const QString Name( QString::fromLatin1(KEBCDIC1047CharCodecName) ); + static const TQString Name( TQString::fromLatin1(KEBCDIC1047CharCodecName) ); return Name; } diff --git a/khexedit/lib/codecs/kebcdic1047charcodec.h b/khexedit/lib/codecs/kebcdic1047charcodec.h index 7c30956..8ac1d43 100644 --- a/khexedit/lib/codecs/kebcdic1047charcodec.h +++ b/khexedit/lib/codecs/kebcdic1047charcodec.h @@ -32,12 +32,12 @@ class KEBCDIC1047CharCodec : public KCharCodec public: // KCharCodec API virtual KHEChar decode( char Byte ) const; - virtual bool encode( char *D, const QChar &C ) const; - virtual const QString& name() const; + virtual bool encode( char *D, const TQChar &C ) const; + virtual const TQString& name() const; public: static KEBCDIC1047CharCodec *create(); - static const QString& codecName(); + static const TQString& codecName(); }; diff --git a/khexedit/lib/codecs/khexadecimalbytecodec.cpp b/khexedit/lib/codecs/khexadecimalbytecodec.cpp index 7072464..596fd24 100644 --- a/khexedit/lib/codecs/khexadecimalbytecodec.cpp +++ b/khexedit/lib/codecs/khexadecimalbytecodec.cpp @@ -21,9 +21,9 @@ using namespace KHE; -static const QChar BigDigit[16] = +static const TQChar BigDigit[16] = { '0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F' }; -static const QChar SmallDigit[16] = +static const TQChar SmallDigit[16] = { '0','1','2','3','4','5','6','7','8','9','a','b','c','d','e','f' }; @@ -39,13 +39,13 @@ bool KHexadecimalByteCodec::setSmallDigits( bool S ) bool KHexadecimalByteCodec::smallDigits() const { return Digit != BigDigit; } -void KHexadecimalByteCodec::encode( QString &Digits, unsigned int Pos, unsigned char Char ) const +void KHexadecimalByteCodec::encode( TQString &Digits, unsigned int Pos, unsigned char Char ) const { Digits.at(Pos++) = Digit[Char>>4]; Digits.at(Pos) = Digit[Char&0x0F]; } -void KHexadecimalByteCodec::encodeShort( QString &Digits, unsigned int Pos, unsigned char Char ) const +void KHexadecimalByteCodec::encodeShort( TQString &Digits, unsigned int Pos, unsigned char Char ) const { unsigned char C; if( (C = (Char>>4)) ) diff --git a/khexedit/lib/codecs/khexadecimalbytecodec.h b/khexedit/lib/codecs/khexadecimalbytecodec.h index 9bb1969..88b2f83 100644 --- a/khexedit/lib/codecs/khexadecimalbytecodec.h +++ b/khexedit/lib/codecs/khexadecimalbytecodec.h @@ -48,9 +48,9 @@ class KHexadecimalByteCodec : public KByteCodec virtual unsigned char digitsFilledLimit() const { return 16; } /** encodes the Char and writes the result to */ - virtual void encode( QString &Digits, unsigned int Pos, const unsigned char Char ) const; + virtual void encode( TQString &Digits, unsigned int Pos, const unsigned char Char ) const; /** */ - virtual void encodeShort( QString &Digits, unsigned int Pos, const unsigned char Char ) const; + virtual void encodeShort( TQString &Digits, unsigned int Pos, const unsigned char Char ) const; /** */ virtual bool appendDigit( unsigned char *Byte, const unsigned char Digit ) const; /** */ @@ -61,7 +61,7 @@ class KHexadecimalByteCodec : public KByteCodec virtual bool turnToValue( unsigned char *Digit ) const; protected: - const QChar* Digit; + const TQChar* Digit; }; } diff --git a/khexedit/lib/codecs/koctalbytecodec.cpp b/khexedit/lib/codecs/koctalbytecodec.cpp index 1167941..44c7952 100644 --- a/khexedit/lib/codecs/koctalbytecodec.cpp +++ b/khexedit/lib/codecs/koctalbytecodec.cpp @@ -21,7 +21,7 @@ using namespace KHE; -void KOctalByteCodec::encode( QString &Digits, unsigned int Pos, unsigned char Char ) const +void KOctalByteCodec::encode( TQString &Digits, unsigned int Pos, unsigned char Char ) const { Digits.at(Pos++) = '0'+(Char>>6); Digits.at(Pos++) = '0'+((Char>>3)&0x07); @@ -29,7 +29,7 @@ void KOctalByteCodec::encode( QString &Digits, unsigned int Pos, unsigned char C } -void KOctalByteCodec::encodeShort( QString &Digits, unsigned int Pos, unsigned char Char ) const +void KOctalByteCodec::encodeShort( TQString &Digits, unsigned int Pos, unsigned char Char ) const { unsigned char C; if( (C = (Char>>6)&0x07) ) diff --git a/khexedit/lib/codecs/koctalbytecodec.h b/khexedit/lib/codecs/koctalbytecodec.h index e05ca66..14693f3 100644 --- a/khexedit/lib/codecs/koctalbytecodec.h +++ b/khexedit/lib/codecs/koctalbytecodec.h @@ -41,9 +41,9 @@ class KOctalByteCodec : public KByteCodec virtual unsigned char digitsFilledLimit() const { return 64; } /** encodes the Char and writes the result to */ - virtual void encode( QString &Digits, unsigned int Pos, const unsigned char Char ) const; + virtual void encode( TQString &Digits, unsigned int Pos, const unsigned char Char ) const; /** */ - virtual void encodeShort( QString &Digits, unsigned int Pos, const unsigned char Char ) const; + virtual void encodeShort( TQString &Digits, unsigned int Pos, const unsigned char Char ) const; /** */ virtual bool appendDigit( unsigned char *Byte, const unsigned char Digit ) const; /** */ diff --git a/khexedit/lib/codecs/ktextcharcodec.cpp b/khexedit/lib/codecs/ktextcharcodec.cpp index 613dedd..a9014dd 100644 --- a/khexedit/lib/codecs/ktextcharcodec.cpp +++ b/khexedit/lib/codecs/ktextcharcodec.cpp @@ -16,7 +16,7 @@ // qt specific -#include "qtextcodec.h" +#include "tqtextcodec.h" // kde specific #include <kglobal.h> #include <klocale.h> @@ -63,7 +63,7 @@ const EncodingNames[] = { //TODO: WS2 static const unsigned int NoOfEncodings = 26; -static bool is8Bit( QTextCodec *Codec ) +static bool is8Bit( TQTextCodec *Codec ) { bool Found = false; for( unsigned int i=0; i<NoOfEncodings; ++i ) @@ -77,13 +77,13 @@ static bool is8Bit( QTextCodec *Codec ) return Found; } -static QTextCodec *createLatin1() +static TQTextCodec *createLatin1() { return KGlobal::charsets()->codecForName( EncodingNames[0].Name ); } /** heuristic seems to be doomed :( -static bool is8Bit( QTextCodec *Codec ) +static bool is8Bit( TQTextCodec *Codec ) { bool Result = true; @@ -91,9 +91,9 @@ static bool is8Bit( QTextCodec *Codec ) unsigned char c[4]; c[0] = 0; c[1] = c[2] = c[3] = 230; - QString S = Codec->toUnicode( (const char*)&c,4 ); + TQString S = Codec->toUnicode( (const char*)&c,4 ); int Length = 1; - QCString CS = Codec->fromUnicode( S, Length ); + TQCString CS = Codec->fromUnicode( S, Length ); //kdDebug() << Codec->name() << " "<<Length << endl; if( Length > 0 ) Result = false; @@ -115,26 +115,26 @@ static bool is8Bit( QTextCodec *Codec ) while( c[0] < 255 ); return Result; } -const QStringList &KTextCharCodec::codecNames() +const TQStringList &KTextCharCodec::codecNames() { // first call? if( CodecNames.isEmpty() ) { - const QStringList &CharSets = KGlobal::charsets()->availableEncodingNames(); + const TQStringList &CharSets = KGlobal::charsets()->availableEncodingNames(); - for( QStringList::ConstIterator it = CharSets.begin(); it != CharSets.end(); ++it ) + for( TQStringList::ConstIterator it = CharSets.begin(); it != CharSets.end(); ++it ) { bool Found = true; - QTextCodec* Codec = KGlobal::charsets()->codecForName( *it, Found ); + TQTextCodec* Codec = KGlobal::charsets()->codecForName( *it, Found ); if( Found && is8Bit(Codec) ) - CodecNames.append( QString::fromLatin1(Codec->name()) ); + CodecNames.append( TQString::fromLatin1(Codec->name()) ); } } return CodecNames; } -QString KTextCharCodec::nameOfEncoding( KEncoding C ) +TQString KTextCharCodec::nameOfEncoding( KEncoding C ) { KTextCharCodec *Codec = 0; @@ -150,35 +150,35 @@ QString KTextCharCodec::nameOfEncoding( KEncoding C ) if( N != 0 ) { - QString CodeName = QString::fromLatin1( N ); + TQString CodeName = TQString::fromLatin1( N ); } return Codec; } */ -QStringList KTextCharCodec::CodecNames; +TQStringList KTextCharCodec::CodecNames; KTextCharCodec *KTextCharCodec::createLocalCodec() { - QTextCodec *Codec = KGlobal::locale()->codecForEncoding(); + TQTextCodec *Codec = KGlobal::locale()->codecForEncoding(); if( !is8Bit(Codec) ) Codec = createLatin1(); return new KTextCharCodec( Codec ); } -KTextCharCodec *KTextCharCodec::createCodec( const QString &CodeName ) +KTextCharCodec *KTextCharCodec::createCodec( const TQString &CodeName ) { bool Ok; - QTextCodec *Codec = KGlobal::charsets()->codecForName( CodeName, Ok ); + TQTextCodec *Codec = KGlobal::charsets()->codecForName( CodeName, Ok ); if( Ok ) Ok = is8Bit( Codec ); return Ok ? new KTextCharCodec( Codec ) : 0; } -const QStringList &KTextCharCodec::codecNames() +const TQStringList &KTextCharCodec::codecNames() { // first call? if( CodecNames.isEmpty() ) @@ -186,10 +186,10 @@ const QStringList &KTextCharCodec::codecNames() for( unsigned int i=0; i<NoOfEncodings; ++i ) { bool Found = true; - QString Name = QString::fromLatin1( EncodingNames[i].Name ); - QTextCodec* Codec = KGlobal::charsets()->codecForName( Name, Found ); + TQString Name = TQString::fromLatin1( EncodingNames[i].Name ); + TQTextCodec* Codec = KGlobal::charsets()->codecForName( Name, Found ); if( Found ) - CodecNames.append( QString::fromLatin1(Codec->name()) ); + CodecNames.append( TQString::fromLatin1(Codec->name()) ); } } @@ -197,7 +197,7 @@ const QStringList &KTextCharCodec::codecNames() } -KTextCharCodec::KTextCharCodec( QTextCodec *C ) +KTextCharCodec::KTextCharCodec( TQTextCodec *C ) : Codec( C ), Decoder( C->makeDecoder() ), Encoder( C->makeEncoder() ) @@ -209,7 +209,7 @@ KTextCharCodec::~KTextCharCodec() delete Encoder; } -bool KTextCharCodec::encode( char *D, const QChar &C ) const +bool KTextCharCodec::encode( char *D, const TQChar &C ) const { if( !Codec->canEncode(C) ) // TODO: do we really need the codec? return false; @@ -223,14 +223,14 @@ bool KTextCharCodec::encode( char *D, const QChar &C ) const KHEChar KTextCharCodec::decode( char Byte ) const { - QString S( Decoder->toUnicode(&Byte,1) ); + TQString S( Decoder->toUnicode(&Byte,1) ); return KHEChar(S.at(0)); } -const QString& KTextCharCodec::name() const +const TQString& KTextCharCodec::name() const { if( Name.isNull() ) - Name = QString::fromLatin1( Codec->name() ); + Name = TQString::fromLatin1( Codec->name() ); return Name; } diff --git a/khexedit/lib/codecs/ktextcharcodec.h b/khexedit/lib/codecs/ktextcharcodec.h index 683919c..48ca3b0 100644 --- a/khexedit/lib/codecs/ktextcharcodec.h +++ b/khexedit/lib/codecs/ktextcharcodec.h @@ -32,33 +32,33 @@ namespace KHE class KTextCharCodec : public KCharCodec { public: - static KTextCharCodec *createCodec( const QString &CodeName ); + static KTextCharCodec *createCodec( const TQString &CodeName ); static KTextCharCodec *createCodec( KEncoding C ); static KTextCharCodec *createLocalCodec(); - static const QStringList &codecNames(); + static const TQStringList &codecNames(); protected: - KTextCharCodec( QTextCodec *C ); + KTextCharCodec( TQTextCodec *C ); public: virtual ~KTextCharCodec(); public: // KCharCodec API - virtual bool encode( char *D, const QChar &C ) const; + virtual bool encode( char *D, const TQChar &C ) const; virtual KHEChar decode( char Byte ) const; - virtual const QString& name() const; + virtual const TQString& name() const; protected: - QTextCodec *Codec; + TQTextCodec *Codec; /** decodes the chars to unicode */ - QTextDecoder *Decoder; + TQTextDecoder *Decoder; /** encodes the chars from unicode */ - QTextEncoder *Encoder; + TQTextEncoder *Encoder; /** */ - mutable QString Name; + mutable TQString Name; - static QStringList CodecNames; + static TQStringList CodecNames; }; } diff --git a/khexedit/lib/controller/kchareditor.cpp b/khexedit/lib/controller/kchareditor.cpp index 5b48fc6..7225ec7 100644 --- a/khexedit/lib/controller/kchareditor.cpp +++ b/khexedit/lib/controller/kchareditor.cpp @@ -16,7 +16,7 @@ // qt specific -#include <qevent.h> +#include <tqevent.h> // lib specific #include "kcharcolumn.h" #include "kcharcodec.h" @@ -34,17 +34,17 @@ KCharEditor::KCharEditor( KCharColumn *CC, KBufferCursor *BC, KHexEdit *HE, KCon } -bool KCharEditor::handleKeyPress( QKeyEvent *KeyEvent ) +bool KCharEditor::handleKeyPress( TQKeyEvent *KeyEvent ) { bool KeyUsed = false; // some input that should be inserted? if( KeyEvent->text().length() > 0 && !(KeyEvent->state()&( Qt::ControlButton | Qt::AltButton | Qt::MetaButton )) ) { - QChar C = KeyEvent->text()[0]; + TQChar C = KeyEvent->text()[0]; if( C.isPrint() ) { - QByteArray D( 1 ); + TQByteArray D( 1 ); if( CharColumn->codec()->encode(&D[0],C) ) { // clearUndoRedoInfo = false; diff --git a/khexedit/lib/controller/kchareditor.h b/khexedit/lib/controller/kchareditor.h index 74c3d8d..fba1f66 100644 --- a/khexedit/lib/controller/kchareditor.h +++ b/khexedit/lib/controller/kchareditor.h @@ -32,7 +32,7 @@ class KCharEditor : public KEditor KCharEditor( KCharColumn *CC, KBufferCursor *BC, KHexEdit *HE, KController *P ); public: // KEditor API - virtual bool handleKeyPress( QKeyEvent *KeyEvent ); + virtual bool handleKeyPress( TQKeyEvent *KeyEvent ); protected: KCharColumn *CharColumn; diff --git a/khexedit/lib/controller/kcontroller.cpp b/khexedit/lib/controller/kcontroller.cpp index 490da93..b9c42a6 100644 --- a/khexedit/lib/controller/kcontroller.cpp +++ b/khexedit/lib/controller/kcontroller.cpp @@ -28,7 +28,7 @@ KController::KController( KHexEdit* HE, KController *P ) { } -bool KController::handleKeyPress( QKeyEvent *KeyEvent ) +bool KController::handleKeyPress( TQKeyEvent *KeyEvent ) { return Parent ? Parent->handleKeyPress( KeyEvent ) : false; } diff --git a/khexedit/lib/controller/kcontroller.h b/khexedit/lib/controller/kcontroller.h index daeb0d5..be1f9fc 100644 --- a/khexedit/lib/controller/kcontroller.h +++ b/khexedit/lib/controller/kcontroller.h @@ -32,7 +32,7 @@ class KController KController( KHexEdit *HE, KController *P ); public: // KController API - virtual bool handleKeyPress( QKeyEvent *KeyEvent ); + virtual bool handleKeyPress( TQKeyEvent *KeyEvent ); protected: KController *Parent; diff --git a/khexedit/lib/controller/keditor.cpp b/khexedit/lib/controller/keditor.cpp index 7d4e92f..5678b09 100644 --- a/khexedit/lib/controller/keditor.cpp +++ b/khexedit/lib/controller/keditor.cpp @@ -35,7 +35,7 @@ KEditor::KEditor( KBufferCursor *BC, KHexEdit* HE, KController *P ) } -bool KEditor::handleKeyPress( QKeyEvent *KeyEvent ) +bool KEditor::handleKeyPress( TQKeyEvent *KeyEvent ) { bool clearUndoRedoInfo = true; bool ShiftPressed = KeyEvent->state() & Qt::ShiftButton; diff --git a/khexedit/lib/controller/keditor.h b/khexedit/lib/controller/keditor.h index dc2b0fd..e4fa06c 100644 --- a/khexedit/lib/controller/keditor.h +++ b/khexedit/lib/controller/keditor.h @@ -37,7 +37,7 @@ class KEditor : public KController KEditor( KBufferCursor *BC, KHexEdit *HE, KController *P ); public: // API - virtual bool handleKeyPress( QKeyEvent *KeyEvent ); + virtual bool handleKeyPress( TQKeyEvent *KeyEvent ); protected: /** executes keyboard Action \a Action. This is normally called by a key event handler. */ diff --git a/khexedit/lib/controller/knavigator.cpp b/khexedit/lib/controller/knavigator.cpp index 51c8048..d865d12 100644 --- a/khexedit/lib/controller/knavigator.cpp +++ b/khexedit/lib/controller/knavigator.cpp @@ -17,7 +17,7 @@ // qt specific -#include <qevent.h> +#include <tqevent.h> // lib specific #include "kdatabuffer.h" #include "kbufferranges.h" @@ -34,7 +34,7 @@ KNavigator::KNavigator( KHexEdit* HE, KController *P ) { } -bool KNavigator::handleKeyPress( QKeyEvent *KeyEvent ) +bool KNavigator::handleKeyPress( TQKeyEvent *KeyEvent ) { bool KeyUsed = true; diff --git a/khexedit/lib/controller/knavigator.h b/khexedit/lib/controller/knavigator.h index 4615419..c20cd84 100644 --- a/khexedit/lib/controller/knavigator.h +++ b/khexedit/lib/controller/knavigator.h @@ -34,7 +34,7 @@ class KNavigator : public KController KNavigator( KHexEdit *HE, KController *P ); public: // KEditor API - virtual bool handleKeyPress( QKeyEvent *KeyEvent ); + virtual bool handleKeyPress( TQKeyEvent *KeyEvent ); protected: /** moves the cursor according to the action, handles all drawing */ diff --git a/khexedit/lib/controller/ktabcontroller.cpp b/khexedit/lib/controller/ktabcontroller.cpp index 76c3051..0531b2c 100644 --- a/khexedit/lib/controller/ktabcontroller.cpp +++ b/khexedit/lib/controller/ktabcontroller.cpp @@ -16,7 +16,7 @@ // qt specific -#include <qevent.h> +#include <tqevent.h> // lib specific #include "kvaluecolumn.h" #include "kcharcolumn.h" @@ -33,7 +33,7 @@ KTabController::KTabController( KHexEdit* HE, KController *P ) } -bool KTabController::handleKeyPress( QKeyEvent *KeyEvent ) +bool KTabController::handleKeyPress( TQKeyEvent *KeyEvent ) { bool KeyUsed = false; diff --git a/khexedit/lib/controller/ktabcontroller.h b/khexedit/lib/controller/ktabcontroller.h index e1898b4..a17d55d 100644 --- a/khexedit/lib/controller/ktabcontroller.h +++ b/khexedit/lib/controller/ktabcontroller.h @@ -32,7 +32,7 @@ class KTabController : public KController KTabController( KHexEdit *HE, KController *P ); public: // API - virtual bool handleKeyPress( QKeyEvent *KeyEvent ); + virtual bool handleKeyPress( TQKeyEvent *KeyEvent ); public: bool tabChangesFocus() const; diff --git a/khexedit/lib/controller/kvalueeditor.cpp b/khexedit/lib/controller/kvalueeditor.cpp index ebfb589..3bf4c9b 100644 --- a/khexedit/lib/controller/kvalueeditor.cpp +++ b/khexedit/lib/controller/kvalueeditor.cpp @@ -16,7 +16,7 @@ // qt specific -#include <qevent.h> +#include <tqevent.h> // lib specific #include "kvaluecolumn.h" #include "kbufferranges.h" @@ -36,7 +36,7 @@ KValueEditor::KValueEditor( KValueColumn *VC, KBufferCursor *BC, KHexEdit* HE, K } -bool KValueEditor::handleKeyPress( QKeyEvent *KeyEvent ) +bool KValueEditor::handleKeyPress( TQKeyEvent *KeyEvent ) { bool KeyUsed = true; @@ -79,7 +79,7 @@ bool KValueEditor::handleKeyPress( QKeyEvent *KeyEvent ) if( KeyEvent->text().length() > 0 && ( !(KeyEvent->state()&( Qt::ControlButton | Qt::AltButton | Qt::MetaButton )) ) ) { - QChar C = KeyEvent->text()[0]; + TQChar C = KeyEvent->text()[0]; // no usable char? if( !C.isLetterOrNumber() ) { diff --git a/khexedit/lib/controller/kvalueeditor.h b/khexedit/lib/controller/kvalueeditor.h index 496bcde..4656c36 100644 --- a/khexedit/lib/controller/kvalueeditor.h +++ b/khexedit/lib/controller/kvalueeditor.h @@ -39,7 +39,7 @@ class KValueEditor: public KEditor virtual ~KValueEditor(); public: // KEditor API - virtual bool handleKeyPress( QKeyEvent *KeyEvent ); + virtual bool handleKeyPress( TQKeyEvent *KeyEvent ); public: void reset(); @@ -62,7 +62,7 @@ class KValueEditor: public KEditor /** stores the old byte value */ unsigned char OldValue; /** buffer with the */ - QString ByteBuffer; + TQString ByteBuffer; }; inline KValueEditor::~KValueEditor() {} diff --git a/khexedit/lib/helper.h b/khexedit/lib/helper.h index 600ac5b..5f2b009 100644 --- a/khexedit/lib/helper.h +++ b/khexedit/lib/helper.h @@ -18,12 +18,12 @@ #define KHEXEDIT_HELPER // qt specific -#include <qcolor.h> +#include <tqcolor.h> // lib specific #include <khechar.h> // temporary solution until syntax highlighting is implemented -static inline QColor colorForChar( const KHE::KHEChar Byte ) +static inline TQColor colorForChar( const KHE::KHEChar Byte ) { return Byte.isUndefined() ? Qt::yellow : Byte.isPunct() ? Qt::red : Byte.isPrint() ? Qt::black : Qt::blue; } diff --git a/khexedit/lib/kbigbuffer.cpp b/khexedit/lib/kbigbuffer.cpp index 8505ef7..99925da 100644 --- a/khexedit/lib/kbigbuffer.cpp +++ b/khexedit/lib/kbigbuffer.cpp @@ -102,7 +102,7 @@ int KBigBuffer::rfind( const char*, int /*Length*/, int /*Pos*/ ) const { return -bool KBigBuffer::open( const QString& FileName ) +bool KBigBuffer::open( const TQString& FileName ) { // clear old data if( isOpen() && !close() ) // only occurs if close somehow fails. diff --git a/khexedit/lib/kbigbuffer.h b/khexedit/lib/kbigbuffer.h index 138e64b..63e6ec4 100644 --- a/khexedit/lib/kbigbuffer.h +++ b/khexedit/lib/kbigbuffer.h @@ -19,8 +19,8 @@ #define KHE_KBIGBUFFER_H // qt specific -#include <qvaluevector.h> -#include <qfile.h> +#include <tqvaluevector.h> +#include <tqfile.h> // lib specific #include "kdatabuffer.h" #include "khexedit_export.h" @@ -35,7 +35,7 @@ namespace KHE { class KHEXEDIT_EXPORT KBigBuffer : public KDataBuffer { - typedef QValueVector<char *> KPageOfChar; + typedef TQValueVector<char *> KPageOfChar; public: /** default is only 50*4k = 200k memory image */ @@ -63,12 +63,12 @@ class KHEXEDIT_EXPORT KBigBuffer : public KDataBuffer virtual int find( const char*KeyData, int Length, KSection Section ) const; virtual int rfind( const char*, int Length, int Pos = -1 ) const; -/* virtual int find( const QString &expr, bool cs, bool wo, bool forward = true, int *index = 0 ); */ +/* virtual int find( const TQString &expr, bool cs, bool wo, bool forward = true, int *index = 0 ); */ public: void setReadOnly( bool RO = true ); bool isOpen() const; - bool open (const QString& filename ); + bool open (const TQString& filename ); bool close(); protected: @@ -78,7 +78,7 @@ class KHEXEDIT_EXPORT KBigBuffer : public KDataBuffer protected: /** */ - mutable QFile File; + mutable TQFile File; /** */ bool ReadOnly:1; bool IsOpen:1; diff --git a/khexedit/lib/kbordercoltextexport.cpp b/khexedit/lib/kbordercoltextexport.cpp index d46490f..b60f249 100644 --- a/khexedit/lib/kbordercoltextexport.cpp +++ b/khexedit/lib/kbordercoltextexport.cpp @@ -16,7 +16,7 @@ // qt specific -#include <qstring.h> +#include <tqstring.h> // lib specific #include "kbordercoltextexport.h" @@ -31,17 +31,17 @@ int KBorderColTextExport::charsPerLine() const return BorderColumnTEWidth; } -void KBorderColTextExport::printFirstLine( QString &T, int /*Line*/ ) const +void KBorderColTextExport::printFirstLine( TQString &T, int /*Line*/ ) const { print( T ); } -void KBorderColTextExport::printNextLine( QString &T ) const +void KBorderColTextExport::printNextLine( TQString &T ) const { print( T ); } -void KBorderColTextExport::print( QString &T ) const +void KBorderColTextExport::print( TQString &T ) const { T.append( " | " ); } diff --git a/khexedit/lib/kbordercoltextexport.h b/khexedit/lib/kbordercoltextexport.h index 4103f0b..0fe6c5c 100644 --- a/khexedit/lib/kbordercoltextexport.h +++ b/khexedit/lib/kbordercoltextexport.h @@ -26,13 +26,13 @@ namespace KHE class KBorderColTextExport : public KColTextExport { public: // API - void printFirstLine( QString &T, int Line ) const; - void printNextLine( QString &T) const; + void printFirstLine( TQString &T, int Line ) const; + void printNextLine( TQString &T) const; /** tells how much chars per line are needed */ int charsPerLine() const ; protected: - void print( QString &T ) const; + void print( TQString &T ) const; }; } diff --git a/khexedit/lib/kbordercolumn.cpp b/khexedit/lib/kbordercolumn.cpp index c590246..d23bfea 100644 --- a/khexedit/lib/kbordercolumn.cpp +++ b/khexedit/lib/kbordercolumn.cpp @@ -16,8 +16,8 @@ // qt specific -#include <qpainter.h> -#include <qstyle.h> +#include <tqpainter.h> +#include <tqstyle.h> // lib specific #include "kcolumnsview.h" #include "kbordercolumn.h" @@ -41,7 +41,7 @@ KBorderColumn::~KBorderColumn() } -void KBorderColumn::paintLine( QPainter *P ) +void KBorderColumn::paintLine( TQPainter *P ) { if( LineHeight > 0 ) { @@ -49,7 +49,7 @@ void KBorderColumn::paintLine( QPainter *P ) if( Middle ) { - int GridColor = View->style().styleHint( QStyle::SH_Table_GridLineColor, View ); + int GridColor = View->style().styleHint( TQStyle::SH_Table_GridLineColor, View ); P->setPen( GridColor != -1 ? (QRgb)GridColor : View->colorGroup().mid() ); P->drawLine( LineX, 0, LineX, LineHeight-1 ) ; } @@ -57,25 +57,25 @@ void KBorderColumn::paintLine( QPainter *P ) } -void KBorderColumn::paintFirstLine( QPainter *P, KPixelXs , int ) +void KBorderColumn::paintFirstLine( TQPainter *P, KPixelXs , int ) { paintLine( P ); } -void KBorderColumn::paintNextLine( QPainter *P ) +void KBorderColumn::paintNextLine( TQPainter *P ) { paintLine( P ); } -void KBorderColumn::paintEmptyColumn( QPainter *P, KPixelXs Xs, KPixelYs Ys ) +void KBorderColumn::paintEmptyColumn( TQPainter *P, KPixelXs Xs, KPixelYs Ys ) { KColumn::paintEmptyColumn( P,Xs,Ys ); KPixelX LX = x() + LineX; if( Middle && Xs.includes(LX) ) { - int GridColor = View->style().styleHint( QStyle::SH_Table_GridLineColor, View ); + int GridColor = View->style().styleHint( TQStyle::SH_Table_GridLineColor, View ); P->setPen( GridColor != -1 ? (QRgb)GridColor : View->colorGroup().mid() ); P->drawLine( LX, Ys.start(), LX, Ys.end() ) ; } diff --git a/khexedit/lib/kbordercolumn.h b/khexedit/lib/kbordercolumn.h index 0a72c05..06446f2 100644 --- a/khexedit/lib/kbordercolumn.h +++ b/khexedit/lib/kbordercolumn.h @@ -35,12 +35,12 @@ class KBorderColumn : public KColumn ~KBorderColumn(); public: // KColumn-API - virtual void paintFirstLine( QPainter *P, KPixelXs Xs, int FirstLine ); - virtual void paintNextLine( QPainter *P ); - virtual void paintEmptyColumn( QPainter *P, KPixelXs Xs, KPixelYs Ys ); + virtual void paintFirstLine( TQPainter *P, KPixelXs Xs, int FirstLine ); + virtual void paintNextLine( TQPainter *P ); + virtual void paintEmptyColumn( TQPainter *P, KPixelXs Xs, KPixelYs Ys ); protected: - virtual void paintLine( QPainter *P ); + virtual void paintLine( TQPainter *P ); protected: /** true if we are between two columns and should show a line */ diff --git a/khexedit/lib/kbuffercoltextexport.cpp b/khexedit/lib/kbuffercoltextexport.cpp index a4ee91f..142504c 100644 --- a/khexedit/lib/kbuffercoltextexport.cpp +++ b/khexedit/lib/kbuffercoltextexport.cpp @@ -28,9 +28,9 @@ using namespace KHE; static const int DefaultTEByteSpacingWidth = 1; static const int TEGroupSpacingWidth = 3; -QString KBufferColTextExport::whiteSpace( uint s ) +TQString KBufferColTextExport::whiteSpace( uint s ) { - return QString().fill( ' ', s ); + return TQString().fill( ' ', s ); } KBufferColTextExport::KBufferColTextExport( const KBufferColumn* BufferColumn, const char *D, @@ -86,7 +86,7 @@ int KBufferColTextExport::charsPerLine() const } -void KBufferColTextExport::printFirstLine( QString &T, int Line ) const +void KBufferColTextExport::printFirstLine( TQString &T, int Line ) const { PrintLine = Line; PrintData = Data; @@ -94,13 +94,13 @@ void KBufferColTextExport::printFirstLine( QString &T, int Line ) const } -void KBufferColTextExport::printNextLine( QString &T ) const +void KBufferColTextExport::printNextLine( TQString &T ) const { print( T ); } -void KBufferColTextExport::print( QString &T ) const +void KBufferColTextExport::print( TQString &T ) const { T.append( whiteSpace(NoOfCharsPerLine) ); ++PrintLine; diff --git a/khexedit/lib/kbuffercoltextexport.h b/khexedit/lib/kbuffercoltextexport.h index 6cb161d..d26b21c 100644 --- a/khexedit/lib/kbuffercoltextexport.h +++ b/khexedit/lib/kbuffercoltextexport.h @@ -19,7 +19,7 @@ #define KHE_KBUFFERCOLTEXTEXPORT_H // qt specific -#include <qstring.h> +#include <tqstring.h> // lib specific #include "kcoltextexport.h" #include "kcoordrange.h" @@ -38,18 +38,18 @@ class KBufferColTextExport : public KColTextExport virtual ~KBufferColTextExport(); public: // API - void printFirstLine( QString &T, int Line ) const; - void printNextLine( QString &T ) const; + void printFirstLine( TQString &T, int Line ) const; + void printNextLine( TQString &T ) const; /** tells how much chars per line are needed */ int charsPerLine() const; protected: // API to be reimplemented by subclasses - virtual void print( QString &T ) const; + virtual void print( TQString &T ) const; protected: - static QString whiteSpace( uint s ); + static TQString whiteSpace( uint s ); protected: const char *Data; diff --git a/khexedit/lib/kbuffercolumn.cpp b/khexedit/lib/kbuffercolumn.cpp index 4291e00..d4f58d9 100644 --- a/khexedit/lib/kbuffercolumn.cpp +++ b/khexedit/lib/kbuffercolumn.cpp @@ -18,7 +18,7 @@ //#include <kdebug.h> // qt specific -#include <qpainter.h> +#include <tqpainter.h> // lib specific #include "kcolumnsview.h" #include "kbuffercursor.h" @@ -362,7 +362,7 @@ void KBufferColumn::preparePainting( KPixelXs Xs ) } -void KBufferColumn::paintFirstLine( QPainter *P, KPixelXs Xs, int FirstLine ) +void KBufferColumn::paintFirstLine( TQPainter *P, KPixelXs Xs, int FirstLine ) { preparePainting( Xs ); @@ -375,14 +375,14 @@ void KBufferColumn::paintFirstLine( QPainter *P, KPixelXs Xs, int FirstLine ) } -void KBufferColumn::paintNextLine( QPainter *P ) +void KBufferColumn::paintNextLine( TQPainter *P ) { // paintPositions( P, PaintLine++, PaintPositions ); paintLine( P, PaintLine++ ); } -void KBufferColumn::paintLine( QPainter *P, int Line ) // TODO: could be removed??? +void KBufferColumn::paintLine( TQPainter *P, int Line ) // TODO: could be removed??? { // kdDebug(1501) << "paintLine line: "<<Line<<" Start: "<<PaintPositions.start()<<" End: "<<PaintPositions.end() << "\n"; // no bytes to paint? @@ -393,9 +393,9 @@ void KBufferColumn::paintLine( QPainter *P, int Line ) // TODO: could be removed } -void KBufferColumn::paintPositions( QPainter *P, int Line, KSection Pos ) +void KBufferColumn::paintPositions( TQPainter *P, int Line, KSection Pos ) { - const QColorGroup &CG = View->colorGroup(); + const TQColorGroup &CG = View->colorGroup(); // clear background unsigned int BlankFlag = (Pos.start()!=0?StartsBefore:0) | (Pos.end()!=LastPos?EndsLater:0); @@ -481,7 +481,7 @@ void KBufferColumn::paintPositions( QPainter *P, int Line, KSection Pos ) } -void KBufferColumn::paintPlain( QPainter *P, KSection Positions, int Index ) +void KBufferColumn::paintPlain( TQPainter *P, KSection Positions, int Index ) { // paint all the bytes affected for( int p=Positions.start(); p<=Positions.end(); ++p,++Index ) @@ -499,13 +499,13 @@ void KBufferColumn::paintPlain( QPainter *P, KSection Positions, int Index ) } -void KBufferColumn::paintSelection( QPainter *P, KSection Positions, int Index, int Flag ) +void KBufferColumn::paintSelection( TQPainter *P, KSection Positions, int Index, int Flag ) { - const QColorGroup &CG = View->colorGroup(); + const TQColorGroup &CG = View->colorGroup(); paintRange( P, CG.highlight(), Positions, Flag ); - const QColor &HTC = CG.highlightedText(); + const TQColor &HTC = CG.highlightedText(); // paint all the bytes affected for( int p=Positions.start(); p<=Positions.end(); ++p,++Index ) { @@ -522,13 +522,13 @@ void KBufferColumn::paintSelection( QPainter *P, KSection Positions, int Index, } -void KBufferColumn::paintMarking( QPainter *P, KSection Positions, int Index, int Flag ) +void KBufferColumn::paintMarking( TQPainter *P, KSection Positions, int Index, int Flag ) { - const QColorGroup &CG = View->colorGroup(); + const TQColorGroup &CG = View->colorGroup(); paintRange( P, CG.text(), Positions, Flag ); - const QColor &BC = CG.base(); + const TQColor &BC = CG.base(); // paint all the bytes affected for( int p=Positions.start(); p<=Positions.end(); ++p,++Index ) { @@ -546,7 +546,7 @@ void KBufferColumn::paintMarking( QPainter *P, KSection Positions, int Index, in // TODO: smarter calculation -void KBufferColumn::paintGrid( QPainter *P, KSection Range ) +void KBufferColumn::paintGrid( TQPainter *P, KSection Range ) { int st = 0; // counter for spacing triggering P->setPen( Qt::black ); @@ -567,23 +567,23 @@ void KBufferColumn::paintGrid( QPainter *P, KSection Range ) } -void KBufferColumn::paintRange( QPainter *P, const QColor &Color, KSection Positions, int Flag ) +void KBufferColumn::paintRange( TQPainter *P, const TQColor &Color, KSection Positions, int Flag ) { KPixelX RangeX = Flag & StartsBefore ? relRightXOfPos( Positions.start()-1 ) + 1 : relXOfPos( Positions.start() ); KPixelX RangeW = (Flag & EndsLater ? relXOfPos( Positions.end()+1 ): relRightXOfPos( Positions.end() ) + 1) - RangeX; - P->fillRect( RangeX,0,RangeW,LineHeight, QBrush(Color,Qt::SolidPattern) ); + P->fillRect( RangeX,0,RangeW,LineHeight, TQBrush(Color,Qt::SolidPattern) ); } -void KBufferColumn::paintByte( QPainter *P, int Index ) +void KBufferColumn::paintByte( TQPainter *P, int Index ) { char Byte = ( Index > -1 ) ? Buffer->datum( Index ) : EmptyByte; KHEChar B = Codec->decode( Byte ); - const QColorGroup &CG = View->colorGroup(); - QColor Color = CG.text(); - QBrush Brush( CG.base(), Qt::SolidPattern ); + const TQColorGroup &CG = View->colorGroup(); + TQColor Color = CG.text(); + TQBrush Brush( CG.base(), Qt::SolidPattern ); if( Index > -1 ) { @@ -611,7 +611,7 @@ void KBufferColumn::paintByte( QPainter *P, int Index ) } -void KBufferColumn::paintFramedByte( QPainter *P, int Index, KFrameStyle FrameStyle ) +void KBufferColumn::paintFramedByte( TQPainter *P, int Index, KFrameStyle FrameStyle ) { paintByte( P, Index ); char Byte = ( Index > -1 ) ? Buffer->datum( Index ) : EmptyByte; @@ -627,15 +627,15 @@ void KBufferColumn::paintFramedByte( QPainter *P, int Index, KFrameStyle FrameSt } -void KBufferColumn::paintCursor( QPainter *P, int Index ) +void KBufferColumn::paintCursor( TQPainter *P, int Index ) { char Byte = ( Index > -1 ) ? Buffer->datum( Index ) : EmptyByte; KHEChar B = Codec->decode( Byte ); - P->fillRect( 0, 0, ByteWidth, LineHeight, QBrush(colorForChar(B),Qt::SolidPattern) ); + P->fillRect( 0, 0, ByteWidth, LineHeight, TQBrush(colorForChar(B),Qt::SolidPattern) ); } -void KBufferColumn::drawByte( QPainter *P, char /*Byte*/, KHEChar B, const QColor &Color ) const +void KBufferColumn::drawByte( TQPainter *P, char /*Byte*/, KHEChar B, const TQColor &Color ) const { P->setPen( Color ); P->drawText( 0, DigitBaseLine, B ); diff --git a/khexedit/lib/kbuffercolumn.h b/khexedit/lib/kbuffercolumn.h index 76ed8bc..37a495a 100644 --- a/khexedit/lib/kbuffercolumn.h +++ b/khexedit/lib/kbuffercolumn.h @@ -55,28 +55,28 @@ class KBufferColumn : public KColumn public: // KColumn-API - virtual void paintFirstLine( QPainter *P, KPixelXs Xs, int FirstLine ); - virtual void paintNextLine( QPainter *P ); + virtual void paintFirstLine( TQPainter *P, KPixelXs Xs, int FirstLine ); + virtual void paintNextLine( TQPainter *P ); public: void preparePainting( KPixelXs Xs ); public: - void paintLine( QPainter *P, int Line ); - void paintPositions( QPainter *P, int Line, KSection Positions ); + void paintLine( TQPainter *P, int Line ); + void paintPositions( TQPainter *P, int Line, KSection Positions ); /** paints a cursor based on the type of the byte. * @param Index Index of the byte to paint the cursor for. If -1 a space is used as char. */ - void paintCursor( QPainter *P, int Index ); + void paintCursor( TQPainter *P, int Index ); /** paints the byte with background. * @param Index Index of the byte to paint. If -1 only the background is painted. */ - void paintByte( QPainter *P, int Index ); + void paintByte( TQPainter *P, int Index ); /** paints the byte with background and a frame around. * @param Index Index of the byte to paint the frame for. If -1 a space is used as char. * @param Style the style of the framing */ - void paintFramedByte( QPainter *P, int Index, KFrameStyle Style ); + void paintFramedByte( TQPainter *P, int Index, KFrameStyle Style ); public: // modification access @@ -165,17 +165,17 @@ class KBufferColumn : public KColumn protected: // API to be refined /** default implementation simply prints the byte as ASCII */ - virtual void drawByte( QPainter *P, char Byte, KHEChar B, const QColor &Color ) const; + virtual void drawByte( TQPainter *P, char Byte, KHEChar B, const TQColor &Color ) const; /** default implementation sets byte width to one digit width */ virtual void recalcByteWidth(); protected: - void paintGrid( QPainter *P, KSection Range ); - void paintPlain( QPainter *P, KSection Positions, int Index ); - void paintSelection( QPainter *P, KSection Positions, int Index, int Flag ); - void paintMarking( QPainter *P, KSection Positions, int Index, int Flag ); - void paintRange( QPainter *P, const QColor &Color, KSection Positions, int Flag ); + void paintGrid( TQPainter *P, KSection Range ); + void paintPlain( TQPainter *P, KSection Positions, int Index ); + void paintSelection( TQPainter *P, KSection Positions, int Index, int Flag ); + void paintMarking( TQPainter *P, KSection Positions, int Index, int Flag ); + void paintRange( TQPainter *P, const TQColor &Color, KSection Positions, int Flag ); bool isSelected( KSection Range, KSection *Selection, unsigned int *Flag ) const; bool isMarked( KSection Range, KSection *Marking, unsigned int *Flag ) const; diff --git a/khexedit/lib/kbufferdrag.cpp b/khexedit/lib/kbufferdrag.cpp index 199982c..3fb3cff 100644 --- a/khexedit/lib/kbufferdrag.cpp +++ b/khexedit/lib/kbufferdrag.cpp @@ -16,8 +16,8 @@ // qt specific -#include <qcstring.h> -#include <qtextcodec.h> +#include <tqcstring.h> +#include <tqtextcodec.h> // kde specific #include <kglobal.h> #include <klocale.h> @@ -43,11 +43,11 @@ static const char TextPlainLocalStub[] = "text/plain;charset="; // creates the name for the local text/plain static const char *localTextPlain() { - static QCString TextPlainLocal; + static TQCString TextPlainLocal; if( TextPlainLocal.isNull() ) { - TextPlainLocal = QCString(KGlobal::locale()->encoding()).lower(); + TextPlainLocal = TQCString(KGlobal::locale()->encoding()).lower(); // remove the whitespaces int s; while( (s=TextPlainLocal.find(' ')) >= 0 ) @@ -60,18 +60,18 @@ static const char *localTextPlain() } // tries to create a codec by the given charset description -static QTextCodec* codecForCharset( const QCString& Desc ) +static TQTextCodec* codecForCharset( const TQCString& Desc ) { int i = Desc.find( "charset=" ); if( i >= 0 ) { - QCString CharSetName = Desc.mid( i+8 ); + TQCString CharSetName = Desc.mid( i+8 ); // remove any further attributes if( (i=CharSetName.find( ';' )) >= 0 ) CharSetName = CharSetName.left( i ); // try to find codec - return QTextCodec::codecForName( CharSetName ); + return TQTextCodec::codecForName( CharSetName ); } // no charset=, use locale return KGlobal::locale()->codecForEncoding(); @@ -79,11 +79,11 @@ static QTextCodec* codecForCharset( const QCString& Desc ) -KBufferDrag::KBufferDrag( const QByteArray &D, KCoordRange Range, +KBufferDrag::KBufferDrag( const TQByteArray &D, KCoordRange Range, const KOffsetColumn *OC, const KValueColumn *HC, const KCharColumn *TC, - QChar SC, QChar UC, const QString &CN, - QWidget *Source, const char *Name ) - :QDragObject( Source, Name ), + TQChar SC, TQChar UC, const TQString &CN, + TQWidget *Source, const char *Name ) + :TQDragObject( Source, Name ), CoordRange( Range ), NoOfCol( 0 ), SubstituteChar( SC ), @@ -119,7 +119,7 @@ KBufferDrag::~KBufferDrag() -void KBufferDrag::setData( const QByteArray &D ) +void KBufferDrag::setData( const TQByteArray &D ) { Data = D; } @@ -135,7 +135,7 @@ const char *KBufferDrag::format( int i ) const } -QByteArray KBufferDrag::encodedData( const char *Format ) const +TQByteArray KBufferDrag::encodedData( const char *Format ) const { if( Format != 0 ) { @@ -146,19 +146,19 @@ QByteArray KBufferDrag::encodedData( const char *Format ) const // plain text wanted? if( qstrncmp(Format,TextPlain,10) == 0 ) { - QCString Output; - QTextCodec *TextCodec = codecForCharset( QCString(Format).lower() ); + TQCString Output; + TQTextCodec *TextCodec = codecForCharset( TQCString(Format).lower() ); if( TextCodec == 0 ) return Output; - QString Text; + TQString Text; // plain copy? if( NoOfCol == 0 ) { // duplicate the data and substitute all non-printable items with a space KCharCodec *CharCodec = KCharCodec::createCodec( CodecName ); - static const QChar Tab('\t'); - static const QChar Return('\n'); + static const TQChar Tab('\t'); + static const TQChar Return('\n'); uint Size = Data.size(); Text.setLength( Size ); @@ -201,20 +201,20 @@ QByteArray KBufferDrag::encodedData( const char *Format ) const // fix end //if( TextCodec->mibEnum() != 1000 ) //{ - // Don't include NUL in size (QCString::resize() adds NUL) - // ((QByteArray&)Output).resize( Output.length() ); + // Don't include NUL in size (TQCString::resize() adds NUL) + // ((TQByteArray&)Output).resize( Output.length() ); //} return Output; } } // return empty dummy - return QByteArray(); + return TQByteArray(); } -bool KBufferDrag::canDecode( const QMimeSource* Source ) +bool KBufferDrag::canDecode( const TQMimeSource* Source ) { bool c =( Source->provides(OctetStream) /*|| Source->provides(TextPlain)*/ ); return c; @@ -222,7 +222,7 @@ bool KBufferDrag::canDecode( const QMimeSource* Source ) } -bool KBufferDrag::decode( const QMimeSource* Source, QByteArray &Dest ) +bool KBufferDrag::decode( const TQMimeSource* Source, TQByteArray &Dest ) { // Dest = Source->encodedData( MediaString ); // return Dest.size() != 0; diff --git a/khexedit/lib/kbufferdrag.h b/khexedit/lib/kbufferdrag.h index 86c498f..d04bca6 100644 --- a/khexedit/lib/kbufferdrag.h +++ b/khexedit/lib/kbufferdrag.h @@ -19,7 +19,7 @@ #define KHE_KBUFFERDRAG_H // qt specific -#include <qdragobject.h> +#include <tqdragobject.h> // lib specific #include "khe.h" #include "kcoordrange.h" @@ -43,32 +43,32 @@ class KBufferDrag : public QDragObject public: // TODO: make this call somewhat more generic - KBufferDrag( const QByteArray &, KCoordRange Range, + KBufferDrag( const TQByteArray &, KCoordRange Range, const KOffsetColumn *OC, const KValueColumn *HC, const KCharColumn *TC, - QChar SC, QChar UC, const QString &CN, - QWidget *Source = 0, const char *Name = 0 ); + TQChar SC, TQChar UC, const TQString &CN, + TQWidget *Source = 0, const char *Name = 0 ); ~KBufferDrag(); - public: // QDragObject API + public: // TQDragObject API virtual const char *format( int i ) const; - virtual QByteArray encodedData( const char* ) const; + virtual TQByteArray encodedData( const char* ) const; public: - virtual void setData( const QByteArray &); + virtual void setData( const TQByteArray &); public: - static bool canDecode( const QMimeSource* Source ); - static bool decode( const QMimeSource* Source, QByteArray &Dest ); + static bool canDecode( const TQMimeSource* Source ); + static bool decode( const TQMimeSource* Source, TQByteArray &Dest ); protected: - QByteArray Data; + TQByteArray Data; KCoordRange CoordRange; /** collection of all the columns. All columns will be autodeleted. */ KColTextExportPtr Columns[5]; uint NoOfCol; - QChar SubstituteChar; - QChar UndefinedChar; - const QString &CodecName; + TQChar SubstituteChar; + TQChar UndefinedChar; + const TQString &CodecName; }; } diff --git a/khexedit/lib/kbytecodec.h b/khexedit/lib/kbytecodec.h index fc4e1b3..f966ac5 100644 --- a/khexedit/lib/kbytecodec.h +++ b/khexedit/lib/kbytecodec.h @@ -19,7 +19,7 @@ #define KHE_KBYTECODEC_H #include "khe.h" -#include <qstring.h> +#include <tqstring.h> namespace KHE { @@ -49,9 +49,9 @@ class KByteCodec virtual unsigned char digitsFilledLimit() const = 0; /** encodes the Char and writes the result to */ - virtual void encode( QString &Digits, unsigned int Pos, const unsigned char Char ) const = 0; + virtual void encode( TQString &Digits, unsigned int Pos, const unsigned char Char ) const = 0; /** */ - virtual void encodeShort( QString &Digits, unsigned int Pos, const unsigned char Char ) const = 0; + virtual void encodeShort( TQString &Digits, unsigned int Pos, const unsigned char Char ) const = 0; /** */ virtual bool appendDigit( unsigned char *Byte, const unsigned char Digit ) const = 0; @@ -65,7 +65,7 @@ class KByteCodec public: /** */ - uint decode( unsigned char *Char, const QString &Digits, uint Pos ) const; + uint decode( unsigned char *Char, const TQString &Digits, uint Pos ) const; }; } diff --git a/khexedit/lib/kbytesedit.cpp b/khexedit/lib/kbytesedit.cpp index 40b57a1..3eb49bd 100644 --- a/khexedit/lib/kbytesedit.cpp +++ b/khexedit/lib/kbytesedit.cpp @@ -24,14 +24,14 @@ using namespace KHE; -KBytesEdit::KBytesEdit( char *D, int DS_, int RS_, bool KM, QWidget *Parent, const char *Name, WFlags F ) +KBytesEdit::KBytesEdit( char *D, int DS_, int RS_, bool KM, TQWidget *Parent, const char *Name, WFlags F ) : KHexEdit( 0L, Parent, Name, F ), AutoDelete( false ) { setData( D, DS_, RS_, KM ); } -KBytesEdit::KBytesEdit( char *D, int DS_, QWidget *Parent, const char *Name, WFlags F ) +KBytesEdit::KBytesEdit( char *D, int DS_, TQWidget *Parent, const char *Name, WFlags F ) : KHexEdit( 0L, Parent, Name, F ), AutoDelete( false ) { @@ -39,7 +39,7 @@ KBytesEdit::KBytesEdit( char *D, int DS_, QWidget *Parent, const char *Name, WFl } -KBytesEdit::KBytesEdit( QWidget *Parent, const char *Name, WFlags F ) +KBytesEdit::KBytesEdit( TQWidget *Parent, const char *Name, WFlags F ) : KHexEdit( 0L, Parent, Name, F ), AutoDelete( false ) { diff --git a/khexedit/lib/kbytesedit.h b/khexedit/lib/kbytesedit.h index daf8b6e..e57d73a 100644 --- a/khexedit/lib/kbytesedit.h +++ b/khexedit/lib/kbytesedit.h @@ -73,7 +73,7 @@ class KHEXEDIT_EXPORT KBytesEdit : public KHexEdit * @param Name name for this widget * @param F flags */ - KBytesEdit( char *D, int DS_, int RS_, bool KM, QWidget *Parent = 0, const char *Name = 0, WFlags F = 0 ); + KBytesEdit( char *D, int DS_, int RS_, bool KM, TQWidget *Parent = 0, const char *Name = 0, WFlags F = 0 ); /** hands over to the editor a new byte array. * If there exists an old one and autodelete is set the old one gets deleted. * @param D pointer to memory @@ -81,7 +81,7 @@ class KHEXEDIT_EXPORT KBytesEdit : public KHexEdit * @param RS_ real size of the memory * @param KM keep the memory on resize (RS_ is the maximum size) */ - KBytesEdit( char *D, int DS_, QWidget *Parent = 0, const char *Name = 0, WFlags F = 0 ); + KBytesEdit( char *D, int DS_, TQWidget *Parent = 0, const char *Name = 0, WFlags F = 0 ); /** hands over to the editor a new byte array. * If there exists an old one and autodelete is set the old one gets deleted. * @param D pointer to memory @@ -89,7 +89,7 @@ class KHEXEDIT_EXPORT KBytesEdit : public KHexEdit * @param RS_ real size of the memory * @param KM keep the memory on resize (RS_ is the maximum size) */ - KBytesEdit( QWidget *Parent = 0, const char *Name = 0, WFlags F = 0 ); + KBytesEdit( TQWidget *Parent = 0, const char *Name = 0, WFlags F = 0 ); virtual ~KBytesEdit(); diff --git a/khexedit/lib/kcharcodec.h b/khexedit/lib/kcharcodec.h index 9d1b628..15d47aa 100644 --- a/khexedit/lib/kcharcodec.h +++ b/khexedit/lib/kcharcodec.h @@ -19,7 +19,7 @@ #define KHE_KCHARCODEC_H // qt specific -#include <qstringlist.h> +#include <tqstringlist.h> // lib specific #include "khe.h" #include "khechar.h" @@ -35,18 +35,18 @@ class KHEXEDIT_EXPORT KCharCodec /** */ static KCharCodec* createCodec( KEncoding E ); /** */ - static KCharCodec* createCodec( const QString &Name ); + static KCharCodec* createCodec( const TQString &Name ); - static const QStringList &codecNames(); + static const TQStringList &codecNames(); public: // API to be implemented virtual KHEChar decode( char Byte ) const = 0; - virtual bool encode( char *D, const QChar &C ) const = 0; - virtual const QString& name() const = 0; + virtual bool encode( char *D, const TQChar &C ) const = 0; + virtual const TQString& name() const = 0; protected: /** */ - static QStringList CodecNames; + static TQStringList CodecNames; }; } diff --git a/khexedit/lib/kcharcoltextexport.cpp b/khexedit/lib/kcharcoltextexport.cpp index bc4a60e..d53d187 100644 --- a/khexedit/lib/kcharcoltextexport.cpp +++ b/khexedit/lib/kcharcoltextexport.cpp @@ -24,7 +24,7 @@ using namespace KHE; -KCharColTextExport::KCharColTextExport( const KCharColumn* TC, const char *D, KCoordRange CR, const QString &CodecName ) +KCharColTextExport::KCharColTextExport( const KCharColumn* TC, const char *D, KCoordRange CR, const TQString &CodecName ) : KBufferColTextExport( TC, D, CR, 1 ), CharCodec( KCharCodec::createCodec(CodecName) ), SubstituteChar( TC->substituteChar() ), @@ -39,7 +39,7 @@ KCharColTextExport::~KCharColTextExport() } -void KCharColTextExport::print( QString &T ) const +void KCharColTextExport::print( TQString &T ) const { int p = 0; int pEnd = NoOfBytesPerLine; diff --git a/khexedit/lib/kcharcoltextexport.h b/khexedit/lib/kcharcoltextexport.h index 05a570c..7d9da2f 100644 --- a/khexedit/lib/kcharcoltextexport.h +++ b/khexedit/lib/kcharcoltextexport.h @@ -33,16 +33,16 @@ class KCharCodec; class KCharColTextExport : public KBufferColTextExport { public: - KCharColTextExport( const KCharColumn* BF, const char *D, KCoordRange CR, const QString &CodecName ); + KCharColTextExport( const KCharColumn* BF, const char *D, KCoordRange CR, const TQString &CodecName ); virtual ~KCharColTextExport(); protected: //API - virtual void print( QString &T ) const; + virtual void print( TQString &T ) const; protected: KCharCodec *CharCodec; - QChar SubstituteChar; - QChar UndefinedChar; + TQChar SubstituteChar; + TQChar UndefinedChar; }; } diff --git a/khexedit/lib/kcharcolumn.cpp b/khexedit/lib/kcharcolumn.cpp index 9ecbd5a..10105a0 100644 --- a/khexedit/lib/kcharcolumn.cpp +++ b/khexedit/lib/kcharcolumn.cpp @@ -18,7 +18,7 @@ // c specific #include <ctype.h> // qt specific -#include <qpainter.h> +#include <tqpainter.h> // kde specific #include <kcharsets.h> #include <klocale.h> @@ -33,8 +33,8 @@ using namespace KHE; static const bool DefaultShowUnprintable = false; -static const QChar DefaultSubstituteChar = (char)'.'; -static const QChar DefaultUndefinedChar = (char)'?'; +static const TQChar DefaultSubstituteChar = (char)'.'; +static const TQChar DefaultUndefinedChar = (char)'?'; KCharColumn::KCharColumn( KColumnsView *CV, KDataBuffer *B, KBufferLayout *L, KBufferRanges *R ) @@ -51,10 +51,10 @@ KCharColumn::~KCharColumn() { } -void KCharColumn::drawByte( QPainter *P, char /*Byte*/, KHEChar B, const QColor &Color ) const +void KCharColumn::drawByte( TQPainter *P, char /*Byte*/, KHEChar B, const TQColor &Color ) const { // make a drawable String out of it - QString BS( B.isUndefined() ? KHEChar(UndefinedChar) : ( !(ShowUnprintable || B.isPrint()) ? KHEChar(SubstituteChar) : B )); + TQString BS( B.isUndefined() ? KHEChar(UndefinedChar) : ( !(ShowUnprintable || B.isPrint()) ? KHEChar(SubstituteChar) : B )); P->setPen( Color ); P->drawText( 0, DigitBaseLine, BS ); diff --git a/khexedit/lib/kcharcolumn.h b/khexedit/lib/kcharcolumn.h index 1e875b0..e196cf9 100644 --- a/khexedit/lib/kcharcolumn.h +++ b/khexedit/lib/kcharcolumn.h @@ -19,7 +19,7 @@ #define KHE_KCHARCOLUMN_H // qt specific -#include <qstring.h> +#include <tqstring.h> // lib specific #include "kbuffercolumn.h" @@ -52,11 +52,11 @@ class KCharColumn : public KBufferColumn /** sets the substitute character for "unprintable" chars * returns true if there was a change */ - bool setSubstituteChar( QChar SC ); + bool setSubstituteChar( TQChar SC ); /** sets the undefined character for "undefined" chars * returns true if there was a change */ - bool setUndefinedChar( QChar UC ); + bool setUndefinedChar( TQChar UC ); public: // value access @@ -65,29 +65,29 @@ class KCharColumn : public KBufferColumn */ bool showUnprintable() const; /** returns the actually used substitute character for "unprintable" chars, default is '.' */ - QChar substituteChar() const; + TQChar substituteChar() const; /** returns the actually used undefined character for "undefined" chars, default is '?' */ - QChar undefinedChar() const; + TQChar undefinedChar() const; protected: // KBufferColumn API - virtual void drawByte( QPainter *P, char Byte, KHEChar B, const QColor &Color ) const; + virtual void drawByte( TQPainter *P, char Byte, KHEChar B, const TQColor &Color ) const; protected: /** */ bool ShowUnprintable; /** */ - QChar SubstituteChar; + TQChar SubstituteChar; /** */ - QChar UndefinedChar; + TQChar UndefinedChar; }; inline bool KCharColumn::showUnprintable() const { return ShowUnprintable; } -inline QChar KCharColumn::substituteChar() const { return SubstituteChar; } -inline QChar KCharColumn::undefinedChar() const { return UndefinedChar; } +inline TQChar KCharColumn::substituteChar() const { return SubstituteChar; } +inline TQChar KCharColumn::undefinedChar() const { return UndefinedChar; } -inline bool KCharColumn::setSubstituteChar( QChar SC ) +inline bool KCharColumn::setSubstituteChar( TQChar SC ) { if( SubstituteChar == SC ) return false; @@ -95,7 +95,7 @@ inline bool KCharColumn::setSubstituteChar( QChar SC ) return true; } -inline bool KCharColumn::setUndefinedChar( QChar UC ) +inline bool KCharColumn::setUndefinedChar( TQChar UC ) { if( UndefinedChar == UC ) return false; diff --git a/khexedit/lib/kcoltextexport.h b/khexedit/lib/kcoltextexport.h index d0b3918..0042bae 100644 --- a/khexedit/lib/kcoltextexport.h +++ b/khexedit/lib/kcoltextexport.h @@ -29,8 +29,8 @@ namespace KHE class KColTextExport { public: // API - virtual void printFirstLine( QString &T, int Line ) const = 0; - virtual void printNextLine( QString &T ) const = 0; + virtual void printFirstLine( TQString &T, int Line ) const = 0; + virtual void printNextLine( TQString &T ) const = 0; /** tells how much chars per line are needed */ virtual int charsPerLine() const = 0; }; diff --git a/khexedit/lib/kcolumn.cpp b/khexedit/lib/kcolumn.cpp index f9b0ce5..c23f935 100644 --- a/khexedit/lib/kcolumn.cpp +++ b/khexedit/lib/kcolumn.cpp @@ -16,7 +16,7 @@ // qt specific -#include <qpainter.h> +#include <tqpainter.h> // lib specific #include "kcolumnsview.h" #include "kcolumn.h" @@ -34,26 +34,26 @@ KColumn::KColumn( KColumnsView *V ) } -void KColumn::paintFirstLine( QPainter *P, KPixelXs, int /*FirstLine*/ ) +void KColumn::paintFirstLine( TQPainter *P, KPixelXs, int /*FirstLine*/ ) { paintBlankLine( P ); } -void KColumn::paintNextLine( QPainter *P ) +void KColumn::paintNextLine( TQPainter *P ) { paintBlankLine( P ); } -void KColumn::paintBlankLine( QPainter *P ) const +void KColumn::paintBlankLine( TQPainter *P ) const { if( LineHeight > 0 ) P->fillRect( 0,0,width(),LineHeight, View->backgroundBrush() ); } -void KColumn::paintEmptyColumn( QPainter *P, KPixelXs Xs, KPixelYs Ys ) +void KColumn::paintEmptyColumn( TQPainter *P, KPixelXs Xs, KPixelYs Ys ) { Xs.restrictTo( XSpan ); P->fillRect( Xs.start(), Ys.start(), Xs.width(), Ys.width(), View->backgroundBrush() ); diff --git a/khexedit/lib/kcolumn.h b/khexedit/lib/kcolumn.h index 37c3118..ea219c6 100644 --- a/khexedit/lib/kcolumn.h +++ b/khexedit/lib/kcolumn.h @@ -55,14 +55,14 @@ class KColumn * @param cw * @param FirstLine no of the first of the range of lines to paint */ - virtual void paintFirstLine( QPainter *P, KPixelXs Xs, int FirstLine ); + virtual void paintFirstLine( TQPainter *P, KPixelXs Xs, int FirstLine ); /** the actual painting call for a column's line. * The default implementation simply paints the background */ - virtual void paintNextLine( QPainter *P ); + virtual void paintNextLine( TQPainter *P ); /** */ - virtual void paintEmptyColumn( QPainter *P, KPixelXs Xs, KPixelYs Ys ); + virtual void paintEmptyColumn( TQPainter *P, KPixelXs Xs, KPixelYs Ys ); public: // modification access /** sets starting point of the column */ @@ -92,7 +92,7 @@ class KColumn /** sets width of the column */ void setWidth( KPixelX W ); /** */ - void paintBlankLine( QPainter *P ) const; + void paintBlankLine( TQPainter *P ) const; protected: // general column data /** pointer to the view */ diff --git a/khexedit/lib/kcolumnsview.cpp b/khexedit/lib/kcolumnsview.cpp index 1c93af8..c855b51 100644 --- a/khexedit/lib/kcolumnsview.cpp +++ b/khexedit/lib/kcolumnsview.cpp @@ -18,7 +18,7 @@ //#include <kdebug.h> // qt specific -#include <qpainter.h> +#include <tqpainter.h> // lib specific #include "kcolumn.h" #include "kcolumnsview.h" @@ -28,8 +28,8 @@ using namespace KHE; static bool DefaultHorizontalGrid = false; -KColumnsView::KColumnsView( /*bool R,*/ QWidget *Parent, const char *Name, WFlags Flags ) - : QScrollView( Parent, Name, Flags | WRepaintNoErase /*| WStaticContents*/ ), +KColumnsView::KColumnsView( /*bool R,*/ TQWidget *Parent, const char *Name, WFlags Flags ) + : TQScrollView( Parent, Name, Flags | WRepaintNoErase /*| WStaticContents*/ ), NoOfLines( 0 ), LineHeight( 0 ), TotalWidth( 0 ), @@ -136,13 +136,13 @@ void KColumnsView::repaintView() } -void KColumnsView::paintEmptyArea( QPainter *P, int cx ,int cy, int cw, int ch) +void KColumnsView::paintEmptyArea( TQPainter *P, int cx ,int cy, int cw, int ch) { P->fillRect( cx, cy, cw, ch, backgroundBrush() ); } -void KColumnsView::drawContents( QPainter *P, int cx, int cy, int cw, int ch ) +void KColumnsView::drawContents( TQPainter *P, int cx, int cy, int cw, int ch ) { //kdDebug(1501) << "drawContents(" << cx<<","<<cw<<"#"<<cy<<","<<ch<<")\n"; KPixelXs AffectedXs( cx, cw, true ); @@ -152,7 +152,7 @@ void KColumnsView::drawContents( QPainter *P, int cx, int cy, int cw, int ch ) KPixelYs AffectedYs( cy, ch, true ); // collect affected columns - QPtrList<KColumn> RedrawColumns; + TQPtrList<KColumn> RedrawColumns; for( KColumn *C=Columns.first(); C; C=Columns.next() ) if( C->isVisible() && C->overlaps(AffectedXs) ) RedrawColumns.append( C ); @@ -166,7 +166,7 @@ void KColumnsView::drawContents( QPainter *P, int cx, int cy, int cw, int ch ) if( AffectedLines.isValid() ) { - QPainter Paint; + TQPainter Paint; Paint.begin( &LineBuffer, this ); // starting painting with the first line @@ -231,6 +231,6 @@ void KColumnsView::drawContents( QPainter *P, int cx, int cy, int cw, int ch ) } // Implemented to get rid of a compiler warning -void KColumnsView::drawContents( QPainter * ) {} +void KColumnsView::drawContents( TQPainter * ) {} #include "kcolumnsview.moc" diff --git a/khexedit/lib/kcolumnsview.h b/khexedit/lib/kcolumnsview.h index aa3521d..372a6f5 100644 --- a/khexedit/lib/kcolumnsview.h +++ b/khexedit/lib/kcolumnsview.h @@ -19,10 +19,10 @@ #define KHE_KCOLUMNSVIEW_H // qt specific -#include <qptrlist.h> -#include <qwidget.h> -#include <qpixmap.h> -#include <qscrollview.h> +#include <tqptrlist.h> +#include <tqwidget.h> +#include <tqpixmap.h> +#include <tqscrollview.h> // lib specific #include "kadds.h" #include "ksection.h" // TODO: think about moving this out of the public API @@ -46,12 +46,12 @@ class KColumnsView : public QScrollView friend class KColumn; public: - KColumnsView( /*bool R = false,*/ QWidget *parent=0, const char *name=0, WFlags Flags=0 ); + KColumnsView( /*bool R = false,*/ TQWidget *parent=0, const char *name=0, WFlags Flags=0 ); virtual ~KColumnsView(); public: // drawing - virtual void paintEmptyArea( QPainter *p, int cx, int cy, int cw, int ch ); - virtual void drawContents( QPainter *p, int cx, int cy, int cw, int ch ); + virtual void paintEmptyArea( TQPainter *p, int cx, int cy, int cw, int ch ); + virtual void drawContents( TQPainter *p, int cx, int cy, int cw, int ch ); public: // data-wise sizes /** returns the number of all lines */ @@ -65,7 +65,7 @@ class KColumnsView : public QScrollView /** returns the height of each line */ KPixelY lineHeight() const; /** returns the size of all visible columns together */ - QSize totalViewSize() const; + TQSize totalViewSize() const; /** returns the width of all visible columns together */ KPixelX totalWidth() const; /** returns the height of all lines together */ @@ -116,12 +116,12 @@ class KColumnsView : public QScrollView private: /** hiding it*/ - void drawContents( QPainter* ); + void drawContents( TQPainter* ); protected: // calculated /** collection of all the columns. All columns will be autodeleted. */ - QPtrList<KColumn> Columns; + TQPtrList<KColumn> Columns; /** the number of lines which the column view has */ int NoOfLines; /** the height of each line in pixels */ @@ -135,7 +135,7 @@ class KColumnsView : public QScrollView // TODO: do we really want this? bool HorizontalGrid; /** Buffer where each line is drawn to before it is copied onto the screen */ - QPixmap LineBuffer; + TQPixmap LineBuffer; // bool Reversed; private: @@ -161,7 +161,7 @@ inline KSection KColumnsView::visibleLines( KPixelYs YPixels ) const inline KPixelY KColumnsView::totalHeight() const { return NoOfLines*LineHeight; } inline KPixelX KColumnsView::totalWidth() const { return TotalWidth; } -inline QSize KColumnsView::totalViewSize() const { return QSize( totalWidth(), totalHeight() ); } +inline TQSize KColumnsView::totalViewSize() const { return TQSize( totalWidth(), totalHeight() ); } } diff --git a/khexedit/lib/kcoordrangelist.h b/khexedit/lib/kcoordrangelist.h index 187ec7f..a4401f7 100644 --- a/khexedit/lib/kcoordrangelist.h +++ b/khexedit/lib/kcoordrangelist.h @@ -19,13 +19,13 @@ #define KHE_KCOORDRANGELIST_H // qt specific -#include <qvaluelist.h> +#include <tqvaluelist.h> // lib specific #include "kcoordrange.h" namespace KHE { -typedef QValueList<KCoordRange> KCoordRangeBasicList; +typedef TQValueList<KCoordRange> KCoordRangeBasicList; /** @author Friedrich W. H. Kossebau */ diff --git a/khexedit/lib/kcursor.h b/khexedit/lib/kcursor.h index 428c7ed..17b4371 100644 --- a/khexedit/lib/kcursor.h +++ b/khexedit/lib/kcursor.h @@ -19,7 +19,7 @@ #define KHE_KCURSOR_H -#include <qpixmap.h> +#include <tqpixmap.h> #include "kadds.h" @@ -42,23 +42,23 @@ class KCursor void setShape( KPixelX X, KPixelX W ); public: // access - const QPixmap &onPixmap() const; - const QPixmap &offPixmap() const; + const TQPixmap &onPixmap() const; + const TQPixmap &offPixmap() const; KPixelX cursorX() const; KPixelX cursorW() const; protected: - QPixmap OnPixmap; - QPixmap OffPixmap; + TQPixmap OnPixmap; + TQPixmap OffPixmap; KPixelX CursorX; KPixelX CursorW; }; -inline const QPixmap &KCursor::onPixmap() const { return OnPixmap; } -inline const QPixmap &KCursor::offPixmap() const { return OffPixmap; } +inline const TQPixmap &KCursor::onPixmap() const { return OnPixmap; } +inline const TQPixmap &KCursor::offPixmap() const { return OffPixmap; } inline KPixelX KCursor::cursorX() const { return CursorX; } inline KPixelX KCursor::cursorW() const { return CursorW; } diff --git a/khexedit/lib/kdatabuffer.h b/khexedit/lib/kdatabuffer.h index e9733d8..e7cc3bc 100644 --- a/khexedit/lib/kdatabuffer.h +++ b/khexedit/lib/kdatabuffer.h @@ -219,7 +219,7 @@ class KHEXEDIT_EXPORT KDataBuffer */ virtual int rfind( const char*, int Length, int Pos = -1 ) const = 0; -/* virtual int find( const QString &expr, bool cs, bool wo, bool forward = true, int *index = 0 ); */ +/* virtual int find( const TQString &expr, bool cs, bool wo, bool forward = true, int *index = 0 ); */ }; diff --git a/khexedit/lib/kfixedsizebuffer.cpp b/khexedit/lib/kfixedsizebuffer.cpp index 2945620..784858c 100644 --- a/khexedit/lib/kfixedsizebuffer.cpp +++ b/khexedit/lib/kfixedsizebuffer.cpp @@ -214,7 +214,7 @@ int KFixedSizeBuffer::fill( const char FChar, int FillLength, unsigned int Pos ) int KFixedSizeBuffer::compare( const KDataBuffer &Other, KSection OtherRange, unsigned int Pos ) { - //kdDebug() << QString("Pos: %1, OtherRange: (%3/%4)" ).arg(Pos).arg(OtherRange.start()).arg(OtherRange.end()) + //kdDebug() << TQString("Pos: %1, OtherRange: (%3/%4)" ).arg(Pos).arg(OtherRange.start()).arg(OtherRange.end()) // << endl; // test other values if( OtherRange.startsBehind(Other.size()-1) ) @@ -245,14 +245,14 @@ int KFixedSizeBuffer::compare( const KDataBuffer &Other, KSection OtherRange, un ValueByLength = -1; } //kdDebug() - // << QString( "Range: (%1/%2), OtherRange: (%3/%4)" ).arg(Range.start()).arg(Range.end()).arg(OtherRange.start()).arg(OtherRange.end()) + // << TQString( "Range: (%1/%2), OtherRange: (%3/%4)" ).arg(Range.start()).arg(Range.end()).arg(OtherRange.start()).arg(OtherRange.end()) // << endl; int oi = OtherRange.start(); for( int i=Range.start(); i<=Range.end(); ++i,++oi ) { char OD = Other.datum(oi); char D = Data[i]; - //kdDebug() << QString("%1==%2").arg((int)D).arg((int)OD) << endl; + //kdDebug() << TQString("%1==%2").arg((int)D).arg((int)OD) << endl; if( OD == D ) continue; return OD < D ? 1 : -1; diff --git a/khexedit/lib/kfixedsizebuffer.h b/khexedit/lib/kfixedsizebuffer.h index 15c17da..90060f0 100644 --- a/khexedit/lib/kfixedsizebuffer.h +++ b/khexedit/lib/kfixedsizebuffer.h @@ -58,7 +58,7 @@ class KFixedSizeBuffer : public KDataBuffer virtual int find( const char*KeyData, int Length, KSection Section ) const; virtual int rfind( const char*, int Length, int Pos = -1 ) const; -/* virtual int find( const QString &expr, bool cs, bool wo, bool forward = true, int *index = 0 ); */ +/* virtual int find( const TQString &expr, bool cs, bool wo, bool forward = true, int *index = 0 ); */ public: void setReadOnly( bool RO = true ); diff --git a/khexedit/lib/khechar.h b/khexedit/lib/khechar.h index 4f51e9e..04b4016 100644 --- a/khexedit/lib/khechar.h +++ b/khexedit/lib/khechar.h @@ -18,7 +18,7 @@ #define KHE_KHECHAR_H // qt specific -#include <qstring.h> +#include <tqstring.h> namespace KHE { @@ -26,8 +26,8 @@ namespace KHE class KHEChar : public QChar { public: - KHEChar( QChar C ); - KHEChar( QChar C, bool U ); + KHEChar( TQChar C ); + KHEChar( TQChar C, bool U ); public: bool isUndefined() const; protected: @@ -35,8 +35,8 @@ class KHEChar : public QChar bool IsUndefined:1; }; -inline KHEChar::KHEChar( QChar C ) : QChar( C ), IsUndefined( false ) {} -inline KHEChar::KHEChar( QChar C, bool U ) : QChar( C ), IsUndefined( U ) {} +inline KHEChar::KHEChar( TQChar C ) : TQChar( C ), IsUndefined( false ) {} +inline KHEChar::KHEChar( TQChar C, bool U ) : TQChar( C ), IsUndefined( U ) {} inline bool KHEChar::isUndefined() const { return IsUndefined; } } diff --git a/khexedit/lib/khexedit.cpp b/khexedit/lib/khexedit.cpp index 85478e5..a7a27c5 100644 --- a/khexedit/lib/khexedit.cpp +++ b/khexedit/lib/khexedit.cpp @@ -23,11 +23,11 @@ // c++ specific //#include <limits> // qt specific -#include <qstyle.h> -#include <qpainter.h> -#include <qtimer.h> -#include <qcursor.h> -#include <qapplication.h> +#include <tqstyle.h> +#include <tqpainter.h> +#include <tqtimer.h> +#include <tqcursor.h> +#include <tqapplication.h> // kde specific #ifndef QT_ONLY #include <kglobalsettings.h> @@ -66,16 +66,16 @@ static const int InsertCursorWidth = 2; -KHexEdit::KHexEdit( KDataBuffer *Buffer, QWidget *Parent, const char *Name, WFlags Flags ) +KHexEdit::KHexEdit( KDataBuffer *Buffer, TQWidget *Parent, const char *Name, WFlags Flags ) : KColumnsView( Parent, Name, Flags ), DataBuffer( Buffer ), BufferLayout( new KBufferLayout(DefaultNoOfBytesPerLine,DefaultStartOffset,0) ), BufferCursor( new KBufferCursor(BufferLayout) ), BufferRanges( new KBufferRanges(BufferLayout) ), - CursorBlinkTimer( new QTimer(this) ), - ScrollTimer( new QTimer(this) ), - DragStartTimer( new QTimer(this) ), - TrippleClickTimer( new QTimer(this) ), + CursorBlinkTimer( new TQTimer(this) ), + ScrollTimer( new TQTimer(this) ), + DragStartTimer( new TQTimer(this) ), + TrippleClickTimer( new TQTimer(this) ), CursorPixmaps( new KCursor() ), Codec( 0 ), ClipboardMode( QClipboard::Clipboard ), @@ -124,7 +124,7 @@ KHexEdit::KHexEdit( KDataBuffer *Buffer, QWidget *Parent, const char *Name, WFla Controller = Navigator; #ifdef QT_ONLY - QFont FixedFont( "fixed", 10 ); + TQFont FixedFont( "fixed", 10 ); FixedFont.setFixedPitch( true ); setFont( FixedFont ); #else @@ -138,9 +138,9 @@ KHexEdit::KHexEdit( KDataBuffer *Buffer, QWidget *Parent, const char *Name, WFla viewport()->installEventFilter( this ); installEventFilter( this ); - connect( CursorBlinkTimer, SIGNAL(timeout()), this, SLOT(blinkCursor()) ); - connect( ScrollTimer, SIGNAL(timeout()), this, SLOT(autoScrollTimerDone()) ); - connect( DragStartTimer, SIGNAL(timeout()), this, SLOT(startDrag()) ); + connect( CursorBlinkTimer, TQT_SIGNAL(timeout()), this, TQT_SLOT(blinkCursor()) ); + connect( ScrollTimer, TQT_SIGNAL(timeout()), this, TQT_SLOT(autoScrollTimerDone()) ); + connect( DragStartTimer, TQT_SIGNAL(timeout()), this, TQT_SLOT(startDrag()) ); viewport()->setAcceptDrops( true ); } @@ -170,10 +170,10 @@ bool KHexEdit::isReadOnly() const { return ReadOnly; } bool KHexEdit::isModified() const { return DataBuffer->isModified(); } bool KHexEdit::tabChangesFocus() const { return TabController->tabChangesFocus(); } bool KHexEdit::showUnprintable() const { return charColumn().showUnprintable(); } -QChar KHexEdit::substituteChar() const { return charColumn().substituteChar(); } -QChar KHexEdit::undefinedChar() const { return charColumn().undefinedChar(); } +TQChar KHexEdit::substituteChar() const { return charColumn().substituteChar(); } +TQChar KHexEdit::undefinedChar() const { return charColumn().undefinedChar(); } KHexEdit::KEncoding KHexEdit::encoding() const { return (KHexEdit::KEncoding)Encoding; } -const QString &KHexEdit::encodingName() const { return Codec->name(); } +const TQString &KHexEdit::encodingName() const { return Codec->name(); } KSection KHexEdit::selection() const { return BufferRanges->selection(); } int KHexEdit::cursorPosition() const { return BufferCursor->index(); } @@ -347,7 +347,7 @@ void KHexEdit::setBinaryGapWidth( int/*KPixelX*/ BGW ) } -void KHexEdit::setSubstituteChar( QChar SC ) +void KHexEdit::setSubstituteChar( TQChar SC ) { if( !charColumn().setSubstituteChar(SC) ) return; @@ -356,7 +356,7 @@ void KHexEdit::setSubstituteChar( QChar SC ) unpauseCursor(); } -void KHexEdit::setUndefinedChar( QChar UC ) +void KHexEdit::setUndefinedChar( TQChar UC ) { if( !charColumn().setUndefinedChar(UC) ) return; @@ -398,7 +398,7 @@ void KHexEdit::setEncoding( KEncoding C ) } // TODO: join with function above! -void KHexEdit::setEncoding( const QString& EncodingName ) +void KHexEdit::setEncoding( const TQString& EncodingName ) { if( EncodingName == Codec->name() ) return; @@ -421,15 +421,15 @@ void KHexEdit::setEncoding( const QString& EncodingName ) } -void KHexEdit::fontChange( const QFont &OldFont ) +void KHexEdit::fontChange( const TQFont &OldFont ) { - QScrollView::fontChange( OldFont ); + TQScrollView::fontChange( OldFont ); if( !InZooming ) DefaultFontSize = font().pointSize(); // get new values - QFontMetrics FM( fontMetrics() ); + TQFontMetrics FM( fontMetrics() ); KPixelX DigitWidth = FM.maxWidth(); KPixelY DigitBaseLine = FM.ascent(); @@ -468,8 +468,8 @@ void KHexEdit::zoomOut() { zoomOut( DefaultZoomStep ); } void KHexEdit::zoomIn( int PointInc ) { InZooming = true; - QFont F( font() ); - F.setPointSize( QFontInfo(F).pointSize() + PointInc ); + TQFont F( font() ); + F.setPointSize( TQFontInfo(F).pointSize() + PointInc ); setFont( F ); InZooming = false; } @@ -477,8 +477,8 @@ void KHexEdit::zoomIn( int PointInc ) void KHexEdit::zoomOut( int PointDec ) { InZooming = true; - QFont F( font() ); - F.setPointSize( QMAX( 1, QFontInfo(F).pointSize() - PointDec ) ); + TQFont F( font() ); + F.setPointSize( QMAX( 1, TQFontInfo(F).pointSize() - PointDec ) ); setFont( F ); InZooming = false; } @@ -487,7 +487,7 @@ void KHexEdit::zoomOut( int PointDec ) void KHexEdit::zoomTo( int PointSize ) { InZooming = true; - QFont F( font() ); + TQFont F( font() ); F.setPointSize( PointSize ); setFont( F ); InZooming = false; @@ -548,21 +548,21 @@ void KHexEdit::toggleOffsetColumn( bool Visible ) } -QSize KHexEdit::sizeHint() const +TQSize KHexEdit::sizeHint() const { - return QSize( totalWidth(), totalHeight() ); + return TQSize( totalWidth(), totalHeight() ); } -QSize KHexEdit::minimumSizeHint() const +TQSize KHexEdit::minimumSizeHint() const { // TODO: better minimal width (visibility!) - return QSize( OffsetColumn->visibleWidth()+FirstBorderColumn->visibleWidth()+SecondBorderColumn->visibleWidth()+valueColumn().byteWidth()+charColumn().byteWidth(), - lineHeight() + noOfLines()>1? style().pixelMetric(QStyle::PM_ScrollBarExtent):0 ); + return TQSize( OffsetColumn->visibleWidth()+FirstBorderColumn->visibleWidth()+SecondBorderColumn->visibleWidth()+valueColumn().byteWidth()+charColumn().byteWidth(), + lineHeight() + noOfLines()>1? style().pixelMetric(TQStyle::PM_ScrollBarExtent):0 ); } -void KHexEdit::resizeEvent( QResizeEvent *ResizeEvent ) +void KHexEdit::resizeEvent( TQResizeEvent *ResizeEvent ) { if( ResizeStyle != NoResize ) { @@ -576,13 +576,13 @@ void KHexEdit::resizeEvent( QResizeEvent *ResizeEvent ) } } - QScrollView::resizeEvent( ResizeEvent ); + TQScrollView::resizeEvent( ResizeEvent ); BufferLayout->setNoOfLinesPerPage( noOfLinesPerPage() ); // TODO: doesn't work with the new size!!! } -int KHexEdit::fittingBytesPerLine( const QSize &NewSize ) const +int KHexEdit::fittingBytesPerLine( const TQSize &NewSize ) const { KPixelX ReservedWidth = OffsetColumn->visibleWidth() + FirstBorderColumn->visibleWidth() + SecondBorderColumn->visibleWidth(); @@ -598,7 +598,7 @@ int KHexEdit::fittingBytesPerLine( const QSize &NewSize ) const // check influence of dis-/appearing of the vertical scrollbar bool VerticalScrollbarIsVisible = verticalScrollBar()->isVisible(); - KPixelX ScrollbarExtent = style().pixelMetric( QStyle::PM_ScrollBarExtent );//verticalScrollBar()->width(); + KPixelX ScrollbarExtent = style().pixelMetric( TQStyle::PM_ScrollBarExtent );//verticalScrollBar()->width(); KPixelX AvailableWidth = FullWidth; if( VerticalScrollbarIsVisible ) @@ -798,19 +798,19 @@ bool KHexEdit::hasSelectedData() const } -QByteArray KHexEdit::selectedData() const +TQByteArray KHexEdit::selectedData() const { if( !BufferRanges->hasSelection() ) - return QByteArray(); + return TQByteArray(); KSection Selection = BufferRanges->selection(); - QByteArray SD( Selection.width() ); + TQByteArray SD( Selection.width() ); DataBuffer->copyTo( SD.data(), Selection.start(), Selection.width() ); return SD; } -KBufferDrag *KHexEdit::dragObject( QWidget *Parent ) const +KBufferDrag *KHexEdit::dragObject( TQWidget *Parent ) const { if( !BufferRanges->hasSelection() ) return 0; @@ -850,7 +850,7 @@ void KHexEdit::cut() if( !Drag ) return; - QApplication::clipboard()->setData( Drag, ClipboardMode ); + TQApplication::clipboard()->setData( Drag, ClipboardMode ); removeSelectedData(); } @@ -862,7 +862,7 @@ void KHexEdit::copy() if( !Drag ) return; - QApplication::clipboard()->setData( Drag, ClipboardMode ); + TQApplication::clipboard()->setData( Drag, ClipboardMode ); } @@ -871,17 +871,17 @@ void KHexEdit::paste() if( isReadOnly() ) return; - QMimeSource *Source = QApplication::clipboard()->data( ClipboardMode ); + TQMimeSource *Source = TQApplication::clipboard()->data( ClipboardMode ); pasteFromSource( Source ); } -void KHexEdit::pasteFromSource( QMimeSource *Source ) +void KHexEdit::pasteFromSource( TQMimeSource *Source ) { if( !Source || !KBufferDrag::canDecode(Source) ) return; - QByteArray Data; + TQByteArray Data; if( !KBufferDrag::decode(Source,Data) ) return; @@ -890,7 +890,7 @@ void KHexEdit::pasteFromSource( QMimeSource *Source ) } -void KHexEdit::insert( const QByteArray &D ) +void KHexEdit::insert( const TQByteArray &D ) { pauseCursor( true ); @@ -1017,7 +1017,7 @@ KSection KHexEdit::removeData( KSection Indizes ) // if( !undoRedoInfo.valid() ) // { // doc->selectionStart( selNum, undoRedoInfo.id, undoRedoInfo.index ); -// undoRedoInfo.d->text = QString::null; +// undoRedoInfo.d->text = TQString::null; // } // readFormats( c1, c2, undoRedoInfo.d->text, TRUE ); // } @@ -1042,7 +1042,7 @@ void KHexEdit::updateLength() void KHexEdit::clipboardChanged() { // don't listen to selection changes - disconnect( QApplication::clipboard(), SIGNAL(selectionChanged()), this, 0 ); + disconnect( TQApplication::clipboard(), TQT_SIGNAL(selectionChanged()), this, 0 ); selectAll( false ); } @@ -1130,7 +1130,7 @@ void KHexEdit::setCursorColumn( KBufferColumnId CC ) } -void KHexEdit::placeCursor( const QPoint &Point ) +void KHexEdit::placeCursor( const TQPoint &Point ) { resetInputContext(); @@ -1155,7 +1155,7 @@ void KHexEdit::placeCursor( const QPoint &Point ) } -int KHexEdit::indexByPoint( const QPoint &Point ) const +int KHexEdit::indexByPoint( const TQPoint &Point ) const { const KBufferColumn *C; if( charColumn().isVisible() && Point.x() >= charColumn().x() ) @@ -1169,34 +1169,34 @@ int KHexEdit::indexByPoint( const QPoint &Point ) const } -void KHexEdit::showEvent( QShowEvent *e ) +void KHexEdit::showEvent( TQShowEvent *e ) { KColumnsView::showEvent( e ); BufferLayout->setNoOfLinesPerPage( noOfLinesPerPage() ); } -bool KHexEdit::eventFilter( QObject *O, QEvent *E ) +bool KHexEdit::eventFilter( TQObject *O, TQEvent *E ) { if( O == this || O == viewport() ) { - if( E->type() == QEvent::FocusIn ) + if( E->type() == TQEvent::FocusIn ) { startCursor(); } - else if( E->type() == QEvent::FocusOut ) + else if( E->type() == TQEvent::FocusOut ) { stopCursor(); } } -// if( O == this && E->type() == QEvent::PaletteChange ) +// if( O == this && E->type() == TQEvent::PaletteChange ) // { -// QColor old( viewport()->colorGroup().color(QColorGroup::Text) ); +// TQColor old( viewport()->colorGroup().color(TQColorGroup::Text) ); // -// if( old != colorGroup().color(QColorGroup::Text) ) +// if( old != colorGroup().color(TQColorGroup::Text) ) // { -// QColor c( colorGroup().color(QColorGroup::Text) ); +// TQColor c( colorGroup().color(TQColorGroup::Text) ); // doc->setMinimumWidth( -1 ); // doc->setDefaultFormat( doc->formatCollection()->defaultFormat()->font(), c ); // lastFormatted = doc->firstParagraph(); @@ -1205,7 +1205,7 @@ bool KHexEdit::eventFilter( QObject *O, QEvent *E ) // } // } - return QScrollView::eventFilter( O, E ); + return TQScrollView::eventFilter( O, E ); } @@ -1226,7 +1226,7 @@ void KHexEdit::startCursor() updateCursor(); - CursorBlinkTimer->start( QApplication::cursorFlashTime()/2 ); + CursorBlinkTimer->start( TQApplication::cursorFlashTime()/2 ); } @@ -1274,7 +1274,7 @@ void KHexEdit::createCursorPixmaps() int Index = BufferCursor->validIndex(); - QPainter Paint; + TQPainter Paint; Paint.begin( &CursorPixmaps->offPixmap(), this ); activeColumn().paintByte( &Paint, Index ); Paint.end(); @@ -1300,7 +1300,7 @@ void KHexEdit::createCursorPixmaps() } -void KHexEdit::pointPainterToCursor( QPainter &Painter, const KBufferColumn &Column ) const +void KHexEdit::pointPainterToCursor( TQPainter &Painter, const KBufferColumn &Column ) const { int x = Column.xOfPos( BufferCursor->pos() ) - contentsX(); int y = LineHeight * BufferCursor->line() - contentsY(); @@ -1317,7 +1317,7 @@ void KHexEdit::paintActiveCursor( bool CursorOn ) || (CursorOn && !hasFocus() && !viewport()->hasFocus() && !InDnD ) ) return; - QPainter Painter; + TQPainter Painter; pointPainterToCursor( Painter, activeColumn() ); // paint edited byte? @@ -1353,7 +1353,7 @@ void KHexEdit::paintInactiveCursor( bool CursorOn ) int Index = BufferCursor->validIndex(); - QPainter Painter; + TQPainter Painter; pointPainterToCursor( Painter, inactiveColumn() ); if( CursorOn ) { @@ -1368,7 +1368,7 @@ void KHexEdit::paintInactiveCursor( bool CursorOn ) } -void KHexEdit::drawContents( QPainter *P, int cx, int cy, int cw, int ch ) +void KHexEdit::drawContents( TQPainter *P, int cx, int cy, int cw, int ch ) { KColumnsView::drawContents( P, cx, cy, cw, ch ); // TODO: update non blinking cursors. Should this perhaps be done in the buffercolumn? @@ -1390,7 +1390,7 @@ void KHexEdit::updateColumn( KColumn &Column ) } -void KHexEdit::keyPressEvent( QKeyEvent *KeyEvent ) +void KHexEdit::keyPressEvent( TQKeyEvent *KeyEvent ) { if( !Controller->handleKeyPress( KeyEvent ) ) KeyEvent->ignore(); @@ -1408,7 +1408,7 @@ void KHexEdit::repaintChanged() KPixelXs Xs( contentsX(), visibleWidth(), true ); // collect affected buffer columns - QPtrList<KBufferColumn> RepaintColumns; + TQPtrList<KBufferColumn> RepaintColumns; KBufferColumn *C = ValueColumn; while( true ) @@ -1497,7 +1497,7 @@ void KHexEdit::paintLine( KBufferColumn *C, int Line, KSection Positions ) KPixelY cy = Line * LineHeight; // to avoid flickers we first paint to the linebuffer - QPainter Paint; + TQPainter Paint; Paint.begin( &LineBuffer, this ); Paint.translate( C->x(), 0 ); @@ -1542,7 +1542,7 @@ void KHexEdit::ensureCursorVisible() -void KHexEdit::contentsMousePressEvent( QMouseEvent *e ) +void KHexEdit::contentsMousePressEvent( TQMouseEvent *e ) { // clearUndoRedo(); pauseCursor( true ); @@ -1554,7 +1554,7 @@ void KHexEdit::contentsMousePressEvent( QMouseEvent *e ) // select whole line? if( TrippleClickTimer->isActive() - && (e->globalPos()-DoubleClickPoint).manhattanLength() < QApplication::startDragDistance() ) + && (e->globalPos()-DoubleClickPoint).manhattanLength() < TQApplication::startDragDistance() ) { BufferRanges->setSelectionStart( BufferLayout->indexAtLineStart(DoubleClickLine) ); BufferCursor->gotoLineEnd(); @@ -1565,7 +1565,7 @@ void KHexEdit::contentsMousePressEvent( QMouseEvent *e ) return; } - QPoint MousePoint = e->pos(); + TQPoint MousePoint = e->pos(); placeCursor( MousePoint ); ensureCursorVisible(); @@ -1573,7 +1573,7 @@ void KHexEdit::contentsMousePressEvent( QMouseEvent *e ) if( BufferRanges->selectionIncludes(BufferCursor->index()) ) { DragStartPossible = true; - DragStartTimer->start( QApplication::startDragTime(), true ); + DragStartTimer->start( TQApplication::startDragTime(), true ); DragStartPoint = MousePoint; unpauseCursor(); @@ -1614,7 +1614,7 @@ void KHexEdit::contentsMousePressEvent( QMouseEvent *e ) } -void KHexEdit::contentsMouseMoveEvent( QMouseEvent *e ) +void KHexEdit::contentsMouseMoveEvent( TQMouseEvent *e ) { if( MousePressed ) { @@ -1622,14 +1622,14 @@ void KHexEdit::contentsMouseMoveEvent( QMouseEvent *e ) { DragStartTimer->stop(); // moved enough for a drag? - if( (e->pos()-DragStartPoint).manhattanLength() > QApplication::startDragDistance() ) + if( (e->pos()-DragStartPoint).manhattanLength() > TQApplication::startDragDistance() ) startDrag(); if( !isReadOnly() ) viewport()->setCursor( ibeamCursor ); return; } // selecting - QPoint MousePoint = e->pos(); + TQPoint MousePoint = e->pos(); handleMouseMove( MousePoint ); } else if( !isReadOnly() ) @@ -1641,7 +1641,7 @@ void KHexEdit::contentsMouseMoveEvent( QMouseEvent *e ) } -void KHexEdit::contentsMouseReleaseEvent( QMouseEvent *e ) +void KHexEdit::contentsMouseReleaseEvent( TQMouseEvent *e ) { // this is not the release of a doubleclick so we need to process it? if( !InDoubleClick ) @@ -1671,14 +1671,14 @@ void KHexEdit::contentsMouseReleaseEvent( QMouseEvent *e ) // was end of selection operation? else if( BufferRanges->hasSelection() ) { - if( QApplication::clipboard()->supportsSelection() ) + if( TQApplication::clipboard()->supportsSelection() ) { ClipboardMode = QClipboard::Selection; - disconnect( QApplication::clipboard(), SIGNAL(selectionChanged()), this, 0); + disconnect( TQApplication::clipboard(), TQT_SIGNAL(selectionChanged()), this, 0); copy(); - connect( QApplication::clipboard(), SIGNAL(selectionChanged()), this, SLOT(clipboardChanged()) ); + connect( TQApplication::clipboard(), TQT_SIGNAL(selectionChanged()), this, TQT_SLOT(clipboardChanged()) ); ClipboardMode = QClipboard::Clipboard; } } @@ -1720,7 +1720,7 @@ void KHexEdit::contentsMouseReleaseEvent( QMouseEvent *e ) // gets called after press and release instead of a plain press event (?) -void KHexEdit::contentsMouseDoubleClickEvent( QMouseEvent *e ) +void KHexEdit::contentsMouseDoubleClickEvent( TQMouseEvent *e ) { // we are only interested in LMB doubleclicks if( e->button() != Qt::LeftButton ) @@ -1754,11 +1754,11 @@ void KHexEdit::contentsMouseDoubleClickEvent( QMouseEvent *e ) void KHexEdit::autoScrollTimerDone() { if( MousePressed ) - handleMouseMove( viewportToContents(viewport()->mapFromGlobal( QCursor::pos() )) ); + handleMouseMove( viewportToContents(viewport()->mapFromGlobal( TQCursor::pos() )) ); } -void KHexEdit::handleMouseMove( const QPoint& Point ) // handles the move of the mouse with pressed buttons +void KHexEdit::handleMouseMove( const TQPoint& Point ) // handles the move of the mouse with pressed buttons { // no scrolltimer and outside of viewport? if( !ScrollTimer->isActive() && Point.y() < contentsY() || Point.y() > contentsY() + visibleHeight() ) @@ -1817,7 +1817,7 @@ void KHexEdit::startDrag() DragStartPossible = false; // create data - QDragObject *Drag = dragObject( viewport() ); + TQDragObject *Drag = dragObject( viewport() ); if( !Drag ) return; @@ -1827,12 +1827,12 @@ void KHexEdit::startDrag() // or is this left to the user and he choose to move? else if( Drag->drag() ) // Not inside this widget itself? - if( QDragObject::target() != this && QDragObject::target() != viewport() ) + if( TQDragObject::target() != this && TQDragObject::target() != viewport() ) removeSelectedData(); } -void KHexEdit::contentsDragEnterEvent( QDragEnterEvent *e ) +void KHexEdit::contentsDragEnterEvent( TQDragEnterEvent *e ) { // interesting for this widget? if( isReadOnly() || !KBufferDrag::canDecode(e) ) @@ -1846,7 +1846,7 @@ void KHexEdit::contentsDragEnterEvent( QDragEnterEvent *e ) } -void KHexEdit::contentsDragMoveEvent( QDragMoveEvent *e ) +void KHexEdit::contentsDragMoveEvent( TQDragMoveEvent *e ) { // is this content still interesting for us? if( isReadOnly() || !KBufferDrag::canDecode(e) ) @@ -1864,7 +1864,7 @@ void KHexEdit::contentsDragMoveEvent( QDragMoveEvent *e ) } -void KHexEdit::contentsDragLeaveEvent( QDragLeaveEvent * ) +void KHexEdit::contentsDragLeaveEvent( TQDragLeaveEvent * ) { // bye... and thanks for all the cursor movement... InDnD = false; @@ -1872,7 +1872,7 @@ void KHexEdit::contentsDragLeaveEvent( QDragLeaveEvent * ) -void KHexEdit::contentsDropEvent( QDropEvent *e ) +void KHexEdit::contentsDropEvent( TQDropEvent *e ) { // after drag enter and move check one more time if( isReadOnly() ) @@ -1896,7 +1896,7 @@ void KHexEdit::contentsDropEvent( QDropEvent *e ) } -void KHexEdit::handleInternalDrag( QDropEvent *e ) +void KHexEdit::handleInternalDrag( TQDropEvent *e ) { KSection ChangedRange; @@ -1908,7 +1908,7 @@ void KHexEdit::handleInternalDrag( QDropEvent *e ) int InsertIndex = BufferCursor->realIndex(); // is this a move? - if( e->action() == QDropEvent::Move ) + if( e->action() == TQDropEvent::Move ) { // ignore the copy hold in the event but only move int NewIndex = DataBuffer->move( InsertIndex, Selection ); @@ -1922,7 +1922,7 @@ void KHexEdit::handleInternalDrag( QDropEvent *e ) else { // get data - QByteArray Data; + TQByteArray Data; if( KBufferDrag::decode(e,Data) && !Data.isEmpty() ) { if( OverWrite ) @@ -1966,7 +1966,7 @@ void KHexEdit::handleInternalDrag( QDropEvent *e ) } -void KHexEdit::contentsWheelEvent( QWheelEvent *e ) +void KHexEdit::contentsWheelEvent( TQWheelEvent *e ) { if( isReadOnly() ) { @@ -1979,19 +1979,19 @@ void KHexEdit::contentsWheelEvent( QWheelEvent *e ) return; } } - QScrollView::contentsWheelEvent( e ); + TQScrollView::contentsWheelEvent( e ); } #if 0 -void KHexEdit::contentsContextMenuEvent( QContextMenuEvent *e ) +void KHexEdit::contentsContextMenuEvent( TQContextMenuEvent *e ) { // clearUndoRedo(); MousePressed = false; e->accept(); - QPopupMenu *PopupMenu = createPopupMenu( e->pos() ); + TQPopupMenu *PopupMenu = createPopupMenu( e->pos() ); if( !PopupMenu ) PopupMenu = createPopupMenu(); if( !PopupMenu ) @@ -2005,14 +2005,14 @@ void KHexEdit::contentsContextMenuEvent( QContextMenuEvent *e ) { selectAll(); // if the clipboard support selections, put the newly selected text into the clipboard - if( QApplication::clipboard()->supportsSelection() ) + if( TQApplication::clipboard()->supportsSelection() ) { ClipboardMode = QClipboard::Selection; - disconnect( QApplication::clipboard(), SIGNAL(selectionChanged()), this, 0); + disconnect( TQApplication::clipboard(), TQT_SIGNAL(selectionChanged()), this, 0); copy(); - connect( QApplication::clipboard(), SIGNAL(selectionChanged()), this, SLOT(clipboardChanged()) ); + connect( TQApplication::clipboard(), TQT_SIGNAL(selectionChanged()), this, TQT_SLOT(clipboardChanged()) ); ClipboardMode = QClipboard::Clipboard; } } diff --git a/khexedit/lib/khexedit.h b/khexedit/lib/khexedit.h index 66059c8..38bb53e 100644 --- a/khexedit/lib/khexedit.h +++ b/khexedit/lib/khexedit.h @@ -19,7 +19,7 @@ #define KHE_KHEXEDIT_H // qt specific -#include <qclipboard.h> +#include <tqclipboard.h> // lib specific // #include "khe.h" #include "khexedit_export.h" @@ -91,7 +91,7 @@ class KHEXEDIT_EXPORT KHexEdit : public KColumnsView Q_PROPERTY( bool TabChangesFocus READ tabChangesFocus WRITE setTabChangesFocus ) //Q_PROPERTY( bool hasSelectedData READ hasSelectedData ) - //Q_PROPERTY( QByteArray SelectedData READ selectedData ) + //Q_PROPERTY( TQByteArray SelectedData READ selectedData ) Q_PROPERTY( KResizeStyle ResizeStyle READ resizeStyle WRITE setResizeStyle ) Q_PROPERTY( int StartOffset READ startOffset WRITE setStartOffset ) Q_PROPERTY( int FirstLineOffset READ firstLineOffset WRITE setFirstLineOffset ) @@ -105,7 +105,7 @@ class KHEXEDIT_EXPORT KHexEdit : public KColumnsView Q_PROPERTY( int BinaryGapWidth READ binaryGapWidth WRITE setBinaryGapWidth ) // char column Q_PROPERTY( bool ShowUnprintable READ showUnprintable WRITE setShowUnprintable ) - Q_PROPERTY( QChar SubstituteChar READ substituteChar WRITE setSubstituteChar ) + Q_PROPERTY( TQChar SubstituteChar READ substituteChar WRITE setSubstituteChar ) public: enum KResizeStyle { NoResize=0, LockGrouping=1, FullSizeUsage=2, MaxResizeStyleId=0xFF }; @@ -117,20 +117,20 @@ class KHEXEDIT_EXPORT KHexEdit : public KColumnsView public: - KHexEdit( KDataBuffer *Buffer = 0, QWidget *Parent = 0, const char *Name = 0, WFlags F = 0 ); + KHexEdit( KDataBuffer *Buffer = 0, TQWidget *Parent = 0, const char *Name = 0, WFlags F = 0 ); virtual ~KHexEdit(); public: // KColumnsView API - virtual void drawContents( QPainter *p, int cx, int cy, int cw, int ch ); + virtual void drawContents( TQPainter *p, int cx, int cy, int cw, int ch ); - public: // QWidget API -// void focusInEvent( QFocusEvent *FocusEvent ); // TODO: why don't these work? -// void focusOutEvent( QFocusEvent *FocusEvent ); - virtual bool eventFilter( QObject *O, QEvent *E ); + public: // TQWidget API +// void focusInEvent( TQFocusEvent *FocusEvent ); // TODO: why don't these work? +// void focusOutEvent( TQFocusEvent *FocusEvent ); + virtual bool eventFilter( TQObject *O, TQEvent *E ); - virtual QSize sizeHint() const; - virtual QSize minimumSizeHint() const; + virtual TQSize sizeHint() const; + virtual TQSize minimumSizeHint() const; public: // value access @@ -171,9 +171,9 @@ class KHEXEDIT_EXPORT KHexEdit : public KColumnsView /** gives the used substitute character for "unprintable" chars, default is '.' * @return substitute character */ - QChar substituteChar() const; + TQChar substituteChar() const; /** returns the actually used undefined character for "undefined" chars, default is '?' */ - QChar undefinedChar() const; + TQChar undefinedChar() const; /** * @return encoding used in the char column */ @@ -181,7 +181,7 @@ class KHEXEDIT_EXPORT KHexEdit : public KColumnsView /** * @return name of the encoding used in the char column */ - const QString &encodingName() const; + const TQString &encodingName() const; public: // logic value service /** calculates the number of bytes per line that fit into a widget with the given size @@ -190,12 +190,12 @@ class KHEXEDIT_EXPORT KHexEdit : public KColumnsView * @param TestSize Size the widget might have * @return number of bytes per line that fit into a widget with the given size */ - int fittingBytesPerLine( const QSize &TestSize ) const; + int fittingBytesPerLine( const TQSize &TestSize ) const; /** detects the index of the byte at the given point * @param Point in viewport coordinate system * @return index of the byte that covers the point */ - int indexByPoint(const QPoint &Point ) const; + int indexByPoint(const TQPoint &Point ) const; public: /** returns true if there is a selected range in the array */ @@ -203,7 +203,7 @@ class KHEXEDIT_EXPORT KHexEdit : public KColumnsView /** * @return deep copy of the selected data */ - QByteArray selectedData() const; + TQByteArray selectedData() const; KSection selection() const; public: // modification access @@ -212,7 +212,7 @@ class KHEXEDIT_EXPORT KHexEdit : public KColumnsView */ void setCursorPosition( int Index, bool Behind=false ); /** puts the cursor in the column at the pos of Point (in absolute coord), does not handle the drawing */ - void placeCursor( const QPoint &Point ); + void placeCursor( const TQPoint &Point ); /***/ void setCursorColumn( KBufferColumnId ); // void repaintByte( int row, int column, bool Erase = true ); @@ -294,11 +294,11 @@ class KHEXEDIT_EXPORT KHexEdit : public KColumnsView /** sets the substitute character for "unprintable" chars * returns true if there was a change */ - void setSubstituteChar( QChar SC ); + void setSubstituteChar( TQChar SC ); /** sets the undefined character for "undefined" chars * returns true if there was a change */ - void setUndefinedChar( QChar UC ); + void setUndefinedChar( TQChar UC ); /** sets the encoding of the char column. Default is KHE::LocalEncoding. * If the encoding is not available the format will not be changed. */ void setEncoding( KEncoding C ); @@ -306,7 +306,7 @@ class KHEXEDIT_EXPORT KHexEdit : public KColumnsView * If the encoding is not available the format will not be changed. * @param Encoding name of the encoding */ - void setEncoding( const QString& Encoding ); + void setEncoding( const TQString& Encoding ); // interaction /** de-/selects all data */ @@ -318,7 +318,7 @@ class KHEXEDIT_EXPORT KHexEdit : public KColumnsView /** removes the selected data, takes care of the cursor */ virtual void removeSelectedData(); /** inserts */ - virtual void insert( const QByteArray &D ); + virtual void insert( const TQByteArray &D ); // clipboard interaction virtual void copy(); @@ -361,22 +361,22 @@ class KHEXEDIT_EXPORT KHexEdit : public KColumnsView void bufferChanged( int StartIndex, int EndIndex ); - protected: // QWidget API - virtual void keyPressEvent( QKeyEvent *KeyEvent ); - virtual void resizeEvent( QResizeEvent *ResizeEvent ); - virtual void showEvent( QShowEvent *e ); + protected: // TQWidget API + virtual void keyPressEvent( TQKeyEvent *KeyEvent ); + virtual void resizeEvent( TQResizeEvent *ResizeEvent ); + virtual void showEvent( TQShowEvent *e ); - protected: // QScrollView API - virtual void contentsMousePressEvent( QMouseEvent *e ); - virtual void contentsMouseReleaseEvent( QMouseEvent * e ); - virtual void contentsMouseMoveEvent( QMouseEvent *e ); - virtual void contentsMouseDoubleClickEvent( QMouseEvent * e ); - virtual void contentsDragEnterEvent( QDragEnterEvent *e ); - virtual void contentsDragMoveEvent( QDragMoveEvent *e ); - virtual void contentsDragLeaveEvent( QDragLeaveEvent * ); - virtual void contentsDropEvent( QDropEvent *e ); - virtual void contentsWheelEvent( QWheelEvent *e ); -// virtual void contentsContextMenuEvent( QContextMenuEvent *e ); + protected: // TQScrollView API + virtual void contentsMousePressEvent( TQMouseEvent *e ); + virtual void contentsMouseReleaseEvent( TQMouseEvent * e ); + virtual void contentsMouseMoveEvent( TQMouseEvent *e ); + virtual void contentsMouseDoubleClickEvent( TQMouseEvent * e ); + virtual void contentsDragEnterEvent( TQDragEnterEvent *e ); + virtual void contentsDragMoveEvent( TQDragMoveEvent *e ); + virtual void contentsDragLeaveEvent( TQDragLeaveEvent * ); + virtual void contentsDropEvent( TQDropEvent *e ); + virtual void contentsWheelEvent( TQWheelEvent *e ); +// virtual void contentsContextMenuEvent( TQContextMenuEvent *e ); protected: // KColumnsView API virtual void setNoOfLines( int NewNoOfLines ); @@ -403,23 +403,23 @@ class KHEXEDIT_EXPORT KHexEdit : public KColumnsView /** recreates the cursor pixmaps and paints active and inactive cursors if doable */ void updateCursor(); void createCursorPixmaps(); - void pointPainterToCursor( QPainter &Painter, const KBufferColumn &Column ) const; + void pointPainterToCursor( TQPainter &Painter, const KBufferColumn &Column ) const; /** draws the blinking cursor or removes it */ void paintActiveCursor( bool CursorOn ); void paintInactiveCursor( bool CursorOn ); void paintLine( KBufferColumn *C, int Line, KSection Positions ); protected: // partial operations - void handleMouseMove( const QPoint& Point ); - KBufferDrag *dragObject( QWidget *Parent = 0 ) const; - void pasteFromSource( QMimeSource *Source ); + void handleMouseMove( const TQPoint& Point ); + KBufferDrag *dragObject( TQWidget *Parent = 0 ) const; + void pasteFromSource( TQMimeSource *Source ); /** removes the section from the databuffer and updates all affected values */ KSection removeData( KSection Indizes ); /** sets ChangedRange to the range of VisibleRange that is actually changed * @return true if there was a change within the visible range */ bool hasChanged( const KCoordRange &VisibleRange, KCoordRange *ChangedRange ) const; - void handleInternalDrag( QDropEvent *e ); + void handleInternalDrag( TQDropEvent *e ); protected: /** recalcs all dependant values with the actual NoOfBytesPerLine */ @@ -443,8 +443,8 @@ class KHEXEDIT_EXPORT KHexEdit : public KColumnsView /** */ void startDrag(); - protected slots: // QWidget API - virtual void fontChange( const QFont &OldFont ); + protected slots: // TQWidget API + virtual void fontChange( const TQFont &OldFont ); protected: @@ -484,14 +484,14 @@ class KHEXEDIT_EXPORT KHexEdit : public KColumnsView protected: /** Timer that controls the blinking of the cursor */ - QTimer *CursorBlinkTimer; + TQTimer *CursorBlinkTimer; /** Timer that triggers ensureCursorVisible function calls */ - QTimer *ScrollTimer; -/* QTimer *ChangeIntervalTimer, */ + TQTimer *ScrollTimer; +/* TQTimer *ChangeIntervalTimer, */ /** Timer to start a drag */ - QTimer *DragStartTimer; + TQTimer *DragStartTimer; /** timer to measure whether the time between a double click and the following counts for a tripleclick */ - QTimer *TrippleClickTimer; + TQTimer *TrippleClickTimer; /** object to store the blinking cursor pixmaps */ KCursor *CursorPixmaps; @@ -500,11 +500,11 @@ class KHEXEDIT_EXPORT KHexEdit : public KColumnsView protected: /** point at which the current double click happended (used by TrippleClick) */ - QPoint DoubleClickPoint; + TQPoint DoubleClickPoint; /** line in which the current double click happended (used by TrippleClick) */ int DoubleClickLine; /** point at which the current dragging started */ - QPoint DragStartPoint; + TQPoint DragStartPoint; /** */ QClipboard::Mode ClipboardMode; /** font size as set by user (used for zooming) */ diff --git a/khexedit/lib/koffsetcoltextexport.cpp b/khexedit/lib/koffsetcoltextexport.cpp index c5644df..bce1fa6 100644 --- a/khexedit/lib/koffsetcoltextexport.cpp +++ b/khexedit/lib/koffsetcoltextexport.cpp @@ -16,7 +16,7 @@ // qt specific -#include <qstring.h> +#include <tqstring.h> // lib specific #include "koffsetcolumn.h" #include "koffsetcoltextexport.h" @@ -38,18 +38,18 @@ int KOffsetColTextExport::charsPerLine() const } -void KOffsetColTextExport::printFirstLine( QString &T, int Line ) const +void KOffsetColTextExport::printFirstLine( TQString &T, int Line ) const { PrintLine = Line; print( T ); } -void KOffsetColTextExport::printNextLine( QString &T ) const +void KOffsetColTextExport::printNextLine( TQString &T ) const { print( T ); } -void KOffsetColTextExport::print( QString &T ) const +void KOffsetColTextExport::print( TQString &T ) const { // TODO: fix me (no more printFunction) char *B = new char[CodingWidth+1]; diff --git a/khexedit/lib/koffsetcoltextexport.h b/khexedit/lib/koffsetcoltextexport.h index e07e659..cfc9adb 100644 --- a/khexedit/lib/koffsetcoltextexport.h +++ b/khexedit/lib/koffsetcoltextexport.h @@ -34,13 +34,13 @@ class KOffsetColTextExport : public KColTextExport KOffsetColTextExport( const KOffsetColumn *OC ); public: // KColTextExport API - void printFirstLine( QString &T, int Line ) const; - void printNextLine( QString &T ) const; + void printFirstLine( TQString &T, int Line ) const; + void printNextLine( TQString &T ) const; /** tells how much chars per line are needed */ int charsPerLine() const; protected: - void print( QString &T ) const; + void print( TQString &T ) const; protected: const int CodingWidth; diff --git a/khexedit/lib/koffsetcolumn.cpp b/khexedit/lib/koffsetcolumn.cpp index 6bd6d09..fb8e694 100644 --- a/khexedit/lib/koffsetcolumn.cpp +++ b/khexedit/lib/koffsetcolumn.cpp @@ -15,7 +15,7 @@ ***************************************************************************/ // qt specific -#include "qpainter.h" +#include "tqpainter.h" // lib specific #include "kcolumnsview.h" #include "koffsetcolumn.h" @@ -40,36 +40,36 @@ KOffsetColumn::~KOffsetColumn() } -void KOffsetColumn::paintLine( QPainter *P, int Line ) +void KOffsetColumn::paintLine( TQPainter *P, int Line ) { - const QColor &ButtonColor = View->colorGroup().button(); - P->fillRect( 0,0,width(),LineHeight, QBrush(ButtonColor,Qt::SolidPattern) ); + const TQColor &ButtonColor = View->colorGroup().button(); + P->fillRect( 0,0,width(),LineHeight, TQBrush(ButtonColor,Qt::SolidPattern) ); printFunction()( CodedOffset,FirstLineOffset+Delta*Line ); - P->drawText( 0, DigitBaseLine, QString().append(CodedOffset) ); + P->drawText( 0, DigitBaseLine, TQString().append(CodedOffset) ); } -void KOffsetColumn::paintFirstLine( QPainter *P, KPixelXs, int FirstLine ) +void KOffsetColumn::paintFirstLine( TQPainter *P, KPixelXs, int FirstLine ) { PaintLine = FirstLine; paintLine( P, PaintLine++ ); } -void KOffsetColumn::paintNextLine( QPainter *P ) +void KOffsetColumn::paintNextLine( TQPainter *P ) { paintLine( P, PaintLine++ ); } -void KOffsetColumn::paintEmptyColumn( QPainter *P, KPixelXs Xs, KPixelYs Ys ) +void KOffsetColumn::paintEmptyColumn( TQPainter *P, KPixelXs Xs, KPixelYs Ys ) { Xs.restrictTo( XSpan ); - const QColor &ButtonColor = View->colorGroup().button(); - P->fillRect( Xs.start(), Ys.start(), Xs.width(), Ys.width(), QBrush(ButtonColor,Qt::SolidPattern) ); + const TQColor &ButtonColor = View->colorGroup().button(); + P->fillRect( Xs.start(), Ys.start(), Xs.width(), Ys.width(), TQBrush(ButtonColor,Qt::SolidPattern) ); } void KOffsetColumn::setFormat( KOffsetFormat::KFormat F ) diff --git a/khexedit/lib/koffsetcolumn.h b/khexedit/lib/koffsetcolumn.h index ae182f9..497d7ef 100644 --- a/khexedit/lib/koffsetcolumn.h +++ b/khexedit/lib/koffsetcolumn.h @@ -36,9 +36,9 @@ class KOffsetColumn : public KColumn virtual ~KOffsetColumn(); public: // KColumn API - virtual void paintFirstLine( QPainter *P, KPixelXs Xs, int FirstLine ); - virtual void paintNextLine( QPainter *P ); - virtual void paintEmptyColumn( QPainter *P, KPixelXs Xs, KPixelYs Ys ); + virtual void paintFirstLine( TQPainter *P, KPixelXs Xs, int FirstLine ); + virtual void paintNextLine( TQPainter *P ); + virtual void paintEmptyColumn( TQPainter *P, KPixelXs Xs, KPixelYs Ys ); public: @@ -62,7 +62,7 @@ class KOffsetColumn : public KColumn /** recalculates all x values */ void recalcX(); /** paints full line */ - void paintLine( QPainter *P, int Line ); + void paintLine( TQPainter *P, int Line ); protected: // user settings diff --git a/khexedit/lib/kplainbuffer.cpp b/khexedit/lib/kplainbuffer.cpp index 63c1db7..02b9d70 100644 --- a/khexedit/lib/kplainbuffer.cpp +++ b/khexedit/lib/kplainbuffer.cpp @@ -72,7 +72,7 @@ int KPlainBuffer::insert( int Pos, const char* D, int Length ) // check all parameters if( Length == 0 ) return 0; - //kdDebug() << QString("before: Size: %1, RawSize: %2").arg(Size).arg(RawSize) << endl; + //kdDebug() << TQString("before: Size: %1, RawSize: %2").arg(Size).arg(RawSize) << endl; // correct for appending if( Pos > (int)Size ) Pos = Size; @@ -82,7 +82,7 @@ int KPlainBuffer::insert( int Pos, const char* D, int Length ) // copy new data to its place memcpy( &Data[Pos], D, Length ); - //kdDebug() << QString("after: Size: %1, RawSize: %2").arg(Size).arg(RawSize) << endl; + //kdDebug() << TQString("after: Size: %1, RawSize: %2").arg(Size).arg(RawSize) << endl; Modified = true; return Length; diff --git a/khexedit/lib/kplainbuffer.h b/khexedit/lib/kplainbuffer.h index 27bbbad..31851ae 100644 --- a/khexedit/lib/kplainbuffer.h +++ b/khexedit/lib/kplainbuffer.h @@ -65,7 +65,7 @@ class KPlainBuffer : public KDataBuffer virtual int find( const char*KeyData, int Length, KSection Section ) const; virtual int rfind( const char*, int Length, int Pos = -1 ) const; -/* virtual int find( const QString &expr, bool cs, bool wo, bool forward = true, int *index = 0 ); */ +/* virtual int find( const TQString &expr, bool cs, bool wo, bool forward = true, int *index = 0 ); */ public: void setReadOnly( bool RO = true ); diff --git a/khexedit/lib/ksectionlist.h b/khexedit/lib/ksectionlist.h index 7328e42..1acdf5c 100644 --- a/khexedit/lib/ksectionlist.h +++ b/khexedit/lib/ksectionlist.h @@ -19,13 +19,13 @@ #define KHE_KSECTIONLIST_H // qt specific -#include <qvaluelist.h> +#include <tqvaluelist.h> // lib specific #include "ksection.h" namespace KHE { -typedef QValueList<KSection> KSectionBasicList; +typedef TQValueList<KSection> KSectionBasicList; /** @author Friedrich W. H. Kossebau */ diff --git a/khexedit/lib/kvaluecoltextexport.cpp b/khexedit/lib/kvaluecoltextexport.cpp index 009ad54..190018f 100644 --- a/khexedit/lib/kvaluecoltextexport.cpp +++ b/khexedit/lib/kvaluecoltextexport.cpp @@ -38,7 +38,7 @@ KValueColTextExport::~KValueColTextExport() -void KValueColTextExport::print( QString &T ) const +void KValueColTextExport::print( TQString &T ) const { int p = 0; int pEnd = NoOfBytesPerLine; @@ -48,7 +48,7 @@ void KValueColTextExport::print( QString &T ) const if( PrintLine == CoordRange.end().line() ) pEnd = CoordRange.end().pos()+1; - QString E; + TQString E; E.setLength( ByteCodec->encodingWidth() ); // draw individual chars uint e = 0; diff --git a/khexedit/lib/kvaluecoltextexport.h b/khexedit/lib/kvaluecoltextexport.h index be6bab4..c1987de 100644 --- a/khexedit/lib/kvaluecoltextexport.h +++ b/khexedit/lib/kvaluecoltextexport.h @@ -35,7 +35,7 @@ class KValueColTextExport : public KBufferColTextExport virtual ~KValueColTextExport(); protected: - virtual void print( QString &T ) const; + virtual void print( TQString &T ) const; protected: diff --git a/khexedit/lib/kvaluecolumn.cpp b/khexedit/lib/kvaluecolumn.cpp index 82da795..62d36c0 100644 --- a/khexedit/lib/kvaluecolumn.cpp +++ b/khexedit/lib/kvaluecolumn.cpp @@ -16,7 +16,7 @@ // qt specific -#include <qpainter.h> +#include <tqpainter.h> // lib specific #include "kcolumnsview.h" #include "kbuffercursor.h" @@ -101,26 +101,26 @@ void KValueColumn::recalcByteWidth() // perhaps sometimes there will be a grammar -void KValueColumn::paintEditedByte( QPainter *P, char Byte, const QString &EditBuffer ) +void KValueColumn::paintEditedByte( TQPainter *P, char Byte, const TQString &EditBuffer ) { KHEChar B = Codec->decode( Byte ); - const QColorGroup &CG = View->colorGroup(); + const TQColorGroup &CG = View->colorGroup(); - P->fillRect( 0,0,ByteWidth,LineHeight, QBrush(colorForChar(B),Qt::SolidPattern) ); + P->fillRect( 0,0,ByteWidth,LineHeight, TQBrush(colorForChar(B),Qt::SolidPattern) ); drawCode( P, EditBuffer, CG.base() ); } -void KValueColumn::drawByte( QPainter *P, char Byte, KHEChar /*B*/, const QColor &Color ) const +void KValueColumn::drawByte( TQPainter *P, char Byte, KHEChar /*B*/, const TQColor &Color ) const { ByteCodec->encode( CodedByte, 0, Byte ); drawCode( P, CodedByte, Color ); } -void KValueColumn::drawCode( QPainter *P, const QString &Code, const QColor &Color ) const +void KValueColumn::drawCode( TQPainter *P, const TQString &Code, const TQColor &Color ) const { P->setPen( Color ); if( Coding == BinaryCoding ) diff --git a/khexedit/lib/kvaluecolumn.h b/khexedit/lib/kvaluecolumn.h index cc25929..7aa287e 100644 --- a/khexedit/lib/kvaluecolumn.h +++ b/khexedit/lib/kvaluecolumn.h @@ -40,7 +40,7 @@ class KValueColumn : public KBufferColumn virtual ~KValueColumn(); public: - void paintEditedByte( QPainter *P, char Byte, const QString &EditBuffer ); + void paintEditedByte( TQPainter *P, char Byte, const TQString &EditBuffer ); public: // modification access /** @@ -61,11 +61,11 @@ class KValueColumn : public KBufferColumn protected: // KBufferColumn API - virtual void drawByte( QPainter *P, char Byte, KHEChar B, const QColor &Color ) const; + virtual void drawByte( TQPainter *P, char Byte, KHEChar B, const TQColor &Color ) const; virtual void recalcByteWidth(); protected: - void drawCode( QPainter *P, const QString &Code, const QColor &Color ) const; + void drawCode( TQPainter *P, const TQString &Code, const TQColor &Color ) const; protected: // set data /** */ @@ -77,7 +77,7 @@ class KValueColumn : public KBufferColumn protected: // buffered data /** buffer to hold the formatted coding */ - mutable QString CodedByte; + mutable TQString CodedByte; /** calculated: Offset in pixels of the second half of the binary */ KPixelX BinaryHalfOffset; }; diff --git a/khexedit/listview.cc b/khexedit/listview.cc index 50de78a..e02e1c7 100644 --- a/khexedit/listview.cc +++ b/khexedit/listview.cc @@ -18,13 +18,13 @@ * */ -#include <qheader.h> +#include <tqheader.h> #include "listview.h" -CListView::CListView( QWidget *parent, const char *name, int visibleItem ) +CListView::CListView( TQWidget *parent, const char *name, int visibleItem ) :KListView( parent, name ), mVisibleItem(QMAX( 1, visibleItem )) { setVisibleItem(visibleItem); @@ -35,15 +35,15 @@ void CListView::setVisibleItem( int visibleItem, bool updateSize ) mVisibleItem = QMAX( 1, visibleItem ); if( updateSize == true ) { - QSize s = sizeHint(); + TQSize s = sizeHint(); setMinimumSize( s.width() + verticalScrollBar()->sizeHint().width() + lineWidth() * 2, s.height() ); } } -QSize CListView::sizeHint( void ) const +TQSize CListView::sizeHint( void ) const { - QSize s = QListView::sizeHint(); + TQSize s = TQListView::sizeHint(); int h = fontMetrics().height() + 2*itemMargin(); if( h % 2 > 0 ) { h++; } diff --git a/khexedit/listview.h b/khexedit/listview.h index 253fce9..e87a17d 100644 --- a/khexedit/listview.h +++ b/khexedit/listview.h @@ -28,10 +28,10 @@ class CListView : public KListView Q_OBJECT public: - CListView( QWidget *parent=0, const char *name=0, int visibleItem=10 ); + CListView( TQWidget *parent=0, const char *name=0, int visibleItem=10 ); void setVisibleItem( int visibleItem, bool updateSize=true ); - virtual QSize sizeHint( void ) const; + virtual TQSize sizeHint( void ) const; private: int mVisibleItem; diff --git a/khexedit/main.cc b/khexedit/main.cc index 525868f..fae17fe 100644 --- a/khexedit/main.cc +++ b/khexedit/main.cc @@ -91,7 +91,7 @@ int main( int argc, char **argv ) if (args->isSet("offset")) { - QCString offsetStr = args->getOption("offset"); + TQCString offsetStr = args->getOption("offset"); uint _offset = parseDecimalOrHexadecimal(offsetStr.data() ); hexEdit->setStartupOffset( _offset ); } diff --git a/khexedit/optiondialog.cc b/khexedit/optiondialog.cc index 2038b2d..c1bbb39 100644 --- a/khexedit/optiondialog.cc +++ b/khexedit/optiondialog.cc @@ -20,16 +20,16 @@ #include <limits.h> -#include <qvbox.h> -#include <qvbuttongroup.h> -#include <qpainter.h> +#include <tqvbox.h> +#include <tqvbuttongroup.h> +#include <tqpainter.h> -#include <qcheckbox.h> -#include <qlayout.h> -#include <qlabel.h> -#include <qradiobutton.h> -#include <qspinbox.h> -#include <qwhatsthis.h> +#include <tqcheckbox.h> +#include <tqlayout.h> +#include <tqlabel.h> +#include <tqradiobutton.h> +#include <tqspinbox.h> +#include <tqwhatsthis.h> #include <kcolordialog.h> #include <kcolordrag.h> @@ -39,22 +39,22 @@ #include <kglobalsettings.h> #include "optiondialog.h" -#include <qpushbutton.h> -#include <qcombobox.h> +#include <tqpushbutton.h> +#include <tqcombobox.h> #if 0 -#include <qobjectlist.h> -static void enableWidget( QWidget *w, bool state ) +#include <tqobjectlist.h> +static void enableWidget( TQWidget *w, bool state ) { if( w->children() ) { - QObjectList *l = (QObjectList*)w->children(); // silence please + TQObjectList *l = (TQObjectList*)w->children(); // silence please for( uint i=0; i < l->count(); i++ ) { - QObject *o = l->at(i); + TQObject *o = l->at(i); if( o->isWidgetType() ) { - enableWidget( (QWidget*)o, state ); + enableWidget( (TQWidget*)o, state ); } } } @@ -64,11 +64,11 @@ static void enableWidget( QWidget *w, bool state ) -COptionDialog::COptionDialog( QWidget *parent, char *name, bool modal ) +COptionDialog::COptionDialog( TQWidget *parent, char *name, bool modal ) :KDialogBase( IconList, i18n("Configure"), Help|Default|Apply|Ok|Cancel, Ok, parent, name, modal, true ) { - setHelp( "khexedit/khexedit.html", QString::null ); + setHelp( "khexedit/khexedit.html", TQString::null ); setupLayoutPage(); setupCursorPage(); @@ -91,7 +91,7 @@ void COptionDialog::slotChanged() configChanged = true; } -void COptionDialog::showEvent( QShowEvent *e ) +void COptionDialog::showEvent( TQShowEvent *e ) { KDialogBase::showEvent(e); showPage(0); @@ -101,148 +101,148 @@ void COptionDialog::showEvent( QShowEvent *e ) void COptionDialog::setupLayoutPage( void ) { - QString text; - QFrame *page = addPage( i18n("Layout"), i18n("Data Layout in Editor"), + TQString text; + TQFrame *page = addPage( i18n("Layout"), i18n("Data Layout in Editor"), BarIcon("khexedit", KIcon::SizeMedium ) ); - QGridLayout *gbox = new QGridLayout( page, 15, 2, 0, spacingHint() ); + TQGridLayout *gbox = new TQGridLayout( page, 15, 2, 0, spacingHint() ); gbox->setColStretch( 1, 10 ); - mLayout.formatCombo = new QComboBox( false, page ); - QStringList modeList; + mLayout.formatCombo = new TQComboBox( false, page ); + TQStringList modeList; modeList.append( i18n("Hexadecimal Mode") ); modeList.append( i18n("Decimal Mode") ); modeList.append( i18n("Octal Mode") ); modeList.append( i18n("Binary Mode") ); modeList.append( i18n("Text Only Mode") ); mLayout.formatCombo->insertStringList( modeList ); - connect( mLayout.formatCombo, SIGNAL(activated(int)), - SLOT(slotModeSelectorChanged(int)) ); - connect( mLayout.formatCombo, SIGNAL(activated(int)), - SLOT(slotChanged()) ); + connect( mLayout.formatCombo, TQT_SIGNAL(activated(int)), + TQT_SLOT(slotModeSelectorChanged(int)) ); + connect( mLayout.formatCombo, TQT_SIGNAL(activated(int)), + TQT_SLOT(slotChanged()) ); gbox->addWidget( mLayout.formatCombo, 0, 1 ); // // I am setting the min. width for one widget in the second column // This widtk will be used by every widget in this column. // - mLayout.lineSizeSpin = new QSpinBox( page ); + mLayout.lineSizeSpin = new TQSpinBox( page ); mLayout.lineSizeSpin->setMinimumWidth( fontMetrics().width("M") * 10 ); mLayout.lineSizeSpin->setRange( 1, 10000 ); - connect( mLayout.lineSizeSpin, SIGNAL(valueChanged(int)), - SLOT(slotLineSizeChanged(int) ) ); - connect( mLayout.lineSizeSpin, SIGNAL(valueChanged(int)), - SLOT(slotChanged()) ); + connect( mLayout.lineSizeSpin, TQT_SIGNAL(valueChanged(int)), + TQT_SLOT(slotLineSizeChanged(int) ) ); + connect( mLayout.lineSizeSpin, TQT_SIGNAL(valueChanged(int)), + TQT_SLOT(slotChanged()) ); gbox->addWidget( mLayout.lineSizeSpin, 1, 1 ); - mLayout.columnSizeSpin = new QSpinBox( page ); + mLayout.columnSizeSpin = new TQSpinBox( page ); mLayout.columnSizeSpin->setRange( 1, 10000 ); - connect( mLayout.columnSizeSpin, SIGNAL(valueChanged(int)), - SLOT(slotColumnSizeChanged(int) ) ); - connect( mLayout.columnSizeSpin, SIGNAL(valueChanged(int)), - SLOT(slotChanged() ) ); + connect( mLayout.columnSizeSpin, TQT_SIGNAL(valueChanged(int)), + TQT_SLOT(slotColumnSizeChanged(int) ) ); + connect( mLayout.columnSizeSpin, TQT_SIGNAL(valueChanged(int)), + TQT_SLOT(slotChanged() ) ); gbox->addWidget( mLayout.columnSizeSpin, 2, 1 ); text = i18n("Default l&ine size [bytes]:"); - QLabel *label = new QLabel( mLayout.lineSizeSpin, text, page ); + TQLabel *label = new TQLabel( mLayout.lineSizeSpin, text, page ); gbox->addWidget( label, 1, 0 ); text = i18n("Colu&mn size [bytes]:"); - label = new QLabel( mLayout.columnSizeSpin, text, page ); + label = new TQLabel( mLayout.columnSizeSpin, text, page ); gbox->addWidget( label, 2, 0 ); - QFrame *hline = new QFrame( page ); - hline->setFrameStyle( QFrame::Sunken | QFrame::HLine ); + TQFrame *hline = new TQFrame( page ); + hline->setFrameStyle( TQFrame::Sunken | TQFrame::HLine ); gbox->addMultiCellWidget( hline, 3, 3, 0, 1 ); text = i18n("Line size is &fixed (use scrollbar when required)"); - mLayout.lockLineCheck = new QCheckBox( text, page ); + mLayout.lockLineCheck = new TQCheckBox( text, page ); gbox->addMultiCellWidget( mLayout.lockLineCheck, 4, 4, 0, 1, AlignLeft ); - connect( mLayout.lockLineCheck, SIGNAL(toggled(bool)), - SLOT(slotChanged()) ); + connect( mLayout.lockLineCheck, TQT_SIGNAL(toggled(bool)), + TQT_SLOT(slotChanged()) ); text = i18n("Loc&k column at end of line (when column size>1)"); - mLayout.lockColumnCheck = new QCheckBox( text, page ); + mLayout.lockColumnCheck = new TQCheckBox( text, page ); gbox->addMultiCellWidget( mLayout.lockColumnCheck, 5, 5, 0, 1 ); - connect( mLayout.lockColumnCheck, SIGNAL(toggled(bool)), - SLOT(slotChanged()) ); + connect( mLayout.lockColumnCheck, TQT_SIGNAL(toggled(bool)), + TQT_SLOT(slotChanged()) ); - hline = new QFrame( page ); - hline->setFrameStyle( QFrame::Sunken | QFrame::HLine ); + hline = new TQFrame( page ); + hline->setFrameStyle( TQFrame::Sunken | TQFrame::HLine ); gbox->addMultiCellWidget( hline, 6, 6, 0, 1 ); - QStringList gridList; + TQStringList gridList; gridList.append( i18n("None") ); gridList.append( i18n("Vertical Only") ); gridList.append( i18n("Horizontal Only") ); gridList.append( i18n("Both Directions") ); - mLayout.gridCombo = new QComboBox( false, page ); + mLayout.gridCombo = new TQComboBox( false, page ); mLayout.gridCombo->insertStringList( gridList ); - connect( mLayout.gridCombo, SIGNAL(activated(int)), - SLOT(slotChanged()) ); + connect( mLayout.gridCombo, TQT_SIGNAL(activated(int)), + TQT_SLOT(slotChanged()) ); text = i18n("&Gridlines between text:"); - label = new QLabel( mLayout.gridCombo, text, page ); + label = new TQLabel( mLayout.gridCombo, text, page ); gbox->addWidget( label, 7, 0 ); gbox->addWidget( mLayout.gridCombo, 7, 1 ); - mLayout.leftSepWidthSpin = new QSpinBox( page ); + mLayout.leftSepWidthSpin = new TQSpinBox( page ); mLayout.leftSepWidthSpin->setRange( 0, 20 ); gbox->addWidget( mLayout.leftSepWidthSpin, 8, 1 ); - connect( mLayout.leftSepWidthSpin, SIGNAL(valueChanged(int)), - SLOT(slotChanged()) ); + connect( mLayout.leftSepWidthSpin, TQT_SIGNAL(valueChanged(int)), + TQT_SLOT(slotChanged()) ); - mLayout.rightSepWidthSpin = new QSpinBox( page ); + mLayout.rightSepWidthSpin = new TQSpinBox( page ); mLayout.rightSepWidthSpin->setRange( 0, 20 ); gbox->addWidget( mLayout.rightSepWidthSpin, 9, 1 ); - connect( mLayout.rightSepWidthSpin, SIGNAL(valueChanged(int)), - SLOT(slotChanged()) ); + connect( mLayout.rightSepWidthSpin, TQT_SIGNAL(valueChanged(int)), + TQT_SLOT(slotChanged()) ); text = i18n("&Left separator width [pixels]:"); - mLayout.leftSepLabel = new QLabel( mLayout.leftSepWidthSpin, text, page ); + mLayout.leftSepLabel = new TQLabel( mLayout.leftSepWidthSpin, text, page ); gbox->addWidget( mLayout.leftSepLabel, 8, 0 ); text = i18n("&Right separator width [pixels]:"); - mLayout.rightSepLabel = new QLabel( mLayout.rightSepWidthSpin, text, page ); + mLayout.rightSepLabel = new TQLabel( mLayout.rightSepWidthSpin, text, page ); gbox->addWidget( mLayout.rightSepLabel, 9, 0 ); - mLayout.separatorSpin = new QSpinBox( page ); + mLayout.separatorSpin = new TQSpinBox( page ); mLayout.separatorSpin->setRange( 0, 20 ); gbox->addWidget( mLayout.separatorSpin, 10, 1 ); - connect( mLayout.separatorSpin, SIGNAL(valueChanged(int)), - SLOT(slotChanged()) ); + connect( mLayout.separatorSpin, TQT_SIGNAL(valueChanged(int)), + TQT_SLOT(slotChanged()) ); - mLayout.edgeSpin = new QSpinBox( page ); + mLayout.edgeSpin = new TQSpinBox( page ); mLayout.edgeSpin->setRange( 0, 20 ); gbox->addWidget( mLayout.edgeSpin, 11, 1 ); - connect( mLayout.edgeSpin, SIGNAL(valueChanged(int)), - SLOT(slotChanged()) ); + connect( mLayout.edgeSpin, TQT_SIGNAL(valueChanged(int)), + TQT_SLOT(slotChanged()) ); text = i18n("&Separator margin width [pixels]:"); - label = new QLabel( mLayout.separatorSpin, text, page ); + label = new TQLabel( mLayout.separatorSpin, text, page ); gbox->addWidget( label, 10, 0 ); text = i18n("&Edge margin width [pixels]:"); - label = new QLabel( mLayout.edgeSpin, text, page ); + label = new TQLabel( mLayout.edgeSpin, text, page ); gbox->addWidget( label, 11, 0 ); text = i18n("Column separation is e&qual to one character"); - mLayout.columnCheck = new QCheckBox( text, page ); + mLayout.columnCheck = new TQCheckBox( text, page ); gbox->addMultiCellWidget( mLayout.columnCheck, 12, 12, 0, 1, AlignLeft ); - connect( mLayout.columnCheck, SIGNAL(toggled(bool)), - SLOT( slotColumnSepCheck(bool))); - connect( mLayout.columnCheck, SIGNAL(toggled(bool)), - SLOT( slotChanged())); + connect( mLayout.columnCheck, TQT_SIGNAL(toggled(bool)), + TQT_SLOT( slotColumnSepCheck(bool))); + connect( mLayout.columnCheck, TQT_SIGNAL(toggled(bool)), + TQT_SLOT( slotChanged())); - mLayout.columnSepSpin = new QSpinBox( page ); + mLayout.columnSepSpin = new TQSpinBox( page ); mLayout.columnSepSpin->setRange( 1, 100 ); - connect( mLayout.columnSepSpin, SIGNAL(valueChanged(int)), - SLOT(slotChanged()) ); + connect( mLayout.columnSepSpin, TQT_SIGNAL(valueChanged(int)), + TQT_SLOT(slotChanged()) ); text = i18n("Column separa&tion [pixels]:"); - mLayout.columnSepLabel = new QLabel( mLayout.columnSepSpin, text, page ); + mLayout.columnSepLabel = new TQLabel( mLayout.columnSepSpin, text, page ); gbox->addWidget( mLayout.columnSepLabel, 13, 0 ); gbox->addWidget( mLayout.columnSepSpin, 13, 1 ); @@ -253,65 +253,65 @@ void COptionDialog::setupLayoutPage( void ) void COptionDialog::setupCursorPage( void ) { - QString text; - QFrame *page = addPage( i18n("Cursor"), + TQString text; + TQFrame *page = addPage( i18n("Cursor"), i18n("Cursor Behavior (only valid for editor)"), BarIcon("mouse", KIcon::SizeMedium ) ); - QVBoxLayout *topLayout = new QVBoxLayout( page, 0, spacingHint() ); + TQVBoxLayout *topLayout = new TQVBoxLayout( page, 0, spacingHint() ); - QVButtonGroup *group = new QVButtonGroup( i18n("Blinking"), page ); + TQVButtonGroup *group = new TQVButtonGroup( i18n("Blinking"), page ); group->layout()->setMargin( spacingHint() ); topLayout->addWidget( group ); text = i18n("Do not b&link"); - mCursor.blinkCheck = new QCheckBox( i18n("Do not b&link"), group ); - connect( mCursor.blinkCheck, SIGNAL(toggled(bool)), - SLOT( slotBlinkIntervalCheck(bool))); - connect( mCursor.blinkCheck, SIGNAL(toggled(bool)), - SLOT( slotChanged())); - - QHBox *hbox = new QHBox( group ); - mCursor.blinkLabel = new QLabel( i18n("&Blink interval [ms]:" ), hbox ); - mCursor.blinkSpin = new QSpinBox( hbox ); + mCursor.blinkCheck = new TQCheckBox( i18n("Do not b&link"), group ); + connect( mCursor.blinkCheck, TQT_SIGNAL(toggled(bool)), + TQT_SLOT( slotBlinkIntervalCheck(bool))); + connect( mCursor.blinkCheck, TQT_SIGNAL(toggled(bool)), + TQT_SLOT( slotChanged())); + + TQHBox *hbox = new TQHBox( group ); + mCursor.blinkLabel = new TQLabel( i18n("&Blink interval [ms]:" ), hbox ); + mCursor.blinkSpin = new TQSpinBox( hbox ); mCursor.blinkSpin->setMinimumWidth( fontMetrics().width("M") * 10 ); mCursor.blinkSpin->setRange( 100, 1000 ); mCursor.blinkSpin->setSteps( 100, 100 ); mCursor.blinkSpin->setValue( 500 ); mCursor.blinkLabel->setBuddy(mCursor.blinkSpin); - connect( mCursor.blinkSpin, SIGNAL(valueChanged(int)), - SLOT( slotChanged())); + connect( mCursor.blinkSpin, TQT_SIGNAL(valueChanged(int)), + TQT_SLOT( slotChanged())); - group = new QVButtonGroup( i18n("Shape"), page ); + group = new TQVButtonGroup( i18n("Shape"), page ); group->layout()->setMargin( spacingHint() ); topLayout->addWidget( group ); text = i18n("Always &use block (rectangular) cursor"); - mCursor.blockCheck = new QCheckBox( text, group ); - connect( mCursor.blockCheck, SIGNAL(toggled(bool)), - SLOT( slotBlockCursorCheck(bool))); - connect( mCursor.blockCheck, SIGNAL(toggled(bool)), - SLOT( slotChanged())); + mCursor.blockCheck = new TQCheckBox( text, group ); + connect( mCursor.blockCheck, TQT_SIGNAL(toggled(bool)), + TQT_SLOT( slotBlockCursorCheck(bool))); + connect( mCursor.blockCheck, TQT_SIGNAL(toggled(bool)), + TQT_SLOT( slotChanged())); text = i18n("Use &thick cursor in insert mode"); - mCursor.thickCheck = new QCheckBox( text, group ); - connect( mCursor.thickCheck, SIGNAL(toggled(bool)), - SLOT( slotChanged())); + mCursor.thickCheck = new TQCheckBox( text, group ); + connect( mCursor.thickCheck, TQT_SIGNAL(toggled(bool)), + TQT_SLOT( slotChanged())); text = i18n("Cursor Behavior When Editor Loses Focus"); - group = new QVButtonGroup( text, page ); + group = new TQVButtonGroup( text, page ); group->layout()->setMargin( spacingHint() ); topLayout->addWidget( group ); text = i18n("&Stop blinking (if blinking is enabled)"); - mCursor.stopRadio = new QRadioButton( text, group, "radio1" ); - mCursor.hideRadio = new QRadioButton( i18n("H&ide"), group, "radio2" ); + mCursor.stopRadio = new TQRadioButton( text, group, "radio1" ); + mCursor.hideRadio = new TQRadioButton( i18n("H&ide"), group, "radio2" ); text = i18n("Do ¬hing"); - mCursor.nothingRadio = new QRadioButton( text, group, "radio3" ); - connect( mCursor.stopRadio, SIGNAL(toggled(bool)), - SLOT( slotChanged())); - connect( mCursor.hideRadio, SIGNAL(toggled(bool)), - SLOT( slotChanged())); - connect( mCursor.nothingRadio, SIGNAL(toggled(bool)), - SLOT( slotChanged())); + mCursor.nothingRadio = new TQRadioButton( text, group, "radio3" ); + connect( mCursor.stopRadio, TQT_SIGNAL(toggled(bool)), + TQT_SLOT( slotChanged())); + connect( mCursor.hideRadio, TQT_SIGNAL(toggled(bool)), + TQT_SLOT( slotChanged())); + connect( mCursor.nothingRadio, TQT_SIGNAL(toggled(bool)), + TQT_SLOT( slotChanged())); topLayout->addStretch(10); } @@ -319,26 +319,26 @@ void COptionDialog::setupCursorPage( void ) void COptionDialog::setupColorPage( void ) { - QString text; - QFrame *page = addPage( i18n("Colors"), + TQString text; + TQFrame *page = addPage( i18n("Colors"), i18n("Editor Colors (system selection color is always used)"), BarIcon("colorize", KIcon::SizeMedium ) ); - QVBoxLayout *topLayout = new QVBoxLayout( page, 0, spacingHint() ); + TQVBoxLayout *topLayout = new TQVBoxLayout( page, 0, spacingHint() ); text = i18n("&Use system colors (as chosen in Control Center)"); - mColor.checkSystem = new QCheckBox( text, page ); - connect( mColor.checkSystem, SIGNAL(toggled(bool)), - SLOT( slotColorSystem(bool))); - connect( mColor.checkSystem, SIGNAL(toggled(bool)), - SLOT( slotChanged())); + mColor.checkSystem = new TQCheckBox( text, page ); + connect( mColor.checkSystem, TQT_SIGNAL(toggled(bool)), + TQT_SLOT( slotColorSystem(bool))); + connect( mColor.checkSystem, TQT_SIGNAL(toggled(bool)), + TQT_SLOT( slotChanged())); topLayout->addWidget( mColor.checkSystem ); - QFrame *hline = new QFrame( page ); - hline->setFrameStyle( QFrame::Sunken | QFrame::HLine ); + TQFrame *hline = new TQFrame( page ); + hline->setFrameStyle( TQFrame::Sunken | TQFrame::HLine ); topLayout->addWidget( hline ); - QStringList modeList; + TQStringList modeList; modeList.append( i18n("First, Third ... Line Background") ); modeList.append( i18n("Second, Fourth ... Line Background") ); modeList.append( i18n("Offset Background") ); @@ -365,54 +365,54 @@ void COptionDialog::setupColorPage( void ) mColor.colorList->insertItem( listItem ); } mColor.colorList->setCurrentItem(0); - connect( mColor.colorList, SIGNAL( dataChanged() ), this, SLOT( slotChanged() ) ); + connect( mColor.colorList, TQT_SIGNAL( dataChanged() ), this, TQT_SLOT( slotChanged() ) ); } void COptionDialog::setupFontPage( void ) { - QString text; - QFrame *page = addPage( i18n("Font"), + TQString text; + TQFrame *page = addPage( i18n("Font"), i18n("Font Selection (editor can only use a fixed font)"), BarIcon("fonts", KIcon::SizeMedium ) ); - QVBoxLayout *topLayout = new QVBoxLayout( page, 0, spacingHint() ); + TQVBoxLayout *topLayout = new TQVBoxLayout( page, 0, spacingHint() ); text = i18n("&Use system font (as chosen in Control Center)"); - mFont.checkSystem = new QCheckBox( text, page ); - connect( mFont.checkSystem, SIGNAL(toggled(bool)), - this, SLOT( slotFontSystem(bool))); - connect( mFont.checkSystem, SIGNAL(toggled(bool)), - this, SLOT( slotChanged())); + mFont.checkSystem = new TQCheckBox( text, page ); + connect( mFont.checkSystem, TQT_SIGNAL(toggled(bool)), + this, TQT_SLOT( slotFontSystem(bool))); + connect( mFont.checkSystem, TQT_SIGNAL(toggled(bool)), + this, TQT_SLOT( slotChanged())); topLayout->addWidget( mFont.checkSystem ); - QFrame *hline = new QFrame( page ); - hline->setFrameStyle( QFrame::Sunken | QFrame::HLine ); + TQFrame *hline = new TQFrame( page ); + hline->setFrameStyle( TQFrame::Sunken | TQFrame::HLine ); topLayout->addWidget( hline ); - mFont.chooser = new KFontChooser( page, "font", true, QStringList(), false, 4 ); + mFont.chooser = new KFontChooser( page, "font", true, TQStringList(), false, 4 ); topLayout->addWidget( mFont.chooser ); - QFont fixFont( KGlobalSettings::fixedFont() ); + TQFont fixFont( KGlobalSettings::fixedFont() ); fixFont.setBold(true); mFont.chooser->setFont( fixFont, true ); mFont.chooser->setSampleText( i18n("KHexEdit editor font") ); - connect( mFont.chooser, SIGNAL(fontSelected(const QFont &)), - this, SLOT( slotChanged())); + connect( mFont.chooser, TQT_SIGNAL(fontSelected(const TQFont &)), + this, TQT_SLOT( slotChanged())); - hline = new QFrame( page ); - hline->setFrameStyle( QFrame::Sunken | QFrame::HLine ); + hline = new TQFrame( page ); + hline->setFrameStyle( TQFrame::Sunken | TQFrame::HLine ); topLayout->addWidget( hline ); - QHBoxLayout *hbox = new QHBoxLayout(); + TQHBoxLayout *hbox = new TQHBoxLayout(); topLayout->addLayout( hbox ); - mFont.nonPrintInput = new QLineEdit( page ); + mFont.nonPrintInput = new TQLineEdit( page ); mFont.nonPrintInput->setMaxLength( 1 ); - connect( mFont.nonPrintInput, SIGNAL(textChanged(const QString &)), - this, SLOT( slotChanged())); + connect( mFont.nonPrintInput, TQT_SIGNAL(textChanged(const TQString &)), + this, TQT_SLOT( slotChanged())); text = i18n("&Map non printable characters to:"); - QLabel *nonPrintLabel = new QLabel( mFont.nonPrintInput, text, page ); + TQLabel *nonPrintLabel = new TQLabel( mFont.nonPrintInput, text, page ); hbox->addWidget( nonPrintLabel, 0, AlignLeft ); hbox->addSpacing( spacingHint() ); @@ -424,88 +424,88 @@ void COptionDialog::setupFontPage( void ) void COptionDialog::setupFilePage( void ) { - QString text; - QFrame *page = addPage( i18n("Files"), i18n("File Management"), + TQString text; + TQFrame *page = addPage( i18n("Files"), i18n("File Management"), BarIcon("kmultiple", KIcon::SizeMedium ) ); - QVBoxLayout *topLayout = new QVBoxLayout( page, 0, spacingHint() ); + TQVBoxLayout *topLayout = new TQVBoxLayout( page, 0, spacingHint() ); - QGridLayout *gbox = new QGridLayout( 2, 2, spacingHint() ); + TQGridLayout *gbox = new TQGridLayout( 2, 2, spacingHint() ); topLayout->addLayout( gbox ); - mFile.openCombo = new QComboBox( false, page ); - QStringList modeList; + mFile.openCombo = new TQComboBox( false, page ); + TQStringList modeList; modeList.append( i18n("None") ); modeList.append( i18n("Most Recent Document") ); modeList.append( i18n("All Recent Documents") ); mFile.openCombo->insertStringList( modeList ); mFile.openCombo->setMinimumWidth( mFile.openCombo->sizeHint().width() ); - connect( mFile.openCombo, SIGNAL(activated(int)), - this, SLOT( slotChanged())); + connect( mFile.openCombo, TQT_SIGNAL(activated(int)), + this, TQT_SLOT( slotChanged())); text = i18n("Open doc&uments on startup:"); - QLabel *label = new QLabel( mFile.openCombo, text, page ); + TQLabel *label = new TQLabel( mFile.openCombo, text, page ); gbox->addWidget( label, 0, 0 ); gbox->addWidget( mFile.openCombo, 0, 1 ); text = i18n("&Jump to previous cursor position on startup"); - mFile.gotoOffsetCheck = new QCheckBox( text, page ); + mFile.gotoOffsetCheck = new TQCheckBox( text, page ); // ### TODO: this is currently not available. mFile.gotoOffsetCheck->setChecked( false ); mFile.gotoOffsetCheck->setEnabled( false ); // ### END topLayout->addWidget( mFile.gotoOffsetCheck, 0, AlignLeft ); - connect( mFile.gotoOffsetCheck, SIGNAL(toggled(bool)), - this, SLOT( slotChanged())); + connect( mFile.gotoOffsetCheck, TQT_SIGNAL(toggled(bool)), + this, TQT_SLOT( slotChanged())); - QFrame *hline = new QFrame( page ); - hline->setFrameStyle( QFrame::Sunken | QFrame::HLine ); + TQFrame *hline = new TQFrame( page ); + hline->setFrameStyle( TQFrame::Sunken | TQFrame::HLine ); topLayout->addWidget( hline ); text = i18n("Open document with &write protection enabled"); - mFile.writeProtectCheck = new QCheckBox( text, page ); + mFile.writeProtectCheck = new TQCheckBox( text, page ); topLayout->addWidget( mFile.writeProtectCheck, 0, AlignLeft ); - connect( mFile.writeProtectCheck, SIGNAL(toggled(bool)), - this, SLOT( slotChanged())); + connect( mFile.writeProtectCheck, TQT_SIGNAL(toggled(bool)), + this, TQT_SLOT( slotChanged())); text = i18n("&Keep cursor position after reloading document"); - mFile.reloadOffsetCheck = new QCheckBox( text, page ); + mFile.reloadOffsetCheck = new TQCheckBox( text, page ); topLayout->addWidget( mFile.reloadOffsetCheck, 0, AlignLeft ); - connect( mFile.reloadOffsetCheck, SIGNAL(toggled(bool)), - this, SLOT( slotChanged())); + connect( mFile.reloadOffsetCheck, TQT_SIGNAL(toggled(bool)), + this, TQT_SLOT( slotChanged())); text = i18n("&Make a backup when saving document"); - mFile.backupCheck = new QCheckBox( text, page ); + mFile.backupCheck = new TQCheckBox( text, page ); topLayout->addWidget( mFile.backupCheck, 0, AlignLeft ); - connect( mFile.backupCheck, SIGNAL(toggled(bool)), - this, SLOT( slotChanged())); + connect( mFile.backupCheck, TQT_SIGNAL(toggled(bool)), + this, TQT_SLOT( slotChanged())); - hline = new QFrame( page ); - hline->setFrameStyle( QFrame::Sunken | QFrame::HLine ); + hline = new TQFrame( page ); + hline->setFrameStyle( TQFrame::Sunken | TQFrame::HLine ); topLayout->addWidget( hline ); text = i18n("Don't &save \"Recent\" document list on exit"); - mFile.discardRecentCheck = new QCheckBox( text, page ); + mFile.discardRecentCheck = new TQCheckBox( text, page ); topLayout->addWidget( mFile.discardRecentCheck, 0, AlignLeft ); - QWhatsThis::add( mFile.discardRecentCheck, + TQWhatsThis::add( mFile.discardRecentCheck, i18n( "Clicking this check box makes KHexEdit forget his recent document list " "when the program is closed.\n" "Note: it will not erase any document of the recent document list " "created by KDE." ) ); - connect( mFile.discardRecentCheck, SIGNAL(toggled(bool)), - this, SLOT( slotChanged())); + connect( mFile.discardRecentCheck, TQT_SIGNAL(toggled(bool)), + this, TQT_SLOT( slotChanged())); text = i18n("Cl&ear \"Recent\" Document List"); - QPushButton *discardRecentButton = new QPushButton( page ); + TQPushButton *discardRecentButton = new TQPushButton( page ); discardRecentButton->setText( text ); - QWhatsThis::add( discardRecentButton, + TQWhatsThis::add( discardRecentButton, i18n( "Clicking this button makes KHexEdit forget his recent document list.\n" "Note: it will not erase any document of the recent document list " "created by KDE." ) ); topLayout->addWidget( discardRecentButton, 0, AlignCenter ); - connect( discardRecentButton, SIGNAL(clicked()), - SIGNAL(removeRecentFiles()) ); + connect( discardRecentButton, TQT_SIGNAL(clicked()), + TQT_SIGNAL(removeRecentFiles()) ); topLayout->addStretch(10); } @@ -514,101 +514,101 @@ void COptionDialog::setupFilePage( void ) void COptionDialog::setupMiscPage( void ) { - QString text; - QLabel *label; + TQString text; + TQLabel *label; - QFrame *page = addPage( i18n("Miscellaneous"), i18n("Various Properties"), + TQFrame *page = addPage( i18n("Miscellaneous"), i18n("Various Properties"), BarIcon("gear", KIcon::SizeMedium ) ); - QVBoxLayout *topLayout = new QVBoxLayout( page, 0, spacingHint() ); + TQVBoxLayout *topLayout = new TQVBoxLayout( page, 0, spacingHint() ); text = i18n("Auto&matic copy to clipboard when selection is ready"); - mMisc.autoCheck = new QCheckBox( text, page ); + mMisc.autoCheck = new TQCheckBox( text, page ); topLayout->addWidget( mMisc.autoCheck, 0, AlignLeft ); - connect( mMisc.autoCheck, SIGNAL(toggled(bool)), - this, SLOT( slotChanged())); + connect( mMisc.autoCheck, TQT_SIGNAL(toggled(bool)), + this, TQT_SLOT( slotChanged())); text = i18n("&Editor starts in \"insert\" mode" ); - mMisc.insertCheck = new QCheckBox( text, page ); + mMisc.insertCheck = new TQCheckBox( text, page ); topLayout->addWidget( mMisc.insertCheck, 0, AlignLeft ); - connect( mMisc.insertCheck, SIGNAL(toggled(bool)), - this, SLOT( slotChanged())); + connect( mMisc.insertCheck, TQT_SIGNAL(toggled(bool)), + this, TQT_SLOT( slotChanged())); text = i18n("Confirm &wrapping (to beginning or end) during search"); - mMisc.confirmWrapCheck = new QCheckBox( text, page ); + mMisc.confirmWrapCheck = new TQCheckBox( text, page ); topLayout->addWidget( mMisc.confirmWrapCheck, 0, AlignLeft ); - connect( mMisc.confirmWrapCheck, SIGNAL(toggled(bool)), - this, SLOT( slotChanged())); + connect( mMisc.confirmWrapCheck, TQT_SIGNAL(toggled(bool)), + this, TQT_SLOT( slotChanged())); text = i18n("Cursor jumps to &nearest byte when moved"); - mMisc.cursorJumpCheck = new QCheckBox( text, page ); + mMisc.cursorJumpCheck = new TQCheckBox( text, page ); topLayout->addWidget( mMisc.cursorJumpCheck, 0, AlignLeft ); - connect( mMisc.cursorJumpCheck, SIGNAL(toggled(bool)), - this, SLOT( slotChanged())); + connect( mMisc.cursorJumpCheck, TQT_SIGNAL(toggled(bool)), + this, TQT_SLOT( slotChanged())); - QVButtonGroup *group = new QVButtonGroup( i18n("Sounds"), page ); + TQVButtonGroup *group = new TQVButtonGroup( i18n("Sounds"), page ); group->layout()->setMargin( spacingHint() ); topLayout->addWidget( group ); text = i18n("Make sound on data &input (eg. typing) failure"); - mMisc.inputCheck = new QCheckBox( text, group ); - connect( mMisc.inputCheck, SIGNAL(toggled(bool)), - this, SLOT( slotChanged())); + mMisc.inputCheck = new TQCheckBox( text, group ); + connect( mMisc.inputCheck, TQT_SIGNAL(toggled(bool)), + this, TQT_SLOT( slotChanged())); text = i18n("Make sound on &fatal failure"); - mMisc.fatalCheck = new QCheckBox( text, group ); - connect( mMisc.fatalCheck, SIGNAL(toggled(bool)), - this, SLOT( slotChanged())); + mMisc.fatalCheck = new TQCheckBox( text, group ); + connect( mMisc.fatalCheck, TQT_SIGNAL(toggled(bool)), + this, TQT_SLOT( slotChanged())); - group = new QVButtonGroup( i18n("Bookmark Visibility"), page ); + group = new TQVButtonGroup( i18n("Bookmark Visibility"), page ); group->layout()->setMargin( spacingHint() ); topLayout->addWidget( group ); text = i18n("Use visible bookmarks in the offset column"); - mMisc.bookmarkColumnCheck = new QCheckBox( text, group ); - connect( mMisc.bookmarkColumnCheck, SIGNAL(toggled(bool)), - this, SLOT( slotChanged())); + mMisc.bookmarkColumnCheck = new TQCheckBox( text, group ); + connect( mMisc.bookmarkColumnCheck, TQT_SIGNAL(toggled(bool)), + this, TQT_SLOT( slotChanged())); text = i18n("Use visible bookmarks in the editor fields"); - mMisc.bookmarkEditorCheck = new QCheckBox( text, group ); - connect( mMisc.bookmarkEditorCheck, SIGNAL(toggled(bool)), - this, SLOT( slotChanged())); + mMisc.bookmarkEditorCheck = new TQCheckBox( text, group ); + connect( mMisc.bookmarkEditorCheck, TQT_SIGNAL(toggled(bool)), + this, TQT_SLOT( slotChanged())); text = i18n("Confirm when number of printed pages will e&xceed limit"); - mMisc.thresholdCheck = new QCheckBox( text, page ); - connect( mMisc.thresholdCheck, SIGNAL(clicked()), - SLOT( slotThresholdConfirm())); - connect( mMisc.thresholdCheck, SIGNAL(toggled(bool)), - this, SLOT( slotChanged())); + mMisc.thresholdCheck = new TQCheckBox( text, page ); + connect( mMisc.thresholdCheck, TQT_SIGNAL(clicked()), + TQT_SLOT( slotThresholdConfirm())); + connect( mMisc.thresholdCheck, TQT_SIGNAL(toggled(bool)), + this, TQT_SLOT( slotChanged())); topLayout->addWidget( mMisc.thresholdCheck, 0, AlignLeft ); - QGridLayout *glay = new QGridLayout( 3, 3 ); + TQGridLayout *glay = new TQGridLayout( 3, 3 ); glay->setColStretch(2,10); topLayout->addLayout( glay ); - mMisc.thresholdSpin = new QSpinBox( page ); + mMisc.thresholdSpin = new TQSpinBox( page ); mMisc.thresholdSpin->setMinimumWidth( fontMetrics().width("M") * 10 ); mMisc.thresholdSpin->setRange( 5, INT_MAX ); mMisc.thresholdSpin->setSteps( 5, 5 ); mMisc.thresholdSpin->setValue( 5 ); - connect( mMisc.thresholdSpin, SIGNAL(valueChanged(int)), - this, SLOT( slotChanged())); + connect( mMisc.thresholdSpin, TQT_SIGNAL(valueChanged(int)), + this, TQT_SLOT( slotChanged())); text = i18n("&Threshold [pages]:" ); - mMisc.thresholdLabel = new QLabel( mMisc.thresholdSpin, text, page ); + mMisc.thresholdLabel = new TQLabel( mMisc.thresholdSpin, text, page ); glay->addWidget( mMisc.thresholdLabel, 0, 0 ); glay->addWidget( mMisc.thresholdSpin, 0, 1 ); - QFrame *hline = new QFrame( page ); - hline->setFrameStyle( QFrame::Sunken | QFrame::HLine ); + TQFrame *hline = new TQFrame( page ); + hline->setFrameStyle( TQFrame::Sunken | TQFrame::HLine ); glay->addMultiCellWidget( hline, 1, 1, 0, 2 ); - mMisc.undoSpin = new QSpinBox( page ); + mMisc.undoSpin = new TQSpinBox( page ); mMisc.undoSpin->setRange( 10, 10000 ); mMisc.undoSpin->setSteps( 5, 5 ); mMisc.undoSpin->setValue( 50 ); - connect( mMisc.undoSpin, SIGNAL(valueChanged(int)), - this, SLOT( slotChanged())); + connect( mMisc.undoSpin, TQT_SIGNAL(valueChanged(int)), + this, TQT_SLOT( slotChanged())); - label = new QLabel( mMisc.undoSpin, i18n("&Undo limit:"), page ); + label = new TQLabel( mMisc.undoSpin, i18n("&Undo limit:"), page ); glay->addWidget( label, 2, 0 ); glay->addWidget( mMisc.undoSpin, 2, 1 ); @@ -838,7 +838,7 @@ void COptionDialog::slotApply( void ) f.useSystemFont = mFont.checkSystem->isChecked(); f.localFont = mFont.chooser->font(); - QString nonPrintText = mFont.nonPrintInput->text(); + TQString nonPrintText = mFont.nonPrintInput->text(); if( nonPrintText.isEmpty() ) { f.nonPrintChar = ' '; @@ -965,7 +965,7 @@ void COptionDialog::setFont( SDisplayFont &font ) mFont.checkSystem->setChecked( font.useSystemFont ); mFont.chooser->setFont( font.localFont, true ); - QString buf = font.nonPrintChar; + TQString buf = font.nonPrintChar; mFont.nonPrintInput->setText( buf ); } @@ -1050,10 +1050,10 @@ SDisplayCursor::EFocusMode COptionDialog::cursorFocusMode( void ) -CColorListBox::CColorListBox( QWidget *parent, const char *name, WFlags f ) +CColorListBox::CColorListBox( TQWidget *parent, const char *name, WFlags f ) :KListBox( parent, name, f ), mCurrentOnDragEnter(-1) { - connect( this, SIGNAL(selected(int)), this, SLOT(newColor(int)) ); + connect( this, TQT_SIGNAL(selected(int)), this, TQT_SLOT(newColor(int)) ); setAcceptDrops( true); } @@ -1065,7 +1065,7 @@ void CColorListBox::setEnabled( bool state ) return; } - QListBox::setEnabled( state ); + TQListBox::setEnabled( state ); for( uint i=0; i<count(); i++ ) { updateItem( i ); @@ -1073,7 +1073,7 @@ void CColorListBox::setEnabled( bool state ) } -void CColorListBox::setColor( uint index, const QColor &color ) +void CColorListBox::setColor( uint index, const TQColor &color ) { if( index < count() ) { @@ -1084,7 +1084,7 @@ void CColorListBox::setColor( uint index, const QColor &color ) } -const QColor CColorListBox::color( uint index ) +const TQColor CColorListBox::color( uint index ) { if( index < count() ) { @@ -1107,8 +1107,8 @@ void CColorListBox::newColor( int index ) if( (uint)index < count() ) { - QColor c = color( index ); - if( KColorDialog::getColor( c, this ) != QDialog::Rejected ) + TQColor c = color( index ); + if( KColorDialog::getColor( c, this ) != TQDialog::Rejected ) { setColor( index, c ); emit dataChanged(); @@ -1117,7 +1117,7 @@ void CColorListBox::newColor( int index ) } -void CColorListBox::dragEnterEvent( QDragEnterEvent *e ) +void CColorListBox::dragEnterEvent( TQDragEnterEvent *e ) { if( KColorDrag::canDecode(e) && isEnabled() ) { @@ -1132,7 +1132,7 @@ void CColorListBox::dragEnterEvent( QDragEnterEvent *e ) } -void CColorListBox::dragLeaveEvent( QDragLeaveEvent * ) +void CColorListBox::dragLeaveEvent( TQDragLeaveEvent * ) { if( mCurrentOnDragEnter != -1 ) { @@ -1142,7 +1142,7 @@ void CColorListBox::dragLeaveEvent( QDragLeaveEvent * ) } -void CColorListBox::dragMoveEvent( QDragMoveEvent *e ) +void CColorListBox::dragMoveEvent( TQDragMoveEvent *e ) { if( KColorDrag::canDecode(e) && isEnabled() ) { @@ -1155,9 +1155,9 @@ void CColorListBox::dragMoveEvent( QDragMoveEvent *e ) } -void CColorListBox::dropEvent( QDropEvent *e ) +void CColorListBox::dropEvent( TQDropEvent *e ) { - QColor color; + TQColor color; if( KColorDrag::decode( e, color ) ) { int index = currentItem(); @@ -1173,28 +1173,28 @@ void CColorListBox::dropEvent( QDropEvent *e ) -CColorListItem::CColorListItem( const QString &text, const QColor &color ) - : QListBoxItem(), mColor( color ), mBoxWidth( 30 ) +CColorListItem::CColorListItem( const TQString &text, const TQColor &color ) + : TQListBoxItem(), mColor( color ), mBoxWidth( 30 ) { setText( text ); } -const QColor &CColorListItem::color( void ) +const TQColor &CColorListItem::color( void ) { return( mColor ); } -void CColorListItem::setColor( const QColor &color ) +void CColorListItem::setColor( const TQColor &color ) { mColor = color; } -void CColorListItem::paint( QPainter *p ) +void CColorListItem::paint( TQPainter *p ) { - QFontMetrics fm = p->fontMetrics(); + TQFontMetrics fm = p->fontMetrics(); int h = fm.height(); p->drawText( mBoxWidth+3*2, fm.ascent() + fm.leading()/2, text() ); @@ -1205,13 +1205,13 @@ void CColorListItem::paint( QPainter *p ) } -int CColorListItem::height(const QListBox *lb ) const +int CColorListItem::height(const TQListBox *lb ) const { return( lb->fontMetrics().lineSpacing()+1 ); } -int CColorListItem::width(const QListBox *lb ) const +int CColorListItem::width(const TQListBox *lb ) const { return( mBoxWidth + lb->fontMetrics().width( text() ) + 6 ); } diff --git a/khexedit/optiondialog.h b/khexedit/optiondialog.h index ba62f62..72ffc4a 100644 --- a/khexedit/optiondialog.h +++ b/khexedit/optiondialog.h @@ -45,18 +45,18 @@ class CColorListBox : public KListBox Q_OBJECT public: - CColorListBox( QWidget *parent=0, const char * name=0, WFlags f=0 ); - void setColor( uint index, const QColor &color ); - const QColor color( uint index ); + CColorListBox( TQWidget *parent=0, const char * name=0, WFlags f=0 ); + void setColor( uint index, const TQColor &color ); + const TQColor color( uint index ); public slots: virtual void setEnabled( bool state ); protected: - void dragEnterEvent( QDragEnterEvent *e ); - void dragLeaveEvent( QDragLeaveEvent *e ); - void dragMoveEvent( QDragMoveEvent *e ); - void dropEvent( QDropEvent *e ); + void dragEnterEvent( TQDragEnterEvent *e ); + void dragLeaveEvent( TQDragLeaveEvent *e ); + void dragMoveEvent( TQDragMoveEvent *e ); + void dropEvent( TQDropEvent *e ); private slots: void newColor( int index ); @@ -72,17 +72,17 @@ class CColorListBox : public KListBox class CColorListItem : public QListBoxItem { public: - CColorListItem( const QString &text, const QColor &color=Qt::black ); - const QColor &color( void ); - void setColor( const QColor &color ); + CColorListItem( const TQString &text, const TQColor &color=Qt::black ); + const TQColor &color( void ); + void setColor( const TQColor &color ); protected: - virtual void paint( QPainter * ); - virtual int height( const QListBox * ) const; - virtual int width( const QListBox * ) const; + virtual void paint( TQPainter * ); + virtual int height( const TQListBox * ) const; + virtual int width( const TQListBox * ) const; private: - QColor mColor; + TQColor mColor; int mBoxWidth; }; @@ -105,7 +105,7 @@ class COptionDialog : public KDialogBase page_max }; - COptionDialog( QWidget *parent = 0, char *name = 0, bool modal = false ); + COptionDialog( TQWidget *parent = 0, char *name = 0, bool modal = false ); ~COptionDialog( void ); void setLayout( SDisplayLayout &layout, SDisplayLine &line ); @@ -117,7 +117,7 @@ class COptionDialog : public KDialogBase void setState( SDisplayState &state ); protected: - virtual void showEvent( QShowEvent *e ); + virtual void showEvent( TQShowEvent *e ); protected slots: void slotModeSelectorChanged( int index ); @@ -138,33 +138,33 @@ class COptionDialog : public KDialogBase private: struct SLayoutWidgets { - QComboBox *formatCombo; - QSpinBox *lineSizeSpin; - QSpinBox *columnSizeSpin; - QCheckBox *lockLineCheck; - QCheckBox *lockColumnCheck; - QCheckBox *columnCheck; - QComboBox *gridCombo; - QLabel *leftSepLabel; - QLabel *rightSepLabel; - QSpinBox *leftSepWidthSpin; - QSpinBox *rightSepWidthSpin; - QSpinBox *separatorSpin; - QSpinBox *edgeSpin; - QLabel *columnSepLabel; - QSpinBox *columnSepSpin; + TQComboBox *formatCombo; + TQSpinBox *lineSizeSpin; + TQSpinBox *columnSizeSpin; + TQCheckBox *lockLineCheck; + TQCheckBox *lockColumnCheck; + TQCheckBox *columnCheck; + TQComboBox *gridCombo; + TQLabel *leftSepLabel; + TQLabel *rightSepLabel; + TQSpinBox *leftSepWidthSpin; + TQSpinBox *rightSepWidthSpin; + TQSpinBox *separatorSpin; + TQSpinBox *edgeSpin; + TQLabel *columnSepLabel; + TQSpinBox *columnSepSpin; }; struct SCursorWidgets { - QCheckBox *blinkCheck; - QSpinBox *blinkSpin; - QLabel *blinkLabel; - QCheckBox *blockCheck; - QCheckBox *thickCheck; - QRadioButton *stopRadio; - QRadioButton *hideRadio; - QRadioButton *nothingRadio; + TQCheckBox *blinkCheck; + TQSpinBox *blinkSpin; + TQLabel *blinkLabel; + TQCheckBox *blockCheck; + TQCheckBox *thickCheck; + TQRadioButton *stopRadio; + TQRadioButton *hideRadio; + TQRadioButton *nothingRadio; }; struct SColorWidgets { @@ -190,38 +190,38 @@ class COptionDialog : public KDialogBase MAX_COLOR }; - QCheckBox *checkSystem; + TQCheckBox *checkSystem; CColorListBox *colorList; }; struct SFontWidgets { - QCheckBox *checkSystem; + TQCheckBox *checkSystem; KFontChooser *chooser; - QLineEdit *nonPrintInput; + TQLineEdit *nonPrintInput; }; struct SFileWidgets { - QComboBox *openCombo; - QCheckBox *gotoOffsetCheck; - QCheckBox *reloadOffsetCheck; - QCheckBox *writeProtectCheck; - QCheckBox *backupCheck; - QCheckBox *discardRecentCheck; + TQComboBox *openCombo; + TQCheckBox *gotoOffsetCheck; + TQCheckBox *reloadOffsetCheck; + TQCheckBox *writeProtectCheck; + TQCheckBox *backupCheck; + TQCheckBox *discardRecentCheck; }; struct SMiscWidgets { - QSpinBox *undoSpin; - QCheckBox *inputCheck; - QCheckBox *fatalCheck; - QCheckBox *autoCheck; - QCheckBox *insertCheck; - QCheckBox *confirmWrapCheck; - QCheckBox *cursorJumpCheck; - QCheckBox *thresholdCheck; - QCheckBox *bookmarkColumnCheck; - QCheckBox *bookmarkEditorCheck; - QLabel *thresholdLabel; - QSpinBox *thresholdSpin; + TQSpinBox *undoSpin; + TQCheckBox *inputCheck; + TQCheckBox *fatalCheck; + TQCheckBox *autoCheck; + TQCheckBox *insertCheck; + TQCheckBox *confirmWrapCheck; + TQCheckBox *cursorJumpCheck; + TQCheckBox *thresholdCheck; + TQCheckBox *bookmarkColumnCheck; + TQCheckBox *bookmarkEditorCheck; + TQLabel *thresholdLabel; + TQSpinBox *thresholdSpin; }; private: diff --git a/khexedit/parts/kbytesedit/kbyteseditwidget.cpp b/khexedit/parts/kbytesedit/kbyteseditwidget.cpp index 4cc91ab..cb2b549 100644 --- a/khexedit/parts/kbytesedit/kbyteseditwidget.cpp +++ b/khexedit/parts/kbytesedit/kbyteseditwidget.cpp @@ -16,7 +16,7 @@ // qt specific -#include <qlayout.h> +#include <tqlayout.h> // kde specific #include <klocale.h> #include <kgenericfactory.h> @@ -26,14 +26,14 @@ #include "kbyteseditwidget.h" -KBytesEditWidget::KBytesEditWidget( QWidget *parent, const char *name, const QStringList & ) - : QWidget( parent, name) +KBytesEditWidget::KBytesEditWidget( TQWidget *parent, const char *name, const TQStringList & ) + : TQWidget( parent, name) { - QHBoxLayout* Layout = new QHBoxLayout( this ); + TQHBoxLayout* Layout = new TQHBoxLayout( this ); BytesEdit = new KHE::KBytesEdit( this, "BytesEdit" ); Layout->addWidget( BytesEdit ); -// connect( _editor, SIGNAL( canUndo(bool) ), this, SIGNAL( canUndo(bool) ) ); - connect( BytesEdit, SIGNAL(copyAvailable( bool )), this, SIGNAL(copyAvailable( bool )) ); +// connect( _editor, TQT_SIGNAL( canUndo(bool) ), this, TQT_SIGNAL( canUndo(bool) ) ); + connect( BytesEdit, TQT_SIGNAL(copyAvailable( bool )), this, TQT_SIGNAL(copyAvailable( bool )) ); } @@ -144,7 +144,7 @@ void KBytesEditWidget::setShowUnprintable( bool SU ) BytesEdit->setShowUnprintable( SU ); } -void KBytesEditWidget::setSubstituteChar( QChar SC ) +void KBytesEditWidget::setSubstituteChar( TQChar SC ) { BytesEdit->setSubstituteChar( SC ); } @@ -230,7 +230,7 @@ bool KBytesEditWidget::showUnprintable() const return BytesEdit->showUnprintable(); } -QChar KBytesEditWidget::substituteChar() const +TQChar KBytesEditWidget::substituteChar() const { return BytesEdit->substituteChar(); } @@ -253,7 +253,7 @@ void KBytesEditWidget::repaintRange( int i1, int i2 ) } -void KBytesEditWidget::insert( const QByteArray &D ) +void KBytesEditWidget::insert( const TQByteArray &D ) { BytesEdit->insert( D ); } diff --git a/khexedit/parts/kbytesedit/kbyteseditwidget.h b/khexedit/parts/kbytesedit/kbyteseditwidget.h index 78e4dba..72bfeb6 100644 --- a/khexedit/parts/kbytesedit/kbyteseditwidget.h +++ b/khexedit/parts/kbytesedit/kbyteseditwidget.h @@ -19,7 +19,7 @@ #define KBYTESEDITWIDGET_H // qt specific -#include <qwidget.h> +#include <tqwidget.h> // kde specific #include <khexedit/byteseditinterface.h> #include <khexedit/valuecolumninterface.h> @@ -38,7 +38,7 @@ class KBytesEdit; @author Friedrich W. H. Kossebau <Friedrich.W.H@Kossebau.de> @version 0.1 **/ -class KBytesEditWidget : public QWidget, public KHE::BytesEditInterface, +class KBytesEditWidget : public TQWidget, public KHE::BytesEditInterface, public KHE::ValueColumnInterface, public KHE::CharColumnInterface, public KHE::ZoomInterface, public KHE::ClipboardInterface { @@ -46,7 +46,7 @@ class KBytesEditWidget : public QWidget, public KHE::BytesEditInterface, public: /** constructor API as demanded by KGenericFactory */ - KBytesEditWidget( QWidget *parent, const char *name, const QStringList & = QStringList() ); + KBytesEditWidget( TQWidget *parent, const char *name, const TQStringList & = TQStringList() ); public: // bytesedit interface /** hands over to the editor a new byte array. @@ -133,7 +133,7 @@ class KBytesEditWidget : public QWidget, public KHE::BytesEditInterface, /** sets the substitute character for "unprintable" chars * returns true if there was a change */ - virtual void setSubstituteChar( QChar SC ); + virtual void setSubstituteChar( TQChar SC ); /** sets the encoding of the char column. Default is KHE::LocalEncoding. * If the encoding is not available the format will not be changed. */ virtual void setEncoding( KEncoding C ); @@ -142,13 +142,13 @@ class KBytesEditWidget : public QWidget, public KHE::BytesEditInterface, */ virtual bool showUnprintable() const; /** returns the actually used substitute character for "unprintable" chars, default is '.' */ - virtual QChar substituteChar() const; + virtual TQChar substituteChar() const; /** */ virtual KEncoding encoding() const; public: // edit interface /** */ - virtual void insert( const QByteArray &D ); + virtual void insert( const TQByteArray &D ); /** de-/selects all data */ virtual void selectAll( bool select ); /** returns true if there is a selected range in the array */ diff --git a/khexedit/parts/kpart/khebrowserextension.cpp b/khexedit/parts/kpart/khebrowserextension.cpp index d4fc3f3..a08aa0d 100644 --- a/khexedit/parts/kpart/khebrowserextension.cpp +++ b/khexedit/parts/kpart/khebrowserextension.cpp @@ -29,7 +29,7 @@ KHexEditBrowserExtension::KHexEditBrowserExtension( KHexEditPart *P ) : KParts::BrowserExtension( P, "khexeditpartbrowserextension" ), HexEditPart( P ) { - connect( HexEditPart->HexEdit, SIGNAL( selectionChanged() ), this, SLOT( slotSelectionChanged() ) ); + connect( HexEditPart->HexEdit, TQT_SIGNAL( selectionChanged() ), this, TQT_SLOT( slotSelectionChanged() ) ); } void KHexEditBrowserExtension::copy() @@ -44,7 +44,7 @@ void KHexEditBrowserExtension::slotSelectionChanged() } -void KHexEditBrowserExtension::saveState( QDataStream &stream ) +void KHexEditBrowserExtension::saveState( TQDataStream &stream ) { KParts::BrowserExtension::saveState( stream ); @@ -59,7 +59,7 @@ void KHexEditBrowserExtension::saveState( QDataStream &stream ) } -void KHexEditBrowserExtension::restoreState( QDataStream &stream ) +void KHexEditBrowserExtension::restoreState( TQDataStream &stream ) { KParts::BrowserExtension::restoreState( stream ); @@ -67,7 +67,7 @@ void KHexEditBrowserExtension::restoreState( QDataStream &stream ) int VisibleBufferColumns; int ResizeStyle; int Coding; - QString EncodingName; + TQString EncodingName; int ShowUnprintable; int x, y; int Position; diff --git a/khexedit/parts/kpart/khebrowserextension.h b/khexedit/parts/kpart/khebrowserextension.h index 4638944..67a6d45 100644 --- a/khexedit/parts/kpart/khebrowserextension.h +++ b/khexedit/parts/kpart/khebrowserextension.h @@ -39,8 +39,8 @@ class KHexEditBrowserExtension : public KParts::BrowserExtension KHexEditBrowserExtension( KHexEditPart *P ); public: // KParts::BrowserExtension API - virtual void saveState( QDataStream &stream ); - virtual void restoreState( QDataStream &stream ); + virtual void saveState( TQDataStream &stream ); + virtual void restoreState( TQDataStream &stream ); public slots: /** copy text to clipboard */ diff --git a/khexedit/parts/kpart/khepart.cpp b/khexedit/parts/kpart/khepart.cpp index e9b9ed5..1fa95fb 100644 --- a/khexedit/parts/kpart/khepart.cpp +++ b/khexedit/parts/kpart/khepart.cpp @@ -32,8 +32,8 @@ using namespace KHE; static const char RCFileName[] = "khexedit2partui.rc"; -KHexEditPart::KHexEditPart( QWidget *ParentWidget, const char *WidgetName, - QObject *Parent, const char *Name, +KHexEditPart::KHexEditPart( TQWidget *ParentWidget, const char *WidgetName, + TQObject *Parent, const char *Name, bool BrowserViewWanted ) : KParts::ReadOnlyPart( Parent, Name ) { @@ -51,8 +51,8 @@ KHexEditPart::KHexEditPart( QWidget *ParentWidget, const char *WidgetName, if( CopyAction ) { - connect( HexEdit, SIGNAL(copyAvailable(bool)), CopyAction,SLOT(setEnabled(bool)) ); - connect( HexEdit, SIGNAL(selectionChanged()), this, SLOT(slotSelectionChanged()) ); + connect( HexEdit, TQT_SIGNAL(copyAvailable(bool)), CopyAction,TQT_SLOT(setEnabled(bool)) ); + connect( HexEdit, TQT_SIGNAL(selectionChanged()), this, TQT_SLOT(slotSelectionChanged()) ); CopyAction->setEnabled( false ); } @@ -83,30 +83,30 @@ void KHexEditPart::setupActions( bool BrowserViewWanted ) { KActionCollection *AC = actionCollection(); // create our actions - CopyAction = BrowserViewWanted ? 0 : KStdAction::copy( HexEdit, SLOT(copy()), AC ); + CopyAction = BrowserViewWanted ? 0 : KStdAction::copy( HexEdit, TQT_SLOT(copy()), AC ); - KStdAction::selectAll( this, SLOT(slotSelectAll()), AC ); - KStdAction::deselect( this, SLOT(slotUnselect()), AC ); + KStdAction::selectAll( this, TQT_SLOT(slotSelectAll()), AC ); + KStdAction::deselect( this, TQT_SLOT(slotUnselect()), AC ); // value encoding CodingAction = new KSelectAction( i18n("&Value Coding"), 0, AC, "view_valuecoding" ); - QStringList List; + TQStringList List; List.append( i18n("&Hexadecimal") ); List.append( i18n("&Decimal") ); List.append( i18n("&Octal") ); List.append( i18n("&Binary") ); CodingAction->setItems( List ); - connect( CodingAction, SIGNAL(activated(int)), this, SLOT(slotSetCoding(int)) ); + connect( CodingAction, TQT_SIGNAL(activated(int)), this, TQT_SLOT(slotSetCoding(int)) ); // document encoding EncodingAction = new KSelectAction( i18n("&Char Encoding"), 0, AC, "view_charencoding" ); EncodingAction->setItems( KCharCodec::codecNames() ); - connect( EncodingAction, SIGNAL(activated(int)), this, SLOT(slotSetEncoding(int)) ); + connect( EncodingAction, TQT_SIGNAL(activated(int)), this, TQT_SLOT(slotSetEncoding(int)) ); - ShowUnprintableAction = new KToggleAction( i18n("Show &Unprintable Chars (<32)"), 0, this, SLOT(slotSetShowUnprintable()), actionCollection(), "view_showunprintable" ); + ShowUnprintableAction = new KToggleAction( i18n("Show &Unprintable Chars (<32)"), 0, this, TQT_SLOT(slotSetShowUnprintable()), actionCollection(), "view_showunprintable" ); - KStdAction::zoomIn( HexEdit, SLOT(zoomIn()), actionCollection() ); - KStdAction::zoomOut( HexEdit, SLOT(zoomOut()), actionCollection() ); + KStdAction::zoomIn( HexEdit, TQT_SLOT(zoomIn()), actionCollection() ); + KStdAction::zoomOut( HexEdit, TQT_SLOT(zoomOut()), actionCollection() ); // resize style ResizeStyleAction = new KSelectAction( i18n("&Resize Style"), 0, AC, "resizestyle" ); @@ -115,9 +115,9 @@ void KHexEditPart::setupActions( bool BrowserViewWanted ) List.append( i18n("&Lock Groups") ); List.append( i18n("&Full Size Usage") ); ResizeStyleAction->setItems( List ); - connect( ResizeStyleAction, SIGNAL(activated(int)), this, SLOT(slotSetResizeStyle(int)) ); + connect( ResizeStyleAction, TQT_SIGNAL(activated(int)), this, TQT_SLOT(slotSetResizeStyle(int)) ); - ShowOffsetColumnAction = new KToggleAction( i18n("&Line Offset"), Key_F11, this, SLOT(slotToggleOffsetColumn()), AC, "view_lineoffset" ); + ShowOffsetColumnAction = new KToggleAction( i18n("&Line Offset"), Key_F11, this, TQT_SLOT(slotToggleOffsetColumn()), AC, "view_lineoffset" ); // show buffer columns ToggleColumnsAction = new KSelectAction( i18n("&Columns"), 0, AC, "togglecolumns" ); @@ -126,7 +126,7 @@ void KHexEditPart::setupActions( bool BrowserViewWanted ) List.append( i18n("&Chars Column") ); List.append( i18n("&Both Columns") ); ToggleColumnsAction->setItems( List ); - connect( ToggleColumnsAction, SIGNAL(activated(int)), this, SLOT(slotToggleValueCharColumns(int)) ); + connect( ToggleColumnsAction, TQT_SIGNAL(activated(int)), this, TQT_SLOT(slotToggleValueCharColumns(int)) ); fitActionSettings(); diff --git a/khexedit/parts/kpart/khepart.h b/khexedit/parts/kpart/khepart.h index 54befa0..0526462 100644 --- a/khexedit/parts/kpart/khepart.h +++ b/khexedit/parts/kpart/khepart.h @@ -49,7 +49,7 @@ class KHexEditPart : public KParts::ReadOnlyPart friend class KHexEditBrowserExtension; public: - KHexEditPart( QWidget *ParentWidget, const char *WidgetName, QObject *Parent, const char *Name, + KHexEditPart( TQWidget *ParentWidget, const char *WidgetName, TQObject *Parent, const char *Name, bool BrowserViewWanted ); virtual ~KHexEditPart(); diff --git a/khexedit/parts/kpart/khepartfactory.cpp b/khexedit/parts/kpart/khepartfactory.cpp index f85d8a9..d3bac6c 100644 --- a/khexedit/parts/kpart/khepartfactory.cpp +++ b/khexedit/parts/kpart/khepartfactory.cpp @@ -57,11 +57,11 @@ KHexEditPartFactory::~KHexEditPartFactory() } -KParts::Part* KHexEditPartFactory::createPartObject( QWidget *ParentWidget, const char *WidgetName, - QObject *Parent, const char *Name, - const char *CN, const QStringList &/*args*/ ) +KParts::Part* KHexEditPartFactory::createPartObject( TQWidget *ParentWidget, const char *WidgetName, + TQObject *Parent, const char *Name, + const char *CN, const TQStringList &/*args*/ ) { - QCString Classname( CN ); + TQCString Classname( CN ); bool BrowserViewWanted = ( Classname == "Browser/View" ); //bool ReadOnlyWanted = (BrowserViewWanted || ( Classname == "KParts::ReadOnlyPart" )); diff --git a/khexedit/parts/kpart/khepartfactory.h b/khexedit/parts/kpart/khepartfactory.h index 7cd6c7e..15a1cee 100644 --- a/khexedit/parts/kpart/khepartfactory.h +++ b/khexedit/parts/kpart/khepartfactory.h @@ -33,9 +33,9 @@ class KHexEditPartFactory : public KParts::Factory virtual ~KHexEditPartFactory(); public: - virtual KParts::Part* createPartObject( QWidget *parentWidget, const char *widgetName, - QObject *parent, const char *name, - const char *classname, const QStringList &args ); + virtual KParts::Part* createPartObject( TQWidget *parentWidget, const char *widgetName, + TQObject *parent, const char *name, + const char *classname, const TQStringList &args ); static KInstance* instance(); diff --git a/khexedit/printdialogpage.cc b/khexedit/printdialogpage.cc index ecc0a90..2677ac4 100644 --- a/khexedit/printdialogpage.cc +++ b/khexedit/printdialogpage.cc @@ -18,20 +18,20 @@ * */ -#include <qlayout.h> -#include <qbuttongroup.h> -#include <qspinbox.h> -#include <qlabel.h> -#include <qcheckbox.h> -#include <qstringlist.h> -#include <qcombobox.h> +#include <tqlayout.h> +#include <tqbuttongroup.h> +#include <tqspinbox.h> +#include <tqlabel.h> +#include <tqcheckbox.h> +#include <tqstringlist.h> +#include <tqcombobox.h> #include <klocale.h> #include "printdialogpage.h" -LayoutDialogPage::LayoutDialogPage( QWidget *parent, const char *name ) +LayoutDialogPage::LayoutDialogPage( TQWidget *parent, const char *name ) : KPrintDialogPage( parent, name ) { mConfig = 0; @@ -52,21 +52,21 @@ LayoutDialogPage::~LayoutDialogPage( void ) void LayoutDialogPage::setupLayoutPage( void ) { - QString text; - QVBoxLayout *topLayout = new QVBoxLayout( this, 0, 6 /*KDialog::mSpacingSize*/ ); + TQString text; + TQVBoxLayout *topLayout = new TQVBoxLayout( this, 0, 6 /*KDialog::mSpacingSize*/ ); if( topLayout == 0 ) { return; } text = i18n("Margins [millimeter]"); - QButtonGroup *group = new QButtonGroup( text, this ); + TQButtonGroup *group = new TQButtonGroup( text, this ); if( group == 0 ) { return; } topLayout->addWidget( group ); - QGridLayout *gbox = new QGridLayout( group, 3, 6, 6 /*KDialog::mSpacingSize*/ ); + TQGridLayout *gbox = new TQGridLayout( group, 3, 6, 6 /*KDialog::mSpacingSize*/ ); if( gbox == 0 ) { return; } gbox->addRowSpacing( 0, group->fontMetrics().height() ); gbox->setColStretch( 5, 10 ); - QString name[4]; + TQString name[4]; int i; name[0] = i18n("&Top:"); @@ -76,14 +76,14 @@ void LayoutDialogPage::setupLayoutPage( void ) for( i=0; i<4; i++ ) { - mLayout.marginSpin[i] = new QSpinBox( group ); + mLayout.marginSpin[i] = new TQSpinBox( group ); mLayout.marginSpin[i]->setFixedHeight( mLayout.marginSpin[i]->sizeHint().height() ); mLayout.marginSpin[i]->setMinimumWidth( mLayout.marginSpin[i]->fontMetrics().width("M")*10 ); mLayout.marginSpin[i]->setRange( 0, INT_MAX ); - QLabel *label = new QLabel( mLayout.marginSpin[i], name[i], group ); + TQLabel *label = new TQLabel( mLayout.marginSpin[i], name[i], group ); label->setFixedHeight( mLayout.marginSpin[i]->sizeHint().height() ); label->setFixedWidth( label->sizeHint().width() ); @@ -100,13 +100,13 @@ void LayoutDialogPage::setupLayoutPage( void ) } text = i18n("Draw h&eader above text"); - mLayout.headerCheck = new QCheckBox( text, this ); + mLayout.headerCheck = new TQCheckBox( text, this ); mLayout.headerCheck->setFixedSize( mLayout.headerCheck->sizeHint() ); - connect( mLayout.headerCheck, SIGNAL( toggled(bool)), - SLOT( slotDrawHeader(bool))); + connect( mLayout.headerCheck, TQT_SIGNAL( toggled(bool)), + TQT_SLOT( slotDrawHeader(bool))); topLayout->addWidget( mLayout.headerCheck, 0, AlignLeft ); - gbox = new QGridLayout( 5, 6, 0 ); + gbox = new TQGridLayout( 5, 6, 0 ); if( gbox == 0 ) { return; } topLayout->addLayout( gbox ); @@ -120,26 +120,26 @@ void LayoutDialogPage::setupLayoutPage( void ) name[2] = i18n("Right:"); name[3] = i18n("Border:"); - QStringList textList; + TQStringList textList; textList.append(i18n("None")); textList.append(i18n("Date & Time")); textList.append(i18n("Page Number")); textList.append(i18n("Filename")); - QStringList lineList; + TQStringList lineList; lineList.append(i18n("None")); lineList.append(i18n("Single Line")); lineList.append(i18n("Rectangle")); for( i=0; i<4; i++ ) { - mLayout.headerCombo[i] = new QComboBox( false, this ); + mLayout.headerCombo[i] = new TQComboBox( false, this ); mLayout.headerCombo[i]->setFixedHeight( mLayout.headerCombo[i]->sizeHint().height() ); mLayout.headerCombo[i]->setMinimumWidth( mLayout.headerCombo[i]->fontMetrics().width("M")*10 ); - mLayout.headerLabel[i] = new QLabel( mLayout.headerCombo[i], name[i], + mLayout.headerLabel[i] = new TQLabel( mLayout.headerCombo[i], name[i], this ); mLayout.headerLabel[i]->setFixedHeight( mLayout.headerLabel[i]->sizeHint().height() ); @@ -162,13 +162,13 @@ void LayoutDialogPage::setupLayoutPage( void ) text = i18n("Draw &footer below text"); - mLayout.footerCheck = new QCheckBox( text, this ); + mLayout.footerCheck = new TQCheckBox( text, this ); mLayout.footerCheck->setFixedSize( mLayout.footerCheck->sizeHint() ); - connect( mLayout.footerCheck, SIGNAL( toggled(bool)), - SLOT( slotDrawFooter(bool))); + connect( mLayout.footerCheck, TQT_SIGNAL( toggled(bool)), + TQT_SLOT( slotDrawFooter(bool))); topLayout->addWidget( mLayout.footerCheck, 0, AlignLeft ); - gbox = new QGridLayout( 5, 6, 0 ); + gbox = new TQGridLayout( 5, 6, 0 ); if( gbox == 0 ) { return; } topLayout->addLayout( gbox ); @@ -179,13 +179,13 @@ void LayoutDialogPage::setupLayoutPage( void ) for( i=0; i<4; i++ ) { - mLayout.footerCombo[i] = new QComboBox( false, this ); + mLayout.footerCombo[i] = new TQComboBox( false, this ); mLayout.footerCombo[i]->setFixedHeight( mLayout.footerCombo[i]->sizeHint().height() ); mLayout.footerCombo[i]->setMinimumWidth( mLayout.footerCombo[i]->fontMetrics().width("M")*10 ); - mLayout.footerLabel[i] = new QLabel( mLayout.footerCombo[i], name[i], + mLayout.footerLabel[i] = new TQLabel( mLayout.footerCombo[i], name[i], this ); mLayout.footerLabel[i]->setFixedHeight( mLayout.footerLabel[i]->sizeHint().height() ); @@ -223,7 +223,7 @@ void LayoutDialogPage::readConfiguration( void ) { if( mConfig != 0 ) { return; } - mConfig = new KSimpleConfig( QString("hexprinter") ); + mConfig = new KSimpleConfig( TQString("hexprinter") ); if( mConfig == 0 ) { return; } mConfig->setGroup( "PageLayout" ); @@ -300,16 +300,16 @@ void LayoutDialogPage::writeConfiguration( void ) } -QString LayoutDialogPage::headerText( uint index ) +TQString LayoutDialogPage::headerText( uint index ) { - static const QString text[4] = {"None","DateTime","PageNumber","FileName"}; + static const TQString text[4] = {"None","DateTime","PageNumber","FileName"}; return( text[ index > 3 ? 0 : index ] ); } -int LayoutDialogPage::headerTextIndex( const QString & headerText ) +int LayoutDialogPage::headerTextIndex( const TQString & headerText ) { - static const QString text[4] = {"None","DateTime","PageNumber","FileName"}; + static const TQString text[4] = {"None","DateTime","PageNumber","FileName"}; if( headerText != 0 ) { for( int i=0; i<4; i++ ) @@ -321,16 +321,16 @@ int LayoutDialogPage::headerTextIndex( const QString & headerText ) } -QString LayoutDialogPage::headerLine( uint index ) +TQString LayoutDialogPage::headerLine( uint index ) { - static const QString text[3] = {"None","SingleLine","Rectangle"}; + static const TQString text[3] = {"None","SingleLine","Rectangle"}; return( text[ index > 2 ? 0 : index ] ); } -int LayoutDialogPage::headerLineIndex( const QString & headerLine ) +int LayoutDialogPage::headerLineIndex( const TQString & headerLine ) { - static const QString text[3] = {"None","SingleLine","Rectangle"}; + static const TQString text[3] = {"None","SingleLine","Rectangle"}; if( headerLine != 0 ) { for( int i=0; i<3; i++ ) @@ -362,24 +362,24 @@ void LayoutDialogPage::slotDrawFooter( bool state ) } -void LayoutDialogPage::getOptions( QMap<QString,QString>& opts, bool /*incldef*/ ) +void LayoutDialogPage::getOptions( TQMap<TQString,TQString>& opts, bool /*incldef*/ ) { - opts[ "kde-khexedit-topmarginmm" ] = QString::number( mLayout.marginSpin[0]->value() ); - opts[ "kde-khexedit-bottommarginmm" ] = QString::number( mLayout.marginSpin[1]->value() ); - opts[ "kde-khexedit-leftmarginmm" ] = QString::number( mLayout.marginSpin[2]->value() ); - opts[ "kde-khexedit-rightmarginmm" ] = QString::number( mLayout.marginSpin[3]->value() ); + opts[ "kde-khexedit-topmarginmm" ] = TQString::number( mLayout.marginSpin[0]->value() ); + opts[ "kde-khexedit-bottommarginmm" ] = TQString::number( mLayout.marginSpin[1]->value() ); + opts[ "kde-khexedit-leftmarginmm" ] = TQString::number( mLayout.marginSpin[2]->value() ); + opts[ "kde-khexedit-rightmarginmm" ] = TQString::number( mLayout.marginSpin[3]->value() ); opts[ "kde-khexedit-headercheck" ] = (mLayout.headerCheck->isChecked() ? "true" : "false"); - opts[ "kde-khexedit-headercombo0" ] = QString::number( mLayout.headerCombo[0]->currentItem() ); - opts[ "kde-khexedit-headercombo1" ] = QString::number( mLayout.headerCombo[1]->currentItem() ); - opts[ "kde-khexedit-headercombo2" ] = QString::number( mLayout.headerCombo[2]->currentItem() ); - opts[ "kde-khexedit-headercombo3" ] = QString::number( mLayout.headerCombo[3]->currentItem() ); + opts[ "kde-khexedit-headercombo0" ] = TQString::number( mLayout.headerCombo[0]->currentItem() ); + opts[ "kde-khexedit-headercombo1" ] = TQString::number( mLayout.headerCombo[1]->currentItem() ); + opts[ "kde-khexedit-headercombo2" ] = TQString::number( mLayout.headerCombo[2]->currentItem() ); + opts[ "kde-khexedit-headercombo3" ] = TQString::number( mLayout.headerCombo[3]->currentItem() ); opts[ "kde-khexedit-footercheck" ] = (mLayout.footerCheck->isChecked() ? "true" : "false"); - opts[ "kde-khexedit-footercombo0" ] = QString::number( mLayout.footerCombo[0]->currentItem() ); - opts[ "kde-khexedit-footercombo1" ] = QString::number( mLayout.footerCombo[1]->currentItem() ); - opts[ "kde-khexedit-footercombo2" ] = QString::number( mLayout.footerCombo[2]->currentItem() ); - opts[ "kde-khexedit-footercombo3" ] = QString::number( mLayout.footerCombo[3]->currentItem() ); + opts[ "kde-khexedit-footercombo0" ] = TQString::number( mLayout.footerCombo[0]->currentItem() ); + opts[ "kde-khexedit-footercombo1" ] = TQString::number( mLayout.footerCombo[1]->currentItem() ); + opts[ "kde-khexedit-footercombo2" ] = TQString::number( mLayout.footerCombo[2]->currentItem() ); + opts[ "kde-khexedit-footercombo3" ] = TQString::number( mLayout.footerCombo[3]->currentItem() ); } diff --git a/khexedit/printdialogpage.h b/khexedit/printdialogpage.h index bdc58f6..d25fd48 100644 --- a/khexedit/printdialogpage.h +++ b/khexedit/printdialogpage.h @@ -35,10 +35,10 @@ class LayoutDialogPage : public KPrintDialogPage Q_OBJECT public: - LayoutDialogPage( QWidget *parent = 0, const char *name = 0 ); + LayoutDialogPage( TQWidget *parent = 0, const char *name = 0 ); ~LayoutDialogPage( void ); - void getOptions( QMap<QString,QString>& opts, bool incldef = false ); + void getOptions( TQMap<TQString,TQString>& opts, bool incldef = false ); private slots: void slotDrawHeader( bool state ); @@ -50,20 +50,20 @@ class LayoutDialogPage : public KPrintDialogPage void readConfiguration( void ); void writeConfiguration( void ); - QString headerText( uint index ); - QString headerLine( uint index ); - int headerTextIndex( const QString & headerText ); - int headerLineIndex( const QString & headerLine ); + TQString headerText( uint index ); + TQString headerLine( uint index ); + int headerTextIndex( const TQString & headerText ); + int headerLineIndex( const TQString & headerLine ); struct SLayoutWidgets { - QSpinBox *marginSpin[4]; - QCheckBox *headerCheck; - QCheckBox *footerCheck; - QLabel *headerLabel[4]; - QComboBox *headerCombo[4]; - QLabel *footerLabel[4]; - QComboBox *footerCombo[4]; + TQSpinBox *marginSpin[4]; + TQCheckBox *headerCheck; + TQCheckBox *footerCheck; + TQLabel *headerLabel[4]; + TQComboBox *headerCombo[4]; + TQLabel *footerLabel[4]; + TQComboBox *footerCombo[4]; }; KSimpleConfig *mConfig; diff --git a/khexedit/progress.h b/khexedit/progress.h index fa6e8a3..421637f 100644 --- a/khexedit/progress.h +++ b/khexedit/progress.h @@ -22,7 +22,7 @@ #ifndef _PROGRESS_H_ #define _PROGRESS_H_ -#include <qdatetime.h> +#include <tqdatetime.h> #include "hexerror.h" @@ -122,7 +122,7 @@ class CProgress private: ProgressFunc mProgressFunc; void *mClientData; - QTime mInterruptTimer; + TQTime mInterruptTimer; }; #endif diff --git a/khexedit/searchbar.cc b/khexedit/searchbar.cc index 44d4944..73baba6 100644 --- a/khexedit/searchbar.cc +++ b/khexedit/searchbar.cc @@ -24,7 +24,7 @@ #include "dialog.h" #include "hexvalidator.h" #include "searchbar.h" -#include <qpushbutton.h> +#include <tqpushbutton.h> // crappy X11 headers #undef KeyPress @@ -51,43 +51,43 @@ static const char * close_xpm[] = { " ", " "}; -CSearchBar::CSearchBar( QWidget *parent, const char *name, WFlags f ) - :QFrame( parent, name, f ) +CSearchBar::CSearchBar( TQWidget *parent, const char *name, WFlags f ) + :TQFrame( parent, name, f ) { - setFrameStyle( QFrame::Panel | QFrame::Raised ); + setFrameStyle( TQFrame::Panel | TQFrame::Raised ); setLineWidth( 1 ); - mTypeCombo = new QComboBox( this ); - connect( mTypeCombo, SIGNAL(activated(int)), SLOT(selectorChanged(int)) ); - QStringList list; + mTypeCombo = new TQComboBox( this ); + connect( mTypeCombo, TQT_SIGNAL(activated(int)), TQT_SLOT(selectorChanged(int)) ); + TQStringList list; list << i18n("Hex") << i18n("Dec") << i18n("Oct") << i18n("Bin") << i18n("Txt"); mTypeCombo->insertStringList( list ); - mInputEdit = new QLineEdit( this ); - connect( mInputEdit, SIGNAL(textChanged(const QString&)), - SLOT(textChanged(const QString&)) ); + mInputEdit = new TQLineEdit( this ); + connect( mInputEdit, TQT_SIGNAL(textChanged(const TQString&)), + TQT_SLOT(textChanged(const TQString&)) ); mValidator = new CHexValidator( this, CHexValidator::regularText ); mInputEdit->setValidator( mValidator ); - mFindButton = new QPushButton( i18n("Find"), this ); + mFindButton = new TQPushButton( i18n("Find"), this ); mFindButton->setAutoDefault(false); - connect( mFindButton, SIGNAL(clicked()), this, SLOT(start()) ); - connect(mInputEdit,SIGNAL(returnPressed()),mFindButton,SLOT(animateClick())); + connect( mFindButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(start()) ); + connect(mInputEdit,TQT_SIGNAL(returnPressed()),mFindButton,TQT_SLOT(animateClick())); mFindButton->setFixedHeight( mTypeCombo->sizeHint().height() ); - mBackwards = new QCheckBox( i18n("Backwards"), this ); - mIgnoreCase = new QCheckBox( i18n("Ignore case"), this ); + mBackwards = new TQCheckBox( i18n("Backwards"), this ); + mIgnoreCase = new TQCheckBox( i18n("Ignore case"), this ); - mCloseButton = new QPushButton( this ); + mCloseButton = new TQPushButton( this ); mCloseButton->setAutoDefault(false); - mCloseButton->setPixmap( QPixmap( close_xpm ) ); - connect( mCloseButton, SIGNAL(clicked()), this, SLOT(hideWidget()) ); + mCloseButton->setPixmap( TQPixmap( close_xpm ) ); + connect( mCloseButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(hideWidget()) ); // // Make layout // - QHBoxLayout *hlay = new QHBoxLayout( this, 4, 6 ); + TQHBoxLayout *hlay = new TQHBoxLayout( this, 4, 6 ); hlay->addWidget( mTypeCombo ); hlay->addWidget( mInputEdit ); hlay->addWidget( mFindButton ); @@ -105,21 +105,21 @@ CSearchBar::CSearchBar( QWidget *parent, const char *name, WFlags f ) // // Espen 2000-04-21 -// Qt 2.1: Seems like the QLineEdit::returnPressed() does not work when +// Qt 2.1: Seems like the TQLineEdit::returnPressed() does not work when // I install a validator. So I catch the event manually // -bool CSearchBar::eventFilter( QObject *o, QEvent *e ) +bool CSearchBar::eventFilter( TQObject *o, TQEvent *e ) { - if( o == mInputEdit && e->type() == QEvent::KeyPress ) + if( o == mInputEdit && e->type() == TQEvent::KeyPress ) { - QKeyEvent *ke = (QKeyEvent*)e; + TQKeyEvent *ke = (TQKeyEvent*)e; if( ke->key() == Key_Return ) { mFindButton->animateClick(); return true; } } - return QFrame::eventFilter( o, e ); + return TQFrame::eventFilter( o, e ); } // @@ -143,7 +143,7 @@ void CSearchBar::selectorChanged( int index ) } -void CSearchBar::textChanged( const QString &text ) +void CSearchBar::textChanged( const TQString &text ) { mFindString[ mTypeCombo->currentItem() ] = text; mValidator->convert( mFindData, mFindString[ mTypeCombo->currentItem() ] ); @@ -162,7 +162,7 @@ void CSearchBar::start( void ) { if( mFindData.isEmpty() == true ) { - showEntryFailure( this, QString("") ); + showEntryFailure( this, TQString("") ); return; } @@ -178,9 +178,9 @@ void CSearchBar::start( void ) } -void CSearchBar::showEvent( QShowEvent *e ) +void CSearchBar::showEvent( TQShowEvent *e ) { - QFrame::showEvent(e); + TQFrame::showEvent(e); mInputEdit->setFocus(); } diff --git a/khexedit/searchbar.h b/khexedit/searchbar.h index c11f652..1434ec1 100644 --- a/khexedit/searchbar.h +++ b/khexedit/searchbar.h @@ -20,7 +20,7 @@ #ifndef _SEARCHBAR_H_ #define _SEARCHBAR_H_ -#include <qframe.h> +#include <tqframe.h> #include "hexbuffer.h" @@ -35,19 +35,19 @@ class CSearchBar : public QFrame Q_OBJECT public: - CSearchBar( QWidget *parent=0, const char *name=0, WFlags f=0 ); - virtual bool eventFilter( QObject *o, QEvent *e ); + CSearchBar( TQWidget *parent=0, const char *name=0, WFlags f=0 ); + virtual bool eventFilter( TQObject *o, TQEvent *e ); public slots: void cursorMoved(); protected: - virtual void showEvent( QShowEvent * ); + virtual void showEvent( TQShowEvent * ); private slots: void hideWidget(); void selectorChanged( int index ); - void textChanged( const QString &text ); + void textChanged( const TQString &text ); void start(); signals: @@ -55,15 +55,15 @@ class CSearchBar : public QFrame void findData( SSearchControl &sc, uint mode, bool navigator ); private: - QPushButton *mCloseButton; - QPushButton *mFindButton; - QComboBox *mTypeCombo; - QLineEdit *mInputEdit; - QCheckBox *mBackwards; - QCheckBox *mIgnoreCase; + TQPushButton *mCloseButton; + TQPushButton *mFindButton; + TQComboBox *mTypeCombo; + TQLineEdit *mInputEdit; + TQCheckBox *mBackwards; + TQCheckBox *mIgnoreCase; - QString mFindString[5]; - QByteArray mFindData; + TQString mFindString[5]; + TQByteArray mFindData; CHexValidator *mValidator; uint mSearchMode; }; diff --git a/khexedit/statusbarprogress.cc b/khexedit/statusbarprogress.cc index 6e45cf2..872698e 100644 --- a/khexedit/statusbarprogress.cc +++ b/khexedit/statusbarprogress.cc @@ -21,23 +21,23 @@ #include "statusbarprogress.h" -#include <qpainter.h> +#include <tqpainter.h> #include <kapplication.h> #include <kglobalsettings.h> #include <klocale.h> -#include <qstyle.h> +#include <tqstyle.h> -CStatusBarProgress::CStatusBarProgress( QWidget *parent, const char *name ) - : QFrame(parent, name), QRangeControl(0, 100, 1, 10, 0), +CStatusBarProgress::CStatusBarProgress( TQWidget *parent, const char *name ) + : TQFrame(parent, name), TQRangeControl(0, 100, 1, 10, 0), mOrientation( Horizontal ) { initialize(); } CStatusBarProgress::CStatusBarProgress( Orientation orientation, - QWidget *parent, const char *name ) - : QFrame(parent, name), QRangeControl(0, 100, 1, 10, 0), + TQWidget *parent, const char *name ) + : TQFrame(parent, name), TQRangeControl(0, 100, 1, 10, 0), mOrientation( orientation ) { initialize(); @@ -45,8 +45,8 @@ CStatusBarProgress::CStatusBarProgress( Orientation orientation, CStatusBarProgress::CStatusBarProgress( int minValue, int maxValue, int value, Orientation orientation, - QWidget *parent, const char *name ) - : QFrame(parent, name), QRangeControl(minValue, maxValue, 1, 10, value), + TQWidget *parent, const char *name ) + : TQFrame(parent, name), TQRangeControl(minValue, maxValue, 1, 10, value), mOrientation(orientation) { initialize(); @@ -72,7 +72,7 @@ void CStatusBarProgress::initialize( void ) mTextColor = palette().active().text(); setBackgroundColor( palette().active().background() ); - QFont font( KGlobalSettings::generalFont() ); + TQFont font( KGlobalSettings::generalFont() ); font.setBold( true ); setFont( font ); @@ -81,7 +81,7 @@ void CStatusBarProgress::initialize( void ) } -void CStatusBarProgress::setBarPixmap( const QPixmap &pixmap ) +void CStatusBarProgress::setBarPixmap( const TQPixmap &pixmap ) { if( pixmap.isNull() == true ) { @@ -89,10 +89,10 @@ void CStatusBarProgress::setBarPixmap( const QPixmap &pixmap ) } delete mBarPixmap; - mBarPixmap = new QPixmap( pixmap ); + mBarPixmap = new TQPixmap( pixmap ); } -void CStatusBarProgress::setBarColor( const QColor &color ) +void CStatusBarProgress::setBarColor( const TQColor &color ) { mBarColor = color; delete mBarPixmap; @@ -120,7 +120,7 @@ void CStatusBarProgress::setOrientation( Orientation orientation ) void CStatusBarProgress::setValue(int value) { mCurPage = mMaxPage = -1; - QRangeControl::setValue(value); + TQRangeControl::setValue(value); } void CStatusBarProgress::setValue( int curPage, int maxPage ) @@ -128,14 +128,14 @@ void CStatusBarProgress::setValue( int curPage, int maxPage ) if( curPage <= 0 || maxPage <= 0 || curPage > maxPage ) { mCurPage = mMaxPage = -1; - QRangeControl::setValue(0); + TQRangeControl::setValue(0); } else { mCurPage = curPage; mMaxPage = maxPage; float fraction = (float)curPage/(float)maxPage; - QRangeControl::setValue( (int)(fraction*100.0) ); + TQRangeControl::setValue( (int)(fraction*100.0) ); } } @@ -149,7 +149,7 @@ void CStatusBarProgress::setTextEnabled( bool state ) } } -void CStatusBarProgress::setText( const QString &msg ) +void CStatusBarProgress::setText( const TQString &msg ) { mMsg = msg; if( mTextEnabled == true ) @@ -161,12 +161,12 @@ void CStatusBarProgress::setText( const QString &msg ) -const QColor & CStatusBarProgress::barColor( void ) const +const TQColor & CStatusBarProgress::barColor( void ) const { return( mBarColor ); } -const QPixmap * CStatusBarProgress::barPixmap( void ) const +const TQPixmap * CStatusBarProgress::barPixmap( void ) const { return( mBarPixmap ); } @@ -176,9 +176,9 @@ bool CStatusBarProgress::textEnabled( void ) const return( mTextEnabled ); } -QSize CStatusBarProgress::sizeHint( void ) const +TQSize CStatusBarProgress::sizeHint( void ) const { - QSize s( size() ); + TQSize s( size() ); if( orientation() == CStatusBarProgress::Vertical ) { @@ -232,19 +232,19 @@ void CStatusBarProgress::adjustStyle( void ) switch( style().SH_GUIStyle) { case WindowsStyle: - setFrameStyle( QFrame::NoFrame ); + setFrameStyle( TQFrame::NoFrame ); break; case MotifStyle: default: - setFrameStyle( QFrame::Panel|QFrame::Sunken ); + setFrameStyle( TQFrame::Panel|TQFrame::Sunken ); setLineWidth( 1 ); break; } update(); } -void CStatusBarProgress::paletteChange( const QPalette & ) +void CStatusBarProgress::paletteChange( const TQPalette & ) { mBarColor = palette().active().highlight(); mBarTextColor = palette().active().highlightedText(); @@ -252,14 +252,14 @@ void CStatusBarProgress::paletteChange( const QPalette & ) setBackgroundColor( palette().active().background() ); } -void CStatusBarProgress::drawText( QPainter *p ) +void CStatusBarProgress::drawText( TQPainter *p ) { - QRect r(contentsRect()); - QString s; + TQRect r(contentsRect()); + TQString s; if( mMsg.isEmpty() == true ) { - s = QString("%1%").arg(recalcValue(100)); + s = TQString("%1%").arg(recalcValue(100)); } else { @@ -280,11 +280,11 @@ void CStatusBarProgress::drawText( QPainter *p ) p->drawText( r, AlignCenter, s ); } -void CStatusBarProgress::drawContents(QPainter *p) +void CStatusBarProgress::drawContents(TQPainter *p) { - QRect cr = contentsRect(), er = cr; + TQRect cr = contentsRect(), er = cr; fr = cr; - QBrush fb(mBarColor), eb(backgroundColor() ); + TQBrush fb(mBarColor), eb(backgroundColor() ); if( mBarPixmap != 0 ) { @@ -323,7 +323,7 @@ void CStatusBarProgress::drawContents(QPainter *p) { fr.setHeight(cr.height() - 2 * margin); fr.setWidth((int)(0.67 * fr.height())); - fr.moveTopLeft(QPoint(cr.left() + margin, cr.top() + margin)); + fr.moveTopLeft(TQPoint(cr.left() + margin, cr.top() + margin)); dx = fr.width() + margin; dy = 0; max = (cr.width() - margin) / (fr.width() + margin) + 1; @@ -333,7 +333,7 @@ void CStatusBarProgress::drawContents(QPainter *p) { fr.setWidth(cr.width() - 2 * margin); fr.setHeight((int)(0.67 * fr.width())); - fr.moveBottomLeft(QPoint(cr.left() + margin, cr.bottom() - margin)); + fr.moveBottomLeft(TQPoint(cr.left() + margin, cr.bottom() - margin)); dx = 0; dy = - (fr.height() + margin); max = (cr.height() - margin) / (fr.height() + margin) + 1; @@ -366,7 +366,7 @@ void CStatusBarProgress::drawContents(QPainter *p) } -void CStatusBarProgress::mousePressEvent( QMouseEvent */*e*/ ) +void CStatusBarProgress::mousePressEvent( TQMouseEvent */*e*/ ) { emit pressed(); } diff --git a/khexedit/statusbarprogress.h b/khexedit/statusbarprogress.h index ca605f3..de93b5a 100644 --- a/khexedit/statusbarprogress.h +++ b/khexedit/statusbarprogress.h @@ -22,10 +22,10 @@ #ifndef _STATUSBAR_PROGRESS_H_ #define _STATUSBAR_PROGRESS_H_ -#include <qframe.h> -#include <qrangecontrol.h> +#include <tqframe.h> +#include <tqrangecontrol.h> -class CStatusBarProgress : public QFrame, public QRangeControl +class CStatusBarProgress : public TQFrame, public TQRangeControl { Q_OBJECT @@ -46,18 +46,18 @@ class CStatusBarProgress : public QFrame, public QRangeControl /** * Construct a default progress bar. Orientation is horizontal. */ - CStatusBarProgress(QWidget *parent=0, const char *name=0); + CStatusBarProgress(TQWidget *parent=0, const char *name=0); /** * Construct a KProgress bar with an orientation. */ - CStatusBarProgress(Orientation, QWidget *parent=0, const char *name=0); + CStatusBarProgress(Orientation, TQWidget *parent=0, const char *name=0); /** * Construct a KProgress bar with minimum, maximum and initial value. */ CStatusBarProgress(int minValue, int maxValue, int value, Orientation, - QWidget *parent=0, const char *name=0); + TQWidget *parent=0, const char *name=0); /** * Destructor @@ -72,12 +72,12 @@ class CStatusBarProgress : public QFrame, public QRangeControl /** * Set the color of the progress bar. */ - void setBarColor(const QColor &); + void setBarColor(const TQColor &); /** * Set a pixmap to be shown in the progress bar. */ - void setBarPixmap(const QPixmap &); + void setBarPixmap(const TQPixmap &); /** * Set the orientation of the progress bar. @@ -93,12 +93,12 @@ class CStatusBarProgress : public QFrame, public QRangeControl /** * Retrieve the bar color. */ - const QColor &barColor() const; + const TQColor &barColor() const; /** * Retrieve the bar pixmap. */ - const QPixmap *barPixmap() const; + const TQPixmap *barPixmap() const; /** * Retrieve the orientation. @@ -114,7 +114,7 @@ class CStatusBarProgress : public QFrame, public QRangeControl * Returns the recommended width for vertical progress bars or * the recommended height for vertical progress bars */ - virtual QSize sizeHint() const; + virtual TQSize sizeHint() const; public slots: @@ -122,7 +122,7 @@ class CStatusBarProgress : public QFrame, public QRangeControl void setValue( int, int); void advance( int ); void setTextEnabled( bool state ); - void setText( const QString &msg ); + void setText( const TQString &msg ); signals: void percentageChanged(int); @@ -132,26 +132,26 @@ class CStatusBarProgress : public QFrame, public QRangeControl void valueChange(); void rangeChange(); void styleChange( GUIStyle ); - void paletteChange( const QPalette & ); - void drawContents( QPainter * ); - void mousePressEvent( QMouseEvent *e ); + void paletteChange( const TQPalette & ); + void drawContents( TQPainter * ); + void mousePressEvent( TQMouseEvent *e ); private: - QPixmap *mBarPixmap; + TQPixmap *mBarPixmap; QColor mBarColor; QColor mBarTextColor; QColor mTextColor; - QRect fr; + TQRect fr; BarStyle mBarStyle; Orientation mOrientation; bool mTextEnabled; - QString mMsg; + TQString mMsg; int mCurPage; int mMaxPage; void initialize( void ); int recalcValue( int ); - void drawText( QPainter * ); + void drawText( TQPainter * ); void adjustStyle( void ); }; diff --git a/khexedit/stringdialog.cc b/khexedit/stringdialog.cc index dff774c..5e93f28 100644 --- a/khexedit/stringdialog.cc +++ b/khexedit/stringdialog.cc @@ -18,11 +18,11 @@ * */ -#include <qcheckbox.h> -#include <qlabel.h> -#include <qlayout.h> -#include <qlineedit.h> -#include <qspinbox.h> +#include <tqcheckbox.h> +#include <tqlabel.h> +#include <tqlayout.h> +#include <tqlineedit.h> +#include <tqspinbox.h> #include <kconfig.h> #include <kglobalsettings.h> @@ -31,58 +31,58 @@ #include "listview.h" #include "stringdialog.h" -#include <qpushbutton.h> +#include <tqpushbutton.h> -CStringDialog::CStringDialog( QWidget *parent, const char *name, bool modal ) +CStringDialog::CStringDialog( TQWidget *parent, const char *name, bool modal ) : KDialogBase( Plain, i18n("Extract Strings"), Help|User1|Cancel, User1, parent, name, modal, true, i18n("&Update") ), mMaxLength(0), mBusy(false), mDirty(false) { - setHelp( "khexedit/khexedit.html", QString::null ); + setHelp( "khexedit/khexedit.html", TQString::null ); - QString text; - QVBoxLayout *topLayout = new QVBoxLayout( plainPage(), 0, spacingHint() ); + TQString text; + TQVBoxLayout *topLayout = new TQVBoxLayout( plainPage(), 0, spacingHint() ); - QGridLayout *glay = new QGridLayout( 3, 3, spacingHint() ); + TQGridLayout *glay = new TQGridLayout( 3, 3, spacingHint() ); topLayout->addLayout( glay ); glay->setColStretch( 1, 10 ); - mLengthSpin = new QSpinBox( plainPage() ); + mLengthSpin = new TQSpinBox( plainPage() ); mLengthSpin->setMinimumWidth( fontMetrics().maxWidth()*17 ); mLengthSpin->setRange( 1, 1000000 ); mLengthSpin->setValue( 4 ); glay->addMultiCellWidget( mLengthSpin, 0, 0, 1, 2 ); text = i18n("&Minimum length:"); - QLabel *label = new QLabel( mLengthSpin, text, plainPage() ); + TQLabel *label = new TQLabel( mLengthSpin, text, plainPage() ); glay->addWidget( label, 0, 0, AlignRight ); - mFilter = new QLineEdit( plainPage() ); + mFilter = new TQLineEdit( plainPage() ); mFilter->setMinimumWidth( fontMetrics().maxWidth()*17 ); mFilter->setText("*"); glay->addWidget( mFilter, 1, 1 ); text = i18n("&Filter:"); - label = new QLabel( mFilter, text, plainPage() ); + label = new TQLabel( mFilter, text, plainPage() ); glay->addWidget( label, 1, 0, AlignRight ); - QPushButton *useButton = new QPushButton( plainPage(), "use" ); + TQPushButton *useButton = new TQPushButton( plainPage(), "use" ); useButton->setText( i18n("&Use") ); useButton->setAutoDefault( false ); - connect( useButton, SIGNAL(clicked()),this,SLOT(slotUser1()) ); + connect( useButton, TQT_SIGNAL(clicked()),this,TQT_SLOT(slotUser1()) ); glay->addWidget( useButton, 1, 2 ); - QWidget *helper = new QWidget( plainPage() ); + TQWidget *helper = new TQWidget( plainPage() ); glay->addMultiCellWidget( helper, 2, 2, 1, 2 ); - QHBoxLayout *hlay = new QHBoxLayout( helper, 0, spacingHint() ); + TQHBoxLayout *hlay = new TQHBoxLayout( helper, 0, spacingHint() ); text = i18n("&Ignore case"); - mIgnoreCaseCheck = new QCheckBox( text, helper ); + mIgnoreCaseCheck = new TQCheckBox( text, helper ); hlay->addWidget( mIgnoreCaseCheck ); text = i18n("Show offset as &decimal"); - mOffsetDecimalCheck = new QCheckBox( text, helper ); + mOffsetDecimalCheck = new TQCheckBox( text, helper ); hlay->addWidget( mOffsetDecimalCheck ); hlay->addStretch(10); @@ -95,33 +95,33 @@ CStringDialog::CStringDialog( QWidget *parent, const char *name, bool modal ) mStringList->addColumn( i18n("Offset") ); mStringList->addColumn( i18n("String") ); mStringList->setAllColumnsShowFocus( true ); - mStringList->setFrameStyle( QFrame::WinPanel + QFrame::Sunken ); + mStringList->setFrameStyle( TQFrame::WinPanel + TQFrame::Sunken ); - connect( mStringList, SIGNAL(selectionChanged()), - SLOT(selectionChanged())); + connect( mStringList, TQT_SIGNAL(selectionChanged()), + TQT_SLOT(selectionChanged())); topLayout->addWidget( mStringList, 10 ); - hlay = new QHBoxLayout( topLayout ); + hlay = new TQHBoxLayout( topLayout ); text = i18n("Number of strings:"); - label = new QLabel( text, plainPage() ); + label = new TQLabel( text, plainPage() ); hlay->addWidget( label, AlignLeft ); - mListSizeLabel = new QLabel( QString(), plainPage() ); + mListSizeLabel = new TQLabel( TQString(), plainPage() ); mListSizeLabel->setFixedWidth( fontMetrics().maxWidth()*10 ); hlay->addWidget( mListSizeLabel, AlignLeft|AlignHCenter ); text = i18n("Displayed:"); - label = new QLabel( text, plainPage() ); + label = new TQLabel( text, plainPage() ); hlay->addWidget( label, AlignLeft ); - mDisplaySizeLabel = new QLabel( QString(""), plainPage() ); + mDisplaySizeLabel = new TQLabel( TQString(""), plainPage() ); mDisplaySizeLabel->setFixedWidth( fontMetrics().maxWidth()*10 ); hlay->addWidget( mDisplaySizeLabel, AlignLeft|AlignHCenter); hlay->addStretch( 10 ); - mDirtyLabel = new QLabel( plainPage() ); + mDirtyLabel = new TQLabel( plainPage() ); topLayout->addWidget( mDirtyLabel ); readConfiguration(); @@ -141,7 +141,7 @@ CStringDialog::~CStringDialog( void ) } -void CStringDialog::showEvent( QShowEvent *e ) +void CStringDialog::showEvent( TQShowEvent *e ) { KDialogBase::showEvent(e); mLengthSpin->setFocus(); @@ -194,7 +194,7 @@ void CStringDialog::slotUser1( void ) // Start if( mRegExp.isValid() == false ) { - QString msg = i18n("" + TQString msg = i18n("" "The filter expression you have specified is illegal. " "You must specify a valid regular expression.\n" "Continue without filter?"); @@ -218,10 +218,10 @@ void CStringDialog::slotUser1( void ) // Start } -void CStringDialog::startGoto( QListViewItem *item ) +void CStringDialog::startGoto( TQListViewItem *item ) { - QString str_offset = item->text(0); - QString string = item->text(1); + TQString str_offset = item->text(0); + TQString string = item->text(1); uint offset; if( stringData().decimalOffset == true ) @@ -275,11 +275,11 @@ void CStringDialog::selectionChanged() } -void CStringDialog::timerEvent( QTimerEvent * ) +void CStringDialog::timerEvent( TQTimerEvent * ) { killTimers(); - QListViewItem *item = mStringList->currentItem(); + TQListViewItem *item = mStringList->currentItem(); if( item == 0 ) { slotUser1(); @@ -289,7 +289,7 @@ void CStringDialog::timerEvent( QTimerEvent * ) } -void CStringDialog::resizeEvent( QResizeEvent * ) +void CStringDialog::resizeEvent( TQResizeEvent * ) { setColumnWidth(); } @@ -303,8 +303,8 @@ int CStringDialog::updateList( CProgress &p ) int offsetLen = stringData().offsetLen(); - QPtrList<QString> &list = stringData().list(); - for( const QString *str = list.first(); str != 0; str = list.next() ) + TQPtrList<TQString> &list = stringData().list(); + for( const TQString *str = list.first(); str != 0; str = list.next() ) { appendListItem( *str, offsetLen ); mMaxLength = QMAX( mMaxLength, str->length() ); @@ -361,19 +361,19 @@ void CStringDialog::enableList( bool state ) } -void CStringDialog::appendListItem( const QString &str, uint offsetLen ) +void CStringDialog::appendListItem( const TQString &str, uint offsetLen ) { if( mRegExp.search ( str, offsetLen ) != -1 ) { - new QListViewItem( mStringList, str.left(offsetLen), str.mid(offsetLen) ); + new TQListViewItem( mStringList, str.left(offsetLen), str.mid(offsetLen) ); } } void CStringDialog::updateListInfo( void ) { - mListSizeLabel->setText( QString("%1").arg(mStringData.count()) ); - mDisplaySizeLabel->setText( QString("%1").arg(mStringList->childCount()) ); + mListSizeLabel->setText( TQString("%1").arg(mStringData.count()) ); + mDisplaySizeLabel->setText( TQString("%1").arg(mStringList->childCount()) ); setColumnWidth(); } @@ -381,7 +381,7 @@ void CStringDialog::updateListInfo( void ) void CStringDialog::setColumnWidth( void ) { - const QFontMetrics &fm = mStringList->fontMetrics(); + const TQFontMetrics &fm = mStringList->fontMetrics(); if( mStringData.count() == 0 ) { diff --git a/khexedit/stringdialog.h b/khexedit/stringdialog.h index ec731e4..23bb051 100644 --- a/khexedit/stringdialog.h +++ b/khexedit/stringdialog.h @@ -31,7 +31,7 @@ class QLineEdit; class QListView; class QSpinBox; -#include <qregexp.h> +#include <tqregexp.h> #include <kdialogbase.h> class CListView; @@ -43,7 +43,7 @@ class CStringDialog : public KDialogBase Q_OBJECT public: - CStringDialog( QWidget *parent=0, const char *name = 0, bool modal=false ); + CStringDialog( TQWidget *parent=0, const char *name = 0, bool modal=false ); ~CStringDialog( void ); int updateList( CProgress &p ); @@ -61,17 +61,17 @@ class CStringDialog : public KDialogBase protected slots: virtual void slotUser1( void ); - virtual void startGoto( QListViewItem * ); + virtual void startGoto( TQListViewItem * ); virtual void selectionChanged( ); protected: - virtual void timerEvent( QTimerEvent *e ); - virtual void resizeEvent( QResizeEvent *e ); - virtual void showEvent( QShowEvent *e ); + virtual void timerEvent( TQTimerEvent *e ); + virtual void resizeEvent( TQResizeEvent *e ); + virtual void showEvent( TQShowEvent *e ); private: void enableList( bool state ); - void appendListItem( const QString &str, uint offsetSize ); + void appendListItem( const TQString &str, uint offsetSize ); void updateListInfo( void ); void setColumnWidth( void ); void readConfiguration( void ); @@ -79,19 +79,19 @@ class CStringDialog : public KDialogBase private: CStringCollectControl mStringData; - QRegExp mRegExp; + TQRegExp mRegExp; uint mMaxLength; bool mBusy; bool mDirty; - QSpinBox *mLengthSpin; - QLineEdit *mFilter; - QCheckBox *mIgnoreCaseCheck; - QCheckBox *mOffsetDecimalCheck; + TQSpinBox *mLengthSpin; + TQLineEdit *mFilter; + TQCheckBox *mIgnoreCaseCheck; + TQCheckBox *mOffsetDecimalCheck; CListView *mStringList; - QLabel *mListSizeLabel; - QLabel *mDisplaySizeLabel; - QLabel *mDirtyLabel; + TQLabel *mListSizeLabel; + TQLabel *mDisplaySizeLabel; + TQLabel *mDirtyLabel; }; diff --git a/khexedit/toplevel.cc b/khexedit/toplevel.cc index 733173e..3d65820 100644 --- a/khexedit/toplevel.cc +++ b/khexedit/toplevel.cc @@ -20,10 +20,10 @@ // kate: space-indent on; indent-width 2; replace-tabs on; -#include <qptrlist.h> -#include <qsignalmapper.h> -#include <qtimer.h> -#include <qtooltip.h> +#include <tqptrlist.h> +#include <tqsignalmapper.h> +#include <tqtimer.h> +#include <tqtooltip.h> #include <kaction.h> #include <kiconloader.h> @@ -43,7 +43,7 @@ #include "toplevel.h" -QPtrList<KHexEdit> KHexEdit::mWindowList; +TQPtrList<KHexEdit> KHexEdit::mWindowList; KHexEdit::KHexEdit( void ) : KMainWindow(0, "toplevel"), mStartupOffset(0), @@ -60,7 +60,7 @@ KHexEdit::KHexEdit( void ) // // I use an eventfilter to catch all drag/drop events for the // area outside the editor window. It will only accept KURLDrag. - // (The editor window will catch KURLDrag, QTextDrag and CHexDrag) + // (The editor window will catch KURLDrag, TQTextDrag and CHexDrag) // installEventFilter( this ); setAcceptDrops(true); @@ -68,43 +68,43 @@ KHexEdit::KHexEdit( void ) // // Prepare menus and status bar // - mAction.bookmarkMapper = new QSignalMapper(this); - connect(mAction.bookmarkMapper, SIGNAL(mapped(int)), editor(), SLOT(gotoBookmark(int))); + mAction.bookmarkMapper = new TQSignalMapper(this); + connect(mAction.bookmarkMapper, TQT_SIGNAL(mapped(int)), editor(), TQT_SLOT(gotoBookmark(int))); setupActions(); setupStatusBar(); - connect( hexView(), SIGNAL( cursorChanged( SCursorState & ) ), - this, SLOT( cursorChanged( SCursorState & ) ) ); - connect( hexView(), SIGNAL( editMode( CHexBuffer::EEditMode ) ), - this, SLOT( editMode( CHexBuffer::EEditMode ) ) ); - connect( hexView(), SIGNAL( encodingChanged( const SEncodeState &)), - this, SLOT( encodingChanged( const SEncodeState & )) ); - connect( hexView(), SIGNAL( textWidth( uint ) ), - this, SLOT( textWidth( uint ) ) ); - connect( hexView(), SIGNAL( fileState( SFileState & ) ), - this, SLOT( fileState( SFileState & ) ) ); - connect( hexView(), SIGNAL( layoutChanged( const SDisplayLayout & ) ), - this, SLOT( layoutChanged( const SDisplayLayout & ) ) ); - connect( hexView(), SIGNAL( inputModeChanged( const SDisplayInputMode & ) ), - this, SLOT( inputModeChanged( const SDisplayInputMode & ) ) ); - connect( hexView(), SIGNAL( bookmarkChanged( QPtrList<SCursorOffset> &)), - this, SLOT( bookmarkChanged( QPtrList<SCursorOffset> & ) ) ); - connect( hexView(), SIGNAL( fileName( const QString &, bool ) ), - this, SLOT( fileActive( const QString &, bool ) ) ); - connect( hexView(), SIGNAL( fileRename( const QString &, const QString & )), - this, SLOT( fileRename( const QString &, const QString & ) ) ); - connect( hexView(), SIGNAL( fileClosed( const QString & ) ), - this, SLOT( fileClosed( const QString & ) ) ); - connect( editor(), SIGNAL( errorLoadFile( const QString & ) ), - this, SLOT( removeRecentFile( const QString & ) ) ); - connect( editor(), SIGNAL( operationChanged( bool ) ), - this, SLOT( operationChanged( bool ) ) ); - connect( editor(), SIGNAL( removeRecentFiles() ), - this, SLOT( removeRecentFiles() ) ); - connect( mManager, SIGNAL( conversionClosed() ), - this, SLOT(conversionClosed()) ); - connect( mManager, SIGNAL( searchBarClosed() ), - this, SLOT(searchBarClosed()) ); + connect( hexView(), TQT_SIGNAL( cursorChanged( SCursorState & ) ), + this, TQT_SLOT( cursorChanged( SCursorState & ) ) ); + connect( hexView(), TQT_SIGNAL( editMode( CHexBuffer::EEditMode ) ), + this, TQT_SLOT( editMode( CHexBuffer::EEditMode ) ) ); + connect( hexView(), TQT_SIGNAL( encodingChanged( const SEncodeState &)), + this, TQT_SLOT( encodingChanged( const SEncodeState & )) ); + connect( hexView(), TQT_SIGNAL( textWidth( uint ) ), + this, TQT_SLOT( textWidth( uint ) ) ); + connect( hexView(), TQT_SIGNAL( fileState( SFileState & ) ), + this, TQT_SLOT( fileState( SFileState & ) ) ); + connect( hexView(), TQT_SIGNAL( layoutChanged( const SDisplayLayout & ) ), + this, TQT_SLOT( layoutChanged( const SDisplayLayout & ) ) ); + connect( hexView(), TQT_SIGNAL( inputModeChanged( const SDisplayInputMode & ) ), + this, TQT_SLOT( inputModeChanged( const SDisplayInputMode & ) ) ); + connect( hexView(), TQT_SIGNAL( bookmarkChanged( TQPtrList<SCursorOffset> &)), + this, TQT_SLOT( bookmarkChanged( TQPtrList<SCursorOffset> & ) ) ); + connect( hexView(), TQT_SIGNAL( fileName( const TQString &, bool ) ), + this, TQT_SLOT( fileActive( const TQString &, bool ) ) ); + connect( hexView(), TQT_SIGNAL( fileRename( const TQString &, const TQString & )), + this, TQT_SLOT( fileRename( const TQString &, const TQString & ) ) ); + connect( hexView(), TQT_SIGNAL( fileClosed( const TQString & ) ), + this, TQT_SLOT( fileClosed( const TQString & ) ) ); + connect( editor(), TQT_SIGNAL( errorLoadFile( const TQString & ) ), + this, TQT_SLOT( removeRecentFile( const TQString & ) ) ); + connect( editor(), TQT_SIGNAL( operationChanged( bool ) ), + this, TQT_SLOT( operationChanged( bool ) ) ); + connect( editor(), TQT_SIGNAL( removeRecentFiles() ), + this, TQT_SLOT( removeRecentFiles() ) ); + connect( mManager, TQT_SIGNAL( conversionClosed() ), + this, TQT_SLOT(conversionClosed()) ); + connect( mManager, TQT_SIGNAL( searchBarClosed() ), + this, TQT_SLOT(searchBarClosed()) ); // // Read configuration from file and set the default editor size. @@ -125,68 +125,68 @@ KHexEdit::~KHexEdit( void ) void KHexEdit::setupActions( void ) { - KStdAction::openNew( editor(), SLOT(newFile()), actionCollection() ); - KStdAction::open( editor(), SLOT(open()), actionCollection() ); - KStdAction::keyBindings(guiFactory(), SLOT(configureShortcuts()), + KStdAction::openNew( editor(), TQT_SLOT(newFile()), actionCollection() ); + KStdAction::open( editor(), TQT_SLOT(open()), actionCollection() ); + KStdAction::keyBindings(guiFactory(), TQT_SLOT(configureShortcuts()), actionCollection()); mAction.insert = new KAction( i18n("&Insert..."), CTRL+Key_I, - editor(), SLOT(insertFile()), actionCollection(), "insert_file" ); - mAction.openRecent = KStdAction::openRecent( this, SLOT( slotFileOpenRecent( const KURL& ) ), actionCollection() ); - mAction.save = KStdAction::save( editor(), SLOT(save()), actionCollection() ); - mAction.saveAs = KStdAction::saveAs( editor(), SLOT(saveAs()), actionCollection() ); - mAction.revert = KStdAction::revert( editor(), SLOT(reload()), actionCollection() ); - //mAction.revert = KStdAction::revert( this, SLOT(resizeTest()), actionCollection() ); - - mAction.close = KStdAction::close( editor(), SLOT(close()), actionCollection() ); - mAction.print = KStdAction::print( editor(), SLOT(print()), actionCollection() ); + editor(), TQT_SLOT(insertFile()), actionCollection(), "insert_file" ); + mAction.openRecent = KStdAction::openRecent( this, TQT_SLOT( slotFileOpenRecent( const KURL& ) ), actionCollection() ); + mAction.save = KStdAction::save( editor(), TQT_SLOT(save()), actionCollection() ); + mAction.saveAs = KStdAction::saveAs( editor(), TQT_SLOT(saveAs()), actionCollection() ); + mAction.revert = KStdAction::revert( editor(), TQT_SLOT(reload()), actionCollection() ); + //mAction.revert = KStdAction::revert( this, TQT_SLOT(resizeTest()), actionCollection() ); + + mAction.close = KStdAction::close( editor(), TQT_SLOT(close()), actionCollection() ); + mAction.print = KStdAction::print( editor(), TQT_SLOT(print()), actionCollection() ); mAction.exportData = new KAction( i18n("E&xport..."), 0, - editor(), SLOT(exportDialog()), actionCollection(), "export" ); + editor(), TQT_SLOT(exportDialog()), actionCollection(), "export" ); mAction.cancel = new KAction( i18n("&Cancel Operation"), - "stop", 0, editor(), SLOT(stop()), actionCollection(), "cancel" ); + "stop", 0, editor(), TQT_SLOT(stop()), actionCollection(), "cancel" ); mAction.readOnly = new KToggleAction( i18n("&Read Only"), - 0, editor(), SLOT(toggleWriteProtection()),actionCollection(), "read_only" ); + 0, editor(), TQT_SLOT(toggleWriteProtection()),actionCollection(), "read_only" ); mAction.resizeLock = new KToggleAction( i18n("&Allow Resize"), - 0, editor(), SLOT(toggleResizeLock()),actionCollection(), "resize_lock" ); + 0, editor(), TQT_SLOT(toggleResizeLock()),actionCollection(), "resize_lock" ); mAction.newWindow = new KAction( i18n("N&ew Window"), - 0, this, SLOT(newWindow()),actionCollection(), "new_window" ); + 0, this, TQT_SLOT(newWindow()),actionCollection(), "new_window" ); mAction.closeWindow= new KAction( i18n("Close &Window"), - 0, this, SLOT(closeWindow()),actionCollection(), "close_window" ); - mAction.quit = KStdAction::quit( this, SLOT(closeProgram()), actionCollection() ); - - mAction.undo = KStdAction::undo( editor(), SLOT(undo()), actionCollection() ); - mAction.redo = KStdAction::redo( editor(), SLOT(redo()), actionCollection() ); - mAction.cut = KStdAction::cut( editor(), SLOT(cut()), actionCollection() ); - mAction.copy = KStdAction::copy( editor(), SLOT(copy()), actionCollection() ); - mAction.paste = KStdAction::paste( editor(), SLOT(paste()), actionCollection() ); - mAction.selectAll = KStdAction::selectAll(editor(), SLOT(selectAll()),actionCollection() ); - mAction.unselect = KStdAction::deselect(editor(), SLOT(unselect()), actionCollection()); - mAction.find = KStdAction::find( editor(), SLOT(find()), actionCollection() ); - mAction.findNext = KStdAction::findNext(editor(), SLOT(findNext()), actionCollection() ); - mAction.findPrev = KStdAction::findPrev(editor(),SLOT(findPrevious()),actionCollection() ); - mAction.replace = KStdAction::replace( editor(), SLOT(replace()), actionCollection() ); + 0, this, TQT_SLOT(closeWindow()),actionCollection(), "close_window" ); + mAction.quit = KStdAction::quit( this, TQT_SLOT(closeProgram()), actionCollection() ); + + mAction.undo = KStdAction::undo( editor(), TQT_SLOT(undo()), actionCollection() ); + mAction.redo = KStdAction::redo( editor(), TQT_SLOT(redo()), actionCollection() ); + mAction.cut = KStdAction::cut( editor(), TQT_SLOT(cut()), actionCollection() ); + mAction.copy = KStdAction::copy( editor(), TQT_SLOT(copy()), actionCollection() ); + mAction.paste = KStdAction::paste( editor(), TQT_SLOT(paste()), actionCollection() ); + mAction.selectAll = KStdAction::selectAll(editor(), TQT_SLOT(selectAll()),actionCollection() ); + mAction.unselect = KStdAction::deselect(editor(), TQT_SLOT(unselect()), actionCollection()); + mAction.find = KStdAction::find( editor(), TQT_SLOT(find()), actionCollection() ); + mAction.findNext = KStdAction::findNext(editor(), TQT_SLOT(findNext()), actionCollection() ); + mAction.findPrev = KStdAction::findPrev(editor(),TQT_SLOT(findPrevious()),actionCollection() ); + mAction.replace = KStdAction::replace( editor(), TQT_SLOT(replace()), actionCollection() ); mAction.gotoOffset = new KAction( i18n("&Goto Offset..."), CTRL+Key_G, - editor(), SLOT(gotoOffset()),actionCollection(), "goto_offset" ); + editor(), TQT_SLOT(gotoOffset()),actionCollection(), "goto_offset" ); mAction.insertPattern = new KAction( i18n("&Insert Pattern..."), CTRL+Key_Insert, - editor(), SLOT(insertPattern()), actionCollection(), "insert_pattern" ); + editor(), TQT_SLOT(insertPattern()), actionCollection(), "insert_pattern" ); mAction.copyAsText = new KAction( i18n("Copy as &Text"), 0, - editor(), SLOT(copyText()), actionCollection(), "copy_as_text" ); + editor(), TQT_SLOT(copyText()), actionCollection(), "copy_as_text" ); mAction.pasteToNewFile = new KAction( i18n("Paste into New &File"), 0, - editor(), SLOT(pasteNewFile()), actionCollection(), "paste_into_new_file" ); + editor(), TQT_SLOT(pasteNewFile()), actionCollection(), "paste_into_new_file" ); mAction.pasteToNewWindow = new KAction( i18n("Paste into New &Window"), 0, - this, SLOT(pasteNewWindow()), actionCollection(), "paste_into_new_window" ); + this, TQT_SLOT(pasteNewWindow()), actionCollection(), "paste_into_new_window" ); mAction.hexadecimal = new KRadioAction( i18n("&Hexadecimal"), - 0, this, SLOT(setDisplayMode()), actionCollection(), "mode_hex" ); + 0, this, TQT_SLOT(setDisplayMode()), actionCollection(), "mode_hex" ); mAction.decimal = new KRadioAction( i18n("&Decimal"), - 0, this, SLOT(setDisplayMode()), actionCollection(), "mode_dec" ); + 0, this, TQT_SLOT(setDisplayMode()), actionCollection(), "mode_dec" ); mAction.octal = new KRadioAction( i18n("&Octal"), - 0, this, SLOT(setDisplayMode()), actionCollection(), "mode_oct" ); + 0, this, TQT_SLOT(setDisplayMode()), actionCollection(), "mode_oct" ); mAction.binary = new KRadioAction( i18n("&Binary"), - 0, this, SLOT(setDisplayMode()), actionCollection(), "mode_bin" ); + 0, this, TQT_SLOT(setDisplayMode()), actionCollection(), "mode_bin" ); mAction.textOnly = new KRadioAction( i18n("&Text"), - 0, this, SLOT(setDisplayMode()), actionCollection(), "mode_text" ); + 0, this, TQT_SLOT(setDisplayMode()), actionCollection(), "mode_text" ); mAction.hexadecimal->setExclusiveGroup( "displayMode" ); mAction.decimal->setExclusiveGroup( "displayMode" ); mAction.octal->setExclusiveGroup( "displayMode" ); @@ -194,120 +194,120 @@ actionCollection()); mAction.textOnly->setExclusiveGroup( "displayMode" ); mAction.showOffsetColumn = new KToggleAction( i18n("Show O&ffset Column"), - 0, editor(), SLOT(toggleOffsetColumnVisibility()),actionCollection(), "show_offset_column" ); + 0, editor(), TQT_SLOT(toggleOffsetColumnVisibility()),actionCollection(), "show_offset_column" ); mAction.showTextColumn = new KToggleAction( i18n("Show Te&xt Field"), - 0, editor(), SLOT(toggleTextColumnVisibility()),actionCollection(), "show_text_field" ); + 0, editor(), TQT_SLOT(toggleTextColumnVisibility()),actionCollection(), "show_text_field" ); mAction.offsetAsDecimal = new KToggleAction( i18n("Off&set as Decimal"), - 0, editor(), SLOT(toggleOffsetAsDecimal()),actionCollection(), "offset_as_decimal" ); + 0, editor(), TQT_SLOT(toggleOffsetAsDecimal()),actionCollection(), "offset_as_decimal" ); mAction.dataUppercase = new KToggleAction( i18n("&Upper Case (Data)"), - 0, editor(), SLOT(toggleDataUppercase()),actionCollection(), "upper_case_data" ); + 0, editor(), TQT_SLOT(toggleDataUppercase()),actionCollection(), "upper_case_data" ); mAction.offsetUppercase = new KToggleAction( i18n("Upper &Case (Offset)"), - 0, editor(), SLOT(toggleOffsetUppercase()),actionCollection(), "upper_case_offset" ); + 0, editor(), TQT_SLOT(toggleOffsetUppercase()),actionCollection(), "upper_case_offset" ); mAction.defaultEncoding = new KRadioAction( i18n("&Default encoding", "&Default"), - 0, this, SLOT( setEncoding()), actionCollection(), "enc_default" ); + 0, this, TQT_SLOT( setEncoding()), actionCollection(), "enc_default" ); mAction.usAsciiEncoding = new KRadioAction( i18n("US-&ASCII (7 bit)"), - 0, this, SLOT( setEncoding()), actionCollection(), "enc_ascii"); + 0, this, TQT_SLOT( setEncoding()), actionCollection(), "enc_ascii"); mAction.ebcdicEncoding = new KRadioAction( i18n("&EBCDIC"), - 0, this, SLOT( setEncoding()), actionCollection(), "enc_ebcdic" ); + 0, this, TQT_SLOT( setEncoding()), actionCollection(), "enc_ebcdic" ); // mAction.customEncoding = new KAction( i18n("&Custom..."), -// 0, editor(), SLOT( encoding()), actionCollection(), "enc_custom" ); +// 0, editor(), TQT_SLOT( encoding()), actionCollection(), "enc_custom" ); mAction.defaultEncoding->setExclusiveGroup( "encodingMode" ); mAction.usAsciiEncoding->setExclusiveGroup( "encodingMode" ); mAction.ebcdicEncoding->setExclusiveGroup( "encodingMode" ); mAction.strings = new KAction( i18n("&Extract Strings..."), 0, - editor(), SLOT(strings()), actionCollection(), "extract_strings" ); + editor(), TQT_SLOT(strings()), actionCollection(), "extract_strings" ); // mAction.recordViewer = new KAction( i18n("&Record Viewer"), 0, -// editor(), SLOT(recordView()), actionCollection(), "record_viewer" ); +// editor(), TQT_SLOT(recordView()), actionCollection(), "record_viewer" ); mAction.filter = new KAction( i18n("&Binary Filter..."), 0, - editor(), SLOT(filter()), actionCollection(), "binary_filter" ); + editor(), TQT_SLOT(filter()), actionCollection(), "binary_filter" ); mAction.characterTable = new KAction( i18n("&Character Table"), 0, - editor(), SLOT(chart()), actionCollection(), "char_table" ); + editor(), TQT_SLOT(chart()), actionCollection(), "char_table" ); mAction.converter = new KAction( i18n("C&onverter"), 0, - editor(), SLOT(converter()), actionCollection(), "converter" ); + editor(), TQT_SLOT(converter()), actionCollection(), "converter" ); mAction.statistics = new KAction( i18n("&Statistics"), 0, - editor(), SLOT(statistics()), actionCollection(), "statistics" ); + editor(), TQT_SLOT(statistics()), actionCollection(), "statistics" ); mAction.addBookmark = KStdAction::addBookmark( editor(), - SLOT(addBookmark()), actionCollection() ); + TQT_SLOT(addBookmark()), actionCollection() ); mAction.replaceBookmark = new KAction( i18n("&Replace Bookmark"), CTRL+Key_E, - editor(), SLOT(replaceBookmark()), actionCollection(), "replace_bookmark"); + editor(), TQT_SLOT(replaceBookmark()), actionCollection(), "replace_bookmark"); mAction.removeBookmark = new KAction( i18n("R&emove Bookmark"), CTRL+Key_U, - editor(), SLOT(removeBookmark()), actionCollection(), "remove_bookmark" ); + editor(), TQT_SLOT(removeBookmark()), actionCollection(), "remove_bookmark" ); mAction.removeAllBookmark = new KAction( i18n("Re&move All"), 0, - editor(), SLOT(removeAllBookmark()), actionCollection(), "remove_all_bookmarks" ); + editor(), TQT_SLOT(removeAllBookmark()), actionCollection(), "remove_all_bookmarks" ); mAction.nextBookmark = new KAction( i18n("Goto &Next Bookmark"), ALT+Key_Down, editor(), - SLOT(gotoNextBookmark()), actionCollection(), "next_bookmark" ); + TQT_SLOT(gotoNextBookmark()), actionCollection(), "next_bookmark" ); mAction.prevBookmark = new KAction( i18n("Goto &Previous Bookmark"), ALT+Key_Up, editor(), - SLOT(gotoPrevBookmark()), actionCollection(), "prev_bookmark" ); + TQT_SLOT(gotoPrevBookmark()), actionCollection(), "prev_bookmark" ); createStandardStatusBarAction(); setStandardToolBarMenuEnabled(true); mAction.showFullPath = new KToggleAction( i18n("Show F&ull Path"), - 0, this, SLOT(showFullPath()), actionCollection(), "show_full_path" ); + 0, this, TQT_SLOT(showFullPath()), actionCollection(), "show_full_path" ); mAction.tabHide = new KRadioAction( i18n("&Hide"), - 0, this, SLOT(showDocumentTabs()), actionCollection(), "doctab_hide" ); + 0, this, TQT_SLOT(showDocumentTabs()), actionCollection(), "doctab_hide" ); mAction.tabShowAboveEditor = new KRadioAction( i18n("&Above Editor"), - 0, this, SLOT(showDocumentTabs()), actionCollection(), "doctab_above" ); + 0, this, TQT_SLOT(showDocumentTabs()), actionCollection(), "doctab_above" ); mAction.tabShowBelowEditor = new KRadioAction( i18n("&Below Editor"), - 0, this, SLOT(showDocumentTabs()), actionCollection(), "doctab_below" ); + 0, this, TQT_SLOT(showDocumentTabs()), actionCollection(), "doctab_below" ); mAction.tabHide->setExclusiveGroup( "editorTab" ); mAction.tabShowAboveEditor->setExclusiveGroup( "editorTab" ); mAction.tabShowBelowEditor->setExclusiveGroup( "editorTab" ); mAction.conversionHide = new KRadioAction( i18n("&Hide"), - 0, this, SLOT(showConversionField()), actionCollection(), "conversion_field_hide"); + 0, this, TQT_SLOT(showConversionField()), actionCollection(), "conversion_field_hide"); mAction.conversionFloat = new KRadioAction( i18n("&Floating"), - 0, this, SLOT(showConversionField()), actionCollection(), "conversion_field_float"); + 0, this, TQT_SLOT(showConversionField()), actionCollection(), "conversion_field_float"); mAction.conversionEmbed = new KRadioAction( i18n("&Embed in Main Window"), - 0, this, SLOT(showConversionField()), actionCollection(), "conversion_field_embed"); + 0, this, TQT_SLOT(showConversionField()), actionCollection(), "conversion_field_embed"); mAction.conversionHide->setExclusiveGroup( "conversionField" ); mAction.conversionFloat->setExclusiveGroup( "conversionField" ); mAction.conversionEmbed->setExclusiveGroup( "conversionField" ); mAction.searchHide = new KRadioAction( i18n("&Hide"), - 0, this, SLOT(showSearchBar()), actionCollection(), "searchbar_hide" ); + 0, this, TQT_SLOT(showSearchBar()), actionCollection(), "searchbar_hide" ); mAction.searchShowAboveEditor = new KRadioAction( i18n("&Above Editor"), - Key_F5, this, SLOT(showSearchBar()), actionCollection(), "searchbar_above" ); + Key_F5, this, TQT_SLOT(showSearchBar()), actionCollection(), "searchbar_above" ); mAction.searchShowBelowEditor = new KRadioAction( i18n("&Below Editor"), - Key_F6, this, SLOT(showSearchBar()), actionCollection(), "searchbar_below" ); + Key_F6, this, TQT_SLOT(showSearchBar()), actionCollection(), "searchbar_below" ); mAction.searchHide->setExclusiveGroup( "searchBar" ); mAction.searchShowAboveEditor->setExclusiveGroup( "searchBar" ); mAction.searchShowBelowEditor->setExclusiveGroup( "searchBar" ); - KStdAction::saveOptions(this, SLOT(writeConfiguration()), actionCollection()); - KStdAction::preferences(editor(),SLOT(options()),actionCollection() ); + KStdAction::saveOptions(this, TQT_SLOT(writeConfiguration()), actionCollection()); + KStdAction::preferences(editor(),TQT_SLOT(options()),actionCollection() ); // mAction.favorites = new KAction( i18n("P&rofiles..."), 0, -// editor(), SLOT(favorites()), actionCollection(), "favorites" ); +// editor(), TQT_SLOT(favorites()), actionCollection(), "favorites" ); - KStdAction::help( this, SLOT(appHelpActivated()), actionCollection() ); + KStdAction::help( this, TQT_SLOT(appHelpActivated()), actionCollection() ); mDragLabel = new CDragLabel(this); mDragLabel->setPixmap( UserIcon( "hexdrag" ) ); mDragLabel->setDragMask( UserIcon( "hexmask" ) ); mDragLabel->setEnabled( false ); // Enabled once we open a document - QToolTip::add( mDragLabel, i18n("Drag document") ); - (void) new KWidgetAction(mDragLabel, i18n("Drag Document"), 0, editor(), SLOT(options()), actionCollection(), "drag_document"); + TQToolTip::add( mDragLabel, i18n("Drag document") ); + (void) new KWidgetAction(mDragLabel, i18n("Drag Document"), 0, editor(), TQT_SLOT(options()), actionCollection(), "drag_document"); createGUI("khexeditui.rc", false); - QPopupMenu *popup = (QPopupMenu *)factory()->container("editor_popup", this); + TQPopupMenu *popup = (TQPopupMenu *)factory()->container("editor_popup", this); hexView()->setPopupMenu( popup ); int id = 100; - toolBar(0)->insertButton( MainBarIcon("lock"), id, SIGNAL(clicked()), - editor(), SLOT(toggleWriteProtection()), true, + toolBar(0)->insertButton( MainBarIcon("lock"), id, TQT_SIGNAL(clicked()), + editor(), TQT_SLOT(toggleWriteProtection()), true, i18n("Toggle write protection") ); toolBar(0)->alignItemRight( id ); mWriteProtectButton = toolBar(0)->getButton(id); - QPopupMenu *documentMenu = (QPopupMenu *)factory()->container("documents", this); + TQPopupMenu *documentMenu = (TQPopupMenu *)factory()->container("documents", this); hexView()->setDocumentMenu(documentMenu); - connect(documentMenu, SIGNAL(activated(int)), SLOT(documentMenuCB(int))); + connect(documentMenu, TQT_SIGNAL(activated(int)), TQT_SLOT(documentMenuCB(int))); } @@ -316,15 +316,15 @@ void KHexEdit::setupStatusBar( void ) { CStatusBarProgress *progess = new CStatusBarProgress( statusBar() ); statusBar()->addWidget( progess, 10 ); - connect( progess, SIGNAL(pressed()), editor(), SLOT(stop()) ); - connect( editor(), SIGNAL( setProgress( int ) ), - progess, SLOT( setValue( int ) ) ); - connect( editor(), SIGNAL( setProgress( int, int ) ), - progess, SLOT( setValue( int, int ) ) ); - connect( editor(), SIGNAL( enableProgressText( bool ) ), - progess, SLOT( setTextEnabled( bool ) ) ); - connect( editor(), SIGNAL( setProgressText( const QString & ) ), - progess, SLOT( setText( const QString & ) ) ); + connect( progess, TQT_SIGNAL(pressed()), editor(), TQT_SLOT(stop()) ); + connect( editor(), TQT_SIGNAL( setProgress( int ) ), + progess, TQT_SLOT( setValue( int ) ) ); + connect( editor(), TQT_SIGNAL( setProgress( int, int ) ), + progess, TQT_SLOT( setValue( int, int ) ) ); + connect( editor(), TQT_SIGNAL( enableProgressText( bool ) ), + progess, TQT_SLOT( setTextEnabled( bool ) ) ); + connect( editor(), TQT_SIGNAL( setProgressText( const TQString & ) ), + progess, TQT_SLOT( setText( const TQString & ) ) ); statusBar()->insertFixedItem( i18n("Selection: 0000:0000 0000:0000"), status_Selection ); @@ -347,7 +347,7 @@ void KHexEdit::setupStatusBar( void ) statusBar()->changeItem( i18n("Size:"), status_Size ); statusBar()->changeItem( "", status_Modified ); statusBar()->changeItem( "", status_Selection ); - connect( statusBar(),SIGNAL(pressed(int)),this,SLOT(statusBarPressed(int)) ); + connect( statusBar(),TQT_SIGNAL(pressed(int)),this,TQT_SLOT(statusBarPressed(int)) ); } @@ -380,9 +380,9 @@ void KHexEdit::initialize( bool openFiles ) KConfig* config = kapp->config(); - const QString oldGroup = config->group(); + const TQString oldGroup = config->group(); - const QString groupname = "RecentFiles"; + const TQString groupname = "RecentFiles"; config->setGroup( groupname ); // read file list @@ -391,8 +391,8 @@ void KHexEdit::initialize( bool openFiles ) maxItems = 1; for( unsigned int i = 1 ; i <= maxItems ; i++ ) { - const QString key = QString( "File%1" ).arg( i ); - const QString value = config->readPathEntry( key ); + const TQString key = TQString( "File%1" ).arg( i ); + const TQString value = config->readPathEntry( key ); if (!value.isEmpty()) { @@ -411,7 +411,7 @@ void KHexEdit::initialize( bool openFiles ) // is displayed, then the editor will not be visible until the error // is confirmed and the (modal) dialog is closed. // - QTimer::singleShot( 100, this, SLOT(delayedStartupOpen()) ); + TQTimer::singleShot( 100, this, TQT_SLOT(delayedStartupOpen()) ); } @@ -450,7 +450,7 @@ void KHexEdit::statusBarPressed( int id ) -void KHexEdit::open( QStringList &fileList, QStringList &offsetList ) +void KHexEdit::open( TQStringList &fileList, TQStringList &offsetList ) { // // We load in reverse to allow the first document in @@ -472,7 +472,7 @@ void KHexEdit::open( QStringList &fileList, QStringList &offsetList ) } } -void KHexEdit::addRecentFile( const QString &fileName ) +void KHexEdit::addRecentFile( const TQString &fileName ) { if( fileName.isEmpty() == true ) { @@ -491,7 +491,7 @@ void KHexEdit::addRecentFile( const QString &fileName ) } -void KHexEdit::removeRecentFile( const QString &fileName ) +void KHexEdit::removeRecentFile( const TQString &fileName ) { if( fileName.isEmpty() == true ) { @@ -509,7 +509,7 @@ void KHexEdit::removeRecentFile( const QString &fileName ) } -void KHexEdit::renameRecentFile(const QString &curName, const QString &newName) +void KHexEdit::renameRecentFile(const TQString &curName, const TQString &newName) { if( curName.contains( i18n( "Untitled" ), false ) ) { @@ -543,7 +543,7 @@ KHexEdit *KHexEdit::newWindow( void ) KHexEdit *hexEdit = new KHexEdit; if( hexEdit == 0 ) { - QString msg = i18n( "Can not create new window.\n" ); + TQString msg = i18n( "Can not create new window.\n" ); msg += hexError( Err_NoMemory ); KMessageBox::error( topLevelWidget(), msg ); return(0); @@ -579,10 +579,10 @@ void KHexEdit::closeProgram( void ) { if( w->editor()->modified() == true ) { - QString msg = i18n("" + TQString msg = i18n("" "There are windows with unsaved modified documents. " "If you quit now, these modifications will be lost."); - int reply = KMessageBox::warningContinueCancel( topLevelWidget(), msg, QString::null, KStdGuiItem::quit() ); + int reply = KMessageBox::warningContinueCancel( topLevelWidget(), msg, TQString::null, KStdGuiItem::quit() ); if( reply == KMessageBox::Continue ) { break; @@ -747,7 +747,7 @@ void KHexEdit::operationChanged( bool state ) void KHexEdit::cursorChanged( SCursorState &state ) { - QString offset( i18n("Offset:") ); + TQString offset( i18n("Offset:") ); if( state.valid == false ) { @@ -761,18 +761,18 @@ void KHexEdit::cursorChanged( SCursorState &state ) { if( layout.offsetUpperCase == false ) { - offset += QString().sprintf( " %04x:%04x-%u", state.offset>>16, + offset += TQString().sprintf( " %04x:%04x-%u", state.offset>>16, state.offset&0x0000FFFF, state.cell ); } else { - offset += QString().sprintf( " %04X:%04X-%u", state.offset>>16, + offset += TQString().sprintf( " %04X:%04X-%u", state.offset>>16, state.offset&0x0000FFFF, state.cell ); } } else { - offset += QString().sprintf( " %010u-%u", state.offset, state.cell ); + offset += TQString().sprintf( " %010u-%u", state.offset, state.cell ); } statusBar()->changeItem( offset, status_Offset ); } @@ -903,7 +903,7 @@ void KHexEdit::inputModeChanged( const SDisplayInputMode &mode ) } -void KHexEdit::bookmarkChanged( QPtrList<SCursorOffset> &list ) +void KHexEdit::bookmarkChanged( TQPtrList<SCursorOffset> &list ) { unplugActionList("bookmark_list"); mAction.bookmarkList.setAutoDelete(true); @@ -916,14 +916,14 @@ void KHexEdit::bookmarkChanged( QPtrList<SCursorOffset> &list ) mAction.bookmarkList.append(new KActionSeparator()); - QString text, offset; + TQString text, offset; int i=0; for( SCursorOffset *p=list.first(); p!=0; p=list.next(), i++ ) { offset.sprintf("%04X:%04X", p->offset>>16, p->offset&0x0000FFFF ); text = i18n("Offset: %1").arg(offset); - KAction *action = new KAction(text, 0, mAction.bookmarkMapper, SLOT(map()), this, text.latin1()); + KAction *action = new KAction(text, 0, mAction.bookmarkMapper, TQT_SLOT(map()), this, text.latin1()); int key = acceleratorNumKey( i ); if( key > 0 ) { @@ -936,7 +936,7 @@ void KHexEdit::bookmarkChanged( QPtrList<SCursorOffset> &list ) } -void KHexEdit::setupCaption( const QString &url ) +void KHexEdit::setupCaption( const TQString &url ) { KURL u(url); if( mShowFullPath == true ) @@ -950,7 +950,7 @@ void KHexEdit::setupCaption( const QString &url ) } -void KHexEdit::fileActive( const QString &url, bool onDisk ) +void KHexEdit::fileActive( const TQString &url, bool onDisk ) { setupCaption( url ); mDragLabel->setUrl( url ); @@ -967,7 +967,7 @@ void KHexEdit::fileActive( const QString &url, bool onDisk ) } -void KHexEdit::fileRename( const QString &curName, const QString &newName ) +void KHexEdit::fileRename( const TQString &curName, const TQString &newName ) { if( newName.isNull() == true ) { @@ -981,7 +981,7 @@ void KHexEdit::fileRename( const QString &curName, const QString &newName ) } -void KHexEdit::fileClosed( const QString &url ) +void KHexEdit::fileClosed( const TQString &url ) { removeDocument( url ); } @@ -1169,16 +1169,16 @@ void KHexEdit::setSelectionText( uint selectionOffset, uint selectionSize ) { if( selectionSize > 0 ) { - QString selection = i18n("Selection:"); + TQString selection = i18n("Selection:"); if( mSelectionAsHexadecimal == true ) { - selection += QString().sprintf( " %04x:%04x %04x:%04x", + selection += TQString().sprintf( " %04x:%04x %04x:%04x", selectionOffset>>16, selectionOffset&0x0000FFFF, selectionSize>>16, selectionSize&0x0000FFFF ); } else { - selection += QString().sprintf( " %08u %08u", + selection += TQString().sprintf( " %08u %08u", selectionOffset, selectionSize); } statusBar()->changeItem( selection, status_Selection ); @@ -1200,7 +1200,7 @@ void KHexEdit::documentMenuCB( int index ) } -void KHexEdit::addDocument( const QString &fileName ) +void KHexEdit::addDocument( const TQString &fileName ) { uint documentCount = mDocumentList.count(); for( uint i=0; i < documentCount; i++ ) @@ -1213,7 +1213,7 @@ void KHexEdit::addDocument( const QString &fileName ) mDocumentList.append( fileName ); - QPopupMenu *documentMenu = (QPopupMenu *)factory()->container("documents", this); + TQPopupMenu *documentMenu = (TQPopupMenu *)factory()->container("documents", this); documentMenu->insertItem( fileName, documentCount, documentCount ); int key = acceleratorNumKey( documentCount ); if( key > 0 ) @@ -1223,14 +1223,14 @@ void KHexEdit::addDocument( const QString &fileName ) } -void KHexEdit::removeDocument( const QString &fileName ) +void KHexEdit::removeDocument( const TQString &fileName ) { - QStringList::Iterator it; + TQStringList::Iterator it; for( it = mDocumentList.begin(); it != mDocumentList.end(); it++ ) { if( *it == fileName ) { - QPopupMenu *documentMenu = (QPopupMenu *)factory()->container("documents", this); + TQPopupMenu *documentMenu = (TQPopupMenu *)factory()->container("documents", this); documentMenu->removeItemAt( mDocumentList.findIndex(*it) ); mDocumentList.remove( it ); @@ -1251,14 +1251,14 @@ void KHexEdit::removeDocument( const QString &fileName ) } -void KHexEdit::renameDocument( const QString &curName, const QString &newName ) +void KHexEdit::renameDocument( const TQString &curName, const TQString &newName ) { - QStringList::Iterator it; + TQStringList::Iterator it; for( it = mDocumentList.begin(); it != mDocumentList.end(); it++ ) { if( *it == curName ) { - QPopupMenu *documentMenu = (QPopupMenu *)factory()->container("documents", this); + TQPopupMenu *documentMenu = (TQPopupMenu *)factory()->container("documents", this); documentMenu->changeItem( newName, mDocumentList.findIndex(*it) ); mDocumentList.insert( it, newName ); mDocumentList.remove( it ); @@ -1268,10 +1268,10 @@ void KHexEdit::renameDocument( const QString &curName, const QString &newName ) } -void KHexEdit::setTickedDocument( const QString &fileName ) +void KHexEdit::setTickedDocument( const TQString &fileName ) { uint documentCount = mDocumentList.count(); - QPopupMenu *documentMenu = (QPopupMenu *)factory()->container("documents", this); + TQPopupMenu *documentMenu = (TQPopupMenu *)factory()->container("documents", this); for( uint i=0; i < documentCount; i++ ) { documentMenu->setItemChecked( i, fileName == mDocumentList[i] ); @@ -1291,11 +1291,11 @@ void KHexEdit::searchBarClosed( void ) } -bool KHexEdit::eventFilter( QObject *o, QEvent *event ) +bool KHexEdit::eventFilter( TQObject *o, TQEvent *event ) { - if( event->type() == QEvent::DragEnter ) + if( event->type() == TQEvent::DragEnter ) { - QDragEnterEvent *e = (QDragEnterEvent*)event; + TQDragEnterEvent *e = (TQDragEnterEvent*)event; if( KURLDrag::canDecode(e) ) { e->accept(); @@ -1303,22 +1303,22 @@ bool KHexEdit::eventFilter( QObject *o, QEvent *event ) } return( true ); } - else if( event->type() == QEvent::Drop ) + else if( event->type() == TQEvent::Drop ) { - QMimeSource &m = *(QDropEvent*)event; + TQMimeSource &m = *(TQDropEvent*)event; hexView()->setDropHighlight( false ); KURL::List list; if( KURLDrag::decode( &m, list ) == true ) { - QStringList offset; - QStringList urlList = list.toStringList(); + TQStringList offset; + TQStringList urlList = list.toStringList(); open( urlList, offset ); return( true ); } return( true ); } - else if( event->type() == QEvent::DragLeave ) + else if( event->type() == TQEvent::DragLeave ) { hexView()->setDropHighlight( false ); return( true ); diff --git a/khexedit/toplevel.h b/khexedit/toplevel.h index fbacca1..4043cd2 100644 --- a/khexedit/toplevel.h +++ b/khexedit/toplevel.h @@ -25,7 +25,7 @@ #include <config.h> #endif -#include <qptrlist.h> +#include <tqptrlist.h> #include <kapplication.h> #include <kstdaccel.h> #include <kmainwindow.h> @@ -135,15 +135,15 @@ class KHexEdit : public KMainWindow // KAction *favorites; - QPtrList< KAction > bookmarkList; - QSignalMapper *bookmarkMapper; + TQPtrList< KAction > bookmarkList; + TQSignalMapper *bookmarkMapper; }; public: KHexEdit( void ); ~KHexEdit( void ); - inline void addStartupFile( const QString &fileName ); + inline void addStartupFile( const TQString &fileName ); inline void setStartupOffset( uint offset ); public slots: @@ -158,14 +158,14 @@ class KHexEdit : public KMainWindow void fileState( SFileState &state ); void layoutChanged( const SDisplayLayout &layout ); void inputModeChanged( const SDisplayInputMode &mode ); - void bookmarkChanged( QPtrList<SCursorOffset> &list ); - void removeRecentFile( const QString &fileName ); - void renameRecentFile( const QString &curName, const QString &newName ); - - void setupCaption( const QString &url ); - void fileActive( const QString &url, bool onDisk ); - void fileRename( const QString &curName, const QString &newName ); - void fileClosed( const QString &url ); + void bookmarkChanged( TQPtrList<SCursorOffset> &list ); + void removeRecentFile( const TQString &fileName ); + void renameRecentFile( const TQString &curName, const TQString &newName ); + + void setupCaption( const TQString &url ); + void fileActive( const TQString &url, bool onDisk ); + void fileRename( const TQString &curName, const TQString &newName ); + void fileClosed( const TQString &url ); void readConfiguration( void ); void writeConfiguration( void ); void editMode( CHexBuffer::EEditMode editMode ); @@ -200,21 +200,21 @@ protected: private: void setupActions( void ); void setupStatusBar( void ); - void open( QStringList &fileList, QStringList &offsetList ); + void open( TQStringList &fileList, TQStringList &offsetList ); void initialize( bool openFiles ); - void addRecentFile( const QString &fileName ); + void addRecentFile( const TQString &fileName ); bool closeAllWindow( void ); void setUndoState( uint undoState ); void setSelectionState( uint selectionOffset, uint selectionSize ); void setSelectionText( uint selectionOffset, uint selectionSize ); - void addDocument( const QString &fileName ); - void removeDocument( const QString &fileName ); - void renameDocument( const QString &curName, const QString &newName ); - void setTickedDocument( const QString &fileName ); + void addDocument( const TQString &fileName ); + void removeDocument( const TQString &fileName ); + void renameDocument( const TQString &curName, const TQString &newName ); + void setTickedDocument( const TQString &fileName ); void writeConfiguration( KConfig &config ); void readConfiguration( KConfig &config ); - bool eventFilter( QObject *obj, QEvent *event ); + bool eventFilter( TQObject *obj, TQEvent *event ); int acceleratorNumKey( uint index ); inline CHexEditorWidget *editor( void ); @@ -222,12 +222,12 @@ protected: inline CHexViewWidget *hexView( void ); private: - static QPtrList<KHexEdit> mWindowList; + static TQPtrList<KHexEdit> mWindowList; CHexManagerWidget *mManager; - QStringList mDocumentList; + TQStringList mDocumentList; - QStringList mStartupFileList; ///< Files to automatically open on startup - QStringList mStartupOffsetList; ///< Start offset for those files. + TQStringList mStartupFileList; ///< Files to automatically open on startup + TQStringList mStartupOffsetList; ///< Start offset for those files. uint mStartupOffset; ///< Value read from the command line SActionList mAction; @@ -245,10 +245,10 @@ protected: }; -inline void KHexEdit::addStartupFile( const QString &fileName ) +inline void KHexEdit::addStartupFile( const TQString &fileName ) { mStartupFileList.prepend( fileName ); - mStartupOffsetList.prepend( QString("%1").arg(mStartupOffset,0,16) ); + mStartupOffsetList.prepend( TQString("%1").arg(mStartupOffset,0,16) ); mStartupOffset = 0; } diff --git a/kjots/KJotsMain.cpp b/kjots/KJotsMain.cpp index a54cead..e1dedc9 100644 --- a/kjots/KJotsMain.cpp +++ b/kjots/KJotsMain.cpp @@ -19,8 +19,8 @@ // along with this program; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // -#include <qheader.h> -#include <qwidgetstack.h> +#include <tqheader.h> +#include <tqwidgetstack.h> #include <kio/netaccess.h> @@ -63,23 +63,23 @@ KJotsMain::KJotsMain(const char* name) // // Main widget // - QWidget* f_main = new QFrame( this, "Frame_0" ); + TQWidget* f_main = new TQFrame( this, "Frame_0" ); setCentralWidget(f_main); - splitter = new QSplitter(f_main); + splitter = new TQSplitter(f_main); splitter->setOpaqueResize( KGlobalSettings::opaqueResize() ); // the subject list subjectList = new KListView(splitter, "subjectList"); subjectList->setRootIsDecorated(true); - subjectList->setSizePolicy(QSizePolicy(QSizePolicy::Preferred, QSizePolicy::Expanding)); + subjectList->setSizePolicy(TQSizePolicy(TQSizePolicy::Preferred, TQSizePolicy::Expanding)); subjectList->setMinimumWidth(subjectList->fontMetrics().maxWidth() * 10 + 5); subjectList->addColumn(i18n("Pages")); subjectList->setFullWidth(true); - subjectList->setHScrollBarMode(QScrollView::AlwaysOff); - subjectList->setDefaultRenameAction(QListView::Accept); + subjectList->setHScrollBarMode(TQScrollView::AlwaysOff); + subjectList->setDefaultRenameAction(TQListView::Accept); subjectList->setSorting(-1); - subjectList->setAlternateBackground(QColor()); + subjectList->setAlternateBackground(TQColor()); subjectList->header()->hide(); subjectList->setDragEnabled(true); subjectList->setAcceptDrops(true); @@ -87,90 +87,90 @@ KJotsMain::KJotsMain(const char* name) subjectList->setItemsRenameable(true); subjectList->setRenameable(0,true); - textStack = new QWidgetStack(splitter); + textStack = new TQWidgetStack(splitter); me_text = new KJotsEdit(textStack, "me_text"); - me_text->setFocusPolicy(QWidget::StrongFocus); + me_text->setFocusPolicy(TQWidget::StrongFocus); me_text->setEnabled(false); textStack->addWidget(me_text); - connect(me_text, SIGNAL(findSuccessful()), this, SLOT(slotFindSuccessful())); + connect(me_text, TQT_SIGNAL(findSuccessful()), this, TQT_SLOT(slotFindSuccessful())); roTextView = new KTextBrowser(textStack, "roTextView", true); textStack->addWidget(roTextView); - QVBoxLayout *bookGrid = new QVBoxLayout(f_main, KDialog::marginHint(), KDialog::spacingHint()); + TQVBoxLayout *bookGrid = new TQVBoxLayout(f_main, KDialog::marginHint(), KDialog::spacingHint()); bookGrid->addWidget(splitter, 0, 0); bookGrid->setMargin(0); - splitter->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding, 2, 1)); + splitter->setSizePolicy(TQSizePolicy(TQSizePolicy::Expanding, TQSizePolicy::Expanding, 2, 1)); // create actions - actions[ACTION_NEXT_BOOK] = new KAction(i18n("Next Book"), QString::null, CTRL + Key_D, this, - SLOT(nextBook()), actionCollection(), "go_next_book"); - actions[ACTION_PREV_BOOK] = new KAction(i18n("Previous Book"), QString::null, CTRL + SHIFT + Key_D, this, - SLOT(prevBook()), actionCollection(), "go_prev_book"); - actions[ACTION_NEXT_PAGE] = new KAction(i18n("Next Page"), QString::null, CTRL + Key_PageDown, this, - SLOT(nextPage()), actionCollection(), "go_next_page"); - actions[ACTION_PREV_PAGE] = new KAction(i18n("Previous Page"), QString::null, CTRL + Key_PageUp, this, - SLOT(prevPage()), actionCollection(), "go_prev_page"); - - actions[ACTION_NEW_PAGE] = KStdAction::openNew(this, SLOT(newEntry()), actionCollection()); + actions[ACTION_NEXT_BOOK] = new KAction(i18n("Next Book"), TQString::null, CTRL + Key_D, this, + TQT_SLOT(nextBook()), actionCollection(), "go_next_book"); + actions[ACTION_PREV_BOOK] = new KAction(i18n("Previous Book"), TQString::null, CTRL + SHIFT + Key_D, this, + TQT_SLOT(prevBook()), actionCollection(), "go_prev_book"); + actions[ACTION_NEXT_PAGE] = new KAction(i18n("Next Page"), TQString::null, CTRL + Key_PageDown, this, + TQT_SLOT(nextPage()), actionCollection(), "go_next_page"); + actions[ACTION_PREV_PAGE] = new KAction(i18n("Previous Page"), TQString::null, CTRL + Key_PageUp, this, + TQT_SLOT(prevPage()), actionCollection(), "go_prev_page"); + + actions[ACTION_NEW_PAGE] = KStdAction::openNew(this, TQT_SLOT(newEntry()), actionCollection()); actions[ACTION_NEW_PAGE]->setText(i18n("&New Page")); actions[ACTION_NEW_BOOK] = new KAction(i18n("New &Book..."), "contents", CTRL + SHIFT + Key_N, this, - SLOT(createNewBook()), actionCollection(), "new_book"); + TQT_SLOT(createNewBook()), actionCollection(), "new_book"); exportPageMenu = new KActionMenu(i18n("Export Page"), actionCollection(), "save_page_to"); - actions[ACTION_PAGE2TEXT] = new KAction(i18n("To Text File..."), QString::null, 0, this, - SLOT(writePage()), actionCollection(), "save_page_to_ascii"); + actions[ACTION_PAGE2TEXT] = new KAction(i18n("To Text File..."), TQString::null, 0, this, + TQT_SLOT(writePage()), actionCollection(), "save_page_to_ascii"); actions[ACTION_PAGE2TEXT]->plug(exportPageMenu->popupMenu()); - actions[ACTION_PAGE2HTML] = new KAction(i18n("To HTML File..."), QString::null, 0, this, - SLOT(writePageToHTML()), actionCollection(), "save_page_to_html"); + actions[ACTION_PAGE2HTML] = new KAction(i18n("To HTML File..."), TQString::null, 0, this, + TQT_SLOT(writePageToHTML()), actionCollection(), "save_page_to_html"); actions[ACTION_PAGE2HTML]->plug(exportPageMenu->popupMenu()); exportBookMenu = new KActionMenu(i18n("Export Book"), actionCollection(), "save_book_to"); - actions[ACTION_BOOK2TEXT] = new KAction(i18n("To Text File..."), QString::null, 0, this, - SLOT(writeBook()), actionCollection(), "save_book_to_ascii"); + actions[ACTION_BOOK2TEXT] = new KAction(i18n("To Text File..."), TQString::null, 0, this, + TQT_SLOT(writeBook()), actionCollection(), "save_book_to_ascii"); actions[ACTION_BOOK2TEXT]->plug(exportBookMenu->popupMenu()); - actions[ACTION_BOOK2HTML] = new KAction(i18n("To HTML File..."), QString::null, 0, this, - SLOT(writeBookToHTML()), actionCollection(), "save_book_to_html"); + actions[ACTION_BOOK2HTML] = new KAction(i18n("To HTML File..."), TQString::null, 0, this, + TQT_SLOT(writeBookToHTML()), actionCollection(), "save_book_to_html"); actions[ACTION_BOOK2HTML]->plug(exportBookMenu->popupMenu()); actions[ACTION_DELETE_PAGE] = new KAction(i18n("&Delete Page"), "editdelete", CTRL + Key_Delete, this, - SLOT(deleteEntry()), actionCollection(), "del_page"); + TQT_SLOT(deleteEntry()), actionCollection(), "del_page"); actions[ACTION_DELETE_BOOK] = new KAction(i18n("Delete Boo&k"), "editdelete", CTRL + SHIFT + Key_Delete, this, - SLOT(deleteBook()), actionCollection(), "del_folder"); + TQT_SLOT(deleteBook()), actionCollection(), "del_folder"); actions[ACTION_MANUAL_SAVE] = new KAction(i18n("Manual Save"), 0, KStdAccel::save(), - this, SLOT(autoSave()), actionCollection(), "manual_save"); - actions[ACTION_PRINT] = KStdAction::print(this, SLOT(slotPrint()), actionCollection()); - actions[ACTION_QUIT] = KStdAction::quit(this, SLOT(slotQuit()), actionCollection()); + this, TQT_SLOT(autoSave()), actionCollection(), "manual_save"); + actions[ACTION_PRINT] = KStdAction::print(this, TQT_SLOT(slotPrint()), actionCollection()); + actions[ACTION_QUIT] = KStdAction::quit(this, TQT_SLOT(slotQuit()), actionCollection()); - actions[ACTION_CUT] = KStdAction::cut(me_text, SLOT(cut()), actionCollection()); - connect(me_text, SIGNAL(copyAvailable(bool)), actions[ACTION_CUT], SLOT(setEnabled(bool))); + actions[ACTION_CUT] = KStdAction::cut(me_text, TQT_SLOT(cut()), actionCollection()); + connect(me_text, TQT_SIGNAL(copyAvailable(bool)), actions[ACTION_CUT], TQT_SLOT(setEnabled(bool))); actions[ACTION_CUT]->setEnabled(false); - actions[ACTION_COPY] = KStdAction::copy(me_text, SLOT(copy()), actionCollection()); - connect(me_text, SIGNAL(copyAvailable(bool)), actions[ACTION_COPY], SLOT(setEnabled(bool))); + actions[ACTION_COPY] = KStdAction::copy(me_text, TQT_SLOT(copy()), actionCollection()); + connect(me_text, TQT_SIGNAL(copyAvailable(bool)), actions[ACTION_COPY], TQT_SLOT(setEnabled(bool))); actions[ACTION_COPY]->setEnabled(false); actions[ACTION_PASTE2TITLE] = new KAction(i18n("Copy &into Page Title"), "editcopy", CTRL+Key_T, this, - SLOT(copySelection()), actionCollection(), "copyIntoTitle"); - connect(me_text, SIGNAL(copyAvailable(bool)), actions[ACTION_PASTE2TITLE], SLOT(setEnabled(bool))); + TQT_SLOT(copySelection()), actionCollection(), "copyIntoTitle"); + connect(me_text, TQT_SIGNAL(copyAvailable(bool)), actions[ACTION_PASTE2TITLE], TQT_SLOT(setEnabled(bool))); actions[ACTION_PASTE2TITLE]->setEnabled(false); - actions[ACTION_PASTE] = KStdAction::pasteText(me_text, SLOT(paste()), actionCollection()); + actions[ACTION_PASTE] = KStdAction::pasteText(me_text, TQT_SLOT(paste()), actionCollection()); - actions[ACTION_FIND] = KStdAction::find( this, SLOT( slotSearch() ), actionCollection() ); - actions[ACTION_FIND_NEXT] = KStdAction::findNext( this, SLOT( slotRepeatSearch() ), actionCollection() ); + actions[ACTION_FIND] = KStdAction::find( this, TQT_SLOT( slotSearch() ), actionCollection() ); + actions[ACTION_FIND_NEXT] = KStdAction::findNext( this, TQT_SLOT( slotRepeatSearch() ), actionCollection() ); actions[ACTION_FIND_NEXT]->setEnabled(false); - actions[ACTION_REPLACE] = KStdAction::replace( this, SLOT( slotReplace() ), actionCollection() ); + actions[ACTION_REPLACE] = KStdAction::replace( this, TQT_SLOT( slotReplace() ), actionCollection() ); - actions[ACTION_RENAME] = new KAction(i18n("Rename..."), QString::null, CTRL + Key_M, this, - SLOT(slotRenameEntry()), actionCollection(), "rename_entry"); + actions[ACTION_RENAME] = new KAction(i18n("Rename..."), TQString::null, CTRL + Key_M, this, + TQT_SLOT(slotRenameEntry()), actionCollection(), "rename_entry"); actions[ACTION_INSERT_DATE] = new KAction(i18n("Insert Date"), "date", CTRL + Key_I, this, - SLOT(insertDate()), actionCollection(), "insert_date"); + TQT_SLOT(insertDate()), actionCollection(), "insert_date"); - KStdAction::preferences(this, SLOT(configure()), actionCollection()); + KStdAction::preferences(this, TQT_SLOT(configure()), actionCollection()); bookmarkMenu = new KActionMenu(i18n("&Bookmarks"), "bookmarks", actionCollection(), "bookmarks"); KJotsBookmarks* bookmarks = new KJotsBookmarks(this); - connect(bookmarks, SIGNAL(openPage(const QString&)), SLOT(jumpToBookmark(const QString&))); + connect(bookmarks, TQT_SIGNAL(openPage(const TQString&)), TQT_SLOT(jumpToBookmark(const TQString&))); new KBookmarkMenu(KBookmarkManager::managerForFile(locateLocal("appdata","bookmarks.xml")), bookmarks, bookmarkMenu->popupMenu(), actionCollection(), true); @@ -186,7 +186,7 @@ KJotsMain::KJotsMain(const char* name) } */ - m_autosaveTimer = new QTimer(this, "autosave_timer"); + m_autosaveTimer = new TQTimer(this, "autosave_timer"); // // Set startup size. @@ -204,25 +204,25 @@ KJotsMain::KJotsMain(const char* name) updateConfiguration(); updateMenu(); - QTimer::singleShot(0, this, SLOT(slotSetupInterface())); + TQTimer::singleShot(0, this, TQT_SLOT(slotSetupInterface())); //connect new slots - connect(subjectList, SIGNAL(selectionChanged(QListViewItem*)), - this, SLOT(jumpToEntry(QListViewItem*))); - connect(subjectList, SIGNAL(moved(QListViewItem*, QListViewItem*, QListViewItem*)), - this, SLOT(slotItemMoved(QListViewItem*, QListViewItem*, QListViewItem*))); - connect(subjectList, SIGNAL(expanded(QListViewItem*)), - this, SLOT(slotExpandBook(QListViewItem*))); - connect(subjectList, SIGNAL(collapsed(QListViewItem*)), - this, SLOT(slotCollapseBook(QListViewItem*))); - connect(subjectList, SIGNAL(contextMenu(KListView*,QListViewItem*,const QPoint&)), - this, SLOT(showListviewContextMenu(KListView*,QListViewItem*,const QPoint&))); - connect(subjectList, SIGNAL(itemRenamed(QListViewItem*,const QString&,int)), - this, SLOT(slotItemRenamed(QListViewItem*,const QString&,int))); - connect(roTextView, SIGNAL(urlClick(const QString&)), - this, SLOT(linkClicked(const QString&))); - connect(m_autosaveTimer, SIGNAL(timeout()), - this, SLOT(autoSave())); + connect(subjectList, TQT_SIGNAL(selectionChanged(TQListViewItem*)), + this, TQT_SLOT(jumpToEntry(TQListViewItem*))); + connect(subjectList, TQT_SIGNAL(moved(TQListViewItem*, TQListViewItem*, TQListViewItem*)), + this, TQT_SLOT(slotItemMoved(TQListViewItem*, TQListViewItem*, TQListViewItem*))); + connect(subjectList, TQT_SIGNAL(expanded(TQListViewItem*)), + this, TQT_SLOT(slotExpandBook(TQListViewItem*))); + connect(subjectList, TQT_SIGNAL(collapsed(TQListViewItem*)), + this, TQT_SLOT(slotCollapseBook(TQListViewItem*))); + connect(subjectList, TQT_SIGNAL(contextMenu(KListView*,TQListViewItem*,const TQPoint&)), + this, TQT_SLOT(showListviewContextMenu(KListView*,TQListViewItem*,const TQPoint&))); + connect(subjectList, TQT_SIGNAL(itemRenamed(TQListViewItem*,const TQString&,int)), + this, TQT_SLOT(slotItemRenamed(TQListViewItem*,const TQString&,int))); + connect(roTextView, TQT_SIGNAL(urlClick(const TQString&)), + this, TQT_SLOT(linkClicked(const TQString&))); + connect(m_autosaveTimer, TQT_SIGNAL(timeout()), + this, TQT_SLOT(autoSave())); } void KJotsMain::slotSetupInterface() @@ -243,16 +243,16 @@ void KJotsMain::slotSetupInterface() */ void KJotsMain::loadBooks() { - QDir dir(locateLocal("appdata","")); - QStringList files = dir.entryList(QDir::Files|QDir::Readable); + TQDir dir(locateLocal("appdata","")); + TQStringList files = dir.entryList(TQDir::Files|TQDir::Readable); Q_UINT64 currentSelection = KJotsSettings::currentSelection(); //TODO: Eventually we can make use of the ".book" extension here, but for //right now (2005/06/04) there's just too much legacy data out there. - for (QStringList::Iterator it = files.begin(); it != files.end(); it++) + for (TQStringList::Iterator it = files.begin(); it != files.end(); it++) { - QString filepath = dir.absFilePath(*it); + TQString filepath = dir.absFilePath(*it); if (!KJotsBook::isBookFile(filepath) ) { @@ -263,7 +263,7 @@ void KJotsMain::loadBooks() book->openBook(filepath); } - QListViewItemIterator it( subjectList ); + TQListViewItemIterator it( subjectList ); while ( it.current() ) { KJotsEntryBase *entry = dynamic_cast<KJotsEntryBase*>(it.current()); if ( entry && entry->id() == currentSelection ) @@ -283,8 +283,8 @@ bool KJotsMain::createNewBook() { bool ok; - QString name = KInputDialog::getText( i18n( "New Book" ), - i18n( "Book name:" ), QString::null, &ok, this ); + TQString name = KInputDialog::getText( i18n( "New Book" ), + i18n( "Book name:" ), TQString::null, &ok, this ); if (!ok) return false; @@ -315,7 +315,7 @@ void KJotsMain::deleteBook() if (!b) return; - QString msg = i18n("<qt>Are you sure you want to delete the <strong>%1</strong> book?</qt>"); + TQString msg = i18n("<qt>Are you sure you want to delete the <strong>%1</strong> book?</qt>"); int result = KMessageBox::warningContinueCancel(topLevelWidget(), msg.arg(b->subject()), i18n("Delete Book"),KStdGuiItem::del()); if (result!=KMessageBox::Continue) @@ -399,7 +399,7 @@ void KJotsMain::configure() confPageMisc* cpMisc = new confPageMisc(0, "Autosave"); dialog->addPage(cpMisc, i18n("Autosave"), "misc"); - connect(dialog, SIGNAL(settingsChanged()), this, SLOT(updateConfiguration())); + connect(dialog, TQT_SIGNAL(settingsChanged()), this, TQT_SLOT(updateConfiguration())); dialog->show(); } @@ -573,7 +573,7 @@ void KJotsMain::slotQuit() void KJotsMain::insertDate() { - me_text->insert(KGlobal::locale()->formatDateTime(QDateTime::currentDateTime(), true) + " "); + me_text->insert(KGlobal::locale()->formatDateTime(TQDateTime::currentDateTime(), true) + " "); } void KJotsMain::updateMenu() @@ -654,7 +654,7 @@ void KJotsMain::slotFindSuccessful() actions[ACTION_FIND_NEXT]->setEnabled(true); } -void KJotsMain::showListviewContextMenu(KListView*, QListViewItem* i, const QPoint& p) +void KJotsMain::showListviewContextMenu(KListView*, TQListViewItem* i, const TQPoint& p) { if ( invalidMoveFlag ) return; //Prevent race condition KActionMenu* am = new KActionMenu(this); @@ -692,7 +692,7 @@ void KJotsMain::showListviewContextMenu(KListView*, QListViewItem* i, const QPoi KTextBrowser doesn't handle anchor links itself, so we have to take care of those, too. */ -void KJotsMain::linkClicked(const QString& link) +void KJotsMain::linkClicked(const TQString& link) { if (link[0] == '#') { @@ -702,7 +702,7 @@ void KJotsMain::linkClicked(const QString& link) } Q_UINT64 target = link.toULongLong(); - QListViewItemIterator it( subjectList ); + TQListViewItemIterator it( subjectList ); while ( it.current() ) { KJotsEntryBase *entry = dynamic_cast<KJotsEntryBase*>(it.current()); if ( entry && entry->id() == target ) @@ -743,7 +743,7 @@ void KJotsMain::saveProperties() /*! \brief Called when a book is opened/expanded/whatever. */ -void KJotsMain::slotExpandBook(QListViewItem *item) +void KJotsMain::slotExpandBook(TQListViewItem *item) { KJotsEntryBase *entry = dynamic_cast<KJotsEntryBase*>(item); if ( entry ) entry->setDirty(true); @@ -752,7 +752,7 @@ void KJotsMain::slotExpandBook(QListViewItem *item) /*! \brief Called when a book is closed/collapsed/whatever. */ -void KJotsMain::slotCollapseBook(QListViewItem *item) +void KJotsMain::slotCollapseBook(TQListViewItem *item) { KJotsEntryBase *entry = dynamic_cast<KJotsEntryBase*>(item); if ( entry ) entry->setDirty(true); @@ -761,10 +761,10 @@ void KJotsMain::slotCollapseBook(QListViewItem *item) /*! Returns the name of the active book or page. */ -QString KJotsMain::currentBookmarkTitle() +TQString KJotsMain::currentBookmarkTitle() { - QString title; - QListViewItem *item = subjectList->currentItem(); + TQString title; + TQListViewItem *item = subjectList->currentItem(); while ( item ) { @@ -785,9 +785,9 @@ QString KJotsMain::currentBookmarkTitle() /*! Returns a bookmark that identifies the active book or page. */ -QString KJotsMain::currentBookmarkURL() +TQString KJotsMain::currentBookmarkURL() { - QString url; + TQString url; KJotsEntryBase *entry = dynamic_cast<KJotsEntryBase*>(subjectList->currentItem()); if ( entry ) @@ -802,13 +802,13 @@ QString KJotsMain::currentBookmarkURL() Accepts a bookmark from the bookmark manager and jumps to the given entry. \param bookmark The bookmark. */ -void KJotsMain::jumpToBookmark(const QString& bookmark) +void KJotsMain::jumpToBookmark(const TQString& bookmark) { Q_UINT64 id = bookmark.toULongLong(); if ( id ) { - QListViewItemIterator it( subjectList ); + TQListViewItemIterator it( subjectList ); while ( it.current() ) { KJotsEntryBase *entry = dynamic_cast<KJotsEntryBase*>(it.current()); if ( entry && entry->id() == id ) @@ -825,13 +825,13 @@ void KJotsMain::jumpToBookmark(const QString& bookmark) //in the future. CREATION DATE: 2005/06/10 KMessageBox::information(this, - i18n("This bookmark is from an older version of KJots and is not fully supported. It may or may not work. You should delete and recreate this bookmark."), QString::null, "oldBookmarkWarning"); + i18n("This bookmark is from an older version of KJots and is not fully supported. It may or may not work. You should delete and recreate this bookmark."), TQString::null, "oldBookmarkWarning"); int slash = bookmark.findRev('/'); if (slash != -1) { - QString bookName = bookmark.left(slash); + TQString bookName = bookmark.left(slash); int pageNo = bookmark.mid(slash+1).toInt(); int pageCount = 0; @@ -865,7 +865,7 @@ void KJotsMain::jumpToBookmark(const QString& bookmark) { if ( ++pageCount == pageNo ) { - static_cast<QListViewItem*>(entry)->parent()->setOpen(true); + static_cast<TQListViewItem*>(entry)->parent()->setOpen(true); subjectList->ensureItemVisible(entry); subjectList->setSelected(entry, true); jumpToEntry(entry); @@ -885,11 +885,11 @@ void KJotsMain::jumpToBookmark(const QString& bookmark) */ void KJotsMain::nextBook() { - QListViewItem *item = subjectList->currentItem(); + TQListViewItem *item = subjectList->currentItem(); if ( !item ) return; //sanity check - QListViewItemIterator it ( item ); - QListViewItemIterator start ( it ); + TQListViewItemIterator it ( item ); + TQListViewItemIterator start ( it ); do { it++; @@ -897,7 +897,7 @@ void KJotsMain::nextBook() //if we iterate off the list, start over again. if ( !it.current() ) { - it = QListViewItemIterator ( subjectList ); + it = TQListViewItemIterator ( subjectList ); } if ( it.current() == start.current() ) return; //Bail out if we loop. @@ -915,20 +915,20 @@ void KJotsMain::nextBook() void KJotsMain::prevBook() { //Don't get caught by parent book. - QListViewItem *startingPoint = subjectList->currentItem(); + TQListViewItem *startingPoint = subjectList->currentItem(); if ( !startingPoint ) return; //sanity check if ( dynamic_cast<KJotsPage*>(startingPoint) ) startingPoint = startingPoint->parent(); - QListViewItemIterator it ( startingPoint ); + TQListViewItemIterator it ( startingPoint ); do { it--; //if we iterate off the list, start over again. if ( !it.current() ) { - it = QListViewItemIterator ( subjectList->lastItem() ); + it = TQListViewItemIterator ( subjectList->lastItem() ); } if ( it.current() == startingPoint ) return; //Bail out if we loop. @@ -945,11 +945,11 @@ void KJotsMain::prevBook() */ void KJotsMain::nextPage() { - QListViewItem *item = subjectList->currentItem(); + TQListViewItem *item = subjectList->currentItem(); if ( !item ) return; //sanity check - QListViewItemIterator it ( item ); - QListViewItemIterator start ( it ); + TQListViewItemIterator it ( item ); + TQListViewItemIterator start ( it ); do { it++; @@ -957,7 +957,7 @@ void KJotsMain::nextPage() //if we iterate off the list, start over again. if ( !it.current() ) { - it = QListViewItemIterator ( subjectList ); + it = TQListViewItemIterator ( subjectList ); } if ( it.current() == start.current() ) return; //Bail out if we loop. @@ -974,11 +974,11 @@ void KJotsMain::nextPage() */ void KJotsMain::prevPage() { - QListViewItem *item = subjectList->currentItem(); + TQListViewItem *item = subjectList->currentItem(); if ( !item ) return; //sanity check - QListViewItemIterator it ( item ); - QListViewItemIterator start ( it ); + TQListViewItemIterator it ( item ); + TQListViewItemIterator start ( it ); do { it--; @@ -986,7 +986,7 @@ void KJotsMain::prevPage() //if we iterate off the list, start over again. if ( !it.current() ) { - it = QListViewItemIterator ( subjectList->lastItem() ); + it = TQListViewItemIterator ( subjectList->lastItem() ); } if ( it.current() == start.current() ) return; //Bail out if we loop. @@ -998,7 +998,7 @@ void KJotsMain::prevPage() return; } -void KJotsMain::jumpToEntry(QListViewItem* entry, bool force) +void KJotsMain::jumpToEntry(TQListViewItem* entry, bool force) { //This won't lose data or anything; but it does reset the cursor postion and waste cycles. if (currentEntry == entry && !force) @@ -1014,7 +1014,7 @@ void KJotsMain::jumpToEntry(QListViewItem* entry, bool force) me_text->setEntry(0); //clear any old data KJotsBook* book = static_cast<KJotsBook*>(entry); - QString html = book->generateHtml(book, false); + TQString html = book->generateHtml(book, false); roTextView->setText(html); roTextView->setCursorPosition(0, 0); @@ -1037,8 +1037,8 @@ void KJotsMain::jumpToEntry(QListViewItem* entry, bool force) */ void KJotsMain::updateCaption() { - QString caption; - QListViewItem *item = subjectList->currentItem(); + TQString caption; + TQListViewItem *item = subjectList->currentItem(); while ( item ) { @@ -1057,7 +1057,7 @@ void KJotsMain::updateCaption() return; } -void KJotsMain::slotItemRenamed(QListViewItem* item, const QString& str, int /*col*/) +void KJotsMain::slotItemRenamed(TQListViewItem* item, const TQString& str, int /*col*/) { KJotsEntryBase* entry = dynamic_cast<KJotsEntryBase*>(item); @@ -1075,7 +1075,7 @@ void KJotsMain::slotItemRenamed(QListViewItem* item, const QString& str, int /* \warning The whole drag-n-drop reordering system is completely booched. Tread lightly and test well when modifying things here. */ -void KJotsMain::slotItemMoved(QListViewItem *item, QListViewItem* afterFirst, QListViewItem */*afterNow*/ ) +void KJotsMain::slotItemMoved(TQListViewItem *item, TQListViewItem* afterFirst, TQListViewItem */*afterNow*/ ) { KJotsEntryBase *entry = dynamic_cast<KJotsEntryBase*>(item); @@ -1083,7 +1083,7 @@ void KJotsMain::slotItemMoved(QListViewItem *item, QListViewItem* afterFirst, QL //previous sibling, not just the entry directly above it. if ( afterFirst && afterFirst->parent() != entry->parentBook() ) { - QListViewItemIterator it ( afterFirst ); + TQListViewItemIterator it ( afterFirst ); afterFirst = 0; //Rewind backwards up the tree... @@ -1119,7 +1119,7 @@ void KJotsMain::slotItemMoved(QListViewItem *item, QListViewItem* afterFirst, QL i18n("All pages must be inside a book. " "Would you like to create a new book to put the page in, " "or would you prefer to not move the page at all?"), - QString::null, + TQString::null, i18n("Create New Book"), i18n("Do Not Move Page")) == KMessageBox::No || !createNewBook()) diff --git a/kjots/KJotsMain.h b/kjots/KJotsMain.h index 28ec089..c4a3297 100644 --- a/kjots/KJotsMain.h +++ b/kjots/KJotsMain.h @@ -23,8 +23,8 @@ #ifndef KJotsMain_included #define KJotsMain_included -#include <qlayout.h> -#include <qpushbutton.h> +#include <tqlayout.h> +#include <tqpushbutton.h> #include <kdialogbase.h> #include <kmainwindow.h> @@ -86,8 +86,8 @@ class KJotsMain : public KMainWindow public: KJotsMain( const char* name = 0 ); - QString currentBookmarkTitle(); - QString currentBookmarkURL(); + TQString currentBookmarkTitle(); + TQString currentBookmarkURL(); public: void updateCaption(); @@ -111,12 +111,12 @@ class KJotsMain : public KMainWindow void slotQuit(); void slotFindSuccessful(); - void jumpToEntry(QListViewItem* entry, bool=false); + void jumpToEntry(TQListViewItem* entry, bool=false); - void slotExpandBook(QListViewItem* item); - void slotCollapseBook(QListViewItem* item); - void slotItemRenamed(QListViewItem*,const QString&,int); - void slotItemMoved(QListViewItem*,QListViewItem*,QListViewItem*); + void slotExpandBook(TQListViewItem* item); + void slotCollapseBook(TQListViewItem* item); + void slotItemRenamed(TQListViewItem*,const TQString&,int); + void slotItemMoved(TQListViewItem*,TQListViewItem*,TQListViewItem*); void writeBook(); void writeBookToHTML(); void saveBookToFile(bool plainText); @@ -130,12 +130,12 @@ class KJotsMain : public KMainWindow void prevPage(); // handling page changes in the listview - void showListviewContextMenu(KListView* l, QListViewItem* i, const QPoint& p); - void linkClicked(const QString&); + void showListviewContextMenu(KListView* l, TQListViewItem* i, const TQPoint& p); + void linkClicked(const TQString&); void autoSave(void); // bookmarks - void jumpToBookmark(const QString& page); + void jumpToBookmark(const TQString& page); protected: void saveProperties(); @@ -145,16 +145,16 @@ class KJotsMain : public KMainWindow KJotsBook* currentBook(); KJotsPage* currentPage(); - QHBoxLayout *bg_top_layout; - QButtonGroup *bg_top; + TQHBoxLayout *bg_top_layout; + TQButtonGroup *bg_top; KJotsEdit *me_text; KTextBrowser *roTextView; KListView *subjectList; KJotsEntryBase *currentEntry; - QSplitter *splitter; - QWidgetStack *textStack; - QFont m_font; - QTimer* m_autosaveTimer; + TQSplitter *splitter; + TQWidgetStack *textStack; + TQFont m_font; + TQTimer* m_autosaveTimer; bool invalidMoveFlag; //!< Used to fix a race condition. See Bug #109299 KAction* actions[ACTION_MAX]; diff --git a/kjots/kjotsbookmarks.cpp b/kjots/kjotsbookmarks.cpp index b339a46..21ce6e8 100644 --- a/kjots/kjotsbookmarks.cpp +++ b/kjots/kjotsbookmarks.cpp @@ -24,7 +24,7 @@ #include "kjotsbookmarks.h" KJotsBookmarks::KJotsBookmarks(KJotsMain* parent, const char* name) - : QObject(parent, name), + : TQObject(parent, name), m_kjots(parent) { } @@ -33,17 +33,17 @@ KJotsBookmarks::~KJotsBookmarks() { } -void KJotsBookmarks::openBookmarkURL(const QString& page) +void KJotsBookmarks::openBookmarkURL(const TQString& page) { emit openPage(page); } -QString KJotsBookmarks::currentURL() const +TQString KJotsBookmarks::currentURL() const { return m_kjots->currentBookmarkURL(); } -QString KJotsBookmarks::currentTitle() const +TQString KJotsBookmarks::currentTitle() const { return m_kjots->currentBookmarkTitle(); } diff --git a/kjots/kjotsbookmarks.h b/kjots/kjotsbookmarks.h index 7cb3144..9fa533d 100644 --- a/kjots/kjotsbookmarks.h +++ b/kjots/kjotsbookmarks.h @@ -27,7 +27,7 @@ class KJotsMain; -class KJotsBookmarks : public QObject, public KBookmarkOwner +class KJotsBookmarks : public TQObject, public KBookmarkOwner { Q_OBJECT @@ -35,12 +35,12 @@ class KJotsBookmarks : public QObject, public KBookmarkOwner KJotsBookmarks(KJotsMain* parent = 0, const char* name = 0); ~KJotsBookmarks(); - virtual void openBookmarkURL(const QString& url); - virtual QString currentURL() const; - QString currentTitle() const; + virtual void openBookmarkURL(const TQString& url); + virtual TQString currentURL() const; + TQString currentTitle() const; signals: - void openPage(const QString& page); + void openPage(const TQString& page); private: KJotsMain* m_kjots; diff --git a/kjots/kjotsedit.cpp b/kjots/kjotsedit.cpp index 0a61c62..2e4c09d 100644 --- a/kjots/kjotsedit.cpp +++ b/kjots/kjotsedit.cpp @@ -20,9 +20,9 @@ // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // -#include <qpainter.h> -#include <qpaintdevicemetrics.h> -#include <qcursor.h> +#include <tqpainter.h> +#include <tqpaintdevicemetrics.h> +#include <tqcursor.h> #include <kpopupmenu.h> #include <keditcl.h> @@ -36,16 +36,16 @@ //---------------------------------------------------------------------- // MYMULTIEDIT //---------------------------------------------------------------------- -KJotsEdit::KJotsEdit (QWidget* parent, const char* name) +KJotsEdit::KJotsEdit (TQWidget* parent, const char* name) : KEdit(parent, name), m_entry(0) { // no rich text until printing and other such issues are worked out setTextFormat(Qt::PlainText); - setWordWrap(QTextEdit::WidgetWidth); + setWordWrap(TQTextEdit::WidgetWidth); setLinkUnderline(true); web_menu = new KPopupMenu(this);; - web_menu->insertItem(i18n("Open URL"), this, SLOT(openUrl()) ); + web_menu->insertItem(i18n("Open URL"), this, TQT_SLOT(openUrl()) ); } KJotsEdit::~KJotsEdit() @@ -53,7 +53,7 @@ KJotsEdit::~KJotsEdit() } -void KJotsEdit::mousePressEvent( QMouseEvent *e ) +void KJotsEdit::mousePressEvent( TQMouseEvent *e ) { if(e->button() == RightButton && hasSelectedText()) @@ -62,7 +62,7 @@ void KJotsEdit::mousePressEvent( QMouseEvent *e ) if(url.isValid()) { - web_menu->popup(QCursor::pos()); + web_menu->popup(TQCursor::pos()); return; } } @@ -82,7 +82,7 @@ void KJotsEdit::openUrl() } } -void KJotsEdit::print(QString title) +void KJotsEdit::print(TQString title) { KPrinter printer; printer.setDocName(title); @@ -91,19 +91,19 @@ void KJotsEdit::print(QString title) if (printer.setup(this)) { - QFont printFont = font(); - QPainter painter( &printer ); - QPaintDeviceMetrics metrics( &printer ); + TQFont printFont = font(); + TQPainter painter( &printer ); + TQPaintDeviceMetrics metrics( &printer ); int y = 0; int maxWidth = metrics.width(); int maxHeight = metrics.height(); - QString currentParagraph; + TQString currentParagraph; for (int paragraphCount = 0; paragraphCount < paragraphs(); ++paragraphCount ) { currentParagraph = text(paragraphCount); - QRect r = painter.boundingRect(0, y, maxWidth, maxHeight, - QPainter::ExpandTabs | QPainter::WordBreak, + TQRect r = painter.boundingRect(0, y, maxWidth, maxHeight, + TQPainter::ExpandTabs | TQPainter::WordBreak, currentParagraph); if ((y + r.height()) > maxHeight) @@ -113,7 +113,7 @@ void KJotsEdit::print(QString title) } painter.drawText(0, y, maxWidth, maxHeight - y, - QPainter::ExpandTabs | QPainter::WordBreak, + TQPainter::ExpandTabs | TQPainter::WordBreak, currentParagraph); y += r.height(); } diff --git a/kjots/kjotsedit.h b/kjots/kjotsedit.h index cae025c..d214ce3 100644 --- a/kjots/kjotsedit.h +++ b/kjots/kjotsedit.h @@ -31,10 +31,10 @@ class KJotsEdit : public KEdit { Q_OBJECT public: - KJotsEdit (QWidget* parent=0, const char* name=0); + KJotsEdit (TQWidget* parent=0, const char* name=0); ~KJotsEdit (); - void print(QString title = QString::null); + void print(TQString title = TQString::null); void setEntry(KJotsPage*); signals: @@ -44,7 +44,7 @@ class KJotsEdit : public KEdit void openUrl(); protected: - virtual void mousePressEvent (QMouseEvent *e); + virtual void mousePressEvent (TQMouseEvent *e); KPopupMenu *web_menu; KJotsPage *m_entry; //!< The entry we are editing. It needs to be kept informed. diff --git a/kjots/kjotsentry.cpp b/kjots/kjotsentry.cpp index a27b00e..dab39c8 100644 --- a/kjots/kjotsentry.cpp +++ b/kjots/kjotsentry.cpp @@ -20,11 +20,11 @@ // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // -#include <qdir.h> -#include <qpainter.h> -#include <qpaintdevicemetrics.h> -#include <qtextcodec.h> -#include <qdom.h> +#include <tqdir.h> +#include <tqpainter.h> +#include <tqpaintdevicemetrics.h> +#include <tqtextcodec.h> +#include <tqdom.h> #include <kapplication.h> #include <kiconloader.h> @@ -44,7 +44,7 @@ #include "kjotsentry.h" // helper functions for HTML output -QString prepForHTML(QString text) +TQString prepForHTML(TQString text) { text.replace("<", "<"); text.replace(">", ">"); @@ -52,15 +52,15 @@ QString prepForHTML(QString text) return text; } -QString htmlHeader(const QString& title, QTextCodec* codec) +TQString htmlHeader(const TQString& title, TQTextCodec* codec) { - QString head = "<html><head><meta http-equiv=\"content-type\" content=\"text/html; charset="; + TQString head = "<html><head><meta http-equiv=\"content-type\" content=\"text/html; charset="; head+=codec->mimeName(); head+="\" ><title>" + prepForHTML(title) + "</title></head><body>"; return head; } -QString htmlFooter() +TQString htmlFooter() { return "</body></html>"; } @@ -69,7 +69,7 @@ QString htmlFooter() // KJotsEntryBase // -KJotsEntryBase::KJotsEntryBase(KListView* parent, QListViewItem* after=0) +KJotsEntryBase::KJotsEntryBase(KListView* parent, TQListViewItem* after=0) :KListViewItem(parent,after) { m_id = 0; @@ -77,7 +77,7 @@ KJotsEntryBase::KJotsEntryBase(KListView* parent, QListViewItem* after=0) m_parent = 0; } -KJotsEntryBase::KJotsEntryBase(KListViewItem* parent, QListViewItem* after=0) +KJotsEntryBase::KJotsEntryBase(KListViewItem* parent, TQListViewItem* after=0) :KListViewItem(parent,after) { m_id = 0; @@ -85,12 +85,12 @@ KJotsEntryBase::KJotsEntryBase(KListViewItem* parent, QListViewItem* after=0) m_parent = dynamic_cast<KJotsBook*>(parent); } -void KJotsEntryBase::setSubject(const QString& subj) +void KJotsEntryBase::setSubject(const TQString& subj) { setText(0, subj); } -void KJotsEntryBase::setText(int column, const QString& text) +void KJotsEntryBase::setText(int column, const TQString& text) { if (column == 0 && text.isEmpty()) KListViewItem::setText(0, defaultSubject()); @@ -105,7 +105,7 @@ void KJotsEntryBase::setText(int column, const QString& text) */ void KJotsEntryBase::resetParent() { - m_parent = dynamic_cast<KJotsBook*>(QListViewItem::parent()); + m_parent = dynamic_cast<KJotsBook*>(TQListViewItem::parent()); } /*! @@ -139,14 +139,14 @@ void KJotsEntryBase::setId(Q_UINT64 id) This function should ONLY be called when saving the file, as it performs other functions than generating XML. */ -void KJotsEntryBase::generateXml( QDomDocument &doc, QDomElement &parent ) +void KJotsEntryBase::generateXml( TQDomDocument &doc, TQDomElement &parent ) { - QDomElement title = doc.createElement( "Title" ); + TQDomElement title = doc.createElement( "Title" ); title.appendChild( doc.createTextNode( subject() )); parent.appendChild( title ); - QDomElement id = doc.createElement( "ID" ); - QString id_string; + TQDomElement id = doc.createElement( "ID" ); + TQString id_string; id_string.setNum(m_id); id.appendChild( doc.createTextNode(id_string) ); parent.appendChild( id ); @@ -158,7 +158,7 @@ void KJotsEntryBase::generateXml( QDomDocument &doc, QDomElement &parent ) /*! Parses through XML data for settings inherent to the base class. */ -void KJotsEntryBase::parseXml( QDomElement &e ) +void KJotsEntryBase::parseXml( TQDomElement &e ) { if ( !e.isNull() ) { @@ -180,15 +180,15 @@ void KJotsEntryBase::parseXml( QDomElement &e ) \brief Draws the Title box when printing. This is a helper function for the derived classes. Code consolidation==the good. */ -int KJotsEntryBase::printTitleBox(QString title, KPrinter& printer, QPainter& painter, int y) +int KJotsEntryBase::printTitleBox(TQString title, KPrinter& printer, TQPainter& painter, int y) { - QPaintDeviceMetrics metrics( &printer ); + TQPaintDeviceMetrics metrics( &printer ); int maxWidth = metrics.width(); int maxHeight = metrics.height(); - QRect r = painter.boundingRect(0, y, + TQRect r = painter.boundingRect(0, y, maxWidth, maxHeight, - QPainter::ExpandTabs | QPainter::WordBreak | QPainter::AlignHCenter, + TQPainter::ExpandTabs | TQPainter::WordBreak | TQPainter::AlignHCenter, title); y += 10; @@ -206,7 +206,7 @@ int KJotsEntryBase::printTitleBox(QString title, KPrinter& printer, QPainter& pa r.setRight(maxWidth); painter.drawRect(r); painter.drawText(0, y, maxWidth, maxHeight - y, - QPainter::ExpandTabs | QPainter::WordBreak | QPainter::AlignHCenter, + TQPainter::ExpandTabs | TQPainter::WordBreak | TQPainter::AlignHCenter, title); y += r.height() + 15; @@ -217,13 +217,13 @@ int KJotsEntryBase::printTitleBox(QString title, KPrinter& printer, QPainter& pa // KJotsBook // -KJotsBook::KJotsBook(KListView* parent, QListViewItem* after) +KJotsBook::KJotsBook(KListView* parent, TQListViewItem* after) : KJotsEntryBase(parent, after) { init(); } -KJotsBook::KJotsBook(KListViewItem* parent, QListViewItem* after) +KJotsBook::KJotsBook(KListViewItem* parent, TQListViewItem* after) : KJotsEntryBase(parent, after) { init(); @@ -245,7 +245,7 @@ void KJotsBook::init() m_open = false; m_saveProgressDialog = 0; setExpandable(true); - setPixmap(0, kapp->iconLoader()->loadIcon(QString("contents"),KIcon::Small)); + setPixmap(0, kapp->iconLoader()->loadIcon(TQString("contents"),KIcon::Small)); } /*! @@ -255,18 +255,18 @@ void KJotsBook::init() This function does a cursory check to see if this looks like it is a KJots file. It's a little too quick and dirty for my taste, but seems to work OK. */ -bool KJotsBook::isBookFile(const QString& filename) +bool KJotsBook::isBookFile(const TQString& filename) { - QFile folder(filename); + TQFile folder(filename); bool test = false; if ( folder.exists() ) { if ( folder.open(IO_ReadWrite) ) { - QTextStream st(static_cast<QIODevice*>(&folder)); - st.setEncoding( KJotsSettings::unicode() ? QTextStream::UnicodeUTF8 : QTextStream::Locale ); - QString buf = st.readLine().stripWhiteSpace(); + TQTextStream st(static_cast<TQIODevice*>(&folder)); + st.setEncoding( KJotsSettings::unicode() ? TQTextStream::UnicodeUTF8 : TQTextStream::Locale ); + TQString buf = st.readLine().stripWhiteSpace(); //Check for new-style book. Not very pretty, but it is faster than loading the DOM. if (buf == "<!DOCTYPE KJots>") @@ -290,7 +290,7 @@ bool KJotsBook::isBookFile(const QString& filename) \brief Reads a book in from a disk file. This function is only called for root-level books. */ -bool KJotsBook::openBook(const QString& filename) +bool KJotsBook::openBook(const TQString& filename) { if ( !m_open ) //sanity check { @@ -302,25 +302,25 @@ bool KJotsBook::openBook(const QString& filename) addPage(); m_open = true; } else { - QFile file(m_fileName); + TQFile file(m_fileName); if ( file.exists() && file.open(IO_ReadWrite) ) //TODO: Implement read-only mode? { - QTextStream st(static_cast<QIODevice*>(&file)); - st.setEncoding( KJotsSettings::unicode() ? QTextStream::UnicodeUTF8 : QTextStream::Locale ); - QString data = st.read(); + TQTextStream st(static_cast<TQIODevice*>(&file)); + st.setEncoding( KJotsSettings::unicode() ? TQTextStream::UnicodeUTF8 : TQTextStream::Locale ); + TQString data = st.read(); - QDomDocument doc( "KJots" ); + TQDomDocument doc( "KJots" ); if ( doc.setContent( data ) ) { - QDomElement docElem = doc.documentElement(); + TQDomElement docElem = doc.documentElement(); if ( docElem.tagName() == "KJots" ) { - QDomNode n = docElem.firstChild(); + TQDomNode n = docElem.firstChild(); while( !n.isNull() ) { - QDomElement e = n.toElement(); // try to convert the node to an element. + TQDomElement e = n.toElement(); // try to convert the node to an element. if( !e.isNull() && e.tagName() == "KJotsBook" ) { parseXml(e); @@ -334,7 +334,7 @@ bool KJotsBook::openBook(const QString& filename) file.reset(); if ( loadOldBook(file) ) { - QFileInfo fi( file ); + TQFileInfo fi( file ); setSubject(fi.fileName()); } } @@ -354,7 +354,7 @@ bool KJotsBook::openBook(const QString& filename) if ( !m_fileName.isEmpty() && !m_fileName.endsWith(".book") ) { //some old books have incorrect names. So we save a new copy, then kill the old file - m_fileName = QString::null; //trick ourselves into thinking we're a new book + m_fileName = TQString::null; //trick ourselves into thinking we're a new book saveBook(); file.remove(); } @@ -386,11 +386,11 @@ bool KJotsBook::openBook(const QString& filename) This is a function for files made from older KJots versions. It could probably be removed at some point in the future. CREATION DATE: 2005/05/30 */ -bool KJotsBook::loadOldBook(QFile &file) +bool KJotsBook::loadOldBook(TQFile &file) { - QTextStream st(static_cast<QIODevice*>(&file)); - st.setEncoding( KJotsSettings::unicode() ? QTextStream::UnicodeUTF8 : QTextStream::Locale ); - QString buf = st.readLine(); + TQTextStream st(static_cast<TQIODevice*>(&file)); + st.setEncoding( KJotsSettings::unicode() ? TQTextStream::UnicodeUTF8 : TQTextStream::Locale ); + TQString buf = st.readLine(); if (buf.left(9) != "\\NewEntry") { @@ -399,7 +399,7 @@ bool KJotsBook::loadOldBook(QFile &file) } KJotsPage *entry = 0; - QString body; + TQString body; bool quit=false; @@ -412,8 +412,8 @@ bool KJotsBook::loadOldBook(QFile &file) entry->setBody(body); } - body = QString::null; - QString title = buf.mid(10, buf.length()); + body = TQString::null; + TQString title = buf.mid(10, buf.length()); // now catch the page id buf = st.readLine(); @@ -461,17 +461,17 @@ void KJotsBook::saveBook(void) m_fileName = temp.name(); } - QFile file(m_fileName); + TQFile file(m_fileName); if (file.open(IO_WriteOnly | IO_Truncate)) { - QDomDocument doc("KJots"); - QDomElement root = doc.createElement( "KJots" ); + TQDomDocument doc("KJots"); + TQDomElement root = doc.createElement( "KJots" ); doc.appendChild( root ); this->generateXml( doc, root ); //recursive - QTextStream st((QIODevice *) &file); - st.setEncoding( KJotsSettings::unicode() ? QTextStream::UnicodeUTF8 : QTextStream::Locale ); + TQTextStream st((TQIODevice *) &file); + st.setEncoding( KJotsSettings::unicode() ? TQTextStream::UnicodeUTF8 : TQTextStream::Locale ); st << doc.toString(); file.close(); @@ -487,14 +487,14 @@ void KJotsBook::saveBook(void) */ void KJotsBook::deleteBook() { - QFile::remove(m_fileName); - m_fileName = QString::null; + TQFile::remove(m_fileName); + m_fileName = TQString::null; } void KJotsBook::rename() { bool ok; - QString name = KInputDialog::getText(i18n( "Rename Book" ), + TQString name = KInputDialog::getText(i18n( "Rename Book" ), i18n( "Book name:" ), subject(), &ok, listView()); if (ok) @@ -514,13 +514,13 @@ void KJotsBook::rename() \brief Initiated when the user chooses to save this to a file. This function gets everything ready to go to save to the disk. */ -void KJotsBook::saveToFile(KURL url, bool plainText, const QString& encoding) +void KJotsBook::saveToFile(KURL url, bool plainText, const TQString& encoding) { if (url.isEmpty() || m_saveInProgress) return; m_saveToPlainText = plainText; - m_saveEncoding = QTextCodec::codecForName(encoding.ascii()); + m_saveEncoding = TQTextCodec::codecForName(encoding.ascii()); KIO::TransferJob* job = KIO::put(url, -1, true, false, false); if (!job) @@ -541,8 +541,8 @@ void KJotsBook::saveToFile(KURL url, bool plainText, const QString& encoding) m_saveProgressDialog->showCancelButton(false); m_saveProgressDialog->setAutoClose(true); - connect(job, SIGNAL(dataReq(KIO::Job*, QByteArray&)), SLOT(saveDataReq(KIO::Job*, QByteArray&))); - connect(job, SIGNAL(result( KIO::Job *)), SLOT(slotSaveResult( KIO::Job *))); + connect(job, TQT_SIGNAL(dataReq(KIO::Job*, TQByteArray&)), TQT_SLOT(saveDataReq(KIO::Job*, TQByteArray&))); + connect(job, TQT_SIGNAL(result( KIO::Job *)), TQT_SLOT(slotSaveResult( KIO::Job *))); m_saveInProgress = true; } @@ -551,11 +551,11 @@ void KJotsBook::saveToFile(KURL url, bool plainText, const QString& encoding) \brief Pumps out data when saving to a file. This function pumps out page data during a disk save. */ -void KJotsBook::saveDataReq(KIO::Job* /* job */, QByteArray& data) +void KJotsBook::saveDataReq(KIO::Job* /* job */, TQByteArray& data) { if (!m_saveInProgress) return; //sanity check - QTextStream stream(data, IO_WriteOnly); + TQTextStream stream(data, IO_WriteOnly); stream.setCodec(m_saveEncoding); if (!m_saveToPlainText) @@ -588,10 +588,10 @@ void KJotsBook::slotSaveResult(KIO::Job *) */ KJotsPage* KJotsBook::addPage() { - QListViewItem *after = 0; + TQListViewItem *after = 0; // append new pages - QListViewItem* tmp = firstChild(); + TQListViewItem* tmp = firstChild(); while (tmp) { after = tmp; @@ -606,7 +606,7 @@ KJotsPage* KJotsBook::addPage() /*! \brief Called when the user wants to print the book. */ -void KJotsBook::print(QFont& defaultFont) +void KJotsBook::print(TQFont& defaultFont) { KPrinter printer; printer.setDocName(subject()); @@ -618,7 +618,7 @@ void KJotsBook::print(QFont& defaultFont) return; } - QPainter painter(&printer); + TQPainter painter(&printer); painter.setFont(defaultFont); print(printer, painter, 0); @@ -628,7 +628,7 @@ void KJotsBook::print(QFont& defaultFont) /*! \brief Prints this book. */ -int KJotsBook::print(KPrinter& printer, QPainter& painter, int y) +int KJotsBook::print(KPrinter& printer, TQPainter& painter, int y) { y = printTitleBox(subject(), printer, painter, y); @@ -642,7 +642,7 @@ int KJotsBook::print(KPrinter& printer, QPainter& painter, int y) return y; } -QString KJotsBook::defaultSubject() +TQString KJotsBook::defaultSubject() { return i18n("Untitled Book"); } @@ -672,14 +672,14 @@ bool KJotsBook::isDirty() \brief Creates XML code and performs necessary tasks to save file. This function should ONLY be called when saving the file. */ -void KJotsBook::generateXml( QDomDocument &doc, QDomElement &parent ) +void KJotsBook::generateXml( TQDomDocument &doc, TQDomElement &parent ) { - QDomElement book = doc.createElement( "KJotsBook" ); + TQDomElement book = doc.createElement( "KJotsBook" ); parent.appendChild( book ); KJotsEntryBase::generateXml(doc, book); //let the base class save important stuff - QDomElement open = doc.createElement( "Open" ); + TQDomElement open = doc.createElement( "Open" ); open.appendChild( this->isOpen() ? doc.createTextNode("1") : doc.createTextNode("0") ); book.appendChild( open ); @@ -690,7 +690,7 @@ void KJotsBook::generateXml( QDomDocument &doc, QDomElement &parent ) entry = dynamic_cast<KJotsEntryBase*>(entry->nextSibling()); } - if ( !m_fileName.isEmpty() && QListViewItem::parent() ) + if ( !m_fileName.isEmpty() && TQListViewItem::parent() ) { //Hmmmm... We were originally loaded from a file, but now we have a parent, so //we must have been moved into another tree. Remove the old file now that we @@ -704,16 +704,16 @@ void KJotsBook::generateXml( QDomDocument &doc, QDomElement &parent ) /*! Parses through XML code from a file. */ -void KJotsBook::parseXml( QDomElement &me ) +void KJotsBook::parseXml( TQDomElement &me ) { KJotsEntryBase *lastEntry = 0; //keep track of the last entry inserted for speed if ( me.tagName() == "KJotsBook" ) { - QDomNode n = me.firstChild(); + TQDomNode n = me.firstChild(); while( !n.isNull() ) { - QDomElement e = n.toElement(); // try to convert the node to an element. + TQDomElement e = n.toElement(); // try to convert the node to an element. if ( !e.isNull() ) { if ( e.tagName() == "KJotsPage" ) @@ -754,16 +754,16 @@ void KJotsBook::parseXml( QDomElement &me ) \brief Returns an HTML Table of contents for this book. This is a helper function for generateHtml(). */ -QString KJotsBook::getToc() +TQString KJotsBook::getToc() { - QString toc; + TQString toc; toc += "<ul>"; KJotsEntryBase *entry = dynamic_cast<KJotsEntryBase*>(firstChild()); while ( entry ) { - QString htmlSubject = prepForHTML(entry->subject()); - toc += QString("<li><a href=\"#%1\">").arg(entry->id()) + htmlSubject + "</a></li>"; + TQString htmlSubject = prepForHTML(entry->subject()); + toc += TQString("<li><a href=\"#%1\">").arg(entry->id()) + htmlSubject + "</a></li>"; KJotsBook *book = dynamic_cast<KJotsBook*>(entry); if ( book ) toc += book->getToc(); @@ -780,20 +780,20 @@ QString KJotsBook::getToc() \param top Pointer to the "starting point" of this tree. \param diskMode Files saved to disk have a slightly different format. */ -QString KJotsBook::generateHtml( KJotsEntryBase* top, bool diskMode ) +TQString KJotsBook::generateHtml( KJotsEntryBase* top, bool diskMode ) { - QString toc, body; - QString htmlTitle = prepForHTML(subject()); + TQString toc, body; + TQString htmlTitle = prepForHTML(subject()); if ( top == this ) { - toc = QString("<h1><a name=\"%1\">%2</a></h1>").arg(id()).arg(htmlTitle); + toc = TQString("<h1><a name=\"%1\">%2</a></h1>").arg(id()).arg(htmlTitle); } else { if ( diskMode ) { - toc = QString("<h2><a name=\"%1\">%2</a></h2>").arg(id()).arg(htmlTitle); + toc = TQString("<h2><a name=\"%1\">%2</a></h2>").arg(id()).arg(htmlTitle); } else { - toc = QString("<h2><a name=\"%1\" href=\"%2\">%3</a></h2>").arg(id()).arg(id()).arg(htmlTitle); + toc = TQString("<h2><a name=\"%1\" href=\"%2\">%3</a></h2>").arg(id()).arg(id()).arg(htmlTitle); } } @@ -818,15 +818,15 @@ QString KJotsBook::generateHtml( KJotsEntryBase* top, bool diskMode ) This functions output moderately formatted text when the user chooses to save as a text file. */ -QString KJotsBook::generateText( void ) +TQString KJotsBook::generateText( void ) { - QString out; + TQString out; //Print Fancy Text header - QString line, buf; + TQString line, buf; line.fill('#', subject().length() + 2); line += "\n"; - out = line + QString("# ") + subject() + QString("\n") + line; + out = line + TQString("# ") + subject() + TQString("\n") + line; KJotsEntryBase* entry = dynamic_cast<KJotsEntryBase*>(firstChild()); while ( entry ) @@ -843,13 +843,13 @@ QString KJotsBook::generateText( void ) // KJotsPage // -KJotsPage::KJotsPage(KJotsBook* parent, QListViewItem *after) +KJotsPage::KJotsPage(KJotsBook* parent, TQListViewItem *after) : KJotsEntryBase(parent,after), m_editor(0) { m_isBook = false; m_paraPos = m_indexPos = 0; - setPixmap(0, kapp->iconLoader()->loadIcon(QString("edit"), KIcon::Small)); + setPixmap(0, kapp->iconLoader()->loadIcon(TQString("edit"), KIcon::Small)); } KJotsPage::~KJotsPage() @@ -879,7 +879,7 @@ void KJotsPage::initNewPage(void) /*! \brief Return the text of this page. */ -QString KJotsPage::body() +TQString KJotsPage::body() { //if we're being edited we want the current text, not whatever we saved before. if ( m_editor && m_editor->edited() ) @@ -895,7 +895,7 @@ QString KJotsPage::body() /*! \brief Sets the text of this page. */ -void KJotsPage::setBody(const QString& text) +void KJotsPage::setBody(const TQString& text) { assert ( !m_editor ); //m_editor should *never* be set. m_text = text; @@ -905,7 +905,7 @@ void KJotsPage::rename() { bool ok; - QString name = KInputDialog::getText(i18n( "Rename Page" ), + TQString name = KInputDialog::getText(i18n( "Rename Page" ), i18n( "Page title:" ), subject(), &ok, listView() ); @@ -926,21 +926,21 @@ void KJotsPage::rename() \brief Initiated when the user chooses to save this to a file. This function gets everything ready to go to save to the disk. */ -void KJotsPage::saveToFile(KURL url, bool plainText, const QString& encoding) +void KJotsPage::saveToFile(KURL url, bool plainText, const TQString& encoding) { if (url.isEmpty() || m_saveInProgress) return; m_saveToPlainText = plainText; - m_saveEncoding = QTextCodec::codecForName(encoding.ascii()); + m_saveEncoding = TQTextCodec::codecForName(encoding.ascii()); KIO::TransferJob* job = KIO::put(url, -1, true, false, false); if (!job) { return; } - connect(job, SIGNAL(dataReq(KIO::Job*, QByteArray&)), SLOT(saveDataReq(KIO::Job*, QByteArray&))); - connect(job, SIGNAL(result( KIO::Job *)), SLOT(slotSaveResult( KIO::Job *))); + connect(job, TQT_SIGNAL(dataReq(KIO::Job*, TQByteArray&)), TQT_SLOT(saveDataReq(KIO::Job*, TQByteArray&))); + connect(job, TQT_SIGNAL(result( KIO::Job *)), TQT_SLOT(slotSaveResult( KIO::Job *))); m_saveInProgress = true; } @@ -950,11 +950,11 @@ void KJotsPage::saveToFile(KURL url, bool plainText, const QString& encoding) \todo This should be augmented to cycle in case of REALLY long pages. */ -void KJotsPage::saveDataReq(KIO::Job* /* job */, QByteArray& data) +void KJotsPage::saveDataReq(KIO::Job* /* job */, TQByteArray& data) { if (!m_saveInProgress) return; //sanity check - QTextStream stream(data, IO_WriteOnly); + TQTextStream stream(data, IO_WriteOnly); stream.setCodec(m_saveEncoding); if ( !m_saveToPlainText ) @@ -980,11 +980,11 @@ void KJotsPage::slotSaveResult(KIO::Job *) /* if (job->error() != 0) {} */ } -void KJotsPage::print(QFont& defaultFont) +void KJotsPage::print(TQFont& defaultFont) { KJotsEntryBase* book = dynamic_cast<KJotsEntryBase*>(KListViewItem::parent()); - QString docName = book->subject(); + TQString docName = book->subject(); if (!subject().isNull()) { docName += ": " + subject(); @@ -997,7 +997,7 @@ void KJotsPage::print(QFont& defaultFont) if (printer.setup(listView(), i18n("Print: %1").arg(docName))) { - QPainter painter( &printer ); + TQPainter painter( &printer ); painter.setFont(defaultFont); print(printer, painter, 0); painter.end(); @@ -1007,26 +1007,26 @@ void KJotsPage::print(QFont& defaultFont) /*! \brief Prints this page. */ -int KJotsPage::print(KPrinter& printer, QPainter& painter, int y) +int KJotsPage::print(KPrinter& printer, TQPainter& painter, int y) { - QPaintDeviceMetrics metrics( &printer ); + TQPaintDeviceMetrics metrics( &printer ); int maxWidth = metrics.width(); int maxHeight = metrics.height(); //TODO: Is it really necessary to copy the entire body when printing? - QStringList paragraphs = QStringList::split(QChar('\n'), body(), true); + TQStringList paragraphs = TQStringList::split(TQChar('\n'), body(), true); y = printTitleBox(subject(), printer, painter, y); - for (QStringList::iterator para = paragraphs.begin(); + for (TQStringList::iterator para = paragraphs.begin(); para != paragraphs.end(); ++para) { //Watch for blank lines inserted as spacers. if ( (*para).isNull() ) *para = " "; - QRect r = painter.boundingRect(0, y, + TQRect r = painter.boundingRect(0, y, maxWidth, maxHeight, - QPainter::ExpandTabs | QPainter::WordBreak, + TQPainter::ExpandTabs | TQPainter::WordBreak, *para); if ((y + r.height()) > maxHeight) @@ -1036,7 +1036,7 @@ int KJotsPage::print(KPrinter& printer, QPainter& painter, int y) } painter.drawText(0, y, maxWidth, maxHeight - y, - QPainter::ExpandTabs | QPainter::WordBreak, + TQPainter::ExpandTabs | TQPainter::WordBreak, *para); y += r.height(); } @@ -1048,7 +1048,7 @@ int KJotsPage::print(KPrinter& printer, QPainter& painter, int y) \brief Get the default title of this page. \note This is only used by initNewPage(); it could probably be removed. */ -QString KJotsPage::defaultSubject() +TQString KJotsPage::defaultSubject() { int page = 0; @@ -1116,15 +1116,15 @@ bool KJotsPage::isDirty() /*! \brief Creates XML code and performs necessary tasks to save file. This function should ONLY be called when saving the file. -*/void KJotsPage::generateXml( QDomDocument &doc, QDomElement &parent ) +*/void KJotsPage::generateXml( TQDomDocument &doc, TQDomElement &parent ) { - QDomElement page = doc.createElement( "KJotsPage" ); + TQDomElement page = doc.createElement( "KJotsPage" ); parent.appendChild( page ); KJotsEntryBase::generateXml(doc, page); //let the base class save important stuff - QDomElement text = doc.createElement( "Text" ); - QString saveText = body(); + TQDomElement text = doc.createElement( "Text" ); + TQString saveText = body(); if ( saveText.contains("]]>") ) { saveText.replace("]]>","]]>"); text.setAttribute("fixed", "1"); @@ -1138,19 +1138,19 @@ bool KJotsPage::isDirty() /*! Parses through XML code from a file. */ -void KJotsPage::parseXml( QDomElement &me ) +void KJotsPage::parseXml( TQDomElement &me ) { if ( me.tagName() == "KJotsPage" ) { - QDomNode n = me.firstChild(); + TQDomNode n = me.firstChild(); while( !n.isNull() ) { - QDomElement e = n.toElement(); // try to convert the node to an element. + TQDomElement e = n.toElement(); // try to convert the node to an element. if ( !e.isNull() ) { if ( e.tagName() == "Text" ) { - QString bodyText = e.text(); + TQString bodyText = e.text(); if ( e.hasAttribute("fixed") ) { bodyText.replace("]]>", "]]>"); @@ -1175,32 +1175,32 @@ void KJotsPage::parseXml( QDomElement &me ) \param top This tells us that we are the toplevel. \param diskMode Files saved to disk have a slightly different format. */ -QString KJotsPage::generateHtml( KJotsEntryBase *top, bool diskMode ) +TQString KJotsPage::generateHtml( KJotsEntryBase *top, bool diskMode ) { - QString html; - QString htmlSubject = prepForHTML(subject()); + TQString html; + TQString htmlSubject = prepForHTML(subject()); if ( top == this || diskMode ) { - html += QString("<h3><a name=\"%1\">%2</a></h3>").arg(id()).arg(htmlSubject); + html += TQString("<h3><a name=\"%1\">%2</a></h3>").arg(id()).arg(htmlSubject); } else { - html += QString("<h3><a name=\"%1\" href=\"%2\">%3</a></h3>").arg(id()).arg(id()).arg(htmlSubject); + html += TQString("<h3><a name=\"%1\" href=\"%2\">%3</a></h3>").arg(id()).arg(id()).arg(htmlSubject); } html += prepForHTML(body()); html += "<br><table border=1><tr>"; - html += QString("<td><a href=\"#%1\">%2</a></td>").arg(id()).arg(subject()); + html += TQString("<td><a href=\"#%1\">%2</a></td>").arg(id()).arg(subject()); if ( top != this ) { KJotsBook *parent = parentBook(); while ( parent ) { - html += QString("<td><a href=\"#%1\">%2</a></td>").arg(parent->id()).arg(parent->subject()); + html += TQString("<td><a href=\"#%1\">%2</a></td>").arg(parent->id()).arg(parent->subject()); if ( parent == top ) break; parent = parent->parentBook(); } } - html += QString("</tr></table>"); + html += TQString("</tr></table>"); if ( top != this ) html += "<hr>"; return html; @@ -1213,15 +1213,15 @@ QString KJotsPage::generateHtml( KJotsEntryBase *top, bool diskMode ) This functions output moderately formatted text when the user chooses to save as a text file. */ -QString KJotsPage::generateText( void ) +TQString KJotsPage::generateText( void ) { - QString out; + TQString out; //Print Fancy Text header - QString line, buf; + TQString line, buf; line.fill('#', subject().length() + 2); line += "\n"; - out = line + QString("# ") + subject() + QString("\n") + line; + out = line + TQString("# ") + subject() + TQString("\n") + line; out += body(); diff --git a/kjots/kjotsentry.h b/kjots/kjotsentry.h index a16d176..08ad403 100644 --- a/kjots/kjotsentry.h +++ b/kjots/kjotsentry.h @@ -46,26 +46,26 @@ namespace KIO class Job; } -class KJotsEntryBase : public QObject, public KListViewItem +class KJotsEntryBase : public TQObject, public KListViewItem { Q_OBJECT public: - KJotsEntryBase(KListView*, QListViewItem*); - KJotsEntryBase(KListViewItem*, QListViewItem*); + KJotsEntryBase(KListView*, TQListViewItem*); + KJotsEntryBase(KListViewItem*, TQListViewItem*); public: - virtual void setSubject(const QString&); - QString subject() { return text(0); } - void setText(int,const QString&); - virtual void saveToFile(KURL, bool plainText, const QString& encoding) = 0; - virtual void print(QFont& defaultFont) = 0; - virtual int print(KPrinter&, QPainter&, int) = 0; - virtual QString defaultSubject() = 0; //!< "subject" is the caption name + virtual void setSubject(const TQString&); + TQString subject() { return text(0); } + void setText(int,const TQString&); + virtual void saveToFile(KURL, bool plainText, const TQString& encoding) = 0; + virtual void print(TQFont& defaultFont) = 0; + virtual int print(KPrinter&, TQPainter&, int) = 0; + virtual TQString defaultSubject() = 0; //!< "subject" is the caption name virtual void rename() = 0; - virtual void generateXml( QDomDocument&, QDomElement& ); - virtual void parseXml( QDomElement& ); - virtual QString generateHtml( KJotsEntryBase*, bool ) = 0; - virtual QString generateText( void ) = 0; + virtual void generateXml( TQDomDocument&, TQDomElement& ); + virtual void parseXml( TQDomElement& ); + virtual TQString generateHtml( KJotsEntryBase*, bool ) = 0; + virtual TQString generateText( void ) = 0; void setDirty(bool d) { m_dirty = d; } //!< Toggles the dirty flag. virtual bool isDirty() { return m_dirty; }; //!< Accessor for dirty flag. @@ -80,7 +80,7 @@ class KJotsEntryBase : public QObject, public KListViewItem bool isPage() const { return !m_isBook; } protected: - int printTitleBox(QString, KPrinter&, QPainter&, int); + int printTitleBox(TQString, KPrinter&, TQPainter&, int); bool m_saveInProgress; //!< Toggled during a manual disk save. bool m_isBook; //!< used for speed and code clarity. @@ -99,39 +99,39 @@ class KJotsBook : public KJotsEntryBase { Q_OBJECT public: - KJotsBook(KListView*, QListViewItem* after = 0); - KJotsBook(KListViewItem*, QListViewItem* after = 0); + KJotsBook(KListView*, TQListViewItem* after = 0); + KJotsBook(KListViewItem*, TQListViewItem* after = 0); ~KJotsBook(); - static bool isBookFile(const QString& book); - bool openBook(const QString&); + static bool isBookFile(const TQString& book); + bool openBook(const TQString&); void saveBook(); void deleteBook(); void rename(); - void saveToFile(KURL, bool plainText, const QString& encoding); + void saveToFile(KURL, bool plainText, const TQString& encoding); KJotsPage* addPage(); //!< Add a new page to this book. - void print(QFont& defaultFont); - int print(KPrinter&, QPainter&, int); + void print(TQFont& defaultFont); + int print(KPrinter&, TQPainter&, int); bool isDirty(); - QString defaultSubject(); - void generateXml( QDomDocument&, QDomElement& ); - void parseXml( QDomElement& ); - QString generateHtml( KJotsEntryBase*, bool ); - QString generateText( void ); + TQString defaultSubject(); + void generateXml( TQDomDocument&, TQDomElement& ); + void parseXml( TQDomElement& ); + TQString generateHtml( KJotsEntryBase*, bool ); + TQString generateText( void ); protected slots: - void saveDataReq(KIO::Job* job, QByteArray& data); + void saveDataReq(KIO::Job* job, TQByteArray& data); void slotSaveResult(KIO::Job*); private: - QString getToc(); - bool loadOldBook(QFile &); + TQString getToc(); + bool loadOldBook(TQFile &); void init(); bool m_open; - QString m_fileName; + TQString m_fileName; bool m_saveToPlainText; - QTextCodec* m_saveEncoding; + TQTextCodec* m_saveEncoding; KProgressDialog* m_saveProgressDialog; }; @@ -142,33 +142,33 @@ class KJotsPage : public KJotsEntryBase { Q_OBJECT public: - KJotsPage(KJotsBook* parent, QListViewItem* after = 0); + KJotsPage(KJotsBook* parent, TQListViewItem* after = 0); ~KJotsPage(); public: - QString body(); - void setBody(const QString&); - void saveToFile(KURL, bool plainText, const QString& encoding); - void print(QFont& defaultFont); - int print(KPrinter&, QPainter&, int); - QString defaultSubject(); + TQString body(); + void setBody(const TQString&); + void saveToFile(KURL, bool plainText, const TQString& encoding); + void print(TQFont& defaultFont); + int print(KPrinter&, TQPainter&, int); + TQString defaultSubject(); void rename(); void setEditor(KJotsEdit*); bool isDirty(); - void generateXml( QDomDocument&, QDomElement& ); - void parseXml( QDomElement& ); + void generateXml( TQDomDocument&, TQDomElement& ); + void parseXml( TQDomElement& ); void initNewPage(void); - QString generateHtml( KJotsEntryBase*, bool ); - QString generateText( void ); + TQString generateHtml( KJotsEntryBase*, bool ); + TQString generateText( void ); protected slots: - void saveDataReq(KIO::Job* job, QByteArray& data); + void saveDataReq(KIO::Job* job, TQByteArray& data); void slotSaveResult(KIO::Job*); private: - QString m_text; - QTextCodec* m_saveEncoding; + TQString m_text; + TQTextCodec* m_saveEncoding; bool m_saveToPlainText; KJotsEdit *m_editor; //!< ptr to editor if this is the active subject int m_paraPos; //< used to remrmber the cursor position diff --git a/kjots/main.cpp b/kjots/main.cpp index 4b0c10d..dcee5b9 100644 --- a/kjots/main.cpp +++ b/kjots/main.cpp @@ -66,7 +66,7 @@ int main( int argc, char **argv ) config->setGroup("kjots"); if (config->hasKey("EFontFamily")) { // read old font and create it - QFont font( config->readEntry("EFontFamily"), + TQFont font( config->readEntry("EFontFamily"), config->readNumEntry("EFontSize", 12), config->readNumEntry("EFontWeight", 0), config->readNumEntry("EFontItalic", 0)); @@ -89,7 +89,7 @@ int main( int argc, char **argv ) } } - a.setMainWidget( (QWidget *) jots ); + a.setMainWidget( (TQWidget *) jots ); jots->show(); jots->resize(jots->size()); return a.exec(); diff --git a/klaptopdaemon/acpi.cpp b/klaptopdaemon/acpi.cpp index 843b8cb..94bb124 100644 --- a/klaptopdaemon/acpi.cpp +++ b/klaptopdaemon/acpi.cpp @@ -40,33 +40,33 @@ #include <kprocess.h> // other Qt headers: -#include <qlayout.h> -#include <qlabel.h> -#include <qcheckbox.h> -#include <qhbox.h> -#include <qvgroupbox.h> -#include <qhgroupbox.h> -#include <qgrid.h> -#include <qpushbutton.h> -#include <qtooltip.h> +#include <tqlayout.h> +#include <tqlabel.h> +#include <tqcheckbox.h> +#include <tqhbox.h> +#include <tqvgroupbox.h> +#include <tqhgroupbox.h> +#include <tqgrid.h> +#include <tqpushbutton.h> +#include <tqtooltip.h> extern void wake_laptop_daemon(); -AcpiConfig::AcpiConfig (QWidget * parent, const char *name) +AcpiConfig::AcpiConfig (TQWidget * parent, const char *name) : KCModule(parent, name) { KGlobal::locale()->insertCatalogue("klaptopdaemon"); // For translation of klaptopdaemon messages config = new KConfig("kcmlaptoprc"); - QVBoxLayout *top_layout = new QVBoxLayout( this, KDialog::marginHint(), + TQVBoxLayout *top_layout = new TQVBoxLayout( this, KDialog::marginHint(), KDialog::spacingHint() ); - QLabel *tmp_label = new QLabel( i18n("This panel provides information about your system's ACPI implementation " + TQLabel *tmp_label = new TQLabel( i18n("This panel provides information about your system's ACPI implementation " "and lets you have access to some of the extra features provided by ACPI"), this ); tmp_label->setAlignment( Qt::WordBreak ); top_layout->addWidget( tmp_label ); - tmp_label = new QLabel( i18n("NOTE: the Linux ACPI implementation is still a 'work in progress'. " + tmp_label = new TQLabel( i18n("NOTE: the Linux ACPI implementation is still a 'work in progress'. " "Some features, in particular suspend and hibernate are not yet available " "under 2.4 - and under 2.5 some particular ACPI implementations are still " "unstable, these check boxes let you only enable the things that work reliably. " @@ -76,37 +76,37 @@ AcpiConfig::AcpiConfig (QWidget * parent, const char *name) tmp_label->setAlignment( Qt::WordBreak ); top_layout->addWidget( tmp_label ); - tmp_label = new QLabel( i18n("Some changes made on this page may require you to quit the laptop panel " + tmp_label = new TQLabel( i18n("Some changes made on this page may require you to quit the laptop panel " "and start it again to take effect"), this ); tmp_label->setAlignment( Qt::WordBreak ); top_layout->addWidget( tmp_label ); bool can_enable = laptop_portable::has_acpi(1); // is helper ready - enableStandby = new QCheckBox( i18n("Enable standby"), this ); + enableStandby = new TQCheckBox( i18n("Enable standby"), this ); top_layout->addWidget( enableStandby ); - QToolTip::add( enableStandby, i18n( "If checked this box enables transitions to the 'standby' state - a temporary powered down state" ) ); + TQToolTip::add( enableStandby, i18n( "If checked this box enables transitions to the 'standby' state - a temporary powered down state" ) ); enableStandby->setEnabled(can_enable); - connect( enableStandby, SIGNAL(clicked()), this, SLOT(configChanged()) ); + connect( enableStandby, TQT_SIGNAL(clicked()), this, TQT_SLOT(configChanged()) ); - enableSuspend = new QCheckBox( i18n("Enable &suspend"), this ); + enableSuspend = new TQCheckBox( i18n("Enable &suspend"), this ); top_layout->addWidget( enableSuspend ); - QToolTip::add( enableSuspend, i18n( "If checked this box enables transitions to the 'suspend' state - a semi-powered down state, sometimes called 'suspend-to-ram'" ) ); + TQToolTip::add( enableSuspend, i18n( "If checked this box enables transitions to the 'suspend' state - a semi-powered down state, sometimes called 'suspend-to-ram'" ) ); enableSuspend->setEnabled(can_enable); - connect( enableSuspend, SIGNAL(clicked()), this, SLOT(configChanged()) ); + connect( enableSuspend, TQT_SIGNAL(clicked()), this, TQT_SLOT(configChanged()) ); - QHBoxLayout *ll = new QHBoxLayout(); - enableHibernate = new QCheckBox( i18n("Enable &hibernate"), this ); + TQHBoxLayout *ll = new TQHBoxLayout(); + enableHibernate = new TQCheckBox( i18n("Enable &hibernate"), this ); ll->addWidget( enableHibernate ); - QToolTip::add( enableHibernate, i18n( "If checked this box enables transitions to the 'hibernate' state - a powered down state, sometimes called 'suspend-to-disk'" ) ); + TQToolTip::add( enableHibernate, i18n( "If checked this box enables transitions to the 'hibernate' state - a powered down state, sometimes called 'suspend-to-disk'" ) ); enableHibernate->setEnabled(can_enable); - connect( enableHibernate, SIGNAL(clicked()), this, SLOT(configChanged()) ); + connect( enableHibernate, TQT_SIGNAL(clicked()), this, TQT_SLOT(configChanged()) ); if (laptop_portable::has_software_suspend()) { ll->addStretch(1); - enableSoftwareSuspendHibernate = new QCheckBox( i18n("Use software suspend for hibernate"), this ); + enableSoftwareSuspendHibernate = new TQCheckBox( i18n("Use software suspend for hibernate"), this ); ll->addWidget( enableSoftwareSuspendHibernate ); - QToolTip::add( enableSoftwareSuspendHibernate, i18n( "If checked this box enables transitions to the 'hibernate' state - a powered down state, sometimes called 'suspend-to-disk' - the kernel 'Software Suspend' mechanism will be used instead of using ACPI directly" ) ); + TQToolTip::add( enableSoftwareSuspendHibernate, i18n( "If checked this box enables transitions to the 'hibernate' state - a powered down state, sometimes called 'suspend-to-disk' - the kernel 'Software Suspend' mechanism will be used instead of using ACPI directly" ) ); enableSoftwareSuspendHibernate->setEnabled(laptop_portable::has_software_suspend(2)); - connect( enableSoftwareSuspendHibernate, SIGNAL(clicked()), this, SLOT(configChanged()) ); + connect( enableSoftwareSuspendHibernate, TQT_SIGNAL(clicked()), this, TQT_SLOT(configChanged()) ); } else { enableSoftwareSuspendHibernate = 0; } @@ -114,19 +114,19 @@ AcpiConfig::AcpiConfig (QWidget * parent, const char *name) top_layout->addLayout(ll); - enablePerformance = new QCheckBox( i18n("Enable &performance profiles"), this ); + enablePerformance = new TQCheckBox( i18n("Enable &performance profiles"), this ); top_layout->addWidget( enablePerformance ); - QToolTip::add( enablePerformance, i18n( "If checked this box enables access to ACPI performance profiles - usually OK in 2.4 and later" ) ); + TQToolTip::add( enablePerformance, i18n( "If checked this box enables access to ACPI performance profiles - usually OK in 2.4 and later" ) ); enablePerformance->setEnabled(can_enable); - connect( enablePerformance, SIGNAL(clicked()), this, SLOT(configChanged()) ); + connect( enablePerformance, TQT_SIGNAL(clicked()), this, TQT_SLOT(configChanged()) ); - enableThrottle = new QCheckBox( i18n("Enable &CPU throttling"), this ); + enableThrottle = new TQCheckBox( i18n("Enable &CPU throttling"), this ); top_layout->addWidget( enableThrottle ); - QToolTip::add( enableThrottle, i18n( "If checked this box enables access to ACPI throttle speed changes - usually OK in 2.4 and later" ) ); + TQToolTip::add( enableThrottle, i18n( "If checked this box enables access to ACPI throttle speed changes - usually OK in 2.4 and later" ) ); enableThrottle->setEnabled(can_enable); - connect( enableThrottle, SIGNAL(clicked()), this, SLOT(configChanged()) ); + connect( enableThrottle, TQT_SIGNAL(clicked()), this, TQT_SLOT(configChanged()) ); - tmp_label = new QLabel(i18n("If the above boxes are disabled then there is no 'helper' " + tmp_label = new TQLabel(i18n("If the above boxes are disabled then there is no 'helper' " "application set up to help change ACPI states, there are two " "ways you can enable this application, either make the file " "/proc/acpi/sleep writeable by anyone every time your system boots " @@ -134,10 +134,10 @@ AcpiConfig::AcpiConfig (QWidget * parent, const char *name) "set-uid root"), this ); tmp_label->setAlignment( Qt::WordBreak ); top_layout->addWidget( tmp_label ); - ll = new QHBoxLayout(); - QPushButton *setupButton = new QPushButton(i18n("Setup Helper Application"), this); - connect( setupButton, SIGNAL(clicked()), this, SLOT(setupHelper()) ); - QToolTip::add( setupButton, i18n( "This button can be used to enable the ACPI helper application" ) ); + ll = new TQHBoxLayout(); + TQPushButton *setupButton = new TQPushButton(i18n("Setup Helper Application"), this); + connect( setupButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(setupHelper()) ); + TQToolTip::add( setupButton, i18n( "This button can be used to enable the ACPI helper application" ) ); ll->addStretch(2); ll->addWidget(setupButton); ll->addStretch(8); @@ -145,7 +145,7 @@ AcpiConfig::AcpiConfig (QWidget * parent, const char *name) top_layout->addStretch(1); - top_layout->addWidget( new QLabel( i18n("Version: %1").arg(LAPTOP_VERSION), this), 0, Qt::AlignRight ); + top_layout->addWidget( new TQLabel( i18n("Version: %1").arg(LAPTOP_VERSION), this), 0, Qt::AlignRight ); load(); @@ -158,15 +158,15 @@ AcpiConfig::~AcpiConfig() #include "checkcrc.h" #include "crcresult.h" -#include <qfile.h> +#include <tqfile.h> void AcpiConfig::setupHelper() { unsigned long len, crc; - QString helper = KStandardDirs::findExe("klaptop_acpi_helper"); - checkcrc(QFile::encodeName(helper), len, crc); + TQString helper = KStandardDirs::findExe("klaptop_acpi_helper"); + checkcrc(TQFile::encodeName(helper), len, crc); - QString kdesu = KStandardDirs::findExe("kdesu"); + TQString kdesu = KStandardDirs::findExe("kdesu"); if (!kdesu.isEmpty()) { int rc = KMessageBox::warningContinueCancel(0, i18n("You will need to supply a root password " @@ -263,7 +263,7 @@ void AcpiConfig::configChanged() } -QString AcpiConfig::quickHelp() const +TQString AcpiConfig::quickHelp() const { return i18n("<h1>ACPI Setup</h1>This module allows you to configure ACPI for your system"); } diff --git a/klaptopdaemon/acpi.h b/klaptopdaemon/acpi.h index a6a77cb..d463ef5 100644 --- a/klaptopdaemon/acpi.h +++ b/klaptopdaemon/acpi.h @@ -26,7 +26,7 @@ #define __ACPICONFIG_H__ #include <kcmodule.h> -#include <qstring.h> +#include <tqstring.h> class QWidget; class QSpinBox; @@ -41,7 +41,7 @@ class AcpiConfig : public KCModule { Q_OBJECT public: - AcpiConfig( QWidget *parent=0, const char* name=0); + AcpiConfig( TQWidget *parent=0, const char* name=0); ~AcpiConfig( ); void save( void ); @@ -49,7 +49,7 @@ public: void load( bool useDefaults ); void defaults(); - virtual QString quickHelp() const; + virtual TQString quickHelp() const; private slots: @@ -59,12 +59,12 @@ private slots: private: KConfig *config; - QCheckBox *enableHibernate; - QCheckBox *enableSuspend; - QCheckBox *enableStandby; - QCheckBox *enablePerformance; - QCheckBox *enableThrottle; - QCheckBox *enableSoftwareSuspendHibernate; + TQCheckBox *enableHibernate; + TQCheckBox *enableSuspend; + TQCheckBox *enableStandby; + TQCheckBox *enablePerformance; + TQCheckBox *enableThrottle; + TQCheckBox *enableSoftwareSuspendHibernate; bool enablestandby, enablesuspend, enablehibernate, enableperformance, enablethrottle, enablesoftwaresuspend; }; diff --git a/klaptopdaemon/apm.cpp b/klaptopdaemon/apm.cpp index ab25010..397bbb6 100644 --- a/klaptopdaemon/apm.cpp +++ b/klaptopdaemon/apm.cpp @@ -41,32 +41,32 @@ #include <kprocess.h> // other Qt headers: -#include <qlayout.h> -#include <qlabel.h> -#include <qcheckbox.h> -#include <qhbox.h> -#include <qvgroupbox.h> -#include <qgrid.h> -#include <qpushbutton.h> -#include <qtooltip.h> +#include <tqlayout.h> +#include <tqlabel.h> +#include <tqcheckbox.h> +#include <tqhbox.h> +#include <tqvgroupbox.h> +#include <tqgrid.h> +#include <tqpushbutton.h> +#include <tqtooltip.h> extern void wake_laptop_daemon(); -ApmConfig::ApmConfig (QWidget * parent, const char *name) +ApmConfig::ApmConfig (TQWidget * parent, const char *name) : KCModule(parent, name) { KGlobal::locale()->insertCatalogue("klaptopdaemon"); // For translation of klaptopdaemon messages config = new KConfig("kcmlaptoprc"); - QVBoxLayout *top_layout = new QVBoxLayout( this, KDialog::marginHint(), + TQVBoxLayout *top_layout = new TQVBoxLayout( this, KDialog::marginHint(), KDialog::spacingHint() ); - QLabel *tmp_label = new QLabel( i18n("This panel lets you configure your APM system and lets " + TQLabel *tmp_label = new TQLabel( i18n("This panel lets you configure your APM system and lets " "you have access to some of the extra features provided by it"), this ); tmp_label->setAlignment( Qt::WordBreak ); top_layout->addWidget( tmp_label ); - tmp_label = new QLabel( i18n("NOTE: some APM implementations have buggy suspend/standby " + tmp_label = new TQLabel( i18n("NOTE: some APM implementations have buggy suspend/standby " "implementations. You should test these features very gingerly - save " "all your work, check them on and try a suspend/standby from " "the popup menu on the battery icon in the panel if it fails to come " @@ -74,28 +74,28 @@ ApmConfig::ApmConfig (QWidget * parent, const char *name) tmp_label->setAlignment( Qt::WordBreak ); top_layout->addWidget( tmp_label ); - tmp_label = new QLabel( i18n("Some changes made on this page may require you to quit the laptop panel " + tmp_label = new TQLabel( i18n("Some changes made on this page may require you to quit the laptop panel " "and start it again to take effect"), this ); tmp_label->setAlignment( Qt::WordBreak ); top_layout->addWidget( tmp_label ); bool can_enable = laptop_portable::has_apm(1); // is helper ready - enableStandby = new QCheckBox( i18n("Enable standby"), this ); + enableStandby = new TQCheckBox( i18n("Enable standby"), this ); top_layout->addWidget( enableStandby ); - QToolTip::add( enableStandby, i18n( "If checked this box enables transitions to the 'standby' state - a temporary powered down state" ) ); + TQToolTip::add( enableStandby, i18n( "If checked this box enables transitions to the 'standby' state - a temporary powered down state" ) ); enableStandby->setEnabled(can_enable); - connect( enableStandby, SIGNAL(clicked()), this, SLOT(configChanged()) ); + connect( enableStandby, TQT_SIGNAL(clicked()), this, TQT_SLOT(configChanged()) ); - enableSuspend = new QCheckBox( i18n("Enable &suspend"), this ); + enableSuspend = new TQCheckBox( i18n("Enable &suspend"), this ); top_layout->addWidget( enableSuspend ); - QToolTip::add( enableSuspend, i18n( "If checked this box enables transitions to the 'suspend' state - a semi-powered down state, sometimes called 'suspend-to-ram'" ) ); + TQToolTip::add( enableSuspend, i18n( "If checked this box enables transitions to the 'suspend' state - a semi-powered down state, sometimes called 'suspend-to-ram'" ) ); enableSuspend->setEnabled(can_enable); - connect( enableSuspend, SIGNAL(clicked()), this, SLOT(configChanged()) ); + connect( enableSuspend, TQT_SIGNAL(clicked()), this, TQT_SLOT(configChanged()) ); apm_name = "/usr/bin/apm"; if (::access(apm_name, F_OK) != 0 && ::access("/usr/sbin/apm", F_OK) == 0) apm_name = "/usr/sbin/apm"; - tmp_label = new QLabel(i18n("If the above boxes are disabled then there is no 'helper' " + tmp_label = new TQLabel(i18n("If the above boxes are disabled then there is no 'helper' " "application set up to help change APM states, there are two " "ways you can enable this application, either make the file " "/proc/apm writeable by anyone every time your system boots " @@ -103,35 +103,35 @@ ApmConfig::ApmConfig (QWidget * parent, const char *name) "set-uid root").arg(apm_name), this ); tmp_label->setAlignment( Qt::WordBreak ); top_layout->addWidget( tmp_label ); - QHBoxLayout *ll = new QHBoxLayout(top_layout); - QPushButton *setupButton = new QPushButton(i18n("Setup Helper Application"), this); - connect( setupButton, SIGNAL(clicked()), this, SLOT(setupHelper()) ); - QToolTip::add( setupButton, i18n( "This button can be used to enable the APM helper application" ) ); + TQHBoxLayout *ll = new TQHBoxLayout(top_layout); + TQPushButton *setupButton = new TQPushButton(i18n("Setup Helper Application"), this); + connect( setupButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(setupHelper()) ); + TQToolTip::add( setupButton, i18n( "This button can be used to enable the APM helper application" ) ); ll->addStretch(2); ll->addWidget(setupButton); ll->addStretch(8); if (laptop_portable::has_software_suspend()) { - tmp_label = new QLabel( i18n("Your system seems to have 'Software Suspend' installed, this can " + tmp_label = new TQLabel( i18n("Your system seems to have 'Software Suspend' installed, this can " "be used to hibernate or 'suspend to disk' your system if you want " "to use this for hibernation check the box below"), this ); tmp_label->setAlignment( Qt::WordBreak ); top_layout->addWidget( tmp_label ); - enableSoftwareSuspendHibernate = new QCheckBox( i18n("Enable software suspend for hibernate"), this ); + enableSoftwareSuspendHibernate = new TQCheckBox( i18n("Enable software suspend for hibernate"), this ); top_layout->addWidget( enableSoftwareSuspendHibernate ); - QToolTip::add( enableSoftwareSuspendHibernate, i18n( "If checked this box enables transitions to the 'hibernate' state using the 'Software Suspend' mechanism" ) ); + TQToolTip::add( enableSoftwareSuspendHibernate, i18n( "If checked this box enables transitions to the 'hibernate' state using the 'Software Suspend' mechanism" ) ); enableSoftwareSuspendHibernate->setEnabled(laptop_portable::has_software_suspend(2)); - connect( enableSoftwareSuspendHibernate, SIGNAL(clicked()), this, SLOT(configChanged()) ); - tmp_label = new QLabel( i18n("If the above box is disabled then you need to be logged in " + connect( enableSoftwareSuspendHibernate, TQT_SIGNAL(clicked()), this, TQT_SLOT(configChanged()) ); + tmp_label = new TQLabel( i18n("If the above box is disabled then you need to be logged in " "as root or need a helper application to invoke the Software " "Suspend utility - KDE provides a utility to do this, if you " "wish to use it you must make it set-uid root, the button " "below will do this for you"), this ); tmp_label->setAlignment( Qt::WordBreak ); top_layout->addWidget( tmp_label ); - ll = new QHBoxLayout(this); - QPushButton *setupSSButton = new QPushButton(i18n("Setup SS Helper Application"), this); - connect( setupSSButton, SIGNAL(clicked()), this, SLOT(setupHelper2()) ); - QToolTip::add( setupSSButton, i18n( "This button can be used to enable the Software Suspend helper application" ) ); + ll = new TQHBoxLayout(this); + TQPushButton *setupSSButton = new TQPushButton(i18n("Setup SS Helper Application"), this); + connect( setupSSButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(setupHelper2()) ); + TQToolTip::add( setupSSButton, i18n( "This button can be used to enable the Software Suspend helper application" ) ); ll->addStretch(2); ll->addWidget(setupSSButton); ll->addStretch(8); @@ -141,7 +141,7 @@ ApmConfig::ApmConfig (QWidget * parent, const char *name) top_layout->addStretch(1); - top_layout->addWidget( new QLabel( i18n("Version: %1").arg(LAPTOP_VERSION), this), 0, Qt::AlignRight ); + top_layout->addWidget( new TQLabel( i18n("Version: %1").arg(LAPTOP_VERSION), this), 0, Qt::AlignRight ); load(); @@ -154,7 +154,7 @@ ApmConfig::~ApmConfig() void ApmConfig::setupHelper() { - QString kdesu = KStandardDirs::findExe("kdesu"); + TQString kdesu = KStandardDirs::findExe("kdesu"); if (!kdesu.isEmpty()) { int rc = KMessageBox::warningContinueCancel(0, i18n("You will need to supply a root password " @@ -166,11 +166,11 @@ void ApmConfig::setupHelper() proc << kdesu; proc << "-u"; proc << "root"; - proc << QString("dpkg-statoverride --update --add root root 6755 ")+apm_name; + proc << TQString("dpkg-statoverride --update --add root root 6755 ")+apm_name; proc.start(KProcess::Block); // run it sync so has_apm below sees the results } } else { - KMessageBox::sorry(0, i18n("%1 cannot be enabled because kdesu cannot be found. Please make sure that it is installed correctly.").arg(QString(apm_name)), + KMessageBox::sorry(0, i18n("%1 cannot be enabled because kdesu cannot be found. Please make sure that it is installed correctly.").arg(TQString(apm_name)), i18n("KLaptopDaemon")); } laptop_portable::apm_set_mask(enablestandby, enablesuspend); @@ -185,10 +185,10 @@ void ApmConfig::setupHelper() void ApmConfig::setupHelper2() // we use the acpi helper to do software suspend { unsigned long len, crc; - QString helper = KStandardDirs::findExe("klaptop_acpi_helper"); + TQString helper = KStandardDirs::findExe("klaptop_acpi_helper"); checkcrc(helper.latin1(), len, crc); - QString kdesu = KStandardDirs::findExe("kdesu"); + TQString kdesu = KStandardDirs::findExe("kdesu"); if (!kdesu.isEmpty()) { int rc = KMessageBox::warningContinueCancel(0, i18n("You will need to supply a root password " @@ -266,7 +266,7 @@ void ApmConfig::configChanged() } -QString ApmConfig::quickHelp() const +TQString ApmConfig::quickHelp() const { return i18n("<h1>APM Setup</h1>This module allows you to configure APM for your system"); } diff --git a/klaptopdaemon/apm.h b/klaptopdaemon/apm.h index a2213e9..c58e60f 100644 --- a/klaptopdaemon/apm.h +++ b/klaptopdaemon/apm.h @@ -26,7 +26,7 @@ #define __APMCONFIG_H__ #include <kcmodule.h> -#include <qstring.h> +#include <tqstring.h> class QWidget; class QSpinBox; @@ -41,7 +41,7 @@ class ApmConfig : public KCModule { Q_OBJECT public: - ApmConfig( QWidget *parent=0, const char* name=0); + ApmConfig( TQWidget *parent=0, const char* name=0); ~ApmConfig( ); void save( void ); @@ -49,7 +49,7 @@ public: void load(bool useDefaults); void defaults(); - virtual QString quickHelp() const; + virtual TQString quickHelp() const; private slots: @@ -60,9 +60,9 @@ private slots: private: KConfig *config; - QCheckBox *enableSuspend; - QCheckBox *enableStandby; - QCheckBox *enableSoftwareSuspendHibernate; + TQCheckBox *enableSuspend; + TQCheckBox *enableStandby; + TQCheckBox *enableSoftwareSuspendHibernate; bool enablestandby, enablesuspend, enablesoftwaresuspend; const char *apm_name; }; diff --git a/klaptopdaemon/battery.cpp b/klaptopdaemon/battery.cpp index ef43890..0c337d7 100644 --- a/klaptopdaemon/battery.cpp +++ b/klaptopdaemon/battery.cpp @@ -39,19 +39,19 @@ #include <krichtextlabel.h> // other Qt headers: -#include <qlayout.h> -#include <qlabel.h> -#include <qcheckbox.h> -#include <qhbox.h> -#include <qvgroupbox.h> -#include <qhgroupbox.h> -#include <qgrid.h> -#include <qpushbutton.h> -#include <qtooltip.h> +#include <tqlayout.h> +#include <tqlabel.h> +#include <tqcheckbox.h> +#include <tqhbox.h> +#include <tqvgroupbox.h> +#include <tqhgroupbox.h> +#include <tqgrid.h> +#include <tqpushbutton.h> +#include <tqtooltip.h> extern void wake_laptop_daemon(); -BatteryConfig::BatteryConfig (QWidget * parent, const char *name) +BatteryConfig::BatteryConfig (TQWidget * parent, const char *name) : KCModule(parent, name), editPoll(0), iconloader(0), @@ -65,30 +65,30 @@ BatteryConfig::BatteryConfig (QWidget * parent, const char *name) config = new KConfig("kcmlaptoprc"); instance = new KInstance("klaptopdaemon"); - QVBoxLayout *top_layout = new QVBoxLayout( this, KDialog::marginHint(), + TQVBoxLayout *top_layout = new TQVBoxLayout( this, KDialog::marginHint(), KDialog::spacingHint() ); // do we show the monitor - runMonitor = new QCheckBox( i18n("&Show battery monitor"), this ); + runMonitor = new TQCheckBox( i18n("&Show battery monitor"), this ); top_layout->addWidget( runMonitor ); - QToolTip::add( runMonitor, i18n( "This box enables the battery state icon in the panel" ) ); - connect( runMonitor, SIGNAL(clicked()), this, SLOT(configChanged()) ); - connect( runMonitor, SIGNAL(clicked()), this, SLOT(runMonitorChanged()) ); + TQToolTip::add( runMonitor, i18n( "This box enables the battery state icon in the panel" ) ); + connect( runMonitor, TQT_SIGNAL(clicked()), this, TQT_SLOT(configChanged()) ); + connect( runMonitor, TQT_SIGNAL(clicked()), this, TQT_SLOT(runMonitorChanged()) ); // show also the battery level percentage - showLevel = new QCheckBox( i18n("Show battery level percentage"), this ); + showLevel = new TQCheckBox( i18n("Show battery level percentage"), this ); top_layout->addWidget( showLevel ); - QToolTip::add( showLevel, i18n( "This box enables a text message near the battery state icon containing battery level percentage" ) ); - connect( showLevel, SIGNAL(clicked()), this, SLOT(configChanged()) ); + TQToolTip::add( showLevel, i18n( "This box enables a text message near the battery state icon containing battery level percentage" ) ); + connect( showLevel, TQT_SIGNAL(clicked()), this, TQT_SLOT(configChanged()) ); - notifyMe = new QCheckBox( i18n("&Notify me whenever my battery becomes fully charged"), this ); + notifyMe = new TQCheckBox( i18n("&Notify me whenever my battery becomes fully charged"), this ); top_layout->addWidget( notifyMe ); - QToolTip::add( notifyMe, i18n( "This box enables a dialog box that pops up when your battery becomes fully charged" ) ); - connect( notifyMe, SIGNAL(clicked()), this, SLOT(configChanged()) ); + TQToolTip::add( notifyMe, i18n( "This box enables a dialog box that pops up when your battery becomes fully charged" ) ); + connect( notifyMe, TQT_SIGNAL(clicked()), this, TQT_SLOT(configChanged()) ); - blankSaver = new QCheckBox( i18n("&Use a blank screen saver when running on battery"), this ); + blankSaver = new TQCheckBox( i18n("&Use a blank screen saver when running on battery"), this ); top_layout->addWidget( blankSaver ); - connect( blankSaver, SIGNAL(clicked()), this, SLOT(configChanged()) ); + connect( blankSaver, TQT_SIGNAL(clicked()), this, TQT_SLOT(configChanged()) ); if (!apm) { top_layout->addWidget( laptop_portable::no_power_management_explanation(this) ); @@ -96,72 +96,72 @@ BatteryConfig::BatteryConfig (QWidget * parent, const char *name) iconloader = new KIconLoader("klaptopdaemon"); // the poll time (in seconds) - QHBox *hb = new QHBox( this ); + TQHBox *hb = new TQHBox( this ); hb->setSpacing( KDialog::spacingHint() ); top_layout->addWidget( hb ); - QLabel* poll_label = new QLabel( i18n("&Check status every:"), hb ); - editPoll = new QSpinBox( 1, 3600, 1, hb ); // min,max,step - QToolTip::add( editPoll, i18n( "Choose how responsive the laptop software will be when it checks the battery status" ) ); + TQLabel* poll_label = new TQLabel( i18n("&Check status every:"), hb ); + editPoll = new TQSpinBox( 1, 3600, 1, hb ); // min,max,step + TQToolTip::add( editPoll, i18n( "Choose how responsive the laptop software will be when it checks the battery status" ) ); editPoll->setSuffix( i18n("keep short, unit in spinbox", "sec") ); poll_label->setBuddy( editPoll ); - connect( editPoll, SIGNAL(valueChanged(int)), - this, SLOT(configChanged()) ); - QWidget* spacer = new QWidget( hb ); + connect( editPoll, TQT_SIGNAL(valueChanged(int)), + this, TQT_SLOT(configChanged()) ); + TQWidget* spacer = new TQWidget( hb ); hb->setStretchFactor( spacer, 1 ); // group box to hold the icons together - QVGroupBox* icons_groupbox = new QVGroupBox( i18n("Select Battery Icons"), this ); + TQVGroupBox* icons_groupbox = new TQVGroupBox( i18n("Select Battery Icons"), this ); icons_groupbox->layout()->setSpacing( KDialog::spacingHint() ); top_layout->addWidget( icons_groupbox, 0, Qt::AlignLeft ); // layout to hold the icons inside the groupbox - QGrid *icon_grid = new QGrid( 3 /*cols*/, icons_groupbox ); + TQGrid *icon_grid = new TQGrid( 3 /*cols*/, icons_groupbox ); icon_grid->setSpacing( KDialog::spacingHint() ); buttonNoBattery = new KIconButton( iconloader, icon_grid ); buttonNoCharge = new KIconButton( iconloader, icon_grid ); buttonCharge = new KIconButton( iconloader, icon_grid ); - (void)new QLabel( buttonNoBattery, i18n("No &battery"), icon_grid); - (void)new QLabel( buttonNoCharge, i18n("&Not charging"), icon_grid); - (void)new QLabel( buttonCharge, i18n("Char&ging"), icon_grid); + (void)new TQLabel( buttonNoBattery, i18n("No &battery"), icon_grid); + (void)new TQLabel( buttonNoCharge, i18n("&Not charging"), icon_grid); + (void)new TQLabel( buttonCharge, i18n("Char&ging"), icon_grid); buttonNoBattery->setIconType( KIcon::NoGroup, KIcon::Any, 1); buttonNoCharge->setIconType( KIcon::NoGroup, KIcon::Any, 1); buttonCharge->setIconType( KIcon::NoGroup, KIcon::Any, 1); - connect(buttonNoBattery, SIGNAL(iconChanged(QString)), this, SLOT(iconChanged())); - connect(buttonNoCharge, SIGNAL(iconChanged(QString)), this, SLOT(iconChanged())); - connect(buttonCharge, SIGNAL(iconChanged(QString)), this, SLOT(configChanged())); + connect(buttonNoBattery, TQT_SIGNAL(iconChanged(TQString)), this, TQT_SLOT(iconChanged())); + connect(buttonNoCharge, TQT_SIGNAL(iconChanged(TQString)), this, TQT_SLOT(iconChanged())); + connect(buttonCharge, TQT_SIGNAL(iconChanged(TQString)), this, TQT_SLOT(configChanged())); int num_batteries; - QStringList battery_names, battery_states, battery_values; + TQStringList battery_names, battery_states, battery_values; laptop_portable::get_battery_status(num_batteries, battery_names, battery_states, battery_values); if (num_batteries > 0) { - QHBoxLayout *hl = new QHBoxLayout(); + TQHBoxLayout *hl = new TQHBoxLayout(); top_layout->addLayout(hl); - QHGroupBox *hb = new QHGroupBox(i18n("Current Battery Status"), this); + TQHGroupBox *hb = new TQHGroupBox(i18n("Current Battery Status"), this); for (int i = 0; i < num_batteries; i++) { - QWidget *wp; + TQWidget *wp; if (num_batteries == 1) { - wp = new QWidget(hb); + wp = new TQWidget(hb); } else { - wp = new QVGroupBox(battery_names[i], hb); + wp = new TQVGroupBox(battery_names[i], hb); } - QVBoxLayout *vb = new QVBoxLayout(wp); + TQVBoxLayout *vb = new TQVBoxLayout(wp); - QLabel *l; + TQLabel *l; - l = new QLabel(wp); // icon indicating state + l = new TQLabel(wp); // icon indicating state vb->addWidget(l); batt_label_1.append(l); - l = new QLabel(QString(""), wp); + l = new TQLabel(TQString(""), wp); vb->addWidget(l); batt_label_2.append(l); - l = new QLabel(QString(""), wp); + l = new TQLabel(TQString(""), wp); vb->addWidget(l); batt_label_3.append(l); } @@ -171,14 +171,14 @@ BatteryConfig::BatteryConfig (QWidget * parent, const char *name) } // TODO: remove linefeed from string, can't do it right now coz we have a string freeze - QLabel* explain = new KRichTextLabel( i18n("This panel controls whether the battery status monitor\nappears in the system tray and what it looks like.").replace("\n"," "), this); + TQLabel* explain = new KRichTextLabel( i18n("This panel controls whether the battery status monitor\nappears in the system tray and what it looks like.").replace("\n"," "), this); top_layout->addWidget(explain, 0); laptop_portable::extra_config(this, config, top_layout); } top_layout->addStretch(1); - startMonitor = new QPushButton( i18n("&Start Battery Monitor"), this); - connect(startMonitor, SIGNAL(clicked()), this, SLOT(slotStartMonitor())); + startMonitor = new TQPushButton( i18n("&Start Battery Monitor"), this); + connect(startMonitor, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotStartMonitor())); top_layout->addWidget( startMonitor, 0, Qt::AlignRight ); load(); @@ -271,7 +271,7 @@ void BatteryConfig::configChanged() } -QString BatteryConfig::quickHelp() const +TQString BatteryConfig::quickHelp() const { return i18n("<h1>Laptop Battery</h1>This module allows you to monitor " "your batteries. To make use of this module, you must have power management system software " @@ -283,14 +283,14 @@ void BatteryConfig::slotStartMonitor() { wake_laptop_daemon(); if (!enablemonitor) { - KMessageBox::information(0, i18n("<qt>The battery monitor has been started, but the tray icon is currently disabled. You can make it appear by selecting the <b>Show battery monitor</b> entry on this page and applying your changes.</qt>"), QString::null, "howToEnableMonitor"); + KMessageBox::information(0, i18n("<qt>The battery monitor has been started, but the tray icon is currently disabled. You can make it appear by selecting the <b>Show battery monitor</b> entry on this page and applying your changes.</qt>"), TQString::null, "howToEnableMonitor"); } } void -BatteryConfig::ConvertIcon(int percent, QPixmap &pm, QPixmap &result) +BatteryConfig::ConvertIcon(int percent, TQPixmap &pm, TQPixmap &result) { - QImage image = pm.convertToImage(); + TQImage image = pm.convertToImage(); int w = image.width(); int h = image.height(); @@ -347,12 +347,12 @@ void BatteryConfig::BatteryStateUpdate() { int num_batteries; - QStringList battery_names, battery_states, battery_values; + TQStringList battery_names, battery_states, battery_values; laptop_portable::get_battery_status(num_batteries, battery_names, battery_states, battery_values); if (num_batteries > 0) { for (int i = 0; i < num_batteries; i++) { if (battery_states[i] == "yes") { - QPixmap result; + TQPixmap result; ConvertIcon(battery_values[i].toInt(), battery_pm, result); batt_label_1.at(i)->setPixmap(result); @@ -380,7 +380,7 @@ void BatteryConfig::iconChanged() BatteryStateUpdate(); } -void BatteryConfig::timerEvent(QTimerEvent *) +void BatteryConfig::timerEvent(TQTimerEvent *) { BatteryStateUpdate(); } diff --git a/klaptopdaemon/battery.h b/klaptopdaemon/battery.h index 3e484ef..a914b57 100644 --- a/klaptopdaemon/battery.h +++ b/klaptopdaemon/battery.h @@ -28,9 +28,9 @@ #define __BATTERYCONFIG_H__ #include <kcmodule.h> -#include <qstring.h> -#include <qpixmap.h> -#include <qptrlist.h> +#include <tqstring.h> +#include <tqpixmap.h> +#include <tqptrlist.h> class QWidget; class QSpinBox; @@ -46,7 +46,7 @@ class BatteryConfig : public KCModule { Q_OBJECT public: - BatteryConfig( QWidget *parent=0, const char* name=0); + BatteryConfig( TQWidget *parent=0, const char* name=0); ~BatteryConfig( ); void save( void ); @@ -54,7 +54,7 @@ public: void load(bool useDefaults); void defaults(); - virtual QString quickHelp() const; + virtual TQString quickHelp() const; private slots: @@ -65,15 +65,15 @@ private slots: void BatteryStateUpdate(); private: - void timerEvent(QTimerEvent *); - void ConvertIcon(int percent, QPixmap &pm, QPixmap &result); + void timerEvent(TQTimerEvent *); + void ConvertIcon(int percent, TQPixmap &pm, TQPixmap &result); KConfig *config; - QSpinBox* editPoll; - QCheckBox* runMonitor; - QCheckBox* showLevel; - QCheckBox* notifyMe; - QCheckBox* blankSaver; + TQSpinBox* editPoll; + TQCheckBox* runMonitor; + TQCheckBox* showLevel; + TQCheckBox* notifyMe; + TQCheckBox* blankSaver; bool enablemonitor; bool showlevel; bool enablequitmenu; @@ -85,13 +85,13 @@ private: KIconButton *buttonNoBattery; KIconButton *buttonNoCharge; KIconButton *buttonCharge; - QString nobattery, nochargebattery, chargebattery; - QPushButton *startMonitor; + TQString nobattery, nochargebattery, chargebattery; + TQPushButton *startMonitor; bool apm; int poll_time; - QPtrList<QLabel> batt_label_1, batt_label_2, batt_label_3; - QPixmap battery_pm, battery_nopm; + TQPtrList<TQLabel> batt_label_1, batt_label_2, batt_label_3; + TQPixmap battery_pm, battery_nopm; KInstance *instance; }; diff --git a/klaptopdaemon/buttons.cpp b/klaptopdaemon/buttons.cpp index f9ccce4..3c05359 100644 --- a/klaptopdaemon/buttons.cpp +++ b/klaptopdaemon/buttons.cpp @@ -34,17 +34,17 @@ #include <kapplication.h> #include <kcombobox.h> -#include <qlayout.h> -#include <qvbuttongroup.h> -#include <qspinbox.h> -#include <qradiobutton.h> -#include <qcheckbox.h> -#include <qhbox.h> -#include <qslider.h> -#include <qtooltip.h> +#include <tqlayout.h> +#include <tqvbuttongroup.h> +#include <tqspinbox.h> +#include <tqradiobutton.h> +#include <tqcheckbox.h> +#include <tqhbox.h> +#include <tqslider.h> +#include <tqtooltip.h> extern void wake_laptop_daemon(); -ButtonsConfig::ButtonsConfig (QWidget * parent, const char *name) +ButtonsConfig::ButtonsConfig (TQWidget * parent, const char *name) : KCModule(parent, name), lidBox(0), lidStandby(0), @@ -82,16 +82,16 @@ ButtonsConfig::ButtonsConfig (QWidget * parent, const char *name) apm = laptop_portable::has_power_management(); config = new KConfig("kcmlaptoprc"); int can_brightness = laptop_portable::has_brightness(); - QStringList throttle_list; + TQStringList throttle_list; int current_throttle; bool *active_list; bool has_throttle = laptop_portable::get_system_throttling(0, current_throttle, throttle_list, active_list); - QStringList performance_list; + TQStringList performance_list; int current_performance; bool has_performance = laptop_portable::get_system_performance(0, current_performance, performance_list, active_list); if (!apm && !can_brightness && !has_throttle && !has_performance) { - QVBoxLayout *top_layout = new QVBoxLayout(this, KDialog::marginHint(), + TQVBoxLayout *top_layout = new TQVBoxLayout(this, KDialog::marginHint(), KDialog::spacingHint()); KActiveLabel* explain = laptop_portable::no_power_management_explanation(this); @@ -106,170 +106,170 @@ ButtonsConfig::ButtonsConfig (QWidget * parent, const char *name) if (!can_standby && !can_suspend && !can_hibernate && !can_brightness && !has_throttle && !has_performance) apm = 0; if (!apm) { - QVBoxLayout *top_layout = new QVBoxLayout(this, KDialog::marginHint(), + TQVBoxLayout *top_layout = new TQVBoxLayout(this, KDialog::marginHint(), KDialog::spacingHint()); - QLabel* explain = laptop_portable::how_to_do_suspend_resume(this); + TQLabel* explain = laptop_portable::how_to_do_suspend_resume(this); top_layout->addWidget(explain); top_layout->addStretch(1); } else { - QVBoxLayout *top_layout = new QVBoxLayout(this, KDialog::marginHint(), + TQVBoxLayout *top_layout = new TQVBoxLayout(this, KDialog::marginHint(), KDialog::spacingHint()); - QHBoxLayout *hlay = new QHBoxLayout( top_layout ); + TQHBoxLayout *hlay = new TQHBoxLayout( top_layout ); if (laptop_portable::has_button(laptop_portable::LidButton)) { - lidBox = new QVButtonGroup(i18n("Lid Switch Closed"), this); + lidBox = new TQVButtonGroup(i18n("Lid Switch Closed"), this); lidBox->layout()->setSpacing( KDialog::spacingHint() ); - QToolTip::add( lidBox, i18n( "Select which actions will occur when the laptop's lid is closed" ) ); + TQToolTip::add( lidBox, i18n( "Select which actions will occur when the laptop's lid is closed" ) ); hlay->addWidget( lidBox ); if (can_standby) { - lidStandby = new QRadioButton(i18n("Standb&y"), lidBox); - QToolTip::add( lidStandby, i18n( "Causes the laptop to move into the standby temporary low-power state" ) ); + lidStandby = new TQRadioButton(i18n("Standb&y"), lidBox); + TQToolTip::add( lidStandby, i18n( "Causes the laptop to move into the standby temporary low-power state" ) ); } if (can_suspend) { - lidSuspend = new QRadioButton(i18n("&Suspend"), lidBox); - QToolTip::add( lidSuspend, i18n( "Causes the laptop to move into the suspend 'save-to-ram' state" ) ); + lidSuspend = new TQRadioButton(i18n("&Suspend"), lidBox); + TQToolTip::add( lidSuspend, i18n( "Causes the laptop to move into the suspend 'save-to-ram' state" ) ); } if (can_hibernate) { - lidHibernate = new QRadioButton(i18n("H&ibernate"), lidBox); - QToolTip::add( lidHibernate, i18n( "Causes the laptop to move into the hibernate 'save-to-disk' state" ) ); + lidHibernate = new TQRadioButton(i18n("H&ibernate"), lidBox); + TQToolTip::add( lidHibernate, i18n( "Causes the laptop to move into the hibernate 'save-to-disk' state" ) ); } if (can_shutdown) { - lidShutdown = new QRadioButton(i18n("System power off"), lidBox); - QToolTip::add( lidShutdown, i18n( "Causes the laptop to power down" ) ); + lidShutdown = new TQRadioButton(i18n("System power off"), lidBox); + TQToolTip::add( lidShutdown, i18n( "Causes the laptop to power down" ) ); } if (can_logout) { - lidLogout = new QRadioButton(i18n("Logout"), lidBox); - QToolTip::add( lidShutdown, i18n( "Causes you to be logged out" ) ); + lidLogout = new TQRadioButton(i18n("Logout"), lidBox); + TQToolTip::add( lidShutdown, i18n( "Causes you to be logged out" ) ); } if (can_suspend||can_standby||can_hibernate||can_shutdown||can_logout) - lidOff = new QRadioButton(i18n("&Off"), lidBox); + lidOff = new TQRadioButton(i18n("&Off"), lidBox); if (can_brightness) { - lidBrightness = new QCheckBox(i18n("Brightness"), lidBox); - QToolTip::add( lidBrightness, i18n( "Causes the back panel brightness to be set" ) ); - QWidget *wp = new QWidget(lidBox); - QHBoxLayout *xl = new QHBoxLayout( wp); - xl->addWidget(new QLabel("-", wp)); - lidValBrightness = new QSlider(0, 255, 16, 255, Qt::Horizontal, wp); + lidBrightness = new TQCheckBox(i18n("Brightness"), lidBox); + TQToolTip::add( lidBrightness, i18n( "Causes the back panel brightness to be set" ) ); + TQWidget *wp = new TQWidget(lidBox); + TQHBoxLayout *xl = new TQHBoxLayout( wp); + xl->addWidget(new TQLabel("-", wp)); + lidValBrightness = new TQSlider(0, 255, 16, 255, Qt::Horizontal, wp); lidValBrightness->setEnabled(0); - QToolTip::add( lidValBrightness, i18n( "How bright the back panel will be set to" ) ); - connect (lidValBrightness, SIGNAL(valueChanged(int)), this, SLOT(configChanged())); + TQToolTip::add( lidValBrightness, i18n( "How bright the back panel will be set to" ) ); + connect (lidValBrightness, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(configChanged())); xl->addWidget(lidValBrightness); - xl->addWidget(new QLabel("+", wp)); + xl->addWidget(new TQLabel("+", wp)); xl->addStretch(1); } if (has_performance) { - lidPerformance = new QCheckBox(i18n("System performance"), lidBox); - QToolTip::add( lidPerformance, i18n( "Causes the performance profile to be changed" ) ); + lidPerformance = new TQCheckBox(i18n("System performance"), lidBox); + TQToolTip::add( lidPerformance, i18n( "Causes the performance profile to be changed" ) ); - QWidget *wp = new QWidget(lidBox); - QHBoxLayout *xl = new QHBoxLayout( wp); + TQWidget *wp = new TQWidget(lidBox); + TQHBoxLayout *xl = new TQHBoxLayout( wp); lidValPerformance = new KComboBox(0, wp); - QToolTip::add( lidValPerformance, i18n( "The performance profile to switch to" ) ); + TQToolTip::add( lidValPerformance, i18n( "The performance profile to switch to" ) ); lidValPerformance->insertStringList(performance_list); lidValPerformance->setEnabled(0); - connect (lidValPerformance, SIGNAL(activated(int)), this, SLOT(configChanged())); + connect (lidValPerformance, TQT_SIGNAL(activated(int)), this, TQT_SLOT(configChanged())); xl->addWidget(lidValPerformance); xl->addStretch(1); } if (has_throttle) { - lidThrottle = new QCheckBox(i18n("CPU throttle"), lidBox); - QToolTip::add( lidThrottle, i18n( "Causes the CPU to be throttled back" ) ); + lidThrottle = new TQCheckBox(i18n("CPU throttle"), lidBox); + TQToolTip::add( lidThrottle, i18n( "Causes the CPU to be throttled back" ) ); - QWidget *wp = new QWidget(lidBox); - QHBoxLayout *xl = new QHBoxLayout( wp); + TQWidget *wp = new TQWidget(lidBox); + TQHBoxLayout *xl = new TQHBoxLayout( wp); lidValThrottle = new KComboBox(0, wp); - QToolTip::add( lidValThrottle, i18n( "How much to throttle back the CPU" ) ); + TQToolTip::add( lidValThrottle, i18n( "How much to throttle back the CPU" ) ); lidValThrottle->insertStringList(throttle_list); lidValThrottle->setEnabled(0); - connect (lidValThrottle, SIGNAL(activated(int)), this, SLOT(configChanged())); + connect (lidValThrottle, TQT_SIGNAL(activated(int)), this, TQT_SLOT(configChanged())); xl->addWidget(lidValThrottle); xl->addStretch(1); } - connect(lidBox, SIGNAL(clicked(int)), this, SLOT(configChanged())); + connect(lidBox, TQT_SIGNAL(clicked(int)), this, TQT_SLOT(configChanged())); } if (laptop_portable::has_button(laptop_portable::PowerButton)) { - powerBox = new QVButtonGroup(i18n("Power Switch Pressed"), this); + powerBox = new TQVButtonGroup(i18n("Power Switch Pressed"), this); powerBox->layout()->setSpacing( KDialog::spacingHint() ); - QToolTip::add( powerBox, i18n( "Select which actions will occur when the laptop's power button is pressed" ) ); + TQToolTip::add( powerBox, i18n( "Select which actions will occur when the laptop's power button is pressed" ) ); hlay->addWidget( powerBox ); if (can_standby) { - powerStandby = new QRadioButton(i18n("Sta&ndby"), powerBox); - QToolTip::add( powerStandby, i18n( "Causes the laptop to move into the standby temporary low-power state" ) ); + powerStandby = new TQRadioButton(i18n("Sta&ndby"), powerBox); + TQToolTip::add( powerStandby, i18n( "Causes the laptop to move into the standby temporary low-power state" ) ); } if (can_suspend) { - powerSuspend = new QRadioButton(i18n("S&uspend"), powerBox); - QToolTip::add( powerSuspend, i18n( "Causes the laptop to move into the suspend 'save-to-ram' state" ) ); + powerSuspend = new TQRadioButton(i18n("S&uspend"), powerBox); + TQToolTip::add( powerSuspend, i18n( "Causes the laptop to move into the suspend 'save-to-ram' state" ) ); } if (can_hibernate) { - powerHibernate = new QRadioButton(i18n("Hi&bernate"), powerBox); - QToolTip::add( powerHibernate, i18n( "Causes the laptop to move into the hibernate 'save-to-disk' state" ) ); + powerHibernate = new TQRadioButton(i18n("Hi&bernate"), powerBox); + TQToolTip::add( powerHibernate, i18n( "Causes the laptop to move into the hibernate 'save-to-disk' state" ) ); } if (can_shutdown) { - powerShutdown = new QRadioButton(i18n("System power off"), powerBox); - QToolTip::add( powerShutdown, i18n( "Causes the laptop to power down" ) ); + powerShutdown = new TQRadioButton(i18n("System power off"), powerBox); + TQToolTip::add( powerShutdown, i18n( "Causes the laptop to power down" ) ); } if (can_logout) { - powerLogout = new QRadioButton(i18n("Logout"), powerBox); - QToolTip::add( powerShutdown, i18n( "Causes you to be logged out" ) ); + powerLogout = new TQRadioButton(i18n("Logout"), powerBox); + TQToolTip::add( powerShutdown, i18n( "Causes you to be logged out" ) ); } if (can_suspend||can_standby||can_hibernate||can_shutdown||can_logout) - powerOff = new QRadioButton(i18n("O&ff"), powerBox); + powerOff = new TQRadioButton(i18n("O&ff"), powerBox); if (can_brightness) { - powerBrightness = new QCheckBox(i18n("Brightness"), powerBox); - QToolTip::add( powerBrightness, i18n( "Causes the back panel brightness to be set" ) ); - QWidget *wp = new QWidget(powerBox); - QHBoxLayout *xl = new QHBoxLayout( wp); - xl->addWidget(new QLabel("-", wp)); - powerValBrightness = new QSlider(0, 255, 16, 255, Qt::Horizontal, wp); - QToolTip::add( powerValBrightness, i18n( "How bright the back panel will be set to" ) ); + powerBrightness = new TQCheckBox(i18n("Brightness"), powerBox); + TQToolTip::add( powerBrightness, i18n( "Causes the back panel brightness to be set" ) ); + TQWidget *wp = new TQWidget(powerBox); + TQHBoxLayout *xl = new TQHBoxLayout( wp); + xl->addWidget(new TQLabel("-", wp)); + powerValBrightness = new TQSlider(0, 255, 16, 255, Qt::Horizontal, wp); + TQToolTip::add( powerValBrightness, i18n( "How bright the back panel will be set to" ) ); powerValBrightness->setEnabled(0); - connect (powerValBrightness, SIGNAL(valueChanged(int)), this, SLOT(configChanged())); + connect (powerValBrightness, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(configChanged())); xl->addWidget(powerValBrightness); - xl->addWidget(new QLabel("+", wp)); + xl->addWidget(new TQLabel("+", wp)); xl->addStretch(1); } if (has_performance) { - powerPerformance = new QCheckBox(i18n("System performance"), powerBox); - QToolTip::add( powerPerformance, i18n( "Causes the performance profile to be changed" ) ); + powerPerformance = new TQCheckBox(i18n("System performance"), powerBox); + TQToolTip::add( powerPerformance, i18n( "Causes the performance profile to be changed" ) ); - QWidget *wp = new QWidget(powerBox); - QHBoxLayout *xl = new QHBoxLayout( wp); + TQWidget *wp = new TQWidget(powerBox); + TQHBoxLayout *xl = new TQHBoxLayout( wp); powerValPerformance = new KComboBox(0, wp); - QToolTip::add( powerValPerformance, i18n( "The performance profile to switch to" ) ); + TQToolTip::add( powerValPerformance, i18n( "The performance profile to switch to" ) ); powerValPerformance->insertStringList(performance_list); powerValPerformance->setEnabled(0); - connect (powerValPerformance, SIGNAL(activated(int)), this, SLOT(configChanged())); + connect (powerValPerformance, TQT_SIGNAL(activated(int)), this, TQT_SLOT(configChanged())); xl->addWidget(powerValPerformance); xl->addStretch(1); } if (has_throttle) { - powerThrottle = new QCheckBox(i18n("CPU throttle"), powerBox); - QToolTip::add( powerThrottle, i18n( "Causes the CPU to be throttled back" ) ); + powerThrottle = new TQCheckBox(i18n("CPU throttle"), powerBox); + TQToolTip::add( powerThrottle, i18n( "Causes the CPU to be throttled back" ) ); - QWidget *wp = new QWidget(powerBox); - QHBoxLayout *xl = new QHBoxLayout( wp); + TQWidget *wp = new TQWidget(powerBox); + TQHBoxLayout *xl = new TQHBoxLayout( wp); powerValThrottle = new KComboBox(0, wp); - QToolTip::add( powerValThrottle, i18n( "How much to throttle back the CPU" ) ); + TQToolTip::add( powerValThrottle, i18n( "How much to throttle back the CPU" ) ); powerValThrottle->insertStringList(throttle_list); powerValThrottle->setEnabled(0); - connect (powerValThrottle, SIGNAL(activated(int)), this, SLOT(configChanged())); + connect (powerValThrottle, TQT_SIGNAL(activated(int)), this, TQT_SLOT(configChanged())); xl->addWidget(powerValThrottle); xl->addStretch(1); } - connect(powerBox, SIGNAL(clicked(int)), this, SLOT(configChanged())); + connect(powerBox, TQT_SIGNAL(clicked(int)), this, TQT_SLOT(configChanged())); } hlay->addStretch(1); - QLabel* explain = new QLabel(i18n("This panel enables actions that are triggered when the lid closure switch " + TQLabel* explain = new TQLabel(i18n("This panel enables actions that are triggered when the lid closure switch " "or power switch on your laptop is pressed. Some laptops may already " "automatically do things like this, if you cannot disable them in your BIOS " "you probably should not enable anything in this panel."), this); @@ -278,7 +278,7 @@ ButtonsConfig::ButtonsConfig (QWidget * parent, const char *name) top_layout->addStretch(1); - top_layout->addWidget( new QLabel( i18n("Version: %1").arg(LAPTOP_VERSION), this ), 0, Qt::AlignRight ); + top_layout->addWidget( new TQLabel( i18n("Version: %1").arg(LAPTOP_VERSION), this ), 0, Qt::AlignRight ); } } @@ -609,7 +609,7 @@ void ButtonsConfig::configChanged() } -QString ButtonsConfig::quickHelp() const +TQString ButtonsConfig::quickHelp() const { return i18n("<h1>Laptop Power Control</h1>This module allows you to " "configure the power switch or lid closure switch on your laptop " diff --git a/klaptopdaemon/buttons.h b/klaptopdaemon/buttons.h index 5abd088..f142a58 100644 --- a/klaptopdaemon/buttons.h +++ b/klaptopdaemon/buttons.h @@ -26,7 +26,7 @@ #define __BUTTONSCONFIG_H__ #include <kcmodule.h> -#include <qstring.h> +#include <tqstring.h> class QWidget; class QSlider; @@ -41,14 +41,14 @@ class ButtonsConfig : public KCModule { Q_OBJECT public: - ButtonsConfig( QWidget *parent=0, const char* name=0); + ButtonsConfig( TQWidget *parent=0, const char* name=0); ~ButtonsConfig(); void save( void ); void load(); void load(bool useDefaults); void defaults(); - virtual QString quickHelp() const; + virtual TQString quickHelp() const; private slots: @@ -61,28 +61,28 @@ private: int getLid(); void setPower( int, int ); - QButtonGroup *lidBox; - QRadioButton *lidStandby, *lidSuspend, *lidOff, *lidHibernate, *lidShutdown, *lidLogout; - QCheckBox *lidBrightness; - QSlider *lidValBrightness; - QCheckBox *lidThrottle; + TQButtonGroup *lidBox; + TQRadioButton *lidStandby, *lidSuspend, *lidOff, *lidHibernate, *lidShutdown, *lidLogout; + TQCheckBox *lidBrightness; + TQSlider *lidValBrightness; + TQCheckBox *lidThrottle; KComboBox *lidValThrottle; - QCheckBox *lidPerformance; + TQCheckBox *lidPerformance; KComboBox *lidValPerformance; - QButtonGroup *powerBox; - QRadioButton *powerStandby, *powerSuspend, *powerOff, *powerHibernate, *powerShutdown, *powerLogout; - QCheckBox *powerBrightness; - QSlider *powerValBrightness; - QCheckBox *powerThrottle; + TQButtonGroup *powerBox; + TQRadioButton *powerStandby, *powerSuspend, *powerOff, *powerHibernate, *powerShutdown, *powerLogout; + TQCheckBox *powerBrightness; + TQSlider *powerValBrightness; + TQCheckBox *powerThrottle; KComboBox *powerValThrottle; - QCheckBox *powerPerformance; + TQCheckBox *powerPerformance; KComboBox *powerValPerformance; int power_bright_val, lid_bright_val; bool lid_bright_enabled, power_bright_enabled; bool lid_throttle_enabled, power_throttle_enabled; - QString lid_throttle_val, power_throttle_val; + TQString lid_throttle_val, power_throttle_val; bool lid_performance_enabled, power_performance_enabled; - QString lid_performance_val, power_performance_val; + TQString lid_performance_val, power_performance_val; KConfig *config; int power, lid, apm; diff --git a/klaptopdaemon/daemon_state.cpp b/klaptopdaemon/daemon_state.cpp index 5ca0d28..49d4ade 100644 --- a/klaptopdaemon/daemon_state.cpp +++ b/klaptopdaemon/daemon_state.cpp @@ -29,7 +29,7 @@ #include <stdlib.h> #include <fcntl.h> -#include <qtimer.h> +#include <tqtimer.h> #include <kconfig.h> #include <klocale.h> @@ -41,8 +41,8 @@ #include <sys/ioctl.h> #include <kmessagebox.h> #include <dcopclient.h> -#include <qsocketnotifier.h> -#include <qcursor.h> +#include <tqsocketnotifier.h> +#include <tqcursor.h> #include <unistd.h> @@ -52,11 +52,11 @@ daemon_state::daemon_state() { exists = laptop_portable::has_power_management(); has_brightness = laptop_portable::has_brightness(); - QStringList profile_list; + TQStringList profile_list; int current_profile; bool *active_list; has_performance = laptop_portable::get_system_performance(0, current_profile, profile_list, active_list); - QStringList throttle_list; + TQStringList throttle_list; int current_throttle; has_throttle = laptop_portable::get_system_throttling(0, current_throttle, throttle_list, active_list); @@ -96,11 +96,11 @@ void daemon_state::load() exists = laptop_portable::has_power_management(); has_brightness = laptop_portable::has_brightness(); - QStringList profile_list; + TQStringList profile_list; int current_profile; bool *active_list; has_performance = laptop_portable::get_system_performance(0, current_profile, profile_list, active_list); - QStringList throttle_list; + TQStringList throttle_list; int current_throttle; has_throttle = laptop_portable::get_system_throttling(0, current_throttle, throttle_list, active_list); diff --git a/klaptopdaemon/daemon_state.h b/klaptopdaemon/daemon_state.h index 6da4e73..3a0e4b3 100644 --- a/klaptopdaemon/daemon_state.h +++ b/klaptopdaemon/daemon_state.h @@ -22,13 +22,13 @@ */ -#include <qdir.h> +#include <tqdir.h> #include <unistd.h> #include <time.h> -#include <qmovie.h> -#include <qptrlist.h> -#include <qfileinfo.h> -#include <qimage.h> +#include <tqmovie.h> +#include <tqptrlist.h> +#include <tqfileinfo.h> +#include <tqimage.h> #include <kdelibs_export.h> class KDE_EXPORT daemon_state @@ -44,9 +44,9 @@ public: bool has_performance; bool has_throttle; - QString noBatteryIcon; - QString chargeIcon; - QString noChargeIcon; + TQString noBatteryIcon; + TQString chargeIcon; + TQString noChargeIcon; // // power out actions @@ -71,9 +71,9 @@ public: bool logout[2]; bool shutdown[2]; bool runCommand[2]; - QString runCommandPath[2]; + TQString runCommandPath[2]; bool playSound[2]; - QString playSoundPath[2]; + TQString playSoundPath[2]; bool notify[2]; bool do_suspend[2]; bool do_hibernate[2]; @@ -112,12 +112,12 @@ public: // performance bool performance_pon, performance_poff; - QString performance_val_on, performance_val_off; + TQString performance_val_on, performance_val_off; // throttle bool throttle_pon, throttle_poff; - QString throttle_val_on, throttle_val_off; + TQString throttle_val_on, throttle_val_off; // button triggered stuff int button_lid; @@ -128,12 +128,12 @@ public: int button_power_bright_val; bool button_lid_performance_enabled; bool button_power_performance_enabled; - QString button_lid_performance_val; - QString button_power_performance_val; + TQString button_lid_performance_val; + TQString button_power_performance_val; bool button_lid_throttle_enabled; bool button_power_throttle_enabled; - QString button_lid_throttle_val; - QString button_power_throttle_val; + TQString button_lid_throttle_val; + TQString button_power_throttle_val; bool enable_lid_button; bool enable_power_button; diff --git a/klaptopdaemon/daemondock.cpp b/klaptopdaemon/daemondock.cpp index fb1336a..a49f312 100644 --- a/klaptopdaemon/daemondock.cpp +++ b/klaptopdaemon/daemondock.cpp @@ -24,9 +24,9 @@ #include <stdio.h> #include <stdlib.h> -#include <qcursor.h> +#include <tqcursor.h> -#include <qslider.h> +#include <tqslider.h> #include <klocale.h> #include <kpopupmenu.h> #include <dcopclient.h> @@ -41,10 +41,10 @@ #include <kconfig.h> #include <kglobalsettings.h> #include <kmessagebox.h> -#include <qvbox.h> -#include <qstringlist.h> -#include <qbitmap.h> -#include <qpainter.h> +#include <tqvbox.h> +#include <tqstringlist.h> +#include <tqbitmap.h> +#include <tqpainter.h> #include <kiconeffect.h> extern void wake_laptop_daemon(); @@ -73,48 +73,48 @@ laptop_dock::SetupPopup() int can_standby = laptop_portable::has_standby(); int can_suspend = laptop_portable::has_suspend(); int can_hibernate = laptop_portable::has_hibernation(); - QStringList profile_list; + TQStringList profile_list; int current_profile; bool *active_list; bool has_performance = laptop_portable::get_system_performance(0, current_profile, profile_list, active_list); - QStringList throttle_list; + TQStringList throttle_list; int current_throttle; bool has_throttle = laptop_portable::get_system_throttling(0, current_throttle, throttle_list, active_list); - rightPopup->insertItem(SmallIcon("configure"), i18n("&Configure KLaptop..."), this, SLOT(invokeSetup())); + rightPopup->insertItem(SmallIcon("configure"), i18n("&Configure KLaptop..."), this, TQT_SLOT(invokeSetup())); if (has_brightness) - rightPopup->insertItem(i18n("Screen Brightness..."), this, SLOT(invokeBrightness())); + rightPopup->insertItem(i18n("Screen Brightness..."), this, TQT_SLOT(invokeBrightness())); if (has_performance) { - performance_popup = new QPopupMenu(0, "performance"); + performance_popup = new TQPopupMenu(0, "performance"); performance_popup->setCheckable(1); rightPopup->insertItem(i18n("Performance Profile..."), performance_popup); - connect( performance_popup, SIGNAL( activated( int ) ), this, SLOT( activate_performance( int ) ) ); - connect( performance_popup, SIGNAL( aboutToShow() ), this, SLOT( fill_performance() ) ); + connect( performance_popup, TQT_SIGNAL( activated( int ) ), this, TQT_SLOT( activate_performance( int ) ) ); + connect( performance_popup, TQT_SIGNAL( aboutToShow() ), this, TQT_SLOT( fill_performance() ) ); } else { performance_popup = 0; } if (has_throttle) { - throttle_popup = new QPopupMenu(0, "throttle"); + throttle_popup = new TQPopupMenu(0, "throttle"); throttle_popup->setCheckable(1); rightPopup->insertItem(i18n("CPU Throttling..."), throttle_popup); - connect( throttle_popup, SIGNAL( activated( int ) ), this, SLOT( activate_throttle( int ) ) ); - connect( throttle_popup, SIGNAL( aboutToShow() ), this, SLOT( fill_throttle() ) ); + connect( throttle_popup, TQT_SIGNAL( activated( int ) ), this, TQT_SLOT( activate_throttle( int ) ) ); + connect( throttle_popup, TQT_SIGNAL( aboutToShow() ), this, TQT_SLOT( fill_throttle() ) ); } else { throttle_popup = 0; } if (can_standby || can_suspend || can_hibernate) { rightPopup->insertSeparator(); - if (can_standby) rightPopup->insertItem(i18n("Standby..."), this, SLOT(invokeStandby())); - // if (can_suspend) rightPopup->insertItem(i18n("&Lock && Suspend..."), this, SLOT(invokeLockSuspend())); - if (can_suspend) rightPopup->insertItem(i18n("&Suspend..."), this, SLOT(invokeLockSuspend())); - // if (can_hibernate) rightPopup->insertItem(i18n("&Lock && Hibernate..."), this, SLOT(invokeLockHibernation())); - if (can_hibernate) rightPopup->insertItem(i18n("&Hibernate..."), this, SLOT(invokeLockHibernation())); + if (can_standby) rightPopup->insertItem(i18n("Standby..."), this, TQT_SLOT(invokeStandby())); + // if (can_suspend) rightPopup->insertItem(i18n("&Lock && Suspend..."), this, TQT_SLOT(invokeLockSuspend())); + if (can_suspend) rightPopup->insertItem(i18n("&Suspend..."), this, TQT_SLOT(invokeLockSuspend())); + // if (can_hibernate) rightPopup->insertItem(i18n("&Lock && Hibernate..."), this, TQT_SLOT(invokeLockHibernation())); + if (can_hibernate) rightPopup->insertItem(i18n("&Hibernate..."), this, TQT_SLOT(invokeLockHibernation())); } rightPopup->insertSeparator(); - rightPopup->insertItem(i18n("&Hide Monitor"), this, SLOT(slotHide())); - rightPopup->insertItem(SmallIcon("exit"), KStdGuiItem::quit().text(), this, SLOT(slotQuit())); + rightPopup->insertItem(i18n("&Hide Monitor"), this, TQT_SLOT(slotHide())); + rightPopup->insertItem(SmallIcon("exit"), KStdGuiItem::quit().text(), this, TQT_SLOT(slotQuit())); } laptop_dock::~laptop_dock() @@ -139,13 +139,13 @@ laptop_dock::fill_throttle() { throttle_popup->clear(); int current; - QStringList list; + TQStringList list; bool *active_list; bool has_throttle = laptop_portable::get_system_throttling(1, current, list, active_list); if (!has_throttle && !list.empty()) return; int n=0; - for (QValueListIterator<QString> i = list.begin();i != list.end();i++) { + for (TQValueListIterator<TQString> i = list.begin();i != list.end();i++) { throttle_popup->insertItem(*i, n); throttle_popup->setItemEnabled(n, active_list[n]); n++; @@ -164,13 +164,13 @@ laptop_dock::fill_performance() { performance_popup->clear(); int current; - QStringList list; + TQStringList list; bool *active_list; bool has_performance = laptop_portable::get_system_performance(1, current, list, active_list); if (!has_performance && !list.empty()) return; int n=0; - for (QValueListIterator<QString> i = list.begin();i != list.end();i++) { + for (TQValueListIterator<TQString> i = list.begin();i != list.end();i++) { performance_popup->insertItem(*i, n); performance_popup->setItemEnabled(n, active_list[n]); n++; @@ -195,24 +195,24 @@ laptop_dock::invokeBrightness() brightness = 255; if (brightness_widget == 0) { - brightness_widget = new QVBox(0L, "Brightness", WStyle_Customize | WType_Popup); - brightness_widget->setFrameStyle(QFrame::PopupPanel); + brightness_widget = new TQVBox(0L, "Brightness", WStyle_Customize | WType_Popup); + brightness_widget->setFrameStyle(TQFrame::PopupPanel); brightness_widget->setMargin(KDialog::marginHint()); - brightness_slider = new QSlider(0, 255, 16, 255-brightness, Qt::Vertical, brightness_widget, 0); + brightness_slider = new TQSlider(0, 255, 16, 255-brightness, Qt::Vertical, brightness_widget, 0); brightness_slider->setMinimumHeight(40); brightness_slider->setMinimumWidth(15); - connect(brightness_slider, SIGNAL(valueChanged(int)), this, SLOT(invokeBrightnessSlider(int))); + connect(brightness_slider, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(invokeBrightnessSlider(int))); brightness_widget->resize(brightness_widget->sizeHint()); } else { brightness_slider->setValue(255-brightness); } if (!brightness_widget->isVisible()) { - QRect desktop = KGlobalSettings::desktopGeometry(this); + TQRect desktop = KGlobalSettings::desktopGeometry(this); int sw = desktop.width(); int sh = desktop.height(); int sx = desktop.x(); int sy = desktop.y(); - QPoint pos = QCursor::pos(); + TQPoint pos = TQCursor::pos(); int x = pos.x(); int y = pos.y(); y -= brightness_widget->geometry().height(); @@ -233,7 +233,7 @@ laptop_dock::invokeBrightness() void laptop_dock::slotGoRoot(int /*id*/) { #ifdef NOTDEF - QString kdesu = KStandardDirs::findExe("kdesu"); + TQString kdesu = KStandardDirs::findExe("kdesu"); if (!kdesu.isEmpty()) { int rc = KMessageBox::warningContinueCancel(0, i18n("You will need to supply a root password " @@ -251,8 +251,8 @@ void laptop_dock::slotGoRoot(int /*id*/) { *_rootProcess << "root"; //*_rootProcess << "--nonewdcop"; *_rootProcess << KStandardDirs::findExe("klaptopdaemon"); - connect(_rootProcess, SIGNAL(processExited(KProcess*)), - this, SLOT(rootExited(KProcess*))); + connect(_rootProcess, TQT_SIGNAL(processExited(KProcess*)), + this, TQT_SLOT(rootExited(KProcess*))); _rootProcess->start(KProcess::NotifyOnExit); // We should disable this menu item here now. } @@ -268,7 +268,7 @@ void laptop_dock::slotGoRoot(int /*id*/) { void laptop_dock::slotHide() { - int confirm = KMessageBox::questionYesNo(0, i18n("Are you sure you want to hide the battery monitor? Your battery will still be monitored in the background."), QString::null, i18n("Hide Monitor"), i18n("Do Not Hide"), "hideConfirm"); + int confirm = KMessageBox::questionYesNo(0, i18n("Are you sure you want to hide the battery monitor? Your battery will still be monitored in the background."), TQString::null, i18n("Hide Monitor"), i18n("Do Not Hide"), "hideConfirm"); if (confirm != KMessageBox::Yes) return; @@ -286,12 +286,12 @@ void laptop_dock::slotHide() { void laptop_dock::slotQuit() { - int confirm = KMessageBox::questionYesNo(0, i18n("Are you sure you want to quit the battery monitor?"), QString::null, KStdGuiItem::quit(), KStdGuiItem::cancel(), "quitConfirm"); + int confirm = KMessageBox::questionYesNo(0, i18n("Are you sure you want to quit the battery monitor?"), TQString::null, KStdGuiItem::quit(), KStdGuiItem::cancel(), "quitConfirm"); if (confirm != KMessageBox::Yes) return; - confirm = KMessageBox::questionYesNo(0, i18n("Do you wish to disable the battery monitor from starting in the future?"), QString::null, i18n("Disable"), i18n("Keep Enabled"), "restartMonitor"); + confirm = KMessageBox::questionYesNo(0, i18n("Do you wish to disable the battery monitor from starting in the future?"), TQString::null, i18n("Disable"), i18n("Keep Enabled"), "restartMonitor"); if (confirm == KMessageBox::Yes) { // just tell ourselves to hide the battery @@ -360,19 +360,19 @@ KPCMCIAInfo *f = new KPCMCIAInfo(_pcmcia); f->showTab(_displayActions[id]->num()); } -void laptop_dock::mousePressEvent( QMouseEvent *event ) +void laptop_dock::mousePressEvent( TQMouseEvent *event ) { if(event->button() == LeftButton) { - QPopupMenu *popup = new QPopupMenu(0, "popup"); + TQPopupMenu *popup = new TQPopupMenu(0, "popup"); if (!pdaemon->exists()) { popup->insertItem(i18n("Power Manager Not Found")); } else { - QString tmp; + TQString tmp; if (pdaemon->val >= 0) { if (pdaemon->left >= 0) { - QString num3; + TQString num3; num3.setNum(pdaemon->left%60); num3 = num3.rightJustify(2, '0'); tmp = i18n("%1:%2 hours left").arg(pdaemon->left/60).arg(num3); @@ -399,7 +399,7 @@ void laptop_dock::mousePressEvent( QMouseEvent *event ) * - show the cpu profile and current frequency */ if (laptop_portable::has_cpufreq()) { - QString speed = laptop_portable::cpu_frequency(); + TQString speed = laptop_portable::cpu_frequency(); if (!speed.isEmpty()) { popup->insertSeparator(); popup->insertItem(i18n("CPU: %1").arg(speed)); @@ -410,7 +410,7 @@ void laptop_dock::mousePressEvent( QMouseEvent *event ) * ADD the PCMCIA entries here */ if (_pcmcia && _pcmcia->haveCardServices()) { - QString slotname = i18n("Slot %1"); // up here so we only construct it once + TQString slotname = i18n("Slot %1"); // up here so we only construct it once int id; popup->insertSeparator(); _ejectActions.clear(); @@ -419,30 +419,30 @@ void laptop_dock::mousePressEvent( QMouseEvent *event ) _suspendActions.clear(); _resumeActions.clear(); _displayActions.clear(); - id = popup->insertItem(i18n("Card Slots..."), this, SLOT(slotDisplayAction(int))); + id = popup->insertItem(i18n("Card Slots..."), this, TQT_SLOT(slotDisplayAction(int))); _displayActions.insert(id, _pcmcia->getCard(0)); for (int i = 0; i < _pcmcia->getCardCount(); i++) { KPCMCIACard *thiscard; thiscard = _pcmcia->getCard(i); if (thiscard && (thiscard->present())) { - QPopupMenu *thisSub = new QPopupMenu(popup, thiscard->name().latin1()); - id = thisSub->insertItem(i18n("Details..."), this, SLOT(slotDisplayAction(int))); + TQPopupMenu *thisSub = new TQPopupMenu(popup, thiscard->name().latin1()); + id = thisSub->insertItem(i18n("Details..."), this, TQT_SLOT(slotDisplayAction(int))); _displayActions.insert(id, thiscard); // add the actions - QPopupMenu *actionsSub = new QPopupMenu(thisSub, "actions"); - id = actionsSub->insertItem(i18n("Eject"), this, SLOT(slotEjectAction(int))); + TQPopupMenu *actionsSub = new TQPopupMenu(thisSub, "actions"); + id = actionsSub->insertItem(i18n("Eject"), this, TQT_SLOT(slotEjectAction(int))); actionsSub->setItemEnabled(id, !(thiscard->status() & CARD_STATUS_BUSY)); _ejectActions.insert(id, thiscard); - id = actionsSub->insertItem(i18n("Suspend"), this, SLOT(slotSuspendAction(int))); + id = actionsSub->insertItem(i18n("Suspend"), this, TQT_SLOT(slotSuspendAction(int))); actionsSub->setItemEnabled(id, !(thiscard->status() & (CARD_STATUS_SUSPEND|CARD_STATUS_BUSY))); _suspendActions.insert(id, thiscard); - id = actionsSub->insertItem(i18n("Resume"), this, SLOT(slotResumeAction(int))); + id = actionsSub->insertItem(i18n("Resume"), this, TQT_SLOT(slotResumeAction(int))); actionsSub->setItemEnabled(id, (thiscard->status() & CARD_STATUS_SUSPEND)); _resumeActions.insert(id, thiscard); - id = actionsSub->insertItem(i18n("Reset"), this, SLOT(slotResetAction(int))); + id = actionsSub->insertItem(i18n("Reset"), this, TQT_SLOT(slotResetAction(int))); _resetActions.insert(id, thiscard); - id = actionsSub->insertItem(i18n("Insert"), this, SLOT(slotInsertAction(int))); + id = actionsSub->insertItem(i18n("Insert"), this, TQT_SLOT(slotInsertAction(int))); _insertActions.insert(id, thiscard); actionsSub->setItemEnabled(id, !(thiscard->status() & (CARD_STATUS_READY|CARD_STATUS_SUSPEND))); thisSub->insertItem(i18n("Actions"), actionsSub); @@ -463,11 +463,11 @@ void laptop_dock::mousePressEvent( QMouseEvent *event ) popup->insertItem(i18n("Enable PCMCIA")); } - popup->popup(QCursor::pos()); + popup->popup(TQCursor::pos()); } } -void laptop_dock::mouseReleaseEvent( QMouseEvent *e ) +void laptop_dock::mouseReleaseEvent( TQMouseEvent *e ) { if ( !rect().contains( e->pos() ) ) return; @@ -489,7 +489,7 @@ void laptop_dock::mouseReleaseEvent( QMouseEvent *e ) break; } } -void laptop_dock::showEvent( QShowEvent * ) +void laptop_dock::showEvent( TQShowEvent * ) { } @@ -537,7 +537,7 @@ laptop_dock::reload_icon() { // we will try to deduce the pixmap (or gif) name now. it will // vary depending on the dock and power - QString pixmap_name; + TQString pixmap_name; if (!pdaemon->exists()) pixmap_name = pdaemon->noBatteryIcon(); @@ -567,9 +567,9 @@ void laptop_dock::displayPixmap() // at this point, we have the file to display. so display it - QImage image = pm.convertToImage(); - const QBitmap *bmmask = pm.mask(); - QImage mask; + TQImage image = pm.convertToImage(); + const TQBitmap *bmmask = pm.mask(); + TQImage mask; if (bmmask) mask = bmmask->convertToImage(); @@ -623,8 +623,8 @@ void laptop_dock::displayPixmap() } quit: - QString tmp; - QString levelString; + TQString tmp; + TQString levelString; if (!pdaemon->exists()) { tmp = i18n("Laptop power management not available"); @@ -637,7 +637,7 @@ quit: } else if (pdaemon->val >= 0) { levelString.sprintf ("%i%%", pdaemon->val); if (pdaemon->left >= 0) { - QString num3; + TQString num3; num3.setNum(pdaemon->left%60); num3 = num3.rightJustify(2, '0'); tmp = i18n("Plugged in - %1% charged (%2:%3 hours left)") @@ -654,7 +654,7 @@ quit: if (pdaemon->val >= 0) { levelString.sprintf ("%i%%", pdaemon->val); if (pdaemon->left >= 0) { - QString num3; + TQString num3; num3.setNum(pdaemon->left%60); num3 = num3.rightJustify(2, '0'); tmp = i18n("Running on batteries - %1% charged (%2:%3 hours left)") @@ -690,13 +690,13 @@ quit: int oldPixmapWidth = image.size().width(); int oldPixmapHeight = image.size().height(); - QFont percentageFont = KGlobalSettings::generalFont(); + TQFont percentageFont = KGlobalSettings::generalFont(); percentageFont.setBold(true); // decrease the size of the font for the number of unread messages if the // number doesn't fit into the available space float percentageFontSize = percentageFont.pointSizeFloat(); - QFontMetrics qfm( percentageFont ); + TQFontMetrics qfm( percentageFont ); int width = qfm.width( levelString ); if( width > oldPixmapWidth ) { @@ -710,38 +710,38 @@ quit: // reason text that is drawn on a transparent pixmap is invisible // (apparently the alpha channel isn't changed when the text is drawn). // Therefore I have to draw the text on a solid background and then remove - // the background by making it transparent with QPixmap::setMask. This + // the background by making it transparent with TQPixmap::setMask. This // involves the slow createHeuristicMask() function (from the API docs: - // "This function is slow because it involves transformation to a QImage, - // non-trivial computations and a transformation back to a QBitmap."). Then - // I have to convert the resulting QPixmap to a QImage in order to overlay + // "This function is slow because it involves transformation to a TQImage, + // non-trivial computations and a transformation back to a TQBitmap."). Then + // I have to convert the resulting TQPixmap to a TQImage in order to overlay // the light KMail icon with the number (because KIconEffect::overlay only - // works with QImage). Finally the resulting QImage has to be converted - // back to a QPixmap. + // works with TQImage). Finally the resulting TQImage has to be converted + // back to a TQPixmap. // That's a lot of work for overlaying the KMail icon with the number of // unread messages, but every other approach I tried failed miserably. // IK, 2003-09-22 - QPixmap percentagePixmap( oldPixmapWidth, oldPixmapHeight ); + TQPixmap percentagePixmap( oldPixmapWidth, oldPixmapHeight ); percentagePixmap.fill( Qt::white ); - QPainter p( &percentagePixmap ); + TQPainter p( &percentagePixmap ); p.setFont( percentageFont ); p.setPen( Qt::black ); p.drawText( percentagePixmap.rect(), Qt::AlignCenter, levelString ); percentagePixmap.setMask( percentagePixmap.createHeuristicMask() ); - QImage percentageImage = percentagePixmap.convertToImage(); + TQImage percentageImage = percentagePixmap.convertToImage(); // Overlay the light KMail icon with the number image - QImage iconWithPercentageImage = image.copy(); + TQImage iconWithPercentageImage = image.copy(); KIconEffect::overlay( iconWithPercentageImage, percentageImage ); - QPixmap iconWithPercentage; + TQPixmap iconWithPercentage; iconWithPercentage.convertFromImage( iconWithPercentageImage ); setPixmap( iconWithPercentage ); } else { - QPixmap q; + TQPixmap q; q.convertFromImage(image); if (bmmask) q.setMask(*bmmask); @@ -749,7 +749,7 @@ quit: } adjustSize(); - QToolTip::add(this, tmp); + TQToolTip::add(this, tmp); } #include "daemondock.moc" diff --git a/klaptopdaemon/daemondock.h b/klaptopdaemon/daemondock.h index 7577ffd..8064886 100644 --- a/klaptopdaemon/daemondock.h +++ b/klaptopdaemon/daemondock.h @@ -36,7 +36,7 @@ class QVBox; class QSlider; class KPopupMenu; -#include <qmap.h> +#include <tqmap.h> class laptop_dock : public KSystemTray { @@ -47,9 +47,9 @@ public: ~laptop_dock(); void displayPixmap(); - void mousePressEvent( QMouseEvent * ); - void mouseReleaseEvent( QMouseEvent * ); - void showEvent( QShowEvent * ); + void mousePressEvent( TQMouseEvent * ); + void mouseReleaseEvent( TQMouseEvent * ); + void showEvent( TQShowEvent * ); void reload_icon(); inline void setPCMCIA(KPCMCIA *p) { _pcmcia = p; } @@ -86,14 +86,14 @@ private slots: private: int brightness; - QVBox *brightness_widget; - QSlider *brightness_slider; + TQVBox *brightness_widget; + TQSlider *brightness_slider; laptop_daemon *pdaemon; QPixmap pm; QPopupMenu *performance_popup, *throttle_popup; int current_code; KPCMCIA *_pcmcia; - QMap<int,KPCMCIACard *> _ejectActions, + TQMap<int,KPCMCIACard *> _ejectActions, _suspendActions, _resumeActions, _resetActions, diff --git a/klaptopdaemon/kpcmcia.cpp b/klaptopdaemon/kpcmcia.cpp index 9dec605..50d7b4c 100644 --- a/klaptopdaemon/kpcmcia.cpp +++ b/klaptopdaemon/kpcmcia.cpp @@ -23,9 +23,9 @@ * kardinfo Copyright 1999, Mirko Sucker <mirko.sucker@unibw-hamburg.de> */ -#include <qtimer.h> -#include <qfile.h> -#include <qregexp.h> +#include <tqtimer.h> +#include <tqfile.h> +#include <tqregexp.h> #include <klocale.h> #include <kinstance.h> @@ -169,13 +169,13 @@ tv.tv_sec = 0; tv.tv_usec = 0; * Read in the stab file. */ if (!stat(_stabPath.latin1(), &sb) && sb.st_mtime >= _last) { - QFile f(_stabPath.latin1()); + TQFile f(_stabPath.latin1()); if (f.open(IO_ReadOnly)) { - QTextStream ts(&f); + TQTextStream ts(&f); bool foundit = false; - QString _thisreg = "^Socket %1: "; - QRegExp thisreg ( _thisreg.arg(_num) ); + TQString _thisreg = "^Socket %1: "; + TQRegExp thisreg ( _thisreg.arg(_num) ); if (flock(f.handle(), LOCK_SH)) return updated; @@ -183,7 +183,7 @@ tv.tv_sec = 0; tv.tv_usec = 0; // find the card while(!foundit) { - QString s; + TQString s; if (ts.eof()) break; s = ts.readLine(); if (s.contains(thisreg)) { @@ -196,27 +196,27 @@ tv.tv_sec = 0; tv.tv_usec = 0; // read it in if (foundit && !ts.eof()) { // FIXME: ts.eof() is a bad error!! - QString s = ts.readLine(); + TQString s = ts.readLine(); int end; s.simplifyWhiteSpace(); - end = s.find(QRegExp("[ \r\t\n]")); + end = s.find(TQRegExp("[ \r\t\n]")); s = s.remove(0, end+1); - end = s.find(QRegExp("[ \r\t\n]")); + end = s.find(TQRegExp("[ \r\t\n]")); _type = s; _type.truncate(end); s = s.remove(0, end+1); - end = s.find(QRegExp("[ \r\t\n]")); + end = s.find(TQRegExp("[ \r\t\n]")); _module = s; _module.truncate(end); s = s.remove(0, end+1); - end = s.find(QRegExp("[ \r\t\n]")); + end = s.find(TQRegExp("[ \r\t\n]")); s = s.remove(0, end+1); - end = s.find(QRegExp("[ \r\t\n]")); + end = s.find(TQRegExp("[ \r\t\n]")); _device = s; _device.truncate(end); s = s.remove(0, end+1); @@ -366,9 +366,9 @@ KPCMCIA::KPCMCIA(int maxSlots, const char *stabpath) : _maxSlots(maxSlots), _refreshSpeed = 750; _haveCardServices = false; -_timer = new QTimer(this); -connect(_timer, SIGNAL(timeout()), this, SLOT(updateCardInfo())); -_cards = new QMemArray<KPCMCIACard *>(_maxSlots+1); +_timer = new TQTimer(this); +connect(_timer, TQT_SIGNAL(timeout()), this, TQT_SLOT(updateCardInfo())); +_cards = new TQMemArray<KPCMCIACard *>(_maxSlots+1); _cardCnt = 0; @@ -496,19 +496,19 @@ bool KPCMCIA::haveCardServices() { #ifdef __linux__ static int lookupDevice(const char *x) { -QFile df("/proc/devices"); -QString thisreg; +TQFile df("/proc/devices"); +TQString thisreg; thisreg = "^[0-9]+ %1$"; thisreg = thisreg.arg(x); if (df.open(IO_ReadOnly)) { - QTextStream t(&df); - QString s; + TQTextStream t(&df); + TQString s; while (!t.eof()) { s = t.readLine(); - if (s.contains(QRegExp(thisreg))) { + if (s.contains(TQRegExp(thisreg))) { int n = (s.left(3).stripWhiteSpace()).toInt(); df.close(); return n; @@ -520,8 +520,8 @@ return -1; } static int openDevice(dev_t dev) { -QString tmp_path = locateLocal("tmp", KGlobal::instance()->instanceName()); -QString ext = "_socket%1"; +TQString tmp_path = locateLocal("tmp", KGlobal::instance()->instanceName()); +TQString ext = "_socket%1"; tmp_path += ext.arg((int)dev); diff --git a/klaptopdaemon/kpcmcia.h b/klaptopdaemon/kpcmcia.h index c821926..4e55ca6 100644 --- a/klaptopdaemon/kpcmcia.h +++ b/klaptopdaemon/kpcmcia.h @@ -25,7 +25,7 @@ class QTimer; class KPCMCIA; -#include <qmemarray.h> +#include <tqmemarray.h> #include <sys/types.h> @@ -45,12 +45,12 @@ protected: int _fd; int _interrupt; - QString _device, _ports; - QString _module; - QString _cardname; - QString _type; + TQString _device, _ports; + TQString _module; + TQString _cardname; + TQString _type; int _vcc, _vpp, _vpp2; - QString _stabPath; + TQString _stabPath; int _iotype; int _inttype; int _cfgbase; @@ -141,27 +141,27 @@ public: /** * Return the card name */ - inline QString& name() { return _cardname; } + inline TQString& name() { return _cardname; } /** * Return the port range */ - inline QString& ports() { return _ports; } + inline TQString& ports() { return _ports; } /** * Return the device name */ - inline QString& device() { return _device; } + inline TQString& device() { return _device; } /** * Return the device type (ie network, modem, etc) */ - inline QString& type() { return _type; } + inline TQString& type() { return _type; } /** * Return the driver (module) name */ - inline QString& driver() { return _module; } + inline TQString& driver() { return _module; } /** * Refresh the card information - return < 0 on error. @@ -176,7 +176,7 @@ private: -class KPCMCIA : public QObject { +class KPCMCIA : public TQObject { Q_OBJECT public: @@ -198,12 +198,12 @@ public slots: private: int _refreshSpeed; - QTimer *_timer; - QMemArray<KPCMCIACard *> *_cards; + TQTimer *_timer; + TQMemArray<KPCMCIACard *> *_cards; int _cardCnt; bool _haveCardServices; int _maxSlots; - QString _stabPath; + TQString _stabPath; }; diff --git a/klaptopdaemon/kpcmciainfo.cpp b/klaptopdaemon/kpcmciainfo.cpp index 82da914..3e91f2d 100644 --- a/klaptopdaemon/kpcmciainfo.cpp +++ b/klaptopdaemon/kpcmciainfo.cpp @@ -21,9 +21,9 @@ -#include <qtabwidget.h> -#include <qlayout.h> -#include <qtimer.h> +#include <tqtabwidget.h> +#include <tqlayout.h> +#include <tqtimer.h> #include <kstatusbar.h> #include <klocale.h> #include <kpushbutton.h> @@ -36,14 +36,14 @@ #include "kpcmciainfo.h" -KPCMCIAInfo::KPCMCIAInfo(KPCMCIA *pcmcia, QWidget *parent, const char *name) +KPCMCIAInfo::KPCMCIAInfo(KPCMCIA *pcmcia, TQWidget *parent, const char *name) : KDialog(parent, name, false), _pcmcia(pcmcia) { setMinimumSize(300,400); - _mainGrid = new QGridLayout(this, 9, 5); + _mainGrid = new TQGridLayout(this, 9, 5); - _mainTab = new QTabWidget(this); + _mainTab = new TQTabWidget(this); _mainGrid->addMultiCellWidget(_mainTab, 0, 6, 0, 4); _mainGrid->setRowStretch(0, 1); _mainGrid->setRowStretch(1, 1); @@ -60,7 +60,7 @@ KPCMCIAInfo::KPCMCIAInfo(KPCMCIA *pcmcia, QWidget *parent, const char *name) _mainTab->resize(KDialog::sizeHint()); resize(KDialog::sizeHint()); - connect(_pcmcia, SIGNAL(cardUpdated(int)), this, SLOT(updateCard(int))); + connect(_pcmcia, TQT_SIGNAL(cardUpdated(int)), this, TQT_SLOT(updateCard(int))); _sb = new KStatusBar(this); _sb->insertItem(i18n("Ready."), 0, 1, true); @@ -68,12 +68,12 @@ KPCMCIAInfo::KPCMCIAInfo(KPCMCIA *pcmcia, QWidget *parent, const char *name) _mainGrid->addMultiCellWidget(_sb, 8, 8, 0, 4); _mainGrid->setRowStretch(8, 0); - _updateButton = new QPushButton(i18n("&Update"), this); + _updateButton = new TQPushButton(i18n("&Update"), this); _mainGrid->addWidget(_updateButton, 7, 3); - connect(_updateButton, SIGNAL(pressed()), this, SLOT(update())); + connect(_updateButton, TQT_SIGNAL(pressed()), this, TQT_SLOT(update())); _closeButton = new KPushButton(KStdGuiItem::close(), this); _mainGrid->addWidget(_closeButton, 7, 4); - connect(_closeButton, SIGNAL(pressed()), this, SLOT(slotClose())); + connect(_closeButton, TQT_SIGNAL(pressed()), this, TQT_SLOT(slotClose())); _mainGrid->setRowStretch(7, 0); show(); @@ -96,15 +96,15 @@ void KPCMCIAInfo::slotResetStatus() { } -void KPCMCIAInfo::statusNotice(const QString& text, int life) { +void KPCMCIAInfo::statusNotice(const TQString& text, int life) { _sb->changeItem(text, 0); if (life > 0) - QTimer::singleShot(life, this, SLOT(slotResetStatus())); + TQTimer::singleShot(life, this, TQT_SLOT(slotResetStatus())); } -void KPCMCIAInfo::slotTabSetStatus(const QString& text) { +void KPCMCIAInfo::slotTabSetStatus(const TQString& text) { statusNotice(text); } @@ -131,10 +131,10 @@ void KPCMCIAInfo::prepareCards() { } for (int i = 0; i < _pcmcia->getCardCount(); i++) { - QString tabname = i18n("Card Slot %1"); + TQString tabname = i18n("Card Slot %1"); KPCMCIAInfoPage *tp = new KPCMCIAInfoPage(_pcmcia->getCard(i), _mainTab); - connect(this, SIGNAL(updateNow()), tp, SLOT(update())); - connect(tp, SIGNAL(setStatusBar(const QString&)), this, SLOT(slotTabSetStatus(const QString&))); + connect(this, TQT_SIGNAL(updateNow()), tp, TQT_SLOT(update())); + connect(tp, TQT_SIGNAL(setStatusBar(const TQString&)), this, TQT_SLOT(slotTabSetStatus(const TQString&))); tp->resize(_mainTab->sizeHint()); _mainTab->addTab(tp, tabname.arg(i+1)); _pages.insert(i, tp); @@ -149,42 +149,42 @@ void KPCMCIAInfo::prepareCards() { /////////////////////////////////////////////////////////////////////////// -KPCMCIAInfoPage::KPCMCIAInfoPage(KPCMCIACard *card, QWidget *parent, const char *name) - : QFrame(parent, name), _card(card) { - _mainGrid = new QGridLayout(this, 10, 10); +KPCMCIAInfoPage::KPCMCIAInfoPage(KPCMCIACard *card, TQWidget *parent, const char *name) + : TQFrame(parent, name), _card(card) { + _mainGrid = new TQGridLayout(this, 10, 10); if (!_card) { // display an error } else { - _card_name = new QLabel(this); + _card_name = new TQLabel(this); _mainGrid->addMultiCellWidget(_card_name, 0, 0, 0, 5); - _card_type = new QLabel(this); + _card_type = new TQLabel(this); _mainGrid->addMultiCellWidget(_card_type, 0, 0, 6, 9); - _card_driver = new QLabel(this); + _card_driver = new TQLabel(this); _mainGrid->addMultiCellWidget(_card_driver, 1, 1, 0, 4); - _card_irq = new QLabel(this); + _card_irq = new TQLabel(this); _mainGrid->addMultiCellWidget(_card_irq, 2, 2, 0, 3); - _card_io = new QLabel(this); + _card_io = new TQLabel(this); _mainGrid->addMultiCellWidget(_card_io, 3, 3, 0, 6); - _card_dev = new QLabel(this); + _card_dev = new TQLabel(this); _mainGrid->addMultiCellWidget(_card_dev, 4, 4, 0, 4); - _card_vcc = new QLabel(this); + _card_vcc = new TQLabel(this); _mainGrid->addMultiCellWidget(_card_vcc, 5, 5, 0, 2); - _card_vpp = new QLabel(this); + _card_vpp = new TQLabel(this); _mainGrid->addMultiCellWidget(_card_vpp, 5, 5, 5, 9); - _card_bus = new QLabel(this); + _card_bus = new TQLabel(this); _mainGrid->addMultiCellWidget(_card_bus, 6, 6, 0, 4); - _card_cfgbase = new QLabel(this); + _card_cfgbase = new TQLabel(this); _mainGrid->addMultiCellWidget(_card_cfgbase, 6, 6, 5, 9); - _card_ej_ins = new QPushButton(i18n("&Eject"), this); - _card_sus_res = new QPushButton(i18n("&Suspend"), this); - _card_reset = new QPushButton(i18n("&Reset"), this); + _card_ej_ins = new TQPushButton(i18n("&Eject"), this); + _card_sus_res = new TQPushButton(i18n("&Suspend"), this); + _card_reset = new TQPushButton(i18n("&Reset"), this); _mainGrid->addWidget(_card_ej_ins, 9, 5); _mainGrid->addWidget(_card_sus_res, 9, 6); _mainGrid->addWidget(_card_reset, 9, 7); - connect(_card_reset, SIGNAL(pressed()), this, SLOT(slotResetCard())); - connect(_card_sus_res, SIGNAL(pressed()), this, SLOT(slotSuspendResume())); - connect(_card_ej_ins, SIGNAL(pressed()), this, SLOT(slotInsertEject())); + connect(_card_reset, TQT_SIGNAL(pressed()), this, TQT_SLOT(slotResetCard())); + connect(_card_sus_res, TQT_SIGNAL(pressed()), this, TQT_SLOT(slotSuspendResume())); + connect(_card_ej_ins, TQT_SIGNAL(pressed()), this, TQT_SLOT(slotInsertEject())); update(); } @@ -231,7 +231,7 @@ void KPCMCIAInfoPage::slotSuspendResume() { void KPCMCIAInfoPage::update() { if (_card) { - QString tmp; + TQString tmp; _card_name->setText(_card->name()); _card_name->resize(_card_name->sizeHint()); tmp = i18n("Card type: %1 "); @@ -241,7 +241,7 @@ void KPCMCIAInfoPage::update() { _card_driver->setText(tmp.arg(_card->driver())); _card_driver->resize(_card_driver->sizeHint()); tmp = i18n("IRQ: %1%2"); - QString tmp2; + TQString tmp2; switch (_card->intType()) { case 1: tmp2 = i18n(" (used for memory)"); diff --git a/klaptopdaemon/kpcmciainfo.h b/klaptopdaemon/kpcmciainfo.h index 0cc7cea..f345c19 100644 --- a/klaptopdaemon/kpcmciainfo.h +++ b/klaptopdaemon/kpcmciainfo.h @@ -24,7 +24,7 @@ #define _KPCMCIAINFO_H #include <kdialog.h> -#include <qframe.h> +#include <tqframe.h> class KPCMCIA; class KPCMCIACard; @@ -35,37 +35,37 @@ class QGridLayout; class QPushButton; class KPushButton; -#include <qmap.h> +#include <tqmap.h> class KPCMCIAInfo : public KDialog { Q_OBJECT public: - KPCMCIAInfo(KPCMCIA *pcmcia, QWidget *parent = NULL, const char *name = 0); + KPCMCIAInfo(KPCMCIA *pcmcia, TQWidget *parent = NULL, const char *name = 0); virtual ~KPCMCIAInfo(); void showTab(int num); - void statusNotice(const QString& text, int life = 1500); + void statusNotice(const TQString& text, int life = 1500); public slots: void slotClose(); void update(); void updateCard(int num); void slotResetStatus(); - void slotTabSetStatus(const QString& text); + void slotTabSetStatus(const TQString& text); signals: void updateNow(); private: - QFrame *_mainFrame; - QTabWidget *_mainTab; - QGridLayout *_mainGrid; + TQFrame *_mainFrame; + TQTabWidget *_mainTab; + TQGridLayout *_mainGrid; KPCMCIA *_pcmcia; - QMap<int,KPCMCIAInfoPage*> _pages; + TQMap<int,KPCMCIAInfoPage*> _pages; KStatusBar *_sb; KPushButton *_closeButton; - QPushButton *_updateButton; + TQPushButton *_updateButton; void prepareCards(); @@ -75,10 +75,10 @@ private: class QLabel; -class KPCMCIAInfoPage : public QFrame { +class KPCMCIAInfoPage : public TQFrame { Q_OBJECT public: - KPCMCIAInfoPage(KPCMCIACard *card, QWidget *parent = NULL, const char *name = 0); + KPCMCIAInfoPage(KPCMCIACard *card, TQWidget *parent = NULL, const char *name = 0); virtual ~KPCMCIAInfoPage(); public slots: @@ -88,27 +88,27 @@ public slots: void slotSuspendResume(); signals: - void setStatusBar(const QString&); + void setStatusBar(const TQString&); private: KPCMCIACard *_card; - QGridLayout *_mainGrid; - - QLabel *_card_name; - QLabel *_card_type; - QLabel *_card_irq; - QLabel *_card_io; - QLabel *_card_dev; - QLabel *_card_driver; - QLabel *_card_vcc; - QLabel *_card_vpp; - QLabel *_card_cfgbase; - QLabel *_card_bus; - - QPushButton *_card_ej_ins; - QPushButton *_card_sus_res; - QPushButton *_card_reset; + TQGridLayout *_mainGrid; + + TQLabel *_card_name; + TQLabel *_card_type; + TQLabel *_card_irq; + TQLabel *_card_io; + TQLabel *_card_dev; + TQLabel *_card_driver; + TQLabel *_card_vcc; + TQLabel *_card_vpp; + TQLabel *_card_cfgbase; + TQLabel *_card_bus; + + TQPushButton *_card_ej_ins; + TQPushButton *_card_sus_res; + TQPushButton *_card_reset; }; diff --git a/klaptopdaemon/krichtextlabel.cpp b/klaptopdaemon/krichtextlabel.cpp index 458ade6..089635d 100644 --- a/klaptopdaemon/krichtextlabel.cpp +++ b/klaptopdaemon/krichtextlabel.cpp @@ -18,35 +18,35 @@ #include "krichtextlabel.h" -#include <qtooltip.h> -#include <qstylesheet.h> -#include <qsimplerichtext.h> +#include <tqtooltip.h> +#include <tqstylesheet.h> +#include <tqsimplerichtext.h> #include <kglobalsettings.h> -static QString qrichtextify( const QString& text ) +static TQString qrichtextify( const TQString& text ) { if ( text.isEmpty() || text[0] == '<' ) return text; - QStringList lines = QStringList::split('\n', text); - for(QStringList::Iterator it = lines.begin(); it != lines.end(); ++it) + TQStringList lines = TQStringList::split('\n', text); + for(TQStringList::Iterator it = lines.begin(); it != lines.end(); ++it) { - *it = QStyleSheet::convertFromPlainText( *it, QStyleSheetItem::WhiteSpaceNormal ); + *it = TQStyleSheet::convertFromPlainText( *it, TQStyleSheetItem::WhiteSpaceNormal ); } - return lines.join(QString::null); + return lines.join(TQString::null); } -KRichTextLabel::KRichTextLabel( const QString &text , QWidget *parent, const char *name ) - : QLabel ( parent, name ) { +KRichTextLabel::KRichTextLabel( const TQString &text , TQWidget *parent, const char *name ) + : TQLabel ( parent, name ) { m_defaultWidth = QMIN(400, KGlobalSettings::desktopGeometry(this).width()*2/5); setAlignment( Qt::WordBreak ); setText(text); } -KRichTextLabel::KRichTextLabel( QWidget *parent, const char *name ) - : QLabel ( parent, name ) { +KRichTextLabel::KRichTextLabel( TQWidget *parent, const char *name ) + : TQLabel ( parent, name ) { m_defaultWidth = QMIN(400, KGlobalSettings::desktopGeometry(this).width()*2/5); setAlignment( Qt::WordBreak ); } @@ -57,17 +57,17 @@ void KRichTextLabel::setDefaultWidth(int defaultWidth) updateGeometry(); } -QSizePolicy KRichTextLabel::sizePolicy() const +TQSizePolicy KRichTextLabel::sizePolicy() const { - return QSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Minimum, false); + return TQSizePolicy(TQSizePolicy::MinimumExpanding, TQSizePolicy::Minimum, false); } -QSize KRichTextLabel::minimumSizeHint() const +TQSize KRichTextLabel::minimumSizeHint() const { - QString qt_text = qrichtextify( text() ); + TQString qt_text = qrichtextify( text() ); int pref_width = 0; int pref_height = 0; - QSimpleRichText rt(qt_text, font()); + TQSimpleRichText rt(qt_text, font()); pref_width = m_defaultWidth; rt.setWidth(pref_width); int used_width = rt.widthUsed(); @@ -94,16 +94,16 @@ QSize KRichTextLabel::minimumSizeHint() const pref_width = used_width; } - return QSize(pref_width, rt.height()); + return TQSize(pref_width, rt.height()); } -QSize KRichTextLabel::sizeHint() const +TQSize KRichTextLabel::sizeHint() const { return minimumSizeHint(); } -void KRichTextLabel::setText( const QString &text ) { - QLabel::setText(text); +void KRichTextLabel::setText( const TQString &text ) { + TQLabel::setText(text); } void KRichTextLabel::virtual_hook( int, void* ) diff --git a/klaptopdaemon/krichtextlabel.h b/klaptopdaemon/krichtextlabel.h index e03fe25..40ead03 100644 --- a/klaptopdaemon/krichtextlabel.h +++ b/klaptopdaemon/krichtextlabel.h @@ -19,12 +19,12 @@ #ifndef KRICHTEXTLABEL_H #define KRICHTEXTLABEL_H -#include <qlabel.h> +#include <tqlabel.h> #include <kdelibs_export.h> /** - * @short A replacement for QLabel that supports richtext and proper layout management + * @short A replacement for TQLabel that supports richtext and proper layout management * * @author Waldo Bastian <bastian@kde.org> */ @@ -32,25 +32,25 @@ /* * QLabel */ -class KDEUI_EXPORT KRichTextLabel : public QLabel { +class KDEUI_EXPORT KRichTextLabel : public TQLabel { Q_OBJECT public: /** * Default constructor. */ - KRichTextLabel( QWidget *parent, const char *name = 0 ); - KRichTextLabel( const QString &text, QWidget *parent, const char *name = 0 ); + KRichTextLabel( TQWidget *parent, const char *name = 0 ); + KRichTextLabel( const TQString &text, TQWidget *parent, const char *name = 0 ); int defaultWidth() const { return m_defaultWidth; } void setDefaultWidth(int defaultWidth); - virtual QSize minimumSizeHint() const; - virtual QSize sizeHint() const; - QSizePolicy sizePolicy() const; + virtual TQSize minimumSizeHint() const; + virtual TQSize sizeHint() const; + TQSizePolicy sizePolicy() const; public slots: - void setText( const QString & ); + void setText( const TQString & ); protected: int m_defaultWidth; diff --git a/klaptopdaemon/laptop_daemon.cpp b/klaptopdaemon/laptop_daemon.cpp index 43ac53f..5b710c5 100644 --- a/klaptopdaemon/laptop_daemon.cpp +++ b/klaptopdaemon/laptop_daemon.cpp @@ -29,7 +29,7 @@ #include <stdlib.h> #include <fcntl.h> -#include <qtimer.h> +#include <tqtimer.h> #include <kconfig.h> #include <klocale.h> @@ -43,30 +43,30 @@ #include <kmessagebox.h> #include <kpassivepopup.h> #include <dcopclient.h> -#include <qsocketnotifier.h> -#include <qcursor.h> +#include <tqsocketnotifier.h> +#include <tqcursor.h> #include <unistd.h> #include <sys/time.h> extern "C" { - KDE_EXPORT KDEDModule *create_klaptopdaemon(const QCString& name) { + KDE_EXPORT KDEDModule *create_klaptopdaemon(const TQCString& name) { return new laptop_daemon(name); } } -class XWidget: public QWidget { +class XWidget: public TQWidget { public: - XWidget(laptop_daemon *p):QWidget(0) { pd = p; } + XWidget(laptop_daemon *p):TQWidget(0) { pd = p; } private: bool x11Event(XEvent *event); laptop_daemon *pd; }; bool XWidget::x11Event(XEvent *event) { return pd->x11Event(event); } -laptop_daemon::laptop_daemon(const QCString& obj): KDEDModule(obj) +laptop_daemon::laptop_daemon(const TQCString& obj): KDEDModule(obj) { xwidget = new XWidget(this); xwidget->hide(); @@ -100,7 +100,7 @@ laptop_daemon::laptop_daemon(const QCString& obj): KDEDModule(obj) sony_notifier = 0; knownFullyCharged = 0; sony_disp = 0; - connect(this, SIGNAL(signal_checkBattery()), SLOT(checkBatteryNow())); + connect(this, TQT_SIGNAL(signal_checkBattery()), TQT_SLOT(checkBatteryNow())); //hasAudio = (audioServer.serverStatus() == 0) ? true : false; @@ -113,8 +113,8 @@ laptop_daemon::laptop_daemon(const QCString& obj): KDEDModule(obj) else _pcmcia = NULL; if (_pcmcia) - connect(_pcmcia, SIGNAL(cardUpdated(int)), this, SLOT(updatePCMCIA(int))); - connect( &autoLock, SIGNAL(timeout()), this, SLOT(timerDone()) ); + connect(_pcmcia, TQT_SIGNAL(cardUpdated(int)), this, TQT_SLOT(updatePCMCIA(int))); + connect( &autoLock, TQT_SIGNAL(timeout()), this, TQT_SLOT(timerDone()) ); } @@ -295,10 +295,10 @@ void laptop_daemon::restart() if (s.sony_enablescrollbar||s.sony_middleemulation) { if (sony_notifier == 0) { - sony_notifier = new QSocketNotifier( sony_fd, QSocketNotifier::Read, this ); + sony_notifier = new TQSocketNotifier( sony_fd, TQSocketNotifier::Read, this ); if (sony_notifier) - QObject::connect( sony_notifier, SIGNAL(activated(int)), - this, SLOT(sonyDataReceived()) ); + TQObject::connect( sony_notifier, TQT_SIGNAL(activated(int)), + this, TQT_SLOT(sonyDataReceived()) ); } } else { if (sony_notifier) { @@ -311,8 +311,8 @@ void laptop_daemon::restart() void laptop_daemon::setBlankSaver(bool blanked) { - QByteArray ba; - QDataStream ds(ba, IO_WriteOnly); + TQByteArray ba; + TQDataStream ds(ba, IO_WriteOnly); ds << bool(blanked); // can't use kapp->dcopClient() because it breaks KUniqueApplication DCOPClient c; @@ -356,7 +356,7 @@ void laptop_daemon::timerDone() if ((powered?s.power_performance_enabled[0]:s.power_performance_enabled[1])) { need_wait = 1; if (!saved_performance) { - QStringList profile_list; + TQStringList profile_list; int current_profile; bool *active_list; if (laptop_portable::get_system_performance(1, current_profile, profile_list, active_list)) { @@ -369,7 +369,7 @@ void laptop_daemon::timerDone() if ((powered?s.power_throttle_enabled[0]:s.power_throttle_enabled[1])) { need_wait = 1; if (!saved_throttle) { - QStringList profile_list; + TQStringList profile_list; int current_profile; bool *active_list; if (laptop_portable::get_system_throttling(1, current_profile, profile_list, active_list)) { @@ -384,17 +384,17 @@ void laptop_daemon::timerDone() // (many of the above things cause unexpected time discontinuities) // if (need_wait) { - wakepos.setX(QCursor::pos().x()); - wakepos.setY(QCursor::pos().y()); + wakepos.setX(TQCursor::pos().x()); + wakepos.setY(TQCursor::pos().y()); if (!wake_timer) { - wake_timer = new QTimer(this); - connect(wake_timer, SIGNAL(timeout()), this, SLOT(WakeCheck())); + wake_timer = new TQTimer(this); + connect(wake_timer, TQT_SIGNAL(timeout()), this, TQT_SLOT(WakeCheck())); wake_timer->start(1*1000, 1); } } else { if (!backoffTimer) { - backoffTimer = new QTimer(this); - connect(backoffTimer, SIGNAL(timeout()), this, SLOT(BackoffRestart())); + backoffTimer = new TQTimer(this); + connect(backoffTimer, TQT_SIGNAL(timeout()), this, TQT_SLOT(BackoffRestart())); backoffTimer->start(60*1000, 1); } } @@ -422,7 +422,7 @@ laptop_daemon::WakeCheck() wake_timer = 0; return; } - if (wakepos.x() != QCursor::pos().x() || wakepos.y() != QCursor::pos().y()) { + if (wakepos.x() != TQCursor::pos().x() || wakepos.y() != TQCursor::pos().y()) { wake_timer->stop(); delete wake_timer; wake_timer = 0; @@ -720,7 +720,7 @@ void laptop_daemon::setPollInterval(const int interval) } } -void laptop_daemon::timerEvent(QTimerEvent *) +void laptop_daemon::timerEvent(TQTimerEvent *) { emit(signal_checkBattery()); } @@ -926,12 +926,12 @@ void laptop_daemon::SetBrightness(bool blank, int v) laptop_portable::set_brightness(blank, v); } -void laptop_daemon::SetThrottle(QString v) +void laptop_daemon::SetThrottle(TQString v) { laptop_portable::set_system_throttling(v); } -void laptop_daemon::SetPerformance(QString v) +void laptop_daemon::SetPerformance(TQString v) { laptop_portable::set_system_performance(v); } @@ -963,7 +963,7 @@ laptop_daemon::ButtonThreadInternals() } if (s.button_lid_performance_enabled) { if (!button_saved_performance) { - QStringList profile_list; + TQStringList profile_list; int current_profile; bool *active_list; if (laptop_portable::get_system_performance(1, current_profile, profile_list, active_list)) { @@ -975,7 +975,7 @@ laptop_daemon::ButtonThreadInternals() } if (s.button_lid_throttle_enabled) { if (!button_saved_throttle) { - QStringList profile_list; + TQStringList profile_list; int current_profile; bool *active_list; if (laptop_portable::get_system_throttling(1, current_profile, profile_list, active_list)) { @@ -1040,7 +1040,7 @@ laptop_daemon::ButtonThreadInternals() } if (s.button_power_performance_enabled) { if (!button_saved_performance) { - QStringList profile_list; + TQStringList profile_list; int current_profile; bool *active_list; if (laptop_portable::get_system_performance(1, current_profile, profile_list, active_list)) { @@ -1052,7 +1052,7 @@ laptop_daemon::ButtonThreadInternals() } if (s.button_power_throttle_enabled) { if (!button_saved_throttle) { - QStringList profile_list; + TQStringList profile_list; int current_profile; bool *active_list; if (laptop_portable::get_system_throttling(1, current_profile, profile_list, active_list)) { diff --git a/klaptopdaemon/laptop_daemon.h b/klaptopdaemon/laptop_daemon.h index b1537e1..7617a0d 100644 --- a/klaptopdaemon/laptop_daemon.h +++ b/klaptopdaemon/laptop_daemon.h @@ -25,28 +25,28 @@ #include "daemon_state.h" -#include <qdir.h> +#include <tqdir.h> #include <unistd.h> #include <time.h> -#include <qmovie.h> -#include <qptrlist.h> -#include <qfileinfo.h> -#include <qimage.h> +#include <tqmovie.h> +#include <tqptrlist.h> +#include <tqfileinfo.h> +#include <tqimage.h> #include <kiconloader.h> #include <kprocess.h> //#include <kaudio.h> -#include <qtooltip.h> +#include <tqtooltip.h> #include <X11/Xlib.h> #include <X11/extensions/XTest.h> -#include <qsocketnotifier.h> +#include <tqsocketnotifier.h> #include <kdebug.h> -#include <qthread.h> +#include <tqthread.h> #include "kpcmcia.h" @@ -58,7 +58,7 @@ class laptop_daemon; class XWidget; -class ButtonThread : public QThread { +class ButtonThread : public TQThread { public: ButtonThread() { quitting = 0; } void sethandle(laptop_daemon *h) { handle = h; } @@ -76,13 +76,13 @@ class laptop_daemon: public KDEDModule Q_OBJECT K_DCOP public: - laptop_daemon(const QCString& obj); + laptop_daemon(const TQCString& obj); ~laptop_daemon(); void setPollInterval(const int poll=60); void SetBrightness(bool blank, int v); // routine to do it int GetBrightness() { return brightness; } - void SetThrottle(QString v); - void SetPerformance(QString v); + void SetThrottle(TQString v); + void SetPerformance(TQString v); void ButtonThreadInternals(); k_dcop: void restart(); @@ -90,7 +90,7 @@ k_dcop: signals: void signal_checkBattery(); protected: - void timerEvent(QTimerEvent *); + void timerEvent(TQTimerEvent *); protected slots: void checkBatteryNow(); void timerDone(); @@ -125,9 +125,9 @@ public: int left; bool x11Event(XEvent *event); bool exists() { return s.exists; } - QString noBatteryIcon() { return s.noBatteryIcon; } - QString chargeIcon() { return s.chargeIcon; } - QString noChargeIcon() { return s.noChargeIcon; } + TQString noBatteryIcon() { return s.noBatteryIcon; } + TQString chargeIcon() { return s.chargeIcon; } + TQString noChargeIcon() { return s.noChargeIcon; } protected: int triggered[2]; @@ -147,7 +147,7 @@ protected: int sony_fd; // file desc form open /dev/sonypi Display *sony_disp; // X display - QSocketNotifier *sony_notifier; // how we know data is waiting + TQSocketNotifier *sony_notifier; // how we know data is waiting // brightness @@ -165,19 +165,19 @@ protected: bool need_wait; // undo sleep stuff bool saved_brightness, saved_throttle, saved_performance; int saved_brightness_val; - QString saved_performance_val, saved_throttle_val; - QTimer *wake_timer; // the timer for the above running + TQString saved_performance_val, saved_throttle_val; + TQTimer *wake_timer; // the timer for the above running QPoint wakepos; // the mouse pos at the beginning of time void WakeUpAuto(); - QTimer *backoffTimer; // backoff + TQTimer *backoffTimer; // backoff bool power_button_off; // imagined state of the power button bool button_bright_saved; // saved button state int button_bright_val; bool button_saved_performance; - QString button_saved_performance_val; + TQString button_saved_performance_val; bool button_saved_throttle; - QString button_saved_throttle_val; + TQString button_saved_throttle_val; daemon_state s; // saved daemon state from config file diff --git a/klaptopdaemon/main.cpp b/klaptopdaemon/main.cpp index 9dc0419..ca30218 100644 --- a/klaptopdaemon/main.cpp +++ b/klaptopdaemon/main.cpp @@ -26,7 +26,7 @@ #include <kprocess.h> #include <kconfig.h> #include <kglobal.h> -#include <qlayout.h> +#include <tqlayout.h> #include <unistd.h> #include <fcntl.h> @@ -48,44 +48,44 @@ extern void wake_laptop_daemon(); extern "C" { - KDE_EXPORT KCModule *create_pcmcia(QWidget *parent, const char *) + KDE_EXPORT KCModule *create_pcmcia(TQWidget *parent, const char *) { return new PcmciaConfig(parent, "kcmlaptop"); } - KDE_EXPORT KCModule *create_bwarning(QWidget *parent, const char *) + KDE_EXPORT KCModule *create_bwarning(TQWidget *parent, const char *) { return new WarningConfig(0, parent, "kcmlaptop"); } - KDE_EXPORT KCModule *create_cwarning(QWidget *parent, const char *) + KDE_EXPORT KCModule *create_cwarning(TQWidget *parent, const char *) { return new WarningConfig(1, parent, "kcmlaptop"); } - KDE_EXPORT KCModule *create_battery(QWidget *parent, const char *) + KDE_EXPORT KCModule *create_battery(TQWidget *parent, const char *) { return new BatteryConfig(parent, "kcmlaptop"); } - KDE_EXPORT KCModule *create_power(QWidget *parent, const char *) + KDE_EXPORT KCModule *create_power(TQWidget *parent, const char *) { return new PowerConfig(parent, "kcmlaptop"); } - KDE_EXPORT KCModule *create_acpi(QWidget *parent, const char *) + KDE_EXPORT KCModule *create_acpi(TQWidget *parent, const char *) { return new AcpiConfig(parent, "kcmlaptop"); } - KDE_EXPORT KCModule *create_apm(QWidget *parent, const char *) + KDE_EXPORT KCModule *create_apm(TQWidget *parent, const char *) { return new ApmConfig(parent, "kcmlaptop"); } - KDE_EXPORT KCModule *create_Profile(QWidget *parent, const char *) + KDE_EXPORT KCModule *create_Profile(TQWidget *parent, const char *) { return new ProfileConfig(parent, "kcmlaptop"); } - KDE_EXPORT KCModule *create_sony(QWidget *parent, const char *) + KDE_EXPORT KCModule *create_sony(TQWidget *parent, const char *) { return new SonyConfig(parent, "kcmlaptop"); } - KDE_EXPORT KCModule *create_buttons(QWidget *parent, const char *) + KDE_EXPORT KCModule *create_buttons(TQWidget *parent, const char *) { return new ButtonsConfig(parent, "kcmlaptop"); } @@ -111,7 +111,7 @@ extern "C" wake_laptop_daemon(); } - KDE_EXPORT KCModule *create_laptop(QWidget *parent, const char *) + KDE_EXPORT KCModule *create_laptop(TQWidget *parent, const char *) { return new LaptopModule(parent, "kcmlaptop"); } @@ -124,7 +124,7 @@ extern "C" -LaptopModule::LaptopModule(QWidget *parent, const char *) +LaptopModule::LaptopModule(TQWidget *parent, const char *) : KCModule(parent, "kcmlaptop") { { // export ACPI options @@ -147,58 +147,58 @@ LaptopModule::LaptopModule(QWidget *parent, const char *) enablehibernate = config.readBoolEntry("EnableHibernate", false); laptop_portable::software_suspend_set_mask(enablehibernate); } - QVBoxLayout *layout = new QVBoxLayout(this); - tab = new QTabWidget(this); + TQVBoxLayout *layout = new TQVBoxLayout(this); + tab = new TQTabWidget(this); layout->addWidget(tab); battery = new BatteryConfig(parent, "kcmlaptop"); tab->addTab(battery, i18n("&Battery")); - connect(battery, SIGNAL(changed(bool)), this, SLOT(moduleChanged(bool))); + connect(battery, TQT_SIGNAL(changed(bool)), this, TQT_SLOT(moduleChanged(bool))); power = new PowerConfig(parent, "kcmlaptop"); tab->addTab(power, i18n("&Power Control")); - connect(power, SIGNAL(changed(bool)), this, SLOT(moduleChanged(bool))); + connect(power, TQT_SIGNAL(changed(bool)), this, TQT_SLOT(moduleChanged(bool))); warning = new WarningConfig(0, parent, "kcmlaptop"); tab->addTab(warning, i18n("Low Battery &Warning")); - connect(warning, SIGNAL(changed(bool)), this, SLOT(moduleChanged(bool))); + connect(warning, TQT_SIGNAL(changed(bool)), this, TQT_SLOT(moduleChanged(bool))); critical = new WarningConfig(1, parent, "kcmlaptop"); tab->addTab(critical, i18n("Low Battery &Critical")); - connect(critical, SIGNAL(changed(bool)), this, SLOT(moduleChanged(bool))); + connect(critical, TQT_SIGNAL(changed(bool)), this, TQT_SLOT(moduleChanged(bool))); - QStringList profile_list; + TQStringList profile_list; int current_profile; bool *active_list; bool has_profile = laptop_portable::get_system_performance(0, current_profile, profile_list, active_list); - QStringList throttle_list; + TQStringList throttle_list; int current_throttle; bool has_throttling = laptop_portable::get_system_throttling(0, current_throttle, throttle_list, active_list); if (laptop_portable::has_brightness() || has_profile || has_throttling) { profile = new ProfileConfig(parent, "kcmlaptop"); tab->addTab(profile, i18n("Default Power Profiles")); - connect(profile, SIGNAL(changed(bool)), this, SLOT(moduleChanged(bool))); + connect(profile, TQT_SIGNAL(changed(bool)), this, TQT_SLOT(moduleChanged(bool))); } else { profile = 0; } if (laptop_portable::has_button(laptop_portable::LidButton) || laptop_portable::has_button(laptop_portable::PowerButton)) { buttons = new ButtonsConfig(parent, "kcmlaptop"); tab->addTab(buttons, i18n("Button Actions")); - connect(buttons, SIGNAL(changed(bool)), this, SLOT(moduleChanged(bool))); + connect(buttons, TQT_SIGNAL(changed(bool)), this, TQT_SLOT(moduleChanged(bool))); } else { buttons = 0; } if (laptop_portable::has_acpi()) { acpi = new AcpiConfig(parent, "kcmlaptop"); tab->addTab(acpi, i18n("&ACPI Config")); - connect(acpi, SIGNAL(changed(bool)), this, SLOT(moduleChanged(bool))); + connect(acpi, TQT_SIGNAL(changed(bool)), this, TQT_SLOT(moduleChanged(bool))); } else { acpi = 0; } if (laptop_portable::has_apm()) { apm = new ApmConfig(parent, "kcmlaptop"); tab->addTab(apm, i18n("&APM Config")); - connect(apm, SIGNAL(changed(bool)), this, SLOT(moduleChanged(bool))); + connect(apm, TQT_SIGNAL(changed(bool)), this, TQT_SLOT(moduleChanged(bool))); } else { apm = 0; } @@ -215,7 +215,7 @@ LaptopModule::LaptopModule(QWidget *parent, const char *) if (do_sony) { sony = new SonyConfig(parent, "kcmlaptop"); tab->addTab(sony, i18n("&Sony Laptop Config")); - connect(sony, SIGNAL(changed(bool)), this, SLOT(moduleChanged(bool))); + connect(sony, TQT_SIGNAL(changed(bool)), this, TQT_SLOT(moduleChanged(bool))); } else { sony = 0; } @@ -287,7 +287,7 @@ void LaptopModule::defaults() buttons->defaults(); } -QString LaptopModule::quickHelp() const +TQString LaptopModule::quickHelp() const { return i18n("<h1>Laptop Battery</h1>This module allows you to monitor " "your batteries. To make use of this module, you must have power management software " diff --git a/klaptopdaemon/main.h b/klaptopdaemon/main.h index 81d6e41..c944817 100644 --- a/klaptopdaemon/main.h +++ b/klaptopdaemon/main.h @@ -26,7 +26,7 @@ #define __MAIN_H__ -#include <qtabwidget.h> +#include <tqtabwidget.h> #include <kcmodule.h> @@ -47,12 +47,12 @@ class LaptopModule : public KCModule public: - LaptopModule(QWidget *parent, const char *name); + LaptopModule(TQWidget *parent, const char *name); void load(); void save(); void defaults(); - QString quickHelp() const; + TQString quickHelp() const; @@ -63,7 +63,7 @@ protected slots: private: - QTabWidget *tab; + TQTabWidget *tab; WarningConfig *warning; WarningConfig *critical; diff --git a/klaptopdaemon/pcmcia.cpp b/klaptopdaemon/pcmcia.cpp index ed17789..af6b6dc 100644 --- a/klaptopdaemon/pcmcia.cpp +++ b/klaptopdaemon/pcmcia.cpp @@ -26,8 +26,8 @@ #include <sys/stat.h> #include <stdlib.h> -#include <qfileinfo.h> -#include <qlayout.h> +#include <tqfileinfo.h> +#include <tqlayout.h> #include <kglobal.h> #include <klocale.h> @@ -37,7 +37,7 @@ #include "portable.h" #include "version.h" -PcmciaConfig::PcmciaConfig (QWidget * parent, const char *name) +PcmciaConfig::PcmciaConfig (TQWidget * parent, const char *name) : KCModule(parent, name) { KAboutData *about = @@ -56,8 +56,8 @@ PcmciaConfig::PcmciaConfig (QWidget * parent, const char *name) label1_text = laptop_portable::pcmcia_info(3, this); - QVBoxLayout *top_layout = new QVBoxLayout(this, 15, 5); - QGridLayout *top_grid = new QGridLayout(2, 2); + TQVBoxLayout *top_layout = new TQVBoxLayout(this, 15, 5); + TQGridLayout *top_grid = new TQGridLayout(2, 2); top_layout->addLayout(top_grid); top_grid->setColStretch(0, 0); @@ -78,12 +78,12 @@ PcmciaConfig::PcmciaConfig (QWidget * parent, const char *name) top_layout->addStretch(1); - QHBoxLayout *v1 = new QHBoxLayout; + TQHBoxLayout *v1 = new QHBoxLayout; top_layout->addLayout(v1, 0); v1->addStretch(1); - QString s1 = LAPTOP_VERSION; - QString s2 = i18n("Version: ")+s1; - QLabel* vers = new QLabel(s2, this); + TQString s1 = LAPTOP_VERSION; + TQString s2 = i18n("Version: ")+s1; + TQLabel* vers = new TQLabel(s2, this); vers->setMinimumSize(vers->sizeHint()); v1->addWidget(vers, 0); @@ -113,7 +113,7 @@ void PcmciaConfig::changed() } -QString PcmciaConfig::quickHelp() const +TQString PcmciaConfig::quickHelp() const { return i18n("<h1>PCMCIA Config</h1>This module shows information about " "the PCMCIA cards in your system, if there are PCMCIA cards."); diff --git a/klaptopdaemon/pcmcia.h b/klaptopdaemon/pcmcia.h index e163742..f9579f9 100644 --- a/klaptopdaemon/pcmcia.h +++ b/klaptopdaemon/pcmcia.h @@ -25,12 +25,12 @@ #ifndef __PCMCIACONFIG_H__ #define __PCMCIACONFIG_H__ -#include <qdialog.h> -#include <qpushbutton.h> -#include <qlabel.h> -#include <qlcdnumber.h> -#include <qradiobutton.h> -#include <qbuttongroup.h> +#include <tqdialog.h> +#include <tqpushbutton.h> +#include <tqlabel.h> +#include <tqlcdnumber.h> +#include <tqradiobutton.h> +#include <tqbuttongroup.h> #include <kapplication.h> #include <knuminput.h> @@ -42,13 +42,13 @@ class PcmciaConfig : public KCModule { Q_OBJECT public: - PcmciaConfig( QWidget *parent=0, const char* name=0); + PcmciaConfig( TQWidget *parent=0, const char* name=0); void save( void ); void load(); void defaults(); - virtual QString quickHelp() const; + virtual TQString quickHelp() const; private slots: @@ -58,10 +58,10 @@ private slots: private: void GetSettings( void ); - QLabel *label0; - QLabel *label1; - QLabel *label0_text; - QLabel *label1_text; + TQLabel *label0; + TQLabel *label1; + TQLabel *label0_text; + TQLabel *label1_text; }; diff --git a/klaptopdaemon/portable.cpp b/klaptopdaemon/portable.cpp index ac9ac16..f1b28fa 100644 --- a/klaptopdaemon/portable.cpp +++ b/klaptopdaemon/portable.cpp @@ -78,18 +78,18 @@ #include <fcntl.h> #include <sys/ioctl.h> #include <dirent.h> -#include <qpushbutton.h> -#include <qdir.h> -#include <qfile.h> -#include <qfileinfo.h> -#include <qstringlist.h> -#include <qstring.h> -#include <qobject.h> -#include <qregexp.h> -#include <qiodevice.h> -#include <qlayout.h> -#include <qvgroupbox.h> -#include <qvaluevector.h> +#include <tqpushbutton.h> +#include <tqdir.h> +#include <tqfile.h> +#include <tqfileinfo.h> +#include <tqstringlist.h> +#include <tqstring.h> +#include <tqobject.h> +#include <tqregexp.h> +#include <tqiodevice.h> +#include <tqlayout.h> +#include <tqvgroupbox.h> +#include <tqvaluevector.h> #include <kactivelabel.h> #include <kconfig.h> @@ -176,14 +176,14 @@ pmu_read(apm_info *ap) { int bcnt = 0; memset(ap, 0, sizeof(apm_info)); - QFile f("/proc/pmu/info"); + TQFile f("/proc/pmu/info"); if (!f.exists() || !f.open(IO_ReadOnly)) return 1; while (!f.atEnd()) { - QString l; + TQString l; f.readLine(l, 500); - QStringList ll = QStringList::split(':', l, false); + TQStringList ll = TQStringList::split(':', l, false); if (ll[0].stripWhiteSpace() == "AC Power") { ap->ac_line_status = ll[1].stripWhiteSpace().toInt(); //kdDebug() << "line status " << ap->ac_line_status << endl; @@ -199,14 +199,14 @@ pmu_read(apm_info *ap) int timerem = 0; int maxcharge = 0; for (int i = 0; i < bcnt; i++) { - QFile bf(QString("/proc/pmu/battery_%1").arg(i)); + TQFile bf(TQString("/proc/pmu/battery_%1").arg(i)); if (!bf.exists() || !bf.open(IO_ReadOnly)) continue; while(!bf.atEnd()) { - QString l; + TQString l; bf.readLine(l, 500); - QStringList ll = QStringList::split(':', l, false); + TQStringList ll = TQStringList::split(':', l, false); if (ll[0].stripWhiteSpace() == "charge") { charge += ll[1].stripWhiteSpace().toInt(); //kdDebug() << "charge: " << charge << endl; @@ -238,12 +238,12 @@ struct acpi_battery_info { int cap_low; int remaining; int rate; - QString name; - QString state_file; - QString info_file; + TQString name; + TQString state_file; + TQString info_file; }; -static QValueVector<acpi_battery_info> acpi_batteries; +static TQValueVector<acpi_battery_info> acpi_batteries; static int acpi_last_known=0; static int last_seed=1; // increment this to force revaluation @@ -321,8 +321,8 @@ readit: } static void acpi_read_batteries() { - QString buff; - QFile *f; + TQString buff; + TQFile *f; static int test_count = 0; bool skip = false; @@ -330,11 +330,11 @@ static void acpi_read_batteries() { acpi_battery_info& bat = acpi_batteries[i]; bool present = false; if ((test_count==0 || acpi_last_known != last_seed) && !bat.info_file.isNull()) { - f = new QFile(bat.info_file); + f = new TQFile(bat.info_file); if (f && f->exists() && f->open(IO_ReadOnly)) { while(f->readLine(buff,1024) > 0) { if (buff.contains("design capacity low:", false)) { - QRegExp rx("(\\d*)\\D*$"); + TQRegExp rx("(\\d*)\\D*$"); rx.search(buff); bat.cap_low = rx.cap(1).toInt(); if (bat.cap_low < 0) @@ -342,7 +342,7 @@ static void acpi_read_batteries() { continue; } if (buff.contains("last full capacity:", false)) { - QRegExp rx("(\\d*)\\D*$"); + TQRegExp rx("(\\d*)\\D*$"); rx.search(buff); bat.cap = rx.cap(1).toInt(); continue; @@ -360,11 +360,11 @@ static void acpi_read_batteries() { delete config; } if (!bat.state_file.isNull()) { - f = new QFile(bat.state_file); + f = new TQFile(bat.state_file); if (f && f->exists() && f->open(IO_ReadOnly)) { while(f->readLine(buff,1024) > 0) { if (buff.contains("present rate:", false)) { - QRegExp rx("(\\d*)\\D*$"); + TQRegExp rx("(\\d*)\\D*$"); rx.search(buff); bat.rate = rx.cap(1).toInt(); if (bat.rate < 0) @@ -373,7 +373,7 @@ static void acpi_read_batteries() { continue; } if (buff.contains("remaining capacity:", false)) { - QRegExp rx("(\\d*)\\D*$"); + TQRegExp rx("(\\d*)\\D*$"); rx.search(buff); bat.remaining = rx.cap(1).toInt(); bat.remaining -= bat.cap_low; @@ -558,7 +558,7 @@ has_pmu() return val; init = 1; val = 1; - if (!QDir("/proc/pmu").exists()) { + if (!TQDir("/proc/pmu").exists()) { val = 0; } return val; @@ -637,8 +637,8 @@ has_acpi_power() if (acpi_ac_status() >= 0) acpi_ac_ok = 1; - QDir battdir("/proc/acpi/battery"); - battdir.setFilter(QDir::Dirs); + TQDir battdir("/proc/acpi/battery"); + battdir.setFilter(TQDir::Dirs); if(!battdir.isReadable()) return(val = 0); for(uint i = 0; !battdir[i].isNull(); ++i) { @@ -646,9 +646,9 @@ has_acpi_power() continue; bool ok = 0; acpi_battery_info bat = {0,0,0,0,0,0,0,0,0}; - QString base = battdir.path() + "/" + battdir[i] + "/"; - QString name(base + "state"); - QFileInfo f(name); + TQString base = battdir.path() + "/" + battdir[i] + "/"; + TQString name(base + "state"); + TQFileInfo f(name); if(f.isReadable()) { bat.state_file = name; ok = true; @@ -689,16 +689,16 @@ has_acpi_sleep(int state) known = last_seed; mask = 0; - QFile p("/sys/power/state"); - QFile f("/proc/acpi/sleep"); + TQFile p("/sys/power/state"); + TQFile f("/proc/acpi/sleep"); if (p.exists() && p.open(IO_ReadOnly)) { - QString l; - QTextStream t(&p); + TQString l; + TQTextStream t(&p); l = t.readLine(); - QStringList ll = QStringList::split(' ',l,false); - for (QValueListIterator<QString> i = ll.begin(); i!=ll.end(); i++) { - QString s = *i; + TQStringList ll = TQStringList::split(' ',l,false); + for (TQValueListIterator<TQString> i = ll.begin(); i!=ll.end(); i++) { + TQString s = *i; if (s.compare("standby")==0) mask |= (1<<1); @@ -710,12 +710,12 @@ has_acpi_sleep(int state) p.close(); } else if (f.exists() && f.open(IO_ReadOnly)) { - QString l; - QTextStream t(&f); + TQString l; + TQTextStream t(&f); l = t.readLine(); - QStringList ll = QStringList::split(' ',l,false); - for (QValueListIterator<QString> i = ll.begin(); i!=ll.end(); i++) { - QString s = *i; + TQStringList ll = TQStringList::split(' ',l,false); + for (TQValueListIterator<TQString> i = ll.begin(); i!=ll.end(); i++) { + TQString s = *i; if (s[0] == 'S') { int c = s[1].digitValue(); if (c >= 0 && c <= 9) @@ -939,7 +939,7 @@ int laptop_portable::has_hibernation() // to get any software they lack // -KActiveLabel *laptop_portable::no_power_management_explanation(QWidget *parent) +KActiveLabel *laptop_portable::no_power_management_explanation(TQWidget *parent) { if (access("/proc/acpi", F_OK) == 0) { // probably has default kernel ACPI installed KActiveLabel* explain = new KActiveLabel(i18n("Your computer seems to have a partial ACPI installation. ACPI was probably enabled, but some of the sub-options were not - you need to enable at least 'AC Adaptor' and 'Control Method Battery' and then rebuild your kernel."), parent); @@ -954,23 +954,23 @@ KActiveLabel *laptop_portable::no_power_management_explanation(QWidget *parent) // // explain to the user what they need to do to get suspend/resume to work from user mode // -QLabel *laptop_portable::how_to_do_suspend_resume(QWidget *parent) +TQLabel *laptop_portable::how_to_do_suspend_resume(TQWidget *parent) { if (::has_apm()) { // TODO: remove linefeed from string, can't do it right now coz we have a string freeze - QLabel* note = new KRichTextLabel(i18n("\nIf you make /usr/bin/apm setuid then you will also " + TQLabel* note = new KRichTextLabel(i18n("\nIf you make /usr/bin/apm setuid then you will also " "be able to choose 'suspend' and 'standby' in the above " "dialog - check out the help button below to find out " - "how to do this").replace("\n", QString::null), parent); + "how to do this").replace("\n", TQString::null), parent); return(note); } if (::has_acpi()) { // TODO: remove linefeed from string, can't do it right now coz we have a string freeze - QLabel* note = new KRichTextLabel(i18n("\nYou may need to enable ACPI suspend/resume in the ACPI panel").replace("\n", QString::null), parent); + TQLabel* note = new KRichTextLabel(i18n("\nYou may need to enable ACPI suspend/resume in the ACPI panel").replace("\n", TQString::null), parent); return(note); } // TODO: remove linefeed from string, can't do it right now coz we have a string freeze - QLabel* note = new KRichTextLabel(i18n("\nYour system does not support suspend/standby").replace("\n", QString::null), parent); + TQLabel* note = new KRichTextLabel(i18n("\nYour system does not support suspend/standby").replace("\n", TQString::null), parent); return(note); } @@ -1040,20 +1040,20 @@ void get_pcmcia_info() // pcmcia support - this will be replaced by better - pcmcia support being worked on by // others // -QLabel *laptop_portable::pcmcia_info(int x, QWidget *parent) +TQLabel *laptop_portable::pcmcia_info(int x, TQWidget *parent) { if (x == 0) get_pcmcia_info(); if (!present) { if (x == 1) - return(new QLabel(i18n("No PCMCIA controller detected"), parent)); - return(new QLabel(i18n(""), parent)); + return(new TQLabel(i18n("No PCMCIA controller detected"), parent)); + return(new TQLabel(i18n(""), parent)); } else { switch (x) { - case 0: return(new QLabel(i18n("Card 0:"), parent)); - case 1: return(new QLabel(tmp0, parent)); - case 2: return(new QLabel(i18n("Card 1:"), parent)); - default:return(new QLabel(tmp1, parent)); + case 0: return(new TQLabel(i18n("Card 0:"), parent)); + case 1: return(new TQLabel(tmp0, parent)); + case 2: return(new TQLabel(i18n("Card 1:"), parent)); + default:return(new TQLabel(tmp1, parent)); } } } @@ -1162,18 +1162,18 @@ void laptop_portable::invoke_hibernation() } void -laptop_portable::extra_config(QWidget *wp, KConfig *, QVBoxLayout *top_layout) +laptop_portable::extra_config(TQWidget *wp, KConfig *, TQVBoxLayout *top_layout) { if (laptop_portable::has_apm(1) || laptop_portable::has_acpi(1)) return; if (laptop_portable::has_apm(0)) { - QLabel* explain = new KRichTextLabel( i18n("Your system has APM installed but may not be able to use all " + TQLabel* explain = new KRichTextLabel( i18n("Your system has APM installed but may not be able to use all " "of its features without further setup - look in the 'APM Config' " "tab for information about setting up APM for suspend and resume"), wp); top_layout->addWidget(explain, 0); } if (laptop_portable::has_acpi(0)) { - QLabel* explain = new KRichTextLabel( i18n("Your system has ACPI installed but may not be able to use all " + TQLabel* explain = new KRichTextLabel( i18n("Your system has ACPI installed but may not be able to use all " "of its features without further setup - look in the 'ACPI Config' " "tab for information about setting up ACPI for suspend and resume"), wp); top_layout->addWidget(explain, 0); @@ -1205,7 +1205,7 @@ struct power_result laptop_portable::poll_battery_state() } void -laptop_portable::get_battery_status(int &num_batteries, QStringList &names, QStringList &state, QStringList &values) +laptop_portable::get_battery_status(int &num_batteries, TQStringList &names, TQStringList &state, TQStringList &values) { struct power_result r; @@ -1226,7 +1226,7 @@ laptop_portable::get_battery_status(int &num_batteries, QStringList &names, QStr for(unsigned int i = 0; i < acpi_batteries.count(); ++i) { acpi_battery_info& bat = acpi_batteries[i]; names.append(bat.name); - values.append(QString("%1").arg(bat.percentage)); + values.append(TQString("%1").arg(bat.percentage)); state.append(bat.present ? "yes" : "no"); } return; @@ -1238,7 +1238,7 @@ laptop_portable::get_battery_status(int &num_batteries, QStringList &names, QStr r = poll_battery_state(); names.append("BAT1"); state.append("yes"); - QString s; + TQString s; s.setNum(r.percentage); values.append(s); } @@ -1247,7 +1247,7 @@ laptop_portable::get_battery_status(int &num_batteries, QStringList &names, QStr // // returns the current system load average, -1 if none // -static QFile lav_file; +static TQFile lav_file; static bool lav_inited=0; static bool lav_openok=0; @@ -1273,10 +1273,10 @@ float laptop_portable::get_load_average() if (!::has_lav()) return(-1); lav_file.open( IO_ReadOnly ); - QString l; + TQString l; lav_file.readLine(l, 500); lav_file.close(); - QStringList ll = QStringList::split(' ', l, false); + TQStringList ll = TQStringList::split(' ', l, false); l = ll[0]; bool ok; float f = l.toFloat(&ok); @@ -1300,17 +1300,17 @@ int laptop_portable::has_cpufreq() { } -QString laptop_portable::cpu_frequency() { - QString rc; - QFile cf("/proc/cpufreq"); +TQString laptop_portable::cpu_frequency() { + TQString rc; + TQFile cf("/proc/cpufreq"); bool haveProfile = false; if (cf.exists() && cf.open(IO_ReadOnly)) { while (!cf.atEnd()) { - QString l; + TQString l; cf.readLine(l, 500); if (l.left(3) == "CPU") { - QStringList ll = QStringList::split(' ', l, false); + TQStringList ll = TQStringList::split(' ', l, false); rc = ll.last(); haveProfile = true; break; @@ -1319,13 +1319,13 @@ QString laptop_portable::cpu_frequency() { } if (haveProfile) { - QFile ci("/proc/cpuinfo"); + TQFile ci("/proc/cpuinfo"); if (ci.exists() && ci.open(IO_ReadOnly)) { while (!ci.atEnd()) { - QString l; + TQString l; ci.readLine(l, 500); - QStringList ll = - QStringList::split(':',l,false); + TQStringList ll = + TQStringList::split(':',l,false); if (ll.count() != 2) continue; if (ll.first().stripWhiteSpace() @@ -1334,7 +1334,7 @@ QString laptop_portable::cpu_frequency() { break; } else if (ll.first().stripWhiteSpace() == "clock") { - rc = QString("%1 (%2)").arg(ll.last().stripWhiteSpace()).arg(rc); + rc = TQString("%1 (%2)").arg(ll.last().stripWhiteSpace()).arg(rc); break; } } @@ -1358,7 +1358,7 @@ acpi_helper_ok(bool type) known[type] = last_seed; known_res[type] = 0; struct stat sb; - QString str = KStandardDirs::findExe("klaptop_acpi_helper"); + TQString str = KStandardDirs::findExe("klaptop_acpi_helper"); if (str.isNull() || str.isEmpty()) return(0); @@ -1401,7 +1401,7 @@ apm_helper_ok(bool type) known[type] = last_seed; known_res[type] = 0; struct stat sb; - QString str = "/usr/bin/apm"; + TQString str = "/usr/bin/apm"; if (str.isNull() || str.isEmpty()) return(0); if (stat(str.latin1(), &sb) < 0) @@ -1508,15 +1508,15 @@ laptop_portable::get_brightness() // return a val 0-255, or -1 if you can't #define MAP_SIZE 20 static int acpi_performance_map[MAP_SIZE]; // hidden acpi state map static bool acpi_performance_enable[MAP_SIZE]; -static QStringList performance_list; -static QString acpi_performance_cpu; +static TQStringList performance_list; +static TQString acpi_performance_cpu; static int acpi_throttle_map[MAP_SIZE]; static bool acpi_throttle_enable[MAP_SIZE]; -static QStringList throttle_list; -static QString acpi_throttle_cpu; +static TQStringList throttle_list; +static TQString acpi_throttle_cpu; static bool -get_acpi_list(char p, int *map, const char *dev, QStringList &list, int &index, QString &cpu, bool get_enable, bool *enable_list) +get_acpi_list(char p, int *map, const char *dev, TQStringList &list, int &index, TQString &cpu, bool get_enable, bool *enable_list) { DIR *dfd; struct dirent *dp; @@ -1531,19 +1531,19 @@ get_acpi_list(char p, int *map, const char *dev, QStringList &list, int &index, if (strcmp(dp->d_name, ".") == 0 || strcmp(dp->d_name, "..") == 0) continue; - QString name("/proc/acpi/processor/"); + TQString name("/proc/acpi/processor/"); name += dp->d_name; name += dev; if (!(::access(name.latin1(), R_OK|W_OK)==0 && ::acpi_helper_ok(1)) && !(::access(name.latin1(), R_OK)==0 && ::acpi_helper_ok(0))) continue; - QFile f(name); + TQFile f(name); if (f.exists() && f.open(IO_ReadOnly)) { while (!f.atEnd() && i < MAP_SIZE) { - QString l; + TQString l; f.readLine(l, 500); - QStringList ll = QStringList::split(':',l,false); - QString tag = ll[0].stripWhiteSpace(); + TQStringList ll = TQStringList::split(':',l,false); + TQString tag = ll[0].stripWhiteSpace(); bool is_this = tag[0] == '*'; if (is_this) { if (tag[1] != p) @@ -1574,14 +1574,14 @@ get_acpi_list(char p, int *map, const char *dev, QStringList &list, int &index, // get the limit info if asked for // if (get_enable) { - name = QString("/proc/acpi/processor/")+dp->d_name+"/limit"; + name = TQString("/proc/acpi/processor/")+dp->d_name+"/limit"; f.setName(name); if (f.exists() && f.open(IO_ReadOnly)) { while (!f.atEnd() && i < MAP_SIZE) { - QString l; + TQString l; f.readLine(l, 500); if (l.contains("active limit", false)) { - QRegExp rx(QString("%1(\\d+)").arg(p)); + TQRegExp rx(TQString("%1(\\d+)").arg(p)); if (rx.search(l) >= 0) { bool ok; int min = rx.cap(1).toInt(&ok); @@ -1610,15 +1610,15 @@ get_acpi_list(char p, int *map, const char *dev, QStringList &list, int &index, #define CPUFREQ_25 2 #define CPUFREQ_SYSFS 3 -static QString cpufreq_cpu = ""; -static QString cpufreq_minmax_frequency[2]; +static TQString cpufreq_cpu = ""; +static TQString cpufreq_minmax_frequency[2]; // get CPUFreq scaling policies via the sysfs interface -static int get_cpufreq_sysfs_state(QStringList &states, int ¤t, const QString cpu) { - QString cur, buffer; +static int get_cpufreq_sysfs_state(TQStringList &states, int ¤t, const TQString cpu) { + TQString cur, buffer; // read current scaling policy - QFile f("/sys/devices/system/cpu/" + cpu + "/cpufreq/scaling_governor"); + TQFile f("/sys/devices/system/cpu/" + cpu + "/cpufreq/scaling_governor"); if(!f.exists() || !f.open(IO_ReadOnly) || f.atEnd()) return CPUFREQ_NONE; f.readLine(buffer, 256); @@ -1633,7 +1633,7 @@ static int get_cpufreq_sysfs_state(QStringList &states, int ¤t, const QStr int count = 0; if(!f.atEnd()) { f.readLine(buffer, 1024); - QStringList l = QStringList::split(' ', buffer.stripWhiteSpace(), false); + TQStringList l = TQStringList::split(' ', buffer.stripWhiteSpace(), false); for(unsigned int i = 0; i < l.size(); ++i, ++count) { states.append(l[i].stripWhiteSpace()); if(states[i] == cur) @@ -1649,16 +1649,16 @@ static int get_cpufreq_sysfs_state(QStringList &states, int ¤t, const QStr // sample output of cat /proc/cpufreq: // minimum CPU frequency - maximum CPU frequency - policy // CPU 0 700000 kHz ( 70 %) - 1000000 kHz (100 %) - powersave -static int get_cpufreq_25_state(QStringList &states, int ¤t) { +static int get_cpufreq_25_state(TQStringList &states, int ¤t) { current = -1; states.clear(); - QFile f("/proc/cpufreq"); + TQFile f("/proc/cpufreq"); if (f.exists() && f.open(IO_ReadOnly)) { while (!f.atEnd()) { - QString l; + TQString l; f.readLine(l, 1024); - QRegExp rx("CPU.*\\d+.*(\\d+).*-.*(\\d+).*-\\W*(\\w*)"); + TQRegExp rx("CPU.*\\d+.*(\\d+).*-.*(\\d+).*-\\W*(\\w*)"); if (rx.search(l) >= 0) { cpufreq_minmax_frequency[0] = rx.cap(1); cpufreq_minmax_frequency[1] = rx.cap(2); @@ -1684,12 +1684,12 @@ static int get_cpufreq_25_state(QStringList &states, int ¤t) { // get CPUFreq scaling policies via the 2.4 /proc interface // The old interface doesn't support policies yet, we only get the min and max frequency, // so we use these as performance states. -static int get_cpufreq_24_state(QStringList &states, int ¤t, const QString cpu) { - QString buffer, cur; +static int get_cpufreq_24_state(TQStringList &states, int ¤t, const TQString cpu) { + TQString buffer, cur; states.clear(); // current frequency - QFile f("/proc/sys/cpu/" + cpu + "/speed"); + TQFile f("/proc/sys/cpu/" + cpu + "/speed"); if(!f.exists() || !f.open(IO_ReadOnly) || f.atEnd()) return CPUFREQ_NONE; f.readLine(buffer, 16); @@ -1716,7 +1716,7 @@ static int get_cpufreq_24_state(QStringList &states, int ¤t, const QString // check for CPUFreq support and get a list of all available scaling policies // this method doesn't support multiple CPU's (neither does get_acpi_list() above), // but this shouldn't be a problem on notebooks... -static int get_cpufreq_state(bool force, QStringList &states, int ¤t) { +static int get_cpufreq_state(bool force, TQStringList &states, int ¤t) { static int known = -1; // check wether we already know which interface to use @@ -1737,8 +1737,8 @@ static int get_cpufreq_state(bool force, QStringList &states, int ¤t) { } // look for the CPUFreq sysfs interface first - QDir dir("/sys/devices/system/cpu"); - dir.setFilter(QDir::Dirs); + TQDir dir("/sys/devices/system/cpu"); + dir.setFilter(TQDir::Dirs); if(dir.isReadable()) { for(unsigned int i = 0; !dir[i].isNull(); ++i) { if(dir[i] == "." || dir[i] == "..") @@ -1755,7 +1755,7 @@ static int get_cpufreq_state(bool force, QStringList &states, int ¤t) { // last chance: the /proc interface from the 2.4 kernel series dir.setPath("/proc/sys/cpu"); - dir.setFilter(QDir::Dirs); + dir.setFilter(TQDir::Dirs); if(dir.isReadable()) { for(unsigned int i = 0; !dir[i].isNull(); ++i) { if(dir[i] == "." || dir[i] == "..") @@ -1771,7 +1771,7 @@ static int get_cpufreq_state(bool force, QStringList &states, int ¤t) { } bool -laptop_portable::get_system_performance(bool force, int ¤t, QStringList &s, bool *&active) // do something to help get system profiles from places like ACPI +laptop_portable::get_system_performance(bool force, int ¤t, TQStringList &s, bool *&active) // do something to help get system profiles from places like ACPI { if(!acpi_performance_enabled) return false; @@ -1804,7 +1804,7 @@ laptop_portable::get_system_performance(bool force, int ¤t, QStringList &s } bool -laptop_portable::get_system_throttling(bool force, int ¤t, QStringList &s, bool *&active) // do something to help get system throttling data from places like ACPI +laptop_portable::get_system_throttling(bool force, int ¤t, TQStringList &s, bool *&active) // do something to help get system throttling data from places like ACPI { static int known=0; static int index=0; @@ -1828,7 +1828,7 @@ laptop_portable::get_system_throttling(bool force, int ¤t, QStringList &s, } void -laptop_portable::set_system_performance(QString val) // val = string given by get_system_performance above +laptop_portable::set_system_performance(TQString val) // val = string given by get_system_performance above { if(!acpi_performance_enabled) return; @@ -1847,7 +1847,7 @@ laptop_portable::set_system_performance(QString val) // val = string given by ge if((result = get_cpufreq_state(false, performance_list, current))) { if(performance_list[current] == val) return; - QString tmp; + TQString tmp; switch(result) { case CPUFREQ_SYSFS: invoke_acpi_helper("--cpufreq-sysfs", cpufreq_cpu.latin1(), val.latin1()); @@ -1867,7 +1867,7 @@ laptop_portable::set_system_performance(QString val) // val = string given by ge } void -laptop_portable::set_system_throttling(QString val) // val = string given by get_system_throttle above +laptop_portable::set_system_throttling(TQString val) // val = string given by get_system_throttle above { if (::has_acpi()) { char tmp[20]; @@ -1883,10 +1883,10 @@ laptop_portable::set_system_throttling(QString val) // val = string given by get return; } -static QString acpi_power_name, acpi_lid_name; // names of paths to ACPI lid states +static TQString acpi_power_name, acpi_lid_name; // names of paths to ACPI lid states static bool -acpi_check_button(const char *prefix, QString &result) +acpi_check_button(const char *prefix, TQString &result) { DIR *dfd; struct dirent *dp; @@ -1898,16 +1898,16 @@ acpi_check_button(const char *prefix, QString &result) if (strcmp(dp->d_name, ".") == 0 || strcmp(dp->d_name, "..") == 0) continue; - QString name(prefix); + TQString name(prefix); name += "/"; name += dp->d_name; name += "/state"; if (::access(name.latin1(), R_OK)!=0) continue; - QFile f(name); + TQFile f(name); if (f.exists() && f.open(IO_ReadOnly)) { while (!f.atEnd()) { - QString l; + TQString l; f.readLine(l, 500); if (l.contains("state:")) { result = name; @@ -1959,7 +1959,7 @@ bool laptop_portable::get_button(LaptopButton l) // true if a button is pressed { if (::has_acpi()) { - QString name; + TQString name; switch (l) { case LidButton: name = acpi_lid_name; @@ -1971,12 +1971,12 @@ laptop_portable::get_button(LaptopButton l) // true if a button is pressed break; } if (!name.isEmpty()) { - QFile f(name); + TQFile f(name); if (f.exists() && f.open(IO_ReadOnly)) { while (!f.atEnd()) { - QString l; + TQString l; f.readLine(l, 500); - QStringList ll = QStringList::split(':',l,false); + TQStringList ll = TQStringList::split(':',l,false); if (ll[0].stripWhiteSpace() == "state") { if (ll[1].stripWhiteSpace() == "open") { f.close(); @@ -2015,8 +2015,8 @@ laptop_portable::get_button(LaptopButton l) // true if a button is pressed #include <stdlib.h> #include <machine/apm_bios.h> #include <sys/stat.h> -#include <qpushbutton.h> -#include <qobject.h> +#include <tqpushbutton.h> +#include <tqobject.h> #include <kactivelabel.h> #include <kprocess.h> @@ -2139,7 +2139,7 @@ int laptop_portable::has_hibernation() // explain to the user what they need to do if has_power_management() returned 0 // to get any software they lack // -KActiveLabel *laptop_portable::no_power_management_explanation(QWidget *parent) +KActiveLabel *laptop_portable::no_power_management_explanation(TQWidget *parent) { int fd; KActiveLabel *explain; @@ -2172,9 +2172,9 @@ KActiveLabel *laptop_portable::no_power_management_explanation(QWidget *parent) // // explain to the user what they need to do to get suspend/resume to work from user mode // -QLabel *laptop_portable::how_to_do_suspend_resume(QWidget *parent) +TQLabel *laptop_portable::how_to_do_suspend_resume(TQWidget *parent) { - QLabel* note = new QLabel(" ", parent); + TQLabel* note = new TQLabel(" ", parent); return(note); } @@ -2183,11 +2183,11 @@ QLabel *laptop_portable::how_to_do_suspend_resume(QWidget *parent) // pcmcia support - this will be replaced by better - pcmcia support being worked on by // others // -QLabel *laptop_portable::pcmcia_info(int x, QWidget *parent) +TQLabel *laptop_portable::pcmcia_info(int x, TQWidget *parent) { if (x == 0) - return(new QLabel(i18n("No PCMCIA controller detected"), parent)); - return(new QLabel(i18n(""), parent)); + return(new TQLabel(i18n("No PCMCIA controller detected"), parent)); + return(new TQLabel(i18n(""), parent)); } // // puts us into standby mode @@ -2267,7 +2267,7 @@ laptop_portable::apm_set_mask(bool , bool ) // adds extra widgets to the battery panel // void -laptop_portable::extra_config(QWidget * /*parent*/, KConfig * /*config*/, QVBoxLayout * /*layout*/) +laptop_portable::extra_config(TQWidget * /*parent*/, KConfig * /*config*/, TQVBoxLayout * /*layout*/) { // INSERT HERE } @@ -2323,7 +2323,7 @@ int laptop_portable::has_cpufreq() { return 0; } -QString laptop_portable::cpu_frequency() { +TQString laptop_portable::cpu_frequency() { // INSERT HERE return ""; } @@ -2349,7 +2349,7 @@ laptop_portable::get_brightness() } bool -laptop_portable::get_system_performance(bool, int ¤t, QStringList &s, bool *&) // do something to help get system profiles from places like ACPI +laptop_portable::get_system_performance(bool, int ¤t, TQStringList &s, bool *&) // do something to help get system profiles from places like ACPI { // INSERT HERE current = 0; @@ -2358,7 +2358,7 @@ laptop_portable::get_system_performance(bool, int ¤t, QStringList &s, bool } bool -laptop_portable::get_system_throttling(bool, int ¤t, QStringList &s, bool *&) // do something to help get system throttling data from places like ACPI +laptop_portable::get_system_throttling(bool, int ¤t, TQStringList &s, bool *&) // do something to help get system throttling data from places like ACPI { // INSERT HERE current = 0; @@ -2367,13 +2367,13 @@ laptop_portable::get_system_throttling(bool, int ¤t, QStringList &s, bool } void -laptop_portable::set_system_performance(QString) +laptop_portable::set_system_performance(TQString) { // INSERT HERE } void -laptop_portable::set_system_throttling(QString) +laptop_portable::set_system_throttling(TQString) { // INSERT HERE } @@ -2393,7 +2393,7 @@ laptop_portable::get_button(LaptopButton) // true if a button is pressed } void -laptop_portable::get_battery_status(int &num_batteries, QStringList &names, QStringList &state, QStringList &values) // get multiple battery status +laptop_portable::get_battery_status(int &num_batteries, TQStringList &names, TQStringList &state, TQStringList &values) // get multiple battery status { struct power_result r; @@ -2411,7 +2411,7 @@ laptop_portable::get_battery_status(int &num_batteries, QStringList &names, QStr r = poll_battery_state(); names.append("BAT1"); state.append("yes"); - QString s; + TQString s; s.setNum(r.percentage); values.append(s); } @@ -2544,7 +2544,7 @@ int laptop_portable::has_hibernation() // explain to the user what they need to do if has_power_management() returned 0 // to get any software they lack // -KActiveLabel *laptop_portable::no_power_management_explanation(QWidget *parent) +KActiveLabel *laptop_portable::no_power_management_explanation(TQWidget *parent) { int fd; KActiveLabel *explain; @@ -2577,10 +2577,10 @@ KActiveLabel *laptop_portable::no_power_management_explanation(QWidget *parent) // // explain to the user what they need to do to get suspend/resume to work from user mode // -QLabel *laptop_portable::how_to_do_suspend_resume(QWidget *parent) +TQLabel *laptop_portable::how_to_do_suspend_resume(TQWidget *parent) { // INSERT HERE - QLabel* note = new QLabel(" ", parent); + TQLabel* note = new TQLabel(" ", parent); return(note); } @@ -2588,12 +2588,12 @@ QLabel *laptop_portable::how_to_do_suspend_resume(QWidget *parent) // pcmcia support - this will be replaced by better - pcmcia support being worked on by // others // -QLabel *laptop_portable::pcmcia_info(int x, QWidget *parent) +TQLabel *laptop_portable::pcmcia_info(int x, TQWidget *parent) { // INSERT HERE if (x == 0) - return(new QLabel(i18n("No PCMCIA controller detected"), parent)); - return(new QLabel(i18n(""), parent)); + return(new TQLabel(i18n("No PCMCIA controller detected"), parent)); + return(new TQLabel(i18n(""), parent)); } // @@ -2710,7 +2710,7 @@ int laptop_portable::has_cpufreq() { return 0; } -QString laptop_portable::cpu_frequency() { +TQString laptop_portable::cpu_frequency() { // INSERT HERE return ""; } @@ -2736,7 +2736,7 @@ laptop_portable::get_brightness() } bool -laptop_portable::get_system_throttling(bool, int ¤t, QStringList &s) // do something to help get system throttling data from places like ACPI +laptop_portable::get_system_throttling(bool, int ¤t, TQStringList &s) // do something to help get system throttling data from places like ACPI { // INSERT HERE current = 0; @@ -2745,13 +2745,13 @@ laptop_portable::get_system_throttling(bool, int ¤t, QStringList &s) // } void -laptop_portable::set_system_performance(QString) +laptop_portable::set_system_performance(TQString) { // INSERT HERE } void -laptop_portable::set_system_throttling(QString) +laptop_portable::set_system_throttling(TQString) { // INSERT HERE } @@ -2771,7 +2771,7 @@ laptop_portable::get_button(LaptopButton) // true if a button is pressed } void -laptop_portable::get_battery_status(int &num_batteries, QStringList &names, QStringList &state, QStringList &values) // get multiple battery status +laptop_portable::get_battery_status(int &num_batteries, TQStringList &names, TQStringList &state, TQStringList &values) // get multiple battery status { struct power_result r; @@ -2789,7 +2789,7 @@ laptop_portable::get_battery_status(int &num_batteries, QStringList &names, QStr r = poll_battery_state(); names.append("BAT1"); state.append("yes"); - QString s; + TQString s; s.setNum(r.percentage); values.append(s); } @@ -2861,7 +2861,7 @@ int laptop_portable::has_hibernation() // explain to the user what they need to do if has_power_management() returned 0 // to get any software they lack // -KActiveLabel *laptop_portable::no_power_management_explanation(QWidget *parent) +KActiveLabel *laptop_portable::no_power_management_explanation(TQWidget *parent) { KActiveLabel* explain = new KActiveLabel(i18n("Your computer or operating system is not supported by the current version of the\nKDE laptop control panels. If you want help porting these panels to work with it\nplease contact paul@taniwha.com."), parent); // INSERT HERE @@ -2871,9 +2871,9 @@ KActiveLabel *laptop_portable::no_power_management_explanation(QWidget *parent) // // explain to the user what they need to do to get suspend/resume to work from user mode // -QLabel *laptop_portable::how_to_do_suspend_resume(QWidget *parent) +TQLabel *laptop_portable::how_to_do_suspend_resume(TQWidget *parent) { - QLabel* note = new QLabel(" ", parent); + TQLabel* note = new TQLabel(" ", parent); // INSERT HERE return(note); } @@ -2883,12 +2883,12 @@ QLabel *laptop_portable::how_to_do_suspend_resume(QWidget *parent) // pcmcia support - this will be replaced by better - pcmcia support being worked on by // others // -QLabel *laptop_portable::pcmcia_info(int x, QWidget *parent) +TQLabel *laptop_portable::pcmcia_info(int x, TQWidget *parent) { // INSERT HERE if (x == 0) - return(new QLabel(i18n("No PCMCIA controller detected"), parent)); - return(new QLabel(i18n(""), parent)); + return(new TQLabel(i18n("No PCMCIA controller detected"), parent)); + return(new TQLabel(i18n(""), parent)); } // // puts us into standby mode @@ -2945,7 +2945,7 @@ int laptop_portable::has_apm(int) // adds extra widgets to the battery panel // void -laptop_portable::extra_config(QWidget *parent, KConfig *config, QVBoxLayout *layout) +laptop_portable::extra_config(TQWidget *parent, KConfig *config, TQVBoxLayout *layout) { // INSERT HERE } @@ -2980,7 +2980,7 @@ int laptop_portable::has_cpufreq() { return 0; } -QString laptop_portable::cpu_frequency() { +TQString laptop_portable::cpu_frequency() { // INSERT HERE return ""; } @@ -3006,7 +3006,7 @@ laptop_portable::get_brightness() } bool -laptop_portable::get_system_performance(bool, int ¤t, QStringList &s, bool *&) // do something to help get system profiles from places like ACPI +laptop_portable::get_system_performance(bool, int ¤t, TQStringList &s, bool *&) // do something to help get system profiles from places like ACPI { // INSERT HERE current = 0; @@ -3015,7 +3015,7 @@ laptop_portable::get_system_performance(bool, int ¤t, QStringList &s, bool } bool -laptop_portable::get_system_throttling(bool, int ¤t, QStringList &s, bool *&) // do something to help get system throttling data from places like ACPI +laptop_portable::get_system_throttling(bool, int ¤t, TQStringList &s, bool *&) // do something to help get system throttling data from places like ACPI { // INSERT HERE current = 0; @@ -3024,13 +3024,13 @@ laptop_portable::get_system_throttling(bool, int ¤t, QStringList &s, bool } void -laptop_portable::set_system_performance(QString) +laptop_portable::set_system_performance(TQString) { // INSERT HERE } void -laptop_portable::set_system_throttling(QString) +laptop_portable::set_system_throttling(TQString) { // INSERT HERE } @@ -3050,7 +3050,7 @@ laptop_portable::get_button(LaptopButton) // true if a button is pressed } void -laptop_portable::get_battery_status(int &num_batteries, QStringList &names, QStringList &state, QStringList &values) // get multiple battery status +laptop_portable::get_battery_status(int &num_batteries, TQStringList &names, TQStringList &state, TQStringList &values) // get multiple battery status { struct power_result r; @@ -3068,7 +3068,7 @@ laptop_portable::get_battery_status(int &num_batteries, QStringList &names, QStr r = poll_battery_state(); names.append("BAT1"); state.append("yes"); - QString s; + TQString s; s.setNum(r.percentage); values.append(s); } diff --git a/klaptopdaemon/portable.h b/klaptopdaemon/portable.h index 62d325c..a9fa703 100644 --- a/klaptopdaemon/portable.h +++ b/klaptopdaemon/portable.h @@ -1,8 +1,8 @@ -#include <qlabel.h> +#include <tqlabel.h> #include <kactivelabel.h> #include <kconfig.h> -#include <qvgroupbox.h> -#include <qstringlist.h> +#include <tqvgroupbox.h> +#include <tqstringlist.h> #ifndef PORTABLE_H #define PORTABLE_H @@ -71,10 +71,10 @@ public: static int has_brightness(); // returns 1 if this computer can set tyhe back panel brightness static void set_brightness(bool blank, int val); // val = 0-255 255 brightest, 0 means dimmest (if !blank it must be still visible), static int get_brightness(); // returns 0-255 brightness, -1 if you can't - static QString cpu_frequency(); // Returns the cpu freq. - static KActiveLabel *no_power_management_explanation(QWidget *parent); - static QLabel *how_to_do_suspend_resume(QWidget *parent); - static QLabel *pcmcia_info(int x, QWidget *parent); + static TQString cpu_frequency(); // Returns the cpu freq. + static KActiveLabel *no_power_management_explanation(TQWidget *parent); + static TQLabel *how_to_do_suspend_resume(TQWidget *parent); + static TQLabel *pcmcia_info(int x, TQWidget *parent); /** * Put this computer into standby mode. @@ -95,10 +95,10 @@ public: static void invoke_hibernation(); static struct power_result poll_battery_state(); - static void get_battery_status(int &num_batteries, QStringList &names, QStringList &state, QStringList &values); // get multiple battery status + static void get_battery_status(int &num_batteries, TQStringList &names, TQStringList &state, TQStringList &values); // get multiple battery status static bool has_lav(); // true if the following returns a valid value static float get_load_average(); // current short term load average - static void extra_config(QWidget *parent, KConfig *config, QVBoxLayout *layout); + static void extra_config(TQWidget *parent, KConfig *config, TQVBoxLayout *layout); static void acpi_set_mask(bool standby, bool suspend, bool hibernate, bool perf, bool throttle); static void apm_set_mask(bool standby, bool suspend); static void software_suspend_set_mask(bool hibernate); @@ -112,14 +112,14 @@ public: * limits). * @return True if this system provides performance profiles. */ - static bool get_system_performance(bool force, int ¤t, QStringList &s, bool *&active); + static bool get_system_performance(bool force, int ¤t, TQStringList &s, bool *&active); /** * Set performance profile. * @param val - Name of the performance profile as provided by * get_system_performance(). */ - static void set_system_performance(QString val); + static void set_system_performance(TQString val); /** * Get a list of available throttling levels. @@ -130,14 +130,14 @@ public: * for ACPI limits). * @return True if this system provides throttling levels. */ - static bool get_system_throttling(bool force, int ¤t, QStringList &s, bool *&active); + static bool get_system_throttling(bool force, int ¤t, TQStringList &s, bool *&active); /** * Set throttling level. * @param val - Name of the throttling level as provided by * get_system_throttling(). */ - static void set_system_throttling(QString val); + static void set_system_throttling(TQString val); enum LaptopButton {LidButton=0, PowerButton}; static bool has_button(LaptopButton p); // true if we have support for a particular button diff --git a/klaptopdaemon/power.cpp b/klaptopdaemon/power.cpp index 2477cee..dadf654 100644 --- a/klaptopdaemon/power.cpp +++ b/klaptopdaemon/power.cpp @@ -35,17 +35,17 @@ #include <kcombobox.h> #include <knuminput.h> -#include <qlayout.h> -#include <qvbuttongroup.h> -#include <qspinbox.h> -#include <qradiobutton.h> -#include <qcheckbox.h> -#include <qhbox.h> -#include <qslider.h> -#include <qtooltip.h> +#include <tqlayout.h> +#include <tqvbuttongroup.h> +#include <tqspinbox.h> +#include <tqradiobutton.h> +#include <tqcheckbox.h> +#include <tqhbox.h> +#include <tqslider.h> +#include <tqtooltip.h> extern void wake_laptop_daemon(); -PowerConfig::PowerConfig (QWidget * parent, const char *name) +PowerConfig::PowerConfig (TQWidget * parent, const char *name) : KCModule(parent, name), nopowerBox(0), nopowerStandby(0), @@ -84,16 +84,16 @@ PowerConfig::PowerConfig (QWidget * parent, const char *name) apm = laptop_portable::has_power_management(); config = new KConfig("kcmlaptoprc"); int can_brightness = laptop_portable::has_brightness(); - QStringList throttle_list; + TQStringList throttle_list; int current_throttle; bool *active_list; bool has_throttle = laptop_portable::get_system_throttling(0, current_throttle, throttle_list, active_list); - QStringList performance_list; + TQStringList performance_list; int current_performance; bool has_performance = laptop_portable::get_system_performance(0, current_performance, performance_list, active_list); if (!apm && !can_brightness && !has_throttle && !has_performance) { - QVBoxLayout *top_layout = new QVBoxLayout(this, KDialog::marginHint(), + TQVBoxLayout *top_layout = new TQVBoxLayout(this, KDialog::marginHint(), KDialog::spacingHint()); KActiveLabel* explain = laptop_portable::no_power_management_explanation(this); @@ -108,200 +108,200 @@ PowerConfig::PowerConfig (QWidget * parent, const char *name) if (!can_standby && !can_suspend && !can_hibernate && !can_brightness && !has_throttle && !has_performance) apm = 0; if (!apm) { - QVBoxLayout *top_layout = new QVBoxLayout(this, KDialog::marginHint(), + TQVBoxLayout *top_layout = new TQVBoxLayout(this, KDialog::marginHint(), KDialog::spacingHint()); - QLabel* explain = laptop_portable::how_to_do_suspend_resume(this); + TQLabel* explain = laptop_portable::how_to_do_suspend_resume(this); top_layout->addWidget(explain); top_layout->addStretch(1); } else { - QVBoxLayout *top_layout = new QVBoxLayout(this, KDialog::marginHint(), + TQVBoxLayout *top_layout = new TQVBoxLayout(this, KDialog::marginHint(), KDialog::spacingHint()); - QHBoxLayout *hlay = new QHBoxLayout( top_layout ); + TQHBoxLayout *hlay = new TQHBoxLayout( top_layout ); - nopowerBox = new QVButtonGroup(i18n("Not Powered"), this); - QToolTip::add( nopowerBox, i18n( "Options in this box apply when the laptop is unplugged from the wall and has been idle for a while" ) ); + nopowerBox = new TQVButtonGroup(i18n("Not Powered"), this); + TQToolTip::add( nopowerBox, i18n( "Options in this box apply when the laptop is unplugged from the wall and has been idle for a while" ) ); nopowerBox->layout()->setSpacing( KDialog::spacingHint() ); hlay->addWidget( nopowerBox ); if (can_standby) { - nopowerStandby = new QRadioButton(i18n("Standb&y"), nopowerBox); - QToolTip::add( nopowerStandby, i18n( "Causes the laptop to change to a standby temporary-low power state" ) ); + nopowerStandby = new TQRadioButton(i18n("Standb&y"), nopowerBox); + TQToolTip::add( nopowerStandby, i18n( "Causes the laptop to change to a standby temporary-low power state" ) ); } if (can_suspend) { - nopowerSuspend = new QRadioButton(i18n("&Suspend"), nopowerBox); - QToolTip::add( nopowerSuspend, i18n( "Causes the laptop to change to a suspend 'save-to-ram' state" ) ); + nopowerSuspend = new TQRadioButton(i18n("&Suspend"), nopowerBox); + TQToolTip::add( nopowerSuspend, i18n( "Causes the laptop to change to a suspend 'save-to-ram' state" ) ); } if (can_hibernate) { - nopowerHibernate = new QRadioButton(i18n("H&ibernate"), nopowerBox); - QToolTip::add( nopowerHibernate, i18n( "Causes the laptop to change to a hibernate 'save-to-disk' state" ) ); + nopowerHibernate = new TQRadioButton(i18n("H&ibernate"), nopowerBox); + TQToolTip::add( nopowerHibernate, i18n( "Causes the laptop to change to a hibernate 'save-to-disk' state" ) ); } if (can_suspend||can_standby||can_hibernate) - nopowerOff = new QRadioButton(i18n("None"), nopowerBox); + nopowerOff = new TQRadioButton(i18n("None"), nopowerBox); if (can_brightness) { - nopowerBrightness = new QCheckBox(i18n("Brightness"), nopowerBox); - QToolTip::add( nopowerBrightness, i18n( "Enables changing the laptop's back panel brightness" ) ); - QWidget *wp = new QWidget(nopowerBox); - QHBoxLayout *xl = new QHBoxLayout( wp); - xl->addWidget(new QLabel("-", wp)); - nopowerValBrightness = new QSlider(0, 255, 16, 255, Qt::Horizontal, wp); - QToolTip::add( nopowerValBrightness, i18n( "How bright to change the back panel" ) ); + nopowerBrightness = new TQCheckBox(i18n("Brightness"), nopowerBox); + TQToolTip::add( nopowerBrightness, i18n( "Enables changing the laptop's back panel brightness" ) ); + TQWidget *wp = new TQWidget(nopowerBox); + TQHBoxLayout *xl = new TQHBoxLayout( wp); + xl->addWidget(new TQLabel("-", wp)); + nopowerValBrightness = new TQSlider(0, 255, 16, 255, Qt::Horizontal, wp); + TQToolTip::add( nopowerValBrightness, i18n( "How bright to change the back panel" ) ); nopowerValBrightness->setEnabled(0); - connect(nopowerValBrightness, SIGNAL(valueChanged(int)), this, SLOT(changed())); - connect(nopowerBrightness, SIGNAL(toggled(bool)), nopowerValBrightness, SLOT(setEnabled(bool))); + connect(nopowerValBrightness, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(changed())); + connect(nopowerBrightness, TQT_SIGNAL(toggled(bool)), nopowerValBrightness, TQT_SLOT(setEnabled(bool))); xl->addWidget(nopowerValBrightness); - xl->addWidget(new QLabel("+", wp)); + xl->addWidget(new TQLabel("+", wp)); xl->addStretch(1); } if (has_performance) { - nopowerPerformance = new QCheckBox(i18n("System performance"), nopowerBox); - QToolTip::add( nopowerPerformance, i18n( "Enables changing the laptop's performance profile" ) ); + nopowerPerformance = new TQCheckBox(i18n("System performance"), nopowerBox); + TQToolTip::add( nopowerPerformance, i18n( "Enables changing the laptop's performance profile" ) ); - QWidget *wp = new QWidget(nopowerBox); - QHBoxLayout *xl = new QHBoxLayout( wp); + TQWidget *wp = new TQWidget(nopowerBox); + TQHBoxLayout *xl = new TQHBoxLayout( wp); nopowerValPerformance = new KComboBox(0, wp); - QToolTip::add( nopowerValPerformance, i18n( "Which profile to change it to" ) ); + TQToolTip::add( nopowerValPerformance, i18n( "Which profile to change it to" ) ); nopowerValPerformance->insertStringList(performance_list); nopowerValPerformance->setEnabled(0); - connect(nopowerValPerformance, SIGNAL(activated(int)), this, SLOT(changed())); - connect(nopowerPerformance, SIGNAL(toggled(bool)), nopowerValPerformance, SLOT(setEnabled(bool))); + connect(nopowerValPerformance, TQT_SIGNAL(activated(int)), this, TQT_SLOT(changed())); + connect(nopowerPerformance, TQT_SIGNAL(toggled(bool)), nopowerValPerformance, TQT_SLOT(setEnabled(bool))); xl->addWidget(nopowerValPerformance); xl->addStretch(1); } if (has_throttle) { - nopowerThrottle = new QCheckBox(i18n("CPU throttle"), nopowerBox); - QToolTip::add( nopowerThrottle, i18n( "Enables throttling the laptop's CPU" ) ); + nopowerThrottle = new TQCheckBox(i18n("CPU throttle"), nopowerBox); + TQToolTip::add( nopowerThrottle, i18n( "Enables throttling the laptop's CPU" ) ); - QWidget *wp = new QWidget(nopowerBox); - QHBoxLayout *xl = new QHBoxLayout( wp); + TQWidget *wp = new TQWidget(nopowerBox); + TQHBoxLayout *xl = new TQHBoxLayout( wp); nopowerValThrottle = new KComboBox(0, wp); - QToolTip::add( nopowerValThrottle, i18n( "How much to throttle the laptop's CPU" ) ); + TQToolTip::add( nopowerValThrottle, i18n( "How much to throttle the laptop's CPU" ) ); nopowerValThrottle->insertStringList(throttle_list); nopowerValThrottle->setEnabled(0); - connect(nopowerValThrottle, SIGNAL(activated(int)), this, SLOT(changed())); - connect(nopowerThrottle, SIGNAL(toggled(bool)), nopowerValThrottle, SLOT(setEnabled(bool))); + connect(nopowerValThrottle, TQT_SIGNAL(activated(int)), this, TQT_SLOT(changed())); + connect(nopowerThrottle, TQT_SIGNAL(toggled(bool)), nopowerValThrottle, TQT_SLOT(setEnabled(bool))); xl->addWidget(nopowerValThrottle); xl->addStretch(1); } - connect(nopowerBox, SIGNAL(clicked(int)), this, SLOT(changed())); + connect(nopowerBox, TQT_SIGNAL(clicked(int)), this, TQT_SLOT(changed())); bool can_lav = laptop_portable::has_lav(); - QHBox *hbox; + TQHBox *hbox; if (can_lav) { - hbox = new QHBox( nopowerBox ); - noenablelav = new QCheckBox(i18n("Don't act if LAV is >"), hbox); - connect(noenablelav, SIGNAL(clicked()), this, SLOT(changed())); + hbox = new TQHBox( nopowerBox ); + noenablelav = new TQCheckBox(i18n("Don't act if LAV is >"), hbox); + connect(noenablelav, TQT_SIGNAL(clicked()), this, TQT_SLOT(changed())); noeditlav = new KDoubleSpinBox(0.0, 10.0, 0.0, 0.1, 1, hbox); - QToolTip::add( noeditlav, i18n( "If enabled and the system load average is greater than this value none of the above options will be applied" ) ); - connect(noeditlav, SIGNAL(valueChanged(double)), this, SLOT(changed())); - connect(noenablelav, SIGNAL(toggled(bool)), noeditlav, SLOT(setEnabled(bool))); + TQToolTip::add( noeditlav, i18n( "If enabled and the system load average is greater than this value none of the above options will be applied" ) ); + connect(noeditlav, TQT_SIGNAL(valueChanged(double)), this, TQT_SLOT(changed())); + connect(noenablelav, TQT_SIGNAL(toggled(bool)), noeditlav, TQT_SLOT(setEnabled(bool))); } - hbox = new QHBox( nopowerBox ); - QLabel* noedlabel = new QLabel(i18n("&Wait for:"), hbox); - noeditwait = new QSpinBox( 1, 60*24 /*1 day*/, 1, hbox ); - QToolTip::add( noeditwait, i18n( "How long the computer has to be idle before these values take effect" ) ); + hbox = new TQHBox( nopowerBox ); + TQLabel* noedlabel = new TQLabel(i18n("&Wait for:"), hbox); + noeditwait = new TQSpinBox( 1, 60*24 /*1 day*/, 1, hbox ); + TQToolTip::add( noeditwait, i18n( "How long the computer has to be idle before these values take effect" ) ); noeditwait->setSuffix( i18n("keep short, unit in spinbox", "min") ); noedlabel->setBuddy( noeditwait ); hbox->setStretchFactor( noeditwait, 1 ); - connect( noeditwait, SIGNAL(valueChanged(int)), this, SLOT(changed())); + connect( noeditwait, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(changed())); /////////////////////////////////////////////////////////////// - powerBox = new QVButtonGroup(i18n("Powered"), this); + powerBox = new TQVButtonGroup(i18n("Powered"), this); powerBox->layout()->setSpacing( KDialog::spacingHint() ); - QToolTip::add( powerBox, i18n( "Options in this box apply when the laptop is plugged into the wall and has been idle for a while" ) ); + TQToolTip::add( powerBox, i18n( "Options in this box apply when the laptop is plugged into the wall and has been idle for a while" ) ); hlay->addWidget( powerBox ); if (can_standby) { - powerStandby = new QRadioButton(i18n("Sta&ndby"), powerBox); - QToolTip::add( powerStandby, i18n( "Causes the laptop to change to a standby temporary-low power state" ) ); + powerStandby = new TQRadioButton(i18n("Sta&ndby"), powerBox); + TQToolTip::add( powerStandby, i18n( "Causes the laptop to change to a standby temporary-low power state" ) ); } if (can_suspend) { - powerSuspend = new QRadioButton(i18n("S&uspend"), powerBox); - QToolTip::add( powerSuspend, i18n( "Causes the laptop to change to a suspend 'save-to-ram' state" ) ); + powerSuspend = new TQRadioButton(i18n("S&uspend"), powerBox); + TQToolTip::add( powerSuspend, i18n( "Causes the laptop to change to a suspend 'save-to-ram' state" ) ); } if (can_hibernate) { - powerHibernate = new QRadioButton(i18n("Hi&bernate"), powerBox); - QToolTip::add( powerHibernate, i18n( "Causes the laptop to change to a hibernate 'save-to-disk' state" ) ); + powerHibernate = new TQRadioButton(i18n("Hi&bernate"), powerBox); + TQToolTip::add( powerHibernate, i18n( "Causes the laptop to change to a hibernate 'save-to-disk' state" ) ); } if (can_suspend||can_standby||can_hibernate) - powerOff = new QRadioButton(i18n("None"), powerBox); + powerOff = new TQRadioButton(i18n("None"), powerBox); if (can_brightness) { - powerBrightness = new QCheckBox(i18n("Brightness"), powerBox); - QToolTip::add( powerBrightness, i18n( "Enables changing the laptop's back panel brightness" ) ); - QWidget *wp = new QWidget(powerBox); - QHBoxLayout *xl = new QHBoxLayout( wp); - xl->addWidget(new QLabel("-", wp)); - powerValBrightness = new QSlider(0, 255, 16, 255, Qt::Horizontal, wp); - QToolTip::add( powerValBrightness, i18n( "How bright to change the back panel" ) ); + powerBrightness = new TQCheckBox(i18n("Brightness"), powerBox); + TQToolTip::add( powerBrightness, i18n( "Enables changing the laptop's back panel brightness" ) ); + TQWidget *wp = new TQWidget(powerBox); + TQHBoxLayout *xl = new TQHBoxLayout( wp); + xl->addWidget(new TQLabel("-", wp)); + powerValBrightness = new TQSlider(0, 255, 16, 255, Qt::Horizontal, wp); + TQToolTip::add( powerValBrightness, i18n( "How bright to change the back panel" ) ); powerValBrightness->setEnabled(0); - connect(powerValBrightness, SIGNAL(valueChanged(int)), this, SLOT(changed())); - connect(powerBrightness, SIGNAL(toggled(bool)), powerValBrightness, SLOT(setEnabled(bool))); + connect(powerValBrightness, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(changed())); + connect(powerBrightness, TQT_SIGNAL(toggled(bool)), powerValBrightness, TQT_SLOT(setEnabled(bool))); xl->addWidget(powerValBrightness); - xl->addWidget(new QLabel("+", wp)); + xl->addWidget(new TQLabel("+", wp)); xl->addStretch(1); } if (has_performance) { - powerPerformance = new QCheckBox(i18n("System performance"), powerBox); - QToolTip::add( powerPerformance, i18n( "Enables changing the laptop's performance profile" ) ); + powerPerformance = new TQCheckBox(i18n("System performance"), powerBox); + TQToolTip::add( powerPerformance, i18n( "Enables changing the laptop's performance profile" ) ); - QWidget *wp = new QWidget(powerBox); - QHBoxLayout *xl = new QHBoxLayout( wp); + TQWidget *wp = new TQWidget(powerBox); + TQHBoxLayout *xl = new TQHBoxLayout( wp); powerValPerformance = new KComboBox(0, wp); - QToolTip::add( powerValPerformance, i18n( "Which profile to change it to" ) ); + TQToolTip::add( powerValPerformance, i18n( "Which profile to change it to" ) ); powerValPerformance->insertStringList(performance_list); powerValPerformance->setEnabled(0); - connect(powerValPerformance, SIGNAL(activated(int)), this, SLOT(changed())); - connect(powerPerformance, SIGNAL(toggled(bool)), powerValPerformance, SLOT(setEnabled(bool))); + connect(powerValPerformance, TQT_SIGNAL(activated(int)), this, TQT_SLOT(changed())); + connect(powerPerformance, TQT_SIGNAL(toggled(bool)), powerValPerformance, TQT_SLOT(setEnabled(bool))); xl->addWidget(powerValPerformance); xl->addStretch(1); } if (has_throttle) { - powerThrottle = new QCheckBox(i18n("CPU throttle"), powerBox); - QToolTip::add( powerThrottle, i18n( "Enables throttling the laptop's CPU" ) ); + powerThrottle = new TQCheckBox(i18n("CPU throttle"), powerBox); + TQToolTip::add( powerThrottle, i18n( "Enables throttling the laptop's CPU" ) ); - QWidget *wp = new QWidget(powerBox); - QHBoxLayout *xl = new QHBoxLayout( wp); + TQWidget *wp = new TQWidget(powerBox); + TQHBoxLayout *xl = new TQHBoxLayout( wp); powerValThrottle = new KComboBox(0, wp); - QToolTip::add( powerValThrottle, i18n( "How much to throttle the laptop's CPU" ) ); + TQToolTip::add( powerValThrottle, i18n( "How much to throttle the laptop's CPU" ) ); powerValThrottle->insertStringList(throttle_list); powerValThrottle->setEnabled(0); - connect(powerValThrottle, SIGNAL(activated(int)), this, SLOT(changed())); - connect(powerThrottle, SIGNAL(toggled(bool)), powerValThrottle, SLOT(setEnabled(bool))); + connect(powerValThrottle, TQT_SIGNAL(activated(int)), this, TQT_SLOT(changed())); + connect(powerThrottle, TQT_SIGNAL(toggled(bool)), powerValThrottle, TQT_SLOT(setEnabled(bool))); xl->addWidget(powerValThrottle); xl->addStretch(1); } - connect(powerBox, SIGNAL(clicked(int)), this, SLOT(changed())); + connect(powerBox, TQT_SIGNAL(clicked(int)), this, TQT_SLOT(changed())); if (can_lav) { - hbox = new QHBox( powerBox ); - enablelav = new QCheckBox(i18n("Don't act if LAV is >"), hbox); - connect( enablelav, SIGNAL(clicked()), this, SLOT(changed())); + hbox = new TQHBox( powerBox ); + enablelav = new TQCheckBox(i18n("Don't act if LAV is >"), hbox); + connect( enablelav, TQT_SIGNAL(clicked()), this, TQT_SLOT(changed())); editlav = new KDoubleSpinBox(0.0, 10.0, 0.0, 0.1, 1, hbox); - QToolTip::add( editlav, i18n( "If enabled and the system load average is greater than this value none of the above options will be applied" ) ); - connect( editlav, SIGNAL(valueChanged(double)), this, SLOT(changed())); - connect( enablelav, SIGNAL(toggled(bool)), editlav, SLOT(setEnabled(bool)) ); + TQToolTip::add( editlav, i18n( "If enabled and the system load average is greater than this value none of the above options will be applied" ) ); + connect( editlav, TQT_SIGNAL(valueChanged(double)), this, TQT_SLOT(changed())); + connect( enablelav, TQT_SIGNAL(toggled(bool)), editlav, TQT_SLOT(setEnabled(bool)) ); } - hbox = new QHBox( powerBox ); - QLabel* edlabel = new QLabel(i18n("Wai&t for:"), hbox); - editwait = new QSpinBox( 1, 60*24 /*1 day*/, 1, hbox ); - QToolTip::add( editwait, i18n( "How long the computer has to be idle before these values take effect" ) ); + hbox = new TQHBox( powerBox ); + TQLabel* edlabel = new TQLabel(i18n("Wai&t for:"), hbox); + editwait = new TQSpinBox( 1, 60*24 /*1 day*/, 1, hbox ); + TQToolTip::add( editwait, i18n( "How long the computer has to be idle before these values take effect" ) ); editwait->setSuffix( i18n("keep short, unit in spinbox", "min") ); edlabel->setBuddy( editwait ); hbox->setStretchFactor( editwait, 1 ); - connect( editwait, SIGNAL(valueChanged(int)), this, SLOT(changed())); + connect( editwait, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(changed())); hlay->addStretch(1); - QLabel* explain = new QLabel(i18n("This panel configures the behavior of the automatic power-down feature - " + TQLabel* explain = new TQLabel(i18n("This panel configures the behavior of the automatic power-down feature - " "it works as a sort of extreme screen saver. You can configure different " "timeouts and types of behavior depending on whether or not your laptop is " "plugged in to the mains supply."), this ); @@ -309,7 +309,7 @@ PowerConfig::PowerConfig (QWidget * parent, const char *name) top_layout->addWidget(explain); if (can_standby) { - QLabel* explain3 = new QLabel(i18n("Different laptops may respond to 'standby' in different ways - in many " + TQLabel* explain3 = new TQLabel(i18n("Different laptops may respond to 'standby' in different ways - in many " "it is only a temporary state and may not be useful for you."), this); explain3->setAlignment( Qt::WordBreak ); top_layout->addWidget(explain3, 0, Qt::AlignLeft); @@ -317,7 +317,7 @@ PowerConfig::PowerConfig (QWidget * parent, const char *name) top_layout->addStretch(1); - top_layout->addWidget( new QLabel( i18n("Version: %1").arg(LAPTOP_VERSION), this ), 0, Qt::AlignRight ); + top_layout->addWidget( new TQLabel( i18n("Version: %1").arg(LAPTOP_VERSION), this ), 0, Qt::AlignRight ); } } @@ -576,7 +576,7 @@ void PowerConfig::setPower(int p, int np) } -QString PowerConfig::quickHelp() const +TQString PowerConfig::quickHelp() const { return i18n("<h1>Laptop Power Control</h1>This module allows you to " "control the power settings of your laptop and set timouts that will trigger " diff --git a/klaptopdaemon/power.h b/klaptopdaemon/power.h index 0d9d624..359ffdf 100644 --- a/klaptopdaemon/power.h +++ b/klaptopdaemon/power.h @@ -26,7 +26,7 @@ #define __POWERCONFIG_H__ #include <kcmodule.h> -#include <qstring.h> +#include <tqstring.h> class QWidget; class QSlider; @@ -42,14 +42,14 @@ class PowerConfig : public KCModule { Q_OBJECT public: - PowerConfig( QWidget *parent=0, const char* name=0); + PowerConfig( TQWidget *parent=0, const char* name=0); ~PowerConfig(); void save( void ); void load(); void load(bool useDefaults); void defaults(); - virtual QString quickHelp() const; + virtual TQString quickHelp() const; private: @@ -58,37 +58,37 @@ private: int getNoPower(); void setPower( int, int ); - QButtonGroup *nopowerBox; - QRadioButton *nopowerStandby, *nopowerSuspend, *nopowerOff, *nopowerHibernate; - QCheckBox *nopowerBrightness; - QSlider *nopowerValBrightness; - QCheckBox *nopowerThrottle; + TQButtonGroup *nopowerBox; + TQRadioButton *nopowerStandby, *nopowerSuspend, *nopowerOff, *nopowerHibernate; + TQCheckBox *nopowerBrightness; + TQSlider *nopowerValBrightness; + TQCheckBox *nopowerThrottle; KComboBox *nopowerValThrottle; - QCheckBox *nopowerPerformance; + TQCheckBox *nopowerPerformance; KComboBox *nopowerValPerformance; - QButtonGroup *powerBox; - QRadioButton *powerStandby, *powerSuspend, *powerOff, *powerHibernate; - QCheckBox *powerBrightness; - QSlider *powerValBrightness; - QCheckBox *powerThrottle; + TQButtonGroup *powerBox; + TQRadioButton *powerStandby, *powerSuspend, *powerOff, *powerHibernate; + TQCheckBox *powerBrightness; + TQSlider *powerValBrightness; + TQCheckBox *powerThrottle; KComboBox *powerValThrottle; - QCheckBox *powerPerformance; + TQCheckBox *powerPerformance; KComboBox *powerValPerformance; - QSpinBox *noeditwait; - QSpinBox *editwait; - QCheckBox *enablelav; - QCheckBox *noenablelav; + TQSpinBox *noeditwait; + TQSpinBox *editwait; + TQCheckBox *enablelav; + TQCheckBox *noenablelav; KDoubleSpinBox *noeditlav; KDoubleSpinBox *editlav; int edit_wait, noedit_wait; int power_bright_val, nopower_bright_val; bool nopower_bright_enabled, power_bright_enabled; bool nopower_throttle_enabled, power_throttle_enabled; - QString nopower_throttle_val, power_throttle_val; + TQString nopower_throttle_val, power_throttle_val; bool nopower_performance_enabled, power_performance_enabled; bool lav_enabled, nolav_enabled; float edit_lav, noedit_lav; - QString nopower_performance_val, power_performance_val; + TQString nopower_performance_val, power_performance_val; KConfig *config; int power, nopower, apm; diff --git a/klaptopdaemon/profile.cpp b/klaptopdaemon/profile.cpp index a6285cb..db3cfde 100644 --- a/klaptopdaemon/profile.cpp +++ b/klaptopdaemon/profile.cpp @@ -41,26 +41,26 @@ #include <kcombobox.h> // other Qt headers: -#include <qlayout.h> -#include <qlabel.h> -#include <qcheckbox.h> -#include <qhbox.h> -#include <qvgroupbox.h> -#include <qgrid.h> -#include <qpushbutton.h> -#include <qslider.h> -#include <qtooltip.h> +#include <tqlayout.h> +#include <tqlabel.h> +#include <tqcheckbox.h> +#include <tqhbox.h> +#include <tqvgroupbox.h> +#include <tqgrid.h> +#include <tqpushbutton.h> +#include <tqslider.h> +#include <tqtooltip.h> extern void wake_laptop_daemon(); -ProfileConfig::ProfileConfig(QWidget * parent, const char *name) +ProfileConfig::ProfileConfig(TQWidget * parent, const char *name) : KCModule(parent, name) { - QStringList performance_list; + TQStringList performance_list; int current_performance; bool *active_list; bool has_performance = laptop_portable::get_system_performance(0, current_performance, performance_list, active_list); - QStringList throttle_list; + TQStringList throttle_list; int current_throttle; bool has_throttle = laptop_portable::get_system_throttling(0, current_throttle, throttle_list, active_list); @@ -68,28 +68,28 @@ ProfileConfig::ProfileConfig(QWidget * parent, const char *name) config = new KConfig("kcmlaptoprc"); - QVBoxLayout *top_layout = new QVBoxLayout( this, KDialog::marginHint(), + TQVBoxLayout *top_layout = new TQVBoxLayout( this, KDialog::marginHint(), KDialog::spacingHint() ); - QHBoxLayout *ll = new QHBoxLayout(); + TQHBoxLayout *ll = new TQHBoxLayout(); - QVGroupBox *gb = new QVGroupBox(i18n("Not Powered"), this); - QToolTip::add( gb, i18n( "Items in this box take effect whenever the laptop is unplugged from the wall" ) ); + TQVGroupBox *gb = new TQVGroupBox(i18n("Not Powered"), this); + TQToolTip::add( gb, i18n( "Items in this box take effect whenever the laptop is unplugged from the wall" ) ); if (laptop_portable::has_brightness()) { - QWidget *wp = new QWidget(gb); - QHBoxLayout *xl = new QHBoxLayout( wp); - poff = new QCheckBox(i18n("Back panel brightness"), wp); - QToolTip::add( poff, i18n( "Enables the changing of the back panel brightness" ) ); + TQWidget *wp = new TQWidget(gb); + TQHBoxLayout *xl = new TQHBoxLayout( wp); + poff = new TQCheckBox(i18n("Back panel brightness"), wp); + TQToolTip::add( poff, i18n( "Enables the changing of the back panel brightness" ) ); xl->addWidget(poff); - connect (poff, SIGNAL(toggled(bool)), this, SLOT(poff_changed(bool))); + connect (poff, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(poff_changed(bool))); - xl->addWidget(new QLabel("-", wp)); - soff = new QSlider(0, 255, 16, 160, Qt::Horizontal, wp); + xl->addWidget(new TQLabel("-", wp)); + soff = new TQSlider(0, 255, 16, 160, Qt::Horizontal, wp); soff->setEnabled(0); - QToolTip::add( soff, i18n( "How bright it should be when it is changed" ) ); - connect (soff, SIGNAL(valueChanged(int)), this, SLOT(configChanged())); + TQToolTip::add( soff, i18n( "How bright it should be when it is changed" ) ); + connect (soff, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(configChanged())); xl->addWidget(soff); - xl->addWidget(new QLabel("+", wp)); + xl->addWidget(new TQLabel("+", wp)); xl->addStretch(1); } else { poff = 0; @@ -97,18 +97,18 @@ ProfileConfig::ProfileConfig(QWidget * parent, const char *name) } if (has_performance) { - QWidget *wp = new QWidget(gb); - QHBoxLayout *xl = new QHBoxLayout( wp); - performance_off = new QCheckBox(i18n("System performance"), wp); - QToolTip::add( performance_off, i18n( "Enables the changing of the system performance profile" ) ); + TQWidget *wp = new TQWidget(gb); + TQHBoxLayout *xl = new TQHBoxLayout( wp); + performance_off = new TQCheckBox(i18n("System performance"), wp); + TQToolTip::add( performance_off, i18n( "Enables the changing of the system performance profile" ) ); xl->addWidget(performance_off); - connect (performance_off, SIGNAL(toggled(bool)), this, SLOT(performance_off_changed(bool))); + connect (performance_off, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(performance_off_changed(bool))); performance_val_off = new KComboBox(0, wp); - QToolTip::add( performance_val_off, i18n( "The new system performance profile to change to" ) ); + TQToolTip::add( performance_val_off, i18n( "The new system performance profile to change to" ) ); performance_val_off->insertStringList(performance_list); performance_val_off->setEnabled(0); - connect (performance_val_off, SIGNAL(activated(int)), this, SLOT(configChanged())); + connect (performance_val_off, TQT_SIGNAL(activated(int)), this, TQT_SLOT(configChanged())); xl->addWidget(performance_val_off); xl->addStretch(1); } else { @@ -116,18 +116,18 @@ ProfileConfig::ProfileConfig(QWidget * parent, const char *name) performance_val_off = 0; } if (has_throttle) { - QWidget *wp = new QWidget(gb); - QHBoxLayout *xl = new QHBoxLayout( wp); - throttle_off = new QCheckBox(i18n("CPU throttling"), wp); - QToolTip::add( throttle_off, i18n( "Enables the throttling of the CPU performance" ) ); + TQWidget *wp = new TQWidget(gb); + TQHBoxLayout *xl = new TQHBoxLayout( wp); + throttle_off = new TQCheckBox(i18n("CPU throttling"), wp); + TQToolTip::add( throttle_off, i18n( "Enables the throttling of the CPU performance" ) ); xl->addWidget(throttle_off); - connect (throttle_off, SIGNAL(toggled(bool)), this, SLOT(throttle_off_changed(bool))); + connect (throttle_off, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(throttle_off_changed(bool))); throttle_val_off = new KComboBox(0, wp); throttle_val_off->insertStringList(throttle_list); throttle_val_off->setEnabled(0); - QToolTip::add( throttle_val_off, i18n( "How much to throttle the CPU by" ) ); - connect (throttle_val_off, SIGNAL(activated(int)), this, SLOT(configChanged())); + TQToolTip::add( throttle_val_off, i18n( "How much to throttle the CPU by" ) ); + connect (throttle_val_off, TQT_SIGNAL(activated(int)), this, TQT_SLOT(configChanged())); xl->addWidget(throttle_val_off); xl->addStretch(1); } else { @@ -137,41 +137,41 @@ ProfileConfig::ProfileConfig(QWidget * parent, const char *name) ll->addWidget(gb); - gb = new QVGroupBox(i18n("Powered"), this); - QToolTip::add( gb, i18n( "Items in this box take effect whenever the laptop is plugged into the wall" ) ); + gb = new TQVGroupBox(i18n("Powered"), this); + TQToolTip::add( gb, i18n( "Items in this box take effect whenever the laptop is plugged into the wall" ) ); if (laptop_portable::has_brightness()) { - QWidget *wp = new QWidget(gb); - QHBoxLayout *xl = new QHBoxLayout( wp); - pon = new QCheckBox(i18n("Back panel brightness"), wp); - QToolTip::add( pon, i18n( "Enables the changing of the back panel brightness" ) ); + TQWidget *wp = new TQWidget(gb); + TQHBoxLayout *xl = new TQHBoxLayout( wp); + pon = new TQCheckBox(i18n("Back panel brightness"), wp); + TQToolTip::add( pon, i18n( "Enables the changing of the back panel brightness" ) ); xl->addWidget(pon); - connect (pon, SIGNAL(toggled(bool)), this, SLOT(pon_changed(bool))); + connect (pon, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(pon_changed(bool))); - xl->addWidget(new QLabel("-", wp)); - son = new QSlider(0, 255, 16, 255, Qt::Horizontal, wp); + xl->addWidget(new TQLabel("-", wp)); + son = new TQSlider(0, 255, 16, 255, Qt::Horizontal, wp); son->setEnabled(0); - QToolTip::add( son, i18n( "How bright it should be when it is changed" ) ); - connect (son, SIGNAL(valueChanged(int)), this, SLOT(configChanged())); + TQToolTip::add( son, i18n( "How bright it should be when it is changed" ) ); + connect (son, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(configChanged())); xl->addWidget(son); - xl->addWidget(new QLabel("+", wp)); + xl->addWidget(new TQLabel("+", wp)); xl->addStretch(1); } else { pon = 0; son = 0; } if (has_performance) { - QWidget *wp = new QWidget(gb); - QHBoxLayout *xl = new QHBoxLayout( wp); - performance_on = new QCheckBox(i18n("System performance"), wp); - QToolTip::add( performance_on, i18n( "Enables the changing of the system performance profile" ) ); + TQWidget *wp = new TQWidget(gb); + TQHBoxLayout *xl = new TQHBoxLayout( wp); + performance_on = new TQCheckBox(i18n("System performance"), wp); + TQToolTip::add( performance_on, i18n( "Enables the changing of the system performance profile" ) ); xl->addWidget(performance_on); - connect (performance_on, SIGNAL(toggled(bool)), this, SLOT(performance_on_changed(bool))); + connect (performance_on, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(performance_on_changed(bool))); performance_val_on = new KComboBox(0, wp); performance_val_on->insertStringList(performance_list); performance_val_on->setEnabled(0); - QToolTip::add( performance_val_on, i18n( "The new system performance profile to change to" ) ); - connect (performance_val_on, SIGNAL(activated(int)), this, SLOT(configChanged())); + TQToolTip::add( performance_val_on, i18n( "The new system performance profile to change to" ) ); + connect (performance_val_on, TQT_SIGNAL(activated(int)), this, TQT_SLOT(configChanged())); xl->addWidget(performance_val_on); xl->addStretch(1); } else { @@ -179,18 +179,18 @@ ProfileConfig::ProfileConfig(QWidget * parent, const char *name) performance_val_on = 0; } if (has_throttle) { - QWidget *wp = new QWidget(gb); - QHBoxLayout *xl = new QHBoxLayout( wp); - throttle_on = new QCheckBox(i18n("CPU throttle"), wp); - QToolTip::add( throttle_on, i18n( "Enables the throttling of the CPU performance" ) ); + TQWidget *wp = new TQWidget(gb); + TQHBoxLayout *xl = new TQHBoxLayout( wp); + throttle_on = new TQCheckBox(i18n("CPU throttle"), wp); + TQToolTip::add( throttle_on, i18n( "Enables the throttling of the CPU performance" ) ); xl->addWidget(throttle_on); - connect (throttle_on, SIGNAL(toggled(bool)), this, SLOT(throttle_on_changed(bool))); + connect (throttle_on, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(throttle_on_changed(bool))); throttle_val_on = new KComboBox(0, wp); throttle_val_on->insertStringList(throttle_list); throttle_val_on->setEnabled(0); - QToolTip::add( throttle_val_on, i18n( "How much to throttle the CPU by" ) ); - connect (throttle_val_on, SIGNAL(activated(int)), this, SLOT(configChanged())); + TQToolTip::add( throttle_val_on, i18n( "How much to throttle the CPU by" ) ); + connect (throttle_val_on, TQT_SIGNAL(activated(int)), this, TQT_SLOT(configChanged())); xl->addWidget(throttle_val_on); xl->addStretch(1); } else { @@ -202,18 +202,18 @@ ProfileConfig::ProfileConfig(QWidget * parent, const char *name) ll->addStretch(1); top_layout->addLayout(ll); - QLabel *tmp_label = new QLabel(i18n("This panel allows you to set default values for system attributes " + TQLabel *tmp_label = new TQLabel(i18n("This panel allows you to set default values for system attributes " "so that they change when the laptop is plugged in to the wall or " "running on batteries."), this ); tmp_label->setAlignment( Qt::WordBreak ); top_layout->addWidget( tmp_label ); - tmp_label = new QLabel(i18n("You can also set options for these values that will be set by low battery " + tmp_label = new TQLabel(i18n("You can also set options for these values that will be set by low battery " "conditions, or system inactivity in the other panels"), this ); tmp_label->setAlignment( Qt::WordBreak ); top_layout->addWidget( tmp_label ); top_layout->addStretch(1); - top_layout->addWidget( new QLabel( i18n("Version: %1").arg(LAPTOP_VERSION), this), 0, Qt::AlignRight ); + top_layout->addWidget( new TQLabel( i18n("Version: %1").arg(LAPTOP_VERSION), this), 0, Qt::AlignRight ); load(); @@ -330,7 +330,7 @@ void ProfileConfig::load(bool useDefaults) v = 0; } if (performance_val_on) { - QString s = config->readEntry("PerformanceOnLevel", ""); + TQString s = config->readEntry("PerformanceOnLevel", ""); int ind = 0; for (int i = 0; i < performance_val_on->count(); i++) if (performance_val_on->text(i) == s) { @@ -347,7 +347,7 @@ void ProfileConfig::load(bool useDefaults) v = 0; } if (performance_val_off) { - QString s = config->readEntry("PerformanceOffLevel", ""); + TQString s = config->readEntry("PerformanceOffLevel", ""); int ind = 0; for (int i = 0; i < performance_val_off->count(); i++) if (performance_val_off->text(i) == s) { @@ -364,7 +364,7 @@ void ProfileConfig::load(bool useDefaults) v = 0; } if (throttle_val_on) { - QString s = config->readEntry("ThrottleOnLevel", ""); + TQString s = config->readEntry("ThrottleOnLevel", ""); int ind = 0; for (int i = 0; i < throttle_val_on->count(); i++) if (throttle_val_on->text(i) == s) { @@ -381,7 +381,7 @@ void ProfileConfig::load(bool useDefaults) v = 0; } if (throttle_val_off) { - QString s = config->readEntry("ThrottleOffLevel", ""); + TQString s = config->readEntry("ThrottleOffLevel", ""); int ind = 0; for (int i = 0; i < throttle_val_off->count(); i++) if (throttle_val_off->text(i) == s) { @@ -406,7 +406,7 @@ void ProfileConfig::configChanged() } -QString ProfileConfig::quickHelp() const +TQString ProfileConfig::quickHelp() const { return i18n("<h1>Laptop Power Profile Setup</h1>This module allows you to configure default values for static laptop " "system attributes that will change when the laptop is plugged in or unplugged from the wall."); diff --git a/klaptopdaemon/profile.h b/klaptopdaemon/profile.h index a9a81be..914725a 100644 --- a/klaptopdaemon/profile.h +++ b/klaptopdaemon/profile.h @@ -26,7 +26,7 @@ #define __BRIGHTNESSCONFIG_H__ #include <kcmodule.h> -#include <qstring.h> +#include <tqstring.h> class QWidget; class QSpinBox; @@ -43,7 +43,7 @@ class ProfileConfig : public KCModule { Q_OBJECT public: - ProfileConfig( QWidget *parent=0, const char* name=0); + ProfileConfig( TQWidget *parent=0, const char* name=0); ~ProfileConfig( ); void save( void ); @@ -51,7 +51,7 @@ public: void load(bool useDefaults); void defaults(); - virtual QString quickHelp() const; + virtual TQString quickHelp() const; private slots: @@ -68,11 +68,11 @@ private slots: private: KConfig *config; - QCheckBox *pon, *performance_on, *throttle_on; - QSlider *son; + TQCheckBox *pon, *performance_on, *throttle_on; + TQSlider *son; KComboBox *performance_val_on, *throttle_val_on; - QCheckBox *poff, *performance_off, *throttle_off; - QSlider *soff; + TQCheckBox *poff, *performance_off, *throttle_off; + TQSlider *soff; KComboBox *performance_val_off, *throttle_val_off; diff --git a/klaptopdaemon/sony.cpp b/klaptopdaemon/sony.cpp index 8183f21..b97b05e 100644 --- a/klaptopdaemon/sony.cpp +++ b/klaptopdaemon/sony.cpp @@ -43,26 +43,26 @@ #include <krichtextlabel.h> // other Qt headers: -#include <qlayout.h> -#include <qlabel.h> -#include <qcheckbox.h> -#include <qhbox.h> -#include <qvgroupbox.h> -#include <qgrid.h> -#include <qpushbutton.h> -#include <qslider.h> -#include <qtooltip.h> +#include <tqlayout.h> +#include <tqlabel.h> +#include <tqcheckbox.h> +#include <tqhbox.h> +#include <tqvgroupbox.h> +#include <tqgrid.h> +#include <tqpushbutton.h> +#include <tqslider.h> +#include <tqtooltip.h> extern void wake_laptop_daemon(); -SonyConfig::SonyConfig(QWidget * parent, const char *name) +SonyConfig::SonyConfig(TQWidget * parent, const char *name) : KCModule(parent, name) { KGlobal::locale()->insertCatalogue("klaptopdaemon"); // For translation of klaptopdaemon messages config = new KConfig("kcmlaptoprc"); - QVBoxLayout *top_layout = new QVBoxLayout( this, KDialog::marginHint(), + TQVBoxLayout *top_layout = new TQVBoxLayout( this, KDialog::marginHint(), KDialog::spacingHint() ); // TODO: remove linefeed from string, can't do it right now coz we have a string freeze @@ -70,15 +70,15 @@ SonyConfig::SonyConfig(QWidget * parent, const char *name) "'sonypi' device for your laptop - you should not enable the options below if you\nalso " "use the 'sonypid' program in your system").replace("\n", " "), this)); - enableScrollBar = new QCheckBox( i18n("Enable &scroll bar"), this ); - QToolTip::add( enableScrollBar, i18n( "When checked this box enables the scrollbar so that it works under KDE" ) ); + enableScrollBar = new TQCheckBox( i18n("Enable &scroll bar"), this ); + TQToolTip::add( enableScrollBar, i18n( "When checked this box enables the scrollbar so that it works under KDE" ) ); top_layout->addWidget( enableScrollBar ); - connect( enableScrollBar, SIGNAL(clicked()), this, SLOT(configChanged()) ); + connect( enableScrollBar, TQT_SIGNAL(clicked()), this, TQT_SLOT(configChanged()) ); - enableMiddleEmulation = new QCheckBox( i18n("&Emulate middle mouse button with scroll bar press"), this ); - QToolTip::add( enableMiddleEmulation, i18n( "When checked this box enables pressing the scroll bar to act in the same way as pressing the middle button on a 3 button mouse" ) ); + enableMiddleEmulation = new TQCheckBox( i18n("&Emulate middle mouse button with scroll bar press"), this ); + TQToolTip::add( enableMiddleEmulation, i18n( "When checked this box enables pressing the scroll bar to act in the same way as pressing the middle button on a 3 button mouse" ) ); top_layout->addWidget( enableMiddleEmulation ); - connect( enableMiddleEmulation, SIGNAL(clicked()), this, SLOT(configChanged()) ); + connect( enableMiddleEmulation, TQT_SIGNAL(clicked()), this, TQT_SLOT(configChanged()) ); if (::access("/dev/sonypi", R_OK) != 0) { enableMiddleEmulation->setEnabled(0); @@ -87,10 +87,10 @@ SonyConfig::SonyConfig(QWidget * parent, const char *name) // TODO: remove linefeed from string, can't do it right now coz we have a string freeze top_layout->addWidget(new KRichTextLabel(i18n("The /dev/sonypi is not accessable, if you wish to use the above features its\n" "protections need to be changed. Clicking on the button below will change them\n").replace("\n", " "), this)); - QHBoxLayout *ll = new QHBoxLayout(); - QPushButton *setupButton = new QPushButton(i18n("Setup /dev/sonypi"), this); - connect( setupButton, SIGNAL(clicked()), this, SLOT(setupHelper()) ); - QToolTip::add( setupButton, i18n( "This button can be used to enable the sony specific features" ) ); + TQHBoxLayout *ll = new TQHBoxLayout(); + TQPushButton *setupButton = new TQPushButton(i18n("Setup /dev/sonypi"), this); + connect( setupButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(setupHelper()) ); + TQToolTip::add( setupButton, i18n( "This button can be used to enable the sony specific features" ) ); ll->addStretch(2); ll->addWidget(setupButton); ll->addStretch(8); @@ -99,7 +99,7 @@ SonyConfig::SonyConfig(QWidget * parent, const char *name) top_layout->addStretch(1); - top_layout->addWidget( new QLabel( i18n("Version: %1").arg(LAPTOP_VERSION), this), 0, Qt::AlignRight ); + top_layout->addWidget( new TQLabel( i18n("Version: %1").arg(LAPTOP_VERSION), this), 0, Qt::AlignRight ); load(); @@ -107,7 +107,7 @@ SonyConfig::SonyConfig(QWidget * parent, const char *name) void SonyConfig::setupHelper() { - QString kdesu = KStandardDirs::findExe("kdesu"); + TQString kdesu = KStandardDirs::findExe("kdesu"); if (!kdesu.isEmpty()) { int rc = KMessageBox::warningContinueCancel(0, i18n("You will need to supply a root password " @@ -182,7 +182,7 @@ void SonyConfig::configChanged() } -QString SonyConfig::quickHelp() const +TQString SonyConfig::quickHelp() const { return i18n("<h1>Sony Laptop Hardware Setup</h1>This module allows you to configure " "some Sony laptop hardware for your system"); diff --git a/klaptopdaemon/sony.h b/klaptopdaemon/sony.h index ab31065..172798a 100644 --- a/klaptopdaemon/sony.h +++ b/klaptopdaemon/sony.h @@ -26,7 +26,7 @@ #define __SONYCONFIG_H__ #include <kcmodule.h> -#include <qstring.h> +#include <tqstring.h> class QWidget; class QSpinBox; @@ -42,7 +42,7 @@ class SonyConfig : public KCModule { Q_OBJECT public: - SonyConfig( QWidget *parent=0, const char* name=0); + SonyConfig( TQWidget *parent=0, const char* name=0); ~SonyConfig( ); void save( void ); @@ -50,7 +50,7 @@ public: void load(bool useDefaults); void defaults(); - virtual QString quickHelp() const; + virtual TQString quickHelp() const; private slots: @@ -61,9 +61,9 @@ private slots: private: KConfig *config; - QCheckBox *enableScrollBar; + TQCheckBox *enableScrollBar; bool enablescrollbar; - QCheckBox *enableMiddleEmulation; + TQCheckBox *enableMiddleEmulation; bool middleemulation; }; diff --git a/klaptopdaemon/wake_laptop.cpp b/klaptopdaemon/wake_laptop.cpp index 6b2a2b9..8902be8 100644 --- a/klaptopdaemon/wake_laptop.cpp +++ b/klaptopdaemon/wake_laptop.cpp @@ -33,7 +33,7 @@ wake_laptop_daemon() if (!dclient || (!dclient->isAttached() && !dclient->attach())) return; - QByteArray data; - QDataStream arg( data, IO_WriteOnly ); + TQByteArray data; + TQDataStream arg( data, IO_WriteOnly ); (void) dclient->send( "kded", "klaptopdaemon", "restart()", data ); } diff --git a/klaptopdaemon/warning.cpp b/klaptopdaemon/warning.cpp index 29944e0..c098718 100644 --- a/klaptopdaemon/warning.cpp +++ b/klaptopdaemon/warning.cpp @@ -33,18 +33,18 @@ #include <kapplication.h> #include <kcombobox.h> -#include <qlayout.h> -#include <qcheckbox.h> -#include <qspinbox.h> -#include <qslider.h> -#include <qhbox.h> -#include <qvbuttongroup.h> -#include <qradiobutton.h> -#include <qtooltip.h> +#include <tqlayout.h> +#include <tqcheckbox.h> +#include <tqspinbox.h> +#include <tqslider.h> +#include <tqhbox.h> +#include <tqvbuttongroup.h> +#include <tqradiobutton.h> +#include <tqtooltip.h> extern void wake_laptop_daemon(); -WarningConfig::WarningConfig (int t, QWidget * parent, const char *name) +WarningConfig::WarningConfig (int t, TQWidget * parent, const char *name) : KCModule(parent, name), checkSuspend(0), checkStandby(0), @@ -59,7 +59,7 @@ WarningConfig::WarningConfig (int t, QWidget * parent, const char *name) my_load(0); if (!apm) { - QVBoxLayout *top_layout = new QVBoxLayout( this, KDialog::marginHint(), + TQVBoxLayout *top_layout = new TQVBoxLayout( this, KDialog::marginHint(), KDialog::spacingHint() ); KActiveLabel* explain = laptop_portable::no_power_management_explanation(this); @@ -67,7 +67,7 @@ WarningConfig::WarningConfig (int t, QWidget * parent, const char *name) top_layout->addStretch(1); } else { - QGridLayout *grid = new QGridLayout( this, 11, 2, /* rows x cols */ + TQGridLayout *grid = new TQGridLayout( this, 11, 2, /* rows x cols */ KDialog::marginHint(), KDialog::spacingHint() ); grid->setColStretch( 1, 1 ); @@ -75,87 +75,87 @@ WarningConfig::WarningConfig (int t, QWidget * parent, const char *name) int curRow = 0; // setup the trigger stuff: if (type) { - checkCriticalTime = new QCheckBox( i18n("Critical &trigger:"), this ); - checkCriticalPercent = new QCheckBox( i18n("Critical &trigger:"), this ); - editCriticalTime = new QSpinBox(1, 60*24, 1, this); + checkCriticalTime = new TQCheckBox( i18n("Critical &trigger:"), this ); + checkCriticalPercent = new TQCheckBox( i18n("Critical &trigger:"), this ); + editCriticalTime = new TQSpinBox(1, 60*24, 1, this); editCriticalTime->setSuffix(i18n("keep short, unit in spinbox", "min")); - QToolTip::add(editCriticalTime, i18n("When this amount of battery life is left the actions below will be triggered")); - editCriticalPercent = new QSpinBox(1, 100, 1, this); + TQToolTip::add(editCriticalTime, i18n("When this amount of battery life is left the actions below will be triggered")); + editCriticalPercent = new TQSpinBox(1, 100, 1, this); editCriticalPercent->setSuffix(i18n("keep short, unit in spinbox", "%")); - QToolTip::add(editCriticalPercent, i18n("When this amount of battery life is left the actions below will be triggered")); + TQToolTip::add(editCriticalPercent, i18n("When this amount of battery life is left the actions below will be triggered")); grid->addWidget(checkCriticalTime, curRow, 0); grid->addWidget(editCriticalTime, curRow++, Qt::AlignLeft); grid->addWidget(checkCriticalPercent, curRow, 0); grid->addWidget(editCriticalPercent, curRow++, Qt::AlignLeft); - connect(editCriticalTime, SIGNAL(valueChanged(int)), this, SLOT(configChanged())); - connect(editCriticalPercent, SIGNAL(valueChanged(int)), this, SLOT(configChanged())); - connect(checkCriticalTime, SIGNAL(toggled(bool)), this, SLOT(configChanged())); - connect(checkCriticalPercent, SIGNAL(toggled(bool)), this, SLOT(configChanged())); - connect(checkCriticalTime, SIGNAL(toggled(bool)), this, SLOT(checkCriticalTimeChanged(bool))); - connect(checkCriticalPercent, SIGNAL(toggled(bool)), this, SLOT(checkCriticalPercentChanged(bool))); + connect(editCriticalTime, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(configChanged())); + connect(editCriticalPercent, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(configChanged())); + connect(checkCriticalTime, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(configChanged())); + connect(checkCriticalPercent, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(configChanged())); + connect(checkCriticalTime, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(checkCriticalTimeChanged(bool))); + connect(checkCriticalPercent, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(checkCriticalPercentChanged(bool))); } else { - checkLowTime = new QCheckBox( i18n("Low &trigger:"), this ); - checkLowPercent = new QCheckBox( i18n("Low &trigger:"), this ); - editLowTime = new QSpinBox(1, 60*24, 1, this); + checkLowTime = new TQCheckBox( i18n("Low &trigger:"), this ); + checkLowPercent = new TQCheckBox( i18n("Low &trigger:"), this ); + editLowTime = new TQSpinBox(1, 60*24, 1, this); editLowTime->setSuffix(i18n("keep short, unit in spinbox", "min")); - QToolTip::add(editLowTime, i18n("When this amount of battery life is left the actions below will be triggered")); - editLowPercent = new QSpinBox(1, 100, 1, this); + TQToolTip::add(editLowTime, i18n("When this amount of battery life is left the actions below will be triggered")); + editLowPercent = new TQSpinBox(1, 100, 1, this); editLowPercent->setSuffix(i18n("keep short, unit in spinbox", "%")); - QToolTip::add(editLowPercent, i18n("When this amount of battery life is left the actions below will be triggered")); + TQToolTip::add(editLowPercent, i18n("When this amount of battery life is left the actions below will be triggered")); grid->addWidget(checkLowTime, curRow, 0); grid->addWidget(editLowTime, curRow++, Qt::AlignLeft); grid->addWidget(checkLowPercent, curRow, 0); grid->addWidget(editLowPercent, curRow++, Qt::AlignLeft); - connect(editLowTime, SIGNAL(valueChanged(int)), this, SLOT(configChanged())); - connect(editLowPercent, SIGNAL(valueChanged(int)), this, SLOT(configChanged())); - connect(checkLowTime, SIGNAL(toggled(bool)), this, SLOT(configChanged())); - connect(checkLowPercent, SIGNAL(toggled(bool)), this, SLOT(configChanged())); - connect(checkLowTime, SIGNAL(toggled(bool)), this, SLOT(checkLowTimeChanged(bool))); - connect(checkLowPercent, SIGNAL(toggled(bool)), this, SLOT(checkLowPercentChanged(bool))); + connect(editLowTime, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(configChanged())); + connect(editLowPercent, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(configChanged())); + connect(checkLowTime, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(configChanged())); + connect(checkLowPercent, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(configChanged())); + connect(checkLowTime, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(checkLowTimeChanged(bool))); + connect(checkLowPercent, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(checkLowPercentChanged(bool))); } // setup the Run Command stuff - checkRunCommand = new QCheckBox(i18n("Run &command:"), this); + checkRunCommand = new TQCheckBox(i18n("Run &command:"), this); grid->addWidget(checkRunCommand, curRow, 0); editRunCommand = new KURLRequester( this ); editRunCommand->setEnabled(false); - connect( checkRunCommand, SIGNAL(toggled(bool)), - editRunCommand, SLOT(setEnabled(bool)) ); - connect( checkRunCommand, SIGNAL(clicked()), - this, SLOT(configChanged()) ); - connect( editRunCommand, SIGNAL(textChanged(const QString&)), - this, SLOT(configChanged()) ); + connect( checkRunCommand, TQT_SIGNAL(toggled(bool)), + editRunCommand, TQT_SLOT(setEnabled(bool)) ); + connect( checkRunCommand, TQT_SIGNAL(clicked()), + this, TQT_SLOT(configChanged()) ); + connect( editRunCommand, TQT_SIGNAL(textChanged(const TQString&)), + this, TQT_SLOT(configChanged()) ); grid->addWidget(editRunCommand, curRow++, 1); - QToolTip::add( editRunCommand, i18n( "This command will be run when the battery gets low" ) ); + TQToolTip::add( editRunCommand, i18n( "This command will be run when the battery gets low" ) ); // setup the Play Sound stuff - checkPlaySound = new QCheckBox(i18n("&Play sound:"), this); + checkPlaySound = new TQCheckBox(i18n("&Play sound:"), this); grid->addWidget(checkPlaySound, curRow, 0); editPlaySound = new KURLRequester( this ); editPlaySound->setEnabled(false); - connect( checkPlaySound, SIGNAL(toggled(bool)), - editPlaySound, SLOT(setEnabled(bool)) ); - connect( checkPlaySound, SIGNAL(clicked()), - this, SLOT(configChanged()) ); - connect( editPlaySound, SIGNAL(textChanged(const QString&)), - this, SLOT(configChanged()) ); + connect( checkPlaySound, TQT_SIGNAL(toggled(bool)), + editPlaySound, TQT_SLOT(setEnabled(bool)) ); + connect( checkPlaySound, TQT_SIGNAL(clicked()), + this, TQT_SLOT(configChanged()) ); + connect( editPlaySound, TQT_SIGNAL(textChanged(const TQString&)), + this, TQT_SLOT(configChanged()) ); grid->addWidget(editPlaySound, curRow++, 1); - QToolTip::add( editPlaySound, i18n( "This sound will play when the battery gets low" ) ); + TQToolTip::add( editPlaySound, i18n( "This sound will play when the battery gets low" ) ); // setup the System Sound stuff - checkBeep = new QCheckBox(i18n("System &beep"), this); + checkBeep = new TQCheckBox(i18n("System &beep"), this); grid->addWidget(checkBeep, curRow++, 0); - connect(checkBeep, SIGNAL(clicked()), this, SLOT(configChanged())); - QToolTip::add( checkBeep, i18n( "The system will beep if this is enabled" ) ); + connect(checkBeep, TQT_SIGNAL(clicked()), this, TQT_SLOT(configChanged())); + TQToolTip::add( checkBeep, i18n( "The system will beep if this is enabled" ) ); - checkNotify = new QCheckBox(i18n("&Notify"), this); + checkNotify = new TQCheckBox(i18n("&Notify"), this); grid->addWidget(checkNotify, curRow++, 0); - connect(checkNotify, SIGNAL(clicked()), this, SLOT(configChanged())); + connect(checkNotify, TQT_SIGNAL(clicked()), this, TQT_SLOT(configChanged())); int can_suspend = laptop_portable::has_suspend(); int can_standby = laptop_portable::has_standby(); @@ -163,43 +163,43 @@ WarningConfig::WarningConfig (int t, QWidget * parent, const char *name) int can_brightness = laptop_portable::has_brightness(); if (can_brightness) { - checkBrightness = new QCheckBox(i18n("Panel b&rightness"), this); + checkBrightness = new TQCheckBox(i18n("Panel b&rightness"), this); checkBrightness->setMinimumSize(checkBrightness->sizeHint()); - QToolTip::add( checkBrightness, i18n( "If enabled the back panel brightness will change" ) ); + TQToolTip::add( checkBrightness, i18n( "If enabled the back panel brightness will change" ) ); grid->addWidget(checkBrightness, curRow, 0); - connect(checkBrightness, SIGNAL(toggled(bool)), this, SLOT(brightness_changed(bool))); - QHBoxLayout *v = new QHBoxLayout(); - v->addWidget(new QLabel("-", this)); - valueBrightness = new QSlider(0, 255, 16, 160, Qt::Horizontal, this); - QToolTip::add( valueBrightness, i18n( "How bright or dim to make the back panel" ) ); + connect(checkBrightness, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(brightness_changed(bool))); + TQHBoxLayout *v = new TQHBoxLayout(); + v->addWidget(new TQLabel("-", this)); + valueBrightness = new TQSlider(0, 255, 16, 160, Qt::Horizontal, this); + TQToolTip::add( valueBrightness, i18n( "How bright or dim to make the back panel" ) ); valueBrightness->setMaximumWidth(70); v->addWidget(valueBrightness); - v->addWidget(new QLabel("+", this)); + v->addWidget(new TQLabel("+", this)); v->addStretch(1); grid->addLayout(v, curRow, 1); valueBrightness->setEnabled(0); - connect(valueBrightness, SIGNAL(valueChanged(int)), this, SLOT(configChanged())); + connect(valueBrightness, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(configChanged())); ++curRow; } else { checkBrightness = 0; valueBrightness = 0; } - QStringList performance_list; + TQStringList performance_list; int current_performance; bool *active_list; bool has_performance = laptop_portable::get_system_performance(0, current_performance, performance_list, active_list); if (has_performance) { - performance = new QCheckBox(i18n("System performance"), this); - QToolTip::add( performance, i18n( "If enabled the laptop's power performance profile will change" ) ); + performance = new TQCheckBox(i18n("System performance"), this); + TQToolTip::add( performance, i18n( "If enabled the laptop's power performance profile will change" ) ); grid->addWidget(performance, curRow, 0); - connect (performance, SIGNAL(toggled(bool)), this, SLOT(performance_changed(bool))); + connect (performance, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(performance_changed(bool))); - QHBoxLayout *v = new QHBoxLayout(); + TQHBoxLayout *v = new TQHBoxLayout(); performance_val = new KComboBox(0, this); performance_val->insertStringList(performance_list); performance_val->setEnabled(0); - connect (performance_val, SIGNAL(activated(int)), this, SLOT(configChanged())); - QToolTip::add( performance_val, i18n( "The performance profile to change to" ) ); + connect (performance_val, TQT_SIGNAL(activated(int)), this, TQT_SLOT(configChanged())); + TQToolTip::add( performance_val, i18n( "The performance profile to change to" ) ); v->addWidget(performance_val); v->addStretch(1); grid->addLayout(v, curRow, 1); @@ -208,21 +208,21 @@ WarningConfig::WarningConfig (int t, QWidget * parent, const char *name) performance = 0; performance_val = 0; } - QStringList throttle_list; + TQStringList throttle_list; int current_throttle; bool has_throttle = laptop_portable::get_system_throttling(0, current_throttle, throttle_list, active_list); if (has_throttle) { - throttle = new QCheckBox(i18n("CPU throttling"), this); - QToolTip::add( throttle, i18n( "If enabled the CPU performance will be throttled" ) ); + throttle = new TQCheckBox(i18n("CPU throttling"), this); + TQToolTip::add( throttle, i18n( "If enabled the CPU performance will be throttled" ) ); grid->addWidget(throttle, curRow, 0); - connect (throttle, SIGNAL(toggled(bool)), this, SLOT(throttle_changed(bool))); + connect (throttle, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(throttle_changed(bool))); - QHBoxLayout *v = new QHBoxLayout(); + TQHBoxLayout *v = new TQHBoxLayout(); throttle_val = new KComboBox(0, this); throttle_val->insertStringList(throttle_list); throttle_val->setEnabled(0); - connect (throttle_val, SIGNAL(activated(int)), this, SLOT(configChanged())); - QToolTip::add( throttle_val, i18n( "How much to throttle the CPU performance by" ) ); + connect (throttle_val, TQT_SIGNAL(activated(int)), this, TQT_SLOT(configChanged())); + TQToolTip::add( throttle_val, i18n( "How much to throttle the CPU performance by" ) ); v->addWidget(throttle_val); v->addStretch(1); grid->addLayout(v, curRow, 1); @@ -234,47 +234,47 @@ WarningConfig::WarningConfig (int t, QWidget * parent, const char *name) - QVButtonGroup *b = new QVButtonGroup(i18n("System State Change"), this); - QToolTip::add( b, i18n( "You may choose one of the following to occur when the battery gets low" ) ); + TQVButtonGroup *b = new TQVButtonGroup(i18n("System State Change"), this); + TQToolTip::add( b, i18n( "You may choose one of the following to occur when the battery gets low" ) ); b->layout()->setSpacing( KDialog::spacingHint() ); if (can_standby) { - checkStandby = new QRadioButton(i18n("Standb&y"), b); - QToolTip::add( checkStandby, i18n( "Move the system into the standby state - a temporary lower power state" ) ); + checkStandby = new TQRadioButton(i18n("Standb&y"), b); + TQToolTip::add( checkStandby, i18n( "Move the system into the standby state - a temporary lower power state" ) ); checkStandby->setMinimumSize(checkStandby->sizeHint()); - connect(checkStandby, SIGNAL(clicked()), this, SLOT(configChanged())); + connect(checkStandby, TQT_SIGNAL(clicked()), this, TQT_SLOT(configChanged())); } if (can_suspend) { - checkSuspend = new QRadioButton(i18n("&Suspend"), b); - QToolTip::add( checkSuspend, i18n( "Move the system into the suspend state - also known as 'save-to-ram'" ) ); + checkSuspend = new TQRadioButton(i18n("&Suspend"), b); + TQToolTip::add( checkSuspend, i18n( "Move the system into the suspend state - also known as 'save-to-ram'" ) ); checkSuspend->setMinimumSize(checkSuspend->sizeHint()); - connect(checkSuspend, SIGNAL(clicked()), this, SLOT(configChanged())); + connect(checkSuspend, TQT_SIGNAL(clicked()), this, TQT_SLOT(configChanged())); } if (can_hibernate) { - checkHibernate = new QRadioButton(i18n("H&ibernate"), b); - QToolTip::add( checkHibernate, i18n( "Move the system into the hibernate state - also known as 'save-to-disk'" ) ); + checkHibernate = new TQRadioButton(i18n("H&ibernate"), b); + TQToolTip::add( checkHibernate, i18n( "Move the system into the hibernate state - also known as 'save-to-disk'" ) ); checkHibernate->setMinimumSize(checkHibernate->sizeHint()); - connect(checkHibernate, SIGNAL(clicked()), this, SLOT(configChanged())); + connect(checkHibernate, TQT_SIGNAL(clicked()), this, TQT_SLOT(configChanged())); } // setup the logout option - checkLogout = new QRadioButton(i18n("&Logout"), b); - connect(checkLogout, SIGNAL(clicked()), this, SLOT(configChanged())); + checkLogout = new TQRadioButton(i18n("&Logout"), b); + connect(checkLogout, TQT_SIGNAL(clicked()), this, TQT_SLOT(configChanged())); // setup the shutdown option - checkShutdown = new QRadioButton(i18n("System power off"), b); - QToolTip::add( checkShutdown, i18n( "Power the laptop off" ) ); - connect(checkShutdown, SIGNAL(clicked()), this, SLOT(configChanged())); + checkShutdown = new TQRadioButton(i18n("System power off"), b); + TQToolTip::add( checkShutdown, i18n( "Power the laptop off" ) ); + connect(checkShutdown, TQT_SIGNAL(clicked()), this, TQT_SLOT(configChanged())); - checkNone = new QRadioButton(i18n("&None"), b); - connect(checkNone, SIGNAL(clicked()), this, SLOT(configChanged())); + checkNone = new TQRadioButton(i18n("&None"), b); + connect(checkNone, TQT_SIGNAL(clicked()), this, TQT_SLOT(configChanged())); grid->addMultiCellWidget(b, curRow, curRow, 0, 1, Qt::AlignLeft|Qt::AlignTop); curRow++; - QLabel* explain; + TQLabel* explain; if (type) { - explain = new QLabel(i18n("This panel controls how and when you receive warnings that your battery power is going to run out VERY VERY soon."), this); + explain = new TQLabel(i18n("This panel controls how and when you receive warnings that your battery power is going to run out VERY VERY soon."), this); } else { - explain = new QLabel(i18n("This panel controls how and when you receive warnings that your battery power is about to run out"), this); + explain = new TQLabel(i18n("This panel controls how and when you receive warnings that your battery power is about to run out"), this); } explain->setAlignment( Qt::WordBreak ); grid->addMultiCellWidget(explain, curRow, curRow, 0, 1); @@ -282,13 +282,13 @@ WarningConfig::WarningConfig (int t, QWidget * parent, const char *name) if (!can_suspend && !can_standby && !can_hibernate) { // display help text: - QLabel* note = laptop_portable::how_to_do_suspend_resume(this); + TQLabel* note = laptop_portable::how_to_do_suspend_resume(this); grid->addMultiCellWidget(note, curRow, curRow, 0, 1); ++curRow; } grid->setRowStretch(curRow++, 1); - grid->addWidget(new QLabel( i18n("Version: %1").arg(LAPTOP_VERSION), this), + grid->addWidget(new TQLabel( i18n("Version: %1").arg(LAPTOP_VERSION), this), curRow, 1, Qt::AlignRight); } @@ -560,7 +560,7 @@ void WarningConfig::enablePlaySound(bool enable) void WarningConfig::browseRunCommand() { - KURL url = KFileDialog::getOpenURL(QString::null, QString::null, this ); + KURL url = KFileDialog::getOpenURL(TQString::null, TQString::null, this ); if( url.isEmpty() ) return; @@ -577,7 +577,7 @@ void WarningConfig::browseRunCommand() void WarningConfig::browsePlaySound() { - KURL url = KFileDialog::getOpenURL(QString::null, QString::null, this ); + KURL url = KFileDialog::getOpenURL(TQString::null, TQString::null, this ); if( url.isEmpty() ) return; @@ -593,7 +593,7 @@ void WarningConfig::browsePlaySound() } #endif -QString WarningConfig::quickHelp() const +TQString WarningConfig::quickHelp() const { return i18n("<h1>Low battery Warning</h1>This module allows you to " "set an alarm in case your battery's charge is about to run out."); diff --git a/klaptopdaemon/warning.h b/klaptopdaemon/warning.h index 3eb1b04..cdab7ee 100644 --- a/klaptopdaemon/warning.h +++ b/klaptopdaemon/warning.h @@ -27,7 +27,7 @@ #define __WARNINGCONFIG_H__ #include <kcmodule.h> -#include <qstring.h> +#include <tqstring.h> class QWidget; class KConfig; @@ -42,14 +42,14 @@ class WarningConfig : public KCModule { Q_OBJECT public: - WarningConfig(int x, QWidget *parent=0, const char* name=0); + WarningConfig(int x, TQWidget *parent=0, const char* name=0); ~WarningConfig(); void save( void ); void load(); void load(bool useDefaults); void defaults(); - virtual QString quickHelp() const; + virtual TQString quickHelp() const; private slots: void configChanged(); @@ -68,36 +68,36 @@ private: KURLRequester* editRunCommand; KURLRequester* editPlaySound; - QCheckBox* checkLowTime; - QCheckBox* checkLowPercent; - QCheckBox* checkCriticalTime; - QCheckBox* checkCriticalPercent; - QSpinBox* editLowTime; - QSpinBox* editLowPercent; - QSpinBox* editCriticalTime; - QSpinBox* editCriticalPercent; + TQCheckBox* checkLowTime; + TQCheckBox* checkLowPercent; + TQCheckBox* checkCriticalTime; + TQCheckBox* checkCriticalPercent; + TQSpinBox* editLowTime; + TQSpinBox* editLowPercent; + TQSpinBox* editCriticalTime; + TQSpinBox* editCriticalPercent; - QCheckBox *checkRunCommand; - QCheckBox *checkPlaySound; - QCheckBox *checkBeep; - QCheckBox *checkNotify; - QCheckBox *checkBrightness; - QSlider *valueBrightness; - QCheckBox *performance, *throttle; + TQCheckBox *checkRunCommand; + TQCheckBox *checkPlaySound; + TQCheckBox *checkBeep; + TQCheckBox *checkNotify; + TQCheckBox *checkBrightness; + TQSlider *valueBrightness; + TQCheckBox *performance, *throttle; KComboBox *performance_val, *throttle_val; - QRadioButton *checkNone; - QRadioButton *checkShutdown; - QRadioButton *checkLogout; - QRadioButton *checkSuspend; - QRadioButton *checkStandby; - QRadioButton *checkHibernate; + TQRadioButton *checkNone; + TQRadioButton *checkShutdown; + TQRadioButton *checkLogout; + TQRadioButton *checkSuspend; + TQRadioButton *checkStandby; + TQRadioButton *checkHibernate; bool apm, runcommand, playsound, beep, notify, do_suspend, do_standby, do_hibernate, logout, shutdown, do_brightness; bool do_performance, do_throttle; bool time_based_action_low, time_based_action_critical; - QString val_performance, val_throttle; + TQString val_performance, val_throttle; int val_brightness; - QString runcommand_val, sound_val; + TQString runcommand_val, sound_val; int low_val_time, low_val_percent, critical_val_time, critical_val_percent; int have_time, type; }; diff --git a/klaptopdaemon/xautolock.cc b/klaptopdaemon/xautolock.cc index 4f856e1..630b175 100644 --- a/klaptopdaemon/xautolock.cc +++ b/klaptopdaemon/xautolock.cc @@ -165,7 +165,7 @@ void XAutoLock::setTrigger( time_t t ) // // Process new windows and check the mouse. // -void XAutoLock::timerEvent(QTimerEvent *ev) +void XAutoLock::timerEvent(TQTimerEvent *ev) { if (ev->timerId() != mTimerId) { @@ -246,14 +246,14 @@ bool XAutoLock::x11Event( XEvent* ev ) // don't futher process key events that were received only because XAutoLock wants them if( ev->type == KeyPress && !ev->xkey.send_event && !xautolock_useXidle && !xautolock_useMit - && !QWidget::find( ev->xkey.window )) + && !TQWidget::find( ev->xkey.window )) return true; return false; } bool XAutoLock::ignoreWindow( WId w ) { - if( w != qt_xrootwin() && QWidget::find( w )) + if( w != qt_xrootwin() && TQWidget::find( w )) return true; return false; } diff --git a/klaptopdaemon/xautolock.h b/klaptopdaemon/xautolock.h index aa618f2..35b5320 100644 --- a/klaptopdaemon/xautolock.h +++ b/klaptopdaemon/xautolock.h @@ -8,7 +8,7 @@ #ifndef __XAUTOLOCK_H__ #define __XAUTOLOCK_H__ -#include <qwidget.h> +#include <tqwidget.h> #include <X11/Xlib.h> @@ -62,7 +62,7 @@ signals: void timeout(); protected: - virtual void timerEvent(QTimerEvent *ev); + virtual void timerEvent(TQTimerEvent *ev); virtual bool x11Event( XEvent* ); protected: diff --git a/kmilo/asus/asus.cpp b/kmilo/asus/asus.cpp index e1fbfa0..1af8780 100644 --- a/kmilo/asus/asus.cpp +++ b/kmilo/asus/asus.cpp @@ -26,8 +26,8 @@ #include <krun.h> #include <kurl.h> -#include <qfile.h> -#include <qdir.h> +#include <tqfile.h> +#include <tqdir.h> #include "kmilointerface.h" @@ -42,7 +42,7 @@ namespace KMilo { -AsusMonitor::AsusMonitor(QObject* parent, const char* name, const QStringList& args): Monitor(parent, name, args) +AsusMonitor::AsusMonitor(TQObject* parent, const char* name, const TQStringList& args): Monitor(parent, name, args) { } @@ -69,7 +69,7 @@ bool AsusMonitor::init() } #else // we need to read the /proc file system and store the current values into a struct - QDir dir("/proc/acpi/asus"); + TQDir dir("/proc/acpi/asus"); if (!dir.exists()) { kdDebug() << "/proc/acpi/asus doesn't exist, check that the asus_acpi module is loaded" << endl; @@ -172,22 +172,22 @@ bool AsusMonitor::readProc(asus_state_struct* asus_state) if ( sysctl(video_mib, 4, &value, &value_len, NULL, 0) != -1 ) asus_state->display = value; #else - asus_state->brightness = readProcEntry(QString("brn")); - //asus_state->lcd = readProcEntry(QString("lcd")); + asus_state->brightness = readProcEntry(TQString("brn")); + //asus_state->lcd = readProcEntry(TQString("lcd")); //disabled because it does not yet work on my S5200N (asus_acpi bug) - //asus_state->display = readProcEntry(QString("disp")); + //asus_state->display = readProcEntry(TQString("disp")); //FIXME #endif return true; } -int AsusMonitor::readProcEntry(const QString &name) +int AsusMonitor::readProcEntry(const TQString &name) { - QFile f(QString("/proc/acpi/asus/%1").arg(name).local8Bit()); + TQFile f(TQString("/proc/acpi/asus/%1").arg(name).local8Bit()); if (f.open(IO_ReadOnly)) { - QString line; + TQString line; if (f.readLine(line, 1024) > 0) { line = line.stripWhiteSpace(); diff --git a/kmilo/asus/asus.h b/kmilo/asus/asus.h index 90361d8..c809eea 100644 --- a/kmilo/asus/asus.h +++ b/kmilo/asus/asus.h @@ -42,7 +42,7 @@ typedef struct */ class AsusMonitor: public Monitor { public: - AsusMonitor(QObject *parent, const char *name, const QStringList&); + AsusMonitor(TQObject *parent, const char *name, const TQStringList&); virtual ~AsusMonitor(); /** @@ -72,7 +72,7 @@ class AsusMonitor: public Monitor { asus_state_struct asus_state; bool readProc(asus_state_struct* ); - int readProcEntry(const QString &); + int readProcEntry(const TQString &); void clearStruct(asus_state_struct& asus_state); diff --git a/kmilo/delli8k/delli8k.cpp b/kmilo/delli8k/delli8k.cpp index 74c0d60..d63c8c7 100644 --- a/kmilo/delli8k/delli8k.cpp +++ b/kmilo/delli8k/delli8k.cpp @@ -43,7 +43,7 @@ namespace KMilo { -DellI8kMonitor::DellI8kMonitor( QObject* parent, const char* name, const QStringList& args ) +DellI8kMonitor::DellI8kMonitor( TQObject* parent, const char* name, const TQStringList& args ) : Monitor( parent, name, args ) { } diff --git a/kmilo/delli8k/delli8k.h b/kmilo/delli8k/delli8k.h index d33f6ff..424f80a 100644 --- a/kmilo/delli8k/delli8k.h +++ b/kmilo/delli8k/delli8k.h @@ -45,7 +45,7 @@ namespace KMilo { class DellI8kMonitor: public Monitor { public: - DellI8kMonitor( QObject *parent, const char *name, const QStringList& ); + DellI8kMonitor( TQObject *parent, const char *name, const TQStringList& ); virtual ~DellI8kMonitor(); /** diff --git a/kmilo/demo/demo.cpp b/kmilo/demo/demo.cpp index 668d137..c985e08 100644 --- a/kmilo/demo/demo.cpp +++ b/kmilo/demo/demo.cpp @@ -26,7 +26,7 @@ namespace KMilo { -Demo::Demo(QObject *parent, const char *name, const QStringList& args) +Demo::Demo(TQObject *parent, const char *name, const TQStringList& args) : Monitor(parent, name, args) { } diff --git a/kmilo/demo/demo.h b/kmilo/demo/demo.h index 6f57cfc..a1d02d4 100644 --- a/kmilo/demo/demo.h +++ b/kmilo/demo/demo.h @@ -26,7 +26,7 @@ class Demo : public KMilo::Monitor { public: - Demo(QObject *parent, const char *name, const QStringList&); + Demo(TQObject *parent, const char *name, const TQStringList&); virtual ~Demo(); virtual bool init(); diff --git a/kmilo/generic/generic_monitor.cpp b/kmilo/generic/generic_monitor.cpp index bc104dc..14e79e0 100644 --- a/kmilo/generic/generic_monitor.cpp +++ b/kmilo/generic/generic_monitor.cpp @@ -33,16 +33,16 @@ #include "generic_monitor.h" #include "kmilointerface.h" -#include <qmessagebox.h> -#include <qfile.h> -#include <qdir.h> +#include <tqmessagebox.h> +#include <tqfile.h> +#include <tqdir.h> #define CONFIG_FILE "kmilodrc" using namespace KMilo; -GenericMonitor::GenericMonitor(QObject *parent, const char *name, const QStringList& args) +GenericMonitor::GenericMonitor(TQObject *parent, const char *name, const TQStringList& args) : Monitor(parent, name, args) { _poll = false; @@ -79,23 +79,23 @@ bool GenericMonitor::init() return false; // exit early if we are not supposed to run static const ShortcutInfo shortcuts[] = { - { "Search", KShortcut("XF86Search"), SLOT(launchSearch()) }, - { "Home Folder", KShortcut("XF86MyComputer"), SLOT(launchHomeFolder()) }, - { "Mail", KShortcut("XF86Mail"), SLOT(launchMail()) }, - { "Audio Media", KShortcut("XF86AudioMedia"), SLOT(launchMusic()) }, - { "Music", KShortcut("XF86Music"), SLOT(launchMusic()) }, - { "Browser", KShortcut("XF86WWW"), SLOT(launchBrowser()) }, - { "Calculator", KShortcut("XF86Calculator"), SLOT(launchCalculator()) }, - { "Terminal", KShortcut("XF86Terminal"), SLOT(launchTerminal()) }, - { "Eject", KShortcut("XF86Eject"), SLOT(eject()) }, - { "Help", KShortcut("XF86Launch0"), SLOT(launchHelp()) }, - { "Light Bulb", KShortcut("XF86LightBulb"), SLOT(lightBulb()) }, - { "Battery", KShortcut("XF86LaunchB"), SLOT(pmBattery()) }, - { "FastVolumeUp", Qt::Key_VolumeUp, SLOT(fastVolumeUp()) }, - { "FastVolumeDown", Qt::Key_VolumeDown, SLOT(fastVolumeDown()) }, - { "SlowVolumeUp", Qt::CTRL+Qt::Key_VolumeUp, SLOT(slowVolumeUp()) }, - { "SlowVolumeDown", Qt::CTRL+Qt::Key_VolumeDown, SLOT(slowVolumeDown()) }, - { "Mute", KShortcut("XF86AudioMute"), SLOT(mute()) } + { "Search", KShortcut("XF86Search"), TQT_SLOT(launchSearch()) }, + { "Home Folder", KShortcut("XF86MyComputer"), TQT_SLOT(launchHomeFolder()) }, + { "Mail", KShortcut("XF86Mail"), TQT_SLOT(launchMail()) }, + { "Audio Media", KShortcut("XF86AudioMedia"), TQT_SLOT(launchMusic()) }, + { "Music", KShortcut("XF86Music"), TQT_SLOT(launchMusic()) }, + { "Browser", KShortcut("XF86WWW"), TQT_SLOT(launchBrowser()) }, + { "Calculator", KShortcut("XF86Calculator"), TQT_SLOT(launchCalculator()) }, + { "Terminal", KShortcut("XF86Terminal"), TQT_SLOT(launchTerminal()) }, + { "Eject", KShortcut("XF86Eject"), TQT_SLOT(eject()) }, + { "Help", KShortcut("XF86Launch0"), TQT_SLOT(launchHelp()) }, + { "Light Bulb", KShortcut("XF86LightBulb"), TQT_SLOT(lightBulb()) }, + { "Battery", KShortcut("XF86LaunchB"), TQT_SLOT(pmBattery()) }, + { "FastVolumeUp", Qt::Key_VolumeUp, TQT_SLOT(fastVolumeUp()) }, + { "FastVolumeDown", Qt::Key_VolumeDown, TQT_SLOT(fastVolumeDown()) }, + { "SlowVolumeUp", Qt::CTRL+Qt::Key_VolumeUp, TQT_SLOT(slowVolumeUp()) }, + { "SlowVolumeDown", Qt::CTRL+Qt::Key_VolumeDown, TQT_SLOT(slowVolumeDown()) }, + { "Mute", KShortcut("XF86AudioMute"), TQT_SLOT(mute()) } }; ga = new KGlobalAccel(this, "miloGenericAccel"); @@ -105,7 +105,7 @@ bool GenericMonitor::init() for (int i = 0; i < len; i++) { si = shortcuts[i]; - ga->insert(si.name, QString::null, QString::null, + ga->insert(si.name, TQString::null, TQString::null, si.symbol, si.symbol, this, si.slot, false); @@ -310,7 +310,7 @@ void GenericMonitor::mute() return; m_mute = !m_mute; - QString muteText; + TQString muteText; if (m_mute) { muteText = i18n("Mute on"); @@ -335,9 +335,9 @@ Monitor::DisplayType GenericMonitor::poll() return m_displayType; } -void GenericMonitor::launch(QString configKey, QString defaultApplication) +void GenericMonitor::launch(TQString configKey, TQString defaultApplication) { - QString application = config->readEntry(configKey, defaultApplication); + TQString application = config->readEntry(configKey, defaultApplication); KProcess proc; proc << application; proc.start(KProcess::DontCare); @@ -361,7 +361,7 @@ void GenericMonitor::launchSearch() void GenericMonitor::launchHomeFolder() { - QString home = QDir::home().path(); + TQString home = TQDir::home().path(); KProcess proc; proc << "kfmclient" << "exec" << home; proc.start(KProcess::DontCare); diff --git a/kmilo/generic/generic_monitor.h b/kmilo/generic/generic_monitor.h index 1ad5304..6d67ac8 100644 --- a/kmilo/generic/generic_monitor.h +++ b/kmilo/generic/generic_monitor.h @@ -36,7 +36,7 @@ namespace KMilo { -// now the key data (from kkeyserver_x11.h and $QTDIR/include/qnamespace.h) +// now the key data (from kkeyserver_x11.h and $QTDIR/include/tqnamespace.h) struct ShortcutInfo { const char* name; @@ -50,7 +50,7 @@ class GenericMonitor : public Monitor Q_OBJECT public: - GenericMonitor(QObject *parent, const char *name, const QStringList&); + GenericMonitor(TQObject *parent, const char *name, const TQStringList&); virtual ~GenericMonitor(); virtual bool init(); @@ -82,7 +82,7 @@ private: bool retrieveMute(); bool retrieveVolume(); void displayVolume(); - void launch(QString configKey, QString defaultApplication); + void launch(TQString configKey, TQString defaultApplication); KGlobalAccel *ga; KConfig* config; diff --git a/kmilo/kmilo_kvaio/kcmkvaio/main.cpp b/kmilo/kmilo_kvaio/kcmkvaio/main.cpp index ce27c94..4cf9707 100644 --- a/kmilo/kmilo_kvaio/kcmkvaio/main.cpp +++ b/kmilo/kmilo_kvaio/kcmkvaio/main.cpp @@ -19,11 +19,11 @@ * */ -#include <qlabel.h> -#include <qlayout.h> -#include <qcheckbox.h> -#include <qtimer.h> -#include <qslider.h> +#include <tqlabel.h> +#include <tqlayout.h> +#include <tqcheckbox.h> +#include <tqtimer.h> +#include <tqslider.h> #include <dcopclient.h> #include <kgenericfactory.h> @@ -40,13 +40,13 @@ #include "main.h" #include "main.moc" -typedef KGenericFactory<KVaioModule, QWidget> KVaioModuleFactory; +typedef KGenericFactory<KVaioModule, TQWidget> KVaioModuleFactory; K_EXPORT_COMPONENT_FACTORY( kcm_kvaio, KVaioModuleFactory("kcmkvaio")) #define CONFIG_FILE "kmilodrc" -KVaioModule::KVaioModule(QWidget *parent, const char *name, const QStringList &) +KVaioModule::KVaioModule(TQWidget *parent, const char *name, const TQStringList &) : KCModule(KVaioModuleFactory::instance(), parent, name) { KAboutData *about = @@ -61,14 +61,14 @@ KVaioModule::KVaioModule(QWidget *parent, const char *name, const QStringList &) "mirko@kde.org"); setAboutData( about ); - QVBoxLayout *layout = new QVBoxLayout(this); + TQVBoxLayout *layout = new TQVBoxLayout(this); mKVaioGeneral = new KCMKVaioGeneral(this); layout->addWidget( mKVaioGeneral ); layout->addStretch(); mDriver = new KVaioDriverInterface(this); mDriverAvailable = mDriver->connectToDriver(false); - mTimer = new QTimer(this); + mTimer = new TQTimer(this); mTimer->start(231); load(); @@ -82,10 +82,10 @@ KVaioModule::KVaioModule(QWidget *parent, const char *name, const QStringList &) // mKVaioGeneral->frameMain->setEnabled (true); } - connect(mKVaioGeneral, SIGNAL(changed()), - SLOT(changed())); - connect(mTimer, SIGNAL(timeout()), SLOT(timeout())); - connect(mDriver, SIGNAL (vaioEvent(int)), SLOT (vaioEvent(int) ) ); + connect(mKVaioGeneral, TQT_SIGNAL(changed()), + TQT_SLOT(changed())); + connect(mTimer, TQT_SIGNAL(timeout()), TQT_SLOT(timeout())); + connect(mDriver, TQT_SIGNAL (vaioEvent(int)), TQT_SLOT (vaioEvent(int) ) ); } void KVaioModule::save() @@ -108,8 +108,8 @@ void KVaioModule::save() if(mClient.attach()) { - QByteArray data, replyData; - QCString replyType; + TQByteArray data, replyData; + TQCString replyType; if (!mClient.call("kded", "kmilod", "reconfigure()", data, replyType, replyData)) diff --git a/kmilo/kmilo_kvaio/kcmkvaio/main.h b/kmilo/kmilo_kvaio/kcmkvaio/main.h index c19b648..7d47b74 100644 --- a/kmilo/kmilo_kvaio/kcmkvaio/main.h +++ b/kmilo/kmilo_kvaio/kcmkvaio/main.h @@ -33,7 +33,7 @@ class KVaioModule : public KCModule Q_OBJECT public: - KVaioModule(QWidget *parent, const char *name, const QStringList &); + KVaioModule(TQWidget *parent, const char *name, const TQStringList &); void save(); void load(); @@ -46,7 +46,7 @@ protected slots: private: KCMKVaioGeneral *mKVaioGeneral; KVaioDriverInterface *mDriver; - QTimer *mTimer; + TQTimer *mTimer; bool mDriverAvailable; }; diff --git a/kmilo/kmilo_kvaio/kmilo_kvaio.cpp b/kmilo/kmilo_kvaio/kmilo_kvaio.cpp index 6389759..1f4a886 100644 --- a/kmilo/kmilo_kvaio/kmilo_kvaio.cpp +++ b/kmilo/kmilo_kvaio/kmilo_kvaio.cpp @@ -26,8 +26,8 @@ #include "kvaio.h" #include "kmilointerface.h" -KMiloKVaio::KMiloKVaio(QObject *parent, const char *name, - const QStringList& args) +KMiloKVaio::KMiloKVaio(TQObject *parent, const char *name, + const TQStringList& args) : Monitor(parent, name, args), m_kvaio(0) { diff --git a/kmilo/kmilo_kvaio/kmilo_kvaio.h b/kmilo/kmilo_kvaio/kmilo_kvaio.h index fccd7e9..ffcc604 100644 --- a/kmilo/kmilo_kvaio/kmilo_kvaio.h +++ b/kmilo/kmilo_kvaio/kmilo_kvaio.h @@ -37,8 +37,8 @@ class KMiloKVaio : public KMilo::Monitor { // Q_OBJECT public: - KMiloKVaio(QObject *parent, - const char *name, const QStringList&); + KMiloKVaio(TQObject *parent, + const char *name, const TQStringList&); virtual ~KMiloKVaio(); virtual bool init(); @@ -48,11 +48,11 @@ class KMiloKVaio : public KMilo::Monitor { virtual void reconfigure(KConfig*); - bool showTextMsg(const QString& msg) { + bool showTextMsg(const TQString& msg) { _interface->displayText(msg); return true; } - bool showProgressMsg(const QString& msg, int progress) { + bool showProgressMsg(const TQString& msg, int progress) { _interface->displayProgress(msg,progress); return true; } diff --git a/kmilo/kmilo_kvaio/kvaio.cpp b/kmilo/kmilo_kvaio/kvaio.cpp index 8a02098..167ddcb 100644 --- a/kmilo/kmilo_kvaio/kvaio.cpp +++ b/kmilo/kmilo_kvaio/kvaio.cpp @@ -31,10 +31,10 @@ #include "kvaio.h" #include "kmilointerface.h" -#include <qlabel.h> -#include <qcstring.h> -#include <qevent.h> -#include <qdatastream.h> +#include <tqlabel.h> +#include <tqcstring.h> +#include <tqevent.h> +#include <tqdatastream.h> #include <kmainwindow.h> #include <klocale.h> #include <kdebug.h> @@ -56,9 +56,9 @@ extern "C" { KVaio::KVaio(KMiloKVaio *parent, const char* name) - : QObject(parent, name), + : TQObject(parent, name), mDisp(0), - mTimer (new QTimer (this) ) + mTimer (new TQTimer (this) ) { myparent = parent; @@ -70,8 +70,8 @@ KVaio::KVaio(KMiloKVaio *parent, const char* name) kdDebug() << "KVaio: Cannot connect to driver." << endl; } else { kdDebug() << "KVaio: Connected to SonyPI driver." << endl; - connect(mDriver, SIGNAL(vaioEvent(int)), SLOT(slotVaioEvent(int))); - connect (mTimer, SIGNAL (timeout ()), SLOT (slotTimeout() ) ); + connect(mDriver, TQT_SIGNAL(vaioEvent(int)), TQT_SLOT(slotVaioEvent(int))); + connect (mTimer, TQT_SIGNAL (timeout ()), TQT_SLOT (slotTimeout() ) ); mTimer->start (10000, true); } @@ -126,8 +126,8 @@ KVaio::~KVaio() void KVaio::slotVaioEvent(int event) { - QString text; - QTextStream stream(text, IO_WriteOnly); + TQString text; + TQTextStream stream(text, IO_WriteOnly); switch(event) { @@ -174,14 +174,14 @@ void KVaio::slotVaioEvent(int event) } } -bool KVaio::showTextMsg(const QString& msg) +bool KVaio::showTextMsg(const TQString& msg) { return myparent->showTextMsg(msg); } -bool KVaio::showProgressMsg(const QString& msg, int value) +bool KVaio::showProgressMsg(const TQString& msg, int value) { m_progress = value; return myparent->showProgressMsg(msg,value); @@ -193,9 +193,9 @@ void KVaio::blankScreen() if (isKScreensaverAvailable()) { - QByteArray data, replyData; - QDataStream arg(data, IO_WriteOnly); - QCString replyType; + TQByteArray data, replyData; + TQDataStream arg(data, IO_WriteOnly); + TQCString replyType; /* Set the screensave to BlankOnly mode */ blankonly = true; @@ -223,9 +223,9 @@ void KVaio::blankScreen() void KVaio::suspendToDisk() { - QByteArray data, replyData; - QDataStream arg(data, IO_WriteOnly); - QCString replyType; + TQByteArray data, replyData; + TQDataStream arg(data, IO_WriteOnly); + TQCString replyType; mClient.call("kpowersave","KPowersaveIface","do_suspendToDisk()", data, replyType, replyData) ; @@ -340,8 +340,8 @@ bool KVaio::showBatteryStatus ( bool force ) bool displayBatteryMsg = false; bool displayACStatus = false; - QString text, acMsg; - QTextStream stream(text, IO_WriteOnly); + TQString text, acMsg; + TQTextStream stream(text, IO_WriteOnly); // ----- // only display on startup if mReportPowerStatus is true: @@ -584,7 +584,7 @@ void KVaio::mute() m_mute = !m_mute; int newVolume; - QString muteText; + TQString muteText; if (m_mute) { m_oldVolume = m_volume; diff --git a/kmilo/kmilo_kvaio/kvaio.h b/kmilo/kmilo_kvaio/kvaio.h index c16f27e..fac0290 100644 --- a/kmilo/kmilo_kvaio/kvaio.h +++ b/kmilo/kmilo_kvaio/kvaio.h @@ -26,7 +26,7 @@ #include <config.h> #endif -#include <qtimer.h> +#include <tqtimer.h> #include <dcopclient.h> #include <dcopref.h> @@ -57,7 +57,7 @@ class KVaio : public QObject { Q_OBJECT public: -// KVaio(QObject *parent = 0, const char *name =0); +// KVaio(TQObject *parent = 0, const char *name =0); KVaio(KMiloKVaio *parent = 0, const char *name =0); virtual ~KVaio(); @@ -71,8 +71,8 @@ protected: DCOPClient mClient; bool isKScreensaverAvailable(); bool isKMiloDAvailable(); - bool showTextMsg(const QString& msg); - bool showProgressMsg(const QString& msg, int progress); + bool showTextMsg(const TQString& msg); + bool showProgressMsg(const TQString& msg, int progress); bool showBatteryStatus ( bool force = false); protected slots: void slotVaioEvent(int); @@ -107,7 +107,7 @@ private: bool mReportUnknownEvents; bool mReportPowerStatus; bool mShowPowerStatusOnBackButton; - QTimer *mTimer; + TQTimer *mTimer; }; #endif // _KVAIO_H diff --git a/kmilo/kmilo_kvaio/kvaiodriverinterface.cpp b/kmilo/kmilo_kvaio/kvaiodriverinterface.cpp index 32da70a..20a7a72 100644 --- a/kmilo/kmilo_kvaio/kvaiodriverinterface.cpp +++ b/kmilo/kmilo_kvaio/kvaiodriverinterface.cpp @@ -37,7 +37,7 @@ extern "C" { #include "./sonypi.h" } -#include <qsocketnotifier.h> +#include <tqsocketnotifier.h> #include <kdebug.h> // Taken from Stelian Pop's spicctrl utility: @@ -64,8 +64,8 @@ extern "C" { #define SONYPI_IOCGBLUE _IOR('v', 8, __u8) #define SONYPI_IOCSBLUE _IOW('v', 9, __u8) -KVaioDriverInterface::KVaioDriverInterface(QObject *parent) - : QObject(parent), +KVaioDriverInterface::KVaioDriverInterface(TQObject *parent) + : TQObject(parent), mFd(0), mNotifier(0) { @@ -90,8 +90,8 @@ bool KVaioDriverInterface::connectToDriver(bool listen) if(listen) { - mNotifier = new QSocketNotifier(mFd, QSocketNotifier::Read, this); - connect(mNotifier, SIGNAL(activated(int)), SLOT(socketActivated(int))); + mNotifier = new TQSocketNotifier(mFd, TQSocketNotifier::Read, this); + connect(mNotifier, TQT_SIGNAL(activated(int)), TQT_SLOT(socketActivated(int))); } return true; } diff --git a/kmilo/kmilo_kvaio/kvaiodriverinterface.h b/kmilo/kmilo_kvaio/kvaiodriverinterface.h index 55c32b6..9259248 100644 --- a/kmilo/kmilo_kvaio/kvaiodriverinterface.h +++ b/kmilo/kmilo_kvaio/kvaiodriverinterface.h @@ -18,7 +18,7 @@ #ifndef KVAIO_DRIVERINTERFACE_H #define KVAIO_DRIVERINTERFACE_H -#include <qobject.h> +#include <tqobject.h> class QTimer; @@ -35,7 +35,7 @@ class KVaioDriverInterface : public QObject { Q_OBJECT public: - KVaioDriverInterface(QObject *parent=0); + KVaioDriverInterface(TQObject *parent=0); bool connectToDriver(bool listen = true); void disconnectFromDriver(); /** Return the current display brightness, a value between 0 and @@ -51,7 +51,7 @@ public slots: protected: int mFd; fd_set mRfds; - QSocketNotifier *mNotifier; + TQSocketNotifier *mNotifier; signals: void vaioEvent(int); // void brightnessChanged(int); diff --git a/kmilo/kmilod/defaultskin.cpp b/kmilo/kmilod/defaultskin.cpp index a0ef2b0..6667a88 100644 --- a/kmilo/kmilod/defaultskin.cpp +++ b/kmilo/kmilod/defaultskin.cpp @@ -23,11 +23,11 @@ #include "defaultwidget.h" -#include <qprogressbar.h> -#include <qwidget.h> -#include <qwidgetstack.h> -#include <qlabel.h> -#include <qapplication.h> +#include <tqprogressbar.h> +#include <tqwidget.h> +#include <tqwidgetstack.h> +#include <tqlabel.h> +#include <tqapplication.h> #include <kwin.h> #include <netwm.h> @@ -39,10 +39,10 @@ DefaultSkin::DefaultSkin() { - connect(&_timer, SIGNAL(timeout()), this, SLOT(timeout())); + connect(&_timer, TQT_SIGNAL(timeout()), this, TQT_SLOT(timeout())); _widget = new DefaultWidget(0, "Screen Indicator", Qt::WX11BypassWM); - _widget->setFocusPolicy(QWidget::NoFocus); + _widget->setFocusPolicy(TQWidget::NoFocus); KWin::setOnAllDesktops(_widget->winId(), true); KWin::setState( _widget->winId(), NET::StaysOnTop | NET::Sticky @@ -65,11 +65,11 @@ void DefaultSkin::reconfigure( KConfig *config ) { config->setGroup("DefaultSkin"); - QFont *defaultFont = new QFont("Sans", 10, QFont::Bold ); - QSize *defaultSize = new QSize( 80, 30 ); - QColor *defaultpaletteForegroundColor = new QColor( 200, 200, 200 ); - QColor *defaultpaletteBackgroundColor = new QColor( 100, 100, 100 ); - QFont *defaultProgressFont = new QFont("Sans", 8, QFont::Bold ); + TQFont *defaultFont = new TQFont("Sans", 10, TQFont::Bold ); + TQSize *defaultSize = new TQSize( 80, 30 ); + TQColor *defaultpaletteForegroundColor = new TQColor( 200, 200, 200 ); + TQColor *defaultpaletteBackgroundColor = new TQColor( 100, 100, 100 ); + TQFont *defaultProgressFont = new TQFont("Sans", 8, TQFont::Bold ); _widget->resize( config->readSizeEntry("Size", defaultSize ) ); _widget->setFont( config->readFontEntry("Font", defaultFont ) ); @@ -98,20 +98,20 @@ void DefaultSkin::clear() { void DefaultSkin::show() { #if KDE_IS_VERSION(3,1,90) - QRect r = KGlobalSettings::splashScreenDesktopGeometry(); + TQRect r = KGlobalSettings::splashScreenDesktopGeometry(); #else - QRect r = QApplication::desktop()->geometry(); + TQRect r = TQApplication::desktop()->geometry(); #endif // _label->resize(_label->minimumSizeHint()); // _widget->resize(_label->minimumSizeHint()); _widget->move(r.center() - - QPoint(_widget->width()/2, _widget->height()/2)); + TQPoint(_widget->width()/2, _widget->height()/2)); _widget->show(); _timer.start(750, true); } -void DefaultSkin::displayText(const QString& text, const QPixmap& customPixmap) { +void DefaultSkin::displayText(const TQString& text, const TQPixmap& customPixmap) { Q_UNUSED(customPixmap) _timer.stop(); _widget->_widgetStack->raiseWidget(0); @@ -120,7 +120,7 @@ void DefaultSkin::displayText(const QString& text, const QPixmap& customPixmap) } -void DefaultSkin::displayProgress(const QString& text, int percent, const QPixmap& customPixmap) { +void DefaultSkin::displayProgress(const TQString& text, int percent, const TQPixmap& customPixmap) { Q_UNUSED(customPixmap) _timer.stop(); _widget->_progressText->setText(text); diff --git a/kmilo/kmilod/defaultskin.h b/kmilo/kmilod/defaultskin.h index 1610152..62bea16 100644 --- a/kmilo/kmilod/defaultskin.h +++ b/kmilo/kmilod/defaultskin.h @@ -23,14 +23,14 @@ #ifndef _DEFAULTSKIN_H_ #define _DEFAULTSKIN_H_ -#include <qstring.h> -#include <qobject.h> -#include <qtimer.h> +#include <tqstring.h> +#include <tqobject.h> +#include <tqtimer.h> #include "displayskin.h" class DefaultWidget; -class DefaultSkin : public QObject, public KMilo::DisplaySkin { +class DefaultSkin : public TQObject, public KMilo::DisplaySkin { Q_OBJECT public: DefaultSkin(); @@ -39,9 +39,9 @@ class DefaultSkin : public QObject, public KMilo::DisplaySkin { virtual void clear(); virtual void reconfigure( KConfig *config ); - virtual void displayText(const QString& text, const QPixmap& customPixmap=QPixmap()); - virtual void displayProgress(const QString& text, - int percent, const QPixmap& customPixmap=QPixmap()); + virtual void displayText(const TQString& text, const TQPixmap& customPixmap=TQPixmap()); + virtual void displayProgress(const TQString& text, + int percent, const TQPixmap& customPixmap=TQPixmap()); private slots: void timeout(); @@ -50,7 +50,7 @@ class DefaultSkin : public QObject, public KMilo::DisplaySkin { void show(); DefaultWidget *_widget; - QTimer _timer; + TQTimer _timer; }; diff --git a/kmilo/kmilod/displayskin.h b/kmilo/kmilod/displayskin.h index 4e74e0c..46bd445 100644 --- a/kmilo/kmilod/displayskin.h +++ b/kmilo/kmilod/displayskin.h @@ -25,8 +25,8 @@ #include <kdemacros.h> -#include <qstring.h> -#include <qpixmap.h> +#include <tqstring.h> +#include <tqpixmap.h> namespace KMilo { @@ -37,9 +37,9 @@ class KDE_EXPORT DisplaySkin { virtual void clear() = 0; - virtual void displayText(const QString& text,const QPixmap& customPixmap=QPixmap()) = 0; - virtual void displayProgress(const QString& text, - int percent, const QPixmap& customPixmap=QPixmap()) = 0; + virtual void displayText(const TQString& text,const TQPixmap& customPixmap=TQPixmap()) = 0; + virtual void displayProgress(const TQString& text, + int percent, const TQPixmap& customPixmap=TQPixmap()) = 0; }; } diff --git a/kmilo/kmilod/kmilod.cpp b/kmilo/kmilod/kmilod.cpp index 98203b1..aa40b6d 100644 --- a/kmilo/kmilod/kmilod.cpp +++ b/kmilo/kmilod/kmilod.cpp @@ -28,7 +28,7 @@ #include "kmilod.h" #include "monitor.h" -#include <qfile.h> +#include <tqfile.h> #include <klocale.h> #include <kdebug.h> @@ -43,13 +43,13 @@ using namespace KMilo; extern "C" { - KDE_EXPORT KDEDModule *create_kmilod(const QCString &name) { + KDE_EXPORT KDEDModule *create_kmilod(const TQCString &name) { return new KMiloD(name); } } -KMiloD::KMiloD(const QCString &name) : KDEDModule(name), _interval(100) +KMiloD::KMiloD(const TQCString &name) : KDEDModule(name), _interval(100) { _monitors.setAutoDelete(true); _miface = new KMiloInterface(this); @@ -80,7 +80,7 @@ KMiloD::KMiloD(const QCString &name) : KDEDModule(name), _interval(100) } // Start the timer - QObject::connect(&_timer, SIGNAL(timeout()), this, SLOT(doTimer())); + TQObject::connect(&_timer, TQT_SIGNAL(timeout()), this, TQT_SLOT(doTimer())); if (shouldPoll) { _timer.start(_interval); } @@ -192,21 +192,21 @@ void KMiloD::doTimer() { } -void KMiloD::displayText(const QString& text) { - _display->displayText(text, QPixmap()); +void KMiloD::displayText(const TQString& text) { + _display->displayText(text, TQPixmap()); } -void KMiloD::displayText(const QString& text, const QPixmap& customPixmap) { +void KMiloD::displayText(const TQString& text, const TQPixmap& customPixmap) { _display->displayText(text, customPixmap); } -void KMiloD::displayProgress(const QString& text, int progress) { - _display->displayProgress(text, progress, QPixmap()); +void KMiloD::displayProgress(const TQString& text, int progress) { + _display->displayProgress(text, progress, TQPixmap()); } -void KMiloD::displayProgress(const QString& text, int progress, const QPixmap& customPixmap ) { +void KMiloD::displayProgress(const TQString& text, int progress, const TQPixmap& customPixmap ) { _display->displayProgress(text, progress, customPixmap); } diff --git a/kmilo/kmilod/kmilod.h b/kmilo/kmilod/kmilod.h index d97027b..6fdfb52 100644 --- a/kmilo/kmilod/kmilod.h +++ b/kmilo/kmilod/kmilod.h @@ -24,9 +24,9 @@ #define _KMILOD_H_ #include <kdedmodule.h> -#include <qstring.h> -#include <qtimer.h> -#include <qptrlist.h> +#include <tqstring.h> +#include <tqtimer.h> +#include <tqptrlist.h> #include "monitor.h" #include "displayskin.h" @@ -38,7 +38,7 @@ class KMiloD : public KDEDModule { Q_OBJECT K_DCOP public: - KMiloD(const QCString &name); + KMiloD(const TQCString &name); virtual ~KMiloD(); k_dcop: @@ -49,10 +49,10 @@ class KMiloD : public KDEDModule { virtual int pollMilliSeconds() const; virtual bool setPollMilliSeconds(int ms); - virtual void displayText(const QString& text); - virtual void displayText(const QString& text, const QPixmap& customPixmap); - virtual void displayProgress(const QString& text, int progress, const QPixmap& customPixmap); - virtual void displayProgress(const QString& text, int progress); + virtual void displayText(const TQString& text); + virtual void displayText(const TQString& text, const TQPixmap& customPixmap); + virtual void displayProgress(const TQString& text, int progress, const TQPixmap& customPixmap); + virtual void displayProgress(const TQString& text, int progress); virtual void reconfigure(); @@ -60,9 +60,9 @@ class KMiloD : public KDEDModule { virtual void doTimer(); private: - QTimer _timer; + TQTimer _timer; int _interval; - QPtrList<Monitor> _monitors; + TQPtrList<Monitor> _monitors; DisplaySkin *_display; KMiloInterface *_miface; }; diff --git a/kmilo/kmilod/kmilointerface.h b/kmilo/kmilod/kmilointerface.h index d1edbb9..16e1567 100644 --- a/kmilo/kmilod/kmilointerface.h +++ b/kmilo/kmilod/kmilointerface.h @@ -23,28 +23,28 @@ #ifndef _KMILOI_H_ #define _KMILOI_H_ -#include <qobject.h> -#include <qstring.h> +#include <tqobject.h> +#include <tqstring.h> #include "kmilod.h" namespace KMilo { // FIXME: make put the methods into .cpp file when the header is installed. -class KMiloInterface : public QObject { +class KMiloInterface : public TQObject { Q_OBJECT public: - KMiloInterface(KMiloD *p) : QObject() { _p = p; } + KMiloInterface(KMiloD *p) : TQObject() { _p = p; } virtual ~KMiloInterface() {} public slots: int pollMilliSeconds() const { return _p->pollMilliSeconds(); } bool setPollMilliSeconds(int ms) { return _p->setPollMilliSeconds(ms); } - void displayText(const QString& text) { _p->displayText(text); } - void displayText(const QString& text, const QPixmap& customPixmap) { _p->displayText(text, customPixmap); } + void displayText(const TQString& text) { _p->displayText(text); } + void displayText(const TQString& text, const TQPixmap& customPixmap) { _p->displayText(text, customPixmap); } - void displayProgress(const QString& text, int progress, const QPixmap& customPixmap) { _p->displayProgress(text, progress, customPixmap); } - void displayProgress(const QString& text, int progress) { _p->displayProgress(text, progress); } + void displayProgress(const TQString& text, int progress, const TQPixmap& customPixmap) { _p->displayProgress(text, progress, customPixmap); } + void displayProgress(const TQString& text, int progress) { _p->displayProgress(text, progress); } void reconfigure() { _p->reconfigure(); } diff --git a/kmilo/kmilod/monitor.cpp b/kmilo/kmilod/monitor.cpp index f427ce4..84f0e03 100644 --- a/kmilo/kmilod/monitor.cpp +++ b/kmilo/kmilod/monitor.cpp @@ -22,8 +22,8 @@ #include "monitor.h" -KMilo::Monitor::Monitor(QObject *parent, const char *name, const QStringList&) -: QObject(parent, name) { +KMilo::Monitor::Monitor(TQObject *parent, const char *name, const TQStringList&) +: TQObject(parent, name) { _poll = true; } @@ -38,7 +38,7 @@ KMilo::Monitor::DisplayType KMilo::Monitor::poll() { return None; } int KMilo::Monitor::progress() const { return 42; } -QString KMilo::Monitor::message() const { return QString::null; } -QPixmap KMilo::Monitor::customPixmap() const { return QPixmap(); } +TQString KMilo::Monitor::message() const { return TQString::null; } +TQPixmap KMilo::Monitor::customPixmap() const { return TQPixmap(); } bool KMilo::Monitor::init() { return true; } diff --git a/kmilo/kmilod/monitor.h b/kmilo/kmilod/monitor.h index ee1581c..d50045b 100644 --- a/kmilo/kmilod/monitor.h +++ b/kmilo/kmilod/monitor.h @@ -23,10 +23,10 @@ #ifndef _MONITOR_H_ #define _MONITOR_H_ -#include <qstring.h> -#include <qstringlist.h> -#include <qpixmap.h> -#include <qobject.h> +#include <tqstring.h> +#include <tqstringlist.h> +#include <tqpixmap.h> +#include <tqobject.h> #include <kdemacros.h> @@ -35,9 +35,9 @@ class KConfig; namespace KMilo { class KMiloInterface; -class KDE_EXPORT Monitor : public QObject { +class KDE_EXPORT Monitor : public TQObject { public: - Monitor(QObject *parent, const char *name, const QStringList&); + Monitor(TQObject *parent, const char *name, const TQStringList&); virtual ~Monitor(); /** @@ -73,13 +73,13 @@ class KDE_EXPORT Monitor : public QObject { * Message displayed for DisplayType's that are not int * measurable ( DisplayType::Tap for example ) */ - virtual QString message() const; + virtual TQString message() const; /** * Custom pixmap that can be displayed be the themes * when displaying the DisplayType. */ - virtual QPixmap customPixmap() const; + virtual TQPixmap customPixmap() const; bool shouldPoll() const { return _poll; } diff --git a/kmilo/powerbook/pb_monitor.cpp b/kmilo/powerbook/pb_monitor.cpp index 6279854..5b1fae2 100644 --- a/kmilo/powerbook/pb_monitor.cpp +++ b/kmilo/powerbook/pb_monitor.cpp @@ -33,7 +33,7 @@ extern "C" { namespace KMilo { -PowerBookMonitor::PowerBookMonitor(QObject *parent, const char *name, const QStringList& args) +PowerBookMonitor::PowerBookMonitor(TQObject *parent, const char *name, const TQStringList& args) : Monitor(parent, name, args) { _serverPort = -1; _clientPort = -1; diff --git a/kmilo/powerbook/pb_monitor.h b/kmilo/powerbook/pb_monitor.h index 6d2736d..13b9885 100644 --- a/kmilo/powerbook/pb_monitor.h +++ b/kmilo/powerbook/pb_monitor.h @@ -26,7 +26,7 @@ class PowerBookMonitor : public KMilo::Monitor { public: - PowerBookMonitor(QObject *parent, const char *name, const QStringList&); + PowerBookMonitor(TQObject *parent, const char *name, const TQStringList&); virtual ~PowerBookMonitor(); virtual bool init(); diff --git a/kmilo/powerbook2/pb_monitor.cpp b/kmilo/powerbook2/pb_monitor.cpp index 84c72d5..340d38b 100644 --- a/kmilo/powerbook2/pb_monitor.cpp +++ b/kmilo/powerbook2/pb_monitor.cpp @@ -45,12 +45,12 @@ extern "C" { } #define BUFFERLEN 200 -const QString tpmodes[] = { I18N_NOOP("No Tap"), I18N_NOOP("Tap"), I18N_NOOP("Drag"), I18N_NOOP("Lock") }; +const TQString tpmodes[] = { I18N_NOOP("No Tap"), I18N_NOOP("Tap"), I18N_NOOP("Drag"), I18N_NOOP("Lock") }; namespace KMilo { -PowerBookMonitor::PowerBookMonitor(QObject *parent, const char *name, - const QStringList& args) +PowerBookMonitor::PowerBookMonitor(TQObject *parent, const char *name, + const TQStringList& args) : Monitor(parent, name, args), m_progress( 0 ) { @@ -79,7 +79,7 @@ Monitor::DisplayType PowerBookMonitor::poll() Monitor::DisplayType rc = None; // Drain the queue, send the last message struct tagitem* tag = readMessage(); - m_message = QString::null; + m_message = TQString::null; while ( tag && tag->tag != TAG_END ) { switch ( tag->tag ) { case TAG_VOLUME: @@ -97,7 +97,7 @@ Monitor::DisplayType PowerBookMonitor::poll() case TAG_TPMODE: { rc = Monitor::Tap; - QString marg = tpmodes[ tag->data & 3 ]; + TQString marg = tpmodes[ tag->data & 3 ]; m_message = i18n( "Operating mode set to: %1." ).arg( marg ); } break; @@ -120,7 +120,7 @@ int PowerBookMonitor::progress() const return m_progress; } -QString PowerBookMonitor::message() const +TQString PowerBookMonitor::message() const { return m_message; } diff --git a/kmilo/powerbook2/pb_monitor.h b/kmilo/powerbook2/pb_monitor.h index a6bf651..e9dfb71 100644 --- a/kmilo/powerbook2/pb_monitor.h +++ b/kmilo/powerbook2/pb_monitor.h @@ -34,19 +34,19 @@ namespace KMilo { class PowerBookMonitor : public KMilo::Monitor { public: - PowerBookMonitor(QObject *parent, const char *name, const QStringList&); + PowerBookMonitor(TQObject *parent, const char *name, const TQStringList&); virtual ~PowerBookMonitor(); virtual bool init(); virtual DisplayType poll(); virtual int progress() const; - virtual QString message() const; + virtual TQString message() const; private: struct tagitem* readMessage(); private: int m_progress; - QString m_message; + TQString m_message; bool m_sleep; }; diff --git a/kmilo/thinkpad/kcmthinkpad/main.cpp b/kmilo/thinkpad/kcmthinkpad/main.cpp index 1b8b4bd..b98dc28 100644 --- a/kmilo/thinkpad/kcmthinkpad/main.cpp +++ b/kmilo/thinkpad/kcmthinkpad/main.cpp @@ -22,12 +22,12 @@ * */ -#include <qlabel.h> -#include <qlayout.h> -#include <qcheckbox.h> -#include <qspinbox.h> -#include <qfile.h> -#include <qbuttongroup.h> +#include <tqlabel.h> +#include <tqlayout.h> +#include <tqcheckbox.h> +#include <tqspinbox.h> +#include <tqfile.h> +#include <tqbuttongroup.h> #include <dcopclient.h> #include <kgenericfactory.h> @@ -49,12 +49,12 @@ #include "main.h" #include "main.moc" -typedef KGenericFactory<KCMThinkpadModule, QWidget> KCMThinkpadModuleFactory; +typedef KGenericFactory<KCMThinkpadModule, TQWidget> KCMThinkpadModuleFactory; K_EXPORT_COMPONENT_FACTORY( kcm_thinkpad, KCMThinkpadModuleFactory("kcmthinkpad")) #define CONFIG_FILE "kmilodrc" -KCMThinkpadModule::KCMThinkpadModule(QWidget* parent, const char* name, const QStringList&) +KCMThinkpadModule::KCMThinkpadModule(TQWidget* parent, const char* name, const TQStringList&) : KCModule(KCMThinkpadModuleFactory::instance(), parent, name) { KAboutData* about = new KAboutData(I18N_NOOP("kcmthinkpad"), @@ -68,7 +68,7 @@ KCMThinkpadModule::KCMThinkpadModule(QWidget* parent, const char* name, const QS "jr@jriddell.org"); setAboutData( about ); - QVBoxLayout* layout = new QVBoxLayout(this); + TQVBoxLayout* layout = new TQVBoxLayout(this); m_KCMThinkpadGeneral = new KCMThinkpadGeneral(this); layout->addWidget( m_KCMThinkpadGeneral ); layout->addStretch(); @@ -97,7 +97,7 @@ KCMThinkpadModule::KCMThinkpadModule(QWidget* parent, const char* name, const QS "R30/R31 models, or using a custom volume " "change step is disabled.")); #else - QFile nvramFile(m_nvramFile); + TQFile nvramFile(m_nvramFile); if ( nvramFile.open(IO_ReadOnly) ) { m_nvramReadable = true; nvramFile.close(); @@ -122,7 +122,7 @@ KCMThinkpadModule::KCMThinkpadModule(QWidget* parent, const char* name, const QS m_KCMThinkpadGeneral->tlOff->setText(i18n("Thinkpad Buttons KMilo Plugin Ready For Configuration")); } - connect( m_KCMThinkpadGeneral, SIGNAL(changed()), SLOT(changed())); + connect( m_KCMThinkpadGeneral, TQT_SIGNAL(changed()), TQT_SLOT(changed())); } @@ -146,8 +146,8 @@ void KCMThinkpadModule::save() { config.sync(); if (client.attach()) { - QByteArray data, replyData; - QCString replyType; + TQByteArray data, replyData; + TQCString replyType; if (!client.call("kded", "kmilod", "reconfigure()", data, replyType, replyData)) { kdDebug() << "KCMThinkpad::showTextMsg: " diff --git a/kmilo/thinkpad/kcmthinkpad/main.h b/kmilo/thinkpad/kcmthinkpad/main.h index 53534ed..1fdedb5 100644 --- a/kmilo/thinkpad/kcmthinkpad/main.h +++ b/kmilo/thinkpad/kcmthinkpad/main.h @@ -33,7 +33,7 @@ class KCMThinkpadModule : public KCModule { Q_OBJECT public: - KCMThinkpadModule(QWidget* parent, const char* name, const QStringList&); + KCMThinkpadModule(TQWidget* parent, const char* name, const TQStringList&); void save(); void load(); @@ -41,7 +41,7 @@ class KCMThinkpadModule : public KCModule { void defaults(); private: KCMThinkpadGeneral* m_KCMThinkpadGeneral; - QString m_nvramFile; + TQString m_nvramFile; bool m_nvramReadable; bool m_nvramWriteable; }; diff --git a/kmilo/thinkpad/thinkpad.cpp b/kmilo/thinkpad/thinkpad.cpp index 74770cf..034c6bd 100644 --- a/kmilo/thinkpad/thinkpad.cpp +++ b/kmilo/thinkpad/thinkpad.cpp @@ -43,7 +43,7 @@ namespace KMilo { -ThinkPadMonitor::ThinkPadMonitor(QObject* parent, const char* name, const QStringList& args): Monitor(parent, name, args) { +ThinkPadMonitor::ThinkPadMonitor(TQObject* parent, const char* name, const TQStringList& args): Monitor(parent, name, args) { m_progress = 0; m_volume = 50; //set in retrieveVolume() } @@ -265,7 +265,7 @@ int ThinkPadMonitor::progress() const { return m_progress; } -QString ThinkPadMonitor::message() const { +TQString ThinkPadMonitor::message() const { //unused //return i18n("yer maw!"); return ""; @@ -426,8 +426,8 @@ void ThinkPadMonitor::clearStruct(thinkpad_state_struct& thinkpad_state) { thinkpad_state.bluetooth_toggle = 0; } -void ThinkPadMonitor::showToggleMessage(QString onMessage, QString offMessage, bool state) { - QString message; +void ThinkPadMonitor::showToggleMessage(TQString onMessage, TQString offMessage, bool state) { + TQString message; if (state) { message = onMessage; } else { diff --git a/kmilo/thinkpad/thinkpad.h b/kmilo/thinkpad/thinkpad.h index f195b2e..dc843ca 100644 --- a/kmilo/thinkpad/thinkpad.h +++ b/kmilo/thinkpad/thinkpad.h @@ -83,7 +83,7 @@ typedef struct { */ class ThinkPadMonitor : public Monitor { public: - ThinkPadMonitor(QObject *parent, const char *name, const QStringList&); + ThinkPadMonitor(TQObject *parent, const char *name, const TQStringList&); virtual ~ThinkPadMonitor(); /** @@ -109,7 +109,7 @@ class ThinkPadMonitor : public Monitor { * Reimplemented from KMilo::Monitor. * Not used, we just set the message ourselves using _interface->displayText() */ - virtual QString message() const; + virtual TQString message() const; protected: /** * Reimplemented from KMilo::Monitor. @@ -136,7 +136,7 @@ class ThinkPadMonitor : public Monitor { * Displays paramater message followed by 'on' or * 'off' depending on state */ - void showToggleMessage(QString onMessage, QString offMessage, bool state); + void showToggleMessage(TQString onMessage, TQString offMessage, bool state); /** * Returned by progress() @@ -146,7 +146,7 @@ class ThinkPadMonitor : public Monitor { /** * The file to read data from, default is /dev/nvram */ - QString m_nvramFile; + TQString m_nvramFile; /** * Some thinkpads change volume in hardware, others we @@ -168,27 +168,27 @@ class ThinkPadMonitor : public Monitor { /** * Thinkpad button */ - QString m_buttonThinkpad; + TQString m_buttonThinkpad; /** * Home button */ - QString m_buttonHome; + TQString m_buttonHome; /** * Search button */ - QString m_buttonSearch; + TQString m_buttonSearch; /** * Mail button */ - QString m_buttonMail; + TQString m_buttonMail; /** * Zoom button */ - QString m_buttonZoom; + TQString m_buttonZoom; /** * Used for changing the volume if m_softwareVolume is true diff --git a/kregexpeditor/KMultiFormListBox/ccp.cpp b/kregexpeditor/KMultiFormListBox/ccp.cpp index d64a3b2..d868591 100644 --- a/kregexpeditor/KMultiFormListBox/ccp.cpp +++ b/kregexpeditor/KMultiFormListBox/ccp.cpp @@ -21,28 +21,28 @@ #include "kmultiformlistbox-multivisible.h" #include "ccp.h" -#include <qobjectlist.h> -#include <qpopupmenu.h> +#include <tqobjectlist.h> +#include <tqpopupmenu.h> #ifdef QT_ONLY #include "compat.h" #else #include <klocale.h> #endif -CCP::CCP(KMultiFormListBoxMultiVisible *ee_, KMultiFormListBoxEntry *eee_) : QObject() { +CCP::CCP(KMultiFormListBoxMultiVisible *ee_, KMultiFormListBoxEntry *eee_) : TQObject() { ee = ee_; eee = eee_; install(eee); } -void CCP::install(QObject *elm) +void CCP::install(TQObject *elm) { elm->installEventFilter(this); - const QObjectList *children = elm->children(); + const TQObjectList *children = elm->children(); if (children) { - QObjectListIt it = QObjectListIt(*children); + TQObjectListIt it = TQObjectListIt(*children); - while (QObject *child=it.current()) { + while (TQObject *child=it.current()) { if (child->inherits("KMultiFormListBoxMultiVisible")) { // Stop if the widget is an KMultiFormListBox, as this widget has its own cut/copy/paste } @@ -55,17 +55,17 @@ void CCP::install(QObject *elm) } // This function post the Cut/Copy/Paste menu -bool CCP::eventFilter(QObject *, QEvent *event) +bool CCP::eventFilter(TQObject *, TQEvent *event) { - if (event->type() != QEvent::MouseButtonPress || - ((QMouseEvent *) event)->button() != RightButton || - ((QMouseEvent *) event)->state() != QEvent::ControlButton) { + if (event->type() != TQEvent::MouseButtonPress || + ((TQMouseEvent *) event)->button() != RightButton || + ((TQMouseEvent *) event)->state() != TQEvent::ControlButton) { return false; } - QPoint pos = ((QMouseEvent *) event)->globalPos(); + TQPoint pos = ((TQMouseEvent *) event)->globalPos(); - QPopupMenu *menu = new QPopupMenu(); + TQPopupMenu *menu = new TQPopupMenu(); menu->insertItem(i18n("Cut"),1); menu->insertItem(i18n("Copy"),2); menu->insertItem(i18n("Paste"),3); diff --git a/kregexpeditor/KMultiFormListBox/ccp.h b/kregexpeditor/KMultiFormListBox/ccp.h index 41857a5..2c249c9 100644 --- a/kregexpeditor/KMultiFormListBox/ccp.h +++ b/kregexpeditor/KMultiFormListBox/ccp.h @@ -38,7 +38,7 @@ @internal **/ -class CCP :public QObject { +class CCP :public TQObject { private: friend class KMultiFormListBoxMultiVisible; @@ -48,8 +48,8 @@ private: **/ CCP(KMultiFormListBoxMultiVisible *,KMultiFormListBoxEntry *); - void install(QObject *); - bool eventFilter(QObject *, QEvent *); + void install(TQObject *); + bool eventFilter(TQObject *, TQEvent *); // Instance variables. diff --git a/kregexpeditor/KMultiFormListBox/indexWindow.cpp b/kregexpeditor/KMultiFormListBox/indexWindow.cpp index 362d012..dccb184 100644 --- a/kregexpeditor/KMultiFormListBox/indexWindow.cpp +++ b/kregexpeditor/KMultiFormListBox/indexWindow.cpp @@ -24,13 +24,13 @@ #include "indexWindow.h" #include <iostream> -#include <qlayout.h> +#include <tqlayout.h> -indexWindow::indexWindow() : QWidget(0,"", WStyle_Customize | WType_Popup) +indexWindow::indexWindow() : TQWidget(0,"", WStyle_Customize | WType_Popup) { - lb = new QListBox(this); - connect(lb,SIGNAL(selected(int)), this, SLOT(lbSelected(int))); - QHBoxLayout *lay = new QHBoxLayout(this); + lb = new TQListBox(this); + connect(lb,TQT_SIGNAL(selected(int)), this, TQT_SLOT(lbSelected(int))); + TQHBoxLayout *lay = new TQHBoxLayout(this); lay->addWidget(lb); lbFinish = false; } @@ -50,20 +50,20 @@ void indexWindow::finish(int index) } -void indexWindow::insertItem(QString txt) +void indexWindow::insertItem(TQString txt) { lb->insertItem(txt); } -void indexWindow::hideEvent(QHideEvent *h) +void indexWindow::hideEvent(TQHideEvent *h) { - QWidget::hideEvent(h); + TQWidget::hideEvent(h); if (!lbFinish) finish(-1); } -int indexWindow::exec(const QPoint & /*start*/, int /*width*/) +int indexWindow::exec(const TQPoint & /*start*/, int /*width*/) { // This code is not xinerama safe, on the other hand this part of the widget // is not used in KRegExpEditor. This is part of a widget which has @@ -76,7 +76,7 @@ int indexWindow::exec(const QPoint & /*start*/, int /*width*/) int elm_h = lb->item(0)->height(lb) * lb->count(); elm_h += 2*lb->frameWidth(); - QWidget *desktop = QApplication::desktop(); + TQWidget *desktop = TQApplication::desktop(); int desktop_h = desktop->height(); int rest_h = desktop_h - start.y(); int below_h = QMAX(rest_h, 200); diff --git a/kregexpeditor/KMultiFormListBox/indexWindow.h b/kregexpeditor/KMultiFormListBox/indexWindow.h index 3597960..ab20e73 100644 --- a/kregexpeditor/KMultiFormListBox/indexWindow.h +++ b/kregexpeditor/KMultiFormListBox/indexWindow.h @@ -18,7 +18,7 @@ #ifndef __indexWindow #define __indexWindow -#include <qlistbox.h> +#include <tqlistbox.h> /** Post a toplevel listbox synchronously. @@ -29,12 +29,12 @@ This widget takes care of posting this listbox, and ensuring that the user can not do anything else before he has chosen an element. - This widget resembles the behavior of @ref QPopupMenu, the difference - is, however, that the QPopupMenu can not handle that the elements in the + This widget resembles the behavior of @ref TQPopupMenu, the difference + is, however, that the TQPopupMenu can not handle that the elements in the menu exceed the size of the screen. This widget can. - In the future this widget may be replaced with the QPopupMenu if the - QPopupMenu can handle this situation. But for now - it works! + In the future this widget may be replaced with the TQPopupMenu if the + TQPopupMenu can handle this situation. But for now - it works! @internal **/ @@ -49,7 +49,7 @@ public: This method inserts an element into the listbox which is shown when the @ref exec method is invoked. **/ - void insertItem(QString txt); + void insertItem(TQString txt); /** This function shows the index window with the elements inserted using @@ -63,17 +63,17 @@ public: @return The index of the element chosen, or -1 if no element has been chosen. **/ - int exec(const QPoint &start, int width); + int exec(const TQPoint &start, int width); protected: void finish(int retVal); - virtual void hideEvent(QHideEvent *h); + virtual void hideEvent(TQHideEvent *h); protected slots: void lbSelected(int); private: - QListBox *lb; + TQListBox *lb; bool lbFinish; int itemSelected; diff --git a/kregexpeditor/KMultiFormListBox/kmultiformlistbox-multivisible.cpp b/kregexpeditor/KMultiFormListBox/kmultiformlistbox-multivisible.cpp index 335863b..4a740c5 100644 --- a/kregexpeditor/KMultiFormListBox/kmultiformlistbox-multivisible.cpp +++ b/kregexpeditor/KMultiFormListBox/kmultiformlistbox-multivisible.cpp @@ -18,7 +18,7 @@ #ifdef QT_ONLY #include "compat.h" - #include <qmessagebox.h> + #include <tqmessagebox.h> #else #include <kmessagebox.h> #include "kmultiformlistbox-multivisible.moc" @@ -28,7 +28,7 @@ #include "indexWindow.h" #include "ccp.h" -#include <qbitmap.h> +#include <tqbitmap.h> const int indexButtonWidth = 16; const int indexButtonHeight = 12; @@ -38,8 +38,8 @@ const uchar indexButtonBits[] = { }; -KMultiFormListBoxMultiVisible::KMultiFormListBoxMultiVisible(KMultiFormListBoxFactory *fact, QWidget *parent, const char *name) - : QScrollView(parent, name) +KMultiFormListBoxMultiVisible::KMultiFormListBoxMultiVisible(KMultiFormListBoxFactory *fact, TQWidget *parent, const char *name) + : TQScrollView(parent, name) { factory = fact; @@ -59,7 +59,7 @@ KMultiFormListBoxMultiVisible::KMultiFormListBoxMultiVisible(KMultiFormListBoxFa KMultiFormListBoxEntryList KMultiFormListBoxMultiVisible::elements() { KMultiFormListBoxEntryList res; - for (QWidget *child = elms->first(); child; child=elms->next()) { + for (TQWidget *child = elms->first(); child; child=elms->next()) { if (strcmp(child->name(),"seperator") != 0) { res.append((KMultiFormListBoxEntry *) child); } @@ -72,10 +72,10 @@ KMultiFormListBoxEntryList KMultiFormListBoxMultiVisible::elements() // This function is called whenever the KMultiFormListBox widget is resized. It is // necessary to ensure that the content of the clipper is resized. //---------------------------------------------------------------------- -void KMultiFormListBoxMultiVisible::resizeEvent(QResizeEvent *e) +void KMultiFormListBoxMultiVisible::resizeEvent(TQResizeEvent *e) { // The call of the super class ensures that the outer border is updated. - QScrollView::resizeEvent(e); + TQScrollView::resizeEvent(e); updateClipperContent(); } @@ -93,7 +93,7 @@ void KMultiFormListBoxMultiVisible::updateClipperContent() // calculate the required size. - for (QWidget *child = elms->first(); child; child=elms->next()) { + for (TQWidget *child = elms->first(); child; child=elms->next()) { maxWidth = QMAX(maxWidth, child->sizeHint().width()); if (strcmp(child->name(), "seperator") != 0) { totalHeight += child->sizeHint().height(); @@ -113,7 +113,7 @@ void KMultiFormListBoxMultiVisible::updateClipperContent() // Now place the elements in the clipper. int yPos = 0; - for (QWidget *child2 = elms->first(); child2; child2=elms->next()) { + for (TQWidget *child2 = elms->first(); child2; child2=elms->next()) { int h; if ( strcmp(child2->name(),"seperator") != 0) { h = child2->sizeHint().height(); @@ -148,14 +148,14 @@ void KMultiFormListBoxMultiVisible::addElement(KMultiFormListBoxEntry *after) void KMultiFormListBoxMultiVisible::append(KMultiFormListBoxEntry *elm) { - elm->reparent(viewport(), 0, QPoint(0,0), false); + elm->reparent(viewport(), 0, TQPoint(0,0), false); insertElmIntoWidget(elm, 0); } -void KMultiFormListBoxMultiVisible::delElement(QWidget *elm) +void KMultiFormListBoxMultiVisible::delElement(TQWidget *elm) { int index = elms->find(elm); - QWidget *next = elms->at(index+1); + TQWidget *next = elms->at(index+1); if (strcmp(next->name(),"seperator") != 0) { elms->removeRef(next); removeChild(next); @@ -176,11 +176,11 @@ void KMultiFormListBoxMultiVisible::insertElmIntoWidget(KMultiFormListBoxEntry * { // Bind the index button if it exists. if (elm->indexButton()) { - elm->indexButton()->setPixmap(QBitmap(indexButtonWidth, indexButtonHeight, + elm->indexButton()->setPixmap(TQBitmap(indexButtonWidth, indexButtonHeight, indexButtonBits, true)); - connect(elm->indexButton(), SIGNAL(clicked()), elm, SLOT(acceptIndexButton())); - connect(elm, SIGNAL(gotoIndex(KMultiFormListBoxEntry *)), - this, SLOT(showIndexList(KMultiFormListBoxEntry *))); + connect(elm->indexButton(), TQT_SIGNAL(clicked()), elm, TQT_SLOT(acceptIndexButton())); + connect(elm, TQT_SIGNAL(gotoIndex(KMultiFormListBoxEntry *)), + this, TQT_SLOT(showIndexList(KMultiFormListBoxEntry *))); } // Find the location to insert the new element. @@ -194,7 +194,7 @@ void KMultiFormListBoxMultiVisible::insertElmIntoWidget(KMultiFormListBoxEntry * elm->show(); addChild(elm,0,0); // updateClipperContent will place the child correctly. - QWidget *sep = factory->separator(viewport()); + TQWidget *sep = factory->separator(viewport()); if (sep != 0) { sep->setName("seperator"); sep->show(); @@ -219,15 +219,15 @@ void KMultiFormListBoxMultiVisible::showIndexList(KMultiFormListBoxEntry *elm) indexWindow *menu = new indexWindow(); // Insert the elements into the menu item. - for (QWidget *child = elms->first(); child; child=elms->next()) { + for (TQWidget *child = elms->first(); child; child=elms->next()) { if ( strcmp(child->name(), "seperator") != 0) { - QString txt = ((KMultiFormListBoxEntry *) child)->idxString(); + TQString txt = ((KMultiFormListBoxEntry *) child)->idxString(); menu->insertItem(txt); } } // Calculate the location of the window - QPoint start; + TQPoint start; int width; elm->indexWindowPos(&start, &width); @@ -235,7 +235,7 @@ void KMultiFormListBoxMultiVisible::showIndexList(KMultiFormListBoxEntry *elm) int index = menu->exec(start,width); if (index != -1) { - for (QWidget *child = elms->first(); child; child=elms->next()) { + for (TQWidget *child = elms->first(); child; child=elms->next()) { if ( strcmp(child->name(), "seperator") != 0) { if (index == 0) { @@ -265,14 +265,14 @@ void KMultiFormListBoxMultiVisible::cut(KMultiFormListBoxEntry *elm) return; } - QDataStream stream(clipboard, IO_WriteOnly); + TQDataStream stream(clipboard, IO_WriteOnly); factory->toStream( elm, stream ); delElement(elm); } void KMultiFormListBoxMultiVisible::copy(KMultiFormListBoxEntry *elm) { - QDataStream stream(clipboard, IO_WriteOnly); + TQDataStream stream(clipboard, IO_WriteOnly); factory->toStream(elm, stream); } @@ -284,7 +284,7 @@ void KMultiFormListBoxMultiVisible::paste(KMultiFormListBoxEntry *oldElm) } KMultiFormListBoxEntry *newElm = factory->create(viewport()); - QDataStream stream( clipboard, IO_ReadOnly ); + TQDataStream stream( clipboard, IO_ReadOnly ); factory->fromStream(stream, newElm); insertElmIntoWidget(newElm,oldElm); } @@ -294,7 +294,7 @@ int KMultiFormListBoxMultiVisible::countElements(WidgetList *elms) { int count = 0; - for (QWidget *child = elms->first(); child; child=elms->next()) { + for (TQWidget *child = elms->first(); child; child=elms->next()) { if (dynamic_cast<const KMultiFormListBoxEntry *>(child)) count++; } diff --git a/kregexpeditor/KMultiFormListBox/kmultiformlistbox-multivisible.h b/kregexpeditor/KMultiFormListBox/kmultiformlistbox-multivisible.h index 87aeba4..309044a 100644 --- a/kregexpeditor/KMultiFormListBox/kmultiformlistbox-multivisible.h +++ b/kregexpeditor/KMultiFormListBox/kmultiformlistbox-multivisible.h @@ -32,7 +32,7 @@ /** @internal */ -class KMultiFormListBoxMultiVisible :public QScrollView, KMultiFormListBoxShower { +class KMultiFormListBoxMultiVisible :public TQScrollView, KMultiFormListBoxShower { Q_OBJECT @@ -44,7 +44,7 @@ private: class which is repeated in the KMultiFormListBox @param parent A pointer to the parent widget */ - KMultiFormListBoxMultiVisible(KMultiFormListBoxFactory *factory, QWidget *parent = 0, const char *name = 0); + KMultiFormListBoxMultiVisible(KMultiFormListBoxFactory *factory, TQWidget *parent = 0, const char *name = 0); /** @return The elements in the KMultiFormListBox @@ -52,7 +52,7 @@ private: KMultiFormListBoxEntryList elements(); void append(KMultiFormListBoxEntry *); - QWidget* qWidget() { return this; } + TQWidget* qWidget() { return this; } public slots: @@ -109,11 +109,11 @@ protected: friend class CCP; - virtual void resizeEvent(QResizeEvent *); - void addElemBefore(KMultiFormListBoxEntry *newElm, QWidget *existing); + virtual void resizeEvent(TQResizeEvent *); + void addElemBefore(KMultiFormListBoxEntry *newElm, TQWidget *existing); void insertElmIntoWidget(KMultiFormListBoxEntry *elm, KMultiFormListBoxEntry *after); void showWidget(KMultiFormListBoxEntry *elm); - void delElement(QWidget *); + void delElement(TQWidget *); void delAnElement(); void addElemBefore(KMultiFormListBoxEntry *newElm, KMultiFormListBoxEntry *existing); void updateClipperContent(); @@ -126,8 +126,8 @@ private: KMultiFormListBoxFactory *factory; WidgetList *elms; - QPushButton *addBut; - QByteArray clipboard; + TQPushButton *addBut; + TQByteArray clipboard; }; diff --git a/kregexpeditor/KMultiFormListBox/kmultiformlistbox-shower.h b/kregexpeditor/KMultiFormListBox/kmultiformlistbox-shower.h index fe786d7..15f3af5 100644 --- a/kregexpeditor/KMultiFormListBox/kmultiformlistbox-shower.h +++ b/kregexpeditor/KMultiFormListBox/kmultiformlistbox-shower.h @@ -20,7 +20,7 @@ // -------------------------------- includes ------------------------------ //------------------------------------------------------------------------- -typedef QPtrList<KMultiFormListBoxEntry> KMultiFormListBoxEntryList ; +typedef TQPtrList<KMultiFormListBoxEntry> KMultiFormListBoxEntryList ; /** Abstract class defining the interface for widgets showing a number of @ref KMultiFormListBoxEntry. @@ -35,14 +35,14 @@ public: /** Appends the given argument to the list */ virtual void append(KMultiFormListBoxEntry *) = 0; - /** Return the element as a QWidget */ - virtual QWidget* qWidget() = 0; + /** Return the element as a TQWidget */ + virtual TQWidget* qWidget() = 0; /** Adds an empty element. */ virtual void addElement() = 0; /** Deletes an element at the given index. */ - virtual void delElement(QWidget *) = 0; + virtual void delElement(TQWidget *) = 0; /** Deletes any element from the list */ virtual void delAnElement() = 0; diff --git a/kregexpeditor/KMultiFormListBox/kmultiformlistbox-windowed.cpp b/kregexpeditor/KMultiFormListBox/kmultiformlistbox-windowed.cpp index 6ef14d3..c0e6090 100644 --- a/kregexpeditor/KMultiFormListBox/kmultiformlistbox-windowed.cpp +++ b/kregexpeditor/KMultiFormListBox/kmultiformlistbox-windowed.cpp @@ -27,59 +27,59 @@ #include "widgetwindow.h" #include "windowlistboxitem.h" -KMultiFormListBoxWindowed::KMultiFormListBoxWindowed(KMultiFormListBoxFactory *factory, QWidget *parent, +KMultiFormListBoxWindowed::KMultiFormListBoxWindowed(KMultiFormListBoxFactory *factory, TQWidget *parent, bool showUpDownButtons, bool showHelpButton, - QString addButtonText,const char *name) - : QWidget( parent, name ) + TQString addButtonText,const char *name) + : TQWidget( parent, name ) { - _layout = new QVBoxLayout(this); + _layout = new TQVBoxLayout(this); - QHBoxLayout *innerLayout = new QHBoxLayout(); + TQHBoxLayout *innerLayout = new TQHBoxLayout(); _layout->addLayout(innerLayout); _listbox = new KListBox(this,"listbox"); - _listbox->setSelectionMode(QListBox::Single); + _listbox->setSelectionMode(TQListBox::Single); innerLayout->addWidget(_listbox); - QVBoxLayout *buttons = new QVBoxLayout(); + TQVBoxLayout *buttons = new TQVBoxLayout(); innerLayout->addLayout(buttons); - QPushButton *but = new QPushButton(addButtonText, this,"Add Button"); + TQPushButton *but = new TQPushButton(addButtonText, this,"Add Button"); buttons->addWidget(but,0); - connect(but, SIGNAL(clicked()), this, SLOT(addNewElement())); + connect(but, TQT_SIGNAL(clicked()), this, TQT_SLOT(addNewElement())); - but = new QPushButton(i18n("Edit"), this,"Edit Button"); + but = new TQPushButton(i18n("Edit"), this,"Edit Button"); buttons->addWidget(but,0); - connect(but,SIGNAL(clicked()), this, SLOT(slotEditSelected())); - connect(_listbox, SIGNAL(doubleClicked(QListBoxItem *)), this, SLOT(slotEditSelected(QListBoxItem *))); + connect(but,TQT_SIGNAL(clicked()), this, TQT_SLOT(slotEditSelected())); + connect(_listbox, TQT_SIGNAL(doubleClicked(TQListBoxItem *)), this, TQT_SLOT(slotEditSelected(TQListBoxItem *))); _buttonList.append(but); - but = new QPushButton(i18n("Delete"), this, "Delete Button"); + but = new TQPushButton(i18n("Delete"), this, "Delete Button"); buttons->addWidget(but,0); - connect(but, SIGNAL(clicked()), this, SLOT(slotDeleteEntry())); + connect(but, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotDeleteEntry())); _buttonList.append(but); - but = new QPushButton(i18n("Copy"), this, "Copy Button"); + but = new TQPushButton(i18n("Copy"), this, "Copy Button"); buttons->addWidget(but,0); - connect(but, SIGNAL(clicked()), this, SLOT(slotCopySelected())); + connect(but, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotCopySelected())); _buttonList.append(but); if (showUpDownButtons) { - but = new QPushButton(i18n("Up"), this, "Up Button"); + but = new TQPushButton(i18n("Up"), this, "Up Button"); buttons->addWidget(but, 0); - connect(but, SIGNAL(clicked()), this, SLOT(slotMoveItemUp())); + connect(but, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotMoveItemUp())); _buttonList.append(but); - but = new QPushButton(i18n("Down"), this, "Down Button"); + but = new TQPushButton(i18n("Down"), this, "Down Button"); buttons->addWidget(but, 0); - connect(but, SIGNAL(clicked()), this, SLOT(slotMoveItemDown())); + connect(but, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotMoveItemDown())); _buttonList.append(but); } if (showHelpButton) { but = new KPushButton(KStdGuiItem::help(), this, "Help Button"); buttons->addWidget(but, 0); - connect(but, SIGNAL(clicked()), this, SIGNAL(showHelp())); + connect(but, TQT_SIGNAL(clicked()), this, TQT_SIGNAL(showHelp())); } buttons->addStretch(1); @@ -98,7 +98,7 @@ KMultiFormListBoxEntryList KMultiFormListBoxWindowed::elements() return list; } -void KMultiFormListBoxWindowed::delElement(QWidget */*elm*/) +void KMultiFormListBoxWindowed::delElement(TQWidget */*elm*/) { // kdDebug() << "KMultiFormListBoxWindowed::delElement NOT YET IMPLEMENTED"<<endl; // TODO @@ -121,9 +121,9 @@ void KMultiFormListBoxWindowed::addNewElement() { // kdDebug() << "addNewElement " << _factory << "," << _listbox << endl; - QWidget *widget = new WidgetWindow(_factory, _listbox); + TQWidget *widget = new WidgetWindow(_factory, _listbox); widget->show(); - connect(widget, SIGNAL(finished()), this, SLOT(slotUpdateButtonState())); + connect(widget, TQT_SIGNAL(finished()), this, TQT_SLOT(slotUpdateButtonState())); } void KMultiFormListBoxWindowed::addElement() @@ -132,7 +132,7 @@ void KMultiFormListBoxWindowed::addElement() slotUpdateButtonState(); } -void KMultiFormListBoxWindowed::slotEditSelected(QListBoxItem *item) +void KMultiFormListBoxWindowed::slotEditSelected(TQListBoxItem *item) { ((WindowListboxItem *) item)->displayWidget(); } diff --git a/kregexpeditor/KMultiFormListBox/kmultiformlistbox-windowed.h b/kregexpeditor/KMultiFormListBox/kmultiformlistbox-windowed.h index 74d6d9f..873c406 100644 --- a/kregexpeditor/KMultiFormListBox/kmultiformlistbox-windowed.h +++ b/kregexpeditor/KMultiFormListBox/kmultiformlistbox-windowed.h @@ -20,7 +20,7 @@ #ifdef QT_ONLY #include "compat.h" - #include <qlistbox.h> + #include <tqlistbox.h> #else #include <klistbox.h> #endif @@ -35,28 +35,28 @@ class WindowListboxItem; @internal */ -class KMultiFormListBoxWindowed :public QWidget, KMultiFormListBoxShower { +class KMultiFormListBoxWindowed :public TQWidget, KMultiFormListBoxShower { Q_OBJECT friend class KMultiFormListBox; private: - KMultiFormListBoxWindowed(KMultiFormListBoxFactory *factory, QWidget *parent, - bool showUpDownButtons, bool showHelpButton, QString addButtonText, + KMultiFormListBoxWindowed(KMultiFormListBoxFactory *factory, TQWidget *parent, + bool showUpDownButtons, bool showHelpButton, TQString addButtonText, const char *name); KMultiFormListBoxEntryList elements(); const KMultiFormListBoxEntryList elements() const; void append(KMultiFormListBoxEntry *); WindowListboxItem *selected(); - QWidget* qWidget() { return this; } + TQWidget* qWidget() { return this; } - QVBoxLayout* _layout; + TQVBoxLayout* _layout; KMultiFormListBoxFactory* _factory; - QPtrList<QPushButton> _buttonList; + TQPtrList<TQPushButton> _buttonList; KListBox* _listbox; - virtual void delElement(QWidget *); // Deletes the given element + virtual void delElement(TQWidget *); // Deletes the given element virtual void delAnElement(); void addElement(); @@ -69,7 +69,7 @@ signals: private slots: void slotEditSelected(); - void slotEditSelected(QListBoxItem *item); + void slotEditSelected(TQListBoxItem *item); void slotCopySelected(); void slotMoveItemUp(); void slotMoveItemDown(); diff --git a/kregexpeditor/KMultiFormListBox/kmultiformlistbox.cpp b/kregexpeditor/KMultiFormListBox/kmultiformlistbox.cpp index 57b5abb..0aa384e 100644 --- a/kregexpeditor/KMultiFormListBox/kmultiformlistbox.cpp +++ b/kregexpeditor/KMultiFormListBox/kmultiformlistbox.cpp @@ -22,9 +22,9 @@ #include "kmultiformlistbox-multivisible.h" #include "kmultiformlistbox-windowed.h" -KMultiFormListBox::KMultiFormListBox( KMultiFormListBoxFactory *factory, KMultiFormListBoxType tp, QWidget *parent, - bool showUpDownButtons, bool showHelpButton, QString addButtonText, - const char *name ) : QWidget( parent, name ) +KMultiFormListBox::KMultiFormListBox( KMultiFormListBoxFactory *factory, KMultiFormListBoxType tp, TQWidget *parent, + bool showUpDownButtons, bool showHelpButton, TQString addButtonText, + const char *name ) : TQWidget( parent, name ) { switch ( tp ) { @@ -38,9 +38,9 @@ KMultiFormListBox::KMultiFormListBox( KMultiFormListBoxFactory *factory, KMultiF break; } - QWidget *widget = theWidget->qWidget(); + TQWidget *widget = theWidget->qWidget(); - QHBoxLayout *layout = new QHBoxLayout( this ); + TQHBoxLayout *layout = new TQHBoxLayout( this ); _factory = factory; layout->addWidget( widget ); } @@ -72,15 +72,15 @@ void KMultiFormListBox::slotChangeFace( KMultiFormListBoxType /*newFace*/ ) // << "Please let me (blackie@kde.org) know that you need it, and I'll work on it" << endl; } -void KMultiFormListBox::toStream( QDataStream& stream ) const +void KMultiFormListBox::toStream( TQDataStream& stream ) const { const KMultiFormListBoxEntryList elms = elements(); stream << elms.count(); - for ( QPtrListIterator<KMultiFormListBoxEntry> it(elms); *it; ++it) + for ( TQPtrListIterator<KMultiFormListBoxEntry> it(elms); *it; ++it) _factory->toStream( *it, stream ); } -void KMultiFormListBox::fromStream( QDataStream& stream ) +void KMultiFormListBox::fromStream( TQDataStream& stream ) { unsigned int fromCount, toCount; stream >> fromCount; @@ -96,7 +96,7 @@ void KMultiFormListBox::fromStream( QDataStream& stream ) } KMultiFormListBoxEntryList elms = elements(); - for (QPtrListIterator<KMultiFormListBoxEntry> it(elms); *it; ++it) + for (TQPtrListIterator<KMultiFormListBoxEntry> it(elms); *it; ++it) _factory->fromStream( stream, *it ); } diff --git a/kregexpeditor/KMultiFormListBox/kmultiformlistbox.h b/kregexpeditor/KMultiFormListBox/kmultiformlistbox.h index 8e85808..a0ef4a8 100644 --- a/kregexpeditor/KMultiFormListBox/kmultiformlistbox.h +++ b/kregexpeditor/KMultiFormListBox/kmultiformlistbox.h @@ -21,9 +21,9 @@ #include "kmultiformlistboxfactory.h" #include "kmultiformlistbox-shower.h" #include "kmultiformlistboxentry.h" -#include <qptrlist.h> -#include <qlayout.h> -#include <qscrollview.h> +#include <tqptrlist.h> +#include <tqlayout.h> +#include <tqscrollview.h> #ifdef QT_ONLY #include "compat.h" @@ -34,8 +34,8 @@ class QDataStream; -typedef QPtrList<KMultiFormListBoxEntry> KMultiFormListBoxEntryList ; -typedef QPtrList<QWidget> WidgetList; +typedef TQPtrList<KMultiFormListBoxEntry> KMultiFormListBoxEntryList ; +typedef TQPtrList<TQWidget> WidgetList; class KMultiFormListBoxMultiVisible; /** @@ -60,7 +60,7 @@ class KMultiFormListBoxMultiVisible; @author Jesper Kjær Pedersen <blackie@kde.org> **/ -class KMultiFormListBox : public QWidget { +class KMultiFormListBox : public TQWidget { Q_OBJECT @@ -75,8 +75,8 @@ public: **/ KMultiFormListBox(KMultiFormListBoxFactory *factory, KMultiFormListBoxType tp=Windowed, - QWidget *parent = 0, bool showUpDownButtons = true, - bool showHelpButton = true, QString addButtonText = i18n("Add"), + TQWidget *parent = 0, bool showUpDownButtons = true, + bool showHelpButton = true, TQString addButtonText = i18n("Add"), const char *name = 0); /** @@ -91,10 +91,10 @@ public: void append(KMultiFormListBoxEntry *); /** write data out to stream */ - void toStream( QDataStream& stream ) const; + void toStream( TQDataStream& stream ) const; /** reads data in from stream */ - void fromStream( QDataStream& stream ); + void fromStream( TQDataStream& stream ); public slots: diff --git a/kregexpeditor/KMultiFormListBox/kmultiformlistboxentry.cpp b/kregexpeditor/KMultiFormListBox/kmultiformlistboxentry.cpp index e6768a3..e885c29 100644 --- a/kregexpeditor/KMultiFormListBox/kmultiformlistboxentry.cpp +++ b/kregexpeditor/KMultiFormListBox/kmultiformlistboxentry.cpp @@ -31,14 +31,14 @@ void KMultiFormListBoxEntry::acceptIndexButton() } -void KMultiFormListBoxEntry::indexWindowPos(QPoint *start, int *width) +void KMultiFormListBoxEntry::indexWindowPos(TQPoint *start, int *width) { // Calculate the position of the value widgets left-buttom border - QPoint global_point = valueWidget()->mapToGlobal(QPoint(0,0)); + TQPoint global_point = valueWidget()->mapToGlobal(TQPoint(0,0)); start->setX(global_point.x()); start->setY(global_point.y() + valueWidget()->height()); // Calculate the width of the list. - global_point = indexButton()->mapToGlobal(QPoint(0,0)); + global_point = indexButton()->mapToGlobal(TQPoint(0,0)); *width = global_point.x() + indexButton()->width() - start->x(); } diff --git a/kregexpeditor/KMultiFormListBox/kmultiformlistboxentry.h b/kregexpeditor/KMultiFormListBox/kmultiformlistboxentry.h index 7937fe1..313f026 100644 --- a/kregexpeditor/KMultiFormListBox/kmultiformlistboxentry.h +++ b/kregexpeditor/KMultiFormListBox/kmultiformlistboxentry.h @@ -18,9 +18,9 @@ #ifndef __kmultiformlistboxentry #define __kmultiformlistboxentry -#include <qpoint.h> -#include <qwidget.h> -#include <qpushbutton.h> +#include <tqpoint.h> +#include <tqwidget.h> +#include <tqpushbutton.h> /** This widget must be the base class for an entry widget used in the @ref @@ -30,7 +30,7 @@ The KMultiFormListBox widget features a fast scrolling mechanism through the Idx button. If you want to use this in you KMultiFormListBox, then you must do the following: - @li Create a @ref QPushButton as a sub-widget to your KMultiFormListBoxEntry. + @li Create a @ref TQPushButton as a sub-widget to your KMultiFormListBoxEntry. @li Override the @ref indexButton method to return your QPushButton @li Override the @ref idxString to return a @ref QString with a textual representation of the content in this KMultiFormListBoxEntry. This @@ -50,16 +50,16 @@ class KMultiFormListBoxEntry : public QWidget Q_OBJECT public: - KMultiFormListBoxEntry(QWidget *parent, const char *name) : QWidget(parent,name) {} + KMultiFormListBoxEntry(TQWidget *parent, const char *name) : TQWidget(parent,name) {} - virtual QPushButton *indexButton() { return 0; } - virtual QWidget *valueWidget() { return 0; } + virtual TQPushButton *indexButton() { return 0; } + virtual TQWidget *valueWidget() { return 0; } - virtual void indexWindowPos(QPoint *start, int *width); // both variables are return values. + virtual void indexWindowPos(TQPoint *start, int *width); // both variables are return values. // This function must return a string representing the KMultiFormListBox. This is // used when showing the fast-search menu available from the `Idx' button. - virtual QString idxString() { return QString::fromLatin1(""); } + virtual TQString idxString() { return TQString::fromLatin1(""); } public slots: void acceptIndexButton(); diff --git a/kregexpeditor/KMultiFormListBox/kmultiformlistboxfactory.cpp b/kregexpeditor/KMultiFormListBox/kmultiformlistboxfactory.cpp index 89b5d74..08a800a 100644 --- a/kregexpeditor/KMultiFormListBox/kmultiformlistboxfactory.cpp +++ b/kregexpeditor/KMultiFormListBox/kmultiformlistboxfactory.cpp @@ -16,11 +16,11 @@ * Boston, MA 02110-1301, USA. **/ #include "kmultiformlistboxfactory.h" -#include <qframe.h> +#include <tqframe.h> -QWidget *KMultiFormListBoxFactory::separator(QWidget *parent) { - QFrame* sep = new QFrame( parent ); - sep->setFrameStyle( QFrame::HLine | QFrame::Sunken); +TQWidget *KMultiFormListBoxFactory::separator(TQWidget *parent) { + TQFrame* sep = new TQFrame( parent ); + sep->setFrameStyle( TQFrame::HLine | TQFrame::Sunken); sep->setLineWidth(1); return sep; } diff --git a/kregexpeditor/KMultiFormListBox/kmultiformlistboxfactory.h b/kregexpeditor/KMultiFormListBox/kmultiformlistboxfactory.h index 13f6561..dc0bcce 100644 --- a/kregexpeditor/KMultiFormListBox/kmultiformlistboxfactory.h +++ b/kregexpeditor/KMultiFormListBox/kmultiformlistboxfactory.h @@ -18,7 +18,7 @@ // -------------------------------- includes ------------------------------ #ifndef __kmultiformlistboxfactory #define __kmultiformlistboxfactory -#include <qobject.h> +#include <tqobject.h> #include "kwidgetstreamer.h" class KMultiFormListBoxEntry; //------------------------------------------------------------------------- @@ -52,18 +52,18 @@ public: @return A fresh @ref KMultiFormListBoxEntry to be used in an instance of the @ref KMultiFormListBox class. **/ - virtual KMultiFormListBoxEntry *create(QWidget *parent) = 0; + virtual KMultiFormListBoxEntry *create(TQWidget *parent) = 0; /** This method is used to get a separator between the elements in an @ref KMultiFormListBox. The widget returned from this method will be owned by the caller. - @param parent A pointer to the parent of the QWidget returned. + @param parent A pointer to the parent of the TQWidget returned. @return A widget which must be used as a separator between the @ref KMultiFormListBoxEntry elements in an @ref KMultiFormListBox. **/ - virtual QWidget *separator(QWidget *parent); + virtual TQWidget *separator(TQWidget *parent); }; #endif /* kmultiformlistbox */ diff --git a/kregexpeditor/KMultiFormListBox/widgetwindow.cpp b/kregexpeditor/KMultiFormListBox/widgetwindow.cpp index 022e452..e94210d 100644 --- a/kregexpeditor/KMultiFormListBox/widgetwindow.cpp +++ b/kregexpeditor/KMultiFormListBox/widgetwindow.cpp @@ -36,17 +36,17 @@ void WidgetWindow::init(KMultiFormListBoxFactory *factory, KListBox *lb, KMultiF listbox = lb; myFact = factory; - QFrame *frame = plainPage(); - QHBoxLayout *lay = new QHBoxLayout(frame,0,-1,"WidgetWindow::init::lay"); + TQFrame *frame = plainPage(); + TQHBoxLayout *lay = new TQHBoxLayout(frame,0,-1,"WidgetWindow::init::lay"); if (widget != 0) { myWidget = widget; - widget->reparent(frame, 0, QPoint(0,0)); + widget->reparent(frame, 0, TQPoint(0,0)); } else { myWidget = factory->create(frame); } - QDataStream stream( _backup, IO_WriteOnly ); + TQDataStream stream( _backup, IO_WriteOnly ); myFact->toStream( myWidget, stream ); lay->addWidget(myWidget); @@ -85,7 +85,7 @@ void WidgetWindow::slotCancel() deleteLater(); } else { - QDataStream stream( _backup, IO_ReadOnly ); + TQDataStream stream( _backup, IO_ReadOnly ); myFact->fromStream( stream, myWidget ); } KDialogBase::slotCancel(); @@ -94,10 +94,10 @@ void WidgetWindow::slotCancel() WidgetWindow *WidgetWindow::clone() { WidgetWindow *item = new WidgetWindow(myFact, listbox); - QByteArray data; - QDataStream ws( data, IO_WriteOnly ); + TQByteArray data; + TQDataStream ws( data, IO_WriteOnly ); myFact->toStream( myWidget, ws ); - QDataStream rs( data, IO_ReadOnly ); + TQDataStream rs( data, IO_ReadOnly ); myFact->fromStream( rs, item->myWidget ); item->slotOk(); @@ -106,7 +106,7 @@ WidgetWindow *WidgetWindow::clone() void WidgetWindow::display() { - QDataStream stream( _backup, IO_WriteOnly); + TQDataStream stream( _backup, IO_WriteOnly); myFact->toStream( myWidget, stream ); show(); } diff --git a/kregexpeditor/KMultiFormListBox/widgetwindow.h b/kregexpeditor/KMultiFormListBox/widgetwindow.h index f81b359..647b2ef 100644 --- a/kregexpeditor/KMultiFormListBox/widgetwindow.h +++ b/kregexpeditor/KMultiFormListBox/widgetwindow.h @@ -20,7 +20,7 @@ #ifdef QT_ONLY #include "compat.h" - #include <qlistbox.h> + #include <tqlistbox.h> #else #include <kdialogbase.h> #include <klistbox.h> @@ -51,7 +51,7 @@ protected slots: private: KMultiFormListBoxFactory *myFact; KMultiFormListBoxEntry *myWidget; - QByteArray _backup; + TQByteArray _backup; KListBox *listbox; WindowListboxItem *myListboxItem; bool initialShow; diff --git a/kregexpeditor/KMultiFormListBox/windowlistboxitem.cpp b/kregexpeditor/KMultiFormListBox/windowlistboxitem.cpp index 41f9e5b..69f2f33 100644 --- a/kregexpeditor/KMultiFormListBox/windowlistboxitem.cpp +++ b/kregexpeditor/KMultiFormListBox/windowlistboxitem.cpp @@ -18,8 +18,8 @@ #include "windowlistboxitem.h" #include "widgetwindow.h" -WindowListboxItem::WindowListboxItem(QListBox *lb, QString text, WidgetWindow *windowWidget) - :QListBoxText(lb, text), myItem(windowWidget) +WindowListboxItem::WindowListboxItem(TQListBox *lb, TQString text, WidgetWindow *windowWidget) + :TQListBoxText(lb, text), myItem(windowWidget) { } diff --git a/kregexpeditor/KMultiFormListBox/windowlistboxitem.h b/kregexpeditor/KMultiFormListBox/windowlistboxitem.h index 2505b88..5e9d0f6 100644 --- a/kregexpeditor/KMultiFormListBox/windowlistboxitem.h +++ b/kregexpeditor/KMultiFormListBox/windowlistboxitem.h @@ -17,7 +17,7 @@ **/ #ifndef __windowlistboxitem #define __windowlistboxitem -#include <qlistbox.h> +#include <tqlistbox.h> class WidgetWindow; class KMultiFormListBoxWindowed; class KMultiFormListBoxEntry; @@ -31,7 +31,7 @@ class WindowListboxItem :public QListBoxText friend class WidgetWindow; friend class KMultiFormListBoxWindowed; public: - WindowListboxItem(QListBox *, QString, WidgetWindow *); + WindowListboxItem(TQListBox *, TQString, WidgetWindow *); ~WindowListboxItem(); void clone(); void displayWidget(); diff --git a/kregexpeditor/KWidgetStreamer/kwidgetstreamer.cpp b/kregexpeditor/KWidgetStreamer/kwidgetstreamer.cpp index e91813a..e314110 100644 --- a/kregexpeditor/KWidgetStreamer/kwidgetstreamer.cpp +++ b/kregexpeditor/KWidgetStreamer/kwidgetstreamer.cpp @@ -17,11 +17,11 @@ **/ #include "kwidgetstreamer.h" #include "kmultiformlistbox.h" -#include <qobjectlist.h> -#include <qvariant.h> +#include <tqobjectlist.h> +#include <tqvariant.h> -void KWidgetStreamer::toStream(const QObject* from, QDataStream& stream ) +void KWidgetStreamer::toStream(const TQObject* from, TQDataStream& stream ) { if ( from->inherits("KMultiFormListBox") ) { // Hmm, we'll trust Qt that this dynamic_cast won't fail! @@ -31,7 +31,7 @@ void KWidgetStreamer::toStream(const QObject* from, QDataStream& stream ) propertyToStream( from, stream ); } -void KWidgetStreamer::fromStream( QDataStream& stream, QObject* to ) +void KWidgetStreamer::fromStream( TQDataStream& stream, TQObject* to ) { if ( to->inherits("KMultiFormListBox") ) { // Hmm, we'll trust Qt that this dynamic_cast won't fail! @@ -42,17 +42,17 @@ void KWidgetStreamer::fromStream( QDataStream& stream, QObject* to ) } -void KWidgetStreamer::propertyToStream( const QObject* from, QDataStream& stream ) +void KWidgetStreamer::propertyToStream( const TQObject* from, TQDataStream& stream ) { // Only handle widgets. Alternatives to widgets are layouts, validators, timers, etc. - if ( ! from->inherits("QWidget") ) + if ( ! from->inherits("TQWidget") ) return; // Serializing all the children (if any). - const QObjectList* children = from->children(); + const TQObjectList* children = from->children(); if ( children ) { stream << children->count(); - for ( QObjectListIt it = QObjectListIt(*children); *it; ++it ) { + for ( TQObjectListIt it = TQObjectListIt(*children); *it; ++it ) { toStream( *it, stream ); } } @@ -62,11 +62,11 @@ void KWidgetStreamer::propertyToStream( const QObject* from, QDataStream& stream // Now stream out properties for ( PropertyMapIt mapIt = _map.begin(); mapIt != _map.end(); mapIt++ ) { - QString tp = mapIt.key(); + TQString tp = mapIt.key(); PropertyList list = mapIt.data(); if ( from->inherits( tp.latin1() ) ) { for ( PropertyListIt it = list.begin(); it != list.end(); ++it ) { - QVariant prop = from->property( (*it).latin1() ); + TQVariant prop = from->property( (*it).latin1() ); if ( ! prop.isValid() ) qWarning("Invalid property: %s:%s", tp.latin1(), (*it).latin1() ); @@ -77,20 +77,20 @@ void KWidgetStreamer::propertyToStream( const QObject* from, QDataStream& stream } -void KWidgetStreamer::propertyFromStream( QDataStream& stream, QObject* to ) +void KWidgetStreamer::propertyFromStream( TQDataStream& stream, TQObject* to ) { // Only handle widgets. Alternatives to widgets are layouts, validators, timers, etc. - if ( ! to->inherits("QWidget") ) + if ( ! to->inherits("TQWidget") ) return; // Stream in all the children (if any) - const QObjectList* children = to->children(); + const TQObjectList* children = to->children(); unsigned int count; stream >> count; if ( children ) { Q_ASSERT( count == children->count() ); - for ( QObjectListIt it = QObjectListIt(*children); *it; ++it ) + for ( TQObjectListIt it = TQObjectListIt(*children); *it; ++it ) fromStream( stream, *it ); } else { @@ -99,11 +99,11 @@ void KWidgetStreamer::propertyFromStream( QDataStream& stream, QObject* to ) // Now stream in properties for ( PropertyMapIt mapIt = _map.begin(); mapIt != _map.end(); mapIt++ ) { - QString tp = mapIt.key(); + TQString tp = mapIt.key(); PropertyList list = mapIt.data(); if ( to->inherits( tp.latin1() ) ) { for ( PropertyListIt it = list.begin(); it != list.end(); ++it ) { - QVariant value; + TQVariant value; stream >> value; to->setProperty((*it).latin1(), value); } @@ -113,65 +113,65 @@ void KWidgetStreamer::propertyFromStream( QDataStream& stream, QObject* to ) KWidgetStreamer::KWidgetStreamer () { - QStringList l; + TQStringList l; // QCheckBox l.clear(); - l << QString::fromLatin1("enabled") - << QString::fromLatin1("checked") << QString::fromLatin1("tristate"); - _map.insert(QString::fromLatin1("QCheckBox"), l); + l << TQString::fromLatin1("enabled") + << TQString::fromLatin1("checked") << TQString::fromLatin1("tristate"); + _map.insert(TQString::fromLatin1("TQCheckBox"), l); // QComboBox l.clear(); - l << QString::fromLatin1("enabled") - << QString::fromLatin1("editable") << QString::fromLatin1("currentItem") - << QString::fromLatin1("maxCount") << QString::fromLatin1("insertionPolicy") - << QString::fromLatin1("autoCompletion"); - _map.insert(QString::fromLatin1("QComboBox"), l); + l << TQString::fromLatin1("enabled") + << TQString::fromLatin1("editable") << TQString::fromLatin1("currentItem") + << TQString::fromLatin1("maxCount") << TQString::fromLatin1("insertionPolicy") + << TQString::fromLatin1("autoCompletion"); + _map.insert(TQString::fromLatin1("TQComboBox"), l); // QDial l.clear(); - l << QString::fromLatin1("enabled") - << QString::fromLatin1("tracking") << QString::fromLatin1("wrapping") - << QString::fromLatin1("value"); - _map.insert(QString::fromLatin1("QDial"), l); + l << TQString::fromLatin1("enabled") + << TQString::fromLatin1("tracking") << TQString::fromLatin1("wrapping") + << TQString::fromLatin1("value"); + _map.insert(TQString::fromLatin1("TQDial"), l); // QLCDNumber l.clear(); - l << QString::fromLatin1("enabled") - << QString::fromLatin1("numDigits") << QString::fromLatin1("mode") - << QString::fromLatin1("segmentStyle") << QString::fromLatin1("value"); - _map.insert(QString::fromLatin1("QLCDNumber"), l); + l << TQString::fromLatin1("enabled") + << TQString::fromLatin1("numDigits") << TQString::fromLatin1("mode") + << TQString::fromLatin1("segmentStyle") << TQString::fromLatin1("value"); + _map.insert(TQString::fromLatin1("TQLCDNumber"), l); // QLineEdit l.clear(); - l << QString::fromLatin1("enabled") - << QString::fromLatin1("text") << QString::fromLatin1("maxLength") - << QString::fromLatin1("echoMode") << QString::fromLatin1("alignment"); - _map.insert(QString::fromLatin1("QLineEdit"), l); + l << TQString::fromLatin1("enabled") + << TQString::fromLatin1("text") << TQString::fromLatin1("maxLength") + << TQString::fromLatin1("echoMode") << TQString::fromLatin1("alignment"); + _map.insert(TQString::fromLatin1("TQLineEdit"), l); // QMultiLineEdit l.clear(); - l << QString::fromLatin1("enabled") - << QString::fromLatin1("text") - << QString::fromLatin1("alignment"); - _map.insert(QString::fromLatin1("QTextEdit"), l); + l << TQString::fromLatin1("enabled") + << TQString::fromLatin1("text") + << TQString::fromLatin1("alignment"); + _map.insert(TQString::fromLatin1("TQTextEdit"), l); // QRadioButton l.clear(); - l << QString::fromLatin1("enabled") - << QString::fromLatin1("checked"); - _map.insert(QString::fromLatin1("QRadioButton"), l); + l << TQString::fromLatin1("enabled") + << TQString::fromLatin1("checked"); + _map.insert(TQString::fromLatin1("TQRadioButton"), l); // QSlider l.clear(); - l << QString::fromLatin1("enabled") - << QString::fromLatin1("value"); - _map.insert(QString::fromLatin1("QSlider"), l); + l << TQString::fromLatin1("enabled") + << TQString::fromLatin1("value"); + _map.insert(TQString::fromLatin1("TQSlider"), l); // QSpinBox l.clear(); - l << QString::fromLatin1("enabled") - << QString::fromLatin1("value"); - _map.insert(QString::fromLatin1("QSpinBox"), l); + l << TQString::fromLatin1("enabled") + << TQString::fromLatin1("value"); + _map.insert(TQString::fromLatin1("TQSpinBox"), l); } diff --git a/kregexpeditor/KWidgetStreamer/kwidgetstreamer.h b/kregexpeditor/KWidgetStreamer/kwidgetstreamer.h index 9534a92..6ac3349 100644 --- a/kregexpeditor/KWidgetStreamer/kwidgetstreamer.h +++ b/kregexpeditor/KWidgetStreamer/kwidgetstreamer.h @@ -17,10 +17,10 @@ **/ #ifndef __kwidgetstreamer #define __kwidgetstreamer -#include <qmap.h> -#include <qptrlist.h> -#include <qstringlist.h> -#include <qobject.h> +#include <tqmap.h> +#include <tqptrlist.h> +#include <tqstringlist.h> +#include <tqobject.h> /** This class defines methods for streaming widget data. @@ -32,12 +32,12 @@ inherit from this class and override @ref toStream and @ref fromStream. The following example shows how you can avoid streaming - <tt>numDigits</tt> for a QLCDNumber. The same approach applies if you + <tt>numDigits</tt> for a TQLCDNumber. The same approach applies if you want to add extra properties to be streamed. <pre> KWidgetStreamer streamer; KWidgetStreamer::PropertyMap& map = streamer.propertyMap(); - KWidgetStreamer::PropertyList& list = *map.find("QLCDNumber"); + KWidgetStreamer::PropertyList& list = *map.find("TQLCDNumber"); list.remove("numDigits"); </pre> **/ @@ -45,23 +45,23 @@ class KWidgetStreamer { public: - typedef QStringList PropertyList; - typedef QMap< QString, PropertyList > PropertyMap; - typedef QMap< QString, PropertyList >::ConstIterator PropertyMapIt; - typedef QStringList::Iterator PropertyListIt; + typedef TQStringList PropertyList; + typedef TQMap< TQString, PropertyList > PropertyMap; + typedef TQMap< TQString, PropertyList >::ConstIterator PropertyMapIt; + typedef TQStringList::Iterator PropertyListIt; KWidgetStreamer(); virtual ~KWidgetStreamer() {} - virtual void toStream(const QObject* from, QDataStream& stream ); - virtual void fromStream(QDataStream& stream, QObject* to); + virtual void toStream(const TQObject* from, TQDataStream& stream ); + virtual void fromStream(TQDataStream& stream, TQObject* to); PropertyMap& propertyMap() { return _map; } protected: - void propertyToStream( const QObject* from, QDataStream& stream ); - void propertyFromStream( QDataStream& stream, QObject* to ); + void propertyToStream( const TQObject* from, TQDataStream& stream ); + void propertyFromStream( TQDataStream& stream, TQObject* to ); private: PropertyMap _map; diff --git a/kregexpeditor/altnregexp.cpp b/kregexpeditor/altnregexp.cpp index adebf1b..ef8b8de 100644 --- a/kregexpeditor/altnregexp.cpp +++ b/kregexpeditor/altnregexp.cpp @@ -43,20 +43,20 @@ bool AltnRegExp::check( ErrorMap& map, bool first, bool last ) return possibleEmpty; } -QDomNode AltnRegExp::toXml( QDomDocument* doc ) const +TQDomNode AltnRegExp::toXml( TQDomDocument* doc ) const { - QDomElement top = doc->createElement( QString::fromLocal8Bit( "Alternatives" ) ); + TQDomElement top = doc->createElement( TQString::fromLocal8Bit( "Alternatives" ) ); for ( RegExpListIt it(list); *it; ++it ) { top.appendChild( (*it)->toXml( doc ) ); } return top; } -bool AltnRegExp::load( QDomElement top, const QString& version ) +bool AltnRegExp::load( TQDomElement top, const TQString& version ) { - Q_ASSERT( top.tagName() == QString::fromLocal8Bit( "Alternatives" ) ); + Q_ASSERT( top.tagName() == TQString::fromLocal8Bit( "Alternatives" ) ); - for ( QDomNode child = top.firstChild(); !child.isNull(); child = child.nextSibling() ) { + for ( TQDomNode child = top.firstChild(); !child.isNull(); child = child.nextSibling() ) { if ( ! child.isElement() ) continue; // User might have added a comment. diff --git a/kregexpeditor/altnregexp.h b/kregexpeditor/altnregexp.h index d5d9d1e..c126c5f 100644 --- a/kregexpeditor/altnregexp.h +++ b/kregexpeditor/altnregexp.h @@ -34,8 +34,8 @@ public: virtual bool check( ErrorMap&, bool first, bool last ); virtual int precedence() const { return 1;} - virtual QDomNode toXml( QDomDocument* doc ) const; - virtual bool load( QDomElement, const QString& version ); + virtual TQDomNode toXml( TQDomDocument* doc ) const; + virtual bool load( TQDomElement, const TQString& version ); virtual RegExpType type() const { return ALTN;} virtual bool operator==( const RegExp& other ) const; virtual void replacePart( CompoundRegExp* replacement ); diff --git a/kregexpeditor/altnwidget.cpp b/kregexpeditor/altnwidget.cpp index 22937ac..d1855d4 100644 --- a/kregexpeditor/altnwidget.cpp +++ b/kregexpeditor/altnwidget.cpp @@ -26,9 +26,9 @@ #include "dragaccepter.h" #include "concwidget.h" #include "altnregexp.h" -#include <qpainter.h> +#include <tqpainter.h> -AltnWidget::AltnWidget(RegExpEditorWindow* editorWindow, QWidget *parent, +AltnWidget::AltnWidget(RegExpEditorWindow* editorWindow, TQWidget *parent, const char *name) :MultiContainerWidget(editorWindow, parent, name == 0 ? "AltnWidget" : name) { @@ -39,7 +39,7 @@ AltnWidget::AltnWidget(RegExpEditorWindow* editorWindow, QWidget *parent, } AltnWidget::AltnWidget( AltnRegExp* regexp, RegExpEditorWindow* editorWindow, - QWidget* parent, const char* name) + TQWidget* parent, const char* name) :MultiContainerWidget( editorWindow, parent, name ) { DragAccepter *accepter = new DragAccepter(editorWindow, this); @@ -75,15 +75,15 @@ void AltnWidget::setConcChild(ConcWidget *child) void AltnWidget::addNewConcChild(DragAccepter *accepter, ConcWidget *child) { - child->reparent(this, QPoint(0,0), false); + child->reparent(this, TQPoint(0,0), false); MultiContainerWidget::addNewChild( accepter, child ); updateDrawLineInfo(); } -QSize AltnWidget::sizeHint() const +TQSize AltnWidget::sizeHint() const { - QPtrListIterator<RegExpWidget> it(_children); + TQPtrListIterator<RegExpWidget> it(_children); // Skip the first child, as we only need half of the size of the first and the // last drag accepter. Does, however, not apply when there only is onw child. if ( _children.count() != 1 ) @@ -93,23 +93,23 @@ QSize AltnWidget::sizeHint() const _childrenHeight = 0; for ( ; *it ; ++it) { - QSize thisChildSize = (*it)->sizeHint(); + TQSize thisChildSize = (*it)->sizeHint(); _childrenWidth = QMAX(_childrenWidth, thisChildSize.width()); _childrenHeight += thisChildSize.height(); } // Now add the size of the header - QFontMetrics metrics = fontMetrics(); + TQFontMetrics metrics = fontMetrics(); _textSize = metrics.size(0,_text); int headerWidth = _textSize.width() + 2 * bdSize + 2; _childrenWidth = QMAX(_childrenWidth, headerWidth); - return QSize(_childrenWidth + 2*pw, _childrenHeight + _textSize.height() + 1*pw ); + return TQSize(_childrenWidth + 2*pw, _childrenHeight + _textSize.height() + 1*pw ); } -void AltnWidget::paintEvent( QPaintEvent *e) +void AltnWidget::paintEvent( TQPaintEvent *e) { Q_ASSERT( dynamic_cast<DragAccepter*>(_children.at(0)) ); // if this fails, then I should check the location of the show() @@ -118,9 +118,9 @@ void AltnWidget::paintEvent( QPaintEvent *e) dynamic_cast<DragAccepter*>(_children.at(_children.count()-1)) ) ); int offset = 0; - QSize mySize = sizeHint(); + TQSize mySize = sizeHint(); - QPainter painter(this); + TQPainter painter(this); drawPossibleSelection( painter, mySize ); //-------------------------------------- First draw the border and text @@ -144,8 +144,8 @@ void AltnWidget::paintEvent( QPaintEvent *e) RegExpWidget* child = _children.at(i); - QSize childSize = child->sizeHint(); - QSize curChildSize = child->size(); + TQSize childSize = child->sizeHint(); + TQSize curChildSize = child->size(); //-------------------------------------- place the child int x = xOffset; @@ -172,7 +172,7 @@ RegExp* AltnWidget::regExp() const { AltnRegExp *regexp = new AltnRegExp( isSelected() ); - QPtrListIterator<RegExpWidget> it(_children); + TQPtrListIterator<RegExpWidget> it(_children); ++it; // start with the second element for ( ; *it; it+=2 ) { regexp->addRegExp( (*it)->regExp() ); @@ -197,7 +197,7 @@ RegExp* AltnWidget::selection() const if ( isSelected() ) return regExp(); else { - QPtrListIterator<RegExpWidget> it(_children); + TQPtrListIterator<RegExpWidget> it(_children); ++it; // Skip past DragAccepter for ( ; *it; it+=2 ) { if ( (*it)->hasSelection() ) { @@ -216,7 +216,7 @@ bool AltnWidget::validateSelection() const } bool foundASelection = false; - QPtrListIterator<RegExpWidget> it(_children); + TQPtrListIterator<RegExpWidget> it(_children); ++it; // Skip past DragAccepter for ( ; *it; it+=2 ) { if ( (*it)->hasSelection() ) { diff --git a/kregexpeditor/altnwidget.h b/kregexpeditor/altnwidget.h index 9a4f26b..589726d 100644 --- a/kregexpeditor/altnwidget.h +++ b/kregexpeditor/altnwidget.h @@ -29,12 +29,12 @@ class AltnRegExp; class AltnWidget :public MultiContainerWidget { public: - AltnWidget( RegExpEditorWindow* editorWindow, QWidget *parent, + AltnWidget( RegExpEditorWindow* editorWindow, TQWidget *parent, const char *label = 0); AltnWidget( AltnRegExp* regexp, RegExpEditorWindow* editorWindow, - QWidget* parent, const char* name = 0); + TQWidget* parent, const char* name = 0); virtual void addNewChild(DragAccepter *accepter, RegExpWidget *child); - virtual QSize sizeHint() const; + virtual TQSize sizeHint() const; virtual RegExp* regExp() const; virtual void applyRegExpToSelection( RegExpType type ); virtual RegExpType type() const { return ALTN; } @@ -45,7 +45,7 @@ public: virtual void deleteSelection(); protected: - virtual void paintEvent( QPaintEvent* e ); + virtual void paintEvent( TQPaintEvent* e ); private: /** @@ -54,8 +54,8 @@ private: */ void updateDrawLineInfo(); - QString _text; - mutable QSize _textSize; + TQString _text; + mutable TQSize _textSize; mutable int _maxSelectedWidth; mutable int _childrenWidth; diff --git a/kregexpeditor/auxbuttons.cpp b/kregexpeditor/auxbuttons.cpp index ea28953..0f30d80 100644 --- a/kregexpeditor/auxbuttons.cpp +++ b/kregexpeditor/auxbuttons.cpp @@ -26,58 +26,58 @@ #endif #include "auxbuttons.h" -#include <qlayout.h> -#include <qwhatsthis.h> -#include <qtooltip.h> -#include <qtoolbutton.h> +#include <tqlayout.h> +#include <tqwhatsthis.h> +#include <tqtooltip.h> +#include <tqtoolbutton.h> #include "util.h" -AuxButtons::AuxButtons( QWidget* parent, const char* name = 0) - :QDockWindow( QDockWindow::InDock, parent, name) +AuxButtons::AuxButtons( TQWidget* parent, const char* name = 0) + :TQDockWindow( TQDockWindow::InDock, parent, name) { - QBoxLayout* layout = boxLayout(); + TQBoxLayout* layout = boxLayout(); - _undo = new QToolButton( this ); - _undo->setIconSet( Util::getSystemIconSet(QString::fromLatin1("undo") ) ); + _undo = new TQToolButton( this ); + _undo->setIconSet( Util::getSystemIconSet(TQString::fromLatin1("undo") ) ); layout->addWidget( _undo ); - connect( _undo, SIGNAL(clicked()), this, SIGNAL(undo()) ); - QToolTip::add( _undo, i18n( "Undo" ) ); + connect( _undo, TQT_SIGNAL(clicked()), this, TQT_SIGNAL(undo()) ); + TQToolTip::add( _undo, i18n( "Undo" ) ); - _redo = new QToolButton( this ); - _redo->setIconSet( Util::getSystemIconSet(QString::fromLatin1("redo") ) ); + _redo = new TQToolButton( this ); + _redo->setIconSet( Util::getSystemIconSet(TQString::fromLatin1("redo") ) ); layout->addWidget( _redo ); - connect( _redo, SIGNAL(clicked()), this, SIGNAL(redo()) ); - QToolTip::add( _redo, i18n( "Redo" ) ); + connect( _redo, TQT_SIGNAL(clicked()), this, TQT_SIGNAL(redo()) ); + TQToolTip::add( _redo, i18n( "Redo" ) ); - _cut = new QToolButton( this ); - _cut->setIconSet( Util::getSystemIconSet(QString::fromLatin1("editcut") ) ); + _cut = new TQToolButton( this ); + _cut->setIconSet( Util::getSystemIconSet(TQString::fromLatin1("editcut") ) ); layout->addWidget( _cut ); - connect( _cut, SIGNAL(clicked()), this, SIGNAL(cut()) ); - QToolTip::add( _cut, i18n( "Cut" ) ); + connect( _cut, TQT_SIGNAL(clicked()), this, TQT_SIGNAL(cut()) ); + TQToolTip::add( _cut, i18n( "Cut" ) ); - _copy = new QToolButton( this ); - _copy->setIconSet( Util::getSystemIconSet(QString::fromLatin1("editcopy") ) ); + _copy = new TQToolButton( this ); + _copy->setIconSet( Util::getSystemIconSet(TQString::fromLatin1("editcopy") ) ); layout->addWidget( _copy ); - connect( _copy, SIGNAL(clicked()), this, SIGNAL(copy()) ); - QToolTip::add( _copy, i18n( "Copy" ) ); + connect( _copy, TQT_SIGNAL(clicked()), this, TQT_SIGNAL(copy()) ); + TQToolTip::add( _copy, i18n( "Copy" ) ); - _paste = new QToolButton( this ); - _paste->setIconSet( Util::getSystemIconSet(QString::fromLatin1("editpaste")) ); + _paste = new TQToolButton( this ); + _paste->setIconSet( Util::getSystemIconSet(TQString::fromLatin1("editpaste")) ); layout->addWidget( _paste ); - connect( _paste, SIGNAL(clicked()), this, SIGNAL(paste()) ); - QToolTip::add( _paste, i18n( "Paste" ) ); + connect( _paste, TQT_SIGNAL(clicked()), this, TQT_SIGNAL(paste()) ); + TQToolTip::add( _paste, i18n( "Paste" ) ); - _save = new QToolButton( this ); - _save->setIconSet( Util::getSystemIconSet(QString::fromLatin1("filesave")) ); + _save = new TQToolButton( this ); + _save->setIconSet( Util::getSystemIconSet(TQString::fromLatin1("filesave")) ); layout->addWidget( _save ); - connect( _save, SIGNAL(clicked()), this, SIGNAL(save()) ); - QToolTip::add( _save, i18n( "Save" ) ); + connect( _save, TQT_SIGNAL(clicked()), this, TQT_SIGNAL(save()) ); + TQToolTip::add( _save, i18n( "Save" ) ); - QToolButton* button = new QToolButton(this); - button->setPixmap( Util::getSystemIcon( QString::fromLatin1("contexthelp") ) ); + TQToolButton* button = new TQToolButton(this); + button->setPixmap( Util::getSystemIcon( TQString::fromLatin1("contexthelp") ) ); layout->addWidget( button ); - connect(button, SIGNAL(clicked()), this, SLOT(slotEnterWhatsThis())); + connect(button, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotEnterWhatsThis())); _undo->setEnabled( false ); _redo->setEnabled( false ); @@ -86,7 +86,7 @@ AuxButtons::AuxButtons( QWidget* parent, const char* name = 0) void AuxButtons::slotEnterWhatsThis() { - QWhatsThis::enterWhatsThisMode (); + TQWhatsThis::enterWhatsThisMode (); } void AuxButtons::slotCanUndo( bool b ) diff --git a/kregexpeditor/auxbuttons.h b/kregexpeditor/auxbuttons.h index 08c33ec..9a8a1fa 100644 --- a/kregexpeditor/auxbuttons.h +++ b/kregexpeditor/auxbuttons.h @@ -18,7 +18,7 @@ #ifndef AUXBUTTONS_H #define AUXBUTTONS_H -#include <qdockwindow.h> +#include <tqdockwindow.h> class QComboBox; class QLabel; class QToolButton; @@ -28,7 +28,7 @@ class AuxButtons :public QDockWindow Q_OBJECT public: - AuxButtons( QWidget* parent, const char* name ); + AuxButtons( TQWidget* parent, const char* name ); signals: void undo(); @@ -48,12 +48,12 @@ public slots: void slotCanSave( bool ); private: - QToolButton* _undo; - QToolButton* _redo; - QToolButton* _cut; - QToolButton* _copy; - QToolButton* _paste; - QToolButton* _save; + TQToolButton* _undo; + TQToolButton* _redo; + TQToolButton* _cut; + TQToolButton* _copy; + TQToolButton* _paste; + TQToolButton* _save; }; diff --git a/kregexpeditor/characterswidget.cpp b/kregexpeditor/characterswidget.cpp index b219ed6..e0de760 100644 --- a/kregexpeditor/characterswidget.cpp +++ b/kregexpeditor/characterswidget.cpp @@ -30,16 +30,16 @@ #include "myfontmetrics.h" #include "regexpconverter.h" -#include <qpainter.h> -#include <qgrid.h> +#include <tqpainter.h> +#include <tqgrid.h> #include <iostream> -#include <qhgroupbox.h> -#include <qcursor.h> -#include <qcheckbox.h> +#include <tqhgroupbox.h> +#include <tqcursor.h> +#include <tqcheckbox.h> CharacterEdits* CharactersWidget::_configWindow = 0; -CharactersWidget::CharactersWidget(RegExpEditorWindow* editorWindow, QWidget *parent, +CharactersWidget::CharactersWidget(RegExpEditorWindow* editorWindow, TQWidget *parent, const char *name) : RegExpWidget(editorWindow, parent, name) { @@ -47,7 +47,7 @@ CharactersWidget::CharactersWidget(RegExpEditorWindow* editorWindow, QWidget *pa } CharactersWidget::CharactersWidget( TextRangeRegExp* regexp, RegExpEditorWindow* editorWindow, - QWidget* parent, const char* name ) + TQWidget* parent, const char* name ) : RegExpWidget( editorWindow, parent, name ) { _regexp = dynamic_cast<TextRangeRegExp*>( regexp->clone() ); @@ -60,27 +60,27 @@ CharactersWidget::~CharactersWidget() } -QSize CharactersWidget::sizeHint() const +TQSize CharactersWidget::sizeHint() const { - QFontMetrics metrics = fontMetrics(); + TQFontMetrics metrics = fontMetrics(); _textSize = HackCalculateFontSize(metrics, title()); // _textSize = metrics.size(0, title()); - QSize headerSize = QSize(_textSize.width() + 4 * bdSize, + TQSize headerSize = TQSize(_textSize.width() + 4 * bdSize, _textSize.height()); _contentSize = HackCalculateFontSize(metrics,text()); // _contentSize = metrics.size(0, text()); - return QSize(QMAX(headerSize.width(), bdSize + _contentSize.width() + bdSize+ 2*pw), + return TQSize(QMAX(headerSize.width(), bdSize + _contentSize.width() + bdSize+ 2*pw), headerSize.height() + bdSize + _contentSize.height() + bdSize + 2*pw); } -void CharactersWidget::paintEvent(QPaintEvent *e) +void CharactersWidget::paintEvent(TQPaintEvent *e) { - QSize mySize = sizeHint(); + TQSize mySize = sizeHint(); - QPainter painter(this); + TQPainter painter(this); drawPossibleSelection( painter, mySize ); int center = _textSize.height()/2; @@ -116,9 +116,9 @@ RegExp* CharactersWidget::regExp() const return r; } -QString CharactersWidget::text() const +TQString CharactersWidget::text() const { - QString res = QString::fromLatin1(""); + TQString res = TQString::fromLatin1(""); if (_regexp->wordChar()) res += i18n("- A word character\n"); @@ -139,28 +139,28 @@ QString CharactersWidget::text() const res += i18n("- A non-space character\n"); // Single characters - QStringList chars = _regexp->chars(); + TQStringList chars = _regexp->chars(); if ( !chars.isEmpty() ) { - QString str = chars.join( QString::fromLocal8Bit(", ") ); - res += QString::fromLocal8Bit("- ") + str + QString::fromLocal8Bit("\n"); + TQString str = chars.join( TQString::fromLocal8Bit(", ") ); + res += TQString::fromLocal8Bit("- ") + str + TQString::fromLocal8Bit("\n"); } // Ranges characters - QPtrList<StringPair> range = _regexp->range(); - for ( QPtrListIterator<StringPair> it( range ); *it; ++it ) { + TQPtrList<StringPair> range = _regexp->range(); + for ( TQPtrListIterator<StringPair> it( range ); *it; ++it ) { StringPair* elm = static_cast<StringPair*>(*it); if (elm) { - QString fromText = elm->first(); - QString toText = elm->second(); + TQString fromText = elm->first(); + TQString toText = elm->second(); - res += QString::fromLocal8Bit("- ") + i18n("from ") + fromText + i18n(" to ") + toText + QString::fromLocal8Bit("\n"); + res += TQString::fromLocal8Bit("- ") + i18n("from ") + fromText + i18n(" to ") + toText + TQString::fromLocal8Bit("\n"); } } return res.left(res.length()-1); } -QString CharactersWidget::title() const +TQString CharactersWidget::title() const { if (_regexp->negate()) return i18n("Any Character Except"); @@ -169,9 +169,9 @@ QString CharactersWidget::title() const } -RegExpWidget* CharactersWidget::findWidgetToEdit( QPoint globalPos ) +RegExpWidget* CharactersWidget::findWidgetToEdit( TQPoint globalPos ) { - if ( QRect(mapToGlobal(QPoint(0,0)), size()).contains( globalPos ) ) + if ( TQRect(mapToGlobal(TQPoint(0,0)), size()).contains( globalPos ) ) return this; else return 0; @@ -180,26 +180,26 @@ RegExpWidget* CharactersWidget::findWidgetToEdit( QPoint globalPos ) int CharactersWidget::edit() { if ( _configWindow == 0 ) { - QApplication::setOverrideCursor( WaitCursor ); + TQApplication::setOverrideCursor( WaitCursor ); // No parent here, as this window should continue to exists. _configWindow = new CharacterEdits( 0, "CharactersWidget::_configWindow" ); - QApplication::restoreOverrideCursor(); + TQApplication::restoreOverrideCursor(); } - _configWindow->move(QCursor::pos() - QPoint(_configWindow->sizeHint().width()/2, + _configWindow->move(TQCursor::pos() - TQPoint(_configWindow->sizeHint().width()/2, _configWindow->sizeHint().height()/2)); int ret = _configWindow->exec(_regexp ); - if ( ret == QDialog::Accepted ) { + if ( ret == TQDialog::Accepted ) { _editorWindow->updateContent( 0 ); update(); } return ret; } -void CharacterEdits::addCharacter( QString txt ) +void CharacterEdits::addCharacter( TQString txt ) { KMultiFormListBoxEntryList list = _single->elements(); - for ( QPtrListIterator<KMultiFormListBoxEntry> it(list); *it; ++it ) { + for ( TQPtrListIterator<KMultiFormListBoxEntry> it(list); *it; ++it ) { SingleEntry* entry = dynamic_cast<SingleEntry*>( *it ); if ( entry && entry->isEmpty() ) { entry->setText( txt ); @@ -212,10 +212,10 @@ void CharacterEdits::addCharacter( QString txt ) _single->append( entry ); } -void CharacterEdits::addRange( QString from, QString to ) +void CharacterEdits::addRange( TQString from, TQString to ) { KMultiFormListBoxEntryList list = _range->elements(); - for ( QPtrListIterator<KMultiFormListBoxEntry> it(list); *it; ++it ) { + for ( TQPtrListIterator<KMultiFormListBoxEntry> it(list); *it; ++it ) { RangeEntry* entry = dynamic_cast<RangeEntry*>( *it ); if ( entry && entry->isEmpty() ) { entry->setFrom( from ); @@ -249,30 +249,30 @@ int CharacterEdits::exec( TextRangeRegExp* regexp ) // Characters KMultiFormListBoxEntryList list1 = _single->elements(); - for ( QPtrListIterator<KMultiFormListBoxEntry> it(list1); *it; ++it ) { + for ( TQPtrListIterator<KMultiFormListBoxEntry> it(list1); *it; ++it ) { SingleEntry* entry = dynamic_cast<SingleEntry*>( *it ); if (entry) - entry->setText( QString::fromLocal8Bit("") ); + entry->setText( TQString::fromLocal8Bit("") ); } - QStringList list2 = regexp->chars(); - for ( QStringList::Iterator it2( list2.begin() ); ! (*it2).isNull(); ++it2 ) { + TQStringList list2 = regexp->chars(); + for ( TQStringList::Iterator it2( list2.begin() ); ! (*it2).isNull(); ++it2 ) { addCharacter( *it2 ); } // Ranges KMultiFormListBoxEntryList list3 = _range->elements(); - for ( QPtrListIterator<KMultiFormListBoxEntry> it3(list3); *it3; ++it3 ) { + for ( TQPtrListIterator<KMultiFormListBoxEntry> it3(list3); *it3; ++it3 ) { RangeEntry* entry = dynamic_cast<RangeEntry*>( *it3 ); if (entry) { - entry->setFrom( QString::fromLocal8Bit("") ); - entry->setTo( QString::fromLocal8Bit("") ); + entry->setFrom( TQString::fromLocal8Bit("") ); + entry->setTo( TQString::fromLocal8Bit("") ); } } - QPtrList<StringPair> ranges = regexp->range(); - for ( QPtrListIterator<StringPair> it4(ranges); *it4; ++it4 ) { - QString from = (*it4)->first(); - QString to = (*it4)->second(); + TQPtrList<StringPair> ranges = regexp->range(); + for ( TQPtrListIterator<StringPair> it4(ranges); *it4; ++it4 ) { + TQString from = (*it4)->first(); + TQString to = (*it4)->second(); addRange(from,to); } @@ -282,64 +282,64 @@ int CharacterEdits::exec( TextRangeRegExp* regexp ) } -CharacterEdits::CharacterEdits( QWidget *parent, const char *name) +CharacterEdits::CharacterEdits( TQWidget *parent, const char *name) : KDialogBase( parent, name == 0 ? "CharacterEdits" : name, true, i18n("Specify Characters"), KDialogBase::Ok | KDialogBase::Cancel) { - QWidget* top = new QWidget( this ); - QVBoxLayout *topLayout = new QVBoxLayout(top, 6); + TQWidget* top = new TQWidget( this ); + TQVBoxLayout *topLayout = new TQVBoxLayout(top, 6); setMainWidget( top ); - negate = new QCheckBox(i18n("Do not match the characters specified here"), + negate = new TQCheckBox(i18n("Do not match the characters specified here"), top); topLayout->addWidget( negate ); // The predefined box - QHGroupBox* predefined = new QHGroupBox(i18n("Predefined Character Ranges"),top); + TQHGroupBox* predefined = new TQHGroupBox(i18n("Predefined Character Ranges"),top); topLayout->addWidget(predefined); - QGrid* grid = new QGrid(3, predefined ); + TQGrid* grid = new TQGrid(3, predefined ); - wordChar = new QCheckBox(i18n("A word character"),grid); - digit = new QCheckBox(i18n("A digit character"),grid); - space = new QCheckBox(i18n("A space character"), grid); + wordChar = new TQCheckBox(i18n("A word character"),grid); + digit = new TQCheckBox(i18n("A digit character"),grid); + space = new TQCheckBox(i18n("A space character"), grid); - _nonWordChar = new QCheckBox(i18n("A non-word character"),grid); - _nonDigit = new QCheckBox(i18n("A non-digit character"),grid); - _nonSpace = new QCheckBox(i18n("A non-space character"), grid); + _nonWordChar = new TQCheckBox(i18n("A non-word character"),grid); + _nonDigit = new TQCheckBox(i18n("A non-digit character"),grid); + _nonSpace = new TQCheckBox(i18n("A non-space character"), grid); // Single characters - QVGroupBox* singleBox = new QVGroupBox(i18n("Single Characters"), top ); + TQVGroupBox* singleBox = new TQVGroupBox(i18n("Single Characters"), top ); topLayout->addWidget( singleBox ); _single = new KMultiFormListBox(new SingleFactory(), KMultiFormListBox::MultiVisible, singleBox); _single->addElement(); _single->addElement(); _single->addElement(); - QWidget* moreW = new QWidget( singleBox ); - QHBoxLayout* moreLay = new QHBoxLayout( moreW ); - QPushButton* more = new QPushButton( i18n("More Entries"), moreW ); + TQWidget* moreW = new TQWidget( singleBox ); + TQHBoxLayout* moreLay = new TQHBoxLayout( moreW ); + TQPushButton* more = new TQPushButton( i18n("More Entries"), moreW ); moreLay->addWidget( more ); moreLay->addStretch( 1 ); - connect(more,SIGNAL(clicked()), _single, SLOT(addElement())); + connect(more,TQT_SIGNAL(clicked()), _single, TQT_SLOT(addElement())); // Ranges - QVGroupBox* rangeBox = new QVGroupBox(i18n("Character Ranges"), top ); + TQVGroupBox* rangeBox = new TQVGroupBox(i18n("Character Ranges"), top ); topLayout->addWidget( rangeBox ); _range = new KMultiFormListBox(new RangeFactory(), KMultiFormListBox::MultiVisible, rangeBox); _range->addElement(); _range->addElement(); _range->addElement(); - moreW = new QWidget( rangeBox ); - moreLay = new QHBoxLayout( moreW ); - more = new QPushButton( i18n("More Entries"), moreW ); + moreW = new TQWidget( rangeBox ); + moreLay = new TQHBoxLayout( moreW ); + more = new TQPushButton( i18n("More Entries"), moreW ); moreLay->addWidget( more ); moreLay->addStretch( 1 ); - connect(more,SIGNAL(clicked()), _range, SLOT(addElement())); + connect(more,TQT_SIGNAL(clicked()), _range, TQT_SLOT(addElement())); // Buttons - connect(this, SIGNAL(okClicked()), this, SLOT(slotOK())); + connect(this, TQT_SIGNAL(okClicked()), this, TQT_SLOT(slotOK())); } void CharacterEdits::slotOK() @@ -358,7 +358,7 @@ void CharacterEdits::slotOK() // single characters _regexp->clearChars(); KMultiFormListBoxEntryList list = _single->elements(); - for ( QPtrListIterator<KMultiFormListBoxEntry> it( list ); *it; ++it ) { + for ( TQPtrListIterator<KMultiFormListBoxEntry> it( list ); *it; ++it ) { SingleEntry* entry = dynamic_cast<SingleEntry*>(*it); if ( entry && !entry->isEmpty() ) { _regexp->addCharacter( entry->text() ); @@ -368,7 +368,7 @@ void CharacterEdits::slotOK() // Ranges _regexp->clearRange(); list = _range->elements(); - for ( QPtrListIterator<KMultiFormListBoxEntry> it2( list ); *it2; ++it2 ) { + for ( TQPtrListIterator<KMultiFormListBoxEntry> it2( list ); *it2; ++it2 ) { RangeEntry* entry = dynamic_cast<RangeEntry*>(*it2); if ( entry && !entry->isEmpty() ) { _regexp->addRange( entry->fromText(), entry->toText() ); @@ -377,21 +377,21 @@ void CharacterEdits::slotOK() } -SingleEntry::SingleEntry(QWidget* parent, const char* name ) +SingleEntry::SingleEntry(TQWidget* parent, const char* name ) :KMultiFormListBoxEntry( parent, name ) { - QHBoxLayout* layout = new QHBoxLayout( this, 3, 6 ); + TQHBoxLayout* layout = new TQHBoxLayout( this, 3, 6 ); _selector = new CharSelector( this ); layout->addWidget( _selector ); layout->addStretch(1); } -QString SingleEntry::text() const +TQString SingleEntry::text() const { return _selector->text(); } -void SingleEntry::setText( QString text ) +void SingleEntry::setText( TQString text ) { _selector->setText( text ); } @@ -402,40 +402,40 @@ bool SingleEntry::isEmpty() const } -RangeEntry::RangeEntry(QWidget* parent, const char* name ) +RangeEntry::RangeEntry(TQWidget* parent, const char* name ) :KMultiFormListBoxEntry( parent, name ) { - QHBoxLayout* layout = new QHBoxLayout( this, 3, 6 ); + TQHBoxLayout* layout = new TQHBoxLayout( this, 3, 6 ); - QLabel* label = new QLabel(i18n("From:"), this ); + TQLabel* label = new TQLabel(i18n("From:"), this ); _from = new CharSelector( this ); layout->addWidget( label ); layout->addWidget( _from ); layout->addStretch(1); - label = new QLabel(i18n("end of range","To:"), this ); + label = new TQLabel(i18n("end of range","To:"), this ); _to = new CharSelector( this ); layout->addWidget( label ); layout->addWidget( _to ); } -QString RangeEntry::fromText() const +TQString RangeEntry::fromText() const { return _from->text(); } -QString RangeEntry::toText() const +TQString RangeEntry::toText() const { return _to->text(); } -void RangeEntry::setFrom( QString text ) +void RangeEntry::setFrom( TQString text ) { _from->setText( text ); } -void RangeEntry::setTo( QString text ) +void RangeEntry::setTo( TQString text ) { _to->setText( text ); } diff --git a/kregexpeditor/characterswidget.h b/kregexpeditor/characterswidget.h index 9df89b3..f6f2d66 100644 --- a/kregexpeditor/characterswidget.h +++ b/kregexpeditor/characterswidget.h @@ -26,7 +26,7 @@ #include <kmultiformlistbox.h> #include "regexpwidget.h" -#include <qvgroupbox.h> +#include <tqvgroupbox.h> class KDialogBase; class CharacterEdits; @@ -41,28 +41,28 @@ class QCheckBox; class CharactersWidget :public RegExpWidget { public: - CharactersWidget(RegExpEditorWindow* editorWindow, QWidget *parent, + CharactersWidget(RegExpEditorWindow* editorWindow, TQWidget *parent, const char *label = 0); CharactersWidget( TextRangeRegExp* regexp, RegExpEditorWindow* editorWindow, - QWidget* parent, const char* name = 0 ); + TQWidget* parent, const char* name = 0 ); ~CharactersWidget(); - virtual QSize sizeHint() const; + virtual TQSize sizeHint() const; virtual RegExp* regExp() const; virtual RegExpType type() const { return CHARSET; } - virtual RegExpWidget* findWidgetToEdit( QPoint globalPos ); + virtual RegExpWidget* findWidgetToEdit( TQPoint globalPos ); virtual int edit(); protected: - virtual void paintEvent(QPaintEvent *event); - QString text() const; - QString title() const; + virtual void paintEvent(TQPaintEvent *event); + TQString text() const; + TQString title() const; private: TextRangeRegExp *_regexp; static CharacterEdits *_configWindow; - mutable QSize _textSize; - mutable QSize _contentSize; + mutable TQSize _textSize; + mutable TQSize _contentSize; }; @@ -72,9 +72,9 @@ private: class SingleEntry :public KMultiFormListBoxEntry { public: - SingleEntry(QWidget* parent, const char* name = 0 ); - QString text() const; - void setText( QString text ); + SingleEntry(TQWidget* parent, const char* name = 0 ); + TQString text() const; + void setText( TQString text ); bool isEmpty() const; private: @@ -87,11 +87,11 @@ private: class RangeEntry :public KMultiFormListBoxEntry { public: - RangeEntry(QWidget* parent, const char* name = 0 ); - QString fromText() const; - QString toText() const; - void setFrom( QString text ); - void setTo( QString text ); + RangeEntry(TQWidget* parent, const char* name = 0 ); + TQString fromText() const; + TQString toText() const; + void setFrom( TQString text ); + void setTo( TQString text ); bool isEmpty() const; private: CharSelector *_from, *_to; @@ -103,8 +103,8 @@ private: class SingleFactory :public KMultiFormListBoxFactory { public: - KMultiFormListBoxEntry *create(QWidget *parent) { return new SingleEntry( parent ); } - QWidget *separator( QWidget* ) { return 0; } + KMultiFormListBoxEntry *create(TQWidget *parent) { return new SingleEntry( parent ); } + TQWidget *separator( TQWidget* ) { return 0; } }; /** @@ -113,8 +113,8 @@ public: class RangeFactory :public KMultiFormListBoxFactory { public: - KMultiFormListBoxEntry *create(QWidget *parent) { return new RangeEntry( parent ); } - QWidget *separator( QWidget* ) { return 0; } + KMultiFormListBoxEntry *create(TQWidget *parent) { return new RangeEntry( parent ); } + TQWidget *separator( TQWidget* ) { return 0; } }; /** @@ -124,7 +124,7 @@ class CharacterEdits : public KDialogBase { Q_OBJECT public: - CharacterEdits(QWidget *parent = 0, const char *name = 0); + CharacterEdits(TQWidget *parent = 0, const char *name = 0); public slots: int exec( TextRangeRegExp* regexp ); @@ -133,11 +133,11 @@ protected slots: void slotOK(); private: - QCheckBox *negate, *wordChar, *_nonWordChar, *digit, *_nonDigit, *space, *_nonSpace; + TQCheckBox *negate, *wordChar, *_nonWordChar, *digit, *_nonDigit, *space, *_nonSpace; KMultiFormListBox *_single, *_range; - void addCharacter( QString txt ); - void addRange( QString from, QString to ); + void addCharacter( TQString txt ); + void addRange( TQString from, TQString to ); TextRangeRegExp* _regexp; }; diff --git a/kregexpeditor/charselector.cpp b/kregexpeditor/charselector.cpp index 27fd23d..a71c679 100644 --- a/kregexpeditor/charselector.cpp +++ b/kregexpeditor/charselector.cpp @@ -26,41 +26,41 @@ #include "charselector.h" #include "limitedcharlineedit.h" #include "regexpconverter.h" -#include <qlayout.h> -#include <qwidgetstack.h> -#include <qcombobox.h> +#include <tqlayout.h> +#include <tqwidgetstack.h> +#include <tqcombobox.h> /** In the class CharSelector, three LimitedCharLineEdit are used. - These widgets are all used in a QWidgetStack. The LimitedCharLineEdit - class is basically a QLineEdit, which is limited to a certain - number of characters. This conflicts with the QWidgetStack, as this + These widgets are all used in a TQWidgetStack. The LimitedCharLineEdit + class is basically a TQLineEdit, which is limited to a certain + number of characters. This conflicts with the TQWidgetStack, as this class expects the widgets on the stack to take up all space. StackContainer fills in this gab. */ class StackContainer :public QWidget { public: - StackContainer( QWidget* child, QWidget* parent ) : QWidget( parent ) + StackContainer( TQWidget* child, TQWidget* parent ) : TQWidget( parent ) { - QHBoxLayout* layout = new QHBoxLayout( this ); - child->reparent( this, QPoint(0,0), false ); + TQHBoxLayout* layout = new TQHBoxLayout( this ); + child->reparent( this, TQPoint(0,0), false ); layout->addWidget( child ); layout->addStretch( 1 ); } }; -CharSelector::CharSelector( QWidget* parent, const char* name ) - :QWidget( parent, name ), _oldIndex(0) +CharSelector::CharSelector( TQWidget* parent, const char* name ) + :TQWidget( parent, name ), _oldIndex(0) { - QStringList items; - QHBoxLayout* layout = new QHBoxLayout( this, 0, 6 ); + TQStringList items; + TQHBoxLayout* layout = new TQHBoxLayout( this, 0, 6 ); - _type = new QComboBox( this, "_type" ); + _type = new TQComboBox( this, "_type" ); items << i18n("Normal Character") << i18n("Unicode Char in Hex.") << i18n("Unicode Char in Oct.") - << QString::fromLatin1("----") + << TQString::fromLatin1("----") << i18n("The Bell Character (\\a)") << i18n("The Form Feed Character (\\f)") << i18n("The Line Feed Character (\\n)") @@ -70,7 +70,7 @@ CharSelector::CharSelector( QWidget* parent, const char* name ) _type->insertStringList( items ); layout->addWidget( _type ); - _stack = new QWidgetStack( this, "_stack" ); + _stack = new TQWidgetStack( this, "_stack" ); layout->addWidget( _stack ); _normal = new LimitedCharLineEdit( LimitedCharLineEdit::NORMAL, 0, "_normal" ); @@ -84,7 +84,7 @@ CharSelector::CharSelector( QWidget* parent, const char* name ) _stack->raiseWidget( 0 ); - connect( _type, SIGNAL( activated( int ) ), this, SLOT(slotNewItem( int ) ) ); + connect( _type, TQT_SIGNAL( activated( int ) ), this, TQT_SLOT(slotNewItem( int ) ) ); } void CharSelector::slotNewItem( int which ) @@ -110,7 +110,7 @@ void CharSelector::slotNewItem( int which ) _oldIndex = which; } -void CharSelector::setText( QString text ) +void CharSelector::setText( TQString text ) { // This is the best I can do about missing character range features, unless all of // textrangeregexp is to be reworked. The problem is that textrangeregexp only allows to @@ -119,26 +119,26 @@ void CharSelector::setText( QString text ) bool enabled = ( RegExpConverter::current()->features() & RegExpConverter::ExtRange ); _type->setEnabled( enabled ); - if ( text.at(0) == QChar('\\') ) { - if ( text.at(1) == QChar('x') ) { + if ( text.at(0) == TQChar('\\') ) { + if ( text.at(1) == TQChar('x') ) { _hex->setText(text.mid(2)); slotNewItem( 1 ); } - else if ( text.at(1) == QChar('0') ) { + else if ( text.at(1) == TQChar('0') ) { _oct->setText(text.mid(2)); slotNewItem( 2 ); } - else if ( text.at(1) == QChar('a') ) + else if ( text.at(1) == TQChar('a') ) slotNewItem(4); - else if ( text.at(1) == QChar('f') ) + else if ( text.at(1) == TQChar('f') ) slotNewItem(5); - else if ( text.at(1) == QChar('n') ) + else if ( text.at(1) == TQChar('n') ) slotNewItem(6); - else if ( text.at(1) == QChar('r') ) + else if ( text.at(1) == TQChar('r') ) slotNewItem(7); - else if ( text.at(1) == QChar('t') ) + else if ( text.at(1) == TQChar('t') ) slotNewItem(8); - else if ( text.at(1) == QChar('v') ) + else if ( text.at(1) == TQChar('v') ) slotNewItem(9); else { qWarning("Warning %s:%d Unknown escape %s", __FILE__, __LINE__, text.latin1() ); @@ -157,29 +157,29 @@ bool CharSelector::isEmpty() const ( _type->currentItem() == 2 && _oct->text().isEmpty() ); } -QString CharSelector::text() const +TQString CharSelector::text() const { switch ( _type->currentItem() ) { case 0: // Normal Character return _normal->text(); case 1: // Hex - return QString::fromLocal8Bit("\\x") + _hex->text(); + return TQString::fromLocal8Bit("\\x") + _hex->text(); case 2: // Oct - return QString::fromLocal8Bit("\\0") + _oct->text(); + return TQString::fromLocal8Bit("\\0") + _oct->text(); case 3: // The seperator break; case 4: - return QString::fromLatin1("\\a"); + return TQString::fromLatin1("\\a"); case 5: - return QString::fromLatin1("\\f"); + return TQString::fromLatin1("\\f"); case 6: - return QString::fromLatin1("\\n"); + return TQString::fromLatin1("\\n"); case 7: - return QString::fromLatin1("\\r"); + return TQString::fromLatin1("\\r"); case 8: - return QString::fromLatin1("\\t"); + return TQString::fromLatin1("\\t"); case 9: - return QString::fromLatin1("\\v"); + return TQString::fromLatin1("\\v"); } - return QString::null; + return TQString::null; } diff --git a/kregexpeditor/charselector.h b/kregexpeditor/charselector.h index 07aa056..4990ada 100644 --- a/kregexpeditor/charselector.h +++ b/kregexpeditor/charselector.h @@ -18,7 +18,7 @@ #ifndef CHARSELECTOR_H #define CHARSELECTOR_H -#include <qwidget.h> +#include <tqwidget.h> class QComboBox; class QWidgetStack; @@ -29,9 +29,9 @@ class CharSelector :public QWidget Q_OBJECT public: - CharSelector( QWidget* parent, const char* name = 0 ); - QString text() const; - void setText( QString text ); + CharSelector( TQWidget* parent, const char* name = 0 ); + TQString text() const; + void setText( TQString text ); bool isEmpty() const; protected: @@ -41,8 +41,8 @@ private slots: void slotNewItem( int which ); private: - QComboBox* _type; - QWidgetStack* _stack; + TQComboBox* _type; + TQWidgetStack* _stack; LimitedCharLineEdit* _normal; LimitedCharLineEdit* _hex; LimitedCharLineEdit* _oct; diff --git a/kregexpeditor/compoundregexp.cpp b/kregexpeditor/compoundregexp.cpp index 2949b48..0c5e194 100644 --- a/kregexpeditor/compoundregexp.cpp +++ b/kregexpeditor/compoundregexp.cpp @@ -25,7 +25,7 @@ #include "compoundregexp.h" #include "widgetfactory.h" -CompoundRegExp::CompoundRegExp( bool selected, const QString& title, const QString& description, bool hidden, +CompoundRegExp::CompoundRegExp( bool selected, const TQString& title, const TQString& description, bool hidden, bool allowReplace, RegExp* child) : RegExp( selected ), _title( title ), _description( description ), _hidden( hidden ), _allowReplace( allowReplace ), _child( child ) { @@ -38,21 +38,21 @@ bool CompoundRegExp::check( ErrorMap& map, bool first, bool last ) return _child->check( map, first, last ); } -QDomNode CompoundRegExp::toXml( QDomDocument* doc ) const +TQDomNode CompoundRegExp::toXml( TQDomDocument* doc ) const { - QDomElement top = doc->createElement( QString::fromLocal8Bit( "Compound" ) ); + TQDomElement top = doc->createElement( TQString::fromLocal8Bit( "Compound" ) ); if (_hidden) - top.setAttribute( QString::fromLocal8Bit("hidden"), true ); + top.setAttribute( TQString::fromLocal8Bit("hidden"), true ); if ( _allowReplace ) - top.setAttribute( QString::fromLocal8Bit("allowReplace"), true ); + top.setAttribute( TQString::fromLocal8Bit("allowReplace"), true ); - QDomElement title = doc->createElement( QString::fromLocal8Bit( "Title" ) ); - QDomText titleTxt = doc->createTextNode( _title ); + TQDomElement title = doc->createElement( TQString::fromLocal8Bit( "Title" ) ); + TQDomText titleTxt = doc->createTextNode( _title ); title.appendChild( titleTxt ); top.appendChild( title ); - QDomElement description = doc->createElement( QString::fromLocal8Bit( "Description" ) ); - QDomText descriptionTxt = doc->createTextNode( _description ); + TQDomElement description = doc->createElement( TQString::fromLocal8Bit( "Description" ) ); + TQDomText descriptionTxt = doc->createTextNode( _description ); description.appendChild( descriptionTxt ); top.appendChild( description ); @@ -62,30 +62,30 @@ QDomNode CompoundRegExp::toXml( QDomDocument* doc ) const } -bool CompoundRegExp::load( QDomElement top, const QString& version ) +bool CompoundRegExp::load( TQDomElement top, const TQString& version ) { - Q_ASSERT( top.tagName() == QString::fromLocal8Bit("Compound") ); - QString str = top.attribute( QString::fromLocal8Bit( "hidden" ), QString::fromLocal8Bit("0") ); - _hidden = true; // alway hidden. (str == QString::fromLocal8Bit("1") ); + Q_ASSERT( top.tagName() == TQString::fromLocal8Bit("Compound") ); + TQString str = top.attribute( TQString::fromLocal8Bit( "hidden" ), TQString::fromLocal8Bit("0") ); + _hidden = true; // alway hidden. (str == TQString::fromLocal8Bit("1") ); - str = top.attribute( QString::fromLocal8Bit( "allowReplace" ), QString::fromLocal8Bit("0") ); - _allowReplace = (str == QString::fromLocal8Bit("1") ); + str = top.attribute( TQString::fromLocal8Bit( "allowReplace" ), TQString::fromLocal8Bit("0") ); + _allowReplace = (str == TQString::fromLocal8Bit("1") ); - for ( QDomNode node = top.firstChild(); !node.isNull(); node = node.nextSibling() ) { + for ( TQDomNode node = top.firstChild(); !node.isNull(); node = node.nextSibling() ) { if ( !node.isElement() ) continue; // skip past comments. - QString txt; - QDomElement child = node.toElement(); - QDomNode txtNode = child.firstChild(); + TQString txt; + TQDomElement child = node.toElement(); + TQDomNode txtNode = child.firstChild(); if ( txtNode.isText() ) txt = txtNode.toText().data(); - if ( child.tagName() == QString::fromLocal8Bit( "Title" ) ) { + if ( child.tagName() == TQString::fromLocal8Bit( "Title" ) ) { if ( txt.isEmpty() ) _title = txt; else _title = i18n(txt.utf8()); } - else if ( child.tagName() == QString::fromLocal8Bit( "Description" ) ) { + else if ( child.tagName() == TQString::fromLocal8Bit( "Description" ) ) { if ( txt.isEmpty() ) _description = txt; else diff --git a/kregexpeditor/compoundregexp.h b/kregexpeditor/compoundregexp.h index 4e9aa8c..6368359 100644 --- a/kregexpeditor/compoundregexp.h +++ b/kregexpeditor/compoundregexp.h @@ -26,16 +26,16 @@ class CompoundRegExp :public RegExp { public: - CompoundRegExp( bool selected, const QString& title = QString::null, - const QString& description = QString::null, + CompoundRegExp( bool selected, const TQString& title = TQString::null, + const TQString& description = TQString::null, bool hidden = false, bool allowReplace = false, RegExp* child = 0); virtual bool check( ErrorMap&, bool first, bool last ); virtual int precedence() const { return _child->precedence();} - virtual QDomNode toXml( QDomDocument* doc ) const; - virtual bool load( QDomElement, const QString& version ); - QString title() const { return _title; } - QString description() const { return _description; } + virtual TQDomNode toXml( TQDomDocument* doc ) const; + virtual bool load( TQDomElement, const TQString& version ); + TQString title() const { return _title; } + TQString description() const { return _description; } RegExp* child() const { return _child; } bool hidden() const { return _hidden; } bool allowReplace() const { return _allowReplace; } @@ -43,8 +43,8 @@ public: virtual bool operator==( const RegExp& other ) const; private: - QString _title; - QString _description; + TQString _title; + TQString _description; bool _hidden; bool _allowReplace; RegExp* _child; diff --git a/kregexpeditor/compoundwidget.cpp b/kregexpeditor/compoundwidget.cpp index 3294313..441143f 100644 --- a/kregexpeditor/compoundwidget.cpp +++ b/kregexpeditor/compoundwidget.cpp @@ -26,33 +26,33 @@ #endif #include "compoundwidget.h" -#include <qlayout.h> -#include <qcursor.h> -#include <qlineedit.h> -#include <qpainter.h> -#include <qtooltip.h> +#include <tqlayout.h> +#include <tqcursor.h> +#include <tqlineedit.h> +#include <tqpainter.h> +#include <tqtooltip.h> #include "concwidget.h" #include "kwidgetstreamer.h" -#include "qcheckbox.h" +#include "tqcheckbox.h" //================================================================================ -CompoundDetailWindow::CompoundDetailWindow( QWidget* parent, const char* name ) - :QWidget( parent, name ) +CompoundDetailWindow::CompoundDetailWindow( TQWidget* parent, const char* name ) + :TQWidget( parent, name ) { - QVBoxLayout* layout = new QVBoxLayout( this ); + TQVBoxLayout* layout = new TQVBoxLayout( this ); layout->setAutoAdd( true ); - QLabel* label = new QLabel( i18n("&Title:"), this); - _title = new QLineEdit( this ); + TQLabel* label = new TQLabel( i18n("&Title:"), this); + _title = new TQLineEdit( this ); label->setBuddy( _title ); - label = new QLabel( i18n("&Description:"), this ); - _description = new QMultiLineEdit( this ); + label = new TQLabel( i18n("&Description:"), this ); + _description = new TQMultiLineEdit( this ); label->setBuddy( _description ); - _allowReplace = new QCheckBox( i18n("&Automatically replace using this item"), this ); - QToolTip::add( _allowReplace, i18n("When the content of this box is typed in to the ASCII line,<br>" + _allowReplace = new TQCheckBox( i18n("&Automatically replace using this item"), this ); + TQToolTip::add( _allowReplace, i18n("When the content of this box is typed in to the ASCII line,<br>" "this box will automatically be added around it,<br>" "if this check box is selected.") ); _allowReplace->setChecked( true ); @@ -61,12 +61,12 @@ CompoundDetailWindow::CompoundDetailWindow( QWidget* parent, const char* name ) } -QString CompoundDetailWindow::title() const +TQString CompoundDetailWindow::title() const { return _title->text(); } -QString CompoundDetailWindow::description() const +TQString CompoundDetailWindow::description() const { return _description->text(); } @@ -76,12 +76,12 @@ bool CompoundDetailWindow::allowReplace() const return _allowReplace->isChecked(); } -void CompoundDetailWindow::setTitle( QString txt ) +void CompoundDetailWindow::setTitle( TQString txt ) { _title->setText( txt ); } -void CompoundDetailWindow::setDescription( QString txt ) +void CompoundDetailWindow::setDescription( TQString txt ) { _description->setText( txt ); } @@ -93,7 +93,7 @@ void CompoundDetailWindow::setAllowReplace( bool b ) //================================================================================ -CompoundWidget::CompoundWidget( RegExpEditorWindow* editorWindow, QWidget* parent, +CompoundWidget::CompoundWidget( RegExpEditorWindow* editorWindow, TQWidget* parent, const char* name ) :SingleContainerWidget( editorWindow, parent, name == 0 ? "CompoundWidget" : name ) { @@ -102,7 +102,7 @@ CompoundWidget::CompoundWidget( RegExpEditorWindow* editorWindow, QWidget* paren } CompoundWidget::CompoundWidget( CompoundRegExp* regexp, RegExpEditorWindow* editorWindow, - QWidget* parent, const char* name ) + TQWidget* parent, const char* name ) : SingleContainerWidget( editorWindow, parent, name == 0 ? "CompoundWidget" : name ) { init(); @@ -125,19 +125,19 @@ void CompoundWidget::init( ) _content = new CompoundDetailWindow( _configWindow ); _configWindow->setMainWidget( _content ); - connect( _configWindow, SIGNAL(cancelClicked()), this, SLOT(slotConfigCanceled())) ; - connect(_configWindow, SIGNAL(finished()), this, SLOT(slotConfigWindowClosed())); + connect( _configWindow, TQT_SIGNAL(cancelClicked()), this, TQT_SLOT(slotConfigCanceled())) ; + connect(_configWindow, TQT_SIGNAL(finished()), this, TQT_SLOT(slotConfigWindowClosed())); - _down = getIcon( QString::fromLocal8Bit( "1downarrow" )); - _up = getIcon( QString::fromLocal8Bit( "1uparrow" ) ); + _down = getIcon( TQString::fromLocal8Bit( "1downarrow" )); + _up = getIcon( TQString::fromLocal8Bit( "1uparrow" ) ); _hidden = false; _backRefId = -1; } -QSize CompoundWidget::sizeHint() const +TQSize CompoundWidget::sizeHint() const { - QFontMetrics metrics = fontMetrics(); + TQFontMetrics metrics = fontMetrics(); _childSize = _child->sizeHint(); _textSize = metrics.size( 0, _content->title() ); @@ -158,15 +158,15 @@ QSize CompoundWidget::sizeHint() const height = QMAX( _textSize.height(), _pixmapSize.height() ) + 2*bdSize + _childSize.height() + pw; } - return QSize( width, height ); + return TQSize( width, height ); } -void CompoundWidget::paintEvent( QPaintEvent *e ) +void CompoundWidget::paintEvent( TQPaintEvent *e ) { - QSize mySize = sizeHint(); + TQSize mySize = sizeHint(); - QPainter painter(this); + TQPainter painter(this); drawPossibleSelection( painter, mySize); int horLineY, childY; @@ -175,7 +175,7 @@ void CompoundWidget::paintEvent( QPaintEvent *e ) if ( _hidden ) { horLineY = _pixmapSize.height()/2; childY = _pixmapSize.height() + bdSize; - _pixmapPos = QPoint( mySize.width()-pw-bdSize-_pixmapSize.width(), 0 ); + _pixmapPos = TQPoint( mySize.width()-pw-bdSize-_pixmapSize.width(), 0 ); painter.drawLine( pw, horLineY, _pixmapPos.x(), horLineY ); painter.drawLine( mySize.width() - bdSize - pw, horLineY, mySize.width(), horLineY); @@ -197,7 +197,7 @@ void CompoundWidget::paintEvent( QPaintEvent *e ) offset += _textSize.width() + bdSize; } - _pixmapPos = QPoint( mySize.width()-pw-bdSize-_pixmapSize.width(), + _pixmapPos = TQPoint( mySize.width()-pw-bdSize-_pixmapSize.width(), horLineY - _pixmapSize.height()/2 ); painter.drawLine( offset, horLineY, _pixmapPos.x(), horLineY ); @@ -219,8 +219,8 @@ void CompoundWidget::paintEvent( QPaintEvent *e ) _content->title() ); } else { - QSize curSize = _child->size(); - QSize newSize = QSize( QMAX( _child->sizeHint().width(), mySize.width()-2*pw), + TQSize curSize = _child->size(); + TQSize newSize = TQSize( QMAX( _child->sizeHint().width(), mySize.width()-2*pw), _child->sizeHint().height()); _child->move( pw, childY ); @@ -244,7 +244,7 @@ void CompoundWidget::slotConfigWindowClosed() void CompoundWidget::slotConfigCanceled() { - QDataStream stream( _backup, IO_ReadOnly ); + TQDataStream stream( _backup, IO_ReadOnly ); KWidgetStreamer streamer; streamer.fromStream( stream, _content ); repaint(); @@ -256,10 +256,10 @@ RegExp* CompoundWidget::regExp() const _hidden, _content->allowReplace(), _child->regExp() ); } -void CompoundWidget::mousePressEvent( QMouseEvent* event ) +void CompoundWidget::mousePressEvent( TQMouseEvent* event ) { if ( event->button() == LeftButton && - QRect( _pixmapPos, _pixmapSize ).contains( event->pos() ) ) { + TQRect( _pixmapPos, _pixmapSize ).contains( event->pos() ) ) { // Skip otherwise we will never see the mouse release // since it is eaten by Editor window. } @@ -267,10 +267,10 @@ void CompoundWidget::mousePressEvent( QMouseEvent* event ) SingleContainerWidget::mousePressEvent( event ); } -void CompoundWidget::mouseReleaseEvent( QMouseEvent* event) +void CompoundWidget::mouseReleaseEvent( TQMouseEvent* event) { if ( event->button() == LeftButton && - QRect( _pixmapPos, _pixmapSize ).contains( event->pos() ) ) { + TQRect( _pixmapPos, _pixmapSize ).contains( event->pos() ) ) { _hidden = !_hidden; _editorWindow->updateContent( 0 ); repaint(); // is this necesary? @@ -296,9 +296,9 @@ bool CompoundWidget::updateSelection( bool parentSelected ) int CompoundWidget::edit() { - _configWindow->move(QCursor::pos() - QPoint(_configWindow->sizeHint().width()/2, + _configWindow->move(TQCursor::pos() - TQPoint(_configWindow->sizeHint().width()/2, _configWindow->sizeHint().height()/2) ); - QDataStream stream( _backup, IO_WriteOnly ); + TQDataStream stream( _backup, IO_WriteOnly ); KWidgetStreamer streamer; streamer.toStream( _content, stream ); return _configWindow->exec(); @@ -310,10 +310,10 @@ int nextId() return ++counter; } -QPixmap CompoundWidget::getIcon( const QString& name ) +TQPixmap CompoundWidget::getIcon( const TQString& name ) { #ifdef QT_ONLY - QPixmap pix; + TQPixmap pix; pix.convertFromImage( qembed_findImage(name) ); return pix; #else diff --git a/kregexpeditor/compoundwidget.h b/kregexpeditor/compoundwidget.h index f757c05..4f68b9e 100644 --- a/kregexpeditor/compoundwidget.h +++ b/kregexpeditor/compoundwidget.h @@ -32,18 +32,18 @@ class QCheckBox; class CompoundDetailWindow :public QWidget { public: - CompoundDetailWindow(QWidget* parent, const char* name = 0); - QString title() const; - QString description() const; + CompoundDetailWindow(TQWidget* parent, const char* name = 0); + TQString title() const; + TQString description() const; bool allowReplace() const; - void setTitle( QString ); - void setDescription( QString ); + void setTitle( TQString ); + void setDescription( TQString ); void setAllowReplace( bool ); private: - QLineEdit* _title; - QMultiLineEdit* _description; - QCheckBox* _allowReplace; + TQLineEdit* _title; + TQMultiLineEdit* _description; + TQCheckBox* _allowReplace; }; @@ -62,23 +62,23 @@ class CompoundWidget :public SingleContainerWidget Q_OBJECT public: - CompoundWidget( RegExpEditorWindow* editorWindow, QWidget* parent, + CompoundWidget( RegExpEditorWindow* editorWindow, TQWidget* parent, const char* name = 0); CompoundWidget( CompoundRegExp* regexp, RegExpEditorWindow* editorWindow, - QWidget* parent, const char* name = 0); + TQWidget* parent, const char* name = 0); virtual bool updateSelection( bool parentSelected ); - virtual QSize sizeHint() const; + virtual TQSize sizeHint() const; virtual RegExp* regExp() const; virtual RegExpType type() const { return COMPOUND; } virtual int edit(); protected: - virtual void paintEvent( QPaintEvent *e ); - virtual void mousePressEvent( QMouseEvent* e ); - virtual void mouseReleaseEvent( QMouseEvent* e); + virtual void paintEvent( TQPaintEvent *e ); + virtual void mousePressEvent( TQMouseEvent* e ); + virtual void mouseReleaseEvent( TQMouseEvent* e); void init(); - QPixmap getIcon( const QString& name ); + TQPixmap getIcon( const TQString& name ); protected slots: void slotConfigCanceled(); @@ -86,16 +86,16 @@ protected slots: private: bool _hidden; - QPixmap _up, _down; - mutable QSize _pixmapSize; - mutable QPoint _pixmapPos; + TQPixmap _up, _down; + mutable TQSize _pixmapSize; + mutable TQPoint _pixmapPos; KDialogBase* _configWindow; CompoundDetailWindow* _content; - mutable QSize _textSize; - mutable QSize _childSize; - QByteArray _backup; + mutable TQSize _textSize; + mutable TQSize _childSize; + TQByteArray _backup; int _backRefId; }; diff --git a/kregexpeditor/concregexp.cpp b/kregexpeditor/concregexp.cpp index 4fac8d0..cefbac4 100644 --- a/kregexpeditor/concregexp.cpp +++ b/kregexpeditor/concregexp.cpp @@ -55,20 +55,20 @@ RegExp* ConcRegExp::lastRegExp() return list.at( list.count()-1); } -QDomNode ConcRegExp::toXml( QDomDocument* doc ) const +TQDomNode ConcRegExp::toXml( TQDomDocument* doc ) const { - QDomElement top = doc->createElement( QString::fromLocal8Bit("Concatenation") ); + TQDomElement top = doc->createElement( TQString::fromLocal8Bit("Concatenation") ); for ( RegExpListIt it(list); *it; ++it ) { top.appendChild( (*it)->toXml( doc ) ); } return top; } -bool ConcRegExp::load( QDomElement top, const QString& version ) +bool ConcRegExp::load( TQDomElement top, const TQString& version ) { - Q_ASSERT( top.tagName() == QString::fromLocal8Bit( "Concatenation" ) ); + Q_ASSERT( top.tagName() == TQString::fromLocal8Bit( "Concatenation" ) ); - for ( QDomNode child = top.firstChild(); !child.isNull(); child = child.nextSibling() ) { + for ( TQDomNode child = top.firstChild(); !child.isNull(); child = child.nextSibling() ) { if ( ! child.isElement() ) continue; // User might have added a comment. @@ -84,7 +84,7 @@ bool ConcRegExp::operator==( const RegExp& other ) const { // TODO: Merge with AltnRegExp::operator== if ( list.count() == 1 ) - return ( other == *(const_cast< QPtrList<RegExp>& >(list).at(0)) ); + return ( other == *(const_cast< TQPtrList<RegExp>& >(list).at(0)) ); if ( other.type() != type() ) return false; diff --git a/kregexpeditor/concregexp.h b/kregexpeditor/concregexp.h index 52a6342..47e3b26 100644 --- a/kregexpeditor/concregexp.h +++ b/kregexpeditor/concregexp.h @@ -36,8 +36,8 @@ public: virtual bool check( ErrorMap&, bool first, bool last ); virtual int precedence() const { return 2;} - virtual QDomNode toXml( QDomDocument* doc ) const; - virtual bool load( QDomElement, const QString& version ); + virtual TQDomNode toXml( TQDomDocument* doc ) const; + virtual bool load( TQDomElement, const TQString& version ); virtual RegExpType type() const {return CONC; } virtual bool operator==( const RegExp& other ) const; virtual void replacePart( CompoundRegExp* replacement ); diff --git a/kregexpeditor/concwidget.cpp b/kregexpeditor/concwidget.cpp index f67c49b..d76730f 100644 --- a/kregexpeditor/concwidget.cpp +++ b/kregexpeditor/concwidget.cpp @@ -19,9 +19,9 @@ #include "concwidget.h" #include "dragaccepter.h" -#include <qpainter.h> +#include <tqpainter.h> -ConcWidget::ConcWidget(RegExpEditorWindow* editorWindow, QWidget *parent, +ConcWidget::ConcWidget(RegExpEditorWindow* editorWindow, TQWidget *parent, const char *name) :MultiContainerWidget(editorWindow, parent, name == 0 ? "concwidget" : name) { @@ -33,13 +33,13 @@ ConcWidget::ConcWidget(RegExpEditorWindow* editorWindow, QWidget *parent, ConcWidget::ConcWidget(RegExpEditorWindow* editorWindow, RegExpWidget *child, - QWidget *parent, const char *name) + TQWidget *parent, const char *name) :MultiContainerWidget(editorWindow, parent, name == 0 ? "concwidget" : name) { init(); DragAccepter *accepter = new DragAccepter(editorWindow, this); _children.append(accepter); - child->reparent(this, QPoint(0,0), false); + child->reparent(this, TQPoint(0,0), false); addNewChild(accepter, child); } @@ -52,13 +52,13 @@ ConcWidget::ConcWidget( RegExpEditorWindow* editorWindow, ConcWidget* origConc, for (unsigned int i = end; i >= start; i--) { RegExpWidget* child = origConc->_children.take( i ); _children.prepend( child ); - child->reparent( this, QPoint(0,0), false); + child->reparent( this, TQPoint(0,0), false); } _children.prepend( new DragAccepter(editorWindow, this) ); } ConcWidget::ConcWidget( ConcRegExp* regexp, RegExpEditorWindow* editorWindow, - QWidget* parent, const char* name ) + TQWidget* parent, const char* name ) :MultiContainerWidget( editorWindow, parent, name == 0 ? "concwidget" : name ) { init(); @@ -78,22 +78,22 @@ void ConcWidget::init() } -QSize ConcWidget::sizeHint() const +TQSize ConcWidget::sizeHint() const { int childrenWidth = 0; int childrenHeight = 0; - QPtrListIterator<RegExpWidget> it(_children); + TQPtrListIterator<RegExpWidget> it(_children); for ( ; *it; ++it) { - QSize thisChildSize = (*it)->sizeHint(); + TQSize thisChildSize = (*it)->sizeHint(); childrenWidth += thisChildSize.width(); childrenHeight = QMAX(childrenHeight, thisChildSize.height()); } - return QSize(childrenWidth, childrenHeight); + return TQSize(childrenWidth, childrenHeight); } -void ConcWidget::paintEvent( QPaintEvent *e) +void ConcWidget::paintEvent( TQPaintEvent *e) { Q_ASSERT( dynamic_cast<DragAccepter*>(_children.at(0)) ); // if this fails, then I should check the location of the show() @@ -106,8 +106,8 @@ void ConcWidget::paintEvent( QPaintEvent *e) _children.at(0)->setGeometry( 0, 0, size().width(), size().height() ); } else { - QSize myReqSize = sizeHint(); - QSize mySize(QMAX(myReqSize.width(), size().width()), + TQSize myReqSize = sizeHint(); + TQSize mySize(QMAX(myReqSize.width(), size().width()), QMAX(myReqSize.height(), size().height())); // If the widget needs less space than it can get then this space should @@ -118,7 +118,7 @@ void ConcWidget::paintEvent( QPaintEvent *e) extra = (size().width() - myReqSize.width())/2; } - QPainter painter( this ); + TQPainter painter( this ); drawPossibleSelection( painter, mySize ); @@ -131,8 +131,8 @@ void ConcWidget::paintEvent( QPaintEvent *e) continue; RegExpWidget* child = _children.at(i); - QSize childSize = child->sizeHint(); - QSize curChildSize = child->size(); + TQSize childSize = child->sizeHint(); + TQSize curChildSize = child->size(); //----------------------------- first place the accepter int x = offset; @@ -150,7 +150,7 @@ void ConcWidget::paintEvent( QPaintEvent *e) if ( accepter->isSelected() ) { y = (mySize.height()-_maxSelectedHeight)/2; h = _maxSelectedHeight; - painter.fillRect( x, y, w, h, QBrush( gray ) ); + painter.fillRect( x, y, w, h, TQBrush( gray ) ); } //-------------------------------------- place the child @@ -170,7 +170,7 @@ void ConcWidget::paintEvent( QPaintEvent *e) if ( child->isSelected() ) { y = (mySize.height()-_maxSelectedHeight)/2; h = _maxSelectedHeight; - painter.fillRect( x, y, w, h, QBrush( gray ) ); + painter.fillRect( x, y, w, h, TQBrush( gray ) ); } } @@ -187,7 +187,7 @@ void ConcWidget::paintEvent( QPaintEvent *e) MultiContainerWidget::paintEvent( e ); } -void ConcWidget::mousePressEvent ( QMouseEvent* event ) +void ConcWidget::mousePressEvent ( TQMouseEvent* event ) { if ( event->button() == RightButton ) { _editorWindow->showRMBMenu( _editorWindow->hasSelection() ); @@ -212,7 +212,7 @@ void ConcWidget::sizeAccepter( DragAccepter* accepter, int height, int totHeight RegExp* ConcWidget::regExp() const { - QPtrListIterator<RegExpWidget> it( _children ); + TQPtrListIterator<RegExpWidget> it( _children ); ++it; // start with the second element. if ( _children.count() == 3 ) { @@ -236,7 +236,7 @@ bool ConcWidget::updateSelection(bool parentSelected) _maxSelectedHeight = 0; - QPtrListIterator<RegExpWidget> it(_children); + TQPtrListIterator<RegExpWidget> it(_children); ++it; // Skip past the first DragAccepter for ( ; *it; it +=2 ) { if ( (*it)->isSelected() ) { @@ -287,7 +287,7 @@ void ConcWidget::applyRegExpToSelection( RegExpType type ) if ( start == -1 ) { // No item selected at top level - QPtrListIterator<RegExpWidget> it(_children); + TQPtrListIterator<RegExpWidget> it(_children); ++it; // Skip past the first DragAccepter for ( ; *it ; it += 2 ) { if ( (*it)->hasSelection() ) { @@ -306,7 +306,7 @@ void ConcWidget::applyRegExpToSelection( RegExpType type ) subSequence->resize(0,0); // see note (1) - subSequence->reparent( newElm, QPoint(0,0), false); + subSequence->reparent( newElm, TQPoint(0,0), false); _children.insert( start, newElm ); newElm->show(); } @@ -318,7 +318,7 @@ bool ConcWidget::isSelected() const // A ConcWidget should be considered selected when all its elements has been selected // otherwise empty ConcWidgets may be left behind when for example selection is deleted. bool allSelected = true; - QPtrListIterator<RegExpWidget> it(_children); + TQPtrListIterator<RegExpWidget> it(_children); ++it; // Skip past first DragAccepter. for ( ; *it && allSelected; it += 2 ) { allSelected = allSelected && (*it)->isSelected(); @@ -336,7 +336,7 @@ RegExp* ConcWidget::selection() const bool foundMoreThanOne = false; RegExp* regexp = 0; - QPtrListIterator<RegExpWidget> it(_children); + TQPtrListIterator<RegExpWidget> it(_children); ++it; // Skip past the first DragAccepter for ( ; (*it) ; it += 2 ) { if ( (*it)->hasSelection() ) { @@ -373,10 +373,10 @@ void ConcWidget::addNewConcChild(DragAccepter *accepter, ConcWidget *other) // namely that every second element is a dragAccepter for ( unsigned int j = other->_children.count()-1; j > 0 ; j-=2 ) { RegExpWidget* newChildA = other->_children.take(j); - newChildA->reparent( this, QPoint(0,0), false); + newChildA->reparent( this, TQPoint(0,0), false); _children.insert( i+1, newChildA ); RegExpWidget* newChildB = other->_children.take(j-1); - newChildB->reparent( this, QPoint(0,0), false); + newChildB->reparent( this, TQPoint(0,0), false); _children.insert( i+1, newChildB ); newChildA->show(); newChildB->show(); @@ -391,7 +391,7 @@ void ConcWidget::addNewConcChild(DragAccepter *accepter, ConcWidget *other) bool ConcWidget::validateSelection() const { bool cont = true; - QPtrListIterator<RegExpWidget> it(_children); + TQPtrListIterator<RegExpWidget> it(_children); ++it; // skip past the DragAccepter. for ( ; *it && cont; it += 2 ) { cont = (*it)->validateSelection(); diff --git a/kregexpeditor/concwidget.h b/kregexpeditor/concwidget.h index 6101ed2..9a4820c 100644 --- a/kregexpeditor/concwidget.h +++ b/kregexpeditor/concwidget.h @@ -30,17 +30,17 @@ class ConcRegExp; class ConcWidget :public MultiContainerWidget { public: - ConcWidget(RegExpEditorWindow* editorWindow, QWidget *parent, + ConcWidget(RegExpEditorWindow* editorWindow, TQWidget *parent, const char *name = 0); ConcWidget(RegExpEditorWindow* editorWindow, RegExpWidget *child, - QWidget *parent, const char *name=0); + TQWidget *parent, const char *name=0); ConcWidget( RegExpEditorWindow* editorWindow, ConcWidget* origConc, unsigned int start, unsigned int end); ConcWidget( ConcRegExp* regexp, RegExpEditorWindow* editorWindow, - QWidget* parent, const char* name = 0); + TQWidget* parent, const char* name = 0); void init(); - virtual QSize sizeHint() const; + virtual TQSize sizeHint() const; virtual RegExp* regExp() const; virtual bool updateSelection(bool parentSelected); virtual bool isSelected() const; @@ -55,11 +55,11 @@ public: bool hasAnyChildren() { return _children.count() > 1; } protected: - virtual void paintEvent( QPaintEvent *e ); - virtual void mousePressEvent ( QMouseEvent* event ); + virtual void paintEvent( TQPaintEvent *e ); + virtual void mousePressEvent ( TQMouseEvent* event ); void sizeAccepter( DragAccepter* accepter, int height, int totHeight ); void getSelectionIndexes( int* start, int* end ); - virtual void dragEnterEvent(QDragEnterEvent* event) { event->accept( false ); } + virtual void dragEnterEvent(TQDragEnterEvent* event) { event->accept( false ); } private: int _maxSelectedHeight; diff --git a/kregexpeditor/dcbutton.cpp b/kregexpeditor/dcbutton.cpp index b5bdcf8..4d714ca 100644 --- a/kregexpeditor/dcbutton.cpp +++ b/kregexpeditor/dcbutton.cpp @@ -23,13 +23,13 @@ #include "dcbutton.h" -DoubleClickButton::DoubleClickButton( QPixmap pixmap, QWidget* parent, const char* name ) - : QToolButton( parent, name ? name : "DoubleClickButton" ) +DoubleClickButton::DoubleClickButton( TQPixmap pixmap, TQWidget* parent, const char* name ) + : TQToolButton( parent, name ? name : "DoubleClickButton" ) { setPixmap( pixmap ); } -void DoubleClickButton::mouseDoubleClickEvent( QMouseEvent* ) +void DoubleClickButton::mouseDoubleClickEvent( TQMouseEvent* ) { emit doubleClicked(); } diff --git a/kregexpeditor/dcbutton.h b/kregexpeditor/dcbutton.h index 78a18a3..7a81e18 100644 --- a/kregexpeditor/dcbutton.h +++ b/kregexpeditor/dcbutton.h @@ -18,11 +18,11 @@ #ifndef dcbutton #define dcbutton -#include <qtoolbutton.h> +#include <tqtoolbutton.h> class QMouseEvent; /** - QToolButton extended to emit a signal on double click. + TQToolButton extended to emit a signal on double click. @internal */ class DoubleClickButton :public QToolButton @@ -30,10 +30,10 @@ class DoubleClickButton :public QToolButton Q_OBJECT public: - DoubleClickButton( QPixmap pix, QWidget* parent, const char* name = 0); + DoubleClickButton( TQPixmap pix, TQWidget* parent, const char* name = 0); protected: - virtual void mouseDoubleClickEvent ( QMouseEvent * ); + virtual void mouseDoubleClickEvent ( TQMouseEvent * ); signals: void doubleClicked(); diff --git a/kregexpeditor/dotregexp.cpp b/kregexpeditor/dotregexp.cpp index 3d375be..311b454 100644 --- a/kregexpeditor/dotregexp.cpp +++ b/kregexpeditor/dotregexp.cpp @@ -26,12 +26,12 @@ bool DotRegExp::check( ErrorMap&, bool, bool ) return false; } -QDomNode DotRegExp::toXml( QDomDocument* doc ) const +TQDomNode DotRegExp::toXml( TQDomDocument* doc ) const { - return doc->createElement( QString::fromLocal8Bit("AnyChar") ); + return doc->createElement( TQString::fromLocal8Bit("AnyChar") ); } -bool DotRegExp::load( QDomElement /* top */, const QString& /*version*/ ) +bool DotRegExp::load( TQDomElement /* top */, const TQString& /*version*/ ) { // Nothing to do return true; diff --git a/kregexpeditor/dotregexp.h b/kregexpeditor/dotregexp.h index b46cffb..4af5f6b 100644 --- a/kregexpeditor/dotregexp.h +++ b/kregexpeditor/dotregexp.h @@ -32,8 +32,8 @@ public: virtual bool check( ErrorMap&, bool first, bool last ); virtual int precedence() const { return 4;} - virtual QDomNode toXml( QDomDocument* doc ) const; - virtual bool load( QDomElement, const QString& version ); + virtual TQDomNode toXml( TQDomDocument* doc ) const; + virtual bool load( TQDomElement, const TQString& version ); virtual RegExpType type() const { return DOT;} }; diff --git a/kregexpeditor/drag.cpp b/kregexpeditor/drag.cpp index 11ecc63..e17973c 100644 --- a/kregexpeditor/drag.cpp +++ b/kregexpeditor/drag.cpp @@ -20,8 +20,8 @@ #include "regexpconverter.h" #include "widgetfactory.h" -RegExpWidgetDrag::RegExpWidgetDrag( RegExp* regexp, QWidget* dragSource ) - : QDragObject( dragSource ), _regexp( regexp->clone() ) +RegExpWidgetDrag::RegExpWidgetDrag( RegExp* regexp, TQWidget* dragSource ) + : TQDragObject( dragSource ), _regexp( regexp->clone() ) { } @@ -31,17 +31,17 @@ RegExpWidgetDrag::~RegExpWidgetDrag() } -bool RegExpWidgetDrag::canDecode( QDragMoveEvent* event ) +bool RegExpWidgetDrag::canDecode( TQDragMoveEvent* event ) { return event->provides( "KRegExpEditor/widgetdrag" ); } -RegExpWidget* RegExpWidgetDrag::decode(QDropEvent* event, RegExpEditorWindow* window, - QWidget* parent) +RegExpWidget* RegExpWidgetDrag::decode(TQDropEvent* event, RegExpEditorWindow* window, + TQWidget* parent) { - QByteArray payload = event->encodedData("KRegExpEditor/widgetdrag" ); - QTextStream stream( payload, IO_ReadOnly ); - QString str = stream.read(); + TQByteArray payload = event->encodedData("KRegExpEditor/widgetdrag" ); + TQTextStream stream( payload, IO_ReadOnly ); + TQString str = stream.read(); RegExp* regexp = WidgetFactory::createRegExp( str ); RegExpWidget* widget = WidgetFactory::createWidget( regexp, window, parent ); delete regexp; @@ -58,15 +58,15 @@ const char * RegExpWidgetDrag::format ( int i ) const return 0; } -QByteArray RegExpWidgetDrag::encodedData ( const char* format ) const +TQByteArray RegExpWidgetDrag::encodedData ( const char* format ) const { - QByteArray data; - QTextStream stream( data, IO_WriteOnly ); - if ( QString::fromLocal8Bit( format ).startsWith(QString::fromLocal8Bit( "KRegExpEditor/widgetdrag" ) ) ) { - QString xml = _regexp->toXmlString(); + TQByteArray data; + TQTextStream stream( data, IO_WriteOnly ); + if ( TQString::fromLocal8Bit( format ).startsWith(TQString::fromLocal8Bit( "KRegExpEditor/widgetdrag" ) ) ) { + TQString xml = _regexp->toXmlString(); stream << xml; } - else if ( QString::fromLocal8Bit( format ).startsWith(QString::fromLocal8Bit( "text/plain" ) ) ) { + else if ( TQString::fromLocal8Bit( format ).startsWith(TQString::fromLocal8Bit( "text/plain" ) ) ) { stream << RegExpConverter::current()->toStr( _regexp, false ); } else { diff --git a/kregexpeditor/drag.h b/kregexpeditor/drag.h index 5a074d1..1ec220b 100644 --- a/kregexpeditor/drag.h +++ b/kregexpeditor/drag.h @@ -18,7 +18,7 @@ #ifndef drag_h #define drag_h -#include <qdragobject.h> +#include <tqdragobject.h> class RegExp; class RegExpWidget; @@ -31,13 +31,13 @@ class RegExpEditorWindow; class RegExpWidgetDrag :public QDragObject { public: - RegExpWidgetDrag( RegExp* regexp , QWidget* dragSource); + RegExpWidgetDrag( RegExp* regexp , TQWidget* dragSource); ~RegExpWidgetDrag(); virtual const char * format ( int i = 0 ) const; - virtual QByteArray encodedData ( const char * ) const; - static bool canDecode(QDragMoveEvent* event); - static RegExpWidget* decode(QDropEvent* event, RegExpEditorWindow* window, - QWidget* parent); + virtual TQByteArray encodedData ( const char * ) const; + static bool canDecode(TQDragMoveEvent* event); + static RegExpWidget* decode(TQDropEvent* event, RegExpEditorWindow* window, + TQWidget* parent); private: RegExp* _regexp; }; diff --git a/kregexpeditor/dragaccepter.cpp b/kregexpeditor/dragaccepter.cpp index 0198e58..bbbf538 100644 --- a/kregexpeditor/dragaccepter.cpp +++ b/kregexpeditor/dragaccepter.cpp @@ -18,7 +18,7 @@ #include "dragaccepter.h" #include "concwidget.h" -#include <qpainter.h> +#include <tqpainter.h> DragAccepter::DragAccepter(RegExpEditorWindow* editorWindow, RegExpWidget *parent, const char *name) @@ -28,14 +28,14 @@ DragAccepter::DragAccepter(RegExpEditorWindow* editorWindow, RegExpWidget *paren setAcceptDrops(TRUE); } -QSize DragAccepter::sizeHint() const +TQSize DragAccepter::sizeHint() const { - return QSize(10,10); + return TQSize(10,10); } -void DragAccepter::paintEvent(QPaintEvent *e) +void DragAccepter::paintEvent(TQPaintEvent *e) { - QPainter painter(this); + TQPainter painter(this); drawPossibleSelection( painter, size() ); if ( _drawLine ) @@ -44,7 +44,7 @@ void DragAccepter::paintEvent(QPaintEvent *e) RegExpWidget::paintEvent(e); } -void DragAccepter::mousePressEvent ( QMouseEvent* event ) +void DragAccepter::mousePressEvent ( TQMouseEvent* event ) { if ( event->button() == RightButton ) { _editorWindow->showRMBMenu( _editorWindow->hasSelection() ); @@ -54,7 +54,7 @@ void DragAccepter::mousePressEvent ( QMouseEvent* event ) } } -void DragAccepter::mouseReleaseEvent( QMouseEvent* event ) +void DragAccepter::mouseReleaseEvent( TQMouseEvent* event ) { if ( _editorWindow->isPasteing() && event->button() == LeftButton ) { RegExp* regexp = _editorWindow->pasteData(); @@ -82,7 +82,7 @@ void DragAccepter::mouseReleaseEvent( QMouseEvent* event ) } else { RegExpWidget *child = WidgetFactory::createWidget( _editorWindow, - dynamic_cast<QWidget*>(parent()), + dynamic_cast<TQWidget*>(parent()), _editorWindow->insertType() ); if ( child ) { RegExpWidget *w = dynamic_cast<RegExpWidget*>(parent()); @@ -98,13 +98,13 @@ void DragAccepter::mouseReleaseEvent( QMouseEvent* event ) } -void DragAccepter::dragEnterEvent(QDragEnterEvent *event) +void DragAccepter::dragEnterEvent(TQDragEnterEvent *event) { bool selfDrag = ( event->source() && event->source()->topLevelWidget() == topLevelWidget() && _isSelected ); event->accept(RegExpWidgetDrag::canDecode( event ) && !selfDrag ); } -void DragAccepter::dropEvent(QDropEvent *event) +void DragAccepter::dropEvent(TQDropEvent *event) { // The widget will be reparent afterward or part of it will, so no need to give // it a parent here. @@ -119,7 +119,7 @@ void DragAccepter::dropEvent(QDropEvent *event) RegExpWidget *rew = dynamic_cast<RegExpWidget*>(parent()); if (rew) rew->addNewConcChild(this, elm); - QWidget *w = dynamic_cast<QWidget*>(parent()); + TQWidget *w = dynamic_cast<TQWidget*>(parent()); if (w) w->update(); _editorWindow->updateContent( this ); diff --git a/kregexpeditor/dragaccepter.h b/kregexpeditor/dragaccepter.h index 48af09f..c9c6fd8 100644 --- a/kregexpeditor/dragaccepter.h +++ b/kregexpeditor/dragaccepter.h @@ -32,17 +32,17 @@ class DragAccepter :public RegExpWidget public: DragAccepter(RegExpEditorWindow* editorWindow, RegExpWidget *parent, const char *name = 0); - QSize sizeHint() const; + TQSize sizeHint() const; virtual RegExp* regExp() const; virtual RegExpType type() const { return DRAGACCEPTER; } void setDrawLine( bool drawLine ) { _drawLine = drawLine; } protected: - virtual void mousePressEvent ( QMouseEvent* event ); - virtual void mouseReleaseEvent( QMouseEvent* event ); - virtual void dragEnterEvent(QDragEnterEvent *event); - virtual void dropEvent(QDropEvent *event); - virtual void paintEvent(QPaintEvent *); + virtual void mousePressEvent ( TQMouseEvent* event ); + virtual void mouseReleaseEvent( TQMouseEvent* event ); + virtual void dragEnterEvent(TQDragEnterEvent *event); + virtual void dropEvent(TQDropEvent *event); + virtual void paintEvent(TQPaintEvent *); virtual bool acceptWidgetInsert( RegExpType ) const { return true; } virtual bool acceptWidgetPaste() const { return true; } diff --git a/kregexpeditor/editorwindow.cpp b/kregexpeditor/editorwindow.cpp index e8c4ac8..fedd0a9 100644 --- a/kregexpeditor/editorwindow.cpp +++ b/kregexpeditor/editorwindow.cpp @@ -31,21 +31,21 @@ #include "editorwindow.h" #include "concwidget.h" -#include <qlayout.h> -#include <qpainter.h> -#include <qaccel.h> -#include <qcursor.h> -#include <qclipboard.h> -#include <qpopupmenu.h> +#include <tqlayout.h> +#include <tqpainter.h> +#include <tqaccel.h> +#include <tqcursor.h> +#include <tqclipboard.h> +#include <tqpopupmenu.h> #include "regexp.h" #include "userdefinedregexps.h" -#include <qfileinfo.h> +#include <tqfileinfo.h> -RegExpEditorWindow::RegExpEditorWindow( QWidget *parent, const char *name) - : QWidget(parent, name, Qt::WPaintUnclipped) +RegExpEditorWindow::RegExpEditorWindow( TQWidget *parent, const char *name) + : TQWidget(parent, name, Qt::WPaintUnclipped) { _top = new ConcWidget(this, this); - _layout = new QHBoxLayout( this); + _layout = new TQHBoxLayout( this); _layout->addWidget(_top); _top->setToplevel(); _undrawSelection = false; @@ -54,16 +54,16 @@ RegExpEditorWindow::RegExpEditorWindow( QWidget *parent, const char *name) _pasteInAction = false; _pasteData = 0; - QAccel* accel = new QAccel( this ); - accel->connectItem( accel->insertItem( CTRL+Key_C ), this, SLOT( slotCopy() ) ); - accel->connectItem( accel->insertItem( CTRL+Key_X ), this, SLOT( slotCut() ) ); - accel->connectItem( accel->insertItem( Key_Delete ), this, SLOT( slotCut() ) ); - accel->connectItem( accel->insertItem( Key_BackSpace ), this, SLOT( slotCut() ) ); - accel->connectItem( accel->insertItem( CTRL+Key_V ), this, SLOT( slotStartPasteAction() ) ); - accel->connectItem( accel->insertItem( Key_Escape ), this, SLOT( slotEndActions() ) ); - accel->connectItem( accel->insertItem( CTRL+Key_S ), this, SLOT( slotSave() ) ); + TQAccel* accel = new TQAccel( this ); + accel->connectItem( accel->insertItem( CTRL+Key_C ), this, TQT_SLOT( slotCopy() ) ); + accel->connectItem( accel->insertItem( CTRL+Key_X ), this, TQT_SLOT( slotCut() ) ); + accel->connectItem( accel->insertItem( Key_Delete ), this, TQT_SLOT( slotCut() ) ); + accel->connectItem( accel->insertItem( Key_BackSpace ), this, TQT_SLOT( slotCut() ) ); + accel->connectItem( accel->insertItem( CTRL+Key_V ), this, TQT_SLOT( slotStartPasteAction() ) ); + accel->connectItem( accel->insertItem( Key_Escape ), this, TQT_SLOT( slotEndActions() ) ); + accel->connectItem( accel->insertItem( CTRL+Key_S ), this, TQT_SLOT( slotSave() ) ); - connect( this, SIGNAL( change() ), this, SLOT( emitVerifyRegExp() ) ); + connect( this, TQT_SIGNAL( change() ), this, TQT_SLOT( emitVerifyRegExp() ) ); } RegExp* RegExpEditorWindow::regExp() const @@ -71,41 +71,41 @@ RegExp* RegExpEditorWindow::regExp() const return _top->regExp(); } -void RegExpEditorWindow::mousePressEvent ( QMouseEvent* event ) +void RegExpEditorWindow::mousePressEvent ( TQMouseEvent* event ) { setFocus(); updateContent( 0 ); _start = event->pos(); - _lastPoint = QPoint(0,0); + _lastPoint = TQPoint(0,0); if ( pointSelected( event->globalPos() ) ) { _isDndOperation = true; } else { _isDndOperation = false; - _selection = QRect(); + _selection = TQRect(); _top->updateSelection( false ); - QWidget::mousePressEvent( event ); + TQWidget::mousePressEvent( event ); } grabMouse(); } -bool RegExpEditorWindow::pointSelected( QPoint p ) const +bool RegExpEditorWindow::pointSelected( TQPoint p ) const { - QRect rect = _top->selectionRect(); + TQRect rect = _top->selectionRect(); return rect.contains(p); } -void RegExpEditorWindow::mouseMoveEvent ( QMouseEvent* event ) +void RegExpEditorWindow::mouseMoveEvent ( TQMouseEvent* event ) { if ( _isDndOperation ) { - if ( ( _start - event->pos() ).manhattanLength() > QApplication::startDragDistance() ) { + if ( ( _start - event->pos() ).manhattanLength() > TQApplication::startDragDistance() ) { RegExp* regexp = _top->selection(); if ( !regexp ) return; - QDragObject *d = new RegExpWidgetDrag( regexp, this ); + TQDragObject *d = new RegExpWidgetDrag( regexp, this ); delete regexp; bool del = d->drag(); @@ -120,13 +120,13 @@ void RegExpEditorWindow::mouseMoveEvent ( QMouseEvent* event ) } } else { - QPainter p( this ); + TQPainter p( this ); p.setRasterOp( Qt::NotROP ); p.setPen( Qt::DotLine ); // remove last selection rectangle if ( ! _lastPoint.isNull() && _undrawSelection ) { - p.drawRect(QRect(_start, _lastPoint)); + p.drawRect(TQRect(_start, _lastPoint)); } // Note this line must come after the old rect has been removed @@ -136,25 +136,25 @@ void RegExpEditorWindow::mouseMoveEvent ( QMouseEvent* event ) _top->updateSelection( false ); emit scrolling( event->pos() ); - p.drawRect(QRect(_start, event->pos())); + p.drawRect(TQRect(_start, event->pos())); _undrawSelection = true; _lastPoint = event->pos(); - _selection = QRect(mapToGlobal(_start), mapToGlobal(_lastPoint)).normalize(); + _selection = TQRect(mapToGlobal(_start), mapToGlobal(_lastPoint)).normalize(); } } -void RegExpEditorWindow::mouseReleaseEvent( QMouseEvent *event) +void RegExpEditorWindow::mouseReleaseEvent( TQMouseEvent *event) { releaseMouse(); - QWidget::mouseReleaseEvent( event); + TQWidget::mouseReleaseEvent( event); // remove last selection rectangle - QPainter p( this ); + TQPainter p( this ); p.setRasterOp( Qt::NotROP ); p.setPen( Qt::DotLine ); if ( ! _lastPoint.isNull() ) { - p.drawRect(QRect(_start, _lastPoint)); + p.drawRect(TQRect(_start, _lastPoint)); } _top->validateSelection(); _top->updateAll(); @@ -164,9 +164,9 @@ void RegExpEditorWindow::mouseReleaseEvent( QMouseEvent *event) } } -bool RegExpEditorWindow::selectionOverlap( QPoint pos, QSize size ) const +bool RegExpEditorWindow::selectionOverlap( TQPoint pos, TQSize size ) const { - QRect child(pos, size); + TQRect child(pos, size); return (_selection.intersects(child) && ! child.contains(_selection)); } @@ -226,35 +226,35 @@ void RegExpEditorWindow::slotDeleteSelection() updateContent( 0 ); } -void RegExpEditorWindow::updateContent( QWidget* focusChild) +void RegExpEditorWindow::updateContent( TQWidget* focusChild) { - QPoint p(0,0); + TQPoint p(0,0); if ( focusChild ) - p = focusChild->mapTo( this, QPoint(0,0) ); + p = focusChild->mapTo( this, TQPoint(0,0) ); _top->update(); emit contentChanged( p ); } -QSize RegExpEditorWindow::sizeHint() const +TQSize RegExpEditorWindow::sizeHint() const { return _top->sizeHint(); } -void RegExpEditorWindow::paintEvent( QPaintEvent* event ) +void RegExpEditorWindow::paintEvent( TQPaintEvent* event ) { - QWidget::paintEvent( event ); + TQWidget::paintEvent( event ); _undrawSelection = false; } void RegExpEditorWindow::slotCut() { - cut( QCursor::pos() ); + cut( TQCursor::pos() ); emit change(); emit canSave( _top->hasAnyChildren() ); } -void RegExpEditorWindow::cut( QPoint pos ) +void RegExpEditorWindow::cut( TQPoint pos ) { cutCopyAux( pos ); slotDeleteSelection(); @@ -262,17 +262,17 @@ void RegExpEditorWindow::cut( QPoint pos ) void RegExpEditorWindow::slotCopy() { - copy( QCursor::pos() ); + copy( TQCursor::pos() ); } -void RegExpEditorWindow::copy( QPoint pos ) +void RegExpEditorWindow::copy( TQPoint pos ) { cutCopyAux( pos ); clearSelection( true ); } -void RegExpEditorWindow::cutCopyAux( QPoint pos ) +void RegExpEditorWindow::cutCopyAux( TQPoint pos ) { if ( !hasSelection() ) { RegExpWidget* widget = _top->widgetUnderPoint( pos, true ); @@ -298,9 +298,9 @@ void RegExpEditorWindow::cutCopyAux( QPoint pos ) void RegExpEditorWindow::slotStartPasteAction() { - QByteArray data = qApp->clipboard()->data()->encodedData( "KRegExpEditor/widgetdrag" ); - QTextStream stream( data, IO_ReadOnly ); - QString str = stream.read(); + TQByteArray data = qApp->clipboard()->data()->encodedData( "KRegExpEditor/widgetdrag" ); + TQTextStream stream( data, IO_ReadOnly ); + TQString str = stream.read(); RegExp* regexp = WidgetFactory::createRegExp( str ); if ( regexp ) @@ -318,17 +318,17 @@ void RegExpEditorWindow::showRMBMenu( bool enableCutCopy ) enum CHOICES { CUT, COPY, PASTE, SAVE, EDIT }; if ( !_menu ) { - _menu = new QPopupMenu( 0 ); - _menu->insertItem(getIcon(QString::fromLocal8Bit("editcut")), + _menu = new TQPopupMenu( 0 ); + _menu->insertItem(getIcon(TQString::fromLocal8Bit("editcut")), i18n("C&ut"), CUT); - _menu->insertItem(getIcon(QString::fromLocal8Bit("editcopy")), + _menu->insertItem(getIcon(TQString::fromLocal8Bit("editcopy")), i18n("&Copy"), COPY); - _menu->insertItem(getIcon(QString::fromLocal8Bit("editpaste")), + _menu->insertItem(getIcon(TQString::fromLocal8Bit("editpaste")), i18n("&Paste"), PASTE); _menu->insertSeparator(); - _menu->insertItem(getIcon(QString::fromLocal8Bit("edit")), + _menu->insertItem(getIcon(TQString::fromLocal8Bit("edit")), i18n("&Edit"), EDIT); - _menu->insertItem(getIcon(QString::fromLocal8Bit("filesave")), + _menu->insertItem(getIcon(TQString::fromLocal8Bit("filesave")), i18n("&Save Regular Expression..."), SAVE); } @@ -342,11 +342,11 @@ void RegExpEditorWindow::showRMBMenu( bool enableCutCopy ) _menu->setItemEnabled( SAVE, _top->hasAnyChildren() ); - RegExpWidget* editWidget = _top->findWidgetToEdit( QCursor::pos() ); + RegExpWidget* editWidget = _top->findWidgetToEdit( TQCursor::pos() ); _menu->setItemEnabled( EDIT, editWidget ); - QPoint pos = QCursor::pos(); + TQPoint pos = TQCursor::pos(); int choice = _menu->exec( pos ); switch ( choice ) { case COPY: copy( pos ); break; @@ -366,29 +366,29 @@ void RegExpEditorWindow::applyRegExpToSelection( RegExpType tp ) void RegExpEditorWindow::slotSave() { - QString dir = WidgetWinItem::path(); - QString txt; + TQString dir = WidgetWinItem::path(); + TQString txt; #ifdef QT_ONLY txt = QInputDialog::getText( tr("Name for regexp"), tr("Enter name:") ); if ( txt.isNull() ) return; #else - KLineEditDlg dlg(i18n("Enter name:"), QString::null, this); + KLineEditDlg dlg(i18n("Enter name:"), TQString::null, this); dlg.setCaption(i18n("Name for Regular Expression")); if (!dlg.exec()) return; txt = dlg.text(); #endif - QString fileName = dir + QString::fromLocal8Bit("/") + txt + QString::fromLocal8Bit(".regexp"); - QFileInfo finfo( fileName ); + TQString fileName = dir + TQString::fromLocal8Bit("/") + txt + TQString::fromLocal8Bit(".regexp"); + TQFileInfo finfo( fileName ); if ( finfo.exists() ) { - int answer = KMessageBox::warningContinueCancel( this, i18n("<p>Overwrite named regular expression <b>%1</b></p>").arg(txt), QString::null, i18n("Overwrite")); + int answer = KMessageBox::warningContinueCancel( this, i18n("<p>Overwrite named regular expression <b>%1</b></p>").arg(txt), TQString::null, i18n("Overwrite")); if ( answer != KMessageBox::Continue ) return; } - QFile file( fileName ); + TQFile file( fileName ); if ( ! file.open(IO_WriteOnly) ) { KMessageBox::sorry( this, i18n("Could not open file for writing: %1").arg(fileName) ); return; @@ -396,10 +396,10 @@ void RegExpEditorWindow::slotSave() // Convert to XML. RegExp* regexp = _top->regExp(); - QString xml = regexp->toXmlString(); + TQString xml = regexp->toXmlString(); delete regexp; - QTextStream stream(&file); + TQTextStream stream(&file); stream << xml; file.close(); @@ -429,7 +429,7 @@ void RegExpEditorWindow::slotSetRegExp( RegExp* regexp ) void RegExpEditorWindow::updateCursorUnderPoint() { - RegExpWidget* widget = _top->widgetUnderPoint( QCursor::pos(), false ); + RegExpWidget* widget = _top->widgetUnderPoint( TQCursor::pos(), false ); if ( widget ) widget->updateCursorShape(); } @@ -440,10 +440,10 @@ void RegExpEditorWindow::emitVerifyRegExp() } -QIconSet RegExpEditorWindow::getIcon( const QString& name ) +TQIconSet RegExpEditorWindow::getIcon( const TQString& name ) { #ifdef QT_ONLY - QPixmap pix; + TQPixmap pix; pix.convertFromImage( qembed_findImage( name ) ); return pix; #else diff --git a/kregexpeditor/editorwindow.h b/kregexpeditor/editorwindow.h index e925c59..dca5603 100644 --- a/kregexpeditor/editorwindow.h +++ b/kregexpeditor/editorwindow.h @@ -20,9 +20,9 @@ #include "drag.h" #include "widgetfactory.h" -#include <qmultilineedit.h> -#include <qlabel.h> -#include <qiconset.h> +#include <tqmultilineedit.h> +#include <tqlabel.h> +#include <tqiconset.h> class RegExp; class RegExpWidget; class QHBoxLayout; @@ -48,7 +48,7 @@ class RegExpEditorWindow :public QWidget Q_OBJECT public: - RegExpEditorWindow(QWidget *parent, const char *name = 0); + RegExpEditorWindow(TQWidget *parent, const char *name = 0); /** Returns an object which represent the regular expression "drawn" in @@ -64,12 +64,12 @@ public: Note this method is only valid while doing rubber-band selection. Afterwards, use @ref pointSelected instead. */ - bool selectionOverlap( QPoint globalPos, QSize size ) const; + bool selectionOverlap( TQPoint globalPos, TQSize size ) const; /** returns true if `pos' lays on top of a widget that is selected. */ - bool pointSelected( QPoint pos ) const; + bool pointSelected( TQPoint pos ) const; /** returns true if the editor has a selection. @@ -86,7 +86,7 @@ public: invoked update on the top widget, and ensures that `focusChild' is visible. It's valid for `focusChild' to be 0. */ - void updateContent(QWidget* focusChild); + void updateContent(TQWidget* focusChild); RegExp* pasteData() { return _pasteData; } bool isPasteing() const { return _pasteInAction; } @@ -109,7 +109,7 @@ public: */ void showRMBMenu( bool enableCutCopy ); - virtual QSize sizeHint() const; + virtual TQSize sizeHint() const; public slots: @@ -180,13 +180,13 @@ signals: If focusPoint is non-null then this point should be made visible */ - void contentChanged( QPoint focusPoint ); + void contentChanged( TQPoint focusPoint ); /** This signal is emitted whenever mouse is being dragged in the editor window. `focusPoint' is the mouse' current position. */ - void scrolling( QPoint focusPoint ); + void scrolling( TQPoint focusPoint ); /** see @ref RegExpScrolledEditorWindow::doneEditing @@ -214,31 +214,31 @@ signals: protected: - virtual void mousePressEvent ( QMouseEvent* event ); - virtual void mouseMoveEvent ( QMouseEvent* event ); - virtual void mouseReleaseEvent( QMouseEvent *event); - virtual void paintEvent( QPaintEvent* event ); + virtual void mousePressEvent ( TQMouseEvent* event ); + virtual void mouseMoveEvent ( TQMouseEvent* event ); + virtual void mouseReleaseEvent( TQMouseEvent *event); + virtual void paintEvent( TQPaintEvent* event ); protected slots: virtual void emitVerifyRegExp(); private: - void cutCopyAux( QPoint pos ); - void copy( QPoint pos ); - void cut( QPoint pos ); + void cutCopyAux( TQPoint pos ); + void copy( TQPoint pos ); + void cut( TQPoint pos ); private: /** This points to the top @ref RegExpWidget in the editor window. */ ConcWidget *_top; /** This points to the layout manager for the editor window */ - QHBoxLayout* _layout; + TQHBoxLayout* _layout; /** Start point and last point draw. Used when doing rubber band selection */ - QPoint _start, _lastPoint; + TQPoint _start, _lastPoint; /** The area which the rubber band selection is over */ - QRect _selection; + TQRect _selection; /** True when a rubber band selection rectangle is drawn, and need to be @@ -259,9 +259,9 @@ private: RegExp* _pasteData; /** Popup menu used for RMB */ - QPopupMenu* _menu; + TQPopupMenu* _menu; - QIconSet getIcon( const QString& name ); + TQIconSet getIcon( const TQString& name ); bool _isDndOperation; }; diff --git a/kregexpeditor/emacsregexpconverter.cpp b/kregexpeditor/emacsregexpconverter.cpp index 327d04c..7d24454 100644 --- a/kregexpeditor/emacsregexpconverter.cpp +++ b/kregexpeditor/emacsregexpconverter.cpp @@ -35,15 +35,15 @@ bool EmacsRegExpConverter::canParse() return false; } -QString EmacsRegExpConverter::toString( AltnRegExp* regexp, bool markSelection ) +TQString EmacsRegExpConverter::toString( AltnRegExp* regexp, bool markSelection ) { - QString res; + TQString res; bool first = true; RegExpList list = regexp->children(); for ( RegExpListIt it(list); *it; ++it ) { if ( !first ) { - res += QString::fromLatin1("\\|"); + res += TQString::fromLatin1("\\|"); } first = false; res += toStr( *it, markSelection ); @@ -52,17 +52,17 @@ QString EmacsRegExpConverter::toString( AltnRegExp* regexp, bool markSelection ) } -QString EmacsRegExpConverter::toString( ConcRegExp* regexp, bool markSelection ) +TQString EmacsRegExpConverter::toString( ConcRegExp* regexp, bool markSelection ) { - QString res; + TQString res; RegExpList list = regexp->children(); for ( RegExpListIt it(list); *it; ++it ) { - QString startPar = QString::fromLocal8Bit(""); - QString endPar = QString::fromLocal8Bit(""); + TQString startPar = TQString::fromLocal8Bit(""); + TQString endPar = TQString::fromLocal8Bit(""); if ( (*it)->precedence() < regexp->precedence() ) { - startPar = QString::fromLatin1( "\\(" ); - endPar = QString::fromLatin1( "\\)" ); + startPar = TQString::fromLatin1( "\\(" ); + endPar = TQString::fromLatin1( "\\)" ); } res += startPar + toStr( *it, markSelection ) + endPar; @@ -72,7 +72,7 @@ QString EmacsRegExpConverter::toString( ConcRegExp* regexp, bool markSelection ) } -QString EmacsRegExpConverter::toString( LookAheadRegExp* /*regexp*/, bool /*markSelection*/ ) +TQString EmacsRegExpConverter::toString( LookAheadRegExp* /*regexp*/, bool /*markSelection*/ ) { static bool haveWarned = false; if ( ! haveWarned ) { @@ -80,12 +80,12 @@ QString EmacsRegExpConverter::toString( LookAheadRegExp* /*regexp*/, bool /*mark haveWarned = true; } - return QString::null; + return TQString::null; } -QString EmacsRegExpConverter::toString( TextRangeRegExp* regexp, bool /*markSelection*/ ) +TQString EmacsRegExpConverter::toString( TextRangeRegExp* regexp, bool /*markSelection*/ ) { - QString txt; + TQString txt; bool foundCarrot = false; bool foundDash = false; @@ -93,15 +93,15 @@ QString EmacsRegExpConverter::toString( TextRangeRegExp* regexp, bool /*markSele // print the single characters, but keep "^" as the very // last element of the characters. - QStringList chars = regexp->chars(); + TQStringList chars = regexp->chars(); for (unsigned int i = 0; i< chars.count(); i++) { - if ( *chars.at(i) == QChar(']') ) { + if ( *chars.at(i) == TQChar(']') ) { foundParenthesis = true; } - else if ( *chars.at(i) == QChar('-') ) { + else if ( *chars.at(i) == TQChar('-') ) { foundDash = true; } - else if ( *chars.at(i) == QChar('^') ) { + else if ( *chars.at(i) == TQChar('^') ) { foundCarrot = true; } else { @@ -110,9 +110,9 @@ QString EmacsRegExpConverter::toString( TextRangeRegExp* regexp, bool /*markSele } // Now insert the ranges. - QPtrList<StringPair> ranges = regexp->range(); - for ( QPtrListIterator<StringPair> it(ranges); *it; ++it ) { - txt.append((*it)->first()+ QString::fromLatin1("-")+ (*it)->second()); + TQPtrList<StringPair> ranges = regexp->range(); + for ( TQPtrListIterator<StringPair> it(ranges); *it; ++it ) { + txt.append((*it)->first()+ TQString::fromLatin1("-")+ (*it)->second()); } // Ok, its time to build each part of the regexp, here comes the rule: @@ -122,20 +122,20 @@ QString EmacsRegExpConverter::toString( TextRangeRegExp* regexp, bool /*markSele // finally if '^' is one of the characters, then it must not be the first // one! - QString res = QString::fromLatin1("["); + TQString res = TQString::fromLatin1("["); if ( regexp->negate() ) - res.append(QString::fromLatin1("^")); + res.append(TQString::fromLatin1("^")); // a ']' must be the first character in teh range. if ( foundParenthesis ) { - res.append(QString::fromLatin1("]")); + res.append(TQString::fromLatin1("]")); } // a '-' must be the first character ( only coming after a ']') if ( foundDash ) { - res.append(QString::fromLatin1("-")); + res.append(TQString::fromLatin1("-")); } res += txt; @@ -143,108 +143,108 @@ QString EmacsRegExpConverter::toString( TextRangeRegExp* regexp, bool /*markSele // Insert equivalents to \s,\S,\d,\D,\w, and \W // non-digit, non-space, and non-word is not supported in Emacs style if ( regexp->digit() ) - res += QString::fromLocal8Bit("0-9"); + res += TQString::fromLocal8Bit("0-9"); if ( regexp->space() ) - res += QString::fromLocal8Bit(" ") + QString( QChar( (char) 9 ) ); // Tab char + res += TQString::fromLocal8Bit(" ") + TQString( TQChar( (char) 9 ) ); // Tab char if ( regexp->wordChar() ) - res += QString::fromLocal8Bit("a-zA-Z"); + res += TQString::fromLocal8Bit("a-zA-Z"); if ( foundCarrot ) { - res.append( QChar( '^' ) ); + res.append( TQChar( '^' ) ); } - res.append(QString::fromLatin1("]")); + res.append(TQString::fromLatin1("]")); return res; } -QString EmacsRegExpConverter::toString( CompoundRegExp* regexp, bool markSelection ) +TQString EmacsRegExpConverter::toString( CompoundRegExp* regexp, bool markSelection ) { return toStr( regexp->child(), markSelection ); } -QString EmacsRegExpConverter::toString( DotRegExp* /*regexp*/, bool /*markSelection*/ ) +TQString EmacsRegExpConverter::toString( DotRegExp* /*regexp*/, bool /*markSelection*/ ) { - return QString::fromLatin1( "." ); + return TQString::fromLatin1( "." ); } -QString EmacsRegExpConverter::toString( PositionRegExp* regexp, bool /*markSelection*/ ) +TQString EmacsRegExpConverter::toString( PositionRegExp* regexp, bool /*markSelection*/ ) { static bool haveWarned = false; switch ( regexp->position()) { case PositionRegExp::BEGLINE: - return QString::fromLatin1("^"); + return TQString::fromLatin1("^"); case PositionRegExp::ENDLINE: - return QString::fromLatin1("$"); + return TQString::fromLatin1("$"); case PositionRegExp::WORDBOUNDARY: case PositionRegExp::NONWORDBOUNDARY: if ( ! haveWarned ) { KMessageBox::sorry( 0, i18n( "Word boundary and non word boundary is not supported in Emacs syntax" ) ); haveWarned = true; - return QString::fromLatin1(""); + return TQString::fromLatin1(""); } } - return QString::fromLatin1(""); + return TQString::fromLatin1(""); } -QString EmacsRegExpConverter::toString( RepeatRegExp* regexp, bool markSelection ) +TQString EmacsRegExpConverter::toString( RepeatRegExp* regexp, bool markSelection ) { RegExp* child = regexp->child(); - QString cText = toStr( child, markSelection ); - QString startPar; - QString endPar; + TQString cText = toStr( child, markSelection ); + TQString startPar; + TQString endPar; if ( child->precedence() < regexp->precedence() ) { - startPar = QString::fromLatin1( "\\(" ); - endPar = QString::fromLatin1( "\\)" ); + startPar = TQString::fromLatin1( "\\(" ); + endPar = TQString::fromLatin1( "\\)" ); } if (regexp->min() == 0 && regexp->max() == -1) { - return startPar + cText +endPar + QString::fromLocal8Bit("*"); + return startPar + cText +endPar + TQString::fromLocal8Bit("*"); } else if ( regexp->min() == 0 && regexp->max() == 1 ) { - return startPar + cText + endPar + QString::fromLocal8Bit("?"); + return startPar + cText + endPar + TQString::fromLocal8Bit("?"); } else if ( regexp->min() == 1 && regexp->max() == -1 ) { - return startPar + cText + endPar + QString::fromLocal8Bit("+"); + return startPar + cText + endPar + TQString::fromLocal8Bit("+"); } else { - QString res = QString::fromLatin1(""); + TQString res = TQString::fromLatin1(""); for ( int i = 0; i < regexp->min(); ++i ) { - res += QString::fromLatin1( "\\(" ) + cText + QString::fromLatin1( "\\)" ); + res += TQString::fromLatin1( "\\(" ) + cText + TQString::fromLatin1( "\\)" ); } if ( regexp->max() != -1 ) { for ( int i = regexp->min(); i < regexp->max(); ++i ) { - res += QString::fromLatin1("\\(") + cText + QString::fromLatin1("\\)?"); + res += TQString::fromLatin1("\\(") + cText + TQString::fromLatin1("\\)?"); } } else - res += QString::fromLatin1("+"); + res += TQString::fromLatin1("+"); return res; } } -QString EmacsRegExpConverter::toString( TextRegExp* regexp, bool /*markSelection*/ ) +TQString EmacsRegExpConverter::toString( TextRegExp* regexp, bool /*markSelection*/ ) { - QValueList<QChar> list; - list << QChar('$') - << QChar('^') - << QChar('.') - << QChar('*') - << QChar('+') - << QChar('?') - << QChar('[') - << QChar(']') - << QChar('\\'); - - QString res = escape( regexp->text(), list, QChar('\\') ); + TQValueList<TQChar> list; + list << TQChar('$') + << TQChar('^') + << TQChar('.') + << TQChar('*') + << TQChar('+') + << TQChar('?') + << TQChar('[') + << TQChar(']') + << TQChar('\\'); + + TQString res = escape( regexp->text(), list, TQChar('\\') ); return res; } -QString EmacsRegExpConverter::name() +TQString EmacsRegExpConverter::name() { - return QString::fromLatin1( "Emacs" ); + return TQString::fromLatin1( "Emacs" ); } int EmacsRegExpConverter::features() diff --git a/kregexpeditor/emacsregexpconverter.h b/kregexpeditor/emacsregexpconverter.h index bbc9e94..e8e9264 100644 --- a/kregexpeditor/emacsregexpconverter.h +++ b/kregexpeditor/emacsregexpconverter.h @@ -25,17 +25,17 @@ class EmacsRegExpConverter :public RegExpConverter { public: virtual bool canParse(); - virtual QString name(); + virtual TQString name(); virtual int features(); - virtual QString toString( AltnRegExp*, bool markSelection ); - virtual QString toString( ConcRegExp*, bool markSelection ); - virtual QString toString( LookAheadRegExp*, bool markSelection ); - virtual QString toString( TextRangeRegExp*, bool markSelection ); - virtual QString toString( CompoundRegExp*, bool markSelection ); - virtual QString toString( DotRegExp*, bool markSelection ); - virtual QString toString( PositionRegExp*, bool markSelection ); - virtual QString toString( RepeatRegExp*, bool markSelection ); - virtual QString toString( TextRegExp*, bool markSelection ); + virtual TQString toString( AltnRegExp*, bool markSelection ); + virtual TQString toString( ConcRegExp*, bool markSelection ); + virtual TQString toString( LookAheadRegExp*, bool markSelection ); + virtual TQString toString( TextRangeRegExp*, bool markSelection ); + virtual TQString toString( CompoundRegExp*, bool markSelection ); + virtual TQString toString( DotRegExp*, bool markSelection ); + virtual TQString toString( PositionRegExp*, bool markSelection ); + virtual TQString toString( RepeatRegExp*, bool markSelection ); + virtual TQString toString( TextRegExp*, bool markSelection ); }; diff --git a/kregexpeditor/errormap.cpp b/kregexpeditor/errormap.cpp index c452ddb..ecf2866 100644 --- a/kregexpeditor/errormap.cpp +++ b/kregexpeditor/errormap.cpp @@ -47,7 +47,7 @@ void ErrorMap::lineStartError() { if ( ! _prevLineStartError ) { KMessageBox::information( 0, i18n("Your regular expression is invalid, due to something preceding a 'line start'."), - i18n("Regular Expression Error"), QString::fromLatin1("KRegExpEditorLineStartError") ); + i18n("Regular Expression Error"), TQString::fromLatin1("KRegExpEditorLineStartError") ); } _lineStartError = true; } @@ -56,7 +56,7 @@ void ErrorMap::lineEndError() { if ( !_prevLineEndError ) { KMessageBox::information( 0, i18n("Your regular expression is invalid, due to something following a 'line end'."), - i18n("Regular Expression Error"), QString::fromLatin1("KRegExpEditorLineEndError") ); + i18n("Regular Expression Error"), TQString::fromLatin1("KRegExpEditorLineEndError") ); } _lineEndError = true; } @@ -66,7 +66,7 @@ void ErrorMap::lookAheadError() { if ( !_prevLookAHeadError ) { KMessageBox::information( 0, i18n("Your regular expression is invalid. 'Look Ahead' regular expression must be the last sub expression."), - i18n("Regular Expression Error"), QString::fromLatin1("KRegExpEditorLookAHeadError") ); + i18n("Regular Expression Error"), TQString::fromLatin1("KRegExpEditorLookAHeadError") ); } _lookAHeadError = true; } diff --git a/kregexpeditor/gen_qregexplexer.cpp b/kregexpeditor/gen_qregexplexer.cpp index 30f2284..c349dcc 100644 --- a/kregexpeditor/gen_qregexplexer.cpp +++ b/kregexpeditor/gen_qregexplexer.cpp @@ -451,7 +451,7 @@ char *yytext; * Boston, MA 02110-1301, USA. **/ #line 21 "qregexpparser.l" - #include <qstring.h> + #include <tqstring.h> #include "textrangeregexp.h" #include "gen_qregexpparser.hh" #ifdef QT_ONLY @@ -770,7 +770,7 @@ YY_RULE_SETUP #line 77 "qregexpparser.l" { TextRangeRegExp* regexp = new TextRangeRegExp( false ); - regexp->addCharacter( QString::fromLocal8Bit( yytext ) ); + regexp->addCharacter( TQString::fromLocal8Bit( yytext ) ); qregexplval.regexp = regexp; return TOK_CharClass; } @@ -780,7 +780,7 @@ YY_RULE_SETUP #line 84 "qregexpparser.l" { TextRangeRegExp* regexp = new TextRangeRegExp( false ); - regexp->addCharacter( QString::fromLocal8Bit(yytext) ); + regexp->addCharacter( TQString::fromLocal8Bit(yytext) ); qregexplval.regexp = regexp; return TOK_CharClass; } @@ -790,7 +790,7 @@ YY_RULE_SETUP #line 90 "qregexpparser.l" { TextRangeRegExp* regexp = new TextRangeRegExp( false ); - regexp->addCharacter( QString::fromLocal8Bit(yytext) ); + regexp->addCharacter( TQString::fromLocal8Bit(yytext) ); qregexplval.regexp = regexp; return TOK_CharClass; } @@ -1774,7 +1774,7 @@ int main() #line 114 "qregexpparser.l" -void setParseData( QString qstr ) { +void setParseData( TQString qstr ) { const char* cstr; if ( qstr.isNull() ) cstr = ""; @@ -1837,18 +1837,18 @@ void parseRange( char* txt, int* min, int* max ) RegExp* parseCharClass( char* match ) { TextRangeRegExp* res = new TextRangeRegExp( false ); - QString txt = QString::fromLocal8Bit( match ); + TQString txt = TQString::fromLocal8Bit( match ); txt = txt.mid(1,txt.length()-2); unsigned int i = 0; - QChar ch = txt.at(i++); - QString pendingChar; - QString thisChar; + TQChar ch = txt.at(i++); + TQString pendingChar; + TQString thisChar; bool charPending = false; bool rangePending = false; bool flushPending = false; - if ( ch == QChar('^') ) { + if ( ch == TQChar('^') ) { res->setNegate( true ); ch = txt.at(i++); } @@ -1856,7 +1856,7 @@ RegExp* parseCharClass( char* match ) do { // If a character is pending, and the next char is '-' then we are // possible looking at a range. - if ( ch == QChar('-') && charPending ) { + if ( ch == TQChar('-') && charPending ) { rangePending = true; ch = txt.at(i++); continue; @@ -1870,44 +1870,44 @@ RegExp* parseCharClass( char* match ) charPending = false; } - if ( ch == QChar('\\') ) { + if ( ch == TQChar('\\') ) { // Handle the cases where an escape character is specified. ch = txt.at(i++); - if ( ch == QChar('a') || ch == QChar('f') || ch == QChar('n') || ch == QChar('r') || ch == QChar('t') || ch == QChar('v') ) { + if ( ch == TQChar('a') || ch == TQChar('f') || ch == TQChar('n') || ch == TQChar('r') || ch == TQChar('t') || ch == TQChar('v') ) { // These are just seen as normal characters. - thisChar = QString::fromLocal8Bit("\\") + ch; + thisChar = TQString::fromLocal8Bit("\\") + ch; } - else if ( ch == QChar('d') ) { + else if ( ch == TQChar('d') ) { // The following characters represent character groups. If any of // these are seen in a range, then the range is ignored, thus [a-\s] // matches an 'a', a '-', and a space (\s means space). res->setDigit( true ); flushPending = true; } - else if ( ch == QChar('D') ) { + else if ( ch == TQChar('D') ) { res->setNonDigit( true ); flushPending = true; } - else if ( ch == QChar('s') ) { + else if ( ch == TQChar('s') ) { res->setSpace( true ); flushPending = true; } - else if ( ch == QChar('S') ) { + else if ( ch == TQChar('S') ) { res->setNonSpace( true ); flushPending = true; } - else if ( ch == QChar('w') ) { + else if ( ch == TQChar('w') ) { res->setWordChar( true ); flushPending = true; } - else if ( ch == QChar('W') ) { + else if ( ch == TQChar('W') ) { res->setNonWordChar( true ); flushPending = true; } - else if ( ch == QChar('x') || ch == QChar('X') ) { + else if ( ch == TQChar('x') || ch == TQChar('X') ) { // This is a hexidecimal character: \xHHHH - QString str; + TQString str; for ( int j=0; j<4; j++) { ch = txt.at(i++); if ( ch == 'a' || ch == 'A' || ch == 'b' || ch == 'B' || ch == 'c' || ch == 'C' || ch == 'd' || ch == 'D' || @@ -1918,11 +1918,11 @@ RegExp* parseCharClass( char* match ) else i--; } - thisChar = QString::fromLocal8Bit("\\x") + str; + thisChar = TQString::fromLocal8Bit("\\x") + str; } - else if ( ch == QChar('0') ) { + else if ( ch == TQChar('0') ) { // This is an octal character - QString str; + TQString str; for ( int j=0; j<4; j++) { ch = txt.at(i++); if ( ch == '0' || ch == '1' || ch == '2' || ch == '3' || ch == '4' || ch == '5' || ch == '6' || ch == '7' ) @@ -1930,7 +1930,7 @@ RegExp* parseCharClass( char* match ) else i--; } - thisChar = QString::fromLocal8Bit("\\x") + str ; + thisChar = TQString::fromLocal8Bit("\\x") + str ; } else { // Anything else escaped just means the character itself. @@ -1951,7 +1951,7 @@ RegExp* parseCharClass( char* match ) if ( charPending ) res->addCharacter( pendingChar ); if ( rangePending ) - res->addCharacter( QString::fromLocal8Bit("-") ); + res->addCharacter( TQString::fromLocal8Bit("-") ); flushPending = false; charPending = false; rangePending = false; @@ -1969,12 +1969,12 @@ RegExp* parseCharClass( char* match ) } ch = txt.at(i++); } - while ( ch != QChar(']') && i <= txt.length() ); + while ( ch != TQChar(']') && i <= txt.length() ); if ( charPending ) res->addCharacter( pendingChar ); if ( rangePending ) - res->addCharacter( QString::fromLocal8Bit("-") ); + res->addCharacter( TQString::fromLocal8Bit("-") ); return res; } diff --git a/kregexpeditor/gen_qregexpparser.cc b/kregexpeditor/gen_qregexpparser.cc index b366293..9f8d0a0 100644 --- a/kregexpeditor/gen_qregexpparser.cc +++ b/kregexpeditor/gen_qregexpparser.cc @@ -107,7 +107,7 @@ #include <kmessagebox.h> #endif - #include <qstring.h> + #include <tqstring.h> #include <stdlib.h> #include "regexp.h" @@ -122,10 +122,10 @@ #include "compoundregexp.h" extern int yylex(); - extern void setParseData( QString str ); + extern void setParseData( TQString str ); int yyerror (const char *); void setParseResult( RegExp* ); - RegExp* parseQtRegExp( QString qstr, bool* ok ); + RegExp* parseQtRegExp( TQString qstr, bool* ok ); static RegExp* parseResult; static int _index; @@ -1049,7 +1049,7 @@ yyreduce: yyval.regexp = new AltnRegExp( false ); dynamic_cast<AltnRegExp*>( yyval.regexp )->addRegExp( yyvsp[-1].regexp ); } - dynamic_cast<AltnRegExp*>( yyval.regexp )->addRegExp( new TextRegExp( false, QString::fromLatin1("") ) ); + dynamic_cast<AltnRegExp*>( yyval.regexp )->addRegExp( new TextRegExp( false, TQString::fromLatin1("") ) ); } break; @@ -1057,7 +1057,7 @@ yyreduce: #line 107 "qregexpparser.y" { yyval.regexp = new AltnRegExp( false ); - dynamic_cast<AltnRegExp*>( yyval.regexp )->addRegExp( new TextRegExp( false, QString::fromLatin1("") ) ); + dynamic_cast<AltnRegExp*>( yyval.regexp )->addRegExp( new TextRegExp( false, TQString::fromLatin1("") ) ); dynamic_cast<AltnRegExp*>( yyval.regexp )->addRegExp( yyvsp[0].regexp ); } break; @@ -1160,7 +1160,7 @@ yyreduce: case 23: #line 157 "qregexpparser.y" { - QString match = QString::fromLocal8Bit("\\%1").arg( yyvsp[0].backRef ); + TQString match = TQString::fromLocal8Bit("\\%1").arg( yyvsp[0].backRef ); yyval.regexp = new TextRegExp( false, match ); KMessageBox::information(0,i18n("<qt>Back reference regular expressions are not supported.<p>" "<tt>\\1</tt>, <tt>\\2</tt>, ... are <i>back references</i>, meaning they refer to " @@ -1172,7 +1172,7 @@ yyreduce: "the back reference will be replaced by matching the text <b>%2</b> literally.") .arg( match ).arg( match ), i18n("Back reference regular expressions not supported"), - QString::fromLocal8Bit("backReferenceNotSupported") ); + TQString::fromLocal8Bit("backReferenceNotSupported") ); } break; @@ -1192,13 +1192,13 @@ yyreduce: if ( yyvsp[0].ch == '{' || yyvsp[0].ch == '}' || yyvsp[0].ch == '[' || yyvsp[0].ch == ']' || yyvsp[0].ch == '\\' ) { yyerror( "illigal character - needs escaping" ); } - yyval.regexp = new TextRegExp( false, QString::fromLocal8Bit("%1").arg(yyvsp[0].ch)); + yyval.regexp = new TextRegExp( false, TQString::fromLocal8Bit("%1").arg(yyvsp[0].ch)); } break; case 27: #line 182 "qregexpparser.y" - { yyval.regexp = new TextRegExp( false, QString::fromLocal8Bit("%1").arg(yyvsp[0].ch)); } + { yyval.regexp = new TextRegExp( false, TQString::fromLocal8Bit("%1").arg(yyvsp[0].ch)); } break; @@ -1427,7 +1427,7 @@ yyreturn: #line 185 "qregexpparser.y" -RegExp* parseQtRegExp( QString qstr, bool* ok ) { +RegExp* parseQtRegExp( TQString qstr, bool* ok ) { _index = 0; parseResult = 0; setParseData( qstr ); diff --git a/kregexpeditor/infopage.cpp b/kregexpeditor/infopage.cpp index 8f373c5..e467c4b 100644 --- a/kregexpeditor/infopage.cpp +++ b/kregexpeditor/infopage.cpp @@ -24,11 +24,11 @@ #include "infopage.h" -InfoPage::InfoPage( QWidget* parent, const char* name ) +InfoPage::InfoPage( TQWidget* parent, const char* name ) :KTextBrowser( parent, name ) { - QString txt = - QString::fromLatin1( "<qt>" ) + + TQString txt = + TQString::fromLatin1( "<qt>" ) + i18n( "Translators, feel free to add yourself in the text below, asking for a postcard ;-), " "also feel free to add a section saying <h2>Translators</h2>. " "Kind regards, and thanks for your work - Jesper.", @@ -58,20 +58,20 @@ InfoPage::InfoPage( QWidget* parent, const char* name ) "<h2>Author</h2>" "<a href=\"http://www.blackie.dk/\">Jesper K. Pedersen</a> <<a href=\"mailto:blackie@kde.org\">blackie@kde.org</a>>") - + QString::fromLatin1( "</qt>" ); + + TQString::fromLatin1( "</qt>" ); setText( txt ); } -void InfoPage::setSource ( const QString& name ) +void InfoPage::setSource ( const TQString& name ) { #ifdef QT_ONLY - mimeSourceFactory()->setFilePath( QStringList() << QString::fromLatin1("manual/")); - QString nm = name; + mimeSourceFactory()->setFilePath( TQStringList() << TQString::fromLatin1("manual/")); + TQString nm = name; if ( nm.endsWith("/") ) nm = nm.left( nm.length()-1); if ( nm.startsWith("mailto:") ) { - QMessageBox::information( this, tr("Support mail"), tr("Please send the mail to blackie@kde.org") ); + TQMessageBox::information( this, tr("Support mail"), tr("Please send the mail to blackie@kde.org") ); return; } if ( nm.startsWith( "http:" ) ) @@ -81,14 +81,14 @@ void InfoPage::setSource ( const QString& name ) if ( nm == "doc://" ) nm = "doc://index"; - if ( nm.startsWith( QString::fromLocal8Bit("doc://") ) ) { + if ( nm.startsWith( TQString::fromLocal8Bit("doc://") ) ) { nm = nm.mid(6) + ".html"; } - QTextBrowser::setSource( nm ); + TQTextBrowser::setSource( nm ); #else - if ( name.startsWith( QString::fromLocal8Bit("doc://") ) ) { - kapp->invokeHelp( name.mid(6, name.length()-7), QString::fromLocal8Bit("KRegExpEditor") ); + if ( name.startsWith( TQString::fromLocal8Bit("doc://") ) ) { + kapp->invokeHelp( name.mid(6, name.length()-7), TQString::fromLocal8Bit("KRegExpEditor") ); } else { KTextBrowser::setSource( name ); // handle mailto and other links diff --git a/kregexpeditor/infopage.h b/kregexpeditor/infopage.h index b518979..cada15d 100644 --- a/kregexpeditor/infopage.h +++ b/kregexpeditor/infopage.h @@ -20,7 +20,7 @@ #ifdef QT_ONLY #include "compat.h" - #include <qtextbrowser.h> + #include <tqtextbrowser.h> #else # include <ktextbrowser.h> #endif @@ -28,8 +28,8 @@ class InfoPage :public KTextBrowser { public: - InfoPage( QWidget* parent, const char* name ); - virtual void setSource ( const QString& name ); + InfoPage( TQWidget* parent, const char* name ); + virtual void setSource ( const TQString& name ); }; diff --git a/kregexpeditor/kregexpeditorgui.cpp b/kregexpeditor/kregexpeditorgui.cpp index e8f8051..bbf06be 100644 --- a/kregexpeditor/kregexpeditorgui.cpp +++ b/kregexpeditor/kregexpeditorgui.cpp @@ -29,24 +29,24 @@ // #include <unistd.h> // DO I need this? #include <stdio.h> #include "kregexpeditorprivate.h" -#include <qlayout.h> +#include <tqlayout.h> -const QString KRegExpEditorGUI::version = QString::fromLocal8Bit("1.0"); +const TQString KRegExpEditorGUI::version = TQString::fromLocal8Bit("1.0"); -KRegExpEditorGUI::KRegExpEditorGUI(QWidget *parent, const char *name, - const QStringList & ) - : QWidget( parent, name) +KRegExpEditorGUI::KRegExpEditorGUI(TQWidget *parent, const char *name, + const TQStringList & ) + : TQWidget( parent, name) { - QHBoxLayout* layout = new QHBoxLayout( this, 6 ); + TQHBoxLayout* layout = new TQHBoxLayout( this, 6 ); _editor = new KRegExpEditorPrivate( this, "_editor" ); layout->addWidget( _editor ); - connect( _editor, SIGNAL( canUndo(bool) ), this, SIGNAL( canUndo(bool) ) ); - connect( _editor, SIGNAL( canRedo(bool) ), this, SIGNAL( canRedo(bool) ) ); - connect( _editor, SIGNAL( changes(bool) ), this, SIGNAL( changes(bool) ) ); + connect( _editor, TQT_SIGNAL( canUndo(bool) ), this, TQT_SIGNAL( canUndo(bool) ) ); + connect( _editor, TQT_SIGNAL( canRedo(bool) ), this, TQT_SIGNAL( canRedo(bool) ) ); + connect( _editor, TQT_SIGNAL( changes(bool) ), this, TQT_SIGNAL( changes(bool) ) ); } -QString KRegExpEditorGUI::regExp() const +TQString KRegExpEditorGUI::regExp() const { return _editor->regexp(); } @@ -61,41 +61,41 @@ void KRegExpEditorGUI::undo() _editor->slotUndo(); } -void KRegExpEditorGUI::setRegExp( const QString ®exp ) +void KRegExpEditorGUI::setRegExp( const TQString ®exp ) { _editor->slotSetRegexp( regexp ); } -KRegExpEditorGUIDialog::KRegExpEditorGUIDialog( QWidget *parent, +KRegExpEditorGUIDialog::KRegExpEditorGUIDialog( TQWidget *parent, const char *name, - const QStringList & ) + const TQStringList & ) : KDialogBase( KDialogBase::Plain, i18n("Regular Expression Editor"), KDialogBase::Ok | KDialogBase::Cancel | KDialogBase::Help, KDialogBase::Ok, parent, name ? name : "KRegExpDialog" ) { - QFrame* frame = plainPage(); - QVBoxLayout* layout = new QVBoxLayout( frame, 6 ); + TQFrame* frame = plainPage(); + TQVBoxLayout* layout = new TQVBoxLayout( frame, 6 ); layout->setAutoAdd( true ); _editor = new KRegExpEditorGUI( frame ); - connect( _editor, SIGNAL( canUndo(bool) ), this, SIGNAL( canUndo(bool) ) ); - connect( _editor, SIGNAL( canRedo(bool) ), this, SIGNAL( canRedo(bool) ) ); - connect( _editor, SIGNAL( changes(bool) ), this, SIGNAL( changes(bool) ) ); + connect( _editor, TQT_SIGNAL( canUndo(bool) ), this, TQT_SIGNAL( canUndo(bool) ) ); + connect( _editor, TQT_SIGNAL( canRedo(bool) ), this, TQT_SIGNAL( canRedo(bool) ) ); + connect( _editor, TQT_SIGNAL( changes(bool) ), this, TQT_SIGNAL( changes(bool) ) ); resize( 640, 400 ); - setHelp( QString::null, QString::fromLocal8Bit( "KRegExpEditor" ) ); + setHelp( TQString::null, TQString::fromLocal8Bit( "KRegExpEditor" ) ); #ifdef QT_ONLY - connect( this, SIGNAL( helpClicked() ), _editor, SLOT( showHelp() ) ); + connect( this, TQT_SIGNAL( helpClicked() ), _editor, TQT_SLOT( showHelp() ) ); #endif } -QString KRegExpEditorGUIDialog::regExp() const +TQString KRegExpEditorGUIDialog::regExp() const { return _editor->regExp(); } -void KRegExpEditorGUIDialog::setRegExp( const QString ®exp ) +void KRegExpEditorGUIDialog::setRegExp( const TQString ®exp ) { _editor->setRegExp( regexp ); } @@ -110,23 +110,23 @@ void KRegExpEditorGUIDialog::undo() _editor->undo(); } -void KRegExpEditorGUIDialog::doSomething( QString method, void* arguments ) +void KRegExpEditorGUIDialog::doSomething( TQString method, void* arguments ) { _editor->doSomething( method, arguments ); } -void KRegExpEditorGUI::doSomething( QString method, void* arguments ) +void KRegExpEditorGUI::doSomething( TQString method, void* arguments ) { - if ( method == QString::fromLatin1( "setCaseSensitive" ) ) { + if ( method == TQString::fromLatin1( "setCaseSensitive" ) ) { _editor->setCaseSensitive( (bool) arguments ); } - else if ( method == QString::fromLatin1("setMinimal") ) { + else if ( method == TQString::fromLatin1("setMinimal") ) { _editor->setMinimal( (bool) arguments ); } - else if ( method == QString::fromLatin1("setSyntax") ) { - _editor->setSyntax( *((QString*) arguments) ); + else if ( method == TQString::fromLatin1("setSyntax") ) { + _editor->setSyntax( *((TQString*) arguments) ); } - else if ( method == QString::fromLatin1("setAllowNonQtSyntax") ) { + else if ( method == TQString::fromLatin1("setAllowNonQtSyntax") ) { _editor->setAllowNonQtSyntax( (bool) arguments ); } else { @@ -134,12 +134,12 @@ void KRegExpEditorGUI::doSomething( QString method, void* arguments ) } } -void KRegExpEditorGUIDialog::setMatchText( const QString& txt ) +void KRegExpEditorGUIDialog::setMatchText( const TQString& txt ) { _editor->setMatchText( txt ); } -void KRegExpEditorGUI::setMatchText( const QString& txt ) +void KRegExpEditorGUI::setMatchText( const TQString& txt ) { _editor->setMatchText( txt ); } @@ -150,7 +150,7 @@ void KRegExpEditorGUI::showHelp() #ifdef QT_ONLY _editor->showHelp(); #else - kapp->invokeHelp( QString::null, QString::fromLocal8Bit( "KRegExpEditor" ) ); + kapp->invokeHelp( TQString::null, TQString::fromLocal8Bit( "KRegExpEditor" ) ); #endif } diff --git a/kregexpeditor/kregexpeditorgui.h b/kregexpeditor/kregexpeditorgui.h index 6bcd5e6..48545d8 100644 --- a/kregexpeditor/kregexpeditorgui.h +++ b/kregexpeditor/kregexpeditorgui.h @@ -34,16 +34,16 @@ class KRegExpEditorPrivate; @author Jesper Kjær Pedersen <blackie@kde.org> @version 0.1 **/ -class KDE_EXPORT KRegExpEditorGUI :public QWidget, public KRegExpEditorInterface +class KDE_EXPORT KRegExpEditorGUI :public TQWidget, public KRegExpEditorInterface { Q_OBJECT - Q_PROPERTY( QString regexp READ regExp WRITE setRegExp ) + Q_PROPERTY( TQString regexp READ regExp WRITE setRegExp ) public: - KRegExpEditorGUI( QWidget *parent, const char *name = 0, - const QStringList & = QStringList() ); - virtual QString regExp() const; + KRegExpEditorGUI( TQWidget *parent, const char *name = 0, + const TQStringList & = TQStringList() ); + virtual TQString regExp() const; - static const QString version; + static const TQString version; signals: /** This signal tells whether undo is available. */ @@ -54,9 +54,9 @@ signals: public slots: virtual void redo(); virtual void undo(); - virtual void setRegExp( const QString ®exp ); - virtual void doSomething( QString method, void* arguments ); - virtual void setMatchText( const QString& ); + virtual void setRegExp( const TQString ®exp ); + virtual void doSomething( TQString method, void* arguments ); + virtual void setMatchText( const TQString& ); void showHelp(); private: @@ -66,11 +66,11 @@ private: class KDE_EXPORT KRegExpEditorGUIDialog : public KDialogBase, public KRegExpEditorInterface { Q_OBJECT - Q_PROPERTY( QString regexp READ regExp WRITE setRegExp ) + Q_PROPERTY( TQString regexp READ regExp WRITE setRegExp ) public: - KRegExpEditorGUIDialog( QWidget *parent, const char *name, const QStringList &args ); + KRegExpEditorGUIDialog( TQWidget *parent, const char *name, const TQStringList &args ); - virtual QString regExp() const; + virtual TQString regExp() const; signals: /** This signal tells whether undo is available. */ @@ -81,9 +81,9 @@ signals: public slots: virtual void redo(); virtual void undo(); - virtual void setRegExp( const QString ®exp ); - virtual void doSomething( QString method, void* arguments ); - virtual void setMatchText( const QString& ); + virtual void setRegExp( const TQString ®exp ); + virtual void doSomething( TQString method, void* arguments ); + virtual void setMatchText( const TQString& ); private: KRegExpEditorGUI *_editor; diff --git a/kregexpeditor/kregexpeditorprivate.cpp b/kregexpeditor/kregexpeditorprivate.cpp index b13a655..e7796c8 100644 --- a/kregexpeditor/kregexpeditorprivate.cpp +++ b/kregexpeditor/kregexpeditorprivate.cpp @@ -26,35 +26,35 @@ #include "kregexpeditorprivate.moc" #endif -#include <qlineedit.h> -#include <qtooltip.h> -#include <qtoolbutton.h> +#include <tqlineedit.h> +#include <tqtooltip.h> +#include <tqtoolbutton.h> #include "kregexpeditorprivate.h" #include "scrollededitorwindow.h" #include "regexpbuttons.h" //#include <unistd.h> // What do I need this for? #include <stdio.h> #include "infopage.h" -#include <qsplitter.h> -#include <qdockarea.h> +#include <tqsplitter.h> +#include <tqdockarea.h> #include "userdefinedregexps.h" #include "auxbuttons.h" -#include <qaccel.h> -#include <qtimer.h> +#include <tqaccel.h> +#include <tqtimer.h> #include "verifier.h" -#include <qfile.h> +#include <tqfile.h> #include "verifybuttons.h" -#include <qwhatsthis.h> +#include <tqwhatsthis.h> -KRegExpEditorPrivate::KRegExpEditorPrivate(QWidget *parent, const char *name) - : QWidget(parent, name), _updating( false ), _autoVerify( true ) +KRegExpEditorPrivate::KRegExpEditorPrivate(TQWidget *parent, const char *name) + : TQWidget(parent, name), _updating( false ), _autoVerify( true ) { setMinimumSize(730,300); - QDockArea* area = new QDockArea( Horizontal, QDockArea::Normal, this ); + TQDockArea* area = new TQDockArea( Horizontal, TQDockArea::Normal, this ); area->setMinimumSize(2,2); - QDockArea* verArea1 = new QDockArea( Vertical, QDockArea::Normal, this ); + TQDockArea* verArea1 = new TQDockArea( Vertical, TQDockArea::Normal, this ); verArea1->setMinimumSize(2,2); - QDockArea* verArea2 = new QDockArea( Vertical, QDockArea::Reverse, this ); + TQDockArea* verArea2 = new TQDockArea( Vertical, TQDockArea::Reverse, this ); verArea2->setMinimumSize(2,2); // The DockWindows. @@ -63,33 +63,33 @@ KRegExpEditorPrivate::KRegExpEditorPrivate(QWidget *parent, const char *name) _auxButtons = new AuxButtons( area, "KRegExpEditorPrivate::AuxButtons" ); _userRegExps = new UserDefinedRegExps( verArea1, "KRegExpEditorPrivate::userRegExps" ); _userRegExps->setResizeEnabled( true ); - QWhatsThis::add( _userRegExps, i18n( "In this window you will find predefined regular expressions. Both regular expressions " + TQWhatsThis::add( _userRegExps, i18n( "In this window you will find predefined regular expressions. Both regular expressions " "you have developed and saved, and regular expressions shipped with the system." )); // Editor window - _editor = new QSplitter( Vertical, this, "KRegExpEditorPrivate::_editor" ); + _editor = new TQSplitter( Vertical, this, "KRegExpEditorPrivate::_editor" ); _scrolledEditorWindow = new RegExpScrolledEditorWindow( _editor, "KRegExpEditorPrivate::_scrolledEditorWindow" ); - QWhatsThis::add( _scrolledEditorWindow, i18n( "In this window you will develop your regular expressions. " + TQWhatsThis::add( _scrolledEditorWindow, i18n( "In this window you will develop your regular expressions. " "Select one of the actions from the action buttons above, and click the mouse in this " "window to insert the given action.")); _info = new InfoPage( this, "_info" ); _verifier = new Verifier( _editor, "KRegExpEditorPrivate::_verifier" ); - connect( _verifier, SIGNAL( textChanged() ), this, SLOT( maybeVerify() ) ); - QWhatsThis::add( _verifier, i18n("Type in some text in this window, and see what the regular expression you have developed matches.<p>" + connect( _verifier, TQT_SIGNAL( textChanged() ), this, TQT_SLOT( maybeVerify() ) ); + TQWhatsThis::add( _verifier, i18n("Type in some text in this window, and see what the regular expression you have developed matches.<p>" "Each second match will be colored in red and each other match will be colored blue, simply so you " "can distinguish them from each other.<p>" "If you select part of the regular expression in the editor window, then this part will be " "highlighted - This allows you to <i>debug</i> your regular expressions") ); _editor->hide(); - _editor->setSizes( QValueList<int>() << _editor->height()/2 << _editor->height()/2 ); + _editor->setSizes( TQValueList<int>() << _editor->height()/2 << _editor->height()/2 ); - QVBoxLayout *topLayout = new QVBoxLayout( this, 0, 6, "KRegExpEditorPrivate::topLayout" ); + TQVBoxLayout *topLayout = new TQVBoxLayout( this, 0, 6, "KRegExpEditorPrivate::topLayout" ); topLayout->addWidget( area ); - QHBoxLayout* rows = new QHBoxLayout; // I need to cal addLayout explicit to get stretching right. + TQHBoxLayout* rows = new QHBoxLayout; // I need to cal addLayout explicit to get stretching right. topLayout->addLayout( rows, 1 ); rows->addWidget( verArea1 ); @@ -98,54 +98,54 @@ KRegExpEditorPrivate::KRegExpEditorPrivate(QWidget *parent, const char *name) rows->addWidget( verArea2 ); // Connect the buttons - connect( _regExpButtons, SIGNAL( clicked( int ) ), _scrolledEditorWindow, SLOT( slotInsertRegExp( int ) ) ); - connect( _regExpButtons, SIGNAL( doSelect() ), _scrolledEditorWindow, SLOT( slotDoSelect() ) ); - connect( _userRegExps, SIGNAL( load( RegExp* ) ), _scrolledEditorWindow, SLOT( slotInsertRegExp( RegExp* ) ) ); + connect( _regExpButtons, TQT_SIGNAL( clicked( int ) ), _scrolledEditorWindow, TQT_SLOT( slotInsertRegExp( int ) ) ); + connect( _regExpButtons, TQT_SIGNAL( doSelect() ), _scrolledEditorWindow, TQT_SLOT( slotDoSelect() ) ); + connect( _userRegExps, TQT_SIGNAL( load( RegExp* ) ), _scrolledEditorWindow, TQT_SLOT( slotInsertRegExp( RegExp* ) ) ); - connect( _regExpButtons, SIGNAL( clicked( int ) ), _userRegExps, SLOT( slotUnSelect() ) ); - connect( _regExpButtons, SIGNAL( doSelect() ), _userRegExps, SLOT( slotUnSelect() ) ); - connect( _userRegExps, SIGNAL( load( RegExp* ) ), _regExpButtons, SLOT( slotUnSelect() ) ); + connect( _regExpButtons, TQT_SIGNAL( clicked( int ) ), _userRegExps, TQT_SLOT( slotUnSelect() ) ); + connect( _regExpButtons, TQT_SIGNAL( doSelect() ), _userRegExps, TQT_SLOT( slotUnSelect() ) ); + connect( _userRegExps, TQT_SIGNAL( load( RegExp* ) ), _regExpButtons, TQT_SLOT( slotUnSelect() ) ); - connect( _scrolledEditorWindow, SIGNAL( doneEditing() ), _regExpButtons, SLOT( slotSelectNewAction() ) ); - connect( _scrolledEditorWindow, SIGNAL( doneEditing() ), _userRegExps, SLOT( slotSelectNewAction() ) ); + connect( _scrolledEditorWindow, TQT_SIGNAL( doneEditing() ), _regExpButtons, TQT_SLOT( slotSelectNewAction() ) ); + connect( _scrolledEditorWindow, TQT_SIGNAL( doneEditing() ), _userRegExps, TQT_SLOT( slotSelectNewAction() ) ); - connect( _regExpButtons, SIGNAL( clicked( int ) ), this, SLOT( slotShowEditor() ) ); - connect( _userRegExps, SIGNAL( load( RegExp* ) ), this, SLOT( slotShowEditor() ) ); - connect( _regExpButtons, SIGNAL( doSelect() ), this, SLOT( slotShowEditor() ) ); + connect( _regExpButtons, TQT_SIGNAL( clicked( int ) ), this, TQT_SLOT( slotShowEditor() ) ); + connect( _userRegExps, TQT_SIGNAL( load( RegExp* ) ), this, TQT_SLOT( slotShowEditor() ) ); + connect( _regExpButtons, TQT_SIGNAL( doSelect() ), this, TQT_SLOT( slotShowEditor() ) ); - connect( _scrolledEditorWindow, SIGNAL( savedRegexp() ), _userRegExps, SLOT( slotPopulateUserRegexps() ) ); + connect( _scrolledEditorWindow, TQT_SIGNAL( savedRegexp() ), _userRegExps, TQT_SLOT( slotPopulateUserRegexps() ) ); - connect( _auxButtons, SIGNAL( undo() ), this, SLOT( slotUndo() ) ); - connect( _auxButtons, SIGNAL( redo() ), this, SLOT( slotRedo() ) ); - connect( _auxButtons, SIGNAL( cut() ), _scrolledEditorWindow, SLOT( slotCut() ) ); - connect( _auxButtons, SIGNAL( copy() ), _scrolledEditorWindow, SLOT( slotCopy() ) ); - connect( _auxButtons, SIGNAL( paste() ), _scrolledEditorWindow, SLOT( slotPaste() ) ); - connect( _auxButtons, SIGNAL( save() ), _scrolledEditorWindow, SLOT( slotSave() ) ); - connect( _verifyButtons, SIGNAL( autoVerify( bool ) ), this, SLOT( setAutoVerify( bool ) ) ); - connect( _verifyButtons, SIGNAL( verify() ), this, SLOT( doVerify() ) ); - connect( _verifyButtons, SIGNAL( changeSyntax( const QString& ) ), this, SLOT( setSyntax( const QString& ) ) ); + connect( _auxButtons, TQT_SIGNAL( undo() ), this, TQT_SLOT( slotUndo() ) ); + connect( _auxButtons, TQT_SIGNAL( redo() ), this, TQT_SLOT( slotRedo() ) ); + connect( _auxButtons, TQT_SIGNAL( cut() ), _scrolledEditorWindow, TQT_SLOT( slotCut() ) ); + connect( _auxButtons, TQT_SIGNAL( copy() ), _scrolledEditorWindow, TQT_SLOT( slotCopy() ) ); + connect( _auxButtons, TQT_SIGNAL( paste() ), _scrolledEditorWindow, TQT_SLOT( slotPaste() ) ); + connect( _auxButtons, TQT_SIGNAL( save() ), _scrolledEditorWindow, TQT_SLOT( slotSave() ) ); + connect( _verifyButtons, TQT_SIGNAL( autoVerify( bool ) ), this, TQT_SLOT( setAutoVerify( bool ) ) ); + connect( _verifyButtons, TQT_SIGNAL( verify() ), this, TQT_SLOT( doVerify() ) ); + connect( _verifyButtons, TQT_SIGNAL( changeSyntax( const TQString& ) ), this, TQT_SLOT( setSyntax( const TQString& ) ) ); - connect( this, SIGNAL( canUndo( bool ) ), _auxButtons, SLOT( slotCanUndo( bool ) ) ); - connect( this, SIGNAL( canRedo( bool ) ), _auxButtons, SLOT( slotCanRedo( bool ) ) ); - connect( _scrolledEditorWindow, SIGNAL( anythingSelected( bool ) ), _auxButtons, SLOT( slotCanCut( bool ) ) ); - connect( _scrolledEditorWindow, SIGNAL( anythingSelected( bool ) ), _auxButtons, SLOT( slotCanCopy( bool ) ) ); - connect( _scrolledEditorWindow, SIGNAL( anythingOnClipboard( bool ) ), _auxButtons, SLOT( slotCanPaste( bool ) ) ); - connect( _scrolledEditorWindow, SIGNAL( canSave( bool ) ), _auxButtons, SLOT( slotCanSave( bool ) ) ); + connect( this, TQT_SIGNAL( canUndo( bool ) ), _auxButtons, TQT_SLOT( slotCanUndo( bool ) ) ); + connect( this, TQT_SIGNAL( canRedo( bool ) ), _auxButtons, TQT_SLOT( slotCanRedo( bool ) ) ); + connect( _scrolledEditorWindow, TQT_SIGNAL( anythingSelected( bool ) ), _auxButtons, TQT_SLOT( slotCanCut( bool ) ) ); + connect( _scrolledEditorWindow, TQT_SIGNAL( anythingSelected( bool ) ), _auxButtons, TQT_SLOT( slotCanCopy( bool ) ) ); + connect( _scrolledEditorWindow, TQT_SIGNAL( anythingOnClipboard( bool ) ), _auxButtons, TQT_SLOT( slotCanPaste( bool ) ) ); + connect( _scrolledEditorWindow, TQT_SIGNAL( canSave( bool ) ), _auxButtons, TQT_SLOT( slotCanSave( bool ) ) ); - connect( _scrolledEditorWindow, SIGNAL( verifyRegExp() ), this, SLOT( maybeVerify() ) ); + connect( _scrolledEditorWindow, TQT_SIGNAL( verifyRegExp() ), this, TQT_SLOT( maybeVerify() ) ); - connect( _verifyButtons, SIGNAL( loadVerifyText( const QString& ) ), this, SLOT( setVerifyText( const QString& ) ) ); + connect( _verifyButtons, TQT_SIGNAL( loadVerifyText( const TQString& ) ), this, TQT_SLOT( setVerifyText( const TQString& ) ) ); - // connect( _verifier, SIGNAL( countChanged( int ) ), _verifyButtons, SLOT( setMatchCount( int ) ) ); + // connect( _verifier, TQT_SIGNAL( countChanged( int ) ), _verifyButtons, TQT_SLOT( setMatchCount( int ) ) ); // Qt anchors do not work for <pre>...</pre>, thefore scrolling to next/prev match // do not work. Enable this when they work. - // connect( _verifyButtons, SIGNAL( gotoFirst() ), _verifier, SLOT( gotoFirst() ) ); - // connect( _verifyButtons, SIGNAL( gotoPrev() ), _verifier, SLOT( gotoPrev() ) ); - // connect( _verifyButtons, SIGNAL( gotoNext() ), _verifier, SLOT( gotoNext() ) ); - // connect( _verifyButtons, SIGNAL( gotoLast() ), _verifier, SLOT( gotoLast() ) ); - // connect( _verifier, SIGNAL( goForwardPossible( bool ) ), _verifyButtons, SLOT( enableForwardButtons( bool ) ) ); - // connect( _verifier, SIGNAL( goBackwardPossible( bool ) ), _verifyButtons, SLOT( enableBackwardButtons( bool ) ) ); + // connect( _verifyButtons, TQT_SIGNAL( gotoFirst() ), _verifier, TQT_SLOT( gotoFirst() ) ); + // connect( _verifyButtons, TQT_SIGNAL( gotoPrev() ), _verifier, TQT_SLOT( gotoPrev() ) ); + // connect( _verifyButtons, TQT_SIGNAL( gotoNext() ), _verifier, TQT_SLOT( gotoNext() ) ); + // connect( _verifyButtons, TQT_SIGNAL( gotoLast() ), _verifier, TQT_SLOT( gotoLast() ) ); + // connect( _verifier, TQT_SIGNAL( goForwardPossible( bool ) ), _verifyButtons, TQT_SLOT( enableForwardButtons( bool ) ) ); + // connect( _verifier, TQT_SIGNAL( goBackwardPossible( bool ) ), _verifyButtons, TQT_SLOT( enableBackwardButtons( bool ) ) ); _auxButtons->slotCanPaste( false ); _auxButtons->slotCanCut( false ); @@ -154,60 +154,60 @@ KRegExpEditorPrivate::KRegExpEditorPrivate(QWidget *parent, const char *name) // Line Edit - QHBoxLayout* layout = new QHBoxLayout( topLayout, 6 ); - QLabel* label = new QLabel( i18n("ASCII syntax:"), this ); + TQHBoxLayout* layout = new TQHBoxLayout( topLayout, 6 ); + TQLabel* label = new TQLabel( i18n("ASCII syntax:"), this ); layout->addWidget( label ); - clearButton = new QToolButton( this ); - const QString icon( QString::fromLatin1( QApplication::reverseLayout() ? "clear_left" : "locationbar_erase" ) ); - QIconSet clearIcon = SmallIconSet( icon ); + clearButton = new TQToolButton( this ); + const TQString icon( TQString::fromLatin1( TQApplication::reverseLayout() ? "clear_left" : "locationbar_erase" ) ); + TQIconSet clearIcon = SmallIconSet( icon ); clearButton->setIconSet( clearIcon ); layout->addWidget( clearButton ); - QToolTip::add( clearButton, i18n("Clear expression") ); - _regexpEdit = new QLineEdit( this ); + TQToolTip::add( clearButton, i18n("Clear expression") ); + _regexpEdit = new TQLineEdit( this ); layout->addWidget( _regexpEdit ); - QWhatsThis::add( _regexpEdit, i18n( "This is the regular expression in ASCII syntax. You are likely only " + TQWhatsThis::add( _regexpEdit, i18n( "This is the regular expression in ASCII syntax. You are likely only " "to be interested in this if you are a programmer, and need to " - "develop a regular expression using QRegExp.<p>" + "develop a regular expression using TQRegExp.<p>" "You may develop your regular expression both by using the graphical " "editor, and by typing the regular expression in this line edit.") ); #ifdef QT_ONLY - QPixmap pix( "icons/error.png" ); + TQPixmap pix( "icons/error.png" ); #else - QPixmap pix = KGlobal::iconLoader()->loadIcon(locate("data", QString::fromLatin1("kregexpeditor/pics/error.png") ), KIcon::Toolbar ); + TQPixmap pix = KGlobal::iconLoader()->loadIcon(locate("data", TQString::fromLatin1("kregexpeditor/pics/error.png") ), KIcon::Toolbar ); #endif - _error = new QLabel( this ); + _error = new TQLabel( this ); _error->setPixmap( pix ); layout->addWidget( _error ); _error->hide(); - _timer = new QTimer(this); + _timer = new TQTimer(this); - connect( _scrolledEditorWindow, SIGNAL( change() ), this, SLOT( slotUpdateLineEdit() ) ); - connect( _regexpEdit, SIGNAL(textChanged( const QString& ) ), this, SLOT( slotTriggerUpdate() ) ); - connect( _timer, SIGNAL( timeout() ), this, SLOT( slotTimeout() ) ); - connect( clearButton, SIGNAL( clicked() ), _regexpEdit, SLOT( clear() ) ); + connect( _scrolledEditorWindow, TQT_SIGNAL( change() ), this, TQT_SLOT( slotUpdateLineEdit() ) ); + connect( _regexpEdit, TQT_SIGNAL(textChanged( const TQString& ) ), this, TQT_SLOT( slotTriggerUpdate() ) ); + connect( _timer, TQT_SIGNAL( timeout() ), this, TQT_SLOT( slotTimeout() ) ); + connect( clearButton, TQT_SIGNAL( clicked() ), _regexpEdit, TQT_SLOT( clear() ) ); // Push an initial empty element on the stack. _undoStack.push( _scrolledEditorWindow->regExp() ); _redoStack.setAutoDelete( true ); - QAccel* accel = new QAccel( this ); - accel->connectItem( accel->insertItem( CTRL+Key_Z ), this, SLOT( slotUndo() ) ); - accel->connectItem( accel->insertItem( CTRL+Key_R ), this, SLOT( slotRedo() ) ); + TQAccel* accel = new TQAccel( this ); + accel->connectItem( accel->insertItem( CTRL+Key_Z ), this, TQT_SLOT( slotUndo() ) ); + accel->connectItem( accel->insertItem( CTRL+Key_R ), this, TQT_SLOT( slotRedo() ) ); - setSyntax( QString::fromLatin1( "Qt" ) ); + setSyntax( TQString::fromLatin1( "Qt" ) ); } -QString KRegExpEditorPrivate::regexp() +TQString KRegExpEditorPrivate::regexp() { RegExp* regexp = _scrolledEditorWindow->regExp(); - QString res = RegExpConverter::current()->toStr( regexp, false ); + TQString res = RegExpConverter::current()->toStr( regexp, false ); delete regexp; return res; } -void KRegExpEditorPrivate::slotUpdateEditor( const QString & txt) +void KRegExpEditorPrivate::slotUpdateEditor( const TQString & txt) { _updating = true; bool ok; @@ -217,8 +217,8 @@ void KRegExpEditorPrivate::slotUpdateEditor( const QString & txt) else { RegExp* result = RegExpConverter::current()->parse( txt, &ok ); if ( ok ) { - QPtrList<CompoundRegExp> list = _userRegExps->regExps(); - for ( QPtrListIterator<CompoundRegExp> it( list ); *it; ++it ) { + TQPtrList<CompoundRegExp> list = _userRegExps->regExps(); + for ( TQPtrListIterator<CompoundRegExp> it( list ); *it; ++it ) { result->replacePart( *it ); } @@ -247,7 +247,7 @@ void KRegExpEditorPrivate::slotUpdateLineEdit() RegExp* regexp = _scrolledEditorWindow->regExp(); regexp->check( _errorMap ); - QString str = RegExpConverter::current()->toStr( regexp, false ); + TQString str = RegExpConverter::current()->toStr( regexp, false ); _regexpEdit->setText( str ); delete regexp; @@ -264,7 +264,7 @@ void KRegExpEditorPrivate::recordUndoInfo() RegExp* regexp = _scrolledEditorWindow->regExp(); if ( regexp->toXmlString() != _undoStack.top()->toXmlString() ) { _undoStack.push( regexp ); - _redoStack = QPtrStack<RegExp>(); + _redoStack = TQPtrStack<RegExp>(); emitUndoRedoSignals(); } } @@ -304,7 +304,7 @@ void KRegExpEditorPrivate::emitUndoRedoSignals() emit canRedo( _redoStack.count() > 0 ); } -void KRegExpEditorPrivate::slotSetRegexp( QString regexp ) +void KRegExpEditorPrivate::slotSetRegexp( TQString regexp ) { _regexpEdit->setText( regexp ); } @@ -329,7 +329,7 @@ void KRegExpEditorPrivate::slotTimeout() slotUpdateEditor( _regexpEdit->text() ); } -void KRegExpEditorPrivate::setMatchText( const QString& text ) +void KRegExpEditorPrivate::setMatchText( const TQString& text ) { bool autoVerify = _autoVerify; _autoVerify = false; @@ -365,17 +365,17 @@ void KRegExpEditorPrivate::setAutoVerify( bool on ) doVerify(); } -void KRegExpEditorPrivate::setVerifyText( const QString& fileName ) +void KRegExpEditorPrivate::setVerifyText( const TQString& fileName ) { bool autoVerify = _autoVerify; _autoVerify = false; - QFile file( fileName ); + TQFile file( fileName ); if ( !file.open( IO_ReadOnly ) ) { KMessageBox::sorry(0, i18n("Could not open file '%1' for reading").arg( fileName ) ); } else { - QTextStream s( &file ); - QString txt = s.read(); + TQTextStream s( &file ); + TQString txt = s.read(); file.close(); RegExp* regexp = _scrolledEditorWindow->regExp(); _verifier->setText( txt ); @@ -395,7 +395,7 @@ void KRegExpEditorPrivate::setMinimal( bool b ) _verifier->setMinimal( b ); } -void KRegExpEditorPrivate::setSyntax( const QString& syntax ) +void KRegExpEditorPrivate::setSyntax( const TQString& syntax ) { RegExpConverter* converter = _verifyButtons->setSyntax( syntax ); RegExpConverter::setCurrent( converter ); diff --git a/kregexpeditor/kregexpeditorprivate.h b/kregexpeditor/kregexpeditorprivate.h index 2e40fad..c7858d5 100644 --- a/kregexpeditor/kregexpeditorprivate.h +++ b/kregexpeditor/kregexpeditorprivate.h @@ -18,8 +18,8 @@ #ifndef kregexpeditorprivate_h #define kregexpeditorprivate_h -#include <qlabel.h> -#include <qptrstack.h> +#include <tqlabel.h> +#include <tqptrstack.h> #include "regexp.h" #include "errormap.h" class QTimer; @@ -48,14 +48,14 @@ class KRegExpEditorPrivate :public QWidget Q_OBJECT public: - KRegExpEditorPrivate( QWidget *parent, const char *name = 0 ); - QString regexp(); + KRegExpEditorPrivate( TQWidget *parent, const char *name = 0 ); + TQString regexp(); void setMinimal( bool ); void setCaseSensitive( bool ); void setAllowNonQtSyntax( bool ); protected slots: - void slotUpdateEditor( const QString & ); + void slotUpdateEditor( const TQString & ); void slotUpdateLineEdit(); void slotShowEditor(); void slotTriggerUpdate(); @@ -63,14 +63,14 @@ protected slots: void maybeVerify(); void doVerify(); void setAutoVerify( bool ); - void setVerifyText( const QString& fileName ); + void setVerifyText( const TQString& fileName ); public slots: void slotUndo(); void slotRedo(); - void slotSetRegexp( QString regexp ); - void setMatchText( const QString& text ); - void setSyntax( const QString& ); + void slotSetRegexp( TQString regexp ); + void setMatchText( const TQString& text ); + void setSyntax( const TQString& ); void showHelp(); signals: @@ -88,18 +88,18 @@ private: VerifyButtons* _verifyButtons; AuxButtons *_auxButtons; InfoPage* _info; - QLineEdit* _regexpEdit; - QSplitter* _editor; + TQLineEdit* _regexpEdit; + TQSplitter* _editor; bool _updating; - QLabel* _error; - QPtrStack<RegExp> _undoStack; - QPtrStack<RegExp> _redoStack; + TQLabel* _error; + TQPtrStack<RegExp> _undoStack; + TQPtrStack<RegExp> _redoStack; UserDefinedRegExps* _userRegExps; - QTimer* _timer; + TQTimer* _timer; Verifier* _verifier; bool _autoVerify; ErrorMap _errorMap; - QToolButton *clearButton; + TQToolButton *clearButton; }; #endif diff --git a/kregexpeditor/limitedcharlineedit.cpp b/kregexpeditor/limitedcharlineedit.cpp index 9631603..6322016 100644 --- a/kregexpeditor/limitedcharlineedit.cpp +++ b/kregexpeditor/limitedcharlineedit.cpp @@ -16,7 +16,7 @@ * Boston, MA 02110-1301, USA. **/ #include "limitedcharlineedit.h" -#include <qvalidator.h> +#include <tqvalidator.h> /** @internal @@ -25,22 +25,22 @@ class Validator :public QValidator { public: - Validator( LimitedCharLineEdit::Mode mode, QWidget* parent ) - :QValidator( parent, "Validator" ), _mode(mode) + Validator( LimitedCharLineEdit::Mode mode, TQWidget* parent ) + :TQValidator( parent, "Validator" ), _mode(mode) { } - virtual QValidator::State validate( QString& txt, int & /*pos*/ ) const + virtual TQValidator::State validate( TQString& txt, int & /*pos*/ ) const { if ( _mode == LimitedCharLineEdit::NORMAL || (_mode == LimitedCharLineEdit::HEX && - QRegExp(QString::fromLocal8Bit("^[0-9A-Fa-f]*$")).search( txt ) != -1) || + TQRegExp(TQString::fromLocal8Bit("^[0-9A-Fa-f]*$")).search( txt ) != -1) || (_mode == LimitedCharLineEdit::OCT && - QRegExp(QString::fromLocal8Bit("^[0-7]*$")).search( txt ) != -1 ) ) { - return QValidator::Acceptable; + TQRegExp(TQString::fromLocal8Bit("^[0-7]*$")).search( txt ) != -1 ) ) { + return TQValidator::Acceptable; } else { - return QValidator::Invalid; + return TQValidator::Invalid; } } @@ -49,15 +49,15 @@ private: }; -void LimitedCharLineEdit::keyPressEvent ( QKeyEvent *event ) +void LimitedCharLineEdit::keyPressEvent ( TQKeyEvent *event ) { - QLineEdit::keyPressEvent( event ); + TQLineEdit::keyPressEvent( event ); if ( text().length() == _count && !event->text().isNull() ) focusNextPrevChild(true); } -LimitedCharLineEdit::LimitedCharLineEdit( Mode mode, QWidget* parent, const char* name ) - :QLineEdit( parent, name ), _mode(mode) +LimitedCharLineEdit::LimitedCharLineEdit( Mode mode, TQWidget* parent, const char* name ) + :TQLineEdit( parent, name ), _mode(mode) { if ( mode == NORMAL ) _count = 1; diff --git a/kregexpeditor/limitedcharlineedit.h b/kregexpeditor/limitedcharlineedit.h index d4654c6..13026cc 100644 --- a/kregexpeditor/limitedcharlineedit.h +++ b/kregexpeditor/limitedcharlineedit.h @@ -18,10 +18,10 @@ #ifndef __limitedcharlineedit #define __limitedcharlineedit -#include <qlineedit.h> +#include <tqlineedit.h> /** - QLineEdit which only accepts a prespecified number of character. + TQLineEdit which only accepts a prespecified number of character. @internal */ class LimitedCharLineEdit :public QLineEdit @@ -29,10 +29,10 @@ class LimitedCharLineEdit :public QLineEdit public: enum Mode { NORMAL = 0, HEX = 1, OCT = 2 }; - LimitedCharLineEdit(Mode mode, QWidget* parent, const char *name = 0); + LimitedCharLineEdit(Mode mode, TQWidget* parent, const char *name = 0); protected: - virtual void keyPressEvent ( QKeyEvent * ); + virtual void keyPressEvent ( TQKeyEvent * ); private: Mode _mode; diff --git a/kregexpeditor/lookaheadregexp.cpp b/kregexpeditor/lookaheadregexp.cpp index 7415ca4..899dcfc 100644 --- a/kregexpeditor/lookaheadregexp.cpp +++ b/kregexpeditor/lookaheadregexp.cpp @@ -34,19 +34,19 @@ bool LookAheadRegExp::check( ErrorMap& map, bool , bool last ) } -QDomNode LookAheadRegExp::toXml( QDomDocument* doc ) const +TQDomNode LookAheadRegExp::toXml( TQDomDocument* doc ) const { - QDomElement top; + TQDomElement top; if ( _tp == POSITIVE ) - top = doc->createElement( QString::fromLocal8Bit("PositiveLookAhead") ); + top = doc->createElement( TQString::fromLocal8Bit("PositiveLookAhead") ); else - top = doc->createElement( QString::fromLocal8Bit("NegativeLookAhead") ); + top = doc->createElement( TQString::fromLocal8Bit("NegativeLookAhead") ); top.appendChild( _child->toXml( doc ) ); return top; } -bool LookAheadRegExp::load( QDomElement top, const QString& version ) +bool LookAheadRegExp::load( TQDomElement top, const TQString& version ) { _child = readRegExp( top, version ); if ( _child ) { diff --git a/kregexpeditor/lookaheadregexp.h b/kregexpeditor/lookaheadregexp.h index 9021710..f2c111a 100644 --- a/kregexpeditor/lookaheadregexp.h +++ b/kregexpeditor/lookaheadregexp.h @@ -33,8 +33,8 @@ public: virtual bool check( ErrorMap&, bool first, bool last ); virtual int precedence() const { return 4;} - virtual QDomNode toXml( QDomDocument* doc ) const; - virtual bool load( QDomElement, const QString& version ); + virtual TQDomNode toXml( TQDomDocument* doc ) const; + virtual bool load( TQDomElement, const TQString& version ); RegExp* child() const { return _child; } TYPE lookAheadType() const { return _tp; } virtual RegExpType type() const { return LOOKAHEAD;} diff --git a/kregexpeditor/lookaheadwidget.cpp b/kregexpeditor/lookaheadwidget.cpp index b724a3c..aa9f873 100644 --- a/kregexpeditor/lookaheadwidget.cpp +++ b/kregexpeditor/lookaheadwidget.cpp @@ -26,9 +26,9 @@ #include "lookaheadwidget.h" #include "lookaheadregexp.h" #include "concwidget.h" -#include <qpainter.h> +#include <tqpainter.h> -LookAheadWidget::LookAheadWidget( RegExpEditorWindow* editorWindow, RegExpType tp, QWidget* parent, const char* name ) +LookAheadWidget::LookAheadWidget( RegExpEditorWindow* editorWindow, RegExpType tp, TQWidget* parent, const char* name ) :SingleContainerWidget(editorWindow, parent, name ? name : "LookAheadWidget" ), _tp(tp) { _child = new ConcWidget( editorWindow, this ); @@ -36,7 +36,7 @@ LookAheadWidget::LookAheadWidget( RegExpEditorWindow* editorWindow, RegExpType t } LookAheadWidget::LookAheadWidget( LookAheadRegExp* regexp, RegExpEditorWindow* editorWindow, RegExpType tp, - QWidget* parent, const char* name ) + TQWidget* parent, const char* name ) :SingleContainerWidget( editorWindow, parent, name ? name : "LookAheadWidget" ), _tp(tp) { RegExpWidget* child = WidgetFactory::createWidget( regexp->child(), editorWindow, this ); @@ -60,24 +60,24 @@ RegExp* LookAheadWidget::regExp() const _child->regExp() ); } -QSize LookAheadWidget::sizeHint() const +TQSize LookAheadWidget::sizeHint() const { // TODO: Merge with RepeatWidget::sizeHint - QFontMetrics metrics = fontMetrics(); + TQFontMetrics metrics = fontMetrics(); _textSize = metrics.size( 0, _text ); _childSize = _child->sizeHint(); int height = _textSize.height() + bdSize + _childSize.height() + bdSize + 2*pw; int width = 2 * pw + QMAX(_childSize.width(), 4*bdSize + _textSize.width()); - return QSize(width,height); + return TQSize(width,height); } -void LookAheadWidget::paintEvent( QPaintEvent *e ) +void LookAheadWidget::paintEvent( TQPaintEvent *e ) { // TODO: Merge with RepeatWidget::paintEvent - QSize mySize = sizeHint(); - QPainter painter(this); + TQSize mySize = sizeHint(); + TQPainter painter(this); drawPossibleSelection( painter, mySize ); @@ -104,7 +104,7 @@ void LookAheadWidget::paintEvent( QPaintEvent *e ) SingleContainerWidget::paintEvent(e); } -RegExpWidget* LookAheadWidget::findWidgetToEdit( QPoint globalPos ) +RegExpWidget* LookAheadWidget::findWidgetToEdit( TQPoint globalPos ) { return _child->findWidgetToEdit( globalPos ); } diff --git a/kregexpeditor/lookaheadwidget.h b/kregexpeditor/lookaheadwidget.h index 5e244b8..022e419 100644 --- a/kregexpeditor/lookaheadwidget.h +++ b/kregexpeditor/lookaheadwidget.h @@ -25,27 +25,27 @@ class LookAheadWidget :public SingleContainerWidget { Q_OBJECT public: - LookAheadWidget( RegExpEditorWindow* editorWindow, RegExpType tp, QWidget* parent, const char* name = 0 ); + LookAheadWidget( RegExpEditorWindow* editorWindow, RegExpType tp, TQWidget* parent, const char* name = 0 ); LookAheadWidget( LookAheadRegExp* regexp, RegExpEditorWindow* editorWindow, RegExpType tp, - QWidget* parent, const char* name = 0); + TQWidget* parent, const char* name = 0); virtual RegExp* regExp() const; virtual RegExpType type() const { return _tp; } - virtual QSize sizeHint() const; - virtual RegExpWidget* findWidgetToEdit( QPoint globalPos ); + virtual TQSize sizeHint() const; + virtual RegExpWidget* findWidgetToEdit( TQPoint globalPos ); protected: void init(); - virtual void paintEvent( QPaintEvent *e ); + virtual void paintEvent( TQPaintEvent *e ); private: RegExpType _tp; - QString _text; + TQString _text; - mutable QSize _textSize; - mutable QSize _childSize; + mutable TQSize _textSize; + mutable TQSize _childSize; }; #endif // __lookaheadwidget diff --git a/kregexpeditor/main.cpp b/kregexpeditor/main.cpp index bde19e9..04fd3a3 100644 --- a/kregexpeditor/main.cpp +++ b/kregexpeditor/main.cpp @@ -18,7 +18,7 @@ #ifdef QT_ONLY #include "compat.h" - #include <qapplication.h> + #include <tqapplication.h> #else #include <kaboutdata.h> #include <kapplication.h> @@ -28,12 +28,12 @@ #endif #include "kregexpeditorgui.h" -#include <qlayout.h> +#include <tqlayout.h> int main( int argc, char* argv[] ) { #ifdef QT_ONLY - QApplication myapp( argc, argv ); + TQApplication myapp( argc, argv ); #else KAboutData aboutData( "kregexpeditor", I18N_NOOP("RegExp Editor"), "1.0", I18N_NOOP("Editor for Regular Expressions"), @@ -43,14 +43,14 @@ int main( int argc, char* argv[] ) KApplication myapp; #endif - QDialog* top = new QDialog( 0 ); - QVBoxLayout* lay = new QVBoxLayout( top, 6 ); + TQDialog* top = new TQDialog( 0 ); + TQVBoxLayout* lay = new TQVBoxLayout( top, 6 ); - KRegExpEditorGUI* iface = new KRegExpEditorGUI( top, "_editor", QStringList() ); - iface->doSomething( QString::fromLatin1("setAllowNonQtSyntax"), (bool*) true ); + KRegExpEditorGUI* iface = new KRegExpEditorGUI( top, "_editor", TQStringList() ); + iface->doSomething( TQString::fromLatin1("setAllowNonQtSyntax"), (bool*) true ); lay->addWidget( iface ); - QHBoxLayout* lay2 = new QHBoxLayout( lay, 6 ); + TQHBoxLayout* lay2 = new TQHBoxLayout( lay, 6 ); KPushButton* help = new KPushButton( KStdGuiItem::help(), top ); KPushButton* quit = new KPushButton( KStdGuiItem::quit(), top ); @@ -58,11 +58,11 @@ int main( int argc, char* argv[] ) lay2->addStretch(1); lay2->addWidget( quit ); - QObject::connect( help, SIGNAL( clicked() ), iface, SLOT( showHelp() ) ); - QObject::connect( quit, SIGNAL( clicked() ), qApp, SLOT( quit() ) ); + TQObject::connect( help, TQT_SIGNAL( clicked() ), iface, TQT_SLOT( showHelp() ) ); + TQObject::connect( quit, TQT_SIGNAL( clicked() ), qApp, TQT_SLOT( quit() ) ); top->show(); - QObject::connect( qApp, SIGNAL( lastWindowClosed() ), qApp, SLOT( quit() ) ); + TQObject::connect( qApp, TQT_SIGNAL( lastWindowClosed() ), qApp, TQT_SLOT( quit() ) ); myapp.exec(); } diff --git a/kregexpeditor/multicontainerwidget.cpp b/kregexpeditor/multicontainerwidget.cpp index b4ae399..cf4403a 100644 --- a/kregexpeditor/multicontainerwidget.cpp +++ b/kregexpeditor/multicontainerwidget.cpp @@ -19,14 +19,14 @@ #include "dragaccepter.h" MultiContainerWidget::MultiContainerWidget( RegExpEditorWindow* editorWindow, - QWidget* parent, const char* name) + TQWidget* parent, const char* name) :RegExpWidget( editorWindow, parent, name ) { } void MultiContainerWidget::append( RegExpWidget* child ) { - child->reparent( this, QPoint(0,0), false ); + child->reparent( this, TQPoint(0,0), false ); _children.append( child ); _children.append( new DragAccepter( _editorWindow, this ) ); } @@ -36,7 +36,7 @@ bool MultiContainerWidget::hasSelection() const if ( _isSelected ) return true; - QPtrListIterator<RegExpWidget> it(_children); + TQPtrListIterator<RegExpWidget> it(_children); ++it; // Move past the first dragAccepter for ( ; *it; it += 2 ) { if ( (*it)->hasSelection() ) { @@ -107,8 +107,8 @@ bool MultiContainerWidget::updateSelection(bool parentSelected) { bool changed = false; bool isSel = _isSelected; - QMemArray<bool> oldState(_children.count()); - QMemArray<bool> newState(_children.count()); + TQMemArray<bool> oldState(_children.count()); + TQMemArray<bool> newState(_children.count()); for (int i = 0; i< (int)_children.count();i++) { oldState[i] = _children.at(i)->isSelected(); @@ -177,21 +177,21 @@ bool MultiContainerWidget::updateSelection(bool parentSelected) -QRect MultiContainerWidget::selectionRect() const +TQRect MultiContainerWidget::selectionRect() const { if ( _isSelected ) - return QRect( mapToGlobal( QPoint(0,0) ), size() ); + return TQRect( mapToGlobal( TQPoint(0,0) ), size() ); else { - QRect res; - QPtrListIterator<RegExpWidget> it(_children); + TQRect res; + TQPtrListIterator<RegExpWidget> it(_children); ++it; // Move past the first dragAccepter for ( ; *it; it +=2 ) { if ( (*it)->hasSelection() ) { - QRect childSel = (*it)->selectionRect(); + TQRect childSel = (*it)->selectionRect(); if ( res.isNull() ) res = childSel; else { - QRect newRes; + TQRect newRes; newRes.setLeft( QMIN( res.left(), childSel.left() ) ); newRes.setTop( QMIN( res.top(), childSel.top() ) ); newRes.setRight( QMAX( res.right(), childSel.right() ) ); @@ -204,7 +204,7 @@ QRect MultiContainerWidget::selectionRect() const } } -RegExpWidget* MultiContainerWidget::widgetUnderPoint( QPoint globalPos, bool justVisibleWidgets ) +RegExpWidget* MultiContainerWidget::widgetUnderPoint( TQPoint globalPos, bool justVisibleWidgets ) { unsigned int start, incr; if ( justVisibleWidgets ) { @@ -228,7 +228,7 @@ RegExpWidget* MultiContainerWidget::widgetUnderPoint( QPoint globalPos, bool jus } } -RegExpWidget* MultiContainerWidget::findWidgetToEdit( QPoint globalPos ) +RegExpWidget* MultiContainerWidget::findWidgetToEdit( TQPoint globalPos ) { for ( unsigned int i = 1; i < _children.count(); i+=2 ) { RegExpWidget* wid = _children.at(i)->findWidgetToEdit( globalPos ); @@ -241,7 +241,7 @@ RegExpWidget* MultiContainerWidget::findWidgetToEdit( QPoint globalPos ) void MultiContainerWidget::selectWidget( bool sel ) { RegExpWidget::selectWidget( sel ); - QPtrListIterator<RegExpWidget> it(_children); + TQPtrListIterator<RegExpWidget> it(_children); for ( ; *it ; ++it ) { (*it)->selectWidget( sel ); } @@ -250,7 +250,7 @@ void MultiContainerWidget::selectWidget( bool sel ) void MultiContainerWidget::updateAll() { - for ( QPtrListIterator<RegExpWidget> it(_children); *it ; ++it ) { + for ( TQPtrListIterator<RegExpWidget> it(_children); *it ; ++it ) { (*it)->updateAll(); } RegExpWidget::updateAll(); @@ -258,7 +258,7 @@ void MultiContainerWidget::updateAll() void MultiContainerWidget::updateCursorRecursively() { - for ( QPtrListIterator<RegExpWidget> it(_children); *it ; ++it ) { + for ( TQPtrListIterator<RegExpWidget> it(_children); *it ; ++it ) { (*it)->updateCursorRecursively(); } updateCursorShape(); diff --git a/kregexpeditor/multicontainerwidget.h b/kregexpeditor/multicontainerwidget.h index 3fa4095..4dd6a58 100644 --- a/kregexpeditor/multicontainerwidget.h +++ b/kregexpeditor/multicontainerwidget.h @@ -27,23 +27,23 @@ class MultiContainerWidget :public RegExpWidget { public: - MultiContainerWidget( RegExpEditorWindow* editorWindow, QWidget* parent = 0, + MultiContainerWidget( RegExpEditorWindow* editorWindow, TQWidget* parent = 0, const char* name = 0); virtual bool hasSelection() const; virtual void clearSelection(); virtual void deleteSelection(); virtual void addNewChild(DragAccepter *accepter, RegExpWidget *child); virtual bool updateSelection(bool parentSelected); - virtual QRect selectionRect() const; - virtual RegExpWidget* widgetUnderPoint( QPoint globalPos, bool justVisibleWidgets ); - virtual RegExpWidget* findWidgetToEdit( QPoint globalPos ); + virtual TQRect selectionRect() const; + virtual RegExpWidget* widgetUnderPoint( TQPoint globalPos, bool justVisibleWidgets ); + virtual RegExpWidget* findWidgetToEdit( TQPoint globalPos ); virtual void selectWidget( bool sel ); virtual void updateAll(); virtual void updateCursorRecursively(); protected: void append( RegExpWidget* child ); - QPtrList<RegExpWidget> _children; + TQPtrList<RegExpWidget> _children; }; diff --git a/kregexpeditor/myfontmetrics.cpp b/kregexpeditor/myfontmetrics.cpp index cdf29b2..f405c69 100644 --- a/kregexpeditor/myfontmetrics.cpp +++ b/kregexpeditor/myfontmetrics.cpp @@ -17,15 +17,15 @@ **/ #include "myfontmetrics.h" -QSize HackCalculateFontSize(QFontMetrics fm, QString str ) +TQSize HackCalculateFontSize(TQFontMetrics fm, TQString str ) { - QStringList list = QStringList::split( QString::fromLatin1("\n"), str ); + TQStringList list = TQStringList::split( TQString::fromLatin1("\n"), str ); int maxWidth = 0; int height = 0; - for ( QStringList::Iterator it = list.begin(); it != list.end(); ++it ) { - QSize size = fm.size( 0, *it ); + for ( TQStringList::Iterator it = list.begin(); it != list.end(); ++it ) { + TQSize size = fm.size( 0, *it ); maxWidth = QMAX( maxWidth, size.width() ); height += size.height(); } - return QSize( maxWidth, height ); + return TQSize( maxWidth, height ); } diff --git a/kregexpeditor/myfontmetrics.h b/kregexpeditor/myfontmetrics.h index 649d32b..a8dba88 100644 --- a/kregexpeditor/myfontmetrics.h +++ b/kregexpeditor/myfontmetrics.h @@ -17,11 +17,11 @@ **/ #ifndef __MYFONTMETRICS_H #define __MYFONTMETRICS_H -#include <qfontmetrics.h> -#include <qstringlist.h> +#include <tqfontmetrics.h> +#include <tqstringlist.h> -// QFontMetrics::size is broken, therefore I need this hack until it works in QT3 +// TQFontMetrics::size is broken, therefore I need this hack until it works in QT3 -QSize HackCalculateFontSize(QFontMetrics fm, QString str ); +TQSize HackCalculateFontSize(TQFontMetrics fm, TQString str ); #endif diff --git a/kregexpeditor/positionregexp.cpp b/kregexpeditor/positionregexp.cpp index df5311f..d210f66 100644 --- a/kregexpeditor/positionregexp.cpp +++ b/kregexpeditor/positionregexp.cpp @@ -34,18 +34,18 @@ bool PositionRegExp::check( ErrorMap& map, bool first , bool last ) return true; } -QDomNode PositionRegExp::toXml( QDomDocument* doc ) const +TQDomNode PositionRegExp::toXml( TQDomDocument* doc ) const { switch (_tp) { - case BEGLINE: return doc->createElement(QString::fromLocal8Bit( "BegLine" ) ); - case ENDLINE: return doc->createElement(QString::fromLocal8Bit( "EndLine" ) ); - case WORDBOUNDARY: return doc->createElement(QString::fromLocal8Bit( "WordBoundary" ) ); - case NONWORDBOUNDARY: return doc->createElement(QString::fromLocal8Bit( "NonWordBoundary" ) ); + case BEGLINE: return doc->createElement(TQString::fromLocal8Bit( "BegLine" ) ); + case ENDLINE: return doc->createElement(TQString::fromLocal8Bit( "EndLine" ) ); + case WORDBOUNDARY: return doc->createElement(TQString::fromLocal8Bit( "WordBoundary" ) ); + case NONWORDBOUNDARY: return doc->createElement(TQString::fromLocal8Bit( "NonWordBoundary" ) ); } - return QDomNode(); + return TQDomNode(); } -bool PositionRegExp::load( QDomElement /* top */, const QString& /*version*/ ) +bool PositionRegExp::load( TQDomElement /* top */, const TQString& /*version*/ ) { // Nothing to do. return true; diff --git a/kregexpeditor/positionregexp.h b/kregexpeditor/positionregexp.h index db90f93..6839c79 100644 --- a/kregexpeditor/positionregexp.h +++ b/kregexpeditor/positionregexp.h @@ -34,8 +34,8 @@ public: virtual bool check( ErrorMap&, bool first, bool last ); virtual int precedence() const { return 4;} - virtual QDomNode toXml( QDomDocument* doc ) const; - virtual bool load( QDomElement, const QString& version ); + virtual TQDomNode toXml( TQDomDocument* doc ) const; + virtual bool load( TQDomElement, const TQString& version ); virtual RegExpType type() const { return POSITION ;} private: diff --git a/kregexpeditor/qt-only/compat.cpp b/kregexpeditor/qt-only/compat.cpp index 7dbc7b4..a7a5d12 100644 --- a/kregexpeditor/qt-only/compat.cpp +++ b/kregexpeditor/qt-only/compat.cpp @@ -18,62 +18,62 @@ #include "compat.h" -QString i18n( const QString& a) { - return QObject::tr(a); +TQString i18n( const TQString& a) { + return TQObject::tr(a); } -QString i18n( const QString& a, const QString& b) { - return QObject::tr(b,a); +TQString i18n( const TQString& a, const TQString& b) { + return TQObject::tr(b,a); } -KDialogBase::KDialogBase( int /*dialogFace*/, const QString &caption, int buttonMask, - ButtonCode defaultButton, QWidget *parent, const char *name, +KDialogBase::KDialogBase( int /*dialogFace*/, const TQString &caption, int buttonMask, + ButtonCode defaultButton, TQWidget *parent, const char *name, bool modal ) - :QDialog( parent, name, modal ) + :TQDialog( parent, name, modal ) { init( buttonMask, defaultButton, caption ); } -KDialogBase::KDialogBase( QWidget* parent, const char* name, bool modal, - const QString& caption, int buttonMask ) - : QDialog( parent, name, modal ) +KDialogBase::KDialogBase( TQWidget* parent, const char* name, bool modal, + const TQString& caption, int buttonMask ) + : TQDialog( parent, name, modal ) { init( buttonMask, Ok, caption ); } -void KDialogBase::init( int buttonMask, ButtonCode /*defaultButton*/, const QString& caption ) +void KDialogBase::init( int buttonMask, ButtonCode /*defaultButton*/, const TQString& caption ) { setCaption( caption ); - _layout = new QVBoxLayout( this, 6 ); - QHBoxLayout* buts = new QHBoxLayout( _layout, 6 ); - QPushButton* but; + _layout = new TQVBoxLayout( this, 6 ); + TQHBoxLayout* buts = new TQHBoxLayout( _layout, 6 ); + TQPushButton* but; if ( buttonMask & Help ) { - but = new QPushButton( tr("Help"), this ); + but = new TQPushButton( tr("Help"), this ); buts->addWidget( but ); - connect( but, SIGNAL( clicked() ), this, SIGNAL( helpClicked() ) ); + connect( but, TQT_SIGNAL( clicked() ), this, TQT_SIGNAL( helpClicked() ) ); } buts->addStretch(1); if ( buttonMask & Ok ) { - but = new QPushButton( tr("OK"), this ); + but = new TQPushButton( tr("OK"), this ); buts->addWidget( but ); - connect( but, SIGNAL( clicked() ), this, SLOT( slotOk() ) ); + connect( but, TQT_SIGNAL( clicked() ), this, TQT_SLOT( slotOk() ) ); } if ( buttonMask & Cancel ) { - but = new QPushButton( tr("Cancel"), this ); + but = new TQPushButton( tr("Cancel"), this ); buts->addWidget( but ); - connect( but, SIGNAL( clicked() ), this, SLOT( slotCancel() ) ); + connect( but, TQT_SIGNAL( clicked() ), this, TQT_SLOT( slotCancel() ) ); } } -void KDialogBase::setMainWidget( QWidget* top ) +void KDialogBase::setMainWidget( TQWidget* top ) { - top->reparent( this, 0, QPoint(0,0) ); + top->reparent( this, 0, TQPoint(0,0) ); _layout->insertWidget( 0, top ); } -QFrame* KDialogBase::plainPage() +TQFrame* KDialogBase::plainPage() { - QFrame* frame = new QFrame( this ); + TQFrame* frame = new TQFrame( this ); setMainWidget( frame ); return frame; } @@ -92,7 +92,7 @@ void KDialogBase::slotCancel() emit finished(); } -int KMessageBox::warningYesNo(QWidget *parent, const QString &text, const QString &caption ) +int KMessageBox::warningYesNo(TQWidget *parent, const TQString &text, const TQString &caption ) { int code = warning( parent, caption, text, tr("No"), tr("Yes") ); if ( code == 0 ) @@ -101,15 +101,15 @@ int KMessageBox::warningYesNo(QWidget *parent, const QString &text, const QStrin return No; } -int KMessageBox::information( QWidget* parent, const QString& text, const QString& caption, - const QString& /*dontShowAgainName*/ ) +int KMessageBox::information( TQWidget* parent, const TQString& text, const TQString& caption, + const TQString& /*dontShowAgainName*/ ) { - return QMessageBox::information( parent, caption, text ); + return TQMessageBox::information( parent, caption, text ); } -int KMessageBox::sorry( QWidget* parent, const QString& text, const QString& caption ) +int KMessageBox::sorry( TQWidget* parent, const TQString& text, const TQString& caption ) { - return QMessageBox::information( parent, caption, text ); + return TQMessageBox::information( parent, caption, text ); } diff --git a/kregexpeditor/qt-only/compat.h b/kregexpeditor/qt-only/compat.h index edf9ced..5afa317 100644 --- a/kregexpeditor/qt-only/compat.h +++ b/kregexpeditor/qt-only/compat.h @@ -18,15 +18,15 @@ #ifndef COMPAT_H #define COMPAT_H -#include <qobject.h> -#include <qmessagebox.h> -#include <qlayout.h> -#include <qpushbutton.h> -#include <qinputdialog.h> -#include <qframe.h> +#include <tqobject.h> +#include <tqmessagebox.h> +#include <tqlayout.h> +#include <tqpushbutton.h> +#include <tqinputdialog.h> +#include <tqframe.h> -QString i18n( const QString& a); -QString i18n( const QString& a, const QString& b); +TQString i18n( const TQString& a); +TQString i18n( const TQString& a, const TQString& b); #define isatty(x) 0 #define KTextBrowser QTextBrowser @@ -42,18 +42,18 @@ public: enum ButtonCode {Ok = 1, Cancel, Help}; enum DialogType { Plain }; - KDialogBase ( int dialogFace, const QString &caption, int buttonMask, + KDialogBase ( int dialogFace, const TQString &caption, int buttonMask, ButtonCode defaultButton, - QWidget *parent=0, const char *name=0, bool modal=true ); + TQWidget *parent=0, const char *name=0, bool modal=true ); - KDialogBase( QWidget* parent, const char* name = 0, bool modal = true, - const QString& caption = QString::null, + KDialogBase( TQWidget* parent, const char* name = 0, bool modal = true, + const TQString& caption = TQString::null, int buttonMask = 0 ); - void init( int buttonMask, ButtonCode /*defaultButton*/, const QString& caption ); - void setMainWidget( QWidget* top ); - QFrame* plainPage(); - void setHelp( const QString&, const QString& ) {} + void init( int buttonMask, ButtonCode /*defaultButton*/, const TQString& caption ); + void setMainWidget( TQWidget* top ); + TQFrame* plainPage(); + void setHelp( const TQString&, const TQString& ) {} public slots: void slotOk(); @@ -66,7 +66,7 @@ signals: void helpClicked(); private: - QVBoxLayout* _layout; + TQVBoxLayout* _layout; }; class KMessageBox :public QMessageBox @@ -74,11 +74,11 @@ class KMessageBox :public QMessageBox Q_OBJECT public: enum ButtonCode { Ok = 1, Cancel = 2, Yes = 3, No = 4, Continue = 5 }; - static int warningYesNo (QWidget *parent, const QString &text, - const QString &caption = QString::null ); - static int information( QWidget* parent, const QString& text, const QString& caption = QString::null, - const QString& /*dontShowAgainName*/ = QString::null ); - static int sorry( QWidget* parent, const QString& text, const QString& caption = QString::null ); + static int warningYesNo (TQWidget *parent, const TQString &text, + const TQString &caption = TQString::null ); + static int information( TQWidget* parent, const TQString& text, const TQString& caption = TQString::null, + const TQString& /*dontShowAgainName*/ = TQString::null ); + static int sorry( TQWidget* parent, const TQString& text, const TQString& caption = TQString::null ); }; #endif /* COMPAT_H */ diff --git a/kregexpeditor/qtregexpconverter.cpp b/kregexpeditor/qtregexpconverter.cpp index 198d7dd..6098097 100644 --- a/kregexpeditor/qtregexpconverter.cpp +++ b/kregexpeditor/qtregexpconverter.cpp @@ -29,7 +29,7 @@ #include "positionregexp.h" #include "repeatregexp.h" -extern RegExp* parseQtRegExp( QString str, bool *ok ); +extern RegExp* parseQtRegExp( TQString str, bool *ok ); extern RegExp* parseDataQtRegExp(); bool QtRegExpConverter::canParse() @@ -38,24 +38,24 @@ bool QtRegExpConverter::canParse() } -RegExp* QtRegExpConverter::parse( const QString& txt, bool* ok ) +RegExp* QtRegExpConverter::parse( const TQString& txt, bool* ok ) { return parseQtRegExp( txt, ok ); } -QString QtRegExpConverter::toString( AltnRegExp* regexp, bool markSelection ) +TQString QtRegExpConverter::toString( AltnRegExp* regexp, bool markSelection ) { - QString res; + TQString res; bool first = true; RegExpList list = regexp->children(); for ( RegExpListIt it(list); *it; ++it ) { if ( !first ) { - res += QString::fromLatin1( "|" ); + res += TQString::fromLatin1( "|" ); } first = false; if ( markSelection && !regexp->isSelected() && (*it)->isSelected() ) { - res += QString::fromLatin1("(") + toStr( *it, markSelection ) + QString::fromLatin1(")"); + res += TQString::fromLatin1("(") + toStr( *it, markSelection ) + TQString::fromLatin1(")"); } else { res += toStr( *it, markSelection ); @@ -64,53 +64,53 @@ QString QtRegExpConverter::toString( AltnRegExp* regexp, bool markSelection ) return res; } -QString QtRegExpConverter::toString( ConcRegExp* regexp, bool markSelection ) +TQString QtRegExpConverter::toString( ConcRegExp* regexp, bool markSelection ) { - QString res; + TQString res; bool childSelected = false; RegExpList list = regexp->children(); for ( RegExpListIt it(list); *it; ++it ) { - QString startPar = QString::fromLocal8Bit(""); - QString endPar = QString::fromLocal8Bit(""); + TQString startPar = TQString::fromLocal8Bit(""); + TQString endPar = TQString::fromLocal8Bit(""); if ( (*it)->precedence() < regexp->precedence() ) { if ( markSelection ) - startPar = QString::fromLocal8Bit("(?:"); + startPar = TQString::fromLocal8Bit("(?:"); else - startPar = QString::fromLatin1( "(" ); - endPar = QString::fromLatin1( ")" ); + startPar = TQString::fromLatin1( "(" ); + endPar = TQString::fromLatin1( ")" ); } // Note these two have different tests! They are activated in each their iteration of the loop. if ( markSelection && !childSelected && !regexp->isSelected() && (*it)->isSelected() ) { - res += QString::fromLatin1("("); + res += TQString::fromLatin1("("); childSelected = true; } if ( markSelection && childSelected && !regexp->isSelected() && !(*it)->isSelected() ) { - res += QString::fromLatin1(")"); + res += TQString::fromLatin1(")"); childSelected= false; } res += startPar + toStr( *it, markSelection ) + endPar; } if ( markSelection && childSelected && !regexp->isSelected() ) { - res += QString::fromLatin1(")"); + res += TQString::fromLatin1(")"); } return res; } -QString QtRegExpConverter::toString( LookAheadRegExp* regexp, bool markSelection ) +TQString QtRegExpConverter::toString( LookAheadRegExp* regexp, bool markSelection ) { if ( regexp->lookAheadType() == LookAheadRegExp::POSITIVE ) - return QString::fromLatin1( "(?=" ) + toStr( regexp->child(), markSelection ) + QString::fromLocal8Bit( ")" ); + return TQString::fromLatin1( "(?=" ) + toStr( regexp->child(), markSelection ) + TQString::fromLocal8Bit( ")" ); else - return QString::fromLatin1( "(?!" ) + toStr( regexp->child(), markSelection ) + QString::fromLocal8Bit( ")" ); + return TQString::fromLatin1( "(?!" ) + toStr( regexp->child(), markSelection ) + TQString::fromLocal8Bit( ")" ); } -QString QtRegExpConverter::toString( TextRangeRegExp* regexp, bool /*markSelection*/ ) +TQString QtRegExpConverter::toString( TextRangeRegExp* regexp, bool /*markSelection*/ ) { - QString txt; + TQString txt; bool foundCarrot = false; bool foundDash = false; @@ -118,15 +118,15 @@ QString QtRegExpConverter::toString( TextRangeRegExp* regexp, bool /*markSelecti // Now print the rest of the single characters, but keep "^" as the very // last element of the characters. - QStringList chars = regexp->chars(); + TQStringList chars = regexp->chars(); for (unsigned int i = 0; i< chars.count(); i++) { - if ( *chars.at(i) == QChar( ']' ) ) { + if ( *chars.at(i) == TQChar( ']' ) ) { foundParenthesis = true; } - else if ( *chars.at(i) == QChar( '-' ) ) { + else if ( *chars.at(i) == TQChar( '-' ) ) { foundDash = true; } - else if ( *chars.at(i) == QChar( '^' ) ) { + else if ( *chars.at(i) == TQChar( '^' ) ) { foundCarrot = true; } else { @@ -135,9 +135,9 @@ QString QtRegExpConverter::toString( TextRangeRegExp* regexp, bool /*markSelecti } // Now insert the ranges. - QPtrList<StringPair> ranges = regexp->range(); - for ( QPtrListIterator<StringPair> it(ranges); *it; ++it ) { - txt.append((*it)->first()+ QString::fromLatin1("-")+ (*it)->second()); + TQPtrList<StringPair> ranges = regexp->range(); + for ( TQPtrListIterator<StringPair> it(ranges); *it; ++it ) { + txt.append((*it)->first()+ TQString::fromLatin1("-")+ (*it)->second()); } // Ok, its time to build each part of the regexp, here comes the rule: @@ -147,145 +147,145 @@ QString QtRegExpConverter::toString( TextRangeRegExp* regexp, bool /*markSelecti // finally if '^' is one of the characters, then it must not be the first // one! - QString res = QString::fromLatin1("["); + TQString res = TQString::fromLatin1("["); if ( regexp->negate() ) - res.append(QString::fromLatin1("^")); + res.append(TQString::fromLatin1("^")); // a ']' must be the first character in teh range. if ( foundParenthesis ) { - res.append(QString::fromLatin1("]")); + res.append(TQString::fromLatin1("]")); } // a '-' must be the first character ( only coming after a ']') if ( foundDash ) { - res.append(QString::fromLatin1("-")); + res.append(TQString::fromLatin1("-")); } res += txt; // Insert \s,\S,\d,\D,\w, and \W if ( regexp->digit() ) - res += QString::fromLocal8Bit("\\d"); + res += TQString::fromLocal8Bit("\\d"); if ( regexp->nonDigit() ) - res += QString::fromLocal8Bit("\\D"); + res += TQString::fromLocal8Bit("\\D"); if ( regexp->space() ) - res += QString::fromLocal8Bit("\\s"); + res += TQString::fromLocal8Bit("\\s"); if ( regexp->nonSpace() ) - res += QString::fromLocal8Bit("\\S"); + res += TQString::fromLocal8Bit("\\S"); if ( regexp->wordChar() ) - res += QString::fromLocal8Bit("\\w"); + res += TQString::fromLocal8Bit("\\w"); if ( regexp->nonWordChar() ) - res += QString::fromLocal8Bit("\\W"); + res += TQString::fromLocal8Bit("\\W"); if ( foundCarrot ) { - res.append( QChar( '^' ) ); + res.append( TQChar( '^' ) ); } - res.append(QString::fromLatin1("]")); + res.append(TQString::fromLatin1("]")); return res; } -QString QtRegExpConverter::toString( CompoundRegExp* regexp, bool markSelection ) +TQString QtRegExpConverter::toString( CompoundRegExp* regexp, bool markSelection ) { if ( markSelection && !regexp->isSelected() && regexp->child()->isSelected() ) - return QString::fromLatin1( "(" ) + toStr( regexp->child(), markSelection ) + QString::fromLatin1( ")" ); + return TQString::fromLatin1( "(" ) + toStr( regexp->child(), markSelection ) + TQString::fromLatin1( ")" ); else return toStr( regexp->child(), markSelection ); } -QString QtRegExpConverter::toString( DotRegExp* /*regexp*/, bool /*markSelection*/ ) +TQString QtRegExpConverter::toString( DotRegExp* /*regexp*/, bool /*markSelection*/ ) { - return QString::fromLatin1( "." ); + return TQString::fromLatin1( "." ); } -QString QtRegExpConverter::toString( PositionRegExp* regexp, bool /*markSelection*/ ) +TQString QtRegExpConverter::toString( PositionRegExp* regexp, bool /*markSelection*/ ) { switch (regexp->position()) { case PositionRegExp::BEGLINE: - return QString::fromLatin1("^"); + return TQString::fromLatin1("^"); case PositionRegExp::ENDLINE: - return QString::fromLatin1("$"); + return TQString::fromLatin1("$"); case PositionRegExp::WORDBOUNDARY: - return QString::fromLatin1("\\b"); + return TQString::fromLatin1("\\b"); case PositionRegExp::NONWORDBOUNDARY: - return QString::fromLatin1("\\B"); + return TQString::fromLatin1("\\B"); } Q_ASSERT( false ); - return QString::fromLatin1(""); + return TQString::fromLatin1(""); } -QString QtRegExpConverter::toString( RepeatRegExp* regexp, bool markSelection ) +TQString QtRegExpConverter::toString( RepeatRegExp* regexp, bool markSelection ) { RegExp* child = regexp->child(); - QString cText = toStr( child, markSelection ); - QString startPar; - QString endPar; + TQString cText = toStr( child, markSelection ); + TQString startPar; + TQString endPar; if ( markSelection ) { if ( !regexp->isSelected() && child->isSelected()) { - startPar = QString::fromLatin1( "(" ); - endPar = QString::fromLatin1( ")" ); + startPar = TQString::fromLatin1( "(" ); + endPar = TQString::fromLatin1( ")" ); } else if ( child->precedence() < regexp->precedence() ) { - startPar = QString::fromLatin1( "(?:" ); - endPar = QString::fromLatin1( ")" ); + startPar = TQString::fromLatin1( "(?:" ); + endPar = TQString::fromLatin1( ")" ); } } else if ( child->precedence() < regexp->precedence() ) { - startPar = QString::fromLatin1( "(" ); - endPar = QString::fromLatin1( ")" ); + startPar = TQString::fromLatin1( "(" ); + endPar = TQString::fromLatin1( ")" ); } if ( regexp->min() == 0 && regexp->max() == -1) { - return startPar + cText +endPar + QString::fromLocal8Bit("*"); + return startPar + cText +endPar + TQString::fromLocal8Bit("*"); } else if ( regexp->min() == 0 && regexp->max() == 1 ) { - return startPar + cText + endPar + QString::fromLocal8Bit("?"); + return startPar + cText + endPar + TQString::fromLocal8Bit("?"); } else if ( regexp->min() == 1 && regexp->max() == -1 ) { - return startPar + cText + endPar + QString::fromLocal8Bit("+"); + return startPar + cText + endPar + TQString::fromLocal8Bit("+"); } else if ( regexp->max() == -1 ) { - return startPar + cText + endPar + QString::fromLocal8Bit("{") + - QString::number( regexp->min() ) + QString::fromLocal8Bit(",") + - QString::fromLocal8Bit("}"); + return startPar + cText + endPar + TQString::fromLocal8Bit("{") + + TQString::number( regexp->min() ) + TQString::fromLocal8Bit(",") + + TQString::fromLocal8Bit("}"); } else { - return startPar + cText + endPar + QString::fromLocal8Bit("{") + - QString::number( regexp->min() ) + QString::fromLocal8Bit(",") + - QString::number( regexp->max() ) + QString::fromLocal8Bit("}"); + return startPar + cText + endPar + TQString::fromLocal8Bit("{") + + TQString::number( regexp->min() ) + TQString::fromLocal8Bit(",") + + TQString::number( regexp->max() ) + TQString::fromLocal8Bit("}"); } } -QString QtRegExpConverter::toString( TextRegExp* regexp, bool /*markSelection*/ ) +TQString QtRegExpConverter::toString( TextRegExp* regexp, bool /*markSelection*/ ) { - QValueList<QChar> list; - list << QChar('$') - << QChar('^') - << QChar('.') - << QChar('*') - << QChar('+') - << QChar('?') - << QChar('[') - << QChar(']') - << QChar('\\') - << QChar('{') - << QChar('}') - << QChar('(') - << QChar(')') - << QChar('|'); - - QString res = escape( regexp->text(), list, QChar('\\') ); + TQValueList<TQChar> list; + list << TQChar('$') + << TQChar('^') + << TQChar('.') + << TQChar('*') + << TQChar('+') + << TQChar('?') + << TQChar('[') + << TQChar(']') + << TQChar('\\') + << TQChar('{') + << TQChar('}') + << TQChar('(') + << TQChar(')') + << TQChar('|'); + + TQString res = escape( regexp->text(), list, TQChar('\\') ); return res; } -QString QtRegExpConverter::name() +TQString QtRegExpConverter::name() { - return QString::fromLatin1( "Qt" ); + return TQString::fromLatin1( "Qt" ); } int QtRegExpConverter::features() @@ -293,7 +293,7 @@ int QtRegExpConverter::features() return WordBoundary | NonWordBoundary | PosLookAhead | NegLookAhead | CharacterRangeNonItems | ExtRange; } -RegexpHighlighter* QtRegExpConverter::highlighter( QTextEdit* edit ) +RegexpHighlighter* QtRegExpConverter::highlighter( TQTextEdit* edit ) { return new QtRegexpHighlighter( edit ); } diff --git a/kregexpeditor/qtregexpconverter.h b/kregexpeditor/qtregexpconverter.h index 100dcf3..d00120c 100644 --- a/kregexpeditor/qtregexpconverter.h +++ b/kregexpeditor/qtregexpconverter.h @@ -24,19 +24,19 @@ class QtRegExpConverter :public RegExpConverter { public: virtual bool canParse(); - virtual RegExp* parse( const QString&, bool* ok ); - virtual QString name(); + virtual RegExp* parse( const TQString&, bool* ok ); + virtual TQString name(); virtual int features(); - virtual QString toString( AltnRegExp*, bool markSelection ); - virtual QString toString( ConcRegExp*, bool markSelection ); - virtual QString toString( LookAheadRegExp*, bool markSelection ); - virtual QString toString( TextRangeRegExp*, bool markSelection ); - virtual QString toString( CompoundRegExp*, bool markSelection ); - virtual QString toString( DotRegExp*, bool markSelection ); - virtual QString toString( PositionRegExp*, bool markSelection ); - virtual QString toString( RepeatRegExp*, bool markSelection ); - virtual QString toString( TextRegExp*, bool markSelection ); - RegexpHighlighter* highlighter( QTextEdit* edit ); + virtual TQString toString( AltnRegExp*, bool markSelection ); + virtual TQString toString( ConcRegExp*, bool markSelection ); + virtual TQString toString( LookAheadRegExp*, bool markSelection ); + virtual TQString toString( TextRangeRegExp*, bool markSelection ); + virtual TQString toString( CompoundRegExp*, bool markSelection ); + virtual TQString toString( DotRegExp*, bool markSelection ); + virtual TQString toString( PositionRegExp*, bool markSelection ); + virtual TQString toString( RepeatRegExp*, bool markSelection ); + virtual TQString toString( TextRegExp*, bool markSelection ); + RegexpHighlighter* highlighter( TQTextEdit* edit ); }; #endif /* QTREGEXPCONVERTER_H */ diff --git a/kregexpeditor/qtregexphighlighter.cpp b/kregexpeditor/qtregexphighlighter.cpp index 1983b89..fdf3a81 100644 --- a/kregexpeditor/qtregexphighlighter.cpp +++ b/kregexpeditor/qtregexphighlighter.cpp @@ -16,15 +16,15 @@ * Boston, MA 02110-1301, USA. **/ #include "qtregexphighlighter.h" -#include <qregexp.h> -QtRegexpHighlighter::QtRegexpHighlighter( QTextEdit* editor ) +#include <tqregexp.h> +QtRegexpHighlighter::QtRegexpHighlighter( TQTextEdit* editor ) :RegexpHighlighter( editor ), _editor( editor ) { } -int QtRegexpHighlighter::highlightParagraph( const QString & text, int endStateOfLastPara ) +int QtRegexpHighlighter::highlightParagraph( const TQString & text, int endStateOfLastPara ) { - QRegExp regexp( _regexp ); + TQRegExp regexp( _regexp ); regexp.setCaseSensitive( _caseSensitive ); regexp.setMinimal( _minimal ); @@ -35,7 +35,7 @@ int QtRegexpHighlighter::highlightParagraph( const QString & text, int endStateO } // ------------------------------ Process with the regular expression. - QColor colors[] = { Qt::red, Qt::blue }; + TQColor colors[] = { Qt::red, Qt::blue }; int color = endStateOfLastPara; if ( color < 0 || color > 1 ) color = 0; @@ -55,7 +55,7 @@ int QtRegexpHighlighter::highlightParagraph( const QString & text, int endStateO if ( start != index ) setFormat( index, start-index, colors[color] ); - QFont font = _editor->font(); + TQFont font = _editor->font(); font.setUnderline( true ); font.setPointSize( (int) (font.pointSize() * 1.3) ); setFormat( start, length, font, colors[color] ); diff --git a/kregexpeditor/qtregexphighlighter.h b/kregexpeditor/qtregexphighlighter.h index bb57bda..c160ca2 100644 --- a/kregexpeditor/qtregexphighlighter.h +++ b/kregexpeditor/qtregexphighlighter.h @@ -18,16 +18,16 @@ #ifndef QTREGEXPHIGHLIGHTER_H #define QTREGEXPHIGHLIGHTER_H #include "regexphighlighter.h" -#include <qtextedit.h> +#include <tqtextedit.h> class QtRegexpHighlighter :public RegexpHighlighter { public: - QtRegexpHighlighter( QTextEdit* verifier ); - virtual int highlightParagraph ( const QString & text, int endStateOfLastPara ); + QtRegexpHighlighter( TQTextEdit* verifier ); + virtual int highlightParagraph ( const TQString & text, int endStateOfLastPara ); private: - QTextEdit* _editor; + TQTextEdit* _editor; }; #endif /* QTREGEXPHIGHLIGHTER_H */ diff --git a/kregexpeditor/regexp.cpp b/kregexpeditor/regexp.cpp index 31450f1..0b583d7 100644 --- a/kregexpeditor/regexp.cpp +++ b/kregexpeditor/regexp.cpp @@ -28,7 +28,7 @@ RegExp::RegExp( bool selected ) : _parent(0), _destructing( false ), _selected( RegExp::~RegExp() { _destructing = true; - for ( QPtrListIterator<RegExp> it(_children); *it; ++it ) { + for ( TQPtrListIterator<RegExp> it(_children); *it; ++it ) { delete *it; } if ( _parent ) @@ -54,9 +54,9 @@ void RegExp::setParent( RegExp* parent ) _parent = parent; } -RegExp* RegExp::readRegExp( QDomElement top, const QString& version ) +RegExp* RegExp::readRegExp( TQDomElement top, const TQString& version ) { - for ( QDomNode node = top.firstChild(); !node.isNull(); node = node.nextSibling() ) { + for ( TQDomNode node = top.firstChild(); !node.isNull(); node = node.nextSibling() ) { if (!node.isElement() ) continue; // skip past comments RegExp* regexp = WidgetFactory::createRegExp(node.toElement(), version ); @@ -65,17 +65,17 @@ RegExp* RegExp::readRegExp( QDomElement top, const QString& version ) return 0; } -QString RegExp::toXmlString() const +TQString RegExp::toXmlString() const { - QDomDocument doc; - doc.setContent( QString::fromLatin1( "<RegularExpression/>" ) ); - QDomNode top = doc.documentElement(); - top.toElement().setAttribute(QString::fromLocal8Bit("version"), KRegExpEditorGUI::version); + TQDomDocument doc; + doc.setContent( TQString::fromLatin1( "<RegularExpression/>" ) ); + TQDomNode top = doc.documentElement(); + top.toElement().setAttribute(TQString::fromLocal8Bit("version"), KRegExpEditorGUI::version); - QDomNode elm = toXml( &doc ); + TQDomNode elm = toXml( &doc ); top.appendChild( elm ); - QString xmlString = QString::fromLocal8Bit("<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<!DOCTYPE RegularExpression PUBLIC \"-//KDE//KRegexpEditor DTD 1.0//EN\" \"http://www.blackie.dk/kreg.dtd\">\n") + doc.toString(); + TQString xmlString = TQString::fromLocal8Bit("<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<!DOCTYPE RegularExpression PUBLIC \"-//KDE//KRegexpEditor DTD 1.0//EN\" \"http://www.blackie.dk/kreg.dtd\">\n") + doc.toString(); return xmlString; } diff --git a/kregexpeditor/regexp.h b/kregexpeditor/regexp.h index 86bd796..5b2bcae 100644 --- a/kregexpeditor/regexp.h +++ b/kregexpeditor/regexp.h @@ -18,8 +18,8 @@ #ifndef REGEXP_H #define REGEXP_H -#include <qdom.h> -#include <qptrlist.h> +#include <tqdom.h> +#include <tqptrlist.h> class CompoundRegExp; class ErrorMap; @@ -35,9 +35,9 @@ public: virtual ~RegExp(); virtual int precedence() const = 0; - virtual QDomNode toXml( QDomDocument* doc ) const = 0; - virtual bool load( QDomElement, const QString& version ) = 0; - QString toXmlString() const; + virtual TQDomNode toXml( TQDomDocument* doc ) const = 0; + virtual bool load( TQDomElement, const TQString& version ) = 0; + TQString toXmlString() const; void check( ErrorMap& ); virtual bool check( ErrorMap&, bool first, bool last ) = 0; @@ -55,18 +55,18 @@ public: void setSelected( bool b ) { _selected = b; } protected: - RegExp* readRegExp( QDomElement top, const QString& version ); + RegExp* readRegExp( TQDomElement top, const TQString& version ); private: RegExp() {} // disable - QPtrList<RegExp> _children; + TQPtrList<RegExp> _children; RegExp* _parent; bool _destructing; bool _selected; }; -typedef QPtrList<RegExp> RegExpList; -typedef QPtrListIterator<RegExp> RegExpListIt; +typedef TQPtrList<RegExp> RegExpList; +typedef TQPtrListIterator<RegExp> RegExpListIt; #endif // REGEXP_H diff --git a/kregexpeditor/regexpbuttons.cpp b/kregexpeditor/regexpbuttons.cpp index eae7da0..88e581e 100644 --- a/kregexpeditor/regexpbuttons.cpp +++ b/kregexpeditor/regexpbuttons.cpp @@ -27,44 +27,44 @@ #include "regexpbuttons.h" #include "dcbutton.h" -#include <qtooltip.h> -#include <qwhatsthis.h> -#include <qbuttongroup.h> -#include <qlayout.h> -#include <qsignalmapper.h> +#include <tqtooltip.h> +#include <tqwhatsthis.h> +#include <tqbuttongroup.h> +#include <tqlayout.h> +#include <tqsignalmapper.h> #include "regexpconverter.h" -RegExpButtons::RegExpButtons( QWidget *parent, const char *name ) - : QDockWindow( QDockWindow::InDock, parent, name), _keepMode(false) +RegExpButtons::RegExpButtons( TQWidget *parent, const char *name ) + : TQDockWindow( TQDockWindow::InDock, parent, name), _keepMode(false) { - QBoxLayout *layout = boxLayout(); + TQBoxLayout *layout = boxLayout(); - _grp = new QButtonGroup(this); + _grp = new TQButtonGroup(this); _grp->hide(); _grp->setExclusive( true ); - _mapper = new QSignalMapper( this, "RegExpButtons::_mapper" ); - connect( _mapper, SIGNAL( mapped(int) ), this, SIGNAL( clicked(int) ) ); + _mapper = new TQSignalMapper( this, "RegExpButtons::_mapper" ); + connect( _mapper, TQT_SIGNAL( mapped(int) ), this, TQT_SIGNAL( clicked(int) ) ); // The "select" button. - _selectBut = new QToolButton( this); + _selectBut = new TQToolButton( this); #ifdef QT_ONLY - QPixmap pix; + TQPixmap pix; pix.convertFromImage( qembed_findImage( "select" ) ); #else - QPixmap pix = KGlobal::iconLoader()->loadIcon(locate("data", QString::fromLatin1("kregexpeditor/pics/select.png") ), KIcon::Toolbar ); + TQPixmap pix = KGlobal::iconLoader()->loadIcon(locate("data", TQString::fromLatin1("kregexpeditor/pics/select.png") ), KIcon::Toolbar ); #endif _selectBut->setPixmap( pix ); layout->addWidget( _selectBut ); _grp->insert(_selectBut); _selectBut->setToggleButton( true ); - connect( _selectBut, SIGNAL(clicked()), SIGNAL(doSelect())); - connect( _selectBut, SIGNAL(clicked()), this, SLOT(slotSetNonKeepMode()) ); + connect( _selectBut, TQT_SIGNAL(clicked()), TQT_SIGNAL(doSelect())); + connect( _selectBut, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotSetNonKeepMode()) ); - QToolTip::add( _selectBut, i18n("Selection tool")); - QWhatsThis::add( _selectBut, i18n("<qt>This will change the state of the editor to <i>selection state</i>.<p>" + TQToolTip::add( _selectBut, i18n("Selection tool")); + TQWhatsThis::add( _selectBut, i18n("<qt>This will change the state of the editor to <i>selection state</i>.<p>" "In this state you will not be inserting <i>regexp items</i>, but instead select them. " "To select a number of items, press down the left mouse button and drag it over the items.<p>" "When you have selected a number of items, you may use cut/copy/paste. These functions are " @@ -152,28 +152,28 @@ RegExpButtons::RegExpButtons( QWidget *parent, const char *name ) layout->addWidget( _negLookAhead ); } -DoubleClickButton* RegExpButtons::insert(RegExpType tp, const char* name, QString tooltip, QString whatsthis) +DoubleClickButton* RegExpButtons::insert(RegExpType tp, const char* name, TQString tooltip, TQString whatsthis) { #ifdef QT_ONLY - QPixmap pix; - pix.convertFromImage( qembed_findImage( QString::fromLatin1( name ) ) ); + TQPixmap pix; + pix.convertFromImage( qembed_findImage( TQString::fromLatin1( name ) ) ); #else - QPixmap pix = KGlobal::iconLoader()->loadIcon(locate("data", QString::fromLatin1("kregexpeditor/pics/")+QString::fromLatin1(name) + - QString::fromLatin1(".png") ), KIcon::Toolbar ); + TQPixmap pix = KGlobal::iconLoader()->loadIcon(locate("data", TQString::fromLatin1("kregexpeditor/pics/")+TQString::fromLatin1(name) + + TQString::fromLatin1(".png") ), KIcon::Toolbar ); #endif DoubleClickButton* but = new DoubleClickButton( pix, this, "RegExpButtons::but"); _mapper->setMapping( but, tp ); - connect( but, SIGNAL( clicked() ), _mapper, SLOT( map() ) ); - connect( but, SIGNAL( clicked() ), this, SLOT( slotSetNonKeepMode() ) ); - connect( but, SIGNAL( doubleClicked() ), this, SLOT( slotSetKeepMode() ) ); + connect( but, TQT_SIGNAL( clicked() ), _mapper, TQT_SLOT( map() ) ); + connect( but, TQT_SIGNAL( clicked() ), this, TQT_SLOT( slotSetNonKeepMode() ) ); + connect( but, TQT_SIGNAL( doubleClicked() ), this, TQT_SLOT( slotSetKeepMode() ) ); _grp->insert( but ); but->setToggleButton( true ); - QToolTip::add( but, tooltip ); - QWhatsThis::add( but, whatsthis ); + TQToolTip::add( but, tooltip ); + TQWhatsThis::add( but, whatsthis ); return but; } @@ -181,7 +181,7 @@ DoubleClickButton* RegExpButtons::insert(RegExpType tp, const char* name, QStrin void RegExpButtons::slotUnSelect() { if ( _grp->selected() ) { - QToolButton *pb = static_cast<QToolButton*>(_grp->selected()); + TQToolButton *pb = static_cast<TQToolButton*>(_grp->selected()); if (pb) { pb->setOn( false ); } diff --git a/kregexpeditor/regexpbuttons.h b/kregexpeditor/regexpbuttons.h index 5671810..5c81049 100644 --- a/kregexpeditor/regexpbuttons.h +++ b/kregexpeditor/regexpbuttons.h @@ -18,7 +18,7 @@ #ifndef __REGEXPBUTTONS_H #define __REGEXPBUTTONS_H -#include <qdockwindow.h> +#include <tqdockwindow.h> #include "widgetfactory.h" class DoubleClickButton; class QButtonGroup; @@ -31,11 +31,11 @@ class RegExpButtons :public QDockWindow Q_OBJECT public: - RegExpButtons( QWidget *parent, const char *name = 0 ); + RegExpButtons( TQWidget *parent, const char *name = 0 ); void setFeatures( int features ); protected: - DoubleClickButton* insert(RegExpType tp, const char* file, QString tooltip, QString whatsthis); + DoubleClickButton* insert(RegExpType tp, const char* file, TQString tooltip, TQString whatsthis); public slots: void slotSelectNewAction(); @@ -50,13 +50,13 @@ signals: void doSelect(); private: - QButtonGroup* _grp; - QToolButton* _selectBut; - QToolButton* _wordBoundary; - QToolButton* _nonWordBoundary; - QToolButton* _posLookAhead; - QToolButton* _negLookAhead; - QSignalMapper* _mapper; // single click Mapper. + TQButtonGroup* _grp; + TQToolButton* _selectBut; + TQToolButton* _wordBoundary; + TQToolButton* _nonWordBoundary; + TQToolButton* _posLookAhead; + TQToolButton* _negLookAhead; + TQSignalMapper* _mapper; // single click Mapper. /** This variable is true if the use wishes to continue editing in the diff --git a/kregexpeditor/regexpconverter.cpp b/kregexpeditor/regexpconverter.cpp index 2d53e20..2678591 100644 --- a/kregexpeditor/regexpconverter.cpp +++ b/kregexpeditor/regexpconverter.cpp @@ -27,11 +27,11 @@ #include "positionregexp.h" #include "repeatregexp.h" #include "textregexp.h" -#include <qtextedit.h> +#include <tqtextedit.h> #include "regexphighlighter.h" RegExpConverter* RegExpConverter::_current = 0; -RegExp* RegExpConverter::parse( const QString&, bool* ok ) +RegExp* RegExpConverter::parse( const TQString&, bool* ok ) { ok = false; return new DotRegExp( false ); // This method should never be called. @@ -39,7 +39,7 @@ RegExp* RegExpConverter::parse( const QString&, bool* ok ) // This function needs to be called toStr rather than toString, as it is not possible to // over load function across inheritance! -QString RegExpConverter::toStr( RegExp* regexp, bool markSelection ) +TQString RegExpConverter::toStr( RegExp* regexp, bool markSelection ) { switch (regexp->type()) { case RegExp::CONC: return toString( static_cast<ConcRegExp*>( regexp ), markSelection); @@ -53,13 +53,13 @@ QString RegExpConverter::toStr( RegExp* regexp, bool markSelection ) case RegExp::TEXTRANGE: return toString( static_cast<TextRangeRegExp*>( regexp ), markSelection ); } qWarning("We shouldn't get here!"); - return QString::fromLatin1( "" ); + return TQString::fromLatin1( "" ); } -QString RegExpConverter::escape( QString text, QValueList<QChar> chars, QChar escapeChar) const +TQString RegExpConverter::escape( TQString text, TQValueList<TQChar> chars, TQChar escapeChar) const { - QString res; + TQString res; for (unsigned int i=0; i<text.length(); i++) { for (unsigned int j=0; j<chars.count(); j++) { if ( text.at(i) == (chars[j]) ) { @@ -74,9 +74,9 @@ QString RegExpConverter::escape( QString text, QValueList<QChar> chars, QChar es } /** - Returns a QSyntaxHighlighter to be used in the virifyer widget. + Returns a TQSyntaxHighlighter to be used in the virifyer widget. */ -RegexpHighlighter* RegExpConverter::highlighter( QTextEdit* ) +RegexpHighlighter* RegExpConverter::highlighter( TQTextEdit* ) { return 0; } diff --git a/kregexpeditor/regexpconverter.h b/kregexpeditor/regexpconverter.h index ddb1e54..cbb3a59 100644 --- a/kregexpeditor/regexpconverter.h +++ b/kregexpeditor/regexpconverter.h @@ -19,8 +19,8 @@ #ifndef REGEXPCONVERTER_H #define REGEXPCONVERTER_H -#include <qstring.h> -#include <qvaluelist.h> +#include <tqstring.h> +#include <tqvaluelist.h> class QTextEdit; class AltnRegExp; @@ -50,26 +50,26 @@ public: }; virtual bool canParse() = 0; - virtual QString name() = 0; + virtual TQString name() = 0; virtual int features() = 0; - virtual RegExp* parse( const QString&, bool* ok ); - QString toStr( RegExp*, bool markSelection ); - virtual RegexpHighlighter* highlighter( QTextEdit* ); + virtual RegExp* parse( const TQString&, bool* ok ); + TQString toStr( RegExp*, bool markSelection ); + virtual RegexpHighlighter* highlighter( TQTextEdit* ); static void setCurrent( RegExpConverter* ); static RegExpConverter* current(); protected: - virtual QString toString( AltnRegExp*, bool markSelection ) = 0; - virtual QString toString( ConcRegExp*, bool markSelection ) = 0; - virtual QString toString( LookAheadRegExp*, bool markSelection ) = 0; - virtual QString toString( TextRangeRegExp*, bool markSelection ) = 0; - virtual QString toString( CompoundRegExp*, bool markSelection ) = 0; - virtual QString toString( DotRegExp*, bool markSelection ) = 0; - virtual QString toString( PositionRegExp*, bool markSelection ) = 0; - virtual QString toString( RepeatRegExp*, bool markSelection ) = 0; - virtual QString toString( TextRegExp*, bool markSelection ) = 0; - QString escape( QString text, QValueList<QChar> chars, QChar escapeChar) const; + virtual TQString toString( AltnRegExp*, bool markSelection ) = 0; + virtual TQString toString( ConcRegExp*, bool markSelection ) = 0; + virtual TQString toString( LookAheadRegExp*, bool markSelection ) = 0; + virtual TQString toString( TextRangeRegExp*, bool markSelection ) = 0; + virtual TQString toString( CompoundRegExp*, bool markSelection ) = 0; + virtual TQString toString( DotRegExp*, bool markSelection ) = 0; + virtual TQString toString( PositionRegExp*, bool markSelection ) = 0; + virtual TQString toString( RepeatRegExp*, bool markSelection ) = 0; + virtual TQString toString( TextRegExp*, bool markSelection ) = 0; + TQString escape( TQString text, TQValueList<TQChar> chars, TQChar escapeChar) const; private: static RegExpConverter* _current; diff --git a/kregexpeditor/regexphighlighter.cpp b/kregexpeditor/regexphighlighter.cpp index 3034ee1..6690b68 100644 --- a/kregexpeditor/regexphighlighter.cpp +++ b/kregexpeditor/regexphighlighter.cpp @@ -18,12 +18,12 @@ #include "regexphighlighter.h" -RegexpHighlighter::RegexpHighlighter( QTextEdit* edit ) - :QSyntaxHighlighter( edit ), _caseSensitive( false ), _minimal( false ) +RegexpHighlighter::RegexpHighlighter( TQTextEdit* edit ) + :TQSyntaxHighlighter( edit ), _caseSensitive( false ), _minimal( false ) { } -void RegexpHighlighter::setRegExp( const QString& regexp ) +void RegexpHighlighter::setRegExp( const TQString& regexp ) { _regexp = regexp; } diff --git a/kregexpeditor/regexphighlighter.h b/kregexpeditor/regexphighlighter.h index 92219b1..9a8003c 100644 --- a/kregexpeditor/regexphighlighter.h +++ b/kregexpeditor/regexphighlighter.h @@ -18,18 +18,18 @@ #ifndef REGEXPHIGHLIGHTER_H #define REGEXPHIGHLIGHTER_H -#include <qsyntaxhighlighter.h> +#include <tqsyntaxhighlighter.h> class RegexpHighlighter :public QSyntaxHighlighter { public: - RegexpHighlighter( QTextEdit* edit ); - void setRegExp( const QString& regexp ); + RegexpHighlighter( TQTextEdit* edit ); + void setRegExp( const TQString& regexp ); void setCaseSensitive( bool ); void setMinimal( bool ); protected: - QString _regexp; + TQString _regexp; bool _caseSensitive, _minimal; }; diff --git a/kregexpeditor/regexpwidget.cpp b/kregexpeditor/regexpwidget.cpp index 2ee2aa7..a64b0c4 100644 --- a/kregexpeditor/regexpwidget.cpp +++ b/kregexpeditor/regexpwidget.cpp @@ -24,8 +24,8 @@ #include "regexpwidget.h" #include <iostream> -#include <qpainter.h> -#include <qcursor.h> +#include <tqpainter.h> +#include <tqcursor.h> #include "concwidget.h" #include "dragaccepter.h" @@ -33,9 +33,9 @@ const int RegExpWidget::pw = 1; const int RegExpWidget::bdSize = 5; const int RegExpWidget::space = 5; -RegExpWidget::RegExpWidget(RegExpEditorWindow* editorWindow, QWidget *parent, +RegExpWidget::RegExpWidget(RegExpEditorWindow* editorWindow, TQWidget *parent, const char *name) - : QWidget(parent, name ? name : "RegExpWidget", WNoMousePropagation ), + : TQWidget(parent, name ? name : "RegExpWidget", WNoMousePropagation ), _editorWindow( editorWindow ), _isSelected( false ), _isToplevel( false ) { } @@ -59,7 +59,7 @@ void RegExpWidget::setConcChild(ConcWidget *) bool RegExpWidget::updateSelection(bool parentSelected) { bool selected = ( parentSelected || - _editorWindow->selectionOverlap( mapToGlobal( QPoint(0,0) ), size() ) ) + _editorWindow->selectionOverlap( mapToGlobal( TQPoint(0,0) ), size() ) ) && !_isToplevel; if ( _isSelected != selected ) { @@ -71,10 +71,10 @@ bool RegExpWidget::updateSelection(bool parentSelected) return false; } -void RegExpWidget::drawPossibleSelection( QPainter& painter, QSize mySize ) +void RegExpWidget::drawPossibleSelection( TQPainter& painter, TQSize mySize ) { if ( _isSelected ) { - painter.fillRect( 0, 0, mySize.width(), mySize.height(), QBrush( gray ) ); + painter.fillRect( 0, 0, mySize.width(), mySize.height(), TQBrush( gray ) ); } } @@ -114,22 +114,22 @@ int RegExpWidget::edit() return 0; // Compiler shut up } -void RegExpWidget::mousePressEvent ( QMouseEvent* event ) +void RegExpWidget::mousePressEvent ( TQMouseEvent* event ) { if ( _editorWindow->isPasteing() || _editorWindow->isInserting() ) return; if ( event->button() == LeftButton ) { - if ( ! _editorWindow->pointSelected( QCursor::pos() ) ) { + if ( ! _editorWindow->pointSelected( TQCursor::pos() ) ) { _editorWindow->clearSelection( true ); if ( dynamic_cast<DragAccepter*>(this) == 0 && dynamic_cast<ConcWidget*>(this) == 0 ) { selectWidget( true ); } } - QMouseEvent ev( event->type(), mapTo(_editorWindow, event->pos()), + TQMouseEvent ev( event->type(), mapTo(_editorWindow, event->pos()), event->button(), event->state()); - QApplication::sendEvent( _editorWindow, &ev ); + TQApplication::sendEvent( _editorWindow, &ev ); } else if ( event->button() == RightButton ) { _editorWindow->showRMBMenu( true ); @@ -139,10 +139,10 @@ void RegExpWidget::mousePressEvent ( QMouseEvent* event ) // and thus sends the event to the parent - given that the following line is in. // It doesn't make any change to leave it out. // 25 Oct. 2001 19:03 -- Jesper K. Pedersen - // QWidget::mousePressEvent( event ); + // TQWidget::mousePressEvent( event ); } -void RegExpWidget::mouseReleaseEvent( QMouseEvent* ) +void RegExpWidget::mouseReleaseEvent( TQMouseEvent* ) { if ( _editorWindow->isInserting() && acceptWidgetInsert( _editorWindow->insertType() ) ) { if ( !_editorWindow->hasSelection() ) @@ -156,20 +156,20 @@ void RegExpWidget::mouseReleaseEvent( QMouseEvent* ) } } -QRect RegExpWidget::selectionRect() const +TQRect RegExpWidget::selectionRect() const { - return QRect( mapToGlobal( QPoint(0,0) ), size() ); + return TQRect( mapToGlobal( TQPoint(0,0) ), size() ); } -void RegExpWidget::enterEvent( QEvent * ) +void RegExpWidget::enterEvent( TQEvent * ) { updateCursorShape(); } void RegExpWidget::updateCursorShape() { - QCursor cursor; + TQCursor cursor; if ( _editorWindow->isPasteing() ) { if ( acceptWidgetPaste() ) @@ -205,9 +205,9 @@ bool RegExpWidget::acceptWidgetInsert( RegExpType tp ) const return WidgetFactory::isContainer( tp ); } -RegExpWidget* RegExpWidget::widgetUnderPoint( QPoint globalPos, bool ) +RegExpWidget* RegExpWidget::widgetUnderPoint( TQPoint globalPos, bool ) { - if ( QRect(mapToGlobal( QPoint(0,0) ), size() ).contains( globalPos ) ) + if ( TQRect(mapToGlobal( TQPoint(0,0) ), size() ).contains( globalPos ) ) return this; else return 0; diff --git a/kregexpeditor/regexpwidget.h b/kregexpeditor/regexpwidget.h index e0c038d..b6e44cd 100644 --- a/kregexpeditor/regexpwidget.h +++ b/kregexpeditor/regexpwidget.h @@ -34,7 +34,7 @@ class RegExpWidget :public QWidget Q_OBJECT public: - RegExpWidget(RegExpEditorWindow* editorWindow, QWidget *parent, + RegExpWidget(RegExpEditorWindow* editorWindow, TQWidget *parent, const char *label = 0); /*====================================================================== @@ -123,7 +123,7 @@ public: /** Returns the rectangle which makes up the selection. */ - virtual QRect selectionRect() const; + virtual TQRect selectionRect() const; /** Selects the RegExp widget and all its chidlren*/ virtual void selectWidget( bool sel ); @@ -155,13 +155,13 @@ public: Returns the regexp widget under point. If `justVisibleWidgets' is true, @ref ConcWidget is ignored. That is, a ConcWidget will not be returned. */ - virtual RegExpWidget* widgetUnderPoint( QPoint globalPos, bool justVisibleWidgets ); + virtual RegExpWidget* widgetUnderPoint( TQPoint globalPos, bool justVisibleWidgets ); /** Returns the widget under point which can be edited. That is the "innermost" widget editable. */ - virtual RegExpWidget* findWidgetToEdit( QPoint /* globalPos */) { return 0; } + virtual RegExpWidget* findWidgetToEdit( TQPoint /* globalPos */) { return 0; } /** Edits the current widget. That is, bring up the dialog, which is @@ -172,7 +172,7 @@ public: protected: /** Draws a selection rectangle for the current widget. */ - virtual void drawPossibleSelection( QPainter& painter, QSize mySize); + virtual void drawPossibleSelection( TQPainter& painter, TQSize mySize); /** Returns true if the widget accepts paste actions. */ virtual bool acceptWidgetPaste() const; @@ -182,10 +182,10 @@ protected: */ virtual bool acceptWidgetInsert( RegExpType ) const; - virtual void mousePressEvent ( QMouseEvent* event ); + virtual void mousePressEvent ( TQMouseEvent* event ); - virtual void mouseReleaseEvent( QMouseEvent* ); - virtual void enterEvent( QEvent * ); + virtual void mouseReleaseEvent( TQMouseEvent* ); + virtual void enterEvent( TQEvent * ); RegExpEditorWindow* _editorWindow; diff --git a/kregexpeditor/repeatregexp.cpp b/kregexpeditor/repeatregexp.cpp index d58736c..e037016 100644 --- a/kregexpeditor/repeatregexp.cpp +++ b/kregexpeditor/repeatregexp.cpp @@ -39,26 +39,26 @@ bool RepeatRegExp::check( ErrorMap& map, bool first, bool last ) return ( _lower == 0 ); } -QDomNode RepeatRegExp::toXml( QDomDocument* doc ) const +TQDomNode RepeatRegExp::toXml( TQDomDocument* doc ) const { - QDomElement top = doc->createElement( QString::fromLocal8Bit("Repeat") ); - top.setAttribute( QString::fromLocal8Bit("lower"), _lower ); - top.setAttribute( QString::fromLocal8Bit("upper"), _upper ); + TQDomElement top = doc->createElement( TQString::fromLocal8Bit("Repeat") ); + top.setAttribute( TQString::fromLocal8Bit("lower"), _lower ); + top.setAttribute( TQString::fromLocal8Bit("upper"), _upper ); top.appendChild( _child->toXml( doc ) ); return top; } -bool RepeatRegExp::load( QDomElement top, const QString& version ) +bool RepeatRegExp::load( TQDomElement top, const TQString& version ) { - Q_ASSERT( top.tagName() == QString::fromLocal8Bit( "Repeat" ) ); - QString lower = top.attribute( QString::fromLocal8Bit("lower"), QString::fromLocal8Bit("0") ); - QString upper = top.attribute( QString::fromLocal8Bit("upper"), QString::fromLocal8Bit("0") ); + Q_ASSERT( top.tagName() == TQString::fromLocal8Bit( "Repeat" ) ); + TQString lower = top.attribute( TQString::fromLocal8Bit("lower"), TQString::fromLocal8Bit("0") ); + TQString upper = top.attribute( TQString::fromLocal8Bit("upper"), TQString::fromLocal8Bit("0") ); bool ok; _lower = lower.toInt( &ok ); if ( !ok ) { KMessageBox::sorry( 0, i18n("<p>Value for attribute <b>%1</b> was not an integer for element " "<b>%2</b></p><p>It contained the value <b>%3</b></p>") - .arg(QString::fromLatin1("lower")).arg(QString::fromLatin1("Repeat")).arg(lower), + .arg(TQString::fromLatin1("lower")).arg(TQString::fromLatin1("Repeat")).arg(lower), i18n("Error While Loading From XML File") ) ; _lower = 0; } @@ -66,7 +66,7 @@ bool RepeatRegExp::load( QDomElement top, const QString& version ) if ( !ok ) { KMessageBox::sorry( 0, i18n("<p>Value for attribute <b>%1</b> was not an integer for element " "<b>%2</b></p><p>It contained the value <b>%3</b></p>") - .arg(QString::fromLatin1("upper")).arg(QString::fromLatin1("Repeat")).arg(upper), + .arg(TQString::fromLatin1("upper")).arg(TQString::fromLatin1("Repeat")).arg(upper), i18n("Error While Loading From XML File") ) ; _upper = -1; } diff --git a/kregexpeditor/repeatregexp.h b/kregexpeditor/repeatregexp.h index 21e32cd..e6fd8c8 100644 --- a/kregexpeditor/repeatregexp.h +++ b/kregexpeditor/repeatregexp.h @@ -31,8 +31,8 @@ public: virtual bool check( ErrorMap&, bool first, bool last ); virtual int precedence() const { return 3;} - virtual QDomNode toXml( QDomDocument* doc ) const; - virtual bool load( QDomElement, const QString& version ); + virtual TQDomNode toXml( TQDomDocument* doc ) const; + virtual bool load( TQDomElement, const TQString& version ); int min() const { return _lower; } int max() const { return _upper; } RegExp* child() const { return _child; } diff --git a/kregexpeditor/repeatwidget.cpp b/kregexpeditor/repeatwidget.cpp index 27215e4..80fa2ab 100644 --- a/kregexpeditor/repeatwidget.cpp +++ b/kregexpeditor/repeatwidget.cpp @@ -26,16 +26,16 @@ #include "repeatwidget.h" #include "concwidget.h" #include "repeatregexp.h" -#include <qpainter.h> -#include <qcursor.h> -#include <qspinbox.h> -#include <qradiobutton.h> -#include <qlayout.h> -#include <qgrid.h> -#include <qvbuttongroup.h> +#include <tqpainter.h> +#include <tqcursor.h> +#include <tqspinbox.h> +#include <tqradiobutton.h> +#include <tqlayout.h> +#include <tqgrid.h> +#include <tqvbuttongroup.h> #include "kwidgetstreamer.h" -RepeatWidget::RepeatWidget(RegExpEditorWindow* editorWindow, QWidget *parent, +RepeatWidget::RepeatWidget(RegExpEditorWindow* editorWindow, TQWidget *parent, const char *name) : SingleContainerWidget(editorWindow, parent, name ? name : "RepeatWidget") { @@ -44,7 +44,7 @@ RepeatWidget::RepeatWidget(RegExpEditorWindow* editorWindow, QWidget *parent, } RepeatWidget::RepeatWidget( RepeatRegExp* regexp, RegExpEditorWindow* editorWindow, - QWidget* parent, const char* name ) + TQWidget* parent, const char* name ) :SingleContainerWidget( editorWindow, parent, name ) { init(); @@ -80,36 +80,36 @@ void RepeatWidget::init() KDialogBase::Ok | KDialogBase::Cancel); _content = new RepeatRangeWindow( _configWindow ); _configWindow->setMainWidget( _content ); - connect( _configWindow, SIGNAL( cancelClicked() ), this, SLOT( slotConfigCanceled() ) ); - connect(_configWindow, SIGNAL(finished()), this, SLOT(slotConfigWindowClosed())); + connect( _configWindow, TQT_SIGNAL( cancelClicked() ), this, TQT_SLOT( slotConfigCanceled() ) ); + connect(_configWindow, TQT_SIGNAL(finished()), this, TQT_SLOT(slotConfigWindowClosed())); } -QSize RepeatWidget::sizeHint() const +TQSize RepeatWidget::sizeHint() const { // TODO: Merge with LookAheadWidget::sizeHint - QFontMetrics metrics = fontMetrics(); + TQFontMetrics metrics = fontMetrics(); _textSize = metrics.size( 0, _content->text() ); _childSize = _child->sizeHint(); int height = _textSize.height() + bdSize + _childSize.height() + bdSize + 2*pw; int width = 2 * pw + QMAX(_childSize.width(), 4*bdSize + _textSize.width()); - return QSize(width,height); + return TQSize(width,height); } -void RepeatWidget::paintEvent( QPaintEvent *e ) +void RepeatWidget::paintEvent( TQPaintEvent *e ) { // TODO: Merge with LookAheadWidget::paintEvent - QSize mySize = sizeHint(); - QPainter painter(this); + TQSize mySize = sizeHint(); + TQPainter painter(this); drawPossibleSelection( painter, mySize ); // move the child to its position and resize it. _child->move(pw,_textSize.height()+bdSize); - QSize curChildSize = _child->size(); - QSize newChildSize = QSize(mySize.width() - 2*pw, _childSize.height()); + TQSize curChildSize = _child->size(); + TQSize newChildSize = TQSize(mySize.width() - 2*pw, _childSize.height()); if ( curChildSize != newChildSize ) { _child->resize(newChildSize); // I resized the child, so give it a chance to relect thus. @@ -149,7 +149,7 @@ void RepeatWidget::slotConfigWindowClosed() void RepeatWidget::slotConfigCanceled() { - QDataStream stream( _backup, IO_ReadOnly ); + TQDataStream stream( _backup, IO_ReadOnly ); KWidgetStreamer streamer; streamer.fromStream( stream, _content ); repaint(); @@ -157,9 +157,9 @@ void RepeatWidget::slotConfigCanceled() int RepeatWidget::edit() { - _configWindow->move(QCursor::pos() - QPoint(_configWindow->sizeHint().width()/2, + _configWindow->move(TQCursor::pos() - TQPoint(_configWindow->sizeHint().width()/2, _configWindow->sizeHint().height()/2) ); - QDataStream stream( _backup, IO_WriteOnly ); + TQDataStream stream( _backup, IO_WriteOnly ); KWidgetStreamer streamer; streamer.toStream( _content, stream ); @@ -167,23 +167,23 @@ int RepeatWidget::edit() } //-------------------------------------------------------------------------------- -RepeatRangeWindow::RepeatRangeWindow( QWidget* parent, const char* name ) - : QVBox( parent, name ? name : "RepeatRangeWindow" ) +RepeatRangeWindow::RepeatRangeWindow( TQWidget* parent, const char* name ) + : TQVBox( parent, name ? name : "RepeatRangeWindow" ) { setSpacing( 6 ); - _group = new QVButtonGroup( i18n("Times to Match"), this, "groupbox" ); + _group = new TQVButtonGroup( i18n("Times to Match"), this, "groupbox" ); // Any number of times - QRadioButton* radioBut = new QRadioButton(i18n("Any number of times (including zero times)"), + TQRadioButton* radioBut = new TQRadioButton(i18n("Any number of times (including zero times)"), _group, "RepeatRangeWindow::choice any times"); _group->insert(radioBut, ANY); - QWidget* container = new QWidget( _group ); - QHBoxLayout* lay = new QHBoxLayout( container ); - QGrid* grid = new QGrid( 3, container ); + TQWidget* container = new TQWidget( _group ); + TQHBoxLayout* lay = new TQHBoxLayout( container ); + TQGrid* grid = new TQGrid( 3, container ); grid->setSpacing( 5 ); lay->addWidget( grid ); @@ -194,38 +194,38 @@ RepeatRangeWindow::RepeatRangeWindow( QWidget* parent, const char* name ) createLine( grid, i18n( "Exactly" ), &_exactlyTimes, EXACTLY ); // from ___ to ___ times - radioBut = new QRadioButton(i18n( "From" ), grid, "RepeatRangeWindow::from"); + radioBut = new TQRadioButton(i18n( "From" ), grid, "RepeatRangeWindow::from"); _group->insert( radioBut, MINMAX ); - _rangeFrom = new QSpinBox( 1, 999, 1, grid); + _rangeFrom = new TQSpinBox( 1, 999, 1, grid); - QHBox* box = new QHBox( grid ); + TQHBox* box = new TQHBox( grid ); box->setSpacing( 5 ); - (void) new QLabel(i18n( "to" ), box); - _rangeTo = new QSpinBox( 1, 999, 1, box ); - (void) new QLabel( i18n( "time(s)" ), box ); + (void) new TQLabel(i18n( "to" ), box); + _rangeTo = new TQSpinBox( 1, 999, 1, box ); + (void) new TQLabel( i18n( "time(s)" ), box ); - connect( _rangeFrom, SIGNAL( valueChanged( int ) ), this, SLOT( slotUpdateMaxVal( int ) ) ); - connect( _rangeTo, SIGNAL( valueChanged( int ) ), this, SLOT( slotUpdateMinVal( int ) ) ); + connect( _rangeFrom, TQT_SIGNAL( valueChanged( int ) ), this, TQT_SLOT( slotUpdateMaxVal( int ) ) ); + connect( _rangeTo, TQT_SIGNAL( valueChanged( int ) ), this, TQT_SLOT( slotUpdateMinVal( int ) ) ); // set a default button. _group->setButton(ANY); slotItemChange( ANY ); - connect( _group, SIGNAL( clicked( int ) ), this, SLOT( slotItemChange( int ) ) ); + connect( _group, TQT_SIGNAL( clicked( int ) ), this, TQT_SLOT( slotItemChange( int ) ) ); } -void RepeatRangeWindow::createLine( QWidget* parent, QString text, QSpinBox** spin, REPEATTYPE tp ) +void RepeatRangeWindow::createLine( TQWidget* parent, TQString text, TQSpinBox** spin, REPEATTYPE tp ) { - QRadioButton* radioBut = new QRadioButton(text, parent); - *spin = new QSpinBox( 1, 999, 1, parent); + TQRadioButton* radioBut = new TQRadioButton(text, parent); + *spin = new TQSpinBox( 1, 999, 1, parent); (*spin)->setValue(1); - (void) new QLabel(i18n("time(s)"), parent); + (void) new TQLabel(i18n("time(s)"), parent); _group->insert(radioBut, tp); } @@ -263,7 +263,7 @@ void RepeatRangeWindow::slotUpdateMaxVal( int minVal ) } } -QString RepeatRangeWindow::text() +TQString RepeatRangeWindow::text() { switch ( _group->id(_group->selected()) ) { case ANY: return i18n("Repeated Any Number of Times"); @@ -274,7 +274,7 @@ QString RepeatRangeWindow::text() .arg( _rangeFrom->value() ).arg( _rangeTo->value() ); } qFatal("Fall through!"); - return QString::fromLocal8Bit(""); + return TQString::fromLocal8Bit(""); } int RepeatRangeWindow::min() diff --git a/kregexpeditor/repeatwidget.h b/kregexpeditor/repeatwidget.h index 434b4cb..747ba30 100644 --- a/kregexpeditor/repeatwidget.h +++ b/kregexpeditor/repeatwidget.h @@ -19,7 +19,7 @@ #define __repeatwidget #include "singlecontainerwidget.h" -#include <qvbox.h> +#include <tqvbox.h> class QButtonGroup; class KDialogBase; class QCheckBox; @@ -37,8 +37,8 @@ Q_OBJECT public: enum REPEATTYPE {ANY, ATLEAST, ATMOST, EXACTLY, MINMAX}; - RepeatRangeWindow( QWidget* parent, const char* name = 0 ); - QString text(); + RepeatRangeWindow( TQWidget* parent, const char* name = 0 ); + TQString text(); int min(); int max(); void set( REPEATTYPE tp, int min, int max ); @@ -50,14 +50,14 @@ protected slots: private: - void createLine( QWidget* parent, QString text, QSpinBox** spin, REPEATTYPE tp ); - - QSpinBox* _leastTimes; - QSpinBox* _mostTimes; - QSpinBox* _exactlyTimes; - QSpinBox* _rangeFrom; - QSpinBox* _rangeTo; - QButtonGroup* _group; + void createLine( TQWidget* parent, TQString text, TQSpinBox** spin, REPEATTYPE tp ); + + TQSpinBox* _leastTimes; + TQSpinBox* _mostTimes; + TQSpinBox* _exactlyTimes; + TQSpinBox* _rangeFrom; + TQSpinBox* _rangeTo; + TQButtonGroup* _group; }; @@ -73,18 +73,18 @@ class RepeatWidget :public SingleContainerWidget Q_OBJECT public: - RepeatWidget( RegExpEditorWindow* editorWindow, QWidget *parent, + RepeatWidget( RegExpEditorWindow* editorWindow, TQWidget *parent, const char *name = 0); RepeatWidget( RepeatRegExp* regexp, RegExpEditorWindow* editorWindow, - QWidget* parent, const char* name = 0); + TQWidget* parent, const char* name = 0); void init(); - virtual QSize sizeHint() const; + virtual TQSize sizeHint() const; virtual RegExp* regExp() const; virtual RegExpType type() const { return REPEAT; } virtual int edit(); protected: - virtual void paintEvent( QPaintEvent *e ); + virtual void paintEvent( TQPaintEvent *e ); protected slots: void slotConfigCanceled(); @@ -94,9 +94,9 @@ private: KDialogBase* _configWindow; RepeatRangeWindow* _content; - mutable QSize _textSize; - mutable QSize _childSize; - QByteArray _backup; + mutable TQSize _textSize; + mutable TQSize _childSize; + TQByteArray _backup; }; diff --git a/kregexpeditor/scrollededitorwindow.cpp b/kregexpeditor/scrollededitorwindow.cpp index 8518db9..eddd293 100644 --- a/kregexpeditor/scrollededitorwindow.cpp +++ b/kregexpeditor/scrollededitorwindow.cpp @@ -22,35 +22,35 @@ #include "scrollededitorwindow.h" #include "editorwindow.h" -RegExpScrolledEditorWindow::RegExpScrolledEditorWindow( QWidget* parent, const char* name) - : QWidget(parent, name) +RegExpScrolledEditorWindow::RegExpScrolledEditorWindow( TQWidget* parent, const char* name) + : TQWidget(parent, name) { - _scrollView = new QScrollView( this ); + _scrollView = new TQScrollView( this ); _editorWindow = new RegExpEditorWindow( _scrollView->viewport()); _scrollView->addChild( _editorWindow ); - _scrollView->setResizePolicy( QScrollView::Manual ); + _scrollView->setResizePolicy( TQScrollView::Manual ); - connect( _editorWindow, SIGNAL( contentChanged( QPoint ) ), - this, SLOT( slotUpdateContentSize( QPoint ) ) ); + connect( _editorWindow, TQT_SIGNAL( contentChanged( TQPoint ) ), + this, TQT_SLOT( slotUpdateContentSize( TQPoint ) ) ); - connect( _editorWindow, SIGNAL( scrolling( QPoint ) ), - this, SLOT( slotScroll( QPoint ) ) ); + connect( _editorWindow, TQT_SIGNAL( scrolling( TQPoint ) ), + this, TQT_SLOT( slotScroll( TQPoint ) ) ); - connect( _editorWindow, SIGNAL( doneEditing() ), this, SIGNAL( doneEditing() ) ); + connect( _editorWindow, TQT_SIGNAL( doneEditing() ), this, TQT_SIGNAL( doneEditing() ) ); - connect( _editorWindow, SIGNAL( change() ), this, SIGNAL( change() ) ); - connect( _editorWindow, SIGNAL( savedRegexp() ), this, SIGNAL( savedRegexp() ) ); + connect( _editorWindow, TQT_SIGNAL( change() ), this, TQT_SIGNAL( change() ) ); + connect( _editorWindow, TQT_SIGNAL( savedRegexp() ), this, TQT_SIGNAL( savedRegexp() ) ); - connect( _editorWindow, SIGNAL( anythingSelected(bool) ), this, SIGNAL( anythingSelected(bool) ) ); - connect( _editorWindow, SIGNAL( anythingOnClipboard(bool) ), this, SIGNAL( anythingOnClipboard(bool) ) ); - connect( _editorWindow, SIGNAL( canSave(bool) ), this, SIGNAL( canSave(bool) ) ); - connect( _editorWindow, SIGNAL( verifyRegExp() ), this, SIGNAL( verifyRegExp() ) ); + connect( _editorWindow, TQT_SIGNAL( anythingSelected(bool) ), this, TQT_SIGNAL( anythingSelected(bool) ) ); + connect( _editorWindow, TQT_SIGNAL( anythingOnClipboard(bool) ), this, TQT_SIGNAL( anythingOnClipboard(bool) ) ); + connect( _editorWindow, TQT_SIGNAL( canSave(bool) ), this, TQT_SIGNAL( canSave(bool) ) ); + connect( _editorWindow, TQT_SIGNAL( verifyRegExp() ), this, TQT_SIGNAL( verifyRegExp() ) ); } void RegExpScrolledEditorWindow::slotSetRegExp( RegExp* regexp ) { _editorWindow->slotSetRegExp( regexp ); - slotUpdateContentSize(QPoint()); + slotUpdateContentSize(TQPoint()); } void RegExpScrolledEditorWindow::slotInsertRegExp( int tp) @@ -98,16 +98,16 @@ RegExp* RegExpScrolledEditorWindow::regExp() return _editorWindow->regExp(); } -void RegExpScrolledEditorWindow::resizeEvent( QResizeEvent *event ) +void RegExpScrolledEditorWindow::resizeEvent( TQResizeEvent *event ) { _scrollView->resize( event->size() ); - slotUpdateContentSize(QPoint()); + slotUpdateContentSize(TQPoint()); } -void RegExpScrolledEditorWindow::slotUpdateContentSize( QPoint focusPoint ) +void RegExpScrolledEditorWindow::slotUpdateContentSize( TQPoint focusPoint ) { - QSize childSize = _editorWindow->sizeHint(); - QSize vpSize = _scrollView->viewportSize(10,10); + TQSize childSize = _editorWindow->sizeHint(); + TQSize vpSize = _scrollView->viewportSize(10,10); bool change = false; @@ -136,8 +136,8 @@ void RegExpScrolledEditorWindow::slotUpdateContentSize( QPoint focusPoint ) // TODO: add timers, which will make the widget scroll when mouse is located -// outside the QScrollView. -void RegExpScrolledEditorWindow::slotScroll( QPoint focusPoint ) +// outside the TQScrollView. +void RegExpScrolledEditorWindow::slotScroll( TQPoint focusPoint ) { _scrollView->ensureVisible( focusPoint.x(), focusPoint.y() ); } diff --git a/kregexpeditor/scrollededitorwindow.h b/kregexpeditor/scrollededitorwindow.h index 725b224..a89a588 100644 --- a/kregexpeditor/scrollededitorwindow.h +++ b/kregexpeditor/scrollededitorwindow.h @@ -18,7 +18,7 @@ #ifndef __scrolledEditorWindow #define __scrolledEditorWindow -#include <qhbox.h> +#include <tqhbox.h> class QScrollView; class RegExpEditorWindow; class RegExp; @@ -31,7 +31,7 @@ class RegExpScrolledEditorWindow :public QWidget { Q_OBJECT public: - RegExpScrolledEditorWindow( QWidget *parent = 0, const char* name = 0); + RegExpScrolledEditorWindow( TQWidget *parent = 0, const char* name = 0); RegExp* regExp(); private: @@ -39,7 +39,7 @@ private: protected: - virtual void resizeEvent( QResizeEvent* ); + virtual void resizeEvent( TQResizeEvent* ); public slots: void slotSetRegExp( RegExp* ); @@ -53,8 +53,8 @@ public slots: void slotPaste(); protected slots: - void slotUpdateContentSize( QPoint focusPoint ); - void slotScroll( QPoint focusPoint ); + void slotUpdateContentSize( TQPoint focusPoint ); + void slotScroll( TQPoint focusPoint ); signals: /** @@ -86,7 +86,7 @@ protected slots: private: RegExpEditorWindow* _editorWindow; - QScrollView* _scrollView; + TQScrollView* _scrollView; }; #endif // __scrolledEditorWindow diff --git a/kregexpeditor/selectablelineedit.cpp b/kregexpeditor/selectablelineedit.cpp index 98aff72..3620fc3 100644 --- a/kregexpeditor/selectablelineedit.cpp +++ b/kregexpeditor/selectablelineedit.cpp @@ -22,19 +22,19 @@ #include "selectablelineedit.h" -SelectableLineEdit::SelectableLineEdit( RegExpWidget* owner, QWidget* parent, const char* name) - : QLineEdit( parent, name ), _owner(owner) +SelectableLineEdit::SelectableLineEdit( RegExpWidget* owner, TQWidget* parent, const char* name) + : TQLineEdit( parent, name ), _owner(owner) { - connect( this, SIGNAL( textChanged( const QString & ) ), this, - SLOT( slotKeyPressed() ) ); + connect( this, TQT_SIGNAL( textChanged( const TQString & ) ), this, + TQT_SLOT( slotKeyPressed() ) ); setAcceptDrops( false ); } void SelectableLineEdit::setSelected( bool selected ) { if ( selected ) { - QPalette pal = palette().copy(); - pal.setBrush( QColorGroup::Base, gray ); + TQPalette pal = palette().copy(); + pal.setBrush( TQColorGroup::Base, gray ); setPalette( pal ); } else { @@ -43,27 +43,27 @@ void SelectableLineEdit::setSelected( bool selected ) repaint(); } -QSize SelectableLineEdit::sizeHint() const +TQSize SelectableLineEdit::sizeHint() const { - int frameWidth = frame() ? 8 : 4; // from QLineEdit source - QFontMetrics metrics = fontMetrics(); + int frameWidth = frame() ? 8 : 4; // from TQLineEdit source + TQFontMetrics metrics = fontMetrics(); int actualSize = metrics.width( text() ); int charWidth = metrics.maxWidth(); - int height = QLineEdit::sizeHint().height(); + int height = TQLineEdit::sizeHint().height(); int width; if ( hasFocus() ) width = actualSize+6*charWidth + frameWidth; else width = QMAX(actualSize, charWidth) + frameWidth; - return QSize( width , height ); + return TQSize( width , height ); } void SelectableLineEdit::slotKeyPressed() { - int frameWidth = frame() ? 8 : 4; // from QLineEdit source + int frameWidth = frame() ? 8 : 4; // from TQLineEdit source - QFontMetrics metrics = fontMetrics(); + TQFontMetrics metrics = fontMetrics(); int actualSize = metrics.width( text() ); if ( actualSize > size().width()-frameWidth ) { diff --git a/kregexpeditor/selectablelineedit.h b/kregexpeditor/selectablelineedit.h index 653d85c..dfe356a 100644 --- a/kregexpeditor/selectablelineedit.h +++ b/kregexpeditor/selectablelineedit.h @@ -17,11 +17,11 @@ **/ #ifndef __selectablelineedit #define __selectablelineedit -#include <qlineedit.h> +#include <tqlineedit.h> class RegExpWidget; /** - A specialized QLineEdit for use in @ref TextWidget. + A specialized TQLineEdit for use in @ref TextWidget. This widget has two main features: @li when the @ref TextWidget which contains it is selected, then the @@ -36,9 +36,9 @@ class SelectableLineEdit :public QLineEdit Q_OBJECT public: - SelectableLineEdit( RegExpWidget* owner, QWidget* parent = 0, const char* name = 0); + SelectableLineEdit( RegExpWidget* owner, TQWidget* parent = 0, const char* name = 0); void setSelected( bool selected ); - virtual QSize sizeHint() const; + virtual TQSize sizeHint() const; protected slots: void slotKeyPressed(); diff --git a/kregexpeditor/singlecontainerwidget.cpp b/kregexpeditor/singlecontainerwidget.cpp index 4782dd9..68b5612 100644 --- a/kregexpeditor/singlecontainerwidget.cpp +++ b/kregexpeditor/singlecontainerwidget.cpp @@ -23,7 +23,7 @@ #include "concwidget.h" SingleContainerWidget::SingleContainerWidget(RegExpEditorWindow* editorWindow, - QWidget* parent, const char* name) + TQWidget* parent, const char* name) : RegExpWidget( editorWindow, parent, name ) { } @@ -73,15 +73,15 @@ bool SingleContainerWidget::validateSelection() const return _child->validateSelection(); } -QRect SingleContainerWidget::selectionRect() const +TQRect SingleContainerWidget::selectionRect() const { if ( _isSelected ) - return QRect( mapToGlobal( QPoint(0,0) ), size() ); + return TQRect( mapToGlobal( TQPoint(0,0) ), size() ); else return _child->selectionRect(); } -RegExpWidget* SingleContainerWidget::widgetUnderPoint( QPoint globalPos, bool justVisibleWidgets ) +RegExpWidget* SingleContainerWidget::widgetUnderPoint( TQPoint globalPos, bool justVisibleWidgets ) { RegExpWidget* wid = _child->widgetUnderPoint( globalPos, justVisibleWidgets ); if ( wid ) @@ -93,12 +93,12 @@ RegExpWidget* SingleContainerWidget::widgetUnderPoint( QPoint globalPos, bool ju } } -RegExpWidget* SingleContainerWidget::findWidgetToEdit( QPoint globalPos ) +RegExpWidget* SingleContainerWidget::findWidgetToEdit( TQPoint globalPos ) { RegExpWidget* wid = _child->findWidgetToEdit( globalPos ); if ( wid ) return wid; - else if ( QRect(mapToGlobal(QPoint(0,0)), size()).contains( globalPos ) ) + else if ( TQRect(mapToGlobal(TQPoint(0,0)), size()).contains( globalPos ) ) return this; else return 0; diff --git a/kregexpeditor/singlecontainerwidget.h b/kregexpeditor/singlecontainerwidget.h index 8f07e6a..7578ce4 100644 --- a/kregexpeditor/singlecontainerwidget.h +++ b/kregexpeditor/singlecontainerwidget.h @@ -27,7 +27,7 @@ class SingleContainerWidget :public RegExpWidget Q_OBJECT public: - SingleContainerWidget( RegExpEditorWindow* editorWindow, QWidget* parent, + SingleContainerWidget( RegExpEditorWindow* editorWindow, TQWidget* parent, const char* name = 0); virtual bool updateSelection( bool parentSelected ); @@ -37,9 +37,9 @@ public: virtual void applyRegExpToSelection( RegExpType type ); virtual RegExp* selection() const; virtual bool validateSelection() const; - virtual QRect selectionRect() const; - virtual RegExpWidget* widgetUnderPoint( QPoint globalPos, bool justVisibleWidgets ); - virtual RegExpWidget* findWidgetToEdit( QPoint globalPos ); + virtual TQRect selectionRect() const; + virtual RegExpWidget* widgetUnderPoint( TQPoint globalPos, bool justVisibleWidgets ); + virtual RegExpWidget* findWidgetToEdit( TQPoint globalPos ); virtual void setConcChild( ConcWidget* child ); virtual void selectWidget( bool sel ); virtual void updateAll(); diff --git a/kregexpeditor/test-without-dl/main.cpp b/kregexpeditor/test-without-dl/main.cpp index 54610ac..a66355f 100644 --- a/kregexpeditor/test-without-dl/main.cpp +++ b/kregexpeditor/test-without-dl/main.cpp @@ -17,20 +17,20 @@ **/ #include <kapplication.h> #include <kcmdlineargs.h> -#include <qfile.h> +#include <tqfile.h> #include "../kregexpeditorgui.h" class ShootABug :public QObject { public: - virtual bool eventFilter( QObject* recv, QEvent* event ) + virtual bool eventFilter( TQObject* recv, TQEvent* event ) { - if ( event->type() == QEvent::MouseButtonPress && - dynamic_cast<QMouseEvent*>(event)->state() == Qt::ControlButton ) { + if ( event->type() == TQEvent::MouseButtonPress && + dynamic_cast<TQMouseEvent*>(event)->state() == Qt::ControlButton ) { // Ctrl + left mouse click. qDebug("----------------------------------------------------"); - qDebug((QString("Widget name : ") + QString( recv->name() )).latin1() ); - qDebug((QString("Widget class: ") + QString( recv->className() )).latin1() ); + qDebug((TQString("Widget name : ") + TQString( recv->name() )).latin1() ); + qDebug((TQString("Widget class: ") + TQString( recv->className() )).latin1() ); qDebug("\nObject info:"); recv->dumpObjectInfo(); qDebug("\nObject tree:"); @@ -49,16 +49,16 @@ int main( int argc, char* argv[] ) qApp->installEventFilter( new ShootABug() ); - KRegExpEditorGUIDialog* iface = new KRegExpEditorGUIDialog( 0, "_editor", QStringList() ); - iface->setRegExp( QString::fromLatin1( "#include" ) ); + KRegExpEditorGUIDialog* iface = new KRegExpEditorGUIDialog( 0, "_editor", TQStringList() ); + iface->setRegExp( TQString::fromLatin1( "#include" ) ); iface->doSomething( "setMinimal", (void*) false ); - iface->doSomething( "setSyntax", (void*) new QString( QString::fromLatin1( "Emacs" ) ) ); + iface->doSomething( "setSyntax", (void*) new TQString( TQString::fromLatin1( "Emacs" ) ) ); iface->doSomething( "setShowSyntaxCombo", (bool*) true ); - QFile file("/packages/kde-src/kdeutils/kregexpeditor/test/main.cpp"); + TQFile file("/packages/kde-src/kdeutils/kregexpeditor/test/main.cpp"); file.open(IO_ReadOnly); - QTextStream stream( &file); - QString txt = stream.read(); + TQTextStream stream( &file); + TQString txt = stream.read(); iface->setMatchText( txt ); iface->exec(); diff --git a/kregexpeditor/textrangeregexp.cpp b/kregexpeditor/textrangeregexp.cpp index 73c2923..0f80964 100644 --- a/kregexpeditor/textrangeregexp.cpp +++ b/kregexpeditor/textrangeregexp.cpp @@ -35,12 +35,12 @@ TextRangeRegExp::~TextRangeRegExp() } -void TextRangeRegExp::addCharacter( QString str ) +void TextRangeRegExp::addCharacter( TQString str ) { _chars.append( str ); } -void TextRangeRegExp::addRange(QString from, QString to) +void TextRangeRegExp::addRange(TQString from, TQString to) { _ranges.append( new StringPair( from, to ) ); } @@ -50,80 +50,80 @@ bool TextRangeRegExp::check( ErrorMap&, bool, bool ) return false; } -QDomNode TextRangeRegExp::toXml( QDomDocument* doc ) const +TQDomNode TextRangeRegExp::toXml( TQDomDocument* doc ) const { - QDomElement top = doc->createElement( QString::fromLocal8Bit( "TextRange" ) ); + TQDomElement top = doc->createElement( TQString::fromLocal8Bit( "TextRange" ) ); if ( _negate ) - top.setAttribute( QString::fromLocal8Bit("negate"), true ); + top.setAttribute( TQString::fromLocal8Bit("negate"), true ); if ( _digit ) - top.setAttribute( QString::fromLocal8Bit("digit"), true ); + top.setAttribute( TQString::fromLocal8Bit("digit"), true ); if ( _nonDigit ) - top.setAttribute( QString::fromLocal8Bit("nonDigit"), true ); + top.setAttribute( TQString::fromLocal8Bit("nonDigit"), true ); if ( _space ) - top.setAttribute( QString::fromLocal8Bit("space"), true ); + top.setAttribute( TQString::fromLocal8Bit("space"), true ); if ( _nonSpace ) - top.setAttribute( QString::fromLocal8Bit("nonSpace"), true ); + top.setAttribute( TQString::fromLocal8Bit("nonSpace"), true ); if ( _wordChar ) - top.setAttribute( QString::fromLocal8Bit("wordChar"), true ); + top.setAttribute( TQString::fromLocal8Bit("wordChar"), true ); if ( _nonWordChar ) - top.setAttribute( QString::fromLocal8Bit("nonWordChar"), true ); + top.setAttribute( TQString::fromLocal8Bit("nonWordChar"), true ); - for ( QStringList::ConstIterator it = _chars.begin(); it != _chars.end(); ++it ) { - QDomElement elm = doc->createElement( QString::fromLocal8Bit( "Character" ) ); - elm.setAttribute( QString::fromLocal8Bit( "char" ), *it ); + for ( TQStringList::ConstIterator it = _chars.begin(); it != _chars.end(); ++it ) { + TQDomElement elm = doc->createElement( TQString::fromLocal8Bit( "Character" ) ); + elm.setAttribute( TQString::fromLocal8Bit( "char" ), *it ); top.appendChild( elm ); } - for ( QPtrListIterator<StringPair> it2(_ranges); *it2; ++it2 ) { - QDomElement elm = doc->createElement( QString::fromLocal8Bit( "Range" ) ); - elm.setAttribute( QString::fromLocal8Bit( "from" ), (*it2)->first() ); - elm.setAttribute( QString::fromLocal8Bit( "to" ), (*it2)->second() ); + for ( TQPtrListIterator<StringPair> it2(_ranges); *it2; ++it2 ) { + TQDomElement elm = doc->createElement( TQString::fromLocal8Bit( "Range" ) ); + elm.setAttribute( TQString::fromLocal8Bit( "from" ), (*it2)->first() ); + elm.setAttribute( TQString::fromLocal8Bit( "to" ), (*it2)->second() ); top.appendChild( elm ); } return top; } -bool TextRangeRegExp::load( QDomElement top, const QString& /*version*/ ) +bool TextRangeRegExp::load( TQDomElement top, const TQString& /*version*/ ) { - Q_ASSERT( top.tagName() == QString::fromLocal8Bit( "TextRange" ) ); - QString str; - QString one = QString::fromLocal8Bit("1"); - QString zero = QString::fromLocal8Bit("0"); + Q_ASSERT( top.tagName() == TQString::fromLocal8Bit( "TextRange" ) ); + TQString str; + TQString one = TQString::fromLocal8Bit("1"); + TQString zero = TQString::fromLocal8Bit("0"); - str = top.attribute( QString::fromLocal8Bit("negate"), zero ); + str = top.attribute( TQString::fromLocal8Bit("negate"), zero ); _negate = ( str == one ); - str = top.attribute( QString::fromLocal8Bit("digit"), zero ); + str = top.attribute( TQString::fromLocal8Bit("digit"), zero ); _digit = ( str == one ); - str = top.attribute( QString::fromLocal8Bit("nonDigit"), zero ); + str = top.attribute( TQString::fromLocal8Bit("nonDigit"), zero ); _nonDigit = ( str == one ); - str = top.attribute( QString::fromLocal8Bit("space"), zero ); + str = top.attribute( TQString::fromLocal8Bit("space"), zero ); _space = ( str == one ); - str = top.attribute( QString::fromLocal8Bit("nonSpace"), zero ); + str = top.attribute( TQString::fromLocal8Bit("nonSpace"), zero ); _nonSpace = ( str == one ); - str = top.attribute( QString::fromLocal8Bit("wordChar"), zero ); + str = top.attribute( TQString::fromLocal8Bit("wordChar"), zero ); _wordChar = ( str == one ); - str = top.attribute( QString::fromLocal8Bit("nonWordChar"), zero ); + str = top.attribute( TQString::fromLocal8Bit("nonWordChar"), zero ); _nonWordChar = ( str == one ); - for ( QDomNode node = top.firstChild(); !node.isNull(); node = node.nextSibling() ) { + for ( TQDomNode node = top.firstChild(); !node.isNull(); node = node.nextSibling() ) { if ( !node.isElement() ) continue; // Skip comments. - QDomElement child = node.toElement(); + TQDomElement child = node.toElement(); - if ( child.tagName() == QString::fromLocal8Bit( "Character" ) ) { - QString ch = child.attribute( QString::fromLocal8Bit( "char" ) ); + if ( child.tagName() == TQString::fromLocal8Bit( "Character" ) ) { + TQString ch = child.attribute( TQString::fromLocal8Bit( "char" ) ); addCharacter( ch ); } - else if ( child.tagName() == QString::fromLocal8Bit( "Range" ) ) { - QString from = child.attribute( QString::fromLocal8Bit( "from" ) ); - QString to = child.attribute( QString::fromLocal8Bit( "to" ) ); + else if ( child.tagName() == TQString::fromLocal8Bit( "Range" ) ) { + TQString from = child.attribute( TQString::fromLocal8Bit( "from" ) ); + TQString to = child.attribute( TQString::fromLocal8Bit( "to" ) ); addRange( from, to ); } else { diff --git a/kregexpeditor/textrangeregexp.h b/kregexpeditor/textrangeregexp.h index de1785e..28c3e68 100644 --- a/kregexpeditor/textrangeregexp.h +++ b/kregexpeditor/textrangeregexp.h @@ -20,9 +20,9 @@ #include "regexp.h" #include "pair.h" -#include <qstringlist.h> +#include <tqstringlist.h> -typedef Pair<QString,QString> StringPair; +typedef Pair<TQString,TQString> StringPair; /** Abstract syntax node for `text range' regular expression @@ -35,12 +35,12 @@ public: TextRangeRegExp( bool selected ); virtual ~TextRangeRegExp(); - void addCharacter( QString ch ); - QStringList chars() const { return _chars; } + void addCharacter( TQString ch ); + TQStringList chars() const { return _chars; } void clearChars() { _chars.clear(); } - void addRange( QString from, QString to ); - QPtrList<StringPair> range() const { return _ranges; } + void addRange( TQString from, TQString to ); + TQPtrList<StringPair> range() const { return _ranges; } void clearRange() { _ranges.clear(); } void setNegate( bool set ) { _negate = set; } @@ -61,15 +61,15 @@ public: virtual bool check( ErrorMap&, bool first, bool last ); virtual int precedence() const { return 4;} - virtual QDomNode toXml( QDomDocument* doc ) const; - virtual bool load( QDomElement, const QString& version ); + virtual TQDomNode toXml( TQDomDocument* doc ) const; + virtual bool load( TQDomElement, const TQString& version ); virtual RegExpType type() const { return TEXTRANGE;} virtual bool operator==( const RegExp& other ) const; private: bool _negate, _digit, _nonDigit, _space, _nonSpace, _wordChar, _nonWordChar; - QStringList _chars; - QPtrList<StringPair> _ranges; + TQStringList _chars; + TQPtrList<StringPair> _ranges; }; #endif // __TEXTRANGEREGEXP_H diff --git a/kregexpeditor/textregexp.cpp b/kregexpeditor/textregexp.cpp index 7d5d02c..e9b493f 100644 --- a/kregexpeditor/textregexp.cpp +++ b/kregexpeditor/textregexp.cpp @@ -24,7 +24,7 @@ #include "textregexp.h" -TextRegExp::TextRegExp( bool selected, QString text) :RegExp( selected ) +TextRegExp::TextRegExp( bool selected, TQString text) :RegExp( selected ) { _text = text; } @@ -35,34 +35,34 @@ bool TextRegExp::check( ErrorMap&, bool, bool ) } -void TextRegExp::append( QString str ) +void TextRegExp::append( TQString str ) { _text.append( str ); } -QDomNode TextRegExp::toXml( QDomDocument* doc ) const +TQDomNode TextRegExp::toXml( TQDomDocument* doc ) const { - QDomElement top = doc->createElement(QString::fromLocal8Bit("Text")); - QDomText text = doc->createTextNode( _text ); + TQDomElement top = doc->createElement(TQString::fromLocal8Bit("Text")); + TQDomText text = doc->createTextNode( _text ); top.appendChild( text ); return top; } -bool TextRegExp::load( QDomElement top, const QString& /*version*/) +bool TextRegExp::load( TQDomElement top, const TQString& /*version*/) { - Q_ASSERT( top.tagName() == QString::fromLocal8Bit( "Text" ) ); + Q_ASSERT( top.tagName() == TQString::fromLocal8Bit( "Text" ) ); if ( top.hasChildNodes() ) { - QDomNode child = top.firstChild(); + TQDomNode child = top.firstChild(); if ( ! child.isText() ) { KMessageBox::sorry( 0, i18n("<p>Element <b>Text</b> did not contain any textual data.</p>"), i18n("Error While Loading From XML File") ) ; return false; } - QDomText txtNode = child.toText(); + TQDomText txtNode = child.toText(); _text = txtNode.data(); } else { - _text = QString::fromLatin1( "" ); + _text = TQString::fromLatin1( "" ); } return true; diff --git a/kregexpeditor/textregexp.h b/kregexpeditor/textregexp.h index f98d0e9..1dd222e 100644 --- a/kregexpeditor/textregexp.h +++ b/kregexpeditor/textregexp.h @@ -27,7 +27,7 @@ class TextRegExp :public RegExp { public: - TextRegExp( bool selected, QString text = QString::null); + TextRegExp( bool selected, TQString text = TQString::null); virtual bool check( ErrorMap&, bool first, bool last ); virtual int precedence() const { @@ -36,15 +36,15 @@ public: else return 4; } - QString text() const { return _text; } - virtual QDomNode toXml( QDomDocument* doc ) const; - virtual bool load( QDomElement, const QString& version ); - void append( QString str); + TQString text() const { return _text; } + virtual TQDomNode toXml( TQDomDocument* doc ) const; + virtual bool load( TQDomElement, const TQString& version ); + void append( TQString str); virtual RegExpType type() const { return TEXT;} virtual bool operator==( const RegExp& other ) const; private: - QString _text; + TQString _text; }; #endif // __textregexp_h diff --git a/kregexpeditor/textwidget.cpp b/kregexpeditor/textwidget.cpp index c36d1a8..3ca0d28 100644 --- a/kregexpeditor/textwidget.cpp +++ b/kregexpeditor/textwidget.cpp @@ -22,35 +22,35 @@ #include "textwidget.h" #include "textregexp.h" #include "selectablelineedit.h" -#include <qlayout.h> +#include <tqlayout.h> -TextWidget::TextWidget(RegExpEditorWindow* editorWindow, QWidget *parent, +TextWidget::TextWidget(RegExpEditorWindow* editorWindow, TQWidget *parent, const char *name) :RegExpWidget(editorWindow, parent, name) { - init( QString::fromLocal8Bit("") ); + init( TQString::fromLocal8Bit("") ); } TextWidget::TextWidget( TextRegExp* regexp, RegExpEditorWindow* editorWindow, - QWidget* parent, const char* name ) + TQWidget* parent, const char* name ) : RegExpWidget( editorWindow, parent, name ) { init(regexp->text()); } -void TextWidget::init( const QString& txt ) +void TextWidget::init( const TQString& txt ) { - QHBoxLayout *lay = new QHBoxLayout(this); + TQHBoxLayout *lay = new TQHBoxLayout(this); _edit = new SelectableLineEdit( this, this, "TextWidget::edit" ); - _edit->setDragEnabled( false ); //otherwise QLineEdit::mouseMoveEvent will set the cursor over and over again. + _edit->setDragEnabled( false ); //otherwise TQLineEdit::mouseMoveEvent will set the cursor over and over again. lay->addWidget(_edit); _edit->setText( txt ); - connect( _edit, SIGNAL( parentPleaseUpdate() ), this, SLOT(slotUpdate()) ); + connect( _edit, TQT_SIGNAL( parentPleaseUpdate() ), this, TQT_SLOT(slotUpdate()) ); setFocusProxy( _edit ); _edit->installEventFilter( this ); - connect( _edit, SIGNAL( textChanged( const QString & ) ), _editorWindow, SLOT( emitChange() ) ); + connect( _edit, TQT_SIGNAL( textChanged( const TQString & ) ), _editorWindow, TQT_SLOT( emitChange() ) ); } @@ -60,18 +60,18 @@ void TextWidget::slotUpdate() // widget may not be enough for the parent to change size, and in that // case the parent would not repaint, and the text widget would not be // resized. - QWidget *p = static_cast<QWidget*>(parent()); + TQWidget *p = static_cast<TQWidget*>(parent()); if (p) p->repaint(); _editorWindow->updateContent( this ); } -QSize TextWidget::sizeHint() const +TQSize TextWidget::sizeHint() const { return _edit->sizeHint(); } -void TextWidget::paintEvent( QPaintEvent *e) +void TextWidget::paintEvent( TQPaintEvent *e) { RegExpWidget::paintEvent(e); } @@ -107,32 +107,32 @@ RegExp* TextWidget::regExp() const return new TextRegExp( isSelected(), _edit->text() ); } -bool TextWidget::eventFilter( QObject*, QEvent* event) +bool TextWidget::eventFilter( TQObject*, TQEvent* event) { // This is an event filter (in contrast to methods in SelectableLineEdit), // otherwise lots of functions would need to be exported from TextWidget. - if ( event->type() == QEvent::MouseButtonRelease ) { + if ( event->type() == TQEvent::MouseButtonRelease ) { if ( _editorWindow->isInserting() ) { if ( acceptWidgetInsert( _editorWindow->insertType() ) ) { - mouseReleaseEvent( static_cast<QMouseEvent*>(event) ); + mouseReleaseEvent( static_cast<TQMouseEvent*>(event) ); } return true; } } - else if ( event->type() == QEvent::MouseButtonPress ) { + else if ( event->type() == TQEvent::MouseButtonPress ) { if ( _editorWindow->isInserting() ) { return true; } else if ( isSelected() ) { - QMouseEvent* e = static_cast<QMouseEvent*>( event ); - QMouseEvent ev( event->type(), mapTo(_editorWindow, e->pos()), + TQMouseEvent* e = static_cast<TQMouseEvent*>( event ); + TQMouseEvent ev( event->type(), mapTo(_editorWindow, e->pos()), e->button(), e->state()); - QApplication::sendEvent( _editorWindow, &ev ); + TQApplication::sendEvent( _editorWindow, &ev ); return true; } } - else if ( event->type() == QEvent::Enter ) { + else if ( event->type() == TQEvent::Enter ) { if ( _editorWindow->isInserting() ) { if ( acceptWidgetInsert( _editorWindow->insertType() ) ) { _edit->setCursor(crossCursor); @@ -148,7 +148,7 @@ bool TextWidget::eventFilter( QObject*, QEvent* event) _edit->setCursor( ibeamCursor ); } } - else if ( event->type() == QEvent::MouseButtonDblClick && _editorWindow->isInserting() ) { + else if ( event->type() == TQEvent::MouseButtonDblClick && _editorWindow->isInserting() ) { return true; } return false; diff --git a/kregexpeditor/textwidget.h b/kregexpeditor/textwidget.h index 9a5c0be..054dbd8 100644 --- a/kregexpeditor/textwidget.h +++ b/kregexpeditor/textwidget.h @@ -32,30 +32,30 @@ class TextWidget : public RegExpWidget Q_OBJECT public: - TextWidget(RegExpEditorWindow* editorWindow, QWidget *parent, + TextWidget(RegExpEditorWindow* editorWindow, TQWidget *parent, const char *name = 0); TextWidget( TextRegExp* regexp, RegExpEditorWindow* editorWindow, - QWidget* parent, const char* name = 0); - virtual QSize sizeHint() const; + TQWidget* parent, const char* name = 0); + virtual TQSize sizeHint() const; virtual RegExp* regExp() const; virtual RegExpType type() const { return TEXT; } virtual void updateAll(); virtual void selectWidget( bool ); protected: - void init( const QString& text ); - virtual void paintEvent( QPaintEvent *e ); + void init( const TQString& text ); + virtual void paintEvent( TQPaintEvent *e ); virtual bool updateSelection( bool parentSelected ); virtual void clearSelection(); - virtual bool eventFilter( QObject*, QEvent* ); + virtual bool eventFilter( TQObject*, TQEvent* ); protected slots: void slotUpdate(); private: - QString text; + TQString text; SelectableLineEdit *_edit; - QSize textSize, boxSize, editSize; + TQSize textSize, boxSize, editSize; }; diff --git a/kregexpeditor/userdefinedregexps.cpp b/kregexpeditor/userdefinedregexps.cpp index de2f675..10c97b0 100644 --- a/kregexpeditor/userdefinedregexps.cpp +++ b/kregexpeditor/userdefinedregexps.cpp @@ -27,36 +27,36 @@ #endif #include "userdefinedregexps.h" -#include <qheader.h> -#include <qpopupmenu.h> -#include <qdir.h> +#include <tqheader.h> +#include <tqpopupmenu.h> +#include <tqdir.h> #include "widgetfactory.h" #include "compoundregexp.h" -#include <qlayout.h> -#include <qlabel.h> +#include <tqlayout.h> +#include <tqlabel.h> -UserDefinedRegExps::UserDefinedRegExps( QWidget *parent, const char *name ) - : QDockWindow( QDockWindow::InDock, parent, name) +UserDefinedRegExps::UserDefinedRegExps( TQWidget *parent, const char *name ) + : TQDockWindow( TQDockWindow::InDock, parent, name) { - QWidget* top = new QWidget( this ); - QVBoxLayout* lay = new QVBoxLayout( top, 6 ); + TQWidget* top = new TQWidget( this ); + TQVBoxLayout* lay = new TQVBoxLayout( top, 6 ); lay->setAutoAdd( true ); - QLabel* label = new QLabel( i18n("Compound regular expressions:"), top ); + TQLabel* label = new TQLabel( i18n("Compound regular expressions:"), top ); // This is to avoid that the label set the minimum width for the window. label->setMinimumSize(1,0); - _userDefined = new QListView( top, "UserDefinedRegExps::_userDefined" ); - _userDefined->addColumn( QString::null ); + _userDefined = new TQListView( top, "UserDefinedRegExps::_userDefined" ); + _userDefined->addColumn( TQString::null ); _userDefined->header()->hide(); // _userDefined->setRootIsDecorated( true ); setWidget( top ); slotPopulateUserRegexps(); - connect( _userDefined, SIGNAL(clicked(QListViewItem*)), this, SLOT(slotLoad(QListViewItem*)) ); - connect( _userDefined, SIGNAL(rightButtonPressed(QListViewItem*,const QPoint&, int )), - this, SLOT( slotEdit( QListViewItem*, const QPoint& ) ) ); + connect( _userDefined, TQT_SIGNAL(clicked(TQListViewItem*)), this, TQT_SLOT(slotLoad(TQListViewItem*)) ); + connect( _userDefined, TQT_SIGNAL(rightButtonPressed(TQListViewItem*,const TQPoint&, int )), + this, TQT_SLOT( slotEdit( TQListViewItem*, const TQPoint& ) ) ); } void UserDefinedRegExps::slotPopulateUserRegexps() @@ -67,46 +67,46 @@ void UserDefinedRegExps::slotPopulateUserRegexps() createItems( i18n("User Defined"), WidgetWinItem::path(), true ); #ifdef QT_ONLY - QStringList dirs; - dirs << QString::fromLatin1( "predefined" ); + TQStringList dirs; + dirs << TQString::fromLatin1( "predefined" ); #else - QStringList dirs = KGlobal::dirs()->findDirs( "data", QString::fromLocal8Bit("kregexpeditor/predefined/") ); + TQStringList dirs = KGlobal::dirs()->findDirs( "data", TQString::fromLocal8Bit("kregexpeditor/predefined/") ); #endif - for ( QStringList::iterator it1 = dirs.begin(); it1 != dirs.end(); ++it1 ) { - QDir dir( *it1, QString::null, QDir::Name, QDir::Dirs ); - QStringList subdirs = dir.entryList(); - for ( QStringList::iterator it2 = subdirs.begin(); it2 != subdirs.end(); ++it2 ) { - if ( *it2 == QString::fromLocal8Bit(".") || *it2 == QString::fromLocal8Bit("..") ) + for ( TQStringList::iterator it1 = dirs.begin(); it1 != dirs.end(); ++it1 ) { + TQDir dir( *it1, TQString::null, TQDir::Name, TQDir::Dirs ); + TQStringList subdirs = dir.entryList(); + for ( TQStringList::iterator it2 = subdirs.begin(); it2 != subdirs.end(); ++it2 ) { + if ( *it2 == TQString::fromLocal8Bit(".") || *it2 == TQString::fromLocal8Bit("..") ) continue; - createItems( *it2, *it1 + QString::fromLocal8Bit("/") + *it2, false ); + createItems( *it2, *it1 + TQString::fromLocal8Bit("/") + *it2, false ); } } } -void UserDefinedRegExps::createItems( const QString& _title, const QString& dir, bool usersRegExp ) +void UserDefinedRegExps::createItems( const TQString& _title, const TQString& dir, bool usersRegExp ) { - QString title = _title; - if (_title == QString::fromLatin1("general")) + TQString title = _title; + if (_title == TQString::fromLatin1("general")) title = i18n("General"); - QListViewItem* lvItem = new QListViewItem( _userDefined, title ); + TQListViewItem* lvItem = new TQListViewItem( _userDefined, title ); lvItem->setOpen( true ); - QDir directory( dir ); - QStringList files = directory.entryList( QString::fromLocal8Bit("*.regexp") ); - for ( QStringList::Iterator it = files.begin(); it != files.end(); ++it ) { - QString fileName = dir + QString::fromLocal8Bit("/") + *it; + TQDir directory( dir ); + TQStringList files = directory.entryList( TQString::fromLocal8Bit("*.regexp") ); + for ( TQStringList::Iterator it = files.begin(); it != files.end(); ++it ) { + TQString fileName = dir + TQString::fromLocal8Bit("/") + *it; - QFile file( fileName ); + TQFile file( fileName ); if ( ! file.open(IO_ReadOnly) ) { KMessageBox::sorry( this, i18n("Could not open file for reading: %1").arg(fileName) ); continue; } - QTextStream stream( &file ); - QString data = stream.read(); + TQTextStream stream( &file ); + TQString data = stream.read(); file.close(); RegExp* regexp = WidgetFactory::createRegExp( data ); @@ -126,7 +126,7 @@ void UserDefinedRegExps::createItems( const QString& _title, const QString& dir, } } -const QPtrList<CompoundRegExp> UserDefinedRegExps::regExps() const +const TQPtrList<CompoundRegExp> UserDefinedRegExps::regExps() const { return _regExps; } @@ -137,7 +137,7 @@ void UserDefinedRegExps::slotUnSelect() _userDefined->clearSelection(); } -void UserDefinedRegExps::slotLoad(QListViewItem* item) +void UserDefinedRegExps::slotLoad(TQListViewItem* item) { if ( !item || ! dynamic_cast<WidgetWinItem*>(item) ) { // Mouse pressed outside a widget. @@ -150,9 +150,9 @@ void UserDefinedRegExps::slotLoad(QListViewItem* item) } } -void UserDefinedRegExps::slotEdit( QListViewItem* item, const QPoint& pos ) +void UserDefinedRegExps::slotEdit( TQListViewItem* item, const TQPoint& pos ) { - QPopupMenu* menu = new QPopupMenu( this ); + TQPopupMenu* menu = new TQPopupMenu( this ); menu->insertItem(i18n("Delete"), 1 ); menu->insertItem(i18n("Rename..."), 2 ); if ( !item || ! dynamic_cast<WidgetWinItem*>( item ) ) { @@ -174,7 +174,7 @@ void UserDefinedRegExps::slotEdit( QListViewItem* item, const QPoint& pos ) if ( which == 1 ) { // Delete WidgetWinItem* winItem = dynamic_cast<WidgetWinItem*>( item ); Q_ASSERT( winItem ); - QFile file( winItem->fileName() ); + TQFile file( winItem->fileName() ); Q_ASSERT( file.exists() ); file.remove(); delete item; @@ -183,10 +183,10 @@ void UserDefinedRegExps::slotEdit( QListViewItem* item, const QPoint& pos ) WidgetWinItem* winItem = dynamic_cast<WidgetWinItem*>( item ); Q_ASSERT( winItem ); - QString oldFile = winItem->fileName(); - QString oldName = winItem->name(); + TQString oldFile = winItem->fileName(); + TQString oldName = winItem->name(); - QString txt; + TQString txt; #ifdef QT_ONLY txt = QInputDialog::getText( tr("Rename Regular Expression"), tr("New name:") ); #else @@ -197,10 +197,10 @@ void UserDefinedRegExps::slotEdit( QListViewItem* item, const QPoint& pos ) txt = dlg.text(); #endif if ( !txt.isNull() && oldName != txt ) { - QString fileName = WidgetWinItem::path() + QString::fromLocal8Bit("/") + txt + QString::fromLocal8Bit(".regexp"); - QFileInfo finfo( fileName ); + TQString fileName = WidgetWinItem::path() + TQString::fromLocal8Bit("/") + txt + TQString::fromLocal8Bit(".regexp"); + TQFileInfo finfo( fileName ); if ( finfo.exists() ) { - int answer = KMessageBox::warningYesNo( this, i18n("<p>Overwrite named regular expression <b>%1</b>?</p>").arg(txt), QString::null, i18n("Overwrite"), i18n("Do Not Overwrite") ); + int answer = KMessageBox::warningYesNo( this, i18n("<p>Overwrite named regular expression <b>%1</b>?</p>").arg(txt), TQString::null, i18n("Overwrite"), i18n("Do Not Overwrite") ); if ( answer != KMessageBox::Yes ) return; @@ -209,7 +209,7 @@ void UserDefinedRegExps::slotEdit( QListViewItem* item, const QPoint& pos ) } else winItem->setName( txt ); - QDir dir; + TQDir dir; dir.rename( oldFile, fileName ); } } @@ -223,18 +223,18 @@ void UserDefinedRegExps::slotSelectNewAction() slotUnSelect(); } -WidgetWinItem::WidgetWinItem( QString fileName, RegExp* regexp, bool usersRegExp, QListViewItem* parent ) - :QListViewItem( parent ), _regexp( regexp ), _usersRegExp ( usersRegExp ) +WidgetWinItem::WidgetWinItem( TQString fileName, RegExp* regexp, bool usersRegExp, TQListViewItem* parent ) + :TQListViewItem( parent ), _regexp( regexp ), _usersRegExp ( usersRegExp ) { - int index = fileName.findRev(QString::fromLocal8Bit(".regexp")); + int index = fileName.findRev(TQString::fromLocal8Bit(".regexp")); _name = fileName.left(index); setText( 0, _name ); } -QString WidgetWinItem::fileName() const +TQString WidgetWinItem::fileName() const { - return path() + QString::fromLocal8Bit("/") +_name + QString::fromLocal8Bit(".regexp"); + return path() + TQString::fromLocal8Bit("/") +_name + TQString::fromLocal8Bit(".regexp"); } RegExp* WidgetWinItem::regExp() const @@ -242,23 +242,23 @@ RegExp* WidgetWinItem::regExp() const return _regexp; } -QString WidgetWinItem::name() const +TQString WidgetWinItem::name() const { return _name; } -void WidgetWinItem::setName( const QString& nm ) +void WidgetWinItem::setName( const TQString& nm ) { _name = nm; setText( 0, nm ); } -QString WidgetWinItem::path() +TQString WidgetWinItem::path() { #ifdef QT_ONLY - return QString::fromLatin1( "predefined" ); + return TQString::fromLatin1( "predefined" ); #else - return locateLocal("data", QString::fromLocal8Bit("KRegExpEditor/")); + return locateLocal("data", TQString::fromLocal8Bit("KRegExpEditor/")); #endif } diff --git a/kregexpeditor/userdefinedregexps.h b/kregexpeditor/userdefinedregexps.h index 358aa73..e1fede4 100644 --- a/kregexpeditor/userdefinedregexps.h +++ b/kregexpeditor/userdefinedregexps.h @@ -17,8 +17,8 @@ **/ #ifndef __USERDEFINEDREGEXPS_H #define __USERDEFINEDREGEXPS_H -#include <qdockwindow.h> -#include <qlistview.h> +#include <tqdockwindow.h> +#include <tqlistview.h> #include "compoundregexp.h" @@ -30,43 +30,43 @@ class UserDefinedRegExps :public QDockWindow Q_OBJECT public: - UserDefinedRegExps( QWidget *parent, const char *name = 0 ); - const QPtrList<CompoundRegExp> regExps() const; + UserDefinedRegExps( TQWidget *parent, const char *name = 0 ); + const TQPtrList<CompoundRegExp> regExps() const; public slots: void slotSelectNewAction(); protected slots: - void slotLoad(QListViewItem* item); - void slotEdit( QListViewItem* item, const QPoint& pos ); + void slotLoad(TQListViewItem* item); + void slotEdit( TQListViewItem* item, const TQPoint& pos ); void slotPopulateUserRegexps(); void slotUnSelect(); protected: - void createItems( const QString& title, const QString& dir, bool usersRegExp ); + void createItems( const TQString& title, const TQString& dir, bool usersRegExp ); signals: void load( RegExp* ); private: - QListView* _userDefined; - QPtrList<CompoundRegExp> _regExps; + TQListView* _userDefined; + TQPtrList<CompoundRegExp> _regExps; }; class WidgetWinItem :public QListViewItem { public: - WidgetWinItem( QString name, RegExp* regexp, bool users, QListViewItem* parent ); - static QString path(); + WidgetWinItem( TQString name, RegExp* regexp, bool users, TQListViewItem* parent ); + static TQString path(); - QString fileName() const; + TQString fileName() const; RegExp* regExp() const; - QString name() const; - void setName( const QString& ); + TQString name() const; + void setName( const TQString& ); bool isUsersRegExp() const { return _usersRegExp; } private: - QString _name; + TQString _name; RegExp* _regexp; bool _usersRegExp; }; diff --git a/kregexpeditor/util.cpp b/kregexpeditor/util.cpp index 8bff5de..d770488 100644 --- a/kregexpeditor/util.cpp +++ b/kregexpeditor/util.cpp @@ -19,22 +19,22 @@ #include "util.h" #include <kiconloader.h> #include <kstandarddirs.h> -QPixmap Util::getKRegExpEditorIcon( const QString& name ) +TQPixmap Util::getKRegExpEditorIcon( const TQString& name ) { #ifdef QT_ONLY - QPixmap pix; + TQPixmap pix; pix.convertFromImage( qembed_findImage(name) ); return pix; #else - return KGlobal::iconLoader()->loadIcon(locate("data", QString::fromLatin1("kregexpeditor/pics/") +name ), + return KGlobal::iconLoader()->loadIcon(locate("data", TQString::fromLatin1("kregexpeditor/pics/") +name ), KIcon::Toolbar ); #endif } -QPixmap Util::getSystemIcon( const QString& name ) +TQPixmap Util::getSystemIcon( const TQString& name ) { #ifdef QT_ONLY - QPixmap pix; + TQPixmap pix; pix.convertFromImage( qembed_findImage( name ) ); return pix; #else @@ -44,12 +44,12 @@ QPixmap Util::getSystemIcon( const QString& name ) } -QIconSet Util::getSystemIconSet( const QString& name ) +TQIconSet Util::getSystemIconSet( const TQString& name ) { #ifdef QT_ONLY - QPixmap pix; + TQPixmap pix; pix.convertFromImage( qembed_findImage( name ) ); - return QIconSet( pix ); + return TQIconSet( pix ); #else KIconLoader loader; return loader.loadIconSet( name, KIcon::Toolbar); diff --git a/kregexpeditor/util.h b/kregexpeditor/util.h index a3b406e..27a9dab 100644 --- a/kregexpeditor/util.h +++ b/kregexpeditor/util.h @@ -19,15 +19,15 @@ #ifndef UTIL_H #define UTIL_H -#include <qpixmap.h> -#include <qiconset.h> +#include <tqpixmap.h> +#include <tqiconset.h> class Util { public: - static QPixmap getKRegExpEditorIcon( const QString& name ); - static QPixmap getSystemIcon( const QString& name ); - static QIconSet getSystemIconSet( const QString& name ); + static TQPixmap getKRegExpEditorIcon( const TQString& name ); + static TQPixmap getSystemIcon( const TQString& name ); + static TQIconSet getSystemIconSet( const TQString& name ); }; #endif // UTIL_H diff --git a/kregexpeditor/verifier.cpp b/kregexpeditor/verifier.cpp index 322db12..26c1a21 100644 --- a/kregexpeditor/verifier.cpp +++ b/kregexpeditor/verifier.cpp @@ -24,7 +24,7 @@ #include "verifier.h" -Verifier::Verifier( QWidget* parent, const char* name ) : QTextEdit( parent, name ) +Verifier::Verifier( TQWidget* parent, const char* name ) : TQTextEdit( parent, name ) /* QT_ANCHOR_DO_NOT_WORK: ,_current( 0 ) */ { _highlighter = 0; @@ -34,7 +34,7 @@ Verifier::Verifier( QWidget* parent, const char* name ) : QTextEdit( parent, nam /** Update text edit to show matches of regular expression */ -void Verifier::verify( const QString& reg ) +void Verifier::verify( const TQString& reg ) { if ( _highlighter ) { _highlighter->setRegExp( reg ); @@ -49,7 +49,7 @@ void Verifier::verify( const QString& reg ) void Verifier::clearRegexp() { if ( _highlighter ) { - _highlighter->setRegExp( QString::null ); + _highlighter->setRegExp( TQString::null ); _highlighter->rehighlight(); } } @@ -97,7 +97,7 @@ void Verifier::setMinimal( bool b ) // // void Verifier::gotoNum( int which ) // { -// QString anchor = QString::fromLatin1("match%1").arg(which); +// TQString anchor = TQString::fromLatin1("match%1").arg(which); // scrollToAnchor( anchor ); // _current = which; // emit currentChanged( _current ); diff --git a/kregexpeditor/verifier.h b/kregexpeditor/verifier.h index 661abef..07454ba 100644 --- a/kregexpeditor/verifier.h +++ b/kregexpeditor/verifier.h @@ -17,7 +17,7 @@ **/ #ifndef VERIFIER_H #define VERIFIER_H -#include <qtextedit.h> +#include <tqtextedit.h> #include "regexphighlighter.h" class QTimer; class QProgressDialog; @@ -27,11 +27,11 @@ class Verifier :public QTextEdit { Q_OBJECT public: - Verifier( QWidget* parent, const char* name = 0 ); + Verifier( TQWidget* parent, const char* name = 0 ); void setHighlighter( RegexpHighlighter* ); public slots: - void verify( const QString& regexp ); + void verify( const TQString& regexp ); void clearRegexp(); void setCaseSensitive( bool ); void setMinimal( bool ); diff --git a/kregexpeditor/verifybuttons.cpp b/kregexpeditor/verifybuttons.cpp index cd1b1ef..d7ed66a 100644 --- a/kregexpeditor/verifybuttons.cpp +++ b/kregexpeditor/verifybuttons.cpp @@ -17,7 +17,7 @@ **/ #ifdef QT_ONLY #include "compat.h" -#include <qfiledialog.h> +#include <tqfiledialog.h> #include "images.h" #else #include <klocale.h> @@ -29,72 +29,72 @@ #endif #include "verifybuttons.h" -#include <qtooltip.h> -#include <qlayout.h> -#include <qwhatsthis.h> +#include <tqtooltip.h> +#include <tqlayout.h> +#include <tqwhatsthis.h> #include "qtregexpconverter.h" #include "emacsregexpconverter.h" -#include <qtoolbutton.h> +#include <tqtoolbutton.h> #include "util.h" -#include <qpopupmenu.h> -#include <qaction.h> +#include <tqpopupmenu.h> +#include <tqaction.h> -VerifyButtons::VerifyButtons( QWidget* parent, const char* name ) - :QDockWindow( QDockWindow::InDock, parent, name ), _configMenu( 0 ) +VerifyButtons::VerifyButtons( TQWidget* parent, const char* name ) + :TQDockWindow( TQDockWindow::InDock, parent, name ), _configMenu( 0 ) { - QBoxLayout* layout = boxLayout(); + TQBoxLayout* layout = boxLayout(); - _verify = new QToolButton(this); - QIconSet icon = Util::getSystemIconSet( QString::fromLatin1("spellcheck")); + _verify = new TQToolButton(this); + TQIconSet icon = Util::getSystemIconSet( TQString::fromLatin1("spellcheck")); _verify->setIconSet( icon ); - QToolTip::add( _verify, i18n( "Verify regular expression" ) ); - QWhatsThis::add( _verify, i18n("Shows what part of the regular expression is being matched in the <i>verifier window</i>." + TQToolTip::add( _verify, i18n( "Verify regular expression" ) ); + TQWhatsThis::add( _verify, i18n("Shows what part of the regular expression is being matched in the <i>verifier window</i>." "(The window below the graphical editor window).")); layout->addWidget( _verify ); - connect( _verify, SIGNAL( clicked() ), this, SIGNAL( verify() ) ); + connect( _verify, TQT_SIGNAL( clicked() ), this, TQT_SIGNAL( verify() ) ); - QToolButton* button = new QToolButton(this); - button->setPixmap( Util::getSystemIcon( QString::fromLatin1("fileopen")) ); + TQToolButton* button = new TQToolButton(this); + button->setPixmap( Util::getSystemIcon( TQString::fromLatin1("fileopen")) ); layout->addWidget( button ); - connect(button, SIGNAL(clicked()), this, SLOT(loadText())); - QToolTip::add( button, i18n("Load text in the verifier window") ); + connect(button, TQT_SIGNAL(clicked()), this, TQT_SLOT(loadText())); + TQToolTip::add( button, i18n("Load text in the verifier window") ); - button = new QToolButton(this); - button->setPixmap( Util::getSystemIcon( QString::fromLatin1("package_settings")) ); + button = new TQToolButton(this); + button->setPixmap( Util::getSystemIcon( TQString::fromLatin1("package_settings")) ); layout->addWidget( button ); - connect(button, SIGNAL(clicked()), this, SLOT(configure())); - QToolTip::add( button, i18n("Settings") ); + connect(button, TQT_SIGNAL(clicked()), this, TQT_SLOT(configure())); + TQToolTip::add( button, i18n("Settings") ); // It is currently not possible to ask for the paragraph being highlighted, thefore scrolling to next/prev match // do not work. Enable this when they work. - // _first = new QToolButton( QString::fromLatin1("<<"), this); + // _first = new TQToolButton( TQString::fromLatin1("<<"), this); // layout->addWidget( _first ); - // connect(_first, SIGNAL(clicked()), this, SIGNAL( gotoFirst())); + // connect(_first, TQT_SIGNAL(clicked()), this, TQT_SIGNAL( gotoFirst())); // _first->setFixedWidth( 25 ); // - // _prev = new QToolButton(QString::fromLatin1("<"), this); + // _prev = new TQToolButton(TQString::fromLatin1("<"), this); // layout->addWidget( _prev ); - // connect(_prev, SIGNAL(clicked()), this, SIGNAL( gotoPrev())); + // connect(_prev, TQT_SIGNAL(clicked()), this, TQT_SIGNAL( gotoPrev())); // _prev->setFixedWidth( 20 ); // - // _next = new QToolButton(QString::fromLatin1(">"), this); + // _next = new TQToolButton(TQString::fromLatin1(">"), this); // layout->addWidget( _next ); - // connect(_next, SIGNAL(clicked()), this, SIGNAL( gotoNext())); + // connect(_next, TQT_SIGNAL(clicked()), this, TQT_SIGNAL( gotoNext())); // _next->setFixedWidth( 20 ); // - // _last = new QToolButton(QString::fromLatin1(">>"), this); + // _last = new TQToolButton(TQString::fromLatin1(">>"), this); // layout->addWidget( _last ); - // connect(_last, SIGNAL(clicked()), this, SIGNAL( gotoLast())); + // connect(_last, TQT_SIGNAL(clicked()), this, TQT_SIGNAL( gotoLast())); // _last->setFixedWidth( 25 ); // Same as above -// QLabel* label = new QLabel( i18n("Matches: "), this ); +// TQLabel* label = new TQLabel( i18n("Matches: "), this ); // layout->addWidget( label ); -// _matches = new QLabel(i18n("-"), this ); +// _matches = new TQLabel(i18n("-"), this ); // layout->addWidget( _matches ); -// QString txt = i18n( "Shows number of times regular expression matches the text in the verifier window"); -// QToolTip::add( label, txt ); -// QToolTip::add( _matches, txt ); +// TQString txt = i18n( "Shows number of times regular expression matches the text in the verifier window"); +// TQToolTip::add( label, txt ); +// TQToolTip::add( _matches, txt ); _verify->setEnabled( false ); @@ -102,23 +102,23 @@ VerifyButtons::VerifyButtons( QWidget* parent, const char* name ) // Qt RegExpConverter* converter = new QtRegExpConverter(); - _converters.append( qMakePair( converter, static_cast<QAction*>( 0 ) ) ); - QString qtConverterName = converter->name(); + _converters.append( qMakePair( converter, static_cast<TQAction*>( 0 ) ) ); + TQString qtConverterName = converter->name(); // Emacs converter = new EmacsRegExpConverter(); - _converters.append( qMakePair( converter, static_cast<QAction*>( 0 ) ) ); + _converters.append( qMakePair( converter, static_cast<TQAction*>( 0 ) ) ); // -------------------------------------------------- Initialize the config menu - _configMenu = new QPopupMenu( this, "config menu" ); + _configMenu = new TQPopupMenu( this, "config menu" ); // Auto Verify - QAction* autoVerify = new QAction( i18n("Verify on the Fly"), 0, this ); + TQAction* autoVerify = new TQAction( i18n("Verify on the Fly"), 0, this ); autoVerify->setToggleAction( true ); autoVerify->setOn( true ); - connect( autoVerify, SIGNAL( toggled( bool ) ), this, SLOT( updateVerifyButton( bool ) ) ); - connect( autoVerify, SIGNAL( toggled( bool ) ), this, SIGNAL( autoVerify( bool ) ) ); + connect( autoVerify, TQT_SIGNAL( toggled( bool ) ), this, TQT_SLOT( updateVerifyButton( bool ) ) ); + connect( autoVerify, TQT_SIGNAL( toggled( bool ) ), this, TQT_SIGNAL( autoVerify( bool ) ) ); autoVerify->addTo( _configMenu ); autoVerify->setToolTip( i18n( "Toggle on-the-fly verification of regular expression" ) ); autoVerify->setWhatsThis( i18n( "Enabling this option will make the verifier update for each edit. " @@ -126,19 +126,19 @@ VerifyButtons::VerifyButtons( QWidget* parent, const char* name ) "complex or matches a lot of time, this may be very slow.")); // RegExp Languages - QPopupMenu* languages = new QPopupMenu( _configMenu ); + TQPopupMenu* languages = new TQPopupMenu( _configMenu ); _languageId = _configMenu->insertItem( i18n("RegExp Language"), languages ); - QActionGroup* grp = new QActionGroup( this ); - for( QValueList< QPair<RegExpConverter*,QAction*> >::Iterator it = _converters.begin(); it != _converters.end(); ++it ) { - QString name = (*it).first->name(); - QAction* action = new QAction( name, 0, this ); + TQActionGroup* grp = new TQActionGroup( this ); + for( TQValueList< QPair<RegExpConverter*,TQAction*> >::Iterator it = _converters.begin(); it != _converters.end(); ++it ) { + TQString name = (*it).first->name(); + TQAction* action = new TQAction( name, 0, this ); action->setToggleAction( true ); grp->add( action ); (*it).second = action; } grp->addTo( languages ); - connect( grp, SIGNAL( selected( QAction* ) ), this, SLOT( slotChangeSyntax( QAction* ) ) ); + connect( grp, TQT_SIGNAL( selected( TQAction* ) ), this, TQT_SLOT( slotChangeSyntax( TQAction* ) ) ); _configMenu->setItemEnabled( _languageId, false ); // Select the Qt converter by default @@ -154,7 +154,7 @@ void VerifyButtons::updateVerifyButton( bool b ) void VerifyButtons::loadText() { - QString fileName = KFileDialog::getOpenFileName(QString::null, QString::null, this); + TQString fileName = KFileDialog::getOpenFileName(TQString::null, TQString::null, this); if ( !fileName.isNull() ) { emit loadVerifyText( fileName ); } @@ -179,21 +179,21 @@ void VerifyButtons::setMatchCount( int /*count*/ ) // currently this is not possible due to limitation in QSyntaxHighlighter /* if ( count == -1 ) - _matches->setText( QString::fromLatin1("-") ); + _matches->setText( TQString::fromLatin1("-") ); else - _matches->setText( QString::number( count ) ); + _matches->setText( TQString::number( count ) ); */ } -void VerifyButtons::slotChangeSyntax( QAction* action ) +void VerifyButtons::slotChangeSyntax( TQAction* action ) { emit changeSyntax( action->menuText() ); } -RegExpConverter* VerifyButtons::setSyntax( const QString& which) +RegExpConverter* VerifyButtons::setSyntax( const TQString& which) { - for( QValueList< QPair<RegExpConverter*, QAction*> >::Iterator it = _converters.begin(); it != _converters.end(); ++it ) { - QString name = (*it).first->name(); + for( TQValueList< QPair<RegExpConverter*, TQAction*> >::Iterator it = _converters.begin(); it != _converters.end(); ++it ) { + TQString name = (*it).first->name(); if ( name == which ) { (*it).second->setOn( true ); return (*it).first; @@ -205,7 +205,7 @@ RegExpConverter* VerifyButtons::setSyntax( const QString& which) void VerifyButtons::configure() { - _configMenu->exec( QCursor::pos() ); + _configMenu->exec( TQCursor::pos() ); } void VerifyButtons::setAllowNonQtSyntax( bool b ) diff --git a/kregexpeditor/verifybuttons.h b/kregexpeditor/verifybuttons.h index aaf3593..39fdf4c 100644 --- a/kregexpeditor/verifybuttons.h +++ b/kregexpeditor/verifybuttons.h @@ -18,7 +18,7 @@ #ifndef VERIFYBUTTONS_H #define VERIFYBUTTONS_H -#include <qdockwindow.h> +#include <tqdockwindow.h> #include "regexpconverter.h" class QToolButton; class QLabel; @@ -30,14 +30,14 @@ class VerifyButtons :public QDockWindow Q_OBJECT public: - VerifyButtons( QWidget* parent, const char* name ); - RegExpConverter* setSyntax( const QString& ); + VerifyButtons( TQWidget* parent, const char* name ); + RegExpConverter* setSyntax( const TQString& ); void setAllowNonQtSyntax( bool ); signals: void verify(); void autoVerify( bool ); - void loadVerifyText( const QString& ); + void loadVerifyText( const TQString& ); // Qt anchors do not work for <pre>...</pre>, thefore scrolling to next/prev match // do not work. Enable this when they work. @@ -46,7 +46,7 @@ signals: // void gotoNext(); // void gotoLast(); - void changeSyntax( const QString& ); + void changeSyntax( const TQString& ); public slots: // void enableForwardButtons( bool ); @@ -56,23 +56,23 @@ public slots: protected slots: void updateVerifyButton( bool ); void loadText(); - void slotChangeSyntax( QAction* action ); + void slotChangeSyntax( TQAction* action ); void configure(); private: - QToolButton* _verify; - QLabel* _matches; - QPopupMenu* _configMenu; + TQToolButton* _verify; + TQLabel* _matches; + TQPopupMenu* _configMenu; int _languageId; // Qt anchors do not work for <pre>...</pre>, thefore scrolling to next/prev match // do not work. Enable this when they work. - // QToolButton* _first; - // QToolButton* _prev; - // QToolButton* _next; - // QToolButton* _last; + // TQToolButton* _first; + // TQToolButton* _prev; + // TQToolButton* _next; + // TQToolButton* _last; - QValueList< QPair<RegExpConverter*,QAction*> > _converters; + TQValueList< QPair<RegExpConverter*,TQAction*> > _converters; }; diff --git a/kregexpeditor/widgetfactory.cpp b/kregexpeditor/widgetfactory.cpp index e2e860d..a5a7a78 100644 --- a/kregexpeditor/widgetfactory.cpp +++ b/kregexpeditor/widgetfactory.cpp @@ -46,7 +46,7 @@ bool WidgetFactory::isContainer( RegExpType tp ) return ( tp == REPEAT || tp == ALTN || tp == COMPOUND ); } -RegExpWidget* WidgetFactory::createWidget( RegExpEditorWindow* win, QWidget* parent, +RegExpWidget* WidgetFactory::createWidget( RegExpEditorWindow* win, TQWidget* parent, RegExpType type ) { RegExpWidget* widget = 0; @@ -80,7 +80,7 @@ RegExpWidget* WidgetFactory::createWidget( RegExpEditorWindow* win, QWidget* par return 0; } - if ( widget->edit() == QDialog::Rejected ) { + if ( widget->edit() == TQDialog::Rejected ) { delete widget; return 0; } @@ -88,7 +88,7 @@ RegExpWidget* WidgetFactory::createWidget( RegExpEditorWindow* win, QWidget* par } RegExpWidget* WidgetFactory::createWidget( RegExp* regexp, RegExpEditorWindow* editorWindow, - QWidget* parent ) + TQWidget* parent ) { if ( regexp == 0 ) { qFatal("%s:%d Regexp is 0", __FILE__, __LINE__ ); @@ -131,35 +131,35 @@ RegExpWidget* WidgetFactory::createWidget( RegExp* regexp, RegExpEditorWindow* e return 0; } -RegExp* WidgetFactory::createRegExp( QDomElement node, const QString& version ) +RegExp* WidgetFactory::createRegExp( TQDomElement node, const TQString& version ) { - QString tag = node.tagName(); + TQString tag = node.tagName(); RegExp* regexp; - if ( tag == QString::fromLocal8Bit( "TextRange" ) ) + if ( tag == TQString::fromLocal8Bit( "TextRange" ) ) regexp = new TextRangeRegExp( false ); - else if ( tag == QString::fromLocal8Bit( "Text" ) ) + else if ( tag == TQString::fromLocal8Bit( "Text" ) ) regexp = new TextRegExp( false ); - else if ( tag == QString::fromLocal8Bit( "Concatenation" ) ) + else if ( tag == TQString::fromLocal8Bit( "Concatenation" ) ) regexp = new ConcRegExp( false ); - else if ( tag == QString::fromLocal8Bit( "Alternatives" ) ) + else if ( tag == TQString::fromLocal8Bit( "Alternatives" ) ) regexp = new AltnRegExp( false ); - else if ( tag == QString::fromLocal8Bit( "BegLine" ) ) + else if ( tag == TQString::fromLocal8Bit( "BegLine" ) ) regexp = new PositionRegExp( false, PositionRegExp::BEGLINE ); - else if ( tag == QString::fromLocal8Bit( "EndLine" ) ) + else if ( tag == TQString::fromLocal8Bit( "EndLine" ) ) regexp = new PositionRegExp( false, PositionRegExp::ENDLINE ); - else if ( tag == QString::fromLocal8Bit( "WordBoundary" ) ) + else if ( tag == TQString::fromLocal8Bit( "WordBoundary" ) ) regexp = new PositionRegExp( false, PositionRegExp::WORDBOUNDARY ); - else if ( tag == QString::fromLocal8Bit( "NonWordBoundary" ) ) + else if ( tag == TQString::fromLocal8Bit( "NonWordBoundary" ) ) regexp = new PositionRegExp( false, PositionRegExp::NONWORDBOUNDARY ); - else if ( tag == QString::fromLocal8Bit( "PositiveLookAhead" ) ) + else if ( tag == TQString::fromLocal8Bit( "PositiveLookAhead" ) ) regexp = new LookAheadRegExp( false, LookAheadRegExp::POSITIVE ); - else if ( tag == QString::fromLocal8Bit( "NegativeLookAhead" ) ) + else if ( tag == TQString::fromLocal8Bit( "NegativeLookAhead" ) ) regexp = new LookAheadRegExp( false, LookAheadRegExp::NEGATIVE ); - else if ( tag == QString::fromLocal8Bit( "Compound" ) ) + else if ( tag == TQString::fromLocal8Bit( "Compound" ) ) regexp = new CompoundRegExp( false ); - else if ( tag == QString::fromLocal8Bit( "AnyChar" ) ) + else if ( tag == TQString::fromLocal8Bit( "AnyChar" ) ) regexp = new DotRegExp( false ); - else if ( tag == QString::fromLocal8Bit( "Repeat" ) ) + else if ( tag == TQString::fromLocal8Bit( "Repeat" ) ) regexp = new RepeatRegExp( false ); else { KMessageBox::sorry( 0, i18n("<p>Unknown tag while reading XML. Tag was <b>%1</b></p>").arg(tag), @@ -178,9 +178,9 @@ RegExp* WidgetFactory::createRegExp( QDomElement node, const QString& version ) return 0; } -RegExp* WidgetFactory::createRegExp( QString str ) +RegExp* WidgetFactory::createRegExp( TQString str ) { - QDomDocument doc; + TQDomDocument doc; bool ok = doc.setContent( str ); if ( !ok ) { KMessageBox::sorry( 0, i18n("Error while loading regular expression from XML. Most probably the regular expression had unmatched tags."), @@ -189,16 +189,16 @@ RegExp* WidgetFactory::createRegExp( QString str ) // Read the RegularExpression element, and extract the version. - QDomElement top = doc.documentElement(); - if (! (top.tagName() == QString::fromLocal8Bit("RegularExpression")) ) { - KMessageBox::sorry( 0, i18n("<p>XML file did not contain a <b>%1</b> tag.</p>").arg(QString::fromLatin1("RegularExpression")), + TQDomElement top = doc.documentElement(); + if (! (top.tagName() == TQString::fromLocal8Bit("RegularExpression")) ) { + KMessageBox::sorry( 0, i18n("<p>XML file did not contain a <b>%1</b> tag.</p>").arg(TQString::fromLatin1("RegularExpression")), i18n("Error While Loading From XML File") ) ; } - QString version = top.attribute( QString::fromLocal8Bit("version"), KRegExpEditorGUI::version ); - QDomNode child = top.firstChild(); + TQString version = top.attribute( TQString::fromLocal8Bit("version"), KRegExpEditorGUI::version ); + TQDomNode child = top.firstChild(); if ( ! child.isElement() ) { KMessageBox::sorry( 0, i18n("<p>Error while reading XML file. The element just below the tag " - "<b>%1</b> was not an element.</p>").arg(QString::fromLatin1("RegularExpression")), + "<b>%1</b> was not an element.</p>").arg(TQString::fromLatin1("RegularExpression")), i18n("Error While Loading From XML File") ) ; } diff --git a/kregexpeditor/widgetfactory.h b/kregexpeditor/widgetfactory.h index b1d1f26..3a55a74 100644 --- a/kregexpeditor/widgetfactory.h +++ b/kregexpeditor/widgetfactory.h @@ -18,7 +18,7 @@ #ifndef widgetfactory #define widgetfactory -#include <qdom.h> +#include <tqdom.h> class RegExpWidget; class RegExpEditorWindow; @@ -47,12 +47,12 @@ enum RegExpType { class WidgetFactory { public: - static RegExpWidget* createWidget( RegExpEditorWindow* editorWindow, QWidget* parent, + static RegExpWidget* createWidget( RegExpEditorWindow* editorWindow, TQWidget* parent, RegExpType type ); static RegExpWidget* createWidget( RegExp* regexp, RegExpEditorWindow* editorWindow, - QWidget* parent ); - static RegExp* createRegExp( QDomElement node, const QString& version ); - static RegExp* createRegExp( QString str ); + TQWidget* parent ); + static RegExp* createRegExp( TQDomElement node, const TQString& version ); + static RegExp* createRegExp( TQString str ); static bool isContainer( RegExpType ); }; diff --git a/kregexpeditor/zerowidgets.cpp b/kregexpeditor/zerowidgets.cpp index 94a15d5..f9de296 100644 --- a/kregexpeditor/zerowidgets.cpp +++ b/kregexpeditor/zerowidgets.cpp @@ -25,13 +25,13 @@ #include "zerowidgets.h" #include "dotregexp.h" #include "positionregexp.h" -#include <qpainter.h> +#include <tqpainter.h> #include "myfontmetrics.h" //-------------------------------------------------------------------------------- // ZeroWidget //-------------------------------------------------------------------------------- -ZeroWidget::ZeroWidget(QString txt, RegExpEditorWindow* editorWindow, - QWidget *parent, const char *name) +ZeroWidget::ZeroWidget(TQString txt, RegExpEditorWindow* editorWindow, + TQWidget *parent, const char *name) : RegExpWidget(editorWindow, parent, name ? name : "ZeroWidget" ) { _text = txt; @@ -42,21 +42,21 @@ void ZeroWidget::addNewChild(DragAccepter *, RegExpWidget *) qFatal("No children should be added to this widget!"); } -QSize ZeroWidget::sizeHint() const +TQSize ZeroWidget::sizeHint() const { - QFontMetrics metrics = fontMetrics(); + TQFontMetrics metrics = fontMetrics(); _textSize = HackCalculateFontSize( metrics, _text ); // _textSize = metrics.size(0,_text); - _boxSize = QSize(_textSize.width() + 2*space, _textSize.height() + 2 *space); + _boxSize = TQSize(_textSize.width() + 2*space, _textSize.height() + 2 *space); return _boxSize; } -void ZeroWidget::paintEvent( QPaintEvent *e) +void ZeroWidget::paintEvent( TQPaintEvent *e) { // So what is my Size? - QSize mySize = sizeHint(); + TQSize mySize = sizeHint(); - QPainter painter(this); + TQPainter painter(this); drawPossibleSelection( painter, mySize); // Write the text and the rectangle @@ -70,7 +70,7 @@ void ZeroWidget::paintEvent( QPaintEvent *e) //-------------------------------------------------------------------------------- // AnyCharWidget //-------------------------------------------------------------------------------- -AnyCharWidget::AnyCharWidget(RegExpEditorWindow* editorWindow, QWidget *parent, +AnyCharWidget::AnyCharWidget(RegExpEditorWindow* editorWindow, TQWidget *parent, const char *name) : ZeroWidget(i18n("Any\nCharacter"), editorWindow, parent, name ? name : "AnyCharWidget") @@ -86,7 +86,7 @@ RegExp* AnyCharWidget::regExp() const //-------------------------------------------------------------------------------- // BegLineWidget //-------------------------------------------------------------------------------- -BegLineWidget::BegLineWidget(RegExpEditorWindow* editorWindow, QWidget *parent, +BegLineWidget::BegLineWidget(RegExpEditorWindow* editorWindow, TQWidget *parent, const char *name) : ZeroWidget(i18n("Line\nStart"), editorWindow, parent, name ? name : "BegLineWidget") @@ -102,7 +102,7 @@ RegExp* BegLineWidget::regExp() const //-------------------------------------------------------------------------------- // EndLineWidget //-------------------------------------------------------------------------------- -EndLineWidget::EndLineWidget(RegExpEditorWindow* editorWindow, QWidget *parent, +EndLineWidget::EndLineWidget(RegExpEditorWindow* editorWindow, TQWidget *parent, const char *name) : ZeroWidget(i18n("Line\nEnd"), editorWindow, parent, name) { @@ -116,7 +116,7 @@ RegExp* EndLineWidget::regExp() const //-------------------------------------------------------------------------------- // WordBoundaryWidget //-------------------------------------------------------------------------------- -WordBoundaryWidget::WordBoundaryWidget(RegExpEditorWindow* editorWindow, QWidget *parent, +WordBoundaryWidget::WordBoundaryWidget(RegExpEditorWindow* editorWindow, TQWidget *parent, const char *name) : ZeroWidget(i18n("Word\nBoundary"), editorWindow, parent, name ? name : "WordBoundaryWidget" ) @@ -131,7 +131,7 @@ RegExp* WordBoundaryWidget::regExp() const //-------------------------------------------------------------------------------- // NonWordBoundaryWidget //-------------------------------------------------------------------------------- -NonWordBoundaryWidget::NonWordBoundaryWidget(RegExpEditorWindow* editorWindow, QWidget *parent, +NonWordBoundaryWidget::NonWordBoundaryWidget(RegExpEditorWindow* editorWindow, TQWidget *parent, const char *name) : ZeroWidget(i18n("Non-word\nBoundary"), editorWindow, parent, name ? name : "NonWordBoundaryWidget" ) diff --git a/kregexpeditor/zerowidgets.h b/kregexpeditor/zerowidgets.h index cd5e9be..04dd5c7 100644 --- a/kregexpeditor/zerowidgets.h +++ b/kregexpeditor/zerowidgets.h @@ -27,19 +27,19 @@ class ZeroWidget :public RegExpWidget { public: - ZeroWidget(QString text, RegExpEditorWindow* editorWindow, QWidget *parent, + ZeroWidget(TQString text, RegExpEditorWindow* editorWindow, TQWidget *parent, const char *name = 0); virtual void addNewChild(DragAccepter *accepter, RegExpWidget *child); - virtual QSize sizeHint() const; + virtual TQSize sizeHint() const; protected: - virtual void paintEvent( QPaintEvent *e ); + virtual void paintEvent( TQPaintEvent *e ); private: - QString _text; + TQString _text; - mutable QSize _textSize; - mutable QSize _boxSize; + mutable TQSize _textSize; + mutable TQSize _boxSize; }; @@ -51,7 +51,7 @@ private: class AnyCharWidget :public ZeroWidget { public: - AnyCharWidget(RegExpEditorWindow* editorWindow, QWidget *parent, + AnyCharWidget(RegExpEditorWindow* editorWindow, TQWidget *parent, const char *label = 0); virtual RegExp* regExp() const; @@ -68,7 +68,7 @@ public: class BegLineWidget : public ZeroWidget { public: - BegLineWidget(RegExpEditorWindow* editorWindow, QWidget *parent, + BegLineWidget(RegExpEditorWindow* editorWindow, TQWidget *parent, const char *name = 0); virtual RegExp* regExp() const; virtual RegExpType type() const { return BEGLINE; } @@ -84,7 +84,7 @@ public: class EndLineWidget : public ZeroWidget { public: - EndLineWidget(RegExpEditorWindow* editorWindow, QWidget *parent, + EndLineWidget(RegExpEditorWindow* editorWindow, TQWidget *parent, const char *name = 0); virtual RegExp* regExp() const; virtual RegExpType type() const { return ENDLINE; } @@ -99,7 +99,7 @@ public: class WordBoundaryWidget : public ZeroWidget { public: - WordBoundaryWidget(RegExpEditorWindow* editorWindow, QWidget *parent, + WordBoundaryWidget(RegExpEditorWindow* editorWindow, TQWidget *parent, const char *name = 0); virtual RegExp* regExp() const; virtual RegExpType type() const { return WORDBOUNDARY; } @@ -115,7 +115,7 @@ public: class NonWordBoundaryWidget : public ZeroWidget { public: - NonWordBoundaryWidget(RegExpEditorWindow* editorWindow, QWidget *parent, + NonWordBoundaryWidget(RegExpEditorWindow* editorWindow, TQWidget *parent, const char *name = 0); virtual RegExp* regExp() const; virtual RegExpType type() const { return NONWORDBOUNDARY; } diff --git a/ksim/baselist.h b/ksim/baselist.h index b55ab3b..6ee7bcc 100644 --- a/ksim/baselist.h +++ b/ksim/baselist.h @@ -20,9 +20,9 @@ #ifndef BASELIST_H #define BASELIST_H -#include <qptrlist.h> +#include <tqptrlist.h> #include <common.h> -#include <qapplication.h> +#include <tqapplication.h> namespace KSim { @@ -32,7 +32,7 @@ namespace KSim static void add(KSim::Base *object) { if (!m_baseList) { - m_baseList = new QPtrList<KSim::Base>; + m_baseList = new TQPtrList<KSim::Base>; m_baseList->setAutoDelete(false); // Make sure our m_baseList instance gets @@ -63,7 +63,7 @@ namespace KSim if (!m_baseList) return; - QPtrListIterator<KSim::Base> object(*m_baseList); + TQPtrListIterator<KSim::Base> object(*m_baseList); for (; object.current(); ++object) { // Call processEvents() so our ui doesn't block if (!object.current()->isThemeConfigOnly() || themeChanged) { @@ -89,9 +89,9 @@ namespace KSim m_baseList = 0L; } - static QPtrList<KSim::Base> *m_baseList; + static TQPtrList<KSim::Base> *m_baseList; }; - QPtrList<KSim::Base> *BaseList::m_baseList = 0L; + TQPtrList<KSim::Base> *BaseList::m_baseList = 0L; } #endif // BASELIST_H diff --git a/ksim/generalprefs.cpp b/ksim/generalprefs.cpp index 1f3baf7..8b308a6 100644 --- a/ksim/generalprefs.cpp +++ b/ksim/generalprefs.cpp @@ -20,16 +20,16 @@ #include "generalprefs.h" #include "generalprefs.moc" -#include <qcombobox.h> -#include <qcheckbox.h> -#include <qgroupbox.h> -#include <qlabel.h> -#include <qlineedit.h> -#include <qpushbutton.h> -#include <qtabwidget.h> -#include <qlayout.h> -#include <qtooltip.h> -#include <qpopupmenu.h> +#include <tqcombobox.h> +#include <tqcheckbox.h> +#include <tqgroupbox.h> +#include <tqlabel.h> +#include <tqlineedit.h> +#include <tqpushbutton.h> +#include <tqtabwidget.h> +#include <tqlayout.h> +#include <tqtooltip.h> +#include <tqpopupmenu.h> #include <klocale.h> #include <kapplication.h> @@ -40,20 +40,20 @@ #include <ksimconfig.h> -KSim::GeneralPrefs::GeneralPrefs(QWidget *parent, const char *name) - : QWidget(parent, name) +KSim::GeneralPrefs::GeneralPrefs(TQWidget *parent, const char *name) + : TQWidget(parent, name) { - m_mainLayout = new QGridLayout(this); + m_mainLayout = new TQGridLayout(this); m_mainLayout->setSpacing(6); - m_sizeBox = new QGroupBox(this); + m_sizeBox = new TQGroupBox(this); m_sizeBox->setTitle(i18n("Graph Size")); m_sizeBox->setColumnLayout(0, Qt::Horizontal); - QGridLayout *sizeBoxLayout = new QGridLayout(m_sizeBox->layout()); + TQGridLayout *sizeBoxLayout = new TQGridLayout(m_sizeBox->layout()); sizeBoxLayout->setSpacing(6); - m_sizeHLabel = new QLabel(m_sizeBox); + m_sizeHLabel = new TQLabel(m_sizeBox); m_sizeHLabel->setText(i18n("Graph height:")); sizeBoxLayout->addWidget(m_sizeHLabel, 0, 0); @@ -61,15 +61,15 @@ KSim::GeneralPrefs::GeneralPrefs(QWidget *parent, const char *name) m_sizeHSpin->setValue(40); m_sizeHSpin->setMinValue(40); m_sizeHSpin->setMaxValue(200); - m_sizeHSpin->setSizePolicy(QSizePolicy(QSizePolicy::Preferred, - QSizePolicy::Fixed)); + m_sizeHSpin->setSizePolicy(TQSizePolicy(TQSizePolicy::Preferred, + TQSizePolicy::Fixed)); sizeBoxLayout->addWidget(m_sizeHSpin, 0, 1); - QSpacerItem *sizeHSpacer = new QSpacerItem(20, 20, - QSizePolicy::Expanding, QSizePolicy::Minimum); + TQSpacerItem *sizeHSpacer = new TQSpacerItem(20, 20, + TQSizePolicy::Expanding, TQSizePolicy::Minimum); sizeBoxLayout->addItem(sizeHSpacer, 0, 2); - m_sizeWLabel = new QLabel(m_sizeBox); + m_sizeWLabel = new TQLabel(m_sizeBox); m_sizeWLabel->setText(i18n("Graph width:")); sizeBoxLayout->addWidget(m_sizeWLabel, 1, 0); @@ -77,28 +77,28 @@ KSim::GeneralPrefs::GeneralPrefs(QWidget *parent, const char *name) m_sizeWSpin->setValue(58); m_sizeWSpin->setMinValue(58); m_sizeWSpin->setMaxValue(200); - m_sizeWSpin->setSizePolicy(QSizePolicy(QSizePolicy::Preferred, - QSizePolicy::Fixed)); + m_sizeWSpin->setSizePolicy(TQSizePolicy(TQSizePolicy::Preferred, + TQSizePolicy::Fixed)); sizeBoxLayout->addWidget(m_sizeWSpin, 1, 1); - QSpacerItem *sizeWSpacer = new QSpacerItem(20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); + TQSpacerItem *sizeWSpacer = new TQSpacerItem(20, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum); sizeBoxLayout->addItem(sizeWSpacer, 1, 2); m_mainLayout->addWidget(m_sizeBox, 0, 0); - QSpacerItem *boxSpacer = new QSpacerItem(20, 20, - QSizePolicy::Expanding, QSizePolicy::Minimum); + TQSpacerItem *boxSpacer = new TQSpacerItem(20, 20, + TQSizePolicy::Expanding, TQSizePolicy::Minimum); m_mainLayout->addItem(boxSpacer, 0, 1); - m_displayFqdn = new QCheckBox(this); + m_displayFqdn = new TQCheckBox(this); m_displayFqdn->setText(i18n("Display fully qualified domain name")); m_mainLayout->addMultiCellWidget(m_displayFqdn, 1, 1, 0, 1); - m_recolourThemes = new QCheckBox(this); + m_recolourThemes = new TQCheckBox(this); m_recolourThemes->setText(i18n("Recolor themes to the current color scheme")); m_mainLayout->addMultiCellWidget(m_recolourThemes, 2, 2, 0, 1); - QSpacerItem *spacer = new QSpacerItem(20, 20, - QSizePolicy::Minimum, QSizePolicy::Expanding); + TQSpacerItem *spacer = new TQSpacerItem(20, 20, + TQSizePolicy::Minimum, TQSizePolicy::Expanding); m_mainLayout->addItem(spacer, 3, 0); } @@ -108,36 +108,36 @@ KSim::GeneralPrefs::~GeneralPrefs() void KSim::GeneralPrefs::saveConfig(KSim::Config *config) { - config->setGraphSize(QSize(m_sizeWSpin->value(), m_sizeHSpin->value())); + config->setGraphSize(TQSize(m_sizeWSpin->value(), m_sizeHSpin->value())); config->setDisplayFqdn(m_displayFqdn->isChecked()); config->setReColourThemes(m_recolourThemes->isChecked()); } void KSim::GeneralPrefs::readConfig(KSim::Config *config) { - QSize size = config->graphSize(); + TQSize size = config->graphSize(); m_sizeHSpin->setValue(size.height()); m_sizeWSpin->setValue(size.width()); m_displayFqdn->setChecked(config->displayFqdn()); m_recolourThemes->setChecked(config->reColourThemes()); } -KSim::ClockPrefs::ClockPrefs(QWidget *parent, const char *name) - : QWidget(parent, name) +KSim::ClockPrefs::ClockPrefs(TQWidget *parent, const char *name) + : TQWidget(parent, name) { - m_mainLayout = new QVBoxLayout(this); + m_mainLayout = new TQVBoxLayout(this); m_mainLayout->setSpacing(6); - m_timeCheck = new QCheckBox(i18n("Show time"),this); + m_timeCheck = new TQCheckBox(i18n("Show time"),this); m_mainLayout->addWidget(m_timeCheck); m_timeCheck->setChecked(true); - m_dateCheck = new QCheckBox(i18n("Show date"),this); + m_dateCheck = new TQCheckBox(i18n("Show date"),this); m_mainLayout->addWidget(m_dateCheck); m_dateCheck->setChecked(true); - QSpacerItem *spacer = new QSpacerItem(20, 20, - QSizePolicy::Minimum, QSizePolicy::Expanding); + TQSpacerItem *spacer = new TQSpacerItem(20, 20, + TQSizePolicy::Minimum, TQSizePolicy::Expanding); m_mainLayout->addItem(spacer); } @@ -157,44 +157,44 @@ void KSim::ClockPrefs::readConfig(KSim::Config *config) m_dateCheck->setChecked(config->showDate()); } -KSim::UptimePrefs::UptimePrefs(QWidget *parent, const char *name) - : QWidget(parent, name) +KSim::UptimePrefs::UptimePrefs(TQWidget *parent, const char *name) + : TQWidget(parent, name) { m_addIcon = SmallIconSet("filenew"); m_removeIcon = SmallIconSet("editdelete"); - m_mainLayout = new QVBoxLayout(this); + m_mainLayout = new TQVBoxLayout(this); m_mainLayout->setSpacing(6); m_uptimeCombo = new KComboBox(true, this); m_uptimeCombo->setDuplicatesEnabled(false); - m_uptimeCombo->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, - QSizePolicy::Fixed)); + m_uptimeCombo->setSizePolicy(TQSizePolicy(TQSizePolicy::Expanding, + TQSizePolicy::Fixed)); m_uptimeCombo->insertItem(i18n("%hh:%mm:%ss")); m_uptimeCombo->insertItem(i18n("%dd %h:%m")); m_uptimeCombo->insertItem(i18n("Uptime: %h:%m:%s")); connect(m_uptimeCombo, - SIGNAL(aboutToShowContextMenu(QPopupMenu *)), - SLOT(uptimeContextMenu(QPopupMenu *))); + TQT_SIGNAL(aboutToShowContextMenu(TQPopupMenu *)), + TQT_SLOT(uptimeContextMenu(TQPopupMenu *))); - m_uptimeAdd = new QPushButton(this); + m_uptimeAdd = new TQPushButton(this); m_uptimeAdd->setPixmap(SmallIcon("down")); - connect(m_uptimeAdd, SIGNAL(clicked()), SLOT(insertUptimeItem())); - QToolTip::add(m_uptimeAdd, i18n("Insert item")); + connect(m_uptimeAdd, TQT_SIGNAL(clicked()), TQT_SLOT(insertUptimeItem())); + TQToolTip::add(m_uptimeAdd, i18n("Insert item")); - m_uptimeCheck = new QCheckBox(this); + m_uptimeCheck = new TQCheckBox(this); m_uptimeCheck->setText(i18n("Show uptime")); m_uptimeCheck->setChecked(true); - connect(m_uptimeCheck, SIGNAL(toggled(bool)), - m_uptimeCombo, SLOT(setEnabled(bool))); - connect(m_uptimeCheck, SIGNAL(toggled(bool)), - m_uptimeAdd, SLOT(setEnabled(bool))); + connect(m_uptimeCheck, TQT_SIGNAL(toggled(bool)), + m_uptimeCombo, TQT_SLOT(setEnabled(bool))); + connect(m_uptimeCheck, TQT_SIGNAL(toggled(bool)), + m_uptimeAdd, TQT_SLOT(setEnabled(bool))); m_mainLayout->addWidget(m_uptimeCheck); m_subLayout = new QHBoxLayout; m_subLayout->setSpacing(6); - m_formatLabel = new QLabel(this); + m_formatLabel = new TQLabel(this); m_formatLabel->setText(i18n("Uptime format:")); m_subLayout->addWidget(m_formatLabel); @@ -202,41 +202,41 @@ KSim::UptimePrefs::UptimePrefs(QWidget *parent, const char *name) m_subLayout->addWidget(m_uptimeAdd); m_mainLayout->addLayout(m_subLayout); - m_uptimeInfo = new QLabel(this); + m_uptimeInfo = new TQLabel(this); m_uptimeInfo->setText(i18n("The text in the edit box will be " "what is displayed as \nthe uptime except the % items " "will be replaced with \nthe legend")); m_mainLayout->addWidget(m_uptimeInfo); - m_uptimeBox = new QGroupBox(this); + m_uptimeBox = new TQGroupBox(this); m_uptimeBox->setTitle(i18n("Uptime Legend")); m_uptimeBox->setColumnLayout(0, Qt::Vertical); m_uptimeBox->layout()->setSpacing(0); m_uptimeBox->layout()->setMargin(0); - m_boxLayout = new QVBoxLayout(m_uptimeBox->layout()); + m_boxLayout = new TQVBoxLayout(m_uptimeBox->layout()); m_boxLayout->setAlignment(Qt::AlignTop); m_boxLayout->setSpacing(6); m_boxLayout->setMargin(11); - m_udLabel = new QLabel(m_uptimeBox); + m_udLabel = new TQLabel(m_uptimeBox); m_udLabel->setText(i18n("%d - Total days uptime")); m_boxLayout->addWidget(m_udLabel); - m_uhLabel = new QLabel(m_uptimeBox); + m_uhLabel = new TQLabel(m_uptimeBox); m_uhLabel->setText(i18n("%h - Total hours uptime")); m_boxLayout->addWidget(m_uhLabel); - m_umLabel = new QLabel(m_uptimeBox); + m_umLabel = new TQLabel(m_uptimeBox); m_umLabel->setText(i18n("%m - Total minutes uptime")); m_boxLayout->addWidget(m_umLabel); - m_usLabel = new QLabel(m_uptimeBox); + m_usLabel = new TQLabel(m_uptimeBox); m_usLabel->setText(i18n("%s - Total seconds uptime")); m_boxLayout->addWidget(m_usLabel); m_mainLayout->addWidget(m_uptimeBox); - QSpacerItem *spacer = new QSpacerItem(20, 20, - QSizePolicy::Minimum, QSizePolicy::Expanding); + TQSpacerItem *spacer = new TQSpacerItem(20, 20, + TQSizePolicy::Minimum, TQSizePolicy::Expanding); m_mainLayout->addItem(spacer); } @@ -249,7 +249,7 @@ void KSim::UptimePrefs::saveConfig(KSim::Config *config) config->setUptimeItem(m_uptimeCombo->currentItem()); config->setShowUptime(m_uptimeCheck->isChecked()); - QStringList comboItems; + TQStringList comboItems; for (int i = 0; i < m_uptimeCombo->count(); i++) comboItems.append(m_uptimeCombo->text(i)); @@ -260,8 +260,8 @@ void KSim::UptimePrefs::readConfig(KSim::Config *config) { m_uptimeCheck->setChecked(config->showUptime()); - QStringList::ConstIterator it; - QStringList items = config->uptimeFormatList(); + TQStringList::ConstIterator it; + TQStringList items = config->uptimeFormatList(); for (it = items.begin(); it != items.end(); ++it) if (!m_uptimeCombo->contains(*it)) m_uptimeCombo->insertItem(*it); @@ -269,18 +269,18 @@ void KSim::UptimePrefs::readConfig(KSim::Config *config) m_uptimeCombo->setCurrentItem(config->uptimeItem()); } -void KSim::UptimePrefs::uptimeContextMenu(QPopupMenu *menu) +void KSim::UptimePrefs::uptimeContextMenu(TQPopupMenu *menu) { menu->insertSeparator(); menu->insertItem(m_addIcon, i18n("Insert Item"), - this, SLOT(insertUptimeItem())); + this, TQT_SLOT(insertUptimeItem())); menu->insertItem(m_removeIcon, i18n("Remove Item"), - this, SLOT(removeUptimeItem())); + this, TQT_SLOT(removeUptimeItem())); } void KSim::UptimePrefs::insertUptimeItem() { - QString text = m_uptimeCombo->lineEdit()->text(); + TQString text = m_uptimeCombo->lineEdit()->text(); if (!m_uptimeCombo->contains(text)) { m_uptimeCombo->insertItem(text); m_uptimeCombo->setCurrentItem(m_uptimeCombo->count() - 1); @@ -294,43 +294,43 @@ void KSim::UptimePrefs::removeUptimeItem() m_uptimeCombo->setCurrentItem(currentItem - 1); } -KSim::MemoryPrefs::MemoryPrefs(QWidget *parent, const char *name) - : QWidget(parent, name) +KSim::MemoryPrefs::MemoryPrefs(TQWidget *parent, const char *name) + : TQWidget(parent, name) { m_addIcon = SmallIconSet("filenew"); m_removeIcon = SmallIconSet("editdelete"); - m_mainLayout = new QVBoxLayout(this); + m_mainLayout = new TQVBoxLayout(this); m_mainLayout->setSpacing(6); m_memCombo = new KComboBox(true, this); m_memCombo->setDuplicatesEnabled(false); - m_memCombo->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, - QSizePolicy::Fixed)); + m_memCombo->setSizePolicy(TQSizePolicy(TQSizePolicy::Expanding, + TQSizePolicy::Fixed)); //m_memCombo->insertItem(i18n("%tM - %fM free")); //m_memCombo->insertItem(i18n("%tM - %uM used")); connect(m_memCombo, - SIGNAL(aboutToShowContextMenu(QPopupMenu *)), - SLOT(memoryContextMenu(QPopupMenu *))); + TQT_SIGNAL(aboutToShowContextMenu(TQPopupMenu *)), + TQT_SLOT(memoryContextMenu(TQPopupMenu *))); - m_memoryAdd = new QPushButton(this); + m_memoryAdd = new TQPushButton(this); m_memoryAdd->setPixmap(SmallIcon("down")); - connect(m_memoryAdd, SIGNAL(clicked()), SLOT(insertMemoryItem())); - QToolTip::add(m_memoryAdd, i18n("Insert item")); + connect(m_memoryAdd, TQT_SIGNAL(clicked()), TQT_SLOT(insertMemoryItem())); + TQToolTip::add(m_memoryAdd, i18n("Insert item")); - m_memCheck = new QCheckBox(this); + m_memCheck = new TQCheckBox(this); m_memCheck->setText(i18n("Show memory and free memory")); m_memCheck->setChecked(false); - connect(m_memCheck, SIGNAL(toggled(bool)), - m_memCombo, SLOT(setEnabled(bool))); - connect(m_memCheck, SIGNAL(toggled(bool)), - m_memoryAdd, SLOT(setEnabled(bool))); + connect(m_memCheck, TQT_SIGNAL(toggled(bool)), + m_memCombo, TQT_SLOT(setEnabled(bool))); + connect(m_memCheck, TQT_SIGNAL(toggled(bool)), + m_memoryAdd, TQT_SLOT(setEnabled(bool))); m_mainLayout->addWidget(m_memCheck); m_subLayout = new QHBoxLayout; m_subLayout->setSpacing(6); - m_memFormat = new QLabel(this); + m_memFormat = new TQLabel(this); m_memFormat->setText(i18n("Mem format:")); m_subLayout->addWidget(m_memFormat); @@ -338,53 +338,53 @@ KSim::MemoryPrefs::MemoryPrefs(QWidget *parent, const char *name) m_subLayout->addWidget(m_memoryAdd); m_mainLayout->addLayout(m_subLayout); - m_memInfo = new QLabel(this); + m_memInfo = new TQLabel(this); m_memInfo->setText(i18n("The text in the edit box will be what " "is displayed as \nthe memory & free memory except the " "% items will be \nreplaced with the legend")); m_mainLayout->addWidget(m_memInfo); - m_memBox = new QGroupBox(this); + m_memBox = new TQGroupBox(this); m_memBox->setTitle(i18n("Memory Legend")); m_memBox->setColumnLayout(0, Qt::Vertical); m_memBox->layout()->setSpacing(0); m_memBox->layout()->setMargin(0); - m_boxLayout = new QVBoxLayout(m_memBox->layout()); + m_boxLayout = new TQVBoxLayout(m_memBox->layout()); m_boxLayout->setAlignment(Qt::AlignTop); m_boxLayout->setSpacing(6); m_boxLayout->setMargin(11); - m_mtLabel = new QLabel(m_memBox); + m_mtLabel = new TQLabel(m_memBox); m_mtLabel->setText(i18n("%t - Total memory")); m_boxLayout->addWidget(m_mtLabel); - m_mfLabel = new QLabel(m_memBox); + m_mfLabel = new TQLabel(m_memBox); m_mfLabel->setText(i18n("%F - Total free memory including cached and buffered")); m_boxLayout->addWidget(m_mfLabel); - m_mfLabel = new QLabel(m_memBox); + m_mfLabel = new TQLabel(m_memBox); m_mfLabel->setText(i18n("%f - Total free memory")); m_boxLayout->addWidget(m_mfLabel); - m_muLabel = new QLabel(m_memBox); + m_muLabel = new TQLabel(m_memBox); m_muLabel->setText(i18n("%u - Total used memory")); m_boxLayout->addWidget(m_muLabel); - m_mcLabel = new QLabel(m_memBox); + m_mcLabel = new TQLabel(m_memBox); m_mcLabel->setText(i18n("%c - Total cached memory")); m_boxLayout->addWidget(m_mcLabel); - m_mbLabel = new QLabel(m_memBox); + m_mbLabel = new TQLabel(m_memBox); m_mbLabel->setText(i18n("%b - Total buffered memory")); m_boxLayout->addWidget(m_mbLabel); - m_msLabel = new QLabel(m_memBox); + m_msLabel = new TQLabel(m_memBox); m_msLabel->setText(i18n("%s - Total shared memory")); m_boxLayout->addWidget(m_msLabel); m_mainLayout->addWidget(m_memBox); - QSpacerItem *spacer = new QSpacerItem(20, 20, - QSizePolicy::Minimum, QSizePolicy::Expanding); + TQSpacerItem *spacer = new TQSpacerItem(20, 20, + TQSizePolicy::Minimum, TQSizePolicy::Expanding); m_mainLayout->addItem(spacer); } @@ -397,7 +397,7 @@ void KSim::MemoryPrefs::saveConfig(KSim::Config *config) config->setMemoryItem(m_memCombo->currentItem()); config->setShowMemory(m_memCheck->isChecked()); - QStringList comboItems; + TQStringList comboItems; for (int i = 0; i < m_memCombo->count(); i++) comboItems.append(m_memCombo->text(i)); @@ -408,8 +408,8 @@ void KSim::MemoryPrefs::readConfig(KSim::Config *config) { m_memCheck->setChecked(config->showMemory()); - QStringList::ConstIterator it; - QStringList items = config->memoryFormatList(); + TQStringList::ConstIterator it; + TQStringList items = config->memoryFormatList(); for (it = items.begin(); it != items.end(); ++it) if (!m_memCombo->contains(*it)) m_memCombo->insertItem(*it); @@ -417,18 +417,18 @@ void KSim::MemoryPrefs::readConfig(KSim::Config *config) m_memCombo->setCurrentItem(config->memoryItem()); } -void KSim::MemoryPrefs::memoryContextMenu(QPopupMenu *menu) +void KSim::MemoryPrefs::memoryContextMenu(TQPopupMenu *menu) { menu->insertSeparator(); menu->insertItem(m_addIcon, i18n("Insert Item"), - this, SLOT(insertMemoryItem())); + this, TQT_SLOT(insertMemoryItem())); menu->insertItem(m_removeIcon, i18n("Remove Item"), - this, SLOT(removeMemoryItem())); + this, TQT_SLOT(removeMemoryItem())); } void KSim::MemoryPrefs::insertMemoryItem() { - QString text = m_memCombo->lineEdit()->text(); + TQString text = m_memCombo->lineEdit()->text(); if (!m_memCombo->contains(text)) { m_memCombo->insertItem(text); m_memCombo->setCurrentItem(m_memCombo->count() - 1); @@ -442,44 +442,44 @@ void KSim::MemoryPrefs::removeMemoryItem() m_memCombo->setCurrentItem(currentItem - 1); } -KSim::SwapPrefs::SwapPrefs(QWidget *parent, const char *name) - : QWidget(parent, name) +KSim::SwapPrefs::SwapPrefs(TQWidget *parent, const char *name) + : TQWidget(parent, name) { m_addIcon = SmallIconSet("filenew"); m_removeIcon = SmallIconSet("editdelete"); - m_mainLayout = new QVBoxLayout(this); + m_mainLayout = new TQVBoxLayout(this); m_mainLayout->setSpacing(6); - m_swapCheck = new QCheckBox(this); + m_swapCheck = new TQCheckBox(this); m_swapCheck->setText(i18n("Show swap and free swap")); m_swapCheck->setChecked(true); m_mainLayout->addWidget(m_swapCheck); m_swapCombo = new KComboBox(true, this); m_swapCombo->setDuplicatesEnabled(false); - m_swapCombo->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, - QSizePolicy::Fixed)); + m_swapCombo->setSizePolicy(TQSizePolicy(TQSizePolicy::Expanding, + TQSizePolicy::Fixed)); //m_swapCombo->insertItem(i18n("%tM - %fM free")); //m_swapCombo->insertItem(i18n("%tM - %uM used")); connect(m_swapCombo, - SIGNAL(aboutToShowContextMenu(QPopupMenu *)), - SLOT(swapContextMenu(QPopupMenu *))); + TQT_SIGNAL(aboutToShowContextMenu(TQPopupMenu *)), + TQT_SLOT(swapContextMenu(TQPopupMenu *))); - m_swapAdd = new QPushButton(this); + m_swapAdd = new TQPushButton(this); m_swapAdd->setPixmap(SmallIcon("down")); - connect(m_swapAdd, SIGNAL(clicked()), SLOT(insertSwapItem())); - QToolTip::add(m_swapAdd, i18n("Insert item")); + connect(m_swapAdd, TQT_SIGNAL(clicked()), TQT_SLOT(insertSwapItem())); + TQToolTip::add(m_swapAdd, i18n("Insert item")); m_subLayout = new QHBoxLayout; m_subLayout->setSpacing(6); - connect(m_swapCheck, SIGNAL(toggled(bool)), - m_swapCombo, SLOT(setEnabled(bool))); - connect(m_swapCheck, SIGNAL(toggled(bool)), - m_swapAdd, SLOT(setEnabled(bool))); + connect(m_swapCheck, TQT_SIGNAL(toggled(bool)), + m_swapCombo, TQT_SLOT(setEnabled(bool))); + connect(m_swapCheck, TQT_SIGNAL(toggled(bool)), + m_swapAdd, TQT_SLOT(setEnabled(bool))); - m_swapFormat = new QLabel(this); + m_swapFormat = new TQLabel(this); m_swapFormat->setText(i18n("Swap format:")); m_subLayout->addWidget(m_swapFormat); @@ -487,37 +487,37 @@ KSim::SwapPrefs::SwapPrefs(QWidget *parent, const char *name) m_subLayout->addWidget(m_swapAdd); m_mainLayout->addLayout(m_subLayout); - m_swapInfo = new QLabel(this); + m_swapInfo = new TQLabel(this); m_swapInfo->setText(i18n("The text in the edit box will be what is " "displayed as \nthe swap & free swap except the % items " "will be \nreplaced with the legend")); m_mainLayout->addWidget(m_swapInfo); - m_swapBox = new QGroupBox(this); + m_swapBox = new TQGroupBox(this); m_swapBox->setTitle(i18n("Swap Legend")); m_swapBox->setColumnLayout(0, Qt::Vertical); m_swapBox->layout()->setSpacing(0); m_swapBox->layout()->setMargin(0); - m_boxLayout = new QVBoxLayout(m_swapBox->layout()); + m_boxLayout = new TQVBoxLayout(m_swapBox->layout()); m_boxLayout->setAlignment(Qt::AlignTop); m_boxLayout->setSpacing(6); m_boxLayout->setMargin(11); - m_stLabel = new QLabel(m_swapBox); + m_stLabel = new TQLabel(m_swapBox); m_stLabel->setText(i18n("%t - Total swap")); m_boxLayout->addWidget(m_stLabel); - m_sfLabel = new QLabel(m_swapBox); + m_sfLabel = new TQLabel(m_swapBox); m_sfLabel->setText(i18n("%f - Total free swap")); m_boxLayout->addWidget(m_sfLabel); - m_suLabel = new QLabel(m_swapBox); + m_suLabel = new TQLabel(m_swapBox); m_suLabel->setText(i18n("%u - Total used swap")); m_boxLayout->addWidget(m_suLabel); m_mainLayout->addWidget(m_swapBox); - QSpacerItem *spacer = new QSpacerItem(20, 20, - QSizePolicy::Minimum, QSizePolicy::Expanding); + TQSpacerItem *spacer = new TQSpacerItem(20, 20, + TQSizePolicy::Minimum, TQSizePolicy::Expanding); m_mainLayout->addItem(spacer); } @@ -529,7 +529,7 @@ void KSim::SwapPrefs::saveConfig(KSim::Config *config) { config->setSwapItem(m_swapCombo->currentItem()); - QStringList comboItems; + TQStringList comboItems; for (int i = 0; i < m_swapCombo->count(); i++) comboItems.append(m_swapCombo->text(i)); @@ -541,8 +541,8 @@ void KSim::SwapPrefs::readConfig(KSim::Config *config) { m_swapCheck->setChecked(config->showSwap()); - QStringList::ConstIterator it; - QStringList items = config->swapFormatList(); + TQStringList::ConstIterator it; + TQStringList items = config->swapFormatList(); for (it = items.begin(); it != items.end(); ++it) if (!m_swapCombo->contains(*it)) m_swapCombo->insertItem(*it); @@ -550,16 +550,16 @@ void KSim::SwapPrefs::readConfig(KSim::Config *config) m_swapCombo->setCurrentItem(config->swapItem()); } -void KSim::SwapPrefs::swapContextMenu(QPopupMenu *menu) +void KSim::SwapPrefs::swapContextMenu(TQPopupMenu *menu) { menu->insertSeparator(); - menu->insertItem(m_addIcon, i18n("Insert Item"), this, SLOT(insertSwapItem())); - menu->insertItem(m_removeIcon, i18n("Remove Item"), this, SLOT(removeSwapItem())); + menu->insertItem(m_addIcon, i18n("Insert Item"), this, TQT_SLOT(insertSwapItem())); + menu->insertItem(m_removeIcon, i18n("Remove Item"), this, TQT_SLOT(removeSwapItem())); } void KSim::SwapPrefs::insertSwapItem() { - QString text = m_swapCombo->lineEdit()->text(); + TQString text = m_swapCombo->lineEdit()->text(); if (!m_swapCombo->contains(text)) { m_swapCombo->insertItem(text); m_swapCombo->setCurrentItem(m_swapCombo->count() - 1); diff --git a/ksim/generalprefs.h b/ksim/generalprefs.h index b163dac..3b861a8 100644 --- a/ksim/generalprefs.h +++ b/ksim/generalprefs.h @@ -20,8 +20,8 @@ #ifndef GENERAL_H #define GENERAL_H -#include <qwidget.h> -#include <qiconset.h> +#include <tqwidget.h> +#include <tqiconset.h> class QVBoxLayout; class QHBoxLayout; @@ -44,7 +44,7 @@ namespace KSim { Q_OBJECT public: - GeneralPrefs(QWidget *parent, const char *name=0); + GeneralPrefs(TQWidget *parent, const char *name=0); ~GeneralPrefs(); public slots: @@ -52,21 +52,21 @@ namespace KSim void readConfig(KSim::Config *); private: - QGridLayout *m_mainLayout; - QGroupBox *m_sizeBox; - QLabel *m_sizeHLabel; + TQGridLayout *m_mainLayout; + TQGroupBox *m_sizeBox; + TQLabel *m_sizeHLabel; KIntSpinBox *m_sizeHSpin; - QLabel *m_sizeWLabel; + TQLabel *m_sizeWLabel; KIntSpinBox *m_sizeWSpin; - QCheckBox *m_displayFqdn; - QCheckBox *m_recolourThemes; + TQCheckBox *m_displayFqdn; + TQCheckBox *m_recolourThemes; }; class ClockPrefs : public QWidget { Q_OBJECT public: - ClockPrefs(QWidget *parent, const char *name=0); + ClockPrefs(TQWidget *parent, const char *name=0); ~ClockPrefs(); public slots: @@ -74,16 +74,16 @@ namespace KSim void readConfig(KSim::Config *); private: - QVBoxLayout *m_mainLayout; - QCheckBox *m_timeCheck; - QCheckBox *m_dateCheck; + TQVBoxLayout *m_mainLayout; + TQCheckBox *m_timeCheck; + TQCheckBox *m_dateCheck; }; class UptimePrefs : public QWidget { Q_OBJECT public: - UptimePrefs(QWidget *parent, const char *name=0); + UptimePrefs(TQWidget *parent, const char *name=0); ~UptimePrefs(); public slots: @@ -91,33 +91,33 @@ namespace KSim void readConfig(KSim::Config *); private slots: - void uptimeContextMenu(QPopupMenu *); + void uptimeContextMenu(TQPopupMenu *); void insertUptimeItem(); void removeUptimeItem(); private: - QVBoxLayout *m_mainLayout; - QHBoxLayout *m_subLayout; - QVBoxLayout *m_boxLayout; + TQVBoxLayout *m_mainLayout; + TQHBoxLayout *m_subLayout; + TQVBoxLayout *m_boxLayout; KComboBox *m_uptimeCombo; - QPushButton *m_uptimeAdd; - QCheckBox *m_uptimeCheck; - QLabel *m_formatLabel; - QLabel *m_uptimeInfo; - QGroupBox *m_uptimeBox; - QLabel *m_udLabel; - QLabel *m_uhLabel; - QLabel *m_umLabel; - QLabel *m_usLabel; - QIconSet m_addIcon; - QIconSet m_removeIcon; + TQPushButton *m_uptimeAdd; + TQCheckBox *m_uptimeCheck; + TQLabel *m_formatLabel; + TQLabel *m_uptimeInfo; + TQGroupBox *m_uptimeBox; + TQLabel *m_udLabel; + TQLabel *m_uhLabel; + TQLabel *m_umLabel; + TQLabel *m_usLabel; + TQIconSet m_addIcon; + TQIconSet m_removeIcon; }; class MemoryPrefs : public QWidget { Q_OBJECT public: - MemoryPrefs(QWidget *parent, const char *name=0); + MemoryPrefs(TQWidget *parent, const char *name=0); ~MemoryPrefs(); public slots: @@ -125,35 +125,35 @@ namespace KSim void readConfig(KSim::Config *); private slots: - void memoryContextMenu(QPopupMenu *); + void memoryContextMenu(TQPopupMenu *); void insertMemoryItem(); void removeMemoryItem(); private: - QVBoxLayout *m_mainLayout; - QHBoxLayout *m_subLayout; - QVBoxLayout *m_boxLayout; - QCheckBox *m_memCheck; - QLabel *m_memFormat; + TQVBoxLayout *m_mainLayout; + TQHBoxLayout *m_subLayout; + TQVBoxLayout *m_boxLayout; + TQCheckBox *m_memCheck; + TQLabel *m_memFormat; KComboBox *m_memCombo; - QLabel *m_memInfo; - QGroupBox *m_memBox; - QLabel *m_mtLabel; - QLabel *m_mfLabel; - QLabel *m_muLabel; - QLabel *m_mcLabel; - QLabel *m_mbLabel; - QLabel *m_msLabel; - QPushButton *m_memoryAdd; - QIconSet m_addIcon; - QIconSet m_removeIcon; + TQLabel *m_memInfo; + TQGroupBox *m_memBox; + TQLabel *m_mtLabel; + TQLabel *m_mfLabel; + TQLabel *m_muLabel; + TQLabel *m_mcLabel; + TQLabel *m_mbLabel; + TQLabel *m_msLabel; + TQPushButton *m_memoryAdd; + TQIconSet m_addIcon; + TQIconSet m_removeIcon; }; class SwapPrefs : public QWidget { Q_OBJECT public: - SwapPrefs(QWidget *parent, const char *name=0); + SwapPrefs(TQWidget *parent, const char *name=0); ~SwapPrefs(); public slots: @@ -161,25 +161,25 @@ namespace KSim void readConfig(KSim::Config *); private slots: - void swapContextMenu(QPopupMenu *); + void swapContextMenu(TQPopupMenu *); void insertSwapItem(); void removeSwapItem(); private: - QVBoxLayout *m_mainLayout; - QHBoxLayout *m_subLayout; - QVBoxLayout *m_boxLayout; - QCheckBox *m_swapCheck; - QLabel *m_swapFormat; + TQVBoxLayout *m_mainLayout; + TQHBoxLayout *m_subLayout; + TQVBoxLayout *m_boxLayout; + TQCheckBox *m_swapCheck; + TQLabel *m_swapFormat; KComboBox *m_swapCombo; - QLabel *m_swapInfo; - QGroupBox *m_swapBox; - QLabel *m_stLabel; - QLabel *m_sfLabel; - QLabel *m_suLabel; - QPushButton *m_swapAdd; - QIconSet m_addIcon; - QIconSet m_removeIcon; + TQLabel *m_swapInfo; + TQGroupBox *m_swapBox; + TQLabel *m_stLabel; + TQLabel *m_sfLabel; + TQLabel *m_suLabel; + TQPushButton *m_swapAdd; + TQIconSet m_addIcon; + TQIconSet m_removeIcon; }; } #endif diff --git a/ksim/ksim.cpp b/ksim/ksim.cpp index 86ea980..8a2b643 100644 --- a/ksim/ksim.cpp +++ b/ksim/ksim.cpp @@ -23,7 +23,7 @@ #include <ksimconfig.h> #include <common.h> -#include <qlayout.h> +#include <tqlayout.h> #include <kaboutapplication.h> #include <kbugreport.h> @@ -35,7 +35,7 @@ extern "C" { - KDE_EXPORT KPanelExtension *init(QWidget *parent, const QString &configFile) + KDE_EXPORT KPanelExtension *init(TQWidget *parent, const TQString &configFile) { KGlobal::locale()->insertCatalogue("ksim"); return new KSim::PanelExtension(configFile, KPanelExtension::Normal, @@ -45,8 +45,8 @@ extern "C" } } -KSim::PanelExtension::PanelExtension(const QString &configFile, - Type type, int actions, QWidget *parent, const char *name) +KSim::PanelExtension::PanelExtension(const TQString &configFile, + Type type, int actions, TQWidget *parent, const char *name) : KPanelExtension(configFile, type, actions, parent, name) { m_dcopClient = new DCOPClient; @@ -75,12 +75,12 @@ KSim::PanelExtension::~PanelExtension() delete m_dcopClient; } -QSize KSim::PanelExtension::sizeHint(Position p, QSize maxSize) const +TQSize KSim::PanelExtension::sizeHint(Position p, TQSize maxSize) const { return m_view->sizeHint(p, maxSize); } -void KSim::PanelExtension::resizeEvent(QResizeEvent *) +void KSim::PanelExtension::resizeEvent(TQResizeEvent *) { m_view->resize(size()); } diff --git a/ksim/ksim.h b/ksim/ksim.h index 8a43a06..3bdc341 100644 --- a/ksim/ksim.h +++ b/ksim/ksim.h @@ -36,13 +36,13 @@ namespace KSim { Q_OBJECT public: - PanelExtension( const QString & configFile, Type type, - int actions, QWidget * parent, const char * name); + PanelExtension( const TQString & configFile, Type type, + int actions, TQWidget * parent, const char * name); ~PanelExtension(); - QSize sizeHint( Position, QSize maxSize ) const; - void resizeEvent(QResizeEvent *); + TQSize sizeHint( Position, TQSize maxSize ) const; + void resizeEvent(TQResizeEvent *); Position preferedPosition() const; void reparse(); @@ -59,7 +59,7 @@ namespace KSim private: KSim::MainView * m_view; - QBoxLayout * m_layout; + TQBoxLayout * m_layout; KAboutData * m_aboutData; DCOPClient * m_dcopClient; }; diff --git a/ksim/ksimframe.cpp b/ksim/ksimframe.cpp index e69a6c6..a76eddf 100644 --- a/ksim/ksimframe.cpp +++ b/ksim/ksimframe.cpp @@ -23,8 +23,8 @@ #include "ksim.h" #include "themetypes.h" -KSim::Frame::Frame(int type, QWidget *parent, const char *name) - : QWidget (parent, name) +KSim::Frame::Frame(int type, TQWidget *parent, const char *name) + : TQWidget (parent, name) { setType(type); @@ -62,15 +62,15 @@ void KSim::Frame::configureObject(bool repaintWidget) update(); } -void KSim::Frame::paintEvent(QPaintEvent *) +void KSim::Frame::paintEvent(TQPaintEvent *) { bitBlt(this, 0, 0, &m_background); } -void KSim::Frame::resizeEvent(QResizeEvent *ev) +void KSim::Frame::resizeEvent(TQResizeEvent *ev) { m_background.convertFromImage(m_image.smoothScale(ev->size())); - QWidget::resizeEvent(ev); + TQWidget::resizeEvent(ev); } void KSim::Frame::setFrameHeight(int height) diff --git a/ksim/ksimframe.h b/ksim/ksimframe.h index b7b397f..5b8db0e 100644 --- a/ksim/ksimframe.h +++ b/ksim/ksimframe.h @@ -20,8 +20,8 @@ #ifndef KSIMFRAME_H #define KSIMFRAME_H -#include <qwidget.h> -#include <qimage.h> +#include <tqwidget.h> +#include <tqimage.h> #include <common.h> namespace KSim @@ -31,19 +31,19 @@ namespace KSim /** * @internal */ - class Frame : public QWidget, public KSim::Base + class Frame : public TQWidget, public KSim::Base { Q_OBJECT public: - Frame(int type, QWidget *parent, const char *name = 0); + Frame(int type, TQWidget *parent, const char *name = 0); ~Frame(); - const QPixmap *const background() const { return &m_background; } + const TQPixmap *const background() const { return &m_background; } virtual void configureObject(bool repaintWidget=true); protected: - virtual void paintEvent(QPaintEvent *); - virtual void resizeEvent(QResizeEvent *); + virtual void paintEvent(TQPaintEvent *); + virtual void resizeEvent(TQResizeEvent *); private: // helper functions to make @@ -53,11 +53,11 @@ namespace KSim int m_origWidth; int m_origHeight; - QPoint m_globalBottomRight; - QPoint m_globalTopLeft; - QPoint m_origPos; - QImage m_image; - QPixmap m_background; + TQPoint m_globalBottomRight; + TQPoint m_globalTopLeft; + TQPoint m_origPos; + TQImage m_image; + TQPixmap m_background; }; } #endif diff --git a/ksim/ksimpref.cpp b/ksim/ksimpref.cpp index d8aa12d..c4ff4dc 100644 --- a/ksim/ksimpref.cpp +++ b/ksim/ksimpref.cpp @@ -33,11 +33,11 @@ #include <kstandarddirs.h> #include <kmessagebox.h> -#include <qhbox.h> -#include <qframe.h> +#include <tqhbox.h> +#include <tqframe.h> KSim::ConfigDialog::ConfigDialog(KSim::Config *config, - QWidget *parent, const char *name) + TQWidget *parent, const char *name) : KDialogBase(TreeList, i18n("Configure"), Help | Ok | Apply | Close, Ok, parent, name, true, true) { @@ -47,53 +47,53 @@ KSim::ConfigDialog::ConfigDialog(KSim::Config *config, m_config = config; - setFolderIcon(QStringList(' ' + i18n("Plugins")), + setFolderIcon(TQStringList(' ' + i18n("Plugins")), BarIcon("folder", KIcon::SizeSmall)); - setFolderIcon(QStringList(' ' + i18n("Miscellaneous")), + setFolderIcon(TQStringList(' ' + i18n("Miscellaneous")), BarIcon("misc", KIcon::SizeSmall)); - QFrame *monitors = addHBoxPage(' ' + i18n("Monitors"), + TQFrame *monitors = addHBoxPage(' ' + i18n("Monitors"), i18n("Monitors Installed"), BarIcon("ksim", KIcon::SizeSmall)); m_monPage = new KSim::MonitorPrefs(monitors); - QStringList list; + TQStringList list; list << ' ' + i18n("Miscellaneous") << ' ' + i18n("General"); - QFrame *general = addHBoxPage(list, i18n("General Options"), + TQFrame *general = addHBoxPage(list, i18n("General Options"), SmallIcon("misc")); m_generalPage = new KSim::GeneralPrefs(general); list.clear(); list << ' ' + i18n("Miscellaneous") << ' ' + i18n("Clock"); - QFrame *clock = addHBoxPage(list, i18n("Clock Options"), - QPixmap(locate("data", "ksim/pics/clock.png"))); + TQFrame *clock = addHBoxPage(list, i18n("Clock Options"), + TQPixmap(locate("data", "ksim/pics/clock.png"))); m_clockPage = new KSim::ClockPrefs(clock); list.clear(); list << ' ' + i18n("Miscellaneous") << ' ' + i18n("Uptime"); - QFrame *uptime = addHBoxPage(list, i18n("Uptime Options"), - QPixmap(locate("data", "ksim/pics/uptime.png"))); + TQFrame *uptime = addHBoxPage(list, i18n("Uptime Options"), + TQPixmap(locate("data", "ksim/pics/uptime.png"))); m_uptimePage = new KSim::UptimePrefs(uptime); list.clear(); list << ' ' + i18n("Miscellaneous") << ' ' + i18n("Memory"); - QFrame *memory = addHBoxPage(list, i18n("Memory Options"), + TQFrame *memory = addHBoxPage(list, i18n("Memory Options"), SmallIcon("memory")); m_memoryPage = new KSim::MemoryPrefs(memory); list.clear(); list << ' ' + i18n("Miscellaneous") << ' ' + i18n("Swap"); - QFrame *swap = addHBoxPage(list, i18n("Swap Options"), + TQFrame *swap = addHBoxPage(list, i18n("Swap Options"), SmallIcon("hdd_unmount")); m_swapPage = new KSim::SwapPrefs(swap); - QFrame *theme = addHBoxPage(' ' + i18n("Themes"), + TQFrame *theme = addHBoxPage(' ' + i18n("Themes"), i18n("Theme Selector"), BarIcon("folder_image", KIcon::SizeSmall)); m_themePage = new KSim::ThemePrefs(theme); - connect(this, SIGNAL(applyClicked()), SLOT(savePrefs())); - connect(this, SIGNAL(okClicked()), SLOT(closePrefs())); - connect(this, SIGNAL(closeClicked()), SLOT(loadPluginConfig())); - connect(parent, SIGNAL(reload()), SLOT(reload())); + connect(this, TQT_SIGNAL(applyClicked()), TQT_SLOT(savePrefs())); + connect(this, TQT_SIGNAL(okClicked()), TQT_SLOT(closePrefs())); + connect(this, TQT_SIGNAL(closeClicked()), TQT_SLOT(loadPluginConfig())); + connect(parent, TQT_SIGNAL(reload()), TQT_SLOT(reload())); KSim::PluginList::ConstIterator it; const KSim::PluginList &pluginList = KSim::PluginLoader::self().pluginList(); @@ -117,7 +117,7 @@ void KSim::ConfigDialog::reload() enableButtons(); } -void KSim::ConfigDialog::removePage(const QCString &name) +void KSim::ConfigDialog::removePage(const TQCString &name) { const KSim::Plugin &plugin = KSim::PluginLoader::self().find(name); if (plugin.isNull() || !plugin.configPage()) { @@ -126,18 +126,18 @@ void KSim::ConfigDialog::removePage(const QCString &name) return; } - QWidget *frame = plugin.configPage()->parentWidget(); + TQWidget *frame = plugin.configPage()->parentWidget(); // reparent the widget if the parent is not null if (frame) { plugin.configPage()->hide(); - plugin.configPage()->reparent(0, QPoint(0, 0), false); + plugin.configPage()->reparent(0, TQPoint(0, 0), false); // delete the frame so it removes the page from the config dialog delete frame; kdDebug(2003) << "removing " << name << " from KSimPref" << endl; } } -void KSim::ConfigDialog::createPage(const QCString &name) +void KSim::ConfigDialog::createPage(const TQCString &name) { const KSim::Plugin &plugin = KSim::PluginLoader::self().find(name); createPage(plugin); @@ -154,17 +154,17 @@ void KSim::ConfigDialog::createPage(const KSim::Plugin &plugin) kdDebug(2003) << "adding " << plugin.libName() << " to KSimPref" << endl; - QStringList list; + TQStringList list; list << ' ' + i18n("Plugins") << ' ' + plugin.name(); - QFrame *pluginFrame = addHBoxPage(list, i18n("%1 Options").arg(plugin.name()), + TQFrame *pluginFrame = addHBoxPage(list, i18n("%1 Options").arg(plugin.name()), plugin.icon()); - plugin.configPage()->reparent(pluginFrame, QPoint(0, 0), true); + plugin.configPage()->reparent(pluginFrame, TQPoint(0, 0), true); plugin.configPage()->readConfig(); // TODO: implement this correctly one day -// connect (info.configPage(), SIGNAL(pageChanged()), -// this, SLOT(enableButtons())); +// connect (info.configPage(), TQT_SIGNAL(pageChanged()), +// this, TQT_SLOT(enableButtons())); } void KSim::ConfigDialog::savePrefs() @@ -185,8 +185,8 @@ void KSim::ConfigDialog::saveConfig(bool reload) m_themePage->saveConfig(m_config); ChangedPluginList changedPlugins; - for (QListViewItemIterator it(m_monPage); it.current(); ++it) { - QCheckListItem *item = static_cast<QCheckListItem *>(it.current()); + for (TQListViewItemIterator it(m_monPage); it.current(); ++it) { + TQCheckListItem *item = static_cast<TQCheckListItem *>(it.current()); KSim::PluginInfo info = KSim::PluginLoader::self().findPluginInfo(item->text(0), KSim::PluginLoader::Name); changedPlugins.append(ChangedPlugin(item->isOn(), @@ -211,8 +211,8 @@ void KSim::ConfigDialog::readConfig() m_themePage->readConfig(m_config); m_currentPlugins.clear(); - for (QListViewItemIterator it(m_monPage); it.current(); ++it) { - QCheckListItem *item = static_cast<QCheckListItem *>(it.current()); + for (TQListViewItemIterator it(m_monPage); it.current(); ++it) { + TQCheckListItem *item = static_cast<TQCheckListItem *>(it.current()); KSim::PluginInfo info = KSim::PluginLoader::self().findPluginInfo(item->text(0), KSim::PluginLoader::Name); m_currentPlugins.append(ChangedPlugin(item->isOn(), @@ -248,7 +248,7 @@ void KSim::ConfigDialog::disableButtons() enableButtonOK(false); } -const KSim::ChangedPlugin &KSim::ConfigDialog::findPlugin(const QString &name) const +const KSim::ChangedPlugin &KSim::ConfigDialog::findPlugin(const TQString &name) const { ChangedPluginList::ConstIterator it; for (it = m_currentPlugins.begin(); it != m_currentPlugins.end(); ++it) { diff --git a/ksim/ksimpref.h b/ksim/ksimpref.h index 8e560a8..e7afc13 100644 --- a/ksim/ksimpref.h +++ b/ksim/ksimpref.h @@ -41,29 +41,29 @@ namespace KSim { public: ChangedPlugin() : m_name(0) {} - ChangedPlugin(bool enabled, const QCString &libname, - const QString &name, const QString &file) : m_enabled(enabled), + ChangedPlugin(bool enabled, const TQCString &libname, + const TQString &name, const TQString &file) : m_enabled(enabled), m_libname(libname), m_name(name), m_file(file) {} - ChangedPlugin(bool enabled, const QCString &libname, - const QString &name, const QString &file, bool oldState) + ChangedPlugin(bool enabled, const TQCString &libname, + const TQString &name, const TQString &file, bool oldState) : m_enabled(enabled), m_libname(libname), m_name(name), m_file(file), m_oldState(oldState) {} bool isEnabled() const { return m_enabled; } bool isDifferent() const { return m_enabled != m_oldState; } - const QCString &libName() const { return m_libname; } - const QString &name() const { return m_name; } - const QString &filename() const { return m_file; } + const TQCString &libName() const { return m_libname; } + const TQString &name() const { return m_name; } + const TQString &filename() const { return m_file; } private: bool m_enabled; - QCString m_libname; - QString m_name; - QString m_file; + TQCString m_libname; + TQString m_name; + TQString m_file; bool m_oldState; }; - class ChangedPluginList : public QValueList<ChangedPlugin> + class ChangedPluginList : public TQValueList<ChangedPlugin> { public: ChangedPluginList() {} @@ -74,12 +74,12 @@ namespace KSim { Q_OBJECT public: - ConfigDialog(KSim::Config *config, QWidget *parent, const char *name = 0); + ConfigDialog(KSim::Config *config, TQWidget *parent, const char *name = 0); ~ConfigDialog(); public slots: - void removePage(const QCString &name); - void createPage(const QCString &name); // overload + void removePage(const TQCString &name); + void createPage(const TQCString &name); // overload void createPage(const KSim::Plugin &plugin); signals: @@ -96,7 +96,7 @@ namespace KSim void disableButtons(); private: - const KSim::ChangedPlugin &findPlugin(const QString &name) const; + const KSim::ChangedPlugin &findPlugin(const TQString &name) const; ChangedPluginList m_currentPlugins; KSim::MonitorPrefs *m_monPage; diff --git a/ksim/ksimsysinfo.cpp b/ksim/ksimsysinfo.cpp index 724adb6..7140e3a 100644 --- a/ksim/ksimsysinfo.cpp +++ b/ksim/ksimsysinfo.cpp @@ -17,12 +17,12 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#include <qtooltip.h> -#include <qlayout.h> -#include <qtimer.h> -#include <qregexp.h> -#include <qtextstream.h> -#include <qdatetime.h> +#include <tqtooltip.h> +#include <tqlayout.h> +#include <tqtimer.h> +#include <tqregexp.h> +#include <tqtextstream.h> +#include <tqdatetime.h> #include <kdebug.h> #include <klocale.h> @@ -41,11 +41,11 @@ #include <string.h> KSim::Sysinfo::Sysinfo(KSim::Config *config, - QWidget *parent, const char *name, WFlags fl) - : DCOPObject("sysinfo"), QWidget(parent, name, fl) + TQWidget *parent, const char *name, WFlags fl) + : DCOPObject("sysinfo"), TQWidget(parent, name, fl) { m_config = config; - m_layout = new QVBoxLayout(this); + m_layout = new TQVBoxLayout(this); m_timeLabel = 0L; m_dateLabel = 0L; @@ -54,11 +54,11 @@ KSim::Sysinfo::Sysinfo(KSim::Config *config, m_swapLabel = 0L; //m_procsLabel = 0L; - m_timer = new QTimer(this); - connect(m_timer, SIGNAL(timeout()), SLOT(clockUptimeUpdate())); + m_timer = new TQTimer(this); + connect(m_timer, TQT_SIGNAL(timeout()), TQT_SLOT(clockUptimeUpdate())); - m_sysTimer = new QTimer(this); - connect(m_sysTimer, SIGNAL(timeout()), SLOT(sysUpdate())); + m_sysTimer = new TQTimer(this); + connect(m_sysTimer, TQT_SIGNAL(timeout()), TQT_SLOT(sysUpdate())); createView(); } @@ -71,13 +71,13 @@ KSim::Sysinfo::~Sysinfo() void KSim::Sysinfo::clockUptimeUpdate() { - QString time; + TQString time; static bool updateDate = true; if (m_timeLabel) { - QTime now = QTime::currentTime(); + TQTime now = TQTime::currentTime(); time = KGlobal::locale()->formatTime(now, true); - if ( now == QTime(0, 0) ) + if ( now == TQTime(0, 0) ) updateDate = true; m_timeLabel->setText(time); @@ -86,7 +86,7 @@ void KSim::Sysinfo::clockUptimeUpdate() // only update the date when necessary if (m_dateLabel) { if (updateDate) { - m_dateLabel->setText(KGlobal::locale()->formatDate(QDate::currentDate())); + m_dateLabel->setText(KGlobal::locale()->formatDate(TQDate::currentDate())); updateDate = false; } } @@ -95,7 +95,7 @@ void KSim::Sysinfo::clockUptimeUpdate() } if (m_uptimeLabel) { - QString uptime = m_config->uptimeFormat(); + TQString uptime = m_config->uptimeFormat(); ++m_totalUptime; long uptimeDays, uptimeHours, uptimeMins, uptimeSecs; @@ -104,13 +104,13 @@ void KSim::Sysinfo::clockUptimeUpdate() uptimeMins = (m_totalUptime - uptimeHours * 3600) / 60; uptimeSecs = m_totalUptime % 60; - QString days; - QString hours; - QString minutes; - QString seconds; + TQString days; + TQString hours; + TQString minutes; + TQString seconds; // found days so we have to modify hours - if (uptime.find(QRegExp("%d" ), 0) >= 0) + if (uptime.find(TQRegExp("%d" ), 0) >= 0) uptimeHours -= (uptimeDays * 24); days.sprintf("%02li", uptimeDays); @@ -118,10 +118,10 @@ void KSim::Sysinfo::clockUptimeUpdate() minutes.sprintf("%02li", uptimeMins); seconds.sprintf("%02li", uptimeSecs); - uptime.replace(QRegExp("%d"), days); - uptime.replace(QRegExp("%h"), hours); - uptime.replace(QRegExp("%m"), minutes); - uptime.replace(QRegExp("%s"), seconds); + uptime.replace(TQRegExp("%d"), days); + uptime.replace(TQRegExp("%h"), hours); + uptime.replace(TQRegExp("%m"), minutes); + uptime.replace(TQRegExp("%s"), seconds); m_uptimeLabel->setText(uptime); } } @@ -132,7 +132,7 @@ void KSim::Sysinfo::sysUpdate() m_totalUptime = system.uptime(); if (m_memLabel) { - QString memory = m_config->memoryFormat(); + TQString memory = m_config->memoryFormat(); unsigned long total = system.totalRam(); unsigned long free = system.freeRam(); unsigned long shared = system.sharedRam(); @@ -142,16 +142,16 @@ void KSim::Sysinfo::sysUpdate() unsigned long allFree = free + buffer + cache; bool all = memory.find( "%F" ) != -1; - memory.replace(QRegExp("%s"), QString::number(System::bytesToMegs(shared))); - memory.replace(QRegExp("%b"), QString::number(System::bytesToMegs(buffer))); - memory.replace(QRegExp("%c"), QString::number(System::bytesToMegs(cache))); - memory.replace(QRegExp("%u"), QString::number(System::bytesToMegs(used))); - memory.replace(QRegExp("%t"), QString::number(System::bytesToMegs(total))); - memory.replace(QRegExp("%f"), QString::number(System::bytesToMegs(free))); - memory.replace(QRegExp("%F"), QString::number(System::bytesToMegs(allFree))); + memory.replace(TQRegExp("%s"), TQString::number(System::bytesToMegs(shared))); + memory.replace(TQRegExp("%b"), TQString::number(System::bytesToMegs(buffer))); + memory.replace(TQRegExp("%c"), TQString::number(System::bytesToMegs(cache))); + memory.replace(TQRegExp("%u"), TQString::number(System::bytesToMegs(used))); + memory.replace(TQRegExp("%t"), TQString::number(System::bytesToMegs(total))); + memory.replace(TQRegExp("%f"), TQString::number(System::bytesToMegs(free))); + memory.replace(TQRegExp("%F"), TQString::number(System::bytesToMegs(allFree))); kdDebug(2003) << memory << endl; m_memLabel->setText("Memory"); - QToolTip::add(m_memLabel, memory ); + TQToolTip::add(m_memLabel, memory ); if ( !all ) m_memLabel->setValue( System::bytesToMegs( total ) - System::bytesToMegs( free ) ); @@ -160,15 +160,15 @@ void KSim::Sysinfo::sysUpdate() } if (m_swapLabel) { - QString swap = m_config->swapFormat(); + TQString swap = m_config->swapFormat(); unsigned long total = system.totalSwap(); unsigned long free = system.freeSwap(); unsigned long swapUsed = system.usedSwap(); - swap.replace(QRegExp("%u"), QString::number(System::bytesToMegs(swapUsed))); - swap.replace(QRegExp("%t"), QString::number(System::bytesToMegs(total))); - swap.replace(QRegExp("%f"), QString::number(System::bytesToMegs(free))); + swap.replace(TQRegExp("%u"), TQString::number(System::bytesToMegs(swapUsed))); + swap.replace(TQRegExp("%t"), TQString::number(System::bytesToMegs(total))); + swap.replace(TQRegExp("%f"), TQString::number(System::bytesToMegs(free))); m_swapLabel->setText("Swap"); - QToolTip::add(m_swapLabel, swap); + TQToolTip::add(m_swapLabel, swap); m_swapLabel->setValue(System::bytesToMegs(total) - System::bytesToMegs(free)); } @@ -194,7 +194,7 @@ void KSim::Sysinfo::createView() m_timeLabel = new KSim::Label(this); m_layout->insertWidget(timeLocation - offset, m_timeLabel); } - QToolTip::add(m_timeLabel, i18n("Current system time")); + TQToolTip::add(m_timeLabel, i18n("Current system time")); m_timeLabel->show(); } else { @@ -208,7 +208,7 @@ void KSim::Sysinfo::createView() m_dateLabel = new KSim::Label(this); m_layout->insertWidget(dateLocation - offset, m_dateLabel); } - QToolTip::add(m_dateLabel, i18n("Current system date")); + TQToolTip::add(m_dateLabel, i18n("Current system date")); m_dateLabel->show(); } else { @@ -224,7 +224,7 @@ void KSim::Sysinfo::createView() m_uptimeLabel = new KSim::Label(KSim::Types::Uptime, this); m_layout->insertWidget(uptimeLocation - offset, m_uptimeLabel); } - QToolTip::add(m_uptimeLabel, i18n("System uptime")); + TQToolTip::add(m_uptimeLabel, i18n("System uptime")); m_uptimeLabel->show(); } else { @@ -300,7 +300,7 @@ void KSim::Sysinfo::startTimers() } } -QString KSim::Sysinfo::uptime() const +TQString KSim::Sysinfo::uptime() const { if (m_uptimeLabel) return m_uptimeLabel->text(); @@ -308,7 +308,7 @@ QString KSim::Sysinfo::uptime() const return i18n("Uptime display disabled"); } -QString KSim::Sysinfo::memInfo() const +TQString KSim::Sysinfo::memInfo() const { if (m_memLabel) return m_memLabel->text(); @@ -316,7 +316,7 @@ QString KSim::Sysinfo::memInfo() const return i18n("Memory display disabled"); } -QString KSim::Sysinfo::swapInfo() const +TQString KSim::Sysinfo::swapInfo() const { if (m_swapLabel) return m_swapLabel->text(); diff --git a/ksim/ksimsysinfo.h b/ksim/ksimsysinfo.h index 5c80d37..1bf245f 100644 --- a/ksim/ksimsysinfo.h +++ b/ksim/ksimsysinfo.h @@ -20,7 +20,7 @@ #ifndef SYSINFO_H #define SYSINFO_H -#include <qwidget.h> +#include <tqwidget.h> #include <dcopobject.h> class QTimer; @@ -31,19 +31,19 @@ namespace KSim class Label; class Progress; - class Sysinfo : public QWidget, virtual public DCOPObject + class Sysinfo : public TQWidget, virtual public DCOPObject { Q_OBJECT K_DCOP public: - Sysinfo(KSim::Config *config, QWidget *parent=0, + Sysinfo(KSim::Config *config, TQWidget *parent=0, const char *name=0, WFlags fl=0); ~Sysinfo(); k_dcop: - QString uptime() const; - QString memInfo() const; - QString swapInfo() const; + TQString uptime() const; + TQString memInfo() const; + TQString swapInfo() const; public slots: void clockUptimeUpdate(); @@ -60,9 +60,9 @@ namespace KSim KSim::Progress *m_memLabel; KSim::Progress *m_swapLabel; //KSimLabel *m_procsLabel; - QVBoxLayout *m_layout; - QTimer *m_timer; - QTimer *m_sysTimer; + TQVBoxLayout *m_layout; + TQTimer *m_timer; + TQTimer *m_sysTimer; KSim::Config *m_config; long m_totalUptime; }; diff --git a/ksim/ksimview.cpp b/ksim/ksimview.cpp index 6f71b66..18f29e9 100644 --- a/ksim/ksimview.cpp +++ b/ksim/ksimview.cpp @@ -46,15 +46,15 @@ #include <kwin.h> #include <krun.h> -#include <qfile.h> -#include <qbitmap.h> -#include <qtimer.h> -#include <qlayout.h> -#include <qobjectlist.h> -#include <qpainter.h> -#include <qcursor.h> -#include <qpopupmenu.h> -#include <qvbox.h> +#include <tqfile.h> +#include <tqbitmap.h> +#include <tqtimer.h> +#include <tqlayout.h> +#include <tqobjectlist.h> +#include <tqpainter.h> +#include <tqcursor.h> +#include <tqpopupmenu.h> +#include <tqvbox.h> #include <unistd.h> #include <sys/param.h> @@ -66,7 +66,7 @@ KSim::MainView::MainView(KConfig *config, bool loadPlugins, KSim::PanelExtension *topLevel, const char *name) : DCOPObject("KSim"), - QWidget(topLevel, name) + TQWidget(topLevel, name) { // create the local "themes" and "monitors" dirs makeDirs(); @@ -90,7 +90,7 @@ KSim::MainView::MainView(KConfig *config, kdDebug(2003) << "loadPlugins: " << loadPlugins << endl; - m_subLayout = new QVBoxLayout(this); + m_subLayout = new TQVBoxLayout(this); m_topFrame = new KSim::Frame(KSim::Types::TopFrame, this); m_subLayout->addWidget(m_topFrame); @@ -101,11 +101,11 @@ KSim::MainView::MainView(KConfig *config, m_leftFrame = new KSim::Frame(KSim::Types::LeftFrame, this); m_sizeLayout->addWidget(m_leftFrame); - m_pluginLayout = new QBoxLayout(QBoxLayout::TopToBottom); + m_pluginLayout = new TQBoxLayout(TQBoxLayout::TopToBottom); m_sizeLayout->addLayout(m_pluginLayout); - QVBoxLayout *vb = new QVBoxLayout; - QSpacerItem *item = new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Expanding); + TQVBoxLayout *vb = new QVBoxLayout; + TQSpacerItem *item = new TQSpacerItem(0, 0, TQSizePolicy::Expanding, TQSizePolicy::Expanding); vb->addItem(item); m_hostLabel = new KSim::Label(KSim::Types::Host, this); @@ -118,7 +118,7 @@ KSim::MainView::MainView(KConfig *config, if (gethostname(hostName, sizeof(hostName))) m_hostLabel->setText(i18n("Unknown")); else { - QCString host(hostName); + TQCString host(hostName); int dotLocation = host.find("."); if (!m_config->displayFqdn() && dotLocation != -1) host.truncate(dotLocation); @@ -127,7 +127,7 @@ KSim::MainView::MainView(KConfig *config, } vb = new QVBoxLayout; - item = new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Expanding); + item = new TQSpacerItem(0, 0, TQSizePolicy::Expanding, TQSizePolicy::Expanding); vb->addItem(item); m_sysinfo = new KSim::Sysinfo(m_config, this); vb->addWidget(m_sysinfo); @@ -140,8 +140,8 @@ KSim::MainView::MainView(KConfig *config, m_sizeLayout->addWidget(m_rightFrame); connect(&KSim::PluginLoader::self(), - SIGNAL(pluginLoaded(const KSim::Plugin &)), - this, SLOT(addMonitor(const KSim::Plugin &))); + TQT_SIGNAL(pluginLoaded(const KSim::Plugin &)), + this, TQT_SLOT(addMonitor(const KSim::Plugin &))); KSim::ThemeLoader::self().themeColours(this); @@ -150,7 +150,7 @@ KSim::MainView::MainView(KConfig *config, addPlugins(); } - connect(&m_maskTimer, SIGNAL(timeout()), SLOT(slotMaskMainView())); + connect(&m_maskTimer, TQT_SIGNAL(timeout()), TQT_SLOT(slotMaskMainView())); } KSim::MainView::~MainView() @@ -161,7 +161,7 @@ KSim::MainView::~MainView() void KSim::MainView::show() { maskMainView(); - QWidget::show(); + TQWidget::show(); } void KSim::MainView::cleanup() @@ -182,12 +182,12 @@ KSim::Config *KSim::MainView::config() const void KSim::MainView::makeDirs() { - QString homeDir = locateLocal("data", "ksim"); - QString themeDir = homeDir + QString::fromLatin1("/themes"); - QString monitorDir = homeDir + QString::fromLatin1("/monitors"); + TQString homeDir = locateLocal("data", "ksim"); + TQString themeDir = homeDir + TQString::fromLatin1("/themes"); + TQString monitorDir = homeDir + TQString::fromLatin1("/monitors"); // return true if the dirs already exist - if (QFile::exists(themeDir) && QFile::exists(monitorDir)) + if (TQFile::exists(themeDir) && TQFile::exists(monitorDir)) return; bool themeCreated = KStandardDirs::makeDir(themeDir); @@ -200,7 +200,7 @@ void KSim::MainView::makeDirs() } } -const QString &KSim::MainView::hostname() const +const TQString &KSim::MainView::hostname() const { return m_hostLabel->text(); } @@ -221,29 +221,29 @@ void KSim::MainView::maskMainView() return; } - QBitmap topPixmap(*m_topFrame->background()->mask()); - QBitmap leftPixmap(*m_leftFrame->background()->mask()); - QBitmap rightPixmap(*m_rightFrame->background()->mask()); - QBitmap bottomPixmap(*m_bottomFrame->background()->mask()); + TQBitmap topPixmap(*m_topFrame->background()->mask()); + TQBitmap leftPixmap(*m_leftFrame->background()->mask()); + TQBitmap rightPixmap(*m_rightFrame->background()->mask()); + TQBitmap bottomPixmap(*m_bottomFrame->background()->mask()); - QSize insideSize(m_pluginLayout->geometry().size()); + TQSize insideSize(m_pluginLayout->geometry().size()); // make a cleared bigrect where we can put our pixmap masks on - QBitmap bigBitmap(topLevelWidget()->size(), true); + TQBitmap bigBitmap(topLevelWidget()->size(), true); // better return if our bitmap is null so we can avoid crashes if (bigBitmap.isNull()) return; - QPoint ofs = mapTo(topLevelWidget(), QPoint(0,0)); + TQPoint ofs = mapTo(topLevelWidget(), TQPoint(0,0)); int ofsX = ofs.x(); int ofsY = ofs.y(); - QPainter painter; + TQPainter painter; painter.begin(&bigBitmap); painter.setBrush(color1); painter.setPen(color1); - QRect rect = m_pluginLayout->geometry(); + TQRect rect = m_pluginLayout->geometry(); rect.moveBy(ofsX, ofsY); painter.drawRect(rect); painter.drawPixmap(ofsX, ofsY, topPixmap); @@ -330,8 +330,8 @@ void KSim::MainView::reparseConfig(bool emitReload, void KSim::MainView::addPlugins() { - QStringList locatedFiles = KGlobal::dirs()->findAllResources("data", "ksim/monitors/*.desktop"); - QStringList::ConstIterator it; + TQStringList locatedFiles = KGlobal::dirs()->findAllResources("data", "ksim/monitors/*.desktop"); + TQStringList::ConstIterator it; for (it = locatedFiles.begin(); it != locatedFiles.end(); ++it) { const KDesktopFile kdf(*it, true); @@ -356,7 +356,7 @@ void KSim::MainView::addMonitor(const KSim::Plugin &plugin) if (!plugin.view()) return; - plugin.view()->reparent(this, 0, QPoint(0, 0), true); + plugin.view()->reparent(this, 0, TQPoint(0, 0), true); KSim::ThemeLoader::self().themeColours(plugin.view()); // int location = m_config->monitorLocation(plugin.libName()); @@ -371,20 +371,20 @@ void KSim::MainView::addMonitor(const KSim::Plugin &plugin) // kdDebug(2003) << "m_oldLocation: " << m_oldLocation << endl; // kdDebug(2003) << "location: " << location << endl; m_pluginLayout->addWidget(plugin.view()); - connect(plugin.view(), SIGNAL(runCommand(const QCString &)), - SLOT(runCommand(const QCString &))); + connect(plugin.view(), TQT_SIGNAL(runCommand(const TQCString &)), + TQT_SLOT(runCommand(const TQCString &))); // if (location > m_oldLocation) // m_oldLocation = location; } -void KSim::MainView::runCommand(const QCString &name) +void KSim::MainView::runCommand(const TQCString &name) { if (name.isNull()) return; kdDebug(2003) << "runCommand(" << name.mid(5) << ")" << endl; - QString exec = m_config->monitorCommand(name.mid(5)); + TQString exec = m_config->monitorCommand(name.mid(5)); kdDebug(2003) << "exec is " << exec << endl; KRun::runCommand(exec); } @@ -393,21 +393,21 @@ void KSim::MainView::preferences() { if (m_prefDialog == 0L) { m_prefDialog = new KSim::ConfigDialog(m_config, this, "m_prefDialog"); - connect(m_prefDialog, SIGNAL(reparse(bool, const KSim::ChangedPluginList &)), - this, SLOT(reparseConfig(bool, const KSim::ChangedPluginList &))); + connect(m_prefDialog, TQT_SIGNAL(reparse(bool, const KSim::ChangedPluginList &)), + this, TQT_SLOT(reparseConfig(bool, const KSim::ChangedPluginList &))); } m_prefDialog->exec(); destroyPref(); } -void KSim::MainView::resizeEvent(QResizeEvent *re) +void KSim::MainView::resizeEvent(TQResizeEvent *re) { - QWidget::resizeEvent(re); + TQWidget::resizeEvent(re); m_maskTimer.start(0, true); } -void KSim::MainView::paletteChange(const QPalette &) +void KSim::MainView::paletteChange(const TQPalette &) { // Call true here to fool the KSim::Base pointers to // think our theme changed, we can afford todo this @@ -430,16 +430,16 @@ void KSim::MainView::destroyPref() } } -QSize KSim::MainView::sizeHint(KPanelExtension::Position p, QSize) const +TQSize KSim::MainView::sizeHint(KPanelExtension::Position p, TQSize) const { int width = 0; int height = 0; - QLayoutItem *child; - for( QLayoutIterator it = m_pluginLayout->iterator(); + TQLayoutItem *child; + for( TQLayoutIterator it = m_pluginLayout->iterator(); (child = it.current()) != 0; ++it) { - QSize sz = child->minimumSize(); + TQSize sz = child->minimumSize(); if ((p == KPanelExtension::Right) || (p == KPanelExtension::Left)) { width = QMAX(width, sz.width()); @@ -455,13 +455,13 @@ QSize KSim::MainView::sizeHint(KPanelExtension::Position p, QSize) const width += m_leftFrame->minimumWidth() + m_rightFrame->minimumWidth(); height += m_topFrame->minimumHeight() + m_bottomFrame->minimumHeight(); - return QSize(width, height); + return TQSize(width, height); } void KSim::MainView::positionChange(KPanelExtension::Orientation o) { if (o == KPanelExtension::Vertical) - m_pluginLayout->setDirection(QBoxLayout::TopToBottom); + m_pluginLayout->setDirection(TQBoxLayout::TopToBottom); else - m_pluginLayout->setDirection(QBoxLayout::LeftToRight); + m_pluginLayout->setDirection(TQBoxLayout::LeftToRight); } diff --git a/ksim/ksimview.h b/ksim/ksimview.h index 4bf7f1f..22f0e09 100644 --- a/ksim/ksimview.h +++ b/ksim/ksimview.h @@ -20,8 +20,8 @@ #ifndef KSIMVIEW_H #define KSIMVIEW_H -#include <qwidget.h> -#include <qtimer.h> +#include <tqwidget.h> +#include <tqtimer.h> #include <dcopobject.h> @@ -46,7 +46,7 @@ namespace KSim class ConfigDialog; class ChangedPluginList; - class KDE_EXPORT MainView : public QWidget, virtual public DCOPObject + class KDE_EXPORT MainView : public TQWidget, virtual public DCOPObject { Q_OBJECT K_DCOP @@ -62,11 +62,11 @@ namespace KSim KSim::Config *config() const; void makeDirs(); - QSize sizeHint(KPanelExtension::Position, QSize maxSize) const; + TQSize sizeHint(KPanelExtension::Position, TQSize maxSize) const; void positionChange(KPanelExtension::Orientation); k_dcop: - const QString &hostname() const; + const TQString &hostname() const; virtual void maskMainView(); signals: @@ -78,13 +78,13 @@ namespace KSim void addPlugin(const KDesktopFile &, bool force = false); void removePlugin(const KDesktopFile &); void addMonitor(const KSim::Plugin &); - void runCommand(const QCString &); + void runCommand(const TQCString &); void preferences(); void slotMaskMainView(); protected: - virtual void resizeEvent(QResizeEvent *); - virtual void paletteChange(const QPalette &); + virtual void resizeEvent(TQResizeEvent *); + virtual void paletteChange(const TQPalette &); private slots: void destroyPref(); @@ -101,12 +101,12 @@ namespace KSim KSim::PanelExtension *m_topLevel; KSim::Config *m_config; KSim::ConfigDialog *m_prefDialog; - QHBoxLayout *m_sizeLayout; - QVBoxLayout *m_subLayout; - QBoxLayout *m_pluginLayout; - QPoint m_mousePoint; + TQHBoxLayout *m_sizeLayout; + TQVBoxLayout *m_subLayout; + TQBoxLayout *m_pluginLayout; + TQPoint m_mousePoint; int m_oldLocation; - QTimer m_maskTimer; + TQTimer m_maskTimer; }; } #endif // KSIMVIEW_H diff --git a/ksim/library/chart.cpp b/ksim/library/chart.cpp index 38f0f17..5128cdb 100644 --- a/ksim/library/chart.cpp +++ b/ksim/library/chart.cpp @@ -20,13 +20,13 @@ #include "chart.h" #include "chart.moc" -#include <qrect.h> -#include <qpainter.h> -#include <qimage.h> -#include <qcolor.h> -#include <qtimer.h> -#include <qvaluelist.h> -#include <qbitmap.h> +#include <tqrect.h> +#include <tqpainter.h> +#include <tqimage.h> +#include <tqcolor.h> +#include <tqtimer.h> +#include <tqvaluelist.h> +#include <tqbitmap.h> #include <kdebug.h> #include <klocale.h> @@ -49,8 +49,8 @@ class KSim::Chart::Timer qAddPostRoutine(cleanup); } - QObject::connect(m_timer, SIGNAL(timeout()), - chart, SLOT(updateDisplay())); + TQObject::connect(m_timer, TQT_SIGNAL(timeout()), + chart, TQT_SLOT(updateDisplay())); } static void disconnect(KSim::Chart *chart) @@ -58,8 +58,8 @@ class KSim::Chart::Timer if (!m_timer) return; - QObject::disconnect(m_timer, SIGNAL(timeout()), - chart, SLOT(updateDisplay())); + TQObject::disconnect(m_timer, TQT_SIGNAL(timeout()), + chart, TQT_SLOT(updateDisplay())); } private: @@ -72,50 +72,50 @@ class KSim::Chart::Timer m_timer = 0; } - static QTimer *m_timer; + static TQTimer *m_timer; }; -QTimer *KSim::Chart::Timer::m_timer = 0; +TQTimer *KSim::Chart::Timer::m_timer = 0; class KSim::Chart::Private { public: typedef QPair<int, int> ValuePair; - QSize size; + TQSize size; int type; bool showShadow; bool showKrell; - QString inText; - QString outText; - QString title; - QPixmap chartPixmap; - QPixmap gridPixmap; - QPixmap graphData; - QColor mColour; - QColor sColour; - QColor dataInColour; - QColor dataOutColour; + TQString inText; + TQString outText; + TQString title; + TQPixmap chartPixmap; + TQPixmap gridPixmap; + TQPixmap graphData; + TQColor mColour; + TQColor sColour; + TQColor dataInColour; + TQColor dataOutColour; Chart::LabelType labelType; KSim::Label *krell; // first will be data In and second will be data out - QValueList<ValuePair> values; - QValueList<int> maxValues; + TQValueList<ValuePair> values; + TQValueList<int> maxValues; int minValue; int maxValue; bool variableGraphs; }; KSim::Chart::Chart(bool showKrell, int maxValue, - const QString &title, QWidget *parent, const char *name, - WFlags fl) : QWidget(parent, name, fl) + const TQString &title, TQWidget *parent, const char *name, + WFlags fl) : TQWidget(parent, name, fl) { init(showKrell, maxValue, title); } KSim::Chart::Chart(bool showKrell, int maxValue, - QWidget *parent, const char *name, WFlags fl) - : QWidget(parent, name, fl) + TQWidget *parent, const char *name, WFlags fl) + : TQWidget(parent, name, fl) { init(showKrell, maxValue, i18n("None")); } @@ -126,7 +126,7 @@ KSim::Chart::~Chart() delete d; } -const QString &KSim::Chart::text(DataType type) const +const TQString &KSim::Chart::text(DataType type) const { if (type == DataIn) return d->inText; @@ -134,7 +134,7 @@ const QString &KSim::Chart::text(DataType type) const return d->outText; } -const QString &KSim::Chart::title() const +const TQString &KSim::Chart::title() const { return d->title; } @@ -206,7 +206,7 @@ KSim::Chart::LabelType KSim::Chart::labelType() const void KSim::Chart::buildPixmaps() { - QImage image(themeLoader().current().chartPixmap()); + TQImage image(themeLoader().current().chartPixmap()); KSim::ThemeLoader::self().reColourImage(image); d->chartPixmap.convertFromImage(image.smoothScale(chartSize())); @@ -251,7 +251,7 @@ void KSim::Chart::buildPixmaps() void KSim::Chart::configureObject(bool repaintWidget) { - QSize oldSize = sizeHint(); + TQSize oldSize = sizeHint(); KSim::Config::config()->setGroup("Misc"); d->size = KSim::Config::config()->readSizeEntry("GraphSize"); @@ -279,21 +279,21 @@ void KSim::Chart::configureObject(bool repaintWidget) update(); } -QSize KSim::Chart::sizeHint() const +TQSize KSim::Chart::sizeHint() const { return d->size; } -QSize KSim::Chart::minimumSizeHint() const +TQSize KSim::Chart::minimumSizeHint() const { return sizeHint(); } -void KSim::Chart::resizeEvent(QResizeEvent *re) +void KSim::Chart::resizeEvent(TQResizeEvent *re) { if (d->chartPixmap.size() != chartSize()) buildPixmaps(); - QWidget::resizeEvent(re); + TQWidget::resizeEvent(re); } void KSim::Chart::disableAutomaticUpdates() @@ -308,7 +308,7 @@ void KSim::Chart::clear() updateDisplay(); } -void KSim::Chart::setTitle(const QString &name) +void KSim::Chart::setTitle(const TQString &name) { if (d->krell) { d->title = name; @@ -331,7 +331,7 @@ void KSim::Chart::setDisplayMeter(bool value) } } -void KSim::Chart::setText(const QString &in, const QString &out) +void KSim::Chart::setText(const TQString &in, const TQString &out) { bool repaint = false; @@ -406,7 +406,7 @@ void KSim::Chart::setValue(int valueIn, int valueOut) void KSim::Chart::setConfigValues() { - QFont newFont = font(); + TQFont newFont = font(); bool repaint = themeLoader().current().fontColours(this, newFont, d->mColour, d->sColour, d->showShadow); @@ -422,7 +422,7 @@ void KSim::Chart::extraTypeCall() setConfigValues(); } -QColor KSim::Chart::chartColour(const DataType &dataType, int, int) const +TQColor KSim::Chart::chartColour(const DataType &dataType, int, int) const { switch (dataType) { case DataIn: @@ -433,19 +433,19 @@ QColor KSim::Chart::chartColour(const DataType &dataType, int, int) const break; } - return QColor(); // avoid a g++ warning + return TQColor(); // avoid a g++ warning } -void KSim::Chart::paintEvent(QPaintEvent *) +void KSim::Chart::paintEvent(TQPaintEvent *) { if (d->krell && labelType() == Led) { static_cast<KSim::LedLabel *>(d->krell)->setOff(KSim::Led::First); static_cast<KSim::LedLabel *>(d->krell)->setOff(KSim::Led::Second); } - const QSize &size = chartSize(); - QPixmap pixmap(size); - QPainter painter; + const TQSize &size = chartSize(); + TQPixmap pixmap(size); + TQPainter painter; painter.begin(&pixmap, this); int location = size.height() / 5; @@ -476,7 +476,7 @@ void KSim::Chart::paintEvent(QPaintEvent *) bitBlt(this, 0, 0, &pixmap); } -void KSim::Chart::fontChange(const QFont &) +void KSim::Chart::fontChange(const TQFont &) { if (d->krell) d->krell->setFont(font()); @@ -510,7 +510,7 @@ void KSim::Chart::drawChart() if (d->variableGraphs) { int maxValue = 0; - QValueList<int>::ConstIterator max; + TQValueList<int>::ConstIterator max; for (max = d->maxValues.begin(); max != d->maxValues.end(); ++max) { if ((*max) > maxValue) maxValue = (*max); @@ -519,12 +519,12 @@ void KSim::Chart::drawChart() setMaxValue(maxValue); } - QPainter painter; + TQPainter painter; d->graphData.setMask(drawMask(&painter)); painter.begin(&d->graphData, this); int position = width() - 1; - QValueList<Private::ValuePair>::ConstIterator it; + TQValueList<Private::ValuePair>::ConstIterator it; for (it = d->values.begin(); it != d->values.end(); ++it) { // Draw the data In lines first if its higher than the data out lines if ((*it).first >= (*it).second) { @@ -541,23 +541,23 @@ void KSim::Chart::drawChart() painter.end(); } -QSize KSim::Chart::chartSize() const +TQSize KSim::Chart::chartSize() const { - QSize sz(size()); + TQSize sz(size()); if (d->krell && d->showKrell) sz.setHeight(sz.height() - d->krell->height()); return sz; } -QBitmap KSim::Chart::drawMask(QPainter *painter) +TQBitmap KSim::Chart::drawMask(TQPainter *painter) { - QBitmap bitmap(chartSize(), true); + TQBitmap bitmap(chartSize(), true); painter->begin(&bitmap, this); painter->setPen(color1); int position = width() - 1; - QValueList<Private::ValuePair>::ConstIterator it; + TQValueList<Private::ValuePair>::ConstIterator it; for (it = d->values.begin(); it != d->values.end(); ++it) { drawIn(painter, (*it).first, position, true); drawOut(painter, (*it).second, position, true); @@ -569,7 +569,7 @@ QBitmap KSim::Chart::drawMask(QPainter *painter) return bitmap; } -void KSim::Chart::drawIn(QPainter *painter, int value, int pos, bool dontSet) +void KSim::Chart::drawIn(TQPainter *painter, int value, int pos, bool dontSet) { if (!dontSet) { painter->setPen(chartColour(DataIn)); @@ -581,7 +581,7 @@ void KSim::Chart::drawIn(QPainter *painter, int value, int pos, bool dontSet) pos, d->graphData.size().height() - location); } -void KSim::Chart::drawOut(QPainter *painter, int value, int pos, bool dontSet) +void KSim::Chart::drawOut(TQPainter *painter, int value, int pos, bool dontSet) { if (!dontSet) { painter->setPen(chartColour(DataOut)); @@ -604,11 +604,11 @@ int KSim::Chart::range(int value) const return value; } -void KSim::Chart::init(bool krell, int maxValue, const QString &title) +void KSim::Chart::init(bool krell, int maxValue, const TQString &title) { setConfigString("StyleChart"); setThemeConfigOnly(false); - setSizePolicy(QSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed)); + setSizePolicy(TQSizePolicy(TQSizePolicy::MinimumExpanding, TQSizePolicy::Fixed)); d = new Private; KSim::Config::config()->setGroup("Misc"); diff --git a/ksim/library/chart.h b/ksim/library/chart.h index 55f4426..0053ae3 100644 --- a/ksim/library/chart.h +++ b/ksim/library/chart.h @@ -20,7 +20,7 @@ #ifndef KSIM__CHART_H #define KSIM__CHART_H -#include <qwidget.h> +#include <tqwidget.h> #include "common.h" #include <kdemacros.h> @@ -33,7 +33,7 @@ namespace KSim * provides a graph displaying data onscreen using gkrellm themes * @author Robbie Ward <linuxphreak@gmx.co.uk> */ - class KDE_EXPORT Chart : public QWidget, public KSim::Base + class KDE_EXPORT Chart : public TQWidget, public KSim::Base { Q_OBJECT public: @@ -49,7 +49,7 @@ namespace KSim * @param parent is the parent widget */ Chart(bool displayMeter, int maxValue, - const QString &title, QWidget *parent, + const TQString &title, TQWidget *parent, const char *name = 0, WFlags fl = 0); /** * Constructs a KSim::Chart. @@ -60,7 +60,7 @@ namespace KSim * @param parent is the parent widget */ Chart(bool displayMeter, int maxValue, - QWidget *parent, const char *name = 0, + TQWidget *parent, const char *name = 0, WFlags fl = 0); /** * destructs KSim::Chart @@ -70,11 +70,11 @@ namespace KSim /** * returns the current text of the chart */ - const QString &text(DataType type) const; + const TQString &text(DataType type) const; /** * @return the title of the chart */ - const QString &title() const; + const TQString &title() const; /** * @return true if the meter is enabled */ @@ -108,11 +108,11 @@ namespace KSim /** * reimplemented for internal reasons */ - QSize sizeHint() const; + TQSize sizeHint() const; /** * reimplemented for internal reasons */ - QSize minimumSizeHint() const; + TQSize minimumSizeHint() const; void disableAutomaticUpdates(); @@ -125,7 +125,7 @@ namespace KSim * sets the title of the chart, this function returns if * the optional krell widget is disabled */ - void setTitle(const QString &); + void setTitle(const TQString &); /** * turns the meter on and off */ @@ -133,7 +133,7 @@ namespace KSim /** * sets the current text that apears in the top left hand corner */ - void setText(const QString &in, const QString &out = QString::null); + void setText(const TQString &in, const TQString &out = TQString::null); /** * Sets the minimum value the graph will display */ @@ -157,10 +157,10 @@ namespace KSim */ virtual void extraTypeCall(); - QColor chartColour(const DataType &dataType, int x = 1, int y = 1) const; - virtual void paintEvent(QPaintEvent *); - virtual void fontChange(const QFont &); - virtual void resizeEvent(QResizeEvent *re); + TQColor chartColour(const DataType &dataType, int x = 1, int y = 1) const; + virtual void paintEvent(TQPaintEvent *); + virtual void fontChange(const TQFont &); + virtual void resizeEvent(TQResizeEvent *re); protected slots: void updateDisplay(); @@ -169,12 +169,12 @@ namespace KSim void buildPixmaps(); int yLocation(int) const; void drawChart(); - QSize chartSize() const; - QBitmap drawMask(QPainter *); - void drawIn(QPainter *, int, int, bool = false); - void drawOut(QPainter *, int, int, bool = false); + TQSize chartSize() const; + TQBitmap drawMask(TQPainter *); + void drawIn(TQPainter *, int, int, bool = false); + void drawOut(TQPainter *, int, int, bool = false); int range(int) const; - void init(bool, int, const QString &); + void init(bool, int, const TQString &); class Timer; class Private; diff --git a/ksim/library/common.cpp b/ksim/library/common.cpp index 3e714c6..d2cf572 100644 --- a/ksim/library/common.cpp +++ b/ksim/library/common.cpp @@ -29,7 +29,7 @@ class KSim::Base::Private public: int type; bool theme; - QString string; + TQString string; }; KSim::Base::Base() @@ -76,12 +76,12 @@ int KSim::Base::type() const return d->type; } -void KSim::Base::setConfigString(const QString &string) +void KSim::Base::setConfigString(const TQString &string) { d->string = string; } -const QString &KSim::Base::configString() const +const TQString &KSim::Base::configString() const { return d->string; } diff --git a/ksim/library/common.h b/ksim/library/common.h index 3f53f7a..9fc01c0 100644 --- a/ksim/library/common.h +++ b/ksim/library/common.h @@ -23,7 +23,7 @@ #define KSIM_VERSION 110 #define KSIM_VERSION_STRING "1.1.0" -#include <qstring.h> +#include <tqstring.h> #include <kdemacros.h> /** @@ -52,13 +52,13 @@ namespace KSim * * example: * <pre> - * #include <qwidget.h> + * #include <tqwidget.h> * #include <ksim/common.h> * - * class Test : public QWidget, virtual public KSim::Base + * class Test : public TQWidget, virtual public KSim::Base * { * public: - * Test(QWidget *parent, const char *name) : QWidget(parent, name) + * Test(TQWidget *parent, const char *name) : TQWidget(parent, name) * { * } * ~Test() {} @@ -100,11 +100,11 @@ namespace KSim /** * Set the config entry key to look for when reading gkrellmrc */ - void setConfigString(const QString &string); + void setConfigString(const TQString &string); /** * @return the config entry to look for when reading theme files */ - const QString &configString() const; + const TQString &configString() const; protected: /** diff --git a/ksim/library/ksimconfig.cpp b/ksim/library/ksimconfig.cpp index 9f70890..2fd136e 100644 --- a/ksim/library/ksimconfig.cpp +++ b/ksim/library/ksimconfig.cpp @@ -57,40 +57,40 @@ void KSim::Config::setWidth(int width) mainConfig->sync(); } -bool KSim::Config::enabledMonitor(const QString &entry) const +bool KSim::Config::enabledMonitor(const TQString &entry) const { mainConfig->setGroup("Monitors"); return mainConfig->readBoolEntry(entry, false); } -void KSim::Config::setEnabledMonitor(const QString &entry, bool enabled) +void KSim::Config::setEnabledMonitor(const TQString &entry, bool enabled) { mainConfig->setGroup("Monitors"); mainConfig->writeEntry(entry, enabled); mainConfig->sync(); } -QString KSim::Config::monitorCommand(const QString &entry) const +TQString KSim::Config::monitorCommand(const TQString &entry) const { mainConfig->setGroup("Monitors"); return mainConfig->readPathEntry(entry + "_command"); } -void KSim::Config::setMonitorCommand(const QString &entry, - const QString &command) +void KSim::Config::setMonitorCommand(const TQString &entry, + const TQString &command) { mainConfig->setGroup("Monitors"); mainConfig->writePathEntry(entry + "_command", command); mainConfig->sync(); } -int KSim::Config::monitorLocation(const QString &entry) +int KSim::Config::monitorLocation(const TQString &entry) { mainConfig->setGroup("Monitors"); return mainConfig->readNumEntry(entry + "_location", -1); } -void KSim::Config::setMonitorLocation(const QString &entry, int location) +void KSim::Config::setMonitorLocation(const TQString &entry, int location) { mainConfig->setGroup("Monitors"); mainConfig->writeEntry(entry + "_location", location); @@ -149,33 +149,33 @@ void KSim::Config::setStayOnTop(bool stayOnTop) mainConfig->sync(); } -QPoint KSim::Config::position(const QPoint &defaultPos) const +TQPoint KSim::Config::position(const TQPoint &defaultPos) const { mainConfig->setGroup("Misc"); return mainConfig->readPointEntry("ksimPosition", &defaultPos); } -void KSim::Config::setPosition(const QPoint &pos) +void KSim::Config::setPosition(const TQPoint &pos) { mainConfig->setGroup("Misc"); mainConfig->writeEntry("ksimPosition", pos); mainConfig->sync(); } -QSize KSim::Config::graphSize() const +TQSize KSim::Config::graphSize() const { mainConfig->setGroup("Misc"); return mainConfig->readSizeEntry("GraphSize"); } -void KSim::Config::setGraphSize(const QSize &size) +void KSim::Config::setGraphSize(const TQSize &size) { mainConfig->setGroup("Misc"); mainConfig->writeEntry("GraphSize", size); mainConfig->sync(); } -QString KSim::Config::uptimeFormat() const +TQString KSim::Config::uptimeFormat() const { return uptimeFormatList()[uptimeItem()]; } @@ -186,13 +186,13 @@ int KSim::Config::uptimeItem() const return mainConfig->readNumEntry("UptimeItem", 0); } -QStringList KSim::Config::uptimeFormatList() const +TQStringList KSim::Config::uptimeFormatList() const { mainConfig->setGroup("Misc"); return mainConfig->readListEntry("UptimeFormat"); } -void KSim::Config::setUptimeFormat(const QStringList &uptimeFormat) +void KSim::Config::setUptimeFormat(const TQStringList &uptimeFormat) { mainConfig->setGroup("Misc"); mainConfig->writeEntry("UptimeFormat", uptimeFormat); @@ -206,7 +206,7 @@ void KSim::Config::setUptimeItem(int item) mainConfig->sync(); } -QString KSim::Config::memoryFormat() const +TQString KSim::Config::memoryFormat() const { return memoryFormatList()[memoryItem()]; } @@ -217,13 +217,13 @@ int KSim::Config::memoryItem() const return mainConfig->readNumEntry("MemoryItem", 0); } -QStringList KSim::Config::memoryFormatList() const +TQStringList KSim::Config::memoryFormatList() const { mainConfig->setGroup("Misc"); return mainConfig->readListEntry("MemoryFormat"); } -void KSim::Config::setMemoryFormat(const QStringList &memoryFormat) +void KSim::Config::setMemoryFormat(const TQStringList &memoryFormat) { mainConfig->setGroup("Misc"); mainConfig->writeEntry("MemoryFormat", memoryFormat); @@ -237,7 +237,7 @@ void KSim::Config::setMemoryItem(int item) mainConfig->sync(); } -QString KSim::Config::swapFormat() const +TQString KSim::Config::swapFormat() const { mainConfig->setGroup("Misc"); return swapFormatList()[swapItem()]; @@ -249,13 +249,13 @@ int KSim::Config::swapItem() const return mainConfig->readNumEntry("SwapItem", 0); } -QStringList KSim::Config::swapFormatList() const +TQStringList KSim::Config::swapFormatList() const { mainConfig->setGroup("Misc"); return mainConfig->readListEntry("SwapFormat"); } -void KSim::Config::setSwapFormat(const QStringList &swapFormat) +void KSim::Config::setSwapFormat(const TQStringList &swapFormat) { mainConfig->setGroup("Misc"); mainConfig->writeEntry("SwapFormat", swapFormat); @@ -360,17 +360,17 @@ void KSim::Config::setShowProcs(bool procs) mainConfig->sync(); } -QString KSim::Config::themeUrl() const +TQString KSim::Config::themeUrl() const { return KSim::ThemeLoader::currentUrl(); } -QString KSim::Config::themeName() const +TQString KSim::Config::themeName() const { return KSim::ThemeLoader::currentName(); } -void KSim::Config::setThemeName(const QString &name) +void KSim::Config::setThemeName(const TQString &name) { mainConfig->setGroup("Theme"); mainConfig->writeEntry("Name", name); @@ -389,12 +389,12 @@ void KSim::Config::setThemeAlt(int alt) mainConfig->sync(); } -QFont KSim::Config::themeFont() const +TQFont KSim::Config::themeFont() const { return KSim::ThemeLoader::currentFont(); } -void KSim::Config::setThemeFont(const QFont &font) +void KSim::Config::setThemeFont(const TQFont &font) { mainConfig->setGroup("Theme"); mainConfig->writeEntry("Font", font); diff --git a/ksim/library/ksimconfig.h b/ksim/library/ksimconfig.h index 0208b18..c831f35 100644 --- a/ksim/library/ksimconfig.h +++ b/ksim/library/ksimconfig.h @@ -20,9 +20,9 @@ #ifndef KSIMCONFIG_H #define KSIMCONFIG_H -#include <qstringlist.h> -#include <qpoint.h> -#include <qfont.h> +#include <tqstringlist.h> +#include <tqpoint.h> +#include <tqfont.h> #include <kdemacros.h> @@ -43,12 +43,12 @@ namespace KSim int width(int defaultWidth) const; void setWidth(int width); - bool enabledMonitor(const QString &) const; - void setEnabledMonitor(const QString &, bool); - QString monitorCommand(const QString &) const; - void setMonitorCommand(const QString &, const QString &); - int monitorLocation(const QString &); - void setMonitorLocation(const QString &, int); + bool enabledMonitor(const TQString &) const; + void setEnabledMonitor(const TQString &, bool); + TQString monitorCommand(const TQString &) const; + void setMonitorCommand(const TQString &, const TQString &); + int monitorLocation(const TQString &); + void setMonitorLocation(const TQString &, int); bool displayFqdn() const; void setDisplayFqdn(bool); bool showDock() const; @@ -57,25 +57,25 @@ namespace KSim void setSavePos(bool); bool stayOnTop() const; void setStayOnTop(bool); - QPoint position(const QPoint &) const; - void setPosition(const QPoint &); - QSize graphSize() const; - void setGraphSize(const QSize &); - QString uptimeFormat() const; - void setUptimeFormat(const QStringList &); + TQPoint position(const TQPoint &) const; + void setPosition(const TQPoint &); + TQSize graphSize() const; + void setGraphSize(const TQSize &); + TQString uptimeFormat() const; + void setUptimeFormat(const TQStringList &); int uptimeItem() const; void setUptimeItem(int); - QStringList uptimeFormatList() const; - QString memoryFormat() const; - void setMemoryFormat(const QStringList &); + TQStringList uptimeFormatList() const; + TQString memoryFormat() const; + void setMemoryFormat(const TQStringList &); int memoryItem() const; void setMemoryItem(int); - QStringList memoryFormatList() const; - QString swapFormat() const; - void setSwapFormat(const QStringList &); + TQStringList memoryFormatList() const; + TQString swapFormat() const; + void setSwapFormat(const TQStringList &); int swapItem() const; void setSwapItem(int); - QStringList swapFormatList() const; + TQStringList swapFormatList() const; bool showTime() const; void setShowTime(bool); bool show24hour() const; @@ -90,13 +90,13 @@ namespace KSim void setShowSwap(bool); bool showProcs() const; void setShowProcs(bool); - QString themeUrl() const; - QString themeName() const; - void setThemeName(const QString &); + TQString themeUrl() const; + TQString themeName() const; + void setThemeName(const TQString &); int themeAlt() const; void setThemeAlt(int); - QFont themeFont() const; - void setThemeFont(const QFont &); + TQFont themeFont() const; + void setThemeFont(const TQFont &); int themeFontItem() const; void setThemeFontItem(int); bool reColourThemes() const; diff --git a/ksim/library/label.cpp b/ksim/library/label.cpp index 91e7621..400b1c5 100644 --- a/ksim/library/label.cpp +++ b/ksim/library/label.cpp @@ -22,13 +22,13 @@ #include <ksimconfig.h> #include "themetypes.h" -#include <qpainter.h> -#include <qstyle.h> -#include <qstylesheet.h> -#include <qsimplerichtext.h> -#include <qcursor.h> -#include <qpixmap.h> -#include <qimage.h> +#include <tqpainter.h> +#include <tqstyle.h> +#include <tqstylesheet.h> +#include <tqsimplerichtext.h> +#include <tqcursor.h> +#include <tqpixmap.h> +#include <tqimage.h> #include <themeloader.h> #include <kdebug.h> @@ -39,31 +39,31 @@ class KSim::Label::Private { public: - QColor mColour; - QColor sColour; - QRect loc; - QRect shad; - QString text; - QImage meterImage; - QPixmap background; - QPixmap sidePixmap; + TQColor mColour; + TQColor sColour; + TQRect loc; + TQRect shad; + TQString text; + TQImage meterImage; + TQPixmap background; + TQPixmap sidePixmap; bool showShadow; }; -KSim::Label::Label(QWidget *parent, const char *name, WFlags fl) - : QWidget(parent, name, fl) +KSim::Label::Label(TQWidget *parent, const char *name, WFlags fl) + : TQWidget(parent, name, fl) { initWidget(KSim::Types::None); } -KSim::Label::Label(int type, QWidget *parent, const char *name, - WFlags fl) : QWidget(parent, name, fl) +KSim::Label::Label(int type, TQWidget *parent, const char *name, + WFlags fl) : TQWidget(parent, name, fl) { initWidget(type); } -KSim::Label::Label(int type, const QString &text, QWidget *parent, - const char *name, WFlags fl) : QWidget(parent, name, fl) +KSim::Label::Label(int type, const TQString &text, TQWidget *parent, + const char *name, WFlags fl) : TQWidget(parent, name, fl) { initWidget(type); setText(text); @@ -74,43 +74,43 @@ KSim::Label::~Label() delete d; } -const QString &KSim::Label::text() const +const TQString &KSim::Label::text() const { return d->text; } void KSim::Label::configureObject(bool repaintWidget) { - QString image = themeLoader().current().meterPixmap(type(), false); + TQString image = themeLoader().current().meterPixmap(type(), false); if (image.isEmpty()) image = themeLoader().current().panelPixmap(type()); d->meterImage.load(image); KSim::ThemeLoader::self().reColourImage(d->meterImage); d->background = d->meterImage.smoothScale(size()); - QSize oldSize = sizeHint(); + TQSize oldSize = sizeHint(); setConfigValues(); relayoutLabel(oldSize, repaintWidget); } -void KSim::Label::setPixmap(const QPixmap &pixmap) +void KSim::Label::setPixmap(const TQPixmap &pixmap) { if (pixmap.serialNumber() == d->sidePixmap.serialNumber()) return; - QSize oldSize = sizeHint(); + TQSize oldSize = sizeHint(); d->sidePixmap = pixmap; relayoutLabel(oldSize); } -const QPixmap &KSim::Label::pixmap() const +const TQPixmap &KSim::Label::pixmap() const { return d->sidePixmap; } -QSize KSim::Label::sizeHint() const +TQSize KSim::Label::sizeHint() const { int width = fontMetrics().size(SingleLine, text()).width(); if (!pixmap().isNull()) @@ -120,25 +120,25 @@ QSize KSim::Label::sizeHint() const if (!pixmap().isNull() && pixmap().height() > height) height = pixmap().height(); - return QSize(width, height); + return TQSize(width, height); } -QSize KSim::Label::minimumSizeHint() const +TQSize KSim::Label::minimumSizeHint() const { return sizeHint(); } void KSim::Label::clear() { - setText(QString::null); + setText(TQString::null); } -void KSim::Label::setText(const QString &text) +void KSim::Label::setText(const TQString &text) { if (text == d->text) return; // If the text is the same, no need to repaint etc - QSize oldSize = sizeHint(); + TQSize oldSize = sizeHint(); // set the text of our widget and repaint d->text = text; relayoutLabel(oldSize); @@ -160,29 +160,29 @@ bool KSim::Label::showShadow() const return d->showShadow; } -void KSim::Label::setTextColour(const QColor &color) +void KSim::Label::setTextColour(const TQColor &color) { d->mColour = color; } -const QColor &KSim::Label::textColour() const +const TQColor &KSim::Label::textColour() const { return d->mColour; } -void KSim::Label::setShadowColour(const QColor &color) +void KSim::Label::setShadowColour(const TQColor &color) { d->sColour = color; } -const QColor &KSim::Label::shadowColour() const +const TQColor &KSim::Label::shadowColour() const { return d->sColour; } void KSim::Label::setConfigValues() { - QFont newFont = font(); + TQFont newFont = font(); bool repaint = themeLoader().current().fontColours(this, newFont, d->mColour, d->sColour, d->showShadow); @@ -193,9 +193,9 @@ void KSim::Label::setConfigValues() update(); } -void KSim::Label::paintEvent(QPaintEvent *) +void KSim::Label::paintEvent(TQPaintEvent *) { - QPainter painter; + TQPainter painter; painter.begin(this); // paint our background pixmap onto the widget @@ -212,7 +212,7 @@ void KSim::Label::paintEvent(QPaintEvent *) painter.end(); } -void KSim::Label::resizeEvent(QResizeEvent *ev) +void KSim::Label::resizeEvent(TQResizeEvent *ev) { // set the location of where the shadow'ed text will be drawn d->shad.setWidth(ev->size().width() + 3); @@ -225,10 +225,10 @@ void KSim::Label::resizeEvent(QResizeEvent *ev) d->background = d->meterImage.smoothScale(ev->size()); } -void KSim::Label::drawText(QPainter *painter, const QRect &rect, - const QColor &color, const QString &text) +void KSim::Label::drawText(TQPainter *painter, const TQRect &rect, + const TQColor &color, const TQString &text) { - QRect location(rect); + TQRect location(rect); if (!pixmap().isNull()) location.setX(pixmap().width() + 5); @@ -236,39 +236,39 @@ void KSim::Label::drawText(QPainter *painter, const QRect &rect, 0, text, -1, &color); } -void KSim::Label::drawPixmap(QPainter *painter, const QRect &rect, - const QPixmap &pixmap) +void KSim::Label::drawPixmap(TQPainter *painter, const TQRect &rect, + const TQPixmap &pixmap) { - QRect location(rect); + TQRect location(rect); location.setWidth(pixmap.width()); style().drawItem(painter, location, AlignCenter, colorGroup(), true, - pixmap.isNull() ? 0 : &pixmap, QString::null); + pixmap.isNull() ? 0 : &pixmap, TQString::null); } -void KSim::Label::setTextLocation(const QRect &rect) +void KSim::Label::setTextLocation(const TQRect &rect) { d->loc = rect; } -const QRect &KSim::Label::textLocation() const +const TQRect &KSim::Label::textLocation() const { return d->loc; } -void KSim::Label::setShadowLocation(const QRect &rect) +void KSim::Label::setShadowLocation(const TQRect &rect) { d->shad = rect; } -const QRect &KSim::Label::shadowLocation() const +const TQRect &KSim::Label::shadowLocation() const { return d->shad; } -void KSim::Label::setThemePixmap(const QString &image) +void KSim::Label::setThemePixmap(const TQString &image) { - QSize oldSize = sizeHint(); + TQSize oldSize = sizeHint(); d->meterImage.reset(); d->meterImage.load(image); KSim::ThemeLoader::self().reColourImage(d->meterImage); @@ -276,7 +276,7 @@ void KSim::Label::setThemePixmap(const QString &image) relayoutLabel(oldSize); } -void KSim::Label::relayoutLabel(const QSize &old, bool repaint) +void KSim::Label::relayoutLabel(const TQSize &old, bool repaint) { if (sizeHint() != old) { updateGeometry(); @@ -294,8 +294,8 @@ void KSim::Label::initWidget(int type) // try to reduce flicker as much as possible setBackgroundMode(NoBackground); - setSizePolicy(QSizePolicy(QSizePolicy::MinimumExpanding, - QSizePolicy::Fixed)); + setSizePolicy(TQSizePolicy(TQSizePolicy::MinimumExpanding, + TQSizePolicy::Fixed)); configureObject(); } diff --git a/ksim/library/label.h b/ksim/library/label.h index 1c750f2..7d77aa6 100644 --- a/ksim/library/label.h +++ b/ksim/library/label.h @@ -20,7 +20,7 @@ #ifndef KSIM__LABEL_H #define KSIM__LABEL_H -#include <qwidget.h> +#include <tqwidget.h> #include "common.h" #include <kdemacros.h> @@ -34,7 +34,7 @@ namespace KSim * @short Label widget * @author Robbie Ward <linuxphreak@gmx.co.uk> */ - class KDE_EXPORT Label : public QWidget, public KSim::Base + class KDE_EXPORT Label : public TQWidget, public KSim::Base { Q_OBJECT public: @@ -50,7 +50,7 @@ namespace KSim * To create a KSim::Label with the normal theme look * @see KSim::ThemeLoader */ - Label(QWidget *parent, const char *name = 0, WFlags fl = 0); + Label(TQWidget *parent, const char *name = 0, WFlags fl = 0); /** * Constructs a KSimLabel. * @@ -62,10 +62,10 @@ namespace KSim * KSim::Label *label = new KSim::Label(KSim::Types::None, this); * </pre> * To create a KSim::Label with the normal theme look, - * NOTE: this is the same as the KSim::Label(QWidget *, const char *, WFlags) ctor + * NOTE: this is the same as the KSim::Label(TQWidget *, const char *, WFlags) ctor * @see KSim::ThemeLoader */ - Label(int type, QWidget *parent, const char *name = 0, WFlags fl = 0); + Label(int type, TQWidget *parent, const char *name = 0, WFlags fl = 0); /** * Constructs a KSim::Label. * @@ -80,8 +80,8 @@ namespace KSim * To create a KSim::Label with the theme look of host * @see KSim::ThemeLoader */ - Label(int type, const QString &text, - QWidget *parent, const char *name = 0, WFlags fl = 0); + Label(int type, const TQString &text, + TQWidget *parent, const char *name = 0, WFlags fl = 0); /** * destructs KSim::Label. */ @@ -91,7 +91,7 @@ namespace KSim * returns the current text of the label * @see #setText */ - const QString &text() const; + const TQString &text() const; /** * recreates the labels look & feel */ @@ -99,19 +99,19 @@ namespace KSim /** * sets a pixmap for the label */ - void setPixmap(const QPixmap &pixmap); + void setPixmap(const TQPixmap &pixmap); /** * @return the side pixmap */ - const QPixmap &pixmap() const; + const TQPixmap &pixmap() const; /** * reimplemented for internal reasons */ - virtual QSize sizeHint() const; + virtual TQSize sizeHint() const; /** * reimplemented for internal reasons */ - virtual QSize minimumSizeHint() const; + virtual TQSize minimumSizeHint() const; public slots: /** @@ -122,7 +122,7 @@ namespace KSim * sets the current label of the widget to @ref text * @see text() */ - void setText(const QString &text); + void setText(const TQString &text); protected: /** @@ -140,19 +140,19 @@ namespace KSim /** * Set the text color */ - void setTextColour(const QColor &color); + void setTextColour(const TQColor &color); /** * @return the text color */ - const QColor &textColour() const; + const TQColor &textColour() const; /** * Set the shadow color */ - void setShadowColour(const QColor &color); + void setShadowColour(const TQColor &color); /** * @return the shadow color */ - const QColor &shadowColour() const; + const TQColor &shadowColour() const; /** * Set the config values depending on the chart type */ @@ -160,42 +160,42 @@ namespace KSim /** * reimplemented for internal reasons */ - virtual void paintEvent(QPaintEvent *); + virtual void paintEvent(TQPaintEvent *); /** * reimplemented for internal reasons */ - virtual void resizeEvent(QResizeEvent *); + virtual void resizeEvent(TQResizeEvent *); /** * draw the text onto the label */ - void drawText(QPainter *painter, const QRect &rect, - const QColor &color, const QString &text); + void drawText(TQPainter *painter, const TQRect &rect, + const TQColor &color, const TQString &text); /** * draw the pixmap onto the label */ - void drawPixmap(QPainter *painter, - const QRect &rect, const QPixmap &pixmap); + void drawPixmap(TQPainter *painter, + const TQRect &rect, const TQPixmap &pixmap); /** * sets the location of the text */ - void setTextLocation(const QRect &rect); + void setTextLocation(const TQRect &rect); /** * @return the location of the text */ - const QRect &textLocation() const; + const TQRect &textLocation() const; /** * sets the location of the shadow text */ - void setShadowLocation(const QRect &rect); + void setShadowLocation(const TQRect &rect); /** * @return the location of the shadow text */ - const QRect &shadowLocation() const; + const TQRect &shadowLocation() const; /** * sets the background image to be painted */ - void setThemePixmap(const QString &image); - void relayoutLabel(const QSize &old, bool repaint = true); + void setThemePixmap(const TQString &image); + void relayoutLabel(const TQSize &old, bool repaint = true); private: /** diff --git a/ksim/library/led.cpp b/ksim/library/led.cpp index 8d0c88d..a3d9e1c 100644 --- a/ksim/library/led.cpp +++ b/ksim/library/led.cpp @@ -20,10 +20,10 @@ #include "led.h" #include "led.moc" -#include <qimage.h> -#include <qpainter.h> -#include <qfile.h> -#include <qbitmap.h> +#include <tqimage.h> +#include <tqpainter.h> +#include <tqfile.h> +#include <tqbitmap.h> #include <kdebug.h> #include <kpixmapsplitter.h> @@ -35,13 +35,13 @@ class KSim::Led::Private { public: KPixmapSplitter splitter; - QPixmap pixmap; - QString imageName; + TQPixmap pixmap; + TQString imageName; KSim::Led::Type type; bool toggled; }; -KSim::Led::Led() : QPixmap() +KSim::Led::Led() : TQPixmap() { d = new Private; @@ -52,7 +52,7 @@ KSim::Led::Led() : QPixmap() setOff(); } -KSim::Led::Led(Type type, const QString &imageName) : QPixmap() +KSim::Led::Led(Type type, const TQString &imageName) : TQPixmap() { d = new Private; @@ -74,7 +74,7 @@ void KSim::Led::setOn(bool force) return; // Return if our pixmap is null - QRect rect = d->splitter.coordinates(d->type == First ? 1 : 3); + TQRect rect = d->splitter.coordinates(d->type == First ? 1 : 3); if (d->pixmap.isNull() || rect.isEmpty()) { resize(12, 8); fill(Qt::white); @@ -82,12 +82,12 @@ void KSim::Led::setOn(bool force) } if (d->pixmap.mask() && !d->pixmap.mask()->isNull()) { - QBitmap mask(rect.size()); - bitBlt(&mask, QPoint(0, 0), d->pixmap.mask(), rect, CopyROP); + TQBitmap mask(rect.size()); + bitBlt(&mask, TQPoint(0, 0), d->pixmap.mask(), rect, CopyROP); setMask(mask); } - bitBlt(this, QPoint(0, 0), &d->pixmap, rect, CopyROP); + bitBlt(this, TQPoint(0, 0), &d->pixmap, rect, CopyROP); d->toggled = true; } @@ -97,7 +97,7 @@ void KSim::Led::setOff(bool force) return; // Return if our pixmap is null - QRect rect = d->splitter.coordinates(d->type == First ? 0 : 2); + TQRect rect = d->splitter.coordinates(d->type == First ? 0 : 2); if (d->pixmap.isNull() || rect.isEmpty()) { resize(12, 8); fill(Qt::white); @@ -105,12 +105,12 @@ void KSim::Led::setOff(bool force) } if (d->pixmap.mask() && !d->pixmap.mask()->isNull()) { - QBitmap mask(rect.size()); - bitBlt(&mask, QPoint(0, 0), d->pixmap.mask(), rect, CopyROP); + TQBitmap mask(rect.size()); + bitBlt(&mask, TQPoint(0, 0), d->pixmap.mask(), rect, CopyROP); setMask(mask); } - bitBlt(this, QPoint(0, 0), &d->pixmap, rect, CopyROP); + bitBlt(this, TQPoint(0, 0), &d->pixmap, rect, CopyROP); d->toggled = false; } @@ -122,28 +122,28 @@ void KSim::Led::toggle() setOn(); } -void KSim::Led::setPixmap(const QString &imageName) +void KSim::Led::setPixmap(const TQString &imageName) { if (imageName == d->imageName) return; - QImage image(imageName); + TQImage image(imageName); if (image.width() >= 19) image = image.smoothScale(19, image.height()); KSim::ThemeLoader::self().reColourImage(image); d->pixmap.convertFromImage(image); - QSize size(image.width(), image.height() / 4); + TQSize size(image.width(), image.height() / 4); d->splitter.setPixmap(d->pixmap); d->splitter.setItemSize(size); resize(size); - setMask(QBitmap()); + setMask(TQBitmap()); } -const QString &KSim::Led::fileName() const +const TQString &KSim::Led::fileName() const { return d->imageName; } @@ -179,12 +179,12 @@ class KSim::LedLabel::Private public: KSim::Led receiveLed; KSim::Led sendLed; - QPoint sendPoint; - QPoint receivePoint; + TQPoint sendPoint; + TQPoint receivePoint; }; -KSim::LedLabel::LedLabel(int max, int type, const QString &label, - QWidget *parent, const char *name, WFlags fl) +KSim::LedLabel::LedLabel(int max, int type, const TQString &label, + TQWidget *parent, const char *name, WFlags fl) : KSim::Progress(max, type, Panel, parent, name, fl) { init(); @@ -192,14 +192,14 @@ KSim::LedLabel::LedLabel(int max, int type, const QString &label, } KSim::LedLabel::LedLabel(int max, int type, - QWidget *parent, const char *name, WFlags fl) + TQWidget *parent, const char *name, WFlags fl) : KSim::Progress(max, type, Panel, parent, name, fl) { init(); } KSim::LedLabel::LedLabel(int max, - QWidget *parent, const char *name, WFlags fl) + TQWidget *parent, const char *name, WFlags fl) : KSim::Progress(max, KSim::Types::None, Panel, parent, name, fl) { @@ -215,7 +215,7 @@ void KSim::LedLabel::configureObject(bool reapaintWidget) { KSim::Progress::configureObject(false); - QPixmap pixmap = themeLoader().current().splitPixmap(KSim::Theme::KrellPanel, 0, false); + TQPixmap pixmap = themeLoader().current().splitPixmap(KSim::Theme::KrellPanel, 0, false); if (pixmap.isNull()) pixmap = themeLoader().current().splitPixmap(KSim::Theme::KrellSlider); @@ -234,9 +234,9 @@ void KSim::LedLabel::configureObject(bool reapaintWidget) update(); } -QSize KSim::LedLabel::sizeHint() const +TQSize KSim::LedLabel::sizeHint() const { - QSize hint(Progress::sizeHint()); + TQSize hint(Progress::sizeHint()); if (d->sendLed.height() > hint.height()) hint.setHeight(d->sendLed.height()); @@ -303,14 +303,14 @@ void KSim::LedLabel::drawLeds() bitBlt(this, d->receivePoint, &d->receiveLed); } -void KSim::LedLabel::paintEvent(QPaintEvent *ev) +void KSim::LedLabel::paintEvent(TQPaintEvent *ev) { KSim::Label::paintEvent(ev); drawLeds(); KSim::Progress::drawMeter(); } -void KSim::LedLabel::resizeEvent(QResizeEvent *ev) +void KSim::LedLabel::resizeEvent(TQResizeEvent *ev) { KSim::Progress::resizeEvent(ev); layoutLeds(); @@ -328,11 +328,11 @@ void KSim::LedLabel::layoutLeds() d->receivePoint.setX((d->sendPoint.x() - d->receiveLed.width()) - 3); d->receivePoint.setY(ledHeight - (d->receiveLed.height() / 2)); - QRect location = textLocation(); + TQRect location = textLocation(); location.setWidth(d->receivePoint.x()); setTextLocation(location); - QRect shadow = shadowLocation(); + TQRect shadow = shadowLocation(); shadow.setWidth(d->receivePoint.x() + 3); setShadowLocation(shadow); diff --git a/ksim/library/led.h b/ksim/library/led.h index 2e5d084..a3ef85e 100644 --- a/ksim/library/led.h +++ b/ksim/library/led.h @@ -22,7 +22,7 @@ #include "progress.h" #include <kdemacros.h> -#include <qpixmap.h> +#include <tqpixmap.h> namespace KSim { @@ -49,7 +49,7 @@ namespace KSim * @param parent is the parent widget * @param name is the object instance name */ - Led(Type type, const QString &imageName); + Led(Type type, const TQString &imageName); /** * destructor for KSim::Led. */ @@ -70,11 +70,11 @@ namespace KSim /** * sets the image of the led */ - void setPixmap(const QString &); + void setPixmap(const TQString &); /** * @return the location of the filename */ - const QString &fileName() const; + const TQString &fileName() const; /** * @return true if the led is on */ @@ -116,8 +116,8 @@ namespace KSim * @param parent is the parent widget * @see KSim::ThemeLoader */ - LedLabel(int max, int type, const QString &label, - QWidget *parent, const char *name = 0, WFlags fl = 0); + LedLabel(int max, int type, const TQString &label, + TQWidget *parent, const char *name = 0, WFlags fl = 0); /** * Constructs a KSim::LedLabel. * @@ -126,7 +126,7 @@ namespace KSim * @param parent is the parent widget * @see KSim::ThemeLoader */ - LedLabel(int max, int type, QWidget *parent, + LedLabel(int max, int type, TQWidget *parent, const char *name = 0, WFlags fl = 0); /** * Constructs a KSim::LedLabel. @@ -135,7 +135,7 @@ namespace KSim * @param parent is the parent widget * @see KSim::ThemeLoader */ - LedLabel(int max, QWidget *parent, + LedLabel(int max, TQWidget *parent, const char *name = 0, WFlags fl = 0); /** * destructor for KSim::LedLabel. @@ -149,7 +149,7 @@ namespace KSim /** * reimplemented for internal reasons */ - virtual QSize sizeHint() const; + virtual TQSize sizeHint() const; public slots: /** @@ -176,11 +176,11 @@ namespace KSim /** * reimplemented for internal reasons */ - virtual void paintEvent(QPaintEvent *); + virtual void paintEvent(TQPaintEvent *); /** * reimplemented for internal reasons */ - virtual void resizeEvent(QResizeEvent *); + virtual void resizeEvent(TQResizeEvent *); private: void layoutLeds(); diff --git a/ksim/library/pluginglobal.cpp b/ksim/library/pluginglobal.cpp index 02b32ad..3cbae68 100644 --- a/ksim/library/pluginglobal.cpp +++ b/ksim/library/pluginglobal.cpp @@ -40,7 +40,7 @@ class KSim::Plugin::Private ~Private() { kdDebug(2003) << "Deleting " << (plugin ? - plugin->name() : QString("Null")) + plugin->name() : TQString("Null")) << " objects." << endl; // Remember to delete the objects we own @@ -57,10 +57,10 @@ class KSim::Plugin::Private bool deref() { return !--count; } uint count; - QString name; - QPixmap icon; - QCString libName; - QString filename; + TQString name; + TQPixmap icon; + TQCString libName; + TQString filename; KSim::PluginObject *plugin; KSim::PluginView *view; KSim::PluginPage *page; @@ -155,24 +155,24 @@ bool KSim::Plugin::isNull() const return !d; } -const QString &KSim::Plugin::name() const +const TQString &KSim::Plugin::name() const { - return d ? d->name : QString::null; + return d ? d->name : TQString::null; } -QPixmap KSim::Plugin::icon() const +TQPixmap KSim::Plugin::icon() const { - return d ? d->icon : QPixmap(); + return d ? d->icon : TQPixmap(); } -QCString KSim::Plugin::libName() const +TQCString KSim::Plugin::libName() const { - return d ? d->libName : QCString(); + return d ? d->libName : TQCString(); } -const QString &KSim::Plugin::fileName() const +const TQString &KSim::Plugin::fileName() const { - return d ? d->filename : QString::null; + return d ? d->filename : TQString::null; } KSim::PluginObject *KSim::Plugin::plugin() const diff --git a/ksim/library/pluginglobal.h b/ksim/library/pluginglobal.h index 85df9ce..5dbeef8 100644 --- a/ksim/library/pluginglobal.h +++ b/ksim/library/pluginglobal.h @@ -20,9 +20,9 @@ #ifndef PLUGINGLOBAL_H #define PLUGINGLOBAL_H -#include <qstring.h> -#include <qpixmap.h> -#include <qvaluelist.h> +#include <tqstring.h> +#include <tqpixmap.h> +#include <tqvaluelist.h> #include <kdemacros.h> @@ -93,19 +93,19 @@ namespace KSim * @return the name of the plugin, NOT the library name * @see #libName */ - const QString &name() const; + const TQString &name() const; /** * @return the icon of the plugin */ - QPixmap icon() const; + TQPixmap icon() const; /** * @return library name of the plugin */ - QCString libName() const; + TQCString libName() const; /** * @return path to the .desktop file */ - const QString &fileName() const; + const TQString &fileName() const; /** * @return the plugin object */ @@ -135,22 +135,22 @@ namespace KSim * use pluginList() from KSim::PluginLoader instead * @author Robbie Ward <linuxphreak@gmx.co.uk> */ - class KDE_EXPORT PluginList : public QValueList<Plugin> + class KDE_EXPORT PluginList : public TQValueList<Plugin> { public: /** * constructs a null list */ - PluginList() : QValueList<Plugin>() {} + PluginList() : TQValueList<Plugin>() {} /** * constructs a copy of @p list */ - PluginList(const PluginList &list) : QValueList<Plugin>(list) {} + PluginList(const PluginList &list) : TQValueList<Plugin>(list) {} /** * constructs a copy of @p list */ - PluginList(const QValueList<Plugin> &list) - : QValueList<Plugin>(list) {} + PluginList(const TQValueList<Plugin> &list) + : TQValueList<Plugin>(list) {} /** * constructs a list with just one item */ diff --git a/ksim/library/pluginloader.cpp b/ksim/library/pluginloader.cpp index be2d2bf..1a8bbd8 100644 --- a/ksim/library/pluginloader.cpp +++ b/ksim/library/pluginloader.cpp @@ -28,7 +28,7 @@ #include <kstandarddirs.h> #include <kmessagebox.h> -#include <qstringlist.h> +#include <tqstringlist.h> class KSim::PluginInfo::Private { @@ -39,17 +39,17 @@ KSim::PluginInfo::~PluginInfo() { } -const QString &KSim::PluginInfo::name() const +const TQString &KSim::PluginInfo::name() const { return m_name; } -QCString KSim::PluginInfo::libName(bool includePrefix) const +TQCString KSim::PluginInfo::libName(bool includePrefix) const { return (includePrefix ? "ksim_" + m_libName : m_libName); } -const QString &KSim::PluginInfo::location() const +const TQString &KSim::PluginInfo::location() const { return m_location; } @@ -63,8 +63,8 @@ class KSim::PluginLoader::Private public: typedef KSim::PluginObject *(PluginPtr)(const char *); KSim::PluginList pluginList; - QString error; - QString lib; + TQString error; + TQString lib; bool lastLoaded; static const char *const ksimString; }; @@ -119,7 +119,7 @@ bool KSim::PluginLoader::loadPlugin(const KDesktopFile &file) return true; } -bool KSim::PluginLoader::unloadPlugin(const QCString &name) +bool KSim::PluginLoader::unloadPlugin(const TQCString &name) { if (name.isEmpty()) return false; @@ -156,7 +156,7 @@ bool KSim::PluginLoader::isLoaded(const KSim::Plugin &info) const return isLoaded(info.libName()); } -bool KSim::PluginLoader::isLoaded(const QCString &library) const +bool KSim::PluginLoader::isLoaded(const TQCString &library) const { if (library.isEmpty()) return false; @@ -164,15 +164,15 @@ bool KSim::PluginLoader::isLoaded(const QCString &library) const return !find(library).isNull(); } -KSim::PluginInfo KSim::PluginLoader::findPluginInfo(const QString &name, +KSim::PluginInfo KSim::PluginLoader::findPluginInfo(const TQString &name, SearchType type) const { - QString location; + TQString location; switch (type) { case Name: { - QStringList files = KGlobal::dirs()->findAllResources("data", "ksim/monitors/*.desktop"); - QStringList::ConstIterator it; + TQStringList files = KGlobal::dirs()->findAllResources("data", "ksim/monitors/*.desktop"); + TQStringList::ConstIterator it; for (it = files.begin(); it != files.end(); ++it) { KDesktopFile file((*it)); if (file.readName() == name) { @@ -183,8 +183,8 @@ KSim::PluginInfo KSim::PluginLoader::findPluginInfo(const QString &name, break; } case LibName: { - QStringList files = KGlobal::dirs()->findAllResources("data", "ksim/monitors/*.desktop"); - QStringList::ConstIterator it; + TQStringList files = KGlobal::dirs()->findAllResources("data", "ksim/monitors/*.desktop"); + TQStringList::ConstIterator it; for (it = files.begin(); it != files.end(); ++it) { KDesktopFile file((*it)); if (file.readEntry("X-KSIM-LIBRARY") == name) { @@ -211,12 +211,12 @@ KSim::PluginInfo KSim::PluginLoader::findPluginInfo(const QString &name, return info; } -KSim::Plugin &KSim::PluginLoader::find(const QCString &libName) +KSim::Plugin &KSim::PluginLoader::find(const TQCString &libName) { if (libName.isEmpty()) return KSim::Plugin::null; - QCString library(libName); + TQCString library(libName); if (libName.find(Private::ksimString) == -1) library.prepend(Private::ksimString); @@ -229,12 +229,12 @@ KSim::Plugin &KSim::PluginLoader::find(const QCString &libName) return KSim::Plugin::null; } -const KSim::Plugin &KSim::PluginLoader::find(const QCString &libName) const +const KSim::Plugin &KSim::PluginLoader::find(const TQCString &libName) const { if (libName.isEmpty()) return KSim::Plugin::null; - QCString library(libName); + TQCString library(libName); if (libName.find(Private::ksimString) == -1) library.prepend(Private::ksimString); @@ -277,7 +277,7 @@ KSim::Plugin &KSim::PluginLoader::plugin() return (d->lastLoaded ? d->pluginList.last() : KSim::Plugin::null); } -KSim::PluginLoader::PluginLoader() : QObject(0, "PluginLoader") +KSim::PluginLoader::PluginLoader() : TQObject(0, "PluginLoader") { d = new KSim::PluginLoader::Private; d->lastLoaded = false; @@ -294,20 +294,20 @@ void KSim::PluginLoader::cleanup() KSim::PluginLoader::ErrorCode KSim::PluginLoader::createPlugin(const KDesktopFile &file) { - d->error = QString::null; - QCString pluginName(file.readEntry("X-KSIM-LIBRARY").local8Bit()); + d->error = TQString::null; + TQCString pluginName(file.readEntry("X-KSIM-LIBRARY").local8Bit()); if (pluginName.isEmpty()) return EmptyLibName; - QCString libName(Private::ksimString + pluginName); + TQCString libName(Private::ksimString + pluginName); KLibrary *library = KLibLoader::self()->library(libName); if (!library) return LibNotFound; - QCString symbol("init_plugin"); + TQCString symbol("init_plugin"); if (Private::PluginPtr *create = (Private::PluginPtr *)(library->symbol(symbol))) { d->pluginList.append(KSim::Plugin(create(pluginName), file)); - d->lib = QString::null; + d->lib = TQString::null; d->lastLoaded = true; } else { diff --git a/ksim/library/pluginloader.h b/ksim/library/pluginloader.h index f101973..385df44 100644 --- a/ksim/library/pluginloader.h +++ b/ksim/library/pluginloader.h @@ -21,7 +21,7 @@ #define PLUGINLOADER_H #include "pluginglobal.h" -#include <qobject.h> +#include <tqobject.h> #include <kdemacros.h> @@ -36,22 +36,22 @@ namespace KSim /** * @return the name of the plugin */ - const QString &name() const; + const TQString &name() const; /** * @return the library name of the plugin */ - QCString libName(bool includePrefix = false) const; + TQCString libName(bool includePrefix = false) const; /** * @return the location of the desktop file */ - const QString &location() const; + const TQString &location() const; private: PluginInfo(); - QString m_name; - QString m_location; - QCString m_libName; + TQString m_name; + TQString m_location; + TQCString m_libName; class Private; Private *d; @@ -89,7 +89,7 @@ namespace KSim /** * unloads a loaded plugin and removes plugin entries from pluginList() */ - bool unloadPlugin(const QCString &name); + bool unloadPlugin(const TQCString &name); /** * unloads all loaded plugins */ @@ -103,14 +103,14 @@ namespace KSim /** * returns true if library is loaded */ - bool isLoaded(const QCString &library) const; + bool isLoaded(const TQCString &library) const; /** * finds the plugins desktopfile and returns information * on the plugin * @return a KSim::PluginInfo object * @see KSim::PluginInfo */ - KSim::PluginInfo findPluginInfo(const QString &name, + KSim::PluginInfo findPluginInfo(const TQString &name, SearchType type = DesktopFile) const; /** * looks through the list of loaded plugins and returns @@ -122,11 +122,11 @@ namespace KSim * @return a KSim::Plugin object * @see KSim::Plugin */ - KSim::Plugin &find(const QCString &libName); + KSim::Plugin &find(const TQCString &libName); /** * convenience function, see the above function for details. */ - const KSim::Plugin &find(const QCString &libName) const; + const KSim::Plugin &find(const TQCString &libName) const; /** * equivalent to find(info.libName()); */ diff --git a/ksim/library/pluginmodule.cpp b/ksim/library/pluginmodule.cpp index f267197..b5cbd37 100644 --- a/ksim/library/pluginmodule.cpp +++ b/ksim/library/pluginmodule.cpp @@ -24,19 +24,19 @@ #include <kapplication.h> #include <kaboutdata.h> #include <kdebug.h> -#include <qregexp.h> -#include <qpopupmenu.h> +#include <tqregexp.h> +#include <tqpopupmenu.h> #include <kconfig.h> class KSim::PluginObject::Private { public: - QCString name; - QString configName; + TQCString name; + TQString configName; }; -KSim::PluginObject::PluginObject(const QCString &name) +KSim::PluginObject::PluginObject(const TQCString &name) { d = new PluginObject::Private; d->name = name; @@ -53,12 +53,12 @@ const char *KSim::PluginObject::instanceName() const return kapp->aboutData()->appName(); } -const QCString &KSim::PluginObject::name() const +const TQCString &KSim::PluginObject::name() const { return d->name; } -void KSim::PluginObject::setConfigFileName(const QString &name) +void KSim::PluginObject::setConfigFileName(const TQString &name) { if (d->configName == name) return; @@ -68,7 +68,7 @@ void KSim::PluginObject::setConfigFileName(const QString &name) d->configName.prepend("ksim_"); } -const QString &KSim::PluginObject::configFileName() const +const TQString &KSim::PluginObject::configFileName() const { return d->configName; } @@ -81,7 +81,7 @@ class KSim::PluginPage::Private }; KSim::PluginPage::PluginPage(KSim::PluginObject *parent, const char *name) - : QWidget(0, name) + : TQWidget(0, name) { d = new PluginPage::Private; d->parent = parent; @@ -112,18 +112,18 @@ class KSim::PluginView::Private { public: PluginObject *parent; - QPopupMenu *popupMenu; + TQPopupMenu *popupMenu; KConfig *config; }; KSim::PluginView::PluginView(KSim::PluginObject *parent, const char *name) - : QWidget(0, name) + : TQWidget(0, name) { d = new PluginView::Private; d->parent = parent; - d->popupMenu = new QPopupMenu(this); + d->popupMenu = new TQPopupMenu(this); d->popupMenu->insertItem(i18n("About"), this, - SLOT(showAbout()), 0, -1, 0); + TQT_SLOT(showAbout()), 0, -1, 0); if (parent && !parent->configFileName().isEmpty()) d->config = new KConfig(parent->configFileName() + "rc"); @@ -147,7 +147,7 @@ KConfig *KSim::PluginView::config() const return d->config; } -QPopupMenu *KSim::PluginView::menu() const +TQPopupMenu *KSim::PluginView::menu() const { return d->popupMenu; } @@ -157,9 +157,9 @@ void KSim::PluginView::doCommand() emit runCommand(name()); } -void KSim::PluginView::mousePressEvent(QMouseEvent *ev) +void KSim::PluginView::mousePressEvent(TQMouseEvent *ev) { - if (ev->button() == QMouseEvent::LeftButton) + if (ev->button() == TQMouseEvent::LeftButton) doCommand(); } diff --git a/ksim/library/pluginmodule.h b/ksim/library/pluginmodule.h index 1cc6a1c..753030f 100644 --- a/ksim/library/pluginmodule.h +++ b/ksim/library/pluginmodule.h @@ -20,7 +20,7 @@ #ifndef PLUGINMODULE_H #define PLUGINMODULE_H -#include <qwidget.h> +#include <tqwidget.h> #include <kdemacros.h> @@ -56,7 +56,7 @@ namespace KSim /** * constructor for PluginObject */ - PluginObject(const QCString &name); + PluginObject(const TQCString &name); /** * destructor for PluginObject */ @@ -83,16 +83,16 @@ namespace KSim /** * @return the name of the plugin */ - const QCString &name() const; + const TQCString &name() const; /** * sets the configuration file name to @p name */ - void setConfigFileName(const QString &name); + void setConfigFileName(const TQString &name); /** * @return the config filename the plugin should use * or name() if the filename hasn't been set */ - const QString &configFileName() const; + const TQString &configFileName() const; private: PluginObject(); @@ -180,7 +180,7 @@ namespace KSim /** * the plugins popup menu */ - QPopupMenu *menu() const; + TQPopupMenu *menu() const; /** * reimplement to recreate your view when KSim requests this */ @@ -188,10 +188,10 @@ namespace KSim void doCommand(); signals: - void runCommand(const QCString &); + void runCommand(const TQCString &); protected: - virtual void mousePressEvent(QMouseEvent *); + virtual void mousePressEvent(TQMouseEvent *); PluginObject *parentPlugin() const; private slots: diff --git a/ksim/library/progress.cpp b/ksim/library/progress.cpp index fd923d2..82ae16e 100644 --- a/ksim/library/progress.cpp +++ b/ksim/library/progress.cpp @@ -21,17 +21,17 @@ #include "progress.moc" #include <kdebug.h> -#include <qpainter.h> -#include <qpixmap.h> -#include <qimage.h> +#include <tqpainter.h> +#include <tqpixmap.h> +#include <tqimage.h> #include <themeloader.h> class KSim::Progress::Private { public: - QPixmap meterPixmap; - QRect rectOrigin; + TQPixmap meterPixmap; + TQRect rectOrigin; ProgressType type; int krellDepth; int value; @@ -40,7 +40,7 @@ class KSim::Progress::Private }; KSim::Progress::Progress(int maxValue, - QWidget *parent, const char *name, + TQWidget *parent, const char *name, WFlags fl) : KSim::Label(parent, name, fl) { init(maxValue); @@ -48,7 +48,7 @@ KSim::Progress::Progress(int maxValue, } KSim::Progress::Progress(int maxValue, - int type, const QString &label, QWidget *parent, + int type, const TQString &label, TQWidget *parent, const char *name, WFlags fl) : KSim::Label(type, label, parent, name, fl) { @@ -57,8 +57,8 @@ KSim::Progress::Progress(int maxValue, } KSim::Progress::Progress(int maxValue, - int type, const QString &label, int value, - QWidget *parent, const char *name, WFlags fl) + int type, const TQString &label, int value, + TQWidget *parent, const char *name, WFlags fl) : KSim::Label(type, label, parent, name, fl) { init(maxValue, value); @@ -66,7 +66,7 @@ KSim::Progress::Progress(int maxValue, } KSim::Progress::Progress(int maxValue, - int type, QWidget *parent, + int type, TQWidget *parent, const char *name, WFlags fl) : KSim::Label(type, parent, name, fl) { @@ -76,7 +76,7 @@ KSim::Progress::Progress(int maxValue, KSim::Progress::Progress(int maxValue, int type, ProgressType progressType, - QWidget *parent, const char *name, WFlags fl) + TQWidget *parent, const char *name, WFlags fl) : KSim::Label(type, parent, name, fl) { init(maxValue, 0, progressType); @@ -103,7 +103,7 @@ int KSim::Progress::maxValue() const return d->maxValue; } -const QRect &KSim::Progress::rectOrigin() const +const TQRect &KSim::Progress::rectOrigin() const { return d->rectOrigin; } @@ -124,9 +124,9 @@ void KSim::Progress::configureObject(bool repaintWidget) update(); } -QSize KSim::Progress::sizeHint() const +TQSize KSim::Progress::sizeHint() const { - QSize hint(Label::sizeHint()); + TQSize hint(Label::sizeHint()); if (d->meterPixmap.height() > hint.height()) hint.setHeight(d->meterPixmap.height()); @@ -179,14 +179,14 @@ void KSim::Progress::setMaxValue(int maxValue) } } -void KSim::Progress::setOrigin(const QRect &origin) +void KSim::Progress::setOrigin(const TQRect &origin) { d->rectOrigin = origin; } -void KSim::Progress::setMeterPixmap(const QPixmap &pixmap) +void KSim::Progress::setMeterPixmap(const TQPixmap &pixmap) { - QSize oldSize = sizeHint(); + TQSize oldSize = sizeHint(); d->meterPixmap = pixmap; relayoutLabel(oldSize); } @@ -204,13 +204,13 @@ int KSim::Progress::xLocation() const return returnValue; } -void KSim::Progress::paintEvent(QPaintEvent *ev) +void KSim::Progress::paintEvent(TQPaintEvent *ev) { KSim::Label::paintEvent(ev); drawMeter(); } -void KSim::Progress::resizeEvent(QResizeEvent *ev) +void KSim::Progress::resizeEvent(TQResizeEvent *ev) { KSim::Label::resizeEvent(ev); setOrigin(rect()); diff --git a/ksim/library/progress.h b/ksim/library/progress.h index 570894a..7f0f68a 100644 --- a/ksim/library/progress.h +++ b/ksim/library/progress.h @@ -43,7 +43,7 @@ namespace KSim * @param label is the text that will be displayed * @param parent is the parent widget */ - Progress(int maxValue, QWidget *parent, + Progress(int maxValue, TQWidget *parent, const char *name = 0, WFlags fl = 0); /** * constructs a KSim::Progress @@ -54,8 +54,8 @@ namespace KSim * @param label is the text that will be displayed * @param parent is the parent widget */ - Progress(int maxValue, int type, const QString &label, - QWidget *parent, const char *name = 0, WFlags fl = 0); + Progress(int maxValue, int type, const TQString &label, + TQWidget *parent, const char *name = 0, WFlags fl = 0); /** * constructs a KSim::Progress * @@ -66,8 +66,8 @@ namespace KSim * @param value is the initial value to be displayed * @param parent is the parent widget */ - Progress(int maxValue, int type, const QString &label, - int value, QWidget *parent, const char *name = 0, + Progress(int maxValue, int type, const TQString &label, + int value, TQWidget *parent, const char *name = 0, WFlags fl = 0); /** * constructs a KSim::Progress @@ -77,7 +77,7 @@ namespace KSim * @param type is the theme type * @param parent is the parent widget */ - Progress(int maxValue, int type, QWidget *parent, + Progress(int maxValue, int type, TQWidget *parent, const char *name = 0, WFlags fl = 0); /** * constructs a KSim::Progress @@ -90,7 +90,7 @@ namespace KSim */ Progress(int maxValue, int type, ProgressType progressType, - QWidget *parent, const char *name = 0, + TQWidget *parent, const char *name = 0, WFlags fl = 0); /** * destructs KSim::Chart @@ -113,7 +113,7 @@ namespace KSim /** * @return the area that the progress meter will be drawn */ - const QRect &rectOrigin() const; + const TQRect &rectOrigin() const; /** * reimplemented for internal reasons */ @@ -121,7 +121,7 @@ namespace KSim /** * reimplemented for internal reasons */ - virtual QSize sizeHint() const; + virtual TQSize sizeHint() const; public slots: /** @@ -146,11 +146,11 @@ namespace KSim /** * sets the area that the progess bar will be drawn */ - void setOrigin(const QRect &); + void setOrigin(const TQRect &); /** * sets the progress bar pixmap */ - void setMeterPixmap(const QPixmap &); + void setMeterPixmap(const TQPixmap &); /** * @return the pixel position where the meter should be drawn */ @@ -158,11 +158,11 @@ namespace KSim /** * reimplemented for internal reasons */ - virtual void paintEvent(QPaintEvent *); + virtual void paintEvent(TQPaintEvent *); /** * reimplemented for internal reasons */ - virtual void resizeEvent(QResizeEvent *); + virtual void resizeEvent(TQResizeEvent *); /** * paints the meter image onto the widget */ diff --git a/ksim/library/themeloader.cpp b/ksim/library/themeloader.cpp index 7c42dcd..f960ef7 100644 --- a/ksim/library/themeloader.cpp +++ b/ksim/library/themeloader.cpp @@ -22,15 +22,15 @@ #include "themetypes.h" #include "common.h" -#include <qfile.h> -#include <qstringlist.h> -#include <qvaluevector.h> -#include <qregexp.h> -#include <qapplication.h> -#include <qfileinfo.h> -#include <qdir.h> -#include <qimage.h> -#include <qbitmap.h> +#include <tqfile.h> +#include <tqstringlist.h> +#include <tqvaluevector.h> +#include <tqregexp.h> +#include <tqapplication.h> +#include <tqfileinfo.h> +#include <tqdir.h> +#include <tqimage.h> +#include <tqbitmap.h> #include <kdebug.h> #include <ksimpleconfig.h> @@ -41,40 +41,40 @@ class KSim::Theme::Private { public: - Private(const QValueVector<QString> &names, - const QStringList &list) : fileNames(names), + Private(const TQValueVector<TQString> &names, + const TQStringList &list) : fileNames(names), imageTypes(list) {} - QStringList file; - QStringList dFile; + TQStringList file; + TQStringList dFile; KConfig *globalReader; - QString altTheme; - QString location; - const QValueVector<QString> &fileNames; - const QStringList &imageTypes; + TQString altTheme; + TQString location; + const TQValueVector<TQString> &fileNames; + const TQStringList &imageTypes; int alternative; int font; bool recolour; - QString readOption(const QString &entry, + TQString readOption(const TQString &entry, bool useGlobal = true, - const QString &defValue = QString::null) + const TQString &defValue = TQString::null) { - QString text; - QStringList::ConstIterator it; + TQString text; + TQStringList::ConstIterator it; for (it = file.begin(); it != file.end(); ++it) { if ((*it).find(entry) != -1) { - text = QStringList::split("=", (*it))[1].stripWhiteSpace(); + text = TQStringList::split("=", (*it))[1].stripWhiteSpace(); } } if (!text.isEmpty() || dFile.isEmpty()) return text; - QStringList::ConstIterator it2; + TQStringList::ConstIterator it2; for (it2 = dFile.begin(); it2 != dFile.end(); ++it) { if ((*it2).find(entry) != -1) { - text = QStringList::split("=", (*it2))[1].stripWhiteSpace(); + text = TQStringList::split("=", (*it2))[1].stripWhiteSpace(); } } @@ -92,11 +92,11 @@ class KSim::Theme::Private class KSim::ThemeLoader::Private { public: - QValueVector<QString> fileNames; - QStringList imageTypes; + TQValueVector<TQString> fileNames; + TQStringList imageTypes; KConfig *globalReader; bool recolour; - QColor pixelColour; + TQColor pixelColour; }; bool KSim::Theme::operator==(const KSim::Theme &rhs) const @@ -124,24 +124,24 @@ KSim::Theme::~Theme() delete d; } -const QString &KSim::Theme::path() const +const TQString &KSim::Theme::path() const { return d->location; } -QString KSim::Theme::name() const +TQString KSim::Theme::name() const { - QString name = d->location; + TQString name = d->location; if (name.endsWith("/")) name.remove(name.length() - 1, 1); return name.remove(0, name.findRev("/") + 1); } -QString KSim::Theme::author() const +TQString KSim::Theme::author() const { - QString author(d->readOption("author", false)); - return author.replace(QRegExp("\""), QString::null); + TQString author(d->readOption("author", false)); + return author.replace(TQRegExp("\""), TQString::null); } int KSim::Theme::fontItem() const @@ -194,48 +194,48 @@ int KSim::Theme::frameRightWidth(int defValue) const return KMIN(2, internalNumEntry("frame_right_width", defValue)); } -QRect KSim::Theme::frameTopBorder(const QRect &defValue) const +TQRect KSim::Theme::frameTopBorder(const TQRect &defValue) const { return internalRectEntry("frame_top_border", defValue); } -QRect KSim::Theme::frameBottomBorder(const QRect &defValue) const +TQRect KSim::Theme::frameBottomBorder(const TQRect &defValue) const { return internalRectEntry("frame_bottom_border", defValue); } -QRect KSim::Theme::frameLeftBorder(const QRect &defValue) const +TQRect KSim::Theme::frameLeftBorder(const TQRect &defValue) const { return internalRectEntry("frame_left_border", defValue); } -QRect KSim::Theme::frameRightBorder(const QRect &defValue) const +TQRect KSim::Theme::frameRightBorder(const TQRect &defValue) const { return internalRectEntry("frame_right_border", defValue); } -QColor KSim::Theme::chartInColour(const QColor &defValue) const +TQColor KSim::Theme::chartInColour(const TQColor &defValue) const { if (d->recolour) - return QApplication::palette().active().background(); + return TQApplication::palette().active().background(); return internalColourEntry("chart_in_color", defValue); } -QColor KSim::Theme::chartInColourGrid(const QColor &defValue) const +TQColor KSim::Theme::chartInColourGrid(const TQColor &defValue) const { return internalColourEntry("chart_in_color_grid", defValue); } -QColor KSim::Theme::chartOutColour(const QColor &defValue) const +TQColor KSim::Theme::chartOutColour(const TQColor &defValue) const { if (d->recolour) - return QApplication::palette().active().background(); + return TQApplication::palette().active().background(); return internalColourEntry("chart_out_color", defValue); } -QColor KSim::Theme::chartOutColourGrid(const QColor &defValue) const +TQColor KSim::Theme::chartOutColourGrid(const TQColor &defValue) const { return internalColourEntry("chart_out_color_grid", defValue); } @@ -285,68 +285,68 @@ int KSim::Theme::krellSliderXHot(int defValue) const return internalNumEntry("krell_slider_x_hot", defValue); } -QRect KSim::Theme::sliderPanel(const QRect &defValue) const +TQRect KSim::Theme::sliderPanel(const TQRect &defValue) const { return internalRectEntry("bg_slider_panel_border", defValue); } -QRect KSim::Theme::sliderMeter(const QRect &defValue) const +TQRect KSim::Theme::sliderMeter(const TQRect &defValue) const { return internalRectEntry("bg_slider_meter_border", defValue); } -QRect KSim::Theme::timerBorder(const QRect &defValue) const +TQRect KSim::Theme::timerBorder(const TQRect &defValue) const { return internalRectEntry("bg_timer_border", defValue); } -QRect KSim::Theme::buttonPanelBorder(const QRect &defValue) const +TQRect KSim::Theme::buttonPanelBorder(const TQRect &defValue) const { return internalRectEntry("button_panel_border", defValue); } -QRect KSim::Theme::buttonMeterBorder(const QRect &defValue) const +TQRect KSim::Theme::buttonMeterBorder(const TQRect &defValue) const { return internalRectEntry("button_meter_border", defValue); } -QFont KSim::Theme::largeFont() const +TQFont KSim::Theme::largeFont() const { - QString font(internalStringEntry("large_font", QString::null)); + TQString font(internalStringEntry("large_font", TQString::null)); if (font.isEmpty()) - return QApplication::font(); + return TQApplication::font(); - QFont themeFont; - themeFont.setRawName(font.replace(QRegExp("\""), QString::null)); + TQFont themeFont; + themeFont.setRawName(font.replace(TQRegExp("\""), TQString::null)); return themeFont; } -QFont KSim::Theme::normalFont() const +TQFont KSim::Theme::normalFont() const { - QString font(internalStringEntry("normal_font", QString::null)); + TQString font(internalStringEntry("normal_font", TQString::null)); if (font.isEmpty()) - return QApplication::font(); + return TQApplication::font(); - QFont themeFont; - themeFont.setRawName(font.replace(QRegExp("\""), QString::null)); + TQFont themeFont; + themeFont.setRawName(font.replace(TQRegExp("\""), TQString::null)); return themeFont; } -QFont KSim::Theme::smallFont() const +TQFont KSim::Theme::smallFont() const { - QString font(internalStringEntry("small_font", QString::null)); + TQString font(internalStringEntry("small_font", TQString::null)); if (font.isEmpty()) - return QApplication::font(); + return TQApplication::font(); - QFont themeFont; - themeFont.setRawName(font.replace(QRegExp("\""), QString::null)); + TQFont themeFont; + themeFont.setRawName(font.replace(TQRegExp("\""), TQString::null)); return themeFont; } -QFont KSim::Theme::currentFont() const +TQFont KSim::Theme::currentFont() const { switch (fontItem()) { case 0: @@ -366,23 +366,23 @@ QFont KSim::Theme::currentFont() const break; } - return QFont(); + return TQFont(); } -QString KSim::Theme::meterPixmap(int type, bool useDefault) const +TQString KSim::Theme::meterPixmap(int type, bool useDefault) const { - QString imageFile = createType(type, d->location); - QString text; - QString file = d->fileNames[7]; + TQString imageFile = createType(type, d->location); + TQString text; + TQString file = d->fileNames[7]; - QStringList::ConstIterator it; + TQStringList::ConstIterator it; for (it = d->imageTypes.begin(); it != d->imageTypes.end(); ++it) { - if (QFile::exists(imageFile + file + d->altTheme + "." + *it)) { + if (TQFile::exists(imageFile + file + d->altTheme + "." + *it)) { text = imageFile + file + d->altTheme + "." + *it; break; } else - if (QFile::exists(d->location + file + d->altTheme + "." + *it)) { + if (TQFile::exists(d->location + file + d->altTheme + "." + *it)) { text = d->location + file + d->altTheme + "." + *it; break; } @@ -394,20 +394,20 @@ QString KSim::Theme::meterPixmap(int type, bool useDefault) const return text; } -QString KSim::Theme::panelPixmap(int type, bool useDefault) const +TQString KSim::Theme::panelPixmap(int type, bool useDefault) const { - QString imageFile = createType(type, d->location); - QString text; - QString file = d->fileNames[6]; + TQString imageFile = createType(type, d->location); + TQString text; + TQString file = d->fileNames[6]; - QStringList::ConstIterator it; + TQStringList::ConstIterator it; for (it = d->imageTypes.begin(); it != d->imageTypes.end(); ++it) { - if (QFile::exists(imageFile + file + d->altTheme + "." + *it)) { + if (TQFile::exists(imageFile + file + d->altTheme + "." + *it)) { text = imageFile + file + d->altTheme + "." + *it; break; } else - if (QFile::exists(d->location + file + d->altTheme + "." + *it)) { + if (TQFile::exists(d->location + file + d->altTheme + "." + *it)) { text = d->location + file + d->altTheme + "." + *it; break; } @@ -419,20 +419,20 @@ QString KSim::Theme::panelPixmap(int type, bool useDefault) const return text; } -QString KSim::Theme::ledPixmap(int type, bool useDefault) const +TQString KSim::Theme::ledPixmap(int type, bool useDefault) const { - QString imageFile = createType(type, d->location); - QString text; - QString file = d->fileNames[30]; + TQString imageFile = createType(type, d->location); + TQString text; + TQString file = d->fileNames[30]; - QStringList::ConstIterator it; + TQStringList::ConstIterator it; for (it = d->imageTypes.begin(); it != d->imageTypes.end(); ++it) { - if (QFile::exists(imageFile + file + d->altTheme + "." + *it)) { + if (TQFile::exists(imageFile + file + d->altTheme + "." + *it)) { text = imageFile + file + d->altTheme + "." + *it; break; } else - if (QFile::exists(d->location + file + d->altTheme + "." + *it)) { + if (TQFile::exists(d->location + file + d->altTheme + "." + *it)) { text = d->location + file + d->altTheme + "." + *it; break; } @@ -444,10 +444,10 @@ QString KSim::Theme::ledPixmap(int type, bool useDefault) const return text; } -QString KSim::Theme::framePixmap(int type, bool useDefault) const +TQString KSim::Theme::framePixmap(int type, bool useDefault) const { - QString text; - QString file; + TQString text; + TQString file; switch (type) { case Types::TopFrame: @@ -464,9 +464,9 @@ QString KSim::Theme::framePixmap(int type, bool useDefault) const break; } - QStringList::ConstIterator it; + TQStringList::ConstIterator it; for (it = d->imageTypes.begin(); it != d->imageTypes.end(); ++it) { - if (QFile::exists(d->location + file + d->altTheme + "." + *it)) { + if (TQFile::exists(d->location + file + d->altTheme + "." + *it)) { text = d->location + file + d->altTheme + "." + *it; break; } @@ -492,55 +492,55 @@ QString KSim::Theme::framePixmap(int type, bool useDefault) const return text; } -QString KSim::Theme::chartPixmap(bool useDefault) const +TQString KSim::Theme::chartPixmap(bool useDefault) const { return loader(4, useDefault); } -QString KSim::Theme::gridPixmap(bool useDefault) const +TQString KSim::Theme::gridPixmap(bool useDefault) const { return loader(5, useDefault); } -QString KSim::Theme::krellPanelPixmap(bool useDefault) const +TQString KSim::Theme::krellPanelPixmap(bool useDefault) const { return loader(14, useDefault); } -QString KSim::Theme::krellMeterPixmap(bool useDefault) const +TQString KSim::Theme::krellMeterPixmap(bool useDefault) const { return loader(15, useDefault); } -QString KSim::Theme::krellSliderPixmap(bool useDefault) const +TQString KSim::Theme::krellSliderPixmap(bool useDefault) const { return loader(16, useDefault); } -QString KSim::Theme::dataInPixmap(bool useDefault) const +TQString KSim::Theme::dataInPixmap(bool useDefault) const { return loader(18, useDefault); } -QString KSim::Theme::dataOutPixmap(bool useDefault) const +TQString KSim::Theme::dataOutPixmap(bool useDefault) const { return loader(20, useDefault); } -QString KSim::Theme::mailPixmap(bool useDefault) const +TQString KSim::Theme::mailPixmap(bool useDefault) const { - QString imageFile = createType(KSim::Types::Mail, d->location); - QString text; - QString file = d->fileNames[25]; + TQString imageFile = createType(KSim::Types::Mail, d->location); + TQString text; + TQString file = d->fileNames[25]; - QStringList::ConstIterator it; + TQStringList::ConstIterator it; for (it = d->imageTypes.begin(); it != d->imageTypes.end(); ++it) { - if (QFile::exists(imageFile + file + d->altTheme + "." + *it)) { + if (TQFile::exists(imageFile + file + d->altTheme + "." + *it)) { text = imageFile + file + d->altTheme + "." + *it; break; } else - if (QFile::exists(d->location + file + d->altTheme + "." + *it)) { + if (TQFile::exists(d->location + file + d->altTheme + "." + *it)) { text = d->location + file + d->altTheme + "." + *it; break; } @@ -548,21 +548,21 @@ QString KSim::Theme::mailPixmap(bool useDefault) const if (text.isNull() && useDefault) return KSim::ThemeLoader::defaultUrl() - + createType(KSim::Types::Mail, QString::null) + file + ".png"; + + createType(KSim::Types::Mail, TQString::null) + file + ".png"; return text; } -QPixmap KSim::Theme::splitPixmap(PixmapType type, uint itemNo, +TQPixmap KSim::Theme::splitPixmap(PixmapType type, uint itemNo, bool useDefault) const { return pixmapToList(type, itemNo, useDefault)[itemNo]; } -QValueList<QPixmap> KSim::Theme::pixmapToList(PixmapType type, +TQValueList<TQPixmap> KSim::Theme::pixmapToList(PixmapType type, int limitAmount, bool useDefault) const { - QImage image; + TQImage image; int xOffset = 0; int yOffset = 0; int depth = 0; @@ -588,27 +588,27 @@ QValueList<QPixmap> KSim::Theme::pixmapToList(PixmapType type, kdDebug(2003) << "KSim::Theme: type = KrellSlider" << endl; break; default: - return QValueList<QPixmap>(); + return TQValueList<TQPixmap>(); break; } if (image.isNull()) - return QValueList<QPixmap>(); + return TQValueList<TQPixmap>(); - QValueList<QPixmap> list; + TQValueList<TQPixmap> list; int size = image.height(); if (depth) size = image.height() / depth; KSim::ThemeLoader::self().reColourImage(image); - QPixmap pixmap = image; - QPixmap newPixmap(image.width() - xOffset, size); + TQPixmap pixmap = image; + TQPixmap newPixmap(image.width() - xOffset, size); for (int i = 0; i < (depth + 1); ++i) { newPixmap.fill(); if (pixmap.mask()) { - QBitmap mask(newPixmap.size()); + TQBitmap mask(newPixmap.size()); bitBlt(&mask, 0, 0, pixmap.mask(), xOffset, yOffset, image.width() - xOffset, size); newPixmap.setMask(mask); @@ -631,33 +631,33 @@ QValueList<QPixmap> KSim::Theme::pixmapToList(PixmapType type, return list; } -int KSim::Theme::transparency(const QString &itemType, - const QString &entry) const +int KSim::Theme::transparency(const TQString &itemType, + const TQString &entry) const { return readIntEntry(itemType, entry); } -bool KSim::Theme::textShadow(const QString &itemType, - const QString &entry) const +bool KSim::Theme::textShadow(const TQString &itemType, + const TQString &entry) const { if (d->recolour) return false; - QString shadow = readEntry(itemType, entry); + TQString shadow = readEntry(itemType, entry); if (shadow.isEmpty() || shadow.findRev("none") != -1) return false; return true; } -QColor KSim::Theme::shadowColour(const QString &itemType, - const QString &entry) const +TQColor KSim::Theme::shadowColour(const TQString &itemType, + const TQString &entry) const { return readColourEntry(itemType, entry, 1); } -QColor KSim::Theme::textColour(const QString &itemType, - const QString &entry) const +TQColor KSim::Theme::textColour(const TQString &itemType, + const TQString &entry) const { if (d->recolour) return KGlobalSettings::textColor(); @@ -665,41 +665,41 @@ QColor KSim::Theme::textColour(const QString &itemType, return readColourEntry(itemType, entry, 0); } -int KSim::Theme::readIntEntry(const QString &itemType, - const QString &entry) const +int KSim::Theme::readIntEntry(const TQString &itemType, + const TQString &entry) const { - QString entryName = itemType + " " + entry; + TQString entryName = itemType + " " + entry; return internalNumEntry(entryName, 0); } -QRect KSim::Theme::readRectEntry(const QString &itemType, - const QString &entry) const +TQRect KSim::Theme::readRectEntry(const TQString &itemType, + const TQString &entry) const { - QString entryName = itemType + " " + entry; - return internalRectEntry(entryName, QRect()); + TQString entryName = itemType + " " + entry; + return internalRectEntry(entryName, TQRect()); } -QString KSim::Theme::readEntry(const QString &itemType, - const QString &entry) const +TQString KSim::Theme::readEntry(const TQString &itemType, + const TQString &entry) const { - QString entryName = itemType + " " + entry; - return internalStringEntry(entryName, QString::null); + TQString entryName = itemType + " " + entry; + return internalStringEntry(entryName, TQString::null); } -QString KSim::Theme::readColourEntry(const QString &itemType, - const QString &entry, int row) const +TQString KSim::Theme::readColourEntry(const TQString &itemType, + const TQString &entry, int row) const { - QString color = readEntry(itemType, entry); + TQString color = readEntry(itemType, entry); if (color.isEmpty()) - color = QString::fromLatin1("#ffffff #ffffff"); + color = TQString::fromLatin1("#ffffff #ffffff"); - return QStringList::split(' ', color)[row]; + return TQStringList::split(' ', color)[row]; } -QFont KSim::Theme::readFontEntry(const QString &itemType, - const QString &entry) const +TQFont KSim::Theme::readFontEntry(const TQString &itemType, + const TQString &entry) const { - const QString &font = readEntry(itemType, entry); + const TQString &font = readEntry(itemType, entry); // If only there was a better way of doing this if (font == "small_font") @@ -711,13 +711,13 @@ QFont KSim::Theme::readFontEntry(const QString &itemType, if (font == "large_font") return largeFont(); - return QFont(); + return TQFont(); } -bool KSim::Theme::fontColours(int type, const QString &string, QFont &font, - QColor &text, QColor &shadow, bool &showShadow) const +bool KSim::Theme::fontColours(int type, const TQString &string, TQFont &font, + TQColor &text, TQColor &shadow, bool &showShadow) const { - QString key = KSim::Types::typeToString(type, false); + TQString key = KSim::Types::typeToString(type, false); bool repaint = false; // set colours from the string 'key' @@ -747,8 +747,8 @@ bool KSim::Theme::fontColours(int type, const QString &string, QFont &font, return repaint; } -bool KSim::Theme::fontColours(const KSim::Base *const base, QFont &font, - QColor &text, QColor &shadow, bool &showShadow) const +bool KSim::Theme::fontColours(const KSim::Base *const base, TQFont &font, + TQColor &text, TQColor &shadow, bool &showShadow) const { if (!base) return false; @@ -762,8 +762,8 @@ KSim::Theme::Theme() d = 0; } -KSim::Theme::Theme(const QString &url, const QString &fileName, int alt, - const QValueVector<QString> &vector, const QStringList &list, +KSim::Theme::Theme(const TQString &url, const TQString &fileName, int alt, + const TQValueVector<TQString> &vector, const TQStringList &list, KConfig *globalReader) { create(vector, list, globalReader); @@ -773,45 +773,45 @@ KSim::Theme::Theme(const QString &url, const QString &fileName, int alt, d->recolour = KSim::Config::config()->readBoolEntry("ReColourTheme", false); } -void KSim::Theme::create(const QValueVector<QString> &vector, - const QStringList &list, KConfig *globalReader) +void KSim::Theme::create(const TQValueVector<TQString> &vector, + const TQStringList &list, KConfig *globalReader) { d = new Private(vector, list); d->globalReader = globalReader; } -void KSim::Theme::init(const QString &url, const QString &fileName, int alt) +void KSim::Theme::init(const TQString &url, const TQString &fileName, int alt) { d->altTheme = KSim::ThemeLoader::alternativeAsString(alt); d->location = url; d->alternative = alt; d->font = KSim::ThemeLoader::currentFontItem(); - d->file = QStringList::split("\n", parseConfig(url, fileName)); + d->file = TQStringList::split("\n", parseConfig(url, fileName)); if (alt != 0) - d->dFile = QStringList::split("\n", parseConfig(url, "gkrellmrc")); + d->dFile = TQStringList::split("\n", parseConfig(url, "gkrellmrc")); } -void KSim::Theme::reparse(const QString &url, const QString &fileName, int alt) +void KSim::Theme::reparse(const TQString &url, const TQString &fileName, int alt) { init(url, fileName, alt); } -QString KSim::Theme::parseConfig(const QString &url, - const QString &fileName) +TQString KSim::Theme::parseConfig(const TQString &url, + const TQString &fileName) { return KSim::ThemeLoader::self().parseConfig(url, fileName); } -QString KSim::Theme::loader(int value, bool useDefault) const +TQString KSim::Theme::loader(int value, bool useDefault) const { - QString text; - QString file = d->fileNames[value]; + TQString text; + TQString file = d->fileNames[value]; - QStringList::ConstIterator it; + TQStringList::ConstIterator it; for (it = d->imageTypes.begin(); it != d->imageTypes.end(); ++it) { - if (QFile::exists(d->location + file + d->altTheme + "." + *it)) { + if (TQFile::exists(d->location + file + d->altTheme + "." + *it)) { text = d->location + file + d->altTheme + "." + *it; break; } @@ -823,7 +823,7 @@ QString KSim::Theme::loader(int value, bool useDefault) const return text; } -QString KSim::Theme::createType(int type, const QString &text) const +TQString KSim::Theme::createType(int type, const TQString &text) const { if (type == Types::None) return text; @@ -841,37 +841,37 @@ void KSim::Theme::setRecolour(bool value) // Keep the ugliness here to make the rest // of the class readable -int KSim::Theme::internalNumEntry(const QString &entry, int defValue) const +int KSim::Theme::internalNumEntry(const TQString &entry, int defValue) const { - return d->readOption(entry, true, QString::number(defValue)).toInt(); + return d->readOption(entry, true, TQString::number(defValue)).toInt(); } -QRect KSim::Theme::internalRectEntry(const QString &entry, - const QRect &defValue) const +TQRect KSim::Theme::internalRectEntry(const TQString &entry, + const TQRect &defValue) const { - QString rect; - rect += QString::number(defValue.left()); + TQString rect; + rect += TQString::number(defValue.left()); rect += ","; - rect += QString::number(defValue.top()); + rect += TQString::number(defValue.top()); rect += ","; - rect += QString::number(defValue.width()); + rect += TQString::number(defValue.width()); rect += ","; - rect += QString::number(defValue.height()); + rect += TQString::number(defValue.height()); - QStringList list = QStringList::split(",", d->readOption(entry, true, rect)); - QRect rect2(list[0].toInt(), list[1].toInt(), list[2].toInt(), list[3].toInt()); + TQStringList list = TQStringList::split(",", d->readOption(entry, true, rect)); + TQRect rect2(list[0].toInt(), list[1].toInt(), list[2].toInt(), list[3].toInt()); return rect2; } -QColor KSim::Theme::internalColourEntry(const QString &entry, - const QColor &defValue) const +TQColor KSim::Theme::internalColourEntry(const TQString &entry, + const TQColor &defValue) const { return d->readOption(entry, true, defValue.name()); } -QString KSim::Theme::internalStringEntry(const QString &entry, - const QString &defValue) const +TQString KSim::Theme::internalStringEntry(const TQString &entry, + const TQString &defValue) const { return d->readOption(entry, true, defValue); } @@ -927,7 +927,7 @@ void KSim::ThemeLoader::reload() if (m_theme.d) m_theme.d->globalReader = d->globalReader; - QString fileName = QString::fromLatin1("gkrellmrc") + alternativeAsString(); + TQString fileName = TQString::fromLatin1("gkrellmrc") + alternativeAsString(); m_theme.reparse(currentUrl(), fileName, currentAlternative()); } @@ -936,20 +936,20 @@ const KSim::Theme &KSim::ThemeLoader::current() const return m_theme; } -KSim::Theme KSim::ThemeLoader::theme(const QString &url, - const QString &rcFile, int alt) const +KSim::Theme KSim::ThemeLoader::theme(const TQString &url, + const TQString &rcFile, int alt) const { return KSim::Theme(url, rcFile, alt, d->fileNames, d->imageTypes, d->globalReader); } -void KSim::ThemeLoader::reColourImage(QImage &image) +void KSim::ThemeLoader::reColourImage(TQImage &image) { if (!d->recolour || image.isNull()) return; - QColor color = QApplication::palette().active().background(); - QImage output(image.width(), image.height(), 32); + TQColor color = TQApplication::palette().active().background(); + TQImage output(image.width(), image.height(), 32); output.setAlphaBuffer(image.hasAlphaBuffer()); Q_UINT32 r = color.red(); @@ -980,22 +980,22 @@ void KSim::ThemeLoader::reColourImage(QImage &image) image = output; } -QString KSim::ThemeLoader::parseConfig(const QString &url, - const QString &fileName) +TQString KSim::ThemeLoader::parseConfig(const TQString &url, + const TQString &fileName) { - QFile origFile(url + fileName); + TQFile origFile(url + fileName); if (!origFile.open(IO_ReadOnly)) - return QString::null; - - QTextStream origStream(&origFile); - QString text; - QRegExp reg("\\*"); // regexp for '*' chars - QRegExp number("[0-9]+"); // regexp for all numbers - QRegExp numbers("[0-9]+,[0-9]+,[0-9]+,[0-9]+"); // regexp for int,int,int,int - QRegExp minus("[a-zA-Z]+ \\- [a-zA-Z]+"); // regexp for 'someText - someText' + return TQString::null; + + TQTextStream origStream(&origFile); + TQString text; + TQRegExp reg("\\*"); // regexp for '*' chars + TQRegExp number("[0-9]+"); // regexp for all numbers + TQRegExp numbers("[0-9]+,[0-9]+,[0-9]+,[0-9]+"); // regexp for int,int,int,int + TQRegExp minus("[a-zA-Z]+ \\- [a-zA-Z]+"); // regexp for 'someText - someText' while (!origStream.atEnd()) { - QString line(origStream.readLine().simplifyWhiteSpace()); + TQString line(origStream.readLine().simplifyWhiteSpace()); if (line.find(reg) == 0) // find the location of the * comments // replace all * comments with # comments so KConfig doesn't complain @@ -1016,7 +1016,7 @@ QString KSim::ThemeLoader::parseConfig(const QString &url, numLoc = line.findRev(minus); if (numLoc != -1) // replace the '-' with an '=' so KConfig doesn't get confused - line.replace(QRegExp("-"), "="); + line.replace(TQRegExp("-"), "="); } } @@ -1030,50 +1030,50 @@ QString KSim::ThemeLoader::parseConfig(const QString &url, // so the following code changes the dir structure // of a theme to be more consistant, but the dir structure // is still compliant with GKrellM. -void KSim::ThemeLoader::parseDir(const QString &url, int alt) +void KSim::ThemeLoader::parseDir(const TQString &url, int alt) { - if ( !QFileInfo( url ).isWritable() && currentName() != "ksim" ) + if ( !TQFileInfo( url ).isWritable() && currentName() != "ksim" ) { - QString homePath = QDir::current().path(); + TQString homePath = TQDir::current().path(); homePath = locateLocal( "data", "ksim" ) - + QString::fromLatin1( "/themes" ) + + TQString::fromLatin1( "/themes" ) + homePath.right( homePath.length() - - homePath.findRev( QRegExp( "\\/" ), + - homePath.findRev( TQRegExp( "\\/" ), homePath.length() ) ); - if ( !QFile::exists( homePath ) ) + if ( !TQFile::exists( homePath ) ) KStandardDirs::makeDir( homePath ); kdWarning() << "Cant write to current dir, setting dir to " << homePath << endl; - QDir::setCurrent( homePath ); + TQDir::setCurrent( homePath ); } int alternatives = ++alt; - QStringList formats; - QStringList panels; - QStringList meters; + TQStringList formats; + TQStringList panels; + TQStringList meters; formats << "png" << "jpg" << "jpeg" << "gif" << "xpm"; panels << "inet" << "net" << "proc" << "cpu" << "disk"; meters << "mem" << "fs" << "mail" << "apm" << "uptime" << "clock" << "cal" << "timer" << "host" << "swap"; - QDir directory; + TQDir directory; for (int i = 0; i < alternatives; ++i) { - QString altString = KSim::ThemeLoader::alternativeAsString(i); + TQString altString = KSim::ThemeLoader::alternativeAsString(i); if (alternatives == 1 || i == 0) - altString = QString::null; + altString = TQString::null; - QStringList::ConstIterator format; + TQStringList::ConstIterator format; for (format = formats.begin(); format != formats.end(); ++format) { // go through the meters array and move the files to the correct dir/filename - QStringList::Iterator meter; + TQStringList::Iterator meter; for (meter = meters.begin(); meter != meters.end(); ++meter) { - QString bgMeter = QString::fromLatin1("bg_meter_"); - if (QFile::exists(bgMeter + (*meter) + altString + "." + (*format))) { + TQString bgMeter = TQString::fromLatin1("bg_meter_"); + if (TQFile::exists(bgMeter + (*meter) + altString + "." + (*format))) { if (KStandardDirs::makeDir(url + (*meter))) directory.rename(bgMeter + (*meter) + altString + "." + (*format), (*meter) + "/bg_meter" + altString + "." + (*format)); @@ -1081,10 +1081,10 @@ void KSim::ThemeLoader::parseDir(const QString &url, int alt) } // go through the panels array and move the files to the correct dir/filename - QStringList::ConstIterator panel; + TQStringList::ConstIterator panel; for (panel = panels.begin(); panel != panels.end(); ++panel) { - QString bgPanel = QString::fromLatin1("bg_panel_"); - if (QFile::exists(bgPanel + (*panel) + altString + "." + (*format))) { + TQString bgPanel = TQString::fromLatin1("bg_panel_"); + if (TQFile::exists(bgPanel + (*panel) + altString + "." + (*format))) { if (KStandardDirs::makeDir(url + (*panel))) directory.rename(bgPanel + (*panel) + altString + "." + (*format), (*panel) + "/bg_panel" + altString + "." + (*format)); @@ -1092,14 +1092,14 @@ void KSim::ThemeLoader::parseDir(const QString &url, int alt) } // fix stupid themes that have a bg_panel image in the host dir - QString tempFile = QString::fromLatin1("host/bg_panel"); - if (QFile::exists(tempFile + altString + "." + (*format))) + TQString tempFile = TQString::fromLatin1("host/bg_panel"); + if (TQFile::exists(tempFile + altString + "." + (*format))) directory.rename(tempFile + altString + "." + (*format), "host/bg_meter" + altString + "." + (*format)); // move decal_net_leds* to the net folder to be more consistant - tempFile = QString::fromLatin1("decal_net_leds"); - if (QFile::exists(tempFile + altString + "." + (*format))) { + tempFile = TQString::fromLatin1("decal_net_leds"); + if (TQFile::exists(tempFile + altString + "." + (*format))) { if (KStandardDirs::makeDir(url + "net")) directory.rename(tempFile + altString + "." + (*format), "net/decal_net_leds" + altString + "." + (*format)); @@ -1110,7 +1110,7 @@ void KSim::ThemeLoader::parseDir(const QString &url, int alt) void KSim::ThemeLoader::validate() { - if (!QFile::exists(currentUrl())) { + if (!TQFile::exists(currentUrl())) { KSim::Config::config()->setGroup("Theme"); KSim::Config::config()->writeEntry("Name", "ksim"); KSim::Config::config()->writeEntry("Alternative", 0); @@ -1118,29 +1118,29 @@ void KSim::ThemeLoader::validate() } } -void KSim::ThemeLoader::themeColours(QWidget *widget) +void KSim::ThemeLoader::themeColours(TQWidget *widget) { widget->setEraseColor(d->pixelColour); } -QString KSim::ThemeLoader::currentName() +TQString KSim::ThemeLoader::currentName() { KSim::Config::config()->setGroup("Theme"); return KSim::Config::config()->readEntry("Name", "ksim"); } -QString KSim::ThemeLoader::currentUrl() +TQString KSim::ThemeLoader::currentUrl() { KSim::Config::config()->setGroup("Theme"); - QString folder(KSim::Config::config()->readEntry("Name")); + TQString folder(KSim::Config::config()->readEntry("Name")); folder.prepend("ksim/themes/").append("/"); - QString dirName(KGlobal::dirs()->findResourceDir("data", folder)); + TQString dirName(KGlobal::dirs()->findResourceDir("data", folder)); dirName += folder; return dirName; } -QString KSim::ThemeLoader::defaultUrl() +TQString KSim::ThemeLoader::defaultUrl() { return KGlobal::dirs()->findDirs("data", "ksim/themes/ksim").first(); } @@ -1156,14 +1156,14 @@ int KSim::ThemeLoader::currentAlternative() return alternative; } -QString KSim::ThemeLoader::alternativeAsString(int alt) +TQString KSim::ThemeLoader::alternativeAsString(int alt) { int alternative = (alt == -1 ? currentAlternative() : alt); - return (alternative == 0 ? QString::null : QString::fromLatin1("_") - + QString::number(alternative)); + return (alternative == 0 ? TQString::null : TQString::fromLatin1("_") + + TQString::number(alternative)); } -QFont KSim::ThemeLoader::currentFont() +TQFont KSim::ThemeLoader::currentFont() { if (currentFontItem() != 3) return self().current().currentFont(); @@ -1225,7 +1225,7 @@ KSim::ThemeLoader::ThemeLoader() m_theme.create(d->fileNames, d->imageTypes, d->globalReader); - QString fileName = QString::fromLatin1("gkrellmrc") + alternativeAsString(); + TQString fileName = TQString::fromLatin1("gkrellmrc") + alternativeAsString(); m_theme.init(currentUrl(), fileName, currentAlternative()); reColourItems(); @@ -1257,10 +1257,10 @@ void KSim::ThemeLoader::reColourItems() void KSim::ThemeLoader::grabColour() { KSim::Config::config()->setGroup("Theme"); - QPoint pos(2, 2); + TQPoint pos(2, 2); pos = KSim::Config::config()->readPointEntry("PixelLocation", &pos); - QImage image(current().meterPixmap(Types::None)); + TQImage image(current().meterPixmap(Types::None)); reColourImage(image); d->pixelColour = image.pixel(pos.x(), pos.y()); } diff --git a/ksim/library/themeloader.h b/ksim/library/themeloader.h index c20afe0..28a38e6 100644 --- a/ksim/library/themeloader.h +++ b/ksim/library/themeloader.h @@ -20,11 +20,11 @@ #ifndef THEMELOADER_H #define THEMELOADER_H -#include <qstring.h> -#include <qrect.h> -#include <qcolor.h> -#include <qfont.h> -#include <qvaluelist.h> +#include <tqstring.h> +#include <tqrect.h> +#include <tqcolor.h> +#include <tqfont.h> +#include <tqvaluelist.h> #include <kdemacros.h> @@ -56,15 +56,15 @@ namespace KSim /** * @return the theme path */ - const QString &path() const; + const TQString &path() const; /** * @return the name of the theme */ - QString name() const; + TQString name() const; /** * @return the author of the theme */ - QString author() const; + TQString author() const; /** * @return the set font item for the theme */ @@ -105,35 +105,35 @@ namespace KSim /** * @return a rect of the top frame border */ - QRect frameTopBorder(const QRect &defValue = QRect()) const; + TQRect frameTopBorder(const TQRect &defValue = TQRect()) const; /** * @return a rect of the bottom frame border */ - QRect frameBottomBorder(const QRect &defValue = QRect()) const; + TQRect frameBottomBorder(const TQRect &defValue = TQRect()) const; /** * @return a rect of the left frame border */ - QRect frameLeftBorder(const QRect &defValue = QRect()) const; + TQRect frameLeftBorder(const TQRect &defValue = TQRect()) const; /** * @return a rect of the right frame border */ - QRect frameRightBorder(const QRect &defValue = QRect()) const; + TQRect frameRightBorder(const TQRect &defValue = TQRect()) const; /** * @return the color of the chart in */ - QColor chartInColour(const QColor &defValue = QColor()) const; + TQColor chartInColour(const TQColor &defValue = TQColor()) const; /** * @return the color of the chart in grid */ - QColor chartInColourGrid(const QColor &defValue = QColor()) const; + TQColor chartInColourGrid(const TQColor &defValue = TQColor()) const; /** * @return the color of the chart out */ - QColor chartOutColour(const QColor &defValue = QColor()) const; + TQColor chartOutColour(const TQColor &defValue = TQColor()) const; /** * @return the color of the chart out grid */ - QColor chartOutColourGrid(const QColor &defValue = QColor()) const; + TQColor chartOutColourGrid(const TQColor &defValue = TQColor()) const; /** * if false then the grid lines should be drawn at the * top and bottom of the graphs @@ -174,40 +174,40 @@ namespace KSim /** * @return the area for the slider panel */ - QRect sliderPanel(const QRect &defValue = QRect()) const; + TQRect sliderPanel(const TQRect &defValue = TQRect()) const; /** * @return the area for the slider meter */ - QRect sliderMeter(const QRect &defValue = QRect()) const; + TQRect sliderMeter(const TQRect &defValue = TQRect()) const; /** * @return the border for the timer label/button */ - QRect timerBorder(const QRect &defValue = QRect()) const; + TQRect timerBorder(const TQRect &defValue = TQRect()) const; /** * @return the border for the panel button */ - QRect buttonPanelBorder(const QRect &defValue = QRect()) const; + TQRect buttonPanelBorder(const TQRect &defValue = TQRect()) const; /** * @return the border for the meter button */ - QRect buttonMeterBorder(const QRect &defValue = QRect()) const; + TQRect buttonMeterBorder(const TQRect &defValue = TQRect()) const; /** * @return the large font that the theme specifies */ - QFont largeFont() const; + TQFont largeFont() const; /** * @return the normal font that the theme specifies */ - QFont normalFont() const; + TQFont normalFont() const; /** * @return the small font that the theme specifies */ - QFont smallFont() const; + TQFont smallFont() const; /** * @return the current font to be used * according to fontItem() */ - QFont currentFont() const; + TQFont currentFont() const; /** * @return the meter image (bg_meter.[png|jpg|gif]) * of the current theme, if type is specified then it will @@ -218,14 +218,14 @@ namespace KSim * @param type is one of: none, apm, cal, clock, fs, * host, mail, mem, swap, timer, uptime */ - QString meterPixmap(int type, bool useDefault = true) const; + TQString meterPixmap(int type, bool useDefault = true) const; /** * @return the meter image (bg_panel.[png|jpg|gif]) * of the current theme, it will first look in the dir 'type' * if no image is found it will drop back a dir * @param type is one of: net, inet */ - QString panelPixmap(int type, bool useDefault = true) const; + TQString panelPixmap(int type, bool useDefault = true) const; /** * @return the decal net leds image * (usually decal_net_leds.[png|jpg|gif]) of the @@ -233,57 +233,57 @@ namespace KSim * if no image is found it will drop back a dir * @param type is one of: net, inet */ - QString ledPixmap(int type, bool useDefault = true) const; + TQString ledPixmap(int type, bool useDefault = true) const; /** * @return the frame image of the current theme, * @param type is one of: top, bottom, left, right */ - QString framePixmap(int type, bool useDefault = true) const; + TQString framePixmap(int type, bool useDefault = true) const; /** * @return the krell chart image (bg_chart.[png|jpg|gif]) * of the current theme */ - QString chartPixmap(bool useDefault = true) const; + TQString chartPixmap(bool useDefault = true) const; /** * @return the krell grid image (bg_grid.[png|jpg|gif]) * of the current theme */ - QString gridPixmap(bool useDefault = true) const; + TQString gridPixmap(bool useDefault = true) const; /** * @return the krell panel image (krell_panel.[png|jpg|gif]) * of the current theme */ - QString krellPanelPixmap(bool useDefault = true) const; + TQString krellPanelPixmap(bool useDefault = true) const; /** * @return the krell meter image (krell_meter.[png|jpg|gif]) * of the current theme */ - QString krellMeterPixmap(bool useDefault = true) const; + TQString krellMeterPixmap(bool useDefault = true) const; /** * @return the krell slider image (krell_slider.[png|jpg|gif]) * of the current theme */ - QString krellSliderPixmap(bool useDefault = true) const; + TQString krellSliderPixmap(bool useDefault = true) const; /** * @return the data in image (data_in.[png|jpg|gif]) * of the current theme */ - QString dataInPixmap(bool useDefault = true) const; + TQString dataInPixmap(bool useDefault = true) const; /** * @return the data out image (data_out.[png|jpg|gif]) * of the current theme */ - QString dataOutPixmap(bool useDefault = true) const; + TQString dataOutPixmap(bool useDefault = true) const; /** * @return the mail image (mail/decal_mail.[png|jpg|gif]) * of the current theme */ - QString mailPixmap(bool useDefault = true) const; + TQString mailPixmap(bool useDefault = true) const; /** * @return a segmant of an image, using @p itemNo to * get the segmant and from the ImageType @p type */ - QPixmap splitPixmap(PixmapType type, uint itemNo = 0, + TQPixmap splitPixmap(PixmapType type, uint itemNo = 0, bool useDefault = true) const; /** * Same as the above function but returns an array of pixmaps @@ -291,44 +291,44 @@ namespace KSim * limitAmount is -1 (default) * @return an array of pixmaps */ - QValueList<QPixmap> pixmapToList(PixmapType type, + TQValueList<TQPixmap> pixmapToList(PixmapType type, int limitAmount = -1, bool useDefault = true) const; /** * returns the transparency level from the specified keys */ - int transparency(const QString &, const QString &) const; + int transparency(const TQString &, const TQString &) const; /** * @return true if shadow text is enabled */ - bool textShadow(const QString &, const QString &) const; + bool textShadow(const TQString &, const TQString &) const; /** * @return the shadow color (if any) for the specified keys */ - QColor shadowColour(const QString &, const QString &) const; + TQColor shadowColour(const TQString &, const TQString &) const; /** * @return the text color for the specified keys */ - QColor textColour(const QString &, const QString &) const; + TQColor textColour(const TQString &, const TQString &) const; /** * reads an entry and returns it as an int */ - int readIntEntry(const QString &, const QString &) const; + int readIntEntry(const TQString &, const TQString &) const; /** * @return a rect from the specified keys */ - QRect readRectEntry(const QString &, const QString &) const; + TQRect readRectEntry(const TQString &, const TQString &) const; /** * reads an entry from the specified keys */ - QString readEntry(const QString &, const QString &) const; + TQString readEntry(const TQString &, const TQString &) const; /** * reads a color entry from the specified keys */ - QString readColourEntry(const QString &, const QString &, int) const; + TQString readColourEntry(const TQString &, const TQString &, int) const; /** * reads a font entry from the specified keys */ - QFont readFontEntry(const QString &, const QString &) const; + TQFont readFontEntry(const TQString &, const TQString &) const; /** * sets the font, textColour, shadowColour and showShadow to * the fonts and colours KSim should use depending on type and @@ -340,8 +340,8 @@ namespace KSim * * example usage: * <pre> - * QFont font; - * QColor textColour, shadowColour; + * TQFont font; + * TQColor textColour, shadowColour; * bool showShadow; * if (KSim::ThemeLoader::self().current().fontColours(type(), configString(), font, * textColour, shadowColour, showShadow) @@ -356,35 +356,35 @@ namespace KSim * from, generally if you're calling this from a KSim::Base (or derived from) * object then use configString() */ - bool fontColours(int type, const QString &string, QFont &font, - QColor &textColour, QColor &shadowColour, bool &showShadow) const; + bool fontColours(int type, const TQString &string, TQFont &font, + TQColor &textColour, TQColor &shadowColour, bool &showShadow) const; /** * convenience function. * * collects the theme type and config key from the base pointer */ - bool fontColours(const KSim::Base *const base, QFont &font, - QColor &textColour, QColor &shadowColour, bool &showShadow) const; + bool fontColours(const KSim::Base *const base, TQFont &font, + TQColor &textColour, TQColor &shadowColour, bool &showShadow) const; Theme(const KSim::Theme &); private: Theme(); - Theme(const QString &url, const QString &fileName, int alt, - const QValueVector<QString> &vector, const QStringList &list, + Theme(const TQString &url, const TQString &fileName, int alt, + const TQValueVector<TQString> &vector, const TQStringList &list, KConfig *globalReader); - void create(const QValueVector<QString> &, const QStringList &, KConfig *); - void init(const QString &url, const QString &fileName, int alt); - void reparse(const QString &url, const QString &fileName, int alt); - QString parseConfig(const QString &, const QString &); - QString loader(int, bool useDefault = true) const; - QString createType(int, const QString &) const; + void create(const TQValueVector<TQString> &, const TQStringList &, KConfig *); + void init(const TQString &url, const TQString &fileName, int alt); + void reparse(const TQString &url, const TQString &fileName, int alt); + TQString parseConfig(const TQString &, const TQString &); + TQString loader(int, bool useDefault = true) const; + TQString createType(int, const TQString &) const; void setRecolour(bool); - int internalNumEntry(const QString &, int) const; - QRect internalRectEntry(const QString &, const QRect &) const; - QColor internalColourEntry(const QString &, const QColor &) const; - QString internalStringEntry(const QString &, const QString &) const; + int internalNumEntry(const TQString &, int) const; + TQRect internalRectEntry(const TQString &, const TQRect &) const; + TQColor internalColourEntry(const TQString &, const TQColor &) const; + TQString internalStringEntry(const TQString &, const TQString &) const; class Private; Private *d; @@ -422,24 +422,24 @@ namespace KSim * @param rcFile is the filename of the config file (optional) * @param alt is the theme alternative number (optional) */ - KSim::Theme theme(const QString &url, - const QString &rcFile = "gkrellmrc", int alt = 0) const; + KSim::Theme theme(const TQString &url, + const TQString &rcFile = "gkrellmrc", int alt = 0) const; /** * re-colours an image to the current KDE * color scheme */ - void reColourImage(QImage &image); + void reColourImage(TQImage &image); /** * changes some of the entries in the config file so kconfig * can handle the file better. * @return the location of the config file */ - QString parseConfig(const QString &url, const QString &file); + TQString parseConfig(const TQString &url, const TQString &file); /** * change the dir structure of a theme directory * so KSim can understand them better */ - void parseDir(const QString &url, int alt); + void parseDir(const TQString &url, int alt); /** * checks if the themeUrl entry is valid, * if not it then reverts the current theme @@ -449,20 +449,20 @@ namespace KSim /** * sets the pallete of the current theme */ - void themeColours(QWidget *); + void themeColours(TQWidget *); /** * @return current theme name */ - static QString currentName(); + static TQString currentName(); /** * @return current theme url, if there is no current theme * then it will return the default theme */ - static QString currentUrl(); + static TQString currentUrl(); /** * @return the default theme url */ - static QString defaultUrl(); + static TQString defaultUrl(); /** * @return the current theme alternative */ @@ -475,11 +475,11 @@ namespace KSim * if this is set to -1 (the default) then the current alternative * will be used */ - static QString alternativeAsString(int alt = -1); + static TQString alternativeAsString(int alt = -1); /** * @return the font of the theme if the theme font is set to custom */ - static QFont currentFont(); + static TQFont currentFont(); /** * @return the font item of the theme, eg: 0 would be the small font */ diff --git a/ksim/library/themetypes.h b/ksim/library/themetypes.h index 805302c..0f34fbf 100644 --- a/ksim/library/themetypes.h +++ b/ksim/library/themetypes.h @@ -58,10 +58,10 @@ namespace KSim /** * @return the ThemeType enum as a QString */ - inline QString typeToString(int type, bool incSlash = true) + inline TQString typeToString(int type, bool incSlash = true) { if (type == Types::None) - return QString::null; + return TQString::null; // This array MUST be in the same order // as the ThemeType enum @@ -72,9 +72,9 @@ namespace KSim "uptime", "net", "inet", 0 }; - QString returnString; + TQString returnString; returnString.setLatin1(typeNames[type]); - return incSlash ? returnString + QString::fromLatin1("/") : returnString; + return incSlash ? returnString + TQString::fromLatin1("/") : returnString; } } } diff --git a/ksim/monitorprefs.cpp b/ksim/monitorprefs.cpp index 1e67945..0038c85 100644 --- a/ksim/monitorprefs.cpp +++ b/ksim/monitorprefs.cpp @@ -29,7 +29,7 @@ #include <ksimconfig.h> #include <pluginloader.h> -KSim::MonitorPrefs::MonitorPrefs(QWidget *parent, const char *name) +KSim::MonitorPrefs::MonitorPrefs(TQWidget *parent, const char *name) : KListView(parent, name) { addColumn(i18n("Monitor")); @@ -42,15 +42,15 @@ KSim::MonitorPrefs::MonitorPrefs(QWidget *parent, const char *name) setDragEnabled(true); setAcceptDrops(true); setAllColumnsShowFocus(true); - setSelectionMode(QListView::Single); + setSelectionMode(TQListView::Single); // Scan for .desktop files and enter them into the KListView m_locatedFiles = KGlobal::dirs()->findAllResources("data", "ksim/monitors/*.desktop"); m_locatedFiles.sort(); - QStringList::ConstIterator it; + TQStringList::ConstIterator it; for (it = m_locatedFiles.begin(); it != m_locatedFiles.end(); ++it) { KDesktopFile file((*it), true); - (void)(new QCheckListItem(this, file.readName(), QCheckListItem::CheckBox))->setText(1, file.readComment()); + (void)(new TQCheckListItem(this, file.readName(), TQCheckListItem::CheckBox))->setText(1, file.readComment()); } sort(); @@ -63,11 +63,11 @@ KSim::MonitorPrefs::~MonitorPrefs() void KSim::MonitorPrefs::saveConfig(KSim::Config *config) { - QCheckListItem *item; - QStringList::ConstIterator it; + TQCheckListItem *item; + TQStringList::ConstIterator it; for (it = m_locatedFiles.begin(); it != m_locatedFiles.end(); ++it) { KSim::PluginInfo info = KSim::PluginLoader::self().findPluginInfo((*it)); - item = static_cast<QCheckListItem *>(findItem(info.name(), 0)); + item = static_cast<TQCheckListItem *>(findItem(info.name(), 0)); config->setEnabledMonitor(info.libName(), item->isOn()); config->setMonitorCommand(info.libName(), item->text(2)); config->setMonitorLocation(info.libName(), itemIndex(item)); @@ -77,15 +77,15 @@ void KSim::MonitorPrefs::saveConfig(KSim::Config *config) void KSim::MonitorPrefs::readConfig(KSim::Config *config) { int location; - QCheckListItem *origItem; - QStringList::ConstIterator it; + TQCheckListItem *origItem; + TQStringList::ConstIterator it; for (it = m_locatedFiles.begin(); it != m_locatedFiles.end(); ++it) { KSim::PluginInfo info = KSim::PluginLoader::self().findPluginInfo((*it)); location = config->monitorLocation(info.libName()); - origItem = static_cast<QCheckListItem *>(findItem(info.name(), 0)); + origItem = static_cast<TQCheckListItem *>(findItem(info.name(), 0)); origItem->setOn(config->enabledMonitor(info.libName())); origItem->setText(2, config->monitorCommand(info.libName())); - if (QListViewItem *item = itemAtIndex(location)) { + if (TQListViewItem *item = itemAtIndex(location)) { if (location) { origItem->moveItem(item->itemAbove()); } diff --git a/ksim/monitorprefs.h b/ksim/monitorprefs.h index 6cb4798..03f3d5f 100644 --- a/ksim/monitorprefs.h +++ b/ksim/monitorprefs.h @@ -21,7 +21,7 @@ #define MONITORPREFS_H #include <klistview.h> -#include <qstringlist.h> +#include <tqstringlist.h> namespace KSim { @@ -31,7 +31,7 @@ namespace KSim { Q_OBJECT public: - MonitorPrefs(QWidget *parent, const char *name=0); + MonitorPrefs(TQWidget *parent, const char *name=0); ~MonitorPrefs(); public slots: @@ -39,7 +39,7 @@ namespace KSim void readConfig(KSim::Config *); private: - QStringList m_locatedFiles; + TQStringList m_locatedFiles; }; } #endif diff --git a/ksim/monitors/cpu/ksimcpu.cpp b/ksim/monitors/cpu/ksimcpu.cpp index 9e6d089..441c1de 100644 --- a/ksim/monitors/cpu/ksimcpu.cpp +++ b/ksim/monitors/cpu/ksimcpu.cpp @@ -20,15 +20,15 @@ #include "ksimcpu.h" #include "ksimcpu.moc" -#include <qtextstream.h> -#include <qregexp.h> -#include <qlayout.h> -#include <qtimer.h> -#include <qfile.h> -#include <qgroupbox.h> -#include <qlabel.h> -#include <qglobal.h> -#include <qpushbutton.h> +#include <tqtextstream.h> +#include <tqregexp.h> +#include <tqlayout.h> +#include <tqtimer.h> +#include <tqfile.h> +#include <tqgroupbox.h> +#include <tqlabel.h> +#include <tqglobal.h> +#include <tqpushbutton.h> #include <klistview.h> #include <kdebug.h> @@ -67,7 +67,7 @@ #endif #endif -#define CPU_NAME(cpu) "Cpu" + QString::number(cpu) + "_options" +#define CPU_NAME(cpu) "Cpu" + TQString::number(cpu) + "_options" #define CPU_SPEED 1000 KSIM_INIT_PLUGIN(CpuPlugin) @@ -94,7 +94,7 @@ KSim::PluginPage *CpuPlugin::createConfigPage(const char *className) void CpuPlugin::showAbout() { - QString version = kapp->aboutData()->version(); + TQString version = kapp->aboutData()->version(); KAboutData aboutData(instanceName(), I18N_NOOP("KSim CPU Plugin"), version.latin1(), @@ -113,11 +113,11 @@ CpuView::CpuView(KSim::PluginObject *parent, const char *name) #ifdef Q_OS_LINUX m_procStream = 0L; if ((m_procFile = fopen("/proc/stat", "r"))) - m_procStream = new QTextStream(m_procFile, IO_ReadOnly); + m_procStream = new TQTextStream(m_procFile, IO_ReadOnly); #endif - m_mainLayout = new QVBoxLayout(this); - QSpacerItem *item = new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Expanding); + m_mainLayout = new TQVBoxLayout(this); + TQSpacerItem *item = new TQSpacerItem(0, 0, TQSizePolicy::Expanding, TQSizePolicy::Expanding); m_mainLayout->addItem(item); m_firstTime = true; @@ -125,8 +125,8 @@ CpuView::CpuView(KSim::PluginObject *parent, const char *name) m_cpus = createList(); addDisplay(); - m_timer = new QTimer(this); - connect(m_timer, SIGNAL(timeout()), SLOT(updateView())); + m_timer = new TQTimer(this); + connect(m_timer, TQT_SIGNAL(timeout()), TQT_SLOT(updateView())); m_timer->start(CPU_SPEED); updateView(); } @@ -168,7 +168,7 @@ void CpuView::updateView() CpuData cpuData; updateCpu(cpuData, current.number()); - QString text = current.format(); + TQString text = current.format(); current.setData(cpuData); cpuData -= current.oldData(); int cpuDiff = 0; @@ -216,22 +216,22 @@ void CpuView::updateCpu(CpuData &cpu, int cpuNumber) return; bool cpuFound = false; - QString output; - QString parser; - QString cpuString; + TQString output; + TQString parser; + TQString cpuString; cpuString.setNum(cpuNumber).prepend("cpu"); // Parse the proc file while (!m_procStream->atEnd()) { parser = m_procStream->readLine(); // remove all the entries apart from the line containing 'cpuString' - if (!cpuFound && parser.find(QRegExp(cpuString)) != -1) { + if (!cpuFound && parser.find(TQRegExp(cpuString)) != -1) { output = parser; cpuFound = true; } } - QStringList cpuList = QStringList::split(' ', output); + TQStringList cpuList = TQStringList::split(' ', output); if (!cpuList.isEmpty()) { cpu.name = cpuList[0].stripWhiteSpace(); @@ -308,8 +308,8 @@ CpuView::CpuList CpuView::createList() CpuList list; int number = 0; - QStringList cpus = config()->readListEntry("Cpus"); - QStringList::ConstIterator it; + TQStringList cpus = config()->readListEntry("Cpus"); + TQStringList::ConstIterator it; for (it = cpus.begin(); it != cpus.end(); ++it) { list.append(Cpu((*it), config()->readEntry(CPU_NAME(number), "%T"), number)); @@ -364,63 +364,63 @@ KSim::Progress *CpuView::addLabel() CpuConfig::CpuConfig(KSim::PluginObject *parent, const char *name) : KSim::PluginPage(parent, name) { - QVBoxLayout * mainLayout = new QVBoxLayout( this ); + TQVBoxLayout * mainLayout = new TQVBoxLayout( this ); mainLayout->setSpacing( 6 ); m_listView = new KListView(this); m_listView->addColumn(i18n("Available CPUs")); m_listView->addColumn(i18n("Chart Format")); m_listView->setAllColumnsShowFocus(true); - m_listView->setSelectionMode(QListView::Single); - connect( m_listView, SIGNAL( doubleClicked( QListViewItem * ) ), - SLOT( modify( QListViewItem * ) ) ); + m_listView->setSelectionMode(TQListView::Single); + connect( m_listView, TQT_SIGNAL( doubleClicked( TQListViewItem * ) ), + TQT_SLOT( modify( TQListViewItem * ) ) ); mainLayout->addWidget( m_listView ); - QHBoxLayout * layout = new QHBoxLayout; + TQHBoxLayout * layout = new QHBoxLayout; layout->setSpacing( 6 ); - QSpacerItem * spacer = new QSpacerItem( 20, 20, - QSizePolicy::Expanding, QSizePolicy::Minimum ); + TQSpacerItem * spacer = new TQSpacerItem( 20, 20, + TQSizePolicy::Expanding, TQSizePolicy::Minimum ); layout->addItem(spacer); - m_modify = new QPushButton( this ); + m_modify = new TQPushButton( this ); m_modify->setText( i18n( "Modify..." ) ); - connect( m_modify, SIGNAL( clicked() ), SLOT( modify() ) ); + connect( m_modify, TQT_SIGNAL( clicked() ), TQT_SLOT( modify() ) ); layout->addWidget( m_modify ); mainLayout->addLayout( layout ); - m_legendBox = new QGroupBox(this); + m_legendBox = new TQGroupBox(this); m_legendBox->setColumnLayout(0, Qt::Vertical); m_legendBox->setTitle(i18n("Chart Legend")); m_legendBox->layout()->setSpacing(0); m_legendBox->layout()->setMargin(0); - m_legendLayout = new QVBoxLayout(m_legendBox->layout()); + m_legendLayout = new TQVBoxLayout(m_legendBox->layout()); m_legendLayout->setAlignment(Qt::AlignTop); m_legendLayout->setSpacing(6); m_legendLayout->setMargin(11); - m_totalNiceLabel = new QLabel(i18n("%T - Total CPU time (sys + user + nice)"), m_legendBox); + m_totalNiceLabel = new TQLabel(i18n("%T - Total CPU time (sys + user + nice)"), m_legendBox); m_legendLayout->addWidget(m_totalNiceLabel); - m_totalLabel = new QLabel(i18n("%t - Total CPU time (sys + user)"), m_legendBox); + m_totalLabel = new TQLabel(i18n("%t - Total CPU time (sys + user)"), m_legendBox); m_legendLayout->addWidget(m_totalLabel); - m_sysLabel = new QLabel(i18n("%s - Total sys time"), m_legendBox); + m_sysLabel = new TQLabel(i18n("%s - Total sys time"), m_legendBox); m_legendLayout->addWidget(m_sysLabel); - m_userLabel = new QLabel(i18n("%u - Total user time"), m_legendBox); + m_userLabel = new TQLabel(i18n("%u - Total user time"), m_legendBox); m_legendLayout->addWidget(m_userLabel); - m_niceLabel = new QLabel(i18n("%n - Total nice time"), m_legendBox); + m_niceLabel = new TQLabel(i18n("%n - Total nice time"), m_legendBox); m_legendLayout->addWidget(m_niceLabel); mainLayout->addWidget( m_legendBox ); for (uint i = 0; i < addCpus(); ++i) { - QCheckListItem *item = new QCheckListItem(m_listView, i18n("cpu %1").arg(i), QCheckListItem::CheckBox); + TQCheckListItem *item = new TQCheckListItem(m_listView, i18n("cpu %1").arg(i), TQCheckListItem::CheckBox); item->setText(1, "%T"); } } @@ -432,13 +432,13 @@ CpuConfig::~CpuConfig() void CpuConfig::readConfig() { config()->setGroup("CpuPlugin"); - QStringList enabledCpus(config()->readListEntry("Cpus")); + TQStringList enabledCpus(config()->readListEntry("Cpus")); int cpuNum = 0; - QStringList::ConstIterator it; + TQStringList::ConstIterator it; for (it = enabledCpus.begin(); it != enabledCpus.end(); ++it) { - if (QCheckListItem *item = - static_cast<QCheckListItem *>(m_listView->findItem((*it), 0))) { + if (TQCheckListItem *item = + static_cast<TQCheckListItem *>(m_listView->findItem((*it), 0))) { item->setOn(true); item->setText(1, config()->readEntry(CPU_NAME(cpuNum), "%T")); } @@ -451,10 +451,10 @@ void CpuConfig::saveConfig() config()->setGroup("CpuPlugin"); int cpuNum = 0; - QStringList enabledCpus; - for (QListViewItemIterator it(m_listView); it.current(); ++it) { + TQStringList enabledCpus; + for (TQListViewItemIterator it(m_listView); it.current(); ++it) { config()->writeEntry(CPU_NAME(cpuNum), it.current()->text(1)); - if (static_cast<QCheckListItem *>(it.current())->isOn()) + if (static_cast<TQCheckListItem *>(it.current())->isOn()) enabledCpus.append(it.current()->text(0)); ++cpuNum; } @@ -465,18 +465,18 @@ void CpuConfig::saveConfig() uint CpuConfig::addCpus() { #ifdef Q_OS_LINUX - QStringList output; - QString parser; - QFile file("/proc/stat"); + TQStringList output; + TQString parser; + TQFile file("/proc/stat"); if (!file.open(IO_ReadOnly)) return 0; // Parse the proc file - QTextStream procStream(&file); + TQTextStream procStream(&file); while (!procStream.atEnd()) { parser = procStream.readLine(); - if (QRegExp("cpu").search(parser, 0) != -1 - && QRegExp("cpu0").search(parser, 0) == -1) { + if (TQRegExp("cpu").search(parser, 0) != -1 + && TQRegExp("cpu0").search(parser, 0) == -1) { output.append(parser); } } @@ -495,13 +495,13 @@ uint CpuConfig::addCpus() #endif } -void CpuConfig::modify( QListViewItem * item ) +void CpuConfig::modify( TQListViewItem * item ) { if ( !item ) return; bool ok = false; - QString text = KInputDialog::getText( i18n( "Modify CPU Format" ), i18n( "Chart format:" ), + TQString text = KInputDialog::getText( i18n( "Modify CPU Format" ), i18n( "Chart format:" ), item->text( 1 ), &ok, this ); if ( ok ) diff --git a/ksim/monitors/cpu/ksimcpu.h b/ksim/monitors/cpu/ksimcpu.h index b129ec0..03914b7 100644 --- a/ksim/monitors/cpu/ksimcpu.h +++ b/ksim/monitors/cpu/ksimcpu.h @@ -67,7 +67,7 @@ class CpuView : public KSim::PluginView public: CpuData() { user = nice = sys = idle = 0; } - QString name; + TQString name; unsigned long user; unsigned long nice; unsigned long sys; @@ -96,8 +96,8 @@ class CpuView : public KSim::PluginView m_label = 0; } - Cpu(const QString &name, - const QString &format, + Cpu(const TQString &name, + const TQString &format, int number) : m_name(name), m_format(format), @@ -139,7 +139,7 @@ class CpuView : public KSim::PluginView return m_old; } - const QString &format() const + const TQString &format() const { return m_format; } @@ -169,14 +169,14 @@ class CpuView : public KSim::PluginView private: CpuData m_data; CpuData m_old; - QString m_name; - QString m_format; + TQString m_name; + TQString m_format; KSim::Chart *m_chart; KSim::Progress *m_label; int m_num; }; - typedef QValueList<Cpu> CpuList; + typedef TQValueList<Cpu> CpuList; void updateCpu(CpuData &cpu, int cpuNumber); CpuList createList(); @@ -186,14 +186,14 @@ class CpuView : public KSim::PluginView KSim::Chart *addChart(); KSim::Progress *addLabel(); - QTimer *m_timer; - QVBoxLayout *m_mainLayout; + TQTimer *m_timer; + TQVBoxLayout *m_mainLayout; bool m_firstTime; CpuList m_cpus; #ifdef __linux__ FILE *m_procFile; - QTextStream *m_procStream; + TQTextStream *m_procStream; #endif }; @@ -208,21 +208,21 @@ class CpuConfig : public KSim::PluginPage virtual void readConfig(); private slots: - void modify( QListViewItem * ); + void modify( TQListViewItem * ); void modify(); private: uint addCpus(); KListView *m_listView; - QGroupBox *m_legendBox; - QLabel *m_totalNiceLabel; - QLabel *m_totalLabel; - QLabel *m_sysLabel; - QLabel *m_userLabel; - QLabel *m_niceLabel; - QVBoxLayout *m_legendLayout; - - QPushButton * m_modify; + TQGroupBox *m_legendBox; + TQLabel *m_totalNiceLabel; + TQLabel *m_totalLabel; + TQLabel *m_sysLabel; + TQLabel *m_userLabel; + TQLabel *m_niceLabel; + TQVBoxLayout *m_legendLayout; + + TQPushButton * m_modify; }; #endif diff --git a/ksim/monitors/disk/ksimdisk.cpp b/ksim/monitors/disk/ksimdisk.cpp index 2fe3560..5be9b80 100644 --- a/ksim/monitors/disk/ksimdisk.cpp +++ b/ksim/monitors/disk/ksimdisk.cpp @@ -20,13 +20,13 @@ #include "ksimdisk.h" #include "ksimdisk.moc" -#include <qtextstream.h> -#include <qregexp.h> -#include <qtimer.h> -#include <qlayout.h> -#include <qradiobutton.h> -#include <qvbuttongroup.h> -#include <qpushbutton.h> +#include <tqtextstream.h> +#include <tqregexp.h> +#include <tqtimer.h> +#include <tqlayout.h> +#include <tqradiobutton.h> +#include <tqvbuttongroup.h> +#include <tqpushbutton.h> #include <kdebug.h> #include <kaboutapplication.h> @@ -90,7 +90,7 @@ KSim::PluginPage *DiskPlugin::createConfigPage(const char *className) void DiskPlugin::showAbout() { - QString version = kapp->aboutData()->version(); + TQString version = kapp->aboutData()->version(); KAboutData aboutData(instanceName(), I18N_NOOP("KSim Disk Plugin"), version.latin1(), @@ -110,23 +110,23 @@ DiskView::DiskView(KSim::PluginObject *parent, const char *name) m_bLinux24 = true; m_procStream = 0L; if ((m_procFile = fopen("/proc/stat", "r"))) - m_procStream = new QTextStream(m_procFile, IO_ReadOnly); + m_procStream = new TQTextStream(m_procFile, IO_ReadOnly); #endif config()->setGroup("DiskPlugin"); - m_list = config()->readListEntry("Disks", QStringList() << "complete"); + m_list = config()->readListEntry("Disks", TQStringList() << "complete"); m_useSeperatly = config()->readBoolEntry("UseSeperatly", true); m_firstTime = 1; m_addAll = false; - m_layout = new QVBoxLayout(this); - QSpacerItem *item = new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Expanding); + m_layout = new TQVBoxLayout(this); + TQSpacerItem *item = new TQSpacerItem(0, 0, TQSizePolicy::Expanding, TQSizePolicy::Expanding); m_layout->addItem(item); init(); - m_timer = new QTimer(this); - connect(m_timer, SIGNAL(timeout()), SLOT(updateDisplay())); + m_timer = new TQTimer(this); + connect(m_timer, TQT_SIGNAL(timeout()), TQT_SLOT(updateDisplay())); m_timer->start(DISK_SPEED); updateDisplay(); } @@ -144,7 +144,7 @@ DiskView::~DiskView() void DiskView::reparseConfig() { config()->setGroup("DiskPlugin"); - QStringList list = config()->readListEntry("Disks", QStringList() << "complete"); + TQStringList list = config()->readListEntry("Disks", TQStringList() << "complete"); m_useSeperatly = config()->readBoolEntry("UseSeperatly", true); if (list != m_list) { @@ -152,7 +152,7 @@ void DiskView::reparseConfig() m_timer->stop(); cleanup(); - QPtrListIterator<DiskPair> it(m_diskList); + TQPtrListIterator<DiskPair> it(m_diskList); for (; it.current(); ++it) { delete it.current()->first; delete it.current()->second; @@ -165,7 +165,7 @@ void DiskView::reparseConfig() } } -DiskView::DiskData DiskView::findDiskData(const DiskList& diskList, QString diskName) +DiskView::DiskData DiskView::findDiskData(const DiskList& diskList, TQString diskName) { if (diskName == "complete") diskName = i18n("All Disks"); @@ -203,7 +203,7 @@ void DiskView::updateDisplay() } // merge all the disks into one - QPtrListIterator<DiskPair> it(m_diskList); + TQPtrListIterator<DiskPair> it(m_diskList); for (int i = 0; it.current(); ++it, ++i) { DiskData diskData = findDiskData(diskList, m_list[i]); m_data[i].second = m_data[i].first; @@ -246,8 +246,8 @@ void DiskView::updateData(DiskList &disks) { // here we need a regexp to match something like: // (3,0):(108911,48080,1713380,60831,1102644) - QRegExp regexp("\\([0-9]+,[0-9]+\\):\\([0-9]+,[0-9]+,[0-9]+,[0-9]+,[0-9]+\\)"); - QString content = m_procStream->read(); + TQRegExp regexp("\\([0-9]+,[0-9]+\\):\\([0-9]+,[0-9]+,[0-9]+,[0-9]+,[0-9]+\\)"); + TQString content = m_procStream->read(); if (content.find("disk_io") == -1) { m_bLinux24 = false; @@ -257,7 +257,7 @@ void DiskView::updateData(DiskList &disks) fclose(m_procFile); if ((m_procFile = fopen("/proc/diskstats", "r"))) - m_procStream = new QTextStream(m_procFile, IO_ReadOnly); + m_procStream = new TQTextStream(m_procFile, IO_ReadOnly); updateData(disks); return; @@ -266,11 +266,11 @@ void DiskView::updateData(DiskList &disks) while ((idx = regexp.search(content, idx)) != -1) { idx += regexp.matchedLength(); - QString diskStr = regexp.cap(0); + TQString diskStr = regexp.cap(0); diskStr.replace(':', ','); - diskStr.replace(QRegExp("\\)?\\(?"), QString::null); + diskStr.replace(TQRegExp("\\)?\\(?"), TQString::null); - QStringList list = QStringList::split(',', diskStr); + TQStringList list = TQStringList::split(',', diskStr); if (list.count() < 7) continue; @@ -322,14 +322,14 @@ void DiskView::updateData(DiskList &disks) // (field 9) times the number of milliseconds spent doing I/O since the // last update of this field. This can provide an easy measure of both // I/O completion time and the backlog that may be accumulating. - QString content = m_procStream->read(); - QStringList lines = QStringList::split('\n', content); + TQString content = m_procStream->read(); + TQStringList lines = TQStringList::split('\n', content); - for(QStringList::ConstIterator it = lines.begin(); + for(TQStringList::ConstIterator it = lines.begin(); it != lines.end(); ++it) { - QString diskStr = (*it).simplifyWhiteSpace(); - QStringList list = QStringList::split(' ', diskStr); + TQString diskStr = (*it).simplifyWhiteSpace(); + TQStringList list = TQStringList::split(' ', diskStr); if (list.count() < 14) continue; @@ -391,7 +391,7 @@ void DiskView::updateData(DiskList &disks) DiskData diskData; diskData.name = device.device_name - + QString::number(device.unit_number); + + TQString::number(device.unit_number); diskData.major = device.device_number; diskData.minor = 0; diskData.total = readBlocks + writeBlocks; @@ -407,26 +407,26 @@ void DiskView::updateData(DiskList &disks) #endif } -QString DiskView::diskName( int major, int minor ) const +TQString DiskView::diskName( int major, int minor ) const { #ifdef Q_OS_LINUX - QString returnValue; + TQString returnValue; switch ( major ) { case IDE0_MAJOR: - returnValue.prepend(QString::fromLatin1("hda")); + returnValue.prepend(TQString::fromLatin1("hda")); break; case IDE1_MAJOR: - returnValue.prepend(QString::fromLatin1("hdc")); + returnValue.prepend(TQString::fromLatin1("hdc")); break; case IDE3_MAJOR: - returnValue.prepend(QString::fromLatin1("hde")); + returnValue.prepend(TQString::fromLatin1("hde")); break; case SCSI_DISK0_MAJOR: - returnValue.prepend(QString::fromLatin1("sda")); + returnValue.prepend(TQString::fromLatin1("sda")); break; case SCSI_GENERIC_MAJOR: - returnValue.prepend(QString::fromLatin1("sg0")); + returnValue.prepend(TQString::fromLatin1("sg0")); break; } @@ -457,7 +457,7 @@ void DiskView::init() { m_data.resize(m_list.size()); - QStringList::ConstIterator it; + TQStringList::ConstIterator it; for (it = m_list.begin(); it != m_list.end(); ++it) { if ((*it) == "complete") m_addAll = true; @@ -475,42 +475,42 @@ void DiskView::cleanup() DiskConfig::DiskConfig(KSim::PluginObject *parent, const char *name) : KSim::PluginPage(parent, name) { - m_layout = new QVBoxLayout(this); + m_layout = new TQVBoxLayout(this); m_layout->setSpacing(6); m_listview = new KListView(this); m_listview->addColumn(i18n("Disks")); m_layout->addWidget(m_listview); - QHBoxLayout *layout = new QHBoxLayout; + TQHBoxLayout *layout = new QHBoxLayout; layout->setSpacing(6); - QSpacerItem *spacer = new QSpacerItem(20, 20, - QSizePolicy::Expanding, QSizePolicy::Minimum); + TQSpacerItem *spacer = new TQSpacerItem(20, 20, + TQSizePolicy::Expanding, TQSizePolicy::Minimum); layout->addItem(spacer); - m_add = new QPushButton(this); + m_add = new TQPushButton(this); m_add->setText(i18n("Add...")); - connect(m_add, SIGNAL(clicked()), SLOT(addItem())); + connect(m_add, TQT_SIGNAL(clicked()), TQT_SLOT(addItem())); layout->addWidget(m_add); - m_remove = new QPushButton(this); + m_remove = new TQPushButton(this); m_remove->setText(i18n("Remove")); - connect(m_remove, SIGNAL(clicked()), SLOT(removeItem())); + connect(m_remove, TQT_SIGNAL(clicked()), TQT_SLOT(removeItem())); layout->addWidget(m_remove); m_layout->addLayout(layout); - m_buttonBox = new QVButtonGroup(i18n("Disk Styles"), this); + m_buttonBox = new TQVButtonGroup(i18n("Disk Styles"), this); m_layout->addWidget(m_buttonBox); - m_totalButton = new QRadioButton(m_buttonBox); + m_totalButton = new TQRadioButton(m_buttonBox); m_totalButton->setText(i18n("Display the read and write data as one")); - m_bothButton = new QRadioButton(m_buttonBox); + m_bothButton = new TQRadioButton(m_buttonBox); m_bothButton->setText(i18n("Display the read and write data" "\nseparately as in/out data")); - QSpacerItem *vSpacer = new QSpacerItem(20, 20, - QSizePolicy::Minimum, QSizePolicy::Expanding); + TQSpacerItem *vSpacer = new TQSpacerItem(20, 20, + TQSizePolicy::Minimum, TQSizePolicy::Expanding); m_layout->addItem(vSpacer); } @@ -522,20 +522,20 @@ void DiskConfig::readConfig() { config()->setGroup("DiskPlugin"); m_buttonBox->setButton(config()->readBoolEntry("UseSeperatly", true)); - QStringList list = config()->readListEntry("Disks"); + TQStringList list = config()->readListEntry("Disks"); - QStringList::ConstIterator it; + TQStringList::ConstIterator it; for (it = list.begin(); it != list.end(); ++it) { - QString text = ((*it) == "complete" ? i18n("All Disks") : (*it)); + TQString text = ((*it) == "complete" ? i18n("All Disks") : (*it)); if (!m_listview->findItem(text, 0)) - new QListViewItem(m_listview, text); + new TQListViewItem(m_listview, text); } } void DiskConfig::saveConfig() { - QStringList list; - for (QListViewItemIterator it(m_listview); it.current(); ++it) { + TQStringList list; + for (TQListViewItemIterator it(m_listview); it.current(); ++it) { if (it.current()->text(0) == i18n("All Disks")) list.append("complete"); else @@ -550,14 +550,14 @@ void DiskConfig::saveConfig() void DiskConfig::addItem() { bool ok = false; - QString text = KInputDialog::getText(i18n("Add Disk Device"), i18n("Disk name:"), - QString::null, &ok, this); + TQString text = KInputDialog::getText(i18n("Add Disk Device"), i18n("Disk name:"), + TQString::null, &ok, this); if (text.startsWith("/dev/")) text = text.mid(5); if (ok) - new QListViewItem(m_listview, text); + new TQListViewItem(m_listview, text); } void DiskConfig::removeItem() @@ -565,6 +565,6 @@ void DiskConfig::removeItem() if (!m_listview->selectedItem()) return; - QListViewItem *item = m_listview->selectedItem(); + TQListViewItem *item = m_listview->selectedItem(); delete item; } diff --git a/ksim/monitors/disk/ksimdisk.h b/ksim/monitors/disk/ksimdisk.h index de4c8ba..e336448 100644 --- a/ksim/monitors/disk/ksimdisk.h +++ b/ksim/monitors/disk/ksimdisk.h @@ -20,12 +20,12 @@ #ifndef KSIMDISK_H #define KSIMDISK_H -#include <qvaluelist.h> +#include <tqvaluelist.h> #include <pluginmodule.h> #include <stdio.h> -#include <qptrlist.h> -#include <qstringlist.h> -#include <qvaluevector.h> +#include <tqptrlist.h> +#include <tqstringlist.h> +#include <tqvaluevector.h> class QTextStream; class QTimer; @@ -94,7 +94,7 @@ class DiskView : public KSim::PluginView return *this; } - QString name; + TQString name; int major; int minor; unsigned long total; @@ -104,27 +104,27 @@ class DiskView : public KSim::PluginView unsigned long writeBlocks; }; - typedef QValueList<DiskData> DiskList; + typedef TQValueList<DiskData> DiskList; typedef QPair<KSim::Chart *, KSim::Progress *> DiskPair; void updateData(DiskList &disks); - QString diskName( int, int ) const; + TQString diskName( int, int ) const; DiskPair *addDisk(); - DiskData findDiskData(const DiskList& diskList, QString diskName); + DiskData findDiskData(const DiskList& diskList, TQString diskName); void init(); void cleanup(); - QValueVector<QPair<DiskData, DiskData> > m_data; - QTimer *m_timer; + TQValueVector<QPair<DiskData, DiskData> > m_data; + TQTimer *m_timer; bool m_bLinux24; FILE *m_procFile; - QTextStream *m_procStream; - QVBoxLayout *m_layout; - QPtrList<DiskPair> m_diskList; + TQTextStream *m_procStream; + TQVBoxLayout *m_layout; + TQPtrList<DiskPair> m_diskList; int m_firstTime; bool m_useSeperatly; - QStringList m_list; + TQStringList m_list; bool m_addAll; }; @@ -143,12 +143,12 @@ class DiskConfig : public KSim::PluginPage void removeItem(); private: - QVBoxLayout *m_layout; + TQVBoxLayout *m_layout; KListView *m_listview; - QPushButton *m_add; - QPushButton *m_remove; - QVButtonGroup *m_buttonBox; - QRadioButton *m_totalButton; - QRadioButton *m_bothButton; + TQPushButton *m_add; + TQPushButton *m_remove; + TQVButtonGroup *m_buttonBox; + TQRadioButton *m_totalButton; + TQRadioButton *m_bothButton; }; #endif diff --git a/ksim/monitors/filesystem/filesystemstats.cpp b/ksim/monitors/filesystem/filesystemstats.cpp index eeb5c62..1aa156d 100644 --- a/ksim/monitors/filesystem/filesystemstats.cpp +++ b/ksim/monitors/filesystem/filesystemstats.cpp @@ -19,9 +19,9 @@ #include "filesystemstats.h" -#include <qglobal.h> -#include <qfile.h> -#include <qstringlist.h> +#include <tqglobal.h> +#include <tqfile.h> +#include <tqstringlist.h> #include <kdebug.h> @@ -184,16 +184,16 @@ FilesystemStats::List FilesystemStats::readEntries() #endif #ifdef USE_FAILSAFE - QFile file( QString::fromLatin1( _PATH_MOUNTED ) ); + TQFile file( TQString::fromLatin1( _PATH_MOUNTED ) ); if ( !file.open( IO_ReadOnly ) ) return list; - QTextStream stream( &file ); + TQTextStream stream( &file ); while ( !stream.atEnd() ) { - QStringList line = QStringList::split( " ", stream.readLine() ); + TQStringList line = TQStringList::split( " ", stream.readLine() ); Entry entry; entry.dir = line[1].stripWhiteSpace(); @@ -206,10 +206,10 @@ FilesystemStats::List FilesystemStats::readEntries() return list; } -bool FilesystemStats::readStats( const QString & mntPoint, int & totalBlocks, int & freeBlocks ) +bool FilesystemStats::readStats( const TQString & mntPoint, int & totalBlocks, int & freeBlocks ) { ksim_statfs sysStats; - if ( fsystemStats( QFile::encodeName( mntPoint ).data(), sysStats ) < 0 ) + if ( fsystemStats( TQFile::encodeName( mntPoint ).data(), sysStats ) < 0 ) { kdError() << "While reading filesystem information for " << mntPoint << endl; totalBlocks = 0; diff --git a/ksim/monitors/filesystem/filesystemstats.h b/ksim/monitors/filesystem/filesystemstats.h index 3ea8f74..51f2f7b 100644 --- a/ksim/monitors/filesystem/filesystemstats.h +++ b/ksim/monitors/filesystem/filesystemstats.h @@ -20,21 +20,21 @@ #ifndef FILESYSTEMSTATS_H #define FILESYSTEMSTATS_H -#include <qstring.h> -#include <qvaluelist.h> +#include <tqstring.h> +#include <tqvaluelist.h> namespace FilesystemStats { struct Entry { - QString dir; - QString fsname; - QString type; + TQString dir; + TQString fsname; + TQString type; }; - typedef QValueList<Entry> List; + typedef TQValueList<Entry> List; List readEntries(); - bool readStats( const QString &, int &, int & ); + bool readStats( const TQString &, int &, int & ); } #endif diff --git a/ksim/monitors/filesystem/filesystemwidget.cpp b/ksim/monitors/filesystem/filesystemwidget.cpp index 0428ee3..aca7694 100644 --- a/ksim/monitors/filesystem/filesystemwidget.cpp +++ b/ksim/monitors/filesystem/filesystemwidget.cpp @@ -21,10 +21,10 @@ #include <pluginmodule.h> -#include <qlayout.h> -#include <qpopupmenu.h> -#include <qregexp.h> -#include <qcursor.h> +#include <tqlayout.h> +#include <tqpopupmenu.h> +#include <tqregexp.h> +#include <tqcursor.h> #include <kprocess.h> #include <kmessagebox.h> @@ -38,7 +38,7 @@ FilesystemWidget::Filesystem::Filesystem() } FilesystemWidget::Filesystem::Filesystem(KSim::Progress *display, - const QString &point) + const TQString &point) { m_display = display; m_mountPoint = point; @@ -54,12 +54,12 @@ KSim::Progress *FilesystemWidget::Filesystem::display() const return m_display; } -const QString &FilesystemWidget::Filesystem::mountPoint() const +const TQString &FilesystemWidget::Filesystem::mountPoint() const { return m_mountPoint; } -const QString &FilesystemWidget::Filesystem::text() const +const TQString &FilesystemWidget::Filesystem::text() const { return m_display->text(); } @@ -69,7 +69,7 @@ int FilesystemWidget::Filesystem::value() const return m_display->value(); } -void FilesystemWidget::Filesystem::setText(const QString &text) +void FilesystemWidget::Filesystem::setText(const TQString &text) { if (!m_display) return; @@ -85,11 +85,11 @@ void FilesystemWidget::Filesystem::setValue(int value) m_display->setValue(value); } -FilesystemWidget::FilesystemWidget(QWidget *parent, const char *name) - : QWidget(parent, name) +FilesystemWidget::FilesystemWidget(TQWidget *parent, const char *name) + : TQWidget(parent, name) { m_list.setAutoDelete(true); - m_layout = new QVBoxLayout(this); + m_layout = new TQVBoxLayout(this); m_process = 0; } @@ -98,7 +98,7 @@ FilesystemWidget::~FilesystemWidget() delete m_process; } -void FilesystemWidget::append(int max, const QString &mountPoint) +void FilesystemWidget::append(int max, const TQString &mountPoint) { KSim::Progress *progress = new KSim::Progress(max, this); progress->installEventFilter(this); @@ -108,7 +108,7 @@ void FilesystemWidget::append(int max, const QString &mountPoint) m_list.append(new Filesystem(progress, mountPoint)); } -void FilesystemWidget::setText(uint id, const QString &text) +void FilesystemWidget::setText(uint id, const TQString &text) { if (id > m_list.count()) return; @@ -129,14 +129,14 @@ void FilesystemWidget::clear() m_list.clear(); } -bool FilesystemWidget::eventFilter(QObject *o, QEvent *e) +bool FilesystemWidget::eventFilter(TQObject *o, TQEvent *e) { if (!o->isA("KSim::Progress")) - return QWidget::eventFilter(o, e); + return TQWidget::eventFilter(o, e); KSim::Progress *progressBar = 0; int i = 0; - QPtrListIterator<Filesystem> it(m_list); + TQPtrListIterator<Filesystem> it(m_list); Filesystem *filesystem; while ((filesystem = it.current()) != 0) { ++it; @@ -149,15 +149,15 @@ bool FilesystemWidget::eventFilter(QObject *o, QEvent *e) ++i; } - if (o == progressBar && e->type() == QEvent::MouseButtonPress) + if (o == progressBar && e->type() == TQEvent::MouseButtonPress) { - switch(static_cast<QMouseEvent *>(e)->button()) { - case QMouseEvent::RightButton: + switch(static_cast<TQMouseEvent *>(e)->button()) { + case TQMouseEvent::RightButton: showMenu(i); break; default: break; - case QMouseEvent::LeftButton: + case TQMouseEvent::LeftButton: if (parentWidget()->inherits("KSim::PluginView")) static_cast<KSim::PluginView *>(parentWidget())->doCommand(); break; @@ -166,7 +166,7 @@ bool FilesystemWidget::eventFilter(QObject *o, QEvent *e) return true; } - return QWidget::eventFilter(o, e); + return TQWidget::eventFilter(o, e); } void FilesystemWidget::receivedStderr(KProcess *, char *buffer, int length) @@ -183,28 +183,28 @@ void FilesystemWidget::processExited(KProcess *) if (m_stderrString.isEmpty()) return; - QStringList errorList = QStringList::split("\n", m_stderrString); - QString message = i18n("<qt>The following errors occurred:<ul>"); + TQStringList errorList = TQStringList::split("\n", m_stderrString); + TQString message = i18n("<qt>The following errors occurred:<ul>"); - QStringList::Iterator it; + TQStringList::Iterator it; for (it = errorList.begin(); it != errorList.end(); ++it) { - message += QString::fromLatin1("<li>%1</li>") - .arg((*it).replace(QRegExp("[u]?mount: "), QString::null)); + message += TQString::fromLatin1("<li>%1</li>") + .arg((*it).replace(TQRegExp("[u]?mount: "), TQString::null)); } - message += QString::fromLatin1("</ul></qt>"); + message += TQString::fromLatin1("</ul></qt>"); KMessageBox::sorry(0, message); } -void FilesystemWidget::createProcess(const QString &command, const QString &point) +void FilesystemWidget::createProcess(const TQString &command, const TQString &point) { m_process = new KProcess(); connect(m_process, - SIGNAL(receivedStderr(KProcess *, char *, int)), - SLOT(receivedStderr(KProcess *, char *, int))); + TQT_SIGNAL(receivedStderr(KProcess *, char *, int)), + TQT_SLOT(receivedStderr(KProcess *, char *, int))); connect(m_process, - SIGNAL(processExited(KProcess *)), - SLOT(processExited(KProcess *))); + TQT_SIGNAL(processExited(KProcess *)), + TQT_SLOT(processExited(KProcess *))); (*m_process) << command << point; void(m_process->start(KProcess::NotifyOnExit, KProcess::Stderr)); @@ -215,11 +215,11 @@ void FilesystemWidget::showMenu(uint id) if (id > m_list.count()) return; - QPopupMenu menu; + TQPopupMenu menu; menu.insertItem(SmallIcon("hdd_mount"), i18n("&Mount Device"), 1); menu.insertItem(SmallIcon("hdd_unmount"), i18n("&Unmount Device"), 2); - switch (menu.exec(QCursor::pos())) { + switch (menu.exec(TQCursor::pos())) { case 1: createProcess("mount", m_list.at(id)->mountPoint()); break; diff --git a/ksim/monitors/filesystem/filesystemwidget.h b/ksim/monitors/filesystem/filesystemwidget.h index d169b9a..143010a 100644 --- a/ksim/monitors/filesystem/filesystemwidget.h +++ b/ksim/monitors/filesystem/filesystemwidget.h @@ -22,7 +22,7 @@ #include <progress.h> -#include <qptrlist.h> +#include <tqptrlist.h> class KProcess; class QVBoxLayout; @@ -31,16 +31,16 @@ class FilesystemWidget : public QWidget { Q_OBJECT public: - FilesystemWidget(QWidget *parent, const char *name); + FilesystemWidget(TQWidget *parent, const char *name); ~FilesystemWidget(); - void append(int, const QString &); - void setText(uint, const QString &); + void append(int, const TQString &); + void setText(uint, const TQString &); void setValue(uint, int); void clear(); protected: - bool eventFilter(QObject *, QEvent *); + bool eventFilter(TQObject *, TQEvent *); private slots: void receivedStderr(KProcess *, char *, int); @@ -51,28 +51,28 @@ class FilesystemWidget : public QWidget { public: Filesystem(); - Filesystem(KSim::Progress *, const QString &); + Filesystem(KSim::Progress *, const TQString &); ~Filesystem(); KSim::Progress *display() const; - const QString &mountPoint() const; - const QString &text() const; + const TQString &mountPoint() const; + const TQString &text() const; int value() const; - void setText(const QString &); + void setText(const TQString &); void setValue(int); - QString m_mountPoint; + TQString m_mountPoint; KSim::Progress *m_display; }; - void createProcess(const QString &, const QString &); + void createProcess(const TQString &, const TQString &); void showMenu(uint); - typedef QPtrList<Filesystem> ProgressList; + typedef TQPtrList<Filesystem> ProgressList; ProgressList m_list; - QVBoxLayout *m_layout; + TQVBoxLayout *m_layout; KProcess *m_process; - QString m_stderrString; + TQString m_stderrString; }; #endif diff --git a/ksim/monitors/filesystem/fsystemconfig.cpp b/ksim/monitors/filesystem/fsystemconfig.cpp index 9b07ee4..67026d1 100644 --- a/ksim/monitors/filesystem/fsystemconfig.cpp +++ b/ksim/monitors/filesystem/fsystemconfig.cpp @@ -28,18 +28,18 @@ #include <knuminput.h> #include <kdebug.h> -#include <qcheckbox.h> -#include <qlayout.h> -#include <qtooltip.h> -#include <qlabel.h> -#include <qwhatsthis.h> +#include <tqcheckbox.h> +#include <tqlayout.h> +#include <tqtooltip.h> +#include <tqlabel.h> +#include <tqwhatsthis.h> class FSysViewItem : public QCheckListItem { public: - FSysViewItem(QListView *parent, const QString &text1, - const QString &text2, const QString &text3) - : QCheckListItem(parent, text1, CheckBox) + FSysViewItem(TQListView *parent, const TQString &text1, + const TQString &text2, const TQString &text3) + : TQCheckListItem(parent, text1, CheckBox) { setText(1, text2); setText(2, text3); @@ -49,7 +49,7 @@ class FSysViewItem : public QCheckListItem FsystemConfig::FsystemConfig(KSim::PluginObject *parent, const char *name) : KSim::PluginPage(parent, name) { - m_mainLayout = new QGridLayout(this); + m_mainLayout = new TQGridLayout(this); m_mainLayout->setSpacing(6); m_availableMounts = new KListView(this); @@ -58,32 +58,32 @@ FsystemConfig::FsystemConfig(KSim::PluginObject *parent, const char *name) m_availableMounts->addColumn(i18n("Type")); m_mainLayout->addMultiCellWidget(m_availableMounts, 0, 0, 0, 3); - m_showPercentage = new QCheckBox(this); + m_showPercentage = new TQCheckBox(this); m_showPercentage->setText(i18n("Show percentage")); m_mainLayout->addMultiCellWidget(m_showPercentage, 1, 1, 0, 3); - m_splitNames = new QCheckBox(this); + m_splitNames = new TQCheckBox(this); m_splitNames->setText(i18n("Display short mount point names")); - QWhatsThis::add(m_splitNames, i18n("This option shortens the text" + TQWhatsThis::add(m_splitNames, i18n("This option shortens the text" " to shrink down a mount point. E.G: a mount point /home/myuser" " would become myuser.")); m_mainLayout->addMultiCellWidget(m_splitNames, 2, 2, 0, 3); - m_intervalLabel = new QLabel(this); + m_intervalLabel = new TQLabel(this); m_intervalLabel->setText( i18n("Update interval:")); - m_intervalLabel->setSizePolicy(QSizePolicy(QSizePolicy::Fixed, - QSizePolicy::Fixed)); + m_intervalLabel->setSizePolicy(TQSizePolicy(TQSizePolicy::Fixed, + TQSizePolicy::Fixed)); m_mainLayout->addMultiCellWidget(m_intervalLabel, 3, 3, 0, 0); m_updateTimer = new KIntSpinBox(this); m_updateTimer->setValue(60); - QToolTip::add(m_updateTimer, i18n("0 means no update")); + TQToolTip::add(m_updateTimer, i18n("0 means no update")); m_mainLayout->addMultiCellWidget(m_updateTimer, 3, 3, 1, 1); - QLabel *intervalLabel = new QLabel(this); + TQLabel *intervalLabel = new TQLabel(this); intervalLabel->setText(i18n("seconds")); - intervalLabel->setSizePolicy(QSizePolicy(QSizePolicy::Fixed, - QSizePolicy::Fixed)); + intervalLabel->setSizePolicy(TQSizePolicy(TQSizePolicy::Fixed, + TQSizePolicy::Fixed)); m_mainLayout->addMultiCellWidget(intervalLabel, 3, 3, 2, 2); m_entries = FilesystemStats::readEntries(); @@ -104,10 +104,10 @@ void FsystemConfig::readConfig() if (!m_availableMounts->childCount()) return; - QStringList list = config()->readListEntry("mountEntries"); - for (QListViewItemIterator it(m_availableMounts); it.current(); ++it) { - QString string = it.current()->text(0) + ":" + splitString(it.current()->text(0)); - static_cast<QCheckListItem *>(it.current())->setOn(list.contains(string) > 0); + TQStringList list = config()->readListEntry("mountEntries"); + for (TQListViewItemIterator it(m_availableMounts); it.current(); ++it) { + TQString string = it.current()->text(0) + ":" + splitString(it.current()->text(0)); + static_cast<TQCheckListItem *>(it.current())->setOn(list.contains(string) > 0); } } @@ -118,16 +118,16 @@ void FsystemConfig::saveConfig() config()->writeEntry("updateValue", m_updateTimer->value()); config()->writeEntry("ShortenEntries", m_splitNames->isChecked()); - QStringList list; - for (QListViewItemIterator it(m_availableMounts); it.current(); ++it) { - if (static_cast<QCheckListItem *>(it.current())->isOn()) + TQStringList list; + for (TQListViewItemIterator it(m_availableMounts); it.current(); ++it) { + if (static_cast<TQCheckListItem *>(it.current())->isOn()) list.append(it.current()->text(0) + ":" + splitString(it.current()->text(0))); } config()->writeEntry("mountEntries", list); } -void FsystemConfig::showEvent(QShowEvent *) +void FsystemConfig::showEvent(TQShowEvent *) { // FIXME: Maybe this is the slow method of doing this? // Eitherway, i need to find a way to only update the list @@ -166,19 +166,19 @@ void FsystemConfig::getStats() return; config()->setGroup("Fsystem"); - QStringList list = config()->readListEntry("mountEntries"); - for (QListViewItemIterator it(m_availableMounts); it.current(); ++it) { - QString string = it.current()->text(0) + ":" + splitString(it.current()->text(0)); - static_cast<QCheckListItem *>(it.current())->setOn(list.contains(string) > 0); + TQStringList list = config()->readListEntry("mountEntries"); + for (TQListViewItemIterator it(m_availableMounts); it.current(); ++it) { + TQString string = it.current()->text(0) + ":" + splitString(it.current()->text(0)); + static_cast<TQCheckListItem *>(it.current())->setOn(list.contains(string) > 0); } } -QString FsystemConfig::splitString(const QString &string) const +TQString FsystemConfig::splitString(const TQString &string) const { if (string == "/" || !m_splitNames->isChecked()) return string; int location = string.findRev("/"); - QString newString(string); + TQString newString(string); return newString.remove(0, location + 1); } diff --git a/ksim/monitors/filesystem/fsystemconfig.h b/ksim/monitors/filesystem/fsystemconfig.h index 353dcf8..7e17e79 100644 --- a/ksim/monitors/filesystem/fsystemconfig.h +++ b/ksim/monitors/filesystem/fsystemconfig.h @@ -41,18 +41,18 @@ class FsystemConfig : public KSim::PluginPage virtual void readConfig(); protected: - void showEvent(QShowEvent *); + void showEvent(TQShowEvent *); private: void getStats(); - QString splitString(const QString &string) const; + TQString splitString(const TQString &string) const; - QCheckBox *m_showPercentage; - QCheckBox *m_splitNames; - QLabel *m_intervalLabel; + TQCheckBox *m_showPercentage; + TQCheckBox *m_splitNames; + TQLabel *m_intervalLabel; KIntSpinBox *m_updateTimer; KListView *m_availableMounts; - QGridLayout *m_mainLayout; + TQGridLayout *m_mainLayout; FilesystemStats::List m_entries; }; #endif // FILESYSTEM_H diff --git a/ksim/monitors/filesystem/ksimfsystem.cpp b/ksim/monitors/filesystem/ksimfsystem.cpp index 3303f6d..039447a 100644 --- a/ksim/monitors/filesystem/ksimfsystem.cpp +++ b/ksim/monitors/filesystem/ksimfsystem.cpp @@ -21,11 +21,11 @@ #include <config.h> -#include <qlayout.h> -#include <qvaluelist.h> -#include <qtimer.h> -#include <qfile.h> -#include <qregexp.h> +#include <tqlayout.h> +#include <tqvaluelist.h> +#include <tqtimer.h> +#include <tqfile.h> +#include <tqregexp.h> #include <kdebug.h> #include <klocale.h> @@ -64,7 +64,7 @@ KSim::PluginPage *PluginModule::createConfigPage(const char *className) void PluginModule::showAbout() { - QString version = kapp->aboutData()->version(); + TQString version = kapp->aboutData()->version(); KAboutData aboutData(instanceName(), I18N_NOOP("KSim FileSystem Plugin"), version.latin1(), @@ -86,10 +86,10 @@ Fsystem::Fsystem(KSim::PluginObject *parent, const char *name) KSim::PluginView(parent, name) { config()->setGroup("Fsystem"); - QVBoxLayout *vbLayout = new QVBoxLayout(this); + TQVBoxLayout *vbLayout = new TQVBoxLayout(this); vbLayout->setAutoAdd(true); - QSpacerItem *item = new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Expanding); + TQSpacerItem *item = new TQSpacerItem(0, 0, TQSizePolicy::Expanding, TQSizePolicy::Expanding); vbLayout->addItem(item); m_mountEntries = makeList(config()->readListEntry("mountEntries")); @@ -99,8 +99,8 @@ Fsystem::Fsystem(KSim::PluginObject *parent, const char *name) createFreeInfo(); - m_updateTimer = new QTimer(this); - connect(m_updateTimer, SIGNAL(timeout()), SLOT(updateFS())); + m_updateTimer = new TQTimer(this); + connect(m_updateTimer, TQT_SIGNAL(timeout()), TQT_SLOT(updateFS())); m_updateTimer->start(config()->readNumEntry("updateValue", 60) * 1000); } @@ -155,7 +155,7 @@ void Fsystem::createFreeInfo() m_widget->setValue(i, total - free); if (m_showPercentage) m_widget->setText(i, ((*it).second.isEmpty() ? (*it).first : (*it).second) - + " - " + QString::number(percent) + "%"); + + " - " + TQString::number(percent) + "%"); else m_widget->setText(i, ((*it).second.isEmpty() ? (*it).first : (*it).second)); i++; @@ -179,20 +179,20 @@ void Fsystem::updateFS() m_widget->setValue(i, total - free); if (m_showPercentage) m_widget->setText(i, ((*it).second.isEmpty() ? (*it).first : (*it).second) - + " - " + QString::number(percent) + "%"); + + " - " + TQString::number(percent) + "%"); else m_widget->setText(i, ((*it).second.isEmpty() ? (*it).first : (*it).second)); i++; } } -Fsystem::MountEntryList Fsystem::makeList(const QStringList &list) const +Fsystem::MountEntryList Fsystem::makeList(const TQStringList &list) const { MountEntryList newList; - QStringList splitList; - QStringList::ConstIterator it; + TQStringList splitList; + TQStringList::ConstIterator it; for (it = list.begin(); it != list.end(); ++it) { - splitList = QStringList::split(":", (*it)); + splitList = TQStringList::split(":", (*it)); newList.append(qMakePair(splitList[0], splitList[1])); } diff --git a/ksim/monitors/filesystem/ksimfsystem.h b/ksim/monitors/filesystem/ksimfsystem.h index c3d403f..8c95fde 100644 --- a/ksim/monitors/filesystem/ksimfsystem.h +++ b/ksim/monitors/filesystem/ksimfsystem.h @@ -65,11 +65,11 @@ class Fsystem : public KSim::PluginView, public FsystemIface void updateFS(); private: - typedef QValueList<QPair<QString, QString> > MountEntryList; - MountEntryList makeList(const QStringList &list) const; + typedef TQValueList<QPair<TQString, TQString> > MountEntryList; + MountEntryList makeList(const TQStringList &list) const; FilesystemWidget *m_widget; - QTimer *m_updateTimer; + TQTimer *m_updateTimer; MountEntryList m_mountEntries; bool m_showPercentage; }; diff --git a/ksim/monitors/i8k/ksimi8k.cpp b/ksim/monitors/i8k/ksimi8k.cpp index ff995b0..46a96e0 100644 --- a/ksim/monitors/i8k/ksimi8k.cpp +++ b/ksim/monitors/i8k/ksimi8k.cpp @@ -19,13 +19,13 @@ #include "ksimi8k.h" -#include <qlayout.h> -#include <qtimer.h> -#include <qfile.h> -#include <qtextstream.h> -#include <qregexp.h> -#include <qlabel.h> -#include <qcheckbox.h> +#include <tqlayout.h> +#include <tqtimer.h> +#include <tqfile.h> +#include <tqtextstream.h> +#include <tqregexp.h> +#include <tqlabel.h> +#include <tqcheckbox.h> #include <label.h> #include <klocale.h> @@ -59,7 +59,7 @@ KSim::PluginPage *I8KPlugin::createConfigPage(const char *className) void I8KPlugin::showAbout() { - QString version = kapp->aboutData()->version(); + TQString version = kapp->aboutData()->version(); KAboutData aboutData(instanceName(), I18N_NOOP("KSim I8K Plugin"), version.latin1(), @@ -78,9 +78,9 @@ I8KView::I8KView(KSim::PluginObject *parent, const char *name) { initGUI(); - m_timer = new QTimer( this ); + m_timer = new TQTimer( this ); - m_reData = new QRegExp( "\\S+\\s+\\S+\\s+\\S+\\s+(\\d+)\\s+\\S+" + m_reData = new TQRegExp( "\\S+\\s+\\S+\\s+\\S+\\s+(\\d+)\\s+\\S+" "\\s+\\S+\\s+(\\d+)\\s+(\\d+)\\s+\\S+\\s+\\S+" ); openStream(); @@ -119,9 +119,9 @@ void I8KView::openStream() if ( ( m_procFile = fopen( "/proc/i8k", "r" ) ) ) { - m_procStream = new QTextIStream( m_procFile ); + m_procStream = new TQTextIStream( m_procFile ); disconnect( m_timer, 0, 0, 0 ); - connect( m_timer, SIGNAL( timeout() ), SLOT( updateView() ) ); + connect( m_timer, TQT_SIGNAL( timeout() ), TQT_SLOT( updateView() ) ); m_timer->start( m_interval*1000 ); kdDebug( 2003 ) << "i8k: Success" << endl; @@ -130,7 +130,7 @@ void I8KView::openStream() { // i8k module is not loaded. Try again after 30 secs. disconnect( m_timer, 0, 0, 0 ); - connect( m_timer, SIGNAL( timeout() ), SLOT( openStream() ) ); + connect( m_timer, TQT_SIGNAL( timeout() ), TQT_SLOT( openStream() ) ); m_timer->start( 30*1000 ); kdDebug( 2003 ) << "i8k: Failed...retry after 30 secs" << endl; } @@ -151,7 +151,7 @@ void I8KView::closeStream() void I8KView::initGUI() { - QVBoxLayout *layout = new QVBoxLayout( this ); + TQVBoxLayout *layout = new TQVBoxLayout( this ); m_fan1Label = new KSim::Label( this ); m_fan2Label = new KSim::Label( this ); @@ -171,7 +171,7 @@ void I8KView::updateView() { fseek( m_procFile, 0L, SEEK_SET ); - QString line = m_procStream->read(); + TQString line = m_procStream->read(); if ( line.isEmpty() ) { @@ -183,7 +183,7 @@ void I8KView::updateView() if ( m_reData->search( line ) > -1 ) { - QStringList matches = m_reData->capturedTexts(); + TQStringList matches = m_reData->capturedTexts(); cputemp = matches[ 1 ].toInt(); leftspeed = matches[ 2 ].toInt(); @@ -211,14 +211,14 @@ void I8KView::updateView() I8KConfig::I8KConfig(KSim::PluginObject *parent, const char *name) : KSim::PluginPage(parent, name) { - m_unit = new QCheckBox( i18n( "Show temperature in Fahrenheit" ), + m_unit = new TQCheckBox( i18n( "Show temperature in Fahrenheit" ), this ); - QLabel *label = new QLabel( i18n( "Update interval:" ), this ); + TQLabel *label = new TQLabel( i18n( "Update interval:" ), this ); m_interval = new KIntNumInput( this ); m_interval->setRange( 2, 60, 1, true ); m_interval->setSuffix( i18n( " sec" ) ); - QGridLayout *layout = new QGridLayout( this, 3, 2, 0, + TQGridLayout *layout = new TQGridLayout( this, 3, 2, 0, KDialog::spacingHint() ); layout->addMultiCellWidget( m_unit, 0, 0, 0, 1 ); @@ -236,7 +236,7 @@ void I8KConfig::readConfig() { config()->setGroup("I8KPlugin"); - QString unit = config()->readEntry( "Unit", "C" ); + TQString unit = config()->readEntry( "Unit", "C" ); int interval = config()->readNumEntry( "Interval", 5 ); m_unit->setChecked( unit == "F" ); diff --git a/ksim/monitors/i8k/ksimi8k.h b/ksim/monitors/i8k/ksimi8k.h index 4357508..40058da 100644 --- a/ksim/monitors/i8k/ksimi8k.h +++ b/ksim/monitors/i8k/ksimi8k.h @@ -68,14 +68,14 @@ class I8KView : public KSim::PluginView private: - QString m_unit; + TQString m_unit; int m_interval; KSim::Label *m_fan1Label, *m_fan2Label, *m_tempLabel; - QTimer *m_timer; + TQTimer *m_timer; FILE *m_procFile; - QTextIStream *m_procStream; - QRegExp *m_reData; + TQTextIStream *m_procStream; + TQRegExp *m_reData; }; class I8KConfig : public KSim::PluginPage @@ -92,7 +92,7 @@ class I8KConfig : public KSim::PluginPage private: - QCheckBox *m_unit; + TQCheckBox *m_unit; KIntNumInput *m_interval; }; diff --git a/ksim/monitors/lm_sensors/ksimsensors.cpp b/ksim/monitors/lm_sensors/ksimsensors.cpp index e63f5cf..eb2614f 100644 --- a/ksim/monitors/lm_sensors/ksimsensors.cpp +++ b/ksim/monitors/lm_sensors/ksimsensors.cpp @@ -27,7 +27,7 @@ #include <kaboutdata.h> #include <kconfig.h> -#include <qlayout.h> +#include <tqlayout.h> #include <label.h> #include <themetypes.h> @@ -58,7 +58,7 @@ KSim::PluginPage *PluginModule::createConfigPage(const char *className) void PluginModule::showAbout() { - QString version = kapp->aboutData()->version(); + TQString version = kapp->aboutData()->version(); KAboutData aboutData(instanceName(), I18N_NOOP("KSim Sensors Plugin"), version.latin1(), @@ -75,10 +75,10 @@ SensorsView::SensorsView(KSim::PluginObject *parent, const char *name) : DCOPObject("sensors"), KSim::PluginView(parent, name) { config()->setGroup("Sensors"); - (new QVBoxLayout(this))->setAutoAdd(true); + (new TQVBoxLayout(this))->setAutoAdd(true); - connect(SensorBase::self(), SIGNAL(updateSensors(const SensorList &)), - this, SLOT(updateSensors(const SensorList &))); + connect(SensorBase::self(), TQT_SIGNAL(updateSensors(const SensorList &)), + this, TQT_SLOT(updateSensors(const SensorList &))); insertSensors(); } @@ -95,8 +95,8 @@ void SensorsView::reparseConfig() SensorBase::self()->setDisplayFahrenheit(displayFahrenheit); SensorBase::self()->setUpdateSpeed(updateVal * 1000); - QString label; - QStringList names; + TQString label; + TQStringList names; SensorItemList sensorItemList; const SensorList &list = SensorBase::self()->sensorsList(); @@ -104,7 +104,7 @@ void SensorsView::reparseConfig() for (it = list.begin(); it != list.end(); ++it) { config()->setGroup("Sensors"); label = (*it).sensorType() + "/" + (*it).sensorName(); - names = QStringList::split(':', config()->readEntry(label)); + names = TQStringList::split(':', config()->readEntry(label)); if (names[0] == "1") sensorItemList.append(SensorItem((*it).sensorId(), names[1])); } @@ -122,8 +122,8 @@ void SensorsView::insertSensors(bool createList) const SensorList &list = SensorBase::self()->sensorsList(); if (createList) { - QString label; - QStringList names; + TQString label; + TQStringList names; config()->setGroup("Sensors"); bool displayFahrenheit = config()->readBoolEntry("displayFahrenheit", false); @@ -134,7 +134,7 @@ void SensorsView::insertSensors(bool createList) SensorList::ConstIterator it; for (it = list.begin(); it != list.end(); ++it) { label = (*it).sensorType() + "/" + (*it).sensorName(); - names = QStringList::split(':', config()->readEntry(label)); + names = TQStringList::split(':', config()->readEntry(label)); if (names[0] == "1") m_sensorItemList.append(SensorItem((*it).sensorId(), names[1])); } @@ -167,12 +167,12 @@ void SensorsView::updateSensors(const SensorList &sensorList) } } -QString SensorsView::sensorValue(const QString &sensor, - const QString &label1) +TQString SensorsView::sensorValue(const TQString &sensor, + const TQString &label1) { const SensorList &list = SensorBase::self()->sensorsList(); config()->setGroup("Sensors"); - QStringList names = QStringList::split(':', + TQStringList names = TQStringList::split(':', config()->readEntry(sensor + "/" + label1)); if (names[0] == "0" || list.isEmpty()) @@ -181,7 +181,7 @@ QString SensorsView::sensorValue(const QString &sensor, SensorList::ConstIterator it; for (it = list.begin(); it != list.end(); ++it) { if (sensor == (*it).sensorType() && label1 == (*it).sensorName()) { - return names[1] + QString(": ") + (*it).sensorValue() + (*it).sensorUnit(); + return names[1] + TQString(": ") + (*it).sensorValue() + (*it).sensorUnit(); } } diff --git a/ksim/monitors/lm_sensors/ksimsensors.h b/ksim/monitors/lm_sensors/ksimsensors.h index 8446931..a8a0482 100644 --- a/ksim/monitors/lm_sensors/ksimsensors.h +++ b/ksim/monitors/lm_sensors/ksimsensors.h @@ -53,7 +53,7 @@ class SensorsView : public KSim::PluginView, public KSimSensorsIface ~SensorsView(); virtual void reparseConfig(); - virtual QString sensorValue(const QString &, const QString &); + virtual TQString sensorValue(const TQString &, const TQString &); private slots: void updateSensors(const SensorList &); @@ -65,7 +65,7 @@ class SensorsView : public KSim::PluginView, public KSimSensorsIface { public: SensorItem() : id(-1), label(0) {} - SensorItem(int i, const QString &na) + SensorItem(int i, const TQString &na) : id(i), name(na), label(0) {} ~SensorItem() { delete label; } @@ -81,11 +81,11 @@ class SensorsView : public KSim::PluginView, public KSimSensorsIface } int id; - QString name; + TQString name; KSim::Label *label; }; - typedef QValueList<SensorItem> SensorItemList; + typedef TQValueList<SensorItem> SensorItemList; SensorItemList m_sensorItemList; }; #endif diff --git a/ksim/monitors/lm_sensors/ksimsensorsiface.h b/ksim/monitors/lm_sensors/ksimsensorsiface.h index 4bd50ce..4ee0d13 100644 --- a/ksim/monitors/lm_sensors/ksimsensorsiface.h +++ b/ksim/monitors/lm_sensors/ksimsensorsiface.h @@ -26,8 +26,8 @@ class KSimSensorsIface : virtual public DCOPObject { K_DCOP k_dcop: - virtual QString sensorValue(const QString &sensorType, - const QString &sensorName) = 0; + virtual TQString sensorValue(const TQString &sensorType, + const TQString &sensorName) = 0; }; #endif // KSIMSENSORSIFACE_H diff --git a/ksim/monitors/lm_sensors/sensorbase.cpp b/ksim/monitors/lm_sensors/sensorbase.cpp index 9ccb247..a0b82c5 100644 --- a/ksim/monitors/lm_sensors/sensorbase.cpp +++ b/ksim/monitors/lm_sensors/sensorbase.cpp @@ -23,14 +23,14 @@ #include <kdebug.h> #include <klocale.h> -#include <qglobal.h> +#include <tqglobal.h> #include <klibloader.h> #include <kstandarddirs.h> #include <kconfig.h> -#include <qtimer.h> -#include <qfile.h> -#include <qregexp.h> +#include <tqtimer.h> +#include <tqfile.h> +#include <tqregexp.h> #include <stdio.h> @@ -50,16 +50,16 @@ SensorBase *SensorBase::self() return m_self; } -SensorBase::SensorBase() : QObject() +SensorBase::SensorBase() : TQObject() { KSim::Config::config()->setGroup("Sensors"); - QCString sensorsName("libsensors.so"); + TQCString sensorsName("libsensors.so"); - QStringList sensorLocations = KSim::Config::config()->readListEntry("sensorLocations"); + TQStringList sensorLocations = KSim::Config::config()->readListEntry("sensorLocations"); - QStringList::ConstIterator it; + TQStringList::ConstIterator it; for (it = sensorLocations.begin(); it != sensorLocations.end(); ++it) { - if (QFile::exists((*it).local8Bit() + sensorsName)) { + if (TQFile::exists((*it).local8Bit() + sensorsName)) { m_libLocation = (*it).local8Bit() + sensorsName; break; } @@ -75,8 +75,8 @@ SensorBase::SensorBase() : QObject() m_hasNVControl = XNVCTRLQueryExtension(qt_xdisplay(), &eventBase, &errorBase) == True; } - m_updateTimer = new QTimer(this); - connect(m_updateTimer, SIGNAL(timeout()), SLOT(update())); + m_updateTimer = new TQTimer(this); + connect(m_updateTimer, TQT_SIGNAL(timeout()), TQT_SLOT(update())); } SensorBase::~SensorBase() @@ -120,13 +120,13 @@ void SensorBase::update() m_label(*chip, sFeature->number, &name); m_feature(*chip, sFeature->number, &value); - float returnValue = formatValue(QString::fromUtf8(name), float(value)); - QString label = formatString(QString::fromUtf8(name), returnValue); - QString chipset = chipsetString(chip); + float returnValue = formatValue(TQString::fromUtf8(name), float(value)); + TQString label = formatString(TQString::fromUtf8(name), returnValue); + TQString chipset = chipsetString(chip); m_sensorList.append(SensorInfo(currentSensor++, label, - QString::fromUtf8(name), QString::fromUtf8(chip->prefix), - chipset, sensorType(QString::fromLatin1(name)))); + TQString::fromUtf8(name), TQString::fromUtf8(chip->prefix), + chipset, sensorType(TQString::fromLatin1(name)))); } } } @@ -134,15 +134,15 @@ void SensorBase::update() if (m_hasNVControl) { int temp = 0; if (XNVCTRLQueryAttribute(qt_xdisplay(), qt_xscreen(), 0 /* not used? */, NV_CTRL_GPU_CORE_TEMPERATURE, &temp)) { - QString name = QString::fromLatin1("GPU Temp"); - m_sensorList.append(SensorInfo(currentSensor++, QString::number(temp), - name, QString::null, QString::null, sensorType(name))); + TQString name = TQString::fromLatin1("GPU Temp"); + m_sensorList.append(SensorInfo(currentSensor++, TQString::number(temp), + name, TQString::null, TQString::null, sensorType(name))); } if (XNVCTRLQueryAttribute(qt_xdisplay(), qt_xscreen(), 0 /* not used? */, NV_CTRL_AMBIENT_TEMPERATURE, &temp)) { - QString name = QString::fromLatin1("GPU Ambient Temp"); - m_sensorList.append(SensorInfo(currentSensor++, QString::number(temp), - name, QString::null, QString::null, sensorType(name))); + TQString name = TQString::fromLatin1("GPU Ambient Temp"); + m_sensorList.append(SensorInfo(currentSensor++, TQString::number(temp), + name, TQString::null, TQString::null, sensorType(name))); } } @@ -210,34 +210,34 @@ bool SensorBase::init() return true; } -QString SensorBase::sensorType(const QString &name) +TQString SensorBase::sensorType(const TQString &name) { if (name.findRev("fan", -1, false) != -1) return i18n("Rounds per minute", " RPM"); if (name.findRev("temp", -1, false) != -1) if (SensorBase::fahrenheit()) - return QString::fromLatin1("°F"); + return TQString::fromLatin1("°F"); else - return QString::fromLatin1("°C"); + return TQString::fromLatin1("°C"); - if (name.findRev(QRegExp("[^\\+]?[^\\-]?V$")) != -1) + if (name.findRev(TQRegExp("[^\\+]?[^\\-]?V$")) != -1) return i18n("Volt", "V"); - return QString::null; + return TQString::null; } -QString SensorBase::chipsetString(const ChipName *c) +TQString SensorBase::chipsetString(const ChipName *c) { - QString data = QString::fromUtf8(c->prefix); + TQString data = TQString::fromUtf8(c->prefix); if (c->bus == BusISA) - return QString().sprintf("%s-isa-%04x", data.utf8().data(), c->addr); + return TQString().sprintf("%s-isa-%04x", data.utf8().data(), c->addr); - return QString().sprintf("%s-i2c-%d-%02x", data.utf8().data(), c->bus, c->addr); + return TQString().sprintf("%s-i2c-%d-%02x", data.utf8().data(), c->bus, c->addr); } -float SensorBase::formatValue(const QString &label, float value) +float SensorBase::formatValue(const TQString &label, float value) { if (label.findRev("temp", -1, false) != -1) return toFahrenheit(value); @@ -245,10 +245,10 @@ float SensorBase::formatValue(const QString &label, float value) return value; } -QString SensorBase::formatString(const QString &label, float value) +TQString SensorBase::formatString(const TQString &label, float value) { if (label.findRev("fan", -1, false) != -1) - return QString::number(value); + return TQString::number(value); - return QString::number(value,'f',2); + return TQString::number(value,'f',2); } diff --git a/ksim/monitors/lm_sensors/sensorbase.h b/ksim/monitors/lm_sensors/sensorbase.h index c819d48..083cfd8 100644 --- a/ksim/monitors/lm_sensors/sensorbase.h +++ b/ksim/monitors/lm_sensors/sensorbase.h @@ -20,9 +20,9 @@ #ifndef SENSORBASE_H #define SENSORBASE_H -#include <qobject.h> -#include <qvaluelist.h> -#include <qcstring.h> +#include <tqobject.h> +#include <tqvaluelist.h> +#include <tqcstring.h> class QTimer; class KLibrary; @@ -32,11 +32,11 @@ class SensorInfo public: SensorInfo() {} SensorInfo(int id, - const QString &sensorValue, - const QString &sensorName, - const QString &sensorType, - const QString &chipsetName, - const QString &sensorUnit) + const TQString &sensorValue, + const TQString &sensorName, + const TQString &sensorType, + const TQString &chipsetName, + const TQString &sensorUnit) : m_id(id), m_sensor(sensorValue), m_sensorName(sensorName), m_sensorType(sensorType), @@ -50,41 +50,41 @@ class SensorInfo /** * @return the current value, eg: 5000 */ - const QString &sensorValue() const { return m_sensor; } + const TQString &sensorValue() const { return m_sensor; } /** * @return the sensor name, eg: temp1, fan2 */ - const QString &sensorName() const { return m_sensorName; } + const TQString &sensorName() const { return m_sensorName; } /** * @return the sensor type name, eg: w83782d */ - const QString &sensorType() const { return m_sensorType; } + const TQString &sensorType() const { return m_sensorType; } /** * @return the chipset name, eg: w83782d-i2c-0-2d */ - const QString &chipsetName() const { return m_chipsetName; } + const TQString &chipsetName() const { return m_chipsetName; } /** * @return the unit name, eg: RPM, °C or °F if display fahrenheit is enabled */ - const QString &sensorUnit() const { return m_sensorUnit; } + const TQString &sensorUnit() const { return m_sensorUnit; } private: int m_id; - QString m_sensor; - QString m_sensorName; - QString m_sensorType; - QString m_chipsetName; - QString m_sensorUnit; + TQString m_sensor; + TQString m_sensorName; + TQString m_sensorType; + TQString m_chipsetName; + TQString m_sensorUnit; }; -class SensorList : public QValueList<SensorInfo> +class SensorList : public TQValueList<SensorInfo> { public: SensorList() {} SensorList(const SensorList &sensorList) - : QValueList<SensorInfo>(sensorList) {} - SensorList(const QValueList<SensorInfo> &sensorList) - : QValueList<SensorInfo>(sensorList) {} + : TQValueList<SensorInfo>(sensorList) {} + SensorList(const TQValueList<SensorInfo> &sensorList) + : TQValueList<SensorInfo>(sensorList) {} SensorList(const SensorInfo &sensor) { append(sensor); } }; @@ -144,15 +144,15 @@ class SensorBase : public QObject bool init(); float toFahrenheit(float value); - QString sensorType(const QString &name); - QString chipsetString(const ChipName *c); - float formatValue(const QString &label, float value); - QString formatString(const QString &label, float value); + TQString sensorType(const TQString &name); + TQString chipsetString(const ChipName *c); + float formatValue(const TQString &label, float value); + TQString formatString(const TQString &label, float value); SensorList m_sensorList; - QTimer *m_updateTimer; + TQTimer *m_updateTimer; KLibrary *m_library; - QCString m_libLocation; + TQCString m_libLocation; bool m_loaded; bool m_fahrenheit; diff --git a/ksim/monitors/lm_sensors/sensorsconfig.cpp b/ksim/monitors/lm_sensors/sensorsconfig.cpp index 6e2b4b3..2ab1235 100644 --- a/ksim/monitors/lm_sensors/sensorsconfig.cpp +++ b/ksim/monitors/lm_sensors/sensorsconfig.cpp @@ -29,21 +29,21 @@ #include <kdebug.h> #include <kinputdialog.h> -#include <qtimer.h> -#include <qlabel.h> -#include <qlayout.h> -#include <qcheckbox.h> -#include <qcursor.h> -#include <qpopupmenu.h> -#include <qpushbutton.h> +#include <tqtimer.h> +#include <tqlabel.h> +#include <tqlayout.h> +#include <tqcheckbox.h> +#include <tqcursor.h> +#include <tqpopupmenu.h> +#include <tqpushbutton.h> class SensorViewItem : public QCheckListItem { public: - SensorViewItem(QListView *parent, const QString &text1, - const QString &text2, const QString &text3, - const QString &text4) - : QCheckListItem(parent, text1, CheckBox) + SensorViewItem(TQListView *parent, const TQString &text1, + const TQString &text2, const TQString &text3, + const TQString &text4) + : TQCheckListItem(parent, text1, CheckBox) { setText(1, text2); setText(2, text3); @@ -54,7 +54,7 @@ class SensorViewItem : public QCheckListItem SensorsConfig::SensorsConfig(KSim::PluginObject *parent, const char *name) : KSim::PluginPage(parent, name) { - m_layout = new QGridLayout(this); + m_layout = new TQGridLayout(this); m_layout->setSpacing(6); m_neverShown = true; @@ -67,36 +67,36 @@ SensorsConfig::SensorsConfig(KSim::PluginObject *parent, const char *name) m_sensorView->setColumnWidth(1, 60); m_sensorView->setColumnWidth(2, 80); m_sensorView->setAllColumnsShowFocus(true); - connect(m_sensorView, SIGNAL(contextMenu(KListView *, - QListViewItem *, const QPoint &)), this, SLOT(menu(KListView *, - QListViewItem *, const QPoint &))); + connect(m_sensorView, TQT_SIGNAL(contextMenu(KListView *, + TQListViewItem *, const TQPoint &)), this, TQT_SLOT(menu(KListView *, + TQListViewItem *, const TQPoint &))); - connect( m_sensorView, SIGNAL( doubleClicked( QListViewItem * ) ), - SLOT( modify( QListViewItem * ) ) ); + connect( m_sensorView, TQT_SIGNAL( doubleClicked( TQListViewItem * ) ), + TQT_SLOT( modify( TQListViewItem * ) ) ); m_layout->addMultiCellWidget(m_sensorView, 1, 1, 0, 3); - m_modify = new QPushButton( this ); + m_modify = new TQPushButton( this ); m_modify->setText( i18n( "Modify..." ) ); - connect( m_modify, SIGNAL( clicked() ), SLOT( modify() ) ); + connect( m_modify, TQT_SIGNAL( clicked() ), TQT_SLOT( modify() ) ); m_layout->addMultiCellWidget( m_modify, 2, 2, 3, 3 ); - m_fahrenBox = new QCheckBox(i18n("Display Fahrenheit"), this); + m_fahrenBox = new TQCheckBox(i18n("Display Fahrenheit"), this); m_layout->addMultiCellWidget(m_fahrenBox, 3, 3, 0, 3); - m_updateLabel = new QLabel(this); + m_updateLabel = new TQLabel(this); m_updateLabel->setText(i18n("Update interval:")); - m_updateLabel->setSizePolicy(QSizePolicy(QSizePolicy::Fixed, - QSizePolicy::Fixed)); + m_updateLabel->setSizePolicy(TQSizePolicy(TQSizePolicy::Fixed, + TQSizePolicy::Fixed)); m_layout->addMultiCellWidget(m_updateLabel, 4, 4, 0, 0); m_sensorSlider = new KIntSpinBox(this); m_layout->addMultiCellWidget(m_sensorSlider, 4, 4, 1, 1); - QLabel *intervalLabel = new QLabel(this); + TQLabel *intervalLabel = new TQLabel(this); intervalLabel->setText(i18n("seconds")); - intervalLabel->setSizePolicy(QSizePolicy(QSizePolicy::Fixed, - QSizePolicy::Fixed)); + intervalLabel->setSizePolicy(TQSizePolicy(TQSizePolicy::Fixed, + TQSizePolicy::Fixed)); m_layout->addMultiCellWidget(intervalLabel, 4, 4, 2, 2); } @@ -110,10 +110,10 @@ void SensorsConfig::saveConfig() config()->writeEntry("sensorUpdateValue", m_sensorSlider->value()); config()->writeEntry("displayFahrenheit", m_fahrenBox->isChecked()); - for (QListViewItemIterator it(m_sensorView); it.current(); ++it) { + for (TQListViewItemIterator it(m_sensorView); it.current(); ++it) { config()->setGroup("Sensors"); config()->writeEntry(it.current()->text(2), - QString::number(static_cast<QCheckListItem *>(it.current())->isOn()) + TQString::number(static_cast<TQCheckListItem *>(it.current())->isOn()) + ":" + it.current()->text(1)); } } @@ -124,25 +124,25 @@ void SensorsConfig::readConfig() m_fahrenBox->setChecked(config()->readBoolEntry("displayFahrenheit", false)); m_sensorSlider->setValue(config()->readNumEntry("sensorUpdateValue", 15)); - QStringList names; - for (QListViewItemIterator it(m_sensorView); it.current(); ++it) { + TQStringList names; + for (TQListViewItemIterator it(m_sensorView); it.current(); ++it) { config()->setGroup("Sensors"); - names = QStringList::split(":", config()->readEntry(it.current()->text(2), "0:")); + names = TQStringList::split(":", config()->readEntry(it.current()->text(2), "0:")); if (!names[1].isNull()) it.current()->setText(1, names[1]); - static_cast<QCheckListItem *>(it.current())->setOn(names[0].toInt()); + static_cast<TQCheckListItem *>(it.current())->setOn(names[0].toInt()); } } -void SensorsConfig::menu(KListView *, QListViewItem *, const QPoint &) +void SensorsConfig::menu(KListView *, TQListViewItem *, const TQPoint &) { - m_popupMenu = new QPopupMenu(this); + m_popupMenu = new TQPopupMenu(this); m_popupMenu->insertItem(i18n("Select All"), 1); m_popupMenu->insertItem(i18n("Unselect All"), 2); m_popupMenu->insertItem(i18n("Invert Selection"), 3); - switch (m_popupMenu->exec(QCursor::pos())) { + switch (m_popupMenu->exec(TQCursor::pos())) { case 1: selectAll(); break; @@ -159,20 +159,20 @@ void SensorsConfig::menu(KListView *, QListViewItem *, const QPoint &) void SensorsConfig::selectAll() { - for (QListViewItemIterator it(m_sensorView); it.current(); ++it) - static_cast<QCheckListItem *>(it.current())->setOn(true); + for (TQListViewItemIterator it(m_sensorView); it.current(); ++it) + static_cast<TQCheckListItem *>(it.current())->setOn(true); } void SensorsConfig::unSelectAll() { - for (QListViewItemIterator it(m_sensorView); it.current(); ++it) - static_cast<QCheckListItem *>(it.current())->setOn(false); + for (TQListViewItemIterator it(m_sensorView); it.current(); ++it) + static_cast<TQCheckListItem *>(it.current())->setOn(false); } void SensorsConfig::invertSelect() { - for (QListViewItemIterator it(m_sensorView); it.current(); ++it) { - QCheckListItem *item = static_cast<QCheckListItem *>(it.current()); + for (TQListViewItemIterator it(m_sensorView); it.current(); ++it) { + TQCheckListItem *item = static_cast<TQCheckListItem *>(it.current()); if (item->isOn()) item->setOn(false); else @@ -185,8 +185,8 @@ void SensorsConfig::initSensors() const SensorList &sensorList = SensorBase::self()->sensorsList(); int i = 0; - QString label; - QStringList sensorInfo; + TQString label; + TQStringList sensorInfo; SensorList::ConstIterator it; for (it = sensorList.begin(); it != sensorList.end(); ++it) { label.sprintf("%02i", ++i); @@ -195,23 +195,23 @@ void SensorsConfig::initSensors() (*it).sensorValue() + (*it).sensorUnit()); } - QStringList names; - for (QListViewItemIterator it(m_sensorView); it.current(); ++it) { + TQStringList names; + for (TQListViewItemIterator it(m_sensorView); it.current(); ++it) { config()->setGroup("Sensors"); - names = QStringList::split(":", config()->readEntry(it.current()->text(2), "0:")); + names = TQStringList::split(":", config()->readEntry(it.current()->text(2), "0:")); if (!names[1].isNull()) it.current()->setText(1, names[1]); - static_cast<QCheckListItem *>(it.current())->setOn(names[0].toInt()); + static_cast<TQCheckListItem *>(it.current())->setOn(names[0].toInt()); } } -void SensorsConfig::modify( QListViewItem * item ) +void SensorsConfig::modify( TQListViewItem * item ) { if ( !item ) return; bool ok = false; - QString text = KInputDialog::getText( i18n( "Modify Sensor Label" ), i18n( "Sensor label:" ), + TQString text = KInputDialog::getText( i18n( "Modify Sensor Label" ), i18n( "Sensor label:" ), item->text( 1 ), &ok, this ); if ( ok ) @@ -223,7 +223,7 @@ void SensorsConfig::modify() modify( m_sensorView->selectedItem() ); } -void SensorsConfig::showEvent(QShowEvent *) +void SensorsConfig::showEvent(TQShowEvent *) { if (m_neverShown) { initSensors(); @@ -233,7 +233,7 @@ void SensorsConfig::showEvent(QShowEvent *) const SensorList &list = SensorBase::self()->sensorsList(); SensorList::ConstIterator it; for (it = list.begin(); it != list.end(); ++it) { - QListViewItem *item = m_sensorView->findItem((*it).sensorName(), 1); + TQListViewItem *item = m_sensorView->findItem((*it).sensorName(), 1); if (item) item->setText(3, (*it).sensorValue() + (*it).sensorUnit()); } diff --git a/ksim/monitors/lm_sensors/sensorsconfig.h b/ksim/monitors/lm_sensors/sensorsconfig.h index 28d656e..60410f4 100644 --- a/ksim/monitors/lm_sensors/sensorsconfig.h +++ b/ksim/monitors/lm_sensors/sensorsconfig.h @@ -44,26 +44,26 @@ class SensorsConfig : public KSim::PluginPage void readConfig(); private slots: - void menu(KListView *, QListViewItem *, const QPoint &); + void menu(KListView *, TQListViewItem *, const TQPoint &); void initSensors(); void selectAll(); void unSelectAll(); void invertSelect(); - void modify( QListViewItem * ); + void modify( TQListViewItem * ); void modify(); protected: - void showEvent(QShowEvent *); + void showEvent(TQShowEvent *); private: bool m_neverShown; - QLabel *m_updateLabel; + TQLabel *m_updateLabel; KIntSpinBox *m_sensorSlider; KListView *m_sensorView; - QCheckBox *m_fahrenBox; - QGridLayout *m_layout; - QPopupMenu *m_popupMenu; - QPushButton * m_modify; + TQCheckBox *m_fahrenBox; + TQGridLayout *m_layout; + TQPopupMenu *m_popupMenu; + TQPushButton * m_modify; }; #endif diff --git a/ksim/monitors/mail/ksimmail.cpp b/ksim/monitors/mail/ksimmail.cpp index 6ca1142..fdda6bd 100644 --- a/ksim/monitors/mail/ksimmail.cpp +++ b/ksim/monitors/mail/ksimmail.cpp @@ -19,9 +19,9 @@ // $Id$ -#include <qbitmap.h> -#include <qlayout.h> -#include <qtimer.h> +#include <tqbitmap.h> +#include <tqlayout.h> +#include <tqtimer.h> #include <kaboutapplication.h> #include <kdebug.h> @@ -69,7 +69,7 @@ void MailPlugin::showAbout() MailView::MailView( KSim::PluginObject* parent, const char* name ) : KSim::PluginView( parent, name ) { - QVBoxLayout* layout = new QVBoxLayout( this ); + TQVBoxLayout* layout = new TQVBoxLayout( this ); MailLabel* label = new MailLabel( this ); layout->addWidget( label, 0, AlignHCenter ); @@ -87,13 +87,13 @@ void MailView::updateDisplay() { } -MailLabel::MailLabel( QWidget* parent ) +MailLabel::MailLabel( TQWidget* parent ) : KSim::Label( KSim::Types::Mail, parent ) { // label->setPixmap( KSim::ThemeLoader::self().current().krellMail() ); configureObject( false ); - QTimer* timer = new QTimer( this ); - connect( timer, SIGNAL( timeout() ), SLOT( animation() ) ); + TQTimer* timer = new TQTimer( this ); + connect( timer, TQT_SIGNAL( timeout() ), TQT_SLOT( animation() ) ); timer->start( 100 ); } @@ -115,7 +115,7 @@ void MailLabel::configureObject( bool repaint ) KSim::Label::configureObject( repaint ); } -void MailLabel::paintEvent( QPaintEvent* e ) +void MailLabel::paintEvent( TQPaintEvent* e ) { KSim::Label::paintEvent( e ); } @@ -127,13 +127,13 @@ void MailLabel::animation() if ( f++ >= m_frames ) f = 1; } -QPixmap MailLabel::frame( const QPixmap& source, int number ) const +TQPixmap MailLabel::frame( const TQPixmap& source, int number ) const { - QPixmap result( source.width(), source.height() / m_frames ); + TQPixmap result( source.width(), source.height() / m_frames ); bitBlt( &result, 0, 0, &source, 0, number * source.height() / m_frames ); if ( source.mask() ) { - QBitmap mask( result.size() ); + TQBitmap mask( result.size() ); bitBlt( &mask, 0, 0, source.mask(), 0, number * source.height() / m_frames ); result.setMask( mask ); } diff --git a/ksim/monitors/mail/ksimmail.h b/ksim/monitors/mail/ksimmail.h index fd8790a..f5a42d7 100644 --- a/ksim/monitors/mail/ksimmail.h +++ b/ksim/monitors/mail/ksimmail.h @@ -53,23 +53,23 @@ class MailLabel : public KSim::Label { Q_OBJECT public: - MailLabel( QWidget* parent ); + MailLabel( TQWidget* parent ); virtual ~MailLabel(); virtual void configureObject( bool ); protected: - virtual void paintEvent( QPaintEvent* ); + virtual void paintEvent( TQPaintEvent* ); private slots: void animation(); private: - QPixmap frame( const QPixmap& source, int number ) const; + TQPixmap frame( const TQPixmap& source, int number ) const; private: - QPixmap m_envelope; - QPixmap m_penguin; + TQPixmap m_envelope; + TQPixmap m_penguin; int m_frames; int m_delay; }; diff --git a/ksim/monitors/net/ksimnet.cpp b/ksim/monitors/net/ksimnet.cpp index 45f86c2..1bbfeb2 100644 --- a/ksim/monitors/net/ksimnet.cpp +++ b/ksim/monitors/net/ksimnet.cpp @@ -33,15 +33,15 @@ static int mib[] = { CTL_NET, PF_ROUTE, 0, 0, NET_RT_IFLIST, 0 }; #endif -#include <qpushbutton.h> -#include <qtextstream.h> -#include <qfile.h> -#include <qdatetime.h> -#include <qlayout.h> -#include <qtimer.h> -#include <qregexp.h> -#include <qcursor.h> -#include <qpopupmenu.h> +#include <tqpushbutton.h> +#include <tqtextstream.h> +#include <tqfile.h> +#include <tqdatetime.h> +#include <tqlayout.h> +#include <tqtimer.h> +#include <tqregexp.h> +#include <tqcursor.h> +#include <tqpopupmenu.h> #include <kdebug.h> #include <klocale.h> @@ -84,7 +84,7 @@ KSim::PluginPage *NetPlugin::createConfigPage(const char *className) void NetPlugin::showAbout() { - QString version = kapp->aboutData()->version(); + TQString version = kapp->aboutData()->version(); KAboutData aboutData(instanceName(), I18N_NOOP("KSim Net Plugin"), version.latin1(), @@ -105,7 +105,7 @@ NetView::NetView(KSim::PluginObject *parent, const char *name) #ifdef __linux__ m_procStream = 0L; if ((m_procFile = fopen("/proc/net/dev", "r"))) - m_procStream = new QTextStream(m_procFile, IO_ReadOnly); + m_procStream = new TQTextStream(m_procFile, IO_ReadOnly); #endif #ifdef __FreeBSD__ m_buf = 0; @@ -113,17 +113,17 @@ NetView::NetView(KSim::PluginObject *parent, const char *name) #endif m_firstTime = true; - m_netLayout = new QVBoxLayout(this); + m_netLayout = new TQVBoxLayout(this); m_networkList = createList(); addDisplay(); - m_netTimer = new QTimer(this); - connect(m_netTimer, SIGNAL(timeout()), SLOT(updateGraph())); + m_netTimer = new TQTimer(this); + connect(m_netTimer, TQT_SIGNAL(timeout()), TQT_SLOT(updateGraph())); m_netTimer->start(NET_UPDATE); - m_lightTimer = new QTimer(this); - connect(m_lightTimer, SIGNAL(timeout()), SLOT(updateLights())); + m_lightTimer = new TQTimer(this); + connect(m_lightTimer, TQT_SIGNAL(timeout()), TQT_SLOT(updateLights())); m_lightTimer->start(LED_UPDATE); updateGraph(); @@ -180,12 +180,12 @@ void NetView::addDisplay() { KSim::LedLabel *led = addLedLabel( ( *it ).name() ); KSim::Label *label = ( ( *it ).showTimer() ? addLabel() : 0L ); - QPopupMenu * popup = ( ( *it ).commandsEnabled() ? + TQPopupMenu * popup = ( ( *it ).commandsEnabled() ? addPopupMenu( ( *it ).name(), i ) : 0L ); KSim::Chart *chart = addChart(); //KSim::LedLabel *led = addLedLabel( ( *it ).name() ); //KSim::Label *label = ( ( *it ).showTimer() ? addLabel() : 0L ); - //QPopupMenu * popup = ( ( *it ).commandsEnabled() ? + //TQPopupMenu * popup = ( ( *it ).commandsEnabled() ? //addPopupMenu( ( *it ).name(), i ) : 0L ); if ( ( *it ).commandsEnabled() ) @@ -262,12 +262,12 @@ Network::List NetView::createList() const Network::List list; for ( int i = 0; i < amount; ++i ) { - if ( !config()->hasGroup( "device-" + QString::number( i ) ) ) + if ( !config()->hasGroup( "device-" + TQString::number( i ) ) ) { continue; } - config()->setGroup( "device-" + QString::number( i ) ); + config()->setGroup( "device-" + TQString::number( i ) ); list.append( Network( config()->readEntry( "deviceName" ), config()->readEntry( "deviceFormat" ), @@ -341,10 +341,10 @@ void NetView::updateGraph() time_t start = 0; struct stat st; - QTime netTime; - QString timeDisplay; - QString pid( "/var/run/%1.pid" ); - QString newPid; + TQTime netTime; + TQString timeDisplay; + TQString pid( "/var/run/%1.pid" ); + TQString newPid; Network::List::Iterator it; for ( it = m_networkList.begin(); it != m_networkList.end(); ++it ) @@ -358,7 +358,7 @@ void NetView::updateGraph() timeDisplay = ( *it ).format(); newPid = pid.arg( ( *it ).name() ); - if ( QFile::exists( newPid ) && stat( QFile::encodeName( newPid ).data(), &st ) == 0 ) + if ( TQFile::exists( newPid ) && stat( TQFile::encodeName( newPid ).data(), &st ) == 0 ) { start = st.st_mtime; @@ -391,8 +391,8 @@ void NetView::updateGraph() ( *it ).chart()->setValue( receiveDiff, sendDiff ); ( *it ).setMaxValue( ( *it ).chart()->maxValue() ); - QString receiveString = KGlobal::locale()->formatNumber( ( float ) receiveDiff / 1024.0, 1 ); - QString sendString = KGlobal::locale()->formatNumber( ( float ) sendDiff / 1024.0, 1 ); + TQString receiveString = KGlobal::locale()->formatNumber( ( float ) receiveDiff / 1024.0, 1 ); + TQString sendString = KGlobal::locale()->formatNumber( ( float ) sendDiff / 1024.0, 1 ); ( *it ).chart()->setText( i18n( "in: %1k" ).arg( receiveString ), i18n( "out: %1k" ).arg( sendString ) ); @@ -422,7 +422,7 @@ KSim::Chart *NetView::addChart() return chart; } -KSim::LedLabel *NetView::addLedLabel(const QString &device) +KSim::LedLabel *NetView::addLedLabel(const TQString &device) { KSim::LedLabel *ledLabel = new KSim::LedLabel(0, KSim::Types::Net, device, this); @@ -440,20 +440,20 @@ KSim::Label *NetView::addLabel() return label; } -QPopupMenu *NetView::addPopupMenu(const QString &device, int value) +TQPopupMenu *NetView::addPopupMenu(const TQString &device, int value) { - QPopupMenu *popup = new QPopupMenu(this); + TQPopupMenu *popup = new TQPopupMenu(this); popup->insertItem(SmallIcon("network"), i18n("Connect"), this, - SLOT(runConnectCommand(int)), 0, 1); + TQT_SLOT(runConnectCommand(int)), 0, 1); popup->setItemParameter(1, value); popup->insertItem(SmallIcon("network"), i18n("Disconnect"), this, - SLOT(runDisconnectCommand(int)), 0, 2); + TQT_SLOT(runDisconnectCommand(int)), 0, 2); popup->setItemParameter(2, value); menu()->insertItem(device, popup, 100 + value); return popup; } -void NetView::netStatistics(const QString &device, NetData &data) +void NetView::netStatistics(const TQString &device, NetData &data) { #ifdef __linux__ if (m_procFile == 0) { @@ -462,8 +462,8 @@ void NetView::netStatistics(const QString &device, NetData &data) return; } - QString output; - QString parser; + TQString output; + TQString parser; // Parse the proc file while (!m_procStream->atEnd()) { parser = m_procStream->readLine(); @@ -480,8 +480,8 @@ void NetView::netStatistics(const QString &device, NetData &data) // make sure our output doesn't contain "eth0:11210107" so we dont // end up with netList[1] actually being netList[2] - output.replace(QRegExp(":"), " "); - QStringList netList = QStringList::split(' ', output); + output.replace(TQRegExp(":"), " "); + TQStringList netList = TQStringList::split(' ', output); data.in = netList[1].toULong(); data.out = netList[9].toULong(); @@ -552,14 +552,14 @@ void NetView::netStatistics(const QString &device, NetData &data) #endif } -bool NetView::isOnline(const QString &device) +bool NetView::isOnline(const TQString &device) { #ifdef __linux__ - QFile file("/proc/net/route"); + TQFile file("/proc/net/route"); if (!file.open(IO_ReadOnly)) return -1; - return (QTextStream(&file).read().find(device) != -1 ? true : false); + return (TQTextStream(&file).read().find(device) != -1 ? true : false); #endif #ifdef __FreeBSD__ @@ -625,7 +625,7 @@ bool NetView::isOnline(const QString &device) } // EventFilter -bool NetView::eventFilter( QObject * o, QEvent * e ) +bool NetView::eventFilter( TQObject * o, TQEvent * e ) { // find out which interface we are int i = 0; @@ -640,9 +640,9 @@ bool NetView::eventFilter( QObject * o, QEvent * e ) ++i; } - if ( e->type() == QEvent::MouseButtonPress ) + if ( e->type() == TQEvent::MouseButtonPress ) { - if ( static_cast<QMouseEvent *>( e )->button() == QMouseEvent::RightButton ) + if ( static_cast<TQMouseEvent *>( e )->button() == TQMouseEvent::RightButton ) { showMenu(i); } @@ -655,10 +655,10 @@ bool NetView::eventFilter( QObject * o, QEvent * e ) void NetView::showMenu(int i) { - QPopupMenu menu; + TQPopupMenu menu; menu.insertItem( SmallIcon("network"), i18n("Connect"), 1); menu.insertItem( SmallIcon("network"), i18n("Disconnect"), 2); - switch (menu.exec(QCursor::pos())) { + switch (menu.exec(TQCursor::pos())) { case 1: runConnectCommand(i); break; diff --git a/ksim/monitors/net/ksimnet.h b/ksim/monitors/net/ksimnet.h index bdb76e6..007a1a8 100644 --- a/ksim/monitors/net/ksimnet.h +++ b/ksim/monitors/net/ksimnet.h @@ -58,29 +58,29 @@ class NetView : public KSim::PluginView void runDisconnectCommand(int); protected: - bool eventFilter(QObject *, QEvent *); + bool eventFilter(TQObject *, TQEvent *); private: Network::List createList() const; KSim::Chart *addChart(); - KSim::LedLabel *addLedLabel(const QString &device); + KSim::LedLabel *addLedLabel(const TQString &device); KSim::Label *addLabel(); - QPopupMenu *addPopupMenu(const QString &device, int value); + TQPopupMenu *addPopupMenu(const TQString &device, int value); - void netStatistics(const QString &device, NetData &data); - bool isOnline(const QString &device); + void netStatistics(const TQString &device, NetData &data); + bool isOnline(const TQString &device); void showMenu(int i); bool m_firstTime; Network::List m_networkList; - QTimer *m_netTimer; - QTimer *m_lightTimer; - QVBoxLayout *m_netLayout; + TQTimer *m_netTimer; + TQTimer *m_lightTimer; + TQVBoxLayout *m_netLayout; #ifdef __linux__ FILE *m_procFile; - QTextStream *m_procStream; + TQTextStream *m_procStream; #endif #ifdef __FreeBSD__ char *m_buf; diff --git a/ksim/monitors/net/netconfig.cpp b/ksim/monitors/net/netconfig.cpp index ca424b3..178ac90 100644 --- a/ksim/monitors/net/netconfig.cpp +++ b/ksim/monitors/net/netconfig.cpp @@ -17,9 +17,9 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#include <qpushbutton.h> -#include <qlayout.h> -#include <qcursor.h> +#include <tqpushbutton.h> +#include <tqlayout.h> +#include <tqcursor.h> #include <klistview.h> #include <ksimpleconfig.h> @@ -40,7 +40,7 @@ NetConfig::NetConfig(KSim::PluginObject *parent, const char *name) m_yes = i18n("yes"); m_no = i18n("no"); - QVBoxLayout *mainLayout = new QVBoxLayout(this); + TQVBoxLayout *mainLayout = new TQVBoxLayout(this); mainLayout->setSpacing(6); usingBox = new KListView(this); @@ -49,33 +49,33 @@ NetConfig::NetConfig(KSim::PluginObject *parent, const char *name) usingBox ->addColumn(i18n("Commands")); usingBox->setAllColumnsShowFocus(true); - connect(usingBox, SIGNAL(contextMenu(KListView *, - QListViewItem *, const QPoint &)), - SLOT(menu(KListView *, QListViewItem *, const QPoint &))); - connect(usingBox, SIGNAL(doubleClicked(QListViewItem *)), - SLOT(modifyItem(QListViewItem *))); + connect(usingBox, TQT_SIGNAL(contextMenu(KListView *, + TQListViewItem *, const TQPoint &)), + TQT_SLOT(menu(KListView *, TQListViewItem *, const TQPoint &))); + connect(usingBox, TQT_SIGNAL(doubleClicked(TQListViewItem *)), + TQT_SLOT(modifyItem(TQListViewItem *))); mainLayout->addWidget(usingBox); layout = new QHBoxLayout; layout->setSpacing(6); - QSpacerItem *spacer = new QSpacerItem(20, 20, - QSizePolicy::Expanding, QSizePolicy::Minimum); + TQSpacerItem *spacer = new TQSpacerItem(20, 20, + TQSizePolicy::Expanding, TQSizePolicy::Minimum); layout->addItem(spacer); - insertButton = new QPushButton(this); + insertButton = new TQPushButton(this); insertButton->setText(i18n("Add...")); - connect(insertButton, SIGNAL(clicked()), SLOT(showNetDialog())); + connect(insertButton, TQT_SIGNAL(clicked()), TQT_SLOT(showNetDialog())); layout->addWidget(insertButton); - modifyButton = new QPushButton(this); + modifyButton = new TQPushButton(this); modifyButton->setText(i18n("Modify...")); - connect(modifyButton, SIGNAL(clicked()), SLOT(modifyCurrent())); + connect(modifyButton, TQT_SIGNAL(clicked()), TQT_SLOT(modifyCurrent())); layout->addWidget(modifyButton); - removeButton = new QPushButton(this); + removeButton = new TQPushButton(this); removeButton->setText(i18n("Remove")); - connect(removeButton, SIGNAL(clicked()), SLOT(removeCurrent())); + connect(removeButton, TQT_SIGNAL(clicked()), TQT_SLOT(removeCurrent())); layout->addWidget(removeButton); mainLayout->addLayout(layout); @@ -93,7 +93,7 @@ void NetConfig::saveConfig() Network::List::Iterator it; for( it = m_networkList.begin(); it != m_networkList.end(); ++it ) { - config()->setGroup( "device-" + QString::number( i ) ); + config()->setGroup( "device-" + TQString::number( i ) ); config()->writeEntry( "deviceName", ( *it ).name() ); config()->writeEntry( "showTimer", ( *it ).showTimer() ); config()->writeEntry( "deviceFormat", ( *it ).format() ); @@ -117,12 +117,12 @@ void NetConfig::readConfig() for ( int i = 0; i < deviceAmount; ++i ) { - if ( !config()->hasGroup( "device-" + QString::number( i ) ) ) + if ( !config()->hasGroup( "device-" + TQString::number( i ) ) ) { continue; } - config()->setGroup("device-" + QString::number(i)); + config()->setGroup("device-" + TQString::number(i)); m_networkList.append( Network( config()->readEntry( "deviceName" ), config()->readEntry( "deviceFormat" ), @@ -131,16 +131,16 @@ void NetConfig::readConfig() config()->readEntry( "cCommand" ), config()->readEntry( "dCommand" ) ) ); - (void) new QListViewItem( usingBox, + (void) new TQListViewItem( usingBox, config()->readEntry( "deviceName" ), boolToString( config()->readBoolEntry( "showTimer" ) ), boolToString( config()->readBoolEntry( "commands" ) ) ); } } -void NetConfig::menu(KListView *, QListViewItem *item, const QPoint &) +void NetConfig::menu(KListView *, TQListViewItem *item, const TQPoint &) { - aboutMenu = new QPopupMenu(this); + aboutMenu = new TQPopupMenu(this); if (item) { aboutMenu->insertItem(i18n("&Add Net Device"), 3); @@ -155,7 +155,7 @@ void NetConfig::menu(KListView *, QListViewItem *item, const QPoint &) aboutMenu->setItemEnabled(2, false); } - switch (aboutMenu->exec(QCursor::pos())) { + switch (aboutMenu->exec(TQCursor::pos())) { case 1: removeItem(item); break; @@ -170,7 +170,7 @@ void NetConfig::menu(KListView *, QListViewItem *item, const QPoint &) delete aboutMenu; } -void NetConfig::modifyItem(QListViewItem *item) +void NetConfig::modifyItem(TQListViewItem *item) { if (!item) return; @@ -211,13 +211,13 @@ void NetConfig::modifyItem(QListViewItem *item) delete netDialog; } -void NetConfig::removeItem(QListViewItem *item) +void NetConfig::removeItem(TQListViewItem *item) { if (!item) return; int result = KMessageBox::warningContinueCancel(0, i18n("Are you sure you " - "want to remove the net interface '%1'?").arg(item->text(0)), QString::null, KStdGuiItem::del()); + "want to remove the net interface '%1'?").arg(item->text(0)), TQString::null, KStdGuiItem::del()); if (result == KMessageBox::Cancel) return; @@ -229,7 +229,7 @@ void NetConfig::removeItem(QListViewItem *item) if ( item->text( 0 ) == ( *it ).name() ) { m_networkList.remove( it ); - if ( config()->deleteGroup( "device-" + QString::number( i ) ) ) + if ( config()->deleteGroup( "device-" + TQString::number( i ) ) ) kdDebug(2003) << "device-" << i << " was deleted" << endl; break; @@ -281,13 +281,13 @@ void NetConfig::getStats() netDialog->cCommand(), netDialog->dCommand() ) ); - (void) new QListViewItem( usingBox, + (void) new TQListViewItem( usingBox, netDialog->deviceName(), boolToString( netDialog->timer() ), boolToString( netDialog->commands() ) ); } -const QString &NetConfig::boolToString(bool value) const +const TQString &NetConfig::boolToString(bool value) const { if (value) return m_yes; diff --git a/ksim/monitors/net/netconfig.h b/ksim/monitors/net/netconfig.h index 9ec5c8d..d8c7889 100644 --- a/ksim/monitors/net/netconfig.h +++ b/ksim/monitors/net/netconfig.h @@ -41,9 +41,9 @@ class NetConfig : public KSim::PluginPage virtual void readConfig(); private slots: - void menu(KListView *, QListViewItem *, const QPoint &); - void modifyItem(QListViewItem *); - void removeItem(QListViewItem *); + void menu(KListView *, TQListViewItem *, const TQPoint &); + void modifyItem(TQListViewItem *); + void removeItem(TQListViewItem *); void removeCurrent(); void modifyCurrent(); void showNetDialog(); @@ -51,17 +51,17 @@ class NetConfig : public KSim::PluginPage private: // Couldnt think of a better name for this :) - const QString &boolToString(bool) const; + const TQString &boolToString(bool) const; - QHBoxLayout *layout; - QPushButton *insertButton; - QPushButton *removeButton; - QPushButton *modifyButton; + TQHBoxLayout *layout; + TQPushButton *insertButton; + TQPushButton *removeButton; + TQPushButton *modifyButton; KListView *usingBox; NetDialog *netDialog; Network::List m_networkList; - QString m_yes; - QString m_no; - QPopupMenu *aboutMenu; + TQString m_yes; + TQString m_no; + TQPopupMenu *aboutMenu; }; #endif diff --git a/ksim/monitors/net/netdevices.h b/ksim/monitors/net/netdevices.h index 2a5a680..b82b77d 100644 --- a/ksim/monitors/net/netdevices.h +++ b/ksim/monitors/net/netdevices.h @@ -42,7 +42,7 @@ class NetData class Network { public: - typedef QValueList<Network> List; + typedef TQValueList<Network> List; Network() { @@ -54,12 +54,12 @@ class Network m_max = 0; } - Network( const QString & name, - const QString & format, + Network( const TQString & name, + const TQString & format, bool timer, bool commands, - const QString & cCommand, - const QString & dCommand ) + const TQString & cCommand, + const TQString & dCommand ) : m_name( name ), m_format( format ), m_timer( timer ), @@ -144,7 +144,7 @@ class Network return m_max; } - const QString & name() const + const TQString & name() const { return m_name; } @@ -154,7 +154,7 @@ class Network return m_timer; } - const QString & format() const + const TQString & format() const { return m_format; } @@ -164,18 +164,18 @@ class Network return m_commands; } - const QString & connectCommand() const + const TQString & connectCommand() const { return m_cCommand; } - const QString & disconnectCommand() const + const TQString & disconnectCommand() const { return m_dCommand; } void setDisplay( KSim::Chart * chart, KSim::LedLabel * led, - KSim::Label * label, QPopupMenu * popup ) + KSim::Label * label, TQPopupMenu * popup ) { m_chart = chart; m_led = led; @@ -201,17 +201,17 @@ class Network private: NetData m_data; NetData m_old; - QString m_name; - QString m_format; + TQString m_name; + TQString m_format; bool m_timer; bool m_commands; - QString m_cCommand; - QString m_dCommand; + TQString m_cCommand; + TQString m_dCommand; KSim::Chart * m_chart; KSim::LedLabel * m_led; KSim::Label * m_label; - QPopupMenu * m_popup; + TQPopupMenu * m_popup; int m_max; }; diff --git a/ksim/monitors/net/netdialog.cpp b/ksim/monitors/net/netdialog.cpp index fe655d4..60a5d20 100644 --- a/ksim/monitors/net/netdialog.cpp +++ b/ksim/monitors/net/netdialog.cpp @@ -20,15 +20,15 @@ #include "netdialog.h" #include "netdialog.moc" -#include <qcheckbox.h> -#include <qgroupbox.h> -#include <qlabel.h> -#include <qpushbutton.h> -#include <qtabwidget.h> -#include <qwidget.h> -#include <qlayout.h> -#include <qfile.h> -#include <qregexp.h> +#include <tqcheckbox.h> +#include <tqgroupbox.h> +#include <tqlabel.h> +#include <tqpushbutton.h> +#include <tqtabwidget.h> +#include <tqwidget.h> +#include <tqlayout.h> +#include <tqfile.h> +#include <tqregexp.h> #include <klocale.h> #include <kcombobox.h> @@ -49,29 +49,29 @@ #include <string.h> -NetDialog::NetDialog(QWidget *parent, const char *name) - : QTabDialog(parent, name, true) +NetDialog::NetDialog(TQWidget *parent, const char *name) + : TQTabDialog(parent, name, true) { m_clicked = false; setCaption(kapp->makeStdCaption(i18n("Network Interface"))); - m_generalTab = new QWidget(this); - m_generalLayout = new QGridLayout(m_generalTab); + m_generalTab = new TQWidget(this); + m_generalLayout = new TQGridLayout(m_generalTab); m_generalLayout->setSpacing(6); m_generalLayout->setMargin(11); - m_deviceLabel = new QLabel(m_generalTab); + m_deviceLabel = new TQLabel(m_generalTab); m_deviceLabel->setText(i18n("Interface:")); m_generalLayout->addMultiCellWidget(m_deviceLabel, 0, 0, 0, 0); m_deviceCombo = new KComboBox(true, m_generalTab); - m_deviceCombo->setSizePolicy(QSizePolicy(QSizePolicy::Preferred, - QSizePolicy::Fixed)); + m_deviceCombo->setSizePolicy(TQSizePolicy(TQSizePolicy::Preferred, + TQSizePolicy::Fixed)); m_deviceCombo->setFocus(); m_deviceCombo->setDuplicatesEnabled(false); m_generalLayout->addMultiCellWidget(m_deviceCombo, 0, 0, 1, 1); - QStringList output(createList()); + TQStringList output(createList()); if (output.isEmpty()) { m_deviceCombo->insertItem("ppp0"); m_deviceCombo->insertItem("eth0"); @@ -79,16 +79,16 @@ NetDialog::NetDialog(QWidget *parent, const char *name) else m_deviceCombo->insertStringList(output); - QSpacerItem *deviceSpacer = new QSpacerItem(20, 20, - QSizePolicy::Expanding, QSizePolicy::Fixed); + TQSpacerItem *deviceSpacer = new TQSpacerItem(20, 20, + TQSizePolicy::Expanding, TQSizePolicy::Fixed); m_generalLayout->addMultiCell(deviceSpacer, 0, 0, 2, 2); - m_timerBox = new QGroupBox(m_generalTab); + m_timerBox = new TQGroupBox(m_generalTab); m_timerBox->setTitle(i18n("Timer")); m_timerBox->setColumnLayout(0, Qt::Vertical); m_timerBox->layout()->setSpacing(0); m_timerBox->layout()->setMargin(0); - m_timerBoxLayout = new QVBoxLayout(m_timerBox->layout()); + m_timerBoxLayout = new TQVBoxLayout(m_timerBox->layout()); m_timerBoxLayout->setAlignment(Qt::AlignTop); m_timerBoxLayout->setSpacing(6); m_timerBoxLayout->setMargin(11); @@ -97,77 +97,77 @@ NetDialog::NetDialog(QWidget *parent, const char *name) m_timerEdit->setText("hh:mm:ss"); m_timerEdit->setEnabled(false); - m_showTimer = new QCheckBox(m_timerBox); + m_showTimer = new TQCheckBox(m_timerBox); m_showTimer->setText(i18n("Show timer")); - connect(m_showTimer, SIGNAL(toggled(bool)), - m_timerEdit, SLOT(setEnabled(bool))); + connect(m_showTimer, TQT_SIGNAL(toggled(bool)), + m_timerEdit, TQT_SLOT(setEnabled(bool))); m_timerBoxLayout->addWidget(m_showTimer); m_timerBoxLayout->addWidget(m_timerEdit); - m_hFormat = new QLabel(m_timerBox); + m_hFormat = new TQLabel(m_timerBox); m_hFormat->setText(i18n("hh - Total hours online")); m_timerBoxLayout->addWidget(m_hFormat); - m_mFormat = new QLabel(m_timerBox); + m_mFormat = new TQLabel(m_timerBox); m_mFormat->setText(i18n("mm - Total minutes online")); m_timerBoxLayout->addWidget(m_mFormat); - m_sFormat = new QLabel(m_timerBox); + m_sFormat = new TQLabel(m_timerBox); m_sFormat->setText(i18n("ss - Total seconds online")); m_timerBoxLayout->addWidget(m_sFormat); m_generalLayout->addMultiCellWidget(m_timerBox, 1, 1, 0, 2); - QSpacerItem *spacer = new QSpacerItem(20, 20, - QSizePolicy::Minimum, QSizePolicy::Expanding); + TQSpacerItem *spacer = new TQSpacerItem(20, 20, + TQSizePolicy::Minimum, TQSizePolicy::Expanding); m_generalLayout->addMultiCell(spacer, 2, 2, 0, 0); addTab(m_generalTab, i18n("General")); - m_commandTab = new QWidget(this); - m_commandLayout = new QGridLayout(m_commandTab); + m_commandTab = new TQWidget(this); + m_commandLayout = new TQGridLayout(m_commandTab); m_commandLayout->setSpacing(6); m_commandLayout->setMargin(11); - m_enableCommands = new QCheckBox(m_commandTab); + m_enableCommands = new TQCheckBox(m_commandTab); m_enableCommands->setText(i18n("Enable connect/disconnect")); m_commandLayout->addMultiCellWidget(m_enableCommands, 0, 0, 0, 2); - m_cCommand = new QLabel(m_commandTab); + m_cCommand = new TQLabel(m_commandTab); m_cCommand->setText(i18n("Connect command:")); m_commandLayout->addMultiCellWidget(m_cCommand, 1, 1, 0, 0); m_connectRequester = new KURLRequester(m_commandTab); m_connectRequester->setMinimumSize(145, 0); m_connectRequester->setEnabled(false); - connect(m_enableCommands, SIGNAL(toggled(bool)), - m_connectRequester, SLOT(setEnabled(bool))); + connect(m_enableCommands, TQT_SIGNAL(toggled(bool)), + m_connectRequester, TQT_SLOT(setEnabled(bool))); m_commandLayout->addMultiCellWidget(m_connectRequester, 1, 1, 1, 2); - m_dCommand = new QLabel(m_commandTab); + m_dCommand = new TQLabel(m_commandTab); m_dCommand->setText(i18n("Disconnect command:")); m_commandLayout->addMultiCellWidget(m_dCommand, 2, 2, 0, 0); m_disconnectRequester = new KURLRequester(m_commandTab); m_disconnectRequester->setMinimumSize(145, 0); m_disconnectRequester->setEnabled(false); - connect(m_enableCommands, SIGNAL(toggled(bool)), - m_disconnectRequester, SLOT(setEnabled(bool))); + connect(m_enableCommands, TQT_SIGNAL(toggled(bool)), + m_disconnectRequester, TQT_SLOT(setEnabled(bool))); m_commandLayout->addMultiCellWidget(m_disconnectRequester, 2, 2, 1, 2); - QSpacerItem *commandSpacer = new QSpacerItem(20, 20, - QSizePolicy::Minimum, QSizePolicy::Expanding); + TQSpacerItem *commandSpacer = new TQSpacerItem(20, 20, + TQSizePolicy::Minimum, TQSizePolicy::Expanding); m_commandLayout->addItem(commandSpacer); addTab(m_commandTab, i18n("Commands")); setOkButton(KStdGuiItem::ok().text()); setCancelButton(KStdGuiItem::cancel().text()); - connect(this, SIGNAL(applyButtonPressed()), SLOT(sendClicked())); + connect(this, TQT_SIGNAL(applyButtonPressed()), TQT_SLOT(sendClicked())); } NetDialog::~NetDialog() { } -const QString NetDialog::deviceName() const +const TQString NetDialog::deviceName() const { return m_deviceCombo->currentText(); } @@ -177,7 +177,7 @@ bool NetDialog::timer() return m_showTimer->isChecked(); } -const QString NetDialog::format() const +const TQString NetDialog::format() const { return m_timerEdit->text(); } @@ -187,17 +187,17 @@ bool NetDialog::commands() return m_enableCommands->isChecked(); } -const QString NetDialog::cCommand() const +const TQString NetDialog::cCommand() const { return m_connectRequester->url(); } -const QString NetDialog::dCommand() const +const TQString NetDialog::dCommand() const { return m_disconnectRequester->url(); } -void NetDialog::setDeviceName(const QString &text) +void NetDialog::setDeviceName(const TQString &text) { m_deviceCombo->setCurrentItem(text, true); } @@ -207,7 +207,7 @@ void NetDialog::setShowTimer(bool value) m_showTimer->setChecked(value); } -void NetDialog::setFormat(const QString &format) +void NetDialog::setFormat(const TQString &format) { m_timerEdit->setText(format); } @@ -217,12 +217,12 @@ void NetDialog::setShowCommands(bool value) m_enableCommands->setChecked(value); } -void NetDialog::setCCommand(const QString &text) +void NetDialog::setCCommand(const TQString &text) { m_connectRequester->setURL(text); } -void NetDialog::setDCommand(const QString &text) +void NetDialog::setDCommand(const TQString &text) { m_disconnectRequester->setURL(text); } @@ -233,28 +233,28 @@ void NetDialog::sendClicked() kdDebug(2003) << "ok was clicked" << endl; } -QStringList NetDialog::createList() const +TQStringList NetDialog::createList() const { #ifdef __linux__ - QFile file("/proc/net/dev"); + TQFile file("/proc/net/dev"); if (!file.open(IO_ReadOnly)) - return QStringList(); + return TQStringList(); - QStringList output; - QTextStream textStream(&file); + TQStringList output; + TQTextStream textStream(&file); while (!textStream.atEnd()) output.append(textStream.readLine()); if (output.isEmpty()) - return QStringList(); + return TQStringList(); output.pop_front(); output.pop_front(); - QStringList::Iterator it; - QStringList list; + TQStringList::Iterator it; + TQStringList list; for (it = output.begin(); it != output.end(); ++it) { - list = QStringList::split(' ', (*it)); + list = TQStringList::split(' ', (*it)); (*it) = list[0].stripWhiteSpace(); (*it).truncate((*it).find(':')); } @@ -263,7 +263,7 @@ QStringList NetDialog::createList() const #endif #ifdef __FreeBSD__ - QStringList output; + TQStringList output; int mib[] = { CTL_NET, PF_ROUTE, 0, 0, NET_RT_IFLIST, 0 }; char *buf = 0; int alloc = 0; @@ -274,19 +274,19 @@ QStringList NetDialog::createList() const char s[32]; if (sysctl(mib, 6, NULL, &needed, NULL, 0) < 0) - return QStringList(); + return TQStringList(); if (alloc < needed) { buf = new char[needed]; if (buf == NULL) - return QStringList(); + return TQStringList(); alloc = needed; } if (sysctl(mib, 6, buf, &needed, NULL, 0) < 0) - return QStringList(); + return TQStringList(); lim = buf + needed; @@ -294,7 +294,7 @@ QStringList NetDialog::createList() const while (next < lim) { ifm = (struct if_msghdr *)next; if (ifm->ifm_type != RTM_IFINFO) - return QStringList(); + return TQStringList(); next += ifm->ifm_msglen; diff --git a/ksim/monitors/net/netdialog.h b/ksim/monitors/net/netdialog.h index b6d7801..662e727 100644 --- a/ksim/monitors/net/netdialog.h +++ b/ksim/monitors/net/netdialog.h @@ -20,7 +20,7 @@ #ifndef NETDIALOG_H #define NETDIALOG_H -#include <qtabdialog.h> +#include <tqtabdialog.h> class QVBoxLayout; class QGridLayout; @@ -36,50 +36,50 @@ class NetDialog : public QTabDialog { Q_OBJECT public: - NetDialog(QWidget *parent, const char *name = 0); + NetDialog(TQWidget *parent, const char *name = 0); ~NetDialog(); - const QString deviceName() const; + const TQString deviceName() const; bool timer(); - const QString format() const; + const TQString format() const; bool commands(); - const QString cCommand() const; - const QString dCommand() const; + const TQString cCommand() const; + const TQString dCommand() const; bool okClicked() { return m_clicked; } public slots: - void setDeviceName(const QString &); + void setDeviceName(const TQString &); void setShowTimer(bool); - void setFormat(const QString &); + void setFormat(const TQString &); void setShowCommands(bool); - void setCCommand(const QString &); - void setDCommand(const QString &); + void setCCommand(const TQString &); + void setDCommand(const TQString &); private slots: void sendClicked(); private: - QStringList createList() const; + TQStringList createList() const; bool m_clicked; - QWidget *m_generalTab; - QLabel *m_deviceLabel; + TQWidget *m_generalTab; + TQLabel *m_deviceLabel; KComboBox *m_deviceCombo; - QGroupBox *m_timerBox; - QCheckBox *m_showTimer; + TQGroupBox *m_timerBox; + TQCheckBox *m_showTimer; KLineEdit *m_timerEdit; - QLabel *m_hFormat; - QLabel *m_mFormat; - QLabel *m_sFormat; - QWidget *m_commandTab; - QCheckBox *m_enableCommands; - QLabel *m_cCommand; + TQLabel *m_hFormat; + TQLabel *m_mFormat; + TQLabel *m_sFormat; + TQWidget *m_commandTab; + TQCheckBox *m_enableCommands; + TQLabel *m_cCommand; KURLRequester *m_connectRequester; - QLabel *m_dCommand; + TQLabel *m_dCommand; KURLRequester *m_disconnectRequester; - QGridLayout *m_generalLayout; - QVBoxLayout *m_timerBoxLayout; - QGridLayout *m_commandLayout; + TQGridLayout *m_generalLayout; + TQVBoxLayout *m_timerBoxLayout; + TQGridLayout *m_commandLayout; }; #endif // NETDIALOG_H diff --git a/ksim/monitors/snmp/browsedialog.cpp b/ksim/monitors/snmp/browsedialog.cpp index d196ec8..3085eca 100644 --- a/ksim/monitors/snmp/browsedialog.cpp +++ b/ksim/monitors/snmp/browsedialog.cpp @@ -19,7 +19,7 @@ #include "browsedialog.h" -#include <qlabel.h> +#include <tqlabel.h> #include <klistview.h> #include <kguiitem.h> @@ -29,7 +29,7 @@ using namespace KSim::Snmp; -BrowseDialog::BrowseDialog( const HostConfig &hostConfig, const QString ¤tOid, QWidget *parent, const char *name ) +BrowseDialog::BrowseDialog( const HostConfig &hostConfig, const TQString ¤tOid, TQWidget *parent, const char *name ) : BrowseDialogBase( parent, name ), m_host( hostConfig ) { stop->setGuiItem( KGuiItem( i18n( "&Stop" ), "stop" ) ); @@ -44,7 +44,7 @@ BrowseDialog::BrowseDialog( const HostConfig &hostConfig, const QString ¤t nextWalk(); } -QString BrowseDialog::selectedObjectIdentifier() const +TQString BrowseDialog::selectedObjectIdentifier() const { return selectedObject->text(); } @@ -66,13 +66,13 @@ void BrowseDialog::insertBrowseItem( const Walker::Result &result ) return; } - QListViewItem *i = new QListViewItem( browserContents, browserContents->lastItem(), result.identifierString, result.dataString ); + TQListViewItem *i = new TQListViewItem( browserContents, browserContents->lastItem(), result.identifierString, result.dataString ); applyFilter( i ); } void BrowseDialog::applyFilter() { - for ( QListViewItem *i = browserContents->firstChild(); + for ( TQListViewItem *i = browserContents->firstChild(); i; i = i->nextSibling() ) applyFilter( i ); } @@ -84,7 +84,7 @@ void BrowseDialog::nextWalk() if ( baseOids.isEmpty() ) return; - QString baseOidString = baseOids.pop(); + TQString baseOidString = baseOids.pop(); Identifier id = Identifier::fromString( baseOidString ); if ( id.isNull() ) return; @@ -96,10 +96,10 @@ void BrowseDialog::startWalk( const Identifier &startOid ) stopWalker(); m_walker = new Walker( m_host, startOid, this ); - connect( m_walker, SIGNAL( resultReady( const Walker::Result & ) ), - this, SLOT( insertBrowseItem( const Walker::Result & ) ) ); - connect( m_walker, SIGNAL( finished() ), - this, SLOT( nextWalk() ) ); + connect( m_walker, TQT_SIGNAL( resultReady( const Walker::Result & ) ), + this, TQT_SLOT( insertBrowseItem( const Walker::Result & ) ) ); + connect( m_walker, TQT_SIGNAL( finished() ), + this, TQT_SLOT( nextWalk() ) ); stop->setEnabled( true ); } @@ -109,10 +109,10 @@ void BrowseDialog::stopWalker() if ( !m_walker ) return; - disconnect( m_walker, SIGNAL( resultReady( const Walker::Result & ) ), - this, SLOT( insertBrowseItem( const Walker::Result & ) ) ); - disconnect( m_walker, SIGNAL( finished() ), - this, SLOT( nextWalk() ) ); + disconnect( m_walker, TQT_SIGNAL( resultReady( const Walker::Result & ) ), + this, TQT_SLOT( insertBrowseItem( const Walker::Result & ) ) ); + disconnect( m_walker, TQT_SIGNAL( finished() ), + this, TQT_SLOT( nextWalk() ) ); m_walker->deleteLater(); m_walker = 0; @@ -120,14 +120,14 @@ void BrowseDialog::stopWalker() stop->setEnabled( false ); } -void BrowseDialog::objectSelected( QListViewItem *item ) +void BrowseDialog::objectSelected( TQListViewItem *item ) { selectedObject->setText( item->text( 0 ) ); } -void BrowseDialog::applyFilter( QListViewItem *item ) +void BrowseDialog::applyFilter( TQListViewItem *item ) { - QString filterText = filter->text(); + TQString filterText = filter->text(); if ( filterText.isEmpty() ) { item->setVisible( true ); diff --git a/ksim/monitors/snmp/browsedialog.h b/ksim/monitors/snmp/browsedialog.h index cb6466a..a694881 100644 --- a/ksim/monitors/snmp/browsedialog.h +++ b/ksim/monitors/snmp/browsedialog.h @@ -28,7 +28,7 @@ #include "snmp.h" #include "walker.h" -#include <qvaluestack.h> +#include <tqvaluestack.h> namespace KSim { @@ -40,27 +40,27 @@ class BrowseDialog : public BrowseDialogBase { Q_OBJECT public: - BrowseDialog( const HostConfig &hostConfig, const QString ¤tOid, QWidget *parent, const char *name = 0 ); + BrowseDialog( const HostConfig &hostConfig, const TQString ¤tOid, TQWidget *parent, const char *name = 0 ); - QString selectedObjectIdentifier() const; + TQString selectedObjectIdentifier() const; protected: virtual void stopAllWalks(); virtual void applyFilter(); - virtual void objectSelected( QListViewItem *item ); + virtual void objectSelected( TQListViewItem *item ); private slots: void insertBrowseItem( const Walker::Result &browseResult ); void nextWalk(); private: - void applyFilter( QListViewItem *item ); + void applyFilter( TQListViewItem *item ); void startWalk( const Identifier &startOid ); void stopWalker(); HostConfig m_host; Walker *m_walker; - QValueStack<QString> baseOids; + TQValueStack<TQString> baseOids; }; } diff --git a/ksim/monitors/snmp/chartmonitor.cpp b/ksim/monitors/snmp/chartmonitor.cpp index 1a32086..a5cfc6e 100644 --- a/ksim/monitors/snmp/chartmonitor.cpp +++ b/ksim/monitors/snmp/chartmonitor.cpp @@ -22,8 +22,8 @@ using namespace KSim::Snmp; -ChartMonitor::ChartMonitor( const MonitorConfig &config, QWidget *parent, const char *name ) - : KSim::Chart( true /* displayMeter */, 0, QString::null, parent, name ), +ChartMonitor::ChartMonitor( const MonitorConfig &config, TQWidget *parent, const char *name ) + : KSim::Chart( true /* displayMeter */, 0, TQString::null, parent, name ), m_lastValue( 0 ), m_config( config ), m_firstSampleReceived( false ) { setTitle( m_config.name ); diff --git a/ksim/monitors/snmp/chartmonitor.h b/ksim/monitors/snmp/chartmonitor.h index 30a58ad..3b064f8 100644 --- a/ksim/monitors/snmp/chartmonitor.h +++ b/ksim/monitors/snmp/chartmonitor.h @@ -32,7 +32,7 @@ class ChartMonitor : public KSim::Chart { Q_OBJECT public: - ChartMonitor( const MonitorConfig &config, QWidget *parent, const char *name = 0 ); + ChartMonitor( const MonitorConfig &config, TQWidget *parent, const char *name = 0 ); public slots: void setData( const Value &data ); diff --git a/ksim/monitors/snmp/configpage.cpp b/ksim/monitors/snmp/configpage.cpp index d15d606..ee50054 100644 --- a/ksim/monitors/snmp/configpage.cpp +++ b/ksim/monitors/snmp/configpage.cpp @@ -24,9 +24,9 @@ #include "hostdialog.h" #include "monitordialog.h" -#include <qlayout.h> -#include <qgroupbox.h> -#include <qpushbutton.h> +#include <tqlayout.h> +#include <tqgroupbox.h> +#include <tqpushbutton.h> #include <kconfig.h> #include <klistview.h> @@ -35,9 +35,9 @@ using namespace KSim::Snmp; -static bool listViewHasSelection( QListView *lv ) +static bool listViewHasSelection( TQListView *lv ) { - for ( QListViewItem *i = lv->firstChild(); i; i = i->itemBelow() ) + for ( TQListViewItem *i = lv->firstChild(); i; i = i->itemBelow() ) if ( i->isSelected() ) return true; return false; @@ -46,28 +46,28 @@ static bool listViewHasSelection( QListView *lv ) ConfigPage::ConfigPage( Plugin *parent, const char *name ) : KSim::PluginPage( parent, name ) { - ( new QVBoxLayout( this ) )->setAutoAdd( true ); + ( new TQVBoxLayout( this ) )->setAutoAdd( true ); m_page = new ConfigWidget( this ); - connect( m_page->addHost, SIGNAL( clicked() ), - this, SLOT( addNewHost() ) ); - connect( m_page->modifyHost, SIGNAL( clicked() ), - this, SLOT( modifyHost() ) ); - connect( m_page->removeHost, SIGNAL( clicked() ), - this, SLOT( removeHost() ) ); - - connect( m_page->addMonitor, SIGNAL( clicked() ), - this, SLOT( addNewMonitor() ) ); - connect( m_page->modifyMonitor, SIGNAL( clicked() ), - this, SLOT( modifyMonitor() ) ); - connect( m_page->removeMonitor, SIGNAL( clicked() ), - this, SLOT( removeMonitor() ) ); - - connect( m_page->hosts, SIGNAL( selectionChanged() ), - this, SLOT( disableOrEnableSomeWidgets() ) ); - connect( m_page->monitors, SIGNAL( selectionChanged() ), - this, SLOT( disableOrEnableSomeWidgets() ) ); + connect( m_page->addHost, TQT_SIGNAL( clicked() ), + this, TQT_SLOT( addNewHost() ) ); + connect( m_page->modifyHost, TQT_SIGNAL( clicked() ), + this, TQT_SLOT( modifyHost() ) ); + connect( m_page->removeHost, TQT_SIGNAL( clicked() ), + this, TQT_SLOT( removeHost() ) ); + + connect( m_page->addMonitor, TQT_SIGNAL( clicked() ), + this, TQT_SLOT( addNewMonitor() ) ); + connect( m_page->modifyMonitor, TQT_SIGNAL( clicked() ), + this, TQT_SLOT( modifyMonitor() ) ); + connect( m_page->removeMonitor, TQT_SIGNAL( clicked() ), + this, TQT_SLOT( removeMonitor() ) ); + + connect( m_page->hosts, TQT_SIGNAL( selectionChanged() ), + this, TQT_SLOT( disableOrEnableSomeWidgets() ) ); + connect( m_page->monitors, TQT_SIGNAL( selectionChanged() ), + this, TQT_SLOT( disableOrEnableSomeWidgets() ) ); } ConfigPage::~ConfigPage() @@ -82,8 +82,8 @@ void ConfigPage::saveConfig() removeAllHostGroups(); removeAllMonitorGroups(); - QStringList hosts = m_hosts.save( cfg ); - QStringList monitors = m_monitors.save( cfg ); + TQStringList hosts = m_hosts.save( cfg ); + TQStringList monitors = m_monitors.save( cfg ); cfg.setGroup( "General" ); cfg.writeEntry( "Hosts", hosts ); @@ -95,8 +95,8 @@ void ConfigPage::readConfig() KConfig &cfg = *config(); cfg.setGroup( "General" ); - QStringList hosts = cfg.readListEntry( "Hosts" ); - QStringList monitors = cfg.readListEntry( "Monitors" ); + TQStringList hosts = cfg.readListEntry( "Hosts" ); + TQStringList monitors = cfg.readListEntry( "Monitors" ); m_hosts.load( cfg, hosts ); m_monitors.load( cfg, monitors, m_hosts ); @@ -151,7 +151,7 @@ void ConfigPage::removeHost() if ( hostIt == m_hosts.end() ) return; - QStringList monitors = monitorsForHost( *hostIt ); + TQStringList monitors = monitorsForHost( *hostIt ); if ( !monitors.isEmpty() ) { int answer = KMessageBox::warningContinueCancelList( this, @@ -237,17 +237,17 @@ void ConfigPage::disableOrEnableSomeWidgets() m_page->monitorGroup->setEnabled( !m_hosts.isEmpty() ); } -void ConfigPage::removeMonitors( QStringList monitors ) +void ConfigPage::removeMonitors( TQStringList monitors ) { - for ( QStringList::ConstIterator it = monitors.begin(); + for ( TQStringList::ConstIterator it = monitors.begin(); it != monitors.end(); ++it ) m_monitors.remove( *it ); - QListViewItem *item = m_page->monitors->firstChild(); + TQListViewItem *item = m_page->monitors->firstChild(); while ( item ) { - QListViewItem *nextItem = item->itemBelow(); + TQListViewItem *nextItem = item->itemBelow(); - for ( QStringList::Iterator it = monitors.begin(); + for ( TQStringList::Iterator it = monitors.begin(); it != monitors.end(); ++it ) if ( item->text( 0 ) == *it ) { @@ -272,12 +272,12 @@ void ConfigPage::removeAllMonitorGroups() removeConfigGroups( "Monitor " ); } -void ConfigPage::removeConfigGroups( const QString &prefix ) +void ConfigPage::removeConfigGroups( const TQString &prefix ) { KConfig &cfg = *config(); - QStringList groups = cfg.groupList(); - for ( QStringList::ConstIterator it = groups.begin(); it != groups.end(); ++it ) + TQStringList groups = cfg.groupList(); + for ( TQStringList::ConstIterator it = groups.begin(); it != groups.end(); ++it ) if ( ( *it ).startsWith( prefix ) ) cfg.deleteGroup( *it, true /* deep */ ); } @@ -296,9 +296,9 @@ void ConfigPage::fillGui() disableOrEnableSomeWidgets(); } -QStringList ConfigPage::monitorsForHost( const HostConfig &host ) const +TQStringList ConfigPage::monitorsForHost( const HostConfig &host ) const { - QStringList monitors; + TQStringList monitors; for ( MonitorConfigMap::ConstIterator it = m_monitors.begin(); it != m_monitors.end(); ++it ) diff --git a/ksim/monitors/snmp/configpage.h b/ksim/monitors/snmp/configpage.h index 42c7579..66c941c 100644 --- a/ksim/monitors/snmp/configpage.h +++ b/ksim/monitors/snmp/configpage.h @@ -35,20 +35,20 @@ namespace Snmp class HostItem : public QListViewItem { public: - HostItem( QListView *parent, const KSim::Snmp::HostConfig &src ) - : QListViewItem( parent, QString::null, QString::null, QString::null ) + HostItem( TQListView *parent, const KSim::Snmp::HostConfig &src ) + : TQListViewItem( parent, TQString::null, TQString::null, TQString::null ) { setFromHostConfig( src ); } - HostItem( QListView *parent ) - : QListViewItem( parent, QString::null, QString::null, QString::null ) + HostItem( TQListView *parent ) + : TQListViewItem( parent, TQString::null, TQString::null, TQString::null ) {} void setFromHostConfig( const KSim::Snmp::HostConfig &src ) { setText( 0, src.name ); - setText( 1, QString::number( src.port ) ); + setText( 1, TQString::number( src.port ) ); setText( 2, snmpVersionToString( src.version ) ); } }; @@ -56,14 +56,14 @@ public: class MonitorItem : public QListViewItem { public: - MonitorItem( QListView *parent, const KSim::Snmp::MonitorConfig &monitor ) - : QListViewItem( parent, QString::null, QString::null, QString::null ) + MonitorItem( TQListView *parent, const KSim::Snmp::MonitorConfig &monitor ) + : TQListViewItem( parent, TQString::null, TQString::null, TQString::null ) { setFromMonitor( monitor ); } - MonitorItem( QListView *parent ) - : QListViewItem( parent, QString::null, QString::null, QString::null ) + MonitorItem( TQListView *parent ) + : TQListViewItem( parent, TQString::null, TQString::null, TQString::null ) {} void setFromMonitor( const KSim::Snmp::MonitorConfig &monitor ) @@ -97,14 +97,14 @@ private slots: void disableOrEnableSomeWidgets(); private: - void removeMonitors( QStringList monitors ); + void removeMonitors( TQStringList monitors ); void removeAllHostGroups(); void removeAllMonitorGroups(); - void removeConfigGroups( const QString &prefix ); + void removeConfigGroups( const TQString &prefix ); void fillGui(); - QStringList monitorsForHost( const HostConfig &host ) const; + TQStringList monitorsForHost( const HostConfig &host ) const; ConfigWidget *m_page; KSim::Snmp::HostConfigMap m_hosts; diff --git a/ksim/monitors/snmp/hostconfig.cpp b/ksim/monitors/snmp/hostconfig.cpp index 1b96541..1188c12 100644 --- a/ksim/monitors/snmp/hostconfig.cpp +++ b/ksim/monitors/snmp/hostconfig.cpp @@ -109,7 +109,7 @@ void HostConfig::save( KConfigBase &config ) const writeIfNotEmpty( config, "PrivPassphrase", KStringHandler::obscure( privacy.key ) ); } -void HostConfig::writeIfNotEmpty( KConfigBase &config, const QString &name, const QString &value ) +void HostConfig::writeIfNotEmpty( KConfigBase &config, const TQString &name, const TQString &value ) { if ( value.isEmpty() ) return; @@ -117,11 +117,11 @@ void HostConfig::writeIfNotEmpty( KConfigBase &config, const QString &name, cons config.writeEntry( name, value ); } -void HostConfigMap::load( KConfigBase &config, const QStringList &hosts ) +void HostConfigMap::load( KConfigBase &config, const TQStringList &hosts ) { clear(); - for ( QStringList::ConstIterator it = hosts.begin(); it != hosts.end(); ++it ) { + for ( TQStringList::ConstIterator it = hosts.begin(); it != hosts.end(); ++it ) { config.setGroup( "Host " + *it ); HostConfig src; @@ -132,12 +132,12 @@ void HostConfigMap::load( KConfigBase &config, const QStringList &hosts ) } } -QStringList HostConfigMap::save( KConfigBase &config ) const +TQStringList HostConfigMap::save( KConfigBase &config ) const { - QStringList hostList; + TQStringList hostList; for ( ConstIterator it = begin(); it != end(); ++it ) { - QString host = it.key(); + TQString host = it.key(); hostList << host; diff --git a/ksim/monitors/snmp/hostconfig.h b/ksim/monitors/snmp/hostconfig.h index d19de9b..af8a0fd 100644 --- a/ksim/monitors/snmp/hostconfig.h +++ b/ksim/monitors/snmp/hostconfig.h @@ -34,26 +34,26 @@ struct HostConfig HostConfig( KConfigBase &config ) { load( config ); } - QString name; // hostname + TQString name; // hostname ushort port; SnmpVersion version; - QString community; + TQString community; - QString securityName; + TQString securityName; SecurityLevel securityLevel; struct { AuthenticationProtocol protocol; - QString key; + TQString key; } authentication; struct { PrivacyProtocol protocol; - QString key; + TQString key; } privacy; bool load( KConfigBase &config ); @@ -65,17 +65,17 @@ struct HostConfig { return name == rhs.name; } private: - static void writeIfNotEmpty( KConfigBase &config, const QString &name, const QString &value ); + static void writeIfNotEmpty( KConfigBase &config, const TQString &name, const TQString &value ); }; -struct HostConfigMap : public QMap< QString, HostConfig > +struct HostConfigMap : public TQMap< TQString, HostConfig > { HostConfigMap() {} - HostConfigMap( const QMap< QString, HostConfig > &rhs ) - : QMap< QString, HostConfig >( rhs ) {} + HostConfigMap( const TQMap< TQString, HostConfig > &rhs ) + : TQMap< TQString, HostConfig >( rhs ) {} - void load( KConfigBase &config, const QStringList &hosts ); - QStringList save( KConfigBase &config ) const; + void load( KConfigBase &config, const TQStringList &hosts ); + TQStringList save( KConfigBase &config ) const; }; } diff --git a/ksim/monitors/snmp/hostdialog.cpp b/ksim/monitors/snmp/hostdialog.cpp index a1ccdc3..7d66a75 100644 --- a/ksim/monitors/snmp/hostdialog.cpp +++ b/ksim/monitors/snmp/hostdialog.cpp @@ -21,12 +21,12 @@ #include "probedialog.h" #include "proberesultdialog.h" -#include <qcombobox.h> -#include <qwidgetstack.h> +#include <tqcombobox.h> +#include <tqwidgetstack.h> #include <klineedit.h> -#include <qlabel.h> -#include <qpushbutton.h> -#include <qspinbox.h> +#include <tqlabel.h> +#include <tqpushbutton.h> +#include <tqspinbox.h> #include <klocale.h> #include <kmessagebox.h> @@ -35,14 +35,14 @@ using namespace KSim::Snmp; -HostDialog::HostDialog( QWidget *parent, const char *name ) +HostDialog::HostDialog( TQWidget *parent, const char *name ) : HostDialogBase( parent, name ) { init(); port->setValue( 161 ); } -HostDialog::HostDialog( const HostConfig &src, QWidget *parent, const char *name ) +HostDialog::HostDialog( const HostConfig &src, TQWidget *parent, const char *name ) : HostDialogBase( parent, name ) { init( src ); @@ -79,7 +79,7 @@ HostConfig HostDialog::settings() const return result; } -void HostDialog::showSnmpAuthenticationDetailsForVersion( const QString &versionStr ) +void HostDialog::showSnmpAuthenticationDetailsForVersion( const TQString &versionStr ) { bool ok = false; SnmpVersion version = stringToSnmpVersion( versionStr, &ok ); @@ -88,7 +88,7 @@ void HostDialog::showSnmpAuthenticationDetailsForVersion( const QString &version authenticationDetails->raiseWidget( version == SnmpVersion3 ? snmpV3Page : snmpV1Page ); } -void HostDialog::enableDisabledAuthenticationAndPrivacyElementsForSecurityLevel( const QString &levelStr ) +void HostDialog::enableDisabledAuthenticationAndPrivacyElementsForSecurityLevel( const TQString &levelStr ) { bool ok = false; SecurityLevel level = stringToSecurityLevel( levelStr, &ok ); diff --git a/ksim/monitors/snmp/hostdialog.h b/ksim/monitors/snmp/hostdialog.h index e296b7b..68ddfe1 100644 --- a/ksim/monitors/snmp/hostdialog.h +++ b/ksim/monitors/snmp/hostdialog.h @@ -34,14 +34,14 @@ class HostDialog : public HostDialogBase { Q_OBJECT public: - HostDialog( QWidget *parent, const char *name = 0 ); - HostDialog( const HostConfig &src, QWidget *parent, const char *name = 0 ); + HostDialog( TQWidget *parent, const char *name = 0 ); + HostDialog( const HostConfig &src, TQWidget *parent, const char *name = 0 ); HostConfig settings() const; private slots: - void showSnmpAuthenticationDetailsForVersion( const QString &versionStr ); - void enableDisabledAuthenticationAndPrivacyElementsForSecurityLevel( const QString &levelStr ); + void showSnmpAuthenticationDetailsForVersion( const TQString &versionStr ); + void enableDisabledAuthenticationAndPrivacyElementsForSecurityLevel( const TQString &levelStr ); void checkValidity(); void testHost(); diff --git a/ksim/monitors/snmp/identifier.cpp b/ksim/monitors/snmp/identifier.cpp index 25c188e..32d6d8b 100644 --- a/ksim/monitors/snmp/identifier.cpp +++ b/ksim/monitors/snmp/identifier.cpp @@ -62,7 +62,7 @@ Identifier::~Identifier() delete d; } -Identifier Identifier::fromString( const QString &name, bool *ok ) +Identifier Identifier::fromString( const TQString &name, bool *ok ) { Identifier res; res.d->length = MAX_OID_LEN; @@ -79,7 +79,7 @@ Identifier Identifier::fromString( const QString &name, bool *ok ) return res; } -QString Identifier::toString( PrintFlags flags ) const +TQString Identifier::toString( PrintFlags flags ) const { size_t buflen = 256; size_t outlen = 0; @@ -87,7 +87,7 @@ QString Identifier::toString( PrintFlags flags ) const u_char *buf = ( u_char* )calloc( buflen, 1 ); if ( !buf ) - return QString::null; + return TQString::null; int oldOutpuFormat = SnmpLib::self()->netsnmp_ds_get_int( NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_OID_OUTPUT_FORMAT ); SnmpLib::self()->netsnmp_ds_set_int( NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_OID_OUTPUT_FORMAT, @@ -100,10 +100,10 @@ QString Identifier::toString( PrintFlags flags ) const if ( overflow ) { free( buf ); - return QString::null; + return TQString::null; } - QString result = QString::fromAscii( ( char* )buf ); + TQString result = TQString::fromAscii( ( char* )buf ); free( buf ); diff --git a/ksim/monitors/snmp/identifier.h b/ksim/monitors/snmp/identifier.h index 7da54dd..e14e58a 100644 --- a/ksim/monitors/snmp/identifier.h +++ b/ksim/monitors/snmp/identifier.h @@ -20,9 +20,9 @@ #ifndef IDENTIFIER_H #define IDENTIFIER_H -#include <qstring.h> -#include <qvaluelist.h> -#include <qmap.h> +#include <tqstring.h> +#include <tqvaluelist.h> +#include <tqmap.h> #include "value.h" @@ -46,9 +46,9 @@ public: Identifier &operator=( const Identifier &rhs ); ~Identifier(); - static Identifier fromString( const QString &name, bool *ok = 0 ); + static Identifier fromString( const TQString &name, bool *ok = 0 ); - QString toString( PrintFlags flags = PrintAscii ) const; + TQString toString( PrintFlags flags = PrintAscii ) const; bool isNull() const; @@ -61,8 +61,8 @@ private: Data *d; }; -typedef QValueList<Identifier> IdentifierList; -typedef QMap<Identifier, Value> ValueMap; +typedef TQValueList<Identifier> IdentifierList; +typedef TQMap<Identifier, Value> ValueMap; } } diff --git a/ksim/monitors/snmp/labelmonitor.cpp b/ksim/monitors/snmp/labelmonitor.cpp index 24e48c7..2245a09 100644 --- a/ksim/monitors/snmp/labelmonitor.cpp +++ b/ksim/monitors/snmp/labelmonitor.cpp @@ -21,17 +21,17 @@ using namespace KSim::Snmp; -LabelMonitor::LabelMonitor( const MonitorConfig &config, QWidget *parent, const char *name ) +LabelMonitor::LabelMonitor( const MonitorConfig &config, TQWidget *parent, const char *name ) : KSim::Label( parent, name ), m_config( config ) { } void LabelMonitor::setData( const Value &data ) { - QString dataString = data.toString( m_config.refreshInterval.minutes == 0 ? Value::TimeTicksWithSeconds : 0 ); + TQString dataString = data.toString( m_config.refreshInterval.minutes == 0 ? Value::TimeTicksWithSeconds : 0 ); if ( m_config.useCustomFormatString ) { - QString text = m_config.customFormatString; + TQString text = m_config.customFormatString; text.replace( "%n", m_config.name ); text.replace( "%s", dataString ); setText( text ); diff --git a/ksim/monitors/snmp/labelmonitor.h b/ksim/monitors/snmp/labelmonitor.h index 3e92c69..606165b 100644 --- a/ksim/monitors/snmp/labelmonitor.h +++ b/ksim/monitors/snmp/labelmonitor.h @@ -34,7 +34,7 @@ class LabelMonitor : public KSim::Label { Q_OBJECT public: - LabelMonitor( const MonitorConfig &config, QWidget *parent, const char *name = 0 ); + LabelMonitor( const MonitorConfig &config, TQWidget *parent, const char *name = 0 ); public slots: void setData( const Value &data ); diff --git a/ksim/monitors/snmp/monitor.cpp b/ksim/monitors/snmp/monitor.cpp index 7a97825..052d2c0 100644 --- a/ksim/monitors/snmp/monitor.cpp +++ b/ksim/monitors/snmp/monitor.cpp @@ -19,26 +19,26 @@ #include "monitor.h" -#include <qtimer.h> -#include <qapplication.h> +#include <tqtimer.h> +#include <tqapplication.h> using namespace KSim::Snmp; -Monitor::Monitor( const HostConfig &host, const Identifier &oid, int refresh, QObject *parent, const char *name ) - : QObject( parent, name ), m_oid( oid ), m_session( host ) +Monitor::Monitor( const HostConfig &host, const Identifier &oid, int refresh, TQObject *parent, const char *name ) + : TQObject( parent, name ), m_oid( oid ), m_session( host ) { if ( refresh > 0 ) m_timerId = startTimer( refresh ); else m_timerId = -1; - QTimer::singleShot( 0, this, SLOT( performSnmpRequest() ) ); + TQTimer::singleShot( 0, this, TQT_SLOT( performSnmpRequest() ) ); } Monitor::~Monitor() { - if ( QThread::running() ) - QThread::wait(); + if ( TQThread::running() ) + TQThread::wait(); } void Monitor::run() @@ -48,13 +48,13 @@ void Monitor::run() result->oid = m_oid; result->success = performSyncSnmpRequest( result->data, &result->error ); - QCustomEvent *ev = new QCustomEvent( QEvent::User, result ); - QApplication::postEvent( this, ev ); + TQCustomEvent *ev = new TQCustomEvent( TQEvent::User, result ); + TQApplication::postEvent( this, ev ); } -void Monitor::customEvent( QCustomEvent *ev ) +void Monitor::customEvent( TQCustomEvent *ev ) { - if ( ev->type() != QEvent::User ) + if ( ev->type() != TQEvent::User ) return; AsyncSnmpQueryResult *result = reinterpret_cast<AsyncSnmpQueryResult *>( ev->data() ); @@ -69,7 +69,7 @@ void Monitor::customEvent( QCustomEvent *ev ) delete result; } -void Monitor::timerEvent( QTimerEvent *ev ) +void Monitor::timerEvent( TQTimerEvent *ev ) { if ( ev->timerId() != m_timerId ) return; @@ -79,7 +79,7 @@ void Monitor::timerEvent( QTimerEvent *ev ) void Monitor::performSnmpRequest() { - if ( QThread::running() ) + if ( TQThread::running() ) return; start(); diff --git a/ksim/monitors/snmp/monitor.h b/ksim/monitors/snmp/monitor.h index cd3dedc..083e97f 100644 --- a/ksim/monitors/snmp/monitor.h +++ b/ksim/monitors/snmp/monitor.h @@ -23,7 +23,7 @@ #include "monitorconfig.h" #include "session.h" -#include <qthread.h> +#include <tqthread.h> namespace KSim { @@ -31,11 +31,11 @@ namespace KSim namespace Snmp { -class Monitor : public QObject, public QThread +class Monitor : public TQObject, public QThread { Q_OBJECT public: - Monitor( const HostConfig &host, const Identifier &oid, int refresh, QObject *parent = 0, const char *name = 0 ); + Monitor( const HostConfig &host, const Identifier &oid, int refresh, TQObject *parent = 0, const char *name = 0 ); virtual ~Monitor(); signals: @@ -46,8 +46,8 @@ signals: protected: virtual void run(); - virtual void customEvent( QCustomEvent *ev ); - virtual void timerEvent( QTimerEvent *ev ); + virtual void customEvent( TQCustomEvent *ev ); + virtual void timerEvent( TQTimerEvent *ev ); private slots: void performSnmpRequest(); diff --git a/ksim/monitors/snmp/monitorconfig.cpp b/ksim/monitors/snmp/monitorconfig.cpp index 6b3b27e..4b4b024 100644 --- a/ksim/monitors/snmp/monitorconfig.cpp +++ b/ksim/monitors/snmp/monitorconfig.cpp @@ -35,7 +35,7 @@ MonitorConfig::MonitorConfig() bool MonitorConfig::load( KConfigBase &config, const HostConfigMap &hosts ) { - QString hostName = config.readEntry( "Host" ); + TQString hostName = config.readEntry( "Host" ); if ( hostName.isEmpty() ) return false; @@ -93,9 +93,9 @@ void MonitorConfig::save( KConfigBase &config ) const config.writeEntry( "DisplayCurrentValueInline", displayCurrentValueInline ); } -QWidget *MonitorConfig::createMonitorWidget( QWidget *parent, const char *name ) +TQWidget *MonitorConfig::createMonitorWidget( TQWidget *parent, const char *name ) { - QWidget *w; + TQWidget *w; int refresh = refreshInterval.seconds * 1000 + refreshInterval.minutes * 60 * 1000; Identifier id = Identifier::fromString( oid ); @@ -108,23 +108,23 @@ QWidget *MonitorConfig::createMonitorWidget( QWidget *parent, const char *name ) w = new ChartMonitor( *this, parent, name ); Monitor *monitor = new Monitor( host, id, refresh, w ); - QObject::connect( monitor, SIGNAL( newData( const Value & ) ), - w, SLOT( setData( const Value & ) ) ); + TQObject::connect( monitor, TQT_SIGNAL( newData( const Value & ) ), + w, TQT_SLOT( setData( const Value & ) ) ); return w; } -QString KSim::Snmp::monitorDisplayTypeToString( MonitorConfig::DisplayType type ) +TQString KSim::Snmp::monitorDisplayTypeToString( MonitorConfig::DisplayType type ) { switch ( type ) { - case MonitorConfig::Label: return QString::fromLatin1( "Label" ); - case MonitorConfig::Chart: return QString::fromLatin1( "Chart" ); + case MonitorConfig::Label: return TQString::fromLatin1( "Label" ); + case MonitorConfig::Chart: return TQString::fromLatin1( "Chart" ); default: assert( false ); }; - return QString::null; + return TQString::null; } -MonitorConfig::DisplayType KSim::Snmp::stringToMonitorDisplayType( QString string, bool *ok ) +MonitorConfig::DisplayType KSim::Snmp::stringToMonitorDisplayType( TQString string, bool *ok ) { string = string.lower(); if ( string == "chart" ) { @@ -142,17 +142,17 @@ MonitorConfig::DisplayType KSim::Snmp::stringToMonitorDisplayType( QString strin return MonitorConfig::Chart; } -QStringList KSim::Snmp::allDisplayTypes() +TQStringList KSim::Snmp::allDisplayTypes() { // !!! keep order with enum - return QStringList() << "Label" << "Chart"; + return TQStringList() << "Label" << "Chart"; } -void MonitorConfigMap::load( KConfigBase &config, const QStringList &names, const HostConfigMap &hosts ) +void MonitorConfigMap::load( KConfigBase &config, const TQStringList &names, const HostConfigMap &hosts ) { clear(); - for ( QStringList::ConstIterator it = names.begin(); it != names.end(); ++it ) { + for ( TQStringList::ConstIterator it = names.begin(); it != names.end(); ++it ) { config.setGroup( "Monitor " + *it ); MonitorConfig monitor; @@ -163,12 +163,12 @@ void MonitorConfigMap::load( KConfigBase &config, const QStringList &names, cons } } -QStringList MonitorConfigMap::save( KConfigBase &config ) const +TQStringList MonitorConfigMap::save( KConfigBase &config ) const { - QStringList names; + TQStringList names; for ( ConstIterator it = begin(); it != end(); ++it ) { - QString name = it.key(); + TQString name = it.key(); names << name; diff --git a/ksim/monitors/snmp/monitorconfig.h b/ksim/monitors/snmp/monitorconfig.h index bbc8674..cf2d525 100644 --- a/ksim/monitors/snmp/monitorconfig.h +++ b/ksim/monitors/snmp/monitorconfig.h @@ -41,11 +41,11 @@ struct MonitorConfig bool isNull() const { return name.isEmpty() || host.isNull(); } - QWidget *createMonitorWidget( QWidget *parent, const char *name = 0 ); + TQWidget *createMonitorWidget( TQWidget *parent, const char *name = 0 ); HostConfig host; - QString name; - QString oid; + TQString name; + TQString oid; struct { uint minutes; @@ -54,26 +54,26 @@ struct MonitorConfig DisplayType display; bool useCustomFormatString; - QString customFormatString; + TQString customFormatString; bool displayCurrentValueInline; }; -struct MonitorConfigMap : public QMap< QString, MonitorConfig > +struct MonitorConfigMap : public TQMap< TQString, MonitorConfig > { MonitorConfigMap() {} - MonitorConfigMap( const QMap< QString, MonitorConfig > &rhs ) - : QMap< QString, MonitorConfig >( rhs ) {} + MonitorConfigMap( const TQMap< TQString, MonitorConfig > &rhs ) + : TQMap< TQString, MonitorConfig >( rhs ) {} - void load( KConfigBase &config, const QStringList &names, const HostConfigMap &hosts ); - QStringList save( KConfigBase &config ) const; + void load( KConfigBase &config, const TQStringList &names, const HostConfigMap &hosts ); + TQStringList save( KConfigBase &config ) const; }; -typedef QValueList<MonitorConfig> MonitorConfigList; +typedef TQValueList<MonitorConfig> MonitorConfigList; -QString monitorDisplayTypeToString( MonitorConfig::DisplayType type ); -MonitorConfig::DisplayType stringToMonitorDisplayType( QString string, bool *ok = 0 ); -QStringList allDisplayTypes(); +TQString monitorDisplayTypeToString( MonitorConfig::DisplayType type ); +MonitorConfig::DisplayType stringToMonitorDisplayType( TQString string, bool *ok = 0 ); +TQStringList allDisplayTypes(); } diff --git a/ksim/monitors/snmp/monitordialog.cpp b/ksim/monitors/snmp/monitordialog.cpp index 615a1aa..1bda0aa 100644 --- a/ksim/monitors/snmp/monitordialog.cpp +++ b/ksim/monitors/snmp/monitordialog.cpp @@ -21,14 +21,14 @@ #include "identifier.h" #include "browsedialog.h" -#include <qcombobox.h> -#include <qlineedit.h> -#include <qspinbox.h> -#include <qpushbutton.h> -#include <qradiobutton.h> -#include <qbuttongroup.h> -#include <qcheckbox.h> -#include <qlabel.h> +#include <tqcombobox.h> +#include <tqlineedit.h> +#include <tqspinbox.h> +#include <tqpushbutton.h> +#include <tqradiobutton.h> +#include <tqbuttongroup.h> +#include <tqcheckbox.h> +#include <tqlabel.h> #include <klocale.h> #include <kpushbutton.h> @@ -37,13 +37,13 @@ using namespace KSim::Snmp; -MonitorDialog::MonitorDialog( const HostConfigMap &hosts, QWidget *parent, const char *name ) +MonitorDialog::MonitorDialog( const HostConfigMap &hosts, TQWidget *parent, const char *name ) : MonitorDialogBase( parent, name ), m_hosts( hosts ) { init(); } -MonitorDialog::MonitorDialog( const MonitorConfig &monitor, const HostConfigMap &hosts, QWidget *parent, const char *name ) +MonitorDialog::MonitorDialog( const MonitorConfig &monitor, const HostConfigMap &hosts, TQWidget *parent, const char *name ) : MonitorDialogBase( parent, name ), m_hosts( hosts ) { init( monitor ); @@ -86,7 +86,7 @@ void MonitorDialog::checkValues() labelOptions->setEnabled( currentDisplayTypeIsLabel ); chartOptions->setEnabled( !currentDisplayTypeIsLabel ); - QString statusText; + TQString statusText; if ( monitorName->text().isEmpty() ) statusText = i18n( "Please enter a name for this monitor" ); @@ -126,7 +126,7 @@ void MonitorDialog::init( const MonitorConfig &monitor ) host->clear(); - QStringList allHosts; + TQStringList allHosts; for ( HostConfigMap::ConstIterator it = m_hosts.begin(); it != m_hosts.end(); ++it ) allHosts << it.key(); diff --git a/ksim/monitors/snmp/monitordialog.h b/ksim/monitors/snmp/monitordialog.h index 0f22d33..b6d0b40 100644 --- a/ksim/monitors/snmp/monitordialog.h +++ b/ksim/monitors/snmp/monitordialog.h @@ -33,8 +33,8 @@ class MonitorDialog : public MonitorDialogBase { Q_OBJECT public: - MonitorDialog( const HostConfigMap &hosts, QWidget *parent, const char *name = 0 ); - MonitorDialog( const MonitorConfig &monitor, const HostConfigMap &hosts, QWidget *parent, const char *name = 0 ); + MonitorDialog( const HostConfigMap &hosts, TQWidget *parent, const char *name = 0 ); + MonitorDialog( const MonitorConfig &monitor, const HostConfigMap &hosts, TQWidget *parent, const char *name = 0 ); MonitorConfig monitorConfig() const; diff --git a/ksim/monitors/snmp/probedialog.cpp b/ksim/monitors/snmp/probedialog.cpp index d45db6b..4667fc3 100644 --- a/ksim/monitors/snmp/probedialog.cpp +++ b/ksim/monitors/snmp/probedialog.cpp @@ -20,7 +20,7 @@ #include "probedialog.h" #include "monitor.h" -#include <qtimer.h> +#include <tqtimer.h> #include <klocale.h> #include <kdebug.h> @@ -38,8 +38,8 @@ static const char * const probeIdentifiers[] = 0 }; -ProbeDialog::ProbeDialog( const HostConfig &hostConfig, QWidget *parent, const char *name ) - : KProgressDialog( parent, name, i18n( "SNMP Host Probe" ), QString::null, true /* modal */ ), +ProbeDialog::ProbeDialog( const HostConfig &hostConfig, TQWidget *parent, const char *name ) + : KProgressDialog( parent, name, i18n( "SNMP Host Probe" ), TQString::null, true /* modal */ ), m_host( hostConfig ), m_currentMonitor( 0 ), m_canceled( false ) { setLabel( i18n( "Probing for common object identifiers..." ) ); @@ -59,7 +59,7 @@ ProbeDialog::ProbeDialog( const HostConfig &hostConfig, QWidget *parent, const c void ProbeDialog::done( int code ) { - if ( code == QDialog::Rejected && m_currentMonitor ) { + if ( code == TQDialog::Rejected && m_currentMonitor ) { setLabel( "Probe aborted. Waiting for job to finish..." ); m_canceled = true; return; @@ -79,10 +79,10 @@ void ProbeDialog::probeOne() delete m_currentMonitor; m_currentMonitor = new Monitor( m_host, oid, 0 /* no refresh */, this ); - connect( m_currentMonitor, SIGNAL( newData( const Identifier &, const Value & ) ), - this, SLOT( probeResult( const Identifier &, const Value & ) ) ); - connect( m_currentMonitor, SIGNAL( error( const Identifier &, const ErrorInfo & ) ), - this, SLOT( probeError( const Identifier &, const ErrorInfo & ) ) ); + connect( m_currentMonitor, TQT_SIGNAL( newData( const Identifier &, const Value & ) ), + this, TQT_SLOT( probeResult( const Identifier &, const Value & ) ) ); + connect( m_currentMonitor, TQT_SIGNAL( error( const Identifier &, const ErrorInfo & ) ), + this, TQT_SLOT( probeError( const Identifier &, const ErrorInfo & ) ) ); } void ProbeDialog::probeResult( const Identifier &oid, const Value &value ) @@ -106,9 +106,9 @@ void ProbeDialog::nextProbe() progressBar()->setProgress( progressBar()->totalSteps() - m_probeOIDs.count() ); if ( m_canceled ) - KProgressDialog::done( QDialog::Rejected ); + KProgressDialog::done( TQDialog::Rejected ); else - QTimer::singleShot( 0, this, SLOT( probeOne() ) ); + TQTimer::singleShot( 0, this, TQT_SLOT( probeOne() ) ); } #include "probedialog.moc" diff --git a/ksim/monitors/snmp/probedialog.h b/ksim/monitors/snmp/probedialog.h index 47a5fb0..9e88eda 100644 --- a/ksim/monitors/snmp/probedialog.h +++ b/ksim/monitors/snmp/probedialog.h @@ -20,7 +20,7 @@ #ifndef PROBEDIALOG_H #define PROBEDIALOG_H -#include <qvaluestack.h> +#include <tqvaluestack.h> #include <kprogress.h> @@ -39,7 +39,7 @@ class ProbeDialog : public KProgressDialog { Q_OBJECT public: - ProbeDialog( const HostConfig &hostConfig, QWidget *parent, const char *name = 0 ); + ProbeDialog( const HostConfig &hostConfig, TQWidget *parent, const char *name = 0 ); struct ProbeResult { @@ -56,7 +56,7 @@ public: bool success; ErrorInfo errorInfo; }; - typedef QValueList<ProbeResult> ProbeResultList; + typedef TQValueList<ProbeResult> ProbeResultList; ProbeResultList probeResults() const { return m_results; } @@ -72,7 +72,7 @@ private: void nextProbe(); HostConfig m_host; - QValueStack<Identifier> m_probeOIDs; + TQValueStack<Identifier> m_probeOIDs; Monitor *m_currentMonitor; ProbeResultList m_results; diff --git a/ksim/monitors/snmp/proberesultdialog.cpp b/ksim/monitors/snmp/proberesultdialog.cpp index 641f12e..bed1e21 100644 --- a/ksim/monitors/snmp/proberesultdialog.cpp +++ b/ksim/monitors/snmp/proberesultdialog.cpp @@ -19,7 +19,7 @@ #include "proberesultdialog.h" -#include <qlabel.h> +#include <tqlabel.h> #include <klocale.h> #include <klistview.h> @@ -27,7 +27,7 @@ using namespace KSim::Snmp; ProbeResultDialog::ProbeResultDialog( const HostConfig &hostConfig, const ProbeDialog::ProbeResultList &probeResults, - QWidget *parent, const char *name ) + TQWidget *parent, const char *name ) : ProbeResultDialogBase( parent, name ) { info->setText( i18n( "Results of scanning host %1:" ).arg( hostConfig.name ) ); @@ -39,14 +39,14 @@ ProbeResultDialog::ProbeResultDialog( const HostConfig &hostConfig, const ProbeD void ProbeResultDialog::addResultItem( const ProbeDialog::ProbeResult &result ) { - QListViewItem *item = new QListViewItem( probeResultView ); + TQListViewItem *item = new TQListViewItem( probeResultView ); item->setText( 0, result.oid.toString() ); if ( result.success ) item->setText( 1, result.value.toString( Value::TimeTicksWithSeconds ) ); else - item->setText( 1, QString( "ERROR: " ) + result.errorInfo.errorMessage() ); + item->setText( 1, TQString( "ERROR: " ) + result.errorInfo.errorMessage() ); } #include "proberesultdialog.moc" diff --git a/ksim/monitors/snmp/proberesultdialog.h b/ksim/monitors/snmp/proberesultdialog.h index 9ba3523..2166a69 100644 --- a/ksim/monitors/snmp/proberesultdialog.h +++ b/ksim/monitors/snmp/proberesultdialog.h @@ -35,7 +35,7 @@ class ProbeResultDialog : public ProbeResultDialogBase Q_OBJECT public: ProbeResultDialog( const HostConfig &hostConfig, const ProbeDialog::ProbeResultList &probeResults, - QWidget *parent, const char *name = 0 ); + TQWidget *parent, const char *name = 0 ); private: void addResultItem( const ProbeDialog::ProbeResult &result ); diff --git a/ksim/monitors/snmp/session.cpp b/ksim/monitors/snmp/session.cpp index d7de283..6d63fab 100644 --- a/ksim/monitors/snmp/session.cpp +++ b/ksim/monitors/snmp/session.cpp @@ -40,11 +40,11 @@ struct Session::Data HostConfig source; - QCString host; - QCString community; - QCString securityName; - QCString authPassPhrase; - QCString privPassPhrase; + TQCString host; + TQCString community; + TQCString securityName; + TQCString authPassPhrase; + TQCString privPassPhrase; }; Session::Session( const HostConfig &source ) @@ -212,7 +212,7 @@ bool Session::initialize( ErrorInfo *error ) return true; } -bool Session::snmpGet( const QString &identifier, Value &value, ErrorInfo *error ) +bool Session::snmpGet( const TQString &identifier, Value &value, ErrorInfo *error ) { bool ok = false; Identifier oid = Identifier::fromString( identifier, &ok ); diff --git a/ksim/monitors/snmp/session.h b/ksim/monitors/snmp/session.h index 0d5cda3..b34bc68 100644 --- a/ksim/monitors/snmp/session.h +++ b/ksim/monitors/snmp/session.h @@ -38,7 +38,7 @@ public: Session( const HostConfig &snmpHostConfig ); ~Session(); - bool snmpGet( const QString &identifier, Value &value, ErrorInfo *error = 0 ); + bool snmpGet( const TQString &identifier, Value &value, ErrorInfo *error = 0 ); bool snmpGet( const Identifier &identifier, Value &value, ErrorInfo *error = 0 ); bool snmpGet( const IdentifierList &identifiers, ValueMap &variables, ErrorInfo *error = 0 ); diff --git a/ksim/monitors/snmp/snmp.cpp b/ksim/monitors/snmp/snmp.cpp index 80fb073..a050acb 100644 --- a/ksim/monitors/snmp/snmp.cpp +++ b/ksim/monitors/snmp/snmp.cpp @@ -23,7 +23,7 @@ #include "snmplib.h" #include "value_p.h" -#include <qmutex.h> +#include <tqmutex.h> #include <assert.h> @@ -53,30 +53,30 @@ static const struct EnumStringMapInfo { 0, 0, 0 } }; -static QStringList allStrings( const EnumStringMapInfo *array ) +static TQStringList allStrings( const EnumStringMapInfo *array ) { - QStringList result; + TQStringList result; for ( uint i = 0; array[ i ].stringValue; ++i ) - result << QString::fromLatin1( array[ i ].stringValue ); + result << TQString::fromLatin1( array[ i ].stringValue ); return result; } -static QString enumToString( const EnumStringMapInfo *array, int value ) +static TQString enumToString( const EnumStringMapInfo *array, int value ) { for ( uint i = 0; array[ i ].stringValue; ++i ) if ( array[ i ].enumValue == value ) - return QString::fromLatin1( array[ i ].stringValue ); + return TQString::fromLatin1( array[ i ].stringValue ); assert( false ); - return QString::null; + return TQString::null; } -static int stringToEnum( const EnumStringMapInfo *array, QString string, bool *ok ) +static int stringToEnum( const EnumStringMapInfo *array, TQString string, bool *ok ) { string = string.lower(); uint i; for ( i = 0; array[ i ].stringValue; ++i ) - if ( QString::fromLatin1( array[ i ].stringValue ).lower() == string ) { + if ( TQString::fromLatin1( array[ i ].stringValue ).lower() == string ) { if ( ok ) *ok = true; return array[ i ].enumValue; } @@ -108,62 +108,62 @@ int KSim::Snmp::snmpSecurityLevelToSnmpLibConstant( SecurityLevel secLevel ) return extractSnmpLibConstant( securityLevelStrings, secLevel ); } -QStringList KSim::Snmp::allSnmpVersions() +TQStringList KSim::Snmp::allSnmpVersions() { return allStrings( snmpVersionStrings ); } -QString KSim::Snmp::snmpVersionToString( SnmpVersion version ) +TQString KSim::Snmp::snmpVersionToString( SnmpVersion version ) { return enumToString( snmpVersionStrings, version ); } -SnmpVersion KSim::Snmp::stringToSnmpVersion( QString string, bool *ok ) +SnmpVersion KSim::Snmp::stringToSnmpVersion( TQString string, bool *ok ) { return static_cast<SnmpVersion>( stringToEnum( snmpVersionStrings, string, ok ) ); } -QStringList KSim::Snmp::allSecurityLevels() +TQStringList KSim::Snmp::allSecurityLevels() { return allStrings( securityLevelStrings ); } -QString KSim::Snmp::securityLevelToString( SecurityLevel level ) +TQString KSim::Snmp::securityLevelToString( SecurityLevel level ) { return enumToString( securityLevelStrings, level ); } -SecurityLevel KSim::Snmp::stringToSecurityLevel( QString string, bool *ok ) +SecurityLevel KSim::Snmp::stringToSecurityLevel( TQString string, bool *ok ) { return static_cast<SecurityLevel>( stringToEnum( securityLevelStrings, string, ok ) ); } -QStringList KSim::Snmp::allAuthenticationProtocols() +TQStringList KSim::Snmp::allAuthenticationProtocols() { return allStrings( authenticationProtocolStrings ); } -QString KSim::Snmp::authenticationProtocolToString( AuthenticationProtocol proto ) +TQString KSim::Snmp::authenticationProtocolToString( AuthenticationProtocol proto ) { return enumToString( authenticationProtocolStrings, proto ); } -AuthenticationProtocol KSim::Snmp::stringToAuthenticationProtocol( QString string, bool *ok ) +AuthenticationProtocol KSim::Snmp::stringToAuthenticationProtocol( TQString string, bool *ok ) { return static_cast<AuthenticationProtocol>( stringToEnum( authenticationProtocolStrings, string, ok ) ); } -QStringList KSim::Snmp::allPrivacyProtocols() +TQStringList KSim::Snmp::allPrivacyProtocols() { return allStrings( privacyProtocolStrings ); } -QString KSim::Snmp::privacyProtocolToString( PrivacyProtocol proto ) +TQString KSim::Snmp::privacyProtocolToString( PrivacyProtocol proto ) { return enumToString( privacyProtocolStrings, proto ); } -PrivacyProtocol KSim::Snmp::stringToPrivacyProtocol( QString string, bool *ok ) +PrivacyProtocol KSim::Snmp::stringToPrivacyProtocol( TQString string, bool *ok ) { return static_cast<PrivacyProtocol>( stringToEnum( privacyProtocolStrings, string, ok ) ); } @@ -288,14 +288,14 @@ int KSim::Snmp::sessionErrorCode( netsnmp_session &session ) return errorCode; } -static QString messageForErrorCode( int errorCode ) +static TQString messageForErrorCode( int errorCode ) { if ( errorCode >= SNMPERR_MAX && errorCode <= SNMPERR_GENERR ) - return QString::fromLatin1( SnmpLib::self()->snmp_api_errstring( errorCode ) ); + return TQString::fromLatin1( SnmpLib::self()->snmp_api_errstring( errorCode ) ); if ( errorCode >= SNMP_ERR_NOERROR && errorCode <= MAX_SNMP_ERR ) - return QString::fromLatin1( SnmpLib::self()->snmp_errstring( errorCode ) ); + return TQString::fromLatin1( SnmpLib::self()->snmp_errstring( errorCode ) ); - return QString::null; + return TQString::null; } ErrorInfo::ErrorInfo() diff --git a/ksim/monitors/snmp/snmp.h b/ksim/monitors/snmp/snmp.h index 4710c2d..f7fa92c 100644 --- a/ksim/monitors/snmp/snmp.h +++ b/ksim/monitors/snmp/snmp.h @@ -22,7 +22,7 @@ #include <kconfigbase.h> -#include <qmap.h> +#include <tqmap.h> namespace KSim @@ -32,24 +32,24 @@ namespace Snmp { enum SnmpVersion { SnmpVersion1, SnmpVersion2c, SnmpVersion3, SnmpLastVersion }; -QStringList allSnmpVersions(); -QString snmpVersionToString( SnmpVersion version ); -SnmpVersion stringToSnmpVersion( QString string, bool *ok = 0 ); +TQStringList allSnmpVersions(); +TQString snmpVersionToString( SnmpVersion version ); +SnmpVersion stringToSnmpVersion( TQString string, bool *ok = 0 ); enum SecurityLevel { NoAuthPriv, AuthNoPriv, AuthPriv, LastSecurityLevel }; -QStringList allSecurityLevels(); -QString securityLevelToString( SecurityLevel level ); -SecurityLevel stringToSecurityLevel( QString string, bool *ok = 0 ); +TQStringList allSecurityLevels(); +TQString securityLevelToString( SecurityLevel level ); +SecurityLevel stringToSecurityLevel( TQString string, bool *ok = 0 ); enum AuthenticationProtocol { MD5Auth, SHA1Auth, LastAuthenticationProtocol }; -QStringList allAuthenticationProtocols(); -QString authenticationProtocolToString( AuthenticationProtocol proto ); -AuthenticationProtocol stringToAuthenticationProtocol( QString string, bool *ok = 0 ); +TQStringList allAuthenticationProtocols(); +TQString authenticationProtocolToString( AuthenticationProtocol proto ); +AuthenticationProtocol stringToAuthenticationProtocol( TQString string, bool *ok = 0 ); enum PrivacyProtocol { DESPrivacy }; -QStringList allPrivacyProtocols(); -QString privacyProtocolToString( PrivacyProtocol proto ); -PrivacyProtocol stringToPrivacyProtocol( QString string, bool *ok = 0 ); +TQStringList allPrivacyProtocols(); +TQString privacyProtocolToString( PrivacyProtocol proto ); +PrivacyProtocol stringToPrivacyProtocol( TQString string, bool *ok = 0 ); class ErrorInfo { @@ -149,11 +149,11 @@ public: ErrorInfo( ErrorType error ); ErrorType errorCode() const { return m_errorCode; } - QString errorMessage() const { return m_errorMessage; } + TQString errorMessage() const { return m_errorMessage; } private: ErrorType m_errorCode; - QString m_errorMessage; + TQString m_errorMessage; }; } diff --git a/ksim/monitors/snmp/snmplib.cpp b/ksim/monitors/snmp/snmplib.cpp index a063203..b042c7f 100644 --- a/ksim/monitors/snmp/snmplib.cpp +++ b/ksim/monitors/snmp/snmplib.cpp @@ -44,9 +44,9 @@ SnmpLib::~SnmpLib() ClassLocker<SnmpLib> &SnmpLib::self() { if ( !s_self ) { - static QMutex singletonGuard; + static TQMutex singletonGuard; - QMutexLocker locker( &singletonGuard ); + TQMutexLocker locker( &singletonGuard ); if ( !s_self ) sd.setObject( s_self, new SnmpLib ); } diff --git a/ksim/monitors/snmp/snmplib.h b/ksim/monitors/snmp/snmplib.h index e8b14a4..388c918 100644 --- a/ksim/monitors/snmp/snmplib.h +++ b/ksim/monitors/snmp/snmplib.h @@ -25,7 +25,7 @@ #include <net-snmp/net-snmp-config.h> #include <net-snmp/net-snmp-includes.h> -#include <qmutex.h> +#include <tqmutex.h> template <class> class KStaticDeleter; @@ -39,13 +39,13 @@ template <class T> class ClassLocker { public: - ClassLocker( QMutex *guard, T *obj ) + ClassLocker( TQMutex *guard, T *obj ) : m_guard( guard ), m_obj( obj ) {} struct ClassLockerHelper { - ClassLockerHelper( QMutex *guard, T *obj ) + ClassLockerHelper( TQMutex *guard, T *obj ) : m_guard( guard ), m_obj( obj ), m_locked( false ) {} @@ -63,7 +63,7 @@ public: } private: - QMutex *m_guard; + TQMutex *m_guard; T *m_obj; bool m_locked; }; @@ -77,7 +77,7 @@ private: ClassLocker( const ClassLocker & ); ClassLocker &operator=( const ClassLocker & ); - QMutex *m_guard; + TQMutex *m_guard; T *m_obj; }; @@ -127,7 +127,7 @@ private: SnmpLib(); ~SnmpLib(); - QMutex m_guard; + TQMutex m_guard; ClassLocker<SnmpLib> *m_lockHelper; static SnmpLib *s_self; diff --git a/ksim/monitors/snmp/value.cpp b/ksim/monitors/snmp/value.cpp index fe42a08..a244c59 100644 --- a/ksim/monitors/snmp/value.cpp +++ b/ksim/monitors/snmp/value.cpp @@ -22,7 +22,7 @@ #include "value_p.h" #include "snmp_p.h" -#include <qvariant.h> +#include <tqvariant.h> #include <klocale.h> @@ -35,22 +35,22 @@ ValueImpl::ValueImpl( variable_list *var ) switch ( var->type ) { case ASN_INTEGER: { type = Value::Int; - data = QVariant( static_cast<int>( *var->val.integer ) ); + data = TQVariant( static_cast<int>( *var->val.integer ) ); break; } case ASN_UINTEGER: { type = Value::UInt; - data = QVariant( static_cast<uint>( *var->val.integer ) ); + data = TQVariant( static_cast<uint>( *var->val.integer ) ); break; } case ASN_OCTET_STR: { type = Value::ByteArray; - QByteArray d; + TQByteArray d; d.setRawData( reinterpret_cast<char *>( var->val.string ), var->val_len ); - QByteArray copy = d; + TQByteArray copy = d; copy.detach(); d.resetRawData( reinterpret_cast<char *>( var->val.string ), var->val_len ); - data = QVariant( copy ); + data = TQVariant( copy ); break; } case ASN_NULL: { @@ -64,17 +64,17 @@ ValueImpl::ValueImpl( variable_list *var ) } case ASN_IPADDRESS: { type = Value::IpAddress; - addr = QHostAddress( static_cast<uint>( *var->val.integer ) ); + addr = TQHostAddress( static_cast<uint>( *var->val.integer ) ); break; } case ASN_COUNTER: { type = Value::Counter; - data = QVariant( static_cast<uint>( *var->val.integer ) ); + data = TQVariant( static_cast<uint>( *var->val.integer ) ); break; } case ASN_GAUGE: { type = Value::Gauge; - data = QVariant( static_cast<uint>( *var->val.integer ) ); + data = TQVariant( static_cast<uint>( *var->val.integer ) ); break; } case ASN_COUNTER64: { @@ -84,7 +84,7 @@ ValueImpl::ValueImpl( variable_list *var ) } case ASN_TIMETICKS: { type = Value::TimeTicks; - data = QVariant( static_cast<int>( *var->val.integer ) ); + data = TQVariant( static_cast<int>( *var->val.integer ) ); break; } case SNMP_NOSUCHOBJECT: { @@ -102,12 +102,12 @@ ValueImpl::ValueImpl( variable_list *var ) #if defined( OPAQUE_SPECIAL_TYPES ) case ASN_OPAQUE_FLOAT: { type = Value::Double; - data = QVariant( static_cast<float>( *var->val.floatVal ) ); + data = TQVariant( static_cast<float>( *var->val.floatVal ) ); break; } case ASN_OPAQUE_DOUBLE: { type = Value::Double; - data = QVariant( static_cast<float>( *var->val.doubleVal ) ); + data = TQVariant( static_cast<float>( *var->val.doubleVal ) ); break; } #endif @@ -135,7 +135,7 @@ Value::Value( int val, Type type ) assert( type == Int || type == TimeTicks ); d->type = type; - d->data = QVariant( val ); + d->data = TQVariant( val ); } Value::Value( uint val, Type type ) @@ -145,21 +145,21 @@ Value::Value( uint val, Type type ) assert( type == UInt || type == Counter || type == Gauge ); d->type = type; - d->data = QVariant( val ); + d->data = TQVariant( val ); } Value::Value( double val ) { d = new ValueImpl; d->type = Double; - d->data = QVariant( val ); + d->data = TQVariant( val ); } -Value::Value( const QByteArray &data ) +Value::Value( const TQByteArray &data ) { d = new ValueImpl; d->type = ByteArray; - d->data = QVariant( data ); + d->data = TQVariant( data ); } Value::Value( const KSim::Snmp::Identifier &oid ) @@ -169,7 +169,7 @@ Value::Value( const KSim::Snmp::Identifier &oid ) d->oid = oid; } -Value::Value( const QHostAddress &address ) +Value::Value( const TQHostAddress &address ) { d = new ValueImpl; d->type = IpAddress; @@ -240,7 +240,7 @@ double Value::toDouble() const return d->data.toDouble(); } -const QByteArray Value::toByteArray() const +const TQByteArray Value::toByteArray() const { assert( d->type == ByteArray ); return d->data.toByteArray(); @@ -252,7 +252,7 @@ const Identifier Value::toOID() const return d->oid; } -const QHostAddress Value::toIpAddress() const +const TQHostAddress Value::toIpAddress() const { assert( d->type == IpAddress ); return d->addr; @@ -279,31 +279,31 @@ Q_UINT64 Value::toCounter64() const return d->ctr64; } -QString Value::toString( int conversionFlags ) const +TQString Value::toString( int conversionFlags ) const { switch ( type() ) { - case Value::Int: return QString::number( toInt() ); + case Value::Int: return TQString::number( toInt() ); case Value::Gauge: case Value::Counter: - case Value::UInt: return QString::number( toUInt() ); - case Value::Double: return QString::number( toDouble() ); - case Value::Counter64: return QString::number( toCounter64() ); - case Value::ByteArray: return QString::fromAscii( toByteArray().data(), toByteArray().size() ); + case Value::UInt: return TQString::number( toUInt() ); + case Value::Double: return TQString::number( toDouble() ); + case Value::Counter64: return TQString::number( toCounter64() ); + case Value::ByteArray: return TQString::fromAscii( toByteArray().data(), toByteArray().size() ); case Value::IpAddress: return toIpAddress().toString(); case Value::Oid: return toOID().toString(); case Value::TimeTicks: return formatTimeTicks( toTimeTicks(), conversionFlags ); // not using i18n here, because it may be called from within a worker thread, and I'm // not sure it makes sense to translate it anyway - case Value::NoSuchObject: return QString::fromLatin1( "No Such Object" ); - case Value::NoSuchInstance: return QString::fromLatin1( "No Such Instance" ); - case Value::EndOfMIBView: return QString::fromLatin1( "End Of MIB View" ); + case Value::NoSuchObject: return TQString::fromLatin1( "No Such Object" ); + case Value::NoSuchInstance: return TQString::fromLatin1( "No Such Instance" ); + case Value::EndOfMIBView: return TQString::fromLatin1( "End Of MIB View" ); case Value::Invalid: - case Value::Null: return QString::null; + case Value::Null: return TQString::null; } - return QString::null; + return TQString::null; } -QString Value::formatTimeTicks( int ticks, int conversionFlags ) +TQString Value::formatTimeTicks( int ticks, int conversionFlags ) { ticks /= 100; @@ -316,15 +316,15 @@ QString Value::formatTimeTicks( int ticks, int conversionFlags ) int minutes = ticks / 60; int seconds = ticks % 60; - QString result; + TQString result; if ( days > 0 ) - result += QString::number( days ) + "d:"; + result += TQString::number( days ) + "d:"; - result += QString::fromAscii( "%1h:%2m" ).arg( hours ).arg( minutes ); + result += TQString::fromAscii( "%1h:%2m" ).arg( hours ).arg( minutes ); if ( conversionFlags & TimeTicksWithSeconds ) - result += ":" + QString::number( seconds ) + "s"; + result += ":" + TQString::number( seconds ) + "s"; return result; } diff --git a/ksim/monitors/snmp/value.h b/ksim/monitors/snmp/value.h index 4ffdcbb..5b2d6cd 100644 --- a/ksim/monitors/snmp/value.h +++ b/ksim/monitors/snmp/value.h @@ -20,7 +20,7 @@ #ifndef VALUE_H #define VALUE_H -#include <qhostaddress.h> +#include <tqhostaddress.h> namespace KSim { @@ -65,9 +65,9 @@ public: Value( uint val, Type type ); Value( float val ); Value( double val ); - Value( const QByteArray &data ); + Value( const TQByteArray &data ); Value( const Identifier &oid ); - Value( const QHostAddress &address ); + Value( const TQHostAddress &address ); Value( Q_UINT64 counter ); Value( const Value &rhs ); @@ -81,18 +81,18 @@ public: int toInt() const; uint toUInt() const; double toDouble() const; - const QByteArray toByteArray() const; + const TQByteArray toByteArray() const; const Identifier toOID() const; - const QHostAddress toIpAddress() const; + const TQHostAddress toIpAddress() const; uint toCounter() const; uint toGauge() const; int toTimeTicks() const; Q_UINT64 toCounter64() const; - QString toString( int conversionFlags = 0 ) const; + TQString toString( int conversionFlags = 0 ) const; private: - static QString formatTimeTicks( int ticks, int conversionFlags ); + static TQString formatTimeTicks( int ticks, int conversionFlags ); ValueImpl *d; }; diff --git a/ksim/monitors/snmp/value_p.h b/ksim/monitors/snmp/value_p.h index 8d61f59..000c32d 100644 --- a/ksim/monitors/snmp/value_p.h +++ b/ksim/monitors/snmp/value_p.h @@ -24,7 +24,7 @@ #include <net-snmp/net-snmp-config.h> #include <net-snmp/net-snmp-includes.h> -#include <qvariant.h> +#include <tqvariant.h> #include "identifier.h" @@ -48,9 +48,9 @@ struct ValueImpl ValueImpl( variable_list *var ); Value::Type type; - QVariant data; + TQVariant data; Identifier oid; - QHostAddress addr; + TQHostAddress addr; Q_UINT64 ctr64; }; diff --git a/ksim/monitors/snmp/view.cpp b/ksim/monitors/snmp/view.cpp index 0a4b276..9515645 100644 --- a/ksim/monitors/snmp/view.cpp +++ b/ksim/monitors/snmp/view.cpp @@ -23,7 +23,7 @@ #include <label.h> -#include <qlayout.h> +#include <tqlayout.h> #include <kconfig.h> @@ -32,7 +32,7 @@ using namespace KSim::Snmp; View::View( Plugin *parent, const char *name ) : KSim::PluginView( parent, name ) { - m_layout = new QVBoxLayout( this ); + m_layout = new TQVBoxLayout( this ); reparseConfig(); } @@ -49,8 +49,8 @@ void View::reparseConfig() KConfig &cfg = *config(); cfg.setGroup( "General" ); - QStringList allHosts = cfg.readListEntry( "Hosts" ); - QStringList monitors = cfg.readListEntry( "Monitors" ); + TQStringList allHosts = cfg.readListEntry( "Hosts" ); + TQStringList monitors = cfg.readListEntry( "Monitors" ); HostConfigMap hosts; hosts.load( cfg, allHosts ); @@ -63,7 +63,7 @@ void View::reparseConfig() MonitorConfig monitorConfig = *it; - QWidget *w = monitorConfig.createMonitorWidget( this ); + TQWidget *w = monitorConfig.createMonitorWidget( this ); if ( !w ) continue; diff --git a/ksim/monitors/snmp/view.h b/ksim/monitors/snmp/view.h index f03a59c..3793d30 100644 --- a/ksim/monitors/snmp/view.h +++ b/ksim/monitors/snmp/view.h @@ -42,8 +42,8 @@ public: virtual void reparseConfig(); private: - QPtrList<QWidget> m_widgets; - QBoxLayout *m_layout; + TQPtrList<TQWidget> m_widgets; + TQBoxLayout *m_layout; }; } diff --git a/ksim/monitors/snmp/walker.cpp b/ksim/monitors/snmp/walker.cpp index 593cd04..0aa6c0a 100644 --- a/ksim/monitors/snmp/walker.cpp +++ b/ksim/monitors/snmp/walker.cpp @@ -19,7 +19,7 @@ #include "walker.h" -#include <qapplication.h> +#include <tqapplication.h> #include <functional> #include <algorithm> @@ -38,8 +38,8 @@ namespace static const uint walkerRefresh = 0; -Walker::Walker( const HostConfig &host, const Identifier &startOid, QObject *parent, const char *name ) - : QObject( parent, name ), m_stop( false ), m_oid( startOid ), m_session( host ) +Walker::Walker( const HostConfig &host, const Identifier &startOid, TQObject *parent, const char *name ) + : TQObject( parent, name ), m_stop( false ), m_oid( startOid ), m_session( host ) { m_timerId = startTimer( walkerRefresh ); start(); @@ -51,8 +51,8 @@ Walker::~Walker() m_stop = true; m_stopGuard.unlock(); - if ( QThread::running() ) - QThread::wait(); + if ( TQThread::running() ) + TQThread::wait(); std::for_each( m_results.begin(), m_results.end(), Deleter<Result *>() ); } @@ -82,10 +82,10 @@ void Walker::run() } // cause finished signal to be emitted - QApplication::postEvent( this, new QCustomEvent( QEvent::User ) ); + TQApplication::postEvent( this, new TQCustomEvent( TQEvent::User ) ); } -void Walker::timerEvent( QTimerEvent *ev ) +void Walker::timerEvent( TQTimerEvent *ev ) { if ( ev->timerId() != m_timerId ) return; @@ -105,13 +105,13 @@ void Walker::timerEvent( QTimerEvent *ev ) delete result; } - if ( !QThread::running() && !result ) { + if ( !TQThread::running() && !result ) { killTimer( m_timerId ); m_timerId = 0; } } -void Walker::customEvent( QCustomEvent * ) +void Walker::customEvent( TQCustomEvent * ) { emit finished(); } diff --git a/ksim/monitors/snmp/walker.h b/ksim/monitors/snmp/walker.h index e1b1ace..3ff38b7 100644 --- a/ksim/monitors/snmp/walker.h +++ b/ksim/monitors/snmp/walker.h @@ -20,10 +20,10 @@ #ifndef WALKER_H #define WALKER_H -#include <qthread.h> -#include <qobject.h> -#include <qmutex.h> -#include <qvaluelist.h> +#include <tqthread.h> +#include <tqobject.h> +#include <tqmutex.h> +#include <tqvaluelist.h> #include "session.h" @@ -33,11 +33,11 @@ namespace KSim namespace Snmp { -class Walker : public QObject, public QThread +class Walker : public TQObject, public QThread { Q_OBJECT public: - Walker( const HostConfig &host, const Identifier &startOid, QObject *parent, const char *name = 0 ); + Walker( const HostConfig &host, const Identifier &startOid, TQObject *parent, const char *name = 0 ); virtual ~Walker(); struct Result @@ -45,9 +45,9 @@ public: Result() : success( false ) {} bool success; Identifier oid; - QString identifierString; + TQString identifierString; Value data; - QString dataString; + TQString dataString; ErrorInfo error; }; @@ -57,17 +57,17 @@ signals: protected: virtual void run(); - virtual void timerEvent( QTimerEvent *ev ); - virtual void customEvent( QCustomEvent *ev ); + virtual void timerEvent( TQTimerEvent *ev ); + virtual void customEvent( TQCustomEvent *ev ); private: - typedef QValueList<Result *> ResultList; + typedef TQValueList<Result *> ResultList; ResultList m_results; - QMutex m_resultGuard; + TQMutex m_resultGuard; bool m_stop; - QMutex m_stopGuard; + TQMutex m_stopGuard; Identifier m_oid; int m_timerId; diff --git a/ksim/themeprefs.cpp b/ksim/themeprefs.cpp index 3951f61..f2aa04d 100644 --- a/ksim/themeprefs.cpp +++ b/ksim/themeprefs.cpp @@ -20,11 +20,11 @@ #include "themeprefs.h" #include "themeprefs.moc" -#include <qdir.h> -#include <qlayout.h> -#include <qtooltip.h> -#include <qlabel.h> -#include <qregexp.h> +#include <tqdir.h> +#include <tqlayout.h> +#include <tqtooltip.h> +#include <tqlabel.h> +#include <tqregexp.h> #include <klocale.h> #include <kdebug.h> @@ -46,7 +46,7 @@ class ThemeViewItem : public KListViewItem { public: - ThemeViewItem(QListView *parent, const QString &text, + ThemeViewItem(TQListView *parent, const TQString &text, const KURL &url) : KListViewItem(parent, text) { m_url = url; @@ -58,52 +58,52 @@ class ThemeViewItem : public KListViewItem KURL m_url; }; -KSim::ThemePrefs::ThemePrefs(QWidget *parent, const char *name) - : QWidget(parent, name) +KSim::ThemePrefs::ThemePrefs(TQWidget *parent, const char *name) + : TQWidget(parent, name) { - m_themeLayout = new QGridLayout(this); + m_themeLayout = new TQGridLayout(this); m_themeLayout->setSpacing(6); - m_label = new QLabel(this); + m_label = new TQLabel(this); m_label->setText(i18n("GKrellm theme support. To use" " gkrellm themes just untar the themes into the folder below")); - m_label->setAlignment(QLabel::WordBreak | - QLabel::AlignVCenter | QLabel::AlignLeft); + m_label->setAlignment(TQLabel::WordBreak | + TQLabel::AlignVCenter | TQLabel::AlignLeft); m_themeLayout->addMultiCellWidget(m_label, 0, 0, 0, 4); - QString themeDir(locateLocal("data", "ksim")); - themeDir += QString::fromLatin1("/themes"); + TQString themeDir(locateLocal("data", "ksim")); + themeDir += TQString::fromLatin1("/themes"); m_urlLabel = new KURLLabel(this); m_urlLabel->setText(i18n("Open Konqueror in KSim's theme folder")); - m_urlLabel->setURL(QString::fromLatin1("file://") + themeDir); - connect(m_urlLabel, SIGNAL(leftClickedURL(const QString &)), - this, SLOT(openURL(const QString &))); + m_urlLabel->setURL(TQString::fromLatin1("file://") + themeDir); + connect(m_urlLabel, TQT_SIGNAL(leftClickedURL(const TQString &)), + this, TQT_SLOT(openURL(const TQString &))); m_themeLayout->addMultiCellWidget(m_urlLabel, 1, 1, 0, 4); m_line = new KSeparator(Horizontal, this); m_themeLayout->addMultiCellWidget(m_line, 2, 2, 0, 4); - m_authorLabel = new QLabel(this); - m_authorLabel->setSizePolicy(QSizePolicy(QSizePolicy::Fixed, - QSizePolicy::Minimum)); + m_authorLabel = new TQLabel(this); + m_authorLabel->setSizePolicy(TQSizePolicy(TQSizePolicy::Fixed, + TQSizePolicy::Minimum)); m_authorLabel->setText(i18n("Author:")); m_themeLayout->addMultiCellWidget(m_authorLabel, 3, 3, 0, 0); m_authLabel = new KSqueezedTextLabel(this); - m_authLabel->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, - QSizePolicy::Minimum)); + m_authLabel->setSizePolicy(TQSizePolicy(TQSizePolicy::Expanding, + TQSizePolicy::Minimum)); m_authLabel->setText(i18n("None")); m_themeLayout->addMultiCellWidget(m_authLabel, 3, 3, 1, 4); m_listView = new KListView(this); m_listView->addColumn(i18n("Theme")); m_listView->setFullWidth(true); - connect(m_listView, SIGNAL(currentChanged(QListViewItem *)), - this, SLOT(selectItem(QListViewItem *))); + connect(m_listView, TQT_SIGNAL(currentChanged(TQListViewItem *)), + this, TQT_SLOT(selectItem(TQListViewItem *))); m_themeLayout->addMultiCellWidget(m_listView, 4, 4, 0, 4); - m_alternateLabel = new QLabel(this); + m_alternateLabel = new TQLabel(this); m_alternateLabel->setText(i18n("Alternate themes:")); m_alternateLabel->setAlignment(AlignVCenter | AlignRight); m_themeLayout->addMultiCellWidget(m_alternateLabel, 5, 5, 0, 1); @@ -111,11 +111,11 @@ KSim::ThemePrefs::ThemePrefs(QWidget *parent, const char *name) m_altTheme = new KIntSpinBox(this); m_themeLayout->addMultiCellWidget(m_altTheme, 5, 5, 2, 2); - m_fontLabel = new QLabel(this); + m_fontLabel = new TQLabel(this); m_fontLabel->setText(i18n("Font:")); m_fontLabel->setAlignment(AlignVCenter | AlignRight); - m_fontLabel->setSizePolicy(QSizePolicy(QSizePolicy::Minimum, - QSizePolicy::Fixed)); + m_fontLabel->setSizePolicy(TQSizePolicy(TQSizePolicy::Minimum, + TQSizePolicy::Fixed)); m_themeLayout->addMultiCellWidget(m_fontLabel, 5, 5, 3, 3); m_fontsCombo = new KComboBox(this); @@ -124,14 +124,14 @@ KSim::ThemePrefs::ThemePrefs(QWidget *parent, const char *name) m_fontsCombo->insertItem(i18n("Large")); m_fontsCombo->insertItem(i18n("Custom")); m_fontsCombo->insertItem(i18n("Default")); - m_fontsCombo->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, - QSizePolicy::Fixed)); - connect(m_fontsCombo, SIGNAL(activated(int)), - this, SLOT(showFontDialog(int))); + m_fontsCombo->setSizePolicy(TQSizePolicy(TQSizePolicy::Expanding, + TQSizePolicy::Fixed)); + connect(m_fontsCombo, TQT_SIGNAL(activated(int)), + this, TQT_SLOT(showFontDialog(int))); m_themeLayout->addMultiCellWidget(m_fontsCombo, 5, 5, 4, 4); - QStringList locatedFiles = KGlobal::dirs()->findDirs("data", "ksim/themes"); - for (QStringList::ConstIterator it = locatedFiles.begin(); it != locatedFiles.end(); ++it) + TQStringList locatedFiles = KGlobal::dirs()->findDirs("data", "ksim/themes"); + for (TQStringList::ConstIterator it = locatedFiles.begin(); it != locatedFiles.end(); ++it) readThemes(*it); } @@ -176,7 +176,7 @@ void KSim::ThemePrefs::setThemeAlts(int alternatives) m_alternateLabel->setEnabled(alternatives == 0 ? false : true); } -void KSim::ThemePrefs::openURL(const QString &url) +void KSim::ThemePrefs::openURL(const TQString &url) { kapp->invokeBrowser(url); } @@ -201,7 +201,7 @@ void KSim::ThemePrefs::completed() { kdDebug(2003) << "Finished listing" << endl; - for (QListViewItemIterator it(m_listView); it.current(); it++) + for (TQListViewItemIterator it(m_listView); it.current(); it++) { if (it.current()->text(0) == m_currentTheme.name) { @@ -215,7 +215,7 @@ void KSim::ThemePrefs::completed() } } -void KSim::ThemePrefs::selectItem(QListViewItem *item) +void KSim::ThemePrefs::selectItem(TQListViewItem *item) { if (!item) return; @@ -233,26 +233,26 @@ void KSim::ThemePrefs::selectItem(QListViewItem *item) if (theme.name() != "ksim") KSim::ThemeLoader::self().parseDir(theme.path(), theme.alternatives()); - QToolTip::remove(m_authLabel); + TQToolTip::remove(m_authLabel); if (theme.author().isEmpty()) { m_authLabel->setText(i18n("None Specified")); - QToolTip::add(m_authLabel, i18n("None specified")); + TQToolTip::add(m_authLabel, i18n("None specified")); } else { m_authLabel->setText(theme.author()); - QToolTip::add(m_authLabel, theme.author()); + TQToolTip::add(m_authLabel, theme.author()); } kdDebug( 2003 ) << "theme.alternatives() = " << theme.alternatives() << endl; setThemeAlts(theme.alternatives()); } -void KSim::ThemePrefs::readThemes(const QString &location) +void KSim::ThemePrefs::readThemes(const TQString &location) { kdDebug(2003) << "readThemes(" << location << ")" << endl; ThemeInfoList themeList; - QStringList items(QDir(location).entryList(QDir::Dirs, QDir::IgnoreCase)); - QStringList::ConstIterator it; + TQStringList items(TQDir(location).entryList(TQDir::Dirs, TQDir::IgnoreCase)); + TQStringList::ConstIterator it; for (it = items.begin(); it != items.end(); ++it) { if ((*it) != "." && (*it) != "..") themeList.append(ThemeInfo((*it), KURL(location + (*it) + "/"))); @@ -264,7 +264,7 @@ void KSim::ThemePrefs::readThemes(const QString &location) void KSim::ThemePrefs::showFontDialog(int currentItem) { if (currentItem == 3) { - QFont customFont = m_font; + TQFont customFont = m_font; int result = KFontDialog::getFont(customFont); if (result == KFontDialog::Accepted) m_font = customFont; diff --git a/ksim/themeprefs.h b/ksim/themeprefs.h index 8ae569e..a0a4f2b 100644 --- a/ksim/themeprefs.h +++ b/ksim/themeprefs.h @@ -21,7 +21,7 @@ #define THEMEIMPL_H #include <kurl.h> -#include <qwidget.h> +#include <tqwidget.h> class QListViewItem; class QGridLayout; @@ -41,7 +41,7 @@ namespace KSim { public: ThemeInfo() : name(0), url(0), alternatives(0) {} - ThemeInfo(const QString &name, const KURL &url, int alts=0) + ThemeInfo(const TQString &name, const KURL &url, int alts=0) : name(name), url(url), alternatives(alts) {} bool operator==(const ThemeInfo &rhs) const @@ -66,18 +66,18 @@ namespace KSim return *this; } - QString name; + TQString name; KURL url; int alternatives; }; - typedef QValueList<ThemeInfo> ThemeInfoList; + typedef TQValueList<ThemeInfo> ThemeInfoList; class ThemePrefs : public QWidget { Q_OBJECT public: - ThemePrefs(QWidget *parent, const char *name=0); + ThemePrefs(TQWidget *parent, const char *name=0); ~ThemePrefs(); public slots: @@ -87,12 +87,12 @@ namespace KSim private slots: void setCurrentTheme(const ThemeInfo &); void setThemeAlts(int); - void openURL(const QString &); + void openURL(const TQString &); void insertItems(const ThemeInfoList &); void clear(); void completed(); - void selectItem(QListViewItem *item); - void readThemes(const QString &); + void selectItem(TQListViewItem *item); + void readThemes(const TQString &); void showFontDialog(int); private: @@ -100,16 +100,16 @@ namespace KSim KURLLabel *m_urlLabel; KIntSpinBox *m_altTheme; KComboBox *m_fontsCombo; - QLabel *m_label; - QLabel *m_authorLabel; + TQLabel *m_label; + TQLabel *m_authorLabel; KSqueezedTextLabel *m_authLabel; - QLabel *m_alternateLabel; - QLabel *m_fontLabel; + TQLabel *m_alternateLabel; + TQLabel *m_fontLabel; KSeparator *m_line; ThemeInfo m_currentTheme; - QFont m_font; + TQFont m_font; ThemeInfoList m_themeList; - QGridLayout *m_themeLayout; + TQGridLayout *m_themeLayout; }; } #endif diff --git a/ktimer/ktimer.cpp b/ktimer/ktimer.cpp index 2b1b1c8..a5f3937 100644 --- a/ktimer/ktimer.cpp +++ b/ktimer/ktimer.cpp @@ -16,15 +16,15 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#include <qtimer.h> -#include <qtoolbutton.h> -#include <qgroupbox.h> -#include <qlistview.h> -#include <qspinbox.h> -#include <qlineedit.h> -#include <qcheckbox.h> -#include <qslider.h> -#include <qlcdnumber.h> +#include <tqtimer.h> +#include <tqtoolbutton.h> +#include <tqgroupbox.h> +#include <tqlistview.h> +#include <tqspinbox.h> +#include <tqlineedit.h> +#include <tqcheckbox.h> +#include <tqslider.h> +#include <tqlcdnumber.h> #include <kurlrequester.h> #include <klineedit.h> @@ -34,20 +34,20 @@ #include <kfiledialog.h> #include "ktimer.h" -#include <qpushbutton.h> +#include <tqpushbutton.h> -class KTimerJobItem : public QListViewItem { +class KTimerJobItem : public TQListViewItem { public: - KTimerJobItem( KTimerJob *job, QListView *parent ) - : QListViewItem( parent ) { + KTimerJobItem( KTimerJob *job, TQListView *parent ) + : TQListViewItem( parent ) { m_job = job; m_error = false; update(); }; - KTimerJobItem( KTimerJob *job, QListView *parent, QListViewItem *after ) - : QListViewItem( parent, after ) { + KTimerJobItem( KTimerJob *job, TQListView *parent, TQListViewItem *after ) + : TQListViewItem( parent, after ) { m_job = job; m_error = false; update(); @@ -65,14 +65,14 @@ public: } void update() { - setText( 0, QString::number(m_job->value()) ); + setText( 0, TQString::number(m_job->value()) ); if( m_error ) setPixmap( 0, SmallIcon("stop") ); else - setPixmap( 0, QPixmap() ); + setPixmap( 0, TQPixmap() ); - setText( 1, QString::number(m_job->delay()) ); + setText( 1, TQString::number(m_job->delay()) ); switch( m_job->state() ) { case KTimerJob::Stopped: setPixmap( 2, SmallIcon("player_stop") ); break; @@ -94,10 +94,10 @@ private: struct KTimerPrefPrivate { - QPtrList<KTimerJob> jobs; + TQPtrList<KTimerJob> jobs; }; -KTimerPref::KTimerPref( QWidget *parent, const char *name ) +KTimerPref::KTimerPref( TQWidget *parent, const char *name ) : PrefWidget( parent, name ) { d = new KTimerPrefPrivate; @@ -115,10 +115,10 @@ KTimerPref::KTimerPref( QWidget *parent, const char *name ) tray->setPixmap( SmallIcon( "ktimer" ) ); // connect - connect( m_add, SIGNAL(clicked()), SLOT(add()) ); - connect( m_remove, SIGNAL(clicked()), SLOT(remove()) ); - connect( m_list, SIGNAL(currentChanged(QListViewItem*)), - SLOT(currentChanged(QListViewItem*)) ); + connect( m_add, TQT_SIGNAL(clicked()), TQT_SLOT(add()) ); + connect( m_remove, TQT_SIGNAL(clicked()), TQT_SLOT(remove()) ); + connect( m_list, TQT_SIGNAL(currentChanged(TQListViewItem*)), + TQT_SLOT(currentChanged(TQListViewItem*)) ); loadJobs( kapp->config() ); show(); @@ -137,16 +137,16 @@ void KTimerPref::add() KTimerJob *job = new KTimerJob; KTimerJobItem *item = new KTimerJobItem( job, m_list ); - connect( job, SIGNAL(delayChanged(KTimerJob*,unsigned)), - SLOT(jobChanged(KTimerJob*)) ); - connect( job, SIGNAL(valueChanged(KTimerJob*,unsigned)), - SLOT(jobChanged(KTimerJob*)) ); - connect( job, SIGNAL(stateChanged(KTimerJob*,States)), - SLOT(jobChanged(KTimerJob*)) ); - connect( job, SIGNAL(commandChanged(KTimerJob*,const QString&)), - SLOT(jobChanged(KTimerJob*)) ); - connect( job, SIGNAL(finished(KTimerJob*,bool)), - SLOT(jobFinished(KTimerJob*,bool)) ); + connect( job, TQT_SIGNAL(delayChanged(KTimerJob*,unsigned)), + TQT_SLOT(jobChanged(KTimerJob*)) ); + connect( job, TQT_SIGNAL(valueChanged(KTimerJob*,unsigned)), + TQT_SLOT(jobChanged(KTimerJob*)) ); + connect( job, TQT_SIGNAL(stateChanged(KTimerJob*,States)), + TQT_SLOT(jobChanged(KTimerJob*)) ); + connect( job, TQT_SIGNAL(commandChanged(KTimerJob*,const TQString&)), + TQT_SLOT(jobChanged(KTimerJob*)) ); + connect( job, TQT_SIGNAL(finished(KTimerJob*,bool)), + TQT_SLOT(jobFinished(KTimerJob*,bool)) ); job->setUser( item ); @@ -166,7 +166,7 @@ void KTimerPref::remove() } -void KTimerPref::currentChanged( QListViewItem *i ) +void KTimerPref::currentChanged( TQListViewItem *i ) { KTimerJobItem *item = static_cast<KTimerJobItem*>(i); if( item ) { @@ -185,22 +185,22 @@ void KTimerPref::currentChanged( QListViewItem *i ) m_counter->disconnect(); m_slider->disconnect(); - connect( m_commandLine->lineEdit(), SIGNAL(textChanged(const QString &)), - job, SLOT(setCommand(const QString &)) ); - connect( m_delay, SIGNAL(valueChanged(int)), - job, SLOT(setDelay(int)) ); - connect( m_loop, SIGNAL(toggled(bool)), - job, SLOT(setLoop(bool)) ); - connect( m_one, SIGNAL(toggled(bool)), - job, SLOT(setOneInstance(bool)) ); - connect( m_stop, SIGNAL(clicked()), - job, SLOT(stop()) ); - connect( m_pause, SIGNAL(clicked()), - job, SLOT(pause()) ); - connect( m_start, SIGNAL(clicked()), - job, SLOT(start()) ); - connect( m_slider, SIGNAL(valueChanged(int)), - job, SLOT(setValue(int)) ); + connect( m_commandLine->lineEdit(), TQT_SIGNAL(textChanged(const TQString &)), + job, TQT_SLOT(setCommand(const TQString &)) ); + connect( m_delay, TQT_SIGNAL(valueChanged(int)), + job, TQT_SLOT(setDelay(int)) ); + connect( m_loop, TQT_SIGNAL(toggled(bool)), + job, TQT_SLOT(setLoop(bool)) ); + connect( m_one, TQT_SIGNAL(toggled(bool)), + job, TQT_SLOT(setOneInstance(bool)) ); + connect( m_stop, TQT_SIGNAL(clicked()), + job, TQT_SLOT(stop()) ); + connect( m_pause, TQT_SIGNAL(clicked()), + job, TQT_SLOT(pause()) ); + connect( m_start, TQT_SIGNAL(clicked()), + job, TQT_SLOT(start()) ); + connect( m_slider, TQT_SIGNAL(valueChanged(int)), + job, TQT_SLOT(setValue(int)) ); m_commandLine->lineEdit()->setText( job->command() ); m_delay->setValue( job->delay() ); @@ -249,7 +249,7 @@ void KTimerPref::saveJobs( KConfig *cfg ) int num = 0; KTimerJobItem *item = static_cast<KTimerJobItem*>(m_list->firstChild()); while( item ) { - item->job()->save( cfg, QString("Job%1").arg( num ) ); + item->job()->save( cfg, TQString("Job%1").arg( num ) ); item = static_cast<KTimerJobItem*>(item->nextSibling()); num++; } @@ -269,18 +269,18 @@ void KTimerPref::loadJobs( KConfig *cfg ) KTimerJob *job = new KTimerJob; KTimerJobItem *item = new KTimerJobItem( job, m_list ); - connect( job, SIGNAL(delayChanged(KTimerJob*,unsigned)), - SLOT(jobChanged(KTimerJob*)) ); - connect( job, SIGNAL(valueChanged(KTimerJob*,unsigned)), - SLOT(jobChanged(KTimerJob*)) ); - connect( job, SIGNAL(stateChanged(KTimerJob*,States)), - SLOT(jobChanged(KTimerJob*)) ); - connect( job, SIGNAL(commandChanged(KTimerJob*,const QString&)), - SLOT(jobChanged(KTimerJob*)) ); - connect( job, SIGNAL(finished(KTimerJob*,bool)), - SLOT(jobFinished(KTimerJob*,bool)) ); + connect( job, TQT_SIGNAL(delayChanged(KTimerJob*,unsigned)), + TQT_SLOT(jobChanged(KTimerJob*)) ); + connect( job, TQT_SIGNAL(valueChanged(KTimerJob*,unsigned)), + TQT_SLOT(jobChanged(KTimerJob*)) ); + connect( job, TQT_SIGNAL(stateChanged(KTimerJob*,States)), + TQT_SLOT(jobChanged(KTimerJob*)) ); + connect( job, TQT_SIGNAL(commandChanged(KTimerJob*,const TQString&)), + TQT_SLOT(jobChanged(KTimerJob*)) ); + connect( job, TQT_SIGNAL(finished(KTimerJob*,bool)), + TQT_SLOT(jobFinished(KTimerJob*,bool)) ); - job->load( cfg, QString( "Job%1" ).arg(n) ); + job->load( cfg, TQString( "Job%1" ).arg(n) ); job->setUser( item ); } @@ -294,20 +294,20 @@ void KTimerPref::loadJobs( KConfig *cfg ) struct KTimerJobPrivate { unsigned delay; - QString command; + TQString command; bool loop; bool oneInstance; unsigned value; KTimerJob::States state; - QPtrList<KProcess> processes; + TQPtrList<KProcess> processes; void *user; - QTimer *timer; + TQTimer *timer; }; -KTimerJob::KTimerJob( QObject *parent, const char *name ) - : QObject( parent, name ) +KTimerJob::KTimerJob( TQObject *parent, const char *name ) + : TQObject( parent, name ) { d = new KTimerJobPrivate; @@ -319,8 +319,8 @@ KTimerJob::KTimerJob( QObject *parent, const char *name ) d->processes.setAutoDelete( true ); d->user = 0; - d->timer = new QTimer( this ); - connect( d->timer, SIGNAL(timeout()), SLOT(timeout()) ); + d->timer = new TQTimer( this ); + connect( d->timer, TQT_SIGNAL(timeout()), TQT_SLOT(timeout()) ); } @@ -330,7 +330,7 @@ KTimerJob::~KTimerJob() } -void KTimerJob::load( KConfig *cfg, const QString& grp ) +void KTimerJob::load( KConfig *cfg, const TQString& grp ) { cfg->setGroup( grp ); cfg->writeEntry( "Delay", d->delay ); @@ -341,7 +341,7 @@ void KTimerJob::load( KConfig *cfg, const QString& grp ) } -void KTimerJob::save( KConfig *cfg, const QString& grp ) +void KTimerJob::save( KConfig *cfg, const TQString& grp ) { cfg->setGroup( grp ); setDelay( cfg->readNumEntry( "Delay", 100 ) ); @@ -384,13 +384,13 @@ void KTimerJob::setDelay( unsigned sec ) } -QString KTimerJob::command() +TQString KTimerJob::command() { return d->command; } -void KTimerJob::setCommand( const QString &cmd ) +void KTimerJob::setCommand( const TQString &cmd ) { if( d->command!=cmd ) { d->command = cmd; @@ -502,8 +502,8 @@ void KTimerJob::fire() KShellProcess *proc = new KShellProcess; (*proc) << d->command; d->processes.append( proc ); - connect( proc, SIGNAL(processExited(KProcess*)), - SLOT(processExited(KProcess*)) ); + connect( proc, TQT_SIGNAL(processExited(KProcess*)), + TQT_SLOT(processExited(KProcess*)) ); bool ok = proc->start( KProcess::NotifyOnExit ); emit fired( this ); if( !ok ) { diff --git a/ktimer/ktimer.h b/ktimer/ktimer.h index 3b7c406..297eec9 100644 --- a/ktimer/ktimer.h +++ b/ktimer/ktimer.h @@ -19,25 +19,25 @@ #ifndef KTIMER_H_INCLUDED #define KTIMER_H_INCLUDED -#include <qdialog.h> -#include <qwidget.h> +#include <tqdialog.h> +#include <tqwidget.h> #include <kprocess.h> #include <kconfig.h> #include "prefwidget.h" -class KTimerJob : public QObject { +class KTimerJob : public TQObject { Q_OBJECT public: - KTimerJob( QObject *parent=0, const char *name=0 ); + KTimerJob( TQObject *parent=0, const char *name=0 ); virtual ~KTimerJob(); enum States { Stopped, Paused, Started }; unsigned delay(); - QString command(); + TQString command(); bool loop(); bool oneInstance(); unsigned value(); @@ -45,13 +45,13 @@ class KTimerJob : public QObject { void *user(); void setUser( void *user ); - void load( KConfig *cfg, const QString& grp ); - void save( KConfig *cfg, const QString& grp ); + void load( KConfig *cfg, const TQString& grp ); + void save( KConfig *cfg, const TQString& grp ); public slots: void setDelay( unsigned sec ); void setDelay( int sec ) { setDelay( (unsigned)sec ); }; - void setCommand( const QString &cmd ); + void setCommand( const TQString &cmd ); void setLoop( bool loop ); void setOneInstance( bool one ); void setValue( unsigned value ); @@ -65,7 +65,7 @@ class KTimerJob : public QObject { signals: void stateChanged( KTimerJob *job, States state ); void delayChanged( KTimerJob *job, unsigned sec ); - void commandChanged( KTimerJob *job, const QString &cmd ); + void commandChanged( KTimerJob *job, const TQString &cmd ); void loopChanged( KTimerJob *job, bool loop ); void oneInstanceChanged( KTimerJob *job, bool one ); void valueChanged( KTimerJob *job, unsigned value ); @@ -91,13 +91,13 @@ class KTimerPref : public PrefWidget { Q_OBJECT public: - KTimerPref( QWidget *parent=0, const char *name = 0 ); + KTimerPref( TQWidget *parent=0, const char *name = 0 ); virtual ~KTimerPref(); protected slots: void add(); void remove(); - void currentChanged( QListViewItem * ); + void currentChanged( TQListViewItem * ); void saveJobs( KConfig *cfg ); void loadJobs( KConfig *cfg ); diff --git a/kwallet/allyourbase.cpp b/kwallet/allyourbase.cpp index add178b..917857c 100644 --- a/kwallet/allyourbase.cpp +++ b/kwallet/allyourbase.cpp @@ -31,28 +31,28 @@ #include <kurldrag.h> #include <kwallet.h> -#include <qdragobject.h> -#include <qfile.h> -#include <qptrlist.h> +#include <tqdragobject.h> +#include <tqfile.h> +#include <tqptrlist.h> /**************** * KWalletFolderItem - ListView items to represent kwallet folders */ -KWalletFolderItem::KWalletFolderItem(KWallet::Wallet *w, QListView* parent, const QString &name, int entries) +KWalletFolderItem::KWalletFolderItem(KWallet::Wallet *w, TQListView* parent, const TQString &name, int entries) : KListViewItem(parent),_wallet(w),_name(name),_entries(entries) { - setText(0, QString("%1 (%2)").arg(_name).arg(_entries)); + setText(0, TQString("%1 (%2)").arg(_name).arg(_entries)); setRenameEnabled(0, false); setDragEnabled(true); setDropEnabled(true); - QPixmap pix = getFolderIcon(KIcon::Small); + TQPixmap pix = getFolderIcon(KIcon::Small); setPixmap(0,pix); } -QPixmap KWalletFolderItem::getFolderIcon(KIcon::Group group){ +TQPixmap KWalletFolderItem::getFolderIcon(KIcon::Group group){ KIconLoader *loader = KGlobal::instance()->iconLoader(); - QPixmap pix = loader->loadIcon( _name, group, 0, + TQPixmap pix = loader->loadIcon( _name, group, 0, KIcon::DefaultState, 0, true ); if (pix.isNull()) pix = loader->loadIcon( _name.lower(), group, 0, @@ -64,14 +64,14 @@ QPixmap KWalletFolderItem::getFolderIcon(KIcon::Group group){ } void KWalletFolderItem::refresh() { - QString saveFolder = _wallet->currentFolder(); + TQString saveFolder = _wallet->currentFolder(); _wallet->setFolder(_name); - setText(0, QString("%1 (%2)").arg(_name).arg(_wallet->entryList().count())); + setText(0, TQString("%1 (%2)").arg(_name).arg(_wallet->entryList().count())); _wallet->setFolder(saveFolder); } KWalletContainerItem* KWalletFolderItem::getContainer(KWallet::Wallet::EntryType type) { - for (QListViewItem *i = firstChild(); i; i = i->nextSibling()) { + for (TQListViewItem *i = firstChild(); i; i = i->nextSibling()) { KWalletContainerItem *ci = dynamic_cast<KWalletContainerItem *>(i); if (!ci) { continue; @@ -83,17 +83,17 @@ KWalletContainerItem* KWalletFolderItem::getContainer(KWallet::Wallet::EntryType return 0; } -bool KWalletFolderItem::contains(const QString& key) { +bool KWalletFolderItem::contains(const TQString& key) { return (getItem(key) != 0); } -QListViewItem* KWalletFolderItem::getItem(const QString& key) { - for (QListViewItem *i = firstChild(); i; i = i->nextSibling()) { +TQListViewItem* KWalletFolderItem::getItem(const TQString& key) { + for (TQListViewItem *i = firstChild(); i; i = i->nextSibling()) { KWalletContainerItem *ci = dynamic_cast<KWalletContainerItem *>(i); if (!ci) { continue; } - QListViewItem *tmp = ci->getItem(key); + TQListViewItem *tmp = ci->getItem(key); if (tmp) { return tmp; } @@ -101,7 +101,7 @@ QListViewItem* KWalletFolderItem::getItem(const QString& key) { return 0; } -bool KWalletFolderItem::acceptDrop(const QMimeSource *mime) const { +bool KWalletFolderItem::acceptDrop(const TQMimeSource *mime) const { return mime->provides("application/x-kwallet-entry") || mime->provides("text/uri-list"); } @@ -110,7 +110,7 @@ int KWalletFolderItem::rtti() const { return KWalletFolderItemClass; } -QString KWalletFolderItem::name() const { +TQString KWalletFolderItem::name() const { return _name; } @@ -121,7 +121,7 @@ KWalletFolderItem::~KWalletFolderItem() { * KWalletContainerItem - ListView items to represent kwallet containers, i.e. * passwords, maps, ... */ -KWalletContainerItem::KWalletContainerItem(QListViewItem* parent, const QString &name, KWallet::Wallet::EntryType type) +KWalletContainerItem::KWalletContainerItem(TQListViewItem* parent, const TQString &name, KWallet::Wallet::EntryType type) : KListViewItem(parent, name), _type(type) { setRenameEnabled(0, false); setDragEnabled(true); @@ -138,12 +138,12 @@ KWallet::Wallet::EntryType KWalletContainerItem::type() { return _type; } -bool KWalletContainerItem::contains(const QString& key) { +bool KWalletContainerItem::contains(const TQString& key) { return getItem(key) != 0; } -QListViewItem *KWalletContainerItem::getItem(const QString& key) { - for (QListViewItem *i = firstChild(); i; i = i->nextSibling()) { +TQListViewItem *KWalletContainerItem::getItem(const TQString& key) { + for (TQListViewItem *i = firstChild(); i; i = i->nextSibling()) { if (i->text(0) == key) { return i; } @@ -154,7 +154,7 @@ QListViewItem *KWalletContainerItem::getItem(const QString& key) { /**************** * KWalletEntryItem - ListView items to represent kwallet entries */ -KWalletEntryItem::KWalletEntryItem(KWallet::Wallet *w, QListViewItem* parent, const QString& ename) +KWalletEntryItem::KWalletEntryItem(KWallet::Wallet *w, TQListViewItem* parent, const TQString& ename) : KListViewItem(parent, ename), _wallet(w), _oldName(ename) { setRenameEnabled(0, true); setDragEnabled(true); @@ -170,27 +170,27 @@ KWalletEntryItem::~KWalletEntryItem() { /**************** * KWalletItem - IconView items to represent wallets */ -KWalletItem::KWalletItem(QIconView *parent, const QString& walletName) -: QIconViewItem(parent, walletName, DesktopIcon("kwalletmanager")) { +KWalletItem::KWalletItem(TQIconView *parent, const TQString& walletName) +: TQIconViewItem(parent, walletName, DesktopIcon("kwalletmanager")) { } KWalletItem::~KWalletItem() { } -bool KWalletItem::acceptDrop(const QMimeSource *mime) const { +bool KWalletItem::acceptDrop(const TQMimeSource *mime) const { return mime->provides("application/x-kwallet-folder") || mime->provides("text/uri-list"); } -static bool decodeEntry(KWallet::Wallet *_wallet, QDataStream& ds) { +static bool decodeEntry(KWallet::Wallet *_wallet, TQDataStream& ds) { Q_UINT32 magic; ds >> magic; if (magic != KWALLETENTRYMAGIC) { kdDebug() << "bad magic" << endl; return false; } - QString name; - QByteArray value; + TQString name; + TQByteArray value; KWallet::Wallet::EntryType et; ds >> name; if (_wallet->hasEntry(name)) { @@ -207,17 +207,17 @@ static bool decodeEntry(KWallet::Wallet *_wallet, QDataStream& ds) { return true; } -static bool decodeFolder(KWallet::Wallet *_wallet, QDataStream& ds) { +static bool decodeFolder(KWallet::Wallet *_wallet, TQDataStream& ds) { Q_UINT32 magic; ds >> magic; if (magic != KWALLETFOLDERMAGIC) { kdDebug() << "bad magic" << endl; return false; } - QString folder; + TQString folder; ds >> folder; if (_wallet->hasFolder(folder)) { - int rc = KMessageBox::warningYesNoCancel(0L, i18n("A folder by the name '%1' already exists. What would you like to do?").arg(folder), QString::null, KStdGuiItem::cont(), i18n("Replace")); + int rc = KMessageBox::warningYesNoCancel(0L, i18n("A folder by the name '%1' already exists. What would you like to do?").arg(folder), TQString::null, KStdGuiItem::cont(), i18n("Replace")); if (rc == KMessageBox::Cancel) { return false; } @@ -231,8 +231,8 @@ static bool decodeFolder(KWallet::Wallet *_wallet, QDataStream& ds) { _wallet->setFolder(folder); while (!ds.atEnd()) { - QString name; - QByteArray value; + TQString name; + TQByteArray value; KWallet::Wallet::EntryType et; ds >> name; long l; @@ -244,7 +244,7 @@ static bool decodeFolder(KWallet::Wallet *_wallet, QDataStream& ds) { return true; } -void KWalletItem::dropped(QDropEvent *e, const QValueList<QIconDragItem>& lst) { +void KWalletItem::dropped(TQDropEvent *e, const TQValueList<TQIconDragItem>& lst) { Q_UNUSED(lst); if (e->provides("application/x-kwallet-folder") || e->provides("text/uri-list")) { @@ -257,19 +257,19 @@ void KWalletItem::dropped(QDropEvent *e, const QValueList<QIconDragItem>& lst) { return; } - QString saveFolder = _wallet->currentFolder(); + TQString saveFolder = _wallet->currentFolder(); - QFile file; - QDataStream *ds = 0L; + TQFile file; + TQDataStream *ds = 0L; if (e->provides("application/x-kwallet-folder")) { - QByteArray edata = e->encodedData("application/x-kwallet-folder"); + TQByteArray edata = e->encodedData("application/x-kwallet-folder"); if (!edata.isEmpty()) { - ds = new QDataStream(edata, IO_ReadOnly); + ds = new TQDataStream(edata, IO_ReadOnly); } } else { // text/uri-list - QStrList urls; - QUriDrag::decode(e, urls); + TQStrList urls; + TQUriDrag::decode(e, urls); if (urls.isEmpty()) { e->ignore(); @@ -281,11 +281,11 @@ void KWalletItem::dropped(QDropEvent *e, const QValueList<QIconDragItem>& lst) { e->ignore(); return; } - QString tmpFile; + TQString tmpFile; if (KIO::NetAccess::download(u, tmpFile, 0L)) { file.setName(tmpFile); file.open(IO_ReadOnly); - ds = new QDataStream(&file); + ds = new TQDataStream(&file); KIO::NetAccess::removeTempFile(tmpFile); } else { KMessageBox::error(iconView(), KIO::NetAccess::lastErrorString()); @@ -324,10 +324,10 @@ void KWalletItem::dropped(QDropEvent *e, const QValueList<QIconDragItem>& lst) { /**************** * KWalletEntryDrag - Stores data for wallet entry drags */ -class KWalletEntryDrag : public QStoredDrag { +class KWalletEntryDrag : public TQStoredDrag { public: - KWalletEntryDrag(QWidget *dragSource, const char *name = 0L) - : QStoredDrag("application/x-kwallet-entry", dragSource, name) { + KWalletEntryDrag(TQWidget *dragSource, const char *name = 0L) + : TQStoredDrag("application/x-kwallet-entry", dragSource, name) { } virtual ~KWalletEntryDrag() {} @@ -336,10 +336,10 @@ class KWalletEntryDrag : public QStoredDrag { /**************** * KWalletFolderDrag - Stores data for wallet folder drags */ -class KWalletFolderDrag : public QStoredDrag { +class KWalletFolderDrag : public TQStoredDrag { public: - KWalletFolderDrag(QWidget *dragSource, const char *name = 0L) - : QStoredDrag("application/x-kwallet-folder", dragSource, name) { + KWalletFolderDrag(TQWidget *dragSource, const char *name = 0L) + : TQStoredDrag("application/x-kwallet-folder", dragSource, name) { } virtual ~KWalletFolderDrag() {} @@ -348,7 +348,7 @@ class KWalletFolderDrag : public QStoredDrag { /**************** * KWalletEntryList - A listview to store wallet entries */ -KWalletEntryList::KWalletEntryList(QWidget *parent, const char *name) +KWalletEntryList::KWalletEntryList(TQWidget *parent, const char *name) : KListView(parent, name) { addColumn(i18n("Folders")); setRootIsDecorated(true); @@ -362,8 +362,8 @@ KWalletEntryList::KWalletEntryList(QWidget *parent, const char *name) KWalletEntryList::~KWalletEntryList() { } -bool KWalletEntryList::acceptDrag(QDropEvent* e) const { - QListViewItem *i = itemAt(contentsToViewport(e->pos())); +bool KWalletEntryList::acceptDrag(TQDropEvent* e) const { + TQListViewItem *i = itemAt(contentsToViewport(e->pos())); if (i) { if (e->provides("application/x-kwallet-entry") || e->provides("text/uri-list")) { @@ -379,14 +379,14 @@ bool KWalletEntryList::acceptDrag(QDropEvent* e) const { } //returns true if the item has been dropped successfully -void KWalletEntryList::itemDropped(QDropEvent *e, QListViewItem *item) { +void KWalletEntryList::itemDropped(TQDropEvent *e, TQListViewItem *item) { bool ok = true; bool isEntry; - QFile file; - QDataStream *ds; + TQFile file; + TQDataStream *ds; KWalletEntryList *el = 0L; - QListViewItem *sel = 0L; + TQListViewItem *sel = 0L; //detect if we are dragging from kwallet itself if (e->source() && e->source()->parent() && @@ -407,12 +407,12 @@ void KWalletEntryList::itemDropped(QDropEvent *e, QListViewItem *item) { return; } isEntry = true; - QByteArray data = e->encodedData("application/x-kwallet-entry"); + TQByteArray data = e->encodedData("application/x-kwallet-entry"); if (data.isEmpty()) { e->ignore(); return; } - ds = new QDataStream(data, IO_ReadOnly); + ds = new TQDataStream(data, IO_ReadOnly); } else if (e->provides("application/x-kwallet-folder")) { //do nothing if we are in the same wallet if (this == el) { @@ -420,15 +420,15 @@ void KWalletEntryList::itemDropped(QDropEvent *e, QListViewItem *item) { return; } isEntry = false; - QByteArray data = e->encodedData("application/x-kwallet-folder"); + TQByteArray data = e->encodedData("application/x-kwallet-folder"); if (data.isEmpty()) { e->ignore(); return; } - ds = new QDataStream(data, IO_ReadOnly); + ds = new TQDataStream(data, IO_ReadOnly); } else if (e->provides("text/uri-list")) { - QStrList urls; - QUriDrag::decode(e, urls); + TQStrList urls; + TQUriDrag::decode(e, urls); if (urls.isEmpty()) { e->ignore(); return; @@ -438,11 +438,11 @@ void KWalletEntryList::itemDropped(QDropEvent *e, QListViewItem *item) { e->ignore(); return; } - QString tmpFile; + TQString tmpFile; if (KIO::NetAccess::download(u, tmpFile, 0L)) { file.setName(tmpFile); file.open(IO_ReadOnly); - ds = new QDataStream(&file); + ds = new TQDataStream(&file); //check magic to discover mime type Q_UINT32 magic; (*ds) >> magic; @@ -458,7 +458,7 @@ void KWalletEntryList::itemDropped(QDropEvent *e, QListViewItem *item) { delete ds; //set the file back to the beginning file.reset(); - ds = new QDataStream(&file); + ds = new TQDataStream(&file); KIO::NetAccess::removeTempFile(tmpFile); } else { KMessageBox::error(this, KIO::NetAccess::lastErrorString()); @@ -481,7 +481,7 @@ void KWalletEntryList::itemDropped(QDropEvent *e, QListViewItem *item) { e->accept(); return; } - QString saveFolder = _wallet->currentFolder(); + TQString saveFolder = _wallet->currentFolder(); _wallet->setFolder(fi->name()); ok = decodeEntry(_wallet, *ds); _wallet->setFolder(saveFolder); @@ -516,8 +516,8 @@ void KWalletEntryList::setWallet(KWallet::Wallet *w) { _wallet = w; } -bool KWalletEntryList::existsFolder(const QString& name) { - for (QListViewItem *vi = firstChild(); vi; vi = vi->nextSibling()) { +bool KWalletEntryList::existsFolder(const TQString& name) { + for (TQListViewItem *vi = firstChild(); vi; vi = vi->nextSibling()) { KWalletFolderItem *fi = dynamic_cast<KWalletFolderItem *>(vi); if (!fi) { continue; @@ -529,12 +529,12 @@ bool KWalletEntryList::existsFolder(const QString& name) { return false; } -void KWalletEntryList::contentsDropEvent(QDropEvent *e) { - QListViewItem *i = itemAt(contentsToViewport(e->pos())); +void KWalletEntryList::contentsDropEvent(TQDropEvent *e) { + TQListViewItem *i = itemAt(contentsToViewport(e->pos())); itemDropped(e, i); } -void KWalletEntryList::contentsDragEnterEvent(QDragEnterEvent *e) { +void KWalletEntryList::contentsDragEnterEvent(TQDragEnterEvent *e) { if (e->provides("application/x-kwallet-entry") || e->provides("application/x-kwallet-folder") || e->provides("application/uri-list")) { @@ -544,8 +544,8 @@ void KWalletEntryList::contentsDragEnterEvent(QDragEnterEvent *e) { } } -KWalletFolderItem* KWalletEntryList::getFolder(const QString& name) { - for (QListViewItem *vi = firstChild(); vi; vi = vi->nextSibling()) { +KWalletFolderItem* KWalletEntryList::getFolder(const TQString& name) { + for (TQListViewItem *vi = firstChild(); vi; vi = vi->nextSibling()) { KWalletFolderItem *fi = dynamic_cast<KWalletFolderItem *>(vi); if (!fi) { continue; @@ -557,7 +557,7 @@ KWalletFolderItem* KWalletEntryList::getFolder(const QString& name) { return 0; } -KWalletFolderItem *KWalletEntryList::getItemFolder(QListViewItem *item) { +KWalletFolderItem *KWalletEntryList::getItemFolder(TQListViewItem *item) { switch (item->rtti()) { case KWalletFolderItemClass: return dynamic_cast<KWalletFolderItem *>(item); @@ -572,10 +572,10 @@ KWalletFolderItem *KWalletEntryList::getItemFolder(QListViewItem *item) { /**************** * KWalletIconDrag - Stores the data for wallet drags */ -class KWalletIconDrag : public QIconDrag { +class KWalletIconDrag : public TQIconDrag { public: - KWalletIconDrag(QWidget *dragSource, const char *name = 0L) - : QIconDrag(dragSource, name) { + KWalletIconDrag(TQWidget *dragSource, const char *name = 0L) + : TQIconDrag(dragSource, name) { } virtual ~KWalletIconDrag() {} @@ -589,13 +589,13 @@ class KWalletIconDrag : public QIconDrag { return 0L; } - QByteArray encodedData(const char *mime) const { - QByteArray a; - QCString mimetype(mime); + TQByteArray encodedData(const char *mime) const { + TQByteArray a; + TQCString mimetype(mime); if (mimetype == "application/x-qiconlist") { - return QIconDrag::encodedData(mime); + return TQIconDrag::encodedData(mime); } else if (mimetype == "text/uri-list") { - QCString s = _urls.join("\r\n").latin1(); + TQCString s = _urls.join("\r\n").latin1(); if (_urls.count() > 0) { s.append("\r\n"); } @@ -605,29 +605,29 @@ class KWalletIconDrag : public QIconDrag { return a; } - void append(const QIconDragItem &item, const QRect &pr, - const QRect &tr, const QString &url) { - QIconDrag::append(item, pr, tr); + void append(const TQIconDragItem &item, const TQRect &pr, + const TQRect &tr, const TQString &url) { + TQIconDrag::append(item, pr, tr); _urls.append(url); } private: - QStringList _urls; + TQStringList _urls; }; /**************** * * KWalletIconView - An iconview to store wallets * */ -KWalletIconView::KWalletIconView(QWidget *parent, const char *name) +KWalletIconView::KWalletIconView(TQWidget *parent, const char *name) : KIconView(parent, name) { KGlobal::dirs()->addResourceType("kwallet", "share/apps/kwallet"); - connect(this, SIGNAL(dropped(QDropEvent*, const QValueList<QIconDragItem>&)), SLOT(slotDropped(QDropEvent*, const QValueList<QIconDragItem>&))); + connect(this, TQT_SIGNAL(dropped(TQDropEvent*, const TQValueList<TQIconDragItem>&)), TQT_SLOT(slotDropped(TQDropEvent*, const TQValueList<TQIconDragItem>&))); } KWalletIconView::~KWalletIconView() { } -void KWalletIconView::slotDropped(QDropEvent *e, const QValueList<QIconDragItem>& /*lst*/) { +void KWalletIconView::slotDropped(TQDropEvent *e, const TQValueList<TQIconDragItem>& /*lst*/) { if (e->source() == viewport()) { e->ignore(); return; @@ -638,10 +638,10 @@ void KWalletIconView::slotDropped(QDropEvent *e, const QValueList<QIconDragItem> return; } - QByteArray edata = e->encodedData("text/uri-list"); - QCString urls = edata.data(); + TQByteArray edata = e->encodedData("text/uri-list"); + TQCString urls = edata.data(); - QStringList ul = QStringList::split("\r\n", urls); + TQStringList ul = TQStringList::split("\r\n", urls); if (ul.isEmpty() || ul.first().isEmpty()) { e->ignore(); return; @@ -654,8 +654,8 @@ void KWalletIconView::slotDropped(QDropEvent *e, const QValueList<QIconDragItem> return; } - QString dest = KGlobal::dirs()->saveLocation("kwallet") + u.fileName(); - if (QFile::exists(dest)) { + TQString dest = KGlobal::dirs()->saveLocation("kwallet") + u.fileName(); + if (TQFile::exists(dest)) { KMessageBox::sorry(viewport(), i18n("That wallet file already exists. You cannot overwrite wallets.")); e->ignore(); return; @@ -666,7 +666,7 @@ void KWalletIconView::slotDropped(QDropEvent *e, const QValueList<QIconDragItem> e->accept(); } -void KWalletIconView::contentsMousePressEvent(QMouseEvent *e) { +void KWalletIconView::contentsMousePressEvent(TQMouseEvent *e) { _mousePos = e->pos(); if (!findItem(_mousePos)) { clearSelection(); @@ -674,19 +674,19 @@ void KWalletIconView::contentsMousePressEvent(QMouseEvent *e) { KIconView::contentsMousePressEvent( e ); } -QDragObject *KWalletIconView::dragObject() { +TQDragObject *KWalletIconView::dragObject() { KWalletIconDrag* id = new KWalletIconDrag(viewport(), "KWallet Drag"); - QString path = "file:" + KGlobal::dirs()->saveLocation("kwallet"); - QPoint pos = _mousePos; - for (QIconViewItem *item = firstItem(); item; item = item->nextItem()) { + TQString path = "file:" + KGlobal::dirs()->saveLocation("kwallet"); + TQPoint pos = _mousePos; + for (TQIconViewItem *item = firstItem(); item; item = item->nextItem()) { if (item->isSelected()) { - QString url = path + item->text() + ".kwl"; - QIconDragItem idi; + TQString url = path + item->text() + ".kwl"; + TQIconDragItem idi; idi.setData(url.local8Bit()); id->append(idi, - QRect(item->pixmapRect(false).topLeft() - pos, + TQRect(item->pixmapRect(false).topLeft() - pos, item->pixmapRect(false).size()), - QRect(item->textRect(false).topLeft() - pos, + TQRect(item->textRect(false).topLeft() - pos, item->textRect(false).size()), url); } @@ -698,10 +698,10 @@ QDragObject *KWalletIconView::dragObject() { return id; } -QDragObject *KWalletEntryList::dragObject() { - QListViewItem *i = currentItem(); +TQDragObject *KWalletEntryList::dragObject() { + TQListViewItem *i = currentItem(); - QStoredDrag *sd = 0L; + TQStoredDrag *sd = 0L; if (i->rtti() == KWalletEntryItemClass) { KWalletEntryItem *ei = dynamic_cast<KWalletEntryItem*>(i); @@ -709,8 +709,8 @@ QDragObject *KWalletEntryList::dragObject() { return 0L; } sd = new KWalletEntryDrag(viewport(), "KWallet Entry Drag"); - QByteArray a; - QDataStream ds(a, IO_WriteOnly); + TQByteArray a; + TQDataStream ds(a, IO_WriteOnly); ds << KWALLETENTRYMAGIC; ds << *ei; sd->setEncodedData(a); @@ -720,8 +720,8 @@ QDragObject *KWalletEntryList::dragObject() { return 0L; } sd = new KWalletFolderDrag(viewport(), "KWallet Folder Drag"); - QByteArray a; - QDataStream ds(a, IO_WriteOnly); + TQByteArray a; + TQDataStream ds(a, IO_WriteOnly); ds << KWALLETFOLDERMAGIC; ds << *fi; diff --git a/kwallet/allyourbase.h b/kwallet/allyourbase.h index 7f5ae92..299a6c9 100644 --- a/kwallet/allyourbase.h +++ b/kwallet/allyourbase.h @@ -39,11 +39,11 @@ enum KWalletListItemClasses { class KWalletEntryItem : public KListViewItem { public: - KWalletEntryItem(KWallet::Wallet *w, QListViewItem* parent, const QString& ename); + KWalletEntryItem(KWallet::Wallet *w, TQListViewItem* parent, const TQString& ename); virtual ~KWalletEntryItem(); - const QString& oldName() { return _oldName; } - QString currentName() { return text(0); } + const TQString& oldName() { return _oldName; } + TQString currentName() { return text(0); } void clearOldName() { _oldName = text(0); } virtual int rtti() const; @@ -52,20 +52,20 @@ class KWalletEntryItem : public KListViewItem { KWallet::Wallet *_wallet; private: - QString _oldName; + TQString _oldName; }; class KWalletContainerItem : public KListViewItem { public: - KWalletContainerItem(QListViewItem* parent, const QString& name, + KWalletContainerItem(TQListViewItem* parent, const TQString& name, KWallet::Wallet::EntryType type); virtual ~KWalletContainerItem(); public: virtual int rtti() const; KWallet::Wallet::EntryType type(); - bool contains(const QString& itemKey); - QListViewItem* getItem(const QString& itemKey); + bool contains(const TQString& itemKey); + TQListViewItem* getItem(const TQString& itemKey); private: KWallet::Wallet::EntryType _type; @@ -73,101 +73,101 @@ class KWalletContainerItem : public KListViewItem { class KWalletFolderItem : public KListViewItem { public: - KWalletFolderItem(KWallet::Wallet *w, QListView* parent, - const QString& name, int entries); + KWalletFolderItem(KWallet::Wallet *w, TQListView* parent, + const TQString& name, int entries); virtual ~KWalletFolderItem(); - virtual bool acceptDrop(const QMimeSource *mime) const; + virtual bool acceptDrop(const TQMimeSource *mime) const; virtual int rtti() const; - QString name() const; + TQString name() const; void refresh(); KWalletContainerItem* getContainer(KWallet::Wallet::EntryType type); - QPixmap getFolderIcon(KIcon::Group group); - bool contains(const QString& itemKey); - QListViewItem* getItem(const QString& itemKey); + TQPixmap getFolderIcon(KIcon::Group group); + bool contains(const TQString& itemKey); + TQListViewItem* getItem(const TQString& itemKey); public: KWallet::Wallet *_wallet; private: - QString _name; + TQString _name; int _entries; }; class KWalletEntryList : public KListView { Q_OBJECT public: - KWalletEntryList(QWidget *parent, const char *name = 0L); + KWalletEntryList(TQWidget *parent, const char *name = 0L); virtual ~KWalletEntryList(); - bool existsFolder(const QString& name); - KWalletFolderItem* getFolder(const QString& name); - void contentsDropEvent(QDropEvent *e); - void contentsDragEnterEvent(QDragEnterEvent *e); + bool existsFolder(const TQString& name); + KWalletFolderItem* getFolder(const TQString& name); + void contentsDropEvent(TQDropEvent *e); + void contentsDragEnterEvent(TQDragEnterEvent *e); void setWallet(KWallet::Wallet *w); protected: - void itemDropped(QDropEvent *e, QListViewItem *item); - virtual QDragObject *dragObject(); - virtual bool acceptDrag (QDropEvent* event) const; + void itemDropped(TQDropEvent *e, TQListViewItem *item); + virtual TQDragObject *dragObject(); + virtual bool acceptDrag (TQDropEvent* event) const; private: - static KWalletFolderItem *getItemFolder(QListViewItem *item); + static KWalletFolderItem *getItemFolder(TQListViewItem *item); public: KWallet::Wallet *_wallet; }; -class KWalletItem : public QIconViewItem { +class KWalletItem : public TQIconViewItem { public: - KWalletItem(QIconView *parent, const QString& walletName); + KWalletItem(TQIconView *parent, const TQString& walletName); virtual ~KWalletItem(); - virtual bool acceptDrop(const QMimeSource *mime) const; + virtual bool acceptDrop(const TQMimeSource *mime) const; protected: - virtual void dropped(QDropEvent *e, const QValueList<QIconDragItem>& lst); + virtual void dropped(TQDropEvent *e, const TQValueList<TQIconDragItem>& lst); }; class KWalletIconView : public KIconView { Q_OBJECT public: - KWalletIconView(QWidget *parent, const char *name = 0L); + KWalletIconView(TQWidget *parent, const char *name = 0L); virtual ~KWalletIconView(); protected slots: - virtual void slotDropped(QDropEvent *e, const QValueList<QIconDragItem>& lst); + virtual void slotDropped(TQDropEvent *e, const TQValueList<TQIconDragItem>& lst); protected: - virtual QDragObject *dragObject(); - virtual void contentsMousePressEvent(QMouseEvent *e); - QPoint _mousePos; + virtual TQDragObject *dragObject(); + virtual void contentsMousePressEvent(TQMouseEvent *e); + TQPoint _mousePos; }; -inline QDataStream& operator<<(QDataStream& str, const KWalletEntryItem& w) { - QString name = w.text(0); +inline TQDataStream& operator<<(TQDataStream& str, const KWalletEntryItem& w) { + TQString name = w.text(0); str << name; KWallet::Wallet::EntryType et = w._wallet->entryType(name); str << long(et); - QByteArray a; + TQByteArray a; w._wallet->readEntry(name, a); str << a; return str; } -inline QDataStream& operator<<(QDataStream& str, const KWalletFolderItem& w) { - QString oldFolder = w._wallet->currentFolder(); +inline TQDataStream& operator<<(TQDataStream& str, const KWalletFolderItem& w) { + TQString oldFolder = w._wallet->currentFolder(); str << w.name(); w._wallet->setFolder(w.name()); - QStringList entries = w._wallet->entryList(); - for (QStringList::Iterator it = entries.begin(); it != entries.end(); ++it) { + TQStringList entries = w._wallet->entryList(); + for (TQStringList::Iterator it = entries.begin(); it != entries.end(); ++it) { str << *it; KWallet::Wallet::EntryType et = w._wallet->entryType(*it); str << long(et); - QByteArray a; + TQByteArray a; w._wallet->readEntry(*it, a); str << a; } diff --git a/kwallet/kbetterthankdialogbase.ui.h b/kwallet/kbetterthankdialogbase.ui.h index 3937746..4d32a14 100644 --- a/kwallet/kbetterthankdialogbase.ui.h +++ b/kwallet/kbetterthankdialogbase.ui.h @@ -25,7 +25,7 @@ void KBetterThanKDialogBase::clicked() } -void KBetterThanKDialogBase::setLabel( const QString & label ) +void KBetterThanKDialogBase::setLabel( const TQString & label ) { _label->setText(label); } @@ -45,6 +45,6 @@ void KBetterThanKDialogBase::accept() void KBetterThanKDialogBase::reject() { - QDialog::reject(); + TQDialog::reject(); setResult(4); } diff --git a/kwallet/konfigurator/konfigurator.cpp b/kwallet/konfigurator/konfigurator.cpp index a5fc336..25e5239 100644 --- a/kwallet/konfigurator/konfigurator.cpp +++ b/kwallet/konfigurator/konfigurator.cpp @@ -30,17 +30,17 @@ #include <kpopupmenu.h> #include <kwallet.h> -#include <qcheckbox.h> -#include <qcombobox.h> -#include <qlayout.h> -#include <qlistview.h> -#include <qpushbutton.h> -#include <qspinbox.h> - -typedef KGenericFactory<KWalletConfig, QWidget> KWalletFactory; +#include <tqcheckbox.h> +#include <tqcombobox.h> +#include <tqlayout.h> +#include <tqlistview.h> +#include <tqpushbutton.h> +#include <tqspinbox.h> + +typedef KGenericFactory<KWalletConfig, TQWidget> KWalletFactory; K_EXPORT_COMPONENT_FACTORY(kcm_kwallet, KWalletFactory("kcmkwallet")) -KWalletConfig::KWalletConfig(QWidget *parent, const char *name, const QStringList&) +KWalletConfig::KWalletConfig(TQWidget *parent, const char *name, const TQStringList&) : KCModule(KWalletFactory::instance(), parent, name) { KAboutData *about = @@ -53,24 +53,24 @@ KWalletConfig::KWalletConfig(QWidget *parent, const char *name, const QStringLis _cfg = new KConfig("kwalletrc", false, false); - QVBoxLayout *vbox = new QVBoxLayout(this, 0, KDialog::spacingHint()); + TQVBoxLayout *vbox = new TQVBoxLayout(this, 0, KDialog::spacingHint()); vbox->add(_wcw = new WalletConfigWidget(this)); - connect(_wcw->_enabled, SIGNAL(clicked()), this, SLOT(configChanged())); - connect(_wcw->_launchManager, SIGNAL(clicked()), this, SLOT(configChanged())); - connect(_wcw->_autocloseManager, SIGNAL(clicked()), this, SLOT(configChanged())); - connect(_wcw->_autoclose, SIGNAL(clicked()), this, SLOT(configChanged())); - connect(_wcw->_closeIdle, SIGNAL(clicked()), this, SLOT(configChanged())); - connect(_wcw->_openPrompt, SIGNAL(clicked()), this, SLOT(configChanged())); - connect(_wcw->_screensaverLock, SIGNAL(clicked()), this, SLOT(configChanged())); - connect(_wcw->_localWalletSelected, SIGNAL(clicked()), this, SLOT(configChanged())); - connect(_wcw->_idleTime, SIGNAL(valueChanged(int)), this, SLOT(configChanged())); - connect(_wcw->_launch, SIGNAL(clicked()), this, SLOT(launchManager())); - connect(_wcw->_newWallet, SIGNAL(clicked()), this, SLOT(newNetworkWallet())); - connect(_wcw->_newLocalWallet, SIGNAL(clicked()), this, SLOT(newLocalWallet())); - connect(_wcw->_localWallet, SIGNAL(activated(int)), this, SLOT(configChanged())); - connect(_wcw->_defaultWallet, SIGNAL(activated(int)), this, SLOT(configChanged())); - connect(_wcw->_accessList, SIGNAL(contextMenuRequested(QListViewItem*, const QPoint&, int)), this, SLOT(contextMenuRequested(QListViewItem*, const QPoint&, int))); + connect(_wcw->_enabled, TQT_SIGNAL(clicked()), this, TQT_SLOT(configChanged())); + connect(_wcw->_launchManager, TQT_SIGNAL(clicked()), this, TQT_SLOT(configChanged())); + connect(_wcw->_autocloseManager, TQT_SIGNAL(clicked()), this, TQT_SLOT(configChanged())); + connect(_wcw->_autoclose, TQT_SIGNAL(clicked()), this, TQT_SLOT(configChanged())); + connect(_wcw->_closeIdle, TQT_SIGNAL(clicked()), this, TQT_SLOT(configChanged())); + connect(_wcw->_openPrompt, TQT_SIGNAL(clicked()), this, TQT_SLOT(configChanged())); + connect(_wcw->_screensaverLock, TQT_SIGNAL(clicked()), this, TQT_SLOT(configChanged())); + connect(_wcw->_localWalletSelected, TQT_SIGNAL(clicked()), this, TQT_SLOT(configChanged())); + connect(_wcw->_idleTime, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(configChanged())); + connect(_wcw->_launch, TQT_SIGNAL(clicked()), this, TQT_SLOT(launchManager())); + connect(_wcw->_newWallet, TQT_SIGNAL(clicked()), this, TQT_SLOT(newNetworkWallet())); + connect(_wcw->_newLocalWallet, TQT_SIGNAL(clicked()), this, TQT_SLOT(newLocalWallet())); + connect(_wcw->_localWallet, TQT_SIGNAL(activated(int)), this, TQT_SLOT(configChanged())); + connect(_wcw->_defaultWallet, TQT_SIGNAL(activated(int)), this, TQT_SLOT(configChanged())); + connect(_wcw->_accessList, TQT_SIGNAL(contextMenuRequested(TQListViewItem*, const TQPoint&, int)), this, TQT_SLOT(contextMenuRequested(TQListViewItem*, const TQPoint&, int))); _wcw->_accessList->setAllColumnsShowFocus(true); updateWalletLists(); @@ -90,14 +90,14 @@ KWalletConfig::~KWalletConfig() { void KWalletConfig::updateWalletLists() { - QString p1, p2; + TQString p1, p2; p1 = _wcw->_localWallet->currentText(); p2 = _wcw->_defaultWallet->currentText(); _wcw->_localWallet->clear(); _wcw->_defaultWallet->clear(); - QStringList wl = KWallet::Wallet::walletList(); + TQStringList wl = KWallet::Wallet::walletList(); _wcw->_localWallet->insertStringList(wl); _wcw->_defaultWallet->insertStringList(wl); @@ -111,22 +111,22 @@ void KWalletConfig::updateWalletLists() { } -QString KWalletConfig::newWallet() { +TQString KWalletConfig::newWallet() { bool ok; - QString n = KInputDialog::getText(i18n("New Wallet"), + TQString n = KInputDialog::getText(i18n("New Wallet"), i18n("Please choose a name for the new wallet:"), - QString::null, + TQString::null, &ok, this); if (!ok) { - return QString::null; + return TQString::null; } KWallet::Wallet *w = KWallet::Wallet::openWallet(n); if (!w) { - return QString::null; + return TQString::null; } delete w; @@ -135,7 +135,7 @@ QString KWalletConfig::newWallet() { void KWalletConfig::newLocalWallet() { - QString n = newWallet(); + TQString n = newWallet(); if (n.isEmpty()) { return; } @@ -149,7 +149,7 @@ void KWalletConfig::newLocalWallet() { void KWalletConfig::newNetworkWallet() { - QString n = newWallet(); + TQString n = newWallet(); if (n.isEmpty()) { return; } @@ -205,29 +205,29 @@ void KWalletConfig::load(bool useDefaults) { } _wcw->_accessList->clear(); _cfg->setGroup("Auto Deny"); - QStringList denykeys = _cfg->entryMap("Auto Deny").keys(); + TQStringList denykeys = _cfg->entryMap("Auto Deny").keys(); _cfg->setGroup("Auto Allow"); - QStringList keys = _cfg->entryMap("Auto Allow").keys(); - for (QStringList::Iterator i = keys.begin(); i != keys.end(); ++i) { + TQStringList keys = _cfg->entryMap("Auto Allow").keys(); + for (TQStringList::Iterator i = keys.begin(); i != keys.end(); ++i) { _cfg->setGroup("Auto Allow"); - QStringList apps = _cfg->readListEntry(*i); + TQStringList apps = _cfg->readListEntry(*i); _cfg->setGroup("Auto Deny"); - QStringList denyapps = _cfg->readListEntry(*i); + TQStringList denyapps = _cfg->readListEntry(*i); denykeys.remove(*i); - QListViewItem *lvi = new QListViewItem(_wcw->_accessList, *i); - for (QStringList::Iterator j = apps.begin(); j != apps.end(); ++j) { - new QListViewItem(lvi, QString::null, *j, i18n("Always Allow")); + TQListViewItem *lvi = new TQListViewItem(_wcw->_accessList, *i); + for (TQStringList::Iterator j = apps.begin(); j != apps.end(); ++j) { + new TQListViewItem(lvi, TQString::null, *j, i18n("Always Allow")); } - for (QStringList::Iterator j = denyapps.begin(); j != denyapps.end(); ++j) { - new QListViewItem(lvi, QString::null, *j, i18n("Always Deny")); + for (TQStringList::Iterator j = denyapps.begin(); j != denyapps.end(); ++j) { + new TQListViewItem(lvi, TQString::null, *j, i18n("Always Deny")); } } _cfg->setGroup("Auto Deny"); - for (QStringList::Iterator i = denykeys.begin(); i != denykeys.end(); ++i) { - QStringList denyapps = _cfg->readListEntry(*i); - QListViewItem *lvi = new QListViewItem(_wcw->_accessList, *i); - for (QStringList::Iterator j = denyapps.begin(); j != denyapps.end(); ++j) { - new QListViewItem(lvi, QString::null, *j, i18n("Always Deny")); + for (TQStringList::Iterator i = denykeys.begin(); i != denykeys.end(); ++i) { + TQStringList denyapps = _cfg->readListEntry(*i); + TQListViewItem *lvi = new TQListViewItem(_wcw->_accessList, *i); + for (TQStringList::Iterator j = denyapps.begin(); j != denyapps.end(); ++j) { + new TQListViewItem(lvi, TQString::null, *j, i18n("Always Deny")); } } emit changed(useDefaults); @@ -262,9 +262,9 @@ void KWalletConfig::save() { _cfg->deleteGroup("Auto Allow"); _cfg->deleteGroup("Auto Deny"); _cfg->setGroup("Auto Allow"); - for (QListViewItem *i = _wcw->_accessList->firstChild(); i; i = i->nextSibling()) { - QStringList al; - for (QListViewItem *j = i->firstChild(); j; j = j->nextSibling()) { + for (TQListViewItem *i = _wcw->_accessList->firstChild(); i; i = i->nextSibling()) { + TQStringList al; + for (TQListViewItem *j = i->firstChild(); j; j = j->nextSibling()) { if (j->text(2) == i18n("Always Allow")) { al << j->text(1); } @@ -273,9 +273,9 @@ void KWalletConfig::save() { } _cfg->setGroup("Auto Deny"); - for (QListViewItem *i = _wcw->_accessList->firstChild(); i; i = i->nextSibling()) { - QStringList al; - for (QListViewItem *j = i->firstChild(); j; j = j->nextSibling()) { + for (TQListViewItem *i = _wcw->_accessList->firstChild(); i; i = i->nextSibling()) { + TQStringList al; + for (TQListViewItem *j = i->firstChild(); j; j = j->nextSibling()) { if (j->text(2) == i18n("Always Deny")) { al << j->text(1); } @@ -295,24 +295,24 @@ void KWalletConfig::defaults() { } -QString KWalletConfig::quickHelp() const { +TQString KWalletConfig::quickHelp() const { return i18n("This configuration module allows you to configure the KDE wallet system."); } -void KWalletConfig::contextMenuRequested(QListViewItem *item, const QPoint& pos, int col) { +void KWalletConfig::contextMenuRequested(TQListViewItem *item, const TQPoint& pos, int col) { Q_UNUSED(col) if (item && item->parent()) { KPopupMenu *m = new KPopupMenu(this); m->insertTitle(item->parent()->text(0)); - m->insertItem(i18n("&Delete"), this, SLOT(deleteEntry()), Key_Delete); + m->insertItem(i18n("&Delete"), this, TQT_SLOT(deleteEntry()), Key_Delete); m->popup(pos); } } void KWalletConfig::deleteEntry() { - QListViewItem *item = _wcw->_accessList->selectedItem(); + TQListViewItem *item = _wcw->_accessList->selectedItem(); if (item) { delete item; emit changed(true); diff --git a/kwallet/konfigurator/konfigurator.h b/kwallet/konfigurator/konfigurator.h index e12ebfc..0d4d4b6 100644 --- a/kwallet/konfigurator/konfigurator.h +++ b/kwallet/konfigurator/konfigurator.h @@ -29,7 +29,7 @@ class QListViewItem; class KWalletConfig : public KCModule { Q_OBJECT public: - KWalletConfig(QWidget *parent = 0L, const char *name = 0L, const QStringList& = QStringList()); + KWalletConfig(TQWidget *parent = 0L, const char *name = 0L, const TQStringList& = TQStringList()); virtual ~KWalletConfig(); void load(); @@ -37,7 +37,7 @@ class KWalletConfig : public KCModule { void save(); void defaults(); - QString quickHelp() const; + TQString quickHelp() const; public slots: void configChanged(); @@ -45,9 +45,9 @@ class KWalletConfig : public KCModule { void newLocalWallet(); void newNetworkWallet(); void updateWalletLists(); - QString newWallet(); + TQString newWallet(); void deleteEntry(); - void contextMenuRequested(QListViewItem *item, const QPoint& pos, int col); + void contextMenuRequested(TQListViewItem *item, const TQPoint& pos, int col); private: WalletConfigWidget *_wcw; diff --git a/kwallet/kwalleteditor.cpp b/kwallet/kwalleteditor.cpp index d9e49d0..adaec87 100644 --- a/kwallet/kwalleteditor.cpp +++ b/kwallet/kwalleteditor.cpp @@ -45,30 +45,30 @@ #include <kstringhandler.h> #include <ktempfile.h> -#include <qcheckbox.h> -#include <qcombobox.h> -#include <qclipboard.h> -#include <qlabel.h> -#include <qlayout.h> -#include <qlineedit.h> -#include <qlistview.h> -#include <qptrstack.h> -#include <qpushbutton.h> -#include <qstylesheet.h> -#include <qtextedit.h> -#include <qtimer.h> -#include <qwidgetstack.h> +#include <tqcheckbox.h> +#include <tqcombobox.h> +#include <tqclipboard.h> +#include <tqlabel.h> +#include <tqlayout.h> +#include <tqlineedit.h> +#include <tqlistview.h> +#include <tqptrstack.h> +#include <tqpushbutton.h> +#include <tqstylesheet.h> +#include <tqtextedit.h> +#include <tqtimer.h> +#include <tqwidgetstack.h> #include <assert.h> #include <stdlib.h> -KWalletEditor::KWalletEditor(const QString& wallet, bool isPath, QWidget *parent, const char *name) +KWalletEditor::KWalletEditor(const TQString& wallet, bool isPath, TQWidget *parent, const char *name) : KMainWindow(parent, name), _walletName(wallet), _nonLocal(isPath) { _newWallet = false; _ww = new WalletWidget(this, "Wallet Widget"); - _copyPassAction = KStdAction::copy(this, SLOT(copyPassword()), actionCollection()); + _copyPassAction = KStdAction::copy(this, TQT_SLOT(copyPassword()), actionCollection()); - QVBoxLayout *box = new QVBoxLayout(_ww->_entryListFrame); + TQVBoxLayout *box = new TQVBoxLayout(_ww->_entryListFrame); box->setSpacing( KDialog::spacingHint() ); box->setMargin( KDialog::marginHint() ); _entryList = new KWalletEntryList(_ww->_entryListFrame, "Wallet Entry List"); @@ -77,9 +77,9 @@ KWalletEditor::KWalletEditor(const QString& wallet, bool isPath, QWidget *parent _ww->_entryStack->setEnabled(true); - box = new QVBoxLayout(_ww->_entryStack->widget(2)); - _mapEditorShowHide = new QCheckBox(i18n("&Show values"), _ww->_entryStack->widget(2)); - connect(_mapEditorShowHide, SIGNAL(toggled(bool)), this, SLOT(showHideMapEditorValue(bool))); + box = new TQVBoxLayout(_ww->_entryStack->widget(2)); + _mapEditorShowHide = new TQCheckBox(i18n("&Show values"), _ww->_entryStack->widget(2)); + connect(_mapEditorShowHide, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(showHideMapEditorValue(bool))); _mapEditor = new KWMapEditor(_currentMap, _ww->_entryStack->widget(2)); box->addWidget(_mapEditorShowHide); box->addWidget(_mapEditor); @@ -88,40 +88,40 @@ KWalletEditor::KWalletEditor(const QString& wallet, bool isPath, QWidget *parent resize(600, 400); - connect(_entryList, SIGNAL(selectionChanged(QListViewItem*)), - this, SLOT(entrySelectionChanged(QListViewItem*))); + connect(_entryList, TQT_SIGNAL(selectionChanged(TQListViewItem*)), + this, TQT_SLOT(entrySelectionChanged(TQListViewItem*))); connect(_entryList, - SIGNAL(contextMenuRequested(QListViewItem*,const QPoint&,int)), + TQT_SIGNAL(contextMenuRequested(TQListViewItem*,const TQPoint&,int)), this, - SLOT(listContextMenuRequested(QListViewItem*,const QPoint&,int))); + TQT_SLOT(listContextMenuRequested(TQListViewItem*,const TQPoint&,int))); connect(_entryList, - SIGNAL(itemRenamed(QListViewItem*, int, const QString&)), + TQT_SIGNAL(itemRenamed(TQListViewItem*, int, const TQString&)), this, - SLOT(listItemRenamed(QListViewItem*, int, const QString&))); + TQT_SLOT(listItemRenamed(TQListViewItem*, int, const TQString&))); - connect(_ww->_passwordValue, SIGNAL(textChanged()), - this, SLOT(entryEditted())); - connect(_mapEditor, SIGNAL(dirty()), - this, SLOT(entryEditted())); + connect(_ww->_passwordValue, TQT_SIGNAL(textChanged()), + this, TQT_SLOT(entryEditted())); + connect(_mapEditor, TQT_SIGNAL(dirty()), + this, TQT_SLOT(entryEditted())); - connect(_ww->_undoChanges, SIGNAL(clicked()), - this, SLOT(restoreEntry())); - connect(_ww->_saveChanges, SIGNAL(clicked()), - this, SLOT(saveEntry())); + connect(_ww->_undoChanges, TQT_SIGNAL(clicked()), + this, TQT_SLOT(restoreEntry())); + connect(_ww->_saveChanges, TQT_SIGNAL(clicked()), + this, TQT_SLOT(saveEntry())); - connect(_ww->_showContents, SIGNAL(clicked()), - this, SLOT(showPasswordContents())); - connect(_ww->_hideContents, SIGNAL(clicked()), - this, SLOT(hidePasswordContents())); + connect(_ww->_showContents, TQT_SIGNAL(clicked()), + this, TQT_SLOT(showPasswordContents())); + connect(_ww->_hideContents, TQT_SIGNAL(clicked()), + this, TQT_SLOT(hidePasswordContents())); _walletIsOpen = false; _w = KWallet::Wallet::openWallet(wallet, winId(), isPath ? KWallet::Wallet::Path : KWallet::Wallet::Asynchronous); if (_w) { - connect(_w, SIGNAL(walletOpened(bool)), this, SLOT(walletOpened(bool))); - connect(_w, SIGNAL(walletClosed()), this, SLOT(walletClosed())); - connect(_w, SIGNAL(folderUpdated(const QString&)), this, SLOT(updateEntries(const QString&))); - connect(_w, SIGNAL(folderListUpdated()), this, SLOT(updateFolderList())); + connect(_w, TQT_SIGNAL(walletOpened(bool)), this, TQT_SLOT(walletOpened(bool))); + connect(_w, TQT_SIGNAL(walletClosed()), this, TQT_SLOT(walletClosed())); + connect(_w, TQT_SIGNAL(folderUpdated(const TQString&)), this, TQT_SLOT(updateEntries(const TQString&))); + connect(_w, TQT_SIGNAL(folderListUpdated()), this, TQT_SLOT(updateFolderList())); updateFolderList(); } else { kdDebug(2300) << "Wallet open failed!" << endl; @@ -133,7 +133,7 @@ KWalletEditor::KWalletEditor(const QString& wallet, bool isPath, QWidget *parent setCaption(wallet); - QTimer::singleShot(0, this, SLOT(layout())); + TQTimer::singleShot(0, this, TQT_SLOT(layout())); } KWalletEditor::~KWalletEditor() { @@ -150,7 +150,7 @@ KWalletEditor::~KWalletEditor() { } void KWalletEditor::layout() { - QValueList<int> sz = _ww->_splitter->sizes(); + TQValueList<int> sz = _ww->_splitter->sizes(); int sum = sz[0] + sz[1]; sz[0] = sum/2; sz[1] = sum/2; @@ -159,49 +159,49 @@ void KWalletEditor::layout() { void KWalletEditor::createActions() { _newFolderAction = new KAction(i18n("&New Folder..."), "folder_new", - 0, this, SLOT(createFolder()), actionCollection(), + 0, this, TQT_SLOT(createFolder()), actionCollection(), "create_folder"); - connect(this, SIGNAL(enableFolderActions(bool)), - _newFolderAction, SLOT(setEnabled(bool))); + connect(this, TQT_SIGNAL(enableFolderActions(bool)), + _newFolderAction, TQT_SLOT(setEnabled(bool))); _deleteFolderAction = new KAction(i18n("&Delete Folder"), 0, 0, - this, SLOT(deleteFolder()), actionCollection(), + this, TQT_SLOT(deleteFolder()), actionCollection(), "delete_folder"); - connect(this, SIGNAL(enableContextFolderActions(bool)), - _deleteFolderAction, SLOT(setEnabled(bool))); - connect(this, SIGNAL(enableFolderActions(bool)), - _deleteFolderAction, SLOT(setEnabled(bool))); + connect(this, TQT_SIGNAL(enableContextFolderActions(bool)), + _deleteFolderAction, TQT_SLOT(setEnabled(bool))); + connect(this, TQT_SIGNAL(enableFolderActions(bool)), + _deleteFolderAction, TQT_SLOT(setEnabled(bool))); _passwordAction = new KAction(i18n("Change &Password..."), 0, 0, this, - SLOT(changePassword()), actionCollection(), + TQT_SLOT(changePassword()), actionCollection(), "change_password"); - connect(this, SIGNAL(enableWalletActions(bool)), - _passwordAction, SLOT(setEnabled(bool))); + connect(this, TQT_SIGNAL(enableWalletActions(bool)), + _passwordAction, TQT_SLOT(setEnabled(bool))); _mergeAction = new KAction(i18n("&Merge Wallet..."), 0, 0, this, - SLOT(importWallet()), actionCollection(), + TQT_SLOT(importWallet()), actionCollection(), "merge"); - connect(this, SIGNAL(enableWalletActions(bool)), - _mergeAction, SLOT(setEnabled(bool))); + connect(this, TQT_SIGNAL(enableWalletActions(bool)), + _mergeAction, TQT_SLOT(setEnabled(bool))); _importAction = new KAction(i18n("&Import XML..."), 0, 0, this, - SLOT(importXML()), actionCollection(), + TQT_SLOT(importXML()), actionCollection(), "import"); - connect(this, SIGNAL(enableWalletActions(bool)), - _importAction, SLOT(setEnabled(bool))); + connect(this, TQT_SIGNAL(enableWalletActions(bool)), + _importAction, TQT_SLOT(setEnabled(bool))); _exportAction = new KAction(i18n("&Export..."), 0, 0, this, - SLOT(exportXML()), actionCollection(), + TQT_SLOT(exportXML()), actionCollection(), "export"); - connect(this, SIGNAL(enableWalletActions(bool)), - _exportAction, SLOT(setEnabled(bool))); + connect(this, TQT_SIGNAL(enableWalletActions(bool)), + _exportAction, TQT_SLOT(setEnabled(bool))); - _saveAsAction = KStdAction::saveAs(this, SLOT(saveAs()), actionCollection()); - connect(this, SIGNAL(enableWalletActions(bool)), - _saveAsAction, SLOT(setEnabled(bool))); + _saveAsAction = KStdAction::saveAs(this, TQT_SLOT(saveAs()), actionCollection()); + connect(this, TQT_SIGNAL(enableWalletActions(bool)), + _saveAsAction, TQT_SLOT(setEnabled(bool))); - KStdAction::quit(this, SLOT(close()), actionCollection()); - KStdAction::keyBindings(guiFactory(), SLOT(configureShortcuts()), + KStdAction::quit(this, TQT_SLOT(close()), actionCollection()); + KStdAction::keyBindings(guiFactory(), TQT_SLOT(configureShortcuts()), actionCollection()); emit enableWalletActions(false); emit enableFolderActions(false); @@ -222,10 +222,10 @@ void KWalletEditor::walletClosed() { void KWalletEditor::updateFolderList(bool checkEntries) { - QStringList fl = _w->folderList(); - QPtrStack<QListViewItem> trash; + TQStringList fl = _w->folderList(); + TQPtrStack<TQListViewItem> trash; - for (QListViewItem *i = _entryList->firstChild(); i; i = i->nextSibling()) { + for (TQListViewItem *i = _entryList->firstChild(); i; i = i->nextSibling()) { KWalletFolderItem *fi = dynamic_cast<KWalletFolderItem *>(i); if (!fi) { continue; @@ -238,7 +238,7 @@ void KWalletEditor::updateFolderList(bool checkEntries) { trash.setAutoDelete(true); trash.clear(); - for (QStringList::Iterator i = fl.begin(); i != fl.end(); ++i) { + for (TQStringList::Iterator i = fl.begin(); i != fl.end(); ++i) { if (_entryList->existsFolder(*i)) { if (checkEntries) { updateEntries(*i); @@ -247,7 +247,7 @@ void KWalletEditor::updateFolderList(bool checkEntries) { } _w->setFolder(*i); - QStringList entries = _w->entryList(); + TQStringList entries = _w->entryList(); KWalletFolderItem *item = new KWalletFolderItem(_w,_entryList, *i, entries.count()); @@ -256,7 +256,7 @@ void KWalletEditor::updateFolderList(bool checkEntries) { KWalletContainerItem *bi = new KWalletContainerItem(item, i18n("Binary Data"),KWallet::Wallet::Stream); KWalletContainerItem *ui = new KWalletContainerItem(item, i18n("Unknown"),KWallet::Wallet::Unknown); - for (QStringList::Iterator j = entries.begin(); j != entries.end(); ++j) { + for (TQStringList::Iterator j = entries.begin(); j != entries.end(); ++j) { switch (_w->entryType(*j)) { case KWallet::Wallet::Password: new KWalletEntryItem(_w, pi, *j); @@ -269,7 +269,7 @@ void KWalletEditor::updateFolderList(bool checkEntries) { break; case KWallet::Wallet::Unknown: default: - new QListViewItem(ui, *j); + new TQListViewItem(ui, *j); break; } } @@ -286,7 +286,7 @@ void KWalletEditor::updateFolderList(bool checkEntries) { void KWalletEditor::deleteFolder() { if (_w) { - QListViewItem *i = _entryList->currentItem(); + TQListViewItem *i = _entryList->currentItem(); if (i) { KWalletFolderItem *fi = dynamic_cast<KWalletFolderItem *>(i); if (!fi) { @@ -312,13 +312,13 @@ void KWalletEditor::deleteFolder() { void KWalletEditor::createFolder() { if (_w) { - QString n; + TQString n; bool ok; do { n = KInputDialog::getText(i18n("New Folder"), i18n("Please choose a name for the new folder:"), - QString::null, + TQString::null, &ok, this); @@ -327,11 +327,11 @@ void KWalletEditor::createFolder() { } if (_entryList->existsFolder(n)) { - int rc = KMessageBox::questionYesNo(this, i18n("Sorry, that folder name is in use. Try again?"), QString::null, i18n("Try Again"), i18n("Do Not Try")); + int rc = KMessageBox::questionYesNo(this, i18n("Sorry, that folder name is in use. Try again?"), TQString::null, i18n("Try Again"), i18n("Do Not Try")); if (rc == KMessageBox::Yes) { continue; } - n = QString::null; + n = TQString::null; } break; } while (true); @@ -344,7 +344,7 @@ void KWalletEditor::createFolder() { void KWalletEditor::saveEntry() { int rc = 1; - QListViewItem *item = _entryList->currentItem(); + TQListViewItem *item = _entryList->currentItem(); _ww->_saveChanges->setEnabled(false); _ww->_undoChanges->setEnabled(false); @@ -381,7 +381,7 @@ void KWalletEditor::entryEditted() { } -void KWalletEditor::entrySelectionChanged(QListViewItem *item) { +void KWalletEditor::entrySelectionChanged(TQListViewItem *item) { KWalletContainerItem *ci = 0L; KWalletFolderItem *fi = 0L; @@ -398,7 +398,7 @@ void KWalletEditor::entrySelectionChanged(QListViewItem *item) { _w->setFolder(fi->name()); _deleteFolderAction->setEnabled(false); if (ci->type() == KWallet::Wallet::Password) { - QString pass; + TQString pass; if (_w->readPassword(item->text(0), pass) == 0) { _ww->_entryStack->raiseWidget(int(4)); _ww->_entryName->setText(i18n("Password: %1") @@ -419,7 +419,7 @@ void KWalletEditor::entrySelectionChanged(QListViewItem *item) { } } else if (ci->type() == KWallet::Wallet::Stream) { _ww->_entryStack->raiseWidget(int(3)); - QByteArray ba; + TQByteArray ba; if (_w->readEntry(item->text(0), ba) == 0) { _ww->_entryName->setText(i18n("Binary Data: %1") .arg(item->text(0))); @@ -454,16 +454,16 @@ void KWalletEditor::entrySelectionChanged(QListViewItem *item) { if (fi) { _currentFolder = fi->name(); - _ww->_entryTitle->setText(QString("<font size=\"+1\">%1</font>").arg(fi->text(0))); + _ww->_entryTitle->setText(TQString("<font size=\"+1\">%1</font>").arg(fi->text(0))); _ww->_iconTitle->setPixmap(fi->getFolderIcon(KIcon::Toolbar)); } } -void KWalletEditor::updateEntries(const QString& folder) { - QPtrStack<QListViewItem> trash; +void KWalletEditor::updateEntries(const TQString& folder) { + TQPtrStack<TQListViewItem> trash; _w->setFolder(folder); - QStringList entries = _w->entryList(); + TQStringList entries = _w->entryList(); KWalletFolderItem *fi = _entryList->getFolder(folder); @@ -477,7 +477,7 @@ void KWalletEditor::updateEntries(const QString& folder) { KWalletContainerItem *ui = fi->getContainer(KWallet::Wallet::Unknown); // Remove deleted entries - for (QListViewItem *i = pi->firstChild(); i; i = i->nextSibling()) { + for (TQListViewItem *i = pi->firstChild(); i; i = i->nextSibling()) { if (!entries.contains(i->text(0))) { if (i == _entryList->currentItem()) { entrySelectionChanged(0L); @@ -486,7 +486,7 @@ void KWalletEditor::updateEntries(const QString& folder) { } } - for (QListViewItem *i = mi->firstChild(); i; i = i->nextSibling()) { + for (TQListViewItem *i = mi->firstChild(); i; i = i->nextSibling()) { if (!entries.contains(i->text(0))) { if (i == _entryList->currentItem()) { entrySelectionChanged(0L); @@ -495,7 +495,7 @@ void KWalletEditor::updateEntries(const QString& folder) { } } - for (QListViewItem *i = bi->firstChild(); i; i = i->nextSibling()) { + for (TQListViewItem *i = bi->firstChild(); i; i = i->nextSibling()) { if (!entries.contains(i->text(0))) { if (i == _entryList->currentItem()) { entrySelectionChanged(0L); @@ -504,7 +504,7 @@ void KWalletEditor::updateEntries(const QString& folder) { } } - for (QListViewItem *i = ui->firstChild(); i; i = i->nextSibling()) { + for (TQListViewItem *i = ui->firstChild(); i; i = i->nextSibling()) { if (!entries.contains(i->text(0))) { if (i == _entryList->currentItem()) { entrySelectionChanged(0L); @@ -517,7 +517,7 @@ void KWalletEditor::updateEntries(const QString& folder) { trash.clear(); // Add new entries - for (QStringList::Iterator i = entries.begin(); i != entries.end(); ++i) { + for (TQStringList::Iterator i = entries.begin(); i != entries.end(); ++i) { if (fi->contains(*i)){ continue; } @@ -534,13 +534,13 @@ void KWalletEditor::updateEntries(const QString& folder) { break; case KWallet::Wallet::Unknown: default: - new QListViewItem(ui, *i); + new TQListViewItem(ui, *i); break; } } fi->refresh(); if (fi->name() == _currentFolder) { - _ww->_entryTitle->setText(QString("<font size=\"+1\">%1</font>").arg(fi->text(0))); + _ww->_entryTitle->setText(TQString("<font size=\"+1\">%1</font>").arg(fi->text(0))); } if (!_entryList->selectedItem()) { _ww->_entryName->clear(); @@ -548,7 +548,7 @@ void KWalletEditor::updateEntries(const QString& folder) { } } -void KWalletEditor::listContextMenuRequested(QListViewItem *item, const QPoint& pos, int col) { +void KWalletEditor::listContextMenuRequested(TQListViewItem *item, const TQPoint& pos, int col) { Q_UNUSED(col) if (!_walletIsOpen) { @@ -579,15 +579,15 @@ void KWalletEditor::listContextMenuRequested(QListViewItem *item, const QPoint& KPopupMenu *m = new KPopupMenu(this); if (item) { - QString title = item->text(0); + TQString title = item->text(0); // I think 200 pixels is wide enough for a title title = KStringHandler::cPixelSqueeze(title, m->fontMetrics(), 200); m->insertTitle(title); switch (menuClass) { case KWalletEntryItemClass: - m->insertItem(i18n("&New..." ), this, SLOT(newEntry()), Key_Insert); - m->insertItem(i18n( "&Rename" ), this, SLOT(renameEntry()), Key_F2); - m->insertItem(i18n( "&Delete" ), this, SLOT(deleteEntry()), Key_Delete); + m->insertItem(i18n("&New..." ), this, TQT_SLOT(newEntry()), Key_Insert); + m->insertItem(i18n( "&Rename" ), this, TQT_SLOT(renameEntry()), Key_F2); + m->insertItem(i18n( "&Delete" ), this, TQT_SLOT(deleteEntry()), Key_Delete); if (ci && ci->type() == KWallet::Wallet::Password) { m->insertSeparator(); _copyPassAction->plug(m); @@ -595,7 +595,7 @@ void KWalletEditor::listContextMenuRequested(QListViewItem *item, const QPoint& break; case KWalletContainerItemClass: - m->insertItem(i18n( "&New..." ), this, SLOT(newEntry()), Key_Insert); + m->insertItem(i18n( "&New..." ), this, TQT_SLOT(newEntry()), Key_Insert); break; case KWalletFolderItemClass: @@ -613,22 +613,22 @@ void KWalletEditor::listContextMenuRequested(QListViewItem *item, const QPoint& void KWalletEditor::copyPassword() { - QListViewItem *item = _entryList->selectedItem(); + TQListViewItem *item = _entryList->selectedItem(); if (_w && item) { - QString pass; + TQString pass; if (_w->readPassword(item->text(0), pass) == 0) { - QApplication::clipboard()->setText(pass); + TQApplication::clipboard()->setText(pass); } } } void KWalletEditor::newEntry() { - QListViewItem *item = _entryList->selectedItem(); - QString n; + TQListViewItem *item = _entryList->selectedItem(); + TQString n; bool ok; - QListViewItem *p; + TQListViewItem *p; KWalletFolderItem *fi; //set the folder where we're trying to create the new entry @@ -649,7 +649,7 @@ void KWalletEditor::newEntry() { do { n = KInputDialog::getText(i18n("New Entry"), i18n("Please choose a name for the new entry:"), - QString::null, + TQString::null, &ok, this); @@ -659,17 +659,17 @@ void KWalletEditor::newEntry() { // FIXME: prohibits the use of the subheadings if (fi->contains(n)) { - int rc = KMessageBox::questionYesNo(this, i18n("Sorry, that entry already exists. Try again?"), QString::null, i18n("Try Again"), i18n("Do Not Try")); + int rc = KMessageBox::questionYesNo(this, i18n("Sorry, that entry already exists. Try again?"), TQString::null, i18n("Try Again"), i18n("Do Not Try")); if (rc == KMessageBox::Yes) { continue; } - n = QString::null; + n = TQString::null; } break; } while (true); if (_w && item && !n.isEmpty()) { - QListViewItem *p = item; + TQListViewItem *p = item; if (p->rtti() == KWalletEntryItemClass) { p = item->parent(); } @@ -691,22 +691,22 @@ void KWalletEditor::newEntry() { return; } if (ci->type() == KWallet::Wallet::Password) { - _w->writePassword(n, QString::null); + _w->writePassword(n, TQString::null); } else if (ci->type() == KWallet::Wallet::Map) { - _w->writeMap(n, QMap<QString,QString>()); + _w->writeMap(n, TQMap<TQString,TQString>()); } else if (ci->type() == KWallet::Wallet::Stream) { - _w->writeEntry(n, QByteArray()); + _w->writeEntry(n, TQByteArray()); } else { abort(); } fi->refresh(); - _ww->_entryTitle->setText(QString("<font size=\"+1\">%1</font>").arg(fi->text(0))); + _ww->_entryTitle->setText(TQString("<font size=\"+1\">%1</font>").arg(fi->text(0))); } } void KWalletEditor::renameEntry() { - QListViewItem *item = _entryList->selectedItem(); + TQListViewItem *item = _entryList->selectedItem(); if (_w && item) { item->startRename(0); } @@ -714,7 +714,7 @@ void KWalletEditor::renameEntry() { // Only supports renaming of KWalletEntryItem derived classes. -void KWalletEditor::listItemRenamed(QListViewItem* item, int, const QString& t) { +void KWalletEditor::listItemRenamed(TQListViewItem* item, int, const TQString& t) { if (item) { KWalletEntryItem *i = dynamic_cast<KWalletEntryItem*>(item); if (!i) { @@ -748,7 +748,7 @@ void KWalletEditor::listItemRenamed(QListViewItem* item, int, const QString& t) void KWalletEditor::deleteEntry() { - QListViewItem *item = _entryList->selectedItem(); + TQListViewItem *item = _entryList->selectedItem(); if (_w && item) { int rc = KMessageBox::warningContinueCancel(this, i18n("Are you sure you wish to delete the item '%1'?").arg(item->text(0)),"",KStdGuiItem::del()); if (rc == KMessageBox::Continue) { @@ -761,7 +761,7 @@ void KWalletEditor::deleteEntry() { delete item; entrySelectionChanged(_entryList->currentItem()); fi->refresh(); - _ww->_entryTitle->setText(QString("<font size=\"+1\">%1</font>").arg(fi->text(0))); + _ww->_entryTitle->setText(TQString("<font size=\"+1\">%1</font>").arg(fi->text(0))); } } } @@ -811,12 +811,12 @@ void KWalletEditor::showHideMapEditorValue(bool show) { enum MergePlan { Prompt = 0, Always = 1, Never = 2, Yes = 3, No = 4 }; void KWalletEditor::importWallet() { - KURL url = KFileDialog::getOpenURL(QString::null, "*.kwl", this); + KURL url = KFileDialog::getOpenURL(TQString::null, "*.kwl", this); if (url.isEmpty()) { return; } - QString tmpFile; + TQString tmpFile; if (!KIO::NetAccess::download(url, tmpFile, this)) { KMessageBox::sorry(this, i18n("Unable to access wallet '<b>%1</b>'.").arg(url.prettyURL())); return; @@ -825,8 +825,8 @@ void KWalletEditor::importWallet() { KWallet::Wallet *w = KWallet::Wallet::openWallet(tmpFile, winId(), KWallet::Wallet::Path); if (w && w->isOpen()) { MergePlan mp = Prompt; - QStringList fl = w->folderList(); - for (QStringList::ConstIterator f = fl.constBegin(); f != fl.constEnd(); ++f) { + TQStringList fl = w->folderList(); + for (TQStringList::ConstIterator f = fl.constBegin(); f != fl.constEnd(); ++f) { if (!w->setFolder(*f)) { continue; } @@ -837,17 +837,17 @@ void KWalletEditor::importWallet() { _w->setFolder(*f); - QMap<QString, QMap<QString, QString> > map; + TQMap<TQString, TQMap<TQString, TQString> > map; int rc; rc = w->readMapList("*", map); if (rc == 0) { - QMap<QString, QMap<QString, QString> >::ConstIterator me; + TQMap<TQString, TQMap<TQString, TQString> >::ConstIterator me; for (me = map.constBegin(); me != map.constEnd(); ++me) { bool hasEntry = _w->hasEntry(me.key()); if (hasEntry && mp == Prompt) { KBetterThanKDialogBase *bd; bd = new KBetterThanKDialogBase(this); - bd->setLabel(i18n("Folder '<b>%1</b>' already contains an entry '<b>%2</b>'. Do you wish to replace it?").arg(QStyleSheet::escape(*f)).arg(QStyleSheet::escape(me.key()))); + bd->setLabel(i18n("Folder '<b>%1</b>' already contains an entry '<b>%2</b>'. Do you wish to replace it?").arg(TQStyleSheet::escape(*f)).arg(TQStyleSheet::escape(me.key()))); mp = (MergePlan)bd->exec(); delete bd; bool ok = false; @@ -868,16 +868,16 @@ void KWalletEditor::importWallet() { } } - QMap<QString, QString> pwd; + TQMap<TQString, TQString> pwd; rc = w->readPasswordList("*", pwd); if (rc == 0) { - QMap<QString, QString>::ConstIterator pe; + TQMap<TQString, TQString>::ConstIterator pe; for (pe = pwd.constBegin(); pe != pwd.constEnd(); ++pe) { bool hasEntry = _w->hasEntry(pe.key()); if (hasEntry && mp == Prompt) { KBetterThanKDialogBase *bd; bd = new KBetterThanKDialogBase(this); - bd->setLabel(i18n("Folder '<b>%1</b>' already contains an entry '<b>%2</b>'. Do you wish to replace it?").arg(QStyleSheet::escape(*f)).arg(QStyleSheet::escape(pe.key()))); + bd->setLabel(i18n("Folder '<b>%1</b>' already contains an entry '<b>%2</b>'. Do you wish to replace it?").arg(TQStyleSheet::escape(*f)).arg(TQStyleSheet::escape(pe.key()))); mp = (MergePlan)bd->exec(); delete bd; bool ok = false; @@ -898,16 +898,16 @@ void KWalletEditor::importWallet() { } } - QMap<QString, QByteArray> ent; + TQMap<TQString, TQByteArray> ent; rc = w->readEntryList("*", ent); if (rc == 0) { - QMap<QString, QByteArray>::ConstIterator ee; + TQMap<TQString, TQByteArray>::ConstIterator ee; for (ee = ent.constBegin(); ee != ent.constEnd(); ++ee) { bool hasEntry = _w->hasEntry(ee.key()); if (hasEntry && mp == Prompt) { KBetterThanKDialogBase *bd; bd = new KBetterThanKDialogBase(this); - bd->setLabel(i18n("Folder '<b>%1</b>' already contains an entry '<b>%2</b>'. Do you wish to replace it?").arg(QStyleSheet::escape(*f)).arg(QStyleSheet::escape(ee.key()))); + bd->setLabel(i18n("Folder '<b>%1</b>' already contains an entry '<b>%2</b>'. Do you wish to replace it?").arg(TQStyleSheet::escape(*f)).arg(TQStyleSheet::escape(ee.key()))); mp = (MergePlan)bd->exec(); delete bd; bool ok = false; @@ -939,48 +939,48 @@ void KWalletEditor::importWallet() { void KWalletEditor::importXML() { - KURL url = KFileDialog::getOpenURL(QString::null, "*.xml", this); + KURL url = KFileDialog::getOpenURL(TQString::null, "*.xml", this); if (url.isEmpty()) { return; } - QString tmpFile; + TQString tmpFile; if (!KIO::NetAccess::download(url, tmpFile, this)) { KMessageBox::sorry(this, i18n("Unable to access XML file '<b>%1</b>'.").arg(url.prettyURL())); return; } - QFile qf(tmpFile); + TQFile qf(tmpFile); if (!qf.open(IO_ReadOnly)) { KMessageBox::sorry(this, i18n("Error opening XML file '<b>%1</b>' for input.").arg(url.prettyURL())); KIO::NetAccess::removeTempFile(tmpFile); return; } - QDomDocument doc(tmpFile); + TQDomDocument doc(tmpFile); if (!doc.setContent(&qf)) { KMessageBox::sorry(this, i18n("Error reading XML file '<b>%1</b>' for input.").arg(url.prettyURL())); KIO::NetAccess::removeTempFile(tmpFile); return; } - QDomElement top = doc.documentElement(); + TQDomElement top = doc.documentElement(); if (top.tagName().lower() != "wallet") { KMessageBox::sorry(this, i18n("Error: XML file does not contain a wallet.")); KIO::NetAccess::removeTempFile(tmpFile); return; } - QDomNode n = top.firstChild(); + TQDomNode n = top.firstChild(); MergePlan mp = Prompt; while (!n.isNull()) { - QDomElement e = n.toElement(); + TQDomElement e = n.toElement(); if (e.tagName().lower() != "folder") { n = n.nextSibling(); continue; } - QString fname = e.attribute("name"); + TQString fname = e.attribute("name"); if (fname.isEmpty()) { n = n.nextSibling(); continue; @@ -989,16 +989,16 @@ void KWalletEditor::importXML() { _w->createFolder(fname); } _w->setFolder(fname); - QDomNode enode = e.firstChild(); + TQDomNode enode = e.firstChild(); while (!enode.isNull()) { e = enode.toElement(); - QString type = e.tagName().lower(); - QString ename = e.attribute("name"); + TQString type = e.tagName().lower(); + TQString ename = e.attribute("name"); bool hasEntry = _w->hasEntry(ename); if (hasEntry && mp == Prompt) { KBetterThanKDialogBase *bd; bd = new KBetterThanKDialogBase(this); - bd->setLabel(i18n("Folder '<b>%1</b>' already contains an entry '<b>%2</b>'. Do you wish to replace it?").arg(QStyleSheet::escape(fname)).arg(QStyleSheet::escape(ename))); + bd->setLabel(i18n("Folder '<b>%1</b>' already contains an entry '<b>%2</b>'. Do you wish to replace it?").arg(TQStyleSheet::escape(fname)).arg(TQStyleSheet::escape(ename))); mp = (MergePlan)bd->exec(); delete bd; bool ok = false; @@ -1022,10 +1022,10 @@ void KWalletEditor::importXML() { } else if (type == "stream") { _w->writeEntry(ename, KCodecs::base64Decode(e.text().latin1())); } else if (type == "map") { - QMap<QString,QString> map; - QDomNode mapNode = e.firstChild(); + TQMap<TQString,TQString> map; + TQDomNode mapNode = e.firstChild(); while (!mapNode.isNull()) { - QDomElement mape = mapNode.toElement(); + TQDomElement mape = mapNode.toElement(); if (mape.tagName().lower() == "mapentry") { map[mape.attribute("name")] = mape.text(); } @@ -1047,31 +1047,31 @@ void KWalletEditor::importXML() { void KWalletEditor::exportXML() { KTempFile tf; tf.setAutoDelete(true); - QTextStream& ts(*tf.textStream()); - QStringList fl = _w->folderList(); + TQTextStream& ts(*tf.textStream()); + TQStringList fl = _w->folderList(); ts << "<wallet name=\"" << _walletName << "\">" << endl; - for (QStringList::Iterator i = fl.begin(); i != fl.end(); ++i) { + for (TQStringList::Iterator i = fl.begin(); i != fl.end(); ++i) { ts << " <folder name=\"" << *i << "\">" << endl; _w->setFolder(*i); - QStringList entries = _w->entryList(); - for (QStringList::Iterator j = entries.begin(); j != entries.end(); ++j) { + TQStringList entries = _w->entryList(); + for (TQStringList::Iterator j = entries.begin(); j != entries.end(); ++j) { switch (_w->entryType(*j)) { case KWallet::Wallet::Password: { - QString pass; + TQString pass; if (_w->readPassword(*j, pass) == 0) { - ts << " <password name=\"" << QStyleSheet::escape(*j) << "\">"; - ts << QStyleSheet::escape(pass); + ts << " <password name=\"" << TQStyleSheet::escape(*j) << "\">"; + ts << TQStyleSheet::escape(pass); ts << "</password>" << endl; } break; } case KWallet::Wallet::Stream: { - QByteArray ba; + TQByteArray ba; if (_w->readEntry(*j, ba) == 0) { - ts << " <stream name=\"" << QStyleSheet::escape(*j) << "\">"; + ts << " <stream name=\"" << TQStyleSheet::escape(*j) << "\">"; ts << KCodecs::base64Encode(ba); ts << "</stream>" << endl; @@ -1080,11 +1080,11 @@ void KWalletEditor::exportXML() { } case KWallet::Wallet::Map: { - QMap<QString,QString> map; + TQMap<TQString,TQString> map; if (_w->readMap(*j, map) == 0) { - ts << " <map name=\"" << QStyleSheet::escape(*j) << "\">" << endl; - for (QMap<QString,QString>::ConstIterator k = map.begin(); k != map.end(); ++k) { - ts << " <mapentry name=\"" << QStyleSheet::escape(k.key()) << "\">" << QStyleSheet::escape(k.data()) << "</mapentry>" << endl; + ts << " <map name=\"" << TQStyleSheet::escape(*j) << "\">" << endl; + for (TQMap<TQString,TQString>::ConstIterator k = map.begin(); k != map.end(); ++k) { + ts << " <mapentry name=\"" << TQStyleSheet::escape(k.key()) << "\">" << TQStyleSheet::escape(k.data()) << "</mapentry>" << endl; } ts << " </map>" << endl; } @@ -1101,7 +1101,7 @@ void KWalletEditor::exportXML() { ts << "</wallet>" << endl; tf.close(); - KURL url = KFileDialog::getSaveURL(QString::null, "*.xml", this); + KURL url = KFileDialog::getSaveURL(TQString::null, "*.xml", this); if (!url.isEmpty()) { bool ok = true; @@ -1125,13 +1125,13 @@ void KWalletEditor::setNewWallet(bool x) { void KWalletEditor::saveAs() { - KURL url = KFileDialog::getSaveURL(QString::null, "*.kwl", this); + KURL url = KFileDialog::getSaveURL(TQString::null, "*.kwl", this); if (!url.isEmpty()) { // Sync() kwalletd if (_nonLocal) { KIO::NetAccess::file_copy(KURL(_walletName), url, 0600, false, false, this); } else { - QString path = KGlobal::dirs()->saveLocation("kwallet") + "/" + _walletName + ".kwl"; + TQString path = KGlobal::dirs()->saveLocation("kwallet") + "/" + _walletName + ".kwl"; KURL destURL; destURL.setPath(path); KIO::NetAccess::file_copy(destURL, url, 0600, false, false, this); } diff --git a/kwallet/kwalleteditor.h b/kwallet/kwalleteditor.h index 2a3c9ef..62cbcf1 100644 --- a/kwallet/kwalleteditor.h +++ b/kwallet/kwalleteditor.h @@ -24,7 +24,7 @@ #include "walletwidget.h" #include <kwallet.h> #include <kmainwindow.h> -#include <qstringlist.h> +#include <tqstringlist.h> class KAction; class QIconViewItem; @@ -38,7 +38,7 @@ class KWalletEditor : public KMainWindow { Q_OBJECT public: - KWalletEditor(const QString& wallet, bool isPath, QWidget *parent = 0, const char* name = 0); + KWalletEditor(const TQString& wallet, bool isPath, TQWidget *parent = 0, const char* name = 0); virtual ~KWalletEditor(); bool isOpen() const { return _w != 0L; } @@ -53,10 +53,10 @@ class KWalletEditor : public KMainWindow { private slots: void layout(); void updateFolderList(bool checkEntries = false); - void entrySelectionChanged(QListViewItem *item); - void listItemRenamed(QListViewItem *, int, const QString&); - void listContextMenuRequested(QListViewItem *item, const QPoint& pos, int col); - void updateEntries(const QString& folder); + void entrySelectionChanged(TQListViewItem *item); + void listItemRenamed(TQListViewItem *, int, const TQString&); + void listContextMenuRequested(TQListViewItem *item, const TQPoint& pos, int col); + void updateEntries(const TQString& folder); void newEntry(); void renameEntry(); @@ -86,7 +86,7 @@ class KWalletEditor : public KMainWindow { void editorClosed(KMainWindow*); public: - QString _walletName; + TQString _walletName; private: void createActions(); @@ -98,12 +98,12 @@ class KWalletEditor : public KMainWindow { KAction *_newFolderAction, *_deleteFolderAction; KAction *_passwordAction, *_exportAction, *_saveAsAction, *_mergeAction, *_importAction; KAction *_copyPassAction; - QLabel*_details; - QString _currentFolder; - QMap<QString,QString> _currentMap; // save memory by storing + TQLabel*_details; + TQString _currentFolder; + TQMap<TQString,TQString> _currentMap; // save memory by storing // only the most recent map. KWMapEditor *_mapEditor; - QCheckBox *_mapEditorShowHide; + TQCheckBox *_mapEditorShowHide; bool _newWallet; }; diff --git a/kwallet/kwalletmanager.cpp b/kwallet/kwalletmanager.cpp index a4fe6cf..58c98aa 100644 --- a/kwallet/kwalletmanager.cpp +++ b/kwallet/kwalletmanager.cpp @@ -39,18 +39,18 @@ #include <ksystemtray.h> #include <kwallet.h> -#include <qaccel.h> -#include <qguardedptr.h> -#include <qptrstack.h> -#include <qregexp.h> -#include <qtimer.h> -#include <qtooltip.h> - -KWalletManager::KWalletManager(QWidget *parent, const char *name, WFlags f) +#include <tqaccel.h> +#include <tqguardedptr.h> +#include <tqptrstack.h> +#include <tqregexp.h> +#include <tqtimer.h> +#include <tqtooltip.h> + +KWalletManager::KWalletManager(TQWidget *parent, const char *name, WFlags f) : KMainWindow(parent, name, f), DCOPObject("KWalletManager") { KGlobal::dirs()->addResourceType("kwallet", "share/apps/kwallet"); _kwalletdLaunch = false; - QAccel *accel = new QAccel(this, "kwalletmanager"); + TQAccel *accel = new TQAccel(this, "kwalletmanager"); KApplication::dcopClient()->setQtBridgeEnabled(false); _shuttingDown = false; @@ -60,15 +60,15 @@ KWalletManager::KWalletManager(QWidget *parent, const char *name, WFlags f) if (walletConfigGroup.readBoolEntry("Launch Manager", true)) { _tray = new KSystemTray(this, "kwalletmanager tray"); _tray->setPixmap(loadSystemTrayIcon("wallet_closed")); - QToolTip::add(_tray, i18n("KDE Wallet: No wallets open.")); - connect(_tray, SIGNAL(quitSelected()), SLOT(shuttingDown())); - QStringList wl = KWallet::Wallet::walletList(); + TQToolTip::add(_tray, i18n("KDE Wallet: No wallets open.")); + connect(_tray, TQT_SIGNAL(quitSelected()), TQT_SLOT(shuttingDown())); + TQStringList wl = KWallet::Wallet::walletList(); bool isOpen = false; - for (QStringList::Iterator it = wl.begin(); it != wl.end(); ++it) { + for (TQStringList::Iterator it = wl.begin(); it != wl.end(); ++it) { if (KWallet::Wallet::isOpen(*it)) { _tray->setPixmap(loadSystemTrayIcon("wallet_open")); - QToolTip::remove(_tray); - QToolTip::add(_tray, i18n("KDE Wallet: A wallet is open.")); + TQToolTip::remove(_tray); + TQToolTip::add(_tray, i18n("KDE Wallet: A wallet is open.")); isOpen = true; break; } @@ -76,7 +76,7 @@ KWalletManager::KWalletManager(QWidget *parent, const char *name, WFlags f) if (!isOpen && kapp->isRestored()) { delete _tray; _tray = 0L; - QTimer::singleShot( 0, kapp, SLOT( quit())); + TQTimer::singleShot( 0, kapp, TQT_SLOT( quit())); return; } } else { @@ -84,8 +84,8 @@ KWalletManager::KWalletManager(QWidget *parent, const char *name, WFlags f) } _iconView = new KWalletIconView(this, "kwalletmanager icon view"); - connect(_iconView, SIGNAL(executed(QIconViewItem*)), this, SLOT(openWallet(QIconViewItem*))); - connect(_iconView, SIGNAL(contextMenuRequested(QIconViewItem*, const QPoint&)), this, SLOT(contextMenu(QIconViewItem*, const QPoint&))); + connect(_iconView, TQT_SIGNAL(executed(TQIconViewItem*)), this, TQT_SLOT(openWallet(TQIconViewItem*))); + connect(_iconView, TQT_SIGNAL(contextMenuRequested(TQIconViewItem*, const TQPoint&)), this, TQT_SLOT(contextMenu(TQIconViewItem*, const TQPoint&))); updateWalletDisplay(); setCentralWidget(_iconView); @@ -94,18 +94,18 @@ KWalletManager::KWalletManager(QWidget *parent, const char *name, WFlags f) _dcopRef = new DCOPRef("kded", "kwalletd"); _dcopRef->dcopClient()->setNotifications(true); connect(_dcopRef->dcopClient(), - SIGNAL(applicationRemoved(const QCString&)), + TQT_SIGNAL(applicationRemoved(const TQCString&)), this, - SLOT(possiblyRescan(const QCString&))); + TQT_SLOT(possiblyRescan(const TQCString&))); connect(_dcopRef->dcopClient(), - SIGNAL(applicationRegistered(const QCString&)), + TQT_SIGNAL(applicationRegistered(const TQCString&)), this, - SLOT(possiblyRescan(const QCString&))); + TQT_SLOT(possiblyRescan(const TQCString&))); connectDCOPSignal(_dcopRef->app(), _dcopRef->obj(), "allWalletsClosed()", "allWalletsClosed()", false); - connectDCOPSignal(_dcopRef->app(), _dcopRef->obj(), "walletClosed(QString)", "updateWalletDisplay()", false); - connectDCOPSignal(_dcopRef->app(), _dcopRef->obj(), "walletOpened(QString)", "aWalletWasOpened()", false); - connectDCOPSignal(_dcopRef->app(), _dcopRef->obj(), "walletDeleted(QString)", "updateWalletDisplay()", false); + connectDCOPSignal(_dcopRef->app(), _dcopRef->obj(), "walletClosed(TQString)", "updateWalletDisplay()", false); + connectDCOPSignal(_dcopRef->app(), _dcopRef->obj(), "walletOpened(TQString)", "aWalletWasOpened()", false); + connectDCOPSignal(_dcopRef->app(), _dcopRef->obj(), "walletDeleted(TQString)", "updateWalletDisplay()", false); connectDCOPSignal(_dcopRef->app(), _dcopRef->obj(), "walletListDirty()", "updateWalletDisplay()", false); // FIXME: slight race - a wallet can open, then we get launched, but the @@ -113,27 +113,27 @@ KWalletManager::KWalletManager(QWidget *parent, const char *name, WFlags f) // open. Must check that a wallet is still open here. new KAction(i18n("&New Wallet..."), "kwalletmanager", 0, this, - SLOT(createWallet()), actionCollection(), + TQT_SLOT(createWallet()), actionCollection(), "wallet_create"); KAction *act = new KAction(i18n("Configure &Wallet..."), "configure", - 0, this, SLOT(setupWallet()), actionCollection(), + 0, this, TQT_SLOT(setupWallet()), actionCollection(), "wallet_settings"); if (_tray) { act->plug(_tray->contextMenu()); } act = new KAction(i18n("Close &All Wallets"), 0, 0, this, - SLOT(closeAllWallets()), actionCollection(), + TQT_SLOT(closeAllWallets()), actionCollection(), "close_all_wallets"); if (_tray) { act->plug(_tray->contextMenu()); } - KStdAction::quit(this, SLOT(shuttingDown()), actionCollection()); - KStdAction::keyBindings(guiFactory(), SLOT(configureShortcuts()), + KStdAction::quit(this, TQT_SLOT(shuttingDown()), actionCollection()); + KStdAction::keyBindings(guiFactory(), TQT_SLOT(configureShortcuts()), actionCollection()); createGUI("kwalletmanager.rc"); - accel->connectItem(accel->insertItem(Key_Return), this, SLOT(openWallet())); - accel->connectItem(accel->insertItem(Key_Delete), this, SLOT(deleteWallet())); + accel->connectItem(accel->insertItem(Key_Return), this, TQT_SLOT(openWallet())); + accel->connectItem(accel->insertItem(Key_Delete), this, TQT_SLOT(deleteWallet())); if (_tray) { _tray->show(); @@ -173,18 +173,18 @@ bool KWalletManager::queryClose() { void KWalletManager::aWalletWasOpened() { if (_tray) { _tray->setPixmap(loadSystemTrayIcon("wallet_open")); - QToolTip::remove(_tray); - QToolTip::add(_tray, i18n("KDE Wallet: A wallet is open.")); + TQToolTip::remove(_tray); + TQToolTip::add(_tray, i18n("KDE Wallet: A wallet is open.")); } updateWalletDisplay(); } void KWalletManager::updateWalletDisplay() { -QStringList wl = KWallet::Wallet::walletList(); -QPtrStack<QIconViewItem> trash; +TQStringList wl = KWallet::Wallet::walletList(); +TQPtrStack<TQIconViewItem> trash; - for (QIconViewItem *item = _iconView->firstItem(); item; item = item->nextItem()) { + for (TQIconViewItem *item = _iconView->firstItem(); item; item = item->nextItem()) { if (!wl.contains(item->text())) { trash.push(item); } @@ -193,7 +193,7 @@ QPtrStack<QIconViewItem> trash; trash.setAutoDelete(true); trash.clear(); - for (QStringList::Iterator i = wl.begin(); i != wl.end(); ++i) { + for (TQStringList::Iterator i = wl.begin(); i != wl.end(); ++i) { if (!_iconView->findItem(*i)) { // FIXME: if KWallet::Wallet::isOpen(*i) then show // a different icon! @@ -205,21 +205,21 @@ QPtrStack<QIconViewItem> trash; } -void KWalletManager::contextMenu(QIconViewItem *item, const QPoint& pos) { +void KWalletManager::contextMenu(TQIconViewItem *item, const TQPoint& pos) { if (item) { - QGuardedPtr<KWalletPopup> popupMenu = new KWalletPopup(item->text(), this); - connect(popupMenu, SIGNAL(walletOpened(const QString&)), this, SLOT(openWallet(const QString&))); - connect(popupMenu, SIGNAL(walletClosed(const QString&)), this, SLOT(closeWallet(const QString&))); - connect(popupMenu, SIGNAL(walletDeleted(const QString&)), this, SLOT(deleteWallet(const QString&))); - connect(popupMenu, SIGNAL(walletChangePassword(const QString&)), this, SLOT(changeWalletPassword(const QString&))); - connect(popupMenu, SIGNAL(walletCreated()), this, SLOT(createWallet())); + TQGuardedPtr<KWalletPopup> popupMenu = new KWalletPopup(item->text(), this); + connect(popupMenu, TQT_SIGNAL(walletOpened(const TQString&)), this, TQT_SLOT(openWallet(const TQString&))); + connect(popupMenu, TQT_SIGNAL(walletClosed(const TQString&)), this, TQT_SLOT(closeWallet(const TQString&))); + connect(popupMenu, TQT_SIGNAL(walletDeleted(const TQString&)), this, TQT_SLOT(deleteWallet(const TQString&))); + connect(popupMenu, TQT_SIGNAL(walletChangePassword(const TQString&)), this, TQT_SLOT(changeWalletPassword(const TQString&))); + connect(popupMenu, TQT_SIGNAL(walletCreated()), this, TQT_SLOT(createWallet())); popupMenu->exec(pos); delete popupMenu; } } -void KWalletManager::deleteWallet(const QString& walletName) { +void KWalletManager::deleteWallet(const TQString& walletName) { int rc = KMessageBox::warningContinueCancel(this, i18n("Are you sure you wish to delete the wallet '%1'?").arg(walletName),"",KStdGuiItem::del()); if (rc != KMessageBox::Continue) { return; @@ -232,10 +232,10 @@ void KWalletManager::deleteWallet(const QString& walletName) { } -void KWalletManager::closeWallet(const QString& walletName) { +void KWalletManager::closeWallet(const TQString& walletName) { int rc = KWallet::Wallet::closeWallet(walletName, false); if (rc != 0) { - rc = KMessageBox::warningYesNo(this, i18n("Unable to close wallet cleanly. It is probably in use by other applications. Do you wish to force it closed?"), QString::null, i18n("Force Closure"), i18n("Do Not Force")); + rc = KMessageBox::warningYesNo(this, i18n("Unable to close wallet cleanly. It is probably in use by other applications. Do you wish to force it closed?"), TQString::null, i18n("Force Closure"), i18n("Do Not Force")); if (rc == KMessageBox::Yes) { rc = KWallet::Wallet::closeWallet(walletName, true); if (rc != 0) { @@ -248,16 +248,16 @@ void KWalletManager::closeWallet(const QString& walletName) { } -void KWalletManager::changeWalletPassword(const QString& walletName) { +void KWalletManager::changeWalletPassword(const TQString& walletName) { KWallet::Wallet::changePassword(walletName); } -void KWalletManager::openWalletFile(const QString& path) { +void KWalletManager::openWalletFile(const TQString& path) { KWalletEditor *we = new KWalletEditor(path, true, this, "Wallet Editor"); if (we->isOpen()) { - connect(we, SIGNAL(editorClosed(KMainWindow*)), - this, SLOT(editorClosed(KMainWindow*))); + connect(we, TQT_SIGNAL(editorClosed(KMainWindow*)), + this, TQT_SLOT(editorClosed(KMainWindow*))); we->show(); } else { KMessageBox::sorry(this, i18n("Error opening wallet %1.").arg(path)); @@ -267,24 +267,24 @@ void KWalletManager::openWalletFile(const QString& path) { void KWalletManager::openWallet() { - QIconViewItem *item = _iconView->currentItem(); + TQIconViewItem *item = _iconView->currentItem(); openWallet(item); } void KWalletManager::deleteWallet() { - QIconViewItem *item = _iconView->currentItem(); + TQIconViewItem *item = _iconView->currentItem(); if (item) { deleteWallet(item->text()); } } -void KWalletManager::openWallet(const QString& walletName) { +void KWalletManager::openWallet(const TQString& walletName) { openWallet(walletName, false); } -void KWalletManager::openWallet(const QString& walletName, bool newWallet) { +void KWalletManager::openWallet(const TQString& walletName, bool newWallet) { // Don't allow a wallet to open in two windows for (KMainWindow *w = _windows.first(); w; w = _windows.next()) { KWalletEditor *e = static_cast<KWalletEditor*>(w); @@ -297,8 +297,8 @@ void KWalletManager::openWallet(const QString& walletName, bool newWallet) { KWalletEditor *we = new KWalletEditor(walletName, false, this, "Wallet Editor"); we->setNewWallet(newWallet); if (we->isOpen()) { - connect(we, SIGNAL(editorClosed(KMainWindow*)), - this, SLOT(editorClosed(KMainWindow*))); + connect(we, TQT_SIGNAL(editorClosed(KMainWindow*)), + this, TQT_SLOT(editorClosed(KMainWindow*))); we->show(); _windows.append(we); } else if (!newWallet) { @@ -308,7 +308,7 @@ void KWalletManager::openWallet(const QString& walletName, bool newWallet) { } -void KWalletManager::openWallet(QIconViewItem *item) { +void KWalletManager::openWallet(TQIconViewItem *item) { if (item) { openWallet(item->text()); } @@ -318,8 +318,8 @@ void KWalletManager::openWallet(QIconViewItem *item) { void KWalletManager::allWalletsClosed() { if (_tray) { _tray->setPixmap(loadSystemTrayIcon("wallet_closed")); - QToolTip::remove(_tray); - QToolTip::add(_tray, i18n("KDE Wallet: No wallets open.")); + TQToolTip::remove(_tray); + TQToolTip::add(_tray, i18n("KDE Wallet: No wallets open.")); } possiblyQuit(); } @@ -342,7 +342,7 @@ void KWalletManager::editorClosed(KMainWindow* e) { } -void KWalletManager::possiblyRescan(const QCString& app) { +void KWalletManager::possiblyRescan(const TQCString& app) { if (app == "kded") { updateWalletDisplay(); } @@ -350,21 +350,21 @@ void KWalletManager::possiblyRescan(const QCString& app) { void KWalletManager::createWallet() { - QString n; + TQString n; bool ok; // FIXME: support international names - QRegExp regexp("^[A-Za-z0-9]+[A-Za-z0-9_\\s\\-]*$"); - QString txt = i18n("Please choose a name for the new wallet:"); + TQRegExp regexp("^[A-Za-z0-9]+[A-Za-z0-9_\\s\\-]*$"); + TQString txt = i18n("Please choose a name for the new wallet:"); if (!KWallet::Wallet::isEnabled()) { - // FIXME: KMessageBox::warningYesNo(this, i1_8n("KWallet is not enabled. Do you want to enable it?"), QString::null, i18n("Enable"), i18n("Keep Disabled")); + // FIXME: KMessageBox::warningYesNo(this, i1_8n("KWallet is not enabled. Do you want to enable it?"), TQString::null, i18n("Enable"), i18n("Keep Disabled")); return; } do { n = KInputDialog::getText(i18n("New Wallet"), txt, - QString::null, + TQString::null, &ok, this); @@ -373,11 +373,11 @@ void KWalletManager::createWallet() { } if (_iconView->findItem(n)) { - int rc = KMessageBox::questionYesNo(this, i18n("Sorry, that wallet already exists. Try a new name?"), QString::null, i18n("Try New"), i18n("Do Not Try")); + int rc = KMessageBox::questionYesNo(this, i18n("Sorry, that wallet already exists. Try a new name?"), TQString::null, i18n("Try New"), i18n("Do Not Try")); if (rc == KMessageBox::Yes) { continue; } - n = QString::null; + n = TQString::null; } else if (regexp.exactMatch(n)) { break; } else { @@ -408,7 +408,7 @@ void KWalletManager::closeAllWallets() { } -QPixmap KWalletManager::loadSystemTrayIcon(const QString &icon) { +TQPixmap KWalletManager::loadSystemTrayIcon(const TQString &icon) { #if KDE_IS_VERSION(3, 1, 90) return KSystemTray::loadIcon(icon); #else diff --git a/kwallet/kwalletmanager.h b/kwallet/kwalletmanager.h index 0c28839..c9cc553 100644 --- a/kwallet/kwalletmanager.h +++ b/kwallet/kwalletmanager.h @@ -22,7 +22,7 @@ #include <kmainwindow.h> #include <dcopobject.h> -#include <qptrlist.h> +#include <tqptrlist.h> class KSystemTray; class KWalletIconView; @@ -35,23 +35,23 @@ class KWalletManager : public KMainWindow, public DCOPObject { K_DCOP public: - KWalletManager(QWidget *parent = 0, const char* name = 0, WFlags f = 0); + KWalletManager(TQWidget *parent = 0, const char* name = 0, WFlags f = 0); virtual ~KWalletManager(); - QPixmap loadSystemTrayIcon(const QString &icon); + TQPixmap loadSystemTrayIcon(const TQString &icon); void kwalletdLaunch(); public slots: void createWallet(); - void deleteWallet(const QString& walletName); - void closeWallet(const QString& walletName); - void changeWalletPassword(const QString& walletName); - void openWallet(const QString& walletName); - void openWallet(const QString& walletName, bool newWallet); - void openWalletFile(const QString& path); - void openWallet(QIconViewItem *item); - void contextMenu(QIconViewItem *item, const QPoint& pos); + void deleteWallet(const TQString& walletName); + void closeWallet(const TQString& walletName); + void changeWalletPassword(const TQString& walletName); + void openWallet(const TQString& walletName); + void openWallet(const TQString& walletName, bool newWallet); + void openWalletFile(const TQString& path); + void openWallet(TQIconViewItem *item); + void contextMenu(TQIconViewItem *item, const TQPoint& pos); protected: virtual bool queryClose(); @@ -66,7 +66,7 @@ class KWalletManager : public KMainWindow, public DCOPObject { void shuttingDown(); void possiblyQuit(); void editorClosed(KMainWindow* e); - void possiblyRescan(const QCString& app); + void possiblyRescan(const TQCString& app); void setupWallet(); void openWallet(); void deleteWallet(); @@ -77,7 +77,7 @@ class KWalletManager : public KMainWindow, public DCOPObject { bool _shuttingDown; KWalletIconView *_iconView; DCOPRef *_dcopRef; - QPtrList<KMainWindow> _windows; + TQPtrList<KMainWindow> _windows; bool _kwalletdLaunch; }; diff --git a/kwallet/kwalletpopup.cpp b/kwallet/kwalletpopup.cpp index 3f2082e..bd5e75d 100644 --- a/kwallet/kwalletpopup.cpp +++ b/kwallet/kwalletpopup.cpp @@ -28,31 +28,31 @@ #include <kwallet.h> #include <kstdguiitem.h> -KWalletPopup::KWalletPopup(const QString& wallet, QWidget *parent, const char *name) +KWalletPopup::KWalletPopup(const TQString& wallet, TQWidget *parent, const char *name) : KPopupMenu(parent, name), _walletName(wallet) { insertTitle(wallet); KActionCollection *ac = new KActionCollection(this, "kwallet context actions"); KAction *act; act = new KAction(i18n("&New Wallet..."), 0, 0, this, - SLOT(createWallet()), ac, "wallet_create"); + TQT_SLOT(createWallet()), ac, "wallet_create"); act->plug(this); act = new KAction(i18n("&Open..."), 0, Key_Return, this, - SLOT(openWallet()), ac, "wallet_open"); + TQT_SLOT(openWallet()), ac, "wallet_open"); act->plug(this); act = new KAction(i18n("Change &Password..."), 0, 0, this, - SLOT(changeWalletPassword()), ac, "wallet_password"); + TQT_SLOT(changeWalletPassword()), ac, "wallet_password"); act->plug(this); - QStringList ul = KWallet::Wallet::users(wallet); + TQStringList ul = KWallet::Wallet::users(wallet); if (!ul.isEmpty()) { KPopupMenu *pm = new KPopupMenu(this, "Disconnect Apps"); int id = 7000; - for (QStringList::Iterator it = ul.begin(); it != ul.end(); ++it) { + for (TQStringList::Iterator it = ul.begin(); it != ul.end(); ++it) { _appMap[id] = *it; - pm->insertItem(*it, this, SLOT(disconnectApp(int)), 0, id); + pm->insertItem(*it, this, TQT_SLOT(disconnectApp(int)), 0, id); pm->setItemParameter(id, id); id++; } @@ -61,14 +61,14 @@ KWalletPopup::KWalletPopup(const QString& wallet, QWidget *parent, const char *n } act = KStdAction::close( this, - SLOT(closeWallet()), ac, "wallet_close"); + TQT_SLOT(closeWallet()), ac, "wallet_close"); // FIXME: let's track this inside the manager so we don't need a dcop // roundtrip here. act->setEnabled(KWallet::Wallet::isOpen(wallet)); act->plug(this); act = new KAction(i18n("&Delete"), 0, Key_Delete, this, - SLOT(deleteWallet()), ac, "wallet_delete"); + TQT_SLOT(deleteWallet()), ac, "wallet_delete"); act->plug(this); } diff --git a/kwallet/kwalletpopup.h b/kwallet/kwalletpopup.h index c704d69..36a2d8f 100644 --- a/kwallet/kwalletpopup.h +++ b/kwallet/kwalletpopup.h @@ -21,14 +21,14 @@ #define KWALLETPOPUP_H #include <kpopupmenu.h> -#include <qmap.h> -#include <qstring.h> +#include <tqmap.h> +#include <tqstring.h> class KWalletPopup : public KPopupMenu { Q_OBJECT public: - KWalletPopup(const QString& wallet, QWidget *parent = 0, const char* name = 0); + KWalletPopup(const TQString& wallet, TQWidget *parent = 0, const char* name = 0); virtual ~KWalletPopup(); public slots: @@ -40,15 +40,15 @@ class KWalletPopup : public KPopupMenu { void disconnectApp(int); signals: - void walletOpened(const QString& walletName); - void walletClosed(const QString& walletName); - void walletDeleted(const QString& walletName); + void walletOpened(const TQString& walletName); + void walletClosed(const TQString& walletName); + void walletDeleted(const TQString& walletName); void walletCreated(); - void walletChangePassword(const QString& walletName); + void walletChangePassword(const TQString& walletName); private: - QString _walletName; - QMap<int,QString> _appMap; + TQString _walletName; + TQMap<int,TQString> _appMap; }; #endif diff --git a/kwallet/kwmapeditor.cpp b/kwallet/kwmapeditor.cpp index a15b9c9..b6cbb50 100644 --- a/kwallet/kwmapeditor.cpp +++ b/kwallet/kwmapeditor.cpp @@ -26,20 +26,20 @@ #include <kstdaction.h> #include <kwin.h> -#include <qapplication.h> -#include <qclipboard.h> -#include <qpushbutton.h> -#include <qtextedit.h> +#include <tqapplication.h> +#include <tqclipboard.h> +#include <tqpushbutton.h> +#include <tqtextedit.h> -KWMapEditor::KWMapEditor(QMap<QString,QString>& map, QWidget *parent, const char *name) -: QTable(0, 3, parent, name), _map(map) { +KWMapEditor::KWMapEditor(TQMap<TQString,TQString>& map, TQWidget *parent, const char *name) +: TQTable(0, 3, parent, name), _map(map) { _ac = new KActionCollection(this); - _copyAct = KStdAction::copy(this, SLOT(copy()), _ac); - connect(this, SIGNAL(valueChanged(int,int)), this, SIGNAL(dirty())); - connect(this, SIGNAL(contextMenuRequested(int,int,const QPoint&)), - this, SLOT(contextMenu(int,int,const QPoint&))); - setSelectionMode(QTable::NoSelection); - horizontalHeader()->setLabel(0, QString::null); + _copyAct = KStdAction::copy(this, TQT_SLOT(copy()), _ac); + connect(this, TQT_SIGNAL(valueChanged(int,int)), this, TQT_SIGNAL(dirty())); + connect(this, TQT_SIGNAL(contextMenuRequested(int,int,const TQPoint&)), + this, TQT_SLOT(contextMenu(int,int,const TQPoint&))); + setSelectionMode(TQTable::NoSelection); + horizontalHeader()->setLabel(0, TQString::null); horizontalHeader()->setLabel(1, i18n("Key")); horizontalHeader()->setLabel(2, i18n("Value")); setColumnWidth(0, 20); // FIXME: this is arbitrary @@ -56,14 +56,14 @@ void KWMapEditor::reload() { if ((row = numRows()) < _map.count()) { insertRows(row, _map.count() - row); for (int x = row; x < numRows(); ++x) { - QPushButton *b = new QPushButton("X", this); - connect(b, SIGNAL(clicked()), this, SLOT(erase())); + TQPushButton *b = new TQPushButton("X", this); + connect(b, TQT_SIGNAL(clicked()), this, TQT_SLOT(erase())); setCellWidget(x, 0, b); } } row = 0; - for (QMap<QString,QString>::Iterator it = _map.begin(); it != _map.end(); ++it) { + for (TQMap<TQString,TQString>::Iterator it = _map.begin(); it != _map.end(); ++it) { setText(row, 1, it.key()); setText(row, 2, it.data()); row++; @@ -76,7 +76,7 @@ KWMapEditor::~KWMapEditor() { void KWMapEditor::erase() { - const QObject *o = sender(); + const TQObject *o = sender(); for (int i = 0; i < numRows(); i++) { if (cellWidget(i, 0) == o) { removeRow(i); @@ -100,8 +100,8 @@ void KWMapEditor::saveMap() { void KWMapEditor::addEntry() { int x = numRows(); insertRows(x, 1); - QPushButton *b = new QPushButton("X", this); - connect(b, SIGNAL(clicked()), this, SLOT(erase())); + TQPushButton *b = new TQPushButton("X", this); + connect(b, TQT_SIGNAL(clicked()), this, TQT_SLOT(erase())); setCellWidget(x, 0, b); ensureCellVisible(x, 1); setCurrentCell(x, 1); @@ -114,68 +114,68 @@ void KWMapEditor::emitDirty() { } -void KWMapEditor::contextMenu(int row, int col, const QPoint& pos) { +void KWMapEditor::contextMenu(int row, int col, const TQPoint& pos) { _contextRow = row; _contextCol = col; KPopupMenu *m = new KPopupMenu(this); - m->insertItem(i18n("&New Entry"), this, SLOT(addEntry())); + m->insertItem(i18n("&New Entry"), this, TQT_SLOT(addEntry())); _copyAct->plug(m); m->popup(pos); } void KWMapEditor::copy() { - QApplication::clipboard()->setText(text(_contextRow, 2)); + TQApplication::clipboard()->setText(text(_contextRow, 2)); } -class InlineEditor : public QTextEdit { +class InlineEditor : public TQTextEdit { public: InlineEditor(KWMapEditor *p, int row, int col) - : QTextEdit(), _p(p), row(row), col(col) { + : TQTextEdit(), _p(p), row(row), col(col) { setWFlags(WStyle_NoBorder | WDestructiveClose); KWin::setType(winId(), NET::Override); - connect(p, SIGNAL(destroyed()), SLOT(close())); + connect(p, TQT_SIGNAL(destroyed()), TQT_SLOT(close())); } virtual ~InlineEditor() { if (!_p) return; _p->setText(row, col, text()); _p->emitDirty(); } protected: - virtual void focusOutEvent(QFocusEvent*) { - if (QFocusEvent::reason() == QFocusEvent::Popup) { - QWidget *focusW = qApp->focusWidget(); + virtual void focusOutEvent(TQFocusEvent*) { + if (TQFocusEvent::reason() == TQFocusEvent::Popup) { + TQWidget *focusW = qApp->focusWidget(); if (focusW && focusW == popup) { return; } } close(); } - virtual void keyPressEvent(QKeyEvent *e) { + virtual void keyPressEvent(TQKeyEvent *e) { if (e->key() == Qt::Key_Escape) { e->accept(); close(); } else { e->ignore(); - QTextEdit::keyPressEvent(e); + TQTextEdit::keyPressEvent(e); } } - virtual QPopupMenu *createPopupMenu(const QPoint &p) { - popup = QTextEdit::createPopupMenu(p); + virtual TQPopupMenu *createPopupMenu(const TQPoint &p) { + popup = TQTextEdit::createPopupMenu(p); return popup; } - QGuardedPtr<KWMapEditor> _p; + TQGuardedPtr<KWMapEditor> _p; int row, col; - QGuardedPtr<QPopupMenu> popup; + TQGuardedPtr<TQPopupMenu> popup; }; -QWidget *KWMapEditor::beginEdit(int row, int col, bool replace) { +TQWidget *KWMapEditor::beginEdit(int row, int col, bool replace) { //kdDebug(2300) << "EDIT COLUMN " << col << endl; if (col != 2) { - return QTable::beginEdit(row, col, replace); + return TQTable::beginEdit(row, col, replace); } - QRect geo = cellGeometry(row, col); - QTextEdit *e = new InlineEditor(this, row, col); + TQRect geo = cellGeometry(row, col); + TQTextEdit *e = new InlineEditor(this, row, col); e->setText(text(row, col)); e->move(mapToGlobal(geo.topLeft())); e->resize(geo.width() * 2, geo.height() * 3); diff --git a/kwallet/kwmapeditor.h b/kwallet/kwmapeditor.h index 8322a91..abd835f 100644 --- a/kwallet/kwmapeditor.h +++ b/kwallet/kwmapeditor.h @@ -20,25 +20,25 @@ #ifndef KWMAPEDITOR_H #define KWMAPEDITOR_H -#include <qmap.h> -#include <qstring.h> -#include <qtable.h> +#include <tqmap.h> +#include <tqstring.h> +#include <tqtable.h> class KAction; class KActionCollection; -class KWMapEditor : public QTable { +class KWMapEditor : public TQTable { Q_OBJECT public: - KWMapEditor(QMap<QString,QString>& map, QWidget *parent = 0, const char *name = 0); + KWMapEditor(TQMap<TQString,TQString>& map, TQWidget *parent = 0, const char *name = 0); virtual ~KWMapEditor(); public slots: void reload(); void saveMap(); void erase(); - void contextMenu(int row, int col, const QPoint& pos); + void contextMenu(int row, int col, const TQPoint& pos); void addEntry(); void emitDirty(); @@ -46,13 +46,13 @@ class KWMapEditor : public QTable { void copy(); protected: - virtual QWidget *beginEdit(int row, int col, bool replace); + virtual TQWidget *beginEdit(int row, int col, bool replace); signals: void dirty(); private: - QMap<QString,QString>& _map; + TQMap<TQString,TQString>& _map; int _contextRow, _contextCol; KActionCollection *_ac; KAction *_copyAct; diff --git a/kwallet/main.cpp b/kwallet/main.cpp index 08f5b74..8fbd0da 100644 --- a/kwallet/main.cpp +++ b/kwallet/main.cpp @@ -26,8 +26,8 @@ #include <kstandarddirs.h> #include <kuniqueapplication.h> -#include <qfile.h> -#include <qfileinfo.h> +#include <tqfile.h> +#include <tqfileinfo.h> #include "kwalletmanager.h" @@ -84,9 +84,9 @@ int main(int argc, char **argv) { } for (int i = 0; i < args->count(); ++i) { - QString fn = QFileInfo(args->arg(i)).absFilePath(); + TQString fn = TQFileInfo(args->arg(i)).absFilePath(); KMimeType::Ptr ptr; - if (QFile::exists(fn) && + if (TQFile::exists(fn) && (ptr = KMimeType::findByFileContent(fn)) && ptr->is("application/x-kde-wallet")) { wm.openWalletFile(fn); diff --git a/superkaramba/src/bar.cpp b/superkaramba/src/bar.cpp index 354433d..a5405fe 100644 --- a/superkaramba/src/bar.cpp +++ b/superkaramba/src/bar.cpp @@ -24,14 +24,14 @@ Bar::~Bar() { } -bool Bar::setImage(QString fileName) +bool Bar::setImage(TQString fileName) { - QFileInfo fileInfo(fileName); + TQFileInfo fileInfo(fileName); bool res = false; if(m_karamba->theme().isThemeFile(fileName)) { - QByteArray ba = m_karamba->theme().readThemeFile(fileName); + TQByteArray ba = m_karamba->theme().readThemeFile(fileName); res = pixmap.loadFromData(ba); } else @@ -85,7 +85,7 @@ void Bar::setValue( long v ) } } -void Bar::setValue(QString v) +void Bar::setValue(TQString v) { setValue((long)(v.toDouble() + 0.5)); } @@ -107,7 +107,7 @@ void Bar::setVertical(bool b) vertical = b; } -void Bar::mUpdate(QPainter *p) +void Bar::mUpdate(TQPainter *p) { int x, y, width, height; x = getX(); diff --git a/superkaramba/src/bar.h b/superkaramba/src/bar.h index d23ac3e..eb4b831 100644 --- a/superkaramba/src/bar.h +++ b/superkaramba/src/bar.h @@ -11,9 +11,9 @@ #define BAR_H #include "meter.h" -#include <qpixmap.h> -#include <qstring.h> -#include <qpainter.h> +#include <tqpixmap.h> +#include <tqstring.h> +#include <tqpainter.h> class Bar : public Meter { @@ -22,18 +22,18 @@ public: Bar(karamba* k,int ix,int iy,int iw,int ih ); ~Bar(); - void mUpdate( QPainter * ); + void mUpdate( TQPainter * ); virtual void setMax( long m ); virtual void setMin( long m ); public slots: - bool setImage( QString imagePath ); - QString getImage() { return imagePath; }; + bool setImage( TQString imagePath ); + TQString getImage() { return imagePath; }; void setValue( long ); long getValue() { return barValue; }; - void setValue( QString ); + void setValue( TQString ); void recalculateValue() {setValue(barValue); }; void setVertical( bool ); @@ -48,8 +48,8 @@ private: bool vertical; // vertical bar? - QString imagePath; - QPixmap pixmap; + TQString imagePath; + TQPixmap pixmap; } ; #endif // BAR_H diff --git a/superkaramba/src/bar_python.cpp b/superkaramba/src/bar_python.cpp index fa94f85..a789239 100644 --- a/superkaramba/src/bar_python.cpp +++ b/superkaramba/src/bar_python.cpp @@ -25,7 +25,7 @@ #endif #include <Python.h> -#include <qobject.h> +#include <tqobject.h> #include "karamba.h" #include "meter.h" #include "meter_python.h" diff --git a/superkaramba/src/clickable.cpp b/superkaramba/src/clickable.cpp index ac3ae1b..794b7fe 100644 --- a/superkaramba/src/clickable.cpp +++ b/superkaramba/src/clickable.cpp @@ -13,25 +13,25 @@ Clickable::Clickable( int x, int y, int w, int h ) { - boundingBox = QRect( x, y, w, h ); + boundingBox = TQRect( x, y, w, h ); } Clickable::~Clickable() {} /* -void Clickable::setOnClick( QString oc ) +void Clickable::setOnClick( TQString oc ) { onClick = oc; } -void Clickable::setOnMiddleClick( QString oc ) +void Clickable::setOnMiddleClick( TQString oc ) { onMiddleClick = oc; } */ -QRect Clickable::getBoundingBox() +TQRect Clickable::getBoundingBox() { return boundingBox; } diff --git a/superkaramba/src/clickable.h b/superkaramba/src/clickable.h index f549893..b8482fb 100644 --- a/superkaramba/src/clickable.h +++ b/superkaramba/src/clickable.h @@ -11,9 +11,9 @@ #ifndef CLICKABLE_H #define CLICKABLE_H -#include <qstring.h> -#include <qrect.h> -#include <qevent.h> +#include <tqstring.h> +#include <tqrect.h> +#include <tqevent.h> /** @@ -27,19 +27,19 @@ public: virtual ~Clickable(); - virtual void click( QMouseEvent* ) = 0; + virtual void click( TQMouseEvent* ) = 0; /* - void setOnClick( QString ); - void setOnMiddleClick( QString ); + void setOnClick( TQString ); + void setOnMiddleClick( TQString ); */ - virtual QRect getBoundingBox(); + virtual TQRect getBoundingBox(); protected: - QRect boundingBox; + TQRect boundingBox; /* - QString onClick; - QString onMiddleClick; + TQString onClick; + TQString onMiddleClick; */ }; diff --git a/superkaramba/src/clickarea.cpp b/superkaramba/src/clickarea.cpp index d060b4d..c2ca63e 100644 --- a/superkaramba/src/clickarea.cpp +++ b/superkaramba/src/clickarea.cpp @@ -18,18 +18,18 @@ ClickArea::ClickArea(karamba* k, int x, int y, int w, int h ) : Meter(k, x, y, w, h ) { value = ""; - rect = QRect( x, y, w, h ); + rect = TQRect( x, y, w, h ); } ClickArea::~ClickArea() {} -bool ClickArea::click( QMouseEvent *e ) +bool ClickArea::click( TQMouseEvent *e ) { if( rect.contains( e->x(), e->y() ) ) { - //qDebug(QString::number(e->type())); + //qDebug(TQString::number(e->type())); //KShellProcess ksp; if( e->button() != Qt::LeftButton ) return false; @@ -42,9 +42,9 @@ bool ClickArea::click( QMouseEvent *e ) } else { - QString program; + TQString program; program = onClick; - program.replace( QRegExp("%v", false), value ); + program.replace( TQRegExp("%v", false), value ); if( !program.isEmpty() ) { @@ -56,30 +56,30 @@ bool ClickArea::click( QMouseEvent *e ) return false; } -void ClickArea::setOnClick( QString oc ) +void ClickArea::setOnClick( TQString oc ) { onClick = oc; } -void ClickArea::setServiceOnClick( QString name , QString exec, QString icon ) +void ClickArea::setServiceOnClick( TQString name , TQString exec, TQString icon ) { svc_name = name; svc_onClick = exec; svc_icon = icon; } -void ClickArea::setOnMiddleClick( QString oc ) +void ClickArea::setOnMiddleClick( TQString oc ) { onMiddleClick = oc; } -QRect ClickArea::getRectangle() +TQRect ClickArea::getRectangle() { return rect; } -void ClickArea::mUpdate( QPainter *p ) +void ClickArea::mUpdate( TQPainter *p ) { p->drawRect(boundingBox); @@ -90,12 +90,12 @@ void ClickArea::mUpdate( QPainter *p ) void ClickArea::setValue( long v) { - setValue( QString::number( v ) ); + setValue( TQString::number( v ) ); } -void ClickArea::setValue( QString v ) +void ClickArea::setValue( TQString v ) { value = v; } diff --git a/superkaramba/src/clickarea.h b/superkaramba/src/clickarea.h index 80625ee..6719794 100644 --- a/superkaramba/src/clickarea.h +++ b/superkaramba/src/clickarea.h @@ -22,10 +22,10 @@ #ifndef CLICKAREA_H #define CLICKAREA_H -#include <qstring.h> -#include <qrect.h> -#include <qevent.h> -#include <qregexp.h> +#include <tqstring.h> +#include <tqrect.h> +#include <tqevent.h> +#include <tqregexp.h> #include <kprocess.h> #include <kprocio.h> @@ -45,25 +45,25 @@ public: ~ClickArea(); - virtual bool click( QMouseEvent* ); - void setOnClick( QString ); - void setServiceOnClick( QString , QString, QString); - void setOnMiddleClick( QString ); + virtual bool click( TQMouseEvent* ); + void setOnClick( TQString ); + void setServiceOnClick( TQString , TQString, TQString); + void setOnMiddleClick( TQString ); - QRect getRectangle(); + TQRect getRectangle(); - void mUpdate( QPainter* ); + void mUpdate( TQPainter* ); void setValue( long ); - void setValue( QString ); + void setValue( TQString ); - QRect rect; - QString onClick; - QString svc_onClick; - QString svc_name; - QString svc_icon; - QString onMiddleClick; - QString value; + TQRect rect; + TQString onClick; + TQString svc_onClick; + TQString svc_name; + TQString svc_icon; + TQString onMiddleClick; + TQString value; }; #endif diff --git a/superkaramba/src/clickmap.cpp b/superkaramba/src/clickmap.cpp index 62b4376..2189916 100644 --- a/superkaramba/src/clickmap.cpp +++ b/superkaramba/src/clickmap.cpp @@ -9,7 +9,7 @@ ***************************************************************************/ #include "clickmap.h" -#include <qregexp.h> +#include <tqregexp.h> #include <krun.h> ClickMap::ClickMap(karamba* k, int x, int y, int w, int h ) @@ -38,14 +38,14 @@ void ClickMap::setTextProps( TextField *t ) text = *t; } -bool ClickMap::click( QMouseEvent *e ) { +bool ClickMap::click( TQMouseEvent *e ) { //Don't load the web page if the click isn't for us if (boundingBox.contains(e->x(), e->y())) { int index = ((e -> y() - getY()) / text.getLineHeight()) + 1; if (index >= 1 && index <= (int)displays.count()) { - // qDebug( "You clicked item " + QString::number( index ) + ", " + + // qDebug( "You clicked item " + TQString::number( index ) + ", " + // displays[index - 1] + " " + links[index - 1] ); KRun::runCommand("konqueror " + links[index - 1]); } @@ -53,13 +53,13 @@ bool ClickMap::click( QMouseEvent *e ) { return false; } -void ClickMap::mUpdate( QPainter *p ) +void ClickMap::mUpdate( TQPainter *p ) { int i = 0; //text.getLineHeight(); int row = 1; p->setFont(text.getFont()); - QStringList::Iterator it = displays.begin(); + TQStringList::Iterator it = displays.begin(); while( it != displays.end() && (row <= getHeight() || getHeight() == -1 ) ) { p->setPen( text.getColor() ); @@ -71,9 +71,9 @@ void ClickMap::mUpdate( QPainter *p ) } } -void ClickMap::setValue( QString v ) +void ClickMap::setValue( TQString v ) { - QRegExp rx("^http://", false ); + TQRegExp rx("^http://", false ); if ( rx.search( v ) == -1 ) { displays.append( v ); diff --git a/superkaramba/src/clickmap.h b/superkaramba/src/clickmap.h index f6df0db..ee802f7 100644 --- a/superkaramba/src/clickmap.h +++ b/superkaramba/src/clickmap.h @@ -27,17 +27,17 @@ public: ClickMap(karamba* k, int x, int y, int w, int h); ~ClickMap(); - virtual bool click( QMouseEvent* ); - void mUpdate( QPainter* ); - void setValue( QString ); + virtual bool click( TQMouseEvent* ); + void mUpdate( TQPainter* ); + void setValue( TQString ); void setValue( long ); void setTextProps( TextField * ); private: TextField text; - QStringList links; - QStringList displays; + TQStringList links; + TQStringList displays; }; #endif diff --git a/superkaramba/src/config_python.cpp b/superkaramba/src/config_python.cpp index 28d5364..1a094eb 100644 --- a/superkaramba/src/config_python.cpp +++ b/superkaramba/src/config_python.cpp @@ -27,14 +27,14 @@ #endif #include <Python.h> -#include <qobject.h> +#include <tqobject.h> #include "karamba.h" #include "meter.h" #include "meter_python.h" #include "config_python.h" // API-Function addMenuConfigOption -long addMenuConfigOption(long widget, QString key, QString name) +long addMenuConfigOption(long widget, TQString key, TQString name) { karamba* currTheme = (karamba*)widget; @@ -54,14 +54,14 @@ PyObject* py_add_menu_config_option(PyObject *, PyObject *args) if (!checkKaramba(widget)) return NULL; - QString k, n; + TQString k, n; k.setAscii(key); - n = PyString2QString(name); + n = PyString2TQString(name); return Py_BuildValue((char*)"l", addMenuConfigOption(widget, k, n)); } -long setMenuConfigOption(long widget, QString key, bool value) +long setMenuConfigOption(long widget, TQString key, bool value) { karamba* currTheme = (karamba*)widget; @@ -79,13 +79,13 @@ PyObject* py_set_menu_config_option(PyObject *, PyObject *args) if (!checkKaramba(widget)) return NULL; - QString k; + TQString k; k.setAscii(key); return Py_BuildValue((char*)"l", setMenuConfigOption(widget, k, (bool)value)); } -long readMenuConfigOption(long widget, QString key) +long readMenuConfigOption(long widget, TQString key) { karamba* currTheme = (karamba*)widget; @@ -102,14 +102,14 @@ PyObject* py_read_menu_config_option(PyObject *, PyObject *args) if (!checkKaramba(widget)) return NULL; - QString k; + TQString k; k.setAscii(key); return Py_BuildValue((char*)"l", readMenuConfigOption(widget, k)); } // API-Function writeConfigEntry -long writeConfigEntry(long widget, QString key, QString value) +long writeConfigEntry(long widget, TQString key, TQString value) { karamba* currTheme = (karamba*)widget; @@ -129,7 +129,7 @@ PyObject* py_write_config_entry(PyObject *, PyObject *args) return NULL; if (!checkKaramba(widget)) return NULL; - QString k, v; + TQString k, v; k.setAscii(key); v.setAscii(value); @@ -137,7 +137,7 @@ PyObject* py_write_config_entry(PyObject *, PyObject *args) } // API-Function readConfigEntry -QVariant readConfigEntry(long widget, QString key) +TQVariant readConfigEntry(long widget, TQString key) { karamba* currTheme = (karamba*)widget; @@ -153,11 +153,11 @@ PyObject* py_read_config_entry(PyObject *, PyObject *args) return NULL; if (!checkKaramba(widget)) return NULL; - QString k; + TQString k; k.setAscii(key); - QVariant entry = readConfigEntry(widget, k); - QString type; + TQVariant entry = readConfigEntry(widget, k); + TQString type; type.setAscii(entry.typeName()); if (type == "Bool") @@ -172,7 +172,7 @@ PyObject* py_read_config_entry(PyObject *, PyObject *args) return Py_BuildValue((char*)"l", i); } - if (type == "QString") + if (type == "TQString") { return Py_BuildValue((char*)"s", entry.toString().ascii()); } diff --git a/superkaramba/src/cpusensor.cpp b/superkaramba/src/cpusensor.cpp index bc4b095..1cf9a06 100644 --- a/superkaramba/src/cpusensor.cpp +++ b/superkaramba/src/cpusensor.cpp @@ -8,7 +8,7 @@ * (at your option) any later version. * ***************************************************************************/ -#include <qglobal.h> +#include <tqglobal.h> #ifdef __FreeBSD__ #include <sys/time.h> @@ -26,11 +26,11 @@ #include "cpusensor.h" -CPUSensor::CPUSensor( QString cpu, int interval ) : +CPUSensor::CPUSensor( TQString cpu, int interval ) : Sensor(interval), userTicks(0), sysTicks(0), niceTicks(0), idleTicks(0) { cpuNbr = cpu; - QRegExp rx("^\\d+$"); + TQRegExp rx("^\\d+$"); if( rx.search( cpu.lower() ) == -1) cpuNbr = ""; cpuNbr = "cpu"+cpuNbr; @@ -69,12 +69,12 @@ void CPUSensor::getTicks (long &u,long &s,long &n,long &i) i = cp_time[CP_IDLE]; } #else - QFile file("/proc/stat"); - QString line; + TQFile file("/proc/stat"); + TQString line; if ( file.open(IO_ReadOnly | IO_Translate) ) { - QTextStream t( &file ); // use a text stream - QRegExp rx( cpuNbr+"\\s+(\\d+)\\s+(\\d+)\\s+(\\d+)\\s+(\\d+)"); + TQTextStream t( &file ); // use a text stream + TQRegExp rx( cpuNbr+"\\s+(\\d+)\\s+(\\d+)\\s+(\\d+)\\s+(\\d+)"); line = t.readLine(); rx.search( line ); while( (line = t.readLine()) !=0 && rx.cap(0) == "" ) @@ -131,10 +131,10 @@ void CPUSensor::update() { SensorParams *sp; Meter *meter; - QString format; + TQString format; int load = getCPULoad(); - QObjectListIt it( *objList ); + TQObjectListIt it( *objList ); while (it != 0) { sp = (SensorParams*)(*it); @@ -145,12 +145,12 @@ void CPUSensor::update() { format = "%v"; } - format.replace( QRegExp("%load", false), QString::number( load ) ); - format.replace( QRegExp("%user", false), QString::number( user ) ); - format.replace( QRegExp("%nice", false), QString::number( nice ) ); - format.replace( QRegExp("%idle", false), QString::number( idle ) ); - format.replace( QRegExp("%system", false), QString::number( system ) ); - format.replace( QRegExp("%v", false), QString::number( load ) ); + format.replace( TQRegExp("%load", false), TQString::number( load ) ); + format.replace( TQRegExp("%user", false), TQString::number( user ) ); + format.replace( TQRegExp("%nice", false), TQString::number( nice ) ); + format.replace( TQRegExp("%idle", false), TQString::number( idle ) ); + format.replace( TQRegExp("%system", false), TQString::number( system ) ); + format.replace( TQRegExp("%v", false), TQString::number( load ) ); meter->setValue( format ); ++it; diff --git a/superkaramba/src/cpusensor.h b/superkaramba/src/cpusensor.h index 5b857f6..ce9840b 100644 --- a/superkaramba/src/cpusensor.h +++ b/superkaramba/src/cpusensor.h @@ -11,14 +11,14 @@ #define CPUSENSOR_H #include "sensor.h" -#include <qfile.h> -#include <qregexp.h> +#include <tqfile.h> +#include <tqregexp.h> class CPUSensor : public Sensor { Q_OBJECT public: - CPUSensor( QString cpuNbr, int interval ); + CPUSensor( TQString cpuNbr, int interval ); ~CPUSensor(); void update(); void setMaxValue( SensorParams *sp ); @@ -37,7 +37,7 @@ private: int idle; void getTicks (long &u,long &s,long &n,long &i); - QString cpuNbr; + TQString cpuNbr; }; diff --git a/superkaramba/src/datesensor.cpp b/superkaramba/src/datesensor.cpp index 186f552..6ca4e20 100644 --- a/superkaramba/src/datesensor.cpp +++ b/superkaramba/src/datesensor.cpp @@ -9,7 +9,7 @@ ***************************************************************************/ #include "datesensor.h" -#include <qapplication.h> +#include <tqapplication.h> DateSensor::DateSensor( int interval ) : Sensor( interval ) { hidden = true; @@ -20,12 +20,12 @@ DateSensor::~DateSensor() void DateSensor::update() { - QDateTime qdt = QDateTime::currentDateTime(); - QString format; + TQDateTime qdt = TQDateTime::currentDateTime(); + TQString format; SensorParams *sp; Meter *meter; - QObjectListIt it( *objList ); + TQObjectListIt it( *objList ); while (it != 0) { sp = (SensorParams*)(*it); @@ -48,11 +48,11 @@ void DateSensor::slotCalendarDeleted() } -DatePicker::DatePicker(QWidget *parent) - : QVBox( parent, 0, WType_TopLevel | WDestructiveClose | +DatePicker::DatePicker(TQWidget *parent) + : TQVBox( parent, 0, WType_TopLevel | WDestructiveClose | WStyle_Customize | WStyle_StaysOnTop | WStyle_NoBorder ) { - setFrameStyle( QFrame::PopupPanel | QFrame::Raised ); + setFrameStyle( TQFrame::PopupPanel | TQFrame::Raised ); //KWin::setOnAllDesktops( handle(), true ); picker = new KDatePicker(this); picker->setCloseButton(true); @@ -62,24 +62,24 @@ DatePicker::DatePicker(QWidget *parent) //setIcon(SmallIcon("date")); } -void DatePicker::keyReleaseEvent(QKeyEvent *e) +void DatePicker::keyReleaseEvent(TQKeyEvent *e) { - QVBox::keyReleaseEvent(e); + TQVBox::keyReleaseEvent(e); if (e->key() == Qt::Key_Escape) close(); } -void DateSensor::toggleCalendar(QMouseEvent *ev) +void DateSensor::toggleCalendar(TQMouseEvent *ev) { - QObjectListIt it(*objList); + TQObjectListIt it(*objList); while (it != 0) { SensorParams *sp = (SensorParams*)(*it); Meter *meter = sp->getMeter(); - QString width = sp->getParam("CALWIDTH"); - QString height = sp->getParam("CALHEIGHT"); + TQString width = sp->getParam("CALWIDTH"); + TQString height = sp->getParam("CALHEIGHT"); - QRect rect(meter->getX(),meter->getY(),width.toInt(), height.toInt()); + TQRect rect(meter->getX(),meter->getY(),width.toInt(), height.toInt()); if (rect.contains( ev->x(), ev->y() )) { if (hidden) @@ -87,14 +87,14 @@ void DateSensor::toggleCalendar(QMouseEvent *ev) hidden = false; cal = new DatePicker(0); - connect(cal, SIGNAL(destroyed()), SLOT(slotCalendarDeleted())); - QPoint c = (QPoint(ev->x(), ev->y())); + connect(cal, TQT_SIGNAL(destroyed()), TQT_SLOT(slotCalendarDeleted())); + TQPoint c = (TQPoint(ev->x(), ev->y())); int w = cal->sizeHint().width(); int h = cal->sizeHint().height(); // make calendar fully visible - QRect deskR = QApplication::desktop()->screenGeometry(QApplication::desktop()->screenNumber(c)); + TQRect deskR = TQApplication::desktop()->screenGeometry(TQApplication::desktop()->screenNumber(c)); if (c.y()+h > deskR.bottom()) c.setY(deskR.bottom()-h-1); @@ -113,11 +113,11 @@ void DateSensor::toggleCalendar(QMouseEvent *ev) } } -void DateSensor::mousePressEvent(QMouseEvent *ev) +void DateSensor::mousePressEvent(TQMouseEvent *ev) { switch (ev->button()) { - case QMouseEvent::LeftButton: + case TQMouseEvent::LeftButton: toggleCalendar(ev); break; default: diff --git a/superkaramba/src/datesensor.h b/superkaramba/src/datesensor.h index 75db6e0..a761d6b 100644 --- a/superkaramba/src/datesensor.h +++ b/superkaramba/src/datesensor.h @@ -11,17 +11,17 @@ #define DATESENSOR_H #include "sensor.h" #include "sensorparams.h" -#include <qdatetime.h> +#include <tqdatetime.h> #include <kdatepicker.h> -#include <qvbox.h> +#include <tqvbox.h> class DatePicker : public QVBox { public: - DatePicker(QWidget*); + DatePicker(TQWidget*); private: KDatePicker *picker; - void keyReleaseEvent(QKeyEvent *e); + void keyReleaseEvent(TQKeyEvent *e); }; class DateSensor : public Sensor @@ -31,8 +31,8 @@ public: DateSensor( int interval ); ~DateSensor(); - void toggleCalendar(QMouseEvent *ev); - void mousePressEvent(QMouseEvent *ev); + void toggleCalendar(TQMouseEvent *ev); + void mousePressEvent(TQMouseEvent *ev); void update(); protected slots: diff --git a/superkaramba/src/dcopinterface.h b/superkaramba/src/dcopinterface.h index 665187d..256c9e2 100644 --- a/superkaramba/src/dcopinterface.h +++ b/superkaramba/src/dcopinterface.h @@ -19,17 +19,17 @@ class dcopIface : virtual public DCOPObject public: k_dcop: - virtual ASYNC openTheme(QString file) = 0; - virtual ASYNC openNamedTheme(QString file, QString name, bool is_sub_theme) = 0; - virtual ASYNC closeTheme(QString name) = 0; + virtual ASYNC openTheme(TQString file) = 0; + virtual ASYNC openNamedTheme(TQString file, TQString name, bool is_sub_theme) = 0; + virtual ASYNC closeTheme(TQString name) = 0; virtual ASYNC quit() = 0; virtual ASYNC hideSystemTray(bool hide) = 0; virtual ASYNC showThemeDialog() = 0; - virtual int themeAdded(QString appId, QString file) = 0; - virtual ASYNC themeClosed(QString appId, QString file, int instance) = 0; - virtual ASYNC themeNotify(QString name, QString text) = 0; - virtual ASYNC setIncomingData(QString name, QString obj) = 0; + virtual int themeAdded(TQString appId, TQString file) = 0; + virtual ASYNC themeClosed(TQString appId, TQString file, int instance) = 0; + virtual ASYNC themeNotify(TQString name, TQString text) = 0; + virtual ASYNC setIncomingData(TQString name, TQString obj) = 0; virtual bool isMainKaramba() = 0; }; diff --git a/superkaramba/src/disksensor.cpp b/superkaramba/src/disksensor.cpp index b8b9b96..b53c6e3 100644 --- a/superkaramba/src/disksensor.cpp +++ b/superkaramba/src/disksensor.cpp @@ -9,19 +9,19 @@ ***************************************************************************/ #include "disksensor.h" -#include <qfile.h> -#include <qtextstream.h> -#include <qstring.h> -#include <qregexp.h> +#include <tqfile.h> +#include <tqtextstream.h> +#include <tqstring.h> +#include <tqregexp.h> #include <kprocess.h> #include <kprocio.h> DiskSensor::DiskSensor( int msec ) : Sensor( msec ) { - connect(&ksp, SIGNAL(receivedStdout(KProcess *, char *, int )), - this,SLOT(receivedStdout(KProcess *, char *, int ))); - connect(&ksp, SIGNAL(processExited(KProcess *)), - this,SLOT(processExited( KProcess * ))); + connect(&ksp, TQT_SIGNAL(receivedStdout(KProcess *, char *, int )), + this,TQT_SLOT(receivedStdout(KProcess *, char *, int ))); + connect(&ksp, TQT_SIGNAL(processExited(KProcess *)), + this,TQT_SLOT(processExited( KProcess * ))); // update values on startup ksp.clearArguments(); @@ -32,38 +32,38 @@ DiskSensor::DiskSensor( int msec ) : Sensor( msec ) DiskSensor::~DiskSensor() {} -long DiskSensor::getFreeSpace(QString mntPt) const +long DiskSensor::getFreeSpace(TQString mntPt) const { - QRegExp rx( "^\\S*\\s*\\d+\\s+\\d+\\s+(\\d+)"); + TQRegExp rx( "^\\S*\\s*\\d+\\s+\\d+\\s+(\\d+)"); rx.search(mntMap[mntPt]); return rx.cap(1).toLong(); } -long DiskSensor::getUsedSpace(QString mntPt) const +long DiskSensor::getUsedSpace(TQString mntPt) const { - QRegExp rx( "^\\S*\\s*\\d+\\s+(\\d+)\\s+\\d+"); + TQRegExp rx( "^\\S*\\s*\\d+\\s+(\\d+)\\s+\\d+"); rx.search(mntMap[mntPt]); return rx.cap(1).toLong(); } -long DiskSensor::getTotalSpace(QString mntPt) const +long DiskSensor::getTotalSpace(TQString mntPt) const { - QRegExp rx( "^\\S*\\s*(\\d+)\\s+\\d+\\s+\\d+"); + TQRegExp rx( "^\\S*\\s*(\\d+)\\s+\\d+\\s+\\d+"); rx.search(mntMap[mntPt]); return rx.cap(1).toLong(); } -int DiskSensor::getPercentUsed(QString mntPt) const +int DiskSensor::getPercentUsed(TQString mntPt) const { - QRegExp rx( "\\s+(\\d+)%\\s+"); + TQRegExp rx( "\\s+(\\d+)%\\s+"); rx.search(mntMap[mntPt]); return rx.cap(1).toInt(); } -int DiskSensor::getPercentFree(QString mntPt) const +int DiskSensor::getPercentFree(TQString mntPt) const { return ( 100 - getPercentUsed( mntPt ) ); } @@ -72,17 +72,17 @@ void DiskSensor::receivedStdout(KProcess *, char *buffer, int len ) { buffer[len] = 0; - sensorResult += QString( QCString(buffer) ); + sensorResult += TQString( TQCString(buffer) ); } void DiskSensor::processExited(KProcess *) { - QStringList stringList = QStringList::split('\n',sensorResult); + TQStringList stringList = TQStringList::split('\n',sensorResult); sensorResult = ""; - QStringList::Iterator it = stringList.begin(); - //QRegExp rx( "^(/dev/).*(/\\S*)$"); - QRegExp rx( ".*\\s+(/\\S*)$"); + TQStringList::Iterator it = stringList.begin(); + //TQRegExp rx( "^(/dev/).*(/\\S*)$"); + TQRegExp rx( ".*\\s+(/\\S*)$"); while( it != stringList.end()) { @@ -95,12 +95,12 @@ void DiskSensor::processExited(KProcess *) } stringList.clear(); - QString format; - QString mntPt; + TQString format; + TQString mntPt; SensorParams *sp; Meter *meter; - QObjectListIt lit( *objList ); + TQObjectListIt lit( *objList ); while (lit != 0) { sp = (SensorParams*)(*lit); @@ -114,31 +114,31 @@ void DiskSensor::processExited(KProcess *) { format = "%u"; } - format.replace( QRegExp("%fp", false),QString::number(getPercentFree(mntPt))); - format.replace( QRegExp("%fg",false), - QString::number(getFreeSpace(mntPt)/(1024*1024))); - format.replace( QRegExp("%fkb",false), - QString::number(getFreeSpace(mntPt)*8) ); - format.replace( QRegExp("%fk",false), - QString::number(getFreeSpace(mntPt)) ); - format.replace( QRegExp("%f", false),QString::number(getFreeSpace(mntPt)/1024)); + format.replace( TQRegExp("%fp", false),TQString::number(getPercentFree(mntPt))); + format.replace( TQRegExp("%fg",false), + TQString::number(getFreeSpace(mntPt)/(1024*1024))); + format.replace( TQRegExp("%fkb",false), + TQString::number(getFreeSpace(mntPt)*8) ); + format.replace( TQRegExp("%fk",false), + TQString::number(getFreeSpace(mntPt)) ); + format.replace( TQRegExp("%f", false),TQString::number(getFreeSpace(mntPt)/1024)); - format.replace( QRegExp("%up", false),QString::number(getPercentUsed(mntPt))); - format.replace( QRegExp("%ug",false), - QString::number(getUsedSpace(mntPt)/(1024*1024))); - format.replace( QRegExp("%ukb",false), - QString::number(getUsedSpace(mntPt)*8) ); - format.replace( QRegExp("%uk",false), - QString::number(getUsedSpace(mntPt)) ); - format.replace( QRegExp("%u", false),QString::number(getUsedSpace(mntPt)/1024)); - - format.replace( QRegExp("%tg",false), - QString::number(getTotalSpace(mntPt)/(1024*1024))); - format.replace( QRegExp("%tkb",false), - QString::number(getTotalSpace(mntPt)*8)); - format.replace( QRegExp("%tk",false), - QString::number(getTotalSpace(mntPt))); - format.replace( QRegExp("%t", false),QString::number(getTotalSpace(mntPt)/1024)); + format.replace( TQRegExp("%up", false),TQString::number(getPercentUsed(mntPt))); + format.replace( TQRegExp("%ug",false), + TQString::number(getUsedSpace(mntPt)/(1024*1024))); + format.replace( TQRegExp("%ukb",false), + TQString::number(getUsedSpace(mntPt)*8) ); + format.replace( TQRegExp("%uk",false), + TQString::number(getUsedSpace(mntPt)) ); + format.replace( TQRegExp("%u", false),TQString::number(getUsedSpace(mntPt)/1024)); + + format.replace( TQRegExp("%tg",false), + TQString::number(getTotalSpace(mntPt)/(1024*1024))); + format.replace( TQRegExp("%tkb",false), + TQString::number(getTotalSpace(mntPt)*8)); + format.replace( TQRegExp("%tk",false), + TQString::number(getTotalSpace(mntPt))); + format.replace( TQRegExp("%t", false),TQString::number(getTotalSpace(mntPt)/1024)); meter->setValue(format); ++lit; } @@ -160,9 +160,9 @@ void DiskSensor::setMaxValue( SensorParams *sp ) { Meter *meter; meter = sp->getMeter(); - const QString mntPt = sp->getParam( "MOUNTPOINT" ); + const TQString mntPt = sp->getParam( "MOUNTPOINT" ); - QString f; + TQString f; f = sp->getParam("FORMAT"); if( f == "%fp" || f == "%up" ) meter->setMax( 100 ); diff --git a/superkaramba/src/disksensor.h b/superkaramba/src/disksensor.h index e35b9d8..d42c9ef 100644 --- a/superkaramba/src/disksensor.h +++ b/superkaramba/src/disksensor.h @@ -10,11 +10,11 @@ #ifndef DISKSENSOR_H #define DISKSENSOR_H #include "sensor.h" -#include <qmap.h> -#include <qstring.h> -#include <qtextcodec.h> -#include <qregexp.h> -#include <qstringlist.h> +#include <tqmap.h> +#include <tqstring.h> +#include <tqtextcodec.h> +#include <tqregexp.h> +#include <tqstringlist.h> #include <kprocess.h> class DiskSensor : public Sensor { @@ -26,17 +26,17 @@ public: void setMaxValue( SensorParams *sp ); private: - long getFreeSpace(QString mntPt) const; - long getUsedSpace(QString mntPt) const; - long getTotalSpace(QString mntPt) const; - int getPercentUsed(QString mntPt) const; - int getPercentFree(QString mntPt) const; + long getFreeSpace(TQString mntPt) const; + long getUsedSpace(TQString mntPt) const; + long getTotalSpace(TQString mntPt) const; + int getPercentUsed(TQString mntPt) const; + int getPercentFree(TQString mntPt) const; KShellProcess ksp; - QString sensorResult; + TQString sensorResult; - QMap<QString,QString> mntMap; - QStringList stringList; + TQMap<TQString,TQString> mntMap; + TQStringList stringList; int init; diff --git a/superkaramba/src/graph.cpp b/superkaramba/src/graph.cpp index c028aea..d485829 100644 --- a/superkaramba/src/graph.cpp +++ b/superkaramba/src/graph.cpp @@ -9,7 +9,7 @@ ***************************************************************************/ #include "graph.h" -#include <qstring.h> +#include <tqstring.h> Graph::Graph(karamba* k, int x, int y, int w, int h, int nbrPts): Meter(k, x, y, w, h), lastValue(0) @@ -46,12 +46,12 @@ void Graph::setValue( long v) ptPtr = (ptPtr + 1) % nbrPoints; } -void Graph::setValue( QString v ) +void Graph::setValue( TQString v ) { setValue((long)(v.toDouble() + 0.5)); } -void Graph::mUpdate(QPainter *p) +void Graph::mUpdate(TQPainter *p) { if (hidden == 0) { diff --git a/superkaramba/src/graph.h b/superkaramba/src/graph.h index 626b569..a2c164f 100644 --- a/superkaramba/src/graph.h +++ b/superkaramba/src/graph.h @@ -12,8 +12,8 @@ #define GRAPH_H #include "meter.h" -#include <qpainter.h> -#include <qcolor.h> +#include <tqpainter.h> +#include <tqcolor.h> class Graph : public Meter { @@ -26,8 +26,8 @@ public: void setValue( long ); long getValue() { return lastValue; }; - void setValue( QString ); - void mUpdate( QPainter * ); + void setValue( TQString ); + void mUpdate( TQPainter * ); private: int lastValue; diff --git a/superkaramba/src/graph_python.cpp b/superkaramba/src/graph_python.cpp index 1ef6e73..0183085 100644 --- a/superkaramba/src/graph_python.cpp +++ b/superkaramba/src/graph_python.cpp @@ -25,7 +25,7 @@ #endif #include <Python.h> -#include <qobject.h> +#include <tqobject.h> #include "karamba.h" #include "meter.h" #include "meter_python.h" diff --git a/superkaramba/src/imagelabel.cpp b/superkaramba/src/imagelabel.cpp index 9959e8b..ef38ec0 100644 --- a/superkaramba/src/imagelabel.cpp +++ b/superkaramba/src/imagelabel.cpp @@ -21,9 +21,9 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ****************************************************************************/ -#include <qpixmap.h> -#include <qtimer.h> -#include <qtooltip.h> +#include <tqpixmap.h> +#include <tqtimer.h> +#include <tqtooltip.h> #include <kpixmapeffect.h> #include <kdebug.h> #include <kimageeffect.h> @@ -39,7 +39,7 @@ Effect::Effect(ImageLabel* img, int msec) : if (msec > 0) { // remove the effect after the given time - //QTimer::singleShot (millisec, myImage, SLOT(slotEffectExpired())); + //TQTimer::singleShot (millisec, myImage, TQT_SLOT(slotEffectExpired())); //timer -> changeInterval(millisec); millisec = msec; } @@ -57,7 +57,7 @@ void Effect::startTimer() { if (millisec > 0) { - QTimer::singleShot (millisec, myImage, SLOT(slotEffectExpired())); + TQTimer::singleShot (millisec, myImage, TQT_SLOT(slotEffectExpired())); millisec = 0; } } @@ -77,7 +77,7 @@ KPixmap Intensity::apply(KPixmap pixmap) } // ChannelIntensity -ChannelIntensity::ChannelIntensity(ImageLabel* img, float r, QString c, +ChannelIntensity::ChannelIntensity(ImageLabel* img, float r, TQString c, int millisec) : Effect(img, millisec) { @@ -151,13 +151,13 @@ ImageLabel::~ImageLabel() } if(!old_tip_rect.isNull()) { - QToolTip::remove(m_karamba, old_tip_rect); + TQToolTip::remove(m_karamba, old_tip_rect); } } void ImageLabel::setValue(long v) { - setValue( QString::number( v ) ); + setValue( TQString::number( v ) ); } void ImageLabel::show() @@ -227,7 +227,7 @@ void ImageLabel::applyTransformations(bool useSmoothScale) if (doRotate) { // KDE and QT seem to miss a high quality image rotation - QWMatrix rotMat; + TQWMatrix rotMat; rotMat.rotate(rot_angle); pixmap = pixmap.xForm(rotMat); } @@ -242,7 +242,7 @@ void ImageLabel::applyTransformations(bool useSmoothScale) { double widthFactor = ((double)scale_w) / ((double)pixmap.width()); double heightFactor = ((double)scale_h) / ((double)pixmap.height()); - QWMatrix scaleMat; + TQWMatrix scaleMat; scaleMat.scale(widthFactor, heightFactor); pixmap = pixmap.xForm(scaleMat); } @@ -257,7 +257,7 @@ void ImageLabel::applyTransformations(bool useSmoothScale) void ImageLabel::slotCopyResult(KIO::Job* job) { - QString tempFile = ((KIO::FileCopyJob*)job)->destURL().path(); + TQString tempFile = ((KIO::FileCopyJob*)job)->destURL().path(); if(job->error() == 0) { setValue(tempFile); @@ -272,30 +272,30 @@ void ImageLabel::slotCopyResult(KIO::Job* job) KIO::NetAccess::removeTempFile(tempFile); } -void ImageLabel::setValue(QString fn) +void ImageLabel::setValue(TQString fn) { // use the first line - QStringList sList = QStringList::split( "\n", fn ); - QString fileName = *sList.begin(); + TQStringList sList = TQStringList::split( "\n", fn ); + TQString fileName = *sList.begin(); KURL url(fileName); - QRegExp rx("^[a-zA-Z]{1,5}:/",false); + TQRegExp rx("^[a-zA-Z]{1,5}:/",false); bool protocol = (rx.search(fileName)!=-1)?true:false; - QPixmap pm; + TQPixmap pm; if(protocol && url.isLocalFile() == false) { KTempFile tmpFile; KIO::FileCopyJob* copy = KIO::file_copy(fileName, tmpFile.name(), 0600, true, false, false); - connect(copy, SIGNAL(result(KIO::Job*)), - this, SLOT(slotCopyResult(KIO::Job*))); + connect(copy, TQT_SIGNAL(result(KIO::Job*)), + this, TQT_SLOT(slotCopyResult(KIO::Job*))); return; } else { if(m_karamba->theme().isThemeFile(fileName)) { - QByteArray ba = m_karamba->theme().readThemeFile(fileName); + TQByteArray ba = m_karamba->theme().readThemeFile(fileName); pm.loadFromData(ba); } else @@ -309,9 +309,9 @@ void ImageLabel::setValue(QString fn) //Matthew Kay: a new version of setValue to be used by createTaskIcon() /** - * set the internal pixmap of this image to the given QPixmap pix + * set the internal pixmap of this image to the given TQPixmap pix */ -void ImageLabel::setValue(QPixmap& pix) +void ImageLabel::setValue(TQPixmap& pix) { realpixmap = KPixmap(pix); pixmap = realpixmap; @@ -320,10 +320,10 @@ void ImageLabel::setValue(QPixmap& pix) pixmapWidth = pixmap.width(); pixmapHeight = pixmap.height(); - rect_off = QRect(getX(),getY(),pixmapWidth,pixmapHeight); + rect_off = TQRect(getX(),getY(),pixmapWidth,pixmapHeight); } -void ImageLabel::mUpdate(QPainter* p, int backgroundUpdate) +void ImageLabel::mUpdate(TQPainter* p, int backgroundUpdate) { if (backgroundUpdate == 1) { @@ -337,9 +337,9 @@ void ImageLabel::mUpdate(QPainter* p, int backgroundUpdate) { //Blend this image with a color - QImage image = pixmap.convertToImage(); + TQImage image = pixmap.convertToImage(); - QImage result = KImageEffect::blend(QColor(255,0,0), image, 0.5f); + TQImage result = KImageEffect::blend(TQColor(255,0,0), image, 0.5f); p->drawImage(getX(),getY(),result); //p->drawRect(boundingBox); @@ -353,7 +353,7 @@ void ImageLabel::mUpdate(QPainter* p, int backgroundUpdate) } } -void ImageLabel::mUpdate(QPainter* p) +void ImageLabel::mUpdate(TQPainter* p) { //only draw image if not hidden if (hidden == 0 && background == 0) @@ -367,9 +367,9 @@ void ImageLabel::mUpdate(QPainter* p) { //Blend this image with a color - QImage image = pixmap.convertToImage(); + TQImage image = pixmap.convertToImage(); - QImage result = KImageEffect::blend(QColor(255,0,0), image, 0.5f); + TQImage result = KImageEffect::blend(TQColor(255,0,0), image, 0.5f); p->drawImage(getX(),getY(),result); //p->drawRect(boundingBox); @@ -382,11 +382,11 @@ void ImageLabel::mUpdate(QPainter* p) } } -bool ImageLabel::click(QMouseEvent* e) +bool ImageLabel::click(TQMouseEvent* e) { if (getBoundingBox().contains(e -> x(), e -> y()) && isEnabled()) { - QString program; + TQString program; if (e -> button() == Qt::LeftButton) { program = leftButtonAction; @@ -412,7 +412,7 @@ bool ImageLabel::click(QMouseEvent* e) return false; } -void ImageLabel::parseImages(QString fn, QString fn_roll, int _xoff, +void ImageLabel::parseImages(TQString fn, TQString fn_roll, int _xoff, int _yoff, int _xon, int _yon) { //fn = filename; @@ -424,12 +424,12 @@ void ImageLabel::parseImages(QString fn, QString fn_roll, int _xoff, yon = _yon; // use the first line - QStringList sList = QStringList::split( "\n", fn ); - QString fileName = *sList.begin(); - QFileInfo fileInfo( fileName ); - QString path; + TQStringList sList = TQStringList::split( "\n", fn ); + TQString fileName = *sList.begin(); + TQFileInfo fileInfo( fileName ); + TQString path; - QRegExp rx("^http://",false); + TQRegExp rx("^http://",false); bool fileOnNet = (rx.search(fileName)!=-1)?true:false; @@ -444,7 +444,7 @@ void ImageLabel::parseImages(QString fn, QString fn_roll, int _xoff, if ( fileOnNet ) { - QString tmpFile; + TQString tmpFile; #if defined(KDE_3_2) if(KIO::NetAccess::download(KURL(path), tmpFile, karambaApp->parentWindow())) #else @@ -468,15 +468,15 @@ void ImageLabel::parseImages(QString fn, QString fn_roll, int _xoff, pixmapOffWidth = pixmap.width(); pixmapOffHeight = pixmap.height(); - rect_off = QRect(xoff,yoff,pixmapWidth,pixmapHeight); + rect_off = TQRect(xoff,yoff,pixmapWidth,pixmapHeight); ///////////////////////////// if (fn_roll.isEmpty()) return; rollover=true; - sList = QStringList::split( "\n", fn_roll ); + sList = TQStringList::split( "\n", fn_roll ); fileName = *sList.begin(); - fileInfo = QFileInfo( fileName ); + fileInfo = TQFileInfo( fileName ); fileOnNet = (rx.search(fileName)!=-1)?true:false; @@ -492,7 +492,7 @@ void ImageLabel::parseImages(QString fn, QString fn_roll, int _xoff, if ( fileOnNet ) { - QString tmpFile; + TQString tmpFile; #if defined(KDE_3_2) if(KIO::NetAccess::download(KURL(path), tmpFile, karambaApp->parentWindow())) #else @@ -515,7 +515,7 @@ void ImageLabel::parseImages(QString fn, QString fn_roll, int _xoff, pixmapOnWidth = pixmap_on.width(); pixmapOnHeight = pixmap_on.height(); - rect_on = QRect(xon,yon,pixmapOnWidth,pixmapOnHeight); + rect_on = TQRect(xon,yon,pixmapOnWidth,pixmapOnHeight); } void ImageLabel::setBackground(int b) @@ -523,7 +523,7 @@ void ImageLabel::setBackground(int b) background = b; } -void ImageLabel::rolloverImage(QMouseEvent *e) +void ImageLabel::rolloverImage(TQMouseEvent *e) { if (!rollover) return; @@ -560,11 +560,11 @@ void ImageLabel::rolloverImage(QMouseEvent *e) } } -void ImageLabel::setTooltip(QString txt) +void ImageLabel::setTooltip(TQString txt) { - QRect rect(getX(),getY(),pixmapWidth,pixmapHeight); - QToolTip::add(m_karamba, rect, txt); - old_tip_rect = QRect(rect.topLeft(), rect.bottomRight()); + TQRect rect(getX(),getY(),pixmapWidth,pixmapHeight); + TQToolTip::add(m_karamba, rect, txt); + old_tip_rect = TQRect(rect.topLeft(), rect.bottomRight()); } @@ -590,7 +590,7 @@ void ImageLabel::intensity(float ratio, int millisec) applyTransformations(); } -void ImageLabel::channelIntensity(float ratio, QString channel, int millisec) +void ImageLabel::channelIntensity(float ratio, TQString channel, int millisec) { if (imageEffect != 0) { @@ -620,9 +620,9 @@ void ImageLabel::slotEffectExpired() m_karamba -> externalStep(); } -void ImageLabel::attachClickArea(QString leftMouseButton, - QString middleMouseButton, - QString rightMouseButton) +void ImageLabel::attachClickArea(TQString leftMouseButton, + TQString middleMouseButton, + TQString rightMouseButton) { leftButtonAction = leftMouseButton; middleButtonAction = middleMouseButton; diff --git a/superkaramba/src/imagelabel.h b/superkaramba/src/imagelabel.h index ff2a7ec..ebe417d 100644 --- a/superkaramba/src/imagelabel.h +++ b/superkaramba/src/imagelabel.h @@ -26,15 +26,15 @@ #include "meter.h" #include <kpixmap.h> -#include <qimage.h> -#include <qpixmap.h> -#include <qpainter.h> -#include <qstring.h> -#include <qstringlist.h> +#include <tqimage.h> +#include <tqpixmap.h> +#include <tqpainter.h> +#include <tqstring.h> +#include <tqstringlist.h> #include <kurl.h> #include <kio/netaccess.h> -#include <qregexp.h> -#include <qtimer.h> +#include <tqregexp.h> +#include <tqtimer.h> #include "karamba.h" class ImageLabel; @@ -78,7 +78,7 @@ private: class ChannelIntensity : public Effect { public: - ChannelIntensity(ImageLabel*, float r, QString c, int millisec); + ChannelIntensity(ImageLabel*, float r, TQString c, int millisec); KPixmap apply(KPixmap pixmap); @@ -105,38 +105,38 @@ public: ImageLabel(karamba* k, int ix,int iy,int iw,int ih ); ImageLabel(karamba* k); ~ImageLabel(); - void setValue( QString imagePath ); + void setValue( TQString imagePath ); void setValue( long ); - void setValue( QPixmap& ); - QString getStringValue() { return imagePath; }; + void setValue( TQPixmap& ); + TQString getStringValue() { return imagePath; }; void scale( int, int ); void smoothScale( int, int ); void rotate(int); void removeImageTransformations(); - void mUpdate( QPainter * ); - void mUpdate( QPainter *, int ); + void mUpdate( TQPainter * ); + void mUpdate( TQPainter *, int ); - void rolloverImage(QMouseEvent *e); - void parseImages( QString fn, QString fn_roll, int, int, int, int ); + void rolloverImage(TQMouseEvent *e); + void parseImages( TQString fn, TQString fn_roll, int, int, int, int ); virtual void show(); virtual void hide(); - void setTooltip(QString txt); + void setTooltip(TQString txt); int cblend; int background; // Pixmap Effects void removeEffects(); void intensity(float ratio, int millisec); - void channelIntensity(float ratio, QString channel, int millisec); + void channelIntensity(float ratio, TQString channel, int millisec); void toGray(int millisec); void setBackground(int b); - void attachClickArea(QString leftMouseButton, QString middleMouseButton, - QString rightMouseButton); + void attachClickArea(TQString leftMouseButton, TQString middleMouseButton, + TQString rightMouseButton); - virtual bool click(QMouseEvent*); + virtual bool click(TQMouseEvent*); private slots: @@ -165,27 +165,27 @@ private: Effect* imageEffect; // Scale Matrix - //QWMatrix scaleMat; + //TQWMatrix scaleMat; int scale_w; int scale_h; // Rotation Matrix - //QWMatrix rotMat; + //TQWMatrix rotMat; int rot_angle; KPixmap pixmap; KPixmap realpixmap; - QRect rect_off, rect_on; - QRect old_tip_rect; + TQRect rect_off, rect_on; + TQRect old_tip_rect; bool zoomed; - //QString fn, fn_roll; + //TQString fn, fn_roll; bool rollover; KPixmap pixmap_off; KPixmap pixmap_on; int xoff,xon; int yoff,yon; - QString imagePath; + TQString imagePath; }; #endif // IMAGELABEL_H diff --git a/superkaramba/src/imagelabel_python.cpp b/superkaramba/src/imagelabel_python.cpp index 6564ce5..7cf6d73 100644 --- a/superkaramba/src/imagelabel_python.cpp +++ b/superkaramba/src/imagelabel_python.cpp @@ -27,7 +27,7 @@ #endif #include <Python.h> -#include <qobject.h> +#include <tqobject.h> #include "karamba.h" #include "imagelabel.h" #include "meter_python.h" @@ -37,8 +37,8 @@ ImageLabel* createImageLabel(karamba *theme, long x, long y, char* path, bool bg) { - QString file; - //QString fakefile; + TQString file; + //TQString fakefile; /*tmp->setThemePath(theme->themePath);*/ //FIXME: This is an ugly hack to ensure a unique reference @@ -124,8 +124,8 @@ PyObject* py_createTaskIcon(PyObject *, PyObject *args) qWarning("Task not found."); return (long)NULL ; } - //retrieve the QPixmap that represents this image - QPixmap iconPixmap = KWin::icon(currTask->window()); + //retrieve the TQPixmap that represents this image + TQPixmap iconPixmap = KWin::icon(currTask->window()); ImageLabel *tmp = createImageLabel((karamba*)widget, x, y, 0, 0); tmp->setValue(iconPixmap); @@ -326,6 +326,6 @@ PyObject* py_addImageTooltip(PyObject *, PyObject *args) return NULL; if (!checkKarambaAndMeter(widget, meter, "ImageLabel")) return NULL; - ((ImageLabel*)meter)->setTooltip(PyString2QString(t)); + ((ImageLabel*)meter)->setTooltip(PyString2TQString(t)); return Py_BuildValue((char*)"l", 1); } diff --git a/superkaramba/src/input.cpp b/superkaramba/src/input.cpp index a917488..eae8780 100644 --- a/superkaramba/src/input.cpp +++ b/superkaramba/src/input.cpp @@ -24,7 +24,7 @@ Input::Input(karamba* k, int x, int y, int w, int h): Meter(k, x, y, w, h) { - edit = new SKLineEdit((QWidget*)k, this); + edit = new SKLineEdit((TQWidget*)k, this); edit->setGeometry(x,y,w,h); } @@ -33,38 +33,38 @@ Input::~Input() delete edit; } -void Input::mUpdate(QPainter*) +void Input::mUpdate(TQPainter*) { edit->repaint(); } -void Input::setValue(QString text) +void Input::setValue(TQString text) { edit->setText(text); } -QString Input::getStringValue() const +TQString Input::getStringValue() const { return edit->text(); } -void Input::setBGColor(QColor c) +void Input::setBGColor(TQColor c) { edit->setBackgroundColor(c); } -void Input::setColor(QColor c) +void Input::setColor(TQColor c) { Meter::setColor(c); edit->setFrameColor(c); } -QColor Input::getBGColor() const +TQColor Input::getBGColor() const { return edit->backgroundColor(); } -QColor Input::getColor() const +TQColor Input::getColor() const { return edit->getFrameColor(); } @@ -111,53 +111,53 @@ void Input::setHeight(int ih) edit->setGeometry(getX(), getY(), getWidth(), ih); } -void Input::setFont(QString f) +void Input::setFont(TQString f) { font.setFamily(f); edit->setFont(font); } -QString Input::getFont() const +TQString Input::getFont() const { return font.family(); } -void Input::setFontColor(QColor fontColor) +void Input::setFontColor(TQColor fontColor) { - QPalette palette = edit->palette(); - palette.setColor(QColorGroup::Text, fontColor); + TQPalette palette = edit->palette(); + palette.setColor(TQColorGroup::Text, fontColor); edit->setPalette(palette); } -QColor Input::getFontColor() const +TQColor Input::getFontColor() const { - const QColorGroup &color = edit->colorGroup(); + const TQColorGroup &color = edit->colorGroup(); return color.text(); } -void Input::setSelectionColor(QColor selectionColor) +void Input::setSelectionColor(TQColor selectionColor) { - QPalette palette = edit->palette(); - palette.setColor(QColorGroup::Highlight, selectionColor); + TQPalette palette = edit->palette(); + palette.setColor(TQColorGroup::Highlight, selectionColor); edit->setPalette(palette); } -QColor Input::getSelectionColor() const +TQColor Input::getSelectionColor() const { - const QColorGroup &color = edit->colorGroup(); + const TQColorGroup &color = edit->colorGroup(); return color.highlight(); } -void Input::setSelectedTextColor(QColor selectedTextColor) +void Input::setSelectedTextColor(TQColor selectedTextColor) { - QPalette palette = edit->palette(); - palette.setColor(QColorGroup::HighlightedText, selectedTextColor); + TQPalette palette = edit->palette(); + palette.setColor(TQColorGroup::HighlightedText, selectedTextColor); edit->setPalette(palette); } -QColor Input::getSelectedTextColor() const +TQColor Input::getSelectedTextColor() const { - const QColorGroup &color = edit->colorGroup(); + const TQColorGroup &color = edit->colorGroup(); return color.highlightedText(); } diff --git a/superkaramba/src/input.h b/superkaramba/src/input.h index 15c16e0..0c9ad71 100644 --- a/superkaramba/src/input.h +++ b/superkaramba/src/input.h @@ -24,12 +24,12 @@ #include <meter.h> #include <sklineedit.h> -#include <qpainter.h> -#include <qcolor.h> -#include <qlineedit.h> -#include <qwidget.h> -#include <qstring.h> -#include <qfont.h> +#include <tqpainter.h> +#include <tqcolor.h> +#include <tqlineedit.h> +#include <tqwidget.h> +#include <tqstring.h> +#include <tqfont.h> #include "textfield.h" @@ -42,21 +42,21 @@ public: ~Input(); - void mUpdate(QPainter *p); + void mUpdate(TQPainter *p); - void setValue(QString text); - QString getStringValue() const; + void setValue(TQString text); + TQString getStringValue() const; - void setBGColor(QColor c); - QColor getBGColor() const; - void setColor(QColor c); - QColor getColor() const; - void setFontColor(QColor fontColor); - QColor getFontColor() const; - void setSelectionColor(QColor selectionColor); - QColor getSelectionColor() const; - void setSelectedTextColor(QColor selectedTextColor); - QColor getSelectedTextColor() const; + void setBGColor(TQColor c); + TQColor getBGColor() const; + void setColor(TQColor c); + TQColor getColor() const; + void setFontColor(TQColor fontColor); + TQColor getFontColor() const; + void setSelectionColor(TQColor selectionColor); + TQColor getSelectionColor() const; + void setSelectedTextColor(TQColor selectedTextColor); + TQColor getSelectedTextColor() const; void setTextProps(TextField*); void hide(); @@ -68,8 +68,8 @@ public: void setWidth(int iw); void setHeight(int ih); - void setFont(QString f); - QString getFont() const; + void setFont(TQString f); + TQString getFont() const; void setFontSize(int size); int getFontSize() const; @@ -78,7 +78,7 @@ public: private: SKLineEdit *edit; - QFont font; + TQFont font; }; #endif diff --git a/superkaramba/src/input_python.cpp b/superkaramba/src/input_python.cpp index 0bf45e1..fc1d9ad 100644 --- a/superkaramba/src/input_python.cpp +++ b/superkaramba/src/input_python.cpp @@ -28,7 +28,7 @@ #endif #include <Python.h> -#include <qobject.h> +#include <tqobject.h> #include "karamba.h" #include "meter.h" #include "meter_python.h" @@ -45,7 +45,7 @@ PyObject* py_createInputBox(PyObject *, PyObject *args) return NULL; Input *tmp = new Input((karamba*)widget, (int)x, (int)y, (int)w, (int)h); - tmp->setValue(PyString2QString(text)); + tmp->setValue(PyString2TQString(text)); tmp->setTextProps(((karamba*)widget)->getDefaultTextProps()); ((karamba*)widget)->meterList->append(tmp); tmp->show(); @@ -153,7 +153,7 @@ PyObject* py_setInputBoxFontColor(PyObject *, PyObject *args) if (!checkKarambaAndMeter(widget, inputBox, "Input")) return NULL; - ((Input*)inputBox)->setFontColor(QColor(r, g, b)); + ((Input*)inputBox)->setFontColor(TQColor(r, g, b)); return Py_BuildValue((char*)"l", 1); } @@ -166,7 +166,7 @@ PyObject* py_getInputBoxFontColor(PyObject *, PyObject *args) if (!checkKarambaAndMeter(widget, inputBox, "Input")) return NULL; - QColor color = ((Input*)inputBox)->getFontColor(); + TQColor color = ((Input*)inputBox)->getFontColor(); return Py_BuildValue((char*)"(i,i,i)", color.red(), color.green(), color.blue()); } @@ -180,7 +180,7 @@ PyObject* py_setInputBoxSelectionColor(PyObject *, PyObject *args) if (!checkKarambaAndMeter(widget, inputBox, "Input")) return NULL; - ((Input*)inputBox)->setSelectionColor(QColor(r, g, b)); + ((Input*)inputBox)->setSelectionColor(TQColor(r, g, b)); return Py_BuildValue((char*)"l", 1); } @@ -193,7 +193,7 @@ PyObject* py_getInputBoxSelectionColor(PyObject *, PyObject *args) if (!checkKarambaAndMeter(widget, inputBox, "Input")) return NULL; - QColor color = ((Input*)inputBox)->getSelectionColor(); + TQColor color = ((Input*)inputBox)->getSelectionColor(); return Py_BuildValue((char*)"(i,i,i)", color.red(), color.green(), color.blue()); } @@ -207,7 +207,7 @@ PyObject* py_setInputBoxBGColor(PyObject *, PyObject *args) if (!checkKarambaAndMeter(widget, inputBox, "Input")) return NULL; - ((Input*)inputBox)->setBGColor(QColor(r, g, b)); + ((Input*)inputBox)->setBGColor(TQColor(r, g, b)); return Py_BuildValue((char*)"l", 1); } @@ -220,7 +220,7 @@ if (!PyArg_ParseTuple(args, (char*)"ll:getInputBoxBackgroundColor", &widget, &in if (!checkKarambaAndMeter(widget, inputBox, "Input")) return NULL; - QColor color = ((Input*)inputBox)->getBGColor(); + TQColor color = ((Input*)inputBox)->getBGColor(); return Py_BuildValue((char*)"(i,i,i)", color.red(), color.green(), color.blue()); } @@ -234,7 +234,7 @@ if (!PyArg_ParseTuple(args, (char*)"lllll:changeInputBoxFrameColor", &widget, &i if (!checkKarambaAndMeter(widget, inputBox, "Input")) return NULL; - ((Input*)inputBox)->setColor(QColor(r, g, b)); + ((Input*)inputBox)->setColor(TQColor(r, g, b)); return Py_BuildValue((char*)"l", 1); } @@ -247,7 +247,7 @@ if (!PyArg_ParseTuple(args, (char*)"ll:getInputBoxFrameColor", &widget, &inputBo if (!checkKarambaAndMeter(widget, inputBox, "Input")) return NULL; - QColor color = ((Input*)inputBox)->getColor(); + TQColor color = ((Input*)inputBox)->getColor(); return Py_BuildValue((char*)"(i,i,i)", color.red(), color.green(), color.blue()); } @@ -261,7 +261,7 @@ if (!PyArg_ParseTuple(args, (char*)"lllll:changeInputBoxSelectedTextColor", &wid if (!checkKarambaAndMeter(widget, inputBox, "Input")) return NULL; - ((Input*)inputBox)->setSelectedTextColor(QColor(r, g, b)); + ((Input*)inputBox)->setSelectedTextColor(TQColor(r, g, b)); return Py_BuildValue((char*)"l", 1); } @@ -274,7 +274,7 @@ if (!PyArg_ParseTuple(args, (char*)"ll:getInputBoxSelectedTextColor", &widget, & if (!checkKarambaAndMeter(widget, inputBox, "Input")) return NULL; - QColor color = ((Input*)inputBox)->getSelectedTextColor(); + TQColor color = ((Input*)inputBox)->getSelectedTextColor(); return Py_BuildValue((char*)"(i,i,i)", color.red(), color.green(), color.blue()); } @@ -346,9 +346,9 @@ PyObject* py_getInputFocus(PyObject *, PyObject *args) // FocusWidget() returns the currently focused line edit, // but unfortunately we need an 'Input' object here. // - QWidget *obj = ((karamba*)widget)->focusWidget(); + TQWidget *obj = ((karamba*)widget)->focusWidget(); - if(obj->isA("QLineEdit")) // SKLineEdit is no Q_Object, but QLineEdit can only be here as a SKLineEdit + if(obj->isA("TQLineEdit")) // SKLineEdit is no Q_Object, but TQLineEdit can only be here as a SKLineEdit return Py_BuildValue((char*)"l", ((SKLineEdit*)obj)->getInput()); return Py_BuildValue((char*)"l", 0); diff --git a/superkaramba/src/karamba.cpp b/superkaramba/src/karamba.cpp index b112af0..fb90a45 100644 --- a/superkaramba/src/karamba.cpp +++ b/superkaramba/src/karamba.cpp @@ -42,16 +42,16 @@ #include <kparts/componentfactory.h> #include <kparts/part.h> -#include <qdir.h> -#include <qwidgetlist.h> +#include <tqdir.h> +#include <tqwidgetlist.h> // Menu IDs #define EDITSCRIPT 1 #define THEMECONF 2 -karamba::karamba(QString fn, QString name, bool reloading, int instance, +karamba::karamba(TQString fn, TQString name, bool reloading, int instance, bool sub_theme): - QWidget(0,"karamba", Qt::WGroupLeader | WStyle_Customize | + TQWidget(0,"karamba", Qt::WGroupLeader | WStyle_Customize | WRepaintNoErase| WStyle_NoBorder | WDestructiveClose ), meterList(0), imageList(0), clickList(0), kpop(0), widgetMask(0), config(0), kWinModule(0), tempUnit('C'), m_instance(instance), @@ -77,7 +77,7 @@ karamba::karamba(QString fn, QString name, bool reloading, int instance, if(!m_theme.set(url)) { setFixedSize(0, 0); - QTimer::singleShot(100, this, SLOT(killWidget())); + TQTimer::singleShot(100, this, TQT_SLOT(killWidget())); return; } // Add self to list of open themes @@ -85,23 +85,23 @@ karamba::karamba(QString fn, QString name, bool reloading, int instance, karambaApp->addKaramba(this, reloading); if(prettyName.isEmpty()) - prettyName = QString("%1 - %2").arg(m_theme.name()).arg(m_instance); + prettyName = TQString("%1 - %2").arg(m_theme.name()).arg(m_instance); kdDebug() << "Starting theme: " << m_theme.name() << " pretty name: " << prettyName << endl; - QString qName = "karamba - " + prettyName; + TQString qName = "karamba - " + prettyName; setName(qName.ascii()); KDirWatch *dirWatch = KDirWatch::self(); - connect(dirWatch, SIGNAL( dirty( const QString & ) ), - SLOT( slotFileChanged( const QString & ) ) ); + connect(dirWatch, TQT_SIGNAL( dirty( const TQString & ) ), + TQT_SLOT( slotFileChanged( const TQString & ) ) ); if(!dirWatch->contains(m_theme.file())) dirWatch->addFile(m_theme.file()); if(!m_theme.isZipTheme() && m_theme.pythonModuleExists()) { - QString pythonFile = m_theme.path() + "/" + m_theme.pythonModule() + ".py"; + TQString pythonFile = m_theme.path() + "/" + m_theme.pythonModule() + ".py"; if(!dirWatch->contains(pythonFile)) dirWatch->addFile(pythonFile); } @@ -109,15 +109,15 @@ karamba::karamba(QString fn, QString name, bool reloading, int instance, widgetUpdate = true; // Creates KConfig Object - QString instanceString; + TQString instanceString; if(m_instance > 1) - instanceString = QString("-%1").arg(m_instance); - QString cfg = QDir::home().absPath() + "/.superkaramba/" + instanceString = TQString("-%1").arg(m_instance); + TQString cfg = TQDir::home().absPath() + "/.superkaramba/" + m_theme.id() + instanceString + ".rc"; kdDebug() << cfg << endl; - QFile themeConfigFile(cfg); + TQFile themeConfigFile(cfg); // Tests if config file Exists - if (!QFileInfo(themeConfigFile).exists()) + if (!TQFileInfo(themeConfigFile).exists()) { // Create config file themeConfigFile.open(IO_ReadWrite); @@ -132,7 +132,7 @@ karamba::karamba(QString fn, QString name, bool reloading, int instance, if(m_theme.pythonModuleExists()) { kdDebug() << "Loading python module: " << m_theme.pythonModule() << endl; - QTimer::singleShot(0, this, SLOT(initPythonInterface())); + TQTimer::singleShot(0, this, TQT_SLOT(initPythonInterface())); } widgetMask = 0; @@ -142,22 +142,22 @@ karamba::karamba(QString fn, QString name, bool reloading, int instance, kWinModule = new KWinModule(); desktop = 0; - connect( kWinModule,SIGNAL(currentDesktopChanged(int)), this, - SLOT(currentDesktopChanged(int)) ); - connect( kapp, SIGNAL(backgroundChanged(int)), this, - SLOT(currentWallpaperChanged(int))); + connect( kWinModule,TQT_SIGNAL(currentDesktopChanged(int)), this, + TQT_SLOT(currentDesktopChanged(int)) ); + connect( kapp, TQT_SIGNAL(backgroundChanged(int)), this, + TQT_SLOT(currentWallpaperChanged(int))); // Setup of the Task Manager Callbacks - connect(&taskManager, SIGNAL(activeTaskChanged(Task*)), this, - SLOT(activeTaskChanged(Task*)) ); - connect(&taskManager, SIGNAL(taskAdded(Task*)), this, - SLOT(taskAdded(Task*)) ); - connect(&taskManager, SIGNAL(taskRemoved(Task*)), this, - SLOT(taskRemoved(Task*)) ); - connect(&taskManager, SIGNAL(startupAdded(Startup*)), this, - SLOT(startupAdded(Startup*)) ); - connect(&taskManager, SIGNAL(startupRemoved(Startup*)), this, - SLOT(startupRemoved(Startup*)) ); + connect(&taskManager, TQT_SIGNAL(activeTaskChanged(Task*)), this, + TQT_SLOT(activeTaskChanged(Task*)) ); + connect(&taskManager, TQT_SIGNAL(taskAdded(Task*)), this, + TQT_SLOT(taskAdded(Task*)) ); + connect(&taskManager, TQT_SIGNAL(taskRemoved(Task*)), this, + TQT_SLOT(taskRemoved(Task*)) ); + connect(&taskManager, TQT_SIGNAL(startupAdded(Startup*)), this, + TQT_SLOT(startupAdded(Startup*)) ); + connect(&taskManager, TQT_SIGNAL(startupRemoved(Startup*)), this, + TQT_SLOT(startupRemoved(Startup*)) ); themeConfMenu = new KPopupMenu( this); themeConfMenu -> setCheckable(true); @@ -171,17 +171,17 @@ karamba::karamba(QString fn, QString name, bool reloading, int instance, toDesktopMenu -> setCheckable(true); mid = toDesktopMenu -> insertItem (i18n("&All Desktops"), dslot = new DesktopChangeSlot(this,0), - SLOT(receive())); + TQT_SLOT(receive())); dslot->setMenuId(mid); toDesktopMenu -> insertSeparator(); for (int ndesktop=1; ndesktop <= kWinModule->numberOfDesktops(); ndesktop++) { - QString name = i18n("Desktop &"); + TQString name = i18n("Desktop &"); name += ('0' + ndesktop); mid = toDesktopMenu -> insertItem (name, - dslot = new DesktopChangeSlot(this, ndesktop), SLOT(receive())); + dslot = new DesktopChangeSlot(this, ndesktop), TQT_SLOT(receive())); dslot->setMenuId(mid); } @@ -193,11 +193,11 @@ karamba::karamba(QString fn, QString name, bool reloading, int instance, menuAccColl = new KActionCollection( this ); kpop->insertItem( SmallIconSet("reload"),i18n("Update"), this, - SLOT(updateSensors()), Key_F5 ); + TQT_SLOT(updateSensors()), Key_F5 ); toggleLocked = new KToggleAction ( i18n("Toggle &Locked Position"), SmallIconSet("locked"), CTRL+Key_L, this, - SLOT( slotToggleLocked() ), + TQT_SLOT( slotToggleLocked() ), accColl, "Locked position" ); accColl->insert(toggleLocked); toggleLocked -> setChecked(true); @@ -206,7 +206,7 @@ karamba::karamba(QString fn, QString name, bool reloading, int instance, toggleFastTransforms = new KToggleAction(i18n("Use &Fast Image Scaling"), CTRL+Key_F, this, - SLOT( slotToggleFastTransforms() ), + TQT_SLOT( slotToggleFastTransforms() ), accColl, "Fast transformations"); accColl->insert(toggleFastTransforms); @@ -221,9 +221,9 @@ karamba::karamba(QString fn, QString name, bool reloading, int instance, kpop->insertItem(i18n("To Des&ktop"), toDesktopMenu); kpop->insertItem( SmallIconSet("reload3"),i18n("&Reload Theme"),this, - SLOT(reloadConfig()), CTRL+Key_R ); + TQT_SLOT(reloadConfig()), CTRL+Key_R ); kpop->insertItem( SmallIconSet("fileclose"),i18n("&Close This Theme"), this, - SLOT(killWidget()), CTRL+Key_C ); + TQT_SLOT(killWidget()), CTRL+Key_C ); if(!SuperKarambaSettings::showSysTray()) showMenuExtension(); @@ -239,14 +239,14 @@ karamba::karamba(QString fn, QString name, bool reloading, int instance, fixedPosition = false; defaultTextField = new TextField(); - meterList = new QObjectList(); + meterList = new TQObjectList(); meterList->setAutoDelete( true ); - sensorList = new QObjectList(); + sensorList = new TQObjectList(); sensorList->setAutoDelete( true ); - clickList = new QObjectList(); - timeList = new QObjectList(); - imageList = new QObjectList(); - menuList = new QObjectList(); + clickList = new TQObjectList(); + timeList = new TQObjectList(); + imageList = new TQObjectList(); + menuList = new TQObjectList(); menuList->setAutoDelete( true ); client = kapp->dcopClient(); @@ -262,12 +262,12 @@ karamba::karamba(QString fn, QString name, bool reloading, int instance, if( !parseConfig() ) { setFixedSize(0,0); - QTimer::singleShot( 100, this, SLOT(killWidget()) ); + TQTimer::singleShot( 100, this, TQT_SLOT(killWidget()) ); qWarning("Could not read config file."); } else { - kroot = new KarambaRootPixmap((QWidget*)this); + kroot = new KarambaRootPixmap((TQWidget*)this); kroot->start(); } @@ -314,7 +314,7 @@ karamba::karamba(QString fn, QString name, bool reloading, int instance, this->setMouseTracking(true); - setFocusPolicy(QWidget::StrongFocus); + setFocusPolicy(TQWidget::StrongFocus); } karamba::~karamba() @@ -378,14 +378,14 @@ bool karamba::parseConfig() if(m_theme.open()) { - QValueStack<QPoint> offsetStack; + TQValueStack<TQPoint> offsetStack; LineParser lineParser; int x=0; int y=0; int w=0; int h=0; - offsetStack.push(QPoint(0,0)); + offsetStack.push(TQPoint(0,0)); while(m_theme.nextLine(lineParser)) { @@ -412,7 +412,7 @@ bool karamba::parseConfig() if(lineParser.getBoolean("RIGHT")) { - QDesktopWidget *d = QApplication::desktop(); + TQDesktopWidget *d = TQApplication::desktop(); x = d->width() - w; } else if(lineParser.getBoolean("LEFT")) @@ -422,7 +422,7 @@ bool karamba::parseConfig() if(lineParser.getBoolean("BOTTOM")) { - QDesktopWidget *d = QApplication::desktop(); + TQDesktopWidget *d = TQApplication::desktop(); y = d->height() - h; } else if(lineParser.getBoolean("TOP")) @@ -431,7 +431,7 @@ bool karamba::parseConfig() } move(x,y); - //pm = QPixmap(size()); + //pm = TQPixmap(size()); if(lineParser.getBoolean("ONTOP")) { @@ -480,7 +480,7 @@ bool karamba::parseConfig() if(lineParser.getBoolean("BOTTOMBAR")) { - int dh = QApplication::desktop()->height(); + int dh = TQApplication::desktop()->height(); move( x, dh - h ); KWin::setStrut( winId(), 0, 0, 0, h ); toggleLocked->setChecked( true ); @@ -490,7 +490,7 @@ bool karamba::parseConfig() if(lineParser.getBoolean("RIGHTBAR")) { - int dw = QApplication::desktop()->width(); + int dw = TQApplication::desktop()->width(); move( dw - w, y ); KWin::setStrut( winId(), 0, w, 0, 0 ); toggleLocked->setChecked( true ); @@ -507,12 +507,12 @@ bool karamba::parseConfig() toggleLocked->setEnabled(false); } - QString path = lineParser.getString("MASK"); + TQString path = lineParser.getString("MASK"); - QFileInfo info(path); - QString absPath; - QBitmap bmMask; - QByteArray ba; + TQFileInfo info(path); + TQString absPath; + TQBitmap bmMask; + TQByteArray ba; if( info.isRelative() ) { absPath.setAscii(m_theme.path().ascii()); @@ -537,25 +537,25 @@ bool karamba::parseConfig() m_interval = lineParser.getInt("INTERVAL"); m_interval = (m_interval == 0) ? 1000 : m_interval; - QString temp = lineParser.getString("TEMPUNIT", "C").upper(); + TQString temp = lineParser.getString("TEMPUNIT", "C").upper(); tempUnit = temp.ascii()[0]; foundKaramba = true; } if(lineParser.meter() == "THEME") { - QString path = lineParser.getString("PATH"); - QFileInfo info(path); + TQString path = lineParser.getString("PATH"); + TQFileInfo info(path); if( info.isRelative()) path = m_theme.path() +"/" + path; - (new karamba( path, QString() ))->show(); + (new karamba( path, TQString() ))->show(); } if(lineParser.meter() == "<GROUP>") { int offsetX = offsetStack.top().x(); int offsetY = offsetStack.top().y(); - offsetStack.push( QPoint( offsetX + lineParser.getInt("X"), + offsetStack.push( TQPoint( offsetX + lineParser.getInt("X"), offsetY + lineParser.getInt("Y"))); } @@ -585,12 +585,12 @@ bool karamba::parseConfig() if(lineParser.meter() == "IMAGE") { - QString file = lineParser.getString("PATH"); - QString file_roll = lineParser.getString("PATHROLL"); + TQString file = lineParser.getString("PATH"); + TQString file_roll = lineParser.getString("PATHROLL"); int xon = lineParser.getInt("XROLL"); int yon = lineParser.getInt("YROLL"); - QString tiptext = lineParser.getString("TOOLTIP"); - QString name = lineParser.getString("NAME"); + TQString tiptext = lineParser.getString("TOOLTIP"); + TQString name = lineParser.getString("NAME"); bool bg = lineParser.getBoolean("BACKGROUND"); xon = ( xon <= 0 ) ? x:xon; yon = ( yon <= 0 ) ? y:yon; @@ -605,7 +605,7 @@ bool karamba::parseConfig() if (!tiptext.isEmpty()) tmp->setTooltip(tiptext); - connect(tmp, SIGNAL(pixmapLoaded()), this, SLOT(externalStep())); + connect(tmp, TQT_SIGNAL(pixmapLoaded()), this, TQT_SLOT(externalStep())); setSensor(lineParser, (Meter*) tmp ); meterList->append (tmp ); imageList->append (tmp ); @@ -617,9 +617,9 @@ bool karamba::parseConfig() defaultTextField = new TextField( ); defaultTextField->setColor(lineParser.getColor("COLOR", - QColor("black"))); + TQColor("black"))); defaultTextField->setBGColor(lineParser.getColor("BGCOLOR", - QColor("white"))); + TQColor("white"))); defaultTextField->setFont(lineParser.getString("FONT", "Helvetica")); defaultTextField->setFontSize(lineParser.getInt("FONTSIZE", 12)); defaultTextField->setAlignment(lineParser.getString("ALIGN", @@ -664,7 +664,7 @@ bool karamba::parseConfig() tmp->setValue( m_theme.locale()->translate(lineParser.getString("VALUE"))); - QString name = lineParser.getString("NAME"); + TQString name = lineParser.getString("NAME"); if (!name.isEmpty()) tmp->setName(name.ascii()); @@ -698,7 +698,7 @@ bool karamba::parseConfig() tmp->setWidth(w); tmp->setHeight(h); - QString name = lineParser.getString("NAME"); + TQString name = lineParser.getString("NAME"); if (!name.isEmpty()) tmp->setName(name.ascii()); @@ -711,7 +711,7 @@ bool karamba::parseConfig() { Input *tmp = new Input(this, x, y, w, h); - QString name = lineParser.getString("NAME"); + TQString name = lineParser.getString("NAME"); if (!name.isEmpty()) tmp->setName(name.ascii()); @@ -732,7 +732,7 @@ bool karamba::parseConfig() tmp->setMax(lineParser.getInt("MAX", 100)); tmp->setMin(lineParser.getInt("MIN", 0)); tmp->setValue(lineParser.getInt("VALUE")); - QString name = lineParser.getString("NAME"); + TQString name = lineParser.getString("NAME"); if (!name.isEmpty()) tmp->setName(name.ascii()); setSensor(lineParser, (Meter*)tmp ); @@ -746,7 +746,7 @@ bool karamba::parseConfig() Graph *tmp = new Graph(this, x, y, w, h, points); tmp->setMax(lineParser.getInt("MAX", 100)); tmp->setMin(lineParser.getInt("MIN", 0)); - QString name = lineParser.getString("NAME"); + TQString name = lineParser.getString("NAME"); if (!name.isEmpty()) tmp->setName(name.ascii()); @@ -788,14 +788,14 @@ bool karamba::parseConfig() void karamba::start() { - m_sysTimer = new QTimer(this); + m_sysTimer = new TQTimer(this); - connect(m_sysTimer, SIGNAL(timeout()), SLOT(step())); + connect(m_sysTimer, TQT_SIGNAL(timeout()), TQT_SLOT(step())); m_sysTimer->start(m_interval); //Start the widget running - QTimer::singleShot( 0, this, SLOT(step()) ); + TQTimer::singleShot( 0, this, TQT_SLOT(step()) ); if( !(onTop || managed) ) lowerTimer.start(); @@ -818,7 +818,7 @@ void karamba::makePassive() if(managed) return; - QObject *meter; + TQObject *meter; for (meter = meterList->first(); meter; meter = meterList->next()) { if((meter)->isA("Input")) @@ -847,7 +847,7 @@ void karamba::reloadConfig() writeConfigData(); if(m_theme.exists()) { - QFileInfo fileInfo( m_theme.file() ); + TQFileInfo fileInfo( m_theme.file() ); (new karamba(m_theme.file(), fileInfo.baseName(), true, m_instance))->show(); } closeTheme(true); @@ -872,8 +872,8 @@ void karamba::initPythonInterface() void karamba::editConfig() { //qDebug("karamba::editConfig"); - QFileInfo fileInfo( m_theme.file() ); - QString path; + TQFileInfo fileInfo( m_theme.file() ); + TQString path; if( fileInfo.isRelative() ) { @@ -890,8 +890,8 @@ void karamba::editConfig() void karamba::editScript() { //qDebug("karamba::editScript"); - QFileInfo fileInfo( m_theme.file() ); - QString path; + TQFileInfo fileInfo( m_theme.file() ); + TQString path; if( fileInfo.isRelative() ) { @@ -899,16 +899,16 @@ void karamba::editScript() } else { - path = QFileInfo(m_theme.file()).dirPath() + "/" + m_theme.name() + ".py"; + path = TQFileInfo(m_theme.file()).dirPath() + "/" + m_theme.name() + ".py"; } KRun::runURL( KURL( path ), "text/plain" ); } -QString karamba::findSensorFromMap(Sensor* sensor) +TQString karamba::findSensorFromMap(Sensor* sensor) { //qDebug("karamba::findSensorFromMap"); - QMap<QString,Sensor*>::ConstIterator it; - QMap<QString,Sensor*>::ConstIterator end( sensorMap.end() ); + TQMap<TQString,Sensor*>::ConstIterator it; + TQMap<TQString,Sensor*>::ConstIterator end( sensorMap.end() ); for ( it = sensorMap.begin(); it != end; ++it ) { if (it.data() == sensor) @@ -920,7 +920,7 @@ QString karamba::findSensorFromMap(Sensor* sensor) Sensor* karamba::findSensorFromList(Meter* meter) { //qDebug("karamba::findSensorFromList"); - QObjectListIt it( *sensorList ); // iterate over meters + TQObjectListIt it( *sensorList ); // iterate over meters while ( it != 0 ) { @@ -931,10 +931,10 @@ Sensor* karamba::findSensorFromList(Meter* meter) return NULL; } -QString karamba::getSensor(Meter* meter) +TQString karamba::getSensor(Meter* meter) { //qDebug("karamba::getSensor"); - QString s; + TQString s; Sensor* sensor = findSensorFromList(meter); if (sensor) s = findSensorFromMap(sensor); @@ -951,7 +951,7 @@ void karamba::deleteMeterFromSensors(Meter* meter) sensor->deleteMeter(meter); if (sensor->isEmpty()) { - QString s = findSensorFromMap(sensor); + TQString s = findSensorFromMap(sensor); sensorMap.erase(s); sensorList->removeRef(sensor); } @@ -965,11 +965,11 @@ void karamba::setSensor(const LineParser& lineParser, Meter* meter) deleteMeterFromSensors(meter); - QString sens = lineParser.getString("SENSOR").upper(); + TQString sens = lineParser.getString("SENSOR").upper(); if( sens == "CPU" ) { - QString cpuNbr = lineParser.getString("CPU"); + TQString cpuNbr = lineParser.getString("CPU"); sensor = sensorMap["CPU"+cpuNbr]; if (sensor == 0) { @@ -1015,12 +1015,12 @@ void karamba::setSensor(const LineParser& lineParser, Meter* meter) int interval = lineParser.getInt("INTERVAL"); interval = (interval == 0)?5000:interval; sensor = ( sensorMap["DISK"] = new DiskSensor( interval ) ); - connect( sensor, SIGNAL(initComplete()), this, SLOT(externalStep()) ); + connect( sensor, TQT_SIGNAL(initComplete()), this, TQT_SLOT(externalStep()) ); sensorList->append( sensor ); } // meter->setMax( ((DiskSensor*)sensor)->getTotalSpace(mntPt)/1024 ); SensorParams *sp = new SensorParams(meter); - QString mntPt = lineParser.getString("MOUNTPOINT"); + TQString mntPt = lineParser.getString("MOUNTPOINT"); if( mntPt.isEmpty() ) { mntPt = "/"; @@ -1042,7 +1042,7 @@ void karamba::setSensor(const LineParser& lineParser, Meter* meter) { int interval = lineParser.getInt("INTERVAL"); interval = (interval == 0)?2000:interval; - QString device = lineParser.getString("DEVICE"); + TQString device = lineParser.getString("DEVICE"); sensor = sensorMap["NETWORK"+device]; if (sensor == 0) { @@ -1094,21 +1094,21 @@ void karamba::setSensor(const LineParser& lineParser, Meter* meter) if( sens == "TEXTFILE" ) { - QString path = lineParser.getString("PATH"); + TQString path = lineParser.getString("PATH"); bool rdf = lineParser.getBoolean("RDF"); sensor = sensorMap["TEXTFILE"+path]; if (sensor == 0) { int interval = lineParser.getInt("INTERVAL"); interval = ( interval == 0 )?60000:interval; - QString encoding = lineParser.getString("ENCODING"); + TQString encoding = lineParser.getString("ENCODING"); sensor = ( sensorMap["TEXTFILE"+path] = new TextFileSensor( path, rdf, interval, encoding ) ); sensorList->append( sensor ); } SensorParams *sp = new SensorParams(meter); - sp->addParam("LINE",QString::number(lineParser.getInt("LINE"))); + sp->addParam("LINE",TQString::number(lineParser.getInt("LINE"))); sensor->addMeter(sp); } @@ -1141,7 +1141,7 @@ void karamba::setSensor(const LineParser& lineParser, Meter* meter) { int interval = lineParser.getInt("INTERVAL"); interval = (interval == 0)?1000:interval; - QString encoding = lineParser.getString("ENCODING"); + TQString encoding = lineParser.getString("ENCODING"); sensor = ( sensorMap["XMMS"] = new XMMSSensor( interval, encoding ) ); sensorList->append( sensor ); @@ -1174,28 +1174,28 @@ void karamba::setSensor(const LineParser& lineParser, Meter* meter) if( sens == "PROGRAM") { - QString progName = lineParser.getString("PROGRAM"); + TQString progName = lineParser.getString("PROGRAM"); sensor = sensorMap["PROGRAM"+progName]; if (sensor == 0) { int interval = lineParser.getInt("INTERVAL"); interval = (interval == 0)?3600000:interval; - QString encoding = lineParser.getString("ENCODING"); + TQString encoding = lineParser.getString("ENCODING"); sensor = (sensorMap["PROGRAM"+progName] = new ProgramSensor( progName, interval, encoding ) ); sensorList->append( sensor ); } SensorParams *sp = new SensorParams(meter); - sp->addParam( "LINE", QString::number(lineParser.getInt("LINE"))); + sp->addParam( "LINE", TQString::number(lineParser.getInt("LINE"))); sp->addParam( "THEMAPATH", m_theme.path() ); sensor->addMeter(sp); } if( sens == "RSS" ) { - QString source = lineParser.getString("SOURCE"); - QString format = + TQString source = lineParser.getString("SOURCE"); + TQString format = m_theme.locale()->translate(lineParser.getString("FORMAT").ascii()); sensor = sensorMap["RSS"+source]; @@ -1203,7 +1203,7 @@ void karamba::setSensor(const LineParser& lineParser, Meter* meter) { int interval = lineParser.getInt( "INTERVAL"); interval = ( interval == 0 )?60000:interval; - QString encoding = lineParser.getString("ENCODING"); + TQString encoding = lineParser.getString("ENCODING"); sensor = ( sensorMap["RSS"+source] = new RssSensor( source, interval, format, encoding ) ); @@ -1216,39 +1216,39 @@ void karamba::setSensor(const LineParser& lineParser, Meter* meter) if (sensor != 0) { - QTimer::singleShot( 0, sensor, SLOT(update()) ); + TQTimer::singleShot( 0, sensor, TQT_SLOT(update()) ); sensor->start(); } } -void karamba::slotFileChanged( const QString & file) +void karamba::slotFileChanged( const TQString & file) { //kdDebug() << "fileChanged: " << file << endl; - QString pythonFile = m_theme.path() + "/" + m_theme.pythonModule() + ".py"; + TQString pythonFile = m_theme.path() + "/" + m_theme.pythonModule() + ".py"; if(file == m_theme.file() || file == pythonFile) reloadConfig(); } -void karamba::passMenuOptionChanged(QString key, bool value) +void karamba::passMenuOptionChanged(TQString key, bool value) { //Everything below is to call the python callback function if (pythonIface && pythonIface->isExtensionLoaded()) pythonIface->menuOptionChanged(this, key, value); } -void karamba::setIncomingData(QString theme, QString obj) +void karamba::setIncomingData(TQString theme, TQString obj) { KarambaApplication* app = (KarambaApplication*)qApp; kdDebug() << "karamba::setIncomingData " << theme << obj << endl; - //QByteArray data; - //QDataStream dataStream( data, IO_WriteOnly ); + //TQByteArray data; + //TQDataStream dataStream( data, IO_WriteOnly ); //dataStream << theme; //dataStream << txt; - //kapp->dcopClient()->send( app->dcopClient()->appId(), "KarambaIface", "themeNotify(QString,QString)", data ); + //kapp->dcopClient()->send( app->dcopClient()->appId(), "KarambaIface", "themeNotify(TQString,TQString)", data ); DCOPClient *c = kapp->dcopClient(); if (!c->isAttached()) @@ -1258,17 +1258,17 @@ void karamba::setIncomingData(QString theme, QString obj) app->dcopStub()->setIncomingData(theme, obj); } -void karamba::callTheme(QString theme, QString txt) +void karamba::callTheme(TQString theme, TQString txt) { KarambaApplication* app = (KarambaApplication*)qApp; kdDebug() << "karamba::callTheme " << theme << txt << endl; //qWarning("karamba::callTheme"); - //QByteArray data; - //QDataStream dataStream( data, IO_WriteOnly ); + //TQByteArray data; + //TQDataStream dataStream( data, IO_WriteOnly ); //dataStream << theme; //dataStream << txt; - //kapp->dcopClient()->send( app->dcopClient()->appId(), "KarambaIface", "themeNotify(QString,QString)", data ); + //kapp->dcopClient()->send( app->dcopClient()->appId(), "KarambaIface", "themeNotify(TQString,TQString)", data ); DCOPClient *c = kapp->dcopClient(); if (!c->isAttached()) @@ -1278,7 +1278,7 @@ void karamba::callTheme(QString theme, QString txt) app->dcopStub()->themeNotify(theme, txt); } -void karamba::themeNotify(QString theme, QString txt) +void karamba::themeNotify(TQString theme, TQString txt) { kdDebug() << "karamba::themeNotify" << theme << txt << endl; if (pythonIface->isExtensionLoaded()) @@ -1287,7 +1287,7 @@ void karamba::themeNotify(QString theme, QString txt) } } -void karamba::meterClicked(QMouseEvent* e, Meter* meter) +void karamba::meterClicked(TQMouseEvent* e, Meter* meter) { //qWarning("karamba::meterClicked"); if (pythonIface && pythonIface->isExtensionLoaded() && haveUpdated) @@ -1319,10 +1319,10 @@ void karamba::changeInterval(int interval) m_sysTimer->changeInterval(interval); } -void karamba::passClick(QMouseEvent *e) +void karamba::passClick(TQMouseEvent *e) { //qDebug("karamba::passClick"); - QObjectListIt it2( *timeList ); // iterate over meters + TQObjectListIt it2( *timeList ); // iterate over meters while ( it2 != 0 ) { (( DateSensor* ) *it2)->toggleCalendar( e ); @@ -1332,8 +1332,8 @@ void karamba::passClick(QMouseEvent *e) // We create a temporary click list here because original // can change during the loop (infinite loop Bug 994359) - QObjectList clickListTmp(*clickList); - QObjectListIt it(clickListTmp); + TQObjectList clickListTmp(*clickList); + TQObjectListIt it(clickListTmp); while (it != 0) { Meter* meter = (Meter*)(*it); @@ -1362,7 +1362,7 @@ void karamba::passClick(QMouseEvent *e) } } -void karamba::passWheelClick( QWheelEvent *e ) +void karamba::passWheelClick( TQWheelEvent *e ) { //qDebug("karamba::passWheelClick"); //Everything below is to call the python callback function @@ -1379,10 +1379,10 @@ void karamba::passWheelClick( QWheelEvent *e ) // can change during the loop (infinite loop Bug 994359) if (want_meter_wheel_event) { - QObjectList clickListTmp(*clickList); - QObjectListIt it(clickListTmp); + TQObjectList clickListTmp(*clickList); + TQObjectListIt it(clickListTmp); - QMouseEvent fakeEvent(QEvent::MouseButtonPress, e->pos(), e->globalPos(), button, e->state()); + TQMouseEvent fakeEvent(TQEvent::MouseButtonPress, e->pos(), e->globalPos(), button, e->state()); while (it != 0) { @@ -1410,10 +1410,10 @@ void karamba::passWheelClick( QWheelEvent *e ) void karamba::management_popup( void ) { - kpop->popup(QCursor::pos()); + kpop->popup(TQCursor::pos()); } -void karamba::mousePressEvent( QMouseEvent *e ) +void karamba::mousePressEvent( TQMouseEvent *e ) { //qDebug("karamba::mousePressEvent"); if( e->button() == RightButton && !want_right_button ) @@ -1430,19 +1430,19 @@ void karamba::mousePressEvent( QMouseEvent *e ) } } -void karamba::wheelEvent( QWheelEvent *e ) +void karamba::wheelEvent( TQWheelEvent *e ) { //qDebug("karamba::wheelEvent"); passWheelClick( e ); } -void karamba::mouseReleaseEvent( QMouseEvent *e ) +void karamba::mouseReleaseEvent( TQMouseEvent *e ) { //qDebug("karamba::mouseReleaseEvent"); clickPos = e->pos(); } -void karamba::mouseDoubleClickEvent( QMouseEvent *e ) +void karamba::mouseDoubleClickEvent( TQMouseEvent *e ) { //qDebug("karamba::mouseDoubleClickEvent"); if( !toggleLocked -> isChecked() ) @@ -1451,19 +1451,19 @@ void karamba::mouseDoubleClickEvent( QMouseEvent *e ) } } -void karamba::keyPressEvent(QKeyEvent *e) +void karamba::keyPressEvent(TQKeyEvent *e) { //qDebug("karamba::keyPressEvent"); keyPressed(e->text(), 0); } -void karamba::keyPressed(const QString& s, const Meter* meter) +void karamba::keyPressed(const TQString& s, const Meter* meter) { if (pythonIface && pythonIface->isExtensionLoaded()) pythonIface->keyPressed(this, meter, s); } -void karamba::mouseMoveEvent( QMouseEvent *e ) +void karamba::mouseMoveEvent( TQMouseEvent *e ) { //qDebug("karamba::mouseMoveEvent"); if( e->state() != 0 && e->state() < 16 && !toggleLocked -> isChecked() ) @@ -1473,7 +1473,7 @@ void karamba::mouseMoveEvent( QMouseEvent *e ) else { // Change cursor over ClickArea - QObjectListIt it(*clickList); + TQObjectListIt it(*clickList); bool insideArea = false; while (it != 0) @@ -1497,7 +1497,7 @@ void karamba::mouseMoveEvent( QMouseEvent *e ) setCursor( ArrowCursor ); } - QObjectListIt image_it( *imageList); // iterate over image sensors + TQObjectListIt image_it( *imageList); // iterate over image sensors while ( image_it != 0 ) { ((ImageLabel*) *image_it)->rolloverImage(e); @@ -1526,7 +1526,7 @@ void karamba::mouseMoveEvent( QMouseEvent *e ) } } -void karamba::closeEvent ( QCloseEvent * qc) +void karamba::closeEvent ( TQCloseEvent * qc) { //qDebug("karamba::closeEvent"); qc->accept(); @@ -1534,7 +1534,7 @@ void karamba::closeEvent ( QCloseEvent * qc) // delete this; } -void karamba::paintEvent ( QPaintEvent *e) +void karamba::paintEvent ( TQPaintEvent *e) { //kdDebug() << k_funcinfo << pm.size() << endl; if(pm.width() == 0) @@ -1547,20 +1547,20 @@ void karamba::paintEvent ( QPaintEvent *e) lowerTimer.restart(); } } - QRect rect = e->rect(); + TQRect rect = e->rect(); bitBlt(this,rect.topLeft(),&pm,rect,Qt::CopyROP); } void karamba::updateSensors() { //qDebug("karamba::updateSensors"); - QObjectListIt it( *sensorList ); // iterate over meters + TQObjectListIt it( *sensorList ); // iterate over meters while ( it != 0 ) { ((Sensor*) *it)->update(); ++it; } - QTimer::singleShot( 500, this, SLOT(step()) ); + TQTimer::singleShot( 500, this, TQT_SLOT(step()) ); } void karamba::updateBackground(KSharedPixmap* kpm) @@ -1574,14 +1574,14 @@ void karamba::updateBackground(KSharedPixmap* kpm) themeStarted = true; start(); } - background = QPixmap(*kpm); + background = TQPixmap(*kpm); - QPixmap buffer = QPixmap(size()); + TQPixmap buffer = TQPixmap(size()); - pm = QPixmap(size()); + pm = TQPixmap(size()); buffer.fill(Qt::black); - QObjectListIt it( *imageList ); // iterate over meters + TQObjectListIt it( *imageList ); // iterate over meters p.begin(&buffer); bitBlt(&buffer,0,0,&background,0,Qt::CopyROP); @@ -1598,12 +1598,12 @@ void karamba::updateBackground(KSharedPixmap* kpm) bitBlt(&pm,0,0,&buffer,0,Qt::CopyROP); background = pm; - QPixmap buffer2 = QPixmap(size()); + TQPixmap buffer2 = TQPixmap(size()); - pm = QPixmap(size()); + pm = TQPixmap(size()); buffer2.fill(Qt::black); - QObjectListIt it2( *meterList ); // iterate over meters + TQObjectListIt it2( *meterList ); // iterate over meters p.begin(&buffer2); bitBlt(&buffer2,0,0,&background,0,Qt::CopyROP); @@ -1643,12 +1643,12 @@ void karamba::externalStep() //kdDebug() << k_funcinfo << pm.size() << endl; if (widgetUpdate) { - QPixmap buffer = QPixmap(size()); + TQPixmap buffer = TQPixmap(size()); - pm = QPixmap(size()); + pm = TQPixmap(size()); buffer.fill(Qt::black); - QObjectListIt it( *meterList ); // iterate over meters + TQObjectListIt it( *meterList ); // iterate over meters p.begin(&buffer); bitBlt(&buffer,0,0,&background,0,Qt::CopyROP); @@ -1669,11 +1669,11 @@ void karamba::step() //kdDebug() << k_funcinfo << pm.size() << endl; if (widgetUpdate && haveUpdated) { - pm = QPixmap(size()); - QPixmap buffer = QPixmap(size()); + pm = TQPixmap(size()); + TQPixmap buffer = TQPixmap(size()); buffer.fill(Qt::black); - QObjectListIt it( *meterList ); // iterate over meters + TQObjectListIt it( *meterList ); // iterate over meters p.begin(&buffer); bitBlt(&buffer,0,0,&background,0,Qt::CopyROP); @@ -1731,7 +1731,7 @@ void karamba::slotToggleFastTransforms() // } // else // { - // QPixmap ok_disabled; + // TQPixmap ok_disabled; // toggleFastTransforms -> setIconSet(ok_disabled); // } //config.setGroup("internal"); @@ -1766,7 +1766,7 @@ void karamba::writeConfigData() // m_theme.name().ascii()); } -void karamba::slotToggleConfigOption(QString key, bool value) +void karamba::slotToggleConfigOption(TQString key, bool value) { //qDebug("karamba::slotToggleConfigOption"); config -> setGroup("config menu"); @@ -1774,21 +1774,21 @@ void karamba::slotToggleConfigOption(QString key, bool value) passMenuOptionChanged(key, value); } -void karamba::addMenuConfigOption(QString key, QString name) +void karamba::addMenuConfigOption(TQString key, TQString name) { //qDebug("karamba::addMenuConfigOption"); kpop -> setItemEnabled(THEMECONF, true); SignalBridge* action = new SignalBridge(this, key, menuAccColl); KToggleAction* confItem = new KToggleAction (name, KShortcut::null(), - action, SLOT(receive()), + action, TQT_SLOT(receive()), menuAccColl, key.ascii()); confItem -> setName(key.ascii()); menuAccColl -> insert(confItem); - connect(action, SIGNAL( enabled(QString, bool) ), - this, SLOT( slotToggleConfigOption(QString, bool) )); + connect(action, TQT_SIGNAL( enabled(TQString, bool) ), + this, TQT_SLOT( slotToggleConfigOption(TQString, bool) )); config -> setGroup("config menu"); confItem -> setChecked(config -> readBoolEntry(key)); @@ -1798,7 +1798,7 @@ void karamba::addMenuConfigOption(QString key, QString name) numberOfConfMenuItems++; } -bool karamba::setMenuConfigOption(QString key, bool value) +bool karamba::setMenuConfigOption(TQString key, bool value) { //qDebug("karamba::setMenuConfigOption"); KToggleAction* menuAction = ((KToggleAction*)menuAccColl -> action(key.ascii())); @@ -1814,7 +1814,7 @@ bool karamba::setMenuConfigOption(QString key, bool value) } } -bool karamba::readMenuConfigOption(QString key) +bool karamba::readMenuConfigOption(TQString key) { //qDebug("karamba::readMenuConfigOption"); KToggleAction* menuAction = ((KToggleAction*)menuAccColl -> action(key.ascii())); @@ -1929,28 +1929,28 @@ void karamba::readProperties(KConfig* config) { //qDebug("karamba::readProperties"); config->setGroup("session"); - QString atheme = config->readEntry("theme"); + TQString atheme = config->readEntry("theme"); } //Register types of events that can be dragged on our widget -void karamba::dragEnterEvent(QDragEnterEvent* event) +void karamba::dragEnterEvent(TQDragEnterEvent* event) { //qDebug("karamba::dragEnterEvent"); - event->accept(QTextDrag::canDecode(event)); + event->accept(TQTextDrag::canDecode(event)); } //Handle the drop part of a drag and drop event. -void karamba::dropEvent(QDropEvent* event) +void karamba::dropEvent(TQDropEvent* event) { //qDebug("karamba::dropEvent"); - QString text; + TQString text; - if ( QTextDrag::decode(event, text) ) + if ( TQTextDrag::decode(event, text) ) { //Everything below is to call the python callback function if (pythonIface && pythonIface->isExtensionLoaded()) { - const QPoint &p = event->pos(); + const TQPoint &p = event->pos(); pythonIface->itemDropped(this, text, p.x(), p.y()); } } @@ -1992,8 +1992,8 @@ void karamba::toggleWidgetUpdate( bool b) widgetUpdate = b; } -SignalBridge::SignalBridge(QObject* parent, QString name, KActionCollection* ac) - : QObject(parent, name.ascii()), collection(ac) +SignalBridge::SignalBridge(TQObject* parent, TQString name, KActionCollection* ac) + : TQObject(parent, name.ascii()), collection(ac) { setName(name.ascii()); } @@ -2004,8 +2004,8 @@ void SignalBridge::receive() isChecked()); } -DesktopChangeSlot::DesktopChangeSlot(QObject *parent, int id) - : QObject(parent, "") +DesktopChangeSlot::DesktopChangeSlot(TQObject *parent, int id) + : TQObject(parent, "") { desktopid = id; } @@ -2035,16 +2035,16 @@ void karamba::showMenuExtension() trayMenuToggleId = kglobal->insertItem(SmallIconSet("superkaramba"), i18n("Show System Tray Icon"), this, - SLOT(slotToggleSystemTray()), + TQT_SLOT(slotToggleSystemTray()), CTRL+Key_S); trayMenuThemeId = kglobal->insertItem(SmallIconSet("knewstuff"), i18n("&Manage Themes..."), this, - SLOT(slotShowTheme()), CTRL+Key_M); + TQT_SLOT(slotShowTheme()), CTRL+Key_M); trayMenuQuitId = kglobal->insertItem(SmallIconSet("exit"), i18n("&Quit SuperKaramba"), this, - SLOT(slotQuit()), CTRL+Key_Q); + TQT_SLOT(slotQuit()), CTRL+Key_Q); kglobal->polish(); diff --git a/superkaramba/src/karamba.h b/superkaramba/src/karamba.h index a81b11b..d3e6e4a 100644 --- a/superkaramba/src/karamba.h +++ b/superkaramba/src/karamba.h @@ -28,43 +28,43 @@ #include <config.h> #endif -#include <qwidget.h> +#include <tqwidget.h> #include <kapplication.h> #include <kwinmodule.h> #include <kwin.h> -#include <qfile.h> +#include <tqfile.h> #include <kfile.h> -#include <qfileinfo.h> +#include <tqfileinfo.h> #include <kaction.h> -#include <qtimer.h> -#include <qpixmap.h> -#include <qpainter.h> +#include <tqtimer.h> +#include <tqpixmap.h> +#include <tqpainter.h> //#include <krootpixmap.h> -#include <qregexp.h> -#include <qlabel.h> -#include <qobjectlist.h> -#include <qstring.h> -#include <qstringlist.h> +#include <tqregexp.h> +#include <tqlabel.h> +#include <tqobjectlist.h> +#include <tqstring.h> +#include <tqstringlist.h> #include <ksharedpixmap.h> -#include <qvaluestack.h> +#include <tqvaluestack.h> #include <dcopclient.h> #include <kpopupmenu.h> -#include <qcursor.h> +#include <tqcursor.h> #include <netwm.h> #include <kiconloader.h> #include <kfiledialog.h> -#include <qmap.h> +#include <tqmap.h> #include <kurl.h> #include <krun.h> -#include <qdatetime.h> -#include <qbitmap.h> +#include <tqdatetime.h> +#include <tqbitmap.h> #include <kconfig.h> #include <kprocess.h> -#include <qdragobject.h> +#include <tqdragobject.h> #include "karambarootpixmap.h" @@ -114,24 +114,24 @@ class karamba : public QWidget Q_OBJECT public: - karamba(QString fn, QString name, bool reloading = false, + karamba(TQString fn, TQString name, bool reloading = false, int instance = -1, bool sub_theme = false); - QObjectList *menuList; + TQObjectList *menuList; virtual ~karamba(); const ThemeFile& theme() const { return m_theme; }; - QObjectList *meterList; - QObjectList *imageList; - QObjectList *clickList; + TQObjectList *meterList; + TQObjectList *imageList; + TQObjectList *clickList; void setSensor(const LineParser& lineParser, Meter* meter); - QString getSensor(Meter* meter); - QString findSensorFromMap(Sensor* sensor); + TQString getSensor(Meter* meter); + TQString findSensorFromMap(Sensor* sensor); void deleteMeterFromSensors(Meter* meter); Sensor* findSensorFromList(Meter* meter); KPopupMenu* keditpop; KPopupMenu *kpop; - QBitmap* widgetMask; + TQBitmap* widgetMask; KarambaRootPixmap *kroot; TaskManager taskManager; Systemtray* systray; @@ -143,19 +143,19 @@ public: bool getWidgetUpdate() { return widgetUpdate; }; bool hasMeter(Meter* meter) { return meterList->containsRef(meter) > 0; }; char getTempUnit() { return tempUnit; }; - void addMenuConfigOption(QString key, QString name); - bool setMenuConfigOption(QString key, bool value); - bool readMenuConfigOption(QString key); + void addMenuConfigOption(TQString key, TQString name); + bool setMenuConfigOption(TQString key, bool value); + bool readMenuConfigOption(TQString key); void writeConfigData(); TextField* getDefaultTextProps() { return defaultTextField; }; int instance() const { return m_instance; }; void setInstance(int instance) { m_instance = instance; }; void closeTheme(bool reloading = false); - void keyPressed(const QString& s, const Meter* meter); + void keyPressed(const TQString& s, const Meter* meter); int numberOfConfMenuItems; KConfig* config; - QString prettyName; + TQString prettyName; bool m_sub_theme; bool isSubTheme() { return m_sub_theme; } @@ -163,13 +163,13 @@ public: KWinModule* kWinModule; - QString incomingData; - QString getIncomingData() { return incomingData; } - void _setIncomingData(QString data) { incomingData = data; } - void setIncomingData(QString theme, QString data); + TQString incomingData; + TQString getIncomingData() { return incomingData; } + void _setIncomingData(TQString data) { incomingData = data; } + void setIncomingData(TQString theme, TQString data); - void themeNotify(QString theme, QString txt); - void callTheme(QString theme, QString txt); + void themeNotify(TQString theme, TQString txt); + void callTheme(TQString theme, TQString txt); double getUpdateTime() { return update_time; } void setUpdateTime(double time) { update_time = time; } @@ -181,18 +181,18 @@ public: void hideMenuExtension(); protected: - void mousePressEvent( QMouseEvent *); - void wheelEvent( QWheelEvent *); - void mouseReleaseEvent( QMouseEvent *); - void mouseDoubleClickEvent( QMouseEvent *); - void mouseMoveEvent( QMouseEvent *); - void keyPressEvent ( QKeyEvent * e ); - void closeEvent ( QCloseEvent *); - void paintEvent ( QPaintEvent *); + void mousePressEvent( TQMouseEvent *); + void wheelEvent( TQWheelEvent *); + void mouseReleaseEvent( TQMouseEvent *); + void mouseDoubleClickEvent( TQMouseEvent *); + void mouseMoveEvent( TQMouseEvent *); + void keyPressEvent ( TQKeyEvent * e ); + void closeEvent ( TQCloseEvent *); + void paintEvent ( TQPaintEvent *); void saveProperties(KConfig *); void readProperties(KConfig *); - void dragEnterEvent(QDragEnterEvent* event); - void dropEvent(QDropEvent* event); + void dragEnterEvent(TQDragEnterEvent* event); + void dropEvent(TQDropEvent* event); private: bool widgetUpdate; @@ -212,15 +212,15 @@ private: bool parseConfig(); - void passClick( QMouseEvent* ); - void passWheelClick( QWheelEvent* ); - void meterClicked(QMouseEvent*, Meter*); + void passClick( TQMouseEvent* ); + void passWheelClick( TQWheelEvent* ); + void meterClicked(TQMouseEvent*, Meter*); - QMap<QString, Sensor*> sensorMap; - QObjectList *sensorList; - QObjectList *timeList; + TQMap<TQString, Sensor*> sensorMap; + TQObjectList *sensorList; + TQObjectList *timeList; - QTime lowerTimer; + TQTime lowerTimer; // use only the first occurance of KARAMBA in a config file bool foundKaramba; @@ -229,13 +229,13 @@ private: KPopupMenu* kglobal; DCOPClient *client; - QCString appId; + TQCString appId; - QPixmap pm; - QPixmap background; - QPainter p; + TQPixmap pm; + TQPixmap background; + TQPainter p; - QPoint clickPos; + TQPoint clickPos; KActionCollection* accColl; KActionCollection* menuAccColl; KToggleAction *toggleLocked; @@ -262,9 +262,9 @@ public slots: void updateSensors(); void currentDesktopChanged(int); void currentWallpaperChanged(int); - void slotToggleConfigOption(QString key, bool); + void slotToggleConfigOption(TQString key, bool); void updateBackground(KSharedPixmap*); - void passMenuOptionChanged(QString key, bool); + void passMenuOptionChanged(TQString key, bool); void passMenuItemClicked(int); void processExited (KProcess *proc); void receivedStdout (KProcess *proc, char *buffer, int buflen); @@ -301,7 +301,7 @@ public slots: private: bool m_reloading; bool themeStarted; - QTimer *m_sysTimer; + TQTimer *m_sysTimer; int m_interval; private slots: @@ -312,7 +312,7 @@ private slots: void slotToggleLocked(); void slotToggleFastTransforms(); void popupNotify(int); - void slotFileChanged( const QString & ); + void slotFileChanged( const TQString & ); void slotToggleSystemTray(); void slotQuit(); @@ -328,7 +328,7 @@ class DesktopChangeSlot : public QObject Q_OBJECT public: - DesktopChangeSlot(QObject *parent, int desktop_id); + DesktopChangeSlot(TQObject *parent, int desktop_id); /* Parent should be the karamba object * desktop id of 0 indicates all desktops */ void setMenuId(int id); @@ -348,10 +348,10 @@ class SignalBridge : public QObject Q_OBJECT public: - SignalBridge(QObject* parent, QString, KActionCollection*); + SignalBridge(TQObject* parent, TQString, KActionCollection*); signals: - void enabled(QString, bool); + void enabled(TQString, bool); public slots: void receive(); diff --git a/superkaramba/src/karamba_python.cpp b/superkaramba/src/karamba_python.cpp index ab0034a..746c890 100644 --- a/superkaramba/src/karamba_python.cpp +++ b/superkaramba/src/karamba_python.cpp @@ -514,7 +514,7 @@ bool KarambaPython::widgetClosed(karamba* k) return callObject("widgetClosed", pArgs); } -bool KarambaPython::menuOptionChanged(karamba* k, QString key, bool value) +bool KarambaPython::menuOptionChanged(karamba* k, TQString key, bool value) { PyObject* pArgs = Py_BuildValue((char*)"(lsi)", k, key.ascii(), (int)value); return callObject("menuOptionChanged", pArgs); @@ -532,7 +532,7 @@ bool KarambaPython::meterClicked(karamba* k, Meter* meter, int button) return callObject("meterClicked", pArgs); } -bool KarambaPython::meterClicked(karamba* k, QString anchor, int button) +bool KarambaPython::meterClicked(karamba* k, TQString anchor, int button) { PyObject* pArgs = Py_BuildValue((char*)"(lsi)", k, anchor.ascii(), button); return callObject("meterClicked", pArgs); @@ -545,7 +545,7 @@ bool KarambaPython::widgetClicked(karamba* k, int x, int y, int button) } bool KarambaPython::keyPressed(karamba* k, const Meter* meter, - const QString& text) + const TQString& text) { PyObject* pArgs = Py_BuildValue((char*)"(lls)", k, meter, text.ucs2()); return callObject("keyPressed", pArgs); @@ -599,7 +599,7 @@ bool KarambaPython::commandFinished(karamba* k, int pid) return callObject("commandFinished", pArgs); } -bool KarambaPython::itemDropped(karamba* k, QString text, int x, int y) +bool KarambaPython::itemDropped(karamba* k, TQString text, int x, int y) { PyObject* pArgs = Py_BuildValue((char*)"(lOii)", k, QString2PyString(text), x, y); return callObject("itemDropped", pArgs); diff --git a/superkaramba/src/karamba_python.h b/superkaramba/src/karamba_python.h index 5f2032e..c494353 100644 --- a/superkaramba/src/karamba_python.h +++ b/superkaramba/src/karamba_python.h @@ -61,11 +61,11 @@ public: bool initWidget(karamba* k); bool widgetUpdated(karamba* k); bool widgetClosed(karamba* k); - bool menuOptionChanged(karamba* k, QString key, bool value); + bool menuOptionChanged(karamba* k, TQString key, bool value); bool meterClicked(karamba* k, Meter* meter, int button); - bool meterClicked(karamba* k, QString anchor, int button); + bool meterClicked(karamba* k, TQString anchor, int button); bool widgetClicked(karamba* k, int x, int y, int button); - bool keyPressed(karamba* k, const Meter* meter, const QString& text); + bool keyPressed(karamba* k, const Meter* meter, const TQString& text); bool widgetMouseMoved(karamba* k, int x, int y, int button); bool menuItemClicked(karamba* k, KPopupMenu* menu, long id); bool activeTaskChanged(karamba* k, Task* t); @@ -75,7 +75,7 @@ public: bool startupRemoved(karamba* k, Startup* t); bool commandOutput(karamba* k, int pid, char *buffer); bool commandFinished(karamba* k, int pid); - bool itemDropped(karamba* k, QString text, int x, int y); + bool itemDropped(karamba* k, TQString text, int x, int y); bool themeNotify(karamba* k, const char *from, const char *txt); bool systrayUpdated(karamba* k); bool desktopChanged(karamba* k, int desktop); diff --git a/superkaramba/src/karambaapp.cpp b/superkaramba/src/karambaapp.cpp index 5357b01..141b2e9 100644 --- a/superkaramba/src/karambaapp.cpp +++ b/superkaramba/src/karambaapp.cpp @@ -8,9 +8,9 @@ * (at your option) any later version. * ***************************************************************************/ -#include <qstring.h> -#include <qstringlist.h> -#include <qdir.h> +#include <tqstring.h> +#include <tqstringlist.h> +#include <tqdir.h> #include <kfiledialog.h> #include <kcmdlineargs.h> #include <fcntl.h> @@ -19,7 +19,7 @@ #include <kdebug.h> #include <khelpmenu.h> -#include <qtooltip.h> +#include <tqtooltip.h> #include "themesdlg.h" #include "karambainterface.h" @@ -27,7 +27,7 @@ #include "dcopinterface_stub.h" #include "karamba.h" #include "superkarambasettings.h" -#include "qwidgetlist.h" +#include "tqwidgetlist.h" int KarambaApplication::fd = -1; @@ -36,7 +36,7 @@ KarambaApplication::KarambaApplication() : karambaList(0), sysTrayIcon(0) { iface = new KarambaIface(); - karambaList = new QObjectList(); + karambaList = new TQObjectList(); // register ourselves as a dcop client dcopClient()->registerAs(name()); dcopClient()->setDefaultObject(dcopIface()->objId()); @@ -51,17 +51,17 @@ KarambaApplication::~KarambaApplication() //delete m_helpMenu; } -void KarambaApplication::initDcopStub(QCString app) +void KarambaApplication::initDcopStub(TQCString app) { if(app.isEmpty()) app = dcopClient()->appId(); dcopIfaceStub = new dcopIface_stub(app, iface->objId()); } -QString KarambaApplication::getMainKaramba() +TQString KarambaApplication::getMainKaramba() { - QStringList karambas = getKarambas(); - QStringList::Iterator it; + TQStringList karambas = getKarambas(); + TQStringList::Iterator it; for (it = karambas.begin(); it != karambas.end(); ++it) { @@ -71,18 +71,18 @@ QString KarambaApplication::getMainKaramba() if (dcop.isMainKaramba()) return *it; } - return QString::null; + return TQString::null; } -bool KarambaApplication::themeExists(QString pretty_name) +bool KarambaApplication::themeExists(TQString pretty_name) { - QWidgetList *list = QApplication::allWidgets(); - QWidgetListIt it( *list ); // iterate over the widgets - QWidget * w; + TQWidgetList *list = TQApplication::allWidgets(); + TQWidgetListIt it( *list ); // iterate over the widgets + TQWidget * w; while ( (w=it.current()) != 0 ) // for each widget... { ++it; - if (QString(w->name()).startsWith("karamba")) + if (TQString(w->name()).startsWith("karamba")) { karamba* k = (karamba*) w; if (k->getPrettyName() == pretty_name) @@ -93,12 +93,12 @@ bool KarambaApplication::themeExists(QString pretty_name) return false; } -QStringList KarambaApplication::getKarambas() +TQStringList KarambaApplication::getKarambas() { QCStringList applst = dcopClient()->registeredApplications(); QCStringList::Iterator it; - QCString s; - QStringList result; + TQCString s; + TQStringList result; for (it = applst.begin(); (s = *it) != 0; ++it) { @@ -111,11 +111,11 @@ QStringList KarambaApplication::getKarambas() void KarambaApplication::checkSuperKarambaDir() { // Create ~/.superkaramba if necessary - QDir configDir(QDir::home().absPath() + "/.superkaramba"); + TQDir configDir(TQDir::home().absPath() + "/.superkaramba"); if (!configDir.exists()) { qWarning("~/.superkaramba doesn't exist"); - if(!configDir.mkdir(QDir::home().absPath() + "/.superkaramba")) + if(!configDir.mkdir(TQDir::home().absPath() + "/.superkaramba")) { qWarning("Couldn't create Directory ~/.superkaramba"); } @@ -141,17 +141,17 @@ void KarambaApplication::setUpSysTray(KAboutData* about) KPopupMenu *menu = sysTrayIcon->contextMenu(); menu->insertItem(SmallIconSet("superkaramba"), i18n("Hide System Tray Icon"), this, - SLOT(globalHideSysTray())); + TQT_SLOT(globalHideSysTray())); menu->insertSeparator(); m_helpMenu = new KHelpMenu(themeListWindow, about); - action = KStdAction::help(m_helpMenu, SLOT(appHelpActivated()), + action = KStdAction::help(m_helpMenu, TQT_SLOT(appHelpActivated()), sysTrayIcon->actionCollection()); action->plug(menu); - action = KStdAction::aboutApp(m_helpMenu, SLOT(aboutApplication()), + action = KStdAction::aboutApp(m_helpMenu, TQT_SLOT(aboutApplication()), sysTrayIcon->actionCollection()); action->plug(menu); - action = KStdAction::aboutKDE(m_helpMenu, SLOT(aboutKDE()), + action = KStdAction::aboutKDE(m_helpMenu, TQT_SLOT(aboutKDE()), sysTrayIcon->actionCollection()); action->plug(menu); @@ -164,13 +164,13 @@ void KarambaApplication::setUpSysTray(KAboutData* about) sysTrayIcon->hide(); //Connect Systray icon's quit event - QObject::connect(sysTrayIcon, SIGNAL(quitSelected()), - this, SLOT(globalQuitSuperKaramba())); + TQObject::connect(sysTrayIcon, TQT_SIGNAL(quitSelected()), + this, TQT_SLOT(globalQuitSuperKaramba())); } void KarambaApplication::showKarambaMenuExtension(bool show) { - QObject *k; + TQObject *k; if(show) { @@ -188,13 +188,13 @@ void KarambaApplication::showKarambaMenuExtension(bool show) } } -void KarambaApplication::setToolTip(const QString &tip) +void KarambaApplication::setToolTip(const TQString &tip) { - QToolTip::remove(sysTrayIcon); + TQToolTip::remove(sysTrayIcon); if(tip.isNull()) - QToolTip::add(sysTrayIcon, i18n("SuperKaramba")); + TQToolTip::add(sysTrayIcon, i18n("SuperKaramba")); else - QToolTip::add(sysTrayIcon, tip); + TQToolTip::add(sysTrayIcon, tip); } void KarambaApplication::buildToolTip() @@ -202,7 +202,7 @@ void KarambaApplication::buildToolTip() if(!sysTrayIcon || !themeListWindow) return; - QStringList list = themeListWindow->runningThemes(); + TQStringList list = themeListWindow->runningThemes(); if(list.isEmpty()) { @@ -210,11 +210,11 @@ void KarambaApplication::buildToolTip() return; } - QString toolTip("<b><center>" + i18n("SuperKaramba") + "</center></b>"); + TQString toolTip("<b><center>" + i18n("SuperKaramba") + "</center></b>"); toolTip += "<table width=300>"; bool firstRun = true; - for(QStringList::Iterator it = list.begin(); it != list.end(); ++it ) + for(TQStringList::Iterator it = list.begin(); it != list.end(); ++it ) { if(firstRun) { @@ -236,7 +236,7 @@ void KarambaApplication::buildToolTip() } void KarambaApplication::checkPreviousSession(KApplication &app, - QStringList &lst) + TQStringList &lst) { /****** Try to restore a previous session if applicable. @@ -245,14 +245,14 @@ void KarambaApplication::checkPreviousSession(KApplication &app, { KConfig* config = app.sessionConfig(); config->setGroup("General Options"); - QString restartThemes = config->readEntry("OpenThemes"); + TQString restartThemes = config->readEntry("OpenThemes"); //Get themes that were running - lst = QStringList::split(QString(";"), restartThemes); + lst = TQStringList::split(TQString(";"), restartThemes); } } -void KarambaApplication::checkCommandLine(KCmdLineArgs *args, QStringList &lst) +void KarambaApplication::checkCommandLine(KCmdLineArgs *args, TQStringList &lst) { /****** Not a saved session - check for themes given on command line @@ -271,15 +271,15 @@ void KarambaApplication::checkCommandLine(KCmdLineArgs *args, QStringList &lst) } } -bool KarambaApplication::startThemes(QStringList &lst) +bool KarambaApplication::startThemes(TQStringList &lst) { bool result = false; - for(QStringList::Iterator it = lst.begin(); it != lst.end(); ++it ) + for(TQStringList::Iterator it = lst.begin(); it != lst.end(); ++it ) { karamba *mainWin = 0; - mainWin = new karamba(*it , QString()); + mainWin = new karamba(*it , TQString()); mainWin->show(); result = true; } @@ -317,7 +317,7 @@ bool KarambaApplication::hasKaramba(karamba* k) bool KarambaApplication::lockKaramba() { - QString file = QDir::home().absPath() + "/.superkaramba/.lock"; + TQString file = TQDir::home().absPath() + "/.superkaramba/.lock"; mode_t mode = S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP; fd = open(file.ascii(), O_CREAT | O_RDWR | O_TRUNC, mode); @@ -386,8 +386,8 @@ void KarambaApplication::quitSuperKaramba() void KarambaApplication::globalQuitSuperKaramba() { - QStringList apps = getKarambas(); - QStringList::Iterator it; + TQStringList apps = getKarambas(); + TQStringList::Iterator it; for (it = apps.begin(); it != apps.end(); ++it) { @@ -398,8 +398,8 @@ void KarambaApplication::globalQuitSuperKaramba() void KarambaApplication::globalShowThemeDialog() { - QStringList apps = getKarambas(); - QStringList::Iterator it; + TQStringList apps = getKarambas(); + TQStringList::Iterator it; for (it = apps.begin(); it != apps.end(); ++it) { @@ -411,8 +411,8 @@ void KarambaApplication::globalShowThemeDialog() void KarambaApplication::globalHideSysTray(bool hide) { //kdDebug() << k_funcinfo << endl; - QStringList apps = getKarambas(); - QStringList::Iterator it; + TQStringList apps = getKarambas(); + TQStringList::Iterator it; SuperKarambaSettings::setShowSysTray(!hide); SuperKarambaSettings::writeConfig(); diff --git a/superkaramba/src/karambaapp.h b/superkaramba/src/karambaapp.h index ef92244..9a22adc 100644 --- a/superkaramba/src/karambaapp.h +++ b/superkaramba/src/karambaapp.h @@ -47,30 +47,30 @@ class KarambaApplication : public KApplication KHelpMenu* m_helpMenu; void showKarambaMenuExtension(bool show = true); - void setToolTip(const QString &tip = QString::null); + void setToolTip(const TQString &tip = TQString::null); protected: KarambaIface* iface; ThemesDlg* themeListWindow; dcopIface_stub* dcopIfaceStub; - QObjectList *karambaList; + TQObjectList *karambaList; KSystemTray* sysTrayIcon; public: KarambaApplication(); ~KarambaApplication(); - QString getMainKaramba(); - QStringList getKarambas(); - bool themeExists(QString pretty_name); - void initDcopStub(QCString app = ""); + TQString getMainKaramba(); + TQStringList getKarambas(); + bool themeExists(TQString pretty_name); + void initDcopStub(TQCString app = ""); void setUpSysTray(KAboutData* about); - void checkPreviousSession(KApplication &app, QStringList &lst); - void checkCommandLine(KCmdLineArgs *args, QStringList &lst); - bool startThemes(QStringList &lst); + void checkPreviousSession(KApplication &app, TQStringList &lst); + void checkCommandLine(KCmdLineArgs *args, TQStringList &lst); + bool startThemes(TQStringList &lst); KarambaIface* dcopIface() { return iface; }; dcopIface_stub* dcopStub() { return dcopIfaceStub; }; - QWidget* parentWindow() { return (QWidget*)themeListWindow; }; + TQWidget* parentWindow() { return (TQWidget*)themeListWindow; }; void addKaramba(karamba* k, bool reloading = false); void deleteKaramba(karamba* k, bool reloading = false); diff --git a/superkaramba/src/karambainterface.cpp b/superkaramba/src/karambainterface.cpp index 7a201d8..5d33f68 100644 --- a/superkaramba/src/karambainterface.cpp +++ b/superkaramba/src/karambainterface.cpp @@ -11,7 +11,7 @@ #include "karamba.h" #include "karambainterface.h" #include <kdebug.h> -#include "qwidgetlist.h" +#include "tqwidgetlist.h" #include "themesdlg.h" KarambaIface::KarambaIface(): DCOPObject("KarambaIface") @@ -22,17 +22,17 @@ KarambaIface::~KarambaIface() { } -karamba* KarambaIface::getKaramba(QString name) +karamba* KarambaIface::getKaramba(TQString name) { - QWidgetList *list = QApplication::allWidgets(); - QWidgetListIt it(*list); // iterate over the widgets - QWidget* w; + TQWidgetList *list = TQApplication::allWidgets(); + TQWidgetListIt it(*list); // iterate over the widgets + TQWidget* w; karamba* result = 0; while ( (w=it.current()) != 0 ) // for each widget... { ++it; - if (QString(w->name()).startsWith("karamba")) + if (TQString(w->name()).startsWith("karamba")) { karamba* k = (karamba*) w; //if(k->prettyName == name) @@ -49,15 +49,15 @@ karamba* KarambaIface::getKaramba(QString name) ThemesDlg* KarambaIface::getThemeWnd() { - QWidgetList *list = QApplication::allWidgets(); - QWidgetListIt it( *list ); // iterate over the widgets - QWidget* w; + TQWidgetList *list = TQApplication::allWidgets(); + TQWidgetListIt it( *list ); // iterate over the widgets + TQWidget* w; ThemesDlg* result = 0; while ( (w=it.current()) != 0 ) // for each widget... { ++it; - if (QString(w->name()) == "ThemesLayout") + if (TQString(w->name()) == "ThemesLayout") { result = (ThemesDlg*) w; break; @@ -67,25 +67,25 @@ ThemesDlg* KarambaIface::getThemeWnd() return result; } -void KarambaIface::openTheme(QString filename) +void KarambaIface::openTheme(TQString filename) { - QFileInfo file(filename); + TQFileInfo file(filename); if(file.exists()) { - (new karamba(filename, QString()))->show(); + (new karamba(filename, TQString()))->show(); } } -void KarambaIface::openNamedTheme(QString filename, QString name, bool is_sub_theme) +void KarambaIface::openNamedTheme(TQString filename, TQString name, bool is_sub_theme) { - QFileInfo file(filename); + TQFileInfo file(filename); if(file.exists()) { (new karamba(filename, name, false, -1, is_sub_theme))->show(); } } -void KarambaIface::closeTheme(QString name) +void KarambaIface::closeTheme(TQString name) { kdDebug() << "KarambaIface::closeTheme: " << name << endl; karamba* k; @@ -97,7 +97,7 @@ void KarambaIface::closeTheme(QString name) } } -int KarambaIface::themeAdded(QString appId, QString file) +int KarambaIface::themeAdded(TQString appId, TQString file) { ThemesDlg* tw = getThemeWnd(); if(tw) @@ -105,7 +105,7 @@ int KarambaIface::themeAdded(QString appId, QString file) return -1; } -void KarambaIface::themeNotify(QString name, QString text) +void KarambaIface::themeNotify(TQString name, TQString text) { karamba* k = getKaramba(name); if(k) @@ -114,7 +114,7 @@ void KarambaIface::themeNotify(QString name, QString text) } } -void KarambaIface::setIncomingData(QString name, QString text) +void KarambaIface::setIncomingData(TQString name, TQString text) { karamba* k = getKaramba(name); if(k) @@ -123,7 +123,7 @@ void KarambaIface::setIncomingData(QString name, QString text) } } -void KarambaIface::themeClosed(QString appId, QString file, int instance) +void KarambaIface::themeClosed(TQString appId, TQString file, int instance) { ThemesDlg* tw = getThemeWnd(); if(tw) diff --git a/superkaramba/src/karambainterface.h b/superkaramba/src/karambainterface.h index 1202cc5..8f4b2ae 100644 --- a/superkaramba/src/karambainterface.h +++ b/superkaramba/src/karambainterface.h @@ -21,21 +21,21 @@ class KarambaIface: virtual public dcopIface public: KarambaIface(); ~KarambaIface(); - karamba* getKaramba(QString name); + karamba* getKaramba(TQString name); ThemesDlg* getThemeWnd(); public slots: - virtual void openTheme(QString filename); - virtual void openNamedTheme(QString filename, QString name, bool is_sub_theme); - virtual void closeTheme(QString name); + virtual void openTheme(TQString filename); + virtual void openNamedTheme(TQString filename, TQString name, bool is_sub_theme); + virtual void closeTheme(TQString name); virtual void quit(); virtual void hideSystemTray(bool show); virtual void showThemeDialog(); - virtual int themeAdded(QString appId, QString file); - virtual void themeClosed(QString appId, QString file, int instance); - virtual void themeNotify(QString name, QString text); - virtual void setIncomingData(QString name, QString text); + virtual int themeAdded(TQString appId, TQString file); + virtual void themeClosed(TQString appId, TQString file, int instance); + virtual void themeNotify(TQString name, TQString text); + virtual void setIncomingData(TQString name, TQString text); virtual bool isMainKaramba(); }; diff --git a/superkaramba/src/karambalistboxitem.cpp b/superkaramba/src/karambalistboxitem.cpp index 703e3ef..e41b831 100644 --- a/superkaramba/src/karambalistboxitem.cpp +++ b/superkaramba/src/karambalistboxitem.cpp @@ -20,6 +20,6 @@ ****************************************************************************/ #include "karambalistboxitem.h" -KarambaListBoxItem::KarambaListBoxItem( QListBox* listbox, const QString & text ) : QListBoxText(listbox, text) { +KarambaListBoxItem::KarambaListBoxItem( TQListBox* listbox, const TQString & text ) : TQListBoxText(listbox, text) { } diff --git a/superkaramba/src/karambalistboxitem.h b/superkaramba/src/karambalistboxitem.h index 76427c2..782daea 100644 --- a/superkaramba/src/karambalistboxitem.h +++ b/superkaramba/src/karambalistboxitem.h @@ -19,13 +19,13 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ****************************************************************************/ #include "karamba.h" -#include <qlistbox.h> +#include <tqlistbox.h> -class KarambaListBoxItem : public QListBoxText +class KarambaListBoxItem : public TQListBoxText { public: - QString appId; - KarambaListBoxItem( QListBox* listbox, const QString & text=QString::null ); + TQString appId; + KarambaListBoxItem( TQListBox* listbox, const TQString & text=TQString::null ); }; diff --git a/superkaramba/src/karambarootpixmap.cpp b/superkaramba/src/karambarootpixmap.cpp index b733624..c2f0038 100644 --- a/superkaramba/src/karambarootpixmap.cpp +++ b/superkaramba/src/karambarootpixmap.cpp @@ -11,7 +11,7 @@ #include "karambarootpixmap.h" #include "karamba.h" -KarambaRootPixmap::KarambaRootPixmap(QWidget *w) : +KarambaRootPixmap::KarambaRootPixmap(TQWidget *w) : KRootPixmap( w) { widget = w; diff --git a/superkaramba/src/karambarootpixmap.h b/superkaramba/src/karambarootpixmap.h index 9445528..bedf1b0 100644 --- a/superkaramba/src/karambarootpixmap.h +++ b/superkaramba/src/karambarootpixmap.h @@ -10,7 +10,7 @@ #ifndef KARAMBAROOTPIXMAP_H #define KARAMBAROOTPIXMAP_H -#include <qwidget.h> +#include <tqwidget.h> #include <krootpixmap.h> #include <ksharedpixmap.h> @@ -23,7 +23,7 @@ class KarambaRootPixmap : public KRootPixmap { public: //KarambaRootPixmap(); - KarambaRootPixmap( QWidget *); + KarambaRootPixmap( TQWidget *); ~KarambaRootPixmap(); @@ -31,7 +31,7 @@ public: void updateBackground ( KSharedPixmap * ); private: -QWidget *widget; +TQWidget *widget; }; diff --git a/superkaramba/src/karambasessionmanaged.cpp b/superkaramba/src/karambasessionmanaged.cpp index eccff7e..952fb7d 100644 --- a/superkaramba/src/karambasessionmanaged.cpp +++ b/superkaramba/src/karambasessionmanaged.cpp @@ -24,7 +24,7 @@ #include <kconfig.h> #include "karambasessionmanaged.h" #include "karamba.h" -#include "qwidgetlist.h" +#include "tqwidgetlist.h" bool KarambaSessionManaged::saveState(QSessionManager&) { @@ -32,20 +32,20 @@ bool KarambaSessionManaged::saveState(QSessionManager&) config->setGroup("General Options"); - QString openThemes=""; + TQString openThemes=""; - QWidgetList *list = QApplication::allWidgets(); - QWidgetListIt it( *list ); // iterate over the widgets - QWidget * w; + TQWidgetList *list = TQApplication::allWidgets(); + TQWidgetListIt it( *list ); // iterate over the widgets + TQWidget * w; while ( (w=it.current()) != 0 ) // for each widget... { ++it; - if (QString(w->name()).startsWith("karamba")) + if (TQString(w->name()).startsWith("karamba")) { karamba* k = (karamba*) w; if (k->isSubTheme()) continue; - openThemes += QFileInfo(k->theme().file()).absFilePath(); + openThemes += TQFileInfo(k->theme().file()).absFilePath(); k->writeConfigData(); openThemes += ";"; } diff --git a/superkaramba/src/kwidgetlistbox.cpp b/superkaramba/src/kwidgetlistbox.cpp index 4749f64..d22d3c8 100644 --- a/superkaramba/src/kwidgetlistbox.cpp +++ b/superkaramba/src/kwidgetlistbox.cpp @@ -21,8 +21,8 @@ #include <kdebug.h> #include <kglobalsettings.h> -KWidgetListbox::KWidgetListbox(QWidget *parent, const char *name) - : QTable(parent, name) +KWidgetListbox::KWidgetListbox(TQWidget *parent, const char *name) + : TQTable(parent, name) { setNumRows(0); setNumCols(1); @@ -31,12 +31,12 @@ KWidgetListbox::KWidgetListbox(QWidget *parent, const char *name) setTopMargin(0); horizontalHeader()->hide(); verticalHeader()->hide(); - setSelectionMode(QTable::NoSelection); - setFocusStyle(QTable::FollowStyle); - connect(this, SIGNAL(currentChanged(int, int)), - this, SLOT(selectionChanged(int, int))); - setHScrollBarMode(QScrollView::AlwaysOff); - setVScrollBarMode(QScrollView::Auto); + setSelectionMode(TQTable::NoSelection); + setFocusStyle(TQTable::FollowStyle); + connect(this, TQT_SIGNAL(currentChanged(int, int)), + this, TQT_SLOT(selectionChanged(int, int))); + setHScrollBarMode(TQScrollView::AlwaysOff); + setVScrollBarMode(TQScrollView::Auto); } KWidgetListbox::~KWidgetListbox() @@ -51,7 +51,7 @@ void KWidgetListbox::clear() setNumRows(0); } -int KWidgetListbox::insertItem(QWidget* item, int index) +int KWidgetListbox::insertItem(TQWidget* item, int index) { int row; @@ -69,7 +69,7 @@ int KWidgetListbox::insertItem(QWidget* item, int index) return row; } -void KWidgetListbox::setSelected(QWidget* item) +void KWidgetListbox::setSelected(TQWidget* item) { setSelected(index(item)); } @@ -81,7 +81,7 @@ void KWidgetListbox::selectionChanged(int row, int col) emit selected(row); } -void KWidgetListbox::removeItem(QWidget* item) +void KWidgetListbox::removeItem(TQWidget* item) { removeItem(index(item)); } @@ -102,17 +102,17 @@ int KWidgetListbox::selected() const return currentRow(); } -QWidget* KWidgetListbox::selectedItem() const +TQWidget* KWidgetListbox::selectedItem() const { return item(selected()); } -QWidget* KWidgetListbox::item(int index) const +TQWidget* KWidgetListbox::item(int index) const { return cellWidget(index, 0); } -int KWidgetListbox::index(QWidget* itm) const +int KWidgetListbox::index(TQWidget* itm) const { for(int i = 0; i < numRows(); ++i) if(item(i) == itm) @@ -148,7 +148,7 @@ void KWidgetListbox::updateColors() void KWidgetListbox::setItemColors(int index, bool even) { - QWidget* itm = item(index); + TQWidget* itm = item(index); if(index == selected()) { @@ -185,14 +185,14 @@ void KWidgetListbox::showItems(show_callback func, void* data) updateColors(); } -void KWidgetListbox::showEvent(QShowEvent*) +void KWidgetListbox::showEvent(TQShowEvent*) { //kdDebug() << k_funcinfo << endl; repaintContents(false); } -void KWidgetListbox::paintCell(QPainter*, int, int, const QRect&, - bool, const QColorGroup&) +void KWidgetListbox::paintCell(TQPainter*, int, int, const TQRect&, + bool, const TQColorGroup&) { //kdDebug() << k_funcinfo << endl; } diff --git a/superkaramba/src/kwidgetlistbox.h b/superkaramba/src/kwidgetlistbox.h index 62a52a8..ead6989 100644 --- a/superkaramba/src/kwidgetlistbox.h +++ b/superkaramba/src/kwidgetlistbox.h @@ -20,43 +20,43 @@ #ifndef KWIDGETLISTBOX_H #define KWIDGETLISTBOX_H -#include <qtable.h> +#include <tqtable.h> /** @author See README for the list of authors */ -typedef bool (*show_callback) (int index, QWidget* widget, void* data); +typedef bool (*show_callback) (int index, TQWidget* widget, void* data); class KWidgetListbox : public QTable { Q_OBJECT public: - KWidgetListbox(QWidget *parent = 0, const char *name = 0); + KWidgetListbox(TQWidget *parent = 0, const char *name = 0); ~KWidgetListbox(); - int insertItem(QWidget* item, int index = -1); - void setSelected(QWidget* item); + int insertItem(TQWidget* item, int index = -1); + void setSelected(TQWidget* item); void setSelected(int index); - void removeItem(QWidget* item); + void removeItem(TQWidget* item); void removeItem(int index); void clear(); int selected() const; - QWidget* selectedItem() const; - QWidget* item(int index) const; - int index(QWidget* itm) const; + TQWidget* selectedItem() const; + TQWidget* item(int index) const; + int index(TQWidget* itm) const; uint count() const { return numRows(); }; void showItems(show_callback func = 0, void* data = 0); - void paintCell(QPainter* p, int row, int col, const QRect& cr, - bool selected, const QColorGroup& cg); + void paintCell(TQPainter* p, int row, int col, const TQRect& cr, + bool selected, const TQColorGroup& cg); protected: void setItemColors(int index, bool even); void updateColors(); bool even(int index); - virtual void showEvent(QShowEvent* e); + virtual void showEvent(TQShowEvent* e); protected slots: void selectionChanged(int row, int col); diff --git a/superkaramba/src/lineparser.cpp b/superkaramba/src/lineparser.cpp index d923b6c..24d5468 100644 --- a/superkaramba/src/lineparser.cpp +++ b/superkaramba/src/lineparser.cpp @@ -21,9 +21,9 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ****************************************************************************/ #include "lineparser.h" -#include <qregexp.h> +#include <tqregexp.h> -LineParser::LineParser(const QString& line) +LineParser::LineParser(const TQString& line) { set(line); } @@ -32,42 +32,42 @@ LineParser::~LineParser() { } -void LineParser::set(const QString& line) +void LineParser::set(const TQString& line) { - QRegExp rx("^\\s*(\\S+)"); + TQRegExp rx("^\\s*(\\S+)"); m_line = line; rx.search(m_line); m_meter = rx.cap(1).upper(); } -int LineParser::getInt(QString w, int def) const +int LineParser::getInt(TQString w, int def) const { - QRegExp rx( "\\W+" + w +"=([-]?\\d+)", false ); + TQRegExp rx( "\\W+" + w +"=([-]?\\d+)", false ); if (rx.search(m_line) != -1) return rx.cap(1).toInt(); else return def; } -QColor LineParser::getColor(QString w, QColor def) const +TQColor LineParser::getColor(TQString w, TQColor def) const { - QRegExp rx( "\\W+" + w + "=([-]?\\d+),([-]?\\d+),([-]?\\d+)", false ); + TQRegExp rx( "\\W+" + w + "=([-]?\\d+),([-]?\\d+),([-]?\\d+)", false ); if (rx.search(m_line) != -1) - return QColor(rx.cap(1).toInt(), rx.cap(2).toInt(), rx.cap(3).toInt()); + return TQColor(rx.cap(1).toInt(), rx.cap(2).toInt(), rx.cap(3).toInt()); else return def; } -QString LineParser::getString(QString w, QString def) const +TQString LineParser::getString(TQString w, TQString def) const { - QString result; - QRegExp rx( "\\W+" + w + "=\"([^\"]*)\"", false ); + TQString result; + TQRegExp rx( "\\W+" + w + "=\"([^\"]*)\"", false ); bool found = (rx.search(m_line)==-1)?false:true; if (rx.cap(1).isEmpty()) { - rx = QRegExp(w + "=(\\S+)", false); + rx = TQRegExp(w + "=(\\S+)", false); found = (rx.search(m_line)==-1)?false:true; result = rx.cap(1); } @@ -81,9 +81,9 @@ QString LineParser::getString(QString w, QString def) const return def; } -bool LineParser::getBoolean(QString w, bool def) const +bool LineParser::getBoolean(TQString w, bool def) const { - QString boolean = getString(w, "-").lower(); + TQString boolean = getString(w, "-").lower(); if(boolean == "-") return def; else if (boolean == "true") // true / false diff --git a/superkaramba/src/lineparser.h b/superkaramba/src/lineparser.h index b877e6c..b92385d 100644 --- a/superkaramba/src/lineparser.h +++ b/superkaramba/src/lineparser.h @@ -27,27 +27,27 @@ @author See README for the list of authors */ -#include <qstring.h> -#include <qcolor.h> +#include <tqstring.h> +#include <tqcolor.h> class LineParser { public: - LineParser(const QString& line = QString::null); + LineParser(const TQString& line = TQString::null); ~LineParser(); - void set(const QString& line); + void set(const TQString& line); - int getInt(QString w, int def = 0) const; - QColor getColor(QString w, QColor def = QColor()) const; - QString getString(QString w, QString def = QString()) const; - bool getBoolean(QString w, bool def = false) const; + int getInt(TQString w, int def = 0) const; + TQColor getColor(TQString w, TQColor def = TQColor()) const; + TQString getString(TQString w, TQString def = TQString()) const; + bool getBoolean(TQString w, bool def = false) const; - const QString& meter() const { return m_meter; }; + const TQString& meter() const { return m_meter; }; private: - QString m_line; - QString m_meter; + TQString m_line; + TQString m_meter; }; #endif diff --git a/superkaramba/src/main.cpp b/superkaramba/src/main.cpp index 14c651c..4b7976f 100644 --- a/superkaramba/src/main.cpp +++ b/superkaramba/src/main.cpp @@ -21,15 +21,15 @@ ****************************************************************************/ #include <karambaapp.h> -#include <qobject.h> +#include <tqobject.h> #include <kaboutdata.h> #include <kcmdlineargs.h> #include <klocale.h> #include <kconfig.h> #include <kmainwindow.h> -#include <qfileinfo.h> -#include <qstringlist.h> +#include <tqfileinfo.h> +#include <tqstringlist.h> #include <kconfig.h> #include <kstandarddirs.h> #include <kdeversion.h> @@ -104,7 +104,7 @@ int main(int argc, char **argv) KarambaSessionManaged ksm; //karamba *mainWin = 0; KCmdLineArgs *args = KCmdLineArgs::parsedArgs(); - QStringList lst; + TQStringList lst; int ret = 0; // Create ~/.superkaramba if necessary @@ -114,7 +114,7 @@ int main(int argc, char **argv) KarambaApplication app; - QString mainAppId = app.getMainKaramba(); + TQString mainAppId = app.getMainKaramba(); if(!mainAppId.isEmpty()) { app.initDcopStub(mainAppId.ascii()); @@ -128,7 +128,7 @@ int main(int argc, char **argv) KarambaApplication::unlockKaramba(); - app.connect(qApp,SIGNAL(lastWindowClosed()),qApp,SLOT(quit())); + app.connect(qApp,TQT_SIGNAL(lastWindowClosed()),qApp,TQT_SLOT(quit())); // Try to restore a previous session if applicable. app.checkPreviousSession(app, lst); diff --git a/superkaramba/src/memsensor.cpp b/superkaramba/src/memsensor.cpp index 21d9f35..dda7983 100644 --- a/superkaramba/src/memsensor.cpp +++ b/superkaramba/src/memsensor.cpp @@ -8,11 +8,11 @@ * (at your option) any later version. * ***************************************************************************/ #include "memsensor.h" -#include <qfile.h> -#include <qglobal.h> -#include <qtextstream.h> -#include <qstring.h> -#include <qregexp.h> +#include <tqfile.h> +#include <tqglobal.h> +#include <tqtextstream.h> +#include <tqstring.h> +#include <tqregexp.h> #ifdef Q_OS_FREEBSD #include <sys/time.h> @@ -56,10 +56,10 @@ MemSensor::MemSensor(int msec) : Sensor(msec) # if defined(Q_OS_FREEBSD) && defined(__FreeBSD_version) && __FreeBSD_version >= 500018 kd = kvm_open("/dev/null", "/dev/null", "/dev/null", O_RDONLY, "kvm_open"); # elif defined Q_OS_FREEBSD - connect(&ksp, SIGNAL(receivedStdout(KProcess *, char *, int )), - this,SLOT(receivedStdout(KProcess *, char *, int ))); - connect(&ksp, SIGNAL(processExited(KProcess *)), - this,SLOT(processExited( KProcess * ))); + connect(&ksp, TQT_SIGNAL(receivedStdout(KProcess *, char *, int )), + this,TQT_SLOT(receivedStdout(KProcess *, char *, int ))); + connect(&ksp, TQT_SIGNAL(processExited(KProcess *)), + this,TQT_SLOT(processExited( KProcess * ))); swapTotal = swapUsed = 0; @@ -79,7 +79,7 @@ MemSensor::~MemSensor() void MemSensor::receivedStdout(KProcess *, char *buffer, int len ) { buffer[len] = 0; - sensorResult += QString( QCString(buffer) ); + sensorResult += TQString( TQCString(buffer) ); } #else void MemSensor::receivedStdout(KProcess *, char *, int) @@ -90,9 +90,9 @@ void MemSensor::receivedStdout(KProcess *, char *, int) void MemSensor::processExited(KProcess *) { #ifdef Q_OS_FREEBSD - QStringList stringList = QStringList::split('\n',sensorResult); + TQStringList stringList = TQStringList::split('\n',sensorResult); sensorResult = ""; - QStringList itemsList = QStringList::split(' ', stringList[1]); + TQStringList itemsList = TQStringList::split(' ', stringList[1]); swapUsed = itemsList[2].toInt(); swapTotal = itemsList[1].toInt(); @@ -108,7 +108,7 @@ int MemSensor::getMemTotal() sysctlbyname("hw.physmem", &mem, &size, NULL, 0); return (mem / 1024); #else - QRegExp rx( "MemTotal:\\s*(\\d+)" ); + TQRegExp rx( "MemTotal:\\s*(\\d+)" ); rx.search( meminfo ); return ( rx.cap(1).toInt() ); #endif @@ -132,7 +132,7 @@ int MemSensor::getMemFree() sysctl(mib,2,&uvmexp,&ssize,NULL,0); return pagetok(uvmexp.free); #else - QRegExp rx( "MemFree:\\s*(\\d+)" ); + TQRegExp rx( "MemFree:\\s*(\\d+)" ); rx.search( meminfo ); return ( rx.cap(1).toInt() ); #endif @@ -153,7 +153,7 @@ int MemSensor::getBuffers() sysctlbyname("vm.bufmem", &buf_mem, &size, NULL, 0); return (buf_mem / 1024); #else - QRegExp rx( "Buffers:\\s*(\\d+)" ); + TQRegExp rx( "Buffers:\\s*(\\d+)" ); rx.search( meminfo ); return ( rx.cap(1).toInt() ); #endif @@ -170,8 +170,8 @@ int MemSensor::getCached() #elif defined(Q_OS_NETBSD) return 0; #else - QRegExp rx1( "Cached:\\s*(\\d+)" ); - QRegExp rx2( "SwapCached:\\s*(\\d+)" ); + TQRegExp rx1( "Cached:\\s*(\\d+)" ); + TQRegExp rx2( "SwapCached:\\s*(\\d+)" ); rx1.search( meminfo ); rx2.search( meminfo ); return ( rx1.cap(1).toInt() + rx2.cap(1).toInt() ); @@ -215,7 +215,7 @@ int MemSensor::getSwapTotal() } return STotal; #else - QRegExp rx( "SwapTotal:\\s*(\\d+)" ); + TQRegExp rx( "SwapTotal:\\s*(\\d+)" ); rx.search( meminfo ); return ( rx.cap(1).toInt() ); #endif @@ -260,7 +260,7 @@ int MemSensor::getSwapFree() } return SFree; #else - QRegExp rx( "SwapFree:\\s*(\\d+)" ); + TQRegExp rx( "SwapFree:\\s*(\\d+)" ); rx.search( meminfo ); return ( rx.cap(1).toInt() ); #endif @@ -275,11 +275,11 @@ void MemSensor::readValues() ksp.start( KProcess::NotifyOnExit,KProcIO::Stdout); # endif #else - QFile file("/proc/meminfo"); - QString line; + TQFile file("/proc/meminfo"); + TQString line; if ( file.open(IO_ReadOnly | IO_Translate) ) { - QTextStream t( &file ); // use a text stream + TQTextStream t( &file ); // use a text stream meminfo = t.read(); file.close(); } @@ -289,10 +289,10 @@ void MemSensor::readValues() void MemSensor::update() { readValues(); - QString format; + TQString format; SensorParams *sp; Meter *meter; - QObjectListIt it( *objList ); + TQObjectListIt it( *objList ); #if defined(Q_OS_FREEBSD) && !(defined(__FreeBSD_version) && __FreeBSD_version >= 500018) bool set = false; #endif @@ -318,17 +318,17 @@ void MemSensor::update() format = "%um"; } - format.replace( QRegExp("%fmb", false), QString::number( (int)(( totalMem - usedMemNoBuffers)/1024.0+0.5))); - format.replace( QRegExp("%fm", false), QString::number( (int)( ( totalMem - usedMem )/1024.0+0.5) )); + format.replace( TQRegExp("%fmb", false), TQString::number( (int)(( totalMem - usedMemNoBuffers)/1024.0+0.5))); + format.replace( TQRegExp("%fm", false), TQString::number( (int)( ( totalMem - usedMem )/1024.0+0.5) )); - format.replace( QRegExp("%umb", false), QString::number( (int)((usedMemNoBuffers)/1024.0+0.5))); - format.replace( QRegExp("%um", false), QString::number( (int)((usedMem)/1024.0+0.5 ))); + format.replace( TQRegExp("%umb", false), TQString::number( (int)((usedMemNoBuffers)/1024.0+0.5))); + format.replace( TQRegExp("%um", false), TQString::number( (int)((usedMem)/1024.0+0.5 ))); - format.replace( QRegExp("%tm", false), QString::number( (int)( (totalMem)/1024.0+0.5))); + format.replace( TQRegExp("%tm", false), TQString::number( (int)( (totalMem)/1024.0+0.5))); - format.replace( QRegExp("%fs", false), QString::number( (int)((totalSwap - usedSwap)/1024.0+0.5))); - format.replace( QRegExp("%us", false), QString::number( (int)(usedSwap/1024.0+0.5))); - format.replace( QRegExp("%ts", false), QString::number( (int)(totalSwap/1024.0+0.5))); + format.replace( TQRegExp("%fs", false), TQString::number( (int)((totalSwap - usedSwap)/1024.0+0.5))); + format.replace( TQRegExp("%us", false), TQString::number( (int)(usedSwap/1024.0+0.5))); + format.replace( TQRegExp("%ts", false), TQString::number( (int)(totalSwap/1024.0+0.5))); meter->setValue(format); ++it; @@ -343,7 +343,7 @@ void MemSensor::setMaxValue( SensorParams *sp ) { Meter *meter; meter = sp->getMeter(); - QString f; + TQString f; f = sp->getParam("FORMAT"); if (f.length() == 0 ) diff --git a/superkaramba/src/memsensor.h b/superkaramba/src/memsensor.h index a9e425e..4a1f0e0 100644 --- a/superkaramba/src/memsensor.h +++ b/superkaramba/src/memsensor.h @@ -10,9 +10,9 @@ #ifndef MEMSENSOR_H #define MEMSENSOR_H #include "sensor.h" -#include <qglobal.h> -#include <qstring.h> -#include <qregexp.h> +#include <tqglobal.h> +#include <tqstring.h> +#include <tqregexp.h> #include <kprocess.h> #ifdef __FreeBSD__ @@ -39,14 +39,14 @@ public: void update(); void setMaxValue( SensorParams *sp ); - QString getMemLine(); + TQString getMemLine(); private: - QString meminfo; + TQString meminfo; void readValues(); #if defined(Q_OS_FREEBSD) || defined(Q_OS_NETBSD) int pageshift; /* log base 2 of the pagesize */ - QString sensorResult; + TQString sensorResult; int swapTotal; int swapUsed; # if defined(Q_OS_FREEBSD) && defined(__FreeBSD_version) && __FreeBSD_version >= 500018 diff --git a/superkaramba/src/menu_python.cpp b/superkaramba/src/menu_python.cpp index 0a85836..11e5a15 100644 --- a/superkaramba/src/menu_python.cpp +++ b/superkaramba/src/menu_python.cpp @@ -27,7 +27,7 @@ #endif #include <Python.h> -#include <qobject.h> +#include <tqobject.h> #include "karamba.h" #include "meter.h" #include "meter_python.h" @@ -40,8 +40,8 @@ long createMenu(long widget) KPopupMenu* tmp = new KPopupMenu(currTheme); currTheme->menuList->append (tmp ); - currTheme->connect(tmp, SIGNAL(activated(int)), currTheme, - SLOT(passMenuItemClicked(int))); + currTheme->connect(tmp, TQT_SIGNAL(activated(int)), currTheme, + TQT_SLOT(passMenuItemClicked(int))); return (long)tmp; } @@ -99,7 +99,7 @@ PyObject* py_delete_menu(PyObject *, PyObject *args) return Py_BuildValue((char*)"l", deleteMenu(widget, menu)); } -long addMenuItem(long widget, long menu, QString text, QString icon) +long addMenuItem(long widget, long menu, TQString text, TQString icon) { karamba* currTheme = (karamba*)widget; KPopupMenu* tmp = (KPopupMenu*)menu; @@ -119,10 +119,10 @@ PyObject* py_add_menu_item(PyObject *, PyObject *args) PyObject* t; if (!PyArg_ParseTuple(args, (char*)"llOs:addMenuItem", &widget, &menu, &t, &i)) return NULL; - QString icon; - QString text; + TQString icon; + TQString text; icon.setAscii(i); - text = PyString2QString(t); + text = PyString2TQString(t); return Py_BuildValue((char*)"l", addMenuItem(widget, menu, text, icon)); } @@ -181,7 +181,7 @@ long popupMenu(long widget, long menu, long x, long y) if(menuExists(currTheme,tmp)) { - tmp->popup(currTheme->mapToGlobal( QPoint(x,y) )); + tmp->popup(currTheme->mapToGlobal( TQPoint(x,y) )); return 1; } else diff --git a/superkaramba/src/meter.cpp b/superkaramba/src/meter.cpp index efc8a13..e9030e6 100644 --- a/superkaramba/src/meter.cpp +++ b/superkaramba/src/meter.cpp @@ -27,7 +27,7 @@ Meter::~Meter() { } -bool Meter::click(QMouseEvent*) +bool Meter::click(TQMouseEvent*) { return false; } @@ -38,7 +38,7 @@ void Meter::setSize(int ix, int iy, int iw, int ih) recalculateValue(); } -void Meter::setThemePath( QString path ) +void Meter::setThemePath( TQString path ) { themePath = path; } @@ -88,7 +88,7 @@ void Meter::setHeight(int height) recalculateValue(); } -QRect Meter::getBoundingBox() +TQRect Meter::getBoundingBox() { return boundingBox; } diff --git a/superkaramba/src/meter.h b/superkaramba/src/meter.h index 8d1aeaf..ecd84e6 100644 --- a/superkaramba/src/meter.h +++ b/superkaramba/src/meter.h @@ -10,13 +10,13 @@ #ifndef METER_H #define METER_H -#include <qpixmap.h> -#include <qpainter.h> -#include <qstring.h> -#include <qstringlist.h> -#include <qobject.h> +#include <tqpixmap.h> +#include <tqpainter.h> +#include <tqstring.h> +#include <tqstringlist.h> +#include <tqobject.h> -#include <qfileinfo.h> +#include <tqfileinfo.h> class karamba; @@ -44,55 +44,55 @@ public: virtual long getMax() { return minValue; }; virtual long getMin() { return maxValue; }; - void setThemePath( QString ); + void setThemePath( TQString ); - virtual void mUpdate(QPainter *)=0 ; + virtual void mUpdate(TQPainter *)=0 ; virtual void setValue(long) {}; virtual long getValue() { return -1; }; - virtual void setValue(QString) {}; - virtual QString getStringValue() const { return QString::null; }; + virtual void setValue(TQString) {}; + virtual TQString getStringValue() const { return TQString::null; }; virtual void recalculateValue() {}; - virtual void setColor(QColor clr) { color = clr; }; - virtual QColor getColor() { return color; }; + virtual void setColor(TQColor clr) { color = clr; }; + virtual TQColor getColor() { return color; }; virtual void show() { hidden = 0; }; virtual void hide() { hidden = 1; }; - QRect getBoundingBox(); + TQRect getBoundingBox(); // true when given coordinate point is inside the meters // active reagion and meter is enabled virtual bool insideActiveArea(int, int); // returns true when callback meterClicked should be called. - virtual bool click( QMouseEvent* ); + virtual bool click( TQMouseEvent* ); void setEnabled(bool); bool isEnabled(); /* - void setOnClick( QString ); - void setOnMiddleClick( QString ); + void setOnClick( TQString ); + void setOnMiddleClick( TQString ); */ protected: // Protected attributes - QString themePath; + TQString themePath; - QRect boundingBox; + TQRect boundingBox; // Actions to execute when clicked on meter - QString leftButtonAction; - QString middleButtonAction; - QString rightButtonAction; + TQString leftButtonAction; + TQString middleButtonAction; + TQString rightButtonAction; bool clickable; int hidden; long minValue; long maxValue; - QColor color; + TQColor color; karamba* m_karamba; }; diff --git a/superkaramba/src/meter_python.cpp b/superkaramba/src/meter_python.cpp index 029820d..b8e1153 100644 --- a/superkaramba/src/meter_python.cpp +++ b/superkaramba/src/meter_python.cpp @@ -13,7 +13,7 @@ #endif #include <Python.h> -#include <qobject.h> +#include <tqobject.h> #include "karamba.h" #include "karambaapp.h" #include "meter.h" @@ -36,7 +36,7 @@ bool checkKaramba(long widget) } if (!karambaApp->hasKaramba((karamba*)widget)) { - QString tmp; + TQString tmp; tmp.sprintf("no %x widget found.", (unsigned int)widget); PyErr_SetString(PyExc_ValueError, tmp.ascii()); @@ -54,15 +54,15 @@ bool checkMeter(long widget, long meter, const char* type) } if (!((karamba*)widget)->hasMeter((Meter*)meter)) { - QString tmp; + TQString tmp; tmp.sprintf("widget does not have meter %x.", (unsigned int)meter); PyErr_SetString(PyExc_ValueError, tmp.ascii()); return false; } - if (!((QObject*)meter)->isA(type)) + if (!((TQObject*)meter)->isA(type)) { - QString tmp; + TQString tmp; tmp.sprintf("meter is not type of %s.", type); PyErr_SetString(PyExc_TypeError, tmp.ascii()); @@ -78,21 +78,21 @@ bool checkKarambaAndMeter(long widget, long meter, const char* type) // This just throws awya extra bytes. // I guess there is a better way to do this... -QString fromUcs4(Q_UINT32* ucs4) +TQString fromUcs4(Q_UINT32* ucs4) { - QString result = ""; + TQString result = ""; while(*ucs4 != 0) { - result += QChar((Q_UINT16)*ucs4); + result += TQChar((Q_UINT16)*ucs4); ++ucs4; } return result; } -// Converts a Python String to a QString with Unicode support -QString PyString2QString(PyObject* text) +// Converts a Python String to a TQString with Unicode support +TQString PyString2TQString(PyObject* text) { - QString qtext; + TQString qtext; if (PyString_CheckExact(text)) { char* t = PyString_AsString(text); @@ -104,7 +104,7 @@ QString PyString2QString(PyObject* text) if(sizeof(Py_UNICODE) == 4) qtext = fromUcs4((Q_UINT32*)t); else - qtext = QString::fromUcs2((Q_UINT16*)t); + qtext = TQString::fromUcs2((Q_UINT16*)t); } else { @@ -113,8 +113,8 @@ QString PyString2QString(PyObject* text) return qtext; } -// Converts a QString to a Python String with Unicode support -PyObject* QString2PyString(QString string) +// Converts a TQString to a Python String with Unicode support +PyObject* QString2PyString(TQString string) { PyObject *pyString; @@ -157,7 +157,7 @@ PyObject* QString2PyString(QString string) long getMeter(long widget, char* name) { karamba* theme = (karamba*)widget; - QObjectListIt it( *theme->meterList ); // iterate over meters + TQObjectListIt it( *theme->meterList ); // iterate over meters while ( it != 0 ) { @@ -168,7 +168,7 @@ long getMeter(long widget, char* name) return 0; } -PyObject* py_getThemeMeter(PyObject *, PyObject *args, QString type) +PyObject* py_getThemeMeter(PyObject *, PyObject *args, TQString type) { long widget, meter; char* name; @@ -184,7 +184,7 @@ PyObject* py_getThemeMeter(PyObject *, PyObject *args, QString type) return (Py_BuildValue((char*)"l", meter)); } -PyObject* py_getSize(PyObject *, PyObject *args, QString type) +PyObject* py_getSize(PyObject *, PyObject *args, TQString type) { long widget; long meter; @@ -196,7 +196,7 @@ PyObject* py_getSize(PyObject *, PyObject *args, QString type) ((Meter*)meter)->getHeight()); } -PyObject* py_resize(PyObject *, PyObject *args, QString type) +PyObject* py_resize(PyObject *, PyObject *args, TQString type) { long widget, meter, x, y; if (!PyArg_ParseTuple(args, (char*)"llll", &widget, &meter, &x, &y)) @@ -208,7 +208,7 @@ PyObject* py_resize(PyObject *, PyObject *args, QString type) return Py_BuildValue((char*)"l", 1); } -PyObject* py_getPos(PyObject *, PyObject *args, QString type) +PyObject* py_getPos(PyObject *, PyObject *args, TQString type) { long widget, meter; if (!PyArg_ParseTuple(args, (char*)"ll", &widget, &meter)) @@ -219,7 +219,7 @@ PyObject* py_getPos(PyObject *, PyObject *args, QString type) ((Meter*)meter)->getY()); } -PyObject* py_move(PyObject *, PyObject *args, QString type) +PyObject* py_move(PyObject *, PyObject *args, TQString type) { long widget, meter, x, y; if (!PyArg_ParseTuple(args, (char*)"llll", &widget, &meter, &x, &y)) @@ -232,7 +232,7 @@ PyObject* py_move(PyObject *, PyObject *args, QString type) return Py_BuildValue((char*)"l", 1); } -PyObject* py_hide(PyObject *, PyObject *args, QString type) +PyObject* py_hide(PyObject *, PyObject *args, TQString type) { long widget, meter; if (!PyArg_ParseTuple(args, (char*)"ll", &widget, &meter)) @@ -243,7 +243,7 @@ PyObject* py_hide(PyObject *, PyObject *args, QString type) return Py_BuildValue((char*)"l", 1); } -PyObject* py_show(PyObject *, PyObject *args, QString type) +PyObject* py_show(PyObject *, PyObject *args, TQString type) { long widget, meter; if (!PyArg_ParseTuple(args, (char*)"ll", &widget, &meter)) @@ -254,7 +254,7 @@ PyObject* py_show(PyObject *, PyObject *args, QString type) return Py_BuildValue((char*)"l", 1); } -PyObject* py_getValue(PyObject *, PyObject *args, QString type) +PyObject* py_getValue(PyObject *, PyObject *args, TQString type) { long widget, meter; if (!PyArg_ParseTuple(args, (char*)"ll", &widget, &meter)) @@ -264,7 +264,7 @@ PyObject* py_getValue(PyObject *, PyObject *args, QString type) return Py_BuildValue((char*)"l", ((Meter*)meter)->getValue()); } -PyObject* py_setValue(PyObject *, PyObject *args, QString type) +PyObject* py_setValue(PyObject *, PyObject *args, TQString type) { long widget, meter, l; if (!PyArg_ParseTuple(args, (char*)"lll", &widget, &meter, &l)) @@ -275,7 +275,7 @@ PyObject* py_setValue(PyObject *, PyObject *args, QString type) return Py_BuildValue((char*)"l", ((long)meter)); } -PyObject* py_getStringValue(PyObject *, PyObject *args, QString type) +PyObject* py_getStringValue(PyObject *, PyObject *args, TQString type) { long widget, meter; if (!PyArg_ParseTuple(args, (char*)"ll", &widget, &meter)) @@ -286,7 +286,7 @@ PyObject* py_getStringValue(PyObject *, PyObject *args, QString type) QString2PyString(((Meter*)meter)->getStringValue())); } -PyObject* py_setStringValue(PyObject *, PyObject *args, QString type) +PyObject* py_setStringValue(PyObject *, PyObject *args, TQString type) { long widget, meter; PyObject* s; @@ -296,11 +296,11 @@ PyObject* py_setStringValue(PyObject *, PyObject *args, QString type) return NULL; if (!checkKarambaAndMeter(widget, meter, type.ascii())) return NULL; - ((Meter*)meter)->setValue(PyString2QString(s)); + ((Meter*)meter)->setValue(PyString2TQString(s)); return Py_BuildValue((char*)"l", ((long)meter)); } -PyObject* py_getMinMax(PyObject *, PyObject *args, QString type) +PyObject* py_getMinMax(PyObject *, PyObject *args, TQString type) { long widget, meter; if (!PyArg_ParseTuple(args, (char*)"ll", &widget, &meter)) @@ -311,7 +311,7 @@ PyObject* py_getMinMax(PyObject *, PyObject *args, QString type) ((Meter*)meter)->getMax()); } -PyObject* py_setMinMax(PyObject *, PyObject *args, QString type) +PyObject* py_setMinMax(PyObject *, PyObject *args, TQString type) { long widget, meter, x, y; if (!PyArg_ParseTuple(args, (char*)"llll", &widget, &meter, &x, &y)) @@ -323,10 +323,10 @@ PyObject* py_setMinMax(PyObject *, PyObject *args, QString type) return Py_BuildValue((char*)"l", 1); } -PyObject* py_getSensor(PyObject *, PyObject *args, QString type) +PyObject* py_getSensor(PyObject *, PyObject *args, TQString type) { long widget, meter; - QString s; + TQString s; if (!PyArg_ParseTuple(args, (char*)"ll", &widget, &meter)) return NULL; if (!checkKarambaAndMeter(widget, meter, type.ascii())) @@ -335,7 +335,7 @@ PyObject* py_getSensor(PyObject *, PyObject *args, QString type) ((karamba*)widget)->getSensor((Meter*)meter).ascii()); } -PyObject* py_setSensor(PyObject *, PyObject *args, QString type) +PyObject* py_setSensor(PyObject *, PyObject *args, TQString type) { long widget, meter; char* s; @@ -348,7 +348,7 @@ PyObject* py_setSensor(PyObject *, PyObject *args, QString type) return Py_BuildValue((char*)"l", 1); } -PyObject* py_setColor(PyObject *, PyObject *args, QString type) +PyObject* py_setColor(PyObject *, PyObject *args, TQString type) { long widget, meter; long r, g, b; @@ -356,18 +356,18 @@ PyObject* py_setColor(PyObject *, PyObject *args, QString type) return NULL; if (!checkKarambaAndMeter(widget, meter, type.ascii())) return NULL; - ((Meter*)meter)->setColor(QColor(r, g, b)); + ((Meter*)meter)->setColor(TQColor(r, g, b)); return Py_BuildValue((char*)"l", 1); } -PyObject* py_getColor(PyObject *, PyObject *args, QString type) +PyObject* py_getColor(PyObject *, PyObject *args, TQString type) { long widget, meter; if (!PyArg_ParseTuple(args, (char*)"ll", &widget, &meter)) return NULL; if (!checkKarambaAndMeter(widget, meter, type.ascii())) return NULL; - QColor color = ((Meter*)meter)->getColor(); + TQColor color = ((Meter*)meter)->getColor(); return Py_BuildValue((char*)"(i,i,i)", color.red(), color.green(), color.blue()); } diff --git a/superkaramba/src/meter_python.h b/superkaramba/src/meter_python.h index f064977..0773ee3 100644 --- a/superkaramba/src/meter_python.h +++ b/superkaramba/src/meter_python.h @@ -19,26 +19,26 @@ bool checkKaramba(long widget); bool checkMeter(long widget, long meter, const char* type); bool checkKarambaAndMeter(long widget, long meter, const char* type); -QString PyString2QString(PyObject* text); -PyObject* QString2PyString(QString string); +TQString PyString2TQString(PyObject* text); +PyObject* QString2PyString(TQString string); -PyObject* py_getThemeMeter(PyObject *self, PyObject *args, QString type); -PyObject* py_getSize(PyObject *self, PyObject *args, QString type); -PyObject* py_resize(PyObject *self, PyObject *args, QString type); -PyObject* py_getPos(PyObject *self, PyObject *args, QString type); -PyObject* py_move(PyObject *self, PyObject *args, QString type); -PyObject* py_hide(PyObject *self, PyObject *args, QString type); -PyObject* py_show(PyObject *self, PyObject *args, QString type); -PyObject* py_getValue(PyObject *self, PyObject *args, QString type); -PyObject* py_setValue(PyObject *self, PyObject *args, QString type); -PyObject* py_getStringValue(PyObject *self, PyObject *args, QString type); -PyObject* py_setStringValue(PyObject *self, PyObject *args, QString type); -PyObject* py_getMinMax(PyObject *self, PyObject *args, QString type); -PyObject* py_setMinMax(PyObject *self, PyObject *args, QString type); -PyObject* py_getSensor(PyObject *self, PyObject *args, QString type); -PyObject* py_setSensor(PyObject *self, PyObject *args, QString type); -PyObject* py_getColor(PyObject *self, PyObject *args, QString type); -PyObject* py_setColor(PyObject *self, PyObject *args, QString type); +PyObject* py_getThemeMeter(PyObject *self, PyObject *args, TQString type); +PyObject* py_getSize(PyObject *self, PyObject *args, TQString type); +PyObject* py_resize(PyObject *self, PyObject *args, TQString type); +PyObject* py_getPos(PyObject *self, PyObject *args, TQString type); +PyObject* py_move(PyObject *self, PyObject *args, TQString type); +PyObject* py_hide(PyObject *self, PyObject *args, TQString type); +PyObject* py_show(PyObject *self, PyObject *args, TQString type); +PyObject* py_getValue(PyObject *self, PyObject *args, TQString type); +PyObject* py_setValue(PyObject *self, PyObject *args, TQString type); +PyObject* py_getStringValue(PyObject *self, PyObject *args, TQString type); +PyObject* py_setStringValue(PyObject *self, PyObject *args, TQString type); +PyObject* py_getMinMax(PyObject *self, PyObject *args, TQString type); +PyObject* py_setMinMax(PyObject *self, PyObject *args, TQString type); +PyObject* py_getSensor(PyObject *self, PyObject *args, TQString type); +PyObject* py_setSensor(PyObject *self, PyObject *args, TQString type); +PyObject* py_getColor(PyObject *self, PyObject *args, TQString type); +PyObject* py_setColor(PyObject *self, PyObject *args, TQString type); #endif // METER_PYTHON_H diff --git a/superkaramba/src/misc_python.cpp b/superkaramba/src/misc_python.cpp index ba67573..891d53f 100644 --- a/superkaramba/src/misc_python.cpp +++ b/superkaramba/src/misc_python.cpp @@ -28,8 +28,8 @@ #endif #include <Python.h> -#include <qglobal.h> -#include <qobject.h> +#include <tqglobal.h> +#include <tqobject.h> #include <kglobal.h> #include <klocale.h> @@ -75,9 +75,9 @@ PyObject* py_run_command(PyObject*, PyObject* args) lst == NULL || !PyList_Check(lst)) return NULL; - QString n; - QString c; - QString i; + TQString n; + TQString c; + TQString i; n.setAscii(name); c.setAscii(command); @@ -88,7 +88,7 @@ PyObject* py_run_command(PyObject*, PyObject* args) for (int i = 0; i < PyList_Size(lst); i++) { - l.append(PyString2QString(PyList_GetItem(lst, i))); + l.append(PyString2TQString(PyList_GetItem(lst, i))); } KRun::run(svc, l); return Py_BuildValue("l", 1); @@ -101,7 +101,7 @@ PyObject* py_execute_command(PyObject *, PyObject* args) if (!PyArg_ParseTuple(args, (char*)"O:execute", &s)) return NULL; - return Py_BuildValue((char*)"l", KRun::runCommand(PyString2QString(s))); + return Py_BuildValue((char*)"l", KRun::runCommand(PyString2TQString(s))); } // Runs a command, returns 0 if it could not start command @@ -112,7 +112,7 @@ PyObject* py_execute_command_interactive(PyObject *, PyObject* args) // return NULL; int numLines; /* how many lines we passed for parsing */ - QString line; /* pointer to the line as a string */ + TQString line; /* pointer to the line as a string */ PyObject * listObj; /* the list of strings */ PyObject * strObj; /* one string in the list */ @@ -142,26 +142,26 @@ PyObject* py_execute_command_interactive(PyObject *, PyObject* args) strObj = PyList_GetItem(listObj, i); /* Can't fail */ /* make it a string */ - line = PyString2QString(strObj); + line = PyString2TQString(strObj); /* now do the parsing */ *(currTheme->currProcess) << line; } - QApplication::connect(currTheme->currProcess, - SIGNAL(processExited(KProcess *)), + TQApplication::connect(currTheme->currProcess, + TQT_SIGNAL(processExited(KProcess *)), currTheme, - SLOT(processExited(KProcess *))); - QApplication::connect(currTheme->currProcess, - SIGNAL(receivedStdout(KProcess *, char *, int)), + TQT_SLOT(processExited(KProcess *))); + TQApplication::connect(currTheme->currProcess, + TQT_SIGNAL(receivedStdout(KProcess *, char *, int)), currTheme, - SLOT(receivedStdout(KProcess *, char *, int))); + TQT_SLOT(receivedStdout(KProcess *, char *, int))); currTheme->currProcess->start(KProcess::NotifyOnExit, KProcess::Stdout); return Py_BuildValue((char*)"l", (int)(currTheme->currProcess->pid())); } -long attachClickArea(long widget, long meter, QString LeftButton, QString MiddleButton, QString RightButton) +long attachClickArea(long widget, long meter, TQString LeftButton, TQString MiddleButton, TQString RightButton) { karamba* currTheme = (karamba*) widget; Meter* currMeter = (Meter*) meter; @@ -212,7 +212,7 @@ PyObject* py_attach_clickArea(PyObject*, PyObject* args, PyObject* dict) return NULL; if (!checkKaramba(widget)) return NULL; - QString lB, mB, rB; + TQString lB, mB, rB; if (LeftButton != NULL) { lB.setAscii(LeftButton); @@ -342,7 +342,7 @@ PyObject* py_read_theme_file(PyObject *, PyObject *args) if (!checkKaramba(widget)) return NULL; karamba* k = (karamba*)widget; - QByteArray ba = k->theme().readThemeFile(file); + TQByteArray ba = k->theme().readThemeFile(file); return PyString_FromStringAndSize(ba.data(), ba.size()); } @@ -363,9 +363,9 @@ long createServiceClickArea(long widget, long x, long y, long w, long h, char *n karamba* currTheme = (karamba*)widget; ClickArea *tmp = new ClickArea( currTheme, x, y, w, h ); - QString n; - QString e; - QString i; + TQString n; + TQString e; + TQString i; n.setAscii(name); e.setAscii(exec); @@ -381,7 +381,7 @@ long createClickArea(long widget, long x, long y, long w, long h, char* text) { karamba* currTheme = (karamba*)widget; ClickArea *tmp = new ClickArea(currTheme, x, y, w, h ); - QString onclick; + TQString onclick; onclick.setAscii(text); @@ -428,7 +428,7 @@ static long callTheme(long widget, char* path, char *str) karamba* currTheme = (karamba*) widget; if (currTheme) - currTheme->callTheme(QString(path), QString(str)); + currTheme->callTheme(TQString(path), TQString(str)); return (long)currTheme; } @@ -438,19 +438,19 @@ static long setIncomingData(long widget, char* path, char *obj) karamba* currTheme = (karamba*) widget; if (currTheme) - currTheme->setIncomingData(QString(path), QString(obj)); + currTheme->setIncomingData(TQString(path), TQString(obj)); return (long)currTheme; } -static QString getIncomingData(long widget) +static TQString getIncomingData(long widget) { karamba* currTheme = (karamba*) widget; if (currTheme) return currTheme->getIncomingData(); - return QString(""); + return TQString(""); } /* @@ -461,16 +461,16 @@ static QString getIncomingData(long widget) */ long openNamedTheme(char* path, char *name, bool is_sub_theme) { - QString filename; + TQString filename; karamba* currTheme = 0; filename.setAscii(path); - QFileInfo file( filename ); + TQFileInfo file( filename ); if( file.exists() ) { - QCString prettyName(name); + TQCString prettyName(name); KarambaApplication* app = (KarambaApplication*)qApp; if (!app->themeExists(prettyName)) { @@ -486,16 +486,16 @@ long openNamedTheme(char* path, char *name, bool is_sub_theme) { long openTheme(char* path) { - QString filename; + TQString filename; karamba* currTheme = 0; filename.setAscii(path); - QFileInfo file( filename ); + TQFileInfo file( filename ); if( file.exists() ) { - currTheme = new karamba( filename, QString() ); + currTheme = new karamba( filename, TQString() ); currTheme->show(); } @@ -582,7 +582,7 @@ int translateAll(long widget, int x, int y) { karamba* currTheme = (karamba*)widget; - QObjectListIt it2( *currTheme->meterList ); // iterate over meters + TQObjectListIt it2( *currTheme->meterList ); // iterate over meters while ( it2 != 0 ) { @@ -660,7 +660,7 @@ PyObject* py_hide(PyObject *, PyObject *args) #include <sys/sockio.h> #endif /* now a method we need to expose to Python */ -QString getIp(char *device_name) +TQString getIp(char *device_name) { int i, sd, numdevs; struct ifconf ifc_conf; @@ -668,7 +668,7 @@ QString getIp(char *device_name) struct ifreq *devptr; int ifc_conf_buf_size; static struct in_addr host; - QString retval; + TQString retval; retval = "Disconnected"; diff --git a/superkaramba/src/networksensor.cpp b/superkaramba/src/networksensor.cpp index 30f9612..09de816 100644 --- a/superkaramba/src/networksensor.cpp +++ b/superkaramba/src/networksensor.cpp @@ -16,7 +16,7 @@ #include "networksensor.h" -NetworkSensor::NetworkSensor( QString dev, int interval ):Sensor( interval ) +NetworkSensor::NetworkSensor( TQString dev, int interval ):Sensor( interval ) { device = dev.lower(); @@ -50,7 +50,7 @@ NetworkSensor::NetworkSensor( QString dev, int interval ):Sensor( interval ) sysctl(name, 6, (void*)&if_mib, (size_t*)&if_miblen, (void*)NULL, (size_t)0); /* We found the right interface? */ - if (QString(if_mib.ifmd_name) == device) { + if (TQString(if_mib.ifmd_name) == device) { if_number = i; break; } @@ -96,11 +96,11 @@ void NetworkSensor::getInOutBytes ( unsigned long &in,unsigned long &out) const out = 0; } #else - QFile file("/proc/net/dev"); - QString line; + TQFile file("/proc/net/dev"); + TQString line; if ( file.open(IO_ReadOnly | IO_Translate) ) { - QTextStream t( &file ); // use a text stream + TQTextStream t( &file ); // use a text stream line = t.readLine(); while(line !=0 && !line.contains(device)) { @@ -108,7 +108,7 @@ void NetworkSensor::getInOutBytes ( unsigned long &in,unsigned long &out) const } if ( line.contains( device ) ) { - QRegExp rx( "\\W+"+device+":\\D*(\\d+)(?:\\D+\\d+){7}\\D+(\\d+)", false); + TQRegExp rx( "\\W+"+device+":\\D*(\\d+)(?:\\D+\\d+){7}\\D+(\\d+)", false); rx.search(line); in = rx.cap(1).toULong(); out = rx.cap(2).toULong(); @@ -128,8 +128,8 @@ void NetworkSensor::update() { SensorParams *sp; Meter *meter; - QObjectListIt it( *objList ); - QString format; + TQObjectListIt it( *objList ); + TQString format; int decimals; unsigned long inB, outB; @@ -148,11 +148,11 @@ void NetworkSensor::update() format = "%in"; } - format.replace( QRegExp("%inkb", false), QString::number( ((inB - receivedBytes)*8)/delay, 'f', decimals ) ); - format.replace( QRegExp("%in", false), QString::number( (inB - receivedBytes)/delay, 'f', decimals ) ); + format.replace( TQRegExp("%inkb", false), TQString::number( ((inB - receivedBytes)*8)/delay, 'f', decimals ) ); + format.replace( TQRegExp("%in", false), TQString::number( (inB - receivedBytes)/delay, 'f', decimals ) ); - format.replace( QRegExp("%outkb", false), QString::number( ((outB - transmittedBytes)*8)/delay, 'f', decimals ) ); - format.replace( QRegExp("%out", false), QString::number( (outB - transmittedBytes)/delay, 'f', decimals ) ); + format.replace( TQRegExp("%outkb", false), TQString::number( ((outB - transmittedBytes)*8)/delay, 'f', decimals ) ); + format.replace( TQRegExp("%out", false), TQString::number( (outB - transmittedBytes)/delay, 'f', decimals ) ); meter->setValue( format ); ++it; diff --git a/superkaramba/src/networksensor.h b/superkaramba/src/networksensor.h index bbdbd13..90878a8 100644 --- a/superkaramba/src/networksensor.h +++ b/superkaramba/src/networksensor.h @@ -12,9 +12,9 @@ #include "sensor.h" -#include <qdatetime.h> -#include <qfile.h> -#include <qregexp.h> +#include <tqdatetime.h> +#include <tqfile.h> +#include <tqregexp.h> #ifdef __FreeBSD__ #include <sys/types.h> #include <sys/socket.h> @@ -26,7 +26,7 @@ class NetworkSensor : public Sensor { Q_OBJECT public: - NetworkSensor( QString device, int interval ); + NetworkSensor( TQString device, int interval ); ~NetworkSensor(); void update(); @@ -34,8 +34,8 @@ public: private: unsigned long receivedBytes; unsigned long transmittedBytes; - QTime netTimer; - QString device; + TQTime netTimer; + TQString device; #ifdef __FreeBSD__ int if_number; ifmibdata if_mib; diff --git a/superkaramba/src/noatunsensor.cpp b/superkaramba/src/noatunsensor.cpp index 607da9e..57f25f1 100644 --- a/superkaramba/src/noatunsensor.cpp +++ b/superkaramba/src/noatunsensor.cpp @@ -23,12 +23,12 @@ NoatunSensor::~NoatunSensor() void NoatunSensor::update() { - QString format; + TQString format; SensorParams *sp; Meter *meter; - QObjectListIt it( *objList ); + TQObjectListIt it( *objList ); - QString title; + TQString title; int songLength = 0; int currentTime = 0; @@ -77,17 +77,17 @@ void NoatunSensor::update() else { - format.replace( QRegExp("%title", false), title ); - format.replace( QRegExp("%id", false), noatunID ); + format.replace( TQRegExp("%title", false), title ); + format.replace( TQRegExp("%id", false), noatunID ); - format.replace( QRegExp("%length", false), QTime( 0,0,0 ). + format.replace( TQRegExp("%length", false), TQTime( 0,0,0 ). addMSecs( songLength ) .toString( "h:mm:ss" ) ); - format.replace( QRegExp("%time", false), QTime( 0,0,0 ). + format.replace( TQRegExp("%time", false), TQTime( 0,0,0 ). addMSecs( currentTime ) .toString( "h:mm:ss" ) ); - format.replace( QRegExp("%remain", false), QTime( 0,0,0 ). + format.replace( TQRegExp("%remain", false), TQTime( 0,0,0 ). addMSecs( songLength ) .addMSecs(-currentTime ) .toString( "h:mm:ss" ) ); @@ -109,9 +109,9 @@ void NoatunSensor::update() bool NoatunSensor::isRunning() { - QRegExp rx("(noatun)|(noatun-\\d+)"); + TQRegExp rx("(noatun)|(noatun-\\d+)"); QCStringList list = client->registeredApplications(); - QValueList<QCString>::iterator it; + TQValueList<TQCString>::iterator it; it = list.begin(); bool foundNoatun = false; noatunID = "noatun"; @@ -128,12 +128,12 @@ bool NoatunSensor::isRunning() } -QString NoatunSensor::getTitle() +TQString NoatunSensor::getTitle() { - QByteArray data, replyData; - QCString replyType; - QString result; - QDataStream arg(data, IO_WriteOnly); + TQByteArray data, replyData; + TQCString replyType; + TQString result; + TQDataStream arg(data, IO_WriteOnly); arg << 5; if (!client->call( noatunID, "Noatun", "title()", data, replyType, replyData)) @@ -143,12 +143,12 @@ QString NoatunSensor::getTitle() } else { - QDataStream reply(replyData, IO_ReadOnly); - if (replyType == "QString") + TQDataStream reply(replyData, IO_ReadOnly); + if (replyType == "TQString") { reply >> result; - result.replace( QRegExp("_")," " ); - result.replace( QRegExp(".mp3$"),"" ); + result.replace( TQRegExp("_")," " ); + result.replace( TQRegExp(".mp3$"),"" ); } else @@ -163,10 +163,10 @@ QString NoatunSensor::getTitle() int NoatunSensor::getTime() { - QByteArray data, replyData; - QCString replyType; + TQByteArray data, replyData; + TQCString replyType; int result; - QDataStream arg(data, IO_WriteOnly); + TQDataStream arg(data, IO_WriteOnly); arg << 5; if (!client->call( noatunID, "Noatun", "position()", data, replyType, replyData)) @@ -176,7 +176,7 @@ int NoatunSensor::getTime() } else { - QDataStream reply(replyData, IO_ReadOnly); + TQDataStream reply(replyData, IO_ReadOnly); if (replyType == "int") { reply >> result; @@ -193,10 +193,10 @@ int NoatunSensor::getTime() int NoatunSensor::getLength() { - QByteArray data, replyData; - QCString replyType; + TQByteArray data, replyData; + TQCString replyType; int result; - QDataStream arg(data, IO_WriteOnly); + TQDataStream arg(data, IO_WriteOnly); arg << 5; if (!client->call( noatunID, "Noatun", "length()", data, replyType, replyData)) @@ -206,7 +206,7 @@ int NoatunSensor::getLength() } else { - QDataStream reply(replyData, IO_ReadOnly); + TQDataStream reply(replyData, IO_ReadOnly); if (replyType == "int") { reply >> result; @@ -225,7 +225,7 @@ void NoatunSensor::setMaxValue( SensorParams *sp) { Meter *meter; meter = sp->getMeter(); - QString f; + TQString f; f = sp->getParam("FORMAT"); if ( f == "%full" ) diff --git a/superkaramba/src/noatunsensor.h b/superkaramba/src/noatunsensor.h index 7d43b96..e605024 100644 --- a/superkaramba/src/noatunsensor.h +++ b/superkaramba/src/noatunsensor.h @@ -12,10 +12,10 @@ #include "sensor.h" #include <dcopclient.h> -#include <qregexp.h> -#include <qcstring.h> -#include <qdatastream.h> -#include <qstringlist.h> +#include <tqregexp.h> +#include <tqcstring.h> +#include <tqdatastream.h> +#include <tqstringlist.h> /** @author Hans Karlsson @@ -33,16 +33,16 @@ public: private: - QCString noatunID; + TQCString noatunID; bool isRunning(); - QString getTitle(); + TQString getTitle(); int getTime(); int getLength(); DCOPClient *client; - QCString appId; + TQCString appId; }; #endif diff --git a/superkaramba/src/programsensor.cpp b/superkaramba/src/programsensor.cpp index a3bddc5..1118d2d 100644 --- a/superkaramba/src/programsensor.cpp +++ b/superkaramba/src/programsensor.cpp @@ -9,26 +9,26 @@ ***************************************************************************/ #include "programsensor.h" -#include <qstringlist.h> -ProgramSensor::ProgramSensor(const QString &progName, int interval, QString encoding ) +#include <tqstringlist.h> +ProgramSensor::ProgramSensor(const TQString &progName, int interval, TQString encoding ) : Sensor( interval ) { if( !encoding.isEmpty()) { - codec = QTextCodec::codecForName( encoding.ascii() ); + codec = TQTextCodec::codecForName( encoding.ascii() ); if ( codec == 0) - codec = QTextCodec::codecForLocale(); + codec = TQTextCodec::codecForLocale(); } else - codec = QTextCodec::codecForLocale(); + codec = TQTextCodec::codecForLocale(); programName = progName; //update(); - connect(&ksp, SIGNAL(receivedStdout(KProcess *, char *, int )), - this,SLOT(receivedStdout(KProcess *, char *, int ))); - connect(&ksp, SIGNAL(processExited(KProcess *)), - this,SLOT(processExited( KProcess * ))); + connect(&ksp, TQT_SIGNAL(receivedStdout(KProcess *, char *, int )), + this,TQT_SLOT(receivedStdout(KProcess *, char *, int ))); + connect(&ksp, TQT_SIGNAL(processExited(KProcess *)), + this,TQT_SLOT(processExited( KProcess * ))); } ProgramSensor::~ProgramSensor() @@ -37,7 +37,7 @@ ProgramSensor::~ProgramSensor() void ProgramSensor::receivedStdout(KProcess *, char *buffer, int len) { buffer[len] = 0; - sensorResult += codec->toUnicode( QCString(buffer) ); + sensorResult += codec->toUnicode( TQCString(buffer) ); } void ProgramSensor::processExited(KProcess *) @@ -45,16 +45,16 @@ void ProgramSensor::processExited(KProcess *) int lineNbr; SensorParams *sp; Meter *meter; - QValueVector<QString> lines; - QStringList stringList = QStringList::split('\n',sensorResult,true); - QStringList::ConstIterator end( stringList.end() ); - for ( QStringList::ConstIterator it = stringList.begin(); it != end; ++it ) + TQValueVector<TQString> lines; + TQStringList stringList = TQStringList::split('\n',sensorResult,true); + TQStringList::ConstIterator end( stringList.end() ); + for ( TQStringList::ConstIterator it = stringList.begin(); it != end; ++it ) { lines.push_back(*it); } int count = (int) lines.size(); - QObjectListIt it( *objList ); + TQObjectListIt it( *objList ); while (it != 0) { sp = (SensorParams*)(*it); diff --git a/superkaramba/src/programsensor.h b/superkaramba/src/programsensor.h index 1ee7407..d016a81 100644 --- a/superkaramba/src/programsensor.h +++ b/superkaramba/src/programsensor.h @@ -12,23 +12,23 @@ #include "sensor.h" #include <kprocess.h> #include <kprocio.h> -#include <qstring.h> -#include <qstringlist.h> -#include <qvaluevector.h> -#include <qtextcodec.h> +#include <tqstring.h> +#include <tqstringlist.h> +#include <tqvaluevector.h> +#include <tqtextcodec.h> class ProgramSensor : public Sensor { Q_OBJECT public: - ProgramSensor(const QString &programName, int msec=1000, QString encoding="" ); + ProgramSensor(const TQString &programName, int msec=1000, TQString encoding="" ); ~ProgramSensor(); void update(); private: - QTextCodec *codec; + TQTextCodec *codec; KShellProcess ksp; - QString programName; - QString sensorResult; + TQString programName; + TQString sensorResult; public slots: void receivedStdout(KProcess *proc, char *buffer, int buflen); diff --git a/superkaramba/src/richtextlabel.cpp b/superkaramba/src/richtextlabel.cpp index 9a8fee0..ba7ab11 100644 --- a/superkaramba/src/richtextlabel.cpp +++ b/superkaramba/src/richtextlabel.cpp @@ -20,7 +20,7 @@ RichTextLabel::RichTextLabel(karamba* k) : colorGrp(k->colorGroup()), underlineLinks(false) { - originalSize = QSize(0, 0); + originalSize = TQSize(0, 0); } RichTextLabel::RichTextLabel(karamba* k, int x, int y, int w, int h) : @@ -31,7 +31,7 @@ RichTextLabel::RichTextLabel(karamba* k, int x, int y, int w, int h) : underlineLinks(false) { kdDebug() << k_funcinfo << x << ", " << y << ", " << w << ", " << h << endl; - originalSize = QSize(w, h); + originalSize = TQSize(w, h); } RichTextLabel::~RichTextLabel() @@ -43,7 +43,7 @@ RichTextLabel::~RichTextLabel() } } -void RichTextLabel::setText(QString t, bool linkUnderline) +void RichTextLabel::setText(TQString t, bool linkUnderline) { source = t; if (text != 0) @@ -58,8 +58,8 @@ void RichTextLabel::setText(QString t, bool linkUnderline) underlineLinks = linkUnderline; } - text = new QSimpleRichText(t, font, m_karamba->theme().path(), - 0, // default QStyleSheet* + text = new TQSimpleRichText(t, font, m_karamba->theme().path(), + 0, // default TQStyleSheet* 0, // default QMimeSourceFactory -1, // no pageBreak Qt::blue, // (has no effect) link Color @@ -75,24 +75,24 @@ void RichTextLabel::setText(QString t, bool linkUnderline) setHeight(text->height()); } -void RichTextLabel::setValue(QString text) +void RichTextLabel::setValue(TQString text) { setText(text); } void RichTextLabel::setValue(long v) { - setText(QString::number(v)); + setText(TQString::number(v)); } -void RichTextLabel::setFont(QString f) +void RichTextLabel::setFont(TQString f) { font.setFamily(f); if(text != 0) text->setDefaultFont(font); } -QString RichTextLabel::getFont() const +TQString RichTextLabel::getFont() const { return font.family(); } @@ -127,7 +127,7 @@ void RichTextLabel::setTextProps(TextField* t) { setFontSize(t->getFontSize()); setFont(t->getFont()); - colorGrp.setColor(QColorGroup::Text, t->getColor()); + colorGrp.setColor(TQColorGroup::Text, t->getColor()); } } @@ -140,7 +140,7 @@ void RichTextLabel::setWidth(int width) setHeight(text->height()); } -void RichTextLabel::mUpdate(QPainter* p) +void RichTextLabel::mUpdate(TQPainter* p) { if (hidden || text == 0) { @@ -151,18 +151,18 @@ void RichTextLabel::mUpdate(QPainter* p) int y = getY(); int w = getWidth(); int h = getHeight(); - QRect clipRect(x, y, w, h); + TQRect clipRect(x, y, w, h); text->draw(p, x, y, clipRect, colorGrp, 0 /* no background */); } -bool RichTextLabel::click(QMouseEvent* e) +bool RichTextLabel::click(TQMouseEvent* e) { if (hidden) { return false; } - QPoint point(e->x() - getX(), e->y() - getY()); - QString anchor = text->anchorAt(point); + TQPoint point(e->x() - getX(), e->y() - getY()); + TQString anchor = text->anchorAt(point); if (anchor[0] != '#') { if (e->button() == Qt::LeftButton) @@ -178,10 +178,10 @@ bool RichTextLabel::click(QMouseEvent* e) } } -QString RichTextLabel::anchorAt(int x, int y) +TQString RichTextLabel::anchorAt(int x, int y) { - QPoint point(x - getX(), y - getY()); - QString anchor = text->anchorAt(point); + TQPoint point(x - getX(), y - getY()); + TQString anchor = text->anchorAt(point); if (anchor[0] == '#') { return anchor.remove(0, 1); @@ -195,16 +195,16 @@ QString RichTextLabel::anchorAt(int x, int y) bool RichTextLabel::insideActiveArea(int x, int y) { - QPoint point(x - getX(), y - getY()); + TQPoint point(x - getX(), y - getY()); return text->anchorAt(point) != ""; // && text -> inText(point); } -void RichTextLabel::setColorGroup(const QColorGroup &colorg) +void RichTextLabel::setColorGroup(const TQColorGroup &colorg) { colorGrp = colorg; } -const QColorGroup & RichTextLabel::getColorGroup() const +const TQColorGroup & RichTextLabel::getColorGroup() const { return colorGrp; } diff --git a/superkaramba/src/richtextlabel.h b/superkaramba/src/richtextlabel.h index 810b129..4a6eb69 100644 --- a/superkaramba/src/richtextlabel.h +++ b/superkaramba/src/richtextlabel.h @@ -12,13 +12,13 @@ #define RICHTEXTLABEL_H #include "meter.h" -#include <qstring.h> -#include <qsimplerichtext.h> -#include <qpainter.h> -#include <qfont.h> -#include <qfontmetrics.h> -#include <qrect.h> -#include <qsize.h> +#include <tqstring.h> +#include <tqsimplerichtext.h> +#include <tqpainter.h> +#include <tqfont.h> +#include <tqfontmetrics.h> +#include <tqrect.h> +#include <tqsize.h> #include "karamba.h" class RichTextLabel : public Meter @@ -29,36 +29,36 @@ class RichTextLabel : public Meter RichTextLabel(karamba* k, int x, int y, int w, int h); ~RichTextLabel(); - void setText(QString text, bool linkUnderline = false); - void setValue(QString text); + void setText(TQString text, bool linkUnderline = false); + void setValue(TQString text); void setValue(long v); - QString getStringValue() { return source; }; + TQString getStringValue() { return source; }; - void setFont(QString font); - QString getFont() const; + void setFont(TQString font); + TQString getFont() const; void setFontSize(int); int getFontSize() const; void setFixedPitch(bool); bool getFixedPitch() const; void setTextProps( TextField* t ); - void setColorGroup(const QColorGroup &colorg); - const QColorGroup &getColorGroup() const; + void setColorGroup(const TQColorGroup &colorg); + const TQColorGroup &getColorGroup() const; void setWidth(int width); virtual bool insideActiveArea(int, int); - virtual bool click(QMouseEvent*); - virtual void mUpdate(QPainter*); + virtual bool click(TQMouseEvent*); + virtual void mUpdate(TQPainter*); - QString anchorAt(int, int); + TQString anchorAt(int, int); private: - QSimpleRichText* text; - QString source; - QFont font; - QColorGroup colorGrp; + TQSimpleRichText* text; + TQString source; + TQFont font; + TQColorGroup colorGrp; bool underlineLinks; - QSize originalSize; + TQSize originalSize; }; #endif diff --git a/superkaramba/src/richtextlabel_python.cpp b/superkaramba/src/richtextlabel_python.cpp index 7ac14cd..beadc81 100644 --- a/superkaramba/src/richtextlabel_python.cpp +++ b/superkaramba/src/richtextlabel_python.cpp @@ -27,7 +27,7 @@ #endif #include <Python.h> -#include <qobject.h> +#include <tqobject.h> #include "karamba.h" #include "richtextlabel.h" #include "meter_python.h" @@ -43,7 +43,7 @@ PyObject* py_createRichText(PyObject *, PyObject *args) if (!checkKaramba(widget)) return NULL; RichTextLabel *tmp = new RichTextLabel((karamba*)widget); - tmp->setText(PyString2QString(text), underline); + tmp->setText(PyString2TQString(text), underline); tmp->setTextProps(((karamba*)widget)->getDefaultTextProps()); ((karamba*)widget)->meterList->append(tmp); ((karamba*)widget)->clickList->append(tmp); diff --git a/superkaramba/src/rsssensor.cpp b/superkaramba/src/rsssensor.cpp index 1477062..5a999ec 100644 --- a/superkaramba/src/rsssensor.cpp +++ b/superkaramba/src/rsssensor.cpp @@ -10,12 +10,12 @@ #include "karambaapp.h" #include "rsssensor.h" -#include <qdom.h> -#include <qregexp.h> +#include <tqdom.h> +#include <tqregexp.h> #include <kurl.h> #include <kio/netaccess.h> -RssSensor::RssSensor( const QString &src, int interval, const QString &form, const QString &enc) +RssSensor::RssSensor( const TQString &src, int interval, const TQString &form, const TQString &enc) : Sensor(interval), source(src), format(form), @@ -28,12 +28,12 @@ RssSensor::RssSensor( const QString &src, int interval, const QString &form, con if( !encoding.isEmpty() ) { - codec = QTextCodec::codecForName( encoding.ascii() ); + codec = TQTextCodec::codecForName( encoding.ascii() ); if ( codec == 0) - codec = QTextCodec::codecForLocale(); + codec = TQTextCodec::codecForLocale(); } else - codec = QTextCodec::codecForLocale(); + codec = TQTextCodec::codecForLocale(); } RssSensor::~RssSensor() @@ -42,9 +42,9 @@ RssSensor::~RssSensor() void RssSensor::update() { - QDomDocument doc; - QFile file; - QString tmpFile; + TQDomDocument doc; + TQFile file; + TQString tmpFile; bool OK = false; #if defined(KDE_3_3) @@ -79,7 +79,7 @@ void RssSensor::update() SensorParams *sp; Meter *meter; - QObjectListIt it( *objList ); + TQObjectListIt it( *objList ); while (it != 0) { sp = (SensorParams*)(*it); @@ -89,12 +89,12 @@ void RssSensor::update() // clickmap to reset its data lists meter->setValue(0); - QDomElement docElem = doc.documentElement(); - QDomNode n = docElem.firstChild(); + TQDomElement docElem = doc.documentElement(); + TQDomNode n = docElem.firstChild(); if (!n.isNull()) { - QDomNodeList links = docElem.elementsByTagName( "link" ); - QDomNodeList displays; + TQDomNodeList links = docElem.elementsByTagName( "link" ); + TQDomNodeList displays; if ( format.contains( "%d", false ) > 0 ) { displays = docElem.elementsByTagName( "description" ); @@ -104,11 +104,11 @@ void RssSensor::update() displays = docElem.elementsByTagName( "title" ); } - QRegExp rx("^http://", false ); + TQRegExp rx("^http://", false ); for (uint i=1; i < displays.count(); ++i ) { - QString dispTxt = displays.item( i ).toElement().text(); - QString linkTxt = links.item( i ).toElement().text(); + TQString dispTxt = displays.item( i ).toElement().text(); + TQString linkTxt = links.item( i ).toElement().text(); if( (rx.search(dispTxt) == -1) && (rx.search(linkTxt) != -1) ) { meter->setValue( dispTxt ); diff --git a/superkaramba/src/rsssensor.h b/superkaramba/src/rsssensor.h index d896d04..f567c0d 100644 --- a/superkaramba/src/rsssensor.h +++ b/superkaramba/src/rsssensor.h @@ -12,8 +12,8 @@ #define RSSSENSOR_H #include <sensor.h> -#include <qstring.h> -#include <qtextcodec.h> +#include <tqstring.h> +#include <tqtextcodec.h> /** * @@ -23,16 +23,16 @@ class RssSensor : public Sensor { Q_OBJECT public: - RssSensor( const QString &source, int interval, const QString &format, const QString &encoding=QString::null ); + RssSensor( const TQString &source, int interval, const TQString &format, const TQString &encoding=TQString::null ); ~RssSensor(); void update(); private: - QTextCodec *codec; - QString source; - QString format; - QString encoding; + TQTextCodec *codec; + TQString source; + TQString format; + TQString encoding; }; diff --git a/superkaramba/src/sensor.cpp b/superkaramba/src/sensor.cpp index 6aba5d2..378cb1d 100644 --- a/superkaramba/src/sensor.cpp +++ b/superkaramba/src/sensor.cpp @@ -10,7 +10,7 @@ #include "sensor.h" Sensor::Sensor(int iMsec) { - objList = new QObjectList(); + objList = new TQObjectList(); objList->setAutoDelete( true ); msec = iMsec; } @@ -19,7 +19,7 @@ void Sensor::start() { if (!timer.isActive()) { - connect (&timer,SIGNAL(timeout()),this,SLOT(update())); + connect (&timer,TQT_SIGNAL(timeout()),this,TQT_SLOT(update())); timer.start( (msec == 0)?1000:msec); } } @@ -37,7 +37,7 @@ void Sensor::addMeter( SensorParams *sp ) SensorParams* Sensor::hasMeter( Meter *meter ) { - QObjectListIt it( *objList ); + TQObjectListIt it( *objList ); while ( it != 0 ) { if (((SensorParams*) *it)->getMeter() == meter) diff --git a/superkaramba/src/sensor.h b/superkaramba/src/sensor.h index d7368b0..ee48c98 100644 --- a/superkaramba/src/sensor.h +++ b/superkaramba/src/sensor.h @@ -9,12 +9,12 @@ ***************************************************************************/ #ifndef SENSOR_H #define SENSOR_H -#include <qstring.h> -#include <qobject.h> -#include <qobjectlist.h> -#include <qstringlist.h> -#include <qmap.h> -#include <qtimer.h> +#include <tqstring.h> +#include <tqobject.h> +#include <tqobjectlist.h> +#include <tqstringlist.h> +#include <tqmap.h> +#include <tqtimer.h> #include "sensorparams.h" @@ -34,10 +34,10 @@ public: private: int msec; - QTimer timer; + TQTimer timer; protected: - QObjectList *objList; + TQObjectList *objList; public slots: virtual void update()=0; diff --git a/superkaramba/src/sensorparams.cpp b/superkaramba/src/sensorparams.cpp index 954b2d5..bcccc20 100644 --- a/superkaramba/src/sensorparams.cpp +++ b/superkaramba/src/sensorparams.cpp @@ -19,11 +19,11 @@ SensorParams::~SensorParams() { } -void SensorParams::addParam( const QString &name, const QString &value){ +void SensorParams::addParam( const TQString &name, const TQString &value){ params[name] = value; } -QString SensorParams::getParam( const QString &name ) const +TQString SensorParams::getParam( const TQString &name ) const { return params[name]; } diff --git a/superkaramba/src/sensorparams.h b/superkaramba/src/sensorparams.h index 24f0fae..1de515a 100644 --- a/superkaramba/src/sensorparams.h +++ b/superkaramba/src/sensorparams.h @@ -22,8 +22,8 @@ #define SENSORPARAMS_H #include "meter.h" -#include <qstring.h> -#include <qmap.h> +#include <tqstring.h> +#include <tqmap.h> /** * * Hans Karlsson @@ -35,13 +35,13 @@ public: ~SensorParams(); - void addParam( const QString &name, const QString &value); - QString getParam( const QString& ) const; + void addParam( const TQString &name, const TQString &value); + TQString getParam( const TQString& ) const; Meter* getMeter() const; private: Meter *meter; -QMap<QString,QString> params; +TQMap<TQString,TQString> params; }; diff --git a/superkaramba/src/sensorsensor.cpp b/superkaramba/src/sensorsensor.cpp index 9ff0d47..ed6934e 100644 --- a/superkaramba/src/sensorsensor.cpp +++ b/superkaramba/src/sensorsensor.cpp @@ -8,7 +8,7 @@ * (at your option) any later version. * ***************************************************************************/ #include "sensorsensor.h" -#include <qglobal.h> +#include <tqglobal.h> SensorSensor::SensorSensor(int interval, char tempUnit) : Sensor( interval ) { @@ -29,10 +29,10 @@ SensorSensor::SensorSensor(int interval, char tempUnit) : Sensor( interval ) #endif if(tempUnit == 'F') extraParams = " -f"; - connect(&ksp, SIGNAL(receivedStdout(KProcess *, char *, int )), - this,SLOT(receivedStdout(KProcess *, char *, int ))); - connect(&ksp, SIGNAL(processExited(KProcess *)), - this,SLOT(processExited( KProcess * ))); + connect(&ksp, TQT_SIGNAL(receivedStdout(KProcess *, char *, int )), + this,TQT_SLOT(receivedStdout(KProcess *, char *, int ))); + connect(&ksp, TQT_SIGNAL(processExited(KProcess *)), + this,TQT_SLOT(processExited( KProcess * ))); // readValues(); } @@ -45,18 +45,18 @@ SensorSensor::~SensorSensor() void SensorSensor::receivedStdout(KProcess *, char *buffer, int len ) { buffer[len] = 0; - sensorResult += QString( QCString(buffer) ); + sensorResult += TQString( TQCString(buffer) ); } void SensorSensor::processExited(KProcess *) { - QStringList stringList = QStringList::split('\n',sensorResult); + TQStringList stringList = TQStringList::split('\n',sensorResult); sensorResult = ""; - QStringList::Iterator it = stringList.begin(); + TQStringList::Iterator it = stringList.begin(); #if defined __FreeBSD__ || defined(Q_OS_NETBSD) - QRegExp rx( "^(\\S+)\\s+:\\s+[\\+\\-]?(\\d+\\.?\\d*)"); + TQRegExp rx( "^(\\S+)\\s+:\\s+[\\+\\-]?(\\d+\\.?\\d*)"); #else - QRegExp rx( "^(.+):\\s+[\\+\\-]?(\\d+\\.?\\d*)"); + TQRegExp rx( "^(.+):\\s+[\\+\\-]?(\\d+\\.?\\d*)"); #endif while( it != stringList.end()) { @@ -69,12 +69,12 @@ void SensorSensor::processExited(KProcess *) it++; } - QString format; - QString type; + TQString format; + TQString type; SensorParams *sp; Meter *meter; - QObjectListIt lit( *objList ); + TQObjectListIt lit( *objList ); while (lit != 0) { sp = (SensorParams*)(*lit); @@ -91,9 +91,9 @@ void SensorSensor::processExited(KProcess *) } #if defined __FreeBSD__ || defined(Q_OS_NETBSD) - format.replace( QRegExp("%v", false), sensorMap[sensorMapBSD[type]]); + format.replace( TQRegExp("%v", false), sensorMap[sensorMapBSD[type]]); #else - format.replace( QRegExp("%v", false), sensorMap[type]); + format.replace( TQRegExp("%v", false), sensorMap[type]); #endif meter->setValue(format); ++lit; diff --git a/superkaramba/src/sensorsensor.h b/superkaramba/src/sensorsensor.h index 82adf10..6201660 100644 --- a/superkaramba/src/sensorsensor.h +++ b/superkaramba/src/sensorsensor.h @@ -2,11 +2,11 @@ #ifndef SENSORSENSOR_H #define SENSORSENSOR_H -#include <qstring.h> -#include <qtextcodec.h> -#include <qmap.h> -#include <qstringlist.h> -#include <qregexp.h> +#include <tqstring.h> +#include <tqtextcodec.h> +#include <tqmap.h> +#include <tqstringlist.h> +#include <tqregexp.h> #include <kprocess.h> #include <kprocio.h> @@ -30,13 +30,13 @@ public: private: KShellProcess ksp; - QString extraParams; + TQString extraParams; - QMap<QString,QString> sensorMap; + TQMap<TQString,TQString> sensorMap; #ifdef __FreeBSD__ - QMap<QString,QString> sensorMapBSD; + TQMap<TQString,TQString> sensorMapBSD; #endif - QString sensorResult; + TQString sensorResult; private slots: void receivedStdout(KProcess *, char *buffer, int); diff --git a/superkaramba/src/showdesktop.cpp b/superkaramba/src/showdesktop.cpp index 304dcb6..159ccae 100644 --- a/superkaramba/src/showdesktop.cpp +++ b/superkaramba/src/showdesktop.cpp @@ -33,17 +33,17 @@ ShowDesktop* ShowDesktop::the() } ShowDesktop::ShowDesktop() - : QObject() + : TQObject() , showingDesktop( false ) , kWinModule( 0 ) { kWinModule = new KWinModule( this ); // on desktop changes or when a window is deiconified, we abort the show desktop mode - connect( kWinModule, SIGNAL(currentDesktopChanged(int)), - SLOT(slotCurrentDesktopChanged(int))); - connect( kWinModule, SIGNAL(windowChanged(WId,unsigned int)), - SLOT(slotWindowChanged(WId,unsigned int))); + connect( kWinModule, TQT_SIGNAL(currentDesktopChanged(int)), + TQT_SLOT(slotCurrentDesktopChanged(int))); + connect( kWinModule, TQT_SIGNAL(windowChanged(WId,unsigned int)), + TQT_SLOT(slotWindowChanged(WId,unsigned int))); } void ShowDesktop::slotCurrentDesktopChanged(int) @@ -91,9 +91,9 @@ void ShowDesktop::showDesktop( bool b ) if ( b ) { // this code should move to KWin after supporting NETWM1.2 iconifiedList.clear(); - const QValueList<WId> windows = kWinModule->windows(); - QValueList<WId>::ConstIterator it; - QValueList<WId>::ConstIterator end( windows.end() ); + const TQValueList<WId> windows = kWinModule->windows(); + TQValueList<WId>::ConstIterator it; + TQValueList<WId>::ConstIterator end( windows.end() ); for ( it=windows.begin(); it!=end; ++it ) { WId w = *it; NETWinInfo info( qt_xdisplay(), w, qt_xrootwin(), @@ -107,13 +107,13 @@ void ShowDesktop::showDesktop( bool b ) } // find first, hide later, otherwise transients may get minimized // with the window they're transient for - QValueList<WId>::ConstIterator endInconifiedList( iconifiedList.end() ); + TQValueList<WId>::ConstIterator endInconifiedList( iconifiedList.end() ); for ( it=iconifiedList.begin(); it!=endInconifiedList; ++it ) { KWin::iconifyWindow( *it, false ); } } else { - QValueList<WId>::ConstIterator it; - QValueList<WId>::ConstIterator end( iconifiedList.end() ); + TQValueList<WId>::ConstIterator it; + TQValueList<WId>::ConstIterator end( iconifiedList.end() ); for ( it=iconifiedList.begin(); it!=end; ++it ) { KWin::deIconifyWindow( *it, false ); } diff --git a/superkaramba/src/showdesktop.h b/superkaramba/src/showdesktop.h index 6a980dc..6f46688 100644 --- a/superkaramba/src/showdesktop.h +++ b/superkaramba/src/showdesktop.h @@ -51,7 +51,7 @@ private: bool showingDesktop; KWinModule* kWinModule; - QValueList<WId> iconifiedList; + TQValueList<WId> iconifiedList; }; diff --git a/superkaramba/src/sklineedit.cpp b/superkaramba/src/sklineedit.cpp index a384e44..7047dde 100644 --- a/superkaramba/src/sklineedit.cpp +++ b/superkaramba/src/sklineedit.cpp @@ -22,7 +22,7 @@ #include "karamba.h" #include "kdebug.h" -SKLineEdit::SKLineEdit(QWidget *w, Input *i) : QLineEdit(w), m_input(i) +SKLineEdit::SKLineEdit(TQWidget *w, Input *i) : TQLineEdit(w), m_input(i) { frameColor = Qt::gray; setBackgroundColor(Qt::white); @@ -32,37 +32,37 @@ SKLineEdit::~SKLineEdit() { } -void SKLineEdit::drawFrame(QPainter *p) +void SKLineEdit::drawFrame(TQPainter *p) { p->setPen(frameColor); p->drawRect(frameRect()); } -void SKLineEdit::drawContents(QPainter *p) +void SKLineEdit::drawContents(TQPainter *p) { - QLineEdit::drawContents(p); + TQLineEdit::drawContents(p); } -void SKLineEdit::setFrameColor(QColor c) +void SKLineEdit::setFrameColor(TQColor c) { frameColor = c; repaint(); } -void SKLineEdit::setBackgroundColor(QColor c) +void SKLineEdit::setBackgroundColor(TQColor c) { - QLineEdit::setBackgroundColor(c); + TQLineEdit::setBackgroundColor(c); repaint(); } -QColor SKLineEdit::getFrameColor() const +TQColor SKLineEdit::getFrameColor() const { return frameColor; } -void SKLineEdit::keyPressEvent(QKeyEvent* e) +void SKLineEdit::keyPressEvent(TQKeyEvent* e) { - QLineEdit::keyPressEvent(e); + TQLineEdit::keyPressEvent(e); if(!e->text().isEmpty()) { @@ -71,9 +71,9 @@ void SKLineEdit::keyPressEvent(QKeyEvent* e) } } -void SKLineEdit::keyReleaseEvent(QKeyEvent* e) +void SKLineEdit::keyReleaseEvent(TQKeyEvent* e) { - QLineEdit::keyReleaseEvent(e); + TQLineEdit::keyReleaseEvent(e); } Input* SKLineEdit::getInput() diff --git a/superkaramba/src/sklineedit.h b/superkaramba/src/sklineedit.h index 2afd6c5..2d56793 100644 --- a/superkaramba/src/sklineedit.h +++ b/superkaramba/src/sklineedit.h @@ -21,36 +21,36 @@ #ifndef SKLINEEDIT_H #define SKLINEEDIT_H -#include <qlineedit.h> -#include <qwidget.h> -#include <qevent.h> -#include <qpainter.h> -#include <qcolor.h> +#include <tqlineedit.h> +#include <tqwidget.h> +#include <tqevent.h> +#include <tqpainter.h> +#include <tqcolor.h> class Input; class SKLineEdit : public QLineEdit { public: - SKLineEdit(QWidget *w, Input *i); + SKLineEdit(TQWidget *w, Input *i); ~SKLineEdit(); - void drawFrame(QPainter *p); - void drawContents(QPainter *p); + void drawFrame(TQPainter *p); + void drawContents(TQPainter *p); - void setFrameColor(QColor c); - QColor getFrameColor() const; + void setFrameColor(TQColor c); + TQColor getFrameColor() const; - void setBackgroundColor(QColor c); + void setBackgroundColor(TQColor c); Input* getInput(); protected: - virtual void keyReleaseEvent(QKeyEvent* e); - virtual void keyPressEvent(QKeyEvent* e); + virtual void keyReleaseEvent(TQKeyEvent* e); + virtual void keyPressEvent(TQKeyEvent* e); private: - QColor frameColor; + TQColor frameColor; Input* m_input; }; diff --git a/superkaramba/src/sknewstuff.cpp b/superkaramba/src/sknewstuff.cpp index bf16fe6..3dd32f6 100644 --- a/superkaramba/src/sknewstuff.cpp +++ b/superkaramba/src/sknewstuff.cpp @@ -27,8 +27,8 @@ #include <kstandarddirs.h> #include <ktar.h> #include <kurl.h> -#include <qdir.h> -#include <qfileinfo.h> +#include <tqdir.h> +#include <tqfileinfo.h> #ifdef HAVE_CONFIG_H #include <config.h> @@ -45,16 +45,16 @@ SKNewStuff::SKNewStuff( ThemesDlg *dlg ) : { } -bool SKNewStuff::install( const QString &fileName ) +bool SKNewStuff::install( const TQString &fileName ) { kdDebug() << "SKNewStuff::install(): " << fileName << endl; KMimeType::Ptr result = KMimeType::findByURL(fileName); KStandardDirs myStdDir; - QFileInfo fi(fileName); - QString base = fi.baseName(); - QString baseDestDir =myStdDir.saveLocation("data", kapp->instanceName() + "/themes/", true); - const QString destDir = baseDestDir + base + "/"; + TQFileInfo fi(fileName); + TQString base = fi.baseName(); + TQString baseDestDir =myStdDir.saveLocation("data", kapp->instanceName() + "/themes/", true); + const TQString destDir = baseDestDir + base + "/"; KStandardDirs::makeDir( destDir ); kdDebug() << "SKNewStuff::install() mimetype: " << result->name() << endl; @@ -114,20 +114,20 @@ bool SKNewStuff::install( const QString &fileName ) return true; } -bool SKNewStuff::createUploadFile( const QString &fileName ) +bool SKNewStuff::createUploadFile( const TQString &fileName ) { kdDebug() << "SKNewStuff::createUploadFile(): " << fileName << endl; return true; } -QString SKNewStuff::downloadDestination( KNS::Entry *entry ) +TQString SKNewStuff::downloadDestination( KNS::Entry *entry ) { KURL source = entry->payload(); m_sourceLink = source; kdDebug() << "SKNewStuff::downloadDestination() url: " << source.url() << " fileName: " << source.fileName() << endl; - QString file(source.fileName()); + TQString file(source.fileName()); if ( file.isEmpty() ) { kdDebug() << "The file was empty. " << source.url() << diff --git a/superkaramba/src/sknewstuff.h b/superkaramba/src/sknewstuff.h index c646f36..9c10d2b 100644 --- a/superkaramba/src/sknewstuff.h +++ b/superkaramba/src/sknewstuff.h @@ -40,9 +40,9 @@ class SKNewStuff : public KNewStuff public: SKNewStuff( ThemesDlg * ); - bool install( const QString &fileName ); - bool createUploadFile( const QString &fileName ); - QString downloadDestination( KNS::Entry *entry ); + bool install( const TQString &fileName ); + bool createUploadFile( const TQString &fileName ); + TQString downloadDestination( KNS::Entry *entry ); private: ThemesDlg *mDlg; diff --git a/superkaramba/src/svcgrp_python.cpp b/superkaramba/src/svcgrp_python.cpp index 5a59c82..8b827ec 100644 --- a/superkaramba/src/svcgrp_python.cpp +++ b/superkaramba/src/svcgrp_python.cpp @@ -19,7 +19,7 @@ #include <Python.h> #include "task_python.h" -#include <qobject.h> +#include <tqobject.h> #include <kservicegroup.h> #include "karamba.h" #include "svcgrp_python.h" @@ -122,7 +122,7 @@ static PyObject *getServiceGroups(const char *rel_path) KServiceGroup::List sl = root->entries(true, excludeNoDisplay_, true, detailed_ && !detailedNamesFirst_); - QStringList suppressGenericNames = root->suppressGenericNames(); + TQStringList suppressGenericNames = root->suppressGenericNames(); KServiceGroup::List::ConstIterator it = sl.begin(); for (; it != sl.end(); ++it) diff --git a/superkaramba/src/systemtray.cpp b/superkaramba/src/systemtray.cpp index 312fe59..ed85ab8 100644 --- a/superkaramba/src/systemtray.cpp +++ b/superkaramba/src/systemtray.cpp @@ -19,7 +19,7 @@ #include "systemtray.h" -#include <qobject.h> +#include <tqobject.h> #include <kiconloader.h> #include <klocale.h> #include <kwinmodule.h> @@ -27,16 +27,16 @@ #include <kdebug.h> #include <kwin.h> -#include <qpopupmenu.h> -#include <qdragobject.h> -#include <qlayout.h> -#include <qstringlist.h> -#include <qpixmap.h> +#include <tqpopupmenu.h> +#include <tqdragobject.h> +#include <tqlayout.h> +#include <tqstringlist.h> +#include <tqpixmap.h> #include <X11/Xlib.h> -Systemtray::Systemtray(QWidget* parent) - : QWidget(parent,0,0) +Systemtray::Systemtray(TQWidget* parent) + : TQWidget(parent,0,0) { setBackgroundOrigin(ParentOrigin); setBackgroundMode(FixedPixmap); @@ -54,20 +54,20 @@ int Systemtray::getTraySize() { return (int) kwin_module->systemTrayWindows().size(); } -void Systemtray::updateBackgroundPixmap ( const QPixmap & pixmap) { +void Systemtray::updateBackgroundPixmap ( const TQPixmap & pixmap) { QXEmbed *emb; setPaletteBackgroundPixmap (pixmap); for (emb = m_Wins.first(); emb != 0L; emb = m_Wins.next()) { //Stupid stupid stupid work around for annoying bug //QXEmbed ignores setBackgroundOrigin(AncestorOrigin).... - QPixmap bug = QPixmap(emb->size()); + TQPixmap bug = TQPixmap(emb->size()); bitBlt(&bug, 0, 0, &pixmap, emb->parentWidget()->x()+emb->x(), emb->parentWidget()->y()+emb->y(), emb->width(), emb->height(),Qt::CopyROP, false); emb->setPaletteBackgroundPixmap (bug); } - QPoint topPoint = mapToGlobal(QPoint(0,0)); + TQPoint topPoint = mapToGlobal(TQPoint(0,0)); Window hack = XCreateSimpleWindow(qt_xdisplay(), winId(), 0,0, width(), height(), 0, 0, 0); XRaiseWindow(qt_xdisplay(), hack); XMapWindow(qt_xdisplay(), hack); @@ -84,8 +84,8 @@ void Systemtray::initSystray( void ) kwin_module = new KWinModule(); systemTrayWindows = kwin_module->systemTrayWindows(); - QValueList<WId>::ConstIterator end(systemTrayWindows.end()); - for (QValueList<WId>::ConstIterator it = systemTrayWindows.begin(); it!=end; ++it) + TQValueList<WId>::ConstIterator end(systemTrayWindows.end()); + for (TQValueList<WId>::ConstIterator it = systemTrayWindows.begin(); it!=end; ++it) { no_of_systray_windows++; QXEmbed *emb; @@ -95,7 +95,7 @@ void Systemtray::initSystray( void ) emb->setAutoDelete(false); - connect(emb, SIGNAL(embeddedWindowDestroyed()), SLOT(updateTrayWindows())); + connect(emb, TQT_SIGNAL(embeddedWindowDestroyed()), TQT_SLOT(updateTrayWindows())); m_Wins.append(emb); @@ -107,12 +107,12 @@ void Systemtray::initSystray( void ) updateTrayWindows(); - connect(kwin_module, SIGNAL(systemTrayWindowAdded(WId)), SLOT(systemTrayWindowAdded(WId))); - connect(kwin_module, SIGNAL(systemTrayWindowRemoved(WId)), SLOT(systemTrayWindowRemoved(WId))); + connect(kwin_module, TQT_SIGNAL(systemTrayWindowAdded(WId)), TQT_SLOT(systemTrayWindowAdded(WId))); + connect(kwin_module, TQT_SIGNAL(systemTrayWindowRemoved(WId)), TQT_SLOT(systemTrayWindowRemoved(WId))); - QCString screenstr; + TQCString screenstr; screenstr.setNum(qt_xscreen()); - QCString trayatom = "_NET_SYSTEM_TRAY_S" + screenstr; + TQCString trayatom = "_NET_SYSTEM_TRAY_S" + screenstr; net_system_tray_selection = XInternAtom( display, trayatom, false ); net_system_tray_opcode = XInternAtom( display, "_NET_SYSTEM_TRAY_OPCODE", false ); @@ -206,7 +206,7 @@ void Systemtray::systemTrayWindowAdded( WId w ) emb->setAutoDelete(false); //emb->setBackgroundMode(X11ParentRelative); emb->setBackgroundMode(FixedPixmap); - connect(emb, SIGNAL(embeddedWindowDestroyed()), SLOT(updateTrayWindows())); + connect(emb, TQT_SIGNAL(embeddedWindowDestroyed()), TQT_SLOT(updateTrayWindows())); m_Wins.append(emb); emb->embed(w); diff --git a/superkaramba/src/systemtray.h b/superkaramba/src/systemtray.h index 768e00c..51f1d56 100644 --- a/superkaramba/src/systemtray.h +++ b/superkaramba/src/systemtray.h @@ -21,9 +21,9 @@ #ifndef TESTCARDAPPLET_H #define TESTCARDAPPLET_H -#include <qobject.h> -#include <qpixmap.h> -#include <qptrlist.h> +#include <tqobject.h> +#include <tqpixmap.h> +#include <tqptrlist.h> #include <qxembed.h> class KWinModule; @@ -35,10 +35,10 @@ class Systemtray : public QWidget { Q_OBJECT public: - Systemtray(QWidget* parent); + Systemtray(TQWidget* parent); ~Systemtray(); - void updateBackgroundPixmap ( const QPixmap & ); + void updateBackgroundPixmap ( const TQPixmap & ); int getCurrentWindowCount(); @@ -56,9 +56,9 @@ signals: private: KWinModule *kwin_module; - QValueList<WId> systemTrayWindows; + TQValueList<WId> systemTrayWindows; - QPtrList<QXEmbed> m_Wins; + TQPtrList<QXEmbed> m_Wins; Atom net_system_tray_selection; Atom net_system_tray_opcode; diff --git a/superkaramba/src/systray_python.cpp b/superkaramba/src/systray_python.cpp index cb8909a..c953fdb 100644 --- a/superkaramba/src/systray_python.cpp +++ b/superkaramba/src/systray_python.cpp @@ -27,7 +27,7 @@ #endif #include <Python.h> -#include <qobject.h> +#include <tqobject.h> #include "karamba.h" #include "meter.h" #include "meter_python.h" @@ -111,8 +111,8 @@ long createSystray(long widget, long x, long y, long w, long h) currTheme->systray->move((int)x,(int)y); currTheme->systray->setMinimumSize((int)w,(int)h); currTheme->systray->initSystray(); - QObject::connect(currTheme->systray,SIGNAL(updated()), - currTheme,SLOT(systrayUpdated())); + TQObject::connect(currTheme->systray,TQT_SIGNAL(updated()), + currTheme,TQT_SLOT(systrayUpdated())); currTheme->systray->show(); } diff --git a/superkaramba/src/task_python.cpp b/superkaramba/src/task_python.cpp index 7a74559..0b3f876 100644 --- a/superkaramba/src/task_python.cpp +++ b/superkaramba/src/task_python.cpp @@ -27,7 +27,7 @@ #endif #include <Python.h> -#include <qobject.h> +#include <tqobject.h> #include "karamba.h" #include "meter.h" #include "meter_python.h" diff --git a/superkaramba/src/taskbartest.cpp b/superkaramba/src/taskbartest.cpp index 3ad6922..95b66a2 100644 --- a/superkaramba/src/taskbartest.cpp +++ b/superkaramba/src/taskbartest.cpp @@ -27,8 +27,8 @@ #include <klocale.h> #include <kconfig.h> -#include <qfileinfo.h> -#include <qstringlist.h> +#include <tqfileinfo.h> +#include <tqstringlist.h> #include <iostream.h> @@ -95,7 +95,7 @@ int main(int argc, char **argv) // { // if( args->arg(i) != "" ) // { -// QFileInfo file( args->arg(i) ); +// TQFileInfo file( args->arg(i) ); // //qDebug( file.dirPath(true) ); // if( file.exists() && !file.isDir() ) // { @@ -125,11 +125,11 @@ int main(int argc, char **argv) // } // else // { -// QStringList fileNames; -// fileNames = KFileDialog::getOpenFileNames(QString::null, "*.theme", 0, "Open configurations"); -// for ( QStringList::Iterator it = fileNames.begin(); it != fileNames.end(); ++it ) +// TQStringList fileNames; +// fileNames = KFileDialog::getOpenFileNames(TQString::null, "*.theme", 0, "Open configurations"); +// for ( TQStringList::Iterator it = fileNames.begin(); it != fileNames.end(); ++it ) // { -// QFileInfo file( *it ); +// TQFileInfo file( *it ); // if( file.exists() && !file.isDir() ) // { // mainWin = new karamba( *it ); diff --git a/superkaramba/src/taskmanager.cpp b/superkaramba/src/taskmanager.cpp index c1f2568..e12fc6a 100644 --- a/superkaramba/src/taskmanager.cpp +++ b/superkaramba/src/taskmanager.cpp @@ -28,8 +28,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include <kiconloader.h> #include <kwinmodule.h> #include <netwm.h> -#include <qtimer.h> -#include <qimage.h> +#include <tqtimer.h> +#include <tqimage.h> #include <X11/X.h> #include <X11/Xlib.h> @@ -38,7 +38,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "taskmanager.h" #include "taskmanager.moc" -template class QPtrList<Task>; +template class TQPtrList<Task>; // Hack: create a global KWinModule without a parent. We // can't make it a child of TaskManager because more than one @@ -48,23 +48,23 @@ template class QPtrList<Task>; // The real problem is that KWinModule should be a singleton. KWinModule* kwin_module = 0; -TaskManager::TaskManager(QObject *parent, const char *name) - : QObject(parent, name), _active(0), _startup_info( NULL ) +TaskManager::TaskManager(TQObject *parent, const char *name) + : TQObject(parent, name), _active(0), _startup_info( NULL ) { kwin_module = new KWinModule(); // KGlobal::locale()->insertCatalogue("libtaskmanager"); - connect(kwin_module, SIGNAL(windowAdded(WId)), SLOT(windowAdded(WId))); - connect(kwin_module, SIGNAL(windowRemoved(WId)), SLOT(windowRemoved(WId))); - connect(kwin_module, SIGNAL(activeWindowChanged(WId)), SLOT(activeWindowChanged(WId))); - connect(kwin_module, SIGNAL(currentDesktopChanged(int)), SLOT(currentDesktopChanged(int))); - connect(kwin_module, SIGNAL(windowChanged(WId,unsigned int)), SLOT(windowChanged(WId,unsigned int))); + connect(kwin_module, TQT_SIGNAL(windowAdded(WId)), TQT_SLOT(windowAdded(WId))); + connect(kwin_module, TQT_SIGNAL(windowRemoved(WId)), TQT_SLOT(windowRemoved(WId))); + connect(kwin_module, TQT_SIGNAL(activeWindowChanged(WId)), TQT_SLOT(activeWindowChanged(WId))); + connect(kwin_module, TQT_SIGNAL(currentDesktopChanged(int)), TQT_SLOT(currentDesktopChanged(int))); + connect(kwin_module, TQT_SIGNAL(windowChanged(WId,unsigned int)), TQT_SLOT(windowChanged(WId,unsigned int))); // register existing windows - const QValueList<WId> windows = kwin_module->windows(); - QValueList<WId>::ConstIterator end( windows.end() ); - for (QValueList<WId>::ConstIterator it = windows.begin(); it != end; ++it ) + const TQValueList<WId> windows = kwin_module->windows(); + TQValueList<WId>::ConstIterator end( windows.end() ); + for (TQValueList<WId>::ConstIterator it = windows.begin(); it != end; ++it ) windowAdded(*it); // set active window @@ -86,14 +86,14 @@ void TaskManager::configure_startup() return; _startup_info = new KStartupInfo( true, this ); connect( _startup_info, - SIGNAL( gotNewStartup( const KStartupInfoId&, const KStartupInfoData& )), - SLOT( gotNewStartup( const KStartupInfoId&, const KStartupInfoData& ))); + TQT_SIGNAL( gotNewStartup( const KStartupInfoId&, const KStartupInfoData& )), + TQT_SLOT( gotNewStartup( const KStartupInfoId&, const KStartupInfoData& ))); connect( _startup_info, - SIGNAL( gotStartupChange( const KStartupInfoId&, const KStartupInfoData& )), - SLOT( gotStartupChange( const KStartupInfoId&, const KStartupInfoData& ))); + TQT_SIGNAL( gotStartupChange( const KStartupInfoId&, const KStartupInfoData& )), + TQT_SLOT( gotStartupChange( const KStartupInfoId&, const KStartupInfoData& ))); connect( _startup_info, - SIGNAL( gotRemoveStartup( const KStartupInfoId&, const KStartupInfoData& )), - SLOT( gotRemoveStartup( const KStartupInfoId& ))); + TQT_SIGNAL( gotRemoveStartup( const KStartupInfoId&, const KStartupInfoData& )), + TQT_SLOT( gotRemoveStartup( const KStartupInfoId& ))); c.setGroup( "TaskbarButtonSettings" ); _startup_info->setTimeout( c.readUnsignedNumEntry( "Timeout", 30 )); } @@ -298,7 +298,7 @@ void TaskManager::killStartup(Startup* s) delete s; } -QString TaskManager::desktopName(int desk) const +TQString TaskManager::desktopName(int desk) const { return kwin_module->desktopName(desk); } @@ -312,7 +312,7 @@ bool TaskManager::isOnTop(const Task* task) { if(!task) return false; - for (QValueList<WId>::ConstIterator it = kwin_module->stackingOrder().fromLast(); + for (TQValueList<WId>::ConstIterator it = kwin_module->stackingOrder().fromLast(); it != kwin_module->stackingOrder().end(); --it ) { for (Task* t = _tasks.first(); t != 0; t = _tasks.next() ) { if ( (*it) == t->window() ) { @@ -329,7 +329,7 @@ bool TaskManager::isOnTop(const Task* task) Task::Task(WId win, TaskManager * parent, const char *name) : - QObject(parent, name), + TQObject(parent, name), _active(false), _win(win), _lastWidth(0), _lastHeight(0), _lastResize(false), _lastIcon(), _thumbSize(0.2), _thumb(), _grab() @@ -462,7 +462,7 @@ bool Task::isOnTop() const bool Task::isModified() const { - static QString modStr = QString::fromUtf8("[") + i18n("modified") + QString::fromUtf8("]"); + static TQString modStr = TQString::fromUtf8("[") + i18n("modified") + TQString::fromUtf8("]"); #ifdef KDE_3_2 int modStrPos = _info.visibleName().find(modStr); #else @@ -472,42 +472,42 @@ bool Task::isModified() const return ( modStrPos != -1 ); } -QString Task::iconName() const +TQString Task::iconName() const { NETWinInfo ni( qt_xdisplay(), _win, qt_xrootwin(), NET::WMIconName); - return QString::fromUtf8(ni.iconName()); + return TQString::fromUtf8(ni.iconName()); } -QString Task::visibleIconName() const +TQString Task::visibleIconName() const { NETWinInfo ni( qt_xdisplay(), _win, qt_xrootwin(), NET::WMVisibleIconName); - return QString::fromUtf8(ni.visibleIconName()); + return TQString::fromUtf8(ni.visibleIconName()); } -QString Task::className() +TQString Task::className() { XClassHint hint; if(XGetClassHint(qt_xdisplay(), _win, &hint)) { - QString nh( hint.res_name ); + TQString nh( hint.res_name ); XFree( hint.res_name ); XFree( hint.res_class ); return nh; } - return QString::null; + return TQString::null; } -QString Task::classClass() +TQString Task::classClass() { XClassHint hint; if(XGetClassHint(qt_xdisplay(), _win, &hint)) { - QString ch( hint.res_class ); + TQString ch( hint.res_class ); XFree( hint.res_name ); XFree( hint.res_class ); return ch; } - return QString::null; + return TQString::null; } -QPixmap Task::icon( int width, int height, bool allowResize ) +TQPixmap Task::icon( int width, int height, bool allowResize ) { if ( (width == _lastWidth) && (height == _lastHeight) @@ -515,7 +515,7 @@ QPixmap Task::icon( int width, int height, bool allowResize ) && (!_lastIcon.isNull()) ) return _lastIcon; - QPixmap newIcon = KWin::icon( _win, width, height, allowResize ); + TQPixmap newIcon = KWin::icon( _win, width, height, allowResize ); if ( !newIcon.isNull() ) { _lastIcon = newIcon; _lastWidth = width; @@ -526,9 +526,9 @@ QPixmap Task::icon( int width, int height, bool allowResize ) return newIcon; } -QPixmap Task::bestIcon( int size, bool &isStaticIcon ) +TQPixmap Task::bestIcon( int size, bool &isStaticIcon ) { - QPixmap pixmap; + TQPixmap pixmap; isStaticIcon = false; switch( size ) { @@ -603,7 +603,7 @@ QPixmap Task::bestIcon( int size, bool &isStaticIcon ) return pixmap; } -bool Task::idMatch( const QString& id1, const QString& id2 ) +bool Task::idMatch( const TQString& id1, const TQString& id2 ) { if ( id1.isEmpty() || id2.isEmpty() ) return false; @@ -748,7 +748,7 @@ void Task::toggleShaded() setShaded( !isShaded() ); } -void Task::publishIconGeometry(QRect rect) +void Task::publishIconGeometry(TQRect rect) { NETWinInfo ni( qt_xdisplay(), _win, qt_xrootwin(), NET::WMIconGeometry); NETRect r; @@ -773,18 +773,18 @@ void Task::updateThumbnail() // by the thumbnail generation. This makes things much smoother // on slower machines. // - QWidget *rootWin = qApp->desktop(); + TQWidget *rootWin = qApp->desktop(); #ifdef KDE_3_2 - QRect geom = _info.geometry(); + TQRect geom = _info.geometry(); #else - QRect geom = _info.geometry; + TQRect geom = _info.geometry; #endif - _grab = QPixmap::grabWindow( rootWin->winId(), + _grab = TQPixmap::grabWindow( rootWin->winId(), geom.x(), geom.y(), geom.width(), geom.height() ); if ( !_grab.isNull() ) - QTimer::singleShot( 200, this, SLOT( generateThumbnail() ) ); + TQTimer::singleShot( 200, this, TQT_SLOT( generateThumbnail() ) ); } void Task::generateThumbnail() @@ -792,7 +792,7 @@ void Task::generateThumbnail() if ( _grab.isNull() ) return; - QImage img = _grab.convertToImage(); + TQImage img = _grab.convertToImage(); double width = img.width(); double height = img.height(); @@ -807,8 +807,8 @@ void Task::generateThumbnail() } Startup::Startup( const KStartupInfoId& id, const KStartupInfoData& data, - QObject * parent, const char *name) - : QObject(parent, name), _id( id ), _data( data ) + TQObject * parent, const char *name) + : TQObject(parent, name), _id( id ), _data( data ) { } diff --git a/superkaramba/src/taskmanager.h b/superkaramba/src/taskmanager.h index 86e4a74..be05cb7 100644 --- a/superkaramba/src/taskmanager.h +++ b/superkaramba/src/taskmanager.h @@ -27,11 +27,11 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include <sys/types.h> -#include <qpoint.h> -#include <qobject.h> -#include <qvaluelist.h> -#include <qptrlist.h> -#include <qpixmap.h> +#include <tqpoint.h> +#include <tqobject.h> +#include <tqvaluelist.h> +#include <tqptrlist.h> +#include <tqpixmap.h> #include <dcopobject.h> #include <kwin.h> @@ -49,12 +49,12 @@ class TaskManager; class Task: public QObject { Q_OBJECT - Q_PROPERTY( QString name READ name ) - Q_PROPERTY( QString visibleName READ visibleName ) - Q_PROPERTY( QString visibleNameWithState READ visibleNameWithState ) - Q_PROPERTY( QString iconName READ iconName ) - Q_PROPERTY( QString visibleIconName READ visibleIconName ) - Q_PROPERTY( QPixmap pixmap READ pixmap ) + Q_PROPERTY( TQString name READ name ) + Q_PROPERTY( TQString visibleName READ visibleName ) + Q_PROPERTY( TQString visibleNameWithState READ visibleNameWithState ) + Q_PROPERTY( TQString iconName READ iconName ) + Q_PROPERTY( TQString visibleIconName READ visibleIconName ) + Q_PROPERTY( TQPixmap pixmap READ pixmap ) Q_PROPERTY( bool maximized READ isMaximized ) Q_PROPERTY( bool iconified READ isIconified ) Q_PROPERTY( bool shaded READ isShaded WRITE setShaded ) @@ -66,7 +66,7 @@ class Task: public QObject Q_PROPERTY( int desktop READ desktop ) Q_PROPERTY( double thumbnailSize READ thumbnailSize WRITE setThumbnailSize ) Q_PROPERTY( bool hasThumbnail READ hasThumbnail ) - Q_PROPERTY( QPixmap thumbnail READ thumbnail ) + Q_PROPERTY( TQPixmap thumbnail READ thumbnail ) public: Task( WId win, TaskManager * parent, const char *name = 0 ); @@ -76,38 +76,38 @@ public: WId window() const { return _win; } #ifdef KDE_3_2 - QString name() const { return _info.name(); } - QString visibleName() const { return _info.visibleName(); } + TQString name() const { return _info.name(); } + TQString visibleName() const { return _info.visibleName(); } /** * Returns the desktop on which this task's window resides. */ int desktop() const { return _info.desktop(); } #else - QString name() const { return _info.name; } - QString visibleName() const { return _info.visibleName; } + TQString name() const { return _info.name; } + TQString visibleName() const { return _info.visibleName; } /** * Returns the desktop on which this task's window resides. */ int desktop() const { return _info.desktop; } #endif - QString visibleNameWithState() const { return _info.visibleNameWithState(); } - QString iconName() const; - QString visibleIconName() const; - QString className(); - QString classClass(); + TQString visibleNameWithState() const { return _info.visibleNameWithState(); } + TQString iconName() const; + TQString visibleIconName() const; + TQString className(); + TQString classClass(); /** * A list of the window ids of all transient windows (dialogs) associated * with this task. */ - QValueList<WId> transients() const { return _transients; } + TQValueList<WId> transients() const { return _transients; } /** * Returns a 16x16 (KIcon::Small) icon for the task. This method will * only fall back to a static icon if there is no icon of any size in * the WM hints. */ - QPixmap pixmap() const { return _pixmap; } + TQPixmap pixmap() const { return _pixmap; } /** * Returns the best icon for any of the KIcon::StdSizes. If there is no @@ -116,14 +116,14 @@ public: * * <pre> * bool gotStaticIcon; - * QPixmap icon = myTask->icon( KIcon::SizeMedium, gotStaticIcon ); + * TQPixmap icon = myTask->icon( KIcon::SizeMedium, gotStaticIcon ); * </pre> * * @param size Any of the constants in KIcon::StdSizes. * @param isStaticIcon Set to true if KIconLoader was used, false otherwise. * @see KIcon */ - QPixmap bestIcon( int size, bool &isStaticIcon ); + TQPixmap bestIcon( int size, bool &isStaticIcon ); /** * Tries to find an icon for the task with the specified size. If there @@ -134,13 +134,13 @@ public: * parameters will only query the NET properties if the icon has changed or * none was found. */ - QPixmap icon( int width, int height, bool allowResize = false ); + TQPixmap icon( int width, int height, bool allowResize = false ); /** * Returns true iff the windows with the specified ids should be grouped * together in the task list. */ - static bool idMatch(const QString &, const QString &); + static bool idMatch(const TQString &, const TQString &); // state @@ -231,7 +231,7 @@ public: * Returns the thumbnail for this task (or a null image if there is * none). */ - const QPixmap &thumbnail() const { return _thumb; } + const TQPixmap &thumbnail() const { return _thumb; } public slots: // actions @@ -306,7 +306,7 @@ public slots: * task will be displayed when iconised. It is used, for example by the * KWin inconify animation. */ - void publishIconGeometry(QRect); + void publishIconGeometry(TQRect); /** * Tells the task to generate a new thumbnail. When the thumbnail is @@ -347,22 +347,22 @@ protected slots: private: bool _active; WId _win; - QPixmap _pixmap; + TQPixmap _pixmap; #ifdef KDE_3_2 KWin::WindowInfo _info; #else KWin::Info _info; #endif - QValueList<WId> _transients; + TQValueList<WId> _transients; int _lastWidth; int _lastHeight; bool _lastResize; - QPixmap _lastIcon; + TQPixmap _lastIcon; double _thumbSize; - QPixmap _thumb; - QPixmap _grab; + TQPixmap _thumb; + TQPixmap _grab; class TaskPrivate *d; }; @@ -375,29 +375,29 @@ private: class Startup: public QObject { Q_OBJECT - Q_PROPERTY( QString text READ text ) - Q_PROPERTY( QString bin READ bin ) - Q_PROPERTY( QString icon READ icon ) + Q_PROPERTY( TQString text READ text ) + Q_PROPERTY( TQString bin READ bin ) + Q_PROPERTY( TQString icon READ icon ) public: - Startup( const KStartupInfoId& id, const KStartupInfoData& data, QObject * parent, + Startup( const KStartupInfoId& id, const KStartupInfoData& data, TQObject * parent, const char *name = 0); virtual ~Startup(); /** * The name of the starting task (if known). */ - QString text() const { return _data.findName(); } + TQString text() const { return _data.findName(); } /** * The name of the executable of the starting task. */ - QString bin() const { return _data.bin(); } + TQString bin() const { return _data.bin(); } /** * The name of the icon to be used for the starting task. */ - QString icon() const { return _data.findIcon(); } + TQString icon() const { return _data.findIcon(); } void update( const KStartupInfoData& data ); const KStartupInfoId& id() const { return _id; } @@ -413,8 +413,8 @@ private: class StartupPrivate *d; }; -typedef QPtrList<Task> TaskList; -typedef QPtrList<Startup> StartupList; +typedef TQPtrList<Task> TaskList; +typedef TQPtrList<Startup> StartupList; /** @@ -434,25 +434,25 @@ class TaskManager : public QObject Q_PROPERTY( int numberOfDesktops READ numberOfDesktops ) public: - TaskManager( QObject *parent = 0, const char *name = 0 ); + TaskManager( TQObject *parent = 0, const char *name = 0 ); virtual ~TaskManager(); /** * Returns a list of all current tasks. Return type changed to - * QPtrList in KDE 3. + * TQPtrList in KDE 3. */ TaskList tasks() const { return _tasks; } /** * Returns a list of all current startups. Return type changed to - * QPtrList in KDE 3. + * TQPtrList in KDE 3. */ StartupList startups() const { return _startups; } /** * Returns the name of the nth desktop. */ - QString desktopName(int n) const; + TQString desktopName(int n) const; /** * Returns the number of virtual desktops. @@ -540,7 +540,7 @@ protected: private: Task* _active; TaskList _tasks; - QValueList< WId > _skiptaskbar_windows; + TQValueList< WId > _skiptaskbar_windows; StartupList _startups; KStartupInfo* _startup_info; diff --git a/superkaramba/src/textfield.cpp b/superkaramba/src/textfield.cpp index 6578466..d2d0c6b 100644 --- a/superkaramba/src/textfield.cpp +++ b/superkaramba/src/textfield.cpp @@ -9,14 +9,14 @@ ***************************************************************************/ #include "textfield.h" -#include <qfontmetrics.h> +#include <tqfontmetrics.h> #include <kdebug.h> TextField::TextField( ) { setFontSize(12); - setColor(QColor(192, 192, 192)); - setBGColor(QColor(0, 0, 0)); + setColor(TQColor(192, 192, 192)); + setBGColor(TQColor(0, 0, 0)); setFont("Helvetica"); setAlignment(Qt::AlignLeft); setFixedPitch(false); @@ -58,35 +58,35 @@ TextField& TextField::operator=(const TextField& rhs) return *this; } -void TextField::setColor(QColor clr) +void TextField::setColor(TQColor clr) { color = clr; } -QColor TextField::getColor() const +TQColor TextField::getColor() const { return color; } -void TextField::setBGColor(QColor clr) +void TextField::setBGColor(TQColor clr) { bgColor = clr; } -QColor TextField::getBGColor() const +TQColor TextField::getBGColor() const { return bgColor; } -void TextField::setFont(const QString &f) +void TextField::setFont(const TQString &f) { font.setFamily(f); - lineHeight = QFontMetrics(font).height(); + lineHeight = TQFontMetrics(font).height(); } -QString TextField::getFont() const +TQString TextField::getFont() const { return font.family(); } @@ -94,7 +94,7 @@ QString TextField::getFont() const void TextField::setFontSize(int size) { font.setPointSize(size); - lineHeight = QFontMetrics(font).height(); + lineHeight = TQFontMetrics(font).height(); } int TextField::getFontSize() const @@ -102,9 +102,9 @@ int TextField::getFontSize() const return font.pointSize(); } -void TextField::setAlignment( const QString &align ) +void TextField::setAlignment( const TQString &align ) { - QString a = align.upper(); + TQString a = align.upper(); if( a == "LEFT" || a.isEmpty() ) alignment = Qt::AlignLeft; if( a == "RIGHT" ) @@ -123,7 +123,7 @@ int TextField::getAlignment() const return alignment; } -QString TextField::getAlignmentAsString() const +TQString TextField::getAlignmentAsString() const { if( alignment == Qt::AlignHCenter ) return "CENTER"; diff --git a/superkaramba/src/textfield.h b/superkaramba/src/textfield.h index b24fff3..13177b7 100644 --- a/superkaramba/src/textfield.h +++ b/superkaramba/src/textfield.h @@ -10,9 +10,9 @@ #ifndef TEXTFIELD_H #define TEXTFIELD_H -#include <qstring.h> -#include <qcolor.h> -#include <qfont.h> +#include <tqstring.h> +#include <tqcolor.h> +#include <tqfont.h> /** * @@ -28,29 +28,29 @@ public: TextField& operator=(const TextField& ); void setFontSize( int ); - void setColor(QColor clr); - void setBGColor(QColor clr); - void setFont( const QString& ); + void setColor(TQColor clr); + void setBGColor(TQColor clr); + void setFont( const TQString& ); void setAlignment( int ); - void setAlignment( const QString& ); + void setAlignment( const TQString& ); void setFixedPitch( bool ); void setShadow( int ); int getFontSize() const; - QColor getColor() const; - QColor getBGColor() const; - QString getFont() const; + TQColor getColor() const; + TQColor getBGColor() const; + TQString getFont() const; int getAlignment() const; - QString getAlignmentAsString() const; + TQString getAlignmentAsString() const; bool getFixedPitch() const; int getShadow() const; int getLineHeight() const; protected: int alignment; - QFont font; - QColor color; - QColor bgColor; + TQFont font; + TQColor color; + TQColor bgColor; int shadow; int lineHeight; diff --git a/superkaramba/src/textfilesensor.cpp b/superkaramba/src/textfilesensor.cpp index cad696f..7956112 100644 --- a/superkaramba/src/textfilesensor.cpp +++ b/superkaramba/src/textfilesensor.cpp @@ -8,9 +8,9 @@ * (at your option) any later version. * ***************************************************************************/ #include "textfilesensor.h" -#include "qdom.h" +#include "tqdom.h" -TextFileSensor::TextFileSensor( const QString &fn, bool iRdf, int interval, const QString &encoding ) +TextFileSensor::TextFileSensor( const TQString &fn, bool iRdf, int interval, const TQString &encoding ) : Sensor( interval ) { fileName = fn; @@ -18,12 +18,12 @@ TextFileSensor::TextFileSensor( const QString &fn, bool iRdf, int interval, cons if( !encoding.isEmpty() ) { - codec = QTextCodec::codecForName( encoding.ascii() ); + codec = TQTextCodec::codecForName( encoding.ascii() ); if ( codec == 0) - codec = QTextCodec::codecForLocale(); + codec = TQTextCodec::codecForLocale(); } else - codec = QTextCodec::codecForLocale(); + codec = TQTextCodec::codecForLocale(); } TextFileSensor::~TextFileSensor() @@ -31,30 +31,30 @@ TextFileSensor::~TextFileSensor() void TextFileSensor::update() { - QValueVector<QString> lines; - QFile file(fileName); - QString line; + TQValueVector<TQString> lines; + TQFile file(fileName); + TQString line; if ( file.open(IO_ReadOnly | IO_Translate) ) { if (rdf) { - QDomDocument doc; + TQDomDocument doc; if ( !doc.setContent( &file ) ) { file.close(); return; } - QDomElement docElem = doc.documentElement(); - QDomNode n = docElem.firstChild(); + TQDomElement docElem = doc.documentElement(); + TQDomNode n = docElem.firstChild(); if (!n.isNull()) { - QDomNodeList titles = docElem.elementsByTagName( "title" ); - QDomNodeList links = docElem.elementsByTagName( "link" ); + TQDomNodeList titles = docElem.elementsByTagName( "title" ); + TQDomNodeList links = docElem.elementsByTagName( "link" ); uint i; for ( i = 0; i < titles.count(); ++i ) { - QDomElement element = titles.item( i ).toElement(); + TQDomElement element = titles.item( i ).toElement(); lines.push_back(element.text()); element = links.item( i ).toElement(); @@ -64,7 +64,7 @@ void TextFileSensor::update() } else { - QTextStream t( &file ); // use a text stream + TQTextStream t( &file ); // use a text stream while( (line = t.readLine()) !=0 ) { lines.push_back(line); @@ -78,7 +78,7 @@ void TextFileSensor::update() Meter *meter; int count = (int) lines.size(); - QObjectListIt it( *objList ); + TQObjectListIt it( *objList ); while (it != 0) { sp = (SensorParams*)(*it); @@ -95,7 +95,7 @@ void TextFileSensor::update() if ( lineNbr == 0 ) { - QString text; + TQString text; for( int i=0; i < count; i++ ) { text += lines[i] + "\n"; diff --git a/superkaramba/src/textfilesensor.h b/superkaramba/src/textfilesensor.h index 1d5951b..39a464d 100644 --- a/superkaramba/src/textfilesensor.h +++ b/superkaramba/src/textfilesensor.h @@ -24,11 +24,11 @@ #include <sensor.h> -#include <qfile.h> -#include <qtextstream.h> -#include <qstring.h> -#include <qtextcodec.h> -#include <qvaluevector.h> +#include <tqfile.h> +#include <tqtextstream.h> +#include <tqstring.h> +#include <tqtextcodec.h> +#include <tqvaluevector.h> /** * * Hans Karlsson @@ -38,15 +38,15 @@ class TextFileSensor : public Sensor Q_OBJECT public: - TextFileSensor( const QString &fileName, bool rdf, int interval, const QString &encoding=QString::null ); + TextFileSensor( const TQString &fileName, bool rdf, int interval, const TQString &encoding=TQString::null ); ~TextFileSensor(); void update(); private: -QTextCodec *codec; -QString fileName; +TQTextCodec *codec; +TQString fileName; bool rdf; }; diff --git a/superkaramba/src/textlabel.cpp b/superkaramba/src/textlabel.cpp index 69fb841..509aea8 100644 --- a/superkaramba/src/textlabel.cpp +++ b/superkaramba/src/textlabel.cpp @@ -73,11 +73,11 @@ void TextLabel::setTextProps( TextField* t ) void TextLabel::calculateTextSize() { int tmp; - QFontMetrics fm(font); + TQFontMetrics fm(font); lineHeight = fm.height(); textSize.setWidth(0); textSize.setHeight(lineHeight * value.count()); - QStringList::Iterator it = value.begin(); + TQStringList::Iterator it = value.begin(); while(it != value.end()) { tmp = fm.width(*it); @@ -87,35 +87,35 @@ void TextLabel::calculateTextSize() } } -void TextLabel::setValue( QString text) +void TextLabel::setValue( TQString text) { - value = QStringList::split('\n',text); + value = TQStringList::split('\n',text); calculateTextSize(); } void TextLabel::setValue( long v) { - value = QStringList( QString::number( v ) ); + value = TQStringList( TQString::number( v ) ); calculateTextSize(); } -void TextLabel::setBGColor(QColor clr) +void TextLabel::setBGColor(TQColor clr) { bgColor = clr; } -QColor TextLabel::getBGColor() const +TQColor TextLabel::getBGColor() const { return bgColor; } -void TextLabel::setFont(QString f) +void TextLabel::setFont(TQString f) { font.setFamily(f); calculateTextSize(); } -QString TextLabel::getFont() const +TQString TextLabel::getFont() const { return font.family(); } @@ -131,9 +131,9 @@ int TextLabel::getFontSize() const return font.pixelSize(); } -void TextLabel::setAlignment( QString align ) +void TextLabel::setAlignment( TQString align ) { - QString a = align.upper(); + TQString a = align.upper(); if( a == "LEFT" || a.isEmpty() ) alignment = Qt::AlignLeft; if( a == "RIGHT" ) @@ -142,7 +142,7 @@ void TextLabel::setAlignment( QString align ) alignment = Qt::AlignHCenter; } -QString TextLabel::getAlignment() const +TQString TextLabel::getAlignment() const { if( alignment == Qt::AlignHCenter ) return "CENTER"; @@ -172,10 +172,10 @@ int TextLabel::getShadow() const return shadow; } -void TextLabel::setScroll(char* type, QPoint speed, int gap, int pause) +void TextLabel::setScroll(char* type, TQPoint speed, int gap, int pause) { ScrollType t = TextLabel::ScrollNone; - QString a = type; + TQString a = type; a = a.upper(); if(a == "NONE") t = TextLabel::ScrollNone; @@ -188,7 +188,7 @@ void TextLabel::setScroll(char* type, QPoint speed, int gap, int pause) setScroll(t, speed, gap, pause); } -void TextLabel::setScroll(ScrollType type, QPoint speed, int gap, int pause) +void TextLabel::setScroll(ScrollType type, TQPoint speed, int gap, int pause) { scrollType = type; scrollSpeed = speed; @@ -207,13 +207,13 @@ void TextLabel::setScroll(ScrollType type, QPoint speed, int gap, int pause) x = -1 * textSize.height(); else if(speed.y() < 0) x = getHeight()-1; - scrollPos = QPoint(x,y); + scrollPos = TQPoint(x,y); break; } case ScrollNone: case ScrollBackAndForth: default: - scrollPos = QPoint(0,0); + scrollPos = TQPoint(0,0); break; } scrollGap = gap; @@ -221,8 +221,8 @@ void TextLabel::setScroll(ScrollType type, QPoint speed, int gap, int pause) pauseCounter = 1; } -int TextLabel::drawText(QPainter *p, int x, int y, int width, int height, - QString text) +int TextLabel::drawText(TQPainter *p, int x, int y, int width, int height, + TQString text) { if( shadow != 0) { @@ -235,8 +235,8 @@ int TextLabel::drawText(QPainter *p, int x, int y, int width, int height, return 0; } -bool TextLabel::calculateScrollCoords(QRect meterRect, QRect &textRect, - QPoint &next, int &x, int &y) +bool TextLabel::calculateScrollCoords(TQRect meterRect, TQRect &textRect, + TQPoint &next, int &x, int &y) { if(scrollType == ScrollBackAndForth && (scrollSpeed.x() != 0 && textSize.width() < getWidth() || @@ -251,11 +251,11 @@ bool TextLabel::calculateScrollCoords(QRect meterRect, QRect &textRect, scrollPos += scrollSpeed; // -1 | 0 | 1 - QPoint direction(scrollSpeed.x()/abs((scrollSpeed.x() == 0)? + TQPoint direction(scrollSpeed.x()/abs((scrollSpeed.x() == 0)? 1:scrollSpeed.x()), scrollSpeed.y()/abs((scrollSpeed.y() == 0)? 1:scrollSpeed.y())); - next = QPoint(-1 * direction.x() * (scrollGap + textSize.width()), + next = TQPoint(-1 * direction.x() * (scrollGap + textSize.width()), -1 * direction.y() * (scrollGap + textSize.height())); textRect.setCoords(x, y, x + textSize.width(), y + textSize.height()); @@ -287,7 +287,7 @@ bool TextLabel::calculateScrollCoords(QRect meterRect, QRect &textRect, return true; } -void TextLabel::mUpdate(QPainter *p) +void TextLabel::mUpdate(TQPainter *p) { if (hidden != 1) { @@ -297,9 +297,9 @@ void TextLabel::mUpdate(QPainter *p) int y = getY(); int width = getWidth(); int height = getHeight(); - QRect meterRect(x, y, width, height); - QRect textRect; - QPoint next; + TQRect meterRect(x, y, width, height); + TQRect textRect; + TQPoint next; p->setFont(font); if(scrollType != ScrollNone) @@ -313,7 +313,7 @@ void TextLabel::mUpdate(QPainter *p) width = textSize.width(); height = textSize.height(); } - QStringList::Iterator it = value.begin(); + TQStringList::Iterator it = value.begin(); while(it != value.end() && (row <= height || height == -1 )) { drawText(p, x, y + i, width, height, *it); @@ -337,11 +337,11 @@ void TextLabel::mUpdate(QPainter *p) } } -bool TextLabel::click(QMouseEvent* e) +bool TextLabel::click(TQMouseEvent* e) { if (getBoundingBox().contains(e -> x(), e -> y()) && isEnabled()) { - QString program; + TQString program; if (e -> button() == Qt::LeftButton) { program = leftButtonAction; @@ -367,9 +367,9 @@ bool TextLabel::click(QMouseEvent* e) return false; } -void TextLabel::attachClickArea(QString leftMouseButton, - QString middleMouseButton, - QString rightMouseButton) +void TextLabel::attachClickArea(TQString leftMouseButton, + TQString middleMouseButton, + TQString rightMouseButton) { leftButtonAction = leftMouseButton; middleButtonAction = middleMouseButton; diff --git a/superkaramba/src/textlabel.h b/superkaramba/src/textlabel.h index e8fc9e4..f3774e6 100644 --- a/superkaramba/src/textlabel.h +++ b/superkaramba/src/textlabel.h @@ -10,13 +10,13 @@ #ifndef TEXTLABEL_H #define TEXTLABEL_H #include "meter.h" -#include <qstring.h> -#include <qpainter.h> -#include <qcolor.h> -#include <qfont.h> -#include <qfontmetrics.h> -#include <qstringlist.h> -#include <qrect.h> +#include <tqstring.h> +#include <tqpainter.h> +#include <tqcolor.h> +#include <tqfont.h> +#include <tqfontmetrics.h> +#include <tqstringlist.h> +#include <tqrect.h> #include "textfield.h" @@ -32,55 +32,55 @@ public: ~TextLabel(); void setTextProps( TextField* ); - void setValue( QString ); + void setValue( TQString ); void setValue( long ); - //virtual QString getStringValue() const { return value.join("\n"); }; - QString getStringValue() const { return value.join("\n"); }; + //virtual TQString getStringValue() const { return value.join("\n"); }; + TQString getStringValue() const { return value.join("\n"); }; void setFontSize( int ); - void setBGColor(QColor clr); - void setFont( QString ); - void setAlignment( QString ); + void setBGColor(TQColor clr); + void setFont( TQString ); + void setAlignment( TQString ); void setFixedPitch( bool ); void setShadow( int ); - void mUpdate( QPainter * ); + void mUpdate( TQPainter * ); virtual void show(); virtual void hide(); int getFontSize() const; - QColor getBGColor() const; - QString getFont() const; - QString getAlignment() const; + TQColor getBGColor() const; + TQString getFont() const; + TQString getAlignment() const; bool getFixedPitch() const; int getShadow() const; - void setScroll(ScrollType type, QPoint speed, int gap, int pause); - void setScroll(char* type, QPoint speed, int gap, int pause); + void setScroll(ScrollType type, TQPoint speed, int gap, int pause); + void setScroll(char* type, TQPoint speed, int gap, int pause); - void attachClickArea(QString leftMouseButton, QString middleMouseButton, - QString rightMouseButton); + void attachClickArea(TQString leftMouseButton, TQString middleMouseButton, + TQString rightMouseButton); - virtual bool click(QMouseEvent*); + virtual bool click(TQMouseEvent*); private: int alignment; int clip; - QStringList value; - QFont font; - QColor bgColor; + TQStringList value; + TQFont font; + TQColor bgColor; int lineHeight; - QSize textSize; + TQSize textSize; int shadow; TextField text; - QPoint scrollSpeed; - QPoint scrollPos; + TQPoint scrollSpeed; + TQPoint scrollPos; int scrollGap; int scrollPause; int pauseCounter; ScrollType scrollType; - int drawText(QPainter *p, int x, int y, int width, int height, - QString text); - bool calculateScrollCoords(QRect meterRect, QRect &textRect, - QPoint &next, int &x, int &y); + int drawText(TQPainter *p, int x, int y, int width, int height, + TQString text); + bool calculateScrollCoords(TQRect meterRect, TQRect &textRect, + TQPoint &next, int &x, int &y); void calculateTextSize(); }; diff --git a/superkaramba/src/textlabel_python.cpp b/superkaramba/src/textlabel_python.cpp index 0802be9..3cf6e3e 100644 --- a/superkaramba/src/textlabel_python.cpp +++ b/superkaramba/src/textlabel_python.cpp @@ -27,7 +27,7 @@ #endif #include <Python.h> -#include <qobject.h> +#include <tqobject.h> #include "karamba.h" #include "textlabel.h" #include "meter_python.h" @@ -43,7 +43,7 @@ PyObject* py_createText(PyObject *, PyObject *args) return NULL; TextLabel *tmp = new TextLabel((karamba*)widget, (int)x, (int)y, (int)w, (int)h); - tmp->setValue(PyString2QString(text)); + tmp->setValue(PyString2TQString(text)); tmp->setTextProps(((karamba*)widget)->getDefaultTextProps()); ((karamba*)widget)->meterList->append(tmp); return (Py_BuildValue((char*)"l", (long)tmp)); @@ -230,6 +230,6 @@ PyObject* py_setTextScroll(PyObject *, PyObject *args) return NULL; if (!checkKarambaAndMeter(widget, textSensor, "TextLabel")) return NULL; - ((TextLabel*)textSensor)->setScroll(type, QPoint(x,y), gap, pause); + ((TextLabel*)textSensor)->setScroll(type, TQPoint(x,y), gap, pause); return Py_BuildValue((char*)"l", 1); } diff --git a/superkaramba/src/themefile.cpp b/superkaramba/src/themefile.cpp index ac02e2f..1147357 100644 --- a/superkaramba/src/themefile.cpp +++ b/superkaramba/src/themefile.cpp @@ -32,10 +32,10 @@ #include <kstandarddirs.h> #include <klocale.h> #include <kio/netaccess.h> -#include <qtextstream.h> -#include <qfileinfo.h> -#include <qdom.h> -#include <qdir.h> +#include <tqtextstream.h> +#include <tqfileinfo.h> +#include <tqdom.h> +#include <tqdir.h> class ZipFile { @@ -44,7 +44,7 @@ class ZipFile m_zip(0), m_file(0) { } - void setFile(const QString& filename) + void setFile(const TQString& filename) { m_filename = filename; if(filename.isEmpty()) @@ -60,7 +60,7 @@ class ZipFile } m_file = static_cast<const KArchiveFile*>(entry); } - void setZip(const QString& zipfile) + void setZip(const TQString& zipfile) { closeZip(); @@ -93,7 +93,7 @@ class ZipFile } } - QByteArray data() + TQByteArray data() { if(m_file) return m_file->data(); @@ -101,7 +101,7 @@ class ZipFile { if(!m_filename.isEmpty()) qDebug("Error reading file %s from zip", m_filename.ascii()); - return QByteArray(); + return TQByteArray(); } } @@ -113,7 +113,7 @@ class ZipFile private: KZip* m_zip; const KArchiveFile* m_file; - QString m_filename; + TQString m_filename; const KArchiveDirectory* m_dir; }; @@ -143,7 +143,7 @@ bool ThemeFile::open() m_ba = m_zip->data(); if(m_ba.size() > 0) { - m_stream = new QTextStream(m_ba, IO_ReadOnly); + m_stream = new TQTextStream(m_ba, IO_ReadOnly); result = true; } } @@ -153,7 +153,7 @@ bool ThemeFile::open() if(m_fl.open(IO_ReadOnly|IO_Translate)) { - m_stream = new QTextStream(&m_fl); // use a text stream + m_stream = new TQTextStream(&m_fl); // use a text stream result = true; } } @@ -166,7 +166,7 @@ bool ThemeFile::nextLine(LineParser& parser) if(m_stream) { - QString result = m_stream->readLine(); + TQString result = m_stream->readLine(); if(result.isNull()) return false; @@ -196,13 +196,13 @@ bool ThemeFile::isValid() const bool ThemeFile::exists() const { - QFileInfo file(m_file); + TQFileInfo file(m_file); return file.exists(); } -QPixmap ThemeFile::icon() const +TQPixmap ThemeFile::icon() const { - return QPixmap(readThemeFile(m_icon)); + return TQPixmap(readThemeFile(m_icon)); } bool ThemeFile::set(const KURL &url) @@ -219,8 +219,8 @@ bool ThemeFile::set(const KURL &url) return false; } - QDir themeDir(locateLocal("appdata", "themes/", true)); - QFileInfo localFile = themeDir.filePath(url.fileName()); + TQDir themeDir(locateLocal("appdata", "themes/", true)); + TQFileInfo localFile = themeDir.filePath(url.fileName()); if(localFile.exists()) { @@ -242,14 +242,14 @@ bool ThemeFile::set(const KURL &url) else { if(url.directory().isEmpty() || url.directory() == "/") - m_file = canonicalFile(QDir::current().filePath(url.fileName())); + m_file = canonicalFile(TQDir::current().filePath(url.fileName())); else m_file = canonicalFile(url.path()); if(!exists()) return false; } - QFileInfo fi(m_file); + TQFileInfo fi(m_file); m_name = fi.baseName( TRUE ); m_theme = m_name + ".theme"; @@ -270,7 +270,7 @@ bool ThemeFile::set(const KURL &url) } parseXml(); - QFileInfo fimo(m_python); + TQFileInfo fimo(m_python); if(m_python.isEmpty()) fimo.setFile(m_theme); else @@ -285,15 +285,15 @@ void ThemeFile::parseXml() { if(!fileExists("maindata.xml")) return; - QByteArray ba = readThemeFile("maindata.xml"); - QDomDocument doc("superkaramba_theme"); + TQByteArray ba = readThemeFile("maindata.xml"); + TQDomDocument doc("superkaramba_theme"); doc.setContent(ba); - QDomElement element = doc.documentElement(); + TQDomElement element = doc.documentElement(); - QDomNode n = element.firstChild(); + TQDomNode n = element.firstChild(); while(!n.isNull()) { - QDomElement e = n.toElement(); + TQDomElement e = n.toElement(); if(!e.isNull()) { if(e.tagName() == "name") @@ -327,22 +327,22 @@ void ThemeFile::parseXml() bool ThemeFile::canUninstall() const { - QFileInfo fi(file()); - if(fi.permission(QFileInfo::WriteUser) || - fi.permission(QFileInfo::WriteGroup) || - fi.permission(QFileInfo::WriteOther)) + TQFileInfo fi(file()); + if(fi.permission(TQFileInfo::WriteUser) || + fi.permission(TQFileInfo::WriteGroup) || + fi.permission(TQFileInfo::WriteOther)) return true; return false; } -bool ThemeFile::isThemeFile(const QString& filename) const +bool ThemeFile::isThemeFile(const TQString& filename) const { - QFileInfo fileInfo(filename); + TQFileInfo fileInfo(filename); return fileInfo.isRelative(); } -bool ThemeFile::fileExists(const QString& filename) const +bool ThemeFile::fileExists(const TQString& filename) const { if(isThemeFile(filename)) { @@ -352,17 +352,17 @@ bool ThemeFile::fileExists(const QString& filename) const return m_zip->exists(); } else - return QFileInfo(path() + "/" + filename).exists(); + return TQFileInfo(path() + "/" + filename).exists(); } else - return QFileInfo(filename).exists(); + return TQFileInfo(filename).exists(); } -QByteArray ThemeFile::readThemeFile(const QString& filename) const +TQByteArray ThemeFile::readThemeFile(const TQString& filename) const { - //QTime time; + //TQTime time; //time.start(); - QByteArray ba; + TQByteArray ba; if(isZipTheme()) { @@ -371,7 +371,7 @@ QByteArray ThemeFile::readThemeFile(const QString& filename) const } else { - QFile file(path() + "/" + filename); + TQFile file(path() + "/" + filename); if(file.open(IO_ReadOnly)) { @@ -384,9 +384,9 @@ QByteArray ThemeFile::readThemeFile(const QString& filename) const return ba; } -bool ThemeFile::isZipFile(const QString& filename) +bool ThemeFile::isZipFile(const TQString& filename) { - QFile file(filename); + TQFile file(filename); if(file.open(IO_ReadOnly)) { @@ -406,9 +406,9 @@ bool ThemeFile::pythonModuleExists() const return (!m_python.isEmpty() && fileExists(m_python + ".py")); } -QString ThemeFile::canonicalFile(const QString& file) +TQString ThemeFile::canonicalFile(const TQString& file) { // Get absolute path with NO symlinks - QFileInfo fi(file); - return QDir(fi.dir().canonicalPath()).filePath(fi.fileName()); + TQFileInfo fi(file); + return TQDir(fi.dir().canonicalPath()).filePath(fi.fileName()); } diff --git a/superkaramba/src/themefile.h b/superkaramba/src/themefile.h index c8259d6..3a34cac 100644 --- a/superkaramba/src/themefile.h +++ b/superkaramba/src/themefile.h @@ -25,11 +25,11 @@ #define THEMEFILE_H #include <kurl.h> -#include <qstring.h> -#include <qcstring.h> -#include <qpixmap.h> -#include <qfile.h> -#include <qvaluevector.h> +#include <tqstring.h> +#include <tqcstring.h> +#include <tqpixmap.h> +#include <tqfile.h> +#include <tqvaluevector.h> class LineParser; class QTextStream; @@ -42,31 +42,31 @@ class ZipFile; class ThemeFile { public: - typedef QValueVector<ThemeFile> List; + typedef TQValueVector<ThemeFile> List; ThemeFile(const KURL& url = KURL()); ~ThemeFile(); bool isZipTheme() const { return m_zipTheme; }; - const QString& name() const { return m_name; }; - const QString& version() const { return m_version; }; - const QString& license() const { return m_license; }; - const QString& id() const { return m_id; }; - const QString& mo() const { return m_mo; }; - const QString& file() const { return m_file; }; - const QString& pythonModule() const { return m_python; }; + const TQString& name() const { return m_name; }; + const TQString& version() const { return m_version; }; + const TQString& license() const { return m_license; }; + const TQString& id() const { return m_id; }; + const TQString& mo() const { return m_mo; }; + const TQString& file() const { return m_file; }; + const TQString& pythonModule() const { return m_python; }; bool pythonModuleExists() const; - const QString& path() const { return m_path; }; - const QString& description() const { return m_description; }; - const QString& author() const { return m_author; }; - const QString& authorEmail() const { return m_authorEmail; }; - const QString& homepage() const { return m_homepage; }; - QPixmap icon() const; + const TQString& path() const { return m_path; }; + const TQString& description() const { return m_description; }; + const TQString& author() const { return m_author; }; + const TQString& authorEmail() const { return m_authorEmail; }; + const TQString& homepage() const { return m_homepage; }; + TQPixmap icon() const; bool exists() const; - bool isThemeFile(const QString& filename) const; + bool isThemeFile(const TQString& filename) const; bool isValid() const; - QByteArray readThemeFile(const QString& filename) const; - bool fileExists(const QString& filename) const; + TQByteArray readThemeFile(const TQString& filename) const; + bool fileExists(const TQString& filename) const; const ThemeLocale* locale() const { return m_locale; }; bool canUninstall() const; @@ -75,31 +75,31 @@ class ThemeFile bool nextLine(LineParser& parser); bool close(); - static bool isZipFile(const QString& filename); - static QString canonicalFile(const QString& file); + static bool isZipFile(const TQString& filename); + static TQString canonicalFile(const TQString& file); private: void parseXml(); - void mkdir(QDir dir); + void mkdir(TQDir dir); - QString m_path; + TQString m_path; bool m_zipTheme; - QString m_file; - QString m_id; - QString m_mo; - QString m_name; - QString m_theme; - QString m_python; - QString m_icon; - QString m_version; - QString m_license; - QTextStream* m_stream; - QByteArray m_ba; - QFile m_fl; - QString m_description; - QString m_author; - QString m_authorEmail; - QString m_homepage; + TQString m_file; + TQString m_id; + TQString m_mo; + TQString m_name; + TQString m_theme; + TQString m_python; + TQString m_icon; + TQString m_version; + TQString m_license; + TQTextStream* m_stream; + TQByteArray m_ba; + TQFile m_fl; + TQString m_description; + TQString m_author; + TQString m_authorEmail; + TQString m_homepage; ThemeLocale* m_locale; ZipFile* m_zip; }; diff --git a/superkaramba/src/themelocale.cpp b/superkaramba/src/themelocale.cpp index 76fa62b..32886f6 100644 --- a/superkaramba/src/themelocale.cpp +++ b/superkaramba/src/themelocale.cpp @@ -33,9 +33,9 @@ #include <kconfig.h> #include <kglobal.h> #include <klocale.h> -#include <qbuffer.h> -#include <qglobal.h> -#include <qiodevice.h> +#include <tqbuffer.h> +#include <tqglobal.h> +#include <tqiodevice.h> #include <stdlib.h> #ifdef HAVE_SYS_TYPES_H @@ -108,7 +108,7 @@ struct string_desc nls_uint32 offset; }; -void tl_nl_load_domain(QIODevice* device, int size, +void tl_nl_load_domain(TQIODevice* device, int size, struct sk_kde_loaded_l10nfile *domain_file); char* tl_nl_find_msg(const struct sk_kde_loaded_l10nfile *domain_file, const char *msgid); @@ -134,13 +134,13 @@ void ThemeLocale::unload() } } -QString ThemeLocale::translate(QString text) const +TQString ThemeLocale::translate(TQString text) const { if(text == 0) - return QString::null; + return TQString::null; if(m_domain.data) { - QString result = QString::fromUtf8(tl_nl_find_msg(&m_domain, text.ascii())); + TQString result = TQString::fromUtf8(tl_nl_find_msg(&m_domain, text.ascii())); if(result.isEmpty()) return text; else @@ -149,19 +149,19 @@ QString ThemeLocale::translate(QString text) const return text; } -void ThemeLocale::setLanguage(const QStringList &languages) +void ThemeLocale::setLanguage(const TQStringList &languages) { unload(); - for(QStringList::ConstIterator it = languages.begin(); + for(TQStringList::ConstIterator it = languages.begin(); it != languages.end(); ++it) { - QString file = - QString("locale/%1/LC_MESSAGES/%2.mo").arg(*it).arg(m_theme->mo()); + TQString file = + TQString("locale/%1/LC_MESSAGES/%2.mo").arg(*it).arg(m_theme->mo()); if(m_theme->fileExists(file)) { - QBuffer buffer(m_theme->readThemeFile(file)); + TQBuffer buffer(m_theme->readThemeFile(file)); tl_nl_load_domain(&buffer, buffer.size(), &m_domain); m_language = *it; return; @@ -169,29 +169,29 @@ void ThemeLocale::setLanguage(const QStringList &languages) } } -QStringList ThemeLocale::languageList() +TQStringList ThemeLocale::languageList() { KConfig* config = KGlobal::instance()->config(); // Reset the list and add the new languages - QStringList languageList; + TQStringList languageList; languageList += - QStringList::split(':', QFile::decodeName(::getenv("KDE_LANG"))); + TQStringList::split(':', TQFile::decodeName(::getenv("KDE_LANG"))); languageList += config->readListEntry("Language", ':'); // same order as setlocale use // HPB: Only run splitLocale on the environment variables.. - QStringList langs; + TQStringList langs; - langs << QFile::decodeName(::getenv("LC_ALL")); - langs << QFile::decodeName(::getenv("LC_MESSAGES")); - langs << QFile::decodeName(::getenv("LANG")); + langs << TQFile::decodeName(::getenv("LC_ALL")); + langs << TQFile::decodeName(::getenv("LC_MESSAGES")); + langs << TQFile::decodeName(::getenv("LANG")); - for(QStringList::Iterator it = langs.begin(); + for(TQStringList::Iterator it = langs.begin(); it != langs.end(); ++it ) { - QString ln, ct, chrset; + TQString ln, ct, chrset; KLocale::splitLocale(*it, ln, ct, chrset); /* We don't use these in zip themes... @@ -206,8 +206,8 @@ QStringList ThemeLocale::languageList() } languageList += langs; // Remove empty strings - QStringList::Iterator end( languageList.end() ); - for(QStringList::Iterator it=languageList.begin(); it!=end;) + TQStringList::Iterator end( languageList.end() ); + for(TQStringList::Iterator it=languageList.begin(); it!=end;) { if((*it).isEmpty()) it = languageList.remove(it); @@ -330,7 +330,7 @@ hash_string (const char *str_param) /* Load the message catalogs specified by device. If it is no valid message catalog do nothing. */ -void tl_nl_load_domain (QIODevice* device, int size, +void tl_nl_load_domain (TQIODevice* device, int size, struct sk_kde_loaded_l10nfile *domain_file) { struct mo_file_header *data = (struct mo_file_header *) -1; diff --git a/superkaramba/src/themelocale.h b/superkaramba/src/themelocale.h index 33b6c4e..3bb079a 100644 --- a/superkaramba/src/themelocale.h +++ b/superkaramba/src/themelocale.h @@ -20,8 +20,8 @@ #ifndef THEMELOCALE_H #define THEMELOCALE_H -#include <qstring.h> -#include <qstringlist.h> +#include <tqstring.h> +#include <tqstringlist.h> class ThemeFile; @@ -42,16 +42,16 @@ class ThemeLocale ThemeLocale(ThemeFile* theme); ~ThemeLocale(); - QString translate(QString text) const; - void setLanguage(const QStringList &languages); - QString language() const { return m_language; }; + TQString translate(TQString text) const; + void setLanguage(const TQStringList &languages); + TQString language() const { return m_language; }; - static QStringList languageList(); + static TQStringList languageList(); private: sk_kde_loaded_l10nfile m_domain; ThemeFile* m_theme; - QString m_language; + TQString m_language; void unload(); }; diff --git a/superkaramba/src/themesdlg.cpp b/superkaramba/src/themesdlg.cpp index 655c982..f483a04 100644 --- a/superkaramba/src/themesdlg.cpp +++ b/superkaramba/src/themesdlg.cpp @@ -42,16 +42,16 @@ #include <kapplication.h> #include <kiconloader.h> #include <klocale.h> -#include <qlineedit.h> -#include <qtable.h> -#include <qdir.h> -#include <qlabel.h> -#include <qcombobox.h> -#include <qptrlist.h> +#include <tqlineedit.h> +#include <tqtable.h> +#include <tqdir.h> +#include <tqlabel.h> +#include <tqcombobox.h> +#include <tqptrlist.h> #include <kio/job.h> #include <kprotocolinfo.h> -ThemesDlg::ThemesDlg(QWidget *parent, const char *name) +ThemesDlg::ThemesDlg(TQWidget *parent, const char *name) : ThemesLayout(parent, name) { populateListbox(); @@ -75,18 +75,18 @@ ThemesDlg::~ThemesDlg() void ThemesDlg::saveUserAddedThemes() { KStandardDirs ksd; - QStringList t = themes(); - QStringList dirs = ksd.findDirs("data", QString(kapp->name()) + "/themes"); - QStringList::Iterator it = t.begin(); + TQStringList t = themes(); + TQStringList dirs = ksd.findDirs("data", TQString(kapp->name()) + "/themes"); + TQStringList::Iterator it = t.begin(); bool remove; while(it != t.end()) { remove = false; - QStringList::Iterator jtend( dirs.end() ); - for(QStringList::Iterator jt = dirs.begin(); jt != jtend; ++jt) + TQStringList::Iterator jtend( dirs.end() ); + for(TQStringList::Iterator jt = dirs.begin(); jt != jtend; ++jt) { - if(QFileInfo(*it).dir().path() + "/" == *jt) + if(TQFileInfo(*it).dir().path() + "/" == *jt) { remove = true; break; @@ -101,9 +101,9 @@ void ThemesDlg::saveUserAddedThemes() SuperKarambaSettings::writeConfig(); } -QStringList ThemesDlg::themes() +TQStringList ThemesDlg::themes() { - QStringList result; + TQStringList result; ThemeWidget* w; for(uint i = 2; i < tableThemes->count(); ++i) @@ -118,9 +118,9 @@ QStringList ThemesDlg::themes() void ThemesDlg::populateListbox() { ThemeWidget* item; - QDir dir; - QStringList dirs; - QStringList t; + TQDir dir; + TQStringList dirs; + TQStringList t; KStandardDirs ksd; tableThemes->clear(); @@ -134,8 +134,8 @@ void ThemesDlg::populateListbox() item->buttonGo->setText(i18n("New Stuff...")); #ifdef HAVE_KNEWSTUFF item->buttonGo->setEnabled(true); - connect(item->buttonGo, SIGNAL(clicked()), - this, SLOT(getNewStuff())); + connect(item->buttonGo, TQT_SIGNAL(clicked()), + this, TQT_SLOT(getNewStuff())); #else item->buttonGo->setEnabled(false); #endif @@ -148,28 +148,28 @@ void ThemesDlg::populateListbox() item->setDescriptionText(i18n("Add local theme to the list.")); item->buttonGo->setProperty("stdItem", 18); item->buttonGo->setText(i18n("Open...")); - connect(item->buttonGo, SIGNAL(clicked()), - this, SLOT(openLocalTheme())); + connect(item->buttonGo, TQT_SIGNAL(clicked()), + this, TQT_SLOT(openLocalTheme())); tableThemes->insertItem(item); - dirs = ksd.findDirs("data", QString(kapp->name()) + "/themes"); + dirs = ksd.findDirs("data", TQString(kapp->name()) + "/themes"); // Get custom dirs from config here? - QStringList::Iterator itend( dirs.end() ); - for(QStringList::Iterator it = dirs.begin(); it != itend; ++it ) + TQStringList::Iterator itend( dirs.end() ); + for(TQStringList::Iterator it = dirs.begin(); it != itend; ++it ) { dir.setPath(*it); t = dir.entryList("*.skz; *.theme"); - for(QStringList::Iterator it = t.begin(); it != t.end(); ++it ) + for(TQStringList::Iterator it = t.begin(); it != t.end(); ++it ) { item = new ThemeWidget(new ThemeFile(dir.filePath(*it))); tableThemes->insertItem(item); item->buttonGo->setText(i18n("Uninstall")); - connect(item->buttonGo, SIGNAL(clicked()), - this, SLOT(uninstall())); + connect(item->buttonGo, TQT_SIGNAL(clicked()), + this, TQT_SLOT(uninstall())); } } t = SuperKarambaSettings::userAddedThemes(); - for(QStringList::Iterator it = t.begin(); it != t.end(); ++it ) + for(TQStringList::Iterator it = t.begin(); it != t.end(); ++it ) { ThemeFile* file = new ThemeFile(*it); @@ -178,8 +178,8 @@ void ThemesDlg::populateListbox() item = new ThemeWidget(file); tableThemes->insertItem(item); item->buttonGo->setText(i18n("Uninstall")); - connect(item->buttonGo, SIGNAL(clicked()), - this, SLOT(uninstall())); + connect(item->buttonGo, TQT_SIGNAL(clicked()), + this, TQT_SLOT(uninstall())); } else delete file; @@ -195,22 +195,22 @@ void ThemesDlg::addToDesktop() ThemeFile* tf = w->themeFile(); if(tf) { - (new karamba(tf->file(), QString()))->show(); + (new karamba(tf->file(), TQString()))->show(); } } } void ThemesDlg::openLocalTheme() { - QStringList fileNames; + TQStringList fileNames; fileNames = KFileDialog::getOpenFileNames(":<themes>", i18n("*.theme *.skz|Themes"), this, i18n("Open Themes")); - for(QStringList::Iterator it = fileNames.begin(); it != fileNames.end(); ++it) + for(TQStringList::Iterator it = fileNames.begin(); it != fileNames.end(); ++it) { ThemeFile file(*it); if(file.isValid()) - (new karamba(*it, QString()))->show(); + (new karamba(*it, TQString()))->show(); } } @@ -220,7 +220,7 @@ void ThemesDlg::getNewStuff() KConfig* config = KGlobal::config(); config->setGroup("KNewStuff"); config->writePathEntry("ProvidersUrl", - QString::fromLatin1("http://download.kde.org/khotnewstuff/karamba-providers.xml")); + TQString::fromLatin1("http://download.kde.org/khotnewstuff/karamba-providers.xml")); config->sync(); m_newStuffStatus = config->entryMap("KNewStuffStatus").keys(); //This check is b/c KNewStuff will download, throw an error, @@ -250,7 +250,7 @@ void ThemesDlg::selectionChanged(int index) w->showButton(true); } -int ThemesDlg::themeIndex(QString file) +int ThemesDlg::themeIndex(TQString file) { ThemeWidget* w; file = ThemeFile::canonicalFile(file); @@ -265,7 +265,7 @@ int ThemesDlg::themeIndex(QString file) return -1; } -void ThemesDlg::addSkzThemeToDialog(const QString &file) +void ThemesDlg::addSkzThemeToDialog(const TQString &file) { kdDebug() << "addSkzThemeToDialog(): file = " << file << endl; addThemeToList(file); @@ -273,13 +273,13 @@ void ThemesDlg::addSkzThemeToDialog(const QString &file) } void ThemesDlg::addThemeToDialog(const KArchiveDirectory *archiveDir, - const QString& destDir) + const TQString& destDir) { kdDebug() << "addThemeToDialog(): destDir = " << destDir << endl; - QStringList entries = archiveDir->entries(); + TQStringList entries = archiveDir->entries(); - QStringList::Iterator end( entries.end() ); - for(QStringList::Iterator it = entries.begin(); it != end; ++it) + TQStringList::Iterator end( entries.end() ); + for(TQStringList::Iterator it = entries.begin(); it != end; ++it) { if(archiveDir->entry(*it)->isDirectory()) { @@ -288,7 +288,7 @@ void ThemesDlg::addThemeToDialog(const KArchiveDirectory *archiveDir, } else { - QFileInfo fi(*it); + TQFileInfo fi(*it); if(fi.extension( FALSE ) == "theme") { addThemeToList(destDir + *it); @@ -298,13 +298,13 @@ void ThemesDlg::addThemeToDialog(const KArchiveDirectory *archiveDir, } } -void ThemesDlg::writeNewStuffConfig(const QString &file) +void ThemesDlg::writeNewStuffConfig(const TQString &file) { #ifdef HAVE_KNEWSTUFF KConfig* config = KGlobal::config(); - QStringList keys = config->entryMap("KNewStuffStatus").keys(); + TQStringList keys = config->entryMap("KNewStuffStatus").keys(); - for(QStringList::Iterator it = m_newStuffStatus.begin(); + for(TQStringList::Iterator it = m_newStuffStatus.begin(); it != m_newStuffStatus.end(); ++it) { keys.remove(*it); @@ -322,20 +322,20 @@ void ThemesDlg::configSanityCheck() { #ifdef HAVE_KNEWSTUFF KConfig* config = KGlobal::config(); - QStringList statusKeys = config->entryMap("KNewStuffStatus").keys(); - QStringList nameKeys = config->entryMap("KNewStuffNames").keys(); - QStringList removeList; + TQStringList statusKeys = config->entryMap("KNewStuffStatus").keys(); + TQStringList nameKeys = config->entryMap("KNewStuffNames").keys(); + TQStringList removeList; - for(QStringList::Iterator it = statusKeys.begin(); + for(TQStringList::Iterator it = statusKeys.begin(); it != statusKeys.end(); ++it) { - QString keyName(*it); + TQString keyName(*it); bool removeKey = true; config->setGroup("KNewStuffNames"); - for(QStringList::Iterator it2 = nameKeys.begin(); + for(TQStringList::Iterator it2 = nameKeys.begin(); it2 != nameKeys.end(); ++it2) { - QString tempName(config->readEntry(*it2)); + TQString tempName(config->readEntry(*it2)); if( tempName.compare(keyName) == 0) { removeKey = false; @@ -353,7 +353,7 @@ void ThemesDlg::configSanityCheck() #endif } -int ThemesDlg::addThemeToList(const QString &file) +int ThemesDlg::addThemeToList(const TQString &file) { kdDebug() << "addThemeToList() file: " << file << endl; int i = themeIndex(file); @@ -363,14 +363,14 @@ int ThemesDlg::addThemeToList(const QString &file) i = tableThemes->insertItem(item); item->buttonGo->setText(i18n("Uninstall")); - connect(item->buttonGo, SIGNAL(clicked()), - this, SLOT(uninstall())); + connect(item->buttonGo, TQT_SIGNAL(clicked()), + this, TQT_SLOT(uninstall())); } tableThemes->setSelected(i); return i; } -int ThemesDlg::addTheme(const QString& , const QString &file) +int ThemesDlg::addTheme(const TQString& , const TQString &file) { int i = addThemeToList(file); int result = -1; @@ -382,7 +382,7 @@ int ThemesDlg::addTheme(const QString& , const QString &file) return result; } -void ThemesDlg::removeTheme(const QString&, const QString& file, int instance) +void ThemesDlg::removeTheme(const TQString&, const TQString& file, int instance) { int i = themeIndex(file); @@ -392,12 +392,12 @@ void ThemesDlg::removeTheme(const QString&, const QString& file, int instance) karambaApp->buildToolTip(); } -void ThemesDlg::search(const QString&) +void ThemesDlg::search(const TQString&) { tableThemes->showItems(&filter, this); } -bool ThemesDlg::filter(int index, QWidget* widget, void* data) +bool ThemesDlg::filter(int index, TQWidget* widget, void* data) { if(index < 2) return true; @@ -409,7 +409,7 @@ bool ThemesDlg::filter(int index, QWidget* widget, void* data) if(w->instances() == 0) return false; - QString searchText = dlg->editSearch->text().lower(); + TQString searchText = dlg->editSearch->text().lower(); if(searchText.isEmpty()) { return true; @@ -424,7 +424,7 @@ bool ThemesDlg::filter(int index, QWidget* widget, void* data) return false; } -bool ThemesDlg::isDownloaded( const QString& path ) +bool ThemesDlg::isDownloaded( const TQString& path ) { kdDebug() << "isDownloaded path: " << path << endl; KConfig* config = KGlobal::config(); @@ -438,7 +438,7 @@ void ThemesDlg::uninstall() ThemeFile* tf = w->themeFile(); KURL trash("trash:/"); KURL theme(tf->file()); - QString tempPath(tf->path()); + TQString tempPath(tf->path()); karambaApp->dcopIface()->closeTheme(tf->name()); if(!KProtocolInfo::isKnownProtocol(trash)) @@ -450,8 +450,8 @@ void ThemesDlg::uninstall() //Don't move it to the trash if it is a local theme if(isDownloaded(tempPath)) { - QFileInfo remPath(tf->path()); - QDir remDir(remPath.dir()); + TQFileInfo remPath(tf->path()); + TQDir remDir(remPath.dir()); remDir.cdUp(); kdDebug() << "moving " << remDir.path() << " to the trash" << endl; KIO::move(remDir.path(), trash); @@ -460,7 +460,7 @@ void ThemesDlg::uninstall() //some themes have multiple .theme files //find all .themes that could be listed in the dialog for the directory removed - QPtrList<ThemeWidget> list; + TQPtrList<ThemeWidget> list; for(uint i = 2; i < tableThemes->count(); ++i) { ThemeWidget* tempW = static_cast<ThemeWidget*>(tableThemes->item(i)); @@ -480,7 +480,7 @@ void ThemesDlg::uninstall() // Remove theme from KNewStuffStatus KConfig* config = KGlobal::config(); config->setGroup("KNewStuffNames"); - QString name = config->readEntry(tempPath); + TQString name = config->readEntry(tempPath); if(!name.isEmpty()) { kdDebug() << "removing " << tempPath << " under KNewStuffNames from superkarambarc" @@ -500,8 +500,8 @@ void ThemesDlg::uninstall() kdDebug() << "encountered skz theme" << endl; if(isDownloaded(theme.path())) { - QFileInfo remPath(theme.path()); - QDir remDir(remPath.dir()); + TQFileInfo remPath(theme.path()); + TQDir remDir(remPath.dir()); kdDebug() << "moving " << remDir.path() << " to the trash" << endl; KIO::move(remDir.path(), trash); } @@ -510,7 +510,7 @@ void ThemesDlg::uninstall() // Remove theme from KNewStuffStatus KConfig* config = KGlobal::config(); config->setGroup("KNewStuffNames"); - QString name = config->readEntry(theme.path()); + TQString name = config->readEntry(theme.path()); if(!name.isEmpty()) { kdDebug() << "removing " << theme.path() << " from superkarambarc" << endl; @@ -525,9 +525,9 @@ void ThemesDlg::uninstall() selectionChanged(tableThemes->selected()); } -QStringList ThemesDlg::runningThemes() +TQStringList ThemesDlg::runningThemes() { - QStringList list; + TQStringList list; ThemeWidget* w; for(uint i = 2; i < tableThemes->count(); ++i) diff --git a/superkaramba/src/themesdlg.h b/superkaramba/src/themesdlg.h index 268a392..2c9976f 100644 --- a/superkaramba/src/themesdlg.h +++ b/superkaramba/src/themesdlg.h @@ -42,38 +42,38 @@ class ThemesDlg : public ThemesLayout Q_OBJECT public: - ThemesDlg(QWidget *parent = 0, const char *name = 0); + ThemesDlg(TQWidget *parent = 0, const char *name = 0); ~ThemesDlg(); - int addTheme(const QString &appId, const QString &file); - void removeTheme(const QString &appId, const QString &file, int instance); - int addThemeToList(const QString &file); - void addSkzThemeToDialog(const QString &file); - void addThemeToDialog(const KArchiveDirectory *archiveDir, const QString& destDir); - void writeNewStuffConfig(const QString &file); + int addTheme(const TQString &appId, const TQString &file); + void removeTheme(const TQString &appId, const TQString &file, int instance); + int addThemeToList(const TQString &file); + void addSkzThemeToDialog(const TQString &file); + void addThemeToDialog(const KArchiveDirectory *archiveDir, const TQString& destDir); + void writeNewStuffConfig(const TQString &file); void configSanityCheck(); - bool isDownloaded(const QString &path); + bool isDownloaded(const TQString &path); void saveUserAddedThemes(); - QStringList runningThemes(); + TQStringList runningThemes(); protected slots: virtual void addToDesktop(); virtual void selectionChanged(int); virtual void openLocalTheme(); virtual void getNewStuff(); - virtual void search(const QString& text); + virtual void search(const TQString& text); virtual void uninstall(); protected: - static bool filter(int index, QWidget* widget, void* data); + static bool filter(int index, TQWidget* widget, void* data); void populateListbox(); - int themeIndex(QString file); - QStringList themes(); + int themeIndex(TQString file); + TQStringList themes(); #ifdef HAVE_KNEWSTUFF private: SKNewStuff *mNewStuff; - QStringList m_newStuffStatus; + TQStringList m_newStuffStatus; #endif }; diff --git a/superkaramba/src/themewidget.cpp b/superkaramba/src/themewidget.cpp index c28e3cf..cad020c 100644 --- a/superkaramba/src/themewidget.cpp +++ b/superkaramba/src/themewidget.cpp @@ -22,10 +22,10 @@ #include <kpushbutton.h> #include <kdebug.h> #include <klocale.h> -#include <qlabel.h> -#include <qlayout.h> +#include <tqlabel.h> +#include <tqlayout.h> -ThemeWidget::ThemeWidget(QWidget *parent, const char *name) +ThemeWidget::ThemeWidget(TQWidget *parent, const char *name) : ThemeWidgetLayout(parent, name), m_themeFile(0) { running->setText(""); @@ -35,10 +35,10 @@ ThemeWidget::ThemeWidget(QWidget *parent, const char *name) ThemeWidget::ThemeWidget(ThemeFile* tf) : m_themeFile(tf) { - QPixmap pixmap = m_themeFile->icon(); + TQPixmap pixmap = m_themeFile->icon(); if(!pixmap.isNull()) icon->setPixmap(pixmap); - QString version; + TQString version; if(!m_themeFile->version().isEmpty()) version = " - " + m_themeFile->version(); themeName->setText( @@ -80,12 +80,12 @@ void ThemeWidget::updateRunning() running->setText(""); } -void ThemeWidget::setDescriptionText(QString text) +void ThemeWidget::setDescriptionText(TQString text) { description->setText(text); } -void ThemeWidget::setHeaderText(QString text) +void ThemeWidget::setHeaderText(TQString text) { themeName->setText(text); } diff --git a/superkaramba/src/themewidget.h b/superkaramba/src/themewidget.h index 4107716..011bbe9 100644 --- a/superkaramba/src/themewidget.h +++ b/superkaramba/src/themewidget.h @@ -31,7 +31,7 @@ class ThemeWidget : public ThemeWidgetLayout { Q_OBJECT public: - ThemeWidget(QWidget *parent = 0, const char *name = 0); + ThemeWidget(TQWidget *parent = 0, const char *name = 0); ThemeWidget(ThemeFile* tf); ~ThemeWidget(); @@ -41,8 +41,8 @@ class ThemeWidget : public ThemeWidgetLayout int instances() const { return m_instancePool.count(); }; void removeInstance(int instance); - void setDescriptionText(QString text); - void setHeaderText(QString text); + void setDescriptionText(TQString text); + void setHeaderText(TQString text); void showButton(bool show); protected: @@ -51,7 +51,7 @@ class ThemeWidget : public ThemeWidgetLayout private: ThemeFile* m_themeFile; - QValueList<int> m_instancePool; + TQValueList<int> m_instancePool; }; #endif diff --git a/superkaramba/src/uptimesensor.cpp b/superkaramba/src/uptimesensor.cpp index 5d794a2..1dcc280 100644 --- a/superkaramba/src/uptimesensor.cpp +++ b/superkaramba/src/uptimesensor.cpp @@ -7,7 +7,7 @@ * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * ***************************************************************************/ -#include <qglobal.h> +#include <tqglobal.h> #if defined __FreeBSD__ #include <sys/time.h> @@ -65,16 +65,16 @@ void UptimeSensor::update() secs = uptime % 60; } #else - QFile file("/proc/uptime"); - QString line; + TQFile file("/proc/uptime"); + TQString line; if ( file.open(IO_ReadOnly | IO_Translate) ) { // file opened successfully - QTextStream t( &file ); // use a text stream + TQTextStream t( &file ); // use a text stream line = t.readLine(); // line of text excluding '\n' file.close(); - QRegExp rx( "^\\d+" ); + TQRegExp rx( "^\\d+" ); rx.search(line); int uptime = rx.cap(0).toInt(); int days = uptime / 86400; @@ -86,11 +86,11 @@ void UptimeSensor::update() int secs = uptime; #endif - QString format; + TQString format; SensorParams *sp; Meter *meter; - QObjectListIt it( *objList ); + TQObjectListIt it( *objList ); while (it != 0) { sp = (SensorParams*)(*it); @@ -101,13 +101,13 @@ void UptimeSensor::update() { format = "%dd %h:%M"; } - format.replace( QRegExp("%d"), QString::number(days)); - format.replace( QRegExp("%H"), QString::number(hours).rightJustify(2,'0')); - format.replace( QRegExp("%M"), QString::number(mins).rightJustify(2,'0')); - format.replace( QRegExp("%S"), QString::number(secs).rightJustify(2,'0')); - format.replace( QRegExp("%h"), QString::number(hours)); - format.replace( QRegExp("%m"), QString::number(mins)); - format.replace( QRegExp("%s"), QString::number(secs)); + format.replace( TQRegExp("%d"), TQString::number(days)); + format.replace( TQRegExp("%H"), TQString::number(hours).rightJustify(2,'0')); + format.replace( TQRegExp("%M"), TQString::number(mins).rightJustify(2,'0')); + format.replace( TQRegExp("%S"), TQString::number(secs).rightJustify(2,'0')); + format.replace( TQRegExp("%h"), TQString::number(hours)); + format.replace( TQRegExp("%m"), TQString::number(mins)); + format.replace( TQRegExp("%s"), TQString::number(secs)); meter->setValue(format); ++it; diff --git a/superkaramba/src/uptimesensor.h b/superkaramba/src/uptimesensor.h index 061a876..5459956 100644 --- a/superkaramba/src/uptimesensor.h +++ b/superkaramba/src/uptimesensor.h @@ -11,11 +11,11 @@ #define UPTIMESENSOR_H #include "sensor.h" -#include <qfile.h> -#include <qtextstream.h> -#include <qstring.h> -#include <qregexp.h> -#include <qdatetime.h> +#include <tqfile.h> +#include <tqtextstream.h> +#include <tqstring.h> +#include <tqregexp.h> +#include <tqdatetime.h> class UptimeSensor : public Sensor { diff --git a/superkaramba/src/widget_python.cpp b/superkaramba/src/widget_python.cpp index 8d5d8e7..0948e39 100644 --- a/superkaramba/src/widget_python.cpp +++ b/superkaramba/src/widget_python.cpp @@ -27,7 +27,7 @@ #endif #include <Python.h> -#include <qobject.h> +#include <tqobject.h> #include "karamba.h" #include "meter.h" #include "meter_python.h" @@ -62,9 +62,9 @@ PyObject* py_get_widget_position(PyObject *, PyObject *args) long createWidgetMask(long widget, char* path) { karamba* currTheme = (karamba*)widget; - QBitmap bm; - QString maskpath; - QString rootPath; + TQBitmap bm; + TQString maskpath; + TQString rootPath; rootPath.setAscii(currTheme->theme().path().ascii()); currTheme->clearMask(); @@ -74,7 +74,7 @@ long createWidgetMask(long widget, char* path) if(currTheme->theme().isZipTheme()) { - QByteArray ba = currTheme->theme().readThemeFile(path); + TQByteArray ba = currTheme->theme().readThemeFile(path); bm.loadFromData(ba); } else diff --git a/superkaramba/src/xmmssensor.cpp b/superkaramba/src/xmmssensor.cpp index de7fa7f..268700b 100644 --- a/superkaramba/src/xmmssensor.cpp +++ b/superkaramba/src/xmmssensor.cpp @@ -10,14 +10,14 @@ #include "xmmssensor.h" #ifdef HAVE_XMMS -#include <qlibrary.h> +#include <tqlibrary.h> class XMMSSensor::XMMS { public: XMMS() : libxmms( 0 ) { - libxmms = new QLibrary( "xmms.so.1" ); + libxmms = new TQLibrary( "xmms.so.1" ); if ( !libxmms->load() ) { delete libxmms; @@ -101,7 +101,7 @@ public: } private: - QLibrary* libxmms; + TQLibrary* libxmms; bool (*xmms_remote_is_running)(int); bool (*xmms_remote_is_playing)(int); @@ -124,17 +124,17 @@ public: #endif // HAVE_XMMS -XMMSSensor::XMMSSensor( int interval, const QString &encoding ) +XMMSSensor::XMMSSensor( int interval, const TQString &encoding ) : Sensor( interval ), xmms( 0 ) { if( !encoding.isEmpty() ) { - codec = QTextCodec::codecForName( encoding.ascii() ); + codec = TQTextCodec::codecForName( encoding.ascii() ); if ( codec == 0) - codec = QTextCodec::codecForLocale(); + codec = TQTextCodec::codecForLocale(); } else - codec = QTextCodec::codecForLocale(); + codec = TQTextCodec::codecForLocale(); xmms = new XMMS(); @@ -146,15 +146,15 @@ XMMSSensor::~XMMSSensor() void XMMSSensor::update() { - QString format; + TQString format; SensorParams *sp; Meter *meter; - QObjectListIt it( *objList ); + TQObjectListIt it( *objList ); #ifdef HAVE_XMMS int pos; - QString title; + TQString title; int songLength = 0; int currentTime = 0; bool isPlaying = false; @@ -165,7 +165,7 @@ void XMMSSensor::update() isPlaying = xmms->isPlaying(0); pos = xmms->getPlaylistPos(0); qDebug("unicode start"); - title = codec->toUnicode( QCString( xmms->getPlaylistTitle( 0, pos ) ) ); + title = codec->toUnicode( TQCString( xmms->getPlaylistTitle( 0, pos ) ) ); qDebug("unicode end"); if( title.isEmpty() ) title = "XMMS"; @@ -210,19 +210,19 @@ void XMMSSensor::update() { - format.replace( QRegExp("%title", false), title ); + format.replace( TQRegExp("%title", false), title ); - format.replace( QRegExp("%length", false), QTime( 0,0,0 ). + format.replace( TQRegExp("%length", false), TQTime( 0,0,0 ). addMSecs( songLength ) .toString( "h:mm:ss" ) ); - format.replace( QRegExp("%time", false), QTime( 0,0,0 ). + format.replace( TQRegExp("%time", false), TQTime( 0,0,0 ). addMSecs( currentTime ) .toString( "h:mm:ss" ) ); if( isPlaying ) { - format.replace( QRegExp("%remain", false), QTime( 0,0,0 ). + format.replace( TQRegExp("%remain", false), TQTime( 0,0,0 ). addMSecs( songLength ) .addMSecs(-currentTime ) .toString( "h:mm:ss" ) ); @@ -230,7 +230,7 @@ void XMMSSensor::update() else { - format.replace( QRegExp("%remain", false), QTime( 0,0,0 ).toString("h:mm:ss" ) ); + format.replace( TQRegExp("%remain", false), TQTime( 0,0,0 ).toString("h:mm:ss" ) ); } meter->setValue(format); } @@ -251,7 +251,7 @@ void XMMSSensor::setMaxValue( SensorParams *sp) { Meter *meter; meter = sp->getMeter(); - QString f; + TQString f; f = sp->getParam("FORMAT"); if ( f == "%full" ) diff --git a/superkaramba/src/xmmssensor.h b/superkaramba/src/xmmssensor.h index 622eb8d..bda6b88 100644 --- a/superkaramba/src/xmmssensor.h +++ b/superkaramba/src/xmmssensor.h @@ -14,9 +14,9 @@ #include <config.h> #endif -#include <qdatetime.h> -#include <qregexp.h> -#include <qtextcodec.h> +#include <tqdatetime.h> +#include <tqregexp.h> +#include <tqtextcodec.h> #include "sensor.h" @@ -24,14 +24,14 @@ class XMMSSensor : public Sensor { Q_OBJECT public: - XMMSSensor( int interval, const QString &encoding=QString::null ); + XMMSSensor( int interval, const TQString &encoding=TQString::null ); ~XMMSSensor(); void update(); void setMaxValue( SensorParams *); bool hasXMMS() const; private: - QTextCodec *codec; + TQTextCodec *codec; class XMMS; XMMS *xmms; |