diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-27 05:58:16 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-27 05:58:16 +0000 |
commit | f636ba5ba2df9d34d56b1c85f24c6598fa1cb645 (patch) | |
tree | 5365045e6bce685a7cbaeb81b4797a719e86089f /src | |
parent | 63862fdfcb61f302ef69e86d40772bb1318d3763 (diff) | |
download | kdiff3-f636ba5ba2df9d34d56b1c85f24c6598fa1cb645.tar.gz kdiff3-f636ba5ba2df9d34d56b1c85f24c6598fa1cb645.zip |
TQt4 port kdiff3
This enables compilation under both Qt3 and Qt4
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/kdiff3@1238464 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'src')
34 files changed, 3017 insertions, 3013 deletions
diff --git a/src/Makefile.am b/src/Makefile.am index 151e53d..58c0298 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -46,7 +46,7 @@ libkdiff3part_la_SOURCES = kdiff3_part.cpp kdiff3.cpp directorymergewindow.cpp \ merger.cpp pdiff.cpp difftextwindow.cpp diff.cpp optiondialog.cpp \ mergeresultwindow.cpp fileaccess.cpp gnudiff_analyze.cpp gnudiff_io.cpp gnudiff_xmalloc.cpp \ common.cpp smalldialogs.cpp -libkdiff3part_la_LDFLAGS = -module $(KDE_PLUGIN) $(all_libraries) +libkdiff3part_la_LDFLAGS = -module $(KDE_PLUGIN) $(all_libraries) $(LIB_QT) libkdiff3part_la_LIBADD = $(LIB_KDEPRINT) $(LIB_KPARTS) $(LIB_KFILE) # this is where the desktop file will go diff --git a/src/Makefile.qt b/src/Makefile.qt index 44de44b..bc29fd3 100644 --- a/src/Makefile.qt +++ b/src/Makefile.qt @@ -19,7 +19,7 @@ YACCFLAGS= -d INCPATH = -I$(QTDIR)/mkspecs/default -I. -Ikreplacements -I/usr/include -I$(QTDIR)/include LINK = g++ LFLAGS = -LIBS = $(SUBLIBS) -L/usr/lib/ -L$(QTDIR)/lib/ -L/usr/X11R6/lib/ -lqt-mt -lXext -lX11 -lm -lpthread +LIBS = $(SUBLIBS) -L/usr/lib/ -L$(QTDIR)/lib/ -L/usr/X11R6/lib/ -lXext -lX11 -lm -lpthread AR = ar cqs RANLIB = MOC = $(QTDIR)/bin/moc diff --git a/src/ccInstHelper.cpp b/src/ccInstHelper.cpp index 055e2d6..643f8f6 100644 --- a/src/ccInstHelper.cpp +++ b/src/ccInstHelper.cpp @@ -260,7 +260,7 @@ int integrateWithClearCase( const char* subCommand, const char* kdiff3CommandPat for( ; i!=lineItemList.end(); ++i ) { LineItem& li = *i; - if ((int)toUpper(li.command).find("KDIFF3")>=0) + if ((int)toUpper(li.command).tqfind("KDIFF3")>=0) { std::list<LineItem>::const_iterator j = lineItemListBak.begin(); for (;j!=lineItemListBak.end();++j) diff --git a/src/common.cpp b/src/common.cpp index a05920e..4249daf 100644 --- a/src/common.cpp +++ b/src/common.cpp @@ -20,12 +20,12 @@ #include "common.h" #include <map> -#include <qfont.h> -#include <qcolor.h> -#include <qsize.h> -#include <qpoint.h> -#include <qstringlist.h> -#include <qtextstream.h> +#include <tqfont.h> +#include <tqcolor.h> +#include <tqsize.h> +#include <tqpoint.h> +#include <tqstringlist.h> +#include <tqtextstream.h> ValueMap::ValueMap() { @@ -35,58 +35,58 @@ ValueMap::~ValueMap() { } -void ValueMap::save( QTextStream& ts ) +void ValueMap::save( TQTextStream& ts ) { - std::map<QString,QString>::iterator i; + std::map<TQString,TQString>::iterator i; for( i=m_map.begin(); i!=m_map.end(); ++i) { - QString key = i->first; - QString val = i->second; + TQString key = i->first; + TQString val = i->second; ts << key << "=" << val << "\n"; } } -QString ValueMap::getAsString() +TQString ValueMap::getAsString() { - QString result; - std::map<QString,QString>::iterator i; + TQString result; + std::map<TQString,TQString>::iterator i; for( i=m_map.begin(); i!=m_map.end(); ++i) { - QString key = i->first; - QString val = i->second; + TQString key = i->first; + TQString val = i->second; result += key + "=" + val + "\n"; } return result; } -void ValueMap::load( QTextStream& ts ) +void ValueMap::load( TQTextStream& ts ) { while ( !ts.eof() ) { // until end of file... - QString s = ts.readLine(); // line of text excluding '\n' - int pos = s.find('='); + TQString s = ts.readLine(); // line of text excluding '\n' + int pos = s.tqfind('='); if( pos > 0 ) // seems not to have a tag { - QString key = s.left(pos); - QString val = s.mid(pos+1); + TQString key = s.left(pos); + TQString val = s.mid(pos+1); m_map[key] = val; } } } /* -void ValueMap::load( const QString& s ) +void ValueMap::load( const TQString& s ) { int pos=0; while ( pos<(int)s.length() ) { // until end of file... - int pos2 = s.find('=', pos); - int pos3 = s.find('\n', pos2 ); + int pos2 = s.tqfind('=', pos); + int pos3 = s.tqfind('\n', pos2 ); if (pos3<0) pos3=s.length(); if( pos2 > 0 ) // seems not to have a tag { - QString key = s.mid(pos, pos2-pos); - QString val = s.mid(pos2+1, pos3-pos2-1); + TQString key = s.mid(pos, pos2-pos); + TQString val = s.mid(pos2+1, pos3-pos2-1); m_map[key] = val; } pos = pos3; @@ -96,7 +96,7 @@ void ValueMap::load( const QString& s ) // safeStringJoin and safeStringSplit allow to convert a stringlist into a string and back // safely, even if the individual strings in the list contain the separator character. -QString safeStringJoin(const QStringList& sl, char sepChar, char metaChar ) +TQString safeStringJoin(const TQStringList& sl, char sepChar, char metaChar ) { // Join the strings in the list, using the separator ',' // If a string contains the separator character, it will be replaced with "\,". @@ -104,19 +104,19 @@ QString safeStringJoin(const QStringList& sl, char sepChar, char metaChar ) assert(sepChar!=metaChar); - QString sep; + TQString sep; sep += sepChar; - QString meta; + TQString meta; meta += metaChar; - QString safeString; + TQString safeString; - QStringList::const_iterator i; + TQStringList::const_iterator i; for (i=sl.begin(); i!=sl.end(); ++i) { - QString s = *i; - s.replace(meta, meta+meta); // "\" -> "\\" - s.replace(sep, meta+sep); // "," -> "\," + TQString s = *i; + s.tqreplace(meta, meta+meta); // "\" -> "\\" + s.tqreplace(sep, meta+sep); // "," -> "\," if ( i==sl.begin() ) safeString = s; else @@ -126,14 +126,14 @@ QString safeStringJoin(const QStringList& sl, char sepChar, char metaChar ) } // Split a string that was joined with safeStringJoin -QStringList safeStringSplit(const QString& s, char sepChar, char metaChar ) +TQStringList safeStringSplit(const TQString& s, char sepChar, char metaChar ) { assert(sepChar!=metaChar); - QStringList sl; + TQStringList sl; // Miniparser int i=0; int len=s.length(); - QString b; + TQString b; for(i=0;i<len;++i) { if ( i+1<len && s[i]==metaChar && s[i+1]==metaChar ){ b+=metaChar; ++i; } @@ -153,26 +153,26 @@ QStringList safeStringSplit(const QString& s, char sepChar, char metaChar ) -static QString numStr(int n) +static TQString numStr(int n) { - QString s; + TQString s; s.setNum( n ); return s; } -static QString subSection( const QString& s, int idx, char sep ) +static TQString subSection( const TQString& s, int idx, char sep ) { int pos=0; while( idx>0 ) { - pos = s.find( sep, pos ); + pos = s.tqfind( sep, pos ); --idx; if (pos<0) break; ++pos; } if ( pos>=0 ) { - int pos2 = s.find( sep, pos ); + int pos2 = s.tqfind( sep, pos ); if ( pos2>0 ) return s.mid(pos, pos2-pos); else @@ -182,61 +182,61 @@ static QString subSection( const QString& s, int idx, char sep ) return ""; } -static int num( QString& s, int idx ) +static int num( TQString& s, int idx ) { return subSection( s, idx, ',').toInt(); } -void ValueMap::writeEntry(const QString& k, const QFont& v ) +void ValueMap::writeEntry(const TQString& k, const TQFont& v ) { - m_map[k] = v.family() + "," + QString::number(v.pointSize()) + "," + (v.bold() ? "bold" : "normal"); + m_map[k] = v.family() + "," + TQString::number(v.pointSize()) + "," + (v.bold() ? "bold" : "normal"); } -void ValueMap::writeEntry(const QString& k, const QColor& v ) +void ValueMap::writeEntry(const TQString& k, const TQColor& v ) { m_map[k] = numStr(v.red()) + "," + numStr(v.green()) + "," + numStr(v.blue()); } -void ValueMap::writeEntry(const QString& k, const QSize& v ) +void ValueMap::writeEntry(const TQString& k, const TQSize& v ) { m_map[k] = numStr(v.width()) + "," + numStr(v.height()); } -void ValueMap::writeEntry(const QString& k, const QPoint& v ) +void ValueMap::writeEntry(const TQString& k, const TQPoint& v ) { m_map[k] = numStr(v.x()) + "," + numStr(v.y()); } -void ValueMap::writeEntry(const QString& k, int v ) +void ValueMap::writeEntry(const TQString& k, int v ) { m_map[k] = numStr(v); } -void ValueMap::writeEntry(const QString& k, bool v ) +void ValueMap::writeEntry(const TQString& k, bool v ) { m_map[k] = numStr(v); } -void ValueMap::writeEntry(const QString& k, const QString& v ) +void ValueMap::writeEntry(const TQString& k, const TQString& v ) { m_map[k] = v; } -void ValueMap::writeEntry(const QString& k, const char* v ) +void ValueMap::writeEntry(const TQString& k, const char* v ) { m_map[k] = v; } -void ValueMap::writeEntry(const QString& k, const QStringList& v, char separator ) +void ValueMap::writeEntry(const TQString& k, const TQStringList& v, char separator ) { m_map[k] = safeStringJoin(v, separator); } -QFont ValueMap::readFontEntry(const QString& k, QFont* defaultVal ) +TQFont ValueMap::readFontEntry(const TQString& k, TQFont* defaultVal ) { - QFont f = *defaultVal; - std::map<QString,QString>::iterator i = m_map.find( k ); + TQFont f = *defaultVal; + std::map<TQString,TQString>::iterator i = m_map.find( k ); if ( i!=m_map.end() ) { f.setFamily( subSection( i->second, 0, ',' ) ); @@ -248,76 +248,76 @@ QFont ValueMap::readFontEntry(const QString& k, QFont* defaultVal ) return f; } -QColor ValueMap::readColorEntry(const QString& k, QColor* defaultVal ) +TQColor ValueMap::readColorEntry(const TQString& k, TQColor* defaultVal ) { - QColor c= *defaultVal; - std::map<QString,QString>::iterator i = m_map.find( k ); + TQColor c= *defaultVal; + std::map<TQString,TQString>::iterator i = m_map.find( k ); if ( i!=m_map.end() ) { - QString s = i->second; - c = QColor( num(s,0),num(s,1),num(s,2) ); + TQString s = i->second; + c = TQColor( num(s,0),num(s,1),num(s,2) ); } return c; } -QSize ValueMap::readSizeEntry(const QString& k, QSize* defaultVal ) +TQSize ValueMap::readSizeEntry(const TQString& k, TQSize* defaultVal ) { - QSize size = defaultVal ? *defaultVal : QSize(600,400); - std::map<QString,QString>::iterator i = m_map.find( k ); + TQSize size = defaultVal ? *defaultVal : TQSize(600,400); + std::map<TQString,TQString>::iterator i = m_map.find( k ); if ( i!=m_map.end() ) { - QString s = i->second; - size = QSize( num(s,0),num(s,1) ); + TQString s = i->second; + size = TQSize( num(s,0),num(s,1) ); } return size; } -QPoint ValueMap::readPointEntry(const QString& k, QPoint* defaultVal) +TQPoint ValueMap::readPointEntry(const TQString& k, TQPoint* defaultVal) { - QPoint point = defaultVal ? *defaultVal : QPoint(0,0); - std::map<QString,QString>::iterator i = m_map.find( k ); + TQPoint point = defaultVal ? *defaultVal : TQPoint(0,0); + std::map<TQString,TQString>::iterator i = m_map.find( k ); if ( i!=m_map.end() ) { - QString s = i->second; - point = QPoint( num(s,0),num(s,1) ); + TQString s = i->second; + point = TQPoint( num(s,0),num(s,1) ); } return point; } -bool ValueMap::readBoolEntry(const QString& k, bool bDefault ) +bool ValueMap::readBoolEntry(const TQString& k, bool bDefault ) { bool b = bDefault; - std::map<QString,QString>::iterator i = m_map.find( k ); + std::map<TQString,TQString>::iterator i = m_map.find( k ); if ( i!=m_map.end() ) { - QString s = i->second; + TQString s = i->second; b = (bool)num(s,0); } return b; } -int ValueMap::readNumEntry(const QString& k, int iDefault ) +int ValueMap::readNumEntry(const TQString& k, int iDefault ) { int ival = iDefault; - std::map<QString,QString>::iterator i = m_map.find( k ); + std::map<TQString,TQString>::iterator i = m_map.find( k ); if ( i!=m_map.end() ) { - QString s = i->second; + TQString s = i->second; ival = num(s,0); } return ival; } -QString ValueMap::readEntry(const QString& k, const QString& sDefault ) +TQString ValueMap::readEntry(const TQString& k, const TQString& sDefault ) { - QString sval = sDefault; - std::map<QString,QString>::iterator i = m_map.find( k ); + TQString sval = sDefault; + std::map<TQString,TQString>::iterator i = m_map.find( k ); if ( i!=m_map.end() ) { sval = i->second; @@ -326,11 +326,11 @@ QString ValueMap::readEntry(const QString& k, const QString& sDefault ) return sval; } -QStringList ValueMap::readListEntry(const QString& k, const QStringList& defaultVal, char separator ) +TQStringList ValueMap::readListEntry(const TQString& k, const TQStringList& defaultVal, char separator ) { - QStringList strList; + TQStringList strList; - std::map<QString,QString>::iterator i = m_map.find( k ); + std::map<TQString,TQString>::iterator i = m_map.find( k ); if ( i!=m_map.end() ) { strList = safeStringSplit( i->second, separator ); diff --git a/src/common.h b/src/common.h index b78d5bc..c5b27d3 100644 --- a/src/common.h +++ b/src/common.h @@ -66,48 +66,48 @@ T minMaxLimiter( T d, T minimum, T maximum ) } #include <map> -#include <qstring.h> -class QFont; -class QColor; -class QSize; -class QPoint; -class QStringList; -class QTextStream; +#include <tqstring.h> +class TQFont; +class TQColor; +class TQSize; +class TQPoint; +class TQStringList; +class TQTextStream; class ValueMap { private: - std::map<QString,QString> m_map; + std::map<TQString,TQString> m_map; public: ValueMap(); virtual ~ValueMap(); - void save( QTextStream& ts ); - void load( QTextStream& ts ); - QString getAsString(); - // void load( const QString& s ); - - virtual void writeEntry(const QString&, const QFont& ); - virtual void writeEntry(const QString&, const QColor& ); - virtual void writeEntry(const QString&, const QSize& ); - virtual void writeEntry(const QString&, const QPoint& ); - virtual void writeEntry(const QString&, int ); - virtual void writeEntry(const QString&, bool ); - virtual void writeEntry(const QString&, const QStringList&, char separator ); - virtual void writeEntry(const QString&, const QString& ); - virtual void writeEntry(const QString&, const char* ); - - virtual QFont readFontEntry (const QString&, QFont* defaultVal ); - virtual QColor readColorEntry(const QString&, QColor* defaultVal ); - virtual QSize readSizeEntry (const QString&, QSize* defaultVal ); - virtual QPoint readPointEntry(const QString&, QPoint* defaultVal ); - virtual bool readBoolEntry (const QString&, bool bDefault ); - virtual int readNumEntry (const QString&, int iDefault ); - virtual QStringList readListEntry (const QString&, const QStringList& defaultVal, char separator ); - virtual QString readEntry (const QString&, const QString& ); + void save( TQTextStream& ts ); + void load( TQTextStream& ts ); + TQString getAsString(); + // void load( const TQString& s ); + + virtual void writeEntry(const TQString&, const TQFont& ); + virtual void writeEntry(const TQString&, const TQColor& ); + virtual void writeEntry(const TQString&, const TQSize& ); + virtual void writeEntry(const TQString&, const TQPoint& ); + virtual void writeEntry(const TQString&, int ); + virtual void writeEntry(const TQString&, bool ); + virtual void writeEntry(const TQString&, const TQStringList&, char separator ); + virtual void writeEntry(const TQString&, const TQString& ); + virtual void writeEntry(const TQString&, const char* ); + + virtual TQFont readFontEntry (const TQString&, TQFont* defaultVal ); + virtual TQColor readColorEntry(const TQString&, TQColor* defaultVal ); + virtual TQSize readSizeEntry (const TQString&, TQSize* defaultVal ); + virtual TQPoint readPointEntry(const TQString&, TQPoint* defaultVal ); + virtual bool readBoolEntry (const TQString&, bool bDefault ); + virtual int readNumEntry (const TQString&, int iDefault ); + virtual TQStringList readListEntry (const TQString&, const TQStringList& defaultVal, char separator ); + virtual TQString readEntry (const TQString&, const TQString& ); }; -QStringList safeStringSplit(const QString& s, char sepChar=',', char metaChar='\\' ); -QString safeStringJoin(const QStringList& sl, char sepChar=',', char metaChar='\\' ); +TQStringList safeStringSplit(const TQString& s, char sepChar=',', char metaChar='\\' ); +TQString safeStringJoin(const TQStringList& sl, char sepChar=',', char metaChar='\\' ); #endif diff --git a/src/diff.cpp b/src/diff.cpp index 7875bc6..9ead57f 100644 --- a/src/diff.cpp +++ b/src/diff.cpp @@ -25,9 +25,9 @@ #include <kmessagebox.h> #include <klocale.h> -#include <qfileinfo.h> -#include <qdir.h> -#include <qtextcodec.h> +#include <tqfileinfo.h> +#include <tqdir.h> +#include <tqtextcodec.h> #include <map> #include <assert.h> @@ -69,11 +69,11 @@ bool equal( const LineData& l1, const LineData& l2, bool bStrict ) return false; // Ignore white space diff - const QChar* p1 = l1.pLine; - const QChar* p1End = p1 + l1.size; + const TQChar* p1 = l1.pLine; + const TQChar* p1End = p1 + l1.size; - const QChar* p2 = l2.pLine; - const QChar* p2End = p2 + l2.size; + const TQChar* p2 = l2.pLine; + const TQChar* p2End = p2 + l2.size; if ( g_bIgnoreWhiteSpace ) { @@ -113,7 +113,7 @@ bool equal( const LineData& l1, const LineData& l2, bool bStrict ) } -static bool isLineOrBufEnd( const QChar* p, int i, int size ) +static bool isLineOrBufEnd( const TQChar* p, int i, int size ) { return i>=size // End of file @@ -173,7 +173,7 @@ void SourceData::reset() } } -void SourceData::setFilename( const QString& filename ) +void SourceData::setFilename( const TQString& filename ) { if (filename.isEmpty()) { @@ -206,17 +206,17 @@ void SourceData::setOptionDialog( OptionDialog* pOptionDialog ) m_pOptionDialog = pOptionDialog; } -QString SourceData::getFilename() +TQString SourceData::getFilename() { return m_fileAccess.absFilePath(); } -QString SourceData::getAliasName() +TQString SourceData::getAliasName() { return m_aliasName.isEmpty() ? m_fileAccess.prettyAbsPath() : m_aliasName; } -void SourceData::setAliasName( const QString& name ) +void SourceData::setAliasName( const TQString& name ) { m_aliasName = name; } @@ -224,7 +224,7 @@ void SourceData::setAliasName( const QString& name ) void SourceData::setFileAccess( const FileAccess& fileAccess ) { m_fileAccess = fileAccess; - m_aliasName = QString(); + m_aliasName = TQString(); if ( !m_tempInputFileName.isEmpty() ) { FileAccess::removeFile( m_tempInputFileName ); @@ -232,7 +232,7 @@ void SourceData::setFileAccess( const FileAccess& fileAccess ) } } -void SourceData::setData( const QString& data ) +void SourceData::setData( const TQString& data ) { // Create a temp file for preprocessing: if ( m_tempInputFileName.isEmpty() ) @@ -241,7 +241,7 @@ void SourceData::setData( const QString& data ) } FileAccess f( m_tempInputFileName ); - bool bSuccess = f.writeFile( QTextCodec::codecForName("UTF-8")->fromUnicode(data), data.length() ); + bool bSuccess = f.writeFile( TQTextCodec::codecForName("UTF-8")->fromUnicode(data), data.length() ); if ( !bSuccess ) { KMessageBox::error( m_pOptionDialog, i18n("Writing clipboard data to temp file failed.") ); @@ -308,7 +308,7 @@ void SourceData::FileData::reset() m_bIsText = true; } -bool SourceData::FileData::readFile( const QString& filename ) +bool SourceData::FileData::readFile( const TQString& filename ) { reset(); if ( filename.isEmpty() ) { return true; } @@ -329,12 +329,12 @@ bool SourceData::FileData::readFile( const QString& filename ) return bSuccess; } -bool SourceData::saveNormalDataAs( const QString& fileName ) +bool SourceData::saveNormalDataAs( const TQString& fileName ) { return m_normalData.writeFile( fileName ); } -bool SourceData::FileData::writeFile( const QString& filename ) +bool SourceData::FileData::writeFile( const TQString& filename ) { if ( filename.isEmpty() ) { return true; } @@ -353,71 +353,71 @@ void SourceData::FileData::copyBufFrom( const FileData& src ) } // Convert the input file from input encoding to output encoding and write it to the output file. -static bool convertFileEncoding( const QString& fileNameIn, QTextCodec* pCodecIn, - const QString& fileNameOut, QTextCodec* pCodecOut ) +static bool convertFileEncoding( const TQString& fileNameIn, TQTextCodec* pCodecIn, + const TQString& fileNameOut, TQTextCodec* pCodecOut ) { - QFile in( fileNameIn ); + TQFile in( fileNameIn ); if ( ! in.open(IO_ReadOnly ) ) return false; - QTextStream inStream( &in ); + TQTextStream inStream( &in ); inStream.setCodec( pCodecIn ); - //inStream.setAutoDetectUnicode( false ); //not available in Qt3, will always detect UCS2 + //inStream.setAutoDetectUnicode( false ); //not available in TQt3, will always detect UCS2 - QFile out( fileNameOut ); + TQFile out( fileNameOut ); if ( ! out.open( IO_WriteOnly ) ) return false; - QTextStream outStream( &out ); + TQTextStream outStream( &out ); outStream.setCodec( pCodecOut ); - QString data = inStream.read(); + TQString data = inStream.read(); outStream << data; return true; } -static QTextCodec* detectEncoding( const char* buf, long size, long& skipBytes ) +static TQTextCodec* detectEncoding( const char* buf, long size, long& skipBytes ) { if (size>=2) { - skipBytes = 0; // In Qt3 UTF-16LE can only be used if autodetected. + skipBytes = 0; // In TQt3 UTF-16LE can only be used if autodetected. if (buf[0]=='\xFF' && buf[1]=='\xFE' ) - return QTextCodec::codecForName( "ISO-10646-UCS2" );// "UTF-16LE" + return TQTextCodec::codecForName( "ISO-10646-UCS2" );// "UTF-16LE" if (buf[0]=='\xFE' && buf[1]=='\xFF' ) - return QTextCodec::codecForName( "ISO-10646-UCS2" );// "UTF-16BE". Qt3 autodetects the difference but has no name for it. + return TQTextCodec::codecForName( "ISO-10646-UCS2" );// "UTF-16BE". TQt3 autodetects the difference but has no name for it. } if (size>=3) { skipBytes = 3; if (buf[0]=='\xEF' && buf[1]=='\xBB' && buf[2]=='\xBF' ) - return QTextCodec::codecForName( "UTF-8-BOM" ); + return TQTextCodec::codecForName( "UTF-8-BOM" ); } skipBytes = 0; return 0; } -QTextCodec* SourceData::detectEncoding( const QString& fileName, QTextCodec* pFallbackCodec ) +TQTextCodec* SourceData::detectEncoding( const TQString& fileName, TQTextCodec* pFallbackCodec ) { - QFile f(fileName); + TQFile f(fileName); if ( f.open(IO_ReadOnly) ) { char buf[4]; long size = f.readBlock( buf, sizeof(buf) ); long skipBytes = 0; - QTextCodec* pCodec = ::detectEncoding( buf, size, skipBytes ); + TQTextCodec* pCodec = ::detectEncoding( buf, size, skipBytes ); if (pCodec) return pCodec; } return pFallbackCodec; } -void SourceData::readAndPreprocess( QTextCodec* pEncoding, bool bAutoDetectUnicode ) +void SourceData::readAndPreprocess( TQTextCodec* pEncoding, bool bAutoDetectUnicode ) { m_pEncoding = pEncoding; - QString fileNameIn1; - QString fileNameOut1; - QString fileNameIn2; - QString fileNameOut2; + TQString fileNameIn1; + TQString fileNameOut1; + TQString fileNameIn2; + TQString fileNameOut2; bool bTempFileFromClipboard = !m_fileAccess.isValid(); @@ -443,10 +443,10 @@ void SourceData::readAndPreprocess( QTextCodec* pEncoding, bool bAutoDetectUnico else // The input was set via setData(), probably from clipboard. { fileNameIn1 = m_tempInputFileName; - m_pEncoding = QTextCodec::codecForName("UTF-8"); + m_pEncoding = TQTextCodec::codecForName("UTF-8"); } - QTextCodec* pEncoding1 = m_pEncoding; - QTextCodec* pEncoding2 = m_pEncoding; + TQTextCodec* pEncoding1 = m_pEncoding; + TQTextCodec* pEncoding2 = m_pEncoding; m_normalData.reset(); m_lmppData.reset(); @@ -458,10 +458,10 @@ void SourceData::readAndPreprocess( QTextCodec* pEncoding, bool bAutoDetectUnico { #ifdef _WIN32 - QString catCmd = "type"; - fileNameIn1.replace( '/', "\\" ); + TQString catCmd = "type"; + fileNameIn1.tqreplace( '/', "\\" ); #else - QString catCmd = "cat"; + TQString catCmd = "cat"; #endif // Run the first preprocessor @@ -472,7 +472,7 @@ void SourceData::readAndPreprocess( QTextCodec* pEncoding, bool bAutoDetectUnico } else { - QString fileNameInPP = fileNameIn1; + TQString fileNameInPP = fileNameIn1; if ( pEncoding1 != m_pOptionDialog->m_pEncodingPP ) { @@ -482,9 +482,9 @@ void SourceData::readAndPreprocess( QTextCodec* pEncoding, bool bAutoDetectUnico convertFileEncoding( fileNameIn1, pEncoding, fileNameInPP, pEncoding1 ); } - QString ppCmd = m_pOptionDialog->m_PreProcessorCmd; + TQString ppCmd = m_pOptionDialog->m_PreProcessorCmd; fileNameOut1 = FileAccess::tempFileName(); - QString cmd = catCmd + " \"" + fileNameInPP + "\" | " + ppCmd + " >\"" + fileNameOut1+"\""; + TQString cmd = catCmd + " \"" + fileNameInPP + "\" | " + ppCmd + " >\"" + fileNameOut1+"\""; ::system( encodeString(cmd) ); bool bSuccess = m_normalData.readFile( fileNameOut1 ); if ( fileInSize >0 && ( !bSuccess || m_normalData.m_size==0 ) ) @@ -492,7 +492,7 @@ void SourceData::readAndPreprocess( QTextCodec* pEncoding, bool bAutoDetectUnico KMessageBox::error(m_pOptionDialog, i18n("Preprocessing possibly failed. Check this command:\n\n %1" "\n\nThe preprocessing command will be disabled now." - ).arg(cmd) ); + ).tqarg(cmd) ); m_pOptionDialog->m_PreProcessorCmd = ""; m_normalData.readFile( fileNameIn1 ); pEncoding1 = m_pEncoding; @@ -507,7 +507,7 @@ void SourceData::readAndPreprocess( QTextCodec* pEncoding, bool bAutoDetectUnico if ( ! m_pOptionDialog->m_LineMatchingPreProcessorCmd.isEmpty() ) { fileNameIn2 = fileNameOut1.isEmpty() ? fileNameIn1 : fileNameOut1; - QString fileNameInPP = fileNameIn2; + TQString fileNameInPP = fileNameIn2; pEncoding2 = pEncoding1; if ( pEncoding2 != m_pOptionDialog->m_pEncodingPP ) { @@ -517,9 +517,9 @@ void SourceData::readAndPreprocess( QTextCodec* pEncoding, bool bAutoDetectUnico convertFileEncoding( fileNameIn2, pEncoding1, fileNameInPP, pEncoding2 ); } - QString ppCmd = m_pOptionDialog->m_LineMatchingPreProcessorCmd; + TQString ppCmd = m_pOptionDialog->m_LineMatchingPreProcessorCmd; fileNameOut2 = FileAccess::tempFileName(); - QString cmd = catCmd + " \"" + fileNameInPP + "\" | " + ppCmd + " >\"" + fileNameOut2 + "\""; + TQString cmd = catCmd + " \"" + fileNameInPP + "\" | " + ppCmd + " >\"" + fileNameOut2 + "\""; ::system( encodeString(cmd) ); bool bSuccess = m_lmppData.readFile( fileNameOut2 ); if ( FileAccess(fileNameIn2).size()>0 && ( !bSuccess || m_lmppData.m_size==0 ) ) @@ -527,7 +527,7 @@ void SourceData::readAndPreprocess( QTextCodec* pEncoding, bool bAutoDetectUnico KMessageBox::error(m_pOptionDialog, i18n("The line-matching-preprocessing possibly failed. Check this command:\n\n %1" "\n\nThe line-matching-preprocessing command will be disabled now." - ).arg(cmd) ); + ).tqarg(cmd) ); m_pOptionDialog->m_LineMatchingPreProcessorCmd = ""; m_lmppData.readFile( fileNameIn2 ); } @@ -557,7 +557,7 @@ void SourceData::readAndPreprocess( QTextCodec* pEncoding, bool bAutoDetectUnico m_lmppData.m_v.resize( m_normalData.m_vSize ); for(int i=m_lmppData.m_vSize; i<m_normalData.m_vSize; ++i ) { // Set all empty lines to point to the end of the buffer. - m_lmppData.m_v[i].pLine = m_lmppData.m_unicodeBuf.unicode()+m_lmppData.m_unicodeBuf.length(); + m_lmppData.m_v[i].pLine = m_lmppData.m_tqunicodeBuf.tqunicode()+m_lmppData.m_tqunicodeBuf.length(); } m_lmppData.m_vSize = m_normalData.m_vSize; @@ -567,8 +567,8 @@ void SourceData::readAndPreprocess( QTextCodec* pEncoding, bool bAutoDetectUnico if ( m_pOptionDialog->m_bIgnoreCase ) { int i; - QChar* pBuf = const_cast<QChar*>(m_lmppData.m_unicodeBuf.unicode()); - int ucSize = m_lmppData.m_unicodeBuf.length(); + TQChar* pBuf = const_cast<TQChar*>(m_lmppData.m_tqunicodeBuf.tqunicode()); + int ucSize = m_lmppData.m_tqunicodeBuf.length(); for(i=0; i<ucSize; ++i) { pBuf[i] = pBuf[i].upper(); @@ -602,25 +602,25 @@ void SourceData::readAndPreprocess( QTextCodec* pEncoding, bool bAutoDetectUnico /** Prepare the linedata vector for every input line.*/ -void SourceData::FileData::preprocess( bool bPreserveCR, QTextCodec* pEncoding ) +void SourceData::FileData::preprocess( bool bPreserveCR, TQTextCodec* pEncoding ) { - //m_unicodeBuf = decodeString( m_pBuf, m_size, eEncoding ); + //m_tqunicodeBuf = decodeString( m_pBuf, m_size, eEncoding ); long skipBytes = 0; - QTextCodec* pCodec = ::detectEncoding( m_pBuf, m_size, skipBytes ); + TQTextCodec* pCodec = ::detectEncoding( m_pBuf, m_size, skipBytes ); if ( pCodec != pEncoding ) skipBytes=0; - QByteArray ba; + TQByteArray ba; ba.setRawData( m_pBuf+skipBytes, m_size-skipBytes ); - QTextStream ts( ba, IO_ReadOnly ); + TQTextStream ts( ba, IO_ReadOnly ); ts.setCodec( pEncoding); //ts.setAutoDetectUnicode( false ); - m_unicodeBuf = ts.read(); + m_tqunicodeBuf = ts.read(); ba.resetRawData( m_pBuf+skipBytes, m_size-skipBytes ); - int ucSize = m_unicodeBuf.length(); - const QChar* p = m_unicodeBuf.unicode(); + int ucSize = m_tqunicodeBuf.length(); + const TQChar* p = m_tqunicodeBuf.tqunicode(); m_bIsText = true; int lines = 1; @@ -680,7 +680,7 @@ void SourceData::FileData::preprocess( bool bPreserveCR, QTextCodec* pEncoding ) // Comments in white lines must remain, while comments in // non-white lines are overwritten with spaces. static void checkLineForComments( - QChar* p, // pointer to start of buffer + TQChar* p, // pointer to start of buffer int& i, // index of current position (in, out) int size, // size of buffer bool& bWhite, // false if this line contains nonwhite characters (in, out) @@ -770,9 +770,9 @@ static void checkLineForComments( void SourceData::FileData::removeComments() { int line=0; - QChar* p = const_cast<QChar*>(m_unicodeBuf.unicode()); + TQChar* p = const_cast<TQChar*>(m_tqunicodeBuf.tqunicode()); bool bWithinComment=false; - int size = m_unicodeBuf.length(); + int size = m_tqunicodeBuf.length(); for(int i=0; i<size; ++i ) { // std::cout << "2 " << std::string(&p[i], m_v[line].size) << std::endl; @@ -1190,7 +1190,7 @@ void correctManualDiffAlignment( Diff3LineList& d3ll, ManualDiffHelpList* pManua if ( pManualDiffHelpList->empty() ) return; - // If a line appears unaligned in comparison to the manual alignment, correct this. + // If a line appears unaligned in comparison to the manual tqalignment, correct this. ManualDiffHelpList::iterator iMDHL; for( iMDHL = pManualDiffHelpList->begin(); iMDHL != pManualDiffHelpList->end(); ++iMDHL ) @@ -1228,7 +1228,7 @@ void correctManualDiffAlignment( Diff3LineList& d3ll, ManualDiffHelpList* pManua if (wi>=1 && wi <= 3) { - // Found manual alignment for one source + // Found manual tqalignment for one source Diff3LineList::iterator iDest = i3; // Move lines up until the next firstLine is found. Omit wi from move and search. @@ -1653,7 +1653,7 @@ void debugLineCheck( Diff3LineList& d3ll, int size, int idx ) } } -inline bool equal( QChar c1, QChar c2, bool /*bStrict*/ ) +inline bool equal( TQChar c1, TQChar c2, bool /*bStrict*/ ) { // If bStrict then white space doesn't match @@ -18,12 +18,12 @@ #ifndef DIFF_H #define DIFF_H -#include <qwidget.h> -#include <qpixmap.h> -#include <qtimer.h> -#include <qframe.h> -#include <qtextstream.h> -#include <qpainter.h> +#include <tqwidget.h> +#include <tqpixmap.h> +#include <tqtimer.h> +#include <tqframe.h> +#include <tqtextstream.h> +#include <tqpainter.h> #include <list> #include <vector> #include <assert.h> @@ -48,8 +48,8 @@ typedef std::list<Diff> DiffList; struct LineData { - const QChar* pLine; - const QChar* pFirstNonWhiteChar; + const TQChar* pLine; + const TQChar* pFirstNonWhiteChar; int size; LineData(){ pLine=0; pFirstNonWhiteChar=0; size=0; /*occurances=0;*/ bContainsPureComment=false; } @@ -132,13 +132,13 @@ struct Diff3Line if ( src == 3 && lineC >= 0 ) return &m_pDiffBufferInfo->m_pLineDataC[lineC]; return 0; } - QString getString( int src ) const + TQString getString( int src ) const { const LineData* pld = getLineData(src); if ( pld ) - return QString( pld->pLine, pld->size); + return TQString( pld->pLine, pld->size); else - return QString(); + return TQString(); } int getLineInFile( int src ) const { @@ -169,10 +169,10 @@ public: typedef std::vector<Diff3WrapLine> Diff3WrapLineVector; -class TotalDiffStatus +class TotalDifftqStatus { public: - TotalDiffStatus(){ reset(); } + TotalDifftqStatus(){ reset(); } void reset() {bBinaryAEqC=false; bBinaryBEqC=false; bBinaryAEqB=false; bTextAEqC=false; bTextBEqC=false; bTextAEqB=false; nofUnsolvedConflicts=0; nofSolvedConflicts=0; @@ -257,34 +257,34 @@ public: const LineData* getLineDataForDisplay() const; const LineData* getLineDataForDiff() const; - void setFilename(const QString& filename); + void setFilename(const TQString& filename); void setFileAccess( const FileAccess& fa ); //FileAccess& getFileAccess(); - QString getFilename(); - void setAliasName(const QString& a); - QString getAliasName(); + TQString getFilename(); + void setAliasName(const TQString& a); + TQString getAliasName(); bool isEmpty(); // File was set bool hasData(); // Data was readable bool isText(); // is it pure text (vs. binary data) bool isFromBuffer(); // was it set via setData() (vs. setFileAccess() or setFilename()) - void setData( const QString& data ); + void setData( const TQString& data ); bool isValid(); // Either no file is specified or reading was successful - void readAndPreprocess(QTextCodec* pEncoding, bool bAutoDetectUnicode ); - bool saveNormalDataAs( const QString& fileName ); + void readAndPreprocess(TQTextCodec* pEncoding, bool bAutoDetectUnicode ); + bool saveNormalDataAs( const TQString& fileName ); bool isBinaryEqualWith( const SourceData& other ) const; void reset(); - QTextCodec* getEncoding() const { return m_pEncoding; } + TQTextCodec* getEncoding() const { return m_pEncoding; } private: - QTextCodec* detectEncoding( const QString& fileName, QTextCodec* pFallbackCodec ); - QString m_aliasName; + TQTextCodec* detectEncoding( const TQString& fileName, TQTextCodec* pFallbackCodec ); + TQString m_aliasName; FileAccess m_fileAccess; OptionDialog* m_pOptionDialog; - QString m_tempInputFileName; + TQString m_tempInputFileName; struct FileData { @@ -293,19 +293,19 @@ private: const char* m_pBuf; int m_size; int m_vSize; // Nr of lines in m_pBuf1 and size of m_v1, m_dv12 and m_dv13 - QString m_unicodeBuf; + TQString m_tqunicodeBuf; std::vector<LineData> m_v; bool m_bIsText; - bool readFile( const QString& filename ); - bool writeFile( const QString& filename ); - void preprocess(bool bPreserveCR, QTextCodec* pEncoding ); + bool readFile( const TQString& filename ); + bool writeFile( const TQString& filename ); + void preprocess(bool bPreserveCR, TQTextCodec* pEncoding ); void reset(); void removeComments(); void copyBufFrom( const FileData& src ); }; FileData m_normalData; FileData m_lmppData; - QTextCodec* m_pEncoding; + TQTextCodec* m_pEncoding; }; void calcDiff3LineListTrim( Diff3LineList& d3ll, const LineData* pldA, const LineData* pldB, const LineData* pldC, ManualDiffHelpList* pManualDiffHelpList ); @@ -315,7 +315,7 @@ void calcDiff3LineVector( Diff3LineList& d3ll, Diff3LineVector& d3lv ); void debugLineCheck( Diff3LineList& d3ll, int size, int idx ); -class QStatusBar; +class TQStatusBar; class Selection @@ -365,18 +365,18 @@ public: class OptionDialog; -QCString encodeString( const QString& s ); +TQCString encodeString( const TQString& s ); // Helper class that swaps left and right for some commands. -class MyPainter : public QPainter +class MyPainter : public TQPainter { int m_factor; int m_xOffset; int m_fontWidth; public: - MyPainter(const QPaintDevice* pd, bool bRTL, int width, int fontWidth) - : QPainter(pd) + MyPainter(const TQPaintDevice* pd, bool bRTL, int width, int fontWidth) + : TQPainter(const_cast<TQPaintDevice*>(TQT_TQPAINTDEVICE_CONST(pd))) { if (bRTL) { @@ -392,23 +392,23 @@ public: } } - void fillRect( int x, int y, int w, int h, const QBrush& b ) + void fillRect( int x, int y, int w, int h, const TQBrush& b ) { if (m_factor==1) - QPainter::fillRect( m_xOffset + x , y, w, h, b ); + TQPainter::fillRect( m_xOffset + x , y, w, h, b ); else - QPainter::fillRect( m_xOffset - x - w, y, w, h, b ); + TQPainter::fillRect( m_xOffset - x - w, y, w, h, b ); } - void drawText( int x, int y, const QString& s, bool bAdapt=false ) + void drawText( int x, int y, const TQString& s, bool bAdapt=false ) { TextDirection td = (m_factor==1 || bAdapt == false) ? LTR : RTL; - QPainter::drawText( m_xOffset-m_fontWidth*s.length() + m_factor*x, y, s, -1, td ); + TQPainter::drawText( m_xOffset-m_fontWidth*s.length() + m_factor*x, y, s, -1, td ); } void drawLine( int x1, int y1, int x2, int y2 ) { - QPainter::drawLine( m_xOffset + m_factor*x1, y1, m_xOffset + m_factor*x2, y2 ); + TQPainter::drawLine( m_xOffset + m_factor*x1, y1, m_xOffset + m_factor*x2, y2 ); } }; @@ -426,7 +426,7 @@ bool equal( const LineData& l1, const LineData& l2, bool bStrict ); -inline bool isWhite( QChar c ) +inline bool isWhite( TQChar c ) { return c==' ' || c=='\t' || c=='\r'; } @@ -449,14 +449,14 @@ extern bool g_bIgnoreTrivialMatches; extern int g_bAutoSolve; // Cursor conversions that consider g_tabSize. -int convertToPosInText( const QString& s, int posOnScreen, int tabSize ); -int convertToPosOnScreen( const QString& s, int posInText, int tabSize ); +int convertToPosInText( const TQString& s, int posOnScreen, int tabSize ); +int convertToPosOnScreen( const TQString& s, int posInText, int tabSize ); enum e_CoordType { eFileCoords, eD3LLineCoords, eWrapCoords }; -void calcTokenPos( const QString&, int posOnScreen, int& pos1, int& pos2, int tabSize ); +void calcTokenPos( const TQString&, int posOnScreen, int& pos1, int& pos2, int tabSize ); -QString calcHistorySortKey( const QString& keyOrder, QRegExp& matchedRegExpr, const QStringList& parenthesesGroupList ); -bool findParenthesesGroups( const QString& s, QStringList& sl ); +TQString calcHistorySortKey( const TQString& keyOrder, TQRegExp& matchedRegExpr, const TQStringList& tqparenthesesGroupList ); +bool findParenthesesGroups( const TQString& s, TQStringList& sl ); #endif diff --git a/src/difftextwindow.cpp b/src/difftextwindow.cpp index 79d55ed..93a3770 100644 --- a/src/difftextwindow.cpp +++ b/src/difftextwindow.cpp @@ -17,23 +17,23 @@ #include "difftextwindow.h" #include "merger.h" -#include <qpainter.h> +#include <tqpainter.h> #include <assert.h> -#include <qpixmap.h> -#include <qstatusbar.h> -#include <qapplication.h> -#include <qtooltip.h> -#include <qfont.h> -#include <qstringlist.h> -#include <qlineedit.h> -#include <qlabel.h> -#include <qpushbutton.h> -#include <qlayout.h> -#include <qtextcodec.h> +#include <tqpixmap.h> +#include <tqstatusbar.h> +#include <tqapplication.h> +#include <tqtooltip.h> +#include <tqfont.h> +#include <tqstringlist.h> +#include <tqlineedit.h> +#include <tqlabel.h> +#include <tqpushbutton.h> +#include <tqlayout.h> +#include <tqtextcodec.h> #include <optiondialog.h> #include <math.h> #include <cstdlib> -#include <qdragobject.h> +#include <tqdragobject.h> #include <klocale.h> #include <kfiledialog.h> @@ -72,7 +72,7 @@ public: bool m_bPaintingAllowed; const LineData* m_pLineData; int m_size; - QString m_filename; + TQString m_filename; bool m_bWordWrap; int m_delayedDrawTimer; @@ -81,10 +81,10 @@ public: const ManualDiffHelpList* m_pManualDiffHelpList; OptionDialog* m_pOptionDialog; - QColor m_cThis; - QColor m_cDiff1; - QColor m_cDiff2; - QColor m_cDiffBoth; + TQColor m_cThis; + TQColor m_cDiff1; + TQColor m_cDiff2; + TQColor m_cDiffBoth; int m_fastSelectorLine1; int m_fastSelectorNofLines; @@ -103,19 +103,19 @@ public: DiffList*& pFineDiff1, DiffList*& pFineDiff2, // return values int& changed, int& changed2 ); - QString getString( int d3lIdx ); - QString getLineString( int line ); + TQString getString( int d3lIdx ); + TQString getLineString( int line ); void writeLine( MyPainter& p, const LineData* pld, const DiffList* pLineDiff1, const DiffList* pLineDiff2, int line, int whatChanged, int whatChanged2, int srcLineIdx, - int wrapLineOffset, int wrapLineLength, bool bWrapLine, const QRect& invalidRect, int deviceWidth + int wrapLineOffset, int wrapLineLength, bool bWrapLine, const TQRect& invalidRect, int deviceWidth ); - void draw( MyPainter& p, const QRect& invalidRect, int deviceWidth, int beginLine, int endLine ); + void draw( MyPainter& p, const TQRect& invalidRect, int deviceWidth, int beginLine, int endLine ); - QStatusBar* m_pStatusBar; + TQStatusBar* m_pStatusBar; Selection m_selection; @@ -129,26 +129,26 @@ public: int convertLineOnScreenToLineInSource( int lineOnScreen, e_CoordType coordType, bool bFirstLine ); bool m_bSelectionInProgress; - QPoint m_lastKnownMousePos; + TQPoint m_lastKnownMousePos; }; DiffTextWindow::DiffTextWindow( DiffTextWindowFrame* pParent, - QStatusBar* pStatusBar, + TQStatusBar* pStatusBar, OptionDialog* pOptionDialog, int winIdx ) - : QWidget(pParent, 0, Qt::WResizeNoErase | Qt::WRepaintNoErase) + : TQWidget(pParent, 0, TQt::WResizeNoErase | TQt::WRepaintNoErase) { d = new DiffTextWindowData(this); d->m_pDiffTextWindowFrame = pParent; - setFocusPolicy( ClickFocus ); + setFocusPolicy( TQ_ClickFocus ); setAcceptDrops( true ); d->m_pOptionDialog = pOptionDialog; init( 0, 0, 0, 0, 0, false ); - setMinimumSize(QSize(20,20)); + setMinimumSize(TQSize(20,20)); d->m_pStatusBar = pStatusBar; d->m_bPaintingAllowed = true; @@ -164,7 +164,7 @@ DiffTextWindow::~DiffTextWindow() } void DiffTextWindow::init( - const QString& filename, + const TQString& filename, const LineData* pLineData, int size, const Diff3LineVector* pDiff3LineVector, @@ -218,9 +218,9 @@ void DiffTextWindow::setPaintingAllowed( bool bAllowPainting ) } } -void DiffTextWindow::dragEnterEvent( QDragEnterEvent* e ) +void DiffTextWindow::dragEnterEvent( TQDragEnterEvent* e ) { - e->accept( QUriDrag::canDecode(e) || QTextDrag::canDecode(e) ); + e->accept( TQUriDrag::canDecode(e) || TQTextDrag::canDecode(e) ); // Note that the corresponding drop is handled in KDiff3App::eventFilter(). } @@ -244,7 +244,7 @@ void DiffTextWindow::setFirstLine(int firstLine) } else { - QWidget::scroll( 0, deltaY ); + TQWidget::scroll( 0, deltaY ); } d->m_pDiffTextWindowFrame->setFirstLine( d->m_firstLine ); } @@ -265,12 +265,12 @@ void DiffTextWindow::setFirstColumn(int firstCol) d->m_firstColumn = newFirstColumn; - QRect r( xOffset, 0, width()-xOffset, height() ); + TQRect r( xOffset, 0, width()-xOffset, height() ); if ( d->m_pOptionDialog->m_bRightToLeftLanguage ) { deltaX = -deltaX; - r = QRect( width()-1-xOffset, 0, -(width()-xOffset), height() ).normalize(); + r = TQRect( width()-1-xOffset, 0, -(width()-xOffset), height() ).normalize(); } if ( d->m_bSelectionInProgress && d->m_selection.firstLine != -1 ) @@ -282,7 +282,7 @@ void DiffTextWindow::setFirstColumn(int firstCol) } else { - QWidget::scroll( deltaX, 0, r ); + TQWidget::scroll( deltaX, 0, r ); } } @@ -378,7 +378,7 @@ void DiffTextWindow::showStatusLine(int line ) { int l = pD3l->getLineInFile( d->m_winIdx ); - QString s; + TQString s; if ( l!=-1 ) s.sprintf("File %s: Line %d", d->m_filename.ascii(), l+1 ); else @@ -390,13 +390,13 @@ void DiffTextWindow::showStatusLine(int line ) } } -void DiffTextWindow::focusInEvent(QFocusEvent* e) +void DiffTextWindow::focusInEvent(TQFocusEvent* e) { emit gotFocus(); - QWidget::focusInEvent(e); + TQWidget::focusInEvent(e); } -void DiffTextWindow::mousePressEvent ( QMouseEvent* e ) +void DiffTextWindow::mousePressEvent ( TQMouseEvent* e ) { if ( e->button() == Qt::LeftButton ) { @@ -421,15 +421,15 @@ void DiffTextWindow::mousePressEvent ( QMouseEvent* e ) } } -bool isCTokenChar( QChar c ) +bool isCTokenChar( TQChar c ) { return (c=='_') || - ( c>='A' && c<='Z' ) || ( c>='a' && c<='z' ) || - (c>='0' && c<='9'); + ( c.unicode()>='A' && c.unicode()<='Z' ) || ( c.unicode()>='a' && c.unicode()<='z' ) || + (c.unicode()>='0' && c.unicode()<='9'); } /// Calculate where a token starts and ends, given the x-position on screen. -void calcTokenPos( const QString& s, int posOnScreen, int& pos1, int& pos2, int tabSize ) +void calcTokenPos( const TQString& s, int posOnScreen, int& pos1, int& pos2, int tabSize ) { // Cursor conversions that consider g_tabSize int pos = convertToPosInText( s, max2( 0, posOnScreen ), tabSize ); @@ -454,7 +454,7 @@ void calcTokenPos( const QString& s, int posOnScreen, int& pos1, int& pos2, int } } -void DiffTextWindow::mouseDoubleClickEvent( QMouseEvent* e ) +void DiffTextWindow::mouseDoubleClickEvent( TQMouseEvent* e ) { d->m_bSelectionInProgress = false; d->m_lastKnownMousePos = e->pos(); @@ -465,7 +465,7 @@ void DiffTextWindow::mouseDoubleClickEvent( QMouseEvent* e ) convertToLinePos( e->x(), e->y(), line, pos ); // Get the string data of the current line - QString s; + TQString s; if ( d->m_bWordWrap ) { if ( line<0 || line >= (int)d->m_diff3WrapLineVector.size() ) @@ -495,7 +495,7 @@ void DiffTextWindow::mouseDoubleClickEvent( QMouseEvent* e ) } } -void DiffTextWindow::mouseReleaseEvent ( QMouseEvent* e ) +void DiffTextWindow::mouseReleaseEvent ( TQMouseEvent* e ) { d->m_bSelectionInProgress = false; d->m_lastKnownMousePos = e->pos(); @@ -514,7 +514,7 @@ void DiffTextWindow::mouseReleaseEvent ( QMouseEvent* e ) inline int sqr(int x){return x*x;} -void DiffTextWindow::mouseMoveEvent ( QMouseEvent * e ) +void DiffTextWindow::mouseMoveEvent ( TQMouseEvent * e ) { int line; int pos; @@ -528,7 +528,7 @@ void DiffTextWindow::mouseMoveEvent ( QMouseEvent * e ) showStatusLine( line ); // Scroll because mouse moved out of the window - const QFontMetrics& fm = fontMetrics(); + const TQFontMetrics& fm = fontMetrics(); int fontWidth = fm.width('W'); int deltaX=0; int deltaY=0; @@ -569,7 +569,7 @@ void DiffTextWindowData::myUpdate(int afterMilliSecs) m_delayedDrawTimer = m_pDiffTextWindow->startTimer( afterMilliSecs ); } -void DiffTextWindow::timerEvent(QTimerEvent*) +void DiffTextWindow::timerEvent(TQTimerEvent*) { killTimer(d->m_delayedDrawTimer); d->m_delayedDrawTimer = 0; @@ -597,7 +597,7 @@ void DiffTextWindow::timerEvent(QTimerEvent*) if ( y1<height() && y2>0 ) { - QRect invalidRect = QRect( 0, y1, width(), y2-y1 ); + TQRect invalidRect = TQRect( 0, y1, width(), y2-y1 ); update( invalidRect ); } } @@ -622,7 +622,7 @@ void DiffTextWindow::resetSelection() void DiffTextWindow::convertToLinePos( int x, int y, int& line, int& pos ) { - const QFontMetrics& fm = fontMetrics(); + const TQFontMetrics& fm = fontMetrics(); int fontHeight = fm.height(); int fontWidth = fm.width('W'); int xOffset = ( d->leftInfoWidth() - d->m_firstColumn ) * fontWidth; @@ -715,14 +715,14 @@ void DiffTextWindowData::writeLine( int wrapLineOffset, int wrapLineLength, bool bWrapLine, - const QRect& invalidRect, + const TQRect& invalidRect, int deviceWidth ) { - QFont normalFont = p.font(); - QFont diffFont = normalFont; + TQFont normalFont = p.font(); + TQFont diffFont = normalFont; diffFont.setItalic( m_pOptionDialog->m_bItalicForDeltas ); - const QFontMetrics& fm = p.fontMetrics(); + const TQFontMetrics& fm = p.fontMetrics(); int fontHeight = fm.height(); int fontAscent = fm.ascent(); int fontDescent = fm.descent(); @@ -731,7 +731,7 @@ void DiffTextWindowData::writeLine( int xOffset = (leftInfoWidth() - m_firstColumn)*fontWidth; int yOffset = (line-m_firstLine) * fontHeight; - QRect lineRect( 0, yOffset, deviceWidth, fontHeight ); + TQRect lineRect( 0, yOffset, deviceWidth, fontHeight ); if ( ! invalidRect.intersects( lineRect ) ) { return; @@ -741,8 +741,8 @@ void DiffTextWindowData::writeLine( int fastSelectorLine2 = m_pDiffTextWindow->convertDiff3LineIdxToLine(m_fastSelectorLine1+m_fastSelectorNofLines)-1; bool bFastSelectionRange = (line>=fastSelectorLine1 && line<= fastSelectorLine2 ); - QColor bgColor = m_pOptionDialog->m_bgColor; - QColor diffBgColor = m_pOptionDialog->m_diffBgColor; + TQColor bgColor = m_pOptionDialog->m_bgColor; + TQColor diffBgColor = m_pOptionDialog->m_diffBgColor; if ( bFastSelectionRange ) { @@ -757,7 +757,7 @@ void DiffTextWindowData::writeLine( if ( pLineDiff1 != 0 ) changed |= 1; if ( pLineDiff2 != 0 ) changed |= 2; - QColor c = m_pOptionDialog->m_fgColor; + TQColor c = m_pOptionDialog->m_fgColor; if ( changed == 2 ) { c = m_cDiff2; } else if ( changed == 1 ) { @@ -787,11 +787,11 @@ void DiffTextWindowData::writeLine( } } - QString s=" "; + TQString s=" "; // Convert tabs int outPos = 0; - QString lineString( pld->pLine, pld->size ); + TQString lineString( pld->pLine, pld->size ); int lineLength = m_bWordWrap ? wrapLineOffset+wrapLineLength : lineString.length(); for( i=wrapLineOffset; i<lineLength; ++i ) @@ -808,7 +808,7 @@ void DiffTextWindowData::writeLine( s[0] = lineString[i]; } - QColor c = m_pOptionDialog->m_fgColor; + TQColor c = m_pOptionDialog->m_fgColor; int cchanged = charChanged[i] | whatChanged; if ( cchanged == 2 ) { @@ -825,9 +825,9 @@ void DiffTextWindowData::writeLine( c = m_pOptionDialog->m_fgColor; } - QRect outRect( xOffset + fontWidth*outPos, yOffset, fontWidth*spaces, fontHeight ); + TQRect outRect( xOffset + fontWidth*outPos, yOffset, fontWidth*spaces, fontHeight ); if ( m_pOptionDialog->m_bRightToLeftLanguage ) - outRect = QRect( deviceWidth-1-(xOffset + fontWidth*outPos), yOffset, -fontWidth*spaces, fontHeight ).normalize(); + outRect = TQRect( deviceWidth-1-(xOffset + fontWidth*outPos), yOffset, -fontWidth*spaces, fontHeight ).normalize(); if ( invalidRect.intersects( outRect ) ) { if( !m_selection.within( line, outPos ) ) @@ -835,7 +835,7 @@ void DiffTextWindowData::writeLine( if( c!=m_pOptionDialog->m_fgColor ) { - QColor lightc = diffBgColor; + TQColor lightc = diffBgColor; p.fillRect( xOffset + fontWidth*outPos, yOffset, fontWidth*spaces, fontHeight, lightc ); p.setFont(diffFont); @@ -860,9 +860,9 @@ void DiffTextWindowData::writeLine( else { p.fillRect( xOffset + fontWidth*outPos, yOffset, - fontWidth*(spaces), fontHeight, m_pDiffTextWindow->colorGroup().highlight() ); + fontWidth*(spaces), fontHeight, m_pDiffTextWindow->tqcolorGroup().highlight() ); - p.setPen( m_pDiffTextWindow->colorGroup().highlightedText() ); + p.setPen( m_pDiffTextWindow->tqcolorGroup().highlightedText() ); p.drawText( xOffset + fontWidth*outPos, yOffset + fontAscent, s ); m_selection.bSelectionContainsData = true; @@ -875,7 +875,7 @@ void DiffTextWindowData::writeLine( if( m_selection.lineWithin( line ) && m_selection.lineWithin( line+1 ) ) { p.fillRect( xOffset + fontWidth*outPos, yOffset, - deviceWidth, fontHeight, m_pDiffTextWindow->colorGroup().highlight() ); + deviceWidth, fontHeight, m_pDiffTextWindow->tqcolorGroup().highlight() ); } } @@ -888,16 +888,16 @@ void DiffTextWindowData::writeLine( { if ( m_pOptionDialog->m_bShowLineNumbers && !bWrapLine ) { - QString num; + TQString num; num.sprintf( "%0*d", m_lineNumberWidth, srcLineIdx+1); p.drawText( 0, yOffset + fontAscent, num ); //p.drawLine( xLeft -1, yOffset, xLeft -1, yOffset+fontHeight-1 ); } if ( !bWrapLine || wrapLineLength>0 ) { - p.setPen( QPen( m_pOptionDialog->m_fgColor, 0, bWrapLine ? Qt::DotLine : Qt::SolidLine) ); + p.setPen( TQPen( m_pOptionDialog->m_fgColor, 0, bWrapLine ? TQt::DotLine : TQt::SolidLine) ); p.drawLine( xOffset +1, yOffset, xOffset +1, yOffset+fontHeight-1 ); - p.setPen( QPen( m_pOptionDialog->m_fgColor, 0, Qt::SolidLine) ); + p.setPen( TQPen( m_pOptionDialog->m_fgColor, 0, TQt::SolidLine) ); } } if ( c!=m_pOptionDialog->m_fgColor && whatChanged2==0 )//&& whatChanged==0 ) @@ -905,7 +905,7 @@ void DiffTextWindowData::writeLine( if ( m_pOptionDialog->m_bShowWhiteSpace ) { p.setBrushOrigin(0,0); - p.fillRect( xLeft, yOffset, fontWidth*2-1, fontHeight, QBrush(c,Qt::Dense5Pattern) ); + p.fillRect( xLeft, yOffset, fontWidth*2-1, fontHeight, TQBrush(c,TQt::Dense5Pattern) ); } } else @@ -936,13 +936,13 @@ void DiffTextWindowData::writeLine( } } -void DiffTextWindow::paintEvent( QPaintEvent* e ) +void DiffTextWindow::paintEvent( TQPaintEvent* e ) { if ( d->m_pDiff3LineVector==0 || ! d->m_bPaintingAllowed || ( d->m_diff3WrapLineVector.empty() && d->m_bWordWrap ) ) return; - QRect invalidRect = e->rect(); + TQRect invalidRect = e->rect(); if ( invalidRect.isEmpty() ) return; @@ -952,28 +952,28 @@ void DiffTextWindow::paintEvent( QPaintEvent* e ) int endLine = min2( d->m_firstLine + getNofVisibleLines()+2, getNofLines() ); //if ( invalidRect.size()==size() ) - { // double buffering, obsolete with Qt4 - QPainter painter(this); // Remove for Qt4 - QPixmap pixmap( invalidRect.size() );// Remove for Qt4 + { // double buffering, obsolete with TQt4 + TQPainter painter(this); // Remove for TQt4 + TQPixmap pixmap( invalidRect.size() );// Remove for TQt4 - MyPainter p( &pixmap, d->m_pOptionDialog->m_bRightToLeftLanguage, width(), fontMetrics().width('W') ); // For Qt4 change pixmap to this + MyPainter p( TQT_TQPAINTDEVICE(&pixmap), d->m_pOptionDialog->m_bRightToLeftLanguage, width(), fontMetrics().width('W') ); // For TQt4 change pixmap to this - p.translate( -invalidRect.x(), -invalidRect.y() );// Remove for Qt4 + p.translate( -invalidRect.x(), -invalidRect.y() );// Remove for TQt4 p.setFont( font() ); - p.QPainter::fillRect( invalidRect, d->m_pOptionDialog->m_bgColor ); + p.TQPainter::fillRect( invalidRect, d->m_pOptionDialog->m_bgColor ); d->draw( p, invalidRect, width(), d->m_firstLine, endLine ); // p.drawLine( m_invalidRect.x(), m_invalidRect.y(), m_invalidRect.right(), m_invalidRect.bottom() ); // For test only p.end(); - painter.drawPixmap( invalidRect.x(), invalidRect.y(), pixmap );// Remove for Qt4 + painter.drawPixmap( invalidRect.x(), invalidRect.y(), pixmap );// Remove for TQt4 } // else // { // no double buffering // MyPainter p( this, d->m_pOptionDialog->m_bRightToLeftLanguage, width(), fontMetrics().width('W') ); // p.setFont( font() ); -// p.QPainter::fillRect( invalidRect, d->m_pOptionDialog->m_bgColor ); +// p.TQPainter::fillRect( invalidRect, d->m_pOptionDialog->m_bgColor ); // d->draw( p, invalidRect, width(), d->m_firstLine, endLine ); // } @@ -988,7 +988,7 @@ void DiffTextWindow::paintEvent( QPaintEvent* e ) emit newSelection(); } -void DiffTextWindow::print( MyPainter& p, const QRect&, int firstLine, int nofLinesPerPage ) +void DiffTextWindow::print( MyPainter& p, const TQRect&, int firstLine, int nofLinesPerPage ) { if ( d->m_pDiff3LineVector==0 || ! d->m_bPaintingAllowed || ( d->m_diff3WrapLineVector.empty() && d->m_bWordWrap ) ) @@ -997,15 +997,15 @@ void DiffTextWindow::print( MyPainter& p, const QRect&, int firstLine, int nofLi // MyPainter p( this, d->m_pOptionDialog->m_bRightToLeftLanguage, width(), fontMetrics().width('W') ); int oldFirstLine = d->m_firstLine; d->m_firstLine = firstLine; - QRect invalidRect = QRect(0,0,QCOORD_MAX,QCOORD_MAX); - QColor bgColor = d->m_pOptionDialog->m_bgColor; - d->m_pOptionDialog->m_bgColor = Qt::white; + TQRect invalidRect = TQRect(0,0,TQCOORD_MAX,TQCOORD_MAX); + TQColor bgColor = d->m_pOptionDialog->m_bgColor; + d->m_pOptionDialog->m_bgColor = TQt::white; d->draw( p, invalidRect, p.window().width(), firstLine, min2(firstLine+nofLinesPerPage,getNofLines()) ); d->m_pOptionDialog->m_bgColor = bgColor; d->m_firstLine = oldFirstLine; } -void DiffTextWindowData::draw( MyPainter& p, const QRect& invalidRect, int deviceWidth, int beginLine, int endLine ) +void DiffTextWindowData::draw( MyPainter& p, const TQRect& invalidRect, int deviceWidth, int beginLine, int endLine ) { m_lineNumberWidth = m_pOptionDialog->m_bShowLineNumbers ? (int)log10((double)m_size)+1 : 0; @@ -1058,7 +1058,7 @@ void DiffTextWindowData::draw( MyPainter& p, const QRect& invalidRect, int devic getLineInfo( *d3l, srcLineIdx, pFineDiff1, pFineDiff2, changed, changed2 ); writeLine( - p, // QPainter + p, // TQPainter srcLineIdx == -1 ? 0 : &m_pLineData[srcLineIdx], // Text in this line pFineDiff1, pFineDiff2, @@ -1075,10 +1075,10 @@ void DiffTextWindowData::draw( MyPainter& p, const QRect& invalidRect, int devic } } -QString DiffTextWindowData::getString( int d3lIdx ) +TQString DiffTextWindowData::getString( int d3lIdx ) { if ( d3lIdx<0 || d3lIdx>=(int)m_pDiff3LineVector->size() ) - return QString(); + return TQString(); const Diff3Line* d3l = (*m_pDiff3LineVector)[d3lIdx]; DiffList* pFineDiff1; DiffList* pFineDiff2; @@ -1087,16 +1087,16 @@ QString DiffTextWindowData::getString( int d3lIdx ) int lineIdx; getLineInfo( *d3l, lineIdx, pFineDiff1, pFineDiff2, changed, changed2 ); - if (lineIdx==-1) return QString(); + if (lineIdx==-1) return TQString(); else { const LineData* ld = &m_pLineData[lineIdx]; - return QString( ld->pLine, ld->size ); + return TQString( ld->pLine, ld->size ); } - return QString(); + return TQString(); } -QString DiffTextWindowData::getLineString( int line ) +TQString DiffTextWindowData::getLineString( int line ) { if ( m_bWordWrap ) { @@ -1150,19 +1150,19 @@ void DiffTextWindowData::getLineInfo( -void DiffTextWindow::resizeEvent( QResizeEvent* e ) +void DiffTextWindow::resizeEvent( TQResizeEvent* e ) { - QSize s = e->size(); - QFontMetrics fm = fontMetrics(); + TQSize s = e->size(); + TQFontMetrics fm = fontMetrics(); int visibleLines = s.height()/fm.height()-2; int visibleColumns = s.width()/fm.width('W') - d->leftInfoWidth(); emit resizeSignal( visibleColumns, visibleLines ); - QWidget::resizeEvent(e); + TQWidget::resizeEvent(e); } int DiffTextWindow::getNofVisibleLines() { - QFontMetrics fm = fontMetrics(); + TQFontMetrics fm = fontMetrics(); int fmh = fm.height(); int h = height(); return h/fmh -1;//height()/fm.height()-2; @@ -1170,13 +1170,13 @@ int DiffTextWindow::getNofVisibleLines() int DiffTextWindow::getNofVisibleColumns() { - QFontMetrics fm = fontMetrics(); + TQFontMetrics fm = fontMetrics(); return width()/fm.width('W') - d->leftInfoWidth(); } -QString DiffTextWindow::getSelection() +TQString DiffTextWindow::getSelection() { - QString selectionString; + TQString selectionString; int line=0; int lineIdx=0; @@ -1193,9 +1193,9 @@ QString DiffTextWindow::getSelection() if( lineIdx != -1 ) { - const QChar* pLine = d->m_pLineData[lineIdx].pLine; + const TQChar* pLine = d->m_pLineData[lineIdx].pLine; int size = d->m_pLineData[lineIdx].size; - QString lineString = QString( pLine, size ); + TQString lineString = TQString( pLine, size ); if ( d->m_bWordWrap ) { @@ -1238,7 +1238,7 @@ QString DiffTextWindow::getSelection() return selectionString; } -bool DiffTextWindow::findString( const QString& s, int& d3vLine, int& posInLine, bool bDirDown, bool bCaseSensitive ) +bool DiffTextWindow::findString( const TQString& s, int& d3vLine, int& posInLine, bool bDirDown, bool bCaseSensitive ) { int it = d3vLine; int endIt = bDirDown ? (int)d->m_pDiff3LineVector->size() : -1; @@ -1247,10 +1247,10 @@ bool DiffTextWindow::findString( const QString& s, int& d3vLine, int& posInLine, for( ; it!=endIt; it+=step ) { - QString line = d->getString( it ); + TQString line = d->getString( it ); if ( !line.isEmpty() ) { - int pos = line.find( s, startPos, bCaseSensitive ); + int pos = line.tqfind( s, startPos, bCaseSensitive ); if ( pos != -1 ) { d3vLine = it; @@ -1324,7 +1324,7 @@ void DiffTextWindow::setSelection( int firstLine, int startPos, int lastLine, in if ( d->m_bWordWrap && d->m_pDiff3LineVector!=0 ) { - QString s1 = d->getString(firstLine); + TQString s1 = d->getString(firstLine); int firstWrapLine = convertDiff3LineIdxToLine(firstLine); int wrapStartPos = startPos; while ( wrapStartPos > d->m_diff3WrapLineVector[firstWrapLine].wrapLineLength ) @@ -1334,7 +1334,7 @@ void DiffTextWindow::setSelection( int firstLine, int startPos, int lastLine, in ++firstWrapLine; } - QString s2 = d->getString(lastLine); + TQString s2 = d->getString(lastLine); int lastWrapLine = convertDiff3LineIdxToLine(lastLine); int wrapEndPos = endPos; while ( wrapEndPos > d->m_diff3WrapLineVector[lastWrapLine].wrapLineLength ) @@ -1396,7 +1396,7 @@ void DiffTextWindow::getSelectionRange( int* pFirstLine, int* pLastLine, e_Coord // Returns the number of wrapped lines // if pWrappedLines != 0 then the stringlist will contain the wrapped lines. -int wordWrap( const QString& origLine, int nofColumns, Diff3WrapLine* pDiff3WrapLine ) +int wordWrap( const TQString& origLine, int nofColumns, Diff3WrapLine* pDiff3WrapLine ) { if (nofColumns<=0) nofColumns = 1; @@ -1427,7 +1427,7 @@ int wordWrap( const QString& origLine, int nofColumns, Diff3WrapLine* pDiff3Wrap } else { - int wsPos = max2( origLine.findRev( ' ', wrapPos ), origLine.findRev( '\t', wrapPos ) ); + int wsPos = max2( origLine.tqfindRev( ' ', wrapPos ), origLine.tqfindRev( '\t', wrapPos ) ); if ( wsPos > pos ) { @@ -1460,7 +1460,7 @@ void DiffTextWindow::convertSelectionToD3LCoords() // convert the d->m_selection to unwrapped coordinates: Later restore to new coords int firstD3LIdx, firstD3LPos; - QString s = d->getLineString( d->m_selection.beginLine() ); + TQString s = d->getLineString( d->m_selection.beginLine() ); int firstPosInText = convertToPosInText( s, d->m_selection.beginPos(), d->m_pOptionDialog->m_tabSize ); convertLineCoordsToD3LCoords( d->m_selection.beginLine(), firstPosInText, firstD3LIdx, firstD3LPos ); @@ -1498,7 +1498,7 @@ void DiffTextWindow::recalcWordWrap( bool bWordWrap, int wrapLineVectorSize, int int size = d->m_pDiff3LineVector->size(); for( i=0; i<size; ++i ) { - QString s = d->getString( i ); + TQString s = d->getString( i ); int linesNeeded = wordWrap( s, nofVisibleColumns, wrapLineVectorSize==0 ? 0 : &d->m_diff3WrapLineVector[wrapLineIdx] ); Diff3Line& d3l = *(*d->m_pDiff3LineVector)[i]; if ( d3l.linesNeededForDisplay<linesNeeded ) @@ -1561,31 +1561,31 @@ class DiffTextWindowFrameData { public: DiffTextWindow* m_pDiffTextWindow; - QLineEdit* m_pFileSelection; - QPushButton* m_pBrowseButton; + TQLineEdit* m_pFileSelection; + TQPushButton* m_pBrowseButton; OptionDialog* m_pOptionDialog; - QLabel* m_pLabel; - QLabel* m_pTopLine; - QWidget* m_pTopLineWidget; + TQLabel* m_pLabel; + TQLabel* m_pTopLine; + TQWidget* m_pTopLineWidget; }; -DiffTextWindowFrame::DiffTextWindowFrame( QWidget* pParent, QStatusBar* pStatusBar, OptionDialog* pOptionDialog, int winIdx ) - : QWidget( pParent ) +DiffTextWindowFrame::DiffTextWindowFrame( TQWidget* pParent, TQStatusBar* pStatusBar, OptionDialog* pOptionDialog, int winIdx ) + : TQWidget( pParent ) { d = new DiffTextWindowFrameData; d->m_pOptionDialog = pOptionDialog; - d->m_pTopLineWidget = new QWidget(this); - d->m_pFileSelection = new QLineEdit(d->m_pTopLineWidget); - d->m_pBrowseButton = new QPushButton( "...",d->m_pTopLineWidget ); + d->m_pTopLineWidget = new TQWidget(this); + d->m_pFileSelection = new TQLineEdit(d->m_pTopLineWidget); + d->m_pBrowseButton = new TQPushButton( "...",d->m_pTopLineWidget ); d->m_pBrowseButton->setFixedWidth( 30 ); - connect(d->m_pBrowseButton,SIGNAL(clicked()), this, SLOT(slotBrowseButtonClicked())); - connect(d->m_pFileSelection,SIGNAL(returnPressed()), this, SLOT(slotReturnPressed())); + connect(d->m_pBrowseButton,TQT_SIGNAL(clicked()), this, TQT_SLOT(slotBrowseButtonClicked())); + connect(d->m_pFileSelection,TQT_SIGNAL(returnPressed()), this, TQT_SLOT(slotReturnPressed())); - d->m_pLabel = new QLabel("A:",d->m_pTopLineWidget); - d->m_pTopLine = new QLabel(d->m_pTopLineWidget); + d->m_pLabel = new TQLabel("A:",d->m_pTopLineWidget); + d->m_pTopLine = new TQLabel(d->m_pTopLineWidget); d->m_pDiffTextWindow = 0; d->m_pDiffTextWindow = new DiffTextWindow( this, pStatusBar, pOptionDialog, winIdx ); - QHBoxLayout* pHL = new QHBoxLayout(d->m_pTopLineWidget); + TQHBoxLayout* pHL = new TQHBoxLayout(d->m_pTopLineWidget); pHL->setMargin(2); pHL->setSpacing(2); @@ -1594,7 +1594,7 @@ DiffTextWindowFrame::DiffTextWindowFrame( QWidget* pParent, QStatusBar* pStatusB pHL->addWidget( d->m_pBrowseButton, 0 ); pHL->addWidget( d->m_pTopLine, 0 ); - QVBoxLayout* pVL = new QVBoxLayout( this, 0, 0 ); + TQVBoxLayout* pVL = new TQVBoxLayout( this, 0, 0 ); pVL->addWidget( d->m_pTopLineWidget, 0 ); pVL->addWidget( d->m_pDiffTextWindow, 1 ); @@ -1614,9 +1614,9 @@ void DiffTextWindowFrame::init() DiffTextWindow* pDTW = d->m_pDiffTextWindow; if ( pDTW ) { - QString s = pDTW->d->m_filename ; - d->m_pFileSelection->setText( QDir::convertSeparators(s) ); - QString winId = pDTW->d->m_winIdx==1 ? + TQString s = pDTW->d->m_filename ; + d->m_pFileSelection->setText( TQDir::convertSeparators(s) ); + TQString winId = pDTW->d->m_winIdx==1 ? ( pDTW->d->m_bTriple?"A (Base)":"A") : ( pDTW->d->m_winIdx==2 ? "B" : "C" ); d->m_pLabel->setText( winId + ":" ); @@ -1641,22 +1641,22 @@ void DiffTextWindowFrame::setFirstLine( int firstLine ) DiffTextWindow* pDTW = d->m_pDiffTextWindow; if ( pDTW && pDTW->d->m_pDiff3LineVector ) { - QString s= i18n("Top line"); + TQString s= i18n("Top line"); int lineNumberWidth = (int)log10((double)pDTW->d->m_size)+1; int l=pDTW->calcTopLineInFile(firstLine); int w = d->m_pTopLine->fontMetrics().width( - s+" "+QString().fill('0',lineNumberWidth)); + s+" "+TQString().fill('0',lineNumberWidth)); d->m_pTopLine->setMinimumWidth( w ); if (l==-1) s = i18n("End"); else - s += " " + QString::number( l+1 ); + s += " " + TQString::number( l+1 ); d->m_pTopLine->setText( s ); - d->m_pTopLine->repaint(); + d->m_pTopLine->tqrepaint(); } } @@ -1665,51 +1665,51 @@ DiffTextWindow* DiffTextWindowFrame::getDiffTextWindow() return d->m_pDiffTextWindow; } -bool DiffTextWindowFrame::eventFilter( QObject* o, QEvent* e ) +bool DiffTextWindowFrame::eventFilter( TQObject* o, TQEvent* e ) { DiffTextWindow* pDTW = d->m_pDiffTextWindow; - if ( e->type()==QEvent::FocusIn || e->type()==QEvent::FocusOut ) + if ( e->type()==TQEvent::FocusIn || e->type()==TQEvent::FocusOut ) { - QColor c1 = d->m_pOptionDialog->m_bgColor; - QColor c2 = pDTW->d->m_cThis; - QPalette p = d->m_pTopLineWidget->palette(); - if ( e->type()==QEvent::FocusOut ) + TQColor c1 = d->m_pOptionDialog->m_bgColor; + TQColor c2 = pDTW->d->m_cThis; + TQPalette p = d->m_pTopLineWidget->palette(); + if ( e->type()==TQEvent::FocusOut ) std::swap(c1,c2); - p.setColor(QColorGroup::Background, c2); + p.setColor(TQColorGroup::Background, c2); d->m_pTopLineWidget->setPalette( p ); d->m_pBrowseButton->setPalette( p ); d->m_pFileSelection->setPalette( p ); - p.setColor(QColorGroup::Foreground, c1); + p.setColor(TQColorGroup::Foreground, c1); d->m_pLabel->setPalette( p ); d->m_pTopLine->setPalette( p ); } - if (o == d->m_pFileSelection && e->type()==QEvent::Drop) + if (TQT_BASE_OBJECT(o) == TQT_BASE_OBJECT(d->m_pFileSelection) && e->type()==TQEvent::Drop) { - QDropEvent* d = static_cast<QDropEvent*>(e); + TQDropEvent* d = static_cast<TQDropEvent*>(e); - if ( QUriDrag::canDecode( d ) ) + if ( TQUriDrag::canDecode( d ) ) { - QStringList lst; - QUriDrag::decodeLocalFiles( d, lst ); + TQStringList lst; + TQUriDrag::decodeLocalFiles( d, lst ); if ( lst.count() > 0 ) { - static_cast<QLineEdit*>(o)->setText( lst[0] ); - static_cast<QLineEdit*>(o)->setFocus(); + static_cast<TQLineEdit*>(TQT_TQWIDGET(o))->setText( lst[0] ); + static_cast<TQLineEdit*>(TQT_TQWIDGET(o))->setFocus(); emit fileNameChanged( lst[0], pDTW->d->m_winIdx ); return true; } } - /* The following lines work for Qt>4.1 but not for 4.0.x*/ + /* The following lines work for TQt>4.1 but not for 4.0.x*/ /*if ( d->mimeData()->hasUrls() ) { - QList<QUrl> lst = d->mimeData()->urls(); + TQList<TQUrl> lst = d->mimeData()->urls(); if ( !lst.empty() ) { - static_cast<QLineEdit*>(o)->setText( lst[0].toLocalFile() ); - static_cast<QLineEdit*>(o)->setFocus(); + static_cast<TQLineEdit*>(o)->setText( lst[0].toLocalFile() ); + static_cast<TQLineEdit*>(o)->setFocus(); emit fileNameChanged( lst[0], pDTW->d->m_winIdx ); return true; } @@ -1729,7 +1729,7 @@ void DiffTextWindowFrame::slotReturnPressed() void DiffTextWindowFrame::slotBrowseButtonClicked() { - QString current = d->m_pFileSelection->text(); + TQString current = d->m_pFileSelection->text(); KURL newURL = KFileDialog::getOpenURL( current, 0, this); if ( !newURL.isEmpty() ) @@ -1739,13 +1739,13 @@ void DiffTextWindowFrame::slotBrowseButtonClicked() } } -QCString encodeString( const QString& s ) +TQCString encodeString( const TQString& s ) { - QTextCodec* c = QTextCodec::codecForLocale(); + TQTextCodec* c = TQTextCodec::codecForLocale(); if (c!=0) return c->fromUnicode( s ); else - return QCString( s.latin1() ); + return TQCString( s.latin1() ); } #include "difftextwindow.moc" diff --git a/src/difftextwindow.h b/src/difftextwindow.h index 8620b28..e5631a0 100644 --- a/src/difftextwindow.h +++ b/src/difftextwindow.h @@ -20,26 +20,27 @@ #include "diff.h" -#include <qwidget.h> +#include <tqwidget.h> -class QStatusBar; +class TQStatusBar; class OptionDialog; class DiffTextWindowData; class DiffTextWindowFrame; -class DiffTextWindow : public QWidget +class DiffTextWindow : public TQWidget { Q_OBJECT + TQ_OBJECT public: DiffTextWindow( DiffTextWindowFrame* pParent, - QStatusBar* pStatusBar, + TQStatusBar* pStatusBar, OptionDialog* pOptionDialog, int winIdx ); ~DiffTextWindow(); void init( - const QString& fileName, + const TQString& fileName, const LineData* pLineData, int size, const Diff3LineVector* pDiff3LineVector, @@ -49,7 +50,7 @@ public: void reset(); void convertToLinePos( int x, int y, int& line, int& pos ); - QString getSelection(); + TQString getSelection(); int getFirstLine(); int calcTopLineInFile( int firstLine ); @@ -66,13 +67,13 @@ public: void convertSelectionToD3LCoords(); - bool findString( const QString& s, int& d3vLine, int& posInLine, bool bDirDown, bool bCaseSensitive ); + bool findString( const TQString& s, int& d3vLine, int& posInLine, bool bDirDown, bool bCaseSensitive ); void setSelection( int firstLine, int startPos, int lastLine, int endPos, int& l, int& p ); void getSelectionRange( int* firstLine, int* lastLine, e_CoordType coordType ); void setPaintingAllowed( bool bAllowPainting ); void recalcWordWrap( bool bWordWrap, int wrapLineVectorSize, int nofVisibleColumns ); - void print( MyPainter& painter, const QRect& r, int firstLine, int nofLinesPerPage ); + void print( MyPainter& painter, const TQRect& r, int firstLine, int nofLinesPerPage ); signals: void resizeSignal( int nofVisibleColumns, int nofVisibleLines ); void scroll( int deltaX, int deltaY ); @@ -89,17 +90,17 @@ public slots: void setFastSelectorRange( int line1, int nofLines ); protected: - virtual void mousePressEvent ( QMouseEvent * ); - virtual void mouseReleaseEvent ( QMouseEvent * ); - virtual void mouseMoveEvent ( QMouseEvent * ); - virtual void mouseDoubleClickEvent ( QMouseEvent * e ); + virtual void mousePressEvent ( TQMouseEvent * ); + virtual void mouseReleaseEvent ( TQMouseEvent * ); + virtual void mouseMoveEvent ( TQMouseEvent * ); + virtual void mouseDoubleClickEvent ( TQMouseEvent * e ); - virtual void paintEvent( QPaintEvent* ); - virtual void dragEnterEvent( QDragEnterEvent* e ); - virtual void focusInEvent( QFocusEvent* e ); + virtual void paintEvent( TQPaintEvent* ); + virtual void dragEnterEvent( TQDragEnterEvent* e ); + virtual void focusInEvent( TQFocusEvent* e ); - virtual void resizeEvent( QResizeEvent* ); - virtual void timerEvent(QTimerEvent*); + virtual void resizeEvent( TQResizeEvent* ); + virtual void timerEvent(TQTimerEvent*); private: DiffTextWindowData* d; @@ -110,19 +111,20 @@ private: class DiffTextWindowFrameData; -class DiffTextWindowFrame : public QWidget +class DiffTextWindowFrame : public TQWidget { Q_OBJECT + TQ_OBJECT public: - DiffTextWindowFrame( QWidget* pParent, QStatusBar* pStatusBar, OptionDialog* pOptionDialog, int winIdx ); + DiffTextWindowFrame( TQWidget* pParent, TQStatusBar* pStatusBar, OptionDialog* pOptionDialog, int winIdx ); ~DiffTextWindowFrame(); DiffTextWindow* getDiffTextWindow(); void init(); void setFirstLine(int firstLine); signals: - void fileNameChanged(const QString&, int); + void fileNameChanged(const TQString&, int); protected: - bool eventFilter( QObject*, QEvent* ); + bool eventFilter( TQObject*, TQEvent* ); private slots: void slotReturnPressed(); void slotBrowseButtonClicked(); diff --git a/src/directorymergewindow.cpp b/src/directorymergewindow.cpp index 48d7904..bf58078 100644 --- a/src/directorymergewindow.cpp +++ b/src/directorymergewindow.cpp @@ -20,20 +20,20 @@ #include <vector> #include <map> -#include <qdir.h> -#include <qapplication.h> -#include <qpixmap.h> -#include <qimage.h> +#include <tqdir.h> +#include <tqapplication.h> +#include <tqpixmap.h> +#include <tqimage.h> #include <kpopupmenu.h> #include <kaction.h> -#include <qregexp.h> -#include <qmessagebox.h> -#include <qlayout.h> -#include <qlabel.h> -#include <qtable.h> -#include <qsplitter.h> -#include <qtextedit.h> -#include <qprogressdialog.h> +#include <tqregexp.h> +#include <tqmessagebox.h> +#include <tqlayout.h> +#include <tqlabel.h> +#include <tqtable.h> +#include <tqsplitter.h> +#include <tqtextedit.h> +#include <tqprogressdialog.h> #include <kmessagebox.h> #include <kfiledialog.h> #include <kiconloader.h> @@ -44,43 +44,43 @@ static bool conflictingFileTypes(MergeFileInfos& mfi); /* -class StatusInfo : public QListView +class StatusInfo : public TQListView { public: - StatusInfo(QWidget* pParent) : QListView( pParent, "StatusInfo", Qt::WShowModal ) + StatusInfo(TQWidget* pParent) : TQListView( pParent, "StatusInfo", TQt::WShowModal ) { addColumn(""); setSorting(-1); //disable sorting } - QListViewItem* m_pLast; - QListViewItem* last() + TQListViewItem* m_pLast; + TQListViewItem* last() { if (firstChild()==0) return 0; else return m_pLast; } - void addText(const QString& s ) + void addText(const TQString& s ) { - if (firstChild()==0) m_pLast = new QListViewItem( this, s ); - else m_pLast = new QListViewItem( this, last(), s ); + if (firstChild()==0) m_pLast = new TQListViewItem( this, s ); + else m_pLast = new TQListViewItem( this, last(), s ); } }; */ -class StatusInfo : public QTextEdit +class StatusInfo : public TQTextEdit { public: - StatusInfo(QWidget* pParent) : QTextEdit( pParent, "StatusInfo" ) + StatusInfo(TQWidget* pParent) : TQTextEdit( pParent, "StatusInfo" ) { - setWFlags(Qt::WShowModal); - setWordWrap(QTextEdit::NoWrap); + setWFlags(TQt::WShowModal); + setWordWrap(TQTextEdit::NoWrap); setReadOnly(true); //showMaximized(); } bool isEmpty(){ return text().isEmpty(); } - void addText(const QString& s ) + void addText(const TQString& s ) { append(s); } @@ -88,7 +88,7 @@ public: void show() { scrollToBottom(); - QTextEdit::show(); + TQTextEdit::show(); } }; @@ -96,16 +96,16 @@ public: class TempRemover { public: - TempRemover( const QString& origName, FileAccess& fa ); + TempRemover( const TQString& origName, FileAccess& fa ); ~TempRemover(); - QString name() { return m_name; } + TQString name() { return m_name; } bool success() { return m_bSuccess; } private: - QString m_name; + TQString m_name; bool m_bTemp; bool m_bSuccess; }; -TempRemover::TempRemover(const QString& origName, FileAccess& fa) +TempRemover::TempRemover(const TQString& origName, FileAccess& fa) { if ( fa.isLocal() ) { @@ -128,7 +128,7 @@ TempRemover::~TempRemover() void DirectoryMergeWindow::fastFileComparison( FileAccess& fi1, FileAccess& fi2, - bool& bEqual, bool& bError, QString& status ) + bool& bEqual, bool& bError, TQString& status ) { ProgressProxy pp; status = ""; @@ -182,42 +182,46 @@ void DirectoryMergeWindow::fastFileComparison( } } - QString fileName1 = fi1.absFilePath(); - QString fileName2 = fi2.absFilePath(); + TQString fileName1 = fi1.absFilePath(); + TQString fileName2 = fi2.absFilePath(); TempRemover tr1( fileName1, fi1 ); if ( !tr1.success() ) { - status = i18n("Creating temp copy of %1 failed.").arg(fileName1); + status = i18n("Creating temp copy of %1 failed.").tqarg(fileName1); return; } TempRemover tr2( fileName2, fi2 ); if ( !tr2.success() ) { - status = i18n("Creating temp copy of %1 failed.").arg(fileName2); + status = i18n("Creating temp copy of %1 failed.").tqarg(fileName2); return; } std::vector<char> buf1(100000); std::vector<char> buf2(buf1.size()); - QFile file1( tr1.name() ); + TQFile file1( tr1.name() ); if ( ! file1.open(IO_ReadOnly) ) { - status = i18n("Opening %1 failed.").arg(fileName1); + status = i18n("Opening %1 failed.").tqarg(fileName1); return; } - QFile file2( tr2.name() ); + TQFile file2( tr2.name() ); if ( ! file2.open(IO_ReadOnly) ) { - status = i18n("Opening %1 failed.").arg(fileName2); + status = i18n("Opening %1 failed.").tqarg(fileName2); return; } pp.setInformation( i18n("Comparing file..."), 0, false ); - typedef QFile::Offset t_FileSize; +#ifdef USE_QT4 + typedef qint64 t_FileSize; +#else // USE_QT4 + typedef TQFile::Offset t_FileSize; +#endif // USE_QT4 t_FileSize fullSize = file1.size(); t_FileSize sizeLeft = fullSize; @@ -226,13 +230,13 @@ void DirectoryMergeWindow::fastFileComparison( int len = min2( sizeLeft, (t_FileSize)buf1.size() ); if( len != file1.readBlock( &buf1[0], len ) ) { - status = i18n("Error reading from %1").arg(fileName1); + status = i18n("Error reading from %1").tqarg(fileName1); return; } if( len != file2.readBlock( &buf2[0], len ) ) { - status = i18n("Error reading from %1").arg(fileName2); + status = i18n("Error reading from %1").tqarg(fileName2); return; } @@ -264,16 +268,16 @@ static int s_UnsolvedCol = 6; // Nr of unsolved conflicts (for 3 input files) static int s_SolvedCol = 7; // Nr of auto-solvable conflicts (for 3 input files) static int s_NonWhiteCol = 8; // Nr of nonwhite deltas (for 2 input files) static int s_WhiteCol = 9; // Nr of white deltas (for 2 input files) -DirectoryMergeWindow::DirectoryMergeWindow( QWidget* pParent, OptionDialog* pOptions, KIconLoader* pIconLoader ) - : QListView( pParent ) -{ - connect( this, SIGNAL(doubleClicked(QListViewItem*)), this, SLOT(onDoubleClick(QListViewItem*))); - connect( this, SIGNAL(returnPressed(QListViewItem*)), this, SLOT(onDoubleClick(QListViewItem*))); - connect( this, SIGNAL( mouseButtonPressed(int,QListViewItem*,const QPoint&, int)), - this, SLOT( onClick(int,QListViewItem*,const QPoint&, int)) ); - connect( this, SIGNAL(contextMenuRequested(QListViewItem*,const QPoint &,int)), - this, SLOT( slotShowContextMenu(QListViewItem*,const QPoint &,int))); - connect( this, SIGNAL(selectionChanged(QListViewItem*)), this, SLOT(onSelectionChanged(QListViewItem*))); +DirectoryMergeWindow::DirectoryMergeWindow( TQWidget* pParent, OptionDialog* pOptions, KIconLoader* pIconLoader ) + : TQListView( pParent ) +{ + connect( TQT_TQOBJECT(this), TQT_SIGNAL(doubleClicked(TQListViewItem*)), TQT_TQOBJECT(this), TQT_SLOT(onDoubleClick(TQListViewItem*))); + connect( TQT_TQOBJECT(this), TQT_SIGNAL(returnPressed(TQListViewItem*)), TQT_TQOBJECT(this), TQT_SLOT(onDoubleClick(TQListViewItem*))); + connect( TQT_TQOBJECT(this), TQT_SIGNAL( mouseButtonPressed(int,TQListViewItem*,const TQPoint&, int)), + TQT_TQOBJECT(this), TQT_SLOT( onClick(int,TQListViewItem*,const TQPoint&, int)) ); + connect( TQT_TQOBJECT(this), TQT_SIGNAL(contextMenuRequested(TQListViewItem*,const TQPoint &,int)), + TQT_TQOBJECT(this), TQT_SLOT( slotShowContextMenu(TQListViewItem*,const TQPoint &,int))); + connect( TQT_TQOBJECT(this), TQT_SIGNAL(selectionChanged(TQListViewItem*)), TQT_TQOBJECT(this), TQT_SLOT(onSelectionChanged(TQListViewItem*))); m_pOptions = pOptions; m_pIconLoader = pIconLoader; m_pDirectoryMergeInfo = 0; @@ -295,16 +299,16 @@ DirectoryMergeWindow::DirectoryMergeWindow( QWidget* pParent, OptionDialog* pOpt addColumn("B"); addColumn("C"); addColumn(i18n("Operation")); - addColumn(i18n("Status")); + addColumn(i18n("tqStatus")); addColumn(i18n("Unsolved")); addColumn(i18n("Solved")); addColumn(i18n("Nonwhite")); addColumn(i18n("White")); - setColumnAlignment( s_UnsolvedCol, Qt::AlignRight ); - setColumnAlignment( s_SolvedCol, Qt::AlignRight ); - setColumnAlignment( s_NonWhiteCol, Qt::AlignRight ); - setColumnAlignment( s_WhiteCol, Qt::AlignRight ); + setColumnAlignment( s_UnsolvedCol, TQt::AlignRight ); + setColumnAlignment( s_SolvedCol, TQt::AlignRight ); + setColumnAlignment( s_NonWhiteCol, TQt::AlignRight ); + setColumnAlignment( s_WhiteCol, TQt::AlignRight ); } DirectoryMergeWindow::~DirectoryMergeWindow() @@ -337,53 +341,53 @@ void DirectoryMergeWindow::reload() } // Copy pm2 onto pm1, but preserve the alpha value from pm1 where pm2 is transparent. -static QPixmap pixCombiner( const QPixmap* pm1, const QPixmap* pm2 ) +static TQPixmap pixCombiner( const TQPixmap* pm1, const TQPixmap* pm2 ) { - QImage img1 = pm1->convertToImage().convertDepth(32); - QImage img2 = pm2->convertToImage().convertDepth(32); + TQImage img1 = pm1->convertToImage().convertDepth(32); + TQImage img2 = pm2->convertToImage().convertDepth(32); for (int y = 0; y < img1.height(); y++) { - Q_UINT32 *line1 = reinterpret_cast<Q_UINT32 *>(img1.scanLine(y)); - Q_UINT32 *line2 = reinterpret_cast<Q_UINT32 *>(img2.scanLine(y)); + TQ_UINT32 *line1 = reinterpret_cast<TQ_UINT32 *>(img1.scanLine(y)); + TQ_UINT32 *line2 = reinterpret_cast<TQ_UINT32 *>(img2.scanLine(y)); for (int x = 0; x < img1.width(); x++) { - if ( qAlpha( line2[x] ) >0 ) + if ( tqAlpha( line2[x] ) >0 ) line1[x] = (line2[x] | 0xff000000); } } - QPixmap pix; + TQPixmap pix; pix.convertFromImage(img1); return pix; } // like pixCombiner but let the pm1 color shine through -static QPixmap pixCombiner2( const QPixmap* pm1, const QPixmap* pm2 ) +static TQPixmap pixCombiner2( const TQPixmap* pm1, const TQPixmap* pm2 ) { - QImage img1 = pm1->convertToImage().convertDepth(32); - QImage img2 = pm2->convertToImage().convertDepth(32); + TQImage img1 = pm1->convertToImage().convertDepth(32); + TQImage img2 = pm2->convertToImage().convertDepth(32); for (int y = 0; y < img1.height(); y++) { - Q_UINT32 *line1 = reinterpret_cast<Q_UINT32 *>(img1.scanLine(y)); - Q_UINT32 *line2 = reinterpret_cast<Q_UINT32 *>(img2.scanLine(y)); + TQ_UINT32 *line1 = reinterpret_cast<TQ_UINT32 *>(img1.scanLine(y)); + TQ_UINT32 *line2 = reinterpret_cast<TQ_UINT32 *>(img2.scanLine(y)); for (int x = 0; x < img1.width(); x++) { - if ( qAlpha( line2[x] ) >0 ) + if ( tqAlpha( line2[x] ) >0 ) { - int r = ( qRed( line1[x] ) + qRed( line2[x] ))/2; - int g = ( qGreen( line1[x] ) + qGreen( line2[x] ))/2; - int b = ( qBlue( line1[x] ) + qBlue( line2[x] ))/2; - line1[x] = qRgba( r,g,b, 0xff ); + int r = ( tqRed( line1[x] ) + tqRed( line2[x] ))/2; + int g = ( tqGreen( line1[x] ) + tqGreen( line2[x] ))/2; + int b = ( tqBlue( line1[x] ) + tqBlue( line2[x] ))/2; + line1[x] = tqRgba( r,g,b, 0xff ); } } } - QPixmap pix; + TQPixmap pix; pix.convertFromImage(img1); return pix; } -static void calcDirStatus( bool bThreeDirs, DirMergeItem* i, int& nofFiles, +static void calcDirtqStatus( bool bThreeDirs, DirMergeItem* i, int& nofFiles, int& nofDirs, int& nofEqualFiles, int& nofManualMerges ) { if ( i->m_pMFI->m_bDirA || i->m_pMFI->m_bDirB || i->m_pMFI->m_bDirC ) @@ -403,11 +407,11 @@ static void calcDirStatus( bool bThreeDirs, DirMergeItem* i, int& nofFiles, ++nofManualMerges; } } - for( QListViewItem* p = i->firstChild(); p!=0; p = p->nextSibling() ) - calcDirStatus( bThreeDirs, static_cast<DirMergeItem*>(p), nofFiles, nofDirs, nofEqualFiles, nofManualMerges ); + for( TQListViewItem* p = i->firstChild(); p!=0; p = p->nextSibling() ) + calcDirtqStatus( bThreeDirs, static_cast<DirMergeItem*>(p), nofFiles, nofDirs, nofEqualFiles, nofManualMerges ); } -static QString sortString(const QString& s, bool bCaseSensitive) +static TQString sortString(const TQString& s, bool bCaseSensitive) { if (bCaseSensitive) return s; @@ -419,7 +423,7 @@ struct t_ItemInfo { bool bExpanded; bool bOperationComplete; - QString status; + TQString status; e_MergeOperation eMergeOperation; }; @@ -446,12 +450,12 @@ bool DirectoryMergeWindow::init show(); - std::map<QString,t_ItemInfo> expandedDirsMap; + std::map<TQString,t_ItemInfo> expandedDirsMap; if ( bReload ) { // Remember expandes items - QListViewItemIterator it( this ); + TQListViewItemIterator it( this ); while ( it.current() ) { DirMergeItem* pDMI = static_cast<DirMergeItem*>( it.current() ); @@ -500,16 +504,16 @@ bool DirectoryMergeWindow::init if ( !m_dirA.isDir() || !m_dirB.isDir() || (m_dirC.isValid() && !m_dirC.isDir()) ) { - QString text( i18n("Opening of directories failed:") ); + TQString text( i18n("Opening of directories failed:") ); text += "\n\n"; if ( !dirA.isDir() ) - { text += i18n("Dir A \"%1\" does not exist or is not a directory.\n").arg(m_dirA.prettyAbsPath()); } + { text += i18n("Dir A \"%1\" does not exist or is not a directory.\n").tqarg(m_dirA.prettyAbsPath()); } if ( !dirB.isDir() ) - { text += i18n("Dir B \"%1\" does not exist or is not a directory.\n").arg(m_dirB.prettyAbsPath()); } + { text += i18n("Dir B \"%1\" does not exist or is not a directory.\n").tqarg(m_dirB.prettyAbsPath()); } if ( m_dirC.isValid() && !m_dirC.isDir() ) - { text += i18n("Dir C \"%1\" does not exist or is not a directory.\n").arg(m_dirC.prettyAbsPath()); } + { text += i18n("Dir C \"%1\" does not exist or is not a directory.\n").tqarg(m_dirC.prettyAbsPath()); } KMessageBox::sorry( this, text, i18n("Directory Open Error") ); return false; @@ -535,7 +539,7 @@ bool DirectoryMergeWindow::init else m_dirDestInternal = m_dirC.isValid() ? m_dirC : m_dirB; - QString origCurrentDirectory = QDir::currentDirPath(); + TQString origCurrentDirectory = TQDir::currentDirPath(); m_fileMergeMap.clear(); t_DirectoryList::iterator i; @@ -544,10 +548,10 @@ bool DirectoryMergeWindow::init double nofScans = ( m_dirA.isValid() ? 1 : 0 )+( m_dirB.isValid() ? 1 : 0 )+( m_dirC.isValid() ? 1 : 0 ); int currentScan = 0; - setColumnWidthMode(s_UnsolvedCol, QListView::Manual); - setColumnWidthMode(s_SolvedCol, QListView::Manual); - setColumnWidthMode(s_WhiteCol, QListView::Manual); - setColumnWidthMode(s_NonWhiteCol, QListView::Manual); + setColumnWidthMode(s_UnsolvedCol, TQListView::Manual); + setColumnWidthMode(s_SolvedCol, TQListView::Manual); + setColumnWidthMode(s_WhiteCol, TQListView::Manual); + setColumnWidthMode(s_NonWhiteCol, TQListView::Manual); if ( !m_pOptions->m_bDmFullAnalysis ) { setColumnWidth( s_WhiteCol, 0 ); @@ -645,7 +649,7 @@ bool DirectoryMergeWindow::init bool bContinue = true; if ( !bListDirSuccessA || !bListDirSuccessB || !bListDirSuccessC ) { - QString s = i18n("Some subdirectories were not readable in"); + TQString s = i18n("Some subdirectories were not readable in"); if ( !bListDirSuccessA ) s += "\nA: " + m_dirA.prettyAbsPath(); if ( !bListDirSuccessB ) s += "\nB: " + m_dirB.prettyAbsPath(); if ( !bListDirSuccessC ) s += "\nC: " + m_dirC.prettyAbsPath(); @@ -658,7 +662,7 @@ bool DirectoryMergeWindow::init { prepareListView(pp); - for( QListViewItem* p = firstChild(); p!=0; p = p->nextSibling() ) + for( TQListViewItem* p = firstChild(); p!=0; p = p->nextSibling() ) { DirMergeItem* pDMI = static_cast<DirMergeItem*>( p ); calcSuggestedOperation( *pDMI->m_pMFI, eDefaultMergeOp ); @@ -669,14 +673,14 @@ bool DirectoryMergeWindow::init setSelected( 0, true ); } - QDir::setCurrent(origCurrentDirectory); + TQDir::setCurrent(origCurrentDirectory); // Try to improve the view a little bit. - QWidget* pParent = parentWidget(); - QSplitter* pSplitter = static_cast<QSplitter*>(pParent); + TQWidget* pParent = tqparentWidget(); + TQSplitter* pSplitter = static_cast<TQSplitter*>(pParent); if (pSplitter!=0) { - QValueList<int> sizes = pSplitter->sizes(); + TQValueList<int> sizes = pSplitter->sizes(); int total = sizes[0] + sizes[1]; sizes[0]=total*6/10; sizes[1]=total - sizes[0]; @@ -693,18 +697,18 @@ bool DirectoryMergeWindow::init int nofDirs=0; int nofEqualFiles=0; int nofManualMerges=0; - for( QListViewItem* p = firstChild(); p!=0; p = p->nextSibling() ) - calcDirStatus( m_dirC.isValid(), static_cast<DirMergeItem*>(p), + for( TQListViewItem* p = firstChild(); p!=0; p = p->nextSibling() ) + calcDirtqStatus( m_dirC.isValid(), static_cast<DirMergeItem*>(p), nofFiles, nofDirs, nofEqualFiles, nofManualMerges ); - QString s; - s = i18n("Directory Comparison Status") + "\n\n" + - i18n("Number of subdirectories:") +" "+ QString::number(nofDirs) + "\n"+ - i18n("Number of equal files:") +" "+ QString::number(nofEqualFiles) + "\n"+ - i18n("Number of different files:") +" "+ QString::number(nofFiles-nofEqualFiles); + TQString s; + s = i18n("Directory Comparison tqStatus") + "\n\n" + + i18n("Number of subdirectories:") +" "+ TQString::number(nofDirs) + "\n"+ + i18n("Number of equal files:") +" "+ TQString::number(nofEqualFiles) + "\n"+ + i18n("Number of different files:") +" "+ TQString::number(nofFiles-nofEqualFiles); if ( m_dirC.isValid() ) - s += "\n" + i18n("Number of manual merges:") +" "+ QString::number(nofManualMerges); + s += "\n" + i18n("Number of manual merges:") +" "+ TQString::number(nofManualMerges); KMessageBox::information( this, s ); setSelected( firstChild(), true ); } @@ -713,11 +717,11 @@ bool DirectoryMergeWindow::init if ( bReload ) { // Remember expandes items - QListViewItemIterator it( this ); + TQListViewItemIterator it( this ); while ( it.current() ) { DirMergeItem* pDMI = static_cast<DirMergeItem*>( it.current() ); - std::map<QString,t_ItemInfo>::iterator i = expandedDirsMap.find( pDMI->m_pMFI->m_subPath ); + std::map<TQString,t_ItemInfo>::iterator i = expandedDirsMap.find( pDMI->m_pMFI->m_subPath ); if ( i!=expandedDirsMap.end() ) { t_ItemInfo& ii = i->second; @@ -749,9 +753,9 @@ void DirectoryMergeWindow::slotAutoChooseEverywhere() void DirectoryMergeWindow::slotNoOpEverywhere(){ setAllMergeOperations(eNoOperation); } -static void setListViewItemOpen( QListViewItem* p, bool bOpen ) +static void setListViewItemOpen( TQListViewItem* p, bool bOpen ) { - for( QListViewItem* pChild = p->firstChild(); pChild!=0; pChild = pChild->nextSibling() ) + for( TQListViewItem* pChild = p->firstChild(); pChild!=0; pChild = pChild->nextSibling() ) setListViewItemOpen( pChild, bOpen ); p->setOpen( bOpen ); @@ -759,17 +763,17 @@ static void setListViewItemOpen( QListViewItem* p, bool bOpen ) void DirectoryMergeWindow::slotFoldAllSubdirs() { - for( QListViewItem* p = firstChild(); p!=0; p = p->nextSibling() ) + for( TQListViewItem* p = firstChild(); p!=0; p = p->nextSibling() ) setListViewItemOpen( p, false ); } void DirectoryMergeWindow::slotUnfoldAllSubdirs() { - for( QListViewItem* p = firstChild(); p!=0; p = p->nextSibling() ) + for( TQListViewItem* p = firstChild(); p!=0; p = p->nextSibling() ) setListViewItemOpen( p, true ); } -static void setMergeOperation( QListViewItem* pLVI, e_MergeOperation eMergeOp ) +static void setMergeOperation( TQListViewItem* pLVI, e_MergeOperation eMergeOp ) { if ( pLVI==0 ) return; @@ -801,13 +805,13 @@ void DirectoryMergeWindow::slotCurrentMergeToB() { setMergeOperation(current void DirectoryMergeWindow::slotCurrentMergeToAAndB() { setMergeOperation(currentItem(), eMergeToAB ); } -void DirectoryMergeWindow::keyPressEvent( QKeyEvent* e ) +void DirectoryMergeWindow::keyPressEvent( TQKeyEvent* e ) { - if ( (e->state() & Qt::ControlButton)!=0 ) + if ( (e->state() & TQt::ControlButton)!=0 ) { bool bThreeDirs = m_dirC.isValid(); - QListViewItem* lvi = currentItem(); + TQListViewItem* lvi = currentItem(); DirMergeItem* pDMI = lvi==0 ? 0 : static_cast<DirMergeItem*>(lvi); MergeFileInfos* pMFI = pDMI==0 ? 0 : pDMI->m_pMFI; @@ -845,14 +849,14 @@ void DirectoryMergeWindow::keyPressEvent( QKeyEvent* e ) } } - QListView::keyPressEvent(e); + TQListView::keyPressEvent(e); } -void DirectoryMergeWindow::focusInEvent(QFocusEvent*) +void DirectoryMergeWindow::focusInEvent(TQFocusEvent*) { updateAvailabilities(); } -void DirectoryMergeWindow::focusOutEvent(QFocusEvent*) +void DirectoryMergeWindow::focusOutEvent(TQFocusEvent*) { updateAvailabilities(); } @@ -863,7 +867,7 @@ void DirectoryMergeWindow::setAllMergeOperations( e_MergeOperation eDefaultOpera i18n("This affects all merge operations."), i18n("Changing All Merge Operations"),i18n("C&ontinue"), i18n("&Cancel") ) ) { - for( QListViewItem* p = firstChild(); p!=0; p = p->nextSibling() ) + for( TQListViewItem* p = firstChild(); p!=0; p = p->nextSibling() ) { DirMergeItem* pDMI = static_cast<DirMergeItem*>( p ); calcSuggestedOperation( *pDMI->m_pMFI, eDefaultOperation ); @@ -874,7 +878,7 @@ void DirectoryMergeWindow::setAllMergeOperations( e_MergeOperation eDefaultOpera void DirectoryMergeWindow::compareFilesAndCalcAges( MergeFileInfos& mfi ) { - std::map<QDateTime,int> dateMap; + std::map<TQDateTime,int> dateMap; if( mfi.m_bExistsInA ) { @@ -907,14 +911,14 @@ void DirectoryMergeWindow::compareFilesAndCalcAges( MergeFileInfos& mfi ) else { emit startDiffMerge( - mfi.m_bExistsInA ? mfi.m_fileInfoA.absFilePath() : QString(""), - mfi.m_bExistsInB ? mfi.m_fileInfoB.absFilePath() : QString(""), - mfi.m_bExistsInC ? mfi.m_fileInfoC.absFilePath() : QString(""), + mfi.m_bExistsInA ? mfi.m_fileInfoA.absFilePath() : TQString(""), + mfi.m_bExistsInB ? mfi.m_fileInfoB.absFilePath() : TQString(""), + mfi.m_bExistsInC ? mfi.m_fileInfoC.absFilePath() : TQString(""), "", - "","","",&mfi.m_totalDiffStatus + "","","",&mfi.m_totalDifftqStatus ); - int nofNonwhiteConflicts = mfi.m_totalDiffStatus.nofUnsolvedConflicts + - mfi.m_totalDiffStatus.nofSolvedConflicts - mfi.m_totalDiffStatus.nofWhitespaceConflicts; + int nofNonwhiteConflicts = mfi.m_totalDifftqStatus.nofUnsolvedConflicts + + mfi.m_totalDifftqStatus.nofSolvedConflicts - mfi.m_totalDifftqStatus.nofWhitespaceConflicts; if (m_pOptions->m_bDmWhiteSpaceEqual && nofNonwhiteConflicts == 0) { @@ -924,25 +928,25 @@ void DirectoryMergeWindow::compareFilesAndCalcAges( MergeFileInfos& mfi ) } else { - mfi.m_bEqualAB = mfi.m_totalDiffStatus.bBinaryAEqB; - mfi.m_bEqualBC = mfi.m_totalDiffStatus.bBinaryBEqC; - mfi.m_bEqualAC = mfi.m_totalDiffStatus.bBinaryAEqC; + mfi.m_bEqualAB = mfi.m_totalDifftqStatus.bBinaryAEqB; + mfi.m_bEqualBC = mfi.m_totalDifftqStatus.bBinaryBEqC; + mfi.m_bEqualAC = mfi.m_totalDifftqStatus.bBinaryAEqC; } } } else { bool bError; - QString eqStatus; + TQString eqtqStatus; if( mfi.m_bExistsInA && mfi.m_bExistsInB ) { if( mfi.m_bDirA ) mfi.m_bEqualAB=true; - else fastFileComparison( mfi.m_fileInfoA, mfi.m_fileInfoB, mfi.m_bEqualAB, bError, eqStatus ); + else fastFileComparison( mfi.m_fileInfoA, mfi.m_fileInfoB, mfi.m_bEqualAB, bError, eqtqStatus ); } if( mfi.m_bExistsInA && mfi.m_bExistsInC ) { if( mfi.m_bDirA ) mfi.m_bEqualAC=true; - else fastFileComparison( mfi.m_fileInfoA, mfi.m_fileInfoC, mfi.m_bEqualAC, bError, eqStatus ); + else fastFileComparison( mfi.m_fileInfoA, mfi.m_fileInfoC, mfi.m_bEqualAC, bError, eqtqStatus ); } if( mfi.m_bExistsInB && mfi.m_bExistsInC ) { @@ -951,7 +955,7 @@ void DirectoryMergeWindow::compareFilesAndCalcAges( MergeFileInfos& mfi ) else { if( mfi.m_bDirB ) mfi.m_bEqualBC=true; - else fastFileComparison( mfi.m_fileInfoB, mfi.m_fileInfoC, mfi.m_bEqualBC, bError, eqStatus ); + else fastFileComparison( mfi.m_fileInfoB, mfi.m_fileInfoC, mfi.m_bEqualBC, bError, eqtqStatus ); } } } @@ -968,7 +972,7 @@ void DirectoryMergeWindow::compareFilesAndCalcAges( MergeFileInfos& mfi ) // The map automatically sorts the keys. int age = eNew; - std::map<QDateTime,int>::reverse_iterator i; + std::map<TQDateTime,int>::reverse_iterator i; for( i=dateMap.rbegin(); i!=dateMap.rend(); ++i ) { int n = i->second; @@ -1018,68 +1022,68 @@ void DirectoryMergeWindow::compareFilesAndCalcAges( MergeFileInfos& mfi ) } } -static QPixmap* s_pm_dir; -static QPixmap* s_pm_file; +static TQPixmap* s_pm_dir; +static TQPixmap* s_pm_file; -static QPixmap* pmNotThere; -static QPixmap* pmNew; -static QPixmap* pmOld; -static QPixmap* pmMiddle; +static TQPixmap* pmNotThere; +static TQPixmap* pmNew; +static TQPixmap* pmOld; +static TQPixmap* pmMiddle; -static QPixmap* pmLink; +static TQPixmap* pmLink; -static QPixmap* pmDirLink; -static QPixmap* pmFileLink; +static TQPixmap* pmDirLink; +static TQPixmap* pmFileLink; -static QPixmap* pmNewLink; -static QPixmap* pmOldLink; -static QPixmap* pmMiddleLink; +static TQPixmap* pmNewLink; +static TQPixmap* pmOldLink; +static TQPixmap* pmMiddleLink; -static QPixmap* pmNewDir; -static QPixmap* pmMiddleDir; -static QPixmap* pmOldDir; +static TQPixmap* pmNewDir; +static TQPixmap* pmMiddleDir; +static TQPixmap* pmOldDir; -static QPixmap* pmNewDirLink; -static QPixmap* pmMiddleDirLink; -static QPixmap* pmOldDirLink; +static TQPixmap* pmNewDirLink; +static TQPixmap* pmMiddleDirLink; +static TQPixmap* pmOldDirLink; -static QPixmap colorToPixmap(QColor c) +static TQPixmap colorToPixmap(TQColor c) { - QPixmap pm(16,16); - QPainter p(&pm); - p.setPen( Qt::black ); + TQPixmap pm(16,16); + TQPainter p(&pm); + p.setPen( TQt::black ); p.setBrush( c ); p.drawRect(0,0,pm.width(),pm.height()); return pm; } -static void initPixmaps( QColor newest, QColor oldest, QColor middle, QColor notThere ) +static void initPixmaps( TQColor newest, TQColor oldest, TQColor middle, TQColor notThere ) { if (pmNew==0) { - pmNotThere = new QPixmap; - pmNew = new QPixmap; - pmOld = new QPixmap; - pmMiddle = new QPixmap; + pmNotThere = new TQPixmap; + pmNew = new TQPixmap; + pmOld = new TQPixmap; + pmMiddle = new TQPixmap; #include "xpm/link_arrow.xpm" - pmLink = new QPixmap(link_arrow); + pmLink = new TQPixmap(link_arrow); - pmDirLink = new QPixmap; - pmFileLink = new QPixmap; + pmDirLink = new TQPixmap; + pmFileLink = new TQPixmap; - pmNewLink = new QPixmap; - pmOldLink = new QPixmap; - pmMiddleLink = new QPixmap; + pmNewLink = new TQPixmap; + pmOldLink = new TQPixmap; + pmMiddleLink = new TQPixmap; - pmNewDir = new QPixmap; - pmMiddleDir = new QPixmap; - pmOldDir = new QPixmap; + pmNewDir = new TQPixmap; + pmMiddleDir = new TQPixmap; + pmOldDir = new TQPixmap; - pmNewDirLink = new QPixmap; - pmMiddleDirLink = new QPixmap; - pmOldDirLink = new QPixmap; + pmNewDirLink = new TQPixmap; + pmMiddleDirLink = new TQPixmap; + pmOldDirLink = new TQPixmap; } @@ -1105,14 +1109,14 @@ static void initPixmaps( QColor newest, QColor oldest, QColor middle, QColor not } -static void setOnePixmap( QListViewItem* pLVI, int col, e_Age eAge, bool bLink, bool bDir ) +static void setOnePixmap( TQListViewItem* pLVI, int col, e_Age eAge, bool bLink, bool bDir ) { - static QPixmap* ageToPm[]= { pmNew, pmMiddle, pmOld, pmNotThere, s_pm_file }; - static QPixmap* ageToPmLink[]= { pmNewLink, pmMiddleLink, pmOldLink, pmNotThere, pmFileLink }; - static QPixmap* ageToPmDir[]= { pmNewDir, pmMiddleDir, pmOldDir, pmNotThere, s_pm_dir }; - static QPixmap* ageToPmDirLink[]={ pmNewDirLink, pmMiddleDirLink, pmOldDirLink, pmNotThere, pmDirLink }; + static TQPixmap* ageToPm[]= { pmNew, pmMiddle, pmOld, pmNotThere, s_pm_file }; + static TQPixmap* ageToPmLink[]= { pmNewLink, pmMiddleLink, pmOldLink, pmNotThere, pmFileLink }; + static TQPixmap* ageToPmDir[]= { pmNewDir, pmMiddleDir, pmOldDir, pmNotThere, s_pm_dir }; + static TQPixmap* ageToPmDirLink[]={ pmNewDirLink, pmMiddleDirLink, pmOldDirLink, pmNotThere, pmDirLink }; - QPixmap** ppPm = bDir ? ( bLink ? ageToPmDirLink : ageToPmDir ): + TQPixmap** ppPm = bDir ? ( bLink ? ageToPmDirLink : ageToPmDir ): ( bLink ? ageToPmLink : ageToPm ); pLVI->setPixmap( col, *ppPm[eAge] ); @@ -1162,8 +1166,8 @@ static void setPixmaps( MergeFileInfos& mfi, bool bCheckC ) setOnePixmap( mfi.m_pDMI, s_CCol, mfi.m_ageC, mfi.m_bLinkC, mfi.m_bDirC ); } -// Iterate through the complete tree. Start by specifying QListView::firstChild(). -static QListViewItem* treeIterator( QListViewItem* p, bool bVisitChildren=true, bool bFindInvisible=false ) +// Iterate through the complete tree. Start by specifying TQListView::firstChild(). +static TQListViewItem* treeIterator( TQListViewItem* p, bool bVisitChildren=true, bool bFindInvisible=false ) { if( p!=0 ) { @@ -1173,11 +1177,11 @@ static QListViewItem* treeIterator( QListViewItem* p, bool bVisitChildren=true, else if ( p->nextSibling() !=0 ) p = p->nextSibling(); else { - p = p->parent(); + p = p->tqparent(); while ( p!=0 ) { if( p->nextSibling()!=0 ) { p = p->nextSibling(); break; } - else { p = p->parent(); } + else { p = p->tqparent(); } } } } @@ -1193,13 +1197,13 @@ void DirectoryMergeWindow::prepareListView( ProgressProxy& pp ) { #include "xpm/file.xpm" #include "xpm/folder.xpm" - s_pm_dir = new QPixmap( m_pIconLoader->loadIcon("folder", KIcon::Small ) ); - if (s_pm_dir->size()!=QSize(16,16)) + s_pm_dir = new TQPixmap( m_pIconLoader->loadIcon("folder", KIcon::Small ) ); + if (s_pm_dir->size()!=TQSize(16,16)) { delete s_pm_dir; - s_pm_dir = new QPixmap( folder_pm ); + s_pm_dir = new TQPixmap( folder_pm ); } - s_pm_file= new QPixmap( file_pm ); + s_pm_file= new TQPixmap( file_pm ); bFirstTime=false; } @@ -1211,10 +1215,10 @@ void DirectoryMergeWindow::prepareListView( ProgressProxy& pp ) bool bCheckC = m_dirC.isValid(); - std::map<QString, MergeFileInfos>::iterator j; + std::map<TQString, MergeFileInfos>::iterator j; int nrOfFiles = m_fileMergeMap.size(); int currentIdx = 1; - QTime t; + TQTime t; t.start(); for( j=m_fileMergeMap.begin(); j!=m_fileMergeMap.end(); ++j ) { @@ -1223,13 +1227,13 @@ void DirectoryMergeWindow::prepareListView( ProgressProxy& pp ) mfi.m_subPath = mfi.m_fileInfoA.exists() ? mfi.m_fileInfoA.filePath() : mfi.m_fileInfoB.exists() ? mfi.m_fileInfoB.filePath() : mfi.m_fileInfoC.exists() ? mfi.m_fileInfoC.filePath() : - QString(""); + TQString(""); - // const QString& fileName = j->first; - const QString& fileName = mfi.m_subPath; + // const TQString& fileName = j->first; + const TQString& fileName = mfi.m_subPath; pp.setInformation( - i18n("Processing ") + QString::number(currentIdx) +" / "+ QString::number(nrOfFiles) + i18n("Processing ") + TQString::number(currentIdx) +" / "+ TQString::number(nrOfFiles) +"\n" + fileName, double(currentIdx) / nrOfFiles, false ); if ( pp.wasCancelled() ) break; ++currentIdx; @@ -1245,9 +1249,9 @@ void DirectoryMergeWindow::prepareListView( ProgressProxy& pp ) // continue; // Get dirname from fileName: Search for "/" from end: - int pos = fileName.findRev('/'); - QString dirPart; - QString filePart; + int pos = fileName.tqfindRev('/'); + TQString dirPart; + TQString filePart; if (pos==-1) { // Top dir @@ -1265,12 +1269,12 @@ void DirectoryMergeWindow::prepareListView( ProgressProxy& pp ) } else { - MergeFileInfos& dirMfi = m_fileMergeMap[sortString(dirPart, m_bCaseSensitive)]; // parent + MergeFileInfos& dirMfi = m_fileMergeMap[sortString(dirPart, m_bCaseSensitive)]; // tqparent assert(dirMfi.m_pDMI!=0); new DirMergeItem( dirMfi.m_pDMI, filePart, &mfi ); mfi.m_pParent = &dirMfi; - if ( !bEqual ) // Set all parents to "not equal" + if ( !bEqual ) // Set all tqparents to "not equal" { MergeFileInfos* p = mfi.m_pParent; while(p!=0) @@ -1296,11 +1300,11 @@ void DirectoryMergeWindow::prepareListView( ProgressProxy& pp ) /*if ( m_pOptions->m_bDmShowOnlyDeltas ) { // Remove all equals. (Search tree depth first) - QListViewItem* p = firstChild(); + TQListViewItem* p = firstChild(); while( p!=0 && firstChild() != 0 ) { - QListViewItem* pParent = p->parent(); - QListViewItem* pNextSibling = p->nextSibling(); + TQListViewItem* pParent = p->tqparent(); + TQListViewItem* pNextSibling = p->nextSibling(); DirMergeItem* pDMI = static_cast<DirMergeItem*>(p); bool bDirEqual = bCheckC ? pDMI->m_pMFI->m_bEqualAB && pDMI->m_pMFI->m_bEqualAC @@ -1319,7 +1323,7 @@ void DirectoryMergeWindow::prepareListView( ProgressProxy& pp ) while ( p!=0 ) { if( p->nextSibling()!=0 ) { p = p->nextSibling(); break; } - else { p = p->parent(); } + else { p = p->tqparent(); } } } } @@ -1496,7 +1500,7 @@ void DirectoryMergeWindow::calcSuggestedOperation( MergeFileInfos& mfi, e_MergeO } } -void DirectoryMergeWindow::onDoubleClick( QListViewItem* lvi ) +void DirectoryMergeWindow::onDoubleClick( TQListViewItem* lvi ) { if (lvi==0) return; @@ -1506,7 +1510,7 @@ void DirectoryMergeWindow::onDoubleClick( QListViewItem* lvi ) compareCurrentFile(); } -void DirectoryMergeWindow::onSelectionChanged( QListViewItem* lvi ) +void DirectoryMergeWindow::onSelectionChanged( TQListViewItem* lvi ) { if ( lvi==0 ) return; @@ -1518,7 +1522,7 @@ void DirectoryMergeWindow::onSelectionChanged( QListViewItem* lvi ) m_pDirectoryMergeInfo->setInfo( m_dirA, m_dirB, m_dirC, m_dirDestInternal, mfi ); } -void DirectoryMergeWindow::onClick( int button, QListViewItem* lvi, const QPoint& p, int c ) +void DirectoryMergeWindow::onClick( int button, TQListViewItem* lvi, const TQPoint& p, int c ) { if ( lvi==0 ) return; @@ -1573,7 +1577,7 @@ void DirectoryMergeWindow::onClick( int button, QListViewItem* lvi, const QPoint } else if ( c == s_ACol || c==s_BCol || c==s_CCol ) { - QString itemPath; + TQString itemPath; if ( c == s_ACol && mfi.m_bExistsInA ){ itemPath = fullNameA(mfi); } else if ( c == s_BCol && mfi.m_bExistsInB ){ itemPath = fullNameB(mfi); } else if ( c == s_CCol && mfi.m_bExistsInC ){ itemPath = fullNameC(mfi); } @@ -1585,7 +1589,7 @@ void DirectoryMergeWindow::onClick( int button, QListViewItem* lvi, const QPoint } } -void DirectoryMergeWindow::slotShowContextMenu(QListViewItem* lvi,const QPoint & p,int c) +void DirectoryMergeWindow::slotShowContextMenu(TQListViewItem* lvi,const TQPoint & p,int c) { if ( lvi==0 ) return; @@ -1595,7 +1599,7 @@ void DirectoryMergeWindow::slotShowContextMenu(QListViewItem* lvi,const QPoint & assert( mfi.m_pDMI==pDMI ); if ( c == s_ACol || c==s_BCol || c==s_CCol ) { - QString itemPath; + TQString itemPath; if ( c == s_ACol && mfi.m_bExistsInA ){ itemPath = fullNameA(mfi); } else if ( c == s_BCol && mfi.m_bExistsInB ){ itemPath = fullNameB(mfi); } else if ( c == s_CCol && mfi.m_bExistsInC ){ itemPath = fullNameC(mfi); } @@ -1610,14 +1614,14 @@ void DirectoryMergeWindow::slotShowContextMenu(QListViewItem* lvi,const QPoint & #ifndef _WIN32 m.exec( p ); #else - void showShellContextMenu( const QString&, QPoint, QWidget*, QPopupMenu* ); + void showShellContextMenu( const TQString&, TQPoint, TQWidget*, TQPopupMenu* ); showShellContextMenu( itemPath, p, this, &m ); #endif } } } -static QString getFileName( DirMergeItem* pDMI, int column ) +static TQString getFileName( DirMergeItem* pDMI, int column ) { if ( pDMI != 0 ) { @@ -1625,7 +1629,7 @@ static QString getFileName( DirMergeItem* pDMI, int column ) return column == s_ACol ? mfi.m_fileInfoA.absFilePath() : column == s_BCol ? mfi.m_fileInfoB.absFilePath() : column == s_CCol ? mfi.m_fileInfoC.absFilePath() : - QString(""); + TQString(""); } return ""; } @@ -1690,30 +1694,26 @@ void DirectoryMergeWindow::selectItemAndColumn(DirMergeItem* pDMI, int c, bool b m_pSelection3Item = pDMI; m_selection3Column = c; } - if (pOld1) repaintItem( pOld1 ); - if (pOld2) repaintItem( pOld2 ); - if (pOld3) repaintItem( pOld3 ); - if (m_pSelection1Item) repaintItem( m_pSelection1Item ); - if (m_pSelection2Item) repaintItem( m_pSelection2Item ); - if (m_pSelection3Item) repaintItem( m_pSelection3Item ); + if (pOld1) tqrepaintItem( pOld1 ); + if (pOld2) tqrepaintItem( pOld2 ); + if (pOld3) tqrepaintItem( pOld3 ); + if (m_pSelection1Item) tqrepaintItem( m_pSelection1Item ); + if (m_pSelection2Item) tqrepaintItem( m_pSelection2Item ); + if (m_pSelection3Item) tqrepaintItem( m_pSelection3Item ); emit updateAvailabilities(); } -// Since Qt 2.3.0 doesn't allow the specification of a compare operator, this trick emulates it. -#if QT_VERSION==230 -#define DIRSORT(x) ( pMFI->m_bDirA ? " " : "" )+x -#else +// Since TQt 2.3.0 doesn't allow the specification of a compare operator, this trick emulates it. #define DIRSORT(x) x -#endif -DirMergeItem::DirMergeItem( QListView* pParent, const QString& fileName, MergeFileInfos* pMFI ) -: QListViewItem( pParent, DIRSORT( fileName ), "","","", i18n("To do."), "" ) +DirMergeItem::DirMergeItem( TQListView* pParent, const TQString& fileName, MergeFileInfos* pMFI ) +: TQListViewItem( pParent, DIRSORT( fileName ), "","","", i18n("To do."), "" ) { init(pMFI); } -DirMergeItem::DirMergeItem( DirMergeItem* pParent, const QString& fileName, MergeFileInfos* pMFI ) -: QListViewItem( pParent, DIRSORT( fileName ), "","","", i18n("To do."), "" ) +DirMergeItem::DirMergeItem( DirMergeItem* pParent, const TQString& fileName, MergeFileInfos* pMFI ) +: TQListViewItem( pParent, DIRSORT( fileName ), "","","", i18n("To do."), "" ) { init(pMFI); } @@ -1723,20 +1723,20 @@ void DirMergeItem::init(MergeFileInfos* pMFI) { pMFI->m_pDMI = this; m_pMFI = pMFI; - TotalDiffStatus& tds = pMFI->m_totalDiffStatus; + TotalDifftqStatus& tds = pMFI->m_totalDifftqStatus; if ( m_pMFI->m_bDirA || m_pMFI->m_bDirB || m_pMFI->m_bDirC ) { } else { - setText( s_UnsolvedCol, QString::number( tds.nofUnsolvedConflicts ) ); - setText( s_SolvedCol, QString::number( tds.nofSolvedConflicts ) ); - setText( s_NonWhiteCol, QString::number( tds.nofUnsolvedConflicts + tds.nofSolvedConflicts - tds.nofWhitespaceConflicts ) ); - setText( s_WhiteCol, QString::number( tds.nofWhitespaceConflicts ) ); + setText( s_UnsolvedCol, TQString::number( tds.nofUnsolvedConflicts ) ); + setText( s_SolvedCol, TQString::number( tds.nofSolvedConflicts ) ); + setText( s_NonWhiteCol, TQString::number( tds.nofUnsolvedConflicts + tds.nofSolvedConflicts - tds.nofWhitespaceConflicts ) ); + setText( s_WhiteCol, TQString::number( tds.nofWhitespaceConflicts ) ); } } -int DirMergeItem::compare(QListViewItem *i, int col, bool ascending) const +int DirMergeItem::compare(TQListViewItem *i, int col, bool ascending) const { DirMergeItem* pDMI = static_cast<DirMergeItem*>(i); bool bDir1 = m_pMFI->m_bDirA || m_pMFI->m_bDirB || m_pMFI->m_bDirC; @@ -1746,17 +1746,17 @@ int DirMergeItem::compare(QListViewItem *i, int col, bool ascending) const if(col==s_UnsolvedCol || col==s_SolvedCol || col==s_NonWhiteCol || col==s_WhiteCol) return key(col,ascending).toInt() > i->key(col,ascending).toInt() ? -1 : 1; else - return QListViewItem::compare( i, col, ascending ); + return TQListViewItem::compare( i, col, ascending ); } else return bDir1 ? -1 : 1; } -void DirMergeItem::paintCell(QPainter * p, const QColorGroup & cg, int column, int width, int align ) +void DirMergeItem::paintCell(TQPainter * p, const TQColorGroup & cg, int column, int width, int align ) { if (column == s_ACol || column == s_BCol || column == s_CCol ) { - const QPixmap* icon = pixmap(column); + const TQPixmap* icon = pixmap(column); if ( icon ) { int yOffset = (height() - icon->height()) / 2; @@ -1772,13 +1772,13 @@ void DirMergeItem::paintCell(QPainter * p, const QColorGroup & cg, int column, i if ( i!=0 ) { OptionDialog* pOD = pDMW->m_pOptions; - QColor c ( i==1 ? pOD->m_colorA : i==2 ? pOD->m_colorB : pOD->m_colorC ); + TQColor c ( i==1 ? pOD->m_colorA : i==2 ? pOD->m_colorB : pOD->m_colorC ); p->setPen( c );// highlight() ); p->drawRect( 2, yOffset, icon->width(), icon->height()); - p->setPen( QPen( c, 0, Qt::DotLine) ); + p->setPen( TQPen( c, 0, TQt::DotLine) ); p->drawRect( 1, yOffset-1, icon->width()+2, icon->height()+2); p->setPen( cg.background() ); - QString s( QChar('A'+i-1) ); + TQString s( TQChar('A'+i-1) ); p->drawText( 2 + (icon->width() - p->fontMetrics().width(s))/2, yOffset + (icon->height() + p->fontMetrics().ascent())/2-1, s ); @@ -1792,7 +1792,7 @@ void DirMergeItem::paintCell(QPainter * p, const QColorGroup & cg, int column, i return; } } - QListViewItem::paintCell(p,cg,column,width,align); + TQListViewItem::paintCell(p,cg,column,width,align); } DirMergeItem::~DirMergeItem() @@ -1809,7 +1809,7 @@ void MergeFileInfos::setMergeOperation( e_MergeOperation eMOp, bool bRecursive ) } m_eMergeOperation = eMOp; - QString s; + TQString s; bool bDir = m_bDirA || m_bDirB || m_bDirC; if( m_pDMI!=0 ) { @@ -1840,7 +1840,7 @@ void MergeFileInfos::setMergeOperation( e_MergeOperation eMOp, bool bRecursive ) { e_MergeOperation eChildrenMergeOp = m_eMergeOperation; if ( eChildrenMergeOp == eConflictingFileTypes ) eChildrenMergeOp = eMergeABCToDest; - QListViewItem* p = m_pDMI->firstChild(); + TQListViewItem* p = m_pDMI->firstChild(); while ( p!=0 ) { DirMergeItem* pDMI = static_cast<DirMergeItem*>( p ); @@ -1869,9 +1869,9 @@ void DirectoryMergeWindow::compareCurrentFile() if ( !(mfi.m_bDirA || mfi.m_bDirB || mfi.m_bDirC) ) { emit startDiffMerge( - mfi.m_bExistsInA ? mfi.m_fileInfoA.absFilePath() : QString(""), - mfi.m_bExistsInB ? mfi.m_fileInfoB.absFilePath() : QString(""), - mfi.m_bExistsInC ? mfi.m_fileInfoC.absFilePath() : QString(""), + mfi.m_bExistsInA ? mfi.m_fileInfoA.absFilePath() : TQString(""), + mfi.m_bExistsInB ? mfi.m_fileInfoB.absFilePath() : TQString(""), + mfi.m_bExistsInC ? mfi.m_fileInfoC.absFilePath() : TQString(""), "", "","","",0 ); @@ -1916,9 +1916,9 @@ void DirectoryMergeWindow::slotMergeExplicitlySelectedFiles() return; } - QString fn1 = getFileName( m_pSelection1Item, m_selection1Column ); - QString fn2 = getFileName( m_pSelection2Item, m_selection2Column ); - QString fn3 = getFileName( m_pSelection3Item, m_selection3Column ); + TQString fn1 = getFileName( m_pSelection1Item, m_selection1Column ); + TQString fn2 = getFileName( m_pSelection2Item, m_selection2Column ); + TQString fn3 = getFileName( m_pSelection3Item, m_selection3Column ); emit startDiffMerge( fn1, fn2, fn3, fn3.isEmpty() ? fn2 : fn3, @@ -1943,7 +1943,7 @@ bool DirectoryMergeWindow::isFileSelected() return false; } -void DirectoryMergeWindow::mergeResultSaved(const QString& fileName) +void DirectoryMergeWindow::mergeResultSaved(const TQString& fileName) { DirMergeItem* pCurrentItemForOperation = (m_mergeItemList.empty() || m_currentItemForOperation==m_mergeItemList.end() ) ? 0 @@ -2012,7 +2012,7 @@ bool DirectoryMergeWindow::executeMergeOperation( MergeFileInfos& mfi, bool& bSi { bool bCreateBackups = m_pOptions->m_bDmCreateBakFiles; // First decide destname - QString destName; + TQString destName; switch( mfi.m_eMergeOperation ) { case eNoOperation: break; @@ -2057,9 +2057,9 @@ bool DirectoryMergeWindow::executeMergeOperation( MergeFileInfos& mfi, bool& bSi destName, bSingleFileMerge ); break; case eMergeABCToDest:bSuccess = mergeFLD( - mfi.m_bExistsInA ? fullNameA(mfi) : QString(""), - mfi.m_bExistsInB ? fullNameB(mfi) : QString(""), - mfi.m_bExistsInC ? fullNameC(mfi) : QString(""), + mfi.m_bExistsInA ? fullNameA(mfi) : TQString(""), + mfi.m_bExistsInB ? fullNameB(mfi) : TQString(""), + mfi.m_bExistsInC ? fullNameC(mfi) : TQString(""), destName, bSingleFileMerge ); break; default: @@ -2073,7 +2073,7 @@ bool DirectoryMergeWindow::executeMergeOperation( MergeFileInfos& mfi, bool& bSi // Check if the merge can start, and prepare the m_mergeItemList which then contains all // items that must be merged. -void DirectoryMergeWindow::prepareMergeStart( QListViewItem* pBegin, QListViewItem* pEnd, bool bVerbose ) +void DirectoryMergeWindow::prepareMergeStart( TQListViewItem* pBegin, TQListViewItem* pEnd, bool bVerbose ) { if ( bVerbose ) { @@ -2097,7 +2097,7 @@ void DirectoryMergeWindow::prepareMergeStart( QListViewItem* pBegin, QListViewIt if (pBegin == 0) return; - for( QListViewItem* p = pBegin; p!= pEnd; p = treeIterator( p ) ) + for( TQListViewItem* p = pBegin; p!= pEnd; p = treeIterator( p ) ) { DirMergeItem* pDMI = static_cast<DirMergeItem*>(p); @@ -2137,8 +2137,8 @@ void DirectoryMergeWindow::slotRunOperationForCurrentItem() bool bVerbose = false; if ( m_mergeItemList.empty() ) { - QListViewItem* pBegin = currentItem(); - QListViewItem* pEnd = treeIterator(pBegin,false,false); // find next visible sibling (no children) + TQListViewItem* pBegin = currentItem(); + TQListViewItem* pEnd = treeIterator(pBegin,false,false); // find next visible sibling (no tqchildren) prepareMergeStart( pBegin, pEnd, bVerbose ); mergeContinue(true, bVerbose); @@ -2154,7 +2154,7 @@ void DirectoryMergeWindow::slotRunOperationForAllItems() bool bVerbose = true; if ( m_mergeItemList.empty() ) { - QListViewItem* pBegin = firstChild(); + TQListViewItem* pBegin = firstChild(); prepareMergeStart( pBegin, 0, bVerbose ); mergeContinue(true, bVerbose); @@ -2184,9 +2184,9 @@ void DirectoryMergeWindow::mergeCurrentFile() m_currentItemForOperation=m_mergeItemList.begin(); bool bDummy=false; mergeFLD( - mfi.m_bExistsInA ? mfi.m_fileInfoA.absFilePath() : QString(""), - mfi.m_bExistsInB ? mfi.m_fileInfoB.absFilePath() : QString(""), - mfi.m_bExistsInC ? mfi.m_fileInfoC.absFilePath() : QString(""), + mfi.m_bExistsInA ? mfi.m_fileInfoA.absFilePath() : TQString(""), + mfi.m_bExistsInB ? mfi.m_fileInfoB.absFilePath() : TQString(""), + mfi.m_bExistsInC ? mfi.m_fileInfoC.absFilePath() : TQString(""), fullNameDest(mfi), bDummy ); @@ -2280,17 +2280,17 @@ void DirectoryMergeWindow::mergeContinue(bool bStart, bool bVerbose) if ( ! bContinueWithCurrentItem ) { // Depth first - QListViewItem* pPrevItem = pCurrentItemForOperation; + TQListViewItem* pPrevItem = pCurrentItemForOperation; ++m_currentItemForOperation; pCurrentItemForOperation = m_currentItemForOperation==m_mergeItemList.end() ? 0 : *m_currentItemForOperation; - if ( (pCurrentItemForOperation==0 || pCurrentItemForOperation->parent()!=pPrevItem->parent()) && pPrevItem->parent()!=0 ) + if ( (pCurrentItemForOperation==0 || pCurrentItemForOperation->tqparent()!=pPrevItem->tqparent()) && pPrevItem->tqparent()!=0 ) { - // Check if the parent may be set to "Done" - QListViewItem* pParent = pPrevItem->parent(); + // Check if the tqparent may be set to "Done" + TQListViewItem* pParent = pPrevItem->tqparent(); bool bDone = true; while ( bDone && pParent!=0 ) { - for( QListViewItem* p = pParent->firstChild(); p!=0; p=p->nextSibling() ) + for( TQListViewItem* p = pParent->firstChild(); p!=0; p=p->nextSibling() ) { DirMergeItem* pDMI = static_cast<DirMergeItem*>(p); if ( !bSim && ! pDMI->m_pMFI->m_bOperationComplete || bSim && pDMI->m_pMFI->m_bSimOpComplete ) @@ -2309,7 +2309,7 @@ void DirectoryMergeWindow::mergeContinue(bool bStart, bool bVerbose) static_cast<DirMergeItem*>(pParent)->m_pMFI->m_bOperationComplete = bDone; } } - pParent = pParent->parent(); + pParent = pParent->tqparent(); } } } @@ -2328,7 +2328,7 @@ void DirectoryMergeWindow::mergeContinue(bool bStart, bool bVerbose) if ( m_bSimulatedMergeStarted ) { m_bSimulatedMergeStarted = false; - for( QListViewItem* p=firstChild(); p!=0; p=treeIterator(p) ) + for( TQListViewItem* p=firstChild(); p!=0; p=treeIterator(p) ) { static_cast<DirMergeItem*>(p)->m_pMFI->m_bSimOpComplete = false; } @@ -2394,13 +2394,13 @@ void DirectoryMergeWindow::allowResizeEvents(bool bAllowResizeEvents ) m_bAllowResizeEvents = bAllowResizeEvents; } -void DirectoryMergeWindow::resizeEvent( QResizeEvent* e ) +void DirectoryMergeWindow::resizeEvent( TQResizeEvent* e ) { if (m_bAllowResizeEvents) - QListView::resizeEvent(e); + TQListView::resizeEvent(e); } -bool DirectoryMergeWindow::deleteFLD( const QString& name, bool bCreateBackup ) +bool DirectoryMergeWindow::deleteFLD( const TQString& name, bool bCreateBackup ) { FileAccess fi(name, true); if ( !fi.exists() ) @@ -2411,16 +2411,16 @@ bool DirectoryMergeWindow::deleteFLD( const QString& name, bool bCreateBackup ) bool bSuccess = renameFLD( name, name+".orig" ); if (!bSuccess) { - m_pStatusInfo->addText( i18n("Error: While deleting %1: Creating backup failed.").arg(name) ); + m_pStatusInfo->addText( i18n("Error: While deleting %1: Creating backup failed.").tqarg(name) ); return false; } } else { if ( fi.isDir() && !fi.isSymLink() ) - m_pStatusInfo->addText(i18n("delete directory recursively( %1 )").arg(name)); + m_pStatusInfo->addText(i18n("delete directory recursively( %1 )").tqarg(name)); else - m_pStatusInfo->addText(i18n("delete( %1 )").arg(name)); + m_pStatusInfo->addText(i18n("delete( %1 )").tqarg(name)); if ( m_bSimulatedMergeStarted ) { @@ -2454,7 +2454,7 @@ bool DirectoryMergeWindow::deleteFLD( const QString& name, bool bCreateBackup ) bSuccess = FileAccess::removeDir( name ); if ( !bSuccess ) { - m_pStatusInfo->addText( i18n("Error: rmdir( %1 ) operation failed.").arg(name)); + m_pStatusInfo->addText( i18n("Error: rmdir( %1 ) operation failed.").tqarg(name)); return false; } } @@ -2472,7 +2472,7 @@ bool DirectoryMergeWindow::deleteFLD( const QString& name, bool bCreateBackup ) return true; } -bool DirectoryMergeWindow::mergeFLD( const QString& nameA,const QString& nameB,const QString& nameC,const QString& nameDest, bool& bSingleFileMerge ) +bool DirectoryMergeWindow::mergeFLD( const TQString& nameA,const TQString& nameB,const TQString& nameC,const TQString& nameDest, bool& bSingleFileMerge ) { FileAccess fi(nameA); if (fi.isDir()) @@ -2481,16 +2481,16 @@ bool DirectoryMergeWindow::mergeFLD( const QString& nameA,const QString& nameB,c } // Make sure that the dir exists, into which we will save the file later. - int pos=nameDest.findRev('/'); + int pos=nameDest.tqfindRev('/'); if ( pos>0 ) { - QString parentName = nameDest.left(pos); - bool bSuccess = makeDir(parentName, true /*quiet*/); + TQString tqparentName = nameDest.left(pos); + bool bSuccess = makeDir(tqparentName, true /*quiet*/); if (!bSuccess) return false; } - m_pStatusInfo->addText(i18n("manual merge( %1, %2, %3 -> %4)").arg(nameA).arg(nameB).arg(nameC).arg(nameDest)); + m_pStatusInfo->addText(i18n("manual merge( %1, %2, %3 -> %4)").tqarg(nameA).tqarg(nameB).tqarg(nameC).tqarg(nameDest)); if ( m_bSimulatedMergeStarted ) { m_pStatusInfo->addText(i18n(" Note: After a manual merge the user should continue by pressing F7.") ); @@ -2506,7 +2506,7 @@ bool DirectoryMergeWindow::mergeFLD( const QString& nameA,const QString& nameB,c return false; } -bool DirectoryMergeWindow::copyFLD( const QString& srcName, const QString& destName ) +bool DirectoryMergeWindow::copyFLD( const TQString& srcName, const TQString& destName ) { if ( srcName == destName ) return true; @@ -2517,7 +2517,7 @@ bool DirectoryMergeWindow::copyFLD( const QString& srcName, const QString& destN if ( !bSuccess ) { m_pStatusInfo->addText(i18n("Error: copy( %1 -> %2 ) failed." - "Deleting existing destination failed.").arg(srcName).arg(destName)); + "Deleting existing destination failed.").tqarg(srcName).tqarg(destName)); return false; } } @@ -2526,7 +2526,7 @@ bool DirectoryMergeWindow::copyFLD( const QString& srcName, const QString& destN if ( fi.isSymLink() && (fi.isDir() && !m_bFollowDirLinks || !fi.isDir() && !m_bFollowFileLinks) ) { - m_pStatusInfo->addText(i18n("copyLink( %1 -> %2 )").arg(srcName).arg(destName)); + m_pStatusInfo->addText(i18n("copyLink( %1 -> %2 )").tqarg(srcName).tqarg(destName)); #ifdef _WIN32 // What are links? #else @@ -2540,7 +2540,7 @@ bool DirectoryMergeWindow::copyFLD( const QString& srcName, const QString& destN m_pStatusInfo->addText(i18n("Error: copyLink failed: Remote links are not yet supported.")); return false; } - QString linkTarget = fi.readLink(); + TQString linkTarget = fi.readLink(); bool bSuccess = FileAccess::symLink( linkTarget, destName ); if (!bSuccess) m_pStatusInfo->addText(i18n("Error: copyLink failed.")); @@ -2554,16 +2554,16 @@ bool DirectoryMergeWindow::copyFLD( const QString& srcName, const QString& destN return bSuccess; } - int pos=destName.findRev('/'); + int pos=destName.tqfindRev('/'); if ( pos>0 ) { - QString parentName = destName.left(pos); - bool bSuccess = makeDir(parentName, true /*quiet*/); + TQString tqparentName = destName.left(pos); + bool bSuccess = makeDir(tqparentName, true /*quiet*/); if (!bSuccess) return false; } - m_pStatusInfo->addText(i18n("copy( %1 -> %2 )").arg(srcName).arg(destName)); + m_pStatusInfo->addText(i18n("copy( %1 -> %2 )").tqarg(srcName).tqarg(destName)); if ( m_bSimulatedMergeStarted ) { @@ -2579,7 +2579,7 @@ bool DirectoryMergeWindow::copyFLD( const QString& srcName, const QString& destN // Rename is not an operation that can be selected by the user. // It will only be used to create backups. // Hence it will delete an existing destination without making a backup (of the old backup.) -bool DirectoryMergeWindow::renameFLD( const QString& srcName, const QString& destName ) +bool DirectoryMergeWindow::renameFLD( const TQString& srcName, const TQString& destName ) { if ( srcName == destName ) return true; @@ -2590,12 +2590,12 @@ bool DirectoryMergeWindow::renameFLD( const QString& srcName, const QString& des if (!bSuccess) { m_pStatusInfo->addText( i18n("Error during rename( %1 -> %2 ): " - "Cannot delete existing destination." ).arg(srcName).arg(destName)); + "Cannot delete existing destination." ).tqarg(srcName).tqarg(destName)); return false; } } - m_pStatusInfo->addText(i18n("rename( %1 -> %2 )").arg(srcName).arg(destName)); + m_pStatusInfo->addText(i18n("rename( %1 -> %2 )").tqarg(srcName).tqarg(destName)); if ( m_bSimulatedMergeStarted ) { return true; @@ -2611,7 +2611,7 @@ bool DirectoryMergeWindow::renameFLD( const QString& srcName, const QString& des return true; } -bool DirectoryMergeWindow::makeDir( const QString& name, bool bQuiet ) +bool DirectoryMergeWindow::makeDir( const TQString& name, bool bQuiet ) { FileAccess fi(name, true); if( fi.exists() && fi.isDir() ) @@ -2623,22 +2623,22 @@ bool DirectoryMergeWindow::makeDir( const QString& name, bool bQuiet ) if (!bSuccess) { m_pStatusInfo->addText( i18n("Error during makeDir of %1. " - "Cannot delete existing file." ).arg(name)); + "Cannot delete existing file." ).tqarg(name)); return false; } } - int pos=name.findRev('/'); + int pos=name.tqfindRev('/'); if ( pos>0 ) { - QString parentName = name.left(pos); - bool bSuccess = makeDir(parentName,true); + TQString tqparentName = name.left(pos); + bool bSuccess = makeDir(tqparentName,true); if (!bSuccess) return false; } if ( ! bQuiet ) - m_pStatusInfo->addText(i18n("makeDir( %1 )").arg(name)); + m_pStatusInfo->addText(i18n("makeDir( %1 )").tqarg(name)); if ( m_bSimulatedMergeStarted ) { @@ -2655,26 +2655,26 @@ bool DirectoryMergeWindow::makeDir( const QString& name, bool bQuiet ) } -DirectoryMergeInfo::DirectoryMergeInfo( QWidget* pParent ) -: QFrame(pParent) +DirectoryMergeInfo::DirectoryMergeInfo( TQWidget* pParent ) +: TQFrame(pParent) { - QVBoxLayout *topLayout = new QVBoxLayout( this ); + TQVBoxLayout *topLayout = new TQVBoxLayout( this ); - QGridLayout *grid = new QGridLayout( topLayout ); + TQGridLayout *grid = new TQGridLayout( topLayout ); grid->setColStretch(1,10); int line=0; - m_pA = new QLabel("A",this); grid->addWidget( m_pA,line, 0 ); - m_pInfoA = new QLabel(this); grid->addWidget( m_pInfoA,line,1 ); ++line; - m_pB = new QLabel("B",this); grid->addWidget( m_pB,line, 0 ); - m_pInfoB = new QLabel(this); grid->addWidget( m_pInfoB,line,1 ); ++line; - m_pC = new QLabel("C",this); grid->addWidget( m_pC,line, 0 ); - m_pInfoC = new QLabel(this); grid->addWidget( m_pInfoC,line,1 ); ++line; - m_pDest = new QLabel(i18n("Dest"),this); grid->addWidget( m_pDest,line, 0 ); - m_pInfoDest = new QLabel(this); grid->addWidget( m_pInfoDest,line,1 ); ++line; + m_pA = new TQLabel("A",this); grid->addWidget( m_pA,line, 0 ); + m_pInfoA = new TQLabel(this); grid->addWidget( m_pInfoA,line,1 ); ++line; + m_pB = new TQLabel("B",this); grid->addWidget( m_pB,line, 0 ); + m_pInfoB = new TQLabel(this); grid->addWidget( m_pInfoB,line,1 ); ++line; + m_pC = new TQLabel("C",this); grid->addWidget( m_pC,line, 0 ); + m_pInfoC = new TQLabel(this); grid->addWidget( m_pInfoC,line,1 ); ++line; + m_pDest = new TQLabel(i18n("Dest"),this); grid->addWidget( m_pDest,line, 0 ); + m_pInfoDest = new TQLabel(this); grid->addWidget( m_pInfoDest,line,1 ); ++line; - m_pInfoList = new QListView(this); topLayout->addWidget( m_pInfoList ); + m_pInfoList = new TQListView(this); topLayout->addWidget( m_pInfoList ); m_pInfoList->addColumn(i18n("Dir")); m_pInfoList->addColumn(i18n("Type")); m_pInfoList->addColumn(i18n("Size")); @@ -2686,15 +2686,15 @@ DirectoryMergeInfo::DirectoryMergeInfo( QWidget* pParent ) m_pInfoList->installEventFilter(this); } -bool DirectoryMergeInfo::eventFilter(QObject*o, QEvent* e) +bool DirectoryMergeInfo::eventFilter(TQObject*o, TQEvent* e) { - if ( e->type()==QEvent::FocusIn && o==m_pInfoList ) + if ( e->type()==TQEvent::FocusIn && TQT_BASE_OBJECT(o)==TQT_BASE_OBJECT(m_pInfoList) ) emit gotFocus(); return false; } -static void addListViewItem( QListView* pListView, const QString& dir, - const QString& basePath, FileAccess& fi ) +static void addListViewItem( TQListView* pListView, const TQString& dir, + const TQString& basePath, FileAccess& fi ) { if ( basePath.isEmpty() ) { @@ -2704,30 +2704,26 @@ static void addListViewItem( QListView* pListView, const QString& dir, { if ( fi.exists() ) { -#if QT_VERSION==230 - QString dateString = fi.lastModified().toString(); -#else - QString dateString = fi.lastModified().toString("yyyy-MM-dd hh:mm:ss"); -#endif + TQString dateString = fi.lastModified().toString("yyyy-MM-dd hh:mm:ss"); - new QListViewItem( + new TQListViewItem( pListView, dir, - QString( fi.isDir() ? i18n("Dir") : i18n("File") ) + (fi.isSymLink() ? "-Link" : ""), - QString::number(fi.size()), - QString(fi.isReadable() ? "r" : " ") + (fi.isWritable()?"w" : " ") + TQString( fi.isDir() ? i18n("Dir") : i18n("File") ) + (fi.isSymLink() ? "-Link" : ""), + TQString::number(fi.size()), + TQString(fi.isReadable() ? "r" : " ") + (fi.isWritable()?"w" : " ") #ifdef _WIN32 /*Future: Use GetFileAttributes()*/, #else + (fi.isExecutable()?"x" : " "), #endif dateString, - QString(fi.isSymLink() ? (" -> " + fi.readLink()) : QString("")) + TQString(fi.isSymLink() ? (" -> " + fi.readLink()) : TQString("")) ); } else { - new QListViewItem( + new TQListViewItem( pListView, dir, i18n("not available"), @@ -2753,7 +2749,7 @@ void DirectoryMergeInfo::setInfo( m_pA->setText( i18n("A (Dest): ") ); bHideDest=true; } else - m_pA->setText( !dirC.isValid() ? QString("A: ") : i18n("A (Base): ")); + m_pA->setText( !dirC.isValid() ? TQString("A: ") : i18n("A (Base): ")); m_pInfoA->setText( dirA.prettyAbsPath() ); @@ -2792,7 +2788,7 @@ void DirectoryMergeInfo::setInfo( } } -QTextStream& operator<<( QTextStream& ts, MergeFileInfos& mfi ) +TQTextStream& operator<<( TQTextStream& ts, MergeFileInfos& mfi ) { ts << "{\n"; ValueMap vm; @@ -2824,7 +2820,7 @@ QTextStream& operator<<( QTextStream& ts, MergeFileInfos& mfi ) //FileAccess m_fileInfoB; //FileAccess m_fileInfoC; - //TotalDiffStatus m_totalDiffStatus; + //TotalDifftqStatus m_totalDifftqStatus; vm.save(ts); @@ -2837,20 +2833,20 @@ void DirectoryMergeWindow::slotSaveMergeState() { //slotStatusMsg(i18n("Saving Directory Merge State ...")); - //QString s = KFileDialog::getSaveURL( QDir::currentDirPath(), 0, this, i18n("Save As...") ).url(); - QString s = KFileDialog::getSaveFileName( QDir::currentDirPath(), 0, this, i18n("Save Directory Merge State As...") ); + //TQString s = KFileDialog::getSaveURL( TQDir::currentDirPath(), 0, this, i18n("Save As...") ).url(); + TQString s = KFileDialog::getSaveFileName( TQDir::currentDirPath(), 0, this, i18n("Save Directory Merge State As...") ); if(!s.isEmpty()) { m_dirMergeStateFilename = s; - QFile file(m_dirMergeStateFilename); + TQFile file(m_dirMergeStateFilename); bool bSuccess = file.open( IO_WriteOnly ); if ( bSuccess ) { - QTextStream ts( &file ); + TQTextStream ts( &file ); - QListViewItemIterator it( this ); + TQListViewItemIterator it( this ); while ( it.current() ) { DirMergeItem* item = static_cast<DirMergeItem*>(it.current()); MergeFileInfos* pMFI = item->m_pMFI; @@ -2880,7 +2876,7 @@ void DirectoryMergeWindow::updateFileVisibilities() m_pSelection2Item = 0; m_pSelection3Item = 0; - QListViewItem* p = firstChild(); + TQListViewItem* p = firstChild(); while(p) { DirMergeItem* pDMI = static_cast<DirMergeItem*>(p); @@ -2895,7 +2891,7 @@ void DirectoryMergeWindow::updateFileVisibilities() || ( bShowOnlyInB && !pMFI->m_bExistsInA && pMFI->m_bExistsInB && !pMFI->m_bExistsInC ) || ( bShowOnlyInC && !pMFI->m_bExistsInA && !pMFI->m_bExistsInB && pMFI->m_bExistsInC ); - QString fileName = pMFI->m_subPath.section( '/', -1 ); + TQString fileName = pMFI->m_subPath.section( '/', -1 ); bVisible = bVisible && ( bDir && ! wildcardMultiMatch( m_pOptions->m_DmDirAntiPattern, fileName, m_bCaseSensitive ) || wildcardMultiMatch( m_pOptions->m_DmFilePattern, fileName, m_bCaseSensitive ) @@ -2916,7 +2912,7 @@ void DirectoryMergeWindow::slotShowFilesOnlyInC() { updateFileVisibilities(); void DirectoryMergeWindow::slotSynchronizeDirectories() { } void DirectoryMergeWindow::slotChooseNewerFiles() { } -void DirectoryMergeWindow::initDirectoryMergeActions( QObject* pKDiff3App, KActionCollection* ac ) +void DirectoryMergeWindow::initDirectoryMergeActions( TQObject* pKDiff3App, KActionCollection* ac ) { #include "xpm/startmerge.xpm" #include "xpm/showequalfiles.xpm" @@ -2925,51 +2921,51 @@ void DirectoryMergeWindow::initDirectoryMergeActions( QObject* pKDiff3App, KActi #include "xpm/showfilesonlyinc.xpm" DirectoryMergeWindow* p = this; - m_pDirStartOperation = new KAction(i18n("Start/Continue Directory Merge"), Qt::Key_F7, p, SLOT(slotRunOperationForAllItems()), ac, "dir_start_operation"); - m_pDirRunOperationForCurrentItem = new KAction(i18n("Run Operation for Current Item"), Qt::Key_F6, p, SLOT(slotRunOperationForCurrentItem()), ac, "dir_run_operation_for_current_item"); - m_pDirCompareCurrent = new KAction(i18n("Compare Selected File"), 0, p, SLOT(compareCurrentFile()), ac, "dir_compare_current"); - m_pDirMergeCurrent = new KAction(i18n("Merge Current File"), QIconSet(QPixmap(startmerge)), 0, pKDiff3App, SLOT(slotMergeCurrentFile()), ac, "merge_current"); - m_pDirFoldAll = new KAction(i18n("Fold All Subdirs"), 0, p, SLOT(slotFoldAllSubdirs()), ac, "dir_fold_all"); - m_pDirUnfoldAll = new KAction(i18n("Unfold All Subdirs"), 0, p, SLOT(slotUnfoldAllSubdirs()), ac, "dir_unfold_all"); - m_pDirRescan = new KAction(i18n("Rescan"), Qt::SHIFT+Qt::Key_F5, p, SLOT(reload()), ac, "dir_rescan"); - m_pDirSaveMergeState = 0; //new KAction(i18n("Save Directory Merge State ..."), 0, p, SLOT(slotSaveMergeState()), ac, "dir_save_merge_state"); - m_pDirLoadMergeState = 0; //new KAction(i18n("Load Directory Merge State ..."), 0, p, SLOT(slotLoadMergeState()), ac, "dir_load_merge_state"); - m_pDirChooseAEverywhere = new KAction(i18n("Choose A for All Items"), 0, p, SLOT(slotChooseAEverywhere()), ac, "dir_choose_a_everywhere"); - m_pDirChooseBEverywhere = new KAction(i18n("Choose B for All Items"), 0, p, SLOT(slotChooseBEverywhere()), ac, "dir_choose_b_everywhere"); - m_pDirChooseCEverywhere = new KAction(i18n("Choose C for All Items"), 0, p, SLOT(slotChooseCEverywhere()), ac, "dir_choose_c_everywhere"); - m_pDirAutoChoiceEverywhere = new KAction(i18n("Auto-Choose Operation for All Items"), 0, p, SLOT(slotAutoChooseEverywhere()), ac, "dir_autochoose_everywhere"); - m_pDirDoNothingEverywhere = new KAction(i18n("No Operation for All Items"), 0, p, SLOT(slotNoOpEverywhere()), ac, "dir_nothing_everywhere"); - -// m_pDirSynchronizeDirectories = new KToggleAction(i18n("Synchronize Directories"), 0, this, SLOT(slotSynchronizeDirectories()), ac, "dir_synchronize_directories"); -// m_pDirChooseNewerFiles = new KToggleAction(i18n("Copy Newer Files Instead of Merging"), 0, this, SLOT(slotChooseNewerFiles()), ac, "dir_choose_newer_files"); - - m_pDirShowIdenticalFiles = new KToggleAction(i18n("Show Identical Files"), QIconSet(QPixmap(showequalfiles)), 0, this, SLOT(slotShowIdenticalFiles()), ac, "dir_show_identical_files"); - m_pDirShowDifferentFiles = new KToggleAction(i18n("Show Different Files"), 0, this, SLOT(slotShowDifferentFiles()), ac, "dir_show_different_files"); - m_pDirShowFilesOnlyInA = new KToggleAction(i18n("Show Files only in A"), QIconSet(QPixmap(showfilesonlyina)), 0, this, SLOT(slotShowFilesOnlyInA()), ac, "dir_show_files_only_in_a"); - m_pDirShowFilesOnlyInB = new KToggleAction(i18n("Show Files only in B"), QIconSet(QPixmap(showfilesonlyinb)), 0, this, SLOT(slotShowFilesOnlyInB()), ac, "dir_show_files_only_in_b"); - m_pDirShowFilesOnlyInC = new KToggleAction(i18n("Show Files only in C"), QIconSet(QPixmap(showfilesonlyinc)), 0, this, SLOT(slotShowFilesOnlyInC()), ac, "dir_show_files_only_in_c"); + m_pDirStartOperation = new KAction(i18n("Start/Continue Directory Merge"), TQt::Key_F7, TQT_TQOBJECT(p), TQT_SLOT(slotRunOperationForAllItems()), ac, "dir_start_operation"); + m_pDirRunOperationForCurrentItem = new KAction(i18n("Run Operation for Current Item"), TQt::Key_F6, TQT_TQOBJECT(p), TQT_SLOT(slotRunOperationForCurrentItem()), ac, "dir_run_operation_for_current_item"); + m_pDirCompareCurrent = new KAction(i18n("Compare Selected File"), 0, TQT_TQOBJECT(p), TQT_SLOT(compareCurrentFile()), ac, "dir_compare_current"); + m_pDirMergeCurrent = new KAction(i18n("Merge Current File"), TQIconSet(TQPixmap(startmerge)), 0, TQT_TQOBJECT(pKDiff3App), TQT_SLOT(slotMergeCurrentFile()), ac, "merge_current"); + m_pDirFoldAll = new KAction(i18n("Fold All Subdirs"), 0, TQT_TQOBJECT(p), TQT_SLOT(slotFoldAllSubdirs()), ac, "dir_fold_all"); + m_pDirUnfoldAll = new KAction(i18n("Unfold All Subdirs"), 0, TQT_TQOBJECT(p), TQT_SLOT(slotUnfoldAllSubdirs()), ac, "dir_unfold_all"); + m_pDirRescan = new KAction(i18n("Rescan"), TQt::SHIFT+TQt::Key_F5, TQT_TQOBJECT(p), TQT_SLOT(reload()), ac, "dir_rescan"); + m_pDirSaveMergeState = 0; //new KAction(i18n("Save Directory Merge State ..."), 0, TQT_TQOBJECT(p), TQT_SLOT(slotSaveMergeState()), ac, "dir_save_merge_state"); + m_pDirLoadMergeState = 0; //new KAction(i18n("Load Directory Merge State ..."), 0, TQT_TQOBJECT(p), TQT_SLOT(slotLoadMergeState()), ac, "dir_load_merge_state"); + m_pDirChooseAEverywhere = new KAction(i18n("Choose A for All Items"), 0, TQT_TQOBJECT(p), TQT_SLOT(slotChooseAEverywhere()), ac, "dir_choose_a_everywhere"); + m_pDirChooseBEverywhere = new KAction(i18n("Choose B for All Items"), 0, TQT_TQOBJECT(p), TQT_SLOT(slotChooseBEverywhere()), ac, "dir_choose_b_everywhere"); + m_pDirChooseCEverywhere = new KAction(i18n("Choose C for All Items"), 0, TQT_TQOBJECT(p), TQT_SLOT(slotChooseCEverywhere()), ac, "dir_choose_c_everywhere"); + m_pDirAutoChoiceEverywhere = new KAction(i18n("Auto-Choose Operation for All Items"), 0, TQT_TQOBJECT(p), TQT_SLOT(slotAutoChooseEverywhere()), ac, "dir_autochoose_everywhere"); + m_pDirDoNothingEverywhere = new KAction(i18n("No Operation for All Items"), 0, TQT_TQOBJECT(p), TQT_SLOT(slotNoOpEverywhere()), ac, "dir_nothing_everywhere"); + +// m_pDirSynchronizeDirectories = new KToggleAction(i18n("Synchronize Directories"), 0, TQT_TQOBJECT(this), TQT_SLOT(slotSynchronizeDirectories()), ac, "dir_synchronize_directories"); +// m_pDirChooseNewerFiles = new KToggleAction(i18n("Copy Newer Files Instead of Merging"), 0, TQT_TQOBJECT(this), TQT_SLOT(slotChooseNewerFiles()), ac, "dir_choose_newer_files"); + + m_pDirShowIdenticalFiles = new KToggleAction(i18n("Show Identical Files"), TQIconSet(TQPixmap(showequalfiles)), 0, TQT_TQOBJECT(this), TQT_SLOT(slotShowIdenticalFiles()), ac, "dir_show_identical_files"); + m_pDirShowDifferentFiles = new KToggleAction(i18n("Show Different Files"), 0, TQT_TQOBJECT(this), TQT_SLOT(slotShowDifferentFiles()), ac, "dir_show_different_files"); + m_pDirShowFilesOnlyInA = new KToggleAction(i18n("Show Files only in A"), TQIconSet(TQPixmap(showfilesonlyina)), 0, TQT_TQOBJECT(this), TQT_SLOT(slotShowFilesOnlyInA()), ac, "dir_show_files_only_in_a"); + m_pDirShowFilesOnlyInB = new KToggleAction(i18n("Show Files only in B"), TQIconSet(TQPixmap(showfilesonlyinb)), 0, TQT_TQOBJECT(this), TQT_SLOT(slotShowFilesOnlyInB()), ac, "dir_show_files_only_in_b"); + m_pDirShowFilesOnlyInC = new KToggleAction(i18n("Show Files only in C"), TQIconSet(TQPixmap(showfilesonlyinc)), 0, TQT_TQOBJECT(this), TQT_SLOT(slotShowFilesOnlyInC()), ac, "dir_show_files_only_in_c"); m_pDirShowIdenticalFiles->setChecked( m_pOptions->m_bDmShowIdenticalFiles ); - m_pDirCompareExplicit = new KAction(i18n("Compare Explicitly Selected Files"), 0, p, SLOT(slotCompareExplicitlySelectedFiles()), ac, "dir_compare_explicitly_selected_files"); - m_pDirMergeExplicit = new KAction(i18n("Merge Explicitly Selected Files"), 0, p, SLOT(slotMergeExplicitlySelectedFiles()), ac, "dir_merge_explicitly_selected_files"); - - m_pDirCurrentDoNothing = new KAction(i18n("Do Nothing"), 0, p, SLOT(slotCurrentDoNothing()), ac, "dir_current_do_nothing"); - m_pDirCurrentChooseA = new KAction(i18n("A"), 0, p, SLOT(slotCurrentChooseA()), ac, "dir_current_choose_a"); - m_pDirCurrentChooseB = new KAction(i18n("B"), 0, p, SLOT(slotCurrentChooseB()), ac, "dir_current_choose_b"); - m_pDirCurrentChooseC = new KAction(i18n("C"), 0, p, SLOT(slotCurrentChooseC()), ac, "dir_current_choose_c"); - m_pDirCurrentMerge = new KAction(i18n("Merge"), 0, p, SLOT(slotCurrentMerge()), ac, "dir_current_merge"); - m_pDirCurrentDelete = new KAction(i18n("Delete (if exists)"), 0, p, SLOT(slotCurrentDelete()), ac, "dir_current_delete"); - - m_pDirCurrentSyncDoNothing = new KAction(i18n("Do Nothing"), 0, p, SLOT(slotCurrentDoNothing()), ac, "dir_current_sync_do_nothing"); - m_pDirCurrentSyncCopyAToB = new KAction(i18n("Copy A to B"), 0, p, SLOT(slotCurrentCopyAToB()), ac, "dir_current_sync_copy_a_to_b" ); - m_pDirCurrentSyncCopyBToA = new KAction(i18n("Copy B to A"), 0, p, SLOT(slotCurrentCopyBToA()), ac, "dir_current_sync_copy_b_to_a" ); - m_pDirCurrentSyncDeleteA = new KAction(i18n("Delete A"), 0, p, SLOT(slotCurrentDeleteA()), ac,"dir_current_sync_delete_a"); - m_pDirCurrentSyncDeleteB = new KAction(i18n("Delete B"), 0, p, SLOT(slotCurrentDeleteB()), ac,"dir_current_sync_delete_b"); - m_pDirCurrentSyncDeleteAAndB = new KAction(i18n("Delete A && B"), 0, p, SLOT(slotCurrentDeleteAAndB()), ac,"dir_current_sync_delete_a_and_b"); - m_pDirCurrentSyncMergeToA = new KAction(i18n("Merge to A"), 0, p, SLOT(slotCurrentMergeToA()), ac,"dir_current_sync_merge_to_a"); - m_pDirCurrentSyncMergeToB = new KAction(i18n("Merge to B"), 0, p, SLOT(slotCurrentMergeToB()), ac,"dir_current_sync_merge_to_b"); - m_pDirCurrentSyncMergeToAAndB = new KAction(i18n("Merge to A && B"), 0, p, SLOT(slotCurrentMergeToAAndB()), ac,"dir_current_sync_merge_to_a_and_b"); + m_pDirCompareExplicit = new KAction(i18n("Compare Explicitly Selected Files"), 0, TQT_TQOBJECT(p), TQT_SLOT(slotCompareExplicitlySelectedFiles()), ac, "dir_compare_explicitly_selected_files"); + m_pDirMergeExplicit = new KAction(i18n("Merge Explicitly Selected Files"), 0, TQT_TQOBJECT(p), TQT_SLOT(slotMergeExplicitlySelectedFiles()), ac, "dir_merge_explicitly_selected_files"); + + m_pDirCurrentDoNothing = new KAction(i18n("Do Nothing"), 0, TQT_TQOBJECT(p), TQT_SLOT(slotCurrentDoNothing()), ac, "dir_current_do_nothing"); + m_pDirCurrentChooseA = new KAction(i18n("A"), 0, TQT_TQOBJECT(p), TQT_SLOT(slotCurrentChooseA()), ac, "dir_current_choose_a"); + m_pDirCurrentChooseB = new KAction(i18n("B"), 0, TQT_TQOBJECT(p), TQT_SLOT(slotCurrentChooseB()), ac, "dir_current_choose_b"); + m_pDirCurrentChooseC = new KAction(i18n("C"), 0, TQT_TQOBJECT(p), TQT_SLOT(slotCurrentChooseC()), ac, "dir_current_choose_c"); + m_pDirCurrentMerge = new KAction(i18n("Merge"), 0, TQT_TQOBJECT(p), TQT_SLOT(slotCurrentMerge()), ac, "dir_current_merge"); + m_pDirCurrentDelete = new KAction(i18n("Delete (if exists)"), 0, TQT_TQOBJECT(p), TQT_SLOT(slotCurrentDelete()), ac, "dir_current_delete"); + + m_pDirCurrentSyncDoNothing = new KAction(i18n("Do Nothing"), 0, TQT_TQOBJECT(p), TQT_SLOT(slotCurrentDoNothing()), ac, "dir_current_sync_do_nothing"); + m_pDirCurrentSyncCopyAToB = new KAction(i18n("Copy A to B"), 0, TQT_TQOBJECT(p), TQT_SLOT(slotCurrentCopyAToB()), ac, "dir_current_sync_copy_a_to_b" ); + m_pDirCurrentSyncCopyBToA = new KAction(i18n("Copy B to A"), 0, TQT_TQOBJECT(p), TQT_SLOT(slotCurrentCopyBToA()), ac, "dir_current_sync_copy_b_to_a" ); + m_pDirCurrentSyncDeleteA = new KAction(i18n("Delete A"), 0, TQT_TQOBJECT(p), TQT_SLOT(slotCurrentDeleteA()), ac,"dir_current_sync_delete_a"); + m_pDirCurrentSyncDeleteB = new KAction(i18n("Delete B"), 0, TQT_TQOBJECT(p), TQT_SLOT(slotCurrentDeleteB()), ac,"dir_current_sync_delete_b"); + m_pDirCurrentSyncDeleteAAndB = new KAction(i18n("Delete A && B"), 0, TQT_TQOBJECT(p), TQT_SLOT(slotCurrentDeleteAAndB()), ac,"dir_current_sync_delete_a_and_b"); + m_pDirCurrentSyncMergeToA = new KAction(i18n("Merge to A"), 0, TQT_TQOBJECT(p), TQT_SLOT(slotCurrentMergeToA()), ac,"dir_current_sync_merge_to_a"); + m_pDirCurrentSyncMergeToB = new KAction(i18n("Merge to B"), 0, TQT_TQOBJECT(p), TQT_SLOT(slotCurrentMergeToB()), ac,"dir_current_sync_merge_to_b"); + m_pDirCurrentSyncMergeToAAndB = new KAction(i18n("Merge to A && B"), 0, TQT_TQOBJECT(p), TQT_SLOT(slotCurrentMergeToAAndB()), ac,"dir_current_sync_merge_to_a_and_b"); } @@ -2998,7 +2994,7 @@ void DirectoryMergeWindow::updateAvailabilities( bool bDirCompare, bool bDiffWin bool bThreeDirs = m_dirC.isValid(); - QListViewItem* lvi = currentItem(); + TQListViewItem* lvi = currentItem(); DirMergeItem* pDMI = lvi==0 ? 0 : static_cast<DirMergeItem*>(lvi); MergeFileInfos* pMFI = pDMI==0 ? 0 : pDMI->m_pMFI; diff --git a/src/directorymergewindow.h b/src/directorymergewindow.h index 77b09fd..25a66f7 100644 --- a/src/directorymergewindow.h +++ b/src/directorymergewindow.h @@ -18,26 +18,26 @@ #ifndef DIRECTORY_MERGE_WINDOW_H #define DIRECTORY_MERGE_WINDOW_H -#include <qfileinfo.h> -#include <qlistview.h> -#include <qtimer.h> -#include <qdir.h> +#include <tqfileinfo.h> +#include <tqlistview.h> +#include <tqtimer.h> +#include <tqdir.h> #include <list> #include <map> #include "common.h" #include "fileaccess.h" -#include "diff.h" //TotalDiffStatus +#include "diff.h" //TotalDifftqStatus class OptionDialog; class KIconLoader; class StatusInfo; class DirectoryMergeInfo; class OneDirectoryInfo; -class QLabel; +class TQLabel; class KAction; class KToggleAction; class KActionCollection; -class TotalDiffStatus; +class TotalDifftqStatus; enum e_MergeOperation { @@ -70,7 +70,7 @@ public: m_ageA = eNotThere; m_ageB=eNotThere; m_ageC=eNotThere; m_bConflictingAges=false; } bool operator>( const MergeFileInfos& ); - QString m_subPath; + TQString m_subPath; bool m_bExistsInA; bool m_bExistsInB; @@ -99,26 +99,27 @@ public: FileAccess m_fileInfoB; FileAccess m_fileInfoC; - TotalDiffStatus m_totalDiffStatus; + TotalDifftqStatus m_totalDifftqStatus; }; -class DirMergeItem : public QListViewItem +class DirMergeItem : public TQListViewItem { public: - DirMergeItem( QListView* pParent, const QString&, MergeFileInfos*); - DirMergeItem( DirMergeItem* pParent, const QString&, MergeFileInfos*); + DirMergeItem( TQListView* pParent, const TQString&, MergeFileInfos*); + DirMergeItem( DirMergeItem* pParent, const TQString&, MergeFileInfos*); ~DirMergeItem(); MergeFileInfos* m_pMFI; - virtual int compare(QListViewItem *i, int col, bool ascending) const; - virtual void paintCell(QPainter * p, const QColorGroup & cg, int column, int width, int align ); + virtual int compare(TQListViewItem *i, int col, bool ascending) const; + virtual void paintCell(TQPainter * p, const TQColorGroup & cg, int column, int width, int align ); void init(MergeFileInfos* pMFI); }; -class DirectoryMergeWindow : public QListView +class DirectoryMergeWindow : public TQListView { Q_OBJECT + TQ_OBJECT public: - DirectoryMergeWindow( QWidget* pParent, OptionDialog* pOptions, KIconLoader* pIconLoader ); + DirectoryMergeWindow( TQWidget* pParent, OptionDialog* pOptions, KIconLoader* pIconLoader ); ~DirectoryMergeWindow(); void setDirectoryMergeInfo(DirectoryMergeInfo* p){ m_pDirectoryMergeInfo=p; } bool init( @@ -135,19 +136,19 @@ public: int totalColumnWidth(); bool isSyncMode() { return m_bSyncMode; } bool isScanning() { return m_bScanning; } - void initDirectoryMergeActions( QObject* pKDiff3App, KActionCollection* ac ); + void initDirectoryMergeActions( TQObject* pKDiff3App, KActionCollection* ac ); void updateAvailabilities( bool bDirCompare, bool bDiffWindowVisible, KToggleAction* chooseA, KToggleAction* chooseB, KToggleAction* chooseC ); void updateFileVisibilities(); - virtual void keyPressEvent( QKeyEvent* e ); - virtual void focusInEvent( QFocusEvent* e ); - virtual void focusOutEvent( QFocusEvent* e ); + virtual void keyPressEvent( TQKeyEvent* e ); + virtual void focusInEvent( TQFocusEvent* e ); + virtual void focusOutEvent( TQFocusEvent* e ); - QString getDirNameA(){ return m_dirA.prettyAbsPath(); } - QString getDirNameB(){ return m_dirB.prettyAbsPath(); } - QString getDirNameC(){ return m_dirC.prettyAbsPath(); } - QString getDirNameDest(){ return m_dirDest.prettyAbsPath(); } + TQString getDirNameA(){ return m_dirA.prettyAbsPath(); } + TQString getDirNameB(){ return m_dirB.prettyAbsPath(); } + TQString getDirNameC(){ return m_dirC.prettyAbsPath(); } + TQString getDirNameDest(){ return m_dirDest.prettyAbsPath(); } public slots: void reload(); @@ -155,7 +156,7 @@ public slots: void compareCurrentFile(); void slotRunOperationForAllItems(); void slotRunOperationForCurrentItem(); - void mergeResultSaved(const QString& fileName); + void mergeResultSaved(const TQString& fileName); void slotChooseAEverywhere(); void slotChooseBEverywhere(); void slotChooseCEverywhere(); @@ -197,7 +198,7 @@ public slots: protected: void mergeContinue( bool bStart, bool bVerbose ); - void resizeEvent(QResizeEvent* e); + void resizeEvent(TQResizeEvent* e); bool m_bAllowResizeEvents; void prepareListView(ProgressProxy& pp); @@ -206,33 +207,33 @@ protected: friend class MergeFileInfos; bool canContinue(); - void prepareMergeStart( QListViewItem* pBegin, QListViewItem* pEnd, bool bVerbose ); + void prepareMergeStart( TQListViewItem* pBegin, TQListViewItem* pEnd, bool bVerbose ); bool executeMergeOperation( MergeFileInfos& mfi, bool& bSingleFileMerge ); - void scanDirectory( const QString& dirName, t_DirectoryList& dirList ); - void scanLocalDirectory( const QString& dirName, t_DirectoryList& dirList ); + void scanDirectory( const TQString& dirName, t_DirectoryList& dirList ); + void scanLocalDirectory( const TQString& dirName, t_DirectoryList& dirList ); void fastFileComparison( FileAccess& fi1, FileAccess& fi2, - bool& bEqual, bool& bError, QString& status ); + bool& bEqual, bool& bError, TQString& status ); void compareFilesAndCalcAges( MergeFileInfos& mfi ); - QString fullNameA( const MergeFileInfos& mfi ) + TQString fullNameA( const MergeFileInfos& mfi ) { return mfi.m_bExistsInA ? mfi.m_fileInfoA.absFilePath() : m_dirA.absFilePath() + "/" + mfi.m_subPath; } - QString fullNameB( const MergeFileInfos& mfi ) + TQString fullNameB( const MergeFileInfos& mfi ) { return mfi.m_bExistsInB ? mfi.m_fileInfoB.absFilePath() : m_dirB.absFilePath() + "/" + mfi.m_subPath; } - QString fullNameC( const MergeFileInfos& mfi ) + TQString fullNameC( const MergeFileInfos& mfi ) { return mfi.m_bExistsInC ? mfi.m_fileInfoC.absFilePath() : m_dirC.absFilePath() + "/" + mfi.m_subPath; } - QString fullNameDest( const MergeFileInfos& mfi ) + TQString fullNameDest( const MergeFileInfos& mfi ) { if ( m_dirDestInternal.prettyAbsPath() == m_dirC.prettyAbsPath() ) return fullNameC(mfi); else if ( m_dirDestInternal.prettyAbsPath() == m_dirB.prettyAbsPath() ) return fullNameB(mfi); else return m_dirDestInternal.absFilePath() + "/" + mfi.m_subPath; } - bool copyFLD( const QString& srcName, const QString& destName ); - bool deleteFLD( const QString& name, bool bCreateBackup ); - bool makeDir( const QString& name, bool bQuiet=false ); - bool renameFLD( const QString& srcName, const QString& destName ); - bool mergeFLD( const QString& nameA,const QString& nameB,const QString& nameC, - const QString& nameDest, bool& bSingleFileMerge ); + bool copyFLD( const TQString& srcName, const TQString& destName ); + bool deleteFLD( const TQString& name, bool bCreateBackup ); + bool makeDir( const TQString& name, bool bQuiet=false ); + bool renameFLD( const TQString& srcName, const TQString& destName ); + bool mergeFLD( const TQString& nameA,const TQString& nameB,const TQString& nameC, + const TQString& nameDest, bool& bSingleFileMerge ); FileAccess m_dirA; FileAccess m_dirB; @@ -240,9 +241,9 @@ protected: FileAccess m_dirDest; FileAccess m_dirDestInternal; - QString m_dirMergeStateFilename; + TQString m_dirMergeStateFilename; - std::map<QString, MergeFileInfos> m_fileMergeMap; + std::map<TQString, MergeFileInfos> m_fileMergeMap; bool m_bFollowDirLinks; bool m_bFollowFileLinks; @@ -318,44 +319,45 @@ protected: KAction* m_pDirSaveMergeState; KAction* m_pDirLoadMergeState; signals: - void startDiffMerge(QString fn1,QString fn2, QString fn3, QString ofn, QString,QString,QString,TotalDiffStatus*); + void startDiffMerge(TQString fn1,TQString fn2, TQString fn3, TQString ofn, TQString,TQString,TQString,TotalDifftqStatus*); void checkIfCanContinue( bool* pbContinue ); void updateAvailabilities(); - void statusBarMessage( const QString& msg ); + void statusBarMessage( const TQString& msg ); protected slots: - void onDoubleClick( QListViewItem* lvi ); - void onClick( int button, QListViewItem* lvi, const QPoint&, int c ); - void slotShowContextMenu(QListViewItem* lvi,const QPoint &,int c); - void onSelectionChanged(QListViewItem* lvi); + void onDoubleClick( TQListViewItem* lvi ); + void onClick( int button, TQListViewItem* lvi, const TQPoint&, int c ); + void slotShowContextMenu(TQListViewItem* lvi,const TQPoint &,int c); + void onSelectionChanged(TQListViewItem* lvi); }; -class DirectoryMergeInfo : public QFrame +class DirectoryMergeInfo : public TQFrame { Q_OBJECT + TQ_OBJECT public: - DirectoryMergeInfo( QWidget* pParent ); + DirectoryMergeInfo( TQWidget* pParent ); void setInfo( const FileAccess& APath, const FileAccess& BPath, const FileAccess& CPath, const FileAccess& DestPath, MergeFileInfos& mfi ); - QListView* getInfoList() {return m_pInfoList;} - virtual bool eventFilter( QObject* o, QEvent* e ); + TQListView* getInfoList() {return m_pInfoList;} + virtual bool eventFilter( TQObject* o, TQEvent* e ); signals: void gotFocus(); private: - QLabel* m_pInfoA; - QLabel* m_pInfoB; - QLabel* m_pInfoC; - QLabel* m_pInfoDest; + TQLabel* m_pInfoA; + TQLabel* m_pInfoB; + TQLabel* m_pInfoC; + TQLabel* m_pInfoDest; - QLabel* m_pA; - QLabel* m_pB; - QLabel* m_pC; - QLabel* m_pDest; + TQLabel* m_pA; + TQLabel* m_pB; + TQLabel* m_pC; + TQLabel* m_pDest; - QListView* m_pInfoList; + TQListView* m_pInfoList; }; diff --git a/src/fileaccess.cpp b/src/fileaccess.cpp index 8d4ce17..6c58569 100644 --- a/src/fileaccess.cpp +++ b/src/fileaccess.cpp @@ -14,18 +14,18 @@ #include <kio/global.h> #include <kmessagebox.h> #include "optiondialog.h" -#include <qlayout.h> -#include <qlabel.h> -#include <qapplication.h> -#include <qpushbutton.h> +#include <tqlayout.h> +#include <tqlabel.h> +#include <tqapplication.h> +#include <tqpushbutton.h> -#include <qeventloop.h> +#include <tqeventloop.h> #include "common.h" #include <ktempfile.h> -#include <qdir.h> -#include <qregexp.h> -#include <qtextstream.h> +#include <tqdir.h> +#include <tqregexp.h> +#include <tqtextstream.h> #include <vector> #include <klocale.h> @@ -46,7 +46,7 @@ ProgressDialog* g_pProgressDialog=0; -FileAccess::FileAccess( const QString& name, bool bWantToWrite ) +FileAccess::FileAccess( const TQString& name, bool bWantToWrite ) { setFile( name, bWantToWrite ); } @@ -55,9 +55,9 @@ FileAccess::FileAccess() { m_bValidData = false; m_size = 0; - m_creationTime = QDateTime(); - m_accessTime = QDateTime(); - m_modificationTime = QDateTime(); + m_creationTime = TQDateTime(); + m_accessTime = TQDateTime(); + m_modificationTime = TQDateTime(); m_bReadable = false; m_bWritable = false; m_bExecutable = false; @@ -77,15 +77,15 @@ FileAccess::~FileAccess() } } -void FileAccess::setFile( const QString& name, bool bWantToWrite ) +void FileAccess::setFile( const TQString& name, bool bWantToWrite ) { m_url = KURL::fromPathOrURL( name ); m_bValidData = false; m_size = 0; - m_creationTime = QDateTime(); - m_accessTime = QDateTime(); - m_modificationTime = QDateTime(); + m_creationTime = TQDateTime(); + m_accessTime = TQDateTime(); + m_modificationTime = TQDateTime(); m_bReadable = false; m_bWritable = false; m_bExecutable = false; @@ -111,16 +111,16 @@ void FileAccess::setFile( const QString& name, bool bWantToWrite ) // 1. When the local file exists and the remote location is wanted nevertheless. (unlikely) // 2. When the local file doesn't exist and should be written to. - bool bExistsLocal = QDir().exists(name); + bool bExistsLocal = TQDir().exists(name); if ( m_url.isLocalFile() || !m_url.isValid() || bExistsLocal ) // assuming that invalid means relative { - QString localName = name; + TQString localName = name; if ( !bExistsLocal && m_url.isLocalFile() && name.left(5).lower()=="file:" ) { localName = m_url.path(); // I want the path without preceding "file:" } - QFileInfo fi( localName ); -#if defined(Q_WS_WIN) + TQFileInfo fi( localName ); +#if defined(TQ_WS_WIN) // On some windows machines in a network this takes very long. // and it's not so important anyway. m_bReadable = true; @@ -151,15 +151,15 @@ void FileAccess::setFile( const QString& name, bool bWantToWrite ) m_url.setPath( m_absFilePath ); } - if ( !m_bExists && m_absFilePath.contains("@@") ) + if ( !m_bExists && m_absFilePath.tqcontains("@@") ) { // Try reading a clearcase file m_localCopy = FileAccess::tempFileName(); - QString cmd = "cleartool get -to \"" + m_localCopy + "\" \"" + m_absFilePath + "\""; + TQString cmd = "cleartool get -to \"" + m_localCopy + "\" \"" + m_absFilePath + "\""; ::system( cmd.local8Bit() ); - QFileInfo fi( m_localCopy ); -#if defined(Q_WS_WIN) + TQFileInfo fi( m_localCopy ); +#if defined(TQ_WS_WIN) m_bReadable = true;//fi.isReadable(); m_bWritable = true;//fi.isWritable(); m_bExecutable = false;//fi.isExecutable(); @@ -196,7 +196,7 @@ void FileAccess::setFile( const QString& name, bool bWantToWrite ) } } -void FileAccess::addPath( const QString& txt ) +void FileAccess::addPath( const TQString& txt ) { if ( m_url.isValid() ) { @@ -205,13 +205,13 @@ void FileAccess::addPath( const QString& txt ) } else { - QString slash = (txt.isEmpty() || txt[0]=='/') ? "" : "/"; + TQString slash = (txt.isEmpty() || txt[0]=='/') ? "" : "/"; setFile( absFilePath() + slash + txt ); } } /* Filetype: - S_IFMT 0170000 bitmask for the file type bitfields + S_IFMT 0170000 bittqmask for the file type bitfields S_IFSOCK 0140000 socket S_IFLNK 0120000 symbolic link S_IFREG 0100000 regular file @@ -224,15 +224,15 @@ void FileAccess::addPath( const QString& txt ) S_ISVTX 0001000 sticky bit (see below) Access: - S_IRWXU 00700 mask for file owner permissions + S_IRWXU 00700 tqmask for file owner permissions S_IRUSR 00400 owner has read permission S_IWUSR 00200 owner has write permission S_IXUSR 00100 owner has execute permission - S_IRWXG 00070 mask for group permissions + S_IRWXG 00070 tqmask for group permissions S_IRGRP 00040 group has read permission S_IWGRP 00020 group has write permission S_IXGRP 00010 group has execute permission - S_IRWXO 00007 mask for permissions for others (not in group) + S_IRWXO 00007 tqmask for permissions for others (not in group) S_IROTH 00004 others have read permission S_IWOTH 00002 others have write permisson S_IXOTH 00001 others have execute permission @@ -294,7 +294,7 @@ void FileAccess::setUdsEntry( const KIO::UDSEntry& e ) m_bSymLink = !m_linkTarget.isEmpty(); if ( m_name.isEmpty() ) { - int pos = m_path.findRev('/') + 1; + int pos = m_path.tqfindRev('/') + 1; m_name = m_path.mid( pos ); } m_bHidden = m_name[0]=='.'; @@ -314,28 +314,28 @@ bool FileAccess::isReadable() const { return m_bReadable; } bool FileAccess::isWritable() const { return m_bWritable; } bool FileAccess::isExecutable() const { return m_bExecutable; } bool FileAccess::isHidden() const { return m_bHidden; } -QString FileAccess::readLink() const { return m_linkTarget; } -QString FileAccess::absFilePath() const{ return m_absFilePath; } // Full abs path -QString FileAccess::fileName() const { return m_name; } // Just the name-part of the path, without parent directories -QString FileAccess::filePath() const { return m_path; } // The path-string that was used during construction -QString FileAccess::prettyAbsPath() const { return isLocal() ? m_absFilePath : m_url.prettyURL(); } +TQString FileAccess::readLink() const { return m_linkTarget; } +TQString FileAccess::absFilePath() const{ return m_absFilePath; } // Full abs path +TQString FileAccess::fileName() const { return m_name; } // Just the name-part of the path, without tqparent directories +TQString FileAccess::filePath() const { return m_path; } // The path-string that was used during construction +TQString FileAccess::prettyAbsPath() const { return isLocal() ? m_absFilePath : m_url.prettyURL(); } -QDateTime FileAccess::created() const +TQDateTime FileAccess::created() const { return ( m_creationTime.isValid() ? m_creationTime : m_modificationTime ); } -QDateTime FileAccess::lastModified() const +TQDateTime FileAccess::lastModified() const { return m_modificationTime; } -QDateTime FileAccess::lastRead() const +TQDateTime FileAccess::lastRead() const { return ( m_accessTime.isValid() ? m_accessTime : m_modificationTime ); } -static bool interruptableReadFile( QFile& f, void* pDestBuffer, unsigned long maxLength ) +static bool interruptableReadFile( TQFile& f, void* pDestBuffer, unsigned long maxLength ) { ProgressProxy pp; const unsigned long maxChunkSize = 100000; @@ -360,13 +360,13 @@ bool FileAccess::readFile( void* pDestBuffer, unsigned long maxLength ) { if ( !m_localCopy.isEmpty() ) { - QFile f( m_localCopy ); + TQFile f( m_localCopy ); if ( f.open( IO_ReadOnly ) ) return interruptableReadFile(f, pDestBuffer, maxLength);// maxLength == f.readBlock( (char*)pDestBuffer, maxLength ); } else if (m_bLocal) { - QFile f( filePath() ); + TQFile f( filePath() ); if ( f.open( IO_ReadOnly ) ) return interruptableReadFile(f, pDestBuffer, maxLength); //maxLength == f.readBlock( (char*)pDestBuffer, maxLength ); @@ -384,7 +384,7 @@ bool FileAccess::writeFile( const void* pSrcBuffer, unsigned long length ) ProgressProxy pp; if (m_bLocal) { - QFile f( filePath() ); + TQFile f( filePath() ); if ( f.open( IO_WriteOnly ) ) { const unsigned long maxChunkSize = 100000; @@ -407,11 +407,11 @@ bool FileAccess::writeFile( const void* pSrcBuffer, unsigned long length ) if ( isExecutable() ) // value is true if the old file was executable { // Preserve attributes - struct stat srcFileStatus; - int statResult = ::stat( filePath().ascii(), &srcFileStatus ); + struct stat srcFiletqStatus; + int statResult = ::stat( filePath().ascii(), &srcFiletqStatus ); if (statResult==0) { - ::chmod ( filePath().ascii(), srcFileStatus.st_mode | S_IXUSR ); + ::chmod ( filePath().ascii(), srcFiletqStatus.st_mode | S_IXUSR ); } } #endif @@ -427,13 +427,13 @@ bool FileAccess::writeFile( const void* pSrcBuffer, unsigned long length ) return false; } -bool FileAccess::copyFile( const QString& dest ) +bool FileAccess::copyFile( const TQString& dest ) { FileAccessJobHandler jh( this ); return jh.copyFile( dest ); // Handles local and remote copying. } -bool FileAccess::rename( const QString& dest ) +bool FileAccess::rename( const TQString& dest ) { FileAccessJobHandler jh( this ); return jh.rename( dest ); @@ -443,7 +443,7 @@ bool FileAccess::removeFile() { if ( isLocal() ) { - return QDir().remove( absFilePath() ); + return TQDir().remove( absFilePath() ); } else { @@ -452,13 +452,13 @@ bool FileAccess::removeFile() } } -bool FileAccess::removeFile( const QString& name ) // static +bool FileAccess::removeFile( const TQString& name ) // static { return FileAccess(name).removeFile(); } bool FileAccess::listDir( t_DirectoryList* pDirList, bool bRecursive, bool bFindHidden, - const QString& filePattern, const QString& fileAntiPattern, const QString& dirAntiPattern, + const TQString& filePattern, const TQString& fileAntiPattern, const TQString& dirAntiPattern, bool bFollowDirLinks, bool bUseCvsIgnore ) { FileAccessJobHandler jh( this ); @@ -466,34 +466,34 @@ bool FileAccess::listDir( t_DirectoryList* pDirList, bool bRecursive, bool bFind dirAntiPattern, bFollowDirLinks, bUseCvsIgnore ); } -QString FileAccess::tempFileName() +TQString FileAccess::tempFileName() { #ifdef KREPLACEMENTS_H - QString fileName; + TQString fileName; #ifdef _WIN32 - QString tmpDir = getenv("TEMP"); + TQString tmpDir = getenv("TEMP"); #else - QString tmpDir = "/tmp"; + TQString tmpDir = "/tmp"; #endif for(int i=0; ;++i) { // short filenames for WIN98 because for system() the command must not exceed 120 characters. #ifdef _WIN32 - if ( QApplication::winVersion() & Qt::WV_DOS_based ) // Win95, 98, ME - fileName = tmpDir + "\\" + QString::number(i); + if ( TQApplication::winVersion() & TQt::WV_DOS_based ) // Win95, 98, ME + fileName = tmpDir + "\\" + TQString::number(i); else - fileName = tmpDir + "/kdiff3_" + QString::number(_getpid()) + "_" + QString::number(i) +".tmp"; + fileName = tmpDir + "/kdiff3_" + TQString::number(_getpid()) + "_" + TQString::number(i) +".tmp"; #else - fileName = tmpDir + "/kdiff3_" + QString::number(getpid()) + "_" + QString::number(i) +".tmp"; + fileName = tmpDir + "/kdiff3_" + TQString::number(getpid()) + "_" + TQString::number(i) +".tmp"; #endif if ( ! FileAccess::exists(fileName) && - QFile(fileName).open(IO_WriteOnly) ) // open, truncate and close the file, true if successful + TQFile(fileName).open(IO_WriteOnly) ) // open, truncate and close the file, true if successful { break; } } - return QDir::convertSeparators(fileName+".2"); + return TQDir::convertSeparators(fileName+".2"); #else // using KDE @@ -505,7 +505,7 @@ QString FileAccess::tempFileName() #endif } -bool FileAccess::removeTempFile( const QString& name ) // static +bool FileAccess::removeTempFile( const TQString& name ) // static { if (name.endsWith(".2")) FileAccess(name.left(name.length()-2)).removeFile(); @@ -513,19 +513,19 @@ bool FileAccess::removeTempFile( const QString& name ) // static } -bool FileAccess::makeDir( const QString& dirName ) +bool FileAccess::makeDir( const TQString& dirName ) { FileAccessJobHandler fh(0); return fh.mkDir( dirName ); } -bool FileAccess::removeDir( const QString& dirName ) +bool FileAccess::removeDir( const TQString& dirName ) { FileAccessJobHandler fh(0); return fh.rmDir( dirName ); } -bool FileAccess::symLink( const QString& linkTarget, const QString& linkLocation ) +bool FileAccess::symLink( const TQString& linkTarget, const TQString& linkLocation ) { #ifdef _WIN32 return false; @@ -536,7 +536,7 @@ bool FileAccess::symLink( const QString& linkTarget, const QString& linkLocation #endif } -bool FileAccess::exists( const QString& name ) +bool FileAccess::exists( const TQString& name ) { FileAccess fa( name ); return fa.exists(); @@ -548,11 +548,11 @@ long FileAccess::sizeForReading() if ( m_size == 0 && !isLocal() ) { // Size couldn't be determined. Copy the file to a local temp place. - QString localCopy = tempFileName(); + TQString localCopy = tempFileName(); bool bSuccess = copyFile( localCopy ); if ( bSuccess ) { - QFileInfo fi( localCopy ); + TQFileInfo fi( localCopy ); m_size = fi.size(); m_localCopy = localCopy; return m_size; @@ -566,17 +566,17 @@ long FileAccess::sizeForReading() return m_size; } -QString FileAccess::getStatusText() +TQString FileAccess::getStatusText() { return m_statusText; } -QString FileAccess::cleanDirPath( const QString& path ) // static +TQString FileAccess::cleanDirPath( const TQString& path ) // static { KURL url(path); if ( url.isLocalFile() || ! url.isValid() ) { - return QDir().cleanDirPath( path ); + return TQDir().cleanDirPath( path ); } else { @@ -584,12 +584,12 @@ QString FileAccess::cleanDirPath( const QString& path ) // static } } -bool FileAccess::createBackup( const QString& bakExtension ) +bool FileAccess::createBackup( const TQString& bakExtension ) { if ( exists() ) { // First rename the existing file to the bak-file. If a bak-file file exists, delete that. - QString bakName = absFilePath() + bakExtension; + TQString bakName = absFilePath() + bakExtension; FileAccess bakFile( bakName, true /*bWantToWrite*/ ); if ( bakFile.exists() ) { @@ -620,12 +620,12 @@ FileAccessJobHandler::FileAccessJobHandler( FileAccess* pFileAccess ) bool FileAccessJobHandler::stat( int detail, bool bWantToWrite ) { m_bSuccess = false; - m_pFileAccess->m_statusText = QString(); + m_pFileAccess->m_statusText = TQString(); KIO::StatJob* pStatJob = KIO::stat( m_pFileAccess->m_url, ! bWantToWrite, detail, false ); - connect( pStatJob, SIGNAL(result(KIO::Job*)), this, SLOT(slotStatResult(KIO::Job*))); + connect( pStatJob, TQT_SIGNAL(result(KIO::Job*)), this, TQT_SLOT(slotStatResult(KIO::Job*))); - g_pProgressDialog->enterEventLoop( pStatJob, i18n("Getting file status: %1").arg(m_pFileAccess->prettyAbsPath()) ); + g_pProgressDialog->enterEventLoop( pStatJob, i18n("Getting file status: %1").tqarg(m_pFileAccess->prettyAbsPath()) ); return m_bSuccess; } @@ -662,20 +662,20 @@ bool FileAccessJobHandler::get(void* pDestBuffer, long maxLength ) m_pTransferBuffer = (char*)pDestBuffer; m_maxLength = maxLength; m_bSuccess = false; - m_pFileAccess->m_statusText = QString(); + m_pFileAccess->m_statusText = TQString(); - connect( pJob, SIGNAL(result(KIO::Job*)), this, SLOT(slotSimpleJobResult(KIO::Job*))); - connect( pJob, SIGNAL(data(KIO::Job*,const QByteArray &)), this, SLOT(slotGetData(KIO::Job*, const QByteArray&))); - connect( pJob, SIGNAL(percent(KIO::Job*,unsigned long)), this, SLOT(slotPercent(KIO::Job*, unsigned long))); + connect( pJob, TQT_SIGNAL(result(KIO::Job*)), this, TQT_SLOT(slotSimpleJobResult(KIO::Job*))); + connect( pJob, TQT_SIGNAL(data(KIO::Job*,const TQByteArray &)), this, TQT_SLOT(slotGetData(KIO::Job*, const TQByteArray&))); + connect( pJob, TQT_SIGNAL(percent(KIO::Job*,unsigned long)), this, TQT_SLOT(slotPercent(KIO::Job*, unsigned long))); - g_pProgressDialog->enterEventLoop( pJob, i18n("Reading file: %1").arg(m_pFileAccess->prettyAbsPath()) ); + g_pProgressDialog->enterEventLoop( pJob, i18n("Reading file: %1").tqarg(m_pFileAccess->prettyAbsPath()) ); return m_bSuccess; } else return true; } -void FileAccessJobHandler::slotGetData( KIO::Job* pJob, const QByteArray& newData ) +void FileAccessJobHandler::slotGetData( KIO::Job* pJob, const TQByteArray& newData ) { if ( pJob->error() ) { @@ -698,20 +698,20 @@ bool FileAccessJobHandler::put(const void* pSrcBuffer, long maxLength, bool bOve m_pTransferBuffer = (char*)pSrcBuffer; m_maxLength = maxLength; m_bSuccess = false; - m_pFileAccess->m_statusText = QString(); + m_pFileAccess->m_statusText = TQString(); - connect( pJob, SIGNAL(result(KIO::Job*)), this, SLOT(slotPutJobResult(KIO::Job*))); - connect( pJob, SIGNAL(dataReq(KIO::Job*, QByteArray&)), this, SLOT(slotPutData(KIO::Job*, QByteArray&))); - connect( pJob, SIGNAL(percent(KIO::Job*,unsigned long)), this, SLOT(slotPercent(KIO::Job*, unsigned long))); + connect( pJob, TQT_SIGNAL(result(KIO::Job*)), this, TQT_SLOT(slotPutJobResult(KIO::Job*))); + connect( pJob, TQT_SIGNAL(dataReq(KIO::Job*, TQByteArray&)), this, TQT_SLOT(slotPutData(KIO::Job*, TQByteArray&))); + connect( pJob, TQT_SIGNAL(percent(KIO::Job*,unsigned long)), this, TQT_SLOT(slotPercent(KIO::Job*, unsigned long))); - g_pProgressDialog->enterEventLoop( pJob, i18n("Writing file: %1").arg(m_pFileAccess->prettyAbsPath()) ); + g_pProgressDialog->enterEventLoop( pJob, i18n("Writing file: %1").tqarg(m_pFileAccess->prettyAbsPath()) ); return m_bSuccess; } else return true; } -void FileAccessJobHandler::slotPutData( KIO::Job* pJob, QByteArray& data ) +void FileAccessJobHandler::slotPutData( KIO::Job* pJob, TQByteArray& data ) { if ( pJob->error() ) { @@ -721,7 +721,7 @@ void FileAccessJobHandler::slotPutData( KIO::Job* pJob, QByteArray& data ) { long maxChunkSize = 100000; long length = min2( maxChunkSize, m_maxLength - m_transferredBytes ); - bool bSuccess = data.resize( length ); + bool bSuccess = data.tqresize( length ); if ( bSuccess ) { if ( length>0 ) @@ -752,47 +752,47 @@ void FileAccessJobHandler::slotPutJobResult(KIO::Job* pJob) g_pProgressDialog->exitEventLoop(); // Close the dialog, return from exec() } -bool FileAccessJobHandler::mkDir( const QString& dirName ) +bool FileAccessJobHandler::mkDir( const TQString& dirName ) { KURL dirURL = KURL::fromPathOrURL( dirName ); if ( dirName.isEmpty() ) return false; else if ( dirURL.isLocalFile() ) { - return QDir().mkdir( dirURL.path() ); + return TQDir().mkdir( dirURL.path() ); } else { m_bSuccess = false; KIO::SimpleJob* pJob = KIO::mkdir( dirURL ); - connect( pJob, SIGNAL(result(KIO::Job*)), this, SLOT(slotSimpleJobResult(KIO::Job*))); + connect( pJob, TQT_SIGNAL(result(KIO::Job*)), this, TQT_SLOT(slotSimpleJobResult(KIO::Job*))); - g_pProgressDialog->enterEventLoop( pJob, i18n("Making directory: %1").arg(dirName) ); + g_pProgressDialog->enterEventLoop( pJob, i18n("Making directory: %1").tqarg(dirName) ); return m_bSuccess; } } -bool FileAccessJobHandler::rmDir( const QString& dirName ) +bool FileAccessJobHandler::rmDir( const TQString& dirName ) { KURL dirURL = KURL::fromPathOrURL( dirName ); if ( dirName.isEmpty() ) return false; else if ( dirURL.isLocalFile() ) { - return QDir().rmdir( dirURL.path() ); + return TQDir().rmdir( dirURL.path() ); } else { m_bSuccess = false; KIO::SimpleJob* pJob = KIO::rmdir( dirURL ); - connect( pJob, SIGNAL(result(KIO::Job*)), this, SLOT(slotSimpleJobResult(KIO::Job*))); + connect( pJob, TQT_SIGNAL(result(KIO::Job*)), this, TQT_SLOT(slotSimpleJobResult(KIO::Job*))); - g_pProgressDialog->enterEventLoop(pJob, i18n("Removing directory: %1").arg(dirName)); + g_pProgressDialog->enterEventLoop(pJob, i18n("Removing directory: %1").tqarg(dirName)); return m_bSuccess; } } -bool FileAccessJobHandler::removeFile( const QString& fileName ) +bool FileAccessJobHandler::removeFile( const TQString& fileName ) { if ( fileName.isEmpty() ) return false; @@ -800,14 +800,14 @@ bool FileAccessJobHandler::removeFile( const QString& fileName ) { m_bSuccess = false; KIO::SimpleJob* pJob = KIO::file_delete( KURL::fromPathOrURL(fileName), false ); - connect( pJob, SIGNAL(result(KIO::Job*)), this, SLOT(slotSimpleJobResult(KIO::Job*))); + connect( pJob, TQT_SIGNAL(result(KIO::Job*)), this, TQT_SLOT(slotSimpleJobResult(KIO::Job*))); - g_pProgressDialog->enterEventLoop( pJob, i18n("Removing file: %1").arg(fileName) ); + g_pProgressDialog->enterEventLoop( pJob, i18n("Removing file: %1").tqarg(fileName) ); return m_bSuccess; } } -bool FileAccessJobHandler::symLink( const QString& linkTarget, const QString& linkLocation ) +bool FileAccessJobHandler::symLink( const TQString& linkTarget, const TQString& linkLocation ) { if ( linkTarget.isEmpty() || linkLocation.isEmpty() ) return false; @@ -815,26 +815,26 @@ bool FileAccessJobHandler::symLink( const QString& linkTarget, const QString& li { m_bSuccess = false; KIO::CopyJob* pJob = KIO::link( KURL::fromPathOrURL(linkTarget), KURL::fromPathOrURL(linkLocation), false ); - connect( pJob, SIGNAL(result(KIO::Job*)), this, SLOT(slotSimpleJobResult(KIO::Job*))); + connect( pJob, TQT_SIGNAL(result(KIO::Job*)), this, TQT_SLOT(slotSimpleJobResult(KIO::Job*))); g_pProgressDialog->enterEventLoop( pJob, - i18n("Creating symbolic link: %1 -> %2").arg(linkLocation).arg(linkTarget) ); + i18n("Creating symbolic link: %1 -> %2").tqarg(linkLocation).tqarg(linkTarget) ); return m_bSuccess; } } -bool FileAccessJobHandler::rename( const QString& dest ) +bool FileAccessJobHandler::rename( const TQString& dest ) { if ( dest.isEmpty() ) return false; KURL kurl = KURL::fromPathOrURL( dest ); if ( !kurl.isValid() ) - kurl = KURL::fromPathOrURL( QDir().absFilePath(dest) ); // assuming that invalid means relative + kurl = KURL::fromPathOrURL( TQDir().absFilePath(dest) ); // assuming that invalid means relative if ( m_pFileAccess->isLocal() && kurl.isLocalFile() ) { - return QDir().rename( m_pFileAccess->absFilePath(), kurl.path() ); + return TQDir().rename( m_pFileAccess->absFilePath(), kurl.path() ); } else { @@ -844,11 +844,11 @@ bool FileAccessJobHandler::rename( const QString& dest ) int permissions=-1; m_bSuccess = false; KIO::FileCopyJob* pJob = KIO::file_move( m_pFileAccess->m_url, kurl, permissions, bOverwrite, bResume, bShowProgress ); - connect( pJob, SIGNAL(result(KIO::Job*)), this, SLOT(slotSimpleJobResult(KIO::Job*))); - connect( pJob, SIGNAL(percent(KIO::Job*,unsigned long)), this, SLOT(slotPercent(KIO::Job*, unsigned long))); + connect( pJob, TQT_SIGNAL(result(KIO::Job*)), this, TQT_SLOT(slotSimpleJobResult(KIO::Job*))); + connect( pJob, TQT_SIGNAL(percent(KIO::Job*,unsigned long)), this, TQT_SLOT(slotPercent(KIO::Job*, unsigned long))); g_pProgressDialog->enterEventLoop( pJob, - i18n("Renaming file: %1 -> %2").arg(m_pFileAccess->prettyAbsPath()).arg(dest) ); + i18n("Renaming file: %1 -> %2").tqarg(m_pFileAccess->prettyAbsPath()).tqarg(dest) ); return m_bSuccess; } } @@ -868,11 +868,11 @@ void FileAccessJobHandler::slotSimpleJobResult(KIO::Job* pJob) // Copy local or remote files. -bool FileAccessJobHandler::copyFile( const QString& dest ) +bool FileAccessJobHandler::copyFile( const TQString& dest ) { ProgressProxy pp; KURL destUrl = KURL::fromPathOrURL( dest ); - m_pFileAccess->m_statusText = QString(); + m_pFileAccess->m_statusText = TQString(); if ( ! m_pFileAccess->isLocal() || ! destUrl.isLocalFile() ) // if either url is nonlocal { bool bOverwrite = false; @@ -881,54 +881,51 @@ bool FileAccessJobHandler::copyFile( const QString& dest ) int permissions = (m_pFileAccess->isExecutable()?0111:0)+(m_pFileAccess->isWritable()?0222:0)+(m_pFileAccess->isReadable()?0444:0); m_bSuccess = false; KIO::FileCopyJob* pJob = KIO::file_copy ( m_pFileAccess->m_url, destUrl, permissions, bOverwrite, bResume, bShowProgress ); - connect( pJob, SIGNAL(result(KIO::Job*)), this, SLOT(slotSimpleJobResult(KIO::Job*))); - connect( pJob, SIGNAL(percent(KIO::Job*,unsigned long)), this, SLOT(slotPercent(KIO::Job*, unsigned long))); + connect( pJob, TQT_SIGNAL(result(KIO::Job*)), this, TQT_SLOT(slotSimpleJobResult(KIO::Job*))); + connect( pJob, TQT_SIGNAL(percent(KIO::Job*,unsigned long)), this, TQT_SLOT(slotPercent(KIO::Job*, unsigned long))); g_pProgressDialog->enterEventLoop( pJob, - i18n("Copying file: %1 -> %2").arg(m_pFileAccess->prettyAbsPath()).arg(dest) ); + i18n("Copying file: %1 -> %2").tqarg(m_pFileAccess->prettyAbsPath()).tqarg(dest) ); return m_bSuccess; // Note that the KIO-slave preserves the original date, if this is supported. } // Both files are local: - QString srcName = m_pFileAccess->absFilePath(); - QString destName = dest; - QFile srcFile( srcName ); - QFile destFile( destName ); + TQString srcName = m_pFileAccess->absFilePath(); + TQString destName = dest; + TQFile srcFile( srcName ); + TQFile destFile( destName ); bool bReadSuccess = srcFile.open( IO_ReadOnly ); if ( bReadSuccess == false ) { - m_pFileAccess->m_statusText = i18n("Error during file copy operation: Opening file for reading failed. Filename: %1").arg(srcName); + m_pFileAccess->m_statusText = i18n("Error during file copy operation: Opening file for reading failed. Filename: %1").tqarg(srcName); return false; } bool bWriteSuccess = destFile.open( IO_WriteOnly ); if ( bWriteSuccess == false ) { - m_pFileAccess->m_statusText = i18n("Error during file copy operation: Opening file for writing failed. Filename: %1").arg(destName); + m_pFileAccess->m_statusText = i18n("Error during file copy operation: Opening file for writing failed. Filename: %1").tqarg(destName); return false; } -#if QT_VERSION==230 - typedef long Q_LONG; -#endif std::vector<char> buffer(100000); - Q_LONG bufSize = buffer.size(); - Q_LONG srcSize = srcFile.size(); + TQ_LONG bufSize = buffer.size(); + TQ_LONG srcSize = srcFile.size(); while ( srcSize > 0 && !pp.wasCancelled() ) { - Q_LONG readSize = srcFile.readBlock( &buffer[0], min2( srcSize, bufSize ) ); + TQ_LONG readSize = srcFile.readBlock( &buffer[0], min2( srcSize, bufSize ) ); if ( readSize==-1 || readSize==0 ) { - m_pFileAccess->m_statusText = i18n("Error during file copy operation: Reading failed. Filename: %1").arg(srcName); + m_pFileAccess->m_statusText = i18n("Error during file copy operation: Reading failed. Filename: %1").tqarg(srcName); return false; } srcSize -= readSize; while ( readSize > 0 ) { - Q_LONG writeSize = destFile.writeBlock( &buffer[0], readSize ); + TQ_LONG writeSize = destFile.writeBlock( &buffer[0], readSize ); if ( writeSize==-1 || writeSize==0 ) { - m_pFileAccess->m_statusText = i18n("Error during file copy operation: Writing failed. Filename: %1").arg(destName); + m_pFileAccess->m_statusText = i18n("Error during file copy operation: Writing failed. Filename: %1").tqarg(destName); return false; } readSize -= writeSize; @@ -941,40 +938,40 @@ bool FileAccessJobHandler::copyFile( const QString& dest ) // Update the times of the destFile #ifdef _WIN32 - struct _stat srcFileStatus; - int statResult = ::_stat( srcName.ascii(), &srcFileStatus ); + struct _stat srcFiletqStatus; + int statResult = ::_stat( srcName.ascii(), &srcFiletqStatus ); if (statResult==0) { _utimbuf destTimes; - destTimes.actime = srcFileStatus.st_atime;/* time of last access */ - destTimes.modtime = srcFileStatus.st_mtime;/* time of last modification */ + destTimes.actime = srcFiletqStatus.st_atime;/* time of last access */ + destTimes.modtime = srcFiletqStatus.st_mtime;/* time of last modification */ _utime ( destName.ascii(), &destTimes ); - _chmod ( destName.ascii(), srcFileStatus.st_mode ); + _chmod ( destName.ascii(), srcFiletqStatus.st_mode ); } #else - struct stat srcFileStatus; - int statResult = ::stat( srcName.ascii(), &srcFileStatus ); + struct stat srcFiletqStatus; + int statResult = ::stat( srcName.ascii(), &srcFiletqStatus ); if (statResult==0) { utimbuf destTimes; - destTimes.actime = srcFileStatus.st_atime;/* time of last access */ - destTimes.modtime = srcFileStatus.st_mtime;/* time of last modification */ + destTimes.actime = srcFiletqStatus.st_atime;/* time of last access */ + destTimes.modtime = srcFiletqStatus.st_mtime;/* time of last modification */ utime ( destName.ascii(), &destTimes ); - chmod ( destName.ascii(), srcFileStatus.st_mode ); + chmod ( destName.ascii(), srcFiletqStatus.st_mode ); } #endif return true; } -bool wildcardMultiMatch( const QString& wildcard, const QString& testString, bool bCaseSensitive ) +bool wildcardMultiMatch( const TQString& wildcard, const TQString& testString, bool bCaseSensitive ) { - QStringList sl = QStringList::split( ";", wildcard ); + TQStringList sl = TQStringList::split( ";", wildcard ); - for ( QStringList::Iterator it = sl.begin(); it != sl.end(); ++it ) + for ( TQStringList::Iterator it = sl.begin(); it != sl.end(); ++it ) { - QRegExp pattern( *it, bCaseSensitive, true /*wildcard mode*/); + TQRegExp pattern( *it, bCaseSensitive, true /*wildcard mode*/); if ( pattern.exactMatch( testString ) ) return true; } @@ -993,17 +990,17 @@ class CvsIgnoreList public: CvsIgnoreList(){} void init(FileAccess& dir, bool bUseLocalCvsIgnore ); - bool matches(const QString& fileName, bool bCaseSensitive ) const; + bool matches(const TQString& fileName, bool bCaseSensitive ) const; private: - void addEntriesFromString(const QString& str); - void addEntriesFromFile(const QString& name); - void addEntry(const QString& entry); - - QStringList m_exactPatterns; - QStringList m_startPatterns; - QStringList m_endPatterns; - QStringList m_generalPatterns; + void addEntriesFromString(const TQString& str); + void addEntriesFromFile(const TQString& name); + void addEntry(const TQString& entry); + + TQStringList m_exactPatterns; + TQStringList m_startPatterns; + TQStringList m_endPatterns; + TQStringList m_generalPatterns; }; @@ -1013,9 +1010,9 @@ void CvsIgnoreList::init( FileAccess& dir, bool bUseLocalCvsIgnore ) ".nse_depinfo #* .#* cvslog.* ,* CVS CVS.adm .del-* *.a *.olb *.o *.obj " "*.so *.Z *~ *.old *.elc *.ln *.bak *.BAK *.orig *.rej *.exe _$* *$"; - addEntriesFromString(QString::fromLatin1(ignorestr)); - addEntriesFromFile(QDir::homeDirPath() + "/.cvsignore"); - addEntriesFromString(QString::fromLocal8Bit(::getenv("CVSIGNORE"))); + addEntriesFromString(TQString::tqfromLatin1(ignorestr)); + addEntriesFromFile(TQDir::homeDirPath() + "/.cvsignore"); + addEntriesFromString(TQString::fromLocal8Bit(::getenv("CVSIGNORE"))); if (bUseLocalCvsIgnore) { @@ -1035,7 +1032,7 @@ void CvsIgnoreList::init( FileAccess& dir, bool bUseLocalCvsIgnore ) { if (pos>pos1) { - addEntry( QString::fromLatin1( &buf[pos1], pos-pos1 ) ); + addEntry( TQString::tqfromLatin1( &buf[pos1], pos-pos1 ) ); } ++pos1; } @@ -1047,11 +1044,11 @@ void CvsIgnoreList::init( FileAccess& dir, bool bUseLocalCvsIgnore ) } -void CvsIgnoreList::addEntriesFromString(const QString& str) +void CvsIgnoreList::addEntriesFromString(const TQString& str) { int posLast(0); int pos; - while ((pos = str.find(' ', posLast)) >= 0) + while ((pos = str.tqfind(' ', posLast)) >= 0) { if (pos > posLast) addEntry(str.mid(posLast, pos - posLast)); @@ -1063,13 +1060,13 @@ void CvsIgnoreList::addEntriesFromString(const QString& str) } -void CvsIgnoreList::addEntriesFromFile(const QString &name) +void CvsIgnoreList::addEntriesFromFile(const TQString &name) { - QFile file(name); + TQFile file(name); if( file.open(IO_ReadOnly) ) { - QTextStream stream(&file); + TQTextStream stream(&file); while( !stream.eof() ) { addEntriesFromString(stream.readLine()); @@ -1077,9 +1074,9 @@ void CvsIgnoreList::addEntriesFromFile(const QString &name) } } -void CvsIgnoreList::addEntry(const QString& pattern) +void CvsIgnoreList::addEntry(const TQString& pattern) { - if (pattern != QString("!")) + if (pattern != TQString("!")) { if (pattern.isEmpty()) return; @@ -1090,13 +1087,13 @@ void CvsIgnoreList::addEntry(const QString& pattern) // Count number of '*' and '?' unsigned int nofMetaCharacters = 0; - const QChar* pos; - pos = pattern.unicode(); - const QChar* posEnd; + const TQChar* pos; + pos = pattern.tqunicode(); + const TQChar* posEnd; posEnd=pos + pattern.length(); while (pos < posEnd) { - if( *pos==QChar('*') || *pos==QChar('?') ) ++nofMetaCharacters; + if( *pos==TQChar('*') || *pos==TQChar('?') ) ++nofMetaCharacters; ++pos; } @@ -1106,11 +1103,11 @@ void CvsIgnoreList::addEntry(const QString& pattern) } else if ( nofMetaCharacters==1 ) { - if ( pattern.constref(0) == QChar('*') ) + if ( pattern.constref(0) == TQChar('*') ) { m_endPatterns.append( pattern.right( pattern.length() - 1) ); } - else if (pattern.constref(pattern.length() - 1) == QChar('*')) + else if (pattern.constref(pattern.length() - 1) == TQChar('*')) { m_startPatterns.append( pattern.left( pattern.length() - 1) ); } @@ -1133,15 +1130,15 @@ void CvsIgnoreList::addEntry(const QString& pattern) } } -bool CvsIgnoreList::matches(const QString& text, bool bCaseSensitive ) const +bool CvsIgnoreList::matches(const TQString& text, bool bCaseSensitive ) const { - if (m_exactPatterns.find(text) != m_exactPatterns.end()) + if (m_exactPatterns.tqfind(text) != m_exactPatterns.end()) { return true; } - QStringList::ConstIterator it; - QStringList::ConstIterator itEnd; + TQStringList::ConstIterator it; + TQStringList::ConstIterator itEnd; for ( it=m_startPatterns.begin(), itEnd=m_startPatterns.end(); it != itEnd; ++it) { if (text.startsWith(*it)) @@ -1159,7 +1156,7 @@ bool CvsIgnoreList::matches(const QString& text, bool bCaseSensitive ) const } /* - for (QValueList<QCString>::const_iterator it(m_generalPatterns.begin()), + for (TQValueList<TQCString>::const_iterator it(m_generalPatterns.begin()), itEnd(m_generalPatterns.end()); it != itEnd; ++it) { @@ -1173,23 +1170,17 @@ bool CvsIgnoreList::matches(const QString& text, bool bCaseSensitive ) const for ( it = m_generalPatterns.begin(); it != m_generalPatterns.end(); ++it ) { - QRegExp pattern( *it, bCaseSensitive, true /*wildcard mode*/); -#if QT_VERSION==230 - int len=0; - if ( pattern.match( text, 0, &len )!=-1 && len==text.length()) - return true; -#else + TQRegExp pattern( *it, bCaseSensitive, true /*wildcard mode*/); if ( pattern.exactMatch( text ) ) return true; -#endif } return false; } -static QString nicePath( const QFileInfo& fi ) +static TQString nicePath( const TQFileInfo& fi ) { - QString fp = fi.filePath(); + TQString fp = fi.filePath(); if ( fp.length()>2 && fp[0] == '.' && fp[1] == '/' ) { return fp.mid(2); @@ -1208,8 +1199,8 @@ static bool cvsIgnoreExists( t_DirectoryList* pDirList ) return false; } -bool FileAccessJobHandler::listDir( t_DirectoryList* pDirList, bool bRecursive, bool bFindHidden, const QString& filePattern, - const QString& fileAntiPattern, const QString& dirAntiPattern, bool bFollowDirLinks, bool bUseCvsIgnore ) +bool FileAccessJobHandler::listDir( t_DirectoryList* pDirList, bool bRecursive, bool bFindHidden, const TQString& filePattern, + const TQString& fileAntiPattern, const TQString& dirAntiPattern, bool bFollowDirLinks, bool bUseCvsIgnore ) { ProgressProxy pp; m_pDirList = pDirList; @@ -1228,19 +1219,19 @@ bool FileAccessJobHandler::listDir( t_DirectoryList* pDirList, bool bRecursive, if( m_pFileAccess->isLocal() ) { - QString currentPath = QDir::currentDirPath(); - m_bSuccess = QDir::setCurrent( m_pFileAccess->absFilePath() ); + TQString currentPath = TQDir::currentDirPath(); + m_bSuccess = TQDir::setCurrent( m_pFileAccess->absFilePath() ); if ( m_bSuccess ) { #ifndef _WIN32 m_bSuccess = true; - QDir dir( "." ); + TQDir dir( "." ); - dir.setSorting( QDir::Name | QDir::DirsFirst ); - dir.setFilter( QDir::Files | QDir::Dirs | QDir::Hidden ); + dir.setSorting( TQDir::Name | TQDir::DirsFirst ); + dir.setFilter( TQDir::Files | TQDir::Dirs | TQDir::Hidden ); dir.setMatchAllDirs( true ); - const QFileInfoList *fiList = dir.entryInfoList(); + const TQFileInfoList *fiList = dir.entryInfoList(); if ( fiList == 0 ) { // No Permission to read directory or other error. @@ -1248,10 +1239,10 @@ bool FileAccessJobHandler::listDir( t_DirectoryList* pDirList, bool bRecursive, } else { - QFileInfoListIterator it( *fiList ); // create list iterator + TQFileInfoListIterator it( *fiList ); // create list iterator for ( ; it.current() != 0; ++it ) // for each file... { - QFileInfo* fi = it.current(); + TQFileInfo* fi = it.current(); if ( fi->fileName() == "." || fi->fileName()==".." ) continue; @@ -1259,25 +1250,25 @@ bool FileAccessJobHandler::listDir( t_DirectoryList* pDirList, bool bRecursive, } } #else - QString pattern ="*.*"; + TQString pattern ="*.*"; WIN32_FIND_DATA findData; WIN32_FIND_DATAA& findDataA=*(WIN32_FIND_DATAA*)&findData; // Needed for Win95 - HANDLE searchHandle = QT_WA_INLINE( + HANDLE searchHandle = TQT_WA_INLINE( FindFirstFile( (TCHAR*)pattern.ucs2(), &findData ), FindFirstFileA( pattern.local8Bit(), &findDataA ) ); if ( searchHandle != INVALID_HANDLE_VALUE ) { - QString absPath = m_pFileAccess->absFilePath(); - QString relPath = m_pFileAccess->filePath(); + TQString absPath = m_pFileAccess->absFilePath(); + TQString relPath = m_pFileAccess->filePath(); bool bFirst=true; while( ! pp.wasCancelled() ) { if (!bFirst) { - if ( ! QT_WA_INLINE( + if ( ! TQT_WA_INLINE( FindNextFile(searchHandle,&findData), FindNextFileA(searchHandle,&findDataA)) ) break; @@ -1289,11 +1280,11 @@ bool FileAccessJobHandler::listDir( t_DirectoryList* pDirList, bool bRecursive, FILETIME ft; SYSTEMTIME t; FileTimeToLocalFileTime( &findData.ftLastWriteTime, &ft ); FileTimeToSystemTime(&ft,&t); - fa.m_modificationTime = QDateTime( QDate(t.wYear, t.wMonth, t.wDay), QTime(t.wHour, t.wMinute, t.wSecond) ); + fa.m_modificationTime = TQDateTime( TQDate(t.wYear, t.wMonth, t.wDay), TQTime(t.wHour, t.wMinute, t.wSecond) ); FileTimeToLocalFileTime( &findData.ftLastAccessTime, &ft ); FileTimeToSystemTime(&ft,&t); - fa.m_accessTime = QDateTime( QDate(t.wYear, t.wMonth, t.wDay), QTime(t.wHour, t.wMinute, t.wSecond) ); + fa.m_accessTime = TQDateTime( TQDate(t.wYear, t.wMonth, t.wDay), TQTime(t.wHour, t.wMinute, t.wSecond) ); FileTimeToLocalFileTime( &findData.ftCreationTime, &ft ); FileTimeToSystemTime(&ft,&t); - fa.m_creationTime = QDateTime( QDate(t.wYear, t.wMonth, t.wDay), QTime(t.wHour, t.wMinute, t.wSecond) ); + fa.m_creationTime = TQDateTime( TQDate(t.wYear, t.wMonth, t.wDay), TQTime(t.wHour, t.wMinute, t.wSecond) ); int a = findData.dwFileAttributes; fa.m_bWritable = ( a & FILE_ATTRIBUTE_READONLY) == 0; @@ -1309,9 +1300,9 @@ bool FileAccessJobHandler::listDir( t_DirectoryList* pDirList, bool bRecursive, fa.m_bSymLink = false; fa.m_fileType = 0; - fa.m_name = QT_WA_INLINE( - QString::fromUcs2((const ushort*)findData.cFileName), - QString::fromLocal8Bit(findDataA.cFileName) + fa.m_name = TQT_WA_INLINE( + TQString::fromUcs2((const ushort*)findData.cFileName), + TQString::fromLocal8Bit(findDataA.cFileName) ); fa.m_path = fa.m_name; @@ -1324,12 +1315,12 @@ bool FileAccessJobHandler::listDir( t_DirectoryList* pDirList, bool bRecursive, } else { - QDir::setCurrent( currentPath ); // restore current path + TQDir::setCurrent( currentPath ); // restore current path return false; } #endif } - QDir::setCurrent( currentPath ); // restore current path + TQDir::setCurrent( currentPath ); // restore current path } else { @@ -1341,19 +1332,19 @@ bool FileAccessJobHandler::listDir( t_DirectoryList* pDirList, bool bRecursive, m_bSuccess = false; if ( pListJob!=0 ) { - connect( pListJob, SIGNAL( entries( KIO::Job *, const KIO::UDSEntryList& ) ), - this, SLOT( slotListDirProcessNewEntries( KIO::Job *, const KIO::UDSEntryList& )) ); - connect( pListJob, SIGNAL( result( KIO::Job* )), - this, SLOT( slotSimpleJobResult(KIO::Job*) ) ); + connect( pListJob, TQT_SIGNAL( entries( KIO::Job *, const KIO::UDSEntryList& ) ), + this, TQT_SLOT( slotListDirProcessNewEntries( KIO::Job *, const KIO::UDSEntryList& )) ); + connect( pListJob, TQT_SIGNAL( result( KIO::Job* )), + this, TQT_SLOT( slotSimpleJobResult(KIO::Job*) ) ); - connect( pListJob, SIGNAL( infoMessage(KIO::Job*, const QString&)), - this, SLOT( slotListDirInfoMessage(KIO::Job*, const QString&) )); + connect( pListJob, TQT_SIGNAL( infoMessage(KIO::Job*, const TQString&)), + this, TQT_SLOT( slotListDirInfoMessage(KIO::Job*, const TQString&) )); // This line makes the transfer via fish unreliable.:-( - //connect( pListJob, SIGNAL(percent(KIO::Job*,unsigned long)), this, SLOT(slotPercent(KIO::Job*, unsigned long))); + //connect( pListJob, TQT_SIGNAL(percent(KIO::Job*,unsigned long)), this, TQT_SLOT(slotPercent(KIO::Job*, unsigned long))); g_pProgressDialog->enterEventLoop( pListJob, - i18n("Listing directory: %1").arg(m_pFileAccess->prettyAbsPath()) ); + i18n("Listing directory: %1").tqarg(m_pFileAccess->prettyAbsPath()) ); } } @@ -1374,7 +1365,7 @@ bool FileAccessJobHandler::listDir( t_DirectoryList* pDirList, bool bRecursive, { t_DirectoryList::iterator i2=i; ++i2; - QString fn = i->fileName(); + TQString fn = i->fileName(); if ( (!bFindHidden && i->isHidden() ) || (i->isFile() && @@ -1429,7 +1420,7 @@ bool FileAccessJobHandler::listDir( t_DirectoryList* pDirList, bool bRecursive, void FileAccessJobHandler::slotListDirProcessNewEntries( KIO::Job *, const KIO::UDSEntryList& l ) { - KURL parentUrl( m_pFileAccess->m_absFilePath ); + KURL tqparentUrl( m_pFileAccess->m_absFilePath ); KIO::UDSEntryList::ConstIterator i; for ( i=l.begin(); i!=l.end(); ++i ) @@ -1440,7 +1431,7 @@ void FileAccessJobHandler::slotListDirProcessNewEntries( KIO::Job *, const KIO:: if ( fa.filePath() != "." && fa.filePath() != ".." ) { - fa.m_url = parentUrl; + fa.m_url = tqparentUrl; fa.m_url.addPath( fa.filePath() ); fa.m_absFilePath = fa.m_url.url(); m_pDirList->push_back( fa ); @@ -1448,7 +1439,7 @@ void FileAccessJobHandler::slotListDirProcessNewEntries( KIO::Job *, const KIO:: } } -void FileAccessJobHandler::slotListDirInfoMessage( KIO::Job*, const QString& msg ) +void FileAccessJobHandler::slotListDirInfoMessage( KIO::Job*, const TQString& msg ) { g_pProgressDialog->setInformation( msg, 0.0 ); } @@ -1459,32 +1450,32 @@ void FileAccessJobHandler::slotPercent( KIO::Job*, unsigned long percent ) } -ProgressDialog::ProgressDialog( QWidget* pParent ) -: QDialog( pParent, 0, true ) +ProgressDialog::ProgressDialog( TQWidget* pParent ) +: TQDialog( pParent, 0, true ) { m_bStayHidden = false; - QVBoxLayout* layout = new QVBoxLayout(this); + TQVBoxLayout* tqlayout = new TQVBoxLayout(this); - m_pInformation = new QLabel( " ", this ); - layout->addWidget( m_pInformation ); + m_pInformation = new TQLabel( " ", this ); + tqlayout->addWidget( m_pInformation ); m_pProgressBar = new KProgress(1000, this); - layout->addWidget( m_pProgressBar ); + tqlayout->addWidget( m_pProgressBar ); - m_pSubInformation = new QLabel( " ", this); - layout->addWidget( m_pSubInformation ); + m_pSubInformation = new TQLabel( " ", this); + tqlayout->addWidget( m_pSubInformation ); m_pSubProgressBar = new KProgress(1000, this); - layout->addWidget( m_pSubProgressBar ); + tqlayout->addWidget( m_pSubProgressBar ); - m_pSlowJobInfo = new QLabel( " ", this); - layout->addWidget( m_pSlowJobInfo ); + m_pSlowJobInfo = new TQLabel( " ", this); + tqlayout->addWidget( m_pSlowJobInfo ); - QHBoxLayout* hlayout = new QHBoxLayout( layout ); - hlayout->addStretch(1); - m_pAbortButton = new QPushButton( i18n("&Cancel"), this); - hlayout->addWidget( m_pAbortButton ); - connect( m_pAbortButton, SIGNAL(clicked()), this, SLOT(slotAbort()) ); + TQHBoxLayout* htqlayout = new TQHBoxLayout( tqlayout ); + htqlayout->addStretch(1); + m_pAbortButton = new TQPushButton( i18n("&Cancel"), this); + htqlayout->addWidget( m_pAbortButton ); + connect( m_pAbortButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotAbort()) ); m_progressDelayTimer = 0; resize( 400, 100 ); @@ -1531,7 +1522,7 @@ void ProgressDialog::pop( bool bRedrawUpdate ) } } -void ProgressDialog::setInformation(const QString& info, double dCurrent, bool bRedrawUpdate ) +void ProgressDialog::setInformation(const TQString& info, double dCurrent, bool bRedrawUpdate ) { if ( m_progressStack.empty() ) return; @@ -1550,7 +1541,7 @@ void ProgressDialog::setInformation(const QString& info, double dCurrent, bool b recalc(bRedrawUpdate); } -void ProgressDialog::setInformation(const QString& info, bool bRedrawUpdate ) +void ProgressDialog::setInformation(const TQString& info, bool bRedrawUpdate ) { if ( m_progressStack.empty() ) return; @@ -1618,10 +1609,10 @@ void ProgressDialog::setSubRangeTransformation( double dMin, double dMax ) pld.m_dSubRangeMax = dMax; } -void qt_enter_modal(QWidget*); -void qt_leave_modal(QWidget*); +void qt_enter_modal(TQWidget*); +void qt_leave_modal(TQWidget*); -void ProgressDialog::enterEventLoop( KIO::Job* pJob, const QString& jobInfo ) +void ProgressDialog::enterEventLoop( KIO::Job* pJob, const TQString& jobInfo ) { m_pJob = pJob; m_pSlowJobInfo->setText(""); @@ -1630,13 +1621,9 @@ void ProgressDialog::enterEventLoop( KIO::Job* pJob, const QString& jobInfo ) m_progressDelayTimer = startTimer( 3000 ); /* 3 s delay */ // instead of using exec() the eventloop is entered and exited often without hiding/showing the window. -#if QT_VERSION==230 - //qApp->enter_loop(); -#else qt_enter_modal(this); - qApp->eventLoop()->enterLoop(); + tqApp->eventLoop()->enterLoop(); qt_leave_modal(this); -#endif } void ProgressDialog::exitEventLoop() @@ -1644,7 +1631,7 @@ void ProgressDialog::exitEventLoop() killTimer( m_progressDelayTimer ); m_progressDelayTimer = 0; m_pJob = 0; - qApp->eventLoop()->exitLoop(); + tqApp->eventLoop()->exitLoop(); } void ProgressDialog::recalc( bool bUpdate ) @@ -1673,24 +1660,20 @@ void ProgressDialog::recalc( bool bUpdate ) if ( !m_bStayHidden && !isVisible() ) show(); - qApp->processEvents(); + tqApp->processEvents(); m_t1.restart(); } } -#include <qtimer.h> +#include <tqtimer.h> void ProgressDialog::show() { killTimer( m_progressDelayTimer ); m_progressDelayTimer = 0; - if ( !isVisible() && (parentWidget()==0 || parentWidget()->isVisible()) ) + if ( !isVisible() && (tqparentWidget()==0 || tqparentWidget()->isVisible()) ) { -#if QT_VERSION==230 - QWidget::show(); -#else - QDialog::show(); -#endif + TQDialog::show(); } } @@ -1698,8 +1681,8 @@ void ProgressDialog::hide() { killTimer( m_progressDelayTimer ); m_progressDelayTimer = 0; - // Calling QDialog::hide() directly doesn't always work. (?) - QTimer::singleShot( 100, this, SLOT(delayedHide()) ); + // Calling TQDialog::hide() directly doesn't always work. (?) + TQTimer::singleShot( 100, this, TQT_SLOT(delayedHide()) ); } void ProgressDialog::delayedHide() @@ -1709,7 +1692,7 @@ void ProgressDialog::delayedHide() m_pJob->kill(false); m_pJob = 0; } - QDialog::hide(); + TQDialog::hide(); m_pInformation->setText( "" ); //m_progressStack.clear(); @@ -1723,7 +1706,7 @@ void ProgressDialog::delayedHide() void ProgressDialog::reject() { m_bWasCancelled = true; - QDialog::reject(); + TQDialog::reject(); } void ProgressDialog::slotAbort() @@ -1735,14 +1718,14 @@ bool ProgressDialog::wasCancelled() { if( m_t2.elapsed()>100 ) { - qApp->processEvents(); + tqApp->processEvents(); m_t2.restart(); } return m_bWasCancelled; } -void ProgressDialog::timerEvent(QTimerEvent*) +void ProgressDialog::timerEvent(TQTimerEvent*) { if( !isVisible() ) { @@ -1762,12 +1745,12 @@ ProgressProxy::~ProgressProxy() g_pProgressDialog->pop(false); } -void ProgressProxy::setInformation( const QString& info, bool bRedrawUpdate ) +void ProgressProxy::setInformation( const TQString& info, bool bRedrawUpdate ) { g_pProgressDialog->setInformation( info, bRedrawUpdate ); } -void ProgressProxy::setInformation( const QString& info, double dCurrent, bool bRedrawUpdate ) +void ProgressProxy::setInformation( const TQString& info, double dCurrent, bool bRedrawUpdate ) { g_pProgressDialog->setInformation( info, dCurrent, bRedrawUpdate ); } diff --git a/src/fileaccess.h b/src/fileaccess.h index 77b70bf..787ca65 100644 --- a/src/fileaccess.h +++ b/src/fileaccess.h @@ -11,17 +11,17 @@ #ifndef FILEACCESS_H #define FILEACCESS_H -#include <qdialog.h> -#include <qfileinfo.h> +#include <tqdialog.h> +#include <tqfileinfo.h> #include <kprogress.h> #include <kio/job.h> #include <kio/jobclasses.h> #include <kurldrag.h> #include <list> -#include <qstring.h> -#include <qdatetime.h> +#include <tqstring.h> +#include <tqdatetime.h> -bool wildcardMultiMatch( const QString& wildcard, const QString& testString, bool bCaseSensitive ); +bool wildcardMultiMatch( const TQString& wildcard, const TQString& testString, bool bCaseSensitive ); class t_DirectoryList; @@ -30,8 +30,8 @@ class FileAccess public: FileAccess(); ~FileAccess(); - FileAccess( const QString& name, bool bWantToWrite=false ); // name: local file or dirname or url (when supported) - void setFile( const QString& name, bool bWantToWrite=false ); + FileAccess( const TQString& name, bool bWantToWrite=false ); // name: local file or dirname or url (when supported) + void setFile( const TQString& name, bool bWantToWrite=false ); bool isValid() const; bool isFile() const; @@ -44,43 +44,43 @@ public: bool isWritable() const; bool isExecutable() const; bool isHidden() const; - QString readLink() const; + TQString readLink() const; - QDateTime created() const; - QDateTime lastModified() const; - QDateTime lastRead() const; + TQDateTime created() const; + TQDateTime lastModified() const; + TQDateTime lastRead() const; - QString fileName() const; // Just the name-part of the path, without parent directories - QString filePath() const; // The path-string that was used during construction - QString prettyAbsPath() const; + TQString fileName() const; // Just the name-part of the path, without tqparent directories + TQString filePath() const; // The path-string that was used during construction + TQString prettyAbsPath() const; KURL url() const; - QString absFilePath() const; + TQString absFilePath() const; bool isLocal() const; bool readFile(void* pDestBuffer, unsigned long maxLength ); bool writeFile(const void* pSrcBuffer, unsigned long length ); bool listDir( t_DirectoryList* pDirList, bool bRecursive, bool bFindHidden, - const QString& filePattern, const QString& fileAntiPattern, - const QString& dirAntiPattern, bool bFollowDirLinks, bool bUseCvsIgnore ); - bool copyFile( const QString& destUrl ); - bool createBackup( const QString& bakExtension ); + const TQString& filePattern, const TQString& fileAntiPattern, + const TQString& dirAntiPattern, bool bFollowDirLinks, bool bUseCvsIgnore ); + bool copyFile( const TQString& destUrl ); + bool createBackup( const TQString& bakExtension ); - static QString tempFileName(); - static bool removeTempFile( const QString& ); + static TQString tempFileName(); + static bool removeTempFile( const TQString& ); bool removeFile(); - static bool removeFile( const QString& ); - static bool makeDir( const QString& ); - static bool removeDir( const QString& ); - static bool exists( const QString& ); - static QString cleanDirPath( const QString& ); - - //bool chmod( const QString& ); - bool rename( const QString& ); - static bool symLink( const QString& linkTarget, const QString& linkLocation ); - - void addPath( const QString& txt ); - QString getStatusText(); + static bool removeFile( const TQString& ); + static bool makeDir( const TQString& ); + static bool removeDir( const TQString& ); + static bool exists( const TQString& ); + static TQString cleanDirPath( const TQString& ); + + //bool chmod( const TQString& ); + bool rename( const TQString& ); + static bool symLink( const TQString& linkTarget, const TQString& linkLocation ); + + void addPath( const TQString& txt ); + TQString getStatusText(); private: void setUdsEntry( const KIO::UDSEntry& e ); KURL m_url; @@ -88,9 +88,9 @@ private: bool m_bValidData; unsigned long m_size; - QDateTime m_modificationTime; - QDateTime m_accessTime; - QDateTime m_creationTime; + TQDateTime m_modificationTime; + TQDateTime m_accessTime; + TQDateTime m_creationTime; bool m_bReadable; bool m_bWritable; bool m_bExecutable; @@ -101,14 +101,14 @@ private: bool m_bHidden; long m_fileType; // for testing only - QString m_linkTarget; - QString m_user; - QString m_group; - QString m_name; - QString m_path; - QString m_absFilePath; - QString m_localCopy; - QString m_statusText; // Might contain an error string, when the last operation didn't succeed. + TQString m_linkTarget; + TQString m_user; + TQString m_group; + TQString m_name; + TQString m_path; + TQString m_absFilePath; + TQString m_localCopy; + TQString m_statusText; // Might contain an error string, when the last operation didn't succeed. friend class FileAccessJobHandler; }; @@ -117,24 +117,25 @@ class t_DirectoryList : public std::list<FileAccess> {}; -class FileAccessJobHandler : public QObject +class FileAccessJobHandler : public TQObject { Q_OBJECT + TQ_OBJECT public: FileAccessJobHandler( FileAccess* pFileAccess ); bool get( void* pDestBuffer, long maxLength ); bool put( const void* pSrcBuffer, long maxLength, bool bOverwrite, bool bResume=false, int permissions=-1 ); bool stat(int detailLevel=2, bool bWantToWrite=false ); - bool copyFile( const QString& dest ); - bool rename( const QString& dest ); + bool copyFile( const TQString& dest ); + bool rename( const TQString& dest ); bool listDir( t_DirectoryList* pDirList, bool bRecursive, bool bFindHidden, - const QString& filePattern, const QString& fileAntiPattern, - const QString& dirAntiPattern, bool bFollowDirLinks, bool bUseCvsIgnore ); - bool mkDir( const QString& dirName ); - bool rmDir( const QString& dirName ); - bool removeFile( const QString& dirName ); - bool symLink( const QString& linkTarget, const QString& linkLocation ); + const TQString& filePattern, const TQString& fileAntiPattern, + const TQString& dirAntiPattern, bool bFollowDirLinks, bool bUseCvsIgnore ); + bool mkDir( const TQString& dirName ); + bool rmDir( const TQString& dirName ); + bool removeFile( const TQString& dirName ); + bool symLink( const TQString& linkTarget, const TQString& linkLocation ); private: FileAccess* m_pFileAccess; @@ -145,39 +146,40 @@ private: char* m_pTransferBuffer; // Needed during get or put long m_maxLength; - QString m_filePattern; - QString m_fileAntiPattern; - QString m_dirAntiPattern; + TQString m_filePattern; + TQString m_fileAntiPattern; + TQString m_dirAntiPattern; t_DirectoryList* m_pDirList; bool m_bFindHidden; bool m_bRecursive; bool m_bFollowDirLinks; - bool scanLocalDirectory( const QString& dirName, t_DirectoryList* dirList ); + bool scanLocalDirectory( const TQString& dirName, t_DirectoryList* dirList ); private slots: void slotStatResult( KIO::Job* ); void slotSimpleJobResult( KIO::Job* pJob ); void slotPutJobResult( KIO::Job* pJob ); - void slotGetData(KIO::Job*,const QByteArray&); - void slotPutData(KIO::Job*, QByteArray&); + void slotGetData(KIO::Job*,const TQByteArray&); + void slotPutData(KIO::Job*, TQByteArray&); - void slotListDirInfoMessage( KIO::Job*, const QString& msg ); + void slotListDirInfoMessage( KIO::Job*, const TQString& msg ); void slotListDirProcessNewEntries( KIO::Job *, const KIO::UDSEntryList& l ); void slotPercent( KIO::Job* pJob, unsigned long percent ); }; -class ProgressDialog : public QDialog +class ProgressDialog : public TQDialog { Q_OBJECT + TQ_OBJECT public: - ProgressDialog( QWidget* pParent ); + ProgressDialog( TQWidget* pParent ); void setStayHidden( bool bStayHidden ); - void setInformation( const QString& info, bool bRedrawUpdate=true ); - void setInformation( const QString& info, double dCurrent, bool bRedrawUpdate=true ); + void setInformation( const TQString& info, bool bRedrawUpdate=true ); + void setInformation( const TQString& info, double dCurrent, bool bRedrawUpdate=true ); void setCurrent( double dCurrent, bool bRedrawUpdate=true ); void step( bool bRedrawUpdate=true ); void setMaxNofSteps( int dMaxNofSteps ); @@ -192,13 +194,13 @@ public: void setSubRangeTransformation( double dMin, double dMax ); void exitEventLoop(); - void enterEventLoop( KIO::Job* pJob, const QString& jobInfo ); + void enterEventLoop( KIO::Job* pJob, const TQString& jobInfo ); bool wasCancelled(); void show(); void hide(); - virtual void timerEvent(QTimerEvent*); + virtual void timerEvent(TQTimerEvent*); private: struct ProgressLevelData @@ -221,16 +223,16 @@ private: KProgress* m_pProgressBar; KProgress* m_pSubProgressBar; - QLabel* m_pInformation; - QLabel* m_pSubInformation; - QLabel* m_pSlowJobInfo; - QPushButton* m_pAbortButton; + TQLabel* m_pInformation; + TQLabel* m_pSubInformation; + TQLabel* m_pSlowJobInfo; + TQPushButton* m_pAbortButton; void recalc(bool bRedrawUpdate); - QTime m_t1; - QTime m_t2; + TQTime m_t1; + TQTime m_t2; bool m_bWasCancelled; KIO::Job* m_pJob; - QString m_currentJobInfo; // Needed if the job doesn't stop after a reasonable time. + TQString m_currentJobInfo; // Needed if the job doesn't stop after a reasonable time. bool m_bStayHidden; protected: virtual void reject(); @@ -246,8 +248,8 @@ public: ProgressProxy(); ~ProgressProxy(); - void setInformation( const QString& info, bool bRedrawUpdate=true ); - void setInformation( const QString& info, double dCurrent, bool bRedrawUpdate=true ); + void setInformation( const TQString& info, bool bRedrawUpdate=true ); + void setInformation( const TQString& info, double dCurrent, bool bRedrawUpdate=true ); void setCurrent( double dCurrent, bool bRedrawUpdate=true ); void step( bool bRedrawUpdate=true ); void setMaxNofSteps( int dMaxNofSteps ); diff --git a/src/gnudiff_analyze.cpp b/src/gnudiff_analyze.cpp index ea49b4e..565cf32 100644 --- a/src/gnudiff_analyze.cpp +++ b/src/gnudiff_analyze.cpp @@ -535,7 +535,7 @@ void GnuDiff::discard_confusing_lines (struct file_data filevec[]) discards[i + j] = 0; /* Scan from beginning of run - until we find 3 or more nonprovisionals in a row + until we tqfind 3 or more nonprovisionals in a row or until the first nonprovisional at least 8 lines in. Until that point, cancel any provisionals. */ for (j = 0, consec = 0; j < length; j++) diff --git a/src/gnudiff_diff.h b/src/gnudiff_diff.h index 930424e..1d54b7d 100644 --- a/src/gnudiff_diff.h +++ b/src/gnudiff_diff.h @@ -27,14 +27,14 @@ #include "gnudiff_system.h" #include <stdio.h> -#include <qstring.h> +#include <tqstring.h> #define TAB_WIDTH 8 class GnuDiff { public: -/* What kind of changes a hunk contains. */ +/* What kind of changes a hunk tqcontains. */ enum changes { /* No changes: lines common to both files. */ @@ -110,23 +110,23 @@ bool brief; bool expand_tabs; /* Use a tab in the output, rather than a space, before the text of an - input line, so as to keep the proper alignment in the input line + input line, so as to keep the proper tqalignment in the input line without changing the characters in it (-T). */ bool initial_tab; /* In directory comparison, specify file to start with (-S). This is used for resuming an aborted comparison. All file names less than this name are ignored. */ -const QChar *starting_file; +const TQChar *starting_file; /* Pipe each file's output through pr (-l). */ bool paginate; /* Line group formats for unchanged, old, new, and changed groups. */ -const QChar *group_format[CHANGED + 1]; +const TQChar *group_format[CHANGED + 1]; /* Line formats for unchanged, old, and new lines. */ -const QChar *line_format[NEW + 1]; +const TQChar *line_format[NEW + 1]; /* If using OUTPUT_SDIFF print extra information to help the sdiff filter. */ bool sdiff_merge_assist; @@ -180,9 +180,9 @@ struct change struct file_data { /* Buffer in which text of file is read. */ - const QChar* buffer; + const TQChar* buffer; - /* Allocated size of buffer, in QChars. Always a multiple of + /* Allocated size of buffer, in TQChars. Always a multiple of sizeof *buffer. */ size_t bufsize; @@ -190,7 +190,7 @@ struct file_data { size_t buffered; /* Array of pointers to lines in the file. */ - const QChar **linbuf; + const TQChar **linbuf; /* linbuf_base <= buffered_lines <= valid_lines <= alloc_lines. linebuf[linbuf_base ... buffered_lines - 1] are possibly differing. @@ -199,14 +199,14 @@ struct file_data { lin linbuf_base, buffered_lines, valid_lines, alloc_lines; /* Pointer to end of prefix of this file to ignore when hashing. */ - const QChar *prefix_end; + const TQChar *prefix_end; /* Count of lines in the prefix. There are this many lines in the file before linbuf[0]. */ lin prefix_lines; /* Pointer to start of suffix of this file to ignore when hashing. */ - const QChar *suffix_begin; + const TQChar *suffix_begin; /* Vector, indexed by line number, containing an equivalence code for each line. It is this vector that is actually compared with that @@ -242,7 +242,7 @@ struct file_data { struct comparison { struct file_data file[2]; - struct comparison const *parent; /* parent, if a recursive comparison */ + struct comparison const *tqparent; /* tqparent, if a recursive comparison */ }; /* Describe the two files currently being compared. */ @@ -263,7 +263,7 @@ void print_context_header (struct file_data[], bool); void print_context_script (struct change *, bool); /* dir.c */ -int diff_dirs (struct comparison const *, int (*) (struct comparison const *, const QChar *, const QChar *)); +int diff_dirs (struct comparison const *, int (*) (struct comparison const *, const TQChar *, const TQChar *)); /* ed.c */ void print_ed_script (struct change *); @@ -286,8 +286,8 @@ void print_rcs_script (struct change *); void print_sdiff_script (struct change *); /* util.c */ -QChar *concat (const QChar *, const QChar *, const QChar *); -bool lines_differ ( const QChar *, size_t, const QChar *, size_t ); +TQChar *concat (const TQChar *, const TQChar *, const TQChar *); +bool lines_differ ( const TQChar *, size_t, const TQChar *, size_t ); lin translate_line_number (struct file_data const *, lin); struct change *find_change (struct change *); struct change *find_reverse_change (struct change *); @@ -296,15 +296,15 @@ enum changes analyze_hunk (struct change *, lin *, lin *, lin *, lin *); void begin_output (void); void debug_script (struct change *); void finish_output (void); -void message (const QChar *, const QChar *, const QChar *); -void message5 (const QChar *, const QChar *, const QChar *, const QChar *, const QChar *); -void output_1_line (const QChar *, const QChar *, const QChar *, const QChar *); -void perror_with_name (const QChar *); -void setup_output (const QChar *, const QChar *, bool); +void message (const TQChar *, const TQChar *, const TQChar *); +void message5 (const TQChar *, const TQChar *, const TQChar *, const TQChar *, const TQChar *); +void output_1_line (const TQChar *, const TQChar *, const TQChar *, const TQChar *); +void perror_with_name (const TQChar *); +void setup_output (const TQChar *, const TQChar *, bool); void translate_range (struct file_data const *, lin, lin, long *, long *); /* version.c */ -//extern const QChar version_string[]; +//extern const TQChar version_string[]; private: // gnudiff_analyze.cpp @@ -325,7 +325,7 @@ private: void *xrealloc(void *p, size_t n); void xalloc_die (void); - inline bool isWhite( QChar c ) + inline bool isWhite( TQChar c ) { return c==' ' || c=='\t' || c=='\r'; } diff --git a/src/gnudiff_io.cpp b/src/gnudiff_io.cpp index 922bce7..4241d36 100644 --- a/src/gnudiff_io.cpp +++ b/src/gnudiff_io.cpp @@ -42,7 +42,7 @@ struct equivclass { lin next; /* Next item in this bucket. */ hash_value hash; /* Hash of lines in this class. */ - const QChar *line; /* A line that fits this class. */ + const TQChar *line; /* A line that fits this class. */ size_t length; /* That line's length, not counting its newline. */ }; @@ -78,12 +78,12 @@ static lin equivs_alloc; but an option like -i might cause us to ignore the difference. Return nonzero if the lines differ. */ -bool GnuDiff::lines_differ (const QChar *s1, size_t len1, const QChar *s2, size_t len2 ) +bool GnuDiff::lines_differ (const TQChar *s1, size_t len1, const TQChar *s2, size_t len2 ) { - const QChar *t1 = s1; - const QChar *t2 = s2; - const QChar *s1end = s1+len1; - const QChar *s2end = s2+len2; + const TQChar *t1 = s1; + const TQChar *t2 = s2; + const TQChar *s1end = s1+len1; + const TQChar *s2end = s2+len2; for ( ; ; ++t1, ++t2 ) { @@ -134,13 +134,13 @@ bool GnuDiff::lines_differ (const QChar *s1, size_t len1, const QChar *s2, size_ void GnuDiff::find_and_hash_each_line (struct file_data *current) { hash_value h; - const QChar *p = current->prefix_end; - QChar c; + const TQChar *p = current->prefix_end; + TQChar c; lin i, *bucket; size_t length; /* Cache often-used quantities in local variables to help the compiler. */ - const QChar **linbuf = current->linbuf; + const TQChar **linbuf = current->linbuf; lin alloc_lines = current->alloc_lines; lin line = 0; lin linbuf_base = current->linbuf_base; @@ -148,8 +148,8 @@ void GnuDiff::find_and_hash_each_line (struct file_data *current) struct equivclass *eqs = equivs; lin eqs_index = equivs_index; lin eqs_alloc = equivs_alloc; - const QChar *suffix_begin = current->suffix_begin; - const QChar *bufend = current->buffer + current->buffered; + const TQChar *suffix_begin = current->suffix_begin; + const TQChar *bufend = current->buffer + current->buffered; bool diff_length_compare_anyway = ignore_white_space != IGNORE_NO_WHITE_SPACE || bIgnoreNumbers; bool same_length_diff_contents_compare_anyway = @@ -157,7 +157,7 @@ void GnuDiff::find_and_hash_each_line (struct file_data *current) while ( p < suffix_begin) { - const QChar *ip = p; + const TQChar *ip = p; h = 0; @@ -169,7 +169,7 @@ void GnuDiff::find_and_hash_each_line (struct file_data *current) while ( p<bufend && (c = *p) != '\n' ) { if (! (isWhite(c) || bIgnoreNumbers && (c.isDigit() || c=='-' || c=='.' ) )) - h = HASH (h, c.lower().unicode()); + h = HASH (h, c.lower().tqunicode()); ++p; } break; @@ -177,7 +177,7 @@ void GnuDiff::find_and_hash_each_line (struct file_data *current) default: while ( p<bufend && (c = *p) != '\n' ) { - h = HASH (h, c.lower().unicode()); + h = HASH (h, c.lower().tqunicode()); ++p; } break; @@ -189,7 +189,7 @@ void GnuDiff::find_and_hash_each_line (struct file_data *current) while ( p<bufend && (c = *p) != '\n') { if (! (isWhite(c)|| bIgnoreNumbers && (c.isDigit() || c=='-' || c=='.' ) )) - h = HASH (h, c.unicode()); + h = HASH (h, c.tqunicode()); ++p; } break; @@ -197,7 +197,7 @@ void GnuDiff::find_and_hash_each_line (struct file_data *current) default: while ( p<bufend && (c = *p) != '\n') { - h = HASH (h, c.unicode()); + h = HASH (h, c.tqunicode()); ++p; } break; @@ -228,7 +228,7 @@ void GnuDiff::find_and_hash_each_line (struct file_data *current) } else if (eqs[i].hash == h) { - const QChar *eqline = eqs[i].line; + const TQChar *eqline = eqs[i].line; /* Reuse existing class if lines_differ reports the lines equal. */ @@ -237,7 +237,7 @@ void GnuDiff::find_and_hash_each_line (struct file_data *current) /* Reuse existing equivalence class if the lines are identical. This detects the common case of exact identity faster than lines_differ would. */ - if (memcmp (eqline, ip, length*sizeof(QChar)) == 0) + if (memcmp (eqline, ip, length*sizeof(TQChar)) == 0) break; if (!same_length_diff_contents_compare_anyway) continue; @@ -260,7 +260,7 @@ void GnuDiff::find_and_hash_each_line (struct file_data *current) alloc_lines = 2 * alloc_lines - linbuf_base; cureqs =(lin*) xrealloc (cureqs, alloc_lines * sizeof *cureqs); linbuf += linbuf_base; - linbuf = (const QChar**) xrealloc (linbuf, + linbuf = (const TQChar**) xrealloc (linbuf, (alloc_lines - linbuf_base) * sizeof *linbuf); linbuf -= linbuf_base; } @@ -285,7 +285,7 @@ void GnuDiff::find_and_hash_each_line (struct file_data *current) xalloc_die (); alloc_lines = 2 * alloc_lines - linbuf_base; linbuf += linbuf_base; - linbuf = (const QChar**)xrealloc (linbuf, + linbuf = (const TQChar**)xrealloc (linbuf, (alloc_lines - linbuf_base) * sizeof *linbuf); linbuf -= linbuf_base; } @@ -322,7 +322,7 @@ guess_lines (lin n, size_t s, size_t t) { size_t guessed_bytes_per_line = n < 10 ? 32 : s / (n - 1); lin guessed_lines = MAX (1, t / guessed_bytes_per_line); - return MIN (guessed_lines, (lin)(PTRDIFF_MAX / (2 * sizeof (QChar *) + 1) - 5)) + 5; + return MIN (guessed_lines, (lin)(PTRDIFF_MAX / (2 * sizeof (TQChar *) + 1) - 5)) + 5; } /* Given a vector of two file_data objects, find the identical @@ -331,14 +331,14 @@ guess_lines (lin n, size_t s, size_t t) void GnuDiff::find_identical_ends (struct file_data filevec[]) { /* Find identical prefix. */ - const QChar *p0, *p1, *buffer0, *buffer1; + const TQChar *p0, *p1, *buffer0, *buffer1; p0 = buffer0 = filevec[0].buffer; p1 = buffer1 = filevec[1].buffer; size_t n0, n1; n0 = filevec[0].buffered; n1 = filevec[1].buffered; - const QChar* const pEnd0 = p0 + n0; - const QChar* const pEnd1 = p1 + n1; + const TQChar* const pEnd0 = p0 + n0; + const TQChar* const pEnd1 = p1 + n1; if (p0 == p1) /* The buffers are the same; sentinels won't work. */ @@ -369,7 +369,7 @@ void GnuDiff::find_identical_ends (struct file_data filevec[]) p0 = buffer0 + n0; p1 = buffer1 + n1; - const QChar *end0, *beg0; + const TQChar *end0, *beg0; end0 = p0; /* Addr of last char in file 0. */ /* Get value of P0 at which we should stop scanning backward: @@ -417,9 +417,9 @@ void GnuDiff::find_identical_ends (struct file_data filevec[]) Handle 1 more line than the context says (because we count 1 too many), rounded up to the next power of 2 to speed index computation. */ - const QChar **linbuf0, **linbuf1; + const TQChar **linbuf0, **linbuf1; lin alloc_lines0, alloc_lines1; - lin buffered_prefix, prefix_count, prefix_mask; + lin buffered_prefix, prefix_count, prefix_tqmask; lin middle_guess, suffix_guess; if (no_diff_means_no_output && context < (lin)(LIN_MAX / 4) && context < (lin)(n0)) @@ -437,9 +437,9 @@ void GnuDiff::find_identical_ends (struct file_data filevec[]) alloc_lines0 = guess_lines (0, 0, n0); } - prefix_mask = prefix_count - 1; + prefix_tqmask = prefix_count - 1; lin lines = 0; - linbuf0 = (const QChar**) xmalloc (alloc_lines0 * sizeof(*linbuf0)); + linbuf0 = (const TQChar**) xmalloc (alloc_lines0 * sizeof(*linbuf0)); p0 = buffer0; /* If the prefix is needed, find the prefix lines. */ @@ -450,13 +450,13 @@ void GnuDiff::find_identical_ends (struct file_data filevec[]) end0 = filevec[0].prefix_end; while (p0 != end0) { - lin l = lines++ & prefix_mask; + lin l = lines++ & prefix_tqmask; if (l == alloc_lines0) { if ((lin)(PTRDIFF_MAX / (2 * sizeof *linbuf0)) <= alloc_lines0) xalloc_die (); alloc_lines0 *= 2; - linbuf0 = (const QChar**) xrealloc (linbuf0, alloc_lines0 * sizeof(*linbuf0)); + linbuf0 = (const TQChar**) xrealloc (linbuf0, alloc_lines0 * sizeof(*linbuf0)); } linbuf0[l] = p0; while ( p0<pEnd0 && *p0++ != '\n' ) @@ -473,14 +473,14 @@ void GnuDiff::find_identical_ends (struct file_data filevec[]) if (alloc_lines1 < buffered_prefix || (lin)(PTRDIFF_MAX / sizeof *linbuf1) <= alloc_lines1) xalloc_die (); - linbuf1 = (const QChar**)xmalloc (alloc_lines1 * sizeof(*linbuf1)); + linbuf1 = (const TQChar**)xmalloc (alloc_lines1 * sizeof(*linbuf1)); lin i; if (buffered_prefix != lines) { /* Rotate prefix lines to proper location. */ for (i = 0; i < buffered_prefix; i++) - linbuf1[i] = linbuf0[(lines - context + i) & prefix_mask]; + linbuf1[i] = linbuf0[(lines - context + i) & prefix_tqmask]; for (i = 0; i < buffered_prefix; i++) linbuf0[i] = linbuf1[i]; } diff --git a/src/kdiff3.cpp b/src/kdiff3.cpp index 5bc2102..6c5a300 100644 --- a/src/kdiff3.cpp +++ b/src/kdiff3.cpp @@ -21,18 +21,18 @@ #include <iostream> // include files for QT -#include <qdir.h> -#include <qprinter.h> -#include <qpainter.h> -#include <qsplitter.h> -#include <qlineedit.h> -#include <qcheckbox.h> -#include <qpushbutton.h> -#include <qpopupmenu.h> -#include <qlabel.h> -#include <qtextedit.h> -#include <qlayout.h> -#include <qpaintdevicemetrics.h> +#include <tqdir.h> +#include <tqprinter.h> +#include <tqpainter.h> +#include <tqsplitter.h> +#include <tqlineedit.h> +#include <tqcheckbox.h> +#include <tqpushbutton.h> +#include <tqpopupmenu.h> +#include <tqlabel.h> +#include <tqtextedit.h> +#include <tqlayout.h> +#include <tqpaintdevicemetrics.h> // include files for KDE #include <kiconloader.h> @@ -91,8 +91,8 @@ bool KDiff3App::isFileSaved() return m_bFileSaved; } -KDiff3App::KDiff3App(QWidget* pParent, const char* name, KDiff3Part* pKDiff3Part ) - :QSplitter(pParent, name) //previously KMainWindow +KDiff3App::KDiff3App(TQWidget* pParent, const char* name, KDiff3Part* pKDiff3Part ) + :TQSplitter(pParent, name) //previously KMainWindow { m_pKDiff3Part = pKDiff3Part; m_pKDiff3Shell = dynamic_cast<KParts::MainWindow*>(pParent); @@ -128,17 +128,17 @@ KDiff3App::KDiff3App(QWidget* pParent, const char* name, KDiff3Part* pKDiff3Part // All default values must be set before calling readOptions(). m_pOptionDialog = new OptionDialog( m_pKDiff3Shell!=0, this ); - connect( m_pOptionDialog, SIGNAL(applyClicked()), this, SLOT(slotRefresh()) ); + connect( m_pOptionDialog, TQT_SIGNAL(applyClicked()), TQT_TQOBJECT(this), TQT_SLOT(slotRefresh()) ); m_pOptionDialog->readOptions( isPart() ? m_pKDiff3Part->instance()->config() : kapp->config() ); - // Option handling: Only when pParent==0 (no parent) + // Option handling: Only when pParent==0 (no tqparent) KCmdLineArgs *args = isPart() ? 0 : KCmdLineArgs::parsedArgs(); if (args) { - QString s; - QString title; + TQString s; + TQString title; if ( args->isSet("confighelp") ) { s = m_pOptionDialog->calcOptionHelp(); @@ -154,13 +154,13 @@ KDiff3App::KDiff3App(QWidget* pParent, const char* name, KDiff3Part* pKDiff3Part #ifdef _WIN32 // A windows program has no console //KMessageBox::information(0, s,i18n("KDiff3-Usage")); - QDialog* pDialog = new QDialog(this,"",true,Qt::WDestructiveClose); + TQDialog* pDialog = new TQDialog(this,"",true,TQt::WDestructiveClose); pDialog->setCaption(title); - QVBoxLayout* pVBoxLayout = new QVBoxLayout( pDialog ); - QTextEdit* pTextEdit = new QTextEdit(pDialog); + TQVBoxLayout* pVBoxLayout = new TQVBoxLayout( pDialog ); + TQTextEdit* pTextEdit = new TQTextEdit(pDialog); pTextEdit->setText(s); pTextEdit->setReadOnly(true); - pTextEdit->setWordWrap(QTextEdit::NoWrap); + pTextEdit->setWordWrap(TQTextEdit::NoWrap); pVBoxLayout->addWidget(pTextEdit); pDialog->resize(600,400); pDialog->exec(); @@ -225,15 +225,15 @@ KDiff3App::KDiff3App(QWidget* pParent, const char* name, KDiff3Part* pKDiff3Part QCStringList aliasList = args->getOptionList("fname"); QCStringList::Iterator ali = aliasList.begin(); - QString an1 = args->getOption("L1"); + TQString an1 = args->getOption("L1"); if ( !an1.isEmpty() ) { m_sd1.setAliasName(an1); } else if ( ali != aliasList.end() ) { m_sd1.setAliasName(*ali); ++ali; } - QString an2 = args->getOption("L2"); + TQString an2 = args->getOption("L2"); if ( !an2.isEmpty() ) { m_sd2.setAliasName(an2); } else if ( ali != aliasList.end() ) { m_sd2.setAliasName(*ali); ++ali; } - QString an3 = args->getOption("L3"); + TQString an3 = args->getOption("L3"); if ( !an3.isEmpty() ) { m_sd3.setAliasName(an3); } else if ( ali != aliasList.end() ) { m_sd3.setAliasName(*ali); ++ali; } } @@ -243,7 +243,7 @@ KDiff3App::KDiff3App(QWidget* pParent, const char* name, KDiff3Part* pKDiff3Part initStatusBar(); m_pFindDialog = new FindDialog( this ); - connect( m_pFindDialog, SIGNAL(findNext()), this, SLOT(slotEditFindNext())); + connect( m_pFindDialog, TQT_SIGNAL(findNext()), TQT_TQOBJECT(this), TQT_SLOT(slotEditFindNext())); autoAdvance->setChecked( m_pOptionDialog->m_bAutoAdvance ); showWhiteSpaceCharacters->setChecked( m_pOptionDialog->m_bShowWhiteSpaceCharacters ); @@ -259,36 +259,36 @@ KDiff3App::KDiff3App(QWidget* pParent, const char* name, KDiff3Part* pKDiff3Part slotViewStatusBar(); if( toolBar("mainToolBar")!=0 ) toolBar("mainToolBar")->setBarPos( (KToolBar::BarPosition) m_pOptionDialog->m_toolBarPos ); -/* QSize size = m_pOptionDialog->m_geometry; - QPoint pos = m_pOptionDialog->m_position; +/* TQSize size = m_pOptionDialog->m_tqgeometry; + TQPoint pos = m_pOptionDialog->m_position; if(!size.isEmpty()) { m_pKDiff3Shell->resize( size ); - QRect visibleRect = QRect( pos, size ) & QApplication::desktop()->rect(); + TQRect visibleRect = TQRect( pos, size ) & TQApplication::desktop()->rect(); if ( visibleRect.width()>100 && visibleRect.height()>100 ) m_pKDiff3Shell->move( pos ); }*/ } slotRefresh(); - m_pMainSplitter = this; //new QSplitter(this); - m_pMainSplitter->setOrientation( Vertical ); + m_pMainSplitter = this; //new TQSplitter(this); + m_pMainSplitter->setOrientation(Qt::Vertical ); // setCentralWidget( m_pMainSplitter ); - m_pDirectoryMergeSplitter = new QSplitter( m_pMainSplitter ); - m_pDirectoryMergeSplitter->setOrientation( Horizontal ); + m_pDirectoryMergeSplitter = new TQSplitter( m_pMainSplitter ); + m_pDirectoryMergeSplitter->setOrientation(Qt::Horizontal ); m_pDirectoryMergeWindow = new DirectoryMergeWindow( m_pDirectoryMergeSplitter, m_pOptionDialog, KApplication::kApplication()->iconLoader() ); m_pDirectoryMergeInfo = new DirectoryMergeInfo( m_pDirectoryMergeSplitter ); m_pDirectoryMergeWindow->setDirectoryMergeInfo( m_pDirectoryMergeInfo ); - connect( m_pDirectoryMergeWindow, SIGNAL(startDiffMerge(QString,QString,QString,QString,QString,QString,QString,TotalDiffStatus*)), - this, SLOT( slotFileOpen2(QString,QString,QString,QString,QString,QString,QString,TotalDiffStatus*))); - connect( m_pDirectoryMergeWindow, SIGNAL(selectionChanged()), this, SLOT(slotUpdateAvailabilities())); - connect( m_pDirectoryMergeWindow, SIGNAL(currentChanged(QListViewItem*)), this, SLOT(slotUpdateAvailabilities())); - connect( m_pDirectoryMergeWindow, SIGNAL(checkIfCanContinue(bool*)), this, SLOT(slotCheckIfCanContinue(bool*))); - connect( m_pDirectoryMergeWindow, SIGNAL(updateAvailabilities()), this, SLOT(slotUpdateAvailabilities())); - connect( m_pDirectoryMergeWindow, SIGNAL(statusBarMessage(const QString&)), this, SLOT(slotStatusMsg(const QString&))); + connect( m_pDirectoryMergeWindow, TQT_SIGNAL(startDiffMerge(TQString,TQString,TQString,TQString,TQString,TQString,TQString,TotalDifftqStatus*)), + TQT_TQOBJECT(this), TQT_SLOT( slotFileOpen2(TQString,TQString,TQString,TQString,TQString,TQString,TQString,TotalDifftqStatus*))); + connect( m_pDirectoryMergeWindow, TQT_SIGNAL(selectionChanged()), TQT_TQOBJECT(this), TQT_SLOT(slotUpdateAvailabilities())); + connect( m_pDirectoryMergeWindow, TQT_SIGNAL(currentChanged(TQListViewItem*)), TQT_TQOBJECT(this), TQT_SLOT(slotUpdateAvailabilities())); + connect( m_pDirectoryMergeWindow, TQT_SIGNAL(checkIfCanContinue(bool*)), TQT_TQOBJECT(this), TQT_SLOT(slotCheckIfCanContinue(bool*))); + connect( m_pDirectoryMergeWindow, TQT_SIGNAL(updateAvailabilities()), TQT_TQOBJECT(this), TQT_SLOT(slotUpdateAvailabilities())); + connect( m_pDirectoryMergeWindow, TQT_SIGNAL(statusBarMessage(const TQString&)), TQT_TQOBJECT(this), TQT_SLOT(slotStatusMsg(const TQString&))); - m_pDirectoryMergeWindow->initDirectoryMergeActions( this, actionCollection() ); + m_pDirectoryMergeWindow->initDirectoryMergeActions( TQT_TQOBJECT(this), actionCollection() ); if ( args!=0 ) args->clear(); // Free up some memory. @@ -299,16 +299,16 @@ KDiff3App::KDiff3App(QWidget* pParent, const char* name, KDiff3Part* pKDiff3Part } -void KDiff3App::completeInit( const QString& fn1, const QString& fn2, const QString& fn3 ) +void KDiff3App::completeInit( const TQString& fn1, const TQString& fn2, const TQString& fn3 ) { if (m_pKDiff3Shell!=0) { - QSize size=m_pOptionDialog->m_geometry; - QPoint pos=m_pOptionDialog->m_position; + TQSize size=m_pOptionDialog->m_tqgeometry; + TQPoint pos=m_pOptionDialog->m_position; if(!size.isEmpty()) { m_pKDiff3Shell->resize( size ); - QRect visibleRect = QRect( pos, size ) & QApplication::desktop()->rect(); + TQRect visibleRect = TQRect( pos, size ) & TQApplication::desktop()->rect(); if ( visibleRect.width()>100 && visibleRect.height()>100 ) m_pKDiff3Shell->move( pos ); if (!m_bAutoMode) @@ -341,13 +341,13 @@ void KDiff3App::completeInit( const QString& fn1, const QString& fn2, const QStr SourceData* pSD=0; if ( m_sd3.isEmpty() ) { - if ( m_totalDiffStatus.bBinaryAEqB ){ pSD = &m_sd1; } + if ( m_totalDifftqStatus.bBinaryAEqB ){ pSD = &m_sd1; } } else { - if ( m_totalDiffStatus.bBinaryBEqC ){ pSD = &m_sd3; } // B==C (assume A is old) - else if ( m_totalDiffStatus.bBinaryAEqB ){ pSD = &m_sd3; } // assuming C has changed - else if ( m_totalDiffStatus.bBinaryAEqC ){ pSD = &m_sd2; } // assuming B has changed + if ( m_totalDifftqStatus.bBinaryBEqC ){ pSD = &m_sd3; } // B==C (assume A is old) + else if ( m_totalDifftqStatus.bBinaryAEqB ){ pSD = &m_sd3; } // assuming C has changed + else if ( m_totalDifftqStatus.bBinaryAEqC ){ pSD = &m_sd2; } // assuming B has changed } if ( pSD!=0 ) @@ -357,7 +357,7 @@ void KDiff3App::completeInit( const QString& fn1, const QString& fn2, const QStr FileAccess fa( m_outputFilename ); if ( m_pOptionDialog->m_bDmCreateBakFiles && fa.exists() ) { - QString newName = m_outputFilename + ".orig"; + TQString newName = m_outputFilename + ".orig"; if ( FileAccess::exists( newName ) ) FileAccess::removeFile( newName ); if ( !FileAccess::exists( newName ) ) fa.rename( newName ); } @@ -399,7 +399,7 @@ void KDiff3App::completeInit( const QString& fn1, const QString& fn2, const QStr ! m_sd2.isEmpty() && !m_sd2.hasData() || ! m_sd3.isEmpty() && !m_sd3.hasData() ) { - QString text( i18n("Opening of these files failed:") ); + TQString text( i18n("Opening of these files failed:") ); text += "\n\n"; if ( ! m_sd1.isEmpty() && !m_sd1.hasData() ) text += " - " + m_sd1.getAliasName() + "\n"; @@ -430,37 +430,37 @@ void KDiff3App::initActions( KActionCollection* ac ) { if (ac==0) KMessageBox::error(0, "actionCollection==0"); - fileOpen = KStdAction::open(this, SLOT(slotFileOpen()), ac); + fileOpen = KStdAction::open(TQT_TQOBJECT(this), TQT_SLOT(slotFileOpen()), ac); fileOpen->setStatusText(i18n("Opens documents for comparison...")); - fileReload = new KAction(i18n("Reload"), /*QIconSet(QPixmap(reloadIcon)),*/ Key_F5, this, SLOT(slotReload()), ac, "file_reload"); + fileReload = new KAction(i18n("Reload"), /*TQIconSet(TQPixmap(reloadIcon)),*/ Key_F5, TQT_TQOBJECT(this), TQT_SLOT(slotReload()), ac, "file_reload"); - fileSave = KStdAction::save(this, SLOT(slotFileSave()), ac); + fileSave = KStdAction::save(TQT_TQOBJECT(this), TQT_SLOT(slotFileSave()), ac); fileSave->setStatusText(i18n("Saves the merge result. All conflicts must be solved!")); - fileSaveAs = KStdAction::saveAs(this, SLOT(slotFileSaveAs()), ac); + fileSaveAs = KStdAction::saveAs(TQT_TQOBJECT(this), TQT_SLOT(slotFileSaveAs()), ac); fileSaveAs->setStatusText(i18n("Saves the current document as...")); - filePrint = KStdAction::print(this, SLOT(slotFilePrint()), ac); + filePrint = KStdAction::print(TQT_TQOBJECT(this), TQT_SLOT(slotFilePrint()), ac); filePrint->setStatusText(i18n("Print the differences")); - fileQuit = KStdAction::quit(this, SLOT(slotFileQuit()), ac); + fileQuit = KStdAction::quit(TQT_TQOBJECT(this), TQT_SLOT(slotFileQuit()), ac); fileQuit->setStatusText(i18n("Quits the application")); - editCut = KStdAction::cut(this, SLOT(slotEditCut()), ac); + editCut = KStdAction::cut(TQT_TQOBJECT(this), TQT_SLOT(slotEditCut()), ac); editCut->setStatusText(i18n("Cuts the selected section and puts it to the clipboard")); - editCopy = KStdAction::copy(this, SLOT(slotEditCopy()), ac); + editCopy = KStdAction::copy(TQT_TQOBJECT(this), TQT_SLOT(slotEditCopy()), ac); editCopy->setStatusText(i18n("Copies the selected section to the clipboard")); - editPaste = KStdAction::paste(this, SLOT(slotEditPaste()), ac); + editPaste = KStdAction::paste(TQT_TQOBJECT(this), TQT_SLOT(slotEditPaste()), ac); editPaste->setStatusText(i18n("Pastes the clipboard contents to actual position")); - editSelectAll = KStdAction::selectAll(this, SLOT(slotEditSelectAll()), ac); + editSelectAll = KStdAction::selectAll(TQT_TQOBJECT(this), TQT_SLOT(slotEditSelectAll()), ac); editSelectAll->setStatusText(i18n("Select everything in current window")); - editFind = KStdAction::find(this, SLOT(slotEditFind()), ac); + editFind = KStdAction::find(TQT_TQOBJECT(this), TQT_SLOT(slotEditFind()), ac); editFind->setStatusText(i18n("Search for a string")); - editFindNext = KStdAction::findNext(this, SLOT(slotEditFindNext()), ac); + editFindNext = KStdAction::findNext(TQT_TQOBJECT(this), TQT_SLOT(slotEditFindNext()), ac); editFindNext->setStatusText(i18n("Search again for the string")); - viewToolBar = KStdAction::showToolbar(this, SLOT(slotViewToolBar()), ac); + viewToolBar = KStdAction::showToolbar(TQT_TQOBJECT(this), TQT_SLOT(slotViewToolBar()), ac); viewToolBar->setStatusText(i18n("Enables/disables the toolbar")); - viewStatusBar = KStdAction::showStatusbar(this, SLOT(slotViewStatusBar()), ac); + viewStatusBar = KStdAction::showStatusbar(TQT_TQOBJECT(this), TQT_SLOT(slotViewStatusBar()), ac); viewStatusBar->setStatusText(i18n("Enables/disables the statusbar")); - KStdAction::keyBindings(this, SLOT(slotConfigureKeys()), ac); - KAction* pAction = KStdAction::preferences(this, SLOT(slotConfigure()), ac ); + KStdAction::keyBindings(TQT_TQOBJECT(this), TQT_SLOT(slotConfigureKeys()), ac); + KAction* pAction = KStdAction::preferences(TQT_TQOBJECT(this), TQT_SLOT(slotConfigure()), ac ); if ( isPart() ) pAction->setText(i18n("Configure KDiff3...")); @@ -483,79 +483,79 @@ void KDiff3App::initActions( KActionCollection* ac ) #include "xpm/showlinenumbers.xpm" //#include "reload.xpm" - goCurrent = new KAction(i18n("Go to Current Delta"), QIconSet(QPixmap(currentpos)), CTRL+Key_Space, this, SLOT(slotGoCurrent()), ac, "go_current"); - goTop = new KAction(i18n("Go to First Delta"), QIconSet(QPixmap(upend)), 0, this, SLOT(slotGoTop()), ac, "go_top"); - goBottom = new KAction(i18n("Go to Last Delta"), QIconSet(QPixmap(downend)), 0, this, SLOT(slotGoBottom()), ac, "go_bottom"); - QString omitsWhitespace = ".\n" + i18n("(Skips white space differences when \"Show White Space\" is disabled.)"); - QString includeWhitespace = ".\n" + i18n("(Does not skip white space differences even when \"Show White Space\" is disabled.)"); - goPrevDelta = new KAction(i18n("Go to Previous Delta"), QIconSet(QPixmap(up1arrow)), CTRL+Key_Up, this, SLOT(slotGoPrevDelta()), ac, "go_prev_delta"); + goCurrent = new KAction(i18n("Go to Current Delta"), TQIconSet(TQPixmap(currentpos)), CTRL+Key_Space, TQT_TQOBJECT(this), TQT_SLOT(slotGoCurrent()), ac, "go_current"); + goTop = new KAction(i18n("Go to First Delta"), TQIconSet(TQPixmap(upend)), 0, TQT_TQOBJECT(this), TQT_SLOT(slotGoTop()), ac, "go_top"); + goBottom = new KAction(i18n("Go to Last Delta"), TQIconSet(TQPixmap(downend)), 0, TQT_TQOBJECT(this), TQT_SLOT(slotGoBottom()), ac, "go_bottom"); + TQString omitsWhitespace = ".\n" + i18n("(Skips white space differences when \"Show White Space\" is disabled.)"); + TQString includeWhitespace = ".\n" + i18n("(Does not skip white space differences even when \"Show White Space\" is disabled.)"); + goPrevDelta = new KAction(i18n("Go to Previous Delta"), TQIconSet(TQPixmap(up1arrow)), CTRL+Key_Up, TQT_TQOBJECT(this), TQT_SLOT(slotGoPrevDelta()), ac, "go_prev_delta"); goPrevDelta->setToolTip( goPrevDelta->text() + omitsWhitespace ); - goNextDelta = new KAction(i18n("Go to Next Delta"), QIconSet(QPixmap(down1arrow)), CTRL+Key_Down, this, SLOT(slotGoNextDelta()), ac, "go_next_delta"); + goNextDelta = new KAction(i18n("Go to Next Delta"), TQIconSet(TQPixmap(down1arrow)), CTRL+Key_Down, TQT_TQOBJECT(this), TQT_SLOT(slotGoNextDelta()), ac, "go_next_delta"); goNextDelta->setToolTip( goNextDelta->text() + omitsWhitespace ); - goPrevConflict = new KAction(i18n("Go to Previous Conflict"), QIconSet(QPixmap(up2arrow)), CTRL+Key_PageUp, this, SLOT(slotGoPrevConflict()), ac, "go_prev_conflict"); + goPrevConflict = new KAction(i18n("Go to Previous Conflict"), TQIconSet(TQPixmap(up2arrow)), CTRL+Key_PageUp, TQT_TQOBJECT(this), TQT_SLOT(slotGoPrevConflict()), ac, "go_prev_conflict"); goPrevConflict->setToolTip( goPrevConflict->text() + omitsWhitespace ); - goNextConflict = new KAction(i18n("Go to Next Conflict"), QIconSet(QPixmap(down2arrow)), CTRL+Key_PageDown, this, SLOT(slotGoNextConflict()), ac, "go_next_conflict"); + goNextConflict = new KAction(i18n("Go to Next Conflict"), TQIconSet(TQPixmap(down2arrow)), CTRL+Key_PageDown, TQT_TQOBJECT(this), TQT_SLOT(slotGoNextConflict()), ac, "go_next_conflict"); goNextConflict->setToolTip( goNextConflict->text() + omitsWhitespace ); - goPrevUnsolvedConflict = new KAction(i18n("Go to Previous Unsolved Conflict"), QIconSet(QPixmap(prevunsolved)), 0, this, SLOT(slotGoPrevUnsolvedConflict()), ac, "go_prev_unsolved_conflict"); + goPrevUnsolvedConflict = new KAction(i18n("Go to Previous Unsolved Conflict"), TQIconSet(TQPixmap(prevunsolved)), 0, TQT_TQOBJECT(this), TQT_SLOT(slotGoPrevUnsolvedConflict()), ac, "go_prev_unsolved_conflict"); goPrevUnsolvedConflict->setToolTip( goPrevUnsolvedConflict->text() + includeWhitespace ); - goNextUnsolvedConflict = new KAction(i18n("Go to Next Unsolved Conflict"), QIconSet(QPixmap(nextunsolved)), 0, this, SLOT(slotGoNextUnsolvedConflict()), ac, "go_next_unsolved_conflict"); + goNextUnsolvedConflict = new KAction(i18n("Go to Next Unsolved Conflict"), TQIconSet(TQPixmap(nextunsolved)), 0, TQT_TQOBJECT(this), TQT_SLOT(slotGoNextUnsolvedConflict()), ac, "go_next_unsolved_conflict"); goNextUnsolvedConflict->setToolTip( goNextUnsolvedConflict->text() + includeWhitespace ); - chooseA = new KToggleAction(i18n("Select Line(s) From A"), QIconSet(QPixmap(iconA)), CTRL+Key_1, this, SLOT(slotChooseA()), ac, "merge_choose_a"); - chooseB = new KToggleAction(i18n("Select Line(s) From B"), QIconSet(QPixmap(iconB)), CTRL+Key_2, this, SLOT(slotChooseB()), ac, "merge_choose_b"); - chooseC = new KToggleAction(i18n("Select Line(s) From C"), QIconSet(QPixmap(iconC)), CTRL+Key_3, this, SLOT(slotChooseC()), ac, "merge_choose_c"); - autoAdvance = new KToggleAction(i18n("Automatically Go to Next Unsolved Conflict After Source Selection"), QIconSet(QPixmap(autoadvance)), 0, this, SLOT(slotAutoAdvanceToggled()), ac, "merge_autoadvance"); - - showWhiteSpaceCharacters = new KToggleAction(i18n("Show Space && Tabulator Characters for Differences"), QIconSet(QPixmap(showwhitespacechars)), 0, this, SLOT(slotShowWhiteSpaceToggled()), ac, "diff_show_whitespace_characters"); - showWhiteSpace = new KToggleAction(i18n("Show White Space"), QIconSet(QPixmap(showwhitespace)), 0, this, SLOT(slotShowWhiteSpaceToggled()), ac, "diff_show_whitespace"); - - showLineNumbers = new KToggleAction(i18n("Show Line Numbers"), QIconSet(QPixmap(showlinenumbers)), 0, this, SLOT(slotShowLineNumbersToggled()), ac, "diff_showlinenumbers"); - chooseAEverywhere = new KAction(i18n("Choose A Everywhere"), CTRL+SHIFT+Key_1, this, SLOT(slotChooseAEverywhere()), ac, "merge_choose_a_everywhere"); - chooseBEverywhere = new KAction(i18n("Choose B Everywhere"), CTRL+SHIFT+Key_2, this, SLOT(slotChooseBEverywhere()), ac, "merge_choose_b_everywhere"); - chooseCEverywhere = new KAction(i18n("Choose C Everywhere"), CTRL+SHIFT+Key_3, this, SLOT(slotChooseCEverywhere()), ac, "merge_choose_c_everywhere"); - chooseAForUnsolvedConflicts = new KAction(i18n("Choose A for All Unsolved Conflicts"), 0, this, SLOT(slotChooseAForUnsolvedConflicts()), ac, "merge_choose_a_for_unsolved_conflicts"); - chooseBForUnsolvedConflicts = new KAction(i18n("Choose B for All Unsolved Conflicts"), 0, this, SLOT(slotChooseBForUnsolvedConflicts()), ac, "merge_choose_b_for_unsolved_conflicts"); - chooseCForUnsolvedConflicts = new KAction(i18n("Choose C for All Unsolved Conflicts"), 0, this, SLOT(slotChooseCForUnsolvedConflicts()), ac, "merge_choose_c_for_unsolved_conflicts"); - chooseAForUnsolvedWhiteSpaceConflicts = new KAction(i18n("Choose A for All Unsolved Whitespace Conflicts"), 0, this, SLOT(slotChooseAForUnsolvedWhiteSpaceConflicts()), ac, "merge_choose_a_for_unsolved_whitespace_conflicts"); - chooseBForUnsolvedWhiteSpaceConflicts = new KAction(i18n("Choose B for All Unsolved Whitespace Conflicts"), 0, this, SLOT(slotChooseBForUnsolvedWhiteSpaceConflicts()), ac, "merge_choose_b_for_unsolved_whitespace_conflicts"); - chooseCForUnsolvedWhiteSpaceConflicts = new KAction(i18n("Choose C for All Unsolved Whitespace Conflicts"), 0, this, SLOT(slotChooseCForUnsolvedWhiteSpaceConflicts()), ac, "merge_choose_c_for_unsolved_whitespace_conflicts"); - autoSolve = new KAction(i18n("Automatically Solve Simple Conflicts"), 0, this, SLOT(slotAutoSolve()), ac, "merge_autosolve"); - unsolve = new KAction(i18n("Set Deltas to Conflicts"), 0, this, SLOT(slotUnsolve()), ac, "merge_autounsolve"); - mergeRegExp = new KAction(i18n("Run Regular Expression Auto Merge"), 0, this, SLOT(slotRegExpAutoMerge()),ac, "merge_regexp_automerge" ); - mergeHistory = new KAction(i18n("Automatically Solve History Conflicts"), 0, this, SLOT(slotMergeHistory()), ac, "merge_versioncontrol_history" ); - splitDiff = new KAction(i18n("Split Diff At Selection"), 0, this, SLOT(slotSplitDiff()), ac, "merge_splitdiff"); - joinDiffs = new KAction(i18n("Join Selected Diffs"), 0, this, SLOT(slotJoinDiffs()), ac, "merge_joindiffs"); - - showWindowA = new KToggleAction(i18n("Show Window A"), 0, this, SLOT(slotShowWindowAToggled()), ac, "win_show_a"); - showWindowB = new KToggleAction(i18n("Show Window B"), 0, this, SLOT(slotShowWindowBToggled()), ac, "win_show_b"); - showWindowC = new KToggleAction(i18n("Show Window C"), 0, this, SLOT(slotShowWindowCToggled()), ac, "win_show_c"); - winFocusNext = new KAction(i18n("Focus Next Window"), ALT+Key_Right, this, SLOT(slotWinFocusNext()), ac, "win_focus_next"); - - overviewModeNormal = new KToggleAction(i18n("Normal Overview"), 0, this, SLOT(slotOverviewNormal()), ac, "diff_overview_normal"); - overviewModeAB = new KToggleAction(i18n("A vs. B Overview"), 0, this, SLOT(slotOverviewAB()), ac, "diff_overview_ab"); - overviewModeAC = new KToggleAction(i18n("A vs. C Overview"), 0, this, SLOT(slotOverviewAC()), ac, "diff_overview_ac"); - overviewModeBC = new KToggleAction(i18n("B vs. C Overview"), 0, this, SLOT(slotOverviewBC()), ac, "diff_overview_bc"); - wordWrap = new KToggleAction(i18n("Word Wrap Diff Windows"), 0, this, SLOT(slotWordWrapToggled()), ac, "diff_wordwrap"); - addManualDiffHelp = new KAction(i18n("Add Manual Diff Alignment"), Qt::CTRL+Qt::Key_Y, this, SLOT(slotAddManualDiffHelp()), ac, "diff_add_manual_diff_help"); - clearManualDiffHelpList = new KAction(i18n("Clear All Manual Diff Alignments"), Qt::CTRL+Qt::SHIFT+Qt::Key_Y, this, SLOT(slotClearManualDiffHelpList()), ac, "diff_clear_manual_diff_help_list"); + chooseA = new KToggleAction(i18n("Select Line(s) From A"), TQIconSet(TQPixmap(iconA)), CTRL+Key_1, TQT_TQOBJECT(this), TQT_SLOT(slotChooseA()), ac, "merge_choose_a"); + chooseB = new KToggleAction(i18n("Select Line(s) From B"), TQIconSet(TQPixmap(iconB)), CTRL+Key_2, TQT_TQOBJECT(this), TQT_SLOT(slotChooseB()), ac, "merge_choose_b"); + chooseC = new KToggleAction(i18n("Select Line(s) From C"), TQIconSet(TQPixmap(iconC)), CTRL+Key_3, TQT_TQOBJECT(this), TQT_SLOT(slotChooseC()), ac, "merge_choose_c"); + autoAdvance = new KToggleAction(i18n("Automatically Go to Next Unsolved Conflict After Source Selection"), TQIconSet(TQPixmap(autoadvance)), 0, TQT_TQOBJECT(this), TQT_SLOT(slotAutoAdvanceToggled()), ac, "merge_autoadvance"); + + showWhiteSpaceCharacters = new KToggleAction(i18n("Show Space && Tabulator Characters for Differences"), TQIconSet(TQPixmap(showwhitespacechars)), 0, TQT_TQOBJECT(this), TQT_SLOT(slotShowWhiteSpaceToggled()), ac, "diff_show_whitespace_characters"); + showWhiteSpace = new KToggleAction(i18n("Show White Space"), TQIconSet(TQPixmap(showwhitespace)), 0, TQT_TQOBJECT(this), TQT_SLOT(slotShowWhiteSpaceToggled()), ac, "diff_show_whitespace"); + + showLineNumbers = new KToggleAction(i18n("Show Line Numbers"), TQIconSet(TQPixmap(showlinenumbers)), 0, TQT_TQOBJECT(this), TQT_SLOT(slotShowLineNumbersToggled()), ac, "diff_showlinenumbers"); + chooseAEverywhere = new KAction(i18n("Choose A Everywhere"), CTRL+SHIFT+Key_1, TQT_TQOBJECT(this), TQT_SLOT(slotChooseAEverywhere()), ac, "merge_choose_a_everywhere"); + chooseBEverywhere = new KAction(i18n("Choose B Everywhere"), CTRL+SHIFT+Key_2, TQT_TQOBJECT(this), TQT_SLOT(slotChooseBEverywhere()), ac, "merge_choose_b_everywhere"); + chooseCEverywhere = new KAction(i18n("Choose C Everywhere"), CTRL+SHIFT+Key_3, TQT_TQOBJECT(this), TQT_SLOT(slotChooseCEverywhere()), ac, "merge_choose_c_everywhere"); + chooseAForUnsolvedConflicts = new KAction(i18n("Choose A for All Unsolved Conflicts"), 0, TQT_TQOBJECT(this), TQT_SLOT(slotChooseAForUnsolvedConflicts()), ac, "merge_choose_a_for_unsolved_conflicts"); + chooseBForUnsolvedConflicts = new KAction(i18n("Choose B for All Unsolved Conflicts"), 0, TQT_TQOBJECT(this), TQT_SLOT(slotChooseBForUnsolvedConflicts()), ac, "merge_choose_b_for_unsolved_conflicts"); + chooseCForUnsolvedConflicts = new KAction(i18n("Choose C for All Unsolved Conflicts"), 0, TQT_TQOBJECT(this), TQT_SLOT(slotChooseCForUnsolvedConflicts()), ac, "merge_choose_c_for_unsolved_conflicts"); + chooseAForUnsolvedWhiteSpaceConflicts = new KAction(i18n("Choose A for All Unsolved Whitespace Conflicts"), 0, TQT_TQOBJECT(this), TQT_SLOT(slotChooseAForUnsolvedWhiteSpaceConflicts()), ac, "merge_choose_a_for_unsolved_whitespace_conflicts"); + chooseBForUnsolvedWhiteSpaceConflicts = new KAction(i18n("Choose B for All Unsolved Whitespace Conflicts"), 0, TQT_TQOBJECT(this), TQT_SLOT(slotChooseBForUnsolvedWhiteSpaceConflicts()), ac, "merge_choose_b_for_unsolved_whitespace_conflicts"); + chooseCForUnsolvedWhiteSpaceConflicts = new KAction(i18n("Choose C for All Unsolved Whitespace Conflicts"), 0, TQT_TQOBJECT(this), TQT_SLOT(slotChooseCForUnsolvedWhiteSpaceConflicts()), ac, "merge_choose_c_for_unsolved_whitespace_conflicts"); + autoSolve = new KAction(i18n("Automatically Solve Simple Conflicts"), 0, TQT_TQOBJECT(this), TQT_SLOT(slotAutoSolve()), ac, "merge_autosolve"); + unsolve = new KAction(i18n("Set Deltas to Conflicts"), 0, TQT_TQOBJECT(this), TQT_SLOT(slotUnsolve()), ac, "merge_autounsolve"); + mergeRegExp = new KAction(i18n("Run Regular Expression Auto Merge"), 0, TQT_TQOBJECT(this), TQT_SLOT(slotRegExpAutoMerge()),ac, "merge_regexp_automerge" ); + mergeHistory = new KAction(i18n("Automatically Solve History Conflicts"), 0, TQT_TQOBJECT(this), TQT_SLOT(slotMergeHistory()), ac, "merge_versioncontrol_history" ); + splitDiff = new KAction(i18n("Split Diff At Selection"), 0, TQT_TQOBJECT(this), TQT_SLOT(slotSplitDiff()), ac, "merge_splitdiff"); + joinDiffs = new KAction(i18n("Join Selected Diffs"), 0, TQT_TQOBJECT(this), TQT_SLOT(slotJoinDiffs()), ac, "merge_joindiffs"); + + showWindowA = new KToggleAction(i18n("Show Window A"), 0, TQT_TQOBJECT(this), TQT_SLOT(slotShowWindowAToggled()), ac, "win_show_a"); + showWindowB = new KToggleAction(i18n("Show Window B"), 0, TQT_TQOBJECT(this), TQT_SLOT(slotShowWindowBToggled()), ac, "win_show_b"); + showWindowC = new KToggleAction(i18n("Show Window C"), 0, TQT_TQOBJECT(this), TQT_SLOT(slotShowWindowCToggled()), ac, "win_show_c"); + winFocusNext = new KAction(i18n("Focus Next Window"), ALT+Key_Right, TQT_TQOBJECT(this), TQT_SLOT(slotWinFocusNext()), ac, "win_focus_next"); + + overviewModeNormal = new KToggleAction(i18n("Normal Overview"), 0, TQT_TQOBJECT(this), TQT_SLOT(slotOverviewNormal()), ac, "diff_overview_normal"); + overviewModeAB = new KToggleAction(i18n("A vs. B Overview"), 0, TQT_TQOBJECT(this), TQT_SLOT(slotOverviewAB()), ac, "diff_overview_ab"); + overviewModeAC = new KToggleAction(i18n("A vs. C Overview"), 0, TQT_TQOBJECT(this), TQT_SLOT(slotOverviewAC()), ac, "diff_overview_ac"); + overviewModeBC = new KToggleAction(i18n("B vs. C Overview"), 0, TQT_TQOBJECT(this), TQT_SLOT(slotOverviewBC()), ac, "diff_overview_bc"); + wordWrap = new KToggleAction(i18n("Word Wrap Diff Windows"), 0, TQT_TQOBJECT(this), TQT_SLOT(slotWordWrapToggled()), ac, "diff_wordwrap"); + addManualDiffHelp = new KAction(i18n("Add Manual Diff Alignment"), TQt::CTRL+TQt::Key_Y, TQT_TQOBJECT(this), TQT_SLOT(slotAddManualDiffHelp()), ac, "diff_add_manual_diff_help"); + clearManualDiffHelpList = new KAction(i18n("Clear All Manual Diff Alignments"), TQt::CTRL+TQt::SHIFT+TQt::Key_Y, TQT_TQOBJECT(this), TQT_SLOT(slotClearManualDiffHelpList()), ac, "diff_clear_manual_diff_help_list"); #ifdef _WIN32 - new KAction(i18n("Focus Next Window"), Qt::CTRL+Qt::Key_Tab, this, SLOT(slotWinFocusNext()), ac, "win_focus_next", false, false); + new KAction(i18n("Focus Next Window"), TQt::CTRL+TQt::Key_Tab, TQT_TQOBJECT(this), TQT_SLOT(slotWinFocusNext()), ac, "win_focus_next", false, false); #endif - winFocusPrev = new KAction(i18n("Focus Prev Window"), Qt::ALT+Qt::Key_Left, this, SLOT(slotWinFocusPrev()), ac, "win_focus_prev"); - winToggleSplitOrientation = new KAction(i18n("Toggle Split Orientation"), 0, this, SLOT(slotWinToggleSplitterOrientation()), ac, "win_toggle_split_orientation"); + winFocusPrev = new KAction(i18n("Focus Prev Window"), TQt::ALT+TQt::Key_Left, TQT_TQOBJECT(this), TQT_SLOT(slotWinFocusPrev()), ac, "win_focus_prev"); + winToggleSplitOrientation = new KAction(i18n("Toggle Split Qt::Orientation"), 0, TQT_TQOBJECT(this), TQT_SLOT(slotWinToggleSplitterOrientation()), ac, "win_toggle_split_orientation"); - dirShowBoth = new KToggleAction(i18n("Dir && Text Split Screen View"), 0, this, SLOT(slotDirShowBoth()), ac, "win_dir_show_both"); + dirShowBoth = new KToggleAction(i18n("Dir && Text Split Screen View"), 0, TQT_TQOBJECT(this), TQT_SLOT(slotDirShowBoth()), ac, "win_dir_show_both"); dirShowBoth->setChecked( true ); - dirViewToggle = new KAction(i18n("Toggle Between Dir && Text View"), 0, this, SLOT(slotDirViewToggle()), actionCollection(), "win_dir_view_toggle"); + dirViewToggle = new KAction(i18n("Toggle Between Dir && Text View"), 0, TQT_TQOBJECT(this), TQT_SLOT(slotDirViewToggle()), actionCollection(), "win_dir_view_toggle"); - m_pMergeEditorPopupMenu = new QPopupMenu( this ); + m_pMergeEditorPopupMenu = new TQPopupMenu( this ); chooseA->plug( m_pMergeEditorPopupMenu ); chooseB->plug( m_pMergeEditorPopupMenu ); chooseC->plug( m_pMergeEditorPopupMenu ); } -void KDiff3App::showPopupMenu( const QPoint& point ) +void KDiff3App::showPopupMenu( const TQPoint& point ) { m_pMergeEditorPopupMenu->popup( point ); } @@ -577,7 +577,7 @@ void KDiff3App::saveOptions( KConfig* config ) m_pOptionDialog->m_bMaximised = m_pKDiff3Shell->isMaximized(); if( ! m_pKDiff3Shell->isMaximized() && m_pKDiff3Shell->isVisible() ) { - m_pOptionDialog->m_geometry = m_pKDiff3Shell->size(); + m_pOptionDialog->m_tqgeometry = m_pKDiff3Shell->size(); m_pOptionDialog->m_position = m_pKDiff3Shell->pos(); } if ( toolBar("mainToolBar")!=0 ) @@ -629,7 +629,7 @@ bool KDiff3App::queryClose() ///////////////////////////////////////////////////////////////////// -// SLOT IMPLEMENTATION +// TQT_SLOT IMPLEMENTATION ///////////////////////////////////////////////////////////////////// @@ -660,7 +660,7 @@ void KDiff3App::slotFileSaveAs() { slotStatusMsg(i18n("Saving file with a new filename...")); - QString s = KFileDialog::getSaveURL( QDir::currentDirPath(), 0, this, i18n("Save As...") ).url(); + TQString s = KFileDialog::getSaveURL( TQDir::currentDirPath(), 0, this, i18n("Save As...") ).url(); if(!s.isEmpty()) { m_outputFilename = s; @@ -681,20 +681,20 @@ void KDiff3App::slotFileSaveAs() } -void printDiffTextWindow( MyPainter& painter, const QRect& view, const QString& headerText, DiffTextWindow* pDiffTextWindow, int line, int linesPerPage, QColor fgColor ) +void printDiffTextWindow( MyPainter& painter, const TQRect& view, const TQString& headerText, DiffTextWindow* pDiffTextWindow, int line, int linesPerPage, TQColor fgColor ) { - QRect clipRect = view; + TQRect clipRect = view; clipRect.setTop(0); painter.setClipRect( clipRect ); painter.translate( view.left() , 0 ); - QFontMetrics fm = painter.fontMetrics(); + TQFontMetrics fm = painter.fontMetrics(); //if ( fm.width(headerText) > view.width() ) { // A simple wrapline algorithm int l=0; for (unsigned int p=0; p<headerText.length(); ) { - QString s = headerText.mid(p); + TQString s = headerText.mid(p); unsigned int i; for(i=2;i<s.length();++i) if (fm.width(s,i)>view.width()) @@ -702,7 +702,7 @@ void printDiffTextWindow( MyPainter& painter, const QRect& view, const QString& --i; break; } - //QString s2 = s.left(i); + //TQString s2 = s.left(i); painter.drawText( 0, l*fm.height() + fm.ascent(), s.left(i) ); p+=i; ++l; @@ -757,19 +757,19 @@ void KDiff3App::slotFilePrint() slotStatusMsg( i18n( "Printing aborted." ) ); return; } - QPaintDeviceMetrics metrics( painter.device() ); + TQPaintDeviceMetrics metrics( painter.device() ); int dpiy = metrics.logicalDpiY(); int columnDistance = (int) ( (0.5/2.54)*dpiy ); // 0.5 cm between the columns int columns = m_bTripleDiff ? 3 : 2; int columnWidth = ( metrics.width() - (columns-1)*columnDistance ) / columns; - QFont f = m_pOptionDialog->m_font; + TQFont f = m_pOptionDialog->m_font; f.setPointSizeFloat(f.pointSizeFloat()-1); // Print with slightly smaller font. painter.setFont( f ); - QFontMetrics fm = painter.fontMetrics(); + TQFontMetrics fm = painter.fontMetrics(); - QString topLineText = i18n("Top line"); + TQString topLineText = i18n("Top line"); //int headerWidth = fm.width( m_sd1.getAliasName() + ", "+topLineText+": 01234567" ); int headerLines = fm.width( m_sd1.getAliasName() + ", "+topLineText+": 01234567" )/columnWidth+1; @@ -777,16 +777,16 @@ void KDiff3App::slotFilePrint() int headerMargin = headerLines * fm.height() + 3; // Text + one horizontal line int footerMargin = fm.height() + 3; - QRect view ( 0, headerMargin, metrics.width(), metrics.height() - (headerMargin + footerMargin) ); - QRect view1( 0*(columnWidth + columnDistance), view.top(), columnWidth, view.height() ); - QRect view2( 1*(columnWidth + columnDistance), view.top(), columnWidth, view.height() ); - QRect view3( 2*(columnWidth + columnDistance), view.top(), columnWidth, view.height() ); + TQRect view ( 0, headerMargin, metrics.width(), metrics.height() - (headerMargin + footerMargin) ); + TQRect view1( 0*(columnWidth + columnDistance), view.top(), columnWidth, view.height() ); + TQRect view2( 1*(columnWidth + columnDistance), view.top(), columnWidth, view.height() ); + TQRect view3( 2*(columnWidth + columnDistance), view.top(), columnWidth, view.height() ); int linesPerPage = view.height() / fm.height(); int charactersPerLine = columnWidth / fm.width("W"); if ( m_pOptionDialog->m_bWordWrap ) { - // For printing the lines are wrapped differently (this invalidates the first line) + // For printing the lines are wrapped differently (this tqinvalidates the first line) recalcWordWrap( charactersPerLine ); } @@ -794,7 +794,7 @@ void KDiff3App::slotFilePrint() if ( m_bTripleDiff && m_pDiffTextWindow3) totalNofLines = max2(totalNofLines, m_pDiffTextWindow3->getNofLines()); - QValueList<int> pageList = printer.pageList(); + TQValueList<int> pageList = printer.pageList(); bool bPrintCurrentPage=false; bool bFirstPrintedPage = false; @@ -830,7 +830,7 @@ void KDiff3App::slotFilePrint() int page = 1; - QValueList<int>::iterator pageListIt = pageList.begin(); + TQValueList<int>::iterator pageListIt = pageList.begin(); for(;;) { if (!bPrintSelection) @@ -867,25 +867,25 @@ void KDiff3App::slotFilePrint() painter.setClipping(true); painter.setPen( m_pOptionDialog->m_colorA ); - QString headerText1 = m_sd1.getAliasName() + ", "+topLineText+": " + QString::number(m_pDiffTextWindow1->calcTopLineInFile(line)+1); + TQString headerText1 = m_sd1.getAliasName() + ", "+topLineText+": " + TQString::number(m_pDiffTextWindow1->calcTopLineInFile(line)+1); printDiffTextWindow( painter, view1, headerText1, m_pDiffTextWindow1, line, linesPerPage, m_pOptionDialog->m_fgColor ); painter.setPen( m_pOptionDialog->m_colorB ); - QString headerText2 = m_sd2.getAliasName() + ", "+topLineText+": " + QString::number(m_pDiffTextWindow2->calcTopLineInFile(line)+1); + TQString headerText2 = m_sd2.getAliasName() + ", "+topLineText+": " + TQString::number(m_pDiffTextWindow2->calcTopLineInFile(line)+1); printDiffTextWindow( painter, view2, headerText2, m_pDiffTextWindow2, line, linesPerPage, m_pOptionDialog->m_fgColor ); if ( m_bTripleDiff && m_pDiffTextWindow3 ) { painter.setPen( m_pOptionDialog->m_colorC ); - QString headerText3 = m_sd3.getAliasName() + ", "+topLineText+": " + QString::number(m_pDiffTextWindow3->calcTopLineInFile(line)+1); + TQString headerText3 = m_sd3.getAliasName() + ", "+topLineText+": " + TQString::number(m_pDiffTextWindow3->calcTopLineInFile(line)+1); printDiffTextWindow( painter, view3, headerText3, m_pDiffTextWindow3, line, linesPerPage, m_pOptionDialog->m_fgColor ); } painter.setClipping(false); painter.setPen( m_pOptionDialog->m_fgColor ); painter.drawLine( 0, view.bottom()+3, view.width(), view.bottom()+3 ); - QString s = bPrintCurrentPage ? QString("") - : QString::number( page ) + "/" + QString::number(totalNofPages); + TQString s = bPrintCurrentPage ? TQString("") + : TQString::number( page ) + "/" + TQString::number(totalNofPages); if ( bPrintSelection ) s+=" (" + i18n("Selection") + ")"; painter.drawText( (view.right() - painter.fontMetrics().width( s ))/2, view.bottom() + painter.fontMetrics().ascent() + 5, s ); @@ -975,7 +975,7 @@ void KDiff3App::slotViewStatusBar() } -void KDiff3App::slotStatusMsg(const QString &text) +void KDiff3App::slotStatusMsg(const TQString &text) { /////////////////////////////////////////////////////////////////// // change status message permanently diff --git a/src/kdiff3.h b/src/kdiff3.h index 72b1a79..2934648 100644 --- a/src/kdiff3.h +++ b/src/kdiff3.h @@ -24,10 +24,10 @@ #include <config.h> #endif -// include files for Qt -#include <qdialog.h> -#include <qsplitter.h> -#include <qscrollbar.h> +// include files for TQt +#include <tqdialog.h> +#include <tqsplitter.h> +#include <tqscrollbar.h> // include files for KDE #include <kapplication.h> @@ -48,11 +48,11 @@ class MergeResultWindow; class WindowTitleWidget; class Overview; -class QScrollBar; -class QComboBox; -class QLineEdit; -class QCheckBox; -class QSplitter; +class TQScrollBar; +class TQComboBox; +class TQLineEdit; +class TQCheckBox; +class TQSplitter; class KDiff3Part; @@ -60,18 +60,19 @@ class DirectoryMergeWindow; class DirectoryMergeInfo; -class ReversibleScrollBar : public QScrollBar +class ReversibleScrollBar : public TQScrollBar { Q_OBJECT + TQ_OBJECT bool* m_pbRightToLeftLanguage; int m_realVal; public: - ReversibleScrollBar( Orientation o, QWidget* pParent, bool* pbRightToLeftLanguage ) - : QScrollBar( o, pParent ) + ReversibleScrollBar( Qt::Orientation o, TQWidget* pParent, bool* pbRightToLeftLanguage ) + : TQScrollBar( o, pParent ) { m_pbRightToLeftLanguage=pbRightToLeftLanguage; m_realVal=0; - connect( this, SIGNAL(valueChanged(int)), this, SLOT(slotValueChanged(int))); + connect( this, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(slotValueChanged(int))); } void setAgain(){ setValue(m_realVal); } public slots: @@ -85,22 +86,23 @@ public slots: void setValue(int i) { if(m_pbRightToLeftLanguage && *m_pbRightToLeftLanguage) - QScrollBar::setValue( maxValue()-(i-minValue()) ); + TQScrollBar::setValue( maxValue()-(i-minValue()) ); else - QScrollBar::setValue( i ); + TQScrollBar::setValue( i ); } signals: void valueChanged2(int); }; -class KDiff3App : public QSplitter +class KDiff3App : public TQSplitter { Q_OBJECT + TQ_OBJECT public: /** constructor of KDiff3App, calls all init functions to create the application. */ - KDiff3App( QWidget* parent, const char* name, KDiff3Part* pKDiff3Part ); + KDiff3App( TQWidget* tqparent, const char* name, KDiff3Part* pKDiff3Part ); ~KDiff3App(); bool isPart(); @@ -108,7 +110,7 @@ class KDiff3App : public QSplitter /** initializes the KActions of the application */ void initActions( KActionCollection* ); - /** save general Options like all bar positions and status as well as the geometry + /** save general Options like all bar positions and status as well as the tqgeometry and the recent file list to the configuration file */ void saveOptions( KConfig* ); @@ -116,7 +118,7 @@ class KDiff3App : public QSplitter void readOptions( KConfig* ); // Finish initialisation (virtual, so that it can be called from the shell too.) - virtual void completeInit(const QString& fn1="", const QString& fn2="", const QString& fn3=""); + virtual void completeInit(const TQString& fn1="", const TQString& fn2="", const TQString& fn3=""); /** queryClose is called by KMainWindow on each closeEvent of a window. Against the * default implementation (only returns true), this calles saveModified() on the document object to ask if the document shall @@ -128,7 +130,7 @@ class KDiff3App : public QSplitter virtual bool isFileSaved(); signals: - void createNewInstance( const QString& fn1, const QString& fn2, const QString& fn3 ); + void createNewInstance( const TQString& fn1, const TQString& fn2, const TQString& fn3 ); protected: void initDirectoryMergeActions(); /** sets up the statusbar for the main window by initialzing a statuslabel. */ @@ -141,10 +143,10 @@ class KDiff3App : public QSplitter /** open a file and load it into the document*/ void slotFileOpen(); - void slotFileOpen2( QString fn1, QString fn2, QString fn3, QString ofn, - QString an1, QString an2, QString an3, TotalDiffStatus* pTotalDiffStatus ); + void slotFileOpen2( TQString fn1, TQString fn2, TQString fn3, TQString ofn, + TQString an1, TQString an2, TQString an3, TotalDifftqStatus* pTotalDifftqStatus ); - void slotFileNameChanged(const QString& fileName, int winIdx); + void slotFileNameChanged(const TQString& fileName, int winIdx); /** save a document */ void slotFileSave(); @@ -176,7 +178,7 @@ class KDiff3App : public QSplitter /** changes the statusbar contents for the standard label permanently, used to indicate current actions. * @param text the text that is displayed in the statusbar */ - void slotStatusMsg(const QString &text); + void slotStatusMsg(const TQString &text); private: /** the configuration object of the application */ @@ -249,14 +251,14 @@ class KDiff3App : public QSplitter KToggleAction *overviewModeBC; - QPopupMenu* m_pMergeEditorPopupMenu; + TQPopupMenu* m_pMergeEditorPopupMenu; - QSplitter* m_pMainSplitter; - QWidget* m_pMainWidget; - QWidget* m_pMergeWindowFrame; + TQSplitter* m_pMainSplitter; + TQWidget* m_pMainWidget; + TQWidget* m_pMergeWindowFrame; ReversibleScrollBar* m_pHScrollBar; - QScrollBar* m_pDiffVScrollBar; - QScrollBar* m_pMergeVScrollBar; + TQScrollBar* m_pDiffVScrollBar; + TQScrollBar* m_pMergeVScrollBar; DiffTextWindow* m_pDiffTextWindow1; DiffTextWindow* m_pDiffTextWindow2; @@ -264,28 +266,28 @@ class KDiff3App : public QSplitter DiffTextWindowFrame* m_pDiffTextWindowFrame1; DiffTextWindowFrame* m_pDiffTextWindowFrame2; DiffTextWindowFrame* m_pDiffTextWindowFrame3; - QSplitter* m_pDiffWindowSplitter; + TQSplitter* m_pDiffWindowSplitter; MergeResultWindow* m_pMergeResultWindow; WindowTitleWidget* m_pMergeResultWindowTitle; bool m_bTripleDiff; - QSplitter* m_pDirectoryMergeSplitter; + TQSplitter* m_pDirectoryMergeSplitter; DirectoryMergeWindow* m_pDirectoryMergeWindow; DirectoryMergeInfo* m_pDirectoryMergeInfo; bool m_bDirCompare; Overview* m_pOverview; - QWidget* m_pCornerWidget; + TQWidget* m_pCornerWidget; - TotalDiffStatus m_totalDiffStatus; + TotalDifftqStatus m_totalDifftqStatus; SourceData m_sd1; SourceData m_sd2; SourceData m_sd3; - QString m_outputFilename; + TQString m_outputFilename; bool m_bDefaultFilename; DiffList m_diffList12; @@ -308,10 +310,10 @@ class KDiff3App : public QSplitter OptionDialog* m_pOptionDialog; FindDialog* m_pFindDialog; - void init( bool bAuto=false, TotalDiffStatus* pTotalDiffStatus=0, bool bLoadFiles=true ); + void init( bool bAuto=false, TotalDifftqStatus* pTotalDifftqStatus=0, bool bLoadFiles=true ); - virtual bool eventFilter( QObject* o, QEvent* e ); - virtual void resizeEvent(QResizeEvent*); + virtual bool eventFilter( TQObject* o, TQEvent* e ); + virtual void resizeEvent(TQResizeEvent*); bool improveFilenames(bool bCreateNewInstance); @@ -335,7 +337,7 @@ public slots: void resizeMergeResultWindow(); void slotRecalcWordWrap(); - void showPopupMenu( const QPoint& point ); + void showPopupMenu( const TQPoint& point ); void scrollDiffTextWindow( int deltaX, int deltaY ); void scrollMergeResultWindow( int deltaX, int deltaY ); diff --git a/src/kdiff3_part.cpp b/src/kdiff3_part.cpp index 799673e..4e0a9c3 100644 --- a/src/kdiff3_part.cpp +++ b/src/kdiff3_part.cpp @@ -24,8 +24,8 @@ #include <kstdaction.h> #include <kfiledialog.h> -#include <qfile.h> -#include <qtextstream.h> +#include <tqfile.h> +#include <tqtextstream.h> #include "kdiff3.h" #include "fileaccess.h" @@ -35,26 +35,26 @@ #include "version.h" -KDiff3Part::KDiff3Part( QWidget *parentWidget, const char *widgetName, - QObject *parent, const char *name ) - : KParts::ReadOnlyPart(parent, name) +KDiff3Part::KDiff3Part( TQWidget *tqparentWidget, const char *widgetName, + TQObject *tqparent, const char *name ) + : KParts::ReadOnlyPart(tqparent, name) { // we need an instance setInstance( KDiff3PartFactory::instance() ); // this should be your custom internal widget - m_widget = new KDiff3App( parentWidget, widgetName, this ); + m_widget = new KDiff3App( tqparentWidget, widgetName, this ); // This hack is necessary to avoid a crash when the program terminates. - m_bIsShell = dynamic_cast<KParts::MainWindow*>(parentWidget)!=0; + m_bIsShell = dynamic_cast<KParts::MainWindow*>(tqparentWidget)!=0; // notify the part that this is our internal widget setWidget(m_widget); // create our actions - //KStdAction::open(this, SLOT(fileOpen()), actionCollection()); - //KStdAction::saveAs(this, SLOT(fileSaveAs()), actionCollection()); - //KStdAction::save(this, SLOT(save()), actionCollection()); + //KStdAction::open(this, TQT_SLOT(fileOpen()), actionCollection()); + //KStdAction::saveAs(this, TQT_SLOT(fileSaveAs()), actionCollection()); + //KStdAction::save(this, TQT_SLOT(save()), actionCollection()); setXMLFile("kdiff3_part.rc"); @@ -93,12 +93,12 @@ void KDiff3Part::setModified(bool /*modified*/) else save->setEnabled(false); - // in any event, we want our parent to do it's thing + // in any event, we want our tqparent to do it's thing ReadWritePart::setModified(modified); */ } -static void getNameAndVersion( const QString& str, const QString& lineStart, QString& fileName, QString& version ) +static void getNameAndVersion( const TQString& str, const TQString& lineStart, TQString& fileName, TQString& version ) { if ( str.left( lineStart.length() )==lineStart && fileName.isEmpty() ) { @@ -114,7 +114,7 @@ static void getNameAndVersion( const QString& str, const QString& lineStart, QSt --pos2; } - int vpos = str.findRev("\t", -1); + int vpos = str.tqfindRev("\t", -1); if ( vpos>0 && vpos>(int)pos2 ) { version = str.mid( vpos+1 ); @@ -127,20 +127,20 @@ static void getNameAndVersion( const QString& str, const QString& lineStart, QSt bool KDiff3Part::openFile() { - // m_file is always local so we can use QFile on it + // m_file is always local so we can use TQFile on it std::cerr << "KDiff3: " << m_file.latin1() << std::endl; - QFile file(m_file); + TQFile file(m_file); if (file.open(IO_ReadOnly) == false) return false; - // our example widget is text-based, so we use QTextStream instead - // of a raw QDataStream - QTextStream stream(&file); - QString str; - QString fileName1; - QString fileName2; - QString version1; - QString version2; + // our example widget is text-based, so we use TQTextStream instead + // of a raw TQDataStream + TQTextStream stream(&file); + TQString str; + TQString fileName1; + TQString fileName2; + TQString version1; + TQString version2; while (!stream.eof() && (fileName1.isEmpty() || fileName2.isEmpty()) ) { str = stream.readLine() + "\n"; @@ -168,8 +168,8 @@ bool KDiff3Part::openFile() { // Normal patch // patch -f -u --ignore-whitespace -i [inputfile] -o [outfile] [patchfile] - QString tempFileName = FileAccess::tempFileName(); - QString cmd = "patch -f -u --ignore-whitespace -i \"" + m_file + + TQString tempFileName = FileAccess::tempFileName(); + TQString cmd = "patch -f -u --ignore-whitespace -i \"" + m_file + "\" -o \""+tempFileName + "\" \"" + fileName1+ "\""; ::system( cmd.ascii() ); @@ -183,8 +183,8 @@ bool KDiff3Part::openFile() { // Reverse patch // patch -f -u -R --ignore-whitespace -i [inputfile] -o [outfile] [patchfile] - QString tempFileName = FileAccess::tempFileName(); - QString cmd = "patch -f -u -R --ignore-whitespace -i \"" + m_file + + TQString tempFileName = FileAccess::tempFileName(); + TQString cmd = "patch -f -u -R --ignore-whitespace -i \"" + m_file + "\" -o \""+tempFileName + "\" \"" + fileName2+"\""; ::system( cmd.ascii() ); @@ -200,12 +200,12 @@ bool KDiff3Part::openFile() // Assuming that files are on CVS: Try to get them // cvs update -p -r [REV] [FILE] > [OUTPUTFILE] - QString tempFileName1 = FileAccess::tempFileName(); - QString cmd1 = "cvs update -p -r " + version1 + " \"" + fileName1 + "\" >\""+tempFileName1+"\""; + TQString tempFileName1 = FileAccess::tempFileName(); + TQString cmd1 = "cvs update -p -r " + version1 + " \"" + fileName1 + "\" >\""+tempFileName1+"\""; ::system( cmd1.ascii() ); - QString tempFileName2 = FileAccess::tempFileName(); - QString cmd2 = "cvs update -p -r " + version2 + " \"" + fileName2 + "\" >\""+tempFileName2+"\""; + TQString tempFileName2 = FileAccess::tempFileName(); + TQString cmd2 = "cvs update -p -r " + version2 + " \"" + fileName2 + "\" >\""+tempFileName2+"\""; ::system( cmd2.ascii() ); m_widget->slotFileOpen2( tempFileName1, tempFileName2, "", "", @@ -233,13 +233,13 @@ bool KDiff3Part::saveFile() if (isReadWrite() == false) return false; - // m_file is always local, so we use QFile - QFile file(m_file); + // m_file is always local, so we use TQFile + TQFile file(m_file); if (file.open(IO_WriteOnly) == false) return false; - // use QTextStream to dump the text to the file - QTextStream stream(&file); + // use TQTextStream to dump the text to the file + TQTextStream stream(&file); //stream << m_widget->text(); file.close(); @@ -270,15 +270,15 @@ KDiff3PartFactory::~KDiff3PartFactory() s_instance = 0L; } -KParts::Part* KDiff3PartFactory::createPartObject( QWidget *parentWidget, const char *widgetName, - QObject *parent, const char *name, - const char *classname, const QStringList&/*args*/ ) +KParts::Part* KDiff3PartFactory::createPartObject( TQWidget *tqparentWidget, const char *widgetName, + TQObject *tqparent, const char *name, + const char *classname, const TQStringList&/*args*/ ) { // Create an instance of our Part - KDiff3Part* obj = new KDiff3Part( parentWidget, widgetName, parent, name ); + KDiff3Part* obj = new KDiff3Part( tqparentWidget, widgetName, tqparent, name ); // See if we are to be read-write or not - if (QCString(classname) == "KParts::ReadOnlyPart") + if (TQCString(classname) == "KParts::ReadOnlyPart") obj->setReadWrite(false); return obj; diff --git a/src/kdiff3_part.h b/src/kdiff3_part.h index 86b58d2..b88d304 100644 --- a/src/kdiff3_part.h +++ b/src/kdiff3_part.h @@ -23,8 +23,8 @@ #include <kparts/part.h> #include <kparts/factory.h> -class QWidget; -class QPainter; +class TQWidget; +class TQPainter; class KURL; class KDiff3App; @@ -38,12 +38,13 @@ class KDiff3App; class KDiff3Part : public KParts::ReadOnlyPart { Q_OBJECT + TQ_OBJECT public: /** * Default constructor */ - KDiff3Part(QWidget *parentWidget, const char *widgetName, - QObject *parent, const char *name); + KDiff3Part(TQWidget *tqparentWidget, const char *widgetName, + TQObject *tqparent, const char *name); /** * Destructor @@ -84,12 +85,13 @@ class KAboutData; class KDiff3PartFactory : public KParts::Factory { Q_OBJECT + TQ_OBJECT public: KDiff3PartFactory(); virtual ~KDiff3PartFactory(); - 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 *tqparentWidget, const char *widgetName, + TQObject *tqparent, const char *name, + const char *classname, const TQStringList &args ); static KInstance* instance(); private: diff --git a/src/kdiff3_shell.cpp b/src/kdiff3_shell.cpp index dd83a69..044eb2b 100644 --- a/src/kdiff3_shell.cpp +++ b/src/kdiff3_shell.cpp @@ -55,7 +55,7 @@ KDiff3Shell::KDiff3Shell(bool bCompleteInit) { // now that the Part is loaded, we cast it to a Part to get // our hands on it - m_part = static_cast<KParts::ReadWritePart *>(factory->create(this, + m_part = static_cast<KParts::ReadWritePart *>(factory->create(TQT_TQOBJECT(this), "kdiff3_part", "KParts::ReadWritePart" )); if (m_part) @@ -68,7 +68,7 @@ KDiff3Shell::KDiff3Shell(bool bCompleteInit) if (bCompleteInit) ((KDiff3App*)m_part->widget())->completeInit(); - connect(((KDiff3App*)m_part->widget()), SIGNAL(createNewInstance(const QString&, const QString&, const QString&)), this, SLOT(slotNewInstance(const QString&, const QString&, const QString&))); + connect(((KDiff3App*)m_part->widget()), TQT_SIGNAL(createNewInstance(const TQString&, const TQString&, const TQString&)), this, TQT_SLOT(slotNewInstance(const TQString&, const TQString&, const TQString&))); } } else @@ -113,7 +113,7 @@ bool KDiff3Shell::queryExit() return true; } -void KDiff3Shell::closeEvent(QCloseEvent*e) +void KDiff3Shell::closeEvent(TQCloseEvent*e) { if ( queryClose() ) { @@ -164,8 +164,8 @@ void KDiff3Shell::optionsConfigureToolbars() // use the standard toolbar editor KEditToolbar dlg(factory()); - connect(&dlg, SIGNAL(newToolbarConfig()), - this, SLOT(applyNewToolbarConfig())); + connect(&dlg, TQT_SIGNAL(newToolbarConfig()), + this, TQT_SLOT(applyNewToolbarConfig())); dlg.exec(); } @@ -182,7 +182,7 @@ void KDiff3Shell::applyNewToolbarConfig() #endif } -void KDiff3Shell::slotNewInstance( const QString& fn1, const QString& fn2, const QString& fn3 ) +void KDiff3Shell::slotNewInstance( const TQString& fn1, const TQString& fn2, const TQString& fn3 ) { KDiff3Shell* pKDiff3Shell = new KDiff3Shell(false); ((KDiff3App*)pKDiff3Shell->m_part->widget())->completeInit(fn1,fn2,fn3); diff --git a/src/kdiff3_shell.h b/src/kdiff3_shell.h index 42a324b..e8fa8ec 100644 --- a/src/kdiff3_shell.h +++ b/src/kdiff3_shell.h @@ -39,6 +39,7 @@ class KToggleAction; class KDiff3Shell : public KParts::MainWindow { Q_OBJECT + TQ_OBJECT public: /** * Default Constructor @@ -52,7 +53,7 @@ public: bool queryClose(); bool queryExit(); - virtual void closeEvent(QCloseEvent*e); + virtual void closeEvent(TQCloseEvent*e); private slots: void optionsShowToolbar(); @@ -61,7 +62,7 @@ private slots: void optionsConfigureToolbars(); void applyNewToolbarConfig(); - void slotNewInstance( const QString& fn1, const QString& fn2, const QString& fn3 ); + void slotNewInstance( const TQString& fn1, const TQString& fn2, const TQString& fn3 ); private: KParts::ReadWritePart *m_part; diff --git a/src/kreplacements/ShellContextMenu.cpp b/src/kreplacements/ShellContextMenu.cpp index e1a6d2d..6be2532 100755 --- a/src/kreplacements/ShellContextMenu.cpp +++ b/src/kreplacements/ShellContextMenu.cpp @@ -21,11 +21,11 @@ #include <windows.h> #include <shlobj.h> #include <malloc.h> -#include <qstring.h> -#include <qstringlist.h> -#include <qwidget.h> -#include <qdir.h> -#include <qpopupmenu.h> +#include <tqstring.h> +#include <tqstringlist.h> +#include <tqwidget.h> +#include <tqdir.h> +#include <tqpopupmenu.h> #include "ShellContextMenu.h" #ifdef _DEBUG @@ -42,10 +42,10 @@ static char THIS_FILE[]=__FILE__; #define MAX_ID 10000 -void showShellContextMenu( const QString& itemPath, QPoint pt, QWidget* pParentWidget, QPopupMenu* pMenu ) +void showShellContextMenu( const TQString& itemPath, TQPoint pt, TQWidget* pParentWidget, TQPopupMenu* pMenu ) { CShellContextMenu scm; - scm.SetObjects(QDir::convertSeparators(itemPath)); + scm.SetObjects(TQDir::convertSeparators(itemPath)); int id = scm.ShowContextMenu (pParentWidget, pt, pMenu); if (id>=1) pMenu->activateItemAt(id-1); @@ -145,7 +145,7 @@ LRESULT CALLBACK CShellContextMenu::HookWndProc(HWND hWnd, UINT message, WPARAM } -UINT CShellContextMenu::ShowContextMenu(QWidget * pParentWidget, QPoint pt, QPopupMenu* pMenu ) +UINT CShellContextMenu::ShowContextMenu(TQWidget * pParentWidget, TQPoint pt, TQPopupMenu* pMenu ) { HWND hWnd = pParentWidget->winId(); int iMenuType = 0; // to know which version of IContextMenu is supported @@ -163,7 +163,7 @@ UINT CShellContextMenu::ShowContextMenu(QWidget * pParentWidget, QPoint pt, QPop UINT_PTR i; for( i=0; i<pMenu->count(); ++i ) { - QString s = pMenu->text(pMenu->idAt(i)); + TQString s = pMenu->text(pMenu->idAt(i)); if (!s.isEmpty()) AppendMenuW( m_hMenu, MF_STRING, i+1, (LPCWSTR)s.ucs2() ); } @@ -215,10 +215,10 @@ void CShellContextMenu::InvokeCommand (LPCONTEXTMENU pContextMenu, UINT idComman } -void CShellContextMenu::SetObjects(const QString& strObject) +void CShellContextMenu::SetObjects(const TQString& strObject) { // only one object is passed - QStringList strArray; + TQStringList strArray; strArray << strObject; // create a CStringArray with one element SetObjects (strArray); // and pass it to SetObjects (CStringArray &strArray) @@ -226,7 +226,7 @@ void CShellContextMenu::SetObjects(const QString& strObject) } -void CShellContextMenu::SetObjects(const QStringList &strList) +void CShellContextMenu::SetObjects(const TQStringList &strList) { // free all allocated datas if (m_psfFolder && bDelete) @@ -246,7 +246,7 @@ void CShellContextMenu::SetObjects(const QStringList &strList) psfDesktop->ParseDisplayName (NULL, 0, (LPOLESTR)strList[0].ucs2(), NULL, &pidl, NULL); - // now we need the parent IShellFolder interface of pidl, and the relative PIDL to that interface + // now we need the tqparent IShellFolder interface of pidl, and the relative PIDL to that interface LPITEMIDLIST pidlItem = NULL; // relative pidl SHBindToParentEx (pidl, IID_IShellFolder, (void **) &m_psfFolder, NULL); free (pidlItem); @@ -255,9 +255,9 @@ void CShellContextMenu::SetObjects(const QStringList &strList) SHGetMalloc (&lpMalloc); lpMalloc->Free (pidl); - // now we have the IShellFolder interface to the parent folder specified in the first element in strArray + // now we have the IShellFolder interface to the tqparent folder specified in the first element in strArray // since we assume that all objects are in the same folder (as it's stated in the MSDN) - // we now have the IShellFolder interface to every objects parent folder + // we now have the IShellFolder interface to every objects tqparent folder IShellFolder * psfFolder = NULL; nItems = strList.size (); @@ -295,7 +295,7 @@ void CShellContextMenu::SetObjects(LPITEMIDLIST /*pidl*/) m_pidlArray = NULL; // full qualified PIDL is passed so we need - // its parent IShellFolder interface and its relative PIDL to that + // its tqparent IShellFolder interface and its relative PIDL to that LPITEMIDLIST pidlItem = NULL; SHBindToParent ((LPCITEMIDLIST) pidl, IID_IShellFolder, (void **) &m_psfFolder, (LPCITEMIDLIST *) &pidlItem); diff --git a/src/kreplacements/ShellContextMenu.h b/src/kreplacements/ShellContextMenu.h index ae67483..e735e13 100644 --- a/src/kreplacements/ShellContextMenu.h +++ b/src/kreplacements/ShellContextMenu.h @@ -33,9 +33,9 @@ public: void SetObjects (IShellFolder * psfFolder, LPITEMIDLIST pidlItem); void SetObjects (IShellFolder * psfFolder, LPITEMIDLIST * pidlArray, int nItemCount); void SetObjects (LPITEMIDLIST pidl); - void SetObjects (const QString& strObject); - void SetObjects (const QStringList& strList); - UINT ShowContextMenu (QWidget* pParent, QPoint pt, QPopupMenu* pMenu); + void SetObjects (const TQString& strObject); + void SetObjects (const TQStringList& strList); + UINT ShowContextMenu (TQWidget* pParent, TQPoint pt, TQPopupMenu* pMenu); CShellContextMenu(); virtual ~CShellContextMenu(); diff --git a/src/kreplacements/kreplacements.cpp b/src/kreplacements/kreplacements.cpp index 95885a5..a9df56a 100644 --- a/src/kreplacements/kreplacements.cpp +++ b/src/kreplacements/kreplacements.cpp @@ -21,30 +21,30 @@ #include <assert.h> -#include <qnamespace.h> -#include <qmessagebox.h> -#include <qpopupmenu.h> -#include <qmenubar.h> -#include <qpainter.h> -#include <qcolordialog.h> -#include <qfontdialog.h> -#include <qlabel.h> -#include <qtextbrowser.h> -#include <qtextstream.h> -#include <qlayout.h> -#include <qdockarea.h> +#include <tqnamespace.h> +#include <tqmessagebox.h> +#include <tqpopupmenu.h> +#include <tqmenubar.h> +#include <tqpainter.h> +#include <tqcolordialog.h> +#include <tqfontdialog.h> +#include <tqlabel.h> +#include <tqtextbrowser.h> +#include <tqtextstream.h> +#include <tqlayout.h> +#include <tqdockarea.h> #include <vector> #include <iostream> #include <algorithm> -static QString s_copyright; -static QString s_email; -static QString s_description; -static QString s_appName; -static QString s_version; -static QString s_homepage; +static TQString s_copyright; +static TQString s_email; +static TQString s_description; +static TQString s_appName; +static TQString s_version; +static TQString s_homepage; static KAboutData* s_pAboutData; @@ -59,17 +59,17 @@ static void showHelp() char buf[200]; int r= SearchPathA( 0, ".", 0, sizeof(buf), buf, 0 ); - QString exePath; + TQString exePath; if (r!=0) { exePath = buf; } else { exePath = "."; } - QFileInfo helpFile( exePath + "\\doc\\en\\index.html" ); + TQFileInfo helpFile( exePath + "\\doc\\en\\index.html" ); if ( ! helpFile.exists() ) { helpFile.setFile( exePath + "\\..\\doc\\en\\index.html" ); } if ( ! helpFile.exists() ) { helpFile.setFile( exePath + "\\doc\\index.html" ); } if ( ! helpFile.exists() ) { helpFile.setFile( exePath + "\\..\\doc\\index.html" ); } if ( ! helpFile.exists() ) { - QMessageBox::warning( 0, "KDiff3 documentation not found", + TQMessageBox::warning( 0, "KDiff3 documentation not found", "Couldn't find the documentation. \n\n" "The documentation can also be found at the homepage:\n\n " " http://kdiff3.sourceforge.net/"); @@ -79,10 +79,10 @@ static void showHelp() HINSTANCE hi = FindExecutableA( helpFile.fileName().ascii(), helpFile.dirPath(true).ascii(), buf ); if ( int(hi)<=32 ) { - static QTextBrowser* pBrowser = 0; + static TQTextBrowser* pBrowser = 0; if (pBrowser==0) { - pBrowser = new QTextBrowser( 0 ); + pBrowser = new TQTextBrowser( 0 ); pBrowser->setMinimumSize( 600, 400 ); } pBrowser->setSource(helpFile.filePath()); @@ -90,15 +90,15 @@ static void showHelp() } else { - QFileInfo prog( buf ); + TQFileInfo prog( buf ); _spawnlp( _P_NOWAIT , prog.filePath().ascii(), prog.fileName().ascii(), ("\"file:///"+helpFile.absFilePath()+"\"").ascii(), NULL ); } #else - static QTextBrowser* pBrowser = 0; + static TQTextBrowser* pBrowser = 0; if (pBrowser==0) { - pBrowser = new QTextBrowser( 0 ); + pBrowser = new TQTextBrowser( 0 ); pBrowser->setMinimumSize( 600, 400 ); } pBrowser->setSource("/usr/local/share/doc/kdiff3/en/index.html"); @@ -106,13 +106,13 @@ static void showHelp() #endif } -QString getTranslationDir() +TQString getTranslationDir() { #ifdef _WIN32 char buf[200]; int r= SearchPathA( 0, ".", 0, sizeof(buf), buf, 0 ); - QString exePath; + TQString exePath; if (r!=0) { exePath = buf; } else { exePath = "."; } return exePath+"/translations"; @@ -122,37 +122,37 @@ QString getTranslationDir() } // static -void KMessageBox::error( QWidget* parent, const QString& text, const QString& caption ) +void KMessageBox::error( TQWidget* tqparent, const TQString& text, const TQString& caption ) { - QMessageBox::critical( parent, caption, text ); + TQMessageBox::critical( tqparent, caption, text ); } -int KMessageBox::warningContinueCancel( QWidget* parent, const QString& text, const QString& caption, - const QString& button1 ) +int KMessageBox::warningContinueCancel( TQWidget* tqparent, const TQString& text, const TQString& caption, + const TQString& button1 ) { - return 0 == QMessageBox::warning( parent, caption, text, button1, "Cancel" ) ? Continue : Cancel; + return 0 == TQMessageBox::warning( tqparent, caption, text, button1, "Cancel" ) ? Continue : Cancel; } -void KMessageBox::sorry( QWidget* parent, const QString& text, const QString& caption ) +void KMessageBox::sorry( TQWidget* tqparent, const TQString& text, const TQString& caption ) { - QMessageBox::information( parent, caption, text ); + TQMessageBox::information( tqparent, caption, text ); } -void KMessageBox::information( QWidget* parent, const QString& text, const QString& caption ) +void KMessageBox::information( TQWidget* tqparent, const TQString& text, const TQString& caption ) { - QMessageBox::information( parent, caption, text ); + TQMessageBox::information( tqparent, caption, text ); } -int KMessageBox::warningYesNo( QWidget* parent, const QString& text, const QString& caption, - const QString& button1, const QString& button2 ) +int KMessageBox::warningYesNo( TQWidget* tqparent, const TQString& text, const TQString& caption, + const TQString& button1, const TQString& button2 ) { - return 0 == QMessageBox::warning( parent, caption, text, button1, button2, QString::null, 1, 1 ) ? Yes : No; + return 0 == TQMessageBox::warning( tqparent, caption, text, button1, button2, TQString(), 1, 1 ) ? Yes : No; } -int KMessageBox::warningYesNoCancel( QWidget* parent, const QString& text, const QString& caption, - const QString& button1, const QString& button2 ) +int KMessageBox::warningYesNoCancel( TQWidget* tqparent, const TQString& text, const TQString& caption, + const TQString& button1, const TQString& button2 ) { - int val = QMessageBox::warning( parent, caption, text, + int val = TQMessageBox::warning( tqparent, caption, text, button1, button2, i18n("Cancel") ); if ( val==0 ) return Yes; if ( val==1 ) return No; @@ -160,9 +160,9 @@ int KMessageBox::warningYesNoCancel( QWidget* parent, const QString& text, const } -KDialogBase::KDialogBase( int, const QString& caption, int, int, QWidget* parent, const char* name, +KDialogBase::KDialogBase( int, const TQString& caption, int, int, TQWidget* tqparent, const char* name, bool /*modal*/, bool ) -: QTabDialog( parent, name, true /* modal */ ) +: TQTabDialog( tqparent, name, true /* modal */ ) { setCaption( caption ); setDefaultButton(); @@ -172,40 +172,40 @@ KDialogBase::KDialogBase( int, const QString& caption, int, int, QWidget* parent setOkButton(); setDefaultButton(); - connect( this, SIGNAL( defaultButtonPressed() ), this, SLOT(slotDefault()) ); - connect( this, SIGNAL( helpButtonPressed() ), this, SLOT(slotHelp())); - connect( this, SIGNAL( applyButtonPressed() ), this, SLOT( slotApply() )); + connect( this, TQT_SIGNAL( defaultButtonPressed() ), this, TQT_SLOT(slotDefault()) ); + connect( this, TQT_SIGNAL( helpButtonPressed() ), this, TQT_SLOT(slotHelp())); + connect( this, TQT_SIGNAL( applyButtonPressed() ), this, TQT_SLOT( slotApply() )); } KDialogBase::~KDialogBase() { } -void KDialogBase::incInitialSize ( const QSize& ) +void KDialogBase::incInitialSize ( const TQSize& ) { } -void KDialogBase::setHelp(const QString&, const QString& ) +void KDialogBase::setHelp(const TQString&, const TQString& ) { } -int KDialogBase::BarIcon(const QString& /*iconName*/, int ) +int KDialogBase::BarIcon(const TQString& /*iconName*/, int ) { return 0; // Not used for replacement. } -QVBox* KDialogBase::addVBoxPage( const QString& name, const QString& /*info*/, int ) +TQVBox* KDialogBase::addVBoxPage( const TQString& name, const TQString& /*info*/, int ) { - QVBox* p = new QVBox(this, name.ascii()); + TQVBox* p = new TQVBox(this, name.ascii()); addTab( p, name ); return p; } -QFrame* KDialogBase::addPage( const QString& name, const QString& /*info*/, int ) +TQFrame* KDialogBase::addPage( const TQString& name, const TQString& /*info*/, int ) { - QFrame* p = new QFrame( this, name.ascii() ); + TQFrame* p = new TQFrame( this, name.ascii() ); addTab( p, name ); return p; } @@ -226,7 +226,7 @@ void KDialogBase::accept() slotOk(); s_inAccept = false; if ( s_bAccepted ) - QTabDialog::accept(); + TQTabDialog::accept(); } else { @@ -252,37 +252,37 @@ void KDialogBase::slotHelp( ) showHelp(); } -KURL KFileDialog::getSaveURL( const QString &startDir, - const QString &filter, - QWidget *parent, const QString &caption) +KURL KFileDialog::getSaveURL( const TQString &startDir, + const TQString &filter, + TQWidget *tqparent, const TQString &caption) { - QString s = QFileDialog::getSaveFileName(startDir, filter, parent, 0, caption); + TQString s = TQFileDialog::getSaveFileName(startDir, filter, tqparent, 0, caption); return KURL(s); } -KURL KFileDialog::getOpenURL( const QString & startDir, - const QString & filter, - QWidget * parent, - const QString & caption ) +KURL KFileDialog::getOpenURL( const TQString & startDir, + const TQString & filter, + TQWidget * tqparent, + const TQString & caption ) { - QString s = QFileDialog::getOpenFileName(startDir, filter, parent, 0, caption); + TQString s = TQFileDialog::getOpenFileName(startDir, filter, tqparent, 0, caption); return KURL(s); } -KURL KFileDialog::getExistingURL( const QString & startDir, - QWidget * parent, - const QString & caption) +KURL KFileDialog::getExistingURL( const TQString & startDir, + TQWidget * tqparent, + const TQString & caption) { - QString s = QFileDialog::getExistingDirectory(startDir, parent, 0, caption); + TQString s = TQFileDialog::getExistingDirectory(startDir, tqparent, 0, caption); return KURL(s); } -QString KFileDialog::getSaveFileName (const QString &startDir, - const QString &filter, - QWidget *parent, - const QString &caption) +TQString KFileDialog::getSaveFileName (const TQString &startDir, + const TQString &filter, + TQWidget *tqparent, + const TQString &caption) { - return QFileDialog::getSaveFileName( startDir, filter, parent, 0, caption ); + return TQFileDialog::getSaveFileName( startDir, filter, tqparent, 0, caption ); } @@ -303,44 +303,44 @@ void KToolBar::setBarPos(BarPosition bp) else if ( bp == Top ) m_pMainWindow->moveDockWindow( this, DockTop ); } -KToolBar::KToolBar( QMainWindow* parent ) -: QToolBar( parent ) +KToolBar::KToolBar( TQMainWindow* tqparent ) +: TQToolBar( tqparent ) { - m_pMainWindow = parent; + m_pMainWindow = tqparent; } -KMainWindow::KMainWindow( QWidget* parent, const char* name ) -: QMainWindow( parent, name ), m_actionCollection(this) +KMainWindow::KMainWindow( TQWidget* tqparent, const char* name ) +: TQMainWindow( tqparent, name ), m_actionCollection(this) { - fileMenu = new QPopupMenu(); + fileMenu = new TQPopupMenu(); menuBar()->insertItem(i18n("&File"), fileMenu); - editMenu = new QPopupMenu(); + editMenu = new TQPopupMenu(); menuBar()->insertItem(i18n("&Edit"), editMenu); - directoryMenu = new QPopupMenu(); + directoryMenu = new TQPopupMenu(); menuBar()->insertItem(i18n("&Directory"), directoryMenu); dirCurrentItemMenu = 0; dirCurrentSyncItemMenu = 0; - movementMenu = new QPopupMenu(); + movementMenu = new TQPopupMenu(); menuBar()->insertItem(i18n("&Movement"), movementMenu); - diffMenu = new QPopupMenu(); + diffMenu = new TQPopupMenu(); menuBar()->insertItem(i18n("D&iffview"), diffMenu); - mergeMenu = new QPopupMenu(); + mergeMenu = new TQPopupMenu(); menuBar()->insertItem(i18n("&Merge"), mergeMenu); - windowsMenu = new QPopupMenu(); + windowsMenu = new TQPopupMenu(); menuBar()->insertItem(i18n("&Window"), windowsMenu); - settingsMenu = new QPopupMenu(); + settingsMenu = new TQPopupMenu(); menuBar()->insertItem(i18n("&Settings"), settingsMenu); - helpMenu = new QPopupMenu(); + helpMenu = new TQPopupMenu(); menuBar()->insertItem(i18n("&Help"), helpMenu); m_pToolBar = new KToolBar(this); - memberList = new QList<KMainWindow>; + memberList = new TQList<KMainWindow>; memberList->append(this); } -KToolBar* KMainWindow::toolBar(const QString&) +KToolBar* KMainWindow::toolBar(const TQString&) { return m_pToolBar; } @@ -352,17 +352,17 @@ KActionCollection* KMainWindow::actionCollection() void KMainWindow::createGUI() { - KStdAction::help(this, SLOT(slotHelp()), actionCollection()); - KStdAction::about(this, SLOT(slotAbout()), actionCollection()); - KStdAction::aboutQt(actionCollection()); + KStdAction::help(this, TQT_SLOT(slotHelp()), actionCollection()); + KStdAction::about(this, TQT_SLOT(slotAbout()), actionCollection()); + KStdAction::aboutTQt(actionCollection()); } void KMainWindow::slotAbout() { - QTabDialog d; + TQTabDialog d; d.setCaption("About " + s_appName); - QTextBrowser* tb1 = new QTextBrowser(&d); - tb1->setWordWrap( QTextEdit::NoWrap ); + TQTextBrowser* tb1 = new TQTextBrowser(&d); + tb1->setWordWrap( TQTextEdit::NoWrap ); tb1->setText( s_appName + " Version " + s_version + "\n\n" + s_description + @@ -374,7 +374,7 @@ void KMainWindow::slotAbout() std::list<KAboutData::AboutDataEntry>::iterator i; - QString s2; + TQString s2; for( i=s_pAboutData->m_authorList.begin(); i!=s_pAboutData->m_authorList.end(); ++i ) { if ( !i->m_name.isEmpty() ) s2 += i->m_name + "\n"; @@ -383,12 +383,12 @@ void KMainWindow::slotAbout() if ( !i->m_weblink.isEmpty() ) s2 += " " + i->m_weblink + "\n"; s2 += "\n"; } - QTextBrowser* tb2 = new QTextBrowser(&d); - tb2->setWordWrap( QTextEdit::NoWrap ); + TQTextBrowser* tb2 = new TQTextBrowser(&d); + tb2->setWordWrap( TQTextEdit::NoWrap ); tb2->setText(s2); d.addTab(tb2,i18n("A&uthor")); - QString s3; + TQString s3; for( i=s_pAboutData->m_creditList.begin(); i!=s_pAboutData->m_creditList.end(); ++i ) { if ( !i->m_name.isEmpty() ) s3 += i->m_name + "\n"; @@ -397,15 +397,15 @@ void KMainWindow::slotAbout() if ( !i->m_weblink.isEmpty() ) s3 += " " + i->m_weblink + "\n"; s3 += "\n"; } - QTextBrowser* tb3 = new QTextBrowser(&d); - tb3->setWordWrap( QTextEdit::NoWrap ); + TQTextBrowser* tb3 = new TQTextBrowser(&d); + tb3->setWordWrap( TQTextEdit::NoWrap ); tb3->setText(s3); d.addTab(tb3,i18n("&Thanks To")); d.resize(400,300); d.exec(); /* - QMessageBox::information( + TQMessageBox::information( this, "About " + s_appName, s_appName + " Version " + s_version + @@ -423,21 +423,21 @@ void KMainWindow::slotHelp() } -QString KStandardDirs::findResource(const QString& resource, const QString& /*appName*/) +TQString KStandardDirs::findResource(const TQString& resource, const TQString& /*appName*/) { if (resource=="config") { - QString home = QDir::homeDirPath(); + TQString home = TQDir::homeDirPath(); return home + "/.kdiff3rc"; } - return QString(); + return TQString(); } KConfig::KConfig() { } -void KConfig::readConfigFile( const QString& configFileName ) +void KConfig::readConfigFile( const TQString& configFileName ) { if ( !configFileName.isEmpty() ) { @@ -448,10 +448,10 @@ void KConfig::readConfigFile( const QString& configFileName ) m_fileName = KStandardDirs().findResource("config","kdiff3rc"); } - QFile f( m_fileName ); + TQFile f( m_fileName ); if ( f.open(IO_ReadOnly) ) { // file opened successfully - QTextStream t( &f ); // use a text stream + TQTextStream t( &f ); // use a text stream load(t); f.close(); } @@ -459,31 +459,31 @@ void KConfig::readConfigFile( const QString& configFileName ) KConfig::~KConfig() { - QFile f(m_fileName); + TQFile f(m_fileName); if ( f.open( IO_WriteOnly | IO_Translate ) ) { // file opened successfully - QTextStream t( &f ); // use a text stream + TQTextStream t( &f ); // use a text stream save(t); f.close(); } } -void KConfig::setGroup(const QString&) +void KConfig::setGroup(const TQString&) { } -void KAction::init(QObject* receiver, const char* slot, KActionCollection* actionCollection, +void KAction::init(TQObject* receiver, const char* slot, KActionCollection* actionCollection, const char* name, bool bToggle, bool bMenu) { - QString n(name); + TQString n(name); KMainWindow* p = actionCollection->m_pMainWindow; if( slot!=0 ) { if (!bToggle) - connect(this, SIGNAL(activated()), receiver, slot); + connect(this, TQT_SIGNAL(activated()), receiver, slot); else { - connect(this, SIGNAL(toggled(bool)), receiver, slot); + connect(this, TQT_SIGNAL(toggled(bool)), receiver, slot); } } @@ -494,9 +494,9 @@ void KAction::init(QObject* receiver, const char* slot, KActionCollection* actio { if ( p->dirCurrentItemMenu==0 ) { - p->dirCurrentItemMenu = new QPopupMenu(); + p->dirCurrentItemMenu = new TQPopupMenu(); p->directoryMenu->insertItem(i18n("Current Item Merge Operation"), p->dirCurrentItemMenu); - p->dirCurrentSyncItemMenu = new QPopupMenu(); + p->dirCurrentSyncItemMenu = new TQPopupMenu(); p->directoryMenu->insertItem(i18n("Current Item Sync Operation"), p->dirCurrentSyncItemMenu); } addTo( p->dirCurrentItemMenu ); @@ -505,9 +505,9 @@ void KAction::init(QObject* receiver, const char* slot, KActionCollection* actio { if ( p->dirCurrentItemMenu==0 ) { - p->dirCurrentItemMenu = new QPopupMenu(); + p->dirCurrentItemMenu = new TQPopupMenu(); p->directoryMenu->insertItem(i18n("Current Item Merge Operation"), p->dirCurrentItemMenu); - p->dirCurrentSyncItemMenu = new QPopupMenu(); + p->dirCurrentSyncItemMenu = new TQPopupMenu(); p->directoryMenu->insertItem(i18n("Current Item Sync Operation"), p->dirCurrentSyncItemMenu); } addTo( p->dirCurrentSyncItemMenu ); @@ -521,11 +521,11 @@ void KAction::init(QObject* receiver, const char* slot, KActionCollection* actio } -KAction::KAction(const QString& text, const QIconSet& icon, int accel, - QObject* receiver, const char* slot, KActionCollection* actionCollection, +KAction::KAction(const TQString& text, const TQIconSet& icon, int accel, + TQObject* receiver, const char* slot, KActionCollection* actionCollection, const char* name, bool bToggle, bool bMenu ) -: QAction ( text, icon, text, accel, actionCollection->m_pMainWindow, name, bToggle ) +: TQAction ( text, icon, text, accel, actionCollection->m_pMainWindow, name, bToggle ) { KMainWindow* p = actionCollection->m_pMainWindow; if ( !icon.isNull() && p ) this->addTo( p->m_pToolBar ); @@ -533,36 +533,36 @@ KAction::KAction(const QString& text, const QIconSet& icon, int accel, init(receiver,slot,actionCollection,name,bToggle,bMenu); } -KAction::KAction(const QString& text, int accel, - QObject* receiver, const char* slot, KActionCollection* actionCollection, +KAction::KAction(const TQString& text, int accel, + TQObject* receiver, const char* slot, KActionCollection* actionCollection, const char* name, bool bToggle, bool bMenu ) -: QAction ( text, text, accel, actionCollection->m_pMainWindow, name, bToggle ) +: TQAction ( text, text, accel, actionCollection->m_pMainWindow, name, bToggle ) { init(receiver,slot,actionCollection,name,bToggle,bMenu); } -void KAction::setStatusText(const QString&) +void KAction::setStatusText(const TQString&) { } -void KAction::plug(QPopupMenu* menu) +void KAction::plug(TQPopupMenu* menu) { addTo(menu); } -KToggleAction::KToggleAction(const QString& text, const QIconSet& icon, int accel, QObject* receiver, const char* slot, KActionCollection* actionCollection, const char* name, bool bMenu) +KToggleAction::KToggleAction(const TQString& text, const TQIconSet& icon, int accel, TQObject* receiver, const char* slot, KActionCollection* actionCollection, const char* name, bool bMenu) : KAction( text, icon, accel, receiver, slot, actionCollection, name, true, bMenu) { } -KToggleAction::KToggleAction(const QString& text, int accel, QObject* receiver, const char* slot, KActionCollection* actionCollection, const char* name, bool bMenu) +KToggleAction::KToggleAction(const TQString& text, int accel, TQObject* receiver, const char* slot, KActionCollection* actionCollection, const char* name, bool bMenu) : KAction( text, accel, receiver, slot, actionCollection, name, true, bMenu) { } -KToggleAction::KToggleAction(const QString& text, const QIconSet& icon, int accel, KActionCollection* actionCollection, const char* name, bool bMenu) +KToggleAction::KToggleAction(const TQString& text, const TQIconSet& icon, int accel, KActionCollection* actionCollection, const char* name, bool bMenu) : KAction( text, icon, accel, 0, 0, actionCollection, name, true, bMenu) { } @@ -582,144 +582,144 @@ bool KToggleAction::isChecked() //static -KAction* KStdAction::open( QWidget* parent, const char* slot, KActionCollection* actionCollection) +KAction* KStdAction::open( TQWidget* tqparent, const char* slot, KActionCollection* actionCollection) { #include "../xpm/fileopen.xpm" KMainWindow* p = actionCollection->m_pMainWindow; - KAction* a = new KAction( i18n("Open"), QIconSet(QPixmap(fileopen)), Qt::CTRL+Qt::Key_O, parent, slot, actionCollection, "open", false, false); + KAction* a = new KAction( i18n("Open"), TQIconSet(TQPixmap(fileopen)), TQt::CTRL+TQt::Key_O, tqparent, slot, actionCollection, "open", false, false); if(p){ a->addTo( p->fileMenu ); } return a; } -KAction* KStdAction::save( QWidget* parent, const char* slot, KActionCollection* actionCollection ) +KAction* KStdAction::save( TQWidget* tqparent, const char* slot, KActionCollection* actionCollection ) { #include "../xpm/filesave.xpm" KMainWindow* p = actionCollection->m_pMainWindow; - KAction* a = new KAction( i18n("Save"), QIconSet(QPixmap(filesave)), Qt::CTRL+Qt::Key_S, parent, slot, actionCollection, "save", false, false); + KAction* a = new KAction( i18n("Save"), TQIconSet(TQPixmap(filesave)), TQt::CTRL+TQt::Key_S, tqparent, slot, actionCollection, "save", false, false); if(p){ a->addTo( p->fileMenu ); } return a; } -KAction* KStdAction::saveAs( QWidget* parent, const char* slot, KActionCollection* actionCollection) +KAction* KStdAction::saveAs( TQWidget* tqparent, const char* slot, KActionCollection* actionCollection) { KMainWindow* p = actionCollection->m_pMainWindow; - KAction* a = new KAction( i18n("Save As..."), 0, parent, slot, actionCollection, "saveas", false, false); + KAction* a = new KAction( i18n("Save As..."), 0, tqparent, slot, actionCollection, "saveas", false, false); if(p) a->addTo( p->fileMenu ); return a; } -KAction* KStdAction::print( QWidget* parent, const char* slot, KActionCollection* actionCollection) +KAction* KStdAction::print( TQWidget* tqparent, const char* slot, KActionCollection* actionCollection) { #include "../xpm/fileprint.xpm" KMainWindow* p = actionCollection->m_pMainWindow; - KAction* a = new KAction( i18n("Print..."), QIconSet(QPixmap(fileprint)),Qt::CTRL+Qt::Key_P, parent, slot, actionCollection, "print", false, false); + KAction* a = new KAction( i18n("Print..."), TQIconSet(TQPixmap(fileprint)),TQt::CTRL+TQt::Key_P, tqparent, slot, actionCollection, "print", false, false); if(p) a->addTo( p->fileMenu ); return a; } -KAction* KStdAction::quit( QWidget* parent, const char* slot, KActionCollection* actionCollection) +KAction* KStdAction::quit( TQWidget* tqparent, const char* slot, KActionCollection* actionCollection) { KMainWindow* p = actionCollection->m_pMainWindow; - KAction* a = new KAction( i18n("Quit"), Qt::CTRL+Qt::Key_Q, parent, slot, actionCollection, "quit", false, false); + KAction* a = new KAction( i18n("Quit"), TQt::CTRL+TQt::Key_Q, tqparent, slot, actionCollection, "quit", false, false); if(p) a->addTo( p->fileMenu ); return a; } -KAction* KStdAction::cut( QWidget* parent, const char* slot, KActionCollection* actionCollection) +KAction* KStdAction::cut( TQWidget* tqparent, const char* slot, KActionCollection* actionCollection) { KMainWindow* p = actionCollection->m_pMainWindow; - KAction* a = new KAction( i18n("Cut"), Qt::CTRL+Qt::Key_X, parent, slot, actionCollection, "cut", false, false ); + KAction* a = new KAction( i18n("Cut"), TQt::CTRL+TQt::Key_X, tqparent, slot, actionCollection, "cut", false, false ); if(p) a->addTo( p->editMenu ); return a; } -KAction* KStdAction::copy( QWidget* parent, const char* slot, KActionCollection* actionCollection) +KAction* KStdAction::copy( TQWidget* tqparent, const char* slot, KActionCollection* actionCollection) { KMainWindow* p = actionCollection->m_pMainWindow; - KAction* a = new KAction( i18n("Copy"), Qt::CTRL+Qt::Key_C, parent, slot, actionCollection, "copy", false, false ); + KAction* a = new KAction( i18n("Copy"), TQt::CTRL+TQt::Key_C, tqparent, slot, actionCollection, "copy", false, false ); if(p) a->addTo( p->editMenu ); return a; } -KAction* KStdAction::paste( QWidget* parent, const char* slot, KActionCollection* actionCollection) +KAction* KStdAction::paste( TQWidget* tqparent, const char* slot, KActionCollection* actionCollection) { KMainWindow* p = actionCollection->m_pMainWindow; - KAction* a = new KAction( i18n("Paste"), Qt::CTRL+Qt::Key_V, parent, slot, actionCollection, "paste", false, false ); + KAction* a = new KAction( i18n("Paste"), TQt::CTRL+TQt::Key_V, tqparent, slot, actionCollection, "paste", false, false ); if(p) a->addTo( p->editMenu ); return a; } -KAction* KStdAction::selectAll( QWidget* parent, const char* slot, KActionCollection* actionCollection) +KAction* KStdAction::selectAll( TQWidget* tqparent, const char* slot, KActionCollection* actionCollection) { KMainWindow* p = actionCollection->m_pMainWindow; - KAction* a = new KAction( i18n("Select All"), Qt::CTRL+Qt::Key_A, parent, slot, actionCollection, "selectall", false, false ); + KAction* a = new KAction( i18n("Select All"), TQt::CTRL+TQt::Key_A, tqparent, slot, actionCollection, "selectall", false, false ); if(p) a->addTo( p->editMenu ); return a; } -KToggleAction* KStdAction::showToolbar( QWidget* parent, const char* slot, KActionCollection* actionCollection) +KToggleAction* KStdAction::showToolbar( TQWidget* tqparent, const char* slot, KActionCollection* actionCollection) { KMainWindow* p = actionCollection->m_pMainWindow; - KToggleAction* a = new KToggleAction( i18n("Show Toolbar"), 0, parent, slot, actionCollection, "showtoolbar", false ); + KToggleAction* a = new KToggleAction( i18n("Show Toolbar"), 0, tqparent, slot, actionCollection, "showtoolbar", false ); if(p) a->addTo( p->settingsMenu ); return a; } -KToggleAction* KStdAction::showStatusbar( QWidget* parent, const char* slot, KActionCollection* actionCollection) +KToggleAction* KStdAction::showStatusbar( TQWidget* tqparent, const char* slot, KActionCollection* actionCollection) { KMainWindow* p = actionCollection->m_pMainWindow; - KToggleAction* a = new KToggleAction( i18n("Show &Statusbar"), 0, parent, slot, actionCollection, "showstatusbar", false ); + KToggleAction* a = new KToggleAction( i18n("Show &Statusbar"), 0, tqparent, slot, actionCollection, "showstatusbar", false ); if(p) a->addTo( p->settingsMenu ); return a; } -KAction* KStdAction::preferences( QWidget* parent, const char* slot, KActionCollection* actionCollection) +KAction* KStdAction::preferences( TQWidget* tqparent, const char* slot, KActionCollection* actionCollection) { KMainWindow* p = actionCollection->m_pMainWindow; - KAction* a = new KAction( i18n("&Configure %1...").arg("KDiff3"), 0, parent, slot, actionCollection, "settings", false, false ); + KAction* a = new KAction( i18n("&Configure %1...").tqarg("KDiff3"), 0, tqparent, slot, actionCollection, "settings", false, false ); if(p) a->addTo( p->settingsMenu ); return a; } -KAction* KStdAction::keyBindings( QWidget*, const char*, KActionCollection*) +KAction* KStdAction::keyBindings( TQWidget*, const char*, KActionCollection*) { return 0; } -KAction* KStdAction::about( QWidget* parent, const char* slot, KActionCollection* actionCollection) +KAction* KStdAction::about( TQWidget* tqparent, const char* slot, KActionCollection* actionCollection) { KMainWindow* p = actionCollection->m_pMainWindow; - KAction* a = new KAction( i18n("About")+" KDiff3", 0, parent, slot, actionCollection, "about_kdiff3", false, false ); + KAction* a = new KAction( i18n("About")+" KDiff3", 0, tqparent, slot, actionCollection, "about_kdiff3", false, false ); if(p) a->addTo( p->helpMenu ); return a; } -KAction* KStdAction::aboutQt( KActionCollection* actionCollection ) +KAction* KStdAction::aboutTQt( KActionCollection* actionCollection ) { KMainWindow* p = actionCollection->m_pMainWindow; - KAction* a = new KAction( i18n("About")+" Qt", 0, qApp, SLOT(aboutQt()), actionCollection, "about_qt", false, false ); + KAction* a = new KAction( i18n("About")+" TQt", 0, tqApp, TQT_SLOT(aboutTQt()), actionCollection, "about_qt", false, false ); if(p) a->addTo( p->helpMenu ); return a; } -KAction* KStdAction::help( QWidget* parent, const char* slot, KActionCollection* actionCollection) +KAction* KStdAction::help( TQWidget* tqparent, const char* slot, KActionCollection* actionCollection) { KMainWindow* p = actionCollection->m_pMainWindow; - KAction* a = new KAction( i18n("Help"), Qt::Key_F1, parent, slot, actionCollection, "help", false, false ); + KAction* a = new KAction( i18n("Help"), TQt::Key_F1, tqparent, slot, actionCollection, "help", false, false ); if(p) a->addTo( p->helpMenu ); return a; } -KAction* KStdAction::find( QWidget* parent, const char* slot, KActionCollection* actionCollection) +KAction* KStdAction::tqfind( TQWidget* tqparent, const char* slot, KActionCollection* actionCollection) { KMainWindow* p = actionCollection->m_pMainWindow; - KAction* a = new KAction( i18n("Find"), Qt::CTRL+Qt::Key_F, parent, slot, actionCollection, "find", false, false ); + KAction* a = new KAction( i18n("Find"), TQt::CTRL+TQt::Key_F, tqparent, slot, actionCollection, "tqfind", false, false ); if(p) a->addTo( p->editMenu ); return a; } -KAction* KStdAction::findNext( QWidget* parent, const char* slot, KActionCollection* actionCollection) +KAction* KStdAction::findNext( TQWidget* tqparent, const char* slot, KActionCollection* actionCollection) { KMainWindow* p = actionCollection->m_pMainWindow; - KAction* a = new KAction( i18n("Find Next"), Qt::Key_F3, parent, slot, actionCollection, "findNext", false, false ); + KAction* a = new KAction( i18n("Find Next"), TQt::Key_F3, tqparent, slot, actionCollection, "findNext", false, false ); if(p) a->addTo( p->editMenu ); return a; } @@ -727,16 +727,16 @@ KAction* KStdAction::findNext( QWidget* parent, const char* slot, KActionCollect -KFontChooser::KFontChooser( QWidget* pParent, const QString& /*name*/, bool, const QStringList&, bool, int ) -: QWidget(pParent) +KFontChooser::KFontChooser( TQWidget* pParent, const TQString& /*name*/, bool, const TQStringList&, bool, int ) +: TQWidget(pParent) { m_pParent = pParent; - QVBoxLayout* pLayout = new QVBoxLayout( this ); - m_pSelectFont = new QPushButton(i18n("Select Font"), this ); - connect(m_pSelectFont, SIGNAL(clicked()), this, SLOT(slotSelectFont())); + TQVBoxLayout* pLayout = new TQVBoxLayout( this ); + m_pSelectFont = new TQPushButton(i18n("Select Font"), this ); + connect(m_pSelectFont, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotSelectFont())); pLayout->addWidget(m_pSelectFont); - m_pLabel = new QLabel( "", this ); + m_pLabel = new TQLabel( "", this ); m_pLabel->setFont( m_font ); m_pLabel->setMinimumWidth(200); m_pLabel->setText( "The quick brown fox jumps over the river\n" @@ -745,12 +745,12 @@ KFontChooser::KFontChooser( QWidget* pParent, const QString& /*name*/, bool, con pLayout->addWidget(m_pLabel); } -QFont KFontChooser::font() +TQFont KFontChooser::font() { - return m_font;//QFont("courier",10); + return m_font;//TQFont("courier",10); } -void KFontChooser::setFont( const QFont& font, bool ) +void KFontChooser::setFont( const TQFont& font, bool ) { m_font = font; m_pLabel->setFont( m_font ); @@ -762,9 +762,9 @@ void KFontChooser::slotSelectFont() for(;;) { bool bOk; - m_font = QFontDialog::getFont(&bOk, m_font ); + m_font = TQFontDialog::getFont(&bOk, m_font ); m_pLabel->setFont( m_font ); - QFontMetrics fm(m_font); + TQFontMetrics fm(m_font); // Variable width font. if ( fm.width('W')!=fm.width('i') ) @@ -785,27 +785,27 @@ void KFontChooser::slotSelectFont() } -KColorButton::KColorButton(QWidget* parent) -: QPushButton(parent) +KColorButton::KColorButton(TQWidget* tqparent) +: TQPushButton(tqparent) { - connect( this, SIGNAL(clicked()), this, SLOT(slotClicked())); + connect( this, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotClicked())); } -QColor KColorButton::color() +TQColor KColorButton::color() { return m_color; } -void KColorButton::setColor( const QColor& color ) +void KColorButton::setColor( const TQColor& color ) { m_color = color; update(); } -void KColorButton::paintEvent( QPaintEvent* e ) +void KColorButton::paintEvent( TQPaintEvent* e ) { - QPushButton::paintEvent(e); - QPainter p(this); + TQPushButton::paintEvent(e); + TQPainter p(this); int w = width(); int h = height(); @@ -816,7 +816,7 @@ void KColorButton::paintEvent( QPaintEvent* e ) void KColorButton::slotClicked() { // Under Windows ChooseColor() should be used. (Nicer if few colors exist.) - QColor c = QColorDialog::getColor ( m_color, this ); + TQColor c = TQColorDialog::getColor ( m_color, this ); if ( c.isValid() ) m_color = c; update(); } @@ -824,9 +824,9 @@ void KColorButton::slotClicked() KPrinter::KPrinter() { } -QValueList<int> KPrinter::pageList() +TQValueList<int> KPrinter::pageList() { - QValueList<int> vl; + TQValueList<int> vl; int to = toPage(); for(int i=fromPage(); i<=to; ++i) { @@ -842,14 +842,14 @@ void KPrinter::setPageSelection(e_PageSelection) } -QPixmap KIconLoader::loadIcon( const QString&, int ) +TQPixmap KIconLoader::loadIcon( const TQString&, int ) { - return QPixmap(); + return TQPixmap(); } -KAboutData::KAboutData( const QString& /*name*/, const QString& appName, const QString& version, - const QString& description, int, - const QString& copyright, int, const QString& homepage, const QString& email) +KAboutData::KAboutData( const TQString& /*name*/, const TQString& appName, const TQString& version, + const TQString& description, int, + const TQString& copyright, int, const TQString& homepage, const TQString& email) { s_copyright = copyright; s_email = email; @@ -859,7 +859,7 @@ KAboutData::KAboutData( const QString& /*name*/, const QString& appName, const Q s_homepage = homepage; } -KAboutData::KAboutData( const QString& /*name*/, const QString& /*appName*/, const QString& /*version*/ ) +KAboutData::KAboutData( const TQString& /*name*/, const TQString& /*appName*/, const TQString& /*version*/ ) { } @@ -913,16 +913,16 @@ int KCmdLineArgs::count() return s_vArg.size(); } -QString KCmdLineArgs::arg(int idx) +TQString KCmdLineArgs::arg(int idx) { - return QString::fromLocal8Bit( s_vArg[idx] ); + return TQString::fromLocal8Bit( s_vArg[idx] ); } void KCmdLineArgs::clear() { } -QString KCmdLineArgs::getOption( const QString& s ) +TQString KCmdLineArgs::getOption( const TQString& s ) { // Find the option int j=0; @@ -932,16 +932,16 @@ QString KCmdLineArgs::getOption( const QString& s ) const char* pos = strchr( optName,' ' ); int len = pos==0 ? strlen( optName ) : pos - optName; - if( s == (const char*)( QCString( optName, len+1) ) ) + if( s == (const char*)( TQCString( optName, len+1) ) ) { - return s_vOption[j].isEmpty() ? QString() : s_vOption[j].last(); + return s_vOption[j].isEmpty() ? TQString() : s_vOption[j].last(); } } assert(false); - return QString(); + return TQString(); } -QCStringList KCmdLineArgs::getOptionList( const QString& s ) +QCStringList KCmdLineArgs::getOptionList( const TQString& s ) { // Find the option int j=0; @@ -951,7 +951,7 @@ QCStringList KCmdLineArgs::getOptionList( const QString& s ) const char* pos = strchr( optName,' ' ); int len = pos==0 ? strlen( optName ) : pos - optName; - if( s == (const char*)( QCString( optName, len+1) ) ) + if( s == (const char*)( TQCString( optName, len+1) ) ) { return s_vOption[j]; } @@ -961,14 +961,14 @@ QCStringList KCmdLineArgs::getOptionList( const QString& s ) return QCStringList(); } -bool KCmdLineArgs::isSet(const QString& s) +bool KCmdLineArgs::isSet(const TQString& s) { // Find the option int j=0; for( j=0; j<(int)s_vOption.size(); ++j ) { const char* optName = s_pOptions[j].name; - if( s == QString( optName ) ) + if( s == TQString( optName ) ) { return ! s_vOption[j].isEmpty(); } @@ -981,7 +981,7 @@ bool KCmdLineArgs::isSet(const QString& s) KApplication* kapp; KApplication::KApplication() -: QApplication( s_argc,s_argv ) +: TQApplication( s_argc,s_argv ) { kapp = this; @@ -999,10 +999,10 @@ KApplication::KApplication() } // First find the option "-config" or "--config" to allow loading of options - QString configFileName; + TQString configFileName; for( i=1; i<s_argc-1; ++i ) { - QString arg = s_argv[i]; + TQString arg = s_argv[i]; if ( arg == "-config" || arg == "--config" ) { configFileName = s_argv[i+1]; @@ -1010,8 +1010,8 @@ KApplication::KApplication() } m_config.readConfigFile(configFileName); - QStringList ignorableCmdLineOptionsList = m_config.readListEntry("IgnorableCmdLineOptions", QString("-u;-query;-html;-abort"), '|'); - QString ignorableCmdLineOptions; + TQStringList ignorableCmdLineOptionsList = m_config.readListEntry("IgnorableCmdLineOptions", TQString("-u;-query;-html;-abort"), '|'); + TQString ignorableCmdLineOptions; if ( !ignorableCmdLineOptionsList.isEmpty() ) ignorableCmdLineOptions = ignorableCmdLineOptionsList.front() + ";"; @@ -1021,7 +1021,7 @@ KApplication::KApplication() { if ( s_argv[i][0]=='-' ) // An option { - if ( ignorableCmdLineOptions.contains(QString(s_argv[i])+";") ) + if ( ignorableCmdLineOptions.tqcontains(TQString(s_argv[i])+";") ) continue; // Find the option int j=0; @@ -1048,8 +1048,8 @@ KApplication::KApplication() } if (j==nofOptions) { - QString s; - s = QString("Unknown option: ") + s_argv[i] + "\n"; + TQString s; + s = TQString("Unknown option: ") + s_argv[i] + "\n"; s += "If KDiff3 should ignore this option, run KDiff3 normally and edit\n" "the \"Command line options to ignore\" in the \"Integration Settings\".\n\n"; @@ -1078,7 +1078,7 @@ KApplication::KApplication() if ( strlen(s_pOptions[j].name)>1 ) s += "-"; } s += s_pOptions[j].name; - s += QString().fill(' ', minMaxLimiter( 20 - ((int)s.length()-pos), 3, 20 ) ); + s += TQString().fill(' ', minMaxLimiter( 20 - ((int)s.length()-pos), 3, 20 ) ); s += s_pOptions[j].description; s +="\n"; pos=s.length(); @@ -1095,7 +1095,7 @@ KApplication::KApplication() s += "\n"+i18n("For more documentation, see the help-menu or the subdirectory doc.")+"\n"; #ifdef _WIN32 // A windows program has no console - if ( 0==QMessageBox::information(0, i18n("KDiff3-Usage"), s, i18n("Ignore"),i18n("Exit") ) ) + if ( 0==TQMessageBox::information(0, i18n("KDiff3-Usage"), s, i18n("Ignore"),i18n("Exit") ) ) continue; #else std::cerr << s.latin1() << std::endl; @@ -1163,18 +1163,18 @@ KLibLoader* KLibLoader::self() } extern "C" void* init_libkdiff3part(); -KLibFactory* KLibLoader::factory(QString const&) +KLibFactory* KLibLoader::factory(TQString const&) { return (KLibFactory*) init_libkdiff3part(); } -QObject* KLibFactory::create(QObject* pParent, const QString& name, const QString& classname ) +TQObject* KLibFactory::create(TQObject* pParent, const TQString& name, const TQString& classname ) { KParts::Factory* f = dynamic_cast<KParts::Factory*>(this); if (f!=0) - return f->createPartObject( (QWidget*)pParent, name.ascii(), + return f->createPartObject( (TQWidget*)pParent, name.ascii(), pParent, name.ascii(), - classname.ascii(), QStringList() ); + classname.ascii(), TQStringList() ); else return 0; } diff --git a/src/kreplacements/kreplacements.h b/src/kreplacements/kreplacements.h index 1402d51..8ae77d3 100644 --- a/src/kreplacements/kreplacements.h +++ b/src/kreplacements/kreplacements.h @@ -20,25 +20,25 @@ #include "common.h" -#include <qobject.h> -#include <qtabdialog.h> -#include <qmainwindow.h> -#include <qaction.h> -#include <qfiledialog.h> -#include <qapplication.h> -#include <qvbox.h> -#include <qpushbutton.h> -#include <qstatusbar.h> -#include <qtoolbar.h> -#include <qprogressbar.h> -#include <qpopupmenu.h> -#include <qstringlist.h> -#include <qprinter.h> +#include <tqobject.h> +#include <tqtabdialog.h> +#include <tqmainwindow.h> +#include <tqaction.h> +#include <tqfiledialog.h> +#include <tqapplication.h> +#include <tqvbox.h> +#include <tqpushbutton.h> +#include <statusbar.h> +#include <tqtoolbar.h> +#include <tqprogressbar.h> +#include <tqpopupmenu.h> +#include <tqstringlist.h> +#include <tqprinter.h> #include <map> #include <list> -QString getTranslationDir(); +TQString getTranslationDir(); class KMainWindow; @@ -46,61 +46,62 @@ class KURL { public: KURL(){} - KURL(const QString& s){ m_s = s; } - static KURL fromPathOrURL( const QString& s ){ return KURL(s); } - QString url() const { return m_s; } + KURL(const TQString& s){ m_s = s; } + static KURL fromPathOrURL( const TQString& s ){ return KURL(s); } + TQString url() const { return m_s; } bool isEmpty() const { return m_s.isEmpty(); } - QString prettyURL() const { return m_s; } + TQString prettyURL() const { return m_s; } bool isLocalFile() const { return true; } bool isValid() const { return true; } - QString path() const { return m_s; } - void setPath( const QString& s ){ m_s=s; } - QString fileName() const { return m_s; } // not really needed - void addPath( const QString& s ){ m_s += "/" + s; } + TQString path() const { return m_s; } + void setPath( const TQString& s ){ m_s=s; } + TQString fileName() const { return m_s; } // not really needed + void addPath( const TQString& s ){ m_s += "/" + s; } private: - QString m_s; + TQString m_s; }; class KMessageBox { public: - static void error( QWidget* parent, const QString& text, const QString& caption=QString() ); - static int warningContinueCancel( QWidget* parent, const QString& text, const QString& caption=QString(), - const QString& button1=QString("Continue") ); - static void sorry( QWidget* parent, const QString& text, const QString& caption=QString() ); - static void information( QWidget* parent, const QString& text, const QString& caption=QString() ); - static int warningYesNo( QWidget* parent, const QString& text, const QString& caption, - const QString& button1, const QString& button2 ); + static void error( TQWidget* tqparent, const TQString& text, const TQString& caption=TQString() ); + static int warningContinueCancel( TQWidget* tqparent, const TQString& text, const TQString& caption=TQString(), + const TQString& button1=TQString("Continue") ); + static void sorry( TQWidget* tqparent, const TQString& text, const TQString& caption=TQString() ); + static void information( TQWidget* tqparent, const TQString& text, const TQString& caption=TQString() ); + static int warningYesNo( TQWidget* tqparent, const TQString& text, const TQString& caption, + const TQString& button1, const TQString& button2 ); static int warningYesNoCancel( - QWidget* parent, const QString& text, const QString& caption, - const QString& button1, const QString& button2 ); + TQWidget* tqparent, const TQString& text, const TQString& caption, + const TQString& button1, const TQString& button2 ); enum {Cancel=-1, No=0, Yes=1, Continue=1}; }; -#define i18n(x) QObject::tr(x) +#define i18n(x) TQObject::tr(x) #define I18N_NOOP(x) x #define RESTORE(x) #define _UNLOAD(x) -typedef QPopupMenu KPopupMenu; +typedef TQPopupMenu KPopupMenu; -class KDialogBase : public QTabDialog +class KDialogBase : public TQTabDialog { Q_OBJECT + TQ_OBJECT public: - KDialogBase( int, const QString& caption, int, int, QWidget* parent, const char* name, + KDialogBase( int, const TQString& caption, int, int, TQWidget* tqparent, const char* name, bool /*modal*/, bool ); ~KDialogBase(); - void incInitialSize ( const QSize& ); - void setHelp(const QString& helpfilename, const QString& ); + void incInitialSize ( const TQSize& ); + void setHelp(const TQString& helpfilename, const TQString& ); enum {IconList, Help, Default, Apply, Ok, Cancel }; - int BarIcon(const QString& iconName, int ); + int BarIcon(const TQString& iconName, int ); - QVBox* addVBoxPage( const QString& name, const QString& info, int ); - QFrame* addPage( const QString& name, const QString& info, int ); + TQVBox* addVBoxPage( const TQString& name, const TQString& info, int ); + TQFrame* addPage( const TQString& name, const TQString& info, int ); int spacingHint(); virtual void accept(); @@ -115,37 +116,37 @@ protected slots: virtual void slotDefault( void ); }; -class KFileDialog : public QFileDialog +class KFileDialog : public TQFileDialog { public: - static KURL getSaveURL( const QString &startDir=QString::null, - const QString &filter=QString::null, - QWidget *parent=0, const QString &caption=QString::null); - static KURL getOpenURL( const QString & startDir = QString::null, - const QString & filter = QString::null, - QWidget * parent = 0, - const QString & caption = QString::null ); - static KURL getExistingURL( const QString & startDir = QString::null, - QWidget * parent = 0, - const QString & caption = QString::null ); - static QString getSaveFileName (const QString &startDir=QString::null, - const QString &filter=QString::null, - QWidget *parent=0, - const QString &caption=QString::null); + static KURL getSaveURL( const TQString &startDir=TQString(), + const TQString &filter=TQString(), + TQWidget *tqparent=0, const TQString &caption=TQString()); + static KURL getOpenURL( const TQString & startDir = TQString(), + const TQString & filter = TQString(), + TQWidget * tqparent = 0, + const TQString & caption = TQString() ); + static KURL getExistingURL( const TQString & startDir = TQString(), + TQWidget * tqparent = 0, + const TQString & caption = TQString() ); + static TQString getSaveFileName (const TQString &startDir=TQString(), + const TQString &filter=TQString(), + TQWidget *tqparent=0, + const TQString &caption=TQString()); }; -typedef QStatusBar KStatusBar; +typedef TQStatusBar KStatusBar; -class KToolBar : public QToolBar +class KToolBar : public TQToolBar { public: - KToolBar(QMainWindow* parent); + KToolBar(TQMainWindow* tqparent); enum BarPosition {Top, Bottom, Left, Right}; BarPosition barPos(); void setBarPos(BarPosition); private: - QMainWindow* m_pMainWindow; + TQMainWindow* m_pMainWindow; }; class KActionCollection @@ -158,9 +159,9 @@ public: class KKeyDialog { public: - static void configure(void*, QWidget*){} - static void configureKeys(KActionCollection*, const QString&){} - static void configure(KActionCollection*, const QString&){} + static void configure(void*, TQWidget*){} + static void configureKeys(KActionCollection*, const TQString&){} + static void configure(KActionCollection*, const TQString&){} }; namespace KParts @@ -168,9 +169,10 @@ namespace KParts class ReadWritePart; } -class KMainWindow : public QMainWindow +class KMainWindow : public TQMainWindow { Q_OBJECT + TQ_OBJECT private: KStatusBar m_statusBar; KActionCollection m_actionCollection; @@ -178,27 +180,27 @@ protected: virtual bool queryClose() = 0; virtual bool queryExit() = 0; public: - QPopupMenu* fileMenu; - QPopupMenu* editMenu; - QPopupMenu* directoryMenu; - QPopupMenu* dirCurrentItemMenu; - QPopupMenu* dirCurrentSyncItemMenu; - QPopupMenu* movementMenu; - QPopupMenu* mergeMenu; - QPopupMenu* diffMenu; - QPopupMenu* windowsMenu; - QPopupMenu* settingsMenu; - QPopupMenu* helpMenu; + TQPopupMenu* fileMenu; + TQPopupMenu* editMenu; + TQPopupMenu* directoryMenu; + TQPopupMenu* dirCurrentItemMenu; + TQPopupMenu* dirCurrentSyncItemMenu; + TQPopupMenu* movementMenu; + TQPopupMenu* mergeMenu; + TQPopupMenu* diffMenu; + TQPopupMenu* windowsMenu; + TQPopupMenu* settingsMenu; + TQPopupMenu* helpMenu; KToolBar* m_pToolBar; - KMainWindow( QWidget* parent, const char* name ); - KToolBar* toolBar(const QString& s = QString::null); + KMainWindow( TQWidget* tqparent, const char* name ); + KToolBar* toolBar(const TQString& s = TQString()); KActionCollection* actionCollection(); void createGUI(); void createGUI(KParts::ReadWritePart*){createGUI();} - QList<KMainWindow>* memberList; + TQList<KMainWindow>* memberList; public slots: void slotHelp(); void slotAbout(); @@ -206,33 +208,34 @@ public slots: class KConfig : public ValueMap { - QString m_fileName; + TQString m_fileName; public: KConfig(); ~KConfig(); - void readConfigFile(const QString& configFileName); + void readConfigFile(const TQString& configFileName); - void setGroup(const QString&); + void setGroup(const TQString&); }; -class KAction : public QAction +class KAction : public TQAction { Q_OBJECT + TQ_OBJECT public: - KAction(const QString& text, const QIconSet& icon, int accel, QObject* receiver, const char* slot, KActionCollection* actionCollection, const char* name, bool bToggle=false, bool bMenu=true); - KAction(const QString& text, int accel, QObject* receiver, const char* slot, KActionCollection* actionCollection, const char* name, bool bToggle=false, bool bMenu=true); - void init(QObject* receiver, const char* slot, KActionCollection* actionCollection, + KAction(const TQString& text, const TQIconSet& icon, int accel, TQObject* receiver, const char* slot, KActionCollection* actionCollection, const char* name, bool bToggle=false, bool bMenu=true); + KAction(const TQString& text, int accel, TQObject* receiver, const char* slot, KActionCollection* actionCollection, const char* name, bool bToggle=false, bool bMenu=true); + void init(TQObject* receiver, const char* slot, KActionCollection* actionCollection, const char* name, bool bToggle, bool bMenu); - void setStatusText(const QString&); - void plug(QPopupMenu*); + void setStatusText(const TQString&); + void plug(TQPopupMenu*); }; class KToggleAction : public KAction { public: - KToggleAction(const QString& text, const QIconSet& icon, int accel, QObject* receiver, const char* slot, KActionCollection* actionCollection, const char* name, bool bMenu=true); - KToggleAction(const QString& text, int accel, QObject* receiver, const char* slot, KActionCollection* actionCollection, const char* name, bool bMenu=true); - KToggleAction(const QString& text, const QIconSet& icon, int accel, KActionCollection* actionCollection, const char* name, bool bMenu=true); + KToggleAction(const TQString& text, const TQIconSet& icon, int accel, TQObject* receiver, const char* slot, KActionCollection* actionCollection, const char* name, bool bMenu=true); + KToggleAction(const TQString& text, int accel, TQObject* receiver, const char* slot, KActionCollection* actionCollection, const char* name, bool bMenu=true); + KToggleAction(const TQString& text, const TQIconSet& icon, int accel, KActionCollection* actionCollection, const char* name, bool bMenu=true); void setChecked(bool); bool isChecked(); }; @@ -241,24 +244,24 @@ public: class KStdAction { public: - static KAction* open( QWidget* parent, const char* slot, KActionCollection* ); - static KAction* save( QWidget* parent, const char* slot, KActionCollection* ); - static KAction* saveAs( QWidget* parent, const char* slot, KActionCollection* ); - static KAction* print( QWidget* parent, const char* slot, KActionCollection* ); - static KAction* quit( QWidget* parent, const char* slot, KActionCollection* ); - static KAction* cut( QWidget* parent, const char* slot, KActionCollection* ); - static KAction* copy( QWidget* parent, const char* slot, KActionCollection* ); - static KAction* paste( QWidget* parent, const char* slot, KActionCollection* ); - static KAction* selectAll( QWidget* parent, const char* slot, KActionCollection* ); - static KToggleAction* showToolbar( QWidget* parent, const char* slot, KActionCollection* ); - static KToggleAction* showStatusbar( QWidget* parent, const char* slot, KActionCollection* ); - static KAction* preferences( QWidget* parent, const char* slot, KActionCollection* ); - static KAction* about( QWidget* parent, const char* slot, KActionCollection* ); - static KAction* aboutQt( KActionCollection* ); - static KAction* help( QWidget* parent, const char* slot, KActionCollection* ); - static KAction* find( QWidget* parent, const char* slot, KActionCollection* ); - static KAction* findNext( QWidget* parent, const char* slot, KActionCollection* ); - static KAction* keyBindings( QWidget* parent, const char* slot, KActionCollection* ); + static KAction* open( TQWidget* tqparent, const char* slot, KActionCollection* ); + static KAction* save( TQWidget* tqparent, const char* slot, KActionCollection* ); + static KAction* saveAs( TQWidget* tqparent, const char* slot, KActionCollection* ); + static KAction* print( TQWidget* tqparent, const char* slot, KActionCollection* ); + static KAction* quit( TQWidget* tqparent, const char* slot, KActionCollection* ); + static KAction* cut( TQWidget* tqparent, const char* slot, KActionCollection* ); + static KAction* copy( TQWidget* tqparent, const char* slot, KActionCollection* ); + static KAction* paste( TQWidget* tqparent, const char* slot, KActionCollection* ); + static KAction* selectAll( TQWidget* tqparent, const char* slot, KActionCollection* ); + static KToggleAction* showToolbar( TQWidget* tqparent, const char* slot, KActionCollection* ); + static KToggleAction* showStatusbar( TQWidget* tqparent, const char* slot, KActionCollection* ); + static KAction* preferences( TQWidget* tqparent, const char* slot, KActionCollection* ); + static KAction* about( TQWidget* tqparent, const char* slot, KActionCollection* ); + static KAction* aboutTQt( KActionCollection* ); + static KAction* help( TQWidget* tqparent, const char* slot, KActionCollection* ); + static KAction* tqfind( TQWidget* tqparent, const char* slot, KActionCollection* ); + static KAction* findNext( TQWidget* tqparent, const char* slot, KActionCollection* ); + static KAction* keyBindings( TQWidget* tqparent, const char* slot, KActionCollection* ); }; class KIcon @@ -267,40 +270,42 @@ public: enum {SizeMedium,Small}; }; -class KFontChooser : public QWidget +class KFontChooser : public TQWidget { Q_OBJECT - QFont m_font; - QPushButton* m_pSelectFont; - QLabel* m_pLabel; - QWidget* m_pParent; + TQ_OBJECT + TQFont m_font; + TQPushButton* m_pSelectFont; + TQLabel* m_pLabel; + TQWidget* m_pParent; public: - KFontChooser( QWidget* pParent, const QString& name, bool, const QStringList&, bool, int ); - QFont font(); - void setFont( const QFont&, bool ); + KFontChooser( TQWidget* pParent, const TQString& name, bool, const TQStringList&, bool, int ); + TQFont font(); + void setFont( const TQFont&, bool ); private slots: void slotSelectFont(); }; -class KColorButton : public QPushButton +class KColorButton : public TQPushButton { Q_OBJECT - QColor m_color; + TQ_OBJECT + TQColor m_color; public: - KColorButton(QWidget* parent); - QColor color(); - void setColor(const QColor&); - virtual void paintEvent(QPaintEvent* e); + KColorButton(TQWidget* tqparent); + TQColor color(); + void setColor(const TQColor&); + virtual void paintEvent(TQPaintEvent* e); public slots: void slotClicked(); }; -class KPrinter : public QPrinter +class KPrinter : public TQPrinter { public: KPrinter(); enum e_PageSelection {ApplicationSide}; - QValueList<int> pageList(); + TQValueList<int> pageList(); void setCurrentPage(int); void setPageSelection(e_PageSelection); }; @@ -308,7 +313,7 @@ public: class KStandardDirs { public: - QString findResource(const QString& resource, const QString& appName); + TQString findResource(const TQString& resource, const TQString& appName); }; struct KCmdLineOptions @@ -323,30 +328,30 @@ struct KCmdLineOptions class KAboutData { public: - KAboutData( const QString& name, const QString& appName, const QString& version, - const QString& description, int licence, - const QString& copyright, int w, const QString& homepage, const QString& email); - KAboutData( const QString& name, const QString& appName, const QString& version ); + KAboutData( const TQString& name, const TQString& appName, const TQString& version, + const TQString& description, int licence, + const TQString& copyright, int w, const TQString& homepage, const TQString& email); + KAboutData( const TQString& name, const TQString& appName, const TQString& version ); void addAuthor(const char* name=0, const char* task=0, const char* email=0, const char* weblink=0); void addCredit(const char* name=0, const char* task=0, const char* email=0, const char* weblink=0); enum { License_GPL }; struct AboutDataEntry { - AboutDataEntry(const QString& name, const QString& task, const QString& email, const QString& weblink) + AboutDataEntry(const TQString& name, const TQString& task, const TQString& email, const TQString& weblink) : m_name(name), m_task(task), m_email(email), m_weblink(weblink) {} - QString m_name; - QString m_task; - QString m_email; - QString m_weblink; + TQString m_name; + TQString m_task; + TQString m_email; + TQString m_weblink; }; std::list<AboutDataEntry> m_authorList; std::list<AboutDataEntry> m_creditList; }; -typedef QValueList<QCString> QCStringList; +typedef TQValueList<TQCString> QCStringList; class KCmdLineArgs { @@ -356,21 +361,21 @@ public: static void addCmdLineOptions( KCmdLineOptions* options ); // Add our own options. int count(); - QString arg(int); + TQString arg(int); KURL url(int i){ return KURL(arg(i)); } void clear(); - QString getOption(const QString&); - QCStringList getOptionList( const QString& ); - bool isSet(const QString&); + TQString getOption(const TQString&); + QCStringList getOptionList( const TQString& ); + bool isSet(const TQString&); }; class KIconLoader { public: - QPixmap loadIcon(const QString& name, int); + TQPixmap loadIcon(const TQString& name, int); }; -class KApplication : public QApplication +class KApplication : public TQApplication { KConfig m_config; KIconLoader m_iconLoader; @@ -384,21 +389,22 @@ public: extern KApplication* kapp; -class KLibFactory : public QObject +class KLibFactory : public TQObject { Q_OBJECT + TQ_OBJECT public: - QObject* create(QObject*,const QString&,const QString&); + TQObject* create(TQObject*,const TQString&,const TQString&); }; class KLibLoader { public: static KLibLoader* self(); - KLibFactory* factory(const QString&); + KLibFactory* factory(const TQString&); }; -class KEditToolbar : public QDialog +class KEditToolbar : public TQDialog { public: KEditToolbar( int ){} @@ -413,13 +419,13 @@ public: namespace KIO { enum UDSEntry {}; - typedef QValueList<UDSEntry> UDSEntryList; - class Job : public QObject + typedef TQValueList<UDSEntry> UDSEntryList; + class Job : public TQObject { public: void kill(bool){} bool error() {return false;} - void showErrorDialog( QWidget* ) {} + void showErrorDialog( TQWidget* ) {} }; class SimpleJob : public Job {}; SimpleJob* mkdir( KURL ); @@ -442,9 +448,9 @@ namespace KIO TransferJob* put( KURL, int, bool, bool, bool ); }; -typedef QProgressBar KProgress; +typedef TQProgressBar KProgress; -class KInstance : public QObject +class KInstance : public TQObject { public: KInstance(KAboutData*){} @@ -455,49 +461,50 @@ namespace KParts class MainWindow : public KMainWindow { public: - MainWindow( QWidget* parent, const char* name ) : KMainWindow(parent,name) {} - void setXMLFile(const QString&){} + MainWindow( TQWidget* tqparent, const char* name ) : KMainWindow(tqparent,name) {} + void setXMLFile(const TQString&){} void setAutoSaveSettings(){} void saveMainWindowSettings(KConfig*){} void applyMainWindowSettings(KConfig*){} int factory(){return 0;} }; - class Part : public QObject + class Part : public TQObject { public: KActionCollection* actionCollection(); KApplication* instance(); - void setWidget( QWidget* w ){ m_pWidget=w; } - QWidget* widget(){return m_pWidget;} - void setXMLFile(const QString&){} + void setWidget( TQWidget* w ){ m_pWidget=w; } + TQWidget* widget(){return m_pWidget;} + void setXMLFile(const TQString&){} private: - QWidget* m_pWidget; + TQWidget* m_pWidget; }; class ReadOnlyPart : public Part { public: ReadOnlyPart(){} - ReadOnlyPart(QObject*,const QCString&){} + ReadOnlyPart(TQObject*,const TQCString&){} void setInstance( KInstance* ){} - QString m_file; + TQString m_file; }; class ReadWritePart : public ReadOnlyPart { public: - ReadWritePart(QObject*,const QCString&){} + ReadWritePart(TQObject*,const TQCString&){} void setReadWrite(bool){} }; class Factory : public KLibFactory { Q_OBJECT + TQ_OBJECT public: - virtual KParts::Part* createPartObject( QWidget *parentWidget, const char *widgetName, - QObject *parent, const char *name, - const char *classname, const QStringList &args )=0; + virtual KParts::Part* createPartObject( TQWidget *tqparentWidget, const char *widgetName, + TQObject *tqparent, const char *name, + const char *classname, const TQStringList &args )=0; }; }; #endif diff --git a/src/main.cpp b/src/main.cpp index 6e19b58..218740e 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -21,9 +21,9 @@ #include "kdiff3_shell.h" #include <kstandarddirs.h> #include "version.h" -#include <qtextcodec.h> -#include <qfile.h> -#include <qtextstream.h> +#include <tqtextcodec.h> +#include <tqfile.h> +#include <tqtextstream.h> #include <vector> #ifdef KREPLACEMENTS_H @@ -62,28 +62,28 @@ static KCmdLineOptions options2[] = }; -void initialiseCmdLineArgs(std::vector<KCmdLineOptions>& vOptions, QStringList& ignorableOptions) +void initialiseCmdLineArgs(std::vector<KCmdLineOptions>& vOptions, TQStringList& ignorableOptions) { vOptions.insert( vOptions.end(), options, (KCmdLineOptions*)((char*)options+sizeof(options))); - QString configFileName = KStandardDirs().findResource("config","kdiff3rc"); - QFile configFile( configFileName ); + TQString configFileName = KStandardDirs().findResource("config","kdiff3rc"); + TQFile configFile( configFileName ); if ( configFile.open( IO_ReadOnly ) ) { - QTextStream ts( &configFile ); + TQTextStream ts( &configFile ); while(!ts.atEnd()) { - QString line = ts.readLine(); + TQString line = ts.readLine(); if ( line.startsWith("IgnorableCmdLineOptions=") ) { - int pos = line.find('='); + int pos = line.tqfind('='); if (pos>=0) { - QString s = line.mid(pos+1); - QStringList sl = QStringList::split( '|', s ); + TQString s = line.mid(pos+1); + TQStringList sl = TQStringList::split( '|', s ); if (!sl.isEmpty()) { - ignorableOptions = QStringList::split( ';', sl.front() ); - for (QStringList::iterator i=ignorableOptions.begin(); i!=ignorableOptions.end(); ++i) + ignorableOptions = TQStringList::split( ';', sl.front() ); + for (TQStringList::iterator i=ignorableOptions.begin(); i!=ignorableOptions.end(); ++i) { KCmdLineOptions ignoreOption; (*i).remove('-'); @@ -112,7 +112,7 @@ void initialiseCmdLineArgs(std::vector<KCmdLineOptions>& vOptions, QStringList& #ifdef _WIN32 #include <process.h> // This command checks the comm -static bool isOptionUsed(const QString& s, int argc, char* argv[]) +static bool isOptionUsed(const TQString& s, int argc, char* argv[]) { for(int j=0; j<argc; ++j ) { @@ -168,7 +168,7 @@ int main(int argc, char *argv[]) } #endif - //QApplication::setColorSpec( QApplication::ManyColor ); // Grab all 216 colors + //TQApplication::setColorSpec( TQApplication::ManyColor ); // Grab all 216 colors KAboutData aboutData( "kdiff3", I18N_NOOP("KDiff3"), VERSION, description, KAboutData::License_GPL, @@ -192,29 +192,29 @@ int main(int argc, char *argv[]) KCmdLineArgs::init( argc, argv, &aboutData ); std::vector<KCmdLineOptions> vOptions; - QStringList ignorableOptions; + TQStringList ignorableOptions; initialiseCmdLineArgs(vOptions, ignorableOptions); KApplication app; #ifdef KREPLACEMENTS_H - QString locale; + TQString locale; locale = app.config()->readEntry("Language", "Auto"); - int spacePos = locale.find(' '); + int spacePos = locale.tqfind(' '); if (spacePos>0) locale = locale.left(spacePos); - QTranslator kdiff3Translator( 0 ); - QTranslator qtTranslator( 0 ); + TQTranslator kdiff3Translator( 0 ); + TQTranslator qtTranslator( 0 ); if (locale != "en_orig") { if ( locale == "Auto" || locale.isEmpty() ) - locale = QTextCodec::locale(); + locale = TQTextCodec::locale(); - QString translationDir = getTranslationDir(); - kdiff3Translator.load( QString("kdiff3_")+locale, translationDir ); + TQString translationDir = getTranslationDir(); + kdiff3Translator.load( TQString("kdiff3_")+locale, translationDir ); app.installTranslator( &kdiff3Translator ); - qtTranslator.load( QString("qt_")+locale, translationDir ); + qtTranslator.load( TQString("qt_")+locale, translationDir ); app.installTranslator( &qtTranslator ); } #endif diff --git a/src/mergeresultwindow.cpp b/src/mergeresultwindow.cpp index 0e0aad9..c0a3a8a 100644 --- a/src/mergeresultwindow.cpp +++ b/src/mergeresultwindow.cpp @@ -18,21 +18,21 @@ #include "mergeresultwindow.h" #include "optiondialog.h" -#include <qpainter.h> -#include <qapplication.h> -#include <qclipboard.h> -#include <qdir.h> -#include <qfile.h> -#include <qcursor.h> -#include <qpopupmenu.h> -#include <qstatusbar.h> -#include <qregexp.h> -#include <qlabel.h> -#include <qlineedit.h> -#include <qcombobox.h> -#include <qlayout.h> -#include <qtextcodec.h> -#include <qdragobject.h> +#include <tqpainter.h> +#include <tqapplication.h> +#include <tqclipboard.h> +#include <tqdir.h> +#include <tqfile.h> +#include <tqcursor.h> +#include <tqpopupmenu.h> +#include <tqstatusbar.h> +#include <tqregexp.h> +#include <tqlabel.h> +#include <tqlineedit.h> +#include <tqcombobox.h> +#include <tqlayout.h> +#include <tqtextcodec.h> +#include <tqdragobject.h> #include <klocale.h> #include <kmessagebox.h> @@ -44,13 +44,13 @@ int g_bAutoSolve = true; #define leftInfoWidth 3 MergeResultWindow::MergeResultWindow( - QWidget* pParent, + TQWidget* pParent, OptionDialog* pOptionDialog, - QStatusBar* pStatusBar + TQStatusBar* pStatusBar ) -: QWidget( pParent, 0, WRepaintNoErase ) +: TQWidget( pParent, 0, WRepaintNoErase ) { - setFocusPolicy( QWidget::ClickFocus ); + setFocusPolicy( TQ_ClickFocus ); m_firstLine = 0; m_firstColumn = 0; @@ -72,7 +72,7 @@ MergeResultWindow::MergeResultWindow( m_sizeC = 0; m_pDiff3LineList = 0; - m_pTotalDiffStatus = 0; + m_pTotalDifftqStatus = 0; m_pStatusBar = pStatusBar; m_pOptionDialog = pOptionDialog; @@ -84,11 +84,11 @@ MergeResultWindow::MergeResultWindow( m_cursorYPos=0; m_bCursorOn = true; m_bCursorUpdate = false; - connect( &m_cursorTimer, SIGNAL(timeout()), this, SLOT( slotCursorUpdate() ) ); + connect( &m_cursorTimer, TQT_SIGNAL(timeout()), this, TQT_SLOT( slotCursorUpdate() ) ); m_cursorTimer.start( 500 /*ms*/, true /*single shot*/ ); m_selection.reset(); - setMinimumSize( QSize(20,20) ); + setMinimumSize( TQSize(20,20) ); setFont( m_pOptionDialog->m_font ); } @@ -97,7 +97,7 @@ void MergeResultWindow::init( const LineData* pLineDataB, int sizeB, const LineData* pLineDataC, int sizeC, const Diff3LineList* pDiff3LineList, - TotalDiffStatus* pTotalDiffStatus + TotalDifftqStatus* pTotalDifftqStatus ) { m_firstLine = 0; @@ -118,7 +118,7 @@ void MergeResultWindow::init( m_sizeC = sizeC; m_pDiff3LineList = pDiff3LineList; - m_pTotalDiffStatus = pTotalDiffStatus; + m_pTotalDifftqStatus = pTotalDifftqStatus; m_selection.reset(); m_cursorXPos=0; @@ -134,13 +134,13 @@ void MergeResultWindow::init( int nofUnsolved = getNrOfUnsolvedConflicts(&wsc); if (m_pStatusBar) m_pStatusBar->message( i18n("Number of remaining unsolved conflicts: %1 (of which %2 are whitespace)") - .arg(nofUnsolved).arg(wsc) ); + .tqarg(nofUnsolved).tqarg(wsc) ); } void MergeResultWindow::reset() { m_pDiff3LineList = 0; - m_pTotalDiffStatus = 0; + m_pTotalDifftqStatus = 0; m_pldA = 0; m_pldB = 0; m_pldC = 0; @@ -467,9 +467,9 @@ void MergeResultWindow::merge(bool bAutoSolve, int defaultSelector, bool bConfli ++nrOfWhiteSpaceConflicts; } - m_pTotalDiffStatus->nofUnsolvedConflicts = nrOfUnsolvedConflicts; - m_pTotalDiffStatus->nofSolvedConflicts = nrOfSolvedConflicts; - m_pTotalDiffStatus->nofWhitespaceConflicts = nrOfWhiteSpaceConflicts; + m_pTotalDifftqStatus->nofUnsolvedConflicts = nrOfUnsolvedConflicts; + m_pTotalDifftqStatus->nofSolvedConflicts = nrOfSolvedConflicts; + m_pTotalDifftqStatus->nofWhitespaceConflicts = nrOfWhiteSpaceConflicts; m_cursorXPos=0; @@ -511,19 +511,19 @@ int MergeResultWindow::getNofLines() int MergeResultWindow::getNofVisibleColumns() { - QFontMetrics fm = fontMetrics(); + TQFontMetrics fm = fontMetrics(); return width()/fm.width('W')-4; } int MergeResultWindow::getNofVisibleLines() { - QFontMetrics fm = fontMetrics(); + TQFontMetrics fm = fontMetrics(); return (height()-3)/fm.height()-2; } -void MergeResultWindow::resizeEvent( QResizeEvent* e ) +void MergeResultWindow::resizeEvent( TQResizeEvent* e ) { - QWidget::resizeEvent(e); + TQWidget::resizeEvent(e); emit resizeSignal(); } @@ -803,26 +803,26 @@ void MergeResultWindow::showNrOfConflicts() if ( i->bConflict || i->bDelta ) ++nrOfConflicts; } - QString totalInfo; - if ( m_pTotalDiffStatus->bBinaryAEqB && m_pTotalDiffStatus->bBinaryAEqC ) + TQString totalInfo; + if ( m_pTotalDifftqStatus->bBinaryAEqB && m_pTotalDifftqStatus->bBinaryAEqC ) totalInfo += i18n("All input files are binary equal."); - else if ( m_pTotalDiffStatus->bTextAEqB && m_pTotalDiffStatus->bTextAEqC ) + else if ( m_pTotalDifftqStatus->bTextAEqB && m_pTotalDifftqStatus->bTextAEqC ) totalInfo += i18n("All input files contain the same text."); else { - if ( m_pTotalDiffStatus->bBinaryAEqB ) totalInfo += i18n("Files %1 and %2 are binary equal.\n").arg("A").arg("B"); - else if ( m_pTotalDiffStatus->bTextAEqB ) totalInfo += i18n("Files %1 and %2 have equal text.\n").arg("A").arg("B"); - if ( m_pTotalDiffStatus->bBinaryAEqC ) totalInfo += i18n("Files %1 and %2 are binary equal.\n").arg("A").arg("C"); - else if ( m_pTotalDiffStatus->bTextAEqC ) totalInfo += i18n("Files %1 and %2 have equal text.\n").arg("A").arg("C"); - if ( m_pTotalDiffStatus->bBinaryBEqC ) totalInfo += i18n("Files %1 and %2 are binary equal.\n").arg("B").arg("C"); - else if ( m_pTotalDiffStatus->bTextBEqC ) totalInfo += i18n("Files %1 and %2 have equal text.\n").arg("B").arg("C"); + if ( m_pTotalDifftqStatus->bBinaryAEqB ) totalInfo += i18n("Files %1 and %2 are binary equal.\n").tqarg("A").tqarg("B"); + else if ( m_pTotalDifftqStatus->bTextAEqB ) totalInfo += i18n("Files %1 and %2 have equal text.\n").tqarg("A").tqarg("B"); + if ( m_pTotalDifftqStatus->bBinaryAEqC ) totalInfo += i18n("Files %1 and %2 are binary equal.\n").tqarg("A").tqarg("C"); + else if ( m_pTotalDifftqStatus->bTextAEqC ) totalInfo += i18n("Files %1 and %2 have equal text.\n").tqarg("A").tqarg("C"); + if ( m_pTotalDifftqStatus->bBinaryBEqC ) totalInfo += i18n("Files %1 and %2 are binary equal.\n").tqarg("B").tqarg("C"); + else if ( m_pTotalDifftqStatus->bTextBEqC ) totalInfo += i18n("Files %1 and %2 have equal text.\n").tqarg("B").tqarg("C"); } int nrOfUnsolvedConflicts = getNrOfUnsolvedConflicts(); KMessageBox::information( this, - i18n("Total number of conflicts: ") + QString::number(nrOfConflicts) + - i18n("\nNr of automatically solved conflicts: ") + QString::number(nrOfConflicts-nrOfUnsolvedConflicts) + - i18n("\nNr of unsolved conflicts: ") + QString::number(nrOfUnsolvedConflicts) + + i18n("Total number of conflicts: ") + TQString::number(nrOfConflicts) + + i18n("\nNr of automatically solved conflicts: ") + TQString::number(nrOfConflicts-nrOfUnsolvedConflicts) + + i18n("\nNr of unsolved conflicts: ") + TQString::number(nrOfUnsolvedConflicts) + "\n"+totalInfo, i18n("Conflicts") ); @@ -948,7 +948,7 @@ void MergeResultWindow::choose( int selector ) int wsc; int nofUnsolved = getNrOfUnsolvedConflicts(&wsc); m_pStatusBar->message( i18n("Number of remaining unsolved conflicts: %1 (of which %2 are whitespace)") - .arg(nofUnsolved).arg(wsc) ); + .tqarg(nofUnsolved).tqarg(wsc) ); } // bConflictsOnly: automatically choose for conflicts only (true) or for everywhere (false) @@ -962,7 +962,7 @@ void MergeResultWindow::chooseGlobal(int selector, bool bConflictsOnly, bool bWh int wsc; int nofUnsolved = getNrOfUnsolvedConflicts(&wsc); m_pStatusBar->message( i18n("Number of remaining unsolved conflicts: %1 (of which %2 are whitespace)") - .arg(nofUnsolved).arg(wsc) ); + .tqarg(nofUnsolved).tqarg(wsc) ); } void MergeResultWindow::slotAutoSolve() @@ -974,7 +974,7 @@ void MergeResultWindow::slotAutoSolve() int wsc; int nofUnsolved = getNrOfUnsolvedConflicts(&wsc); m_pStatusBar->message( i18n("Number of remaining unsolved conflicts: %1 (of which %2 are whitespace)") - .arg(nofUnsolved).arg(wsc) ); + .tqarg(nofUnsolved).tqarg(wsc) ); } void MergeResultWindow::slotUnsolve() @@ -986,10 +986,10 @@ void MergeResultWindow::slotUnsolve() int wsc; int nofUnsolved = getNrOfUnsolvedConflicts(&wsc); m_pStatusBar->message( i18n("Number of remaining unsolved conflicts: %1 (of which %2 are whitespace)") - .arg(nofUnsolved).arg(wsc) ); + .tqarg(nofUnsolved).tqarg(wsc) ); } -static QString calcHistoryLead(const QString& s ) +static TQString calcHistoryLead(const TQString& s ) { // Return the start of the line until the first white char after the first non white char. unsigned int i; @@ -1010,10 +1010,10 @@ static QString calcHistoryLead(const QString& s ) return ""; // Must be an empty string, not a null string. } -static void findHistoryRange( const QRegExp& historyStart, bool bThreeFiles, const Diff3LineList* pD3LList, +static void findHistoryRange( const TQRegExp& historyStart, bool bThreeFiles, const Diff3LineList* pD3LList, Diff3LineList::const_iterator& iBegin, Diff3LineList::const_iterator& iEnd, int& idxBegin, int& idxEnd ) { - QString historyLead; + TQString historyLead; // Search for start of history for( iBegin = pD3LList->begin(), idxBegin=0; iBegin!=pD3LList->end(); ++iBegin, ++idxBegin ) { @@ -1028,9 +1028,9 @@ static void findHistoryRange( const QRegExp& historyStart, bool bThreeFiles, con // Search for end of history for( iEnd = iBegin, idxEnd = idxBegin; iEnd!=pD3LList->end(); ++iEnd, ++idxEnd ) { - QString sA = iEnd->getString(A); - QString sB = iEnd->getString(B); - QString sC = iEnd->getString(C); + TQString sA = iEnd->getString(A); + TQString sB = iEnd->getString(B); + TQString sC = iEnd->getString(C); if ( ! ((sA.isNull() || historyLead == calcHistoryLead(sA) ) && (sB.isNull() || historyLead == calcHistoryLead(sB) ) && (!bThreeFiles || sC.isNull() || historyLead == calcHistoryLead(sC) ) @@ -1041,7 +1041,7 @@ static void findHistoryRange( const QRegExp& historyStart, bool bThreeFiles, con } } -bool findParenthesesGroups( const QString& s, QStringList& sl ) +bool findParenthesesGroups( const TQString& s, TQStringList& sl ) { sl.clear(); int i=0; @@ -1067,30 +1067,30 @@ bool findParenthesesGroups( const QString& s, QStringList& sl ) sl.push_back( s.mid( startPos+1, i-startPos-1 ) ); } } - return startPosStack.empty(); // false if parentheses don't match + return startPosStack.empty(); // false if tqparentheses don't match } -QString calcHistorySortKey( const QString& keyOrder, QRegExp& matchedRegExpr, const QStringList& parenthesesGroupList ) +TQString calcHistorySortKey( const TQString& keyOrder, TQRegExp& matchedRegExpr, const TQStringList& tqparenthesesGroupList ) { - QStringList keyOrderList = QStringList::split(',', keyOrder ); - QString key; - for ( QStringList::iterator keyIt = keyOrderList.begin(); keyIt!=keyOrderList.end(); ++keyIt ) + TQStringList keyOrderList = TQStringList::split(',', keyOrder ); + TQString key; + for ( TQStringList::iterator keyIt = keyOrderList.begin(); keyIt!=keyOrderList.end(); ++keyIt ) { if ( (*keyIt).isEmpty() ) continue; bool bOk=false; int groupIdx = (*keyIt).toInt(&bOk); - if (!bOk || groupIdx<0 || groupIdx >(int)parenthesesGroupList.size() ) + if (!bOk || groupIdx<0 || groupIdx >(int)tqparenthesesGroupList.size() ) continue; - QString s = matchedRegExpr.cap( groupIdx ); + TQString s = matchedRegExpr.cap( groupIdx ); if ( groupIdx == 0 ) { key += s + " "; continue; } - QString groupRegExp = parenthesesGroupList[groupIdx-1]; - if( groupRegExp.find('|')<0 || groupRegExp.find('(')>=0 ) + TQString groupRegExp = tqparenthesesGroupList[groupIdx-1]; + if( groupRegExp.tqfind('|')<0 || groupRegExp.tqfind('(')>=0 ) { bool bOk = false; int i = s.toInt( &bOk ); @@ -1103,15 +1103,15 @@ QString calcHistorySortKey( const QString& keyOrder, QRegExp& matchedRegExpr, co // Assume that the groupRegExp consists of something like "Jan|Feb|Mar|Apr" // s is the string that managed to match. // Now we want to know at which position it occurred. e.g. Jan=0, Feb=1, Mar=2, etc. - QStringList sl = QStringList::split( '|', groupRegExp ); - int idx = sl.findIndex( s ); + TQStringList sl = TQStringList::split( '|', groupRegExp ); + int idx = sl.tqfindIndex( s ); if (idx<0) { // Didn't match } else { - QString sIdx; + TQString sIdx; sIdx.sprintf("%02d", idx+1 ); // Up to 99 words in the groupRegExp (more than 12 aren't expected) key += sIdx + " "; } @@ -1128,18 +1128,18 @@ void MergeResultWindow::collectHistoryInformation( { std::list< HistoryMap::iterator >::iterator itHitListFront = hitList.begin(); Diff3LineList::const_iterator id3l = iHistoryBegin; - QString historyLead; + TQString historyLead; { const LineData* pld = id3l->getLineData(src); - QString s( pld->pLine, pld->size ); + TQString s( pld->pLine, pld->size ); historyLead = calcHistoryLead(s); } - QRegExp historyStart = m_pOptionDialog->m_historyStartRegExp; + TQRegExp historyStart = m_pOptionDialog->m_historyStartRegExp; ++id3l; // Skip line with "$Log ... $" - QRegExp newHistoryEntry = m_pOptionDialog->m_historyEntryStartRegExp; - QStringList parenthesesGroups; - findParenthesesGroups( m_pOptionDialog->m_historyEntryStartRegExp, parenthesesGroups ); - QString key; + TQRegExp newHistoryEntry = m_pOptionDialog->m_historyEntryStartRegExp; + TQStringList tqparenthesesGroups; + findParenthesesGroups( m_pOptionDialog->m_historyEntryStartRegExp, tqparenthesesGroups ); + TQString key; MergeEditLineList melList; bool bPrevLineIsEmpty = true; bool bUseRegExp = !m_pOptionDialog->m_historyEntryStartRegExp.isEmpty(); @@ -1147,9 +1147,9 @@ void MergeResultWindow::collectHistoryInformation( { const LineData* pld = id3l->getLineData(src); if ( !pld ) continue; - QString s( pld->pLine, pld->size ); + TQString s( pld->pLine, pld->size ); if (historyLead.isNull()) historyLead = calcHistoryLead(s); - QString sLine = s.mid(historyLead.length()); + TQString sLine = s.mid(historyLead.length()); if ( ( !bUseRegExp && !sLine.stripWhiteSpace().isEmpty() && bPrevLineIsEmpty ) || bUseRegExp && newHistoryEntry.exactMatch( sLine ) ) @@ -1171,7 +1171,7 @@ void MergeResultWindow::collectHistoryInformation( if ( ! bUseRegExp ) key = sLine; else - key = calcHistorySortKey(m_pOptionDialog->m_historyEntryStartSortKeyOrder,newHistoryEntry,parenthesesGroups); + key = calcHistorySortKey(m_pOptionDialog->m_historyEntryStartSortKeyOrder,newHistoryEntry,tqparenthesesGroups); melList.clear(); melList.push_back( MergeEditLine(id3l,src) ); @@ -1330,7 +1330,7 @@ void MergeResultWindow::slotMergeHistory() iMLLStart->mergeEditLineList.clear(); // Now insert the complete history into the first MergeLine of the history iMLLStart->mergeEditLineList.push_back( MergeEditLine( iD3LHistoryBegin, m_pldC == 0 ? B : C ) ); - QString lead = calcHistoryLead( iD3LHistoryBegin->getString(A) ); + TQString lead = calcHistoryLead( iD3LHistoryBegin->getString(A) ); MergeEditLine mel( m_pDiff3LineList->end() ); mel.setString( lead ); iMLLStart->mergeEditLineList.push_back(mel); @@ -1376,7 +1376,7 @@ void MergeResultWindow::slotRegExpAutoMerge() if ( m_pOptionDialog->m_autoMergeRegExp.isEmpty() ) return; - QRegExp vcsKeywords = m_pOptionDialog->m_autoMergeRegExp; + TQRegExp vcsKeywords = m_pOptionDialog->m_autoMergeRegExp; MergeLineList::iterator i; for ( i=m_mergeLineList.begin(); i!=m_mergeLineList.end(); ++i ) { @@ -1507,7 +1507,7 @@ void MergeResultWindow::myUpdate(int afterMilliSecs) m_delayedDrawTimer = startTimer( afterMilliSecs ); } -void MergeResultWindow::timerEvent(QTimerEvent*) +void MergeResultWindow::timerEvent(TQTimerEvent*) { killTimer(m_delayedDrawTimer); m_delayedDrawTimer = 0; @@ -1527,14 +1527,14 @@ void MergeResultWindow::timerEvent(QTimerEvent*) } } -QString MergeResultWindow::MergeEditLine::getString( const MergeResultWindow* mrw ) +TQString MergeResultWindow::MergeEditLine::getString( const MergeResultWindow* mrw ) { - if ( isRemoved() ) { return QString(); } + if ( isRemoved() ) { return TQString(); } if ( ! isModified() ) { int src = m_src; - if ( src == 0 ) { return QString(); } + if ( src == 0 ) { return TQString(); } const Diff3Line& d3l = *m_id3l; const LineData* pld = 0; assert( src == A || src == B || src == C ); @@ -1545,10 +1545,10 @@ QString MergeResultWindow::MergeEditLine::getString( const MergeResultWindow* mr if ( pld == 0 ) { // assert(false); This is no error. - return QString(); + return TQString(); } - return QString( pld->pLine, pld->size ); + return TQString( pld->pLine, pld->size ); } else { @@ -1558,7 +1558,7 @@ QString MergeResultWindow::MergeEditLine::getString( const MergeResultWindow* mr } /// Converts the cursor-posOnScreen into a text index, considering tabulators. -int convertToPosInText( const QString& s, int posOnScreen, int tabSize ) +int convertToPosInText( const TQString& s, int posOnScreen, int tabSize ) { int localPosOnScreen = 0; int size=s.length(); @@ -1580,7 +1580,7 @@ int convertToPosInText( const QString& s, int posOnScreen, int tabSize ) /// Converts the index into the text to a cursor-posOnScreen considering tabulators. -int convertToPosOnScreen( const QString& p, int posInText, int tabSize ) +int convertToPosOnScreen( const TQString& p, int posInText, int tabSize ) { int posOnScreen = 0; for ( int i=0; i<posInText; ++i ) @@ -1594,11 +1594,11 @@ int convertToPosOnScreen( const QString& p, int posInText, int tabSize ) } void MergeResultWindow::writeLine( - MyPainter& p, int line, const QString& str, + MyPainter& p, int line, const TQString& str, int srcSelect, e_MergeDetails mergeDetails, int rangeMark, bool bUserModified, bool bLineRemoved, bool bWhiteSpaceConflict ) { - const QFontMetrics& fm = fontMetrics(); + const TQFontMetrics& fm = fontMetrics(); int fontHeight = fm.height(); int fontWidth = fm.width("W"); int fontAscent = fm.ascent(); @@ -1612,7 +1612,7 @@ void MergeResultWindow::writeLine( yOffset += topLineYOffset; - QString srcName = " "; + TQString srcName = " "; if ( bUserModified ) srcName = "m"; else if ( srcSelect == A && mergeDetails != eNoChange ) srcName = "A"; else if ( srcSelect == B ) srcName = "B"; @@ -1626,7 +1626,7 @@ void MergeResultWindow::writeLine( if( (srcSelect > 0 || bUserModified ) && !bLineRemoved ) { int outPos = 0; - QString s; + TQString s; int size = str.length(); for ( int i=0; i<size; ++i ) { @@ -1661,12 +1661,12 @@ void MergeResultWindow::writeLine( if( m_selection.lineWithin( line+1 ) ) p.fillRect( xOffset + fontWidth*(firstPosInLine2-m_firstColumn), yOffset, - width(), fontHeight, colorGroup().highlight() ); + width(), fontHeight, tqcolorGroup().highlight() ); else if ( lengthInLine2>0 ) p.fillRect( xOffset + fontWidth*(firstPosInLine2-m_firstColumn), yOffset, - fontWidth*lengthInLine2, fontHeight, colorGroup().highlight() ); + fontWidth*lengthInLine2, fontHeight, tqcolorGroup().highlight() ); - p.setPen( colorGroup().highlightedText() ); + p.setPen( tqcolorGroup().highlightedText() ); p.drawText( xOffset + fontWidth*(firstPosInLine2-m_firstColumn), yOffset+fontAscent, s.mid(firstPosInLine2,lengthInLine2), true ); } @@ -1745,12 +1745,12 @@ void MergeResultWindow::setPaintingAllowed(bool bPaintingAllowed) } } -void MergeResultWindow::paintEvent( QPaintEvent* ) +void MergeResultWindow::paintEvent( TQPaintEvent* ) { if (m_pDiff3LineList==0 || !m_bPaintingAllowed) return; bool bOldSelectionContainsData = m_selection.bSelectionContainsData; - const QFontMetrics& fm = fontMetrics(); + const TQFontMetrics& fm = fontMetrics(); int fontHeight = fm.height(); int fontWidth = fm.width("W"); int fontAscent = fm.ascent(); @@ -1761,9 +1761,9 @@ void MergeResultWindow::paintEvent( QPaintEvent* ) if ( size() != m_pixmap.size() ) m_pixmap.resize(size()); - MyPainter p(&m_pixmap, m_pOptionDialog->m_bRightToLeftLanguage, width(), fontWidth); + MyPainter p(TQT_TQPAINTDEVICE(&m_pixmap), m_pOptionDialog->m_bRightToLeftLanguage, width(), fontWidth); p.setFont( font() ); - p.QPainter::fillRect( rect(), m_pOptionDialog->m_bgColor ); + p.TQPainter::fillRect( rect(), m_pOptionDialog->m_bgColor ); //int visibleLines = height() / fontHeight; @@ -1795,7 +1795,7 @@ void MergeResultWindow::paintEvent( QPaintEvent* ) if ( mlIt == m_currentMergeLineIt ) rangeMark |= 4; // Mark of the current line - QString s; + TQString s; s = mel.getString( this ); if ( convertToPosOnScreen(s,s.length(),m_pOptionDialog->m_tabSize) >nofColumns) nofColumns = s.length(); @@ -1820,7 +1820,7 @@ void MergeResultWindow::paintEvent( QPaintEvent* ) p.end(); } - QPainter painter(this); + TQPainter painter(this); int topLineYOffset = 0; int xOffset = fontWidth * leftInfoWidth; @@ -1843,7 +1843,7 @@ void MergeResultWindow::paintEvent( QPaintEvent* ) if ( m_bCursorOn && hasFocus() && m_cursorYPos>=m_firstLine ) { - MyPainter painter(this, m_pOptionDialog->m_bRightToLeftLanguage, width(), fontWidth); + MyPainter painter(TQT_TQPAINTDEVICE(this), m_pOptionDialog->m_bRightToLeftLanguage, width(), fontWidth); int topLineYOffset = 0; int xOffset = fontWidth * leftInfoWidth; @@ -1898,15 +1898,15 @@ void MergeResultWindow::updateSourceMask() emit sourceMask( srcMask, enabledMask ); } -void MergeResultWindow::focusInEvent( QFocusEvent* e ) +void MergeResultWindow::focusInEvent( TQFocusEvent* e ) { updateSourceMask(); - QWidget::focusInEvent(e); + TQWidget::focusInEvent(e); } void MergeResultWindow::convertToLinePos( int x, int y, int& line, int& pos ) { - const QFontMetrics& fm = fontMetrics(); + const TQFontMetrics& fm = fontMetrics(); int fontHeight = fm.height(); int fontWidth = fm.width('W'); int xOffset = (leftInfoWidth-m_firstColumn)*fontWidth; @@ -1921,7 +1921,7 @@ void MergeResultWindow::convertToLinePos( int x, int y, int& line, int& pos ) pos = ( (width() - 1 - x) - xOffset ) / fontWidth; } -void MergeResultWindow::mousePressEvent ( QMouseEvent* e ) +void MergeResultWindow::mousePressEvent ( TQMouseEvent* e ) { m_bCursorOn = true; @@ -1956,14 +1956,14 @@ void MergeResultWindow::mousePressEvent ( QMouseEvent* e ) if (bRMB) { - showPopupMenu( QCursor::pos() ); + showPopupMenu( TQCursor::pos() ); } } else if ( bLMB ) // Normal cursor placement { pos = max2(pos,0); line = max2(line,0); - if ( e->state() & Qt::ShiftButton ) + if ( e->state() & TQt::ShiftButton ) { if (m_selection.firstLine==-1) m_selection.start( line, pos ); @@ -1997,7 +1997,7 @@ void MergeResultWindow::mousePressEvent ( QMouseEvent* e ) } } -void MergeResultWindow::mouseDoubleClickEvent( QMouseEvent* e ) +void MergeResultWindow::mouseDoubleClickEvent( TQMouseEvent* e ) { if ( e->button() == Qt::LeftButton ) { @@ -2013,7 +2013,7 @@ void MergeResultWindow::mouseDoubleClickEvent( QMouseEvent* e ) MergeLineList::iterator mlIt; MergeEditLineList::iterator melIt; calcIteratorFromLineNr( line, mlIt, melIt ); - QString s = melIt->getString( this ); + TQString s = melIt->getString( this ); if ( !s.isEmpty() ) { @@ -2031,7 +2031,7 @@ void MergeResultWindow::mouseDoubleClickEvent( QMouseEvent* e ) } } -void MergeResultWindow::mouseReleaseEvent ( QMouseEvent * e ) +void MergeResultWindow::mouseReleaseEvent ( TQMouseEvent * e ) { if ( e->button() == Qt::LeftButton ) { @@ -2045,7 +2045,7 @@ void MergeResultWindow::mouseReleaseEvent ( QMouseEvent * e ) } } -void MergeResultWindow::mouseMoveEvent ( QMouseEvent * e ) +void MergeResultWindow::mouseMoveEvent ( TQMouseEvent * e ) { int line; int pos; @@ -2061,7 +2061,7 @@ void MergeResultWindow::mouseMoveEvent ( QMouseEvent * e ) //showStatusLine( line, m_winIdx, m_pFilename, m_pDiff3LineList, m_pStatusBar ); // Scroll because mouse moved out of the window - const QFontMetrics& fm = fontMetrics(); + const TQFontMetrics& fm = fontMetrics(); int fontWidth = fm.width('W'); int topLineYOffset = 0; int deltaX=0; @@ -2097,7 +2097,7 @@ void MergeResultWindow::slotCursorUpdate() { m_bCursorUpdate = true; - const QFontMetrics& fm = fontMetrics(); + const TQFontMetrics& fm = fontMetrics(); int fontWidth = fm.width("W"); int topLineYOffset = 0; int xOffset = fontWidth * leftInfoWidth; @@ -2105,9 +2105,9 @@ void MergeResultWindow::slotCursorUpdate() int xCursor = ( m_cursorXPos - m_firstColumn ) * fontWidth + xOffset; if (!m_pOptionDialog->m_bRightToLeftLanguage) - repaint( xCursor-2, yOffset, 5, fm.ascent()+2 ); + tqrepaint( xCursor-2, yOffset, 5, fm.ascent()+2 ); else - repaint( width()-1-4-(xCursor-2), yOffset, 5, fm.ascent()+2 ); + tqrepaint( width()-1-4-(xCursor-2), yOffset, 5, fm.ascent()+2 ); m_bCursorUpdate=false; } @@ -2116,28 +2116,28 @@ void MergeResultWindow::slotCursorUpdate() } -void MergeResultWindow::wheelEvent( QWheelEvent* e ) +void MergeResultWindow::wheelEvent( TQWheelEvent* e ) { - int d = -e->delta()*QApplication::wheelScrollLines()/120; + int d = -e->delta()*TQApplication::wheelScrollLines()/120; e->accept(); scroll( 0, min2(d, getNofVisibleLines()) ); } -void MergeResultWindow::keyPressEvent( QKeyEvent* e ) +void MergeResultWindow::keyPressEvent( TQKeyEvent* e ) { int y = m_cursorYPos; MergeLineList::iterator mlIt; MergeEditLineList::iterator melIt; calcIteratorFromLineNr( y, mlIt, melIt ); - QString str = melIt->getString( this ); + TQString str = melIt->getString( this ); int x = convertToPosInText( str, m_cursorXPos, m_pOptionDialog->m_tabSize ); - bool bCtrl = ( e->state() & Qt::ControlButton ) != 0 ; - bool bShift = ( e->state() & Qt::ShiftButton ) != 0 ; + bool bCtrl = ( e->state() & TQt::ControlButton ) != 0 ; + bool bShift = ( e->state() & TQt::ShiftButton ) != 0 ; #ifdef _WIN32 - bool bAlt = ( e->state() & Qt::AltButton ) != 0 ; + bool bAlt = ( e->state() & TQt::AltButton ) != 0 ; if ( bCtrl && bAlt ){ bCtrl=false; bAlt=false; } // AltGr-Key pressed. #endif @@ -2145,10 +2145,10 @@ void MergeResultWindow::keyPressEvent( QKeyEvent* e ) // Special keys switch ( e->key() ) { - case Qt::Key_Escape: break; + case TQt::Key_Escape: break; //case Key_Tab: break; - case Qt::Key_Backtab: break; - case Qt::Key_Delete: + case TQt::Key_Backtab: break; + case TQt::Key_Delete: { if ( deleteSelection2( str, x, y, mlIt, melIt )) break; if( !melIt->isEditableText() ) break; @@ -2162,7 +2162,7 @@ void MergeResultWindow::keyPressEvent( QKeyEvent* e ) calcIteratorFromLineNr( y+1, mlIt1, melIt1 ); if ( melIt1->isEditableText() ) { - QString s2 = melIt1->getString( this ); + TQString s2 = melIt1->getString( this ); melIt->setString( str + s2 ); // Remove the line @@ -2175,14 +2175,14 @@ void MergeResultWindow::keyPressEvent( QKeyEvent* e ) } else { - QString s = str.left(x); + TQString s = str.left(x); s += str.mid( x+1 ); melIt->setString( s ); setModified(); } break; } - case Qt::Key_Backspace: + case TQt::Key_Backspace: { if ( deleteSelection2( str, x, y, mlIt, melIt )) break; if( !melIt->isEditableText() ) break; @@ -2196,7 +2196,7 @@ void MergeResultWindow::keyPressEvent( QKeyEvent* e ) calcIteratorFromLineNr( y-1, mlIt1, melIt1 ); if ( melIt1->isEditableText() ) { - QString s1 = melIt1->getString( this ); + TQString s1 = melIt1->getString( this ); melIt1->setString( s1 + str ); // Remove the previous line @@ -2212,7 +2212,7 @@ void MergeResultWindow::keyPressEvent( QKeyEvent* e ) } else { - QString s = str.left( x-1 ); + TQString s = str.left( x-1 ); s += str.mid( x ); --x; melIt->setString( s ); @@ -2220,19 +2220,19 @@ void MergeResultWindow::keyPressEvent( QKeyEvent* e ) } break; } - case Qt::Key_Return: - case Qt::Key_Enter: + case TQt::Key_Return: + case TQt::Key_Enter: { if( !melIt->isEditableText() ) break; deleteSelection2( str, x, y, mlIt, melIt ); setModified(); - QString indentation; + TQString indentation; if ( m_pOptionDialog->m_bAutoIndentation ) { // calc last indentation MergeLineList::iterator mlIt1 = mlIt; MergeEditLineList::iterator melIt1 = melIt; for(;;) { - const QString s = melIt1->getString(this); + const TQString s = melIt1->getString(this); if ( !s.isEmpty() ) { unsigned int i; for( i=0; i<s.length(); ++i ){ if(s[i]!=' ' && s[i]!='\t') break; } @@ -2259,7 +2259,7 @@ void MergeResultWindow::keyPressEvent( QKeyEvent* e ) if ( x<(int)str.length() ) // Cut off the old line. { // Since ps possibly points into melIt->str, first copy it into a temporary. - QString temp = str.left(x); + TQString temp = str.left(x); melIt->setString( temp ); } @@ -2269,16 +2269,16 @@ void MergeResultWindow::keyPressEvent( QKeyEvent* e ) ++y; break; } - case Qt::Key_Insert: m_bInsertMode = !m_bInsertMode; break; - case Qt::Key_Pause: break; - case Qt::Key_Print: break; - case Qt::Key_SysReq: break; - case Qt::Key_Home: x=0; if(bCtrl){y=0; } break; // cursor movement - case Qt::Key_End: x=INT_MAX; if(bCtrl){y=INT_MAX;} break; + case TQt::Key_Insert: m_bInsertMode = !m_bInsertMode; break; + case TQt::Key_Pause: break; + case TQt::Key_Print: break; + case TQt::Key_SysReq: break; + case TQt::Key_Home: x=0; if(bCtrl){y=0; } break; // cursor movement + case TQt::Key_End: x=INT_MAX; if(bCtrl){y=INT_MAX;} break; - case Qt::Key_Left: - case Qt::Key_Right: - if ( (e->key()==Qt::Key_Left) ^ m_pOptionDialog->m_bRightToLeftLanguage ) // operator^: XOR + case TQt::Key_Left: + case TQt::Key_Right: + if ( (e->key()==TQt::Key_Left) ^ m_pOptionDialog->m_bRightToLeftLanguage ) // operator^: XOR { if ( !bCtrl ) { @@ -2306,13 +2306,13 @@ void MergeResultWindow::keyPressEvent( QKeyEvent* e ) } break; - case Qt::Key_Up: if (!bCtrl){ --y; bYMoveKey=true; } break; - case Qt::Key_Down: if (!bCtrl){ ++y; bYMoveKey=true; } break; - case Qt::Key_PageUp: if (!bCtrl){ y-=getNofVisibleLines(); bYMoveKey=true; } break; - case Qt::Key_PageDown: if (!bCtrl){ y+=getNofVisibleLines(); bYMoveKey=true; } break; + case TQt::Key_Up: if (!bCtrl){ --y; bYMoveKey=true; } break; + case TQt::Key_Down: if (!bCtrl){ ++y; bYMoveKey=true; } break; + case TQt::Key_PageUp: if (!bCtrl){ y-=getNofVisibleLines(); bYMoveKey=true; } break; + case TQt::Key_PageDown: if (!bCtrl){ y+=getNofVisibleLines(); bYMoveKey=true; } break; default: { - QString t = e->text(); + TQString t = e->text(); if( t.isEmpty() || bCtrl ) { e->ignore(); return; } else @@ -2328,7 +2328,7 @@ void MergeResultWindow::keyPressEvent( QKeyEvent* e ) setModified(); // Characters to insert - QString s=str; + TQString s=str; if ( t[0]=='\t' && m_pOptionDialog->m_bReplaceTabs ) { int spaces = (m_cursorXPos / m_pOptionDialog->m_tabSize + 1)*m_pOptionDialog->m_tabSize - m_cursorXPos; @@ -2337,7 +2337,7 @@ void MergeResultWindow::keyPressEvent( QKeyEvent* e ) if ( m_bInsertMode ) s.insert( x, t ); else - s.replace( x, t.length(), t ); + s.tqreplace( x, t.length(), t ); melIt->setString( s ); x += t.length(); @@ -2425,9 +2425,9 @@ void MergeResultWindow::calcIteratorFromLineNr( } -QString MergeResultWindow::getSelection() +TQString MergeResultWindow::getSelection() { - QString selectionString; + TQString selectionString; int line = 0; MergeLineList::iterator mlIt = m_mergeLineList.begin(); @@ -2444,7 +2444,7 @@ QString MergeResultWindow::getSelection() int outPos = 0; if (mel.isEditableText()) { - const QString str = mel.getString( this ); + const TQString str = mel.getString( this ); // Consider tabs @@ -2485,7 +2485,7 @@ QString MergeResultWindow::getSelection() return selectionString; } -bool MergeResultWindow::deleteSelection2( QString& s, int& x, int& y, +bool MergeResultWindow::deleteSelection2( TQString& s, int& x, int& y, MergeLineList::iterator& mlIt, MergeEditLineList::iterator& melIt ) { if (m_selection.firstLine!=-1 && m_selection.bSelectionContainsData ) @@ -2511,7 +2511,7 @@ void MergeResultWindow::deleteSelection() int line = 0; MergeLineList::iterator mlItFirst; MergeEditLineList::iterator melItFirst; - QString firstLineString; + TQString firstLineString; int firstLine = -1; int lastLine = -1; @@ -2554,7 +2554,7 @@ void MergeResultWindow::deleteSelection() if ( mel.isEditableText() && m_selection.lineWithin(line) ) { - QString lineString = mel.getString( this ); + TQString lineString = mel.getString( this ); int firstPosInLine = m_selection.firstPosInLine(line); int lastPosInLine = m_selection.lastPosInLine(line); @@ -2610,21 +2610,21 @@ void MergeResultWindow::pasteClipboard( bool bFromSelection ) calcIteratorFromLineNr( y, mlIt, melIt ); melItAfter = melIt; ++melItAfter; - QString str = melIt->getString( this ); + TQString str = melIt->getString( this ); int x = convertToPosInText( str, m_cursorXPos, m_pOptionDialog->m_tabSize ); - if ( !QApplication::clipboard()->supportsSelection() ) + if ( !TQApplication::tqclipboard()->supportsSelection() ) bFromSelection = false; - QString clipBoard = QApplication::clipboard()->text( bFromSelection ? QClipboard::Selection : QClipboard::Clipboard ); + TQString clipBoard = TQApplication::tqclipboard()->text( bFromSelection ? TQClipboard::Selection : TQClipboard::Clipboard ); - QString currentLine = str.left(x); - QString endOfLine = str.mid(x); + TQString currentLine = str.left(x); + TQString endOfLine = str.mid(x); int i; int len = clipBoard.length(); for( i=0; i<len; ++i ) { - QChar c = clipBoard[i]; + TQChar c = clipBoard[i]; if ( c == '\r' ) continue; if ( c == '\n' ) { @@ -2668,7 +2668,7 @@ void MergeResultWindow::setModified(bool bModified) } /// Saves and returns true when successful. -bool MergeResultWindow::saveDocument( const QString& fileName, QTextCodec* pEncoding ) +bool MergeResultWindow::saveDocument( const TQString& fileName, TQTextCodec* pEncoding ) { // Are still conflicts somewhere? if ( getNrOfUnsolvedConflicts()>0 ) @@ -2693,8 +2693,8 @@ bool MergeResultWindow::saveDocument( const QString& fileName, QTextCodec* pEnco } } - QByteArray dataArray; - QTextStream textOutStream(dataArray, IO_WriteOnly); + TQByteArray dataArray; + TQTextStream textOutStream(dataArray, IO_WriteOnly); textOutStream.setCodec( pEncoding ); int line = 0; @@ -2709,7 +2709,7 @@ bool MergeResultWindow::saveDocument( const QString& fileName, QTextCodec* pEnco if ( mel.isEditableText() ) { - QString str = mel.getString( this ); + TQString str = mel.getString( this ); if (line>0) // Prepend line feed, but not for first line { @@ -2737,16 +2737,16 @@ bool MergeResultWindow::saveDocument( const QString& fileName, QTextCodec* pEnco return true; } -QString MergeResultWindow::getString( int lineIdx ) +TQString MergeResultWindow::getString( int lineIdx ) { MergeResultWindow::MergeLineList::iterator mlIt; MergeResultWindow::MergeEditLineList::iterator melIt; calcIteratorFromLineNr( lineIdx, mlIt, melIt ); - QString s = melIt->getString( this ); + TQString s = melIt->getString( this ); return s; } -bool MergeResultWindow::findString( const QString& s, int& d3vLine, int& posInLine, bool bDirDown, bool bCaseSensitive ) +bool MergeResultWindow::findString( const TQString& s, int& d3vLine, int& posInLine, bool bDirDown, bool bCaseSensitive ) { int it = d3vLine; int endIt = bDirDown ? getNofLines() : -1; @@ -2755,10 +2755,10 @@ bool MergeResultWindow::findString( const QString& s, int& d3vLine, int& posInLi for( ; it!=endIt; it+=step ) { - QString line = getString( it ); + TQString line = getString( it ); if ( !line.isEmpty() ) { - int pos = line.find( s, startPos, bCaseSensitive ); + int pos = line.tqfind( s, startPos, bCaseSensitive ); if ( pos != -1 ) { d3vLine = it; @@ -2777,7 +2777,7 @@ void MergeResultWindow::setSelection( int firstLine, int startPos, int lastLine, if ( lastLine >= getNofLines() ) { lastLine = getNofLines()-1; - QString s = getString( lastLine ); + TQString s = getString( lastLine ); endPos = s.length(); } m_selection.reset(); @@ -2786,8 +2786,8 @@ void MergeResultWindow::setSelection( int firstLine, int startPos, int lastLine, update(); } -Overview::Overview( QWidget* pParent, OptionDialog* pOptions ) -: QWidget( pParent, 0, WRepaintNoErase ) +Overview::Overview( TQWidget* pParent, OptionDialog* pOptions ) +: TQWidget( pParent, 0, WRepaintNoErase ) { m_pDiff3LineList = 0; m_pOptions = pOptions; @@ -2802,7 +2802,7 @@ void Overview::init( Diff3LineList* pDiff3LineList, bool bTripleDiff ) { m_pDiff3LineList = pDiff3LineList; m_bTripleDiff = bTripleDiff; - m_pixmap.resize( QSize(0,0) ); // make sure that a redraw happens + m_pixmap.resize( TQSize(0,0) ); // make sure that a redraw happens update(); } @@ -2813,7 +2813,7 @@ void Overview::reset() void Overview::slotRedraw() { - m_pixmap.resize( QSize(0,0) ); // make sure that a redraw happens + m_pixmap.resize( TQSize(0,0) ); // make sure that a redraw happens update(); } @@ -2840,7 +2840,7 @@ Overview::e_OverviewMode Overview::getOverviewMode() return m_eOverviewMode; } -void Overview::mousePressEvent( QMouseEvent* e ) +void Overview::mousePressEvent( TQMouseEvent* e ) { int h = height()-1; int h1 = h * m_pageHeight / max2(1,m_nofLines)+3; @@ -2848,7 +2848,7 @@ void Overview::mousePressEvent( QMouseEvent* e ) emit setLine( ( e->y() - h1/2 )*m_nofLines/h ); } -void Overview::mouseMoveEvent( QMouseEvent* e ) +void Overview::mouseMoveEvent( TQMouseEvent* e ) { mousePressEvent(e); } @@ -2863,9 +2863,9 @@ void Overview::setPaintingAllowed( bool bAllowPainting ) } } -void Overview::drawColumn( QPainter& p, e_OverviewMode eOverviewMode, int x, int w, int h, int nofLines ) +void Overview::drawColumn( TQPainter& p, e_OverviewMode eOverviewMode, int x, int w, int h, int nofLines ) { - p.setPen(Qt::black); + p.setPen(TQt::black); p.drawLine( x, 0, x, h ); if (nofLines==0) return; @@ -2885,7 +2885,7 @@ void Overview::drawColumn( QPainter& p, e_OverviewMode eOverviewMode, int x, int int src; mergeOneLine( d3l, md, bConflict, bLineRemoved, src, !m_bTripleDiff ); - QColor c = m_pOptions->m_bgColor; + TQColor c = m_pOptions->m_bgColor; bool bWhiteSpaceChange = false; //if( bConflict ) c=m_pOptions->m_colorForConflict; //else @@ -2972,12 +2972,12 @@ void Overview::drawColumn( QPainter& p, e_OverviewMode eOverviewMode, int x, int // Make sure that lines with conflict are not overwritten. if ( c == m_pOptions->m_colorForConflict ) { - p.fillRect(x+1, oldY, w, max2(1,y-oldY), bWhiteSpaceChange ? QBrush(c,Qt::Dense4Pattern) : QBrush(c) ); + p.fillRect(x+1, oldY, w, max2(1,y-oldY), bWhiteSpaceChange ? TQBrush(c,TQt::Dense4Pattern) : TQBrush(c) ); oldConflictY = oldY; } else if ( c!=m_pOptions->m_bgColor && oldY>oldConflictY ) { - p.fillRect(x+1, oldY, w, max2(1,y-oldY), bWhiteSpaceChange ? QBrush(c,Qt::Dense4Pattern) : QBrush(c) ); + p.fillRect(x+1, oldY, w, max2(1,y-oldY), bWhiteSpaceChange ? TQBrush(c,TQt::Dense4Pattern) : TQBrush(c) ); } } @@ -3000,7 +3000,7 @@ void Overview::drawColumn( QPainter& p, e_OverviewMode eOverviewMode, int x, int } } -void Overview::paintEvent( QPaintEvent* ) +void Overview::paintEvent( TQPaintEvent* ) { if (m_pDiff3LineList==0 || !m_bPaintingAllowed ) return; int h = height()-1; @@ -3025,7 +3025,7 @@ void Overview::paintEvent( QPaintEvent* ) m_pixmap.resize( size() ); - QPainter p(&m_pixmap); + TQPainter p(&m_pixmap); p.fillRect( rect(), m_pOptions->m_bgColor ); if ( !m_bTripleDiff || m_eOverviewMode == eOMNormal ) @@ -3039,75 +3039,75 @@ void Overview::paintEvent( QPaintEvent* ) } } - QPainter painter( this ); + TQPainter painter( this ); painter.drawPixmap( 0,0, m_pixmap ); int y1 = h * m_firstLine / m_nofLines-1; int h1 = h * m_pageHeight / m_nofLines+3; - painter.setPen(Qt::black); + painter.setPen(TQt::black); painter.drawRect( 1, y1, w-1, h1 ); } -WindowTitleWidget::WindowTitleWidget(OptionDialog* pOptionDialog, QWidget* pParent) -:QWidget(pParent) +WindowTitleWidget::WindowTitleWidget(OptionDialog* pOptionDialog, TQWidget* pParent) +:TQWidget(pParent) { m_pOptionDialog = pOptionDialog; //setAutoFillBackground(true); - QHBoxLayout* pHLayout = new QHBoxLayout(this); + TQHBoxLayout* pHLayout = new TQHBoxLayout(this); pHLayout->setMargin(2); pHLayout->setSpacing(2); - m_pLabel = new QLabel(i18n("Output")+":", this); + m_pLabel = new TQLabel(i18n("Output")+":", this); pHLayout->addWidget( m_pLabel ); - m_pFileNameLineEdit = new QLineEdit(this); + m_pFileNameLineEdit = new TQLineEdit(this); pHLayout->addWidget( m_pFileNameLineEdit, 6 ); m_pFileNameLineEdit->installEventFilter( this ); m_pFileNameLineEdit->setReadOnly( true ); - //m_pBrowseButton = new QPushButton("..."); + //m_pBrowseButton = new TQPushButton("..."); //pHLayout->addWidget( m_pBrowseButton, 0 ); - //connect( m_pBrowseButton, SIGNAL(clicked()), this, SLOT(slotBrowseButtonClicked())); + //connect( m_pBrowseButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotBrowseButtonClicked())); - m_pModifiedLabel = new QLabel(i18n("[Modified]"),this); + m_pModifiedLabel = new TQLabel(i18n("[Modified]"),this); pHLayout->addWidget( m_pModifiedLabel ); - m_pModifiedLabel->setMinimumSize( m_pModifiedLabel->sizeHint() ); + m_pModifiedLabel->setMinimumSize( m_pModifiedLabel->tqsizeHint() ); m_pModifiedLabel->setText(""); pHLayout->addStretch(1); - m_pEncodingLabel = new QLabel(i18n("Encoding for saving")+":",this); + m_pEncodingLabel = new TQLabel(i18n("Encoding for saving")+":",this); pHLayout->addWidget( m_pEncodingLabel ); - m_pEncodingSelector = new QComboBox(this); + m_pEncodingSelector = new TQComboBox(this); pHLayout->addWidget( m_pEncodingSelector, 3 ); setEncodings(0,0,0); } -void WindowTitleWidget::setFileName( const QString& fileName ) +void WindowTitleWidget::setFileName( const TQString& fileName ) { - m_pFileNameLineEdit->setText( QDir::convertSeparators(fileName) ); + m_pFileNameLineEdit->setText( TQDir::convertSeparators(fileName) ); } -QString WindowTitleWidget::getFileName() +TQString WindowTitleWidget::getFileName() { return m_pFileNameLineEdit->text(); } -void WindowTitleWidget::setEncodings( QTextCodec* pCodecForA, QTextCodec* pCodecForB, QTextCodec* pCodecForC ) +void WindowTitleWidget::setEncodings( TQTextCodec* pCodecForA, TQTextCodec* pCodecForB, TQTextCodec* pCodecForC ) { m_pEncodingSelector->clear(); m_codecMap.clear(); // First sort codec names: - std::map<QString, QTextCodec*> names; + std::map<TQString, TQTextCodec*> names; int i; for(i=0;;++i) { - QTextCodec* c = QTextCodec::codecForIndex(i); + TQTextCodec* c = TQTextCodec::codecForIndex(i); if ( c==0 ) break; - else names[QString(c->name())]=c; + else names[TQString(c->name())]=c; } i=0; @@ -3130,14 +3130,14 @@ void WindowTitleWidget::setEncodings( QTextCodec* pCodecForA, QTextCodec* pCodec ++i; } - std::map<QString, QTextCodec*>::iterator it; + std::map<TQString, TQTextCodec*>::iterator it; for(it=names.begin();it!=names.end();++it) { m_pEncodingSelector->insertItem( it->first, i ); m_codecMap[i]=it->second; ++i; } - m_pEncodingSelector->setMinimumSize( m_pEncodingSelector->sizeHint() ); + m_pEncodingSelector->setMinimumSize( m_pEncodingSelector->tqsizeHint() ); if ( pCodecForC && pCodecForB && pCodecForA ) { @@ -3154,19 +3154,19 @@ void WindowTitleWidget::setEncodings( QTextCodec* pCodecForA, QTextCodec* pCodec m_pEncodingSelector->setCurrentItem( 0 ); } -QTextCodec* WindowTitleWidget::getEncoding() +TQTextCodec* WindowTitleWidget::getEncoding() { return m_codecMap[ m_pEncodingSelector->currentItem() ]; } -void WindowTitleWidget::setEncoding(QTextCodec* pEncoding) +void WindowTitleWidget::setEncoding(TQTextCodec* pEncoding) { - m_pEncodingSelector->setCurrentText( QString( pEncoding->name() ) ); + m_pEncodingSelector->setCurrentText( TQString( pEncoding->name() ) ); } //void WindowTitleWidget::slotBrowseButtonClicked() //{ -// QString current = m_pFileNameLineEdit->text(); +// TQString current = m_pFileNameLineEdit->text(); // // KURL newURL = KFileDialog::getSaveURL( current, 0, this, i18n("Select file (not saving yet)")); // if ( !newURL.isEmpty() ) @@ -3180,38 +3180,38 @@ void WindowTitleWidget::slotSetModified( bool bModified ) m_pModifiedLabel->setText( bModified ? i18n("[Modified]") : "" ); } -bool WindowTitleWidget::eventFilter( QObject* o, QEvent* e ) +bool WindowTitleWidget::eventFilter( TQObject* o, TQEvent* e ) { - if ( e->type()==QEvent::FocusIn || e->type()==QEvent::FocusOut ) + if ( e->type()==TQEvent::FocusIn || e->type()==TQEvent::FocusOut ) { - QPalette p = m_pLabel->palette(); + TQPalette p = m_pLabel->palette(); - QColor c1 = m_pOptionDialog->m_fgColor; - QColor c2 = Qt::lightGray; - if ( e->type()==QEvent::FocusOut ) + TQColor c1 = m_pOptionDialog->m_fgColor; + TQColor c2 = TQt::lightGray; + if ( e->type()==TQEvent::FocusOut ) c2 = m_pOptionDialog->m_bgColor; - p.setColor(QColorGroup::Background, c2); + p.setColor(TQColorGroup::Background, c2); setPalette( p ); - p.setColor(QColorGroup::Foreground, c1); + p.setColor(TQColorGroup::Foreground, c1); m_pLabel->setPalette( p ); m_pEncodingLabel->setPalette( p ); m_pEncodingSelector->setPalette( p ); } - if (o == m_pFileNameLineEdit && e->type()==QEvent::Drop) + if (TQT_BASE_OBJECT(o) == TQT_BASE_OBJECT(m_pFileNameLineEdit) && e->type()==TQEvent::Drop) { - QDropEvent* d = static_cast<QDropEvent*>(e); + TQDropEvent* d = static_cast<TQDropEvent*>(e); - if ( QUriDrag::canDecode( d ) ) + if ( TQUriDrag::canDecode( d ) ) { - QStringList lst; - QUriDrag::decodeLocalFiles( d, lst ); + TQStringList lst; + TQUriDrag::decodeLocalFiles( d, lst ); if ( lst.count() > 0 ) { - static_cast<QLineEdit*>(o)->setText( lst[0] ); - static_cast<QLineEdit*>(o)->setFocus(); + static_cast<TQLineEdit*>(TQT_TQWIDGET(o))->setText( lst[0] ); + static_cast<TQLineEdit*>(TQT_TQWIDGET(o))->setFocus(); return true; } } diff --git a/src/mergeresultwindow.h b/src/mergeresultwindow.h index fdc4b5c..ed524a5 100644 --- a/src/mergeresultwindow.h +++ b/src/mergeresultwindow.h @@ -20,17 +20,18 @@ #include "diff.h" -#include <qwidget.h> -#include <qpixmap.h> -#include <qtimer.h> +#include <tqwidget.h> +#include <tqpixmap.h> +#include <tqtimer.h> -class QPainter; +class TQPainter; -class Overview : public QWidget +class Overview : public TQWidget { Q_OBJECT + TQ_OBJECT public: - Overview( QWidget* pParent, OptionDialog* pOptions ); + Overview( TQWidget* pParent, OptionDialog* pOptions ); void init( Diff3LineList* pDiff3LineList, bool bTripleDiff ); void reset(); @@ -52,15 +53,15 @@ private: bool m_bTripleDiff; int m_firstLine; int m_pageHeight; - QPixmap m_pixmap; + TQPixmap m_pixmap; bool m_bPaintingAllowed; e_OverviewMode m_eOverviewMode; int m_nofLines; - virtual void paintEvent( QPaintEvent* e ); - virtual void mousePressEvent( QMouseEvent* e ); - virtual void mouseMoveEvent( QMouseEvent* e ); - void drawColumn( QPainter& p, e_OverviewMode eOverviewMode, int x, int w, int h, int nofLines ); + virtual void paintEvent( TQPaintEvent* e ); + virtual void mousePressEvent( TQMouseEvent* e ); + virtual void mouseMoveEvent( TQMouseEvent* e ); + void drawColumn( TQPainter& p, e_OverviewMode eOverviewMode, int x, int w, int h, int nofLines ); }; @@ -93,14 +94,15 @@ enum e_MergeSrcSelector C=3 }; -class MergeResultWindow : public QWidget +class MergeResultWindow : public TQWidget { Q_OBJECT + TQ_OBJECT public: MergeResultWindow( - QWidget* pParent, + TQWidget* pParent, OptionDialog* pOptionDialog, - QStatusBar* pStatusBar + TQStatusBar* pStatusBar ); void init( @@ -108,12 +110,12 @@ public: const LineData* pLineDataB, int sizeB, const LineData* pLineDataC, int sizeC, const Diff3LineList* pDiff3LineList, - TotalDiffStatus* pTotalDiffStatus + TotalDifftqStatus* pTotalDifftqStatus ); void reset(); - bool saveDocument( const QString& fileName, QTextCodec* pEncoding ); + bool saveDocument( const TQString& fileName, TQTextCodec* pEncoding ); int getNrOfUnsolvedConflicts(int* pNrOfWhiteSpaceConflicts=0); void choose(int selector); void chooseGlobal(int selector, bool bConflictsOnly, bool bWhiteSpaceOnly ); @@ -122,7 +124,7 @@ public: int getNofLines(); int getNofVisibleColumns(); int getNofVisibleLines(); - QString getSelection(); + TQString getSelection(); void resetSelection(); void showNrOfConflicts(); bool isDeltaAboveCurrent(); @@ -132,7 +134,7 @@ public: bool isUnsolvedConflictAtCurrent(); bool isUnsolvedConflictAboveCurrent(); bool isUnsolvedConflictBelowCurrent(); - bool findString( const QString& s, int& d3vLine, int& posInLine, bool bDirDown, bool bCaseSensitive ); + bool findString( const TQString& s, int& d3vLine, int& posInLine, bool bDirDown, bool bCaseSensitive ); void setSelection( int firstLine, int startPos, int lastLine, int endPos ); void setOverviewMode( Overview::e_OverviewMode eOverviewMode ); Overview::e_OverviewMode getOverviewMode(); @@ -168,12 +170,12 @@ signals: void selectionEnd(); void newSelection(); void updateAvailabilities(); - void showPopupMenu( const QPoint& point ); + void showPopupMenu( const TQPoint& point ); void noRelevantChangesDetected(); private: void merge(bool bAutoSolve, int defaultSelector, bool bConflictsOnly=false, bool bWhiteSpaceOnly=false ); - QString getString( int lineIdx ); + TQString getString( int lineIdx ); OptionDialog* m_pOptionDialog; @@ -185,7 +187,7 @@ private: int m_sizeC; const Diff3LineList* m_pDiff3LineList; - TotalDiffStatus* m_pTotalDiffStatus; + TotalDifftqStatus* m_pTotalDifftqStatus; bool m_bPaintingAllowed; int m_delayedDrawTimer; @@ -196,13 +198,13 @@ private: { public: MergeEditLine(Diff3LineList::const_iterator i, int src=0){m_id3l=i; m_src=src; m_bLineRemoved=false; } - void setConflict() { m_src=0; m_bLineRemoved=false; m_str=QString(); } + void setConflict() { m_src=0; m_bLineRemoved=false; m_str=TQString(); } bool isConflict() { return m_src==0 && !m_bLineRemoved && m_str.isNull(); } - void setRemoved(int src=0) { m_src=src; m_bLineRemoved=true; m_str=QString(); } + void setRemoved(int src=0) { m_src=src; m_bLineRemoved=true; m_str=TQString(); } bool isRemoved() { return m_bLineRemoved; } bool isEditableText() { return !isConflict() && !isRemoved(); } - void setString( const QString& s ){ m_str=s; m_bLineRemoved=false; m_src=0; } - QString getString( const MergeResultWindow* ); + void setString( const TQString& s ){ m_str=s; m_bLineRemoved=false; m_src=0; } + TQString getString( const MergeResultWindow* ); bool isModified() { return ! m_str.isNull() || (m_bLineRemoved && m_src==0); } void setSource( int src, bool bLineRemoved ) { m_src=src; m_bLineRemoved =bLineRemoved; } @@ -212,7 +214,7 @@ private: private: Diff3LineList::const_iterator m_id3l; int m_src; // 1, 2 or 3 for A, B or C respectively, or 0 when line is from neither source. - QString m_str; // String when modified by user or null-string when orig data is used. + TQString m_str; // String when modified by user or null-string when orig data is used. bool m_bLineRemoved; }; @@ -339,7 +341,7 @@ private: MergeEditLineList& choice( bool bThreeInputs ); bool staysInPlace( bool bThreeInputs, Diff3LineList::const_iterator& iHistoryEnd ); }; - typedef std::map<QString,HistoryMapEntry> HistoryMap; + typedef std::map<TQString,HistoryMapEntry> HistoryMap; void collectHistoryInformation( int src, Diff3LineList::const_iterator iHistoryBegin, Diff3LineList::const_iterator iHistoryEnd, HistoryMap& historyMap, std::list< HistoryMap::iterator >& hitList ); typedef std::list<MergeLine> MergeLineList; @@ -364,28 +366,28 @@ private: ); MergeLineList::iterator splitAtDiff3LineIdx( int d3lLineIdx ); - virtual void paintEvent( QPaintEvent* e ); + virtual void paintEvent( TQPaintEvent* e ); void myUpdate(int afterMilliSecs); - virtual void timerEvent(QTimerEvent*); + virtual void timerEvent(TQTimerEvent*); void writeLine( - MyPainter& p, int line, const QString& str, + MyPainter& p, int line, const TQString& str, int srcSelect, e_MergeDetails mergeDetails, int rangeMark, bool bUserModified, bool bLineRemoved, bool bWhiteSpaceConflict ); void setFastSelector(MergeLineList::iterator i); void convertToLinePos( int x, int y, int& line, int& pos ); - virtual void mousePressEvent ( QMouseEvent* e ); - virtual void mouseDoubleClickEvent ( QMouseEvent* e ); - virtual void mouseReleaseEvent ( QMouseEvent * ); - virtual void mouseMoveEvent ( QMouseEvent * ); - virtual void resizeEvent( QResizeEvent* e ); - virtual void keyPressEvent( QKeyEvent* e ); - virtual void wheelEvent( QWheelEvent* e ); - virtual void focusInEvent( QFocusEvent* e ); + virtual void mousePressEvent ( TQMouseEvent* e ); + virtual void mouseDoubleClickEvent ( TQMouseEvent* e ); + virtual void mouseReleaseEvent ( TQMouseEvent * ); + virtual void mouseMoveEvent ( TQMouseEvent * ); + virtual void resizeEvent( TQResizeEvent* e ); + virtual void keyPressEvent( TQKeyEvent* e ); + virtual void wheelEvent( TQWheelEvent* e ); + virtual void focusInEvent( TQFocusEvent* e ); virtual bool focusNextPrevChild(bool){return false;} - QPixmap m_pixmap; + TQPixmap m_pixmap; int m_firstLine; int m_firstColumn; int m_nofColumns; @@ -402,13 +404,13 @@ private: int m_cursorYPos; int m_cursorOldXPos; bool m_bCursorOn; // blinking on and off each second - QTimer m_cursorTimer; + TQTimer m_cursorTimer; bool m_bCursorUpdate; - QStatusBar* m_pStatusBar; + TQStatusBar* m_pStatusBar; Selection m_selection; - bool deleteSelection2( QString& str, int& x, int& y, + bool deleteSelection2( TQString& str, int& x, int& y, MergeLineList::iterator& mlIt, MergeEditLineList::iterator& melIt ); bool doRelevantChangesExist(); public slots: @@ -418,31 +420,32 @@ private slots: void slotCursorUpdate(); }; -class QLineEdit; -class QTextCodec; -class QComboBox; -class QLabel; -class WindowTitleWidget : public QWidget +class TQLineEdit; +class TQTextCodec; +class TQComboBox; +class TQLabel; +class WindowTitleWidget : public TQWidget { Q_OBJECT + TQ_OBJECT private: - QLabel* m_pLabel; - QLineEdit* m_pFileNameLineEdit; - //QPushButton* m_pBrowseButton; - QLabel* m_pModifiedLabel; - QLabel* m_pEncodingLabel; - QComboBox* m_pEncodingSelector; + TQLabel* m_pLabel; + TQLineEdit* m_pFileNameLineEdit; + //TQPushButton* m_pBrowseButton; + TQLabel* m_pModifiedLabel; + TQLabel* m_pEncodingLabel; + TQComboBox* m_pEncodingSelector; OptionDialog* m_pOptionDialog; - std::map<int, QTextCodec*> m_codecMap; + std::map<int, TQTextCodec*> m_codecMap; public: - WindowTitleWidget(OptionDialog* pOptionDialog, QWidget* pParent ); - QTextCodec* getEncoding(); - void setFileName(const QString& fileName ); - QString getFileName(); - void setEncodings( QTextCodec* pCodecForA, QTextCodec* pCodecForB, QTextCodec* pCodecForC ); - void setEncoding( QTextCodec* pCodec ); - - bool eventFilter( QObject* o, QEvent* e ); + WindowTitleWidget(OptionDialog* pOptionDialog, TQWidget* pParent ); + TQTextCodec* getEncoding(); + void setFileName(const TQString& fileName ); + TQString getFileName(); + void setEncodings( TQTextCodec* pCodecForA, TQTextCodec* pCodecForB, TQTextCodec* pCodecForC ); + void setEncoding( TQTextCodec* pCodec ); + + bool eventFilter( TQObject* o, TQEvent* e ); public slots: void slotSetModified( bool bModified ); //private slots: diff --git a/src/optiondialog.cpp b/src/optiondialog.cpp index 698763e..445fbb0 100644 --- a/src/optiondialog.cpp +++ b/src/optiondialog.cpp @@ -18,20 +18,20 @@ * */ -#include <qcheckbox.h> -#include <qcombobox.h> -#include <qfont.h> -#include <qframe.h> -#include <qlayout.h> -#include <qlabel.h> -#include <qlineedit.h> -#include <qvbox.h> -#include <qvalidator.h> -#include <qtooltip.h> -#include <qtextcodec.h> -#include <qradiobutton.h> -#include <qvbuttongroup.h> -#include <qsettings.h> +#include <tqcheckbox.h> +#include <tqcombobox.h> +#include <tqfont.h> +#include <tqframe.h> +#include <tqlayout.h> +#include <tqlabel.h> +#include <tqlineedit.h> +#include <tqvbox.h> +#include <tqvalidator.h> +#include <tqtooltip.h> +#include <tqtextcodec.h> +#include <tqradiobutton.h> +#include <tqvbuttongroup.h> +#include <tqsettings.h> #include <kapplication.h> #include <kcolorbtn.h> @@ -55,10 +55,10 @@ #include <kglobalsettings.h> #endif -static QString s_historyEntryStartRegExpToolTip; -static QString s_historyEntryStartSortKeyOrderToolTip; -static QString s_autoMergeRegExpToolTip; -static QString s_historyStartRegExpToolTip; +static TQString s_historyEntryStartRegExpToolTip; +static TQString s_historyEntryStartSortKeyOrderToolTip; +static TQString s_autoMergeRegExpToolTip; +static TQString s_historyStartRegExpToolTip; void OptionDialog::addOptionItem(OptionItem* p) { @@ -68,7 +68,7 @@ void OptionDialog::addOptionItem(OptionItem* p) class OptionItem { public: - OptionItem( OptionDialog* pOptionDialog, const QString& saveName ) + OptionItem( OptionDialog* pOptionDialog, const TQString& saveName ) { assert(pOptionDialog!=0); pOptionDialog->addOptionItem( this ); @@ -80,17 +80,17 @@ public: virtual void apply()=0; virtual void write(ValueMap*)=0; virtual void read(ValueMap*)=0; - QString getSaveName(){return m_saveName;} + TQString getSaveName(){return m_saveName;} protected: - QString m_saveName; + TQString m_saveName; }; -class OptionCheckBox : public QCheckBox, public OptionItem +class OptionCheckBox : public TQCheckBox, public OptionItem { public: - OptionCheckBox( QString text, bool bDefaultVal, const QString& saveName, bool* pbVar, - QWidget* pParent, OptionDialog* pOD ) - : QCheckBox( text, pParent ), OptionItem( pOD, saveName ) + OptionCheckBox( TQString text, bool bDefaultVal, const TQString& saveName, bool* pbVar, + TQWidget* pParent, OptionDialog* pOD ) + : TQCheckBox( text, pParent ), OptionItem( pOD, saveName ) { m_pbVar = pbVar; m_bDefaultVal = bDefaultVal; @@ -106,12 +106,12 @@ private: bool m_bDefaultVal; }; -class OptionRadioButton : public QRadioButton, public OptionItem +class OptionRadioButton : public TQRadioButton, public OptionItem { public: - OptionRadioButton( QString text, bool bDefaultVal, const QString& saveName, bool* pbVar, - QWidget* pParent, OptionDialog* pOD ) - : QRadioButton( text, pParent ), OptionItem( pOD, saveName ) + OptionRadioButton( TQString text, bool bDefaultVal, const TQString& saveName, bool* pbVar, + TQWidget* pParent, OptionDialog* pOD ) + : TQRadioButton( text, pParent ), OptionItem( pOD, saveName ) { m_pbVar = pbVar; m_bDefaultVal = bDefaultVal; @@ -132,13 +132,13 @@ template<class T> class OptionT : public OptionItem { public: - OptionT( const T& defaultVal, const QString& saveName, T* pVar, OptionDialog* pOD ) + OptionT( const T& defaultVal, const TQString& saveName, T* pVar, OptionDialog* pOD ) : OptionItem( pOD, saveName ) { m_pVar = pVar; *m_pVar = defaultVal; } - OptionT( const QString& saveName, T* pVar, OptionDialog* pOD ) + OptionT( const TQString& saveName, T* pVar, OptionDialog* pOD ) : OptionItem( pOD, saveName ) { m_pVar = pVar; @@ -153,26 +153,26 @@ private: T* m_pVar; }; -template <class T> void writeEntry(ValueMap* vm, const QString& saveName, const T& v ) { vm->writeEntry( saveName, v ); } -static void writeEntry(ValueMap* vm, const QString& saveName, const QStringList& v ) { vm->writeEntry( saveName, v, '|' ); } +template <class T> void writeEntry(ValueMap* vm, const TQString& saveName, const T& v ) { vm->writeEntry( saveName, v ); } +static void writeEntry(ValueMap* vm, const TQString& saveName, const TQStringList& v ) { vm->writeEntry( saveName, v, '|' ); } -static void readEntry(ValueMap* vm, const QString& saveName, bool& v ) { v = vm->readBoolEntry( saveName, v ); } -static void readEntry(ValueMap* vm, const QString& saveName, int& v ) { v = vm->readNumEntry( saveName, v ); } -static void readEntry(ValueMap* vm, const QString& saveName, QSize& v ) { v = vm->readSizeEntry( saveName, &v ); } -static void readEntry(ValueMap* vm, const QString& saveName, QPoint& v ) { v = vm->readPointEntry( saveName, &v ); } -static void readEntry(ValueMap* vm, const QString& saveName, QStringList& v ){ v = vm->readListEntry( saveName, QStringList(), '|' ); } +static void readEntry(ValueMap* vm, const TQString& saveName, bool& v ) { v = vm->readBoolEntry( saveName, v ); } +static void readEntry(ValueMap* vm, const TQString& saveName, int& v ) { v = vm->readNumEntry( saveName, v ); } +static void readEntry(ValueMap* vm, const TQString& saveName, TQSize& v ) { v = vm->readSizeEntry( saveName, &v ); } +static void readEntry(ValueMap* vm, const TQString& saveName, TQPoint& v ) { v = vm->readPointEntry( saveName, &v ); } +static void readEntry(ValueMap* vm, const TQString& saveName, TQStringList& v ){ v = vm->readListEntry( saveName, TQStringList(), '|' ); } typedef OptionT<bool> OptionToggleAction; typedef OptionT<int> OptionNum; -typedef OptionT<QPoint> OptionPoint; -typedef OptionT<QSize> OptionSize; -typedef OptionT<QStringList> OptionStringList; +typedef OptionT<TQPoint> OptionPoint; +typedef OptionT<TQSize> OptionSize; +typedef OptionT<TQStringList> OptionStringList; class OptionFontChooser : public KFontChooser, public OptionItem { public: - OptionFontChooser( const QFont& defaultVal, const QString& saveName, QFont* pbVar, QWidget* pParent, OptionDialog* pOD ) - :KFontChooser( pParent,"font",true/*onlyFixed*/,QStringList(),false,6 ), + OptionFontChooser( const TQFont& defaultVal, const TQString& saveName, TQFont* pbVar, TQWidget* pParent, OptionDialog* pOD ) + :KFontChooser( pParent,"font",true/*onlyFixed*/,TQStringList(),false,6 ), OptionItem( pOD, saveName ) { m_pbVar = pbVar; @@ -186,14 +186,14 @@ public: void read (ValueMap* config){ *m_pbVar = config->readFontEntry( m_saveName, m_pbVar ); } private: OptionFontChooser( const OptionToggleAction& ); // private copy constructor without implementation - QFont* m_pbVar; - QFont m_default; + TQFont* m_pbVar; + TQFont m_default; }; class OptionColorButton : public KColorButton, public OptionItem { public: - OptionColorButton( QColor defaultVal, const QString& saveName, QColor* pVar, QWidget* pParent, OptionDialog* pOD ) + OptionColorButton( TQColor defaultVal, const TQString& saveName, TQColor* pVar, TQWidget* pParent, OptionDialog* pOD ) : KColorButton( pParent ), OptionItem( pOD, saveName ) { m_pVar = pVar; @@ -206,16 +206,16 @@ public: void read (ValueMap* config){ *m_pVar = config->readColorEntry( m_saveName, m_pVar ); } private: OptionColorButton( const OptionColorButton& ); // private copy constructor without implementation - QColor* m_pVar; - QColor m_defaultVal; + TQColor* m_pVar; + TQColor m_defaultVal; }; -class OptionLineEdit : public QComboBox, public OptionItem +class OptionLineEdit : public TQComboBox, public OptionItem { public: - OptionLineEdit( const QString& defaultVal, const QString& saveName, QString* pVar, - QWidget* pParent, OptionDialog* pOD ) - : QComboBox( pParent ), OptionItem( pOD, saveName ) + OptionLineEdit( const TQString& defaultVal, const TQString& saveName, TQString* pVar, + TQWidget* pParent, OptionDialog* pOD ) + : TQComboBox( pParent ), OptionItem( pOD, saveName ) { setMinimumWidth(50); setEditable(true); @@ -237,7 +237,7 @@ public: private: void insertText() { // Check if the text exists. If yes remove it and push it in as first element - QString current = currentText(); + TQString current = currentText(); m_list.remove( current ); m_list.push_front( current ); clear(); @@ -246,32 +246,32 @@ private: insertStringList(m_list); } OptionLineEdit( const OptionLineEdit& ); // private copy constructor without implementation - QString* m_pVar; - QString m_defaultVal; - QStringList m_list; + TQString* m_pVar; + TQString m_defaultVal; + TQStringList m_list; }; -#if defined QT_NO_VALIDATOR +#if defined TQT_NO_VALIDATOR #error No validator #endif -class OptionIntEdit : public QLineEdit, public OptionItem +class OptionIntEdit : public TQLineEdit, public OptionItem { public: - OptionIntEdit( int defaultVal, const QString& saveName, int* pVar, int rangeMin, int rangeMax, - QWidget* pParent, OptionDialog* pOD ) - : QLineEdit( pParent ), OptionItem( pOD, saveName ) + OptionIntEdit( int defaultVal, const TQString& saveName, int* pVar, int rangeMin, int rangeMax, + TQWidget* pParent, OptionDialog* pOD ) + : TQLineEdit( pParent ), OptionItem( pOD, saveName ) { m_pVar = pVar; m_defaultVal = defaultVal; - QIntValidator* v = new QIntValidator(this); + TQIntValidator* v = new TQIntValidator(TQT_TQOBJECT(this)); v->setRange( rangeMin, rangeMax ); setValidator( v ); } - void setToDefault(){ QString s; s.setNum(m_defaultVal); setText( s ); } - void setToCurrent(){ QString s; s.setNum(*m_pVar); setText( s ); } - void apply() { const QIntValidator* v=static_cast<const QIntValidator*>(validator()); + void setToDefault(){ TQString s; s.setNum(m_defaultVal); setText( s ); } + void setToCurrent(){ TQString s; s.setNum(*m_pVar); setText( s ); } + void apply() { const TQIntValidator* v=static_cast<const TQIntValidator*>(validator()); *m_pVar = minMaxLimiter( text().toInt(), v->bottom(), v->top()); - setText( QString::number(*m_pVar) ); } + setText( TQString::number(*m_pVar) ); } void write(ValueMap* config){ config->writeEntry(m_saveName, *m_pVar ); } void read (ValueMap* config){ *m_pVar = config->readNumEntry( m_saveName, *m_pVar ); } private: @@ -280,12 +280,12 @@ private: int m_defaultVal; }; -class OptionComboBox : public QComboBox, public OptionItem +class OptionComboBox : public TQComboBox, public OptionItem { public: - OptionComboBox( int defaultVal, const QString& saveName, int* pVarNum, - QWidget* pParent, OptionDialog* pOD ) - : QComboBox( pParent ), OptionItem( pOD, saveName ) + OptionComboBox( int defaultVal, const TQString& saveName, int* pVarNum, + TQWidget* pParent, OptionDialog* pOD ) + : TQComboBox( pParent ), OptionItem( pOD, saveName ) { setMinimumWidth(50); m_pVarNum = pVarNum; @@ -293,9 +293,9 @@ public: m_defaultVal = defaultVal; setEditable(false); } - OptionComboBox( int defaultVal, const QString& saveName, QString* pVarStr, - QWidget* pParent, OptionDialog* pOD ) - : QComboBox( pParent ), OptionItem( pOD, saveName ) + OptionComboBox( int defaultVal, const TQString& saveName, TQString* pVarStr, + TQWidget* pParent, OptionDialog* pOD ) + : TQComboBox( pParent ), OptionItem( pOD, saveName ) { m_pVarNum = 0; m_pVarStr = pVarStr; @@ -330,10 +330,10 @@ public: private: OptionComboBox( const OptionIntEdit& ); // private copy constructor without implementation int* m_pVarNum; - QString* m_pVarStr; + TQString* m_pVarStr; int m_defaultVal; - void setText(const QString& s) + void setText(const TQString& s) { // Find the string in the combobox-list, don't change the value if nothing fits. for( int i=0; i<count(); ++i ) @@ -349,41 +349,41 @@ private: } }; -class OptionEncodingComboBox : public QComboBox, public OptionItem +class OptionEncodingComboBox : public TQComboBox, public OptionItem { - std::vector<QTextCodec*> m_codecVec; - QTextCodec** m_ppVarCodec; + std::vector<TQTextCodec*> m_codecVec; + TQTextCodec** m_ppVarCodec; public: - OptionEncodingComboBox( const QString& saveName, QTextCodec** ppVarCodec, - QWidget* pParent, OptionDialog* pOD ) - : QComboBox( pParent ), OptionItem( pOD, saveName ) + OptionEncodingComboBox( const TQString& saveName, TQTextCodec** ppVarCodec, + TQWidget* pParent, OptionDialog* pOD ) + : TQComboBox( pParent ), OptionItem( pOD, saveName ) { m_ppVarCodec = ppVarCodec; - insertCodec( i18n("Unicode, 8 bit"), QTextCodec::codecForName("UTF-8") ); - insertCodec( i18n("Unicode"), QTextCodec::codecForName("iso-10646-UCS-2") ); - insertCodec( i18n("Latin1"), QTextCodec::codecForName("iso 8859-1") ); + insertCodec( i18n("Unicode, 8 bit"), TQTextCodec::codecForName("UTF-8") ); + insertCodec( i18n("Unicode"), TQTextCodec::codecForName("iso-10646-UCS-2") ); + insertCodec( i18n("Latin1"), TQTextCodec::codecForName("iso 8859-1") ); // First sort codec names: - std::map<QString, QTextCodec*> names; + std::map<TQString, TQTextCodec*> names; int i; for(i=0;;++i) { - QTextCodec* c = QTextCodec::codecForIndex(i); + TQTextCodec* c = TQTextCodec::codecForIndex(i); if ( c==0 ) break; - else names[QString(c->name()).upper()]=c; + else names[TQString(c->name()).upper()]=c; } - std::map<QString, QTextCodec*>::iterator it; + std::map<TQString, TQTextCodec*>::iterator it; for(it=names.begin();it!=names.end();++it) { insertCodec( "", it->second ); } - QToolTip::add( this, i18n( + TQToolTip::add( this, i18n( "Change this if non-ASCII characters are not displayed correctly." )); } - void insertCodec( const QString& visibleCodecName, QTextCodec* c ) + void insertCodec( const TQString& visibleCodecName, TQTextCodec* c ) { if (c!=0) { @@ -392,17 +392,17 @@ public: if ( c==m_codecVec[i] ) return; // don't insert any codec twice } - insertItem( visibleCodecName.isEmpty() ? QString(c->name()) : visibleCodecName+" ("+c->name()+")", m_codecVec.size() ); + insertItem( visibleCodecName.isEmpty() ? TQString(c->name()) : visibleCodecName+" ("+c->name()+")", m_codecVec.size() ); m_codecVec.push_back( c ); } } void setToDefault() { - QString defaultName = QTextCodec::codecForLocale()->name(); + TQString defaultName = TQTextCodec::codecForLocale()->name(); for(int i=0;i<count();++i) { if (defaultName==text(i) && - m_codecVec[i]==QTextCodec::codecForLocale()) + m_codecVec[i]==TQTextCodec::codecForLocale()) { setCurrentItem(i); if (m_ppVarCodec!=0){ *m_ppVarCodec=m_codecVec[i]; } @@ -437,7 +437,7 @@ public: } void read (ValueMap* config) { - QString codecName = config->readEntry( m_saveName, m_codecVec[ currentItem() ]->name() ); + TQString codecName = config->readEntry( m_saveName, m_codecVec[ currentItem() ]->name() ); for(unsigned int i=0; i<m_codecVec.size(); ++i) { if ( codecName == m_codecVec[i]->name() ) @@ -451,11 +451,11 @@ public: }; -OptionDialog::OptionDialog( bool bShowDirMergeSettings, QWidget *parent, char *name ) +OptionDialog::OptionDialog( bool bShowDirMergeSettings, TQWidget *tqparent, char *name ) :KDialogBase( IconList, i18n("Configure"), Help|Default|Apply|Ok|Cancel, - Ok, parent, name, true /*modal*/, true ) + Ok, tqparent, name, true /*modal*/, true ) { - setHelp( "kdiff3/index.html", QString::null ); + setHelp( "kdiff3/index.html", TQString() ); setupFontPage(); setupColorPage(); @@ -495,8 +495,8 @@ void OptionDialog::setupOtherOptions() new OptionToggleAction( true, "Show Statusbar", &m_bShowStatusBar, this ); new OptionNum( (int)KToolBar::Top, "ToolBarPos", &m_toolBarPos, this ); - new OptionSize( QSize(600,400),"Geometry", &m_geometry, this ); - new OptionPoint( QPoint(0,22), "Position", &m_position, this ); + new OptionSize( TQSize(600,400),"Geometry", &m_tqgeometry, this ); + new OptionPoint( TQPoint(0,22), "Position", &m_position, this ); new OptionToggleAction( false, "WindowStateMaximised", &m_bMaximised, this ); new OptionStringList( "RecentAFiles", &m_recentAFiles, this ); @@ -507,16 +507,16 @@ void OptionDialog::setupOtherOptions() void OptionDialog::setupFontPage( void ) { - QFrame *page = addPage( i18n("Font"), i18n("Editor & Diff Output Font" ), + TQFrame *page = addPage( i18n("Font"), i18n("Editor & Diff Output Font" ), BarIcon("fonts", KIcon::SizeMedium ) ); - QVBoxLayout *topLayout = new QVBoxLayout( page, 5, spacingHint() ); + TQVBoxLayout *topLayout = new TQVBoxLayout( page, 5, spacingHint() ); - QFont defaultFont = + TQFont defaultFont = #ifdef _WIN32 - QFont("Courier New", 10 ); + TQFont("Courier New", 10 ); #elif defined( KREPLACEMENTS_H ) - QFont("Courier", 10 ); + TQFont("Courier", 10 ); #else KGlobalSettings::fixedFont(); #endif @@ -524,13 +524,13 @@ void OptionDialog::setupFontPage( void ) OptionFontChooser* pFontChooser = new OptionFontChooser( defaultFont, "Font", &m_font, page, this ); topLayout->addWidget( pFontChooser ); - QGridLayout *gbox = new QGridLayout( 1, 2 ); + TQGridLayout *gbox = new TQGridLayout( 1, 2 ); topLayout->addLayout( gbox ); int line=0; OptionCheckBox* pItalicDeltas = new OptionCheckBox( i18n("Italic font for deltas"), false, "ItalicForDeltas", &m_bItalicForDeltas, page, this ); gbox->addMultiCellWidget( pItalicDeltas, line, line, 0, 1 ); - QToolTip::add( pItalicDeltas, i18n( + TQToolTip::add( pItalicDeltas, i18n( "Selects the italic version of the font for differences.\n" "If the font doesn't support italic characters, then this does nothing.") ); @@ -539,126 +539,126 @@ void OptionDialog::setupFontPage( void ) void OptionDialog::setupColorPage( void ) { - QFrame *page = addPage( i18n("Color"), i18n("Colors Settings"), + TQFrame *page = addPage( i18n("Color"), i18n("Colors Settings"), BarIcon("colorize", KIcon::SizeMedium ) ); - QVBoxLayout *topLayout = new QVBoxLayout( page, 5, spacingHint() ); + TQVBoxLayout *topLayout = new TQVBoxLayout( page, 5, spacingHint() ); - QGridLayout *gbox = new QGridLayout( 7, 2 ); + TQGridLayout *gbox = new TQGridLayout( 7, 2 ); gbox->setColStretch(1,5); topLayout->addLayout(gbox); - QLabel* label; + TQLabel* label; int line = 0; - int depth = QColor::numBitPlanes(); + int depth = TQColor::numBitPlanes(); bool bLowColor = depth<=8; - label = new QLabel( i18n("Editor and Diff Views:"), page ); + label = new TQLabel( i18n("Editor and Diff Views:"), page ); gbox->addWidget( label, line, 0 ); - QFont f( label->font() ); + TQFont f( label->font() ); f.setBold(true); label->setFont(f); ++line; - OptionColorButton* pFgColor = new OptionColorButton( Qt::black,"FgColor", &m_fgColor, page, this ); - label = new QLabel( pFgColor, i18n("Foreground color:"), page ); + OptionColorButton* pFgColor = new OptionColorButton( TQt::black,"FgColor", &m_fgColor, page, this ); + label = new TQLabel( pFgColor, i18n("Foreground color:"), page ); gbox->addWidget( label, line, 0 ); gbox->addWidget( pFgColor, line, 1 ); ++line; - OptionColorButton* pBgColor = new OptionColorButton( Qt::white, "BgColor", &m_bgColor, page, this ); - label = new QLabel( pBgColor, i18n("Background color:"), page ); + OptionColorButton* pBgColor = new OptionColorButton( TQt::white, "BgColor", &m_bgColor, page, this ); + label = new TQLabel( pBgColor, i18n("Background color:"), page ); gbox->addWidget( label, line, 0 ); gbox->addWidget( pBgColor, line, 1 ); ++line; OptionColorButton* pDiffBgColor = new OptionColorButton( - bLowColor ? Qt::lightGray : qRgb(224,224,224), "DiffBgColor", &m_diffBgColor, page, this ); - label = new QLabel( pDiffBgColor, i18n("Diff background color:"), page ); + bLowColor ? TQt::lightGray : tqRgb(224,224,224), "DiffBgColor", &m_diffBgColor, page, this ); + label = new TQLabel( pDiffBgColor, i18n("Diff background color:"), page ); gbox->addWidget( label, line, 0 ); gbox->addWidget( pDiffBgColor, line, 1 ); ++line; OptionColorButton* pColorA = new OptionColorButton( - bLowColor ? qRgb(0,0,255) : qRgb(0,0,200)/*blue*/, "ColorA", &m_colorA, page, this ); - label = new QLabel( pColorA, i18n("Color A:"), page ); + bLowColor ? tqRgb(0,0,255) : tqRgb(0,0,200)/*blue*/, "ColorA", &m_colorA, page, this ); + label = new TQLabel( pColorA, i18n("Color A:"), page ); gbox->addWidget( label, line, 0 ); gbox->addWidget( pColorA, line, 1 ); ++line; OptionColorButton* pColorB = new OptionColorButton( - bLowColor ? qRgb(0,128,0) : qRgb(0,150,0)/*green*/, "ColorB", &m_colorB, page, this ); - label = new QLabel( pColorB, i18n("Color B:"), page ); + bLowColor ? tqRgb(0,128,0) : tqRgb(0,150,0)/*green*/, "ColorB", &m_colorB, page, this ); + label = new TQLabel( pColorB, i18n("Color B:"), page ); gbox->addWidget( label, line, 0 ); gbox->addWidget( pColorB, line, 1 ); ++line; OptionColorButton* pColorC = new OptionColorButton( - bLowColor ? qRgb(128,0,128) : qRgb(150,0,150)/*magenta*/, "ColorC", &m_colorC, page, this ); - label = new QLabel( pColorC, i18n("Color C:"), page ); + bLowColor ? tqRgb(128,0,128) : tqRgb(150,0,150)/*magenta*/, "ColorC", &m_colorC, page, this ); + label = new TQLabel( pColorC, i18n("Color C:"), page ); gbox->addWidget( label, line, 0 ); gbox->addWidget( pColorC, line, 1 ); ++line; - OptionColorButton* pColorForConflict = new OptionColorButton( Qt::red, "ColorForConflict", &m_colorForConflict, page, this ); - label = new QLabel( pColorForConflict, i18n("Conflict color:"), page ); + OptionColorButton* pColorForConflict = new OptionColorButton( TQt::red, "ColorForConflict", &m_colorForConflict, page, this ); + label = new TQLabel( pColorForConflict, i18n("Conflict color:"), page ); gbox->addWidget( label, line, 0 ); gbox->addWidget( pColorForConflict, line, 1 ); ++line; OptionColorButton* pColor = new OptionColorButton( - bLowColor ? qRgb(192,192,192) : qRgb(220,220,100), "CurrentRangeBgColor", &m_currentRangeBgColor, page, this ); - label = new QLabel( pColor, i18n("Current range background color:"), page ); + bLowColor ? tqRgb(192,192,192) : tqRgb(220,220,100), "CurrentRangeBgColor", &m_currentRangeBgColor, page, this ); + label = new TQLabel( pColor, i18n("Current range background color:"), page ); gbox->addWidget( label, line, 0 ); gbox->addWidget( pColor, line, 1 ); ++line; pColor = new OptionColorButton( - bLowColor ? qRgb(255,255,0) : qRgb(255,255,150), "CurrentRangeDiffBgColor", &m_currentRangeDiffBgColor, page, this ); - label = new QLabel( pColor, i18n("Current range diff background color:"), page ); + bLowColor ? tqRgb(255,255,0) : tqRgb(255,255,150), "CurrentRangeDiffBgColor", &m_currentRangeDiffBgColor, page, this ); + label = new TQLabel( pColor, i18n("Current range diff background color:"), page ); gbox->addWidget( label, line, 0 ); gbox->addWidget( pColor, line, 1 ); ++line; - pColor = new OptionColorButton( qRgb(0xff,0xd0,0x80), "ManualAlignmentRangeColor", &m_manualHelpRangeColor, page, this ); - label = new QLabel( pColor, i18n("Color for manually aligned difference ranges:"), page ); + pColor = new OptionColorButton( tqRgb(0xff,0xd0,0x80), "ManualAlignmentRangeColor", &m_manualHelpRangeColor, page, this ); + label = new TQLabel( pColor, i18n("Color for manually aligned difference ranges:"), page ); gbox->addWidget( label, line, 0 ); gbox->addWidget( pColor, line, 1 ); ++line; - label = new QLabel( i18n("Directory Comparison View:"), page ); + label = new TQLabel( i18n("Directory Comparison View:"), page ); gbox->addWidget( label, line, 0 ); label->setFont(f); ++line; - pColor = new OptionColorButton( qRgb(0,0xd0,0), "NewestFileColor", &m_newestFileColor, page, this ); - label = new QLabel( pColor, i18n("Newest file color:"), page ); + pColor = new OptionColorButton( tqRgb(0,0xd0,0), "NewestFileColor", &m_newestFileColor, page, this ); + label = new TQLabel( pColor, i18n("Newest file color:"), page ); gbox->addWidget( label, line, 0 ); gbox->addWidget( pColor, line, 1 ); - QString dirColorTip = i18n( "Changing this color will only be effective when starting the next directory comparison."); - QToolTip::add( label, dirColorTip ); + TQString dirColorTip = i18n( "Changing this color will only be effective when starting the next directory comparison."); + TQToolTip::add( label, dirColorTip ); ++line; - pColor = new OptionColorButton( qRgb(0xf0,0,0), "OldestFileColor", &m_oldestFileColor, page, this ); - label = new QLabel( pColor, i18n("Oldest file color:"), page ); + pColor = new OptionColorButton( tqRgb(0xf0,0,0), "OldestFileColor", &m_oldestFileColor, page, this ); + label = new TQLabel( pColor, i18n("Oldest file color:"), page ); gbox->addWidget( label, line, 0 ); gbox->addWidget( pColor, line, 1 ); - QToolTip::add( label, dirColorTip ); + TQToolTip::add( label, dirColorTip ); ++line; - pColor = new OptionColorButton( qRgb(0xc0,0xc0,0), "MidAgeFileColor", &m_midAgeFileColor, page, this ); - label = new QLabel( pColor, i18n("Middle age file color:"), page ); + pColor = new OptionColorButton( tqRgb(0xc0,0xc0,0), "MidAgeFileColor", &m_midAgeFileColor, page, this ); + label = new TQLabel( pColor, i18n("Middle age file color:"), page ); gbox->addWidget( label, line, 0 ); gbox->addWidget( pColor, line, 1 ); - QToolTip::add( label, dirColorTip ); + TQToolTip::add( label, dirColorTip ); ++line; - pColor = new OptionColorButton( qRgb(0,0,0), "MissingFileColor", &m_missingFileColor, page, this ); - label = new QLabel( pColor, i18n("Color for missing files:"), page ); + pColor = new OptionColorButton( tqRgb(0,0,0), "MissingFileColor", &m_missingFileColor, page, this ); + label = new TQLabel( pColor, i18n("Color for missing files:"), page ); gbox->addWidget( label, line, 0 ); gbox->addWidget( pColor, line, 1 ); - QToolTip::add( label, dirColorTip ); + TQToolTip::add( label, dirColorTip ); ++line; topLayout->addStretch(10); @@ -667,46 +667,46 @@ void OptionDialog::setupColorPage( void ) void OptionDialog::setupEditPage( void ) { - QFrame *page = addPage( i18n("Editor"), i18n("Editor Behavior"), + TQFrame *page = addPage( i18n("Editor"), i18n("Editor Behavior"), BarIcon("edit", KIcon::SizeMedium ) ); - QVBoxLayout *topLayout = new QVBoxLayout( page, 5, spacingHint() ); + TQVBoxLayout *topLayout = new TQVBoxLayout( page, 5, spacingHint() ); - QGridLayout *gbox = new QGridLayout( 4, 2 ); + TQGridLayout *gbox = new TQGridLayout( 4, 2 ); gbox->setColStretch(1,5); topLayout->addLayout( gbox ); - QLabel* label; + TQLabel* label; int line=0; OptionCheckBox* pReplaceTabs = new OptionCheckBox( i18n("Tab inserts spaces"), false, "ReplaceTabs", &m_bReplaceTabs, page, this ); gbox->addMultiCellWidget( pReplaceTabs, line, line, 0, 1 ); - QToolTip::add( pReplaceTabs, i18n( + TQToolTip::add( pReplaceTabs, i18n( "On: Pressing tab generates the appropriate number of spaces.\n" "Off: A Tab-character will be inserted.") ); ++line; OptionIntEdit* pTabSize = new OptionIntEdit( 8, "TabSize", &m_tabSize, 1, 100, page, this ); - label = new QLabel( pTabSize, i18n("Tab size:"), page ); + label = new TQLabel( pTabSize, i18n("Tab size:"), page ); gbox->addWidget( label, line, 0 ); gbox->addWidget( pTabSize, line, 1 ); ++line; OptionCheckBox* pAutoIndentation = new OptionCheckBox( i18n("Auto indentation"), true, "AutoIndentation", &m_bAutoIndentation, page, this ); gbox->addMultiCellWidget( pAutoIndentation, line, line, 0, 1 ); - QToolTip::add( pAutoIndentation, i18n( + TQToolTip::add( pAutoIndentation, i18n( "On: The indentation of the previous line is used for a new line.\n" )); ++line; OptionCheckBox* pAutoCopySelection = new OptionCheckBox( i18n("Auto copy selection"), false, "AutoCopySelection", &m_bAutoCopySelection, page, this ); gbox->addMultiCellWidget( pAutoCopySelection, line, line, 0, 1 ); - QToolTip::add( pAutoCopySelection, i18n( + TQToolTip::add( pAutoCopySelection, i18n( "On: Any selection is immediately written to the clipboard.\n" "Off: You must explicitely copy e.g. via Ctrl-C." )); ++line; - label = new QLabel( i18n("Line end style:"), page ); + label = new TQLabel( i18n("Line end style:"), page ); gbox->addWidget( label, line, 0 ); #ifdef _WIN32 int defaultLineEndStyle = eLineEndDos; @@ -717,7 +717,7 @@ void OptionDialog::setupEditPage( void ) gbox->addWidget( pLineEndStyle, line, 1 ); pLineEndStyle->insertItem( "Unix", eLineEndUnix ); pLineEndStyle->insertItem( "Dos/Windows", eLineEndDos ); - QToolTip::add( label, i18n( + TQToolTip::add( label, i18n( "Sets the line endings for when an edited file is saved.\n" "DOS/Windows: CR+LF; UNIX: LF; with CR=0D, LF=0A") ); @@ -729,29 +729,29 @@ void OptionDialog::setupEditPage( void ) void OptionDialog::setupDiffPage( void ) { - QFrame *page = addPage( i18n("Diff"), i18n("Diff Settings"), + TQFrame *page = addPage( i18n("Diff"), i18n("Diff Settings"), BarIcon("misc", KIcon::SizeMedium ) ); - QVBoxLayout *topLayout = new QVBoxLayout( page, 5, spacingHint() ); + TQVBoxLayout *topLayout = new TQVBoxLayout( page, 5, spacingHint() ); - QGridLayout *gbox = new QGridLayout( 3, 2 ); + TQGridLayout *gbox = new TQGridLayout( 3, 2 ); gbox->setColStretch(1,5); topLayout->addLayout( gbox ); int line=0; - QLabel* label=0; + TQLabel* label=0; // OptionCheckBox* pPreserveCarriageReturn = new OptionCheckBox( i18n("Preserve carriage return"), false, "PreserveCarriageReturn", &m_bPreserveCarriageReturn, page, this ); // gbox->addMultiCellWidget( pPreserveCarriageReturn, line, line, 0, 1 ); -// QToolTip::add( pPreserveCarriageReturn, i18n( +// TQToolTip::add( pPreserveCarriageReturn, i18n( // "Show carriage return characters '\\r' if they exist.\n" // "Helps to compare files that were modified under different operating systems.") // ); // ++line; - QString treatAsWhiteSpace = " ("+i18n("Treat as white space.")+")"; + TQString treatAsWhiteSpace = " ("+i18n("Treat as white space.")+")"; OptionCheckBox* pIgnoreNumbers = new OptionCheckBox( i18n("Ignore numbers")+treatAsWhiteSpace, false, "IgnoreNumbers", &m_bIgnoreNumbers, page, this ); gbox->addMultiCellWidget( pIgnoreNumbers, line, line, 0, 1 ); - QToolTip::add( pIgnoreNumbers, i18n( + TQToolTip::add( pIgnoreNumbers, i18n( "Ignore number characters during line matching phase. (Similar to Ignore white space.)\n" "Might help to compare files with numeric data.") ); @@ -759,34 +759,34 @@ void OptionDialog::setupDiffPage( void ) OptionCheckBox* pIgnoreComments = new OptionCheckBox( i18n("Ignore C/C++ comments")+treatAsWhiteSpace, false, "IgnoreComments", &m_bIgnoreComments, page, this ); gbox->addMultiCellWidget( pIgnoreComments, line, line, 0, 1 ); - QToolTip::add( pIgnoreComments, i18n( "Treat C/C++ comments like white space.") + TQToolTip::add( pIgnoreComments, i18n( "Treat C/C++ comments like white space.") ); ++line; OptionCheckBox* pIgnoreCase = new OptionCheckBox( i18n("Ignore case")+treatAsWhiteSpace, false, "IgnoreCase", &m_bIgnoreCase, page, this ); gbox->addMultiCellWidget( pIgnoreCase, line, line, 0, 1 ); - QToolTip::add( pIgnoreCase, i18n( + TQToolTip::add( pIgnoreCase, i18n( "Treat case differences like white space changes. ('a'<=>'A')") ); ++line; - label = new QLabel( i18n("Preprocessor command:"), page ); + label = new TQLabel( i18n("Preprocessor command:"), page ); gbox->addWidget( label, line, 0 ); OptionLineEdit* pLE = new OptionLineEdit( "", "PreProcessorCmd", &m_PreProcessorCmd, page, this ); gbox->addWidget( pLE, line, 1 ); - QToolTip::add( label, i18n("User defined pre-processing. (See the docs for details.)") ); + TQToolTip::add( label, i18n("User defined pre-processing. (See the docs for details.)") ); ++line; - label = new QLabel( i18n("Line-matching preprocessor command:"), page ); + label = new TQLabel( i18n("Line-matching preprocessor command:"), page ); gbox->addWidget( label, line, 0 ); pLE = new OptionLineEdit( "", "LineMatchingPreProcessorCmd", &m_LineMatchingPreProcessorCmd, page, this ); gbox->addWidget( pLE, line, 1 ); - QToolTip::add( label, i18n("This pre-processor is only used during line matching.\n(See the docs for details.)") ); + TQToolTip::add( label, i18n("This pre-processor is only used during line matching.\n(See the docs for details.)") ); ++line; OptionCheckBox* pTryHard = new OptionCheckBox( i18n("Try hard (slower)"), true, "TryHard", &m_bTryHard, page, this ); gbox->addMultiCellWidget( pTryHard, line, line, 0, 1 ); - QToolTip::add( pTryHard, i18n( + TQToolTip::add( pTryHard, i18n( "Enables the --minimal option for the external diff.\n" "The analysis of big files will be much slower.") ); @@ -797,43 +797,43 @@ void OptionDialog::setupDiffPage( void ) void OptionDialog::setupMergePage( void ) { - QFrame *page = addPage( i18n("Merge"), i18n("Merge Settings"), + TQFrame *page = addPage( i18n("Merge"), i18n("Merge Settings"), BarIcon("misc", KIcon::SizeMedium ) ); - QVBoxLayout *topLayout = new QVBoxLayout( page ); + TQVBoxLayout *topLayout = new TQVBoxLayout( page ); topLayout->setMargin( 5 ); topLayout->setSpacing( spacingHint() ); - QGridLayout *gbox = new QGridLayout(); + TQGridLayout *gbox = new TQGridLayout(); gbox->setColStretch(1,5); topLayout->addLayout( gbox ); int line=0; - QLabel* label=0; + TQLabel* label=0; - label = new QLabel( i18n("Auto advance delay (ms):"), page ); + label = new TQLabel( i18n("Auto advance delay (ms):"), page ); gbox->addWidget( label, line, 0 ); OptionIntEdit* pAutoAdvanceDelay = new OptionIntEdit( 500, "AutoAdvanceDelay", &m_autoAdvanceDelay, 0, 2000, page, this ); gbox->addWidget( pAutoAdvanceDelay, line, 1 ); - QToolTip::add( label,i18n( + TQToolTip::add( label,i18n( "When in Auto-Advance mode the result of the current selection is shown \n" "for the specified time, before jumping to the next conflict. Range: 0-2000 ms") ); ++line; - label = new QLabel( i18n("White space 2-file merge default:"), page ); + label = new TQLabel( i18n("White space 2-file merge default:"), page ); gbox->addWidget( label, line, 0 ); OptionComboBox* pWhiteSpace2FileMergeDefault = new OptionComboBox( 0, "WhiteSpace2FileMergeDefault", &m_whiteSpace2FileMergeDefault, page, this ); gbox->addWidget( pWhiteSpace2FileMergeDefault, line, 1 ); pWhiteSpace2FileMergeDefault->insertItem( i18n("Manual Choice"), 0 ); pWhiteSpace2FileMergeDefault->insertItem( "A", 1 ); pWhiteSpace2FileMergeDefault->insertItem( "B", 2 ); - QToolTip::add( label, i18n( + TQToolTip::add( label, i18n( "Allow the merge algorithm to automatically select an input for " "white-space-only changes." ) ); ++line; - label = new QLabel( i18n("White space 3-file merge default:"), page ); + label = new TQLabel( i18n("White space 3-file merge default:"), page ); gbox->addWidget( label, line, 0 ); OptionComboBox* pWhiteSpace3FileMergeDefault = new OptionComboBox( 0, "WhiteSpace3FileMergeDefault", &m_whiteSpace3FileMergeDefault, page, this ); gbox->addWidget( pWhiteSpace3FileMergeDefault, line, 1 ); @@ -841,61 +841,61 @@ void OptionDialog::setupMergePage( void ) pWhiteSpace3FileMergeDefault->insertItem( "A", 1 ); pWhiteSpace3FileMergeDefault->insertItem( "B", 2 ); pWhiteSpace3FileMergeDefault->insertItem( "C", 3 ); - QToolTip::add( label, i18n( + TQToolTip::add( label, i18n( "Allow the merge algorithm to automatically select an input for " "white-space-only changes." ) ); ++line; - QGroupBox* pGroupBox = new QGroupBox( 2, Qt::Horizontal, i18n("Automatic Merge Regular Expression"), page); + TQGroupBox* pGroupBox = new TQGroupBox( 2, Qt::Horizontal, i18n("Automatic Merge Regular Expression"), page); gbox->addMultiCellWidget( pGroupBox, line,line,0,1); ++line; { - QWidget* page = new QWidget( pGroupBox ); - QGridLayout* gbox = new QGridLayout( page, 2, 2, spacingHint() ); + TQWidget* page = new TQWidget( pGroupBox ); + TQGridLayout* gbox = new TQGridLayout( page, 2, 2, spacingHint() ); gbox->setColStretch(1,10); int line = 0; - label = new QLabel( i18n("Auto merge regular expression:"), page ); + label = new TQLabel( i18n("Auto merge regular expression:"), page ); gbox->addWidget( label, line, 0 ); m_pAutoMergeRegExpLineEdit = new OptionLineEdit( ".*\\$(Version|Header|Date|Author).*\\$.*", "AutoMergeRegExp", &m_autoMergeRegExp, page, this ); gbox->addWidget( m_pAutoMergeRegExpLineEdit, line, 1 ); s_autoMergeRegExpToolTip = i18n("Regular expression for lines where KDiff3 should automatically choose one source.\n" "When a line with a conflict matches the regular expression then\n" "- if available - C, otherwise B will be chosen."); - QToolTip::add( label, s_autoMergeRegExpToolTip ); + TQToolTip::add( label, s_autoMergeRegExpToolTip ); ++line; OptionCheckBox* pAutoMergeRegExp = new OptionCheckBox( i18n("Run regular expression auto merge on merge start"), false, "RunRegExpAutoMergeOnMergeStart", &m_bRunRegExpAutoMergeOnMergeStart, page, this ); gbox->addMultiCellWidget( pAutoMergeRegExp, line, line, 0, 1 ); - QToolTip::add( pAutoMergeRegExp, i18n( "Run the merge for auto merge regular expressions\n" + TQToolTip::add( pAutoMergeRegExp, i18n( "Run the merge for auto merge regular expressions\n" "immediately when a merge starts.\n")); ++line; } - pGroupBox = new QGroupBox( 2, Qt::Horizontal, i18n("Version Control History Merging"), page); + pGroupBox = new TQGroupBox( 2, Qt::Horizontal, i18n("Version Control History Merging"), page); gbox->addMultiCellWidget( pGroupBox, line,line,0,1); ++line; { - QWidget* page = new QWidget( pGroupBox ); - QGridLayout* gbox = new QGridLayout( page, 2, 2, spacingHint() ); + TQWidget* page = new TQWidget( pGroupBox ); + TQGridLayout* gbox = new TQGridLayout( page, 2, 2, spacingHint() ); gbox->setColStretch(1,10); int line = 0; - label = new QLabel( i18n("History start regular expression:"), page ); + label = new TQLabel( i18n("History start regular expression:"), page ); gbox->addWidget( label, line, 0 ); m_pHistoryStartRegExpLineEdit = new OptionLineEdit( ".*\\$Log.*\\$.*", "HistoryStartRegExp", &m_historyStartRegExp, page, this ); gbox->addWidget( m_pHistoryStartRegExpLineEdit, line, 1 ); s_historyStartRegExpToolTip = i18n("Regular expression for the start of the version control history entry.\n" "Usually this line contains the \"$Log$\"-keyword.\n" "Default value: \".*\\$Log.*\\$.*\""); - QToolTip::add( label, s_historyStartRegExpToolTip ); + TQToolTip::add( label, s_historyStartRegExpToolTip ); ++line; - label = new QLabel( i18n("History entry start regular expression:"), page ); + label = new TQLabel( i18n("History entry start regular expression:"), page ); gbox->addWidget( label, line, 0 ); // Example line: "** \main\rolle_fsp_dev_008\1 17 Aug 2001 10:45:44 rolle" - QString historyEntryStartDefault = + TQString historyEntryStartDefault = "\\s*\\\\main\\\\(\\S+)\\s+" // Start with "\main\" "([0-9]+) " // day "(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) " //month @@ -906,62 +906,62 @@ void OptionDialog::setupMergePage( void ) gbox->addWidget( m_pHistoryEntryStartRegExpLineEdit, line, 1 ); s_historyEntryStartRegExpToolTip = i18n("A version control history entry consists of several lines.\n" "Specify the regular expression to detect the first line (without the leading comment).\n" - "Use parentheses to group the keys you want to use for sorting.\n" + "Use tqparentheses to group the keys you want to use for sorting.\n" "If left empty, then KDiff3 assumes that empty lines separate history entries.\n" "See the documentation for details."); - QToolTip::add( label, s_historyEntryStartRegExpToolTip ); + TQToolTip::add( label, s_historyEntryStartRegExpToolTip ); ++line; m_pHistoryMergeSorting = new OptionCheckBox( i18n("History merge sorting"), false, "HistoryMergeSorting", &m_bHistoryMergeSorting, page, this ); gbox->addMultiCellWidget( m_pHistoryMergeSorting, line, line, 0, 1 ); - QToolTip::add( m_pHistoryMergeSorting, i18n("Sort version control history by a key.") ); + TQToolTip::add( m_pHistoryMergeSorting, i18n("Sort version control history by a key.") ); ++line; - //QString branch = newHistoryEntry.cap(1); + //TQString branch = newHistoryEntry.cap(1); //int day = newHistoryEntry.cap(2).toInt(); - //int month = QString("Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec").find(newHistoryEntry.cap(3))/4 + 1; + //int month = TQString("Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec").tqfind(newHistoryEntry.cap(3))/4 + 1; //int year = newHistoryEntry.cap(4).toInt(); - //QString time = newHistoryEntry.cap(5); - //QString name = newHistoryEntry.cap(6); - QString defaultSortKeyOrder = "4,3,2,5,1,6"; //QDate(year,month,day).toString(Qt::ISODate) +" "+ time + " " + branch + " " + name; + //TQString time = newHistoryEntry.cap(5); + //TQString name = newHistoryEntry.cap(6); + TQString defaultSortKeyOrder = "4,3,2,5,1,6"; //TQDate(year,month,day).toString(Qt::ISODate) +" "+ time + " " + branch + " " + name; - label = new QLabel( i18n("History entry start sort key order:"), page ); + label = new TQLabel( i18n("History entry start sort key order:"), page ); gbox->addWidget( label, line, 0 ); m_pHistorySortKeyOrderLineEdit = new OptionLineEdit( defaultSortKeyOrder, "HistoryEntryStartSortKeyOrder", &m_historyEntryStartSortKeyOrder, page, this ); gbox->addWidget( m_pHistorySortKeyOrderLineEdit, line, 1 ); - s_historyEntryStartSortKeyOrderToolTip = i18n("Each parentheses used in the regular expression for the history start entry\n" + s_historyEntryStartSortKeyOrderToolTip = i18n("Each tqparentheses used in the regular expression for the history start entry\n" "groups a key that can be used for sorting.\n" "Specify the list of keys (that are numbered in order of occurrence\n" "starting with 1) using ',' as separator (e.g. \"4,5,6,1,2,3,7\").\n" "If left empty, then no sorting will be done.\n" "See the documentation for details."); - QToolTip::add( label, s_historyEntryStartSortKeyOrderToolTip ); + TQToolTip::add( label, s_historyEntryStartSortKeyOrderToolTip ); m_pHistorySortKeyOrderLineEdit->setEnabled(false); - connect( m_pHistoryMergeSorting, SIGNAL(toggled(bool)), m_pHistorySortKeyOrderLineEdit, SLOT(setEnabled(bool))); + connect( m_pHistoryMergeSorting, TQT_SIGNAL(toggled(bool)), m_pHistorySortKeyOrderLineEdit, TQT_SLOT(setEnabled(bool))); ++line; m_pHistoryAutoMerge = new OptionCheckBox( i18n("Merge version control history on merge start"), false, "RunHistoryAutoMergeOnMergeStart", &m_bRunHistoryAutoMergeOnMergeStart, page, this ); gbox->addMultiCellWidget( m_pHistoryAutoMerge, line, line, 0, 1 ); - QToolTip::add( m_pHistoryAutoMerge, i18n("Run version control history automerge on merge start.") ); + TQToolTip::add( m_pHistoryAutoMerge, i18n("Run version control history automerge on merge start.") ); ++line; OptionIntEdit* pMaxNofHistoryEntries = new OptionIntEdit( -1, "MaxNofHistoryEntries", &m_maxNofHistoryEntries, -1, 1000, page, this ); - label = new QLabel( pMaxNofHistoryEntries, i18n("Max number of history entries:"), page ); + label = new TQLabel( pMaxNofHistoryEntries, i18n("Max number of history entries:"), page ); gbox->addWidget( label, line, 0 ); gbox->addWidget( pMaxNofHistoryEntries, line, 1 ); - QToolTip::add( pMaxNofHistoryEntries, i18n("Cut off after specified number. Use -1 for infinite number of entries.") ); + TQToolTip::add( pMaxNofHistoryEntries, i18n("Cut off after specified number. Use -1 for infinite number of entries.") ); ++line; } - QPushButton* pButton = new QPushButton( i18n("Test your regular expressions"), page ); + TQPushButton* pButton = new TQPushButton( i18n("Test your regular expressions"), page ); gbox->addWidget( pButton, line, 0 ); - connect( pButton, SIGNAL(clicked()), this, SLOT(slotHistoryMergeRegExpTester())); + connect( pButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotHistoryMergeRegExpTester())); ++line; - label = new QLabel( i18n("Irrelevant merge command:"), page ); + label = new TQLabel( i18n("Irrelevant merge command:"), page ); gbox->addWidget( label, line, 0 ); OptionLineEdit* pLE = new OptionLineEdit( "", "IrrelevantMergeCmd", &m_IrrelevantMergeCmd, page, this ); gbox->addWidget( pLE, line, 1 ); - QToolTip::add( label, i18n("If specified this script is run after automerge\n" + TQToolTip::add( label, i18n("If specified this script is run after automerge\n" "when no other relevant changes were detected.\n" "Called with the parameters: filename1 filename2 filename3") ); ++line; @@ -970,7 +970,7 @@ void OptionDialog::setupMergePage( void ) OptionCheckBox* pAutoSaveAndQuit = new OptionCheckBox( i18n("Auto save and quit on merge without conflicts"), false, "AutoSaveAndQuitOnMergeWithoutConflicts", &m_bAutoSaveAndQuitOnMergeWithoutConflicts, page, this ); gbox->addMultiCellWidget( pAutoSaveAndQuit, line, line, 0, 1 ); - QToolTip::add( pAutoSaveAndQuit, i18n("When KDiff3 was started for a file-merge from the commandline and all\n" + TQToolTip::add( pAutoSaveAndQuit, i18n("When KDiff3 was started for a file-merge from the commandline and all\n" "conflicts are solvable without user interaction then automatically save and quit.\n" "(Similar to command line option \"--auto\".") ); ++line; @@ -980,46 +980,46 @@ void OptionDialog::setupMergePage( void ) void OptionDialog::setupDirectoryMergePage( void ) { - QFrame *page = addPage( i18n("Directory Merge"), i18n("Directory Merge"), + TQFrame *page = addPage( i18n("Directory Merge"), i18n("Directory Merge"), BarIcon("folder", KIcon::SizeMedium ) ); - QVBoxLayout *topLayout = new QVBoxLayout( page, 5, spacingHint() ); + TQVBoxLayout *topLayout = new TQVBoxLayout( page, 5, spacingHint() ); - QGridLayout *gbox = new QGridLayout( 11, 2 ); + TQGridLayout *gbox = new TQGridLayout( 11, 2 ); gbox->setColStretch(1,5); topLayout->addLayout( gbox ); int line=0; OptionCheckBox* pRecursiveDirs = new OptionCheckBox( i18n("Recursive directories"), true, "RecursiveDirs", &m_bDmRecursiveDirs, page, this ); gbox->addMultiCellWidget( pRecursiveDirs, line, line, 0, 1 ); - QToolTip::add( pRecursiveDirs, i18n("Whether to analyze subdirectories or not.") ); + TQToolTip::add( pRecursiveDirs, i18n("Whether to analyze subdirectories or not.") ); ++line; - QLabel* label = new QLabel( i18n("File pattern(s):"), page ); + TQLabel* label = new TQLabel( i18n("File pattern(s):"), page ); gbox->addWidget( label, line, 0 ); OptionLineEdit* pFilePattern = new OptionLineEdit( "*", "FilePattern", &m_DmFilePattern, page, this ); gbox->addWidget( pFilePattern, line, 1 ); - QToolTip::add( label, i18n( + TQToolTip::add( label, i18n( "Pattern(s) of files to be analyzed. \n" "Wildcards: '*' and '?'\n" "Several Patterns can be specified by using the separator: ';'" )); ++line; - label = new QLabel( i18n("File-anti-pattern(s):"), page ); + label = new TQLabel( i18n("File-anti-pattern(s):"), page ); gbox->addWidget( label, line, 0 ); OptionLineEdit* pFileAntiPattern = new OptionLineEdit( "*.orig;*.o;*.obj", "FileAntiPattern", &m_DmFileAntiPattern, page, this ); gbox->addWidget( pFileAntiPattern, line, 1 ); - QToolTip::add( label, i18n( + TQToolTip::add( label, i18n( "Pattern(s) of files to be excluded from analysis. \n" "Wildcards: '*' and '?'\n" "Several Patterns can be specified by using the separator: ';'" )); ++line; - label = new QLabel( i18n("Dir-anti-pattern(s):"), page ); + label = new TQLabel( i18n("Dir-anti-pattern(s):"), page ); gbox->addWidget( label, line, 0 ); OptionLineEdit* pDirAntiPattern = new OptionLineEdit( "CVS;.deps;.svn", "DirAntiPattern", &m_DmDirAntiPattern, page, this ); gbox->addWidget( pDirAntiPattern, line, 1 ); - QToolTip::add( label, i18n( + TQToolTip::add( label, i18n( "Pattern(s) of directories to be excluded from analysis. \n" "Wildcards: '*' and '?'\n" "Several Patterns can be specified by using the separator: ';'" @@ -1028,7 +1028,7 @@ void OptionDialog::setupDirectoryMergePage( void ) OptionCheckBox* pUseCvsIgnore = new OptionCheckBox( i18n("Use .cvsignore"), false, "UseCvsIgnore", &m_bDmUseCvsIgnore, page, this ); gbox->addMultiCellWidget( pUseCvsIgnore, line, line, 0, 1 ); - QToolTip::add( pUseCvsIgnore, i18n( + TQToolTip::add( pUseCvsIgnore, i18n( "Extends the antipattern to anything that would be ignored by CVS.\n" "Via local \".cvsignore\"-files this can be directory specific." )); @@ -1037,15 +1037,15 @@ void OptionDialog::setupDirectoryMergePage( void ) OptionCheckBox* pFindHidden = new OptionCheckBox( i18n("Find hidden files and directories"), true, "FindHidden", &m_bDmFindHidden, page, this ); gbox->addMultiCellWidget( pFindHidden, line, line, 0, 1 ); #ifdef _WIN32 - QToolTip::add( pFindHidden, i18n("Finds files and directories with the hidden attribute.") ); + TQToolTip::add( pFindHidden, i18n("Finds files and directories with the hidden attribute.") ); #else - QToolTip::add( pFindHidden, i18n("Finds files and directories starting with '.'.") ); + TQToolTip::add( pFindHidden, i18n("Finds files and directories starting with '.'.") ); #endif ++line; OptionCheckBox* pFollowFileLinks = new OptionCheckBox( i18n("Follow file links"), false, "FollowFileLinks", &m_bDmFollowFileLinks, page, this ); gbox->addMultiCellWidget( pFollowFileLinks, line, line, 0, 1 ); - QToolTip::add( pFollowFileLinks, i18n( + TQToolTip::add( pFollowFileLinks, i18n( "On: Compare the file the link points to.\n" "Off: Compare the links." )); @@ -1053,7 +1053,7 @@ void OptionDialog::setupDirectoryMergePage( void ) OptionCheckBox* pFollowDirLinks = new OptionCheckBox( i18n("Follow directory links"), false, "FollowDirLinks", &m_bDmFollowDirLinks, page, this ); gbox->addMultiCellWidget( pFollowDirLinks, line, line, 0, 1 ); - QToolTip::add( pFollowDirLinks, i18n( + TQToolTip::add( pFollowDirLinks, i18n( "On: Compare the directory the link points to.\n" "Off: Compare the links." )); @@ -1061,7 +1061,7 @@ void OptionDialog::setupDirectoryMergePage( void ) //OptionCheckBox* pShowOnlyDeltas = new OptionCheckBox( i18n("List only deltas"),false,"ListOnlyDeltas", &m_bDmShowOnlyDeltas, page, this ); //gbox->addMultiCellWidget( pShowOnlyDeltas, line, line, 0, 1 ); - //QToolTip::add( pShowOnlyDeltas, i18n( + //TQToolTip::add( pShowOnlyDeltas, i18n( // "Files and directories without change will not appear in the list.")); //++line; @@ -1072,40 +1072,40 @@ void OptionDialog::setupDirectoryMergePage( void ) #endif OptionCheckBox* pCaseSensitiveFileNames = new OptionCheckBox( i18n("Case sensitive filename comparison"),bCaseSensitiveFilenameComparison,"CaseSensitiveFilenameComparison", &m_bDmCaseSensitiveFilenameComparison, page, this ); gbox->addMultiCellWidget( pCaseSensitiveFileNames, line, line, 0, 1 ); - QToolTip::add( pCaseSensitiveFileNames, i18n( + TQToolTip::add( pCaseSensitiveFileNames, i18n( "The directory comparison will compare files or directories when their names match.\n" "Set this option if the case of the names must match. (Default for Windows is off, otherwise on.)")); ++line; - QVButtonGroup* pBG = new QVButtonGroup(i18n("File Comparison Mode"),page); + TQVButtonGroup* pBG = new TQVButtonGroup(i18n("File Comparison Mode"),page); gbox->addMultiCellWidget( pBG, line, line, 0, 1 ); ++line; OptionRadioButton* pBinaryComparison = new OptionRadioButton( i18n("Binary comparison"), true, "BinaryComparison", &m_bDmBinaryComparison, pBG, this ); - QToolTip::add( pBinaryComparison, i18n("Binary comparison of each file. (Default)") ); + TQToolTip::add( pBinaryComparison, i18n("Binary comparison of each file. (Default)") ); OptionRadioButton* pFullAnalysis = new OptionRadioButton( i18n("Full analysis"), false, "FullAnalysis", &m_bDmFullAnalysis, pBG, this ); - QToolTip::add( pFullAnalysis, i18n("Do a full analysis and show statistics information in extra columns.\n" + TQToolTip::add( pFullAnalysis, i18n("Do a full analysis and show statistics information in extra columns.\n" "(Slower than a binary comparison, much slower for binary files.)") ); OptionRadioButton* pTrustDate = new OptionRadioButton( i18n("Trust the size and modification date (unsafe)"), false, "TrustDate", &m_bDmTrustDate, pBG, this ); - QToolTip::add( pTrustDate, i18n("Assume that files are equal if the modification date and file length are equal.\n" + TQToolTip::add( pTrustDate, i18n("Assume that files are equal if the modification date and file length are equal.\n" "Files with equal contents but different modification dates will appear as different.\n" "Useful for big directories or slow networks.") ); OptionRadioButton* pTrustDateFallbackToBinary = new OptionRadioButton( i18n("Trust the size and date, but use binary comparison if date doesn't match (unsafe)"), false, "TrustDateFallbackToBinary", &m_bDmTrustDateFallbackToBinary, pBG, this ); - QToolTip::add( pTrustDateFallbackToBinary, i18n("Assume that files are equal if the modification date and file length are equal.\n" + TQToolTip::add( pTrustDateFallbackToBinary, i18n("Assume that files are equal if the modification date and file length are equal.\n" "If the date isn't equal but the sizes are, use binary comparison.\n" "Useful for big directories or slow networks.") ); OptionRadioButton* pTrustSize = new OptionRadioButton( i18n("Trust the size (unsafe)"), false, "TrustSize", &m_bDmTrustSize, pBG, this ); - QToolTip::add( pTrustSize, i18n("Assume that files are equal if their file lengths are equal.\n" + TQToolTip::add( pTrustSize, i18n("Assume that files are equal if their file lengths are equal.\n" "Useful for big directories or slow networks when the date is modified during download.") ); // Some two Dir-options: Affects only the default actions. OptionCheckBox* pSyncMode = new OptionCheckBox( i18n("Synchronize directories"), false,"SyncMode", &m_bDmSyncMode, page, this ); gbox->addMultiCellWidget( pSyncMode, line, line, 0, 1 ); - QToolTip::add( pSyncMode, i18n( + TQToolTip::add( pSyncMode, i18n( "Offers to store files in both directories so that\n" "both directories are the same afterwards.\n" "Works only when comparing two directories without specifying a destination." ) ); @@ -1114,16 +1114,16 @@ void OptionDialog::setupDirectoryMergePage( void ) // Allow white-space only differences to be considered equal OptionCheckBox* pWhiteSpaceDiffsEqual = new OptionCheckBox( i18n("White space differences considered equal"), true,"WhiteSpaceEqual", &m_bDmWhiteSpaceEqual, page, this ); gbox->addMultiCellWidget( pWhiteSpaceDiffsEqual, line, line, 0, 1 ); - QToolTip::add( pWhiteSpaceDiffsEqual, i18n( + TQToolTip::add( pWhiteSpaceDiffsEqual, i18n( "If files differ only by white space consider them equal.\n" "This is only active when full analysis is chosen." ) ); - connect(pFullAnalysis, SIGNAL(toggled(bool)), pWhiteSpaceDiffsEqual, SLOT(setEnabled(bool))); + connect(pFullAnalysis, TQT_SIGNAL(toggled(bool)), pWhiteSpaceDiffsEqual, TQT_SLOT(setEnabled(bool))); pWhiteSpaceDiffsEqual->setEnabled(false); ++line; OptionCheckBox* pCopyNewer = new OptionCheckBox( i18n("Copy newer instead of merging (unsafe)"), false, "CopyNewer", &m_bDmCopyNewer, page, this ); gbox->addMultiCellWidget( pCopyNewer, line, line, 0, 1 ); - QToolTip::add( pCopyNewer, i18n( + TQToolTip::add( pCopyNewer, i18n( "Don't look inside, just take the newer file.\n" "(Use this only if you know what you are doing!)\n" "Only effective when comparing two directories." ) ); @@ -1131,7 +1131,7 @@ void OptionDialog::setupDirectoryMergePage( void ) OptionCheckBox* pCreateBakFiles = new OptionCheckBox( i18n("Backup files (.orig)"), true, "CreateBakFiles", &m_bDmCreateBakFiles, page, this ); gbox->addMultiCellWidget( pCreateBakFiles, line, line, 0, 1 ); - QToolTip::add( pCreateBakFiles, i18n( + TQToolTip::add( pCreateBakFiles, i18n( "When a file would be saved over an old file, then the old file\n" "will be renamed with a '.orig'-extension instead of being deleted.")); ++line; @@ -1141,37 +1141,37 @@ void OptionDialog::setupDirectoryMergePage( void ) /* static void insertCodecs(OptionComboBox* p) { - std::multimap<QString,QString> m; // Using the multimap for case-insensitive sorting. + std::multimap<TQString,TQString> m; // Using the multimap for case-insensitive sorting. int i; for(i=0;;++i) { - QTextCodec* pCodec = QTextCodec::codecForIndex ( i ); - if ( pCodec != 0 ) m.insert( std::make_pair( QString(pCodec->mimeName()).upper(), pCodec->mimeName()) ); + TQTextCodec* pCodec = TQTextCodec::codecForIndex ( i ); + if ( pCodec != 0 ) m.insert( std::make_pair( TQString(pCodec->mimeName()).upper(), pCodec->mimeName()) ); else break; } p->insertItem( i18n("Auto"), 0 ); - std::multimap<QString,QString>::iterator mi; + std::multimap<TQString,TQString>::iterator mi; for(mi=m.begin(), i=0; mi!=m.end(); ++mi, ++i) p->insertItem(mi->second, i+1); } */ // UTF8-Codec that saves a BOM -class Utf8BOMCodec : public QTextCodec +class Utf8BOMCodec : public TQTextCodec { public: const char * name () const { return "UTF-8-BOM"; } int mibEnum () const { return 2123; } int heuristicContentMatch(const char*, int) const { return 0; } - class UTF8BOMEncoder : public QTextEncoder + class UTF8BOMEncoder : public TQTextEncoder { bool bBOMAdded; public: UTF8BOMEncoder() { bBOMAdded=false; } - QCString fromUnicode(const QString& uc, int& lenInOut ) + TQCString fromUnicode(const TQString& uc, int& lenInOut ) { - QCString r; + TQCString r; if (!bBOMAdded) { r += "\xEF\xBB\xBF"; @@ -1182,25 +1182,25 @@ class Utf8BOMCodec : public QTextCodec return r; } }; - QTextEncoder* makeEncoder() const + TQTextEncoder* makeEncoder() const { return new UTF8BOMEncoder; } - class UTF8BOMDecoder : public QTextDecoder + class UTF8BOMDecoder : public TQTextDecoder { - QTextDecoder *m_pDecoder; + TQTextDecoder *m_pDecoder; public: - UTF8BOMDecoder() { m_pDecoder = QTextCodec::codecForName("UTF-8")->makeDecoder(); } + UTF8BOMDecoder() { m_pDecoder = TQTextCodec::codecForName("UTF-8")->makeDecoder(); } ~UTF8BOMDecoder() { delete m_pDecoder; } - QString toUnicode( const char* p, int len) + TQString toUnicode( const char* p, int len) { return m_pDecoder->toUnicode( p, len ); } }; - QTextDecoder* makeDecoder() const + TQTextDecoder* makeDecoder() const { return new UTF8BOMDecoder; } @@ -1210,16 +1210,16 @@ void OptionDialog::setupRegionalPage( void ) { new Utf8BOMCodec(); - QFrame *page = addPage( i18n("Regional Settings"), i18n("Regional Settings"), + TQFrame *page = addPage( i18n("Regional Settings"), i18n("Regional Settings"), BarIcon("locale"/*"charset"*/, KIcon::SizeMedium ) ); - QVBoxLayout *topLayout = new QVBoxLayout( page, 5, spacingHint() ); + TQVBoxLayout *topLayout = new TQVBoxLayout( page, 5, spacingHint() ); - QGridLayout *gbox = new QGridLayout( 3, 2 ); + TQGridLayout *gbox = new TQGridLayout( 3, 2 ); gbox->setColStretch(1,5); topLayout->addLayout( gbox ); int line=0; - QLabel* label; + TQLabel* label; #ifdef KREPLACEMENTS_H @@ -1306,7 +1306,7 @@ static char* countryMap[]={ "zu Zulu" }; - label = new QLabel( i18n("Language (restart required)"), page ); + label = new TQLabel( i18n("Language (restart required)"), page ); gbox->addWidget( label, line, 0 ); OptionComboBox* pLanguage = new OptionComboBox( 0, "Language", &m_language, page, this ); gbox->addWidget( pLanguage, line, 1 ); @@ -1320,14 +1320,14 @@ static char* countryMap[]={ t_DirectoryList::iterator i; for( i=dirList.begin(); i!=dirList.end(); ++i) { - QString fileName = i->fileName(); + TQString fileName = i->fileName(); // Skip the "kdiff3_" and omit the .qm - QString languageId = fileName.mid(7, fileName.length()-10 ); + TQString languageId = fileName.mid(7, fileName.length()-10 ); unsigned int countryIdx=0; for(countryIdx=0; countryIdx< sizeof(countryMap)/sizeof(countryMap[0]); ++countryIdx ) { - QString fullName = countryMap[countryIdx]; + TQString fullName = countryMap[countryIdx]; if ( languageId+" " == fullName.left(languageId.length()+1) ) { languageId += " (" + fullName.mid(languageId.length()+1) + ")"; @@ -1337,18 +1337,18 @@ static char* countryMap[]={ pLanguage->insertItem( languageId ); } - QToolTip::add( label, i18n( + TQToolTip::add( label, i18n( "Choose the language of the GUI-strings or \"Auto\".\n" "For a change of language to take place, quit and restart KDiff3.") ); ++line; /* - label = new QLabel( i18n("Codec for file contents"), page ); + label = new TQLabel( i18n("Codec for file contents"), page ); gbox->addWidget( label, line, 0 ); OptionComboBox* pFileCodec = new OptionComboBox( 0, "FileCodec", &m_fileCodec, page, this ); gbox->addWidget( pFileCodec, line, 1 ); insertCodecs( pFileCodec ); - QToolTip::add( label, i18n( + TQToolTip::add( label, i18n( "Choose the codec that should be used for your input files\n" "or \"Auto\" if unsure." ) ); @@ -1358,74 +1358,74 @@ static char* countryMap[]={ m_pSameEncoding = new OptionCheckBox( i18n("Use the same encoding for everything:"), true, "SameEncoding", &m_bSameEncoding, page, this ); gbox->addMultiCellWidget( m_pSameEncoding, line, line, 0, 1 ); - QToolTip::add( m_pSameEncoding, i18n( + TQToolTip::add( m_pSameEncoding, i18n( "Enable this allows to change all encodings by changing the first only.\n" "Disable this if different individual settings are needed." ) ); ++line; - label = new QLabel( i18n("Note: Local Encoding is ") + "\"" + QTextCodec::codecForLocale()->name() + "\"", page ); + label = new TQLabel( i18n("Note: Local Encoding is ") + "\"" + TQTextCodec::codecForLocale()->name() + "\"", page ); gbox->addWidget( label, line, 0 ); ++line; - label = new QLabel( i18n("File Encoding for A:"), page ); + label = new TQLabel( i18n("File Encoding for A:"), page ); gbox->addWidget( label, line, 0 ); m_pEncodingAComboBox = new OptionEncodingComboBox( "EncodingForA", &m_pEncodingA, page, this ); gbox->addWidget( m_pEncodingAComboBox, line, 1 ); - QString autoDetectToolTip = i18n( + TQString autoDetectToolTip = i18n( "If enabled then Unicode (UTF-16 or UTF-8) encoding will be detected.\n" "If the file encoding is not detected then the selected encoding will be used as fallback.\n" "(Unicode detection depends on the first bytes of a file - the byte order mark \"BOM\".)" ); m_pAutoDetectUnicodeA = new OptionCheckBox( i18n("Auto Detect Unicode"), true, "AutoDetectUnicodeA", &m_bAutoDetectUnicodeA, page, this ); gbox->addWidget( m_pAutoDetectUnicodeA, line, 2 ); - QToolTip::add( m_pAutoDetectUnicodeA, autoDetectToolTip ); + TQToolTip::add( m_pAutoDetectUnicodeA, autoDetectToolTip ); ++line; - label = new QLabel( i18n("File Encoding for B:"), page ); + label = new TQLabel( i18n("File Encoding for B:"), page ); gbox->addWidget( label, line, 0 ); m_pEncodingBComboBox = new OptionEncodingComboBox( "EncodingForB", &m_pEncodingB, page, this ); gbox->addWidget( m_pEncodingBComboBox, line, 1 ); m_pAutoDetectUnicodeB = new OptionCheckBox( i18n("Auto Detect Unicode"), true, "AutoDetectUnicodeB", &m_bAutoDetectUnicodeB, page, this ); gbox->addWidget( m_pAutoDetectUnicodeB, line, 2 ); - QToolTip::add( m_pAutoDetectUnicodeB, autoDetectToolTip ); + TQToolTip::add( m_pAutoDetectUnicodeB, autoDetectToolTip ); ++line; - label = new QLabel( i18n("File Encoding for C:"), page ); + label = new TQLabel( i18n("File Encoding for C:"), page ); gbox->addWidget( label, line, 0 ); m_pEncodingCComboBox = new OptionEncodingComboBox( "EncodingForC", &m_pEncodingC, page, this ); gbox->addWidget( m_pEncodingCComboBox, line, 1 ); m_pAutoDetectUnicodeC = new OptionCheckBox( i18n("Auto Detect Unicode"), true, "AutoDetectUnicodeC", &m_bAutoDetectUnicodeC, page, this ); gbox->addWidget( m_pAutoDetectUnicodeC, line, 2 ); - QToolTip::add( m_pAutoDetectUnicodeC, autoDetectToolTip ); + TQToolTip::add( m_pAutoDetectUnicodeC, autoDetectToolTip ); ++line; - label = new QLabel( i18n("File Encoding for Merge Output and Saving:"), page ); + label = new TQLabel( i18n("File Encoding for Merge Output and Saving:"), page ); gbox->addWidget( label, line, 0 ); m_pEncodingOutComboBox = new OptionEncodingComboBox( "EncodingForOutput", &m_pEncodingOut, page, this ); gbox->addWidget( m_pEncodingOutComboBox, line, 1 ); m_pAutoSelectOutEncoding = new OptionCheckBox( i18n("Auto Select"), true, "AutoSelectOutEncoding", &m_bAutoSelectOutEncoding, page, this ); gbox->addWidget( m_pAutoSelectOutEncoding, line, 2 ); - QToolTip::add( m_pAutoSelectOutEncoding, i18n( + TQToolTip::add( m_pAutoSelectOutEncoding, i18n( "If enabled then the encoding from the input files is used.\n" "In ambiguous cases a dialog will ask the user to choose the encoding for saving." ) ); ++line; - label = new QLabel( i18n("File Encoding for Preprocessor Files:"), page ); + label = new TQLabel( i18n("File Encoding for Preprocessor Files:"), page ); gbox->addWidget( label, line, 0 ); m_pEncodingPPComboBox = new OptionEncodingComboBox( "EncodingForPP", &m_pEncodingPP, page, this ); gbox->addWidget( m_pEncodingPPComboBox, line, 1 ); ++line; - connect(m_pSameEncoding, SIGNAL(toggled(bool)), this, SLOT(slotEncodingChanged())); - connect(m_pEncodingAComboBox, SIGNAL(activated(int)), this, SLOT(slotEncodingChanged())); - connect(m_pAutoDetectUnicodeA, SIGNAL(toggled(bool)), this, SLOT(slotEncodingChanged())); - connect(m_pAutoSelectOutEncoding, SIGNAL(toggled(bool)), this, SLOT(slotEncodingChanged())); + connect(m_pSameEncoding, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(slotEncodingChanged())); + connect(m_pEncodingAComboBox, TQT_SIGNAL(activated(int)), this, TQT_SLOT(slotEncodingChanged())); + connect(m_pAutoDetectUnicodeA, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(slotEncodingChanged())); + connect(m_pAutoSelectOutEncoding, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(slotEncodingChanged())); OptionCheckBox* pRightToLeftLanguage = new OptionCheckBox( i18n("Right To Left Language"), false, "RightToLeftLanguage", &m_bRightToLeftLanguage, page, this ); gbox->addMultiCellWidget( pRightToLeftLanguage, line, line, 0, 1 ); - QToolTip::add( pRightToLeftLanguage, i18n( + TQToolTip::add( pRightToLeftLanguage, i18n( "Some languages are read from right to left.\n" "This setting will change the viewer and editor accordingly.")); ++line; @@ -1440,21 +1440,21 @@ static char* countryMap[]={ void OptionDialog::setupIntegrationPage( void ) { - QFrame *page = addPage( i18n("Integration"), i18n("Integration Settings"), + TQFrame *page = addPage( i18n("Integration"), i18n("Integration Settings"), BarIcon("launch"/*"charset"*/, KIcon::SizeMedium ) ); - QVBoxLayout *topLayout = new QVBoxLayout( page, 5, spacingHint() ); + TQVBoxLayout *topLayout = new TQVBoxLayout( page, 5, spacingHint() ); - QGridLayout *gbox = new QGridLayout( 3, 3 ); + TQGridLayout *gbox = new TQGridLayout( 3, 3 ); gbox->setColStretch(2,5); topLayout->addLayout( gbox ); int line=0; - QLabel* label; - label = new QLabel( i18n("Command line options to ignore:"), page ); + TQLabel* label; + label = new TQLabel( i18n("Command line options to ignore:"), page ); gbox->addWidget( label, line, 0 ); OptionLineEdit* pIgnorableCmdLineOptions = new OptionLineEdit( "-u;-query;-html;-abort", "IgnorableCmdLineOptions", &m_ignorableCmdLineOptions, page, this ); gbox->addMultiCellWidget( pIgnorableCmdLineOptions, line, line, 1,2 ); - QToolTip::add( label, i18n( + TQToolTip::add( label, i18n( "List of command line options that should be ignored when KDiff3 is used by other tools.\n" "Several values can be specified if separated via ';'\n" "This will suppress the \"Unknown option\"-error." @@ -1462,20 +1462,20 @@ void OptionDialog::setupIntegrationPage( void ) ++line; #ifdef _WIN32 - QPushButton* pIntegrateWithClearCase = new QPushButton( i18n("Integrate with ClearCase"), page); + TQPushButton* pIntegrateWithClearCase = new TQPushButton( i18n("Integrate with ClearCase"), page); gbox->addWidget( pIntegrateWithClearCase, line, 0 ); - QToolTip::add( pIntegrateWithClearCase, i18n( + TQToolTip::add( pIntegrateWithClearCase, i18n( "Integrate with Rational ClearCase from IBM.\n" "Modifies the \"map\" file in ClearCase-subdir \"lib/mgrs\"\n" "(Only enabled when ClearCase \"bin\" directory is in the path.)")); - connect(pIntegrateWithClearCase, SIGNAL(clicked()),this, SLOT(slotIntegrateWithClearCase()) ); + connect(pIntegrateWithClearCase, TQT_SIGNAL(clicked()),this, TQT_SLOT(slotIntegrateWithClearCase()) ); pIntegrateWithClearCase->setEnabled( integrateWithClearCase( "existsClearCase", "" )!=0 ); - QPushButton* pRemoveClearCaseIntegration = new QPushButton( i18n("Remove ClearCase Integration"), page); + TQPushButton* pRemoveClearCaseIntegration = new TQPushButton( i18n("Remove ClearCase Integration"), page); gbox->addWidget( pRemoveClearCaseIntegration, line, 1 ); - QToolTip::add( pRemoveClearCaseIntegration, i18n( + TQToolTip::add( pRemoveClearCaseIntegration, i18n( "Restore the old \"map\" file from before doing the Clearcase integration.")); - connect(pRemoveClearCaseIntegration, SIGNAL(clicked()),this, SLOT(slotRemoveClearCaseIntegration()) ); + connect(pRemoveClearCaseIntegration, TQT_SIGNAL(clicked()),this, TQT_SLOT(slotRemoveClearCaseIntegration()) ); pRemoveClearCaseIntegration->setEnabled( integrateWithClearCase( "existsClearCase", "" )!=0 ); ++line; @@ -1536,11 +1536,11 @@ void OptionDialog::slotEncodingChanged() void OptionDialog::setupKeysPage( void ) { - //QVBox *page = addVBoxPage( i18n("Keys"), i18n("KeyDialog" ), + //TQVBox *page = addVBoxPage( i18n("Keys"), i18n("KeyDialog" ), // BarIcon("fonts", KIcon::SizeMedium ) ); - //QVBoxLayout *topLayout = new QVBoxLayout( page, 0, spacingHint() ); - // new KFontChooser( page,"font",false/*onlyFixed*/,QStringList(),false,6 ); + //TQVBoxLayout *topLayout = new TQVBoxLayout( page, 0, spacingHint() ); + // new KFontChooser( page,"font",false/*onlyFixed*/,TQStringList(),false,6 ); //m_pKeyDialog=new KKeyDialog( false, 0 ); //topLayout->addWidget( m_pKeyDialog ); } @@ -1550,8 +1550,8 @@ void OptionDialog::slotOk( void ) slotApply(); // My system returns variable width fonts even though I - // disabled this. Even QFont::fixedPitch() doesn't work. - QFontMetrics fm(m_font); + // disabled this. Even TQFont::fixedPitch() doesn't work. + TQFontMetrics fm(m_font); if ( fm.width('W')!=fm.width('i') ) { int result = KMessageBox::warningYesNo(this, i18n( @@ -1581,13 +1581,13 @@ void OptionDialog::slotApply( void ) emit applyClicked(); #ifdef _WIN32 - QString locale = m_language; + TQString locale = m_language; if ( locale == "Auto" || locale.isEmpty() ) - locale = locale = QTextCodec::locale(); - int spacePos = locale.find(' '); + locale = locale = TQTextCodec::locale(); + int spacePos = locale.tqfind(' '); if (spacePos>0) locale = locale.left(spacePos); - QSettings settings; - settings.setPath("KDiff3", "diff-ext", QSettings::User ); + TQSettings settings; + settings.setPath("KDiff3", "diff-ext", TQSettings::User ); settings.writeEntry( "Language", locale ); #endif } @@ -1631,24 +1631,24 @@ private: public: ConfigValueMap( KConfig* pConfig ) { m_pConfig = pConfig; } - void writeEntry(const QString& s, const QFont& v ){ m_pConfig->writeEntry(s,v); } - void writeEntry(const QString& s, const QColor& v ){ m_pConfig->writeEntry(s,v); } - void writeEntry(const QString& s, const QSize& v ){ m_pConfig->writeEntry(s,v); } - void writeEntry(const QString& s, const QPoint& v ){ m_pConfig->writeEntry(s,v); } - void writeEntry(const QString& s, int v ) { m_pConfig->writeEntry(s,v); } - void writeEntry(const QString& s, bool v ) { m_pConfig->writeEntry(s,v); } - void writeEntry(const QString& s, const QStringList& v, char separator ){ m_pConfig->writeEntry(s,v,separator); } - void writeEntry(const QString& s, const QString& v ){ m_pConfig->writeEntry(s,v); } - void writeEntry(const QString& s, const char* v ) { m_pConfig->writeEntry(s,v); } - - QFont readFontEntry (const QString& s, QFont* defaultVal ) { return m_pConfig->readFontEntry(s,defaultVal); } - QColor readColorEntry(const QString& s, QColor* defaultVal ){ return m_pConfig->readColorEntry(s,defaultVal); } - QSize readSizeEntry (const QString& s, QSize* defaultVal ) { return m_pConfig->readSizeEntry(s,defaultVal); } - QPoint readPointEntry(const QString& s, QPoint* defaultVal) { return m_pConfig->readPointEntry(s,defaultVal); } - bool readBoolEntry (const QString& s, bool defaultVal ) { return m_pConfig->readBoolEntry(s,defaultVal); } - int readNumEntry (const QString& s, int defaultVal ) { return m_pConfig->readNumEntry(s,defaultVal); } - QStringList readListEntry (const QString& s, const QStringList& def, char separator ) { return m_pConfig->readListEntry(s.latin1(),def,separator); } - QString readEntry (const QString& s, const QString& defaultVal){ return m_pConfig->readEntry(s,defaultVal); } + void writeEntry(const TQString& s, const TQFont& v ){ m_pConfig->writeEntry(s,v); } + void writeEntry(const TQString& s, const TQColor& v ){ m_pConfig->writeEntry(s,v); } + void writeEntry(const TQString& s, const TQSize& v ){ m_pConfig->writeEntry(s,v); } + void writeEntry(const TQString& s, const TQPoint& v ){ m_pConfig->writeEntry(s,v); } + void writeEntry(const TQString& s, int v ) { m_pConfig->writeEntry(s,v); } + void writeEntry(const TQString& s, bool v ) { m_pConfig->writeEntry(s,v); } + void writeEntry(const TQString& s, const TQStringList& v, char separator ){ m_pConfig->writeEntry(s,v,separator); } + void writeEntry(const TQString& s, const TQString& v ){ m_pConfig->writeEntry(s,v); } + void writeEntry(const TQString& s, const char* v ) { m_pConfig->writeEntry(s,v); } + + TQFont readFontEntry (const TQString& s, TQFont* defaultVal ) { return m_pConfig->readFontEntry(s,defaultVal); } + TQColor readColorEntry(const TQString& s, TQColor* defaultVal ){ return m_pConfig->readColorEntry(s,defaultVal); } + TQSize readSizeEntry (const TQString& s, TQSize* defaultVal ) { return m_pConfig->readSizeEntry(s,defaultVal); } + TQPoint readPointEntry(const TQString& s, TQPoint* defaultVal) { return m_pConfig->readPointEntry(s,defaultVal); } + bool readBoolEntry (const TQString& s, bool defaultVal ) { return m_pConfig->readBoolEntry(s,defaultVal); } + int readNumEntry (const TQString& s, int defaultVal ) { return m_pConfig->readNumEntry(s,defaultVal); } + TQStringList readListEntry (const TQString& s, const TQStringList& def, char separator ) { return m_pConfig->readListEntry(s.latin1(),def,separator); } + TQString readEntry (const TQString& s, const TQString& defaultVal){ return m_pConfig->readEntry(s,defaultVal); } }; void OptionDialog::saveOptions( KConfig* config ) @@ -1686,19 +1686,19 @@ void OptionDialog::slotHelp( void ) KDialogBase::slotHelp(); } -QString OptionDialog::parseOptions( const QCStringList& optionList ) +TQString OptionDialog::parseOptions( const QCStringList& optionList ) { - QString result; + TQString result; QCStringList::const_iterator i; for ( i=optionList.begin(); i!=optionList.end(); ++i ) { - QString s = *i; + TQString s = *i; - int pos = s.find('='); + int pos = s.tqfind('='); if( pos > 0 ) // seems not to have a tag { - QString key = s.left(pos); - QString val = s.mid(pos+1); + TQString key = s.left(pos); + TQString val = s.mid(pos+1); std::list<OptionItem*>::iterator j; bool bFound = false; for(j=m_optionItemList.begin(); j!=m_optionItemList.end(); ++j) @@ -1725,7 +1725,7 @@ QString OptionDialog::parseOptions( const QCStringList& optionList ) return result; } -QString OptionDialog::calcOptionHelp() +TQString OptionDialog::calcOptionHelp() { ValueMap config; std::list<OptionItem*>::iterator j; diff --git a/src/optiondialog.h b/src/optiondialog.h index 98ea0ff..0d4c372 100644 --- a/src/optiondialog.h +++ b/src/optiondialog.h @@ -22,15 +22,15 @@ #ifndef OPTION_DIALOG_H #define OPTION_DIALOG_H -class QCheckBox; -class QLabel; -class QLineEdit; +class TQCheckBox; +class TQLabel; +class TQLineEdit; class KColorButton; class KFontChooser; class KConfig; #include <kdialogbase.h> -#include <qstringlist.h> +#include <tqstringlist.h> #include <list> #include <kcmdlineargs.h> @@ -49,40 +49,41 @@ enum e_LineEndStyle class OptionDialog : public KDialogBase { Q_OBJECT + TQ_OBJECT public: - OptionDialog( bool bShowDirMergeSettings, QWidget *parent = 0, char *name = 0 ); + OptionDialog( bool bShowDirMergeSettings, TQWidget *tqparent = 0, char *name = 0 ); ~OptionDialog( void ); - QString parseOptions( const QCStringList& optionList ); - QString calcOptionHelp(); + TQString parseOptions( const QCStringList& optionList ); + TQString calcOptionHelp(); // Some settings are not available in the option dialog: - QSize m_geometry; - QPoint m_position; + TQSize m_tqgeometry; + TQPoint m_position; bool m_bMaximised; bool m_bShowToolBar; bool m_bShowStatusBar; int m_toolBarPos; // These are the results of the option dialog. - QFont m_font; + TQFont m_font; bool m_bItalicForDeltas; - QColor m_fgColor; - QColor m_bgColor; - QColor m_diffBgColor; - QColor m_colorA; - QColor m_colorB; - QColor m_colorC; - QColor m_colorForConflict; - QColor m_currentRangeBgColor; - QColor m_currentRangeDiffBgColor; - QColor m_oldestFileColor; - QColor m_midAgeFileColor; - QColor m_newestFileColor; - QColor m_missingFileColor; - QColor m_manualHelpRangeColor; + TQColor m_fgColor; + TQColor m_bgColor; + TQColor m_diffBgColor; + TQColor m_colorA; + TQColor m_colorB; + TQColor m_colorC; + TQColor m_colorForConflict; + TQColor m_currentRangeBgColor; + TQColor m_currentRangeDiffBgColor; + TQColor m_oldestFileColor; + TQColor m_midAgeFileColor; + TQColor m_newestFileColor; + TQColor m_missingFileColor; + TQColor m_manualHelpRangeColor; bool m_bWordWrap; @@ -91,15 +92,15 @@ public: int m_tabSize; bool m_bAutoCopySelection; bool m_bSameEncoding; - QTextCodec* m_pEncodingA; + TQTextCodec* m_pEncodingA; bool m_bAutoDetectUnicodeA; - QTextCodec* m_pEncodingB; + TQTextCodec* m_pEncodingB; bool m_bAutoDetectUnicodeB; - QTextCodec* m_pEncodingC; + TQTextCodec* m_pEncodingC; bool m_bAutoDetectUnicodeC; - QTextCodec* m_pEncodingOut; + TQTextCodec* m_pEncodingOut; bool m_bAutoSelectOutEncoding; - QTextCodec* m_pEncodingPP; + TQTextCodec* m_pEncodingPP; int m_lineEndStyle; bool m_bPreserveCarriageReturn; @@ -114,27 +115,27 @@ public: bool m_bIgnoreCase; bool m_bIgnoreNumbers; bool m_bIgnoreComments; - QString m_PreProcessorCmd; - QString m_LineMatchingPreProcessorCmd; + TQString m_PreProcessorCmd; + TQString m_LineMatchingPreProcessorCmd; bool m_bRunRegExpAutoMergeOnMergeStart; - QString m_autoMergeRegExp; + TQString m_autoMergeRegExp; bool m_bRunHistoryAutoMergeOnMergeStart; - QString m_historyStartRegExp; - QString m_historyEntryStartRegExp; + TQString m_historyStartRegExp; + TQString m_historyEntryStartRegExp; bool m_bHistoryMergeSorting; - QString m_historyEntryStartSortKeyOrder; + TQString m_historyEntryStartSortKeyOrder; int m_maxNofHistoryEntries; - QString m_IrrelevantMergeCmd; + TQString m_IrrelevantMergeCmd; bool m_bAutoSaveAndQuitOnMergeWithoutConflicts; bool m_bAutoAdvance; int m_autoAdvanceDelay; - QStringList m_recentAFiles; - QStringList m_recentBFiles; - QStringList m_recentCFiles; + TQStringList m_recentAFiles; + TQStringList m_recentBFiles; + TQStringList m_recentCFiles; - QStringList m_recentOutputFiles; + TQStringList m_recentOutputFiles; // Directory Merge options bool m_bDmSyncMode; @@ -154,14 +155,14 @@ public: bool m_bDmUseCvsIgnore; bool m_bDmWhiteSpaceEqual; bool m_bDmCaseSensitiveFilenameComparison; - QString m_DmFilePattern; - QString m_DmFileAntiPattern; - QString m_DmDirAntiPattern; + TQString m_DmFilePattern; + TQString m_DmFileAntiPattern; + TQString m_DmDirAntiPattern; - QString m_language; + TQString m_language; bool m_bRightToLeftLanguage; - QString m_ignorableCmdLineOptions; + TQString m_ignorableCmdLineOptions; bool m_bIntegrateWithClearCase; void saveOptions(KConfig* config); diff --git a/src/pdiff.cpp b/src/pdiff.cpp index abb26bc..bf9be72 100644 --- a/src/pdiff.cpp +++ b/src/pdiff.cpp @@ -23,7 +23,7 @@ #include <iostream> #include <algorithm> #include <ctype.h> -#include <qaccel.h> +#include <tqaccel.h> #include <klocale.h> #include <kmessagebox.h> @@ -31,17 +31,17 @@ #include <kstatusbar.h> #include <kkeydialog.h> -#include <qclipboard.h> -#include <qscrollbar.h> -#include <qlayout.h> -#include <qcheckbox.h> -#include <qsplitter.h> -#include <qdir.h> -#include <qfile.h> -#include <qvbuttongroup.h> -#include <qdragobject.h> -#include <qlineedit.h> -#include <qcombobox.h> +#include <tqclipboard.h> +#include <tqscrollbar.h> +#include <tqlayout.h> +#include <tqcheckbox.h> +#include <tqsplitter.h> +#include <tqdir.h> +#include <tqfile.h> +#include <tqvbuttongroup.h> +#include <tqdragobject.h> +#include <tqlineedit.h> +#include <tqcombobox.h> #include <assert.h> #include "kdiff3.h" @@ -84,7 +84,7 @@ bool KDiff3App::runDiff( const LineData* p1, int size1, const LineData* p2, int { GnuDiff::comparison comparisonInput; memset( &comparisonInput, 0, sizeof(comparisonInput) ); - comparisonInput.parent = 0; + comparisonInput.tqparent = 0; comparisonInput.file[0].buffer = p1[0].pLine;//ptr to buffer comparisonInput.file[0].buffered = (p1[size1-1].pLine-p1[0].pLine+p1[size1-1].size); // size of buffer comparisonInput.file[1].buffer = p2[0].pLine;//ptr to buffer @@ -235,14 +235,14 @@ bool KDiff3App::runDiff( const LineData* p1, int size1, const LineData* p2, int return true; } -void KDiff3App::init( bool bAuto, TotalDiffStatus* pTotalDiffStatus, bool bLoadFiles ) +void KDiff3App::init( bool bAuto, TotalDifftqStatus* pTotalDifftqStatus, bool bLoadFiles ) { ProgressProxy pp; // When doing a full analysis in the directory-comparison, then the statistics-results - // will be stored in the given TotalDiffStatus. Otherwise it will be 0. - bool bGUI = pTotalDiffStatus == 0; - if (pTotalDiffStatus==0) - pTotalDiffStatus = &m_totalDiffStatus; + // will be stored in the given TotalDifftqStatus. Otherwise it will be 0. + bool bGUI = pTotalDifftqStatus == 0; + if (pTotalDifftqStatus==0) + pTotalDifftqStatus = &m_totalDifftqStatus; bool bPreserveCarriageReturn = m_pOptionDialog->m_bPreserveCarriageReturn; @@ -251,7 +251,7 @@ void KDiff3App::init( bool bAuto, TotalDiffStatus* pTotalDiffStatus, bool bLoadF { bPreserveCarriageReturn = false; - QString msg; + TQString msg; if ( !m_pOptionDialog->m_PreProcessorCmd.isEmpty() ) { @@ -310,11 +310,11 @@ void KDiff3App::init( bool bAuto, TotalDiffStatus* pTotalDiffStatus, bool bLoadF pp.setMaxNofSteps( 6 ); // 3 comparisons, 3 finediffs } - pTotalDiffStatus->reset(); + pTotalDifftqStatus->reset(); // Run the diff. if ( m_sd3.isEmpty() ) { - pTotalDiffStatus->bBinaryAEqB = m_sd1.isBinaryEqualWith( m_sd2 ); + pTotalDifftqStatus->bBinaryAEqB = m_sd1.isBinaryEqualWith( m_sd2 ); pp.setInformation(i18n("Diff: A <-> B")); runDiff( m_sd1.getLineDataForDiff(), m_sd1.getSizeLines(), m_sd2.getLineDataForDiff(), m_sd2.getSizeLines(), m_diffList12,1,2 ); @@ -323,8 +323,8 @@ void KDiff3App::init( bool bAuto, TotalDiffStatus* pTotalDiffStatus, bool bLoadF pp.setInformation(i18n("Linediff: A <-> B")); calcDiff3LineListUsingAB( &m_diffList12, m_diff3LineList ); - fineDiff( m_diff3LineList, 1, m_sd1.getLineDataForDisplay(), m_sd2.getLineDataForDisplay(), pTotalDiffStatus->bTextAEqB ); - if ( m_sd1.getSizeBytes()==0 ) pTotalDiffStatus->bTextAEqB=false; + fineDiff( m_diff3LineList, 1, m_sd1.getLineDataForDisplay(), m_sd2.getLineDataForDisplay(), pTotalDifftqStatus->bTextAEqB ); + if ( m_sd1.getSizeBytes()==0 ) pTotalDifftqStatus->bTextAEqB=false; pp.step(); } @@ -337,9 +337,9 @@ void KDiff3App::init( bool bAuto, TotalDiffStatus* pTotalDiffStatus, bool bLoadF pp.step(); } - pTotalDiffStatus->bBinaryAEqB = m_sd1.isBinaryEqualWith( m_sd2 ); - pTotalDiffStatus->bBinaryAEqC = m_sd1.isBinaryEqualWith( m_sd3 ); - pTotalDiffStatus->bBinaryBEqC = m_sd3.isBinaryEqualWith( m_sd2 ); + pTotalDifftqStatus->bBinaryAEqB = m_sd1.isBinaryEqualWith( m_sd2 ); + pTotalDifftqStatus->bBinaryAEqC = m_sd1.isBinaryEqualWith( m_sd3 ); + pTotalDifftqStatus->bBinaryBEqC = m_sd3.isBinaryEqualWith( m_sd2 ); pp.setInformation(i18n("Diff: A <-> B")); runDiff( m_sd1.getLineDataForDiff(), m_sd1.getSizeLines(), m_sd2.getLineDataForDiff(), m_sd2.getSizeLines(), m_diffList12,1,2 ); @@ -364,16 +364,16 @@ void KDiff3App::init( bool bAuto, TotalDiffStatus* pTotalDiffStatus, bool bLoadF debugLineCheck( m_diff3LineList, m_sd3.getSizeLines(), 3 ); pp.setInformation(i18n("Linediff: A <-> B")); - fineDiff( m_diff3LineList, 1, m_sd1.getLineDataForDisplay(), m_sd2.getLineDataForDisplay(), pTotalDiffStatus->bTextAEqB ); + fineDiff( m_diff3LineList, 1, m_sd1.getLineDataForDisplay(), m_sd2.getLineDataForDisplay(), pTotalDifftqStatus->bTextAEqB ); pp.step(); pp.setInformation(i18n("Linediff: B <-> C")); - fineDiff( m_diff3LineList, 2, m_sd2.getLineDataForDisplay(), m_sd3.getLineDataForDisplay(), pTotalDiffStatus->bTextBEqC ); + fineDiff( m_diff3LineList, 2, m_sd2.getLineDataForDisplay(), m_sd3.getLineDataForDisplay(), pTotalDifftqStatus->bTextBEqC ); pp.step(); pp.setInformation(i18n("Linediff: A <-> C")); - fineDiff( m_diff3LineList, 3, m_sd3.getLineDataForDisplay(), m_sd1.getLineDataForDisplay(), pTotalDiffStatus->bTextAEqC ); + fineDiff( m_diff3LineList, 3, m_sd3.getLineDataForDisplay(), m_sd1.getLineDataForDisplay(), pTotalDifftqStatus->bTextAEqC ); pp.step(); - if ( m_sd1.getSizeBytes()==0 ) { pTotalDiffStatus->bTextAEqB=false; pTotalDiffStatus->bTextAEqC=false; } - if ( m_sd2.getSizeBytes()==0 ) { pTotalDiffStatus->bTextAEqB=false; pTotalDiffStatus->bTextBEqC=false; } + if ( m_sd1.getSizeBytes()==0 ) { pTotalDifftqStatus->bTextAEqB=false; pTotalDifftqStatus->bTextAEqC=false; } + if ( m_sd2.getSizeBytes()==0 ) { pTotalDifftqStatus->bTextAEqB=false; pTotalDifftqStatus->bTextBEqC=false; } } m_diffBufferInfo.init( &m_diff3LineList, &m_diff3LineVector, m_sd1.getLineDataForDiff(), m_sd1.getSizeLines(), @@ -420,9 +420,9 @@ void KDiff3App::init( bool bAuto, TotalDiffStatus* pTotalDiffStatus, bool bLoadF m_sd2.getLineDataForDisplay(), m_sd2.getSizeLines(), m_bTripleDiff ? m_sd3.getLineDataForDisplay() : 0, m_sd3.getSizeLines(), &m_diff3LineList, - pTotalDiffStatus + pTotalDifftqStatus ); - m_pMergeResultWindowTitle->setFileName( m_outputFilename.isEmpty() ? QString("unnamed.txt") : m_outputFilename ); + m_pMergeResultWindowTitle->setFileName( m_outputFilename.isEmpty() ? TQString("unnamed.txt") : m_outputFilename ); if ( !bGUI ) { @@ -459,17 +459,17 @@ void KDiff3App::init( bool bAuto, TotalDiffStatus* pTotalDiffStatus, bool bLoadF if ( !isPart() ) { // 1. If the filenames are equal then show only one filename - QString caption; - QString a1 = m_sd1.getAliasName(); - QString a2 = m_sd2.getAliasName(); - QString a3 = m_sd3.getAliasName(); - QString f1, f2, f3; + TQString caption; + TQString a1 = m_sd1.getAliasName(); + TQString a2 = m_sd2.getAliasName(); + TQString a3 = m_sd3.getAliasName(); + TQString f1, f2, f3; int p1,p2,p3; - if ( !a1.isEmpty() && (p1=a1.findRev('/'))>=0 ) + if ( !a1.isEmpty() && (p1=a1.tqfindRev('/'))>=0 ) f1 = a1.mid( p1+1 ); - if ( !a2.isEmpty() && (p2=a2.findRev('/'))>=0 ) + if ( !a2.isEmpty() && (p2=a2.tqfindRev('/'))>=0 ) f2 = a2.mid( p2+1 ); - if ( !a3.isEmpty() && (p3=a3.findRev('/'))>=0 ) + if ( !a3.isEmpty() && (p3=a3.tqfindRev('/'))>=0 ) f3 = a3.mid( p3+1 ); if ( !f1.isEmpty() ) { @@ -488,12 +488,12 @@ void KDiff3App::init( bool bAuto, TotalDiffStatus* pTotalDiffStatus, bool bLoadF // 2. If the files don't have the same name then show all names if ( caption.isEmpty() && (!f1.isEmpty() || !f2.isEmpty() || !f3.isEmpty()) ) { - caption = ( f1.isEmpty()? QString("") : QString(".../")+f1 ); - caption += QString(caption.isEmpty() || f2.isEmpty() ? "" : " <-> ") + ( f2.isEmpty()? QString("") : QString(".../")+f2 ); - caption += QString(caption.isEmpty() || f3.isEmpty() ? "" : " <-> ") + ( f3.isEmpty()? QString("") : QString(".../")+f3 ) ; + caption = ( f1.isEmpty()? TQString("") : TQString(".../")+f1 ); + caption += TQString(caption.isEmpty() || f2.isEmpty() ? "" : " <-> ") + ( f2.isEmpty()? TQString("") : TQString(".../")+f2 ); + caption += TQString(caption.isEmpty() || f3.isEmpty() ? "" : " <-> ") + ( f3.isEmpty()? TQString("") : TQString(".../")+f3 ) ; } - m_pKDiff3Shell->setCaption( caption.isEmpty() ? QString("KDiff3") : caption+QString(" - KDiff3")); + m_pKDiff3Shell->setCaption( caption.isEmpty() ? TQString("KDiff3") : caption+TQString(" - KDiff3")); } if ( bLoadFiles ) @@ -506,18 +506,18 @@ void KDiff3App::init( bool bAuto, TotalDiffStatus* pTotalDiffStatus, bool bLoadF ( m_sd1.isValid() && m_sd2.isValid() && m_sd3.isValid() ) ) { - QString totalInfo; - if ( pTotalDiffStatus->bBinaryAEqB && pTotalDiffStatus->bBinaryAEqC ) + TQString totalInfo; + if ( pTotalDifftqStatus->bBinaryAEqB && pTotalDifftqStatus->bBinaryAEqC ) totalInfo += i18n("All input files are binary equal."); - else if ( pTotalDiffStatus->bTextAEqB && pTotalDiffStatus->bTextAEqC ) + else if ( pTotalDifftqStatus->bTextAEqB && pTotalDifftqStatus->bTextAEqC ) totalInfo += i18n("All input files contain the same text, but are not binary equal."); else { - if ( pTotalDiffStatus->bBinaryAEqB ) totalInfo += i18n("Files %1 and %2 are binary equal.\n" ).arg("A").arg("B"); - else if ( pTotalDiffStatus->bTextAEqB ) totalInfo += i18n("Files %1 and %2 have equal text, but are not binary equal. \n").arg("A").arg("B"); - if ( pTotalDiffStatus->bBinaryAEqC ) totalInfo += i18n("Files %1 and %2 are binary equal.\n" ).arg("A").arg("C"); - else if ( pTotalDiffStatus->bTextAEqC ) totalInfo += i18n("Files %1 and %2 have equal text, but are not binary equal. \n").arg("A").arg("C"); - if ( pTotalDiffStatus->bBinaryBEqC ) totalInfo += i18n("Files %1 and %2 are binary equal.\n" ).arg("B").arg("C"); - else if ( pTotalDiffStatus->bTextBEqC ) totalInfo += i18n("Files %1 and %2 have equal text, but are not binary equal. \n").arg("B").arg("C"); + if ( pTotalDifftqStatus->bBinaryAEqB ) totalInfo += i18n("Files %1 and %2 are binary equal.\n" ).tqarg("A").tqarg("B"); + else if ( pTotalDifftqStatus->bTextAEqB ) totalInfo += i18n("Files %1 and %2 have equal text, but are not binary equal. \n").tqarg("A").tqarg("B"); + if ( pTotalDifftqStatus->bBinaryAEqC ) totalInfo += i18n("Files %1 and %2 are binary equal.\n" ).tqarg("A").tqarg("C"); + else if ( pTotalDifftqStatus->bTextAEqC ) totalInfo += i18n("Files %1 and %2 have equal text, but are not binary equal. \n").tqarg("A").tqarg("C"); + if ( pTotalDifftqStatus->bBinaryBEqC ) totalInfo += i18n("Files %1 and %2 are binary equal.\n" ).tqarg("B").tqarg("C"); + else if ( pTotalDifftqStatus->bTextBEqC ) totalInfo += i18n("Files %1 and %2 have equal text, but are not binary equal. \n").tqarg("B").tqarg("C"); } if ( !totalInfo.isEmpty() ) @@ -533,7 +533,7 @@ void KDiff3App::init( bool bAuto, TotalDiffStatus* pTotalDiffStatus, bool bLoadF } } - QTimer::singleShot( 10, this, SLOT(slotAfterFirstPaint()) ); + TQTimer::singleShot( 10, this, TQT_SLOT(slotAfterFirstPaint()) ); if ( bVisibleMergeResultWindow && m_pMergeResultWindow ) { @@ -581,7 +581,7 @@ void KDiff3App::scrollDiffTextWindow( int deltaX, int deltaY ) m_pOverview->setRange( m_pDiffVScrollBar->value(), m_pDiffVScrollBar->pageStep() ); } if ( deltaX!= 0) - m_pHScrollBar->QScrollBar::setValue( m_pHScrollBar->value() + deltaX ); + m_pHScrollBar->TQScrollBar::setValue( m_pHScrollBar->value() + deltaX ); } void KDiff3App::scrollMergeResultWindow( int deltaX, int deltaY ) @@ -609,20 +609,20 @@ void KDiff3App::sourceMask( int srcMask, int enabledMask ) -// Function uses setMinSize( sizeHint ) before adding the widget. -// void addWidget(QBoxLayout* layout, QWidget* widget); +// Function uses setMinSize( tqsizeHint ) before adding the widget. +// void addWidget(TQBoxLayout* tqlayout, TQWidget* widget); template <class W, class L> -void addWidget( L* layout, W* widget) +void addWidget( L* tqlayout, W* widget) { - QSize s = widget->sizeHint(); - widget->setMinimumSize( QSize(max2(s.width(),0),max2(s.height(),0) ) ); - layout->addWidget( widget ); + TQSize s = widget->tqsizeHint(); + widget->setMinimumSize( TQSize(max2(s.width(),0),max2(s.height(),0) ) ); + tqlayout->addWidget( widget ); } void KDiff3App::initView() { // set the main widget here - QValueList<int> oldHeights; + TQValueList<int> oldHeights; if ( m_pDirectoryMergeSplitter->isVisible() ) { oldHeights = m_pMainSplitter->sizes(); @@ -633,27 +633,27 @@ void KDiff3App::initView() return; //delete m_pMainWidget; } - m_pMainWidget = new QWidget(m_pMainSplitter); + m_pMainWidget = new TQWidget(m_pMainSplitter); - QVBoxLayout* pVLayout = new QVBoxLayout(m_pMainWidget,0,0); + TQVBoxLayout* pVLayout = new TQVBoxLayout(m_pMainWidget,0,0); - QSplitter* pVSplitter = new QSplitter( m_pMainWidget ); + TQSplitter* pVSplitter = new TQSplitter( m_pMainWidget ); pVSplitter->setOrientation( Qt::Vertical ); pVLayout->addWidget( pVSplitter ); - QWidget* pDiffWindowFrame = new QWidget( pVSplitter ); - QHBoxLayout* pDiffHLayout = new QHBoxLayout( pDiffWindowFrame,0,0 ); + TQWidget* pDiffWindowFrame = new TQWidget( pVSplitter ); + TQHBoxLayout* pDiffHLayout = new TQHBoxLayout( pDiffWindowFrame,0,0 ); - m_pDiffWindowSplitter = new QSplitter( pDiffWindowFrame ); + m_pDiffWindowSplitter = new TQSplitter( pDiffWindowFrame ); m_pDiffWindowSplitter->setOrientation( m_pOptionDialog->m_bHorizDiffWindowSplitting ? Qt::Horizontal : Qt::Vertical ); pDiffHLayout->addWidget( m_pDiffWindowSplitter ); m_pOverview = new Overview( pDiffWindowFrame, m_pOptionDialog ); pDiffHLayout->addWidget(m_pOverview); - connect( m_pOverview, SIGNAL(setLine(int)), this, SLOT(setDiff3Line(int)) ); - //connect( m_pOverview, SIGNAL(afterFirstPaint()), this, SLOT(slotAfterFirstPaint())); + connect( m_pOverview, TQT_SIGNAL(setLine(int)), this, TQT_SLOT(setDiff3Line(int)) ); + //connect( m_pOverview, TQT_SIGNAL(afterFirstPaint()), this, TQT_SLOT(slotAfterFirstPaint())); - m_pDiffVScrollBar = new QScrollBar( Qt::Vertical, pDiffWindowFrame ); + m_pDiffVScrollBar = new TQScrollBar( Qt::Vertical, pDiffWindowFrame ); pDiffHLayout->addWidget( m_pDiffVScrollBar ); m_pDiffTextWindowFrame1 = new DiffTextWindowFrame( m_pDiffWindowSplitter, statusBar(), m_pOptionDialog, 1 ); @@ -662,15 +662,15 @@ void KDiff3App::initView() m_pDiffTextWindow1 = m_pDiffTextWindowFrame1->getDiffTextWindow(); m_pDiffTextWindow2 = m_pDiffTextWindowFrame2->getDiffTextWindow(); m_pDiffTextWindow3 = m_pDiffTextWindowFrame3->getDiffTextWindow(); - connect(m_pDiffTextWindowFrame1, SIGNAL(fileNameChanged(const QString&,int)), this, SLOT(slotFileNameChanged(const QString&,int))); - connect(m_pDiffTextWindowFrame2, SIGNAL(fileNameChanged(const QString&,int)), this, SLOT(slotFileNameChanged(const QString&,int))); - connect(m_pDiffTextWindowFrame3, SIGNAL(fileNameChanged(const QString&,int)), this, SLOT(slotFileNameChanged(const QString&,int))); + connect(m_pDiffTextWindowFrame1, TQT_SIGNAL(fileNameChanged(const TQString&,int)), this, TQT_SLOT(slotFileNameChanged(const TQString&,int))); + connect(m_pDiffTextWindowFrame2, TQT_SIGNAL(fileNameChanged(const TQString&,int)), this, TQT_SLOT(slotFileNameChanged(const TQString&,int))); + connect(m_pDiffTextWindowFrame3, TQT_SIGNAL(fileNameChanged(const TQString&,int)), this, TQT_SLOT(slotFileNameChanged(const TQString&,int))); // Merge window - m_pMergeWindowFrame = new QWidget( pVSplitter ); - QHBoxLayout* pMergeHLayout = new QHBoxLayout( m_pMergeWindowFrame,0,0 ); + m_pMergeWindowFrame = new TQWidget( pVSplitter ); + TQHBoxLayout* pMergeHLayout = new TQHBoxLayout( m_pMergeWindowFrame,0,0 ); - QVBoxLayout* pMergeVLayout = new QVBoxLayout(); + TQVBoxLayout* pMergeVLayout = new TQVBoxLayout(); pMergeHLayout->addLayout( pMergeVLayout, 1 ); m_pMergeResultWindowTitle = new WindowTitleWidget(m_pOptionDialog, m_pMergeWindowFrame); @@ -679,12 +679,12 @@ void KDiff3App::initView() m_pMergeResultWindow = new MergeResultWindow( m_pMergeWindowFrame, m_pOptionDialog, statusBar() ); pMergeVLayout->addWidget( m_pMergeResultWindow, 1 ); - m_pMergeVScrollBar = new QScrollBar( Qt::Vertical, m_pMergeWindowFrame ); + m_pMergeVScrollBar = new TQScrollBar( Qt::Vertical, m_pMergeWindowFrame ); pMergeHLayout->addWidget( m_pMergeVScrollBar ); autoAdvance->setEnabled(true); - QValueList<int> sizes = pVSplitter->sizes(); + TQValueList<int> sizes = pVSplitter->sizes(); int total = sizes[0] + sizes[1]; sizes[0]=total/2; sizes[1]=total/2; pVSplitter->setSizes( sizes ); @@ -692,68 +692,68 @@ void KDiff3App::initView() m_pMergeResultWindow->installEventFilter( this ); // for Cut/Copy/Paste-shortcuts m_pMergeResultWindow->installEventFilter( m_pMergeResultWindowTitle ); // for focus tracking - QHBoxLayout* pHScrollBarLayout = new QHBoxLayout( pVLayout ); + TQHBoxLayout* pHScrollBarLayout = new TQHBoxLayout( pVLayout ); m_pHScrollBar = new ReversibleScrollBar( Qt::Horizontal, m_pMainWidget, &m_pOptionDialog->m_bRightToLeftLanguage ); pHScrollBarLayout->addWidget( m_pHScrollBar ); - m_pCornerWidget = new QWidget( m_pMainWidget ); + m_pCornerWidget = new TQWidget( m_pMainWidget ); pHScrollBarLayout->addWidget( m_pCornerWidget ); - connect( m_pDiffVScrollBar, SIGNAL(valueChanged(int)), m_pOverview, SLOT(setFirstLine(int))); - connect( m_pDiffVScrollBar, SIGNAL(valueChanged(int)), m_pDiffTextWindow1, SLOT(setFirstLine(int))); - connect( m_pHScrollBar, SIGNAL(valueChanged2(int)), m_pDiffTextWindow1, SLOT(setFirstColumn(int))); - connect( m_pDiffTextWindow1, SIGNAL(newSelection()), this, SLOT(slotSelectionStart())); - connect( m_pDiffTextWindow1, SIGNAL(selectionEnd()), this, SLOT(slotSelectionEnd())); - connect( m_pDiffTextWindow1, SIGNAL(scroll(int,int)), this, SLOT(scrollDiffTextWindow(int,int))); + connect( m_pDiffVScrollBar, TQT_SIGNAL(valueChanged(int)), m_pOverview, TQT_SLOT(setFirstLine(int))); + connect( m_pDiffVScrollBar, TQT_SIGNAL(valueChanged(int)), m_pDiffTextWindow1, TQT_SLOT(setFirstLine(int))); + connect( m_pHScrollBar, TQT_SIGNAL(valueChanged2(int)), m_pDiffTextWindow1, TQT_SLOT(setFirstColumn(int))); + connect( m_pDiffTextWindow1, TQT_SIGNAL(newSelection()), this, TQT_SLOT(slotSelectionStart())); + connect( m_pDiffTextWindow1, TQT_SIGNAL(selectionEnd()), this, TQT_SLOT(slotSelectionEnd())); + connect( m_pDiffTextWindow1, TQT_SIGNAL(scroll(int,int)), this, TQT_SLOT(scrollDiffTextWindow(int,int))); m_pDiffTextWindow1->installEventFilter( this ); - connect( m_pDiffVScrollBar, SIGNAL(valueChanged(int)), m_pDiffTextWindow2, SLOT(setFirstLine(int))); - connect( m_pHScrollBar, SIGNAL(valueChanged2(int)), m_pDiffTextWindow2, SLOT(setFirstColumn(int))); - connect( m_pDiffTextWindow2, SIGNAL(newSelection()), this, SLOT(slotSelectionStart())); - connect( m_pDiffTextWindow2, SIGNAL(selectionEnd()), this, SLOT(slotSelectionEnd())); - connect( m_pDiffTextWindow2, SIGNAL(scroll(int,int)), this, SLOT(scrollDiffTextWindow(int,int))); + connect( m_pDiffVScrollBar, TQT_SIGNAL(valueChanged(int)), m_pDiffTextWindow2, TQT_SLOT(setFirstLine(int))); + connect( m_pHScrollBar, TQT_SIGNAL(valueChanged2(int)), m_pDiffTextWindow2, TQT_SLOT(setFirstColumn(int))); + connect( m_pDiffTextWindow2, TQT_SIGNAL(newSelection()), this, TQT_SLOT(slotSelectionStart())); + connect( m_pDiffTextWindow2, TQT_SIGNAL(selectionEnd()), this, TQT_SLOT(slotSelectionEnd())); + connect( m_pDiffTextWindow2, TQT_SIGNAL(scroll(int,int)), this, TQT_SLOT(scrollDiffTextWindow(int,int))); m_pDiffTextWindow2->installEventFilter( this ); - connect( m_pDiffVScrollBar, SIGNAL(valueChanged(int)), m_pDiffTextWindow3, SLOT(setFirstLine(int))); - connect( m_pHScrollBar, SIGNAL(valueChanged2(int)), m_pDiffTextWindow3, SLOT(setFirstColumn(int))); - connect( m_pDiffTextWindow3, SIGNAL(newSelection()), this, SLOT(slotSelectionStart())); - connect( m_pDiffTextWindow3, SIGNAL(selectionEnd()), this, SLOT(slotSelectionEnd())); - connect( m_pDiffTextWindow3, SIGNAL(scroll(int,int)), this, SLOT(scrollDiffTextWindow(int,int))); + connect( m_pDiffVScrollBar, TQT_SIGNAL(valueChanged(int)), m_pDiffTextWindow3, TQT_SLOT(setFirstLine(int))); + connect( m_pHScrollBar, TQT_SIGNAL(valueChanged2(int)), m_pDiffTextWindow3, TQT_SLOT(setFirstColumn(int))); + connect( m_pDiffTextWindow3, TQT_SIGNAL(newSelection()), this, TQT_SLOT(slotSelectionStart())); + connect( m_pDiffTextWindow3, TQT_SIGNAL(selectionEnd()), this, TQT_SLOT(slotSelectionEnd())); + connect( m_pDiffTextWindow3, TQT_SIGNAL(scroll(int,int)), this, TQT_SLOT(scrollDiffTextWindow(int,int))); m_pDiffTextWindow3->installEventFilter( this ); MergeResultWindow* p = m_pMergeResultWindow; - connect( m_pMergeVScrollBar, SIGNAL(valueChanged(int)), p, SLOT(setFirstLine(int))); - - connect( m_pHScrollBar, SIGNAL(valueChanged2(int)), p, SLOT(setFirstColumn(int))); - connect( p, SIGNAL(scroll(int,int)), this, SLOT(scrollMergeResultWindow(int,int))); - connect( p, SIGNAL(sourceMask(int,int)), this, SLOT(sourceMask(int,int))); - connect( p, SIGNAL( resizeSignal() ),this, SLOT(resizeMergeResultWindow())); - connect( p, SIGNAL( selectionEnd() ), this, SLOT( slotSelectionEnd() ) ); - connect( p, SIGNAL( newSelection() ), this, SLOT( slotSelectionStart() ) ); - connect( p, SIGNAL( modifiedChanged(bool) ), this, SLOT( slotOutputModified(bool) ) ); - connect( p, SIGNAL( modifiedChanged(bool) ), m_pMergeResultWindowTitle, SLOT( slotSetModified(bool) ) ); - connect( p, SIGNAL( updateAvailabilities() ), this, SLOT( slotUpdateAvailabilities() ) ); - connect( p, SIGNAL( showPopupMenu(const QPoint&) ), this, SLOT(showPopupMenu(const QPoint&))); - connect( p, SIGNAL( noRelevantChangesDetected() ), this, SLOT(slotNoRelevantChangesDetected())); + connect( m_pMergeVScrollBar, TQT_SIGNAL(valueChanged(int)), p, TQT_SLOT(setFirstLine(int))); + + connect( m_pHScrollBar, TQT_SIGNAL(valueChanged2(int)), p, TQT_SLOT(setFirstColumn(int))); + connect( p, TQT_SIGNAL(scroll(int,int)), this, TQT_SLOT(scrollMergeResultWindow(int,int))); + connect( p, TQT_SIGNAL(sourceMask(int,int)), this, TQT_SLOT(sourceMask(int,int))); + connect( p, TQT_SIGNAL( resizeSignal() ),this, TQT_SLOT(resizeMergeResultWindow())); + connect( p, TQT_SIGNAL( selectionEnd() ), this, TQT_SLOT( slotSelectionEnd() ) ); + connect( p, TQT_SIGNAL( newSelection() ), this, TQT_SLOT( slotSelectionStart() ) ); + connect( p, TQT_SIGNAL( modifiedChanged(bool) ), this, TQT_SLOT( slotOutputModified(bool) ) ); + connect( p, TQT_SIGNAL( modifiedChanged(bool) ), m_pMergeResultWindowTitle, TQT_SLOT( slotSetModified(bool) ) ); + connect( p, TQT_SIGNAL( updateAvailabilities() ), this, TQT_SLOT( slotUpdateAvailabilities() ) ); + connect( p, TQT_SIGNAL( showPopupMenu(const TQPoint&) ), this, TQT_SLOT(showPopupMenu(const TQPoint&))); + connect( p, TQT_SIGNAL( noRelevantChangesDetected() ), this, TQT_SLOT(slotNoRelevantChangesDetected())); sourceMask(0,0); - connect( p, SIGNAL(setFastSelectorRange(int,int)), m_pDiffTextWindow1, SLOT(setFastSelectorRange(int,int))); - connect( p, SIGNAL(setFastSelectorRange(int,int)), m_pDiffTextWindow2, SLOT(setFastSelectorRange(int,int))); - connect( p, SIGNAL(setFastSelectorRange(int,int)), m_pDiffTextWindow3, SLOT(setFastSelectorRange(int,int))); - connect(m_pDiffTextWindow1, SIGNAL(setFastSelectorLine(int)), p, SLOT(slotSetFastSelectorLine(int))); - connect(m_pDiffTextWindow2, SIGNAL(setFastSelectorLine(int)), p, SLOT(slotSetFastSelectorLine(int))); - connect(m_pDiffTextWindow3, SIGNAL(setFastSelectorLine(int)), p, SLOT(slotSetFastSelectorLine(int))); - connect(m_pDiffTextWindow1, SIGNAL(gotFocus()), p, SLOT(updateSourceMask())); - connect(m_pDiffTextWindow2, SIGNAL(gotFocus()), p, SLOT(updateSourceMask())); - connect(m_pDiffTextWindow3, SIGNAL(gotFocus()), p, SLOT(updateSourceMask())); - connect(m_pDirectoryMergeInfo, SIGNAL(gotFocus()), p, SLOT(updateSourceMask())); + connect( p, TQT_SIGNAL(setFastSelectorRange(int,int)), m_pDiffTextWindow1, TQT_SLOT(setFastSelectorRange(int,int))); + connect( p, TQT_SIGNAL(setFastSelectorRange(int,int)), m_pDiffTextWindow2, TQT_SLOT(setFastSelectorRange(int,int))); + connect( p, TQT_SIGNAL(setFastSelectorRange(int,int)), m_pDiffTextWindow3, TQT_SLOT(setFastSelectorRange(int,int))); + connect(m_pDiffTextWindow1, TQT_SIGNAL(setFastSelectorLine(int)), p, TQT_SLOT(slotSetFastSelectorLine(int))); + connect(m_pDiffTextWindow2, TQT_SIGNAL(setFastSelectorLine(int)), p, TQT_SLOT(slotSetFastSelectorLine(int))); + connect(m_pDiffTextWindow3, TQT_SIGNAL(setFastSelectorLine(int)), p, TQT_SLOT(slotSetFastSelectorLine(int))); + connect(m_pDiffTextWindow1, TQT_SIGNAL(gotFocus()), p, TQT_SLOT(updateSourceMask())); + connect(m_pDiffTextWindow2, TQT_SIGNAL(gotFocus()), p, TQT_SLOT(updateSourceMask())); + connect(m_pDiffTextWindow3, TQT_SIGNAL(gotFocus()), p, TQT_SLOT(updateSourceMask())); + connect(m_pDirectoryMergeInfo, TQT_SIGNAL(gotFocus()), p, TQT_SLOT(updateSourceMask())); - connect( m_pDiffTextWindow1, SIGNAL( resizeSignal(int,int) ),this, SLOT(resizeDiffTextWindow(int,int))); + connect( m_pDiffTextWindow1, TQT_SIGNAL( resizeSignal(int,int) ),this, TQT_SLOT(resizeDiffTextWindow(int,int))); // The following two connects cause the wordwrap to be recalced thrice, just to make sure. Better than forgetting one. - connect( m_pDiffTextWindow2, SIGNAL( resizeSignal(int,int) ),this, SLOT(slotRecalcWordWrap())); - connect( m_pDiffTextWindow3, SIGNAL( resizeSignal(int,int) ),this, SLOT(slotRecalcWordWrap())); + connect( m_pDiffTextWindow2, TQT_SIGNAL( resizeSignal(int,int) ),this, TQT_SLOT(slotRecalcWordWrap())); + connect( m_pDiffTextWindow3, TQT_SIGNAL( resizeSignal(int,int) ),this, TQT_SLOT(slotRecalcWordWrap())); m_pDiffTextWindow1->setFocus(); m_pMainWidget->setMinimumSize(50,50); @@ -827,51 +827,51 @@ void KDiff3App::slotAfterFirstPaint() slotUpdateAvailabilities(); } -void KDiff3App::resizeEvent(QResizeEvent* e) +void KDiff3App::resizeEvent(TQResizeEvent* e) { - QSplitter::resizeEvent(e); + TQSplitter::resizeEvent(e); if (m_pCornerWidget) m_pCornerWidget->setFixedSize( m_pDiffVScrollBar->width(), m_pHScrollBar->height() ); } -bool KDiff3App::eventFilter( QObject* o, QEvent* e ) +bool KDiff3App::eventFilter( TQObject* o, TQEvent* e ) { - if( o == m_pMergeResultWindow ) + if( TQT_BASE_OBJECT(o) == TQT_BASE_OBJECT(m_pMergeResultWindow) ) { - if ( e->type() == QEvent::KeyPress ) + if ( e->type() == TQEvent::KeyPress ) { // key press - QKeyEvent *k = (QKeyEvent*)e; - if (k->key()==Qt::Key_Insert && (k->state() & Qt::ControlButton)!=0 ) + TQKeyEvent *k = (TQKeyEvent*)e; + if (k->key()==TQt::Key_Insert && (k->state() & TQt::ControlButton)!=0 ) { slotEditCopy(); return true; } - if (k->key()==Qt::Key_Insert && (k->state() & Qt::ShiftButton)!=0 ) + if (k->key()==TQt::Key_Insert && (k->state() & TQt::ShiftButton)!=0 ) { slotEditPaste(); return true; } - if (k->key()==Qt::Key_Delete && (k->state() & Qt::ShiftButton)!=0 ) + if (k->key()==TQt::Key_Delete && (k->state() & TQt::ShiftButton)!=0 ) { slotEditCut(); return true; } } - return QSplitter::eventFilter( o, e ); // standard event processing + return TQSplitter::eventFilter( o, e ); // standard event processing } - if ( e->type() == QEvent::KeyPress ) // key press + if ( e->type() == TQEvent::KeyPress ) // key press { - QKeyEvent *k = (QKeyEvent*)e; + TQKeyEvent *k = (TQKeyEvent*)e; - bool bCtrl = (k->state() & Qt::ControlButton) != 0; - if (k->key()==Qt::Key_Insert && bCtrl ) + bool bCtrl = (k->state() & TQt::ControlButton) != 0; + if (k->key()==TQt::Key_Insert && bCtrl ) { slotEditCopy(); return true; } - if (k->key()==Qt::Key_Insert && (k->state() & Qt::ShiftButton)!=0 ) + if (k->key()==TQt::Key_Insert && (k->state() & TQt::ShiftButton)!=0 ) { slotEditPaste(); return true; @@ -881,18 +881,18 @@ bool KDiff3App::eventFilter( QObject* o, QEvent* e ) int pageSize = m_DTWHeight; switch( k->key() ) { - case Qt::Key_Down: if (!bCtrl) + case TQt::Key_Down: if (!bCtrl) ++deltaY; break; - case Qt::Key_Up: if (!bCtrl) --deltaY; break; - case Qt::Key_PageDown: if (!bCtrl) deltaY+=pageSize; break; - case Qt::Key_PageUp: if (!bCtrl) deltaY-=pageSize; break; - case Qt::Key_Left: if (!bCtrl) --deltaX; break; - case Qt::Key_Right: if (!bCtrl) ++deltaX; break; - case Qt::Key_Home: if ( bCtrl ) m_pDiffVScrollBar->setValue( 0 ); + case TQt::Key_Up: if (!bCtrl) --deltaY; break; + case TQt::Key_PageDown: if (!bCtrl) deltaY+=pageSize; break; + case TQt::Key_PageUp: if (!bCtrl) deltaY-=pageSize; break; + case TQt::Key_Left: if (!bCtrl) --deltaX; break; + case TQt::Key_Right: if (!bCtrl) ++deltaX; break; + case TQt::Key_Home: if ( bCtrl ) m_pDiffVScrollBar->setValue( 0 ); else m_pHScrollBar->setValue( 0 ); break; - case Qt::Key_End: if ( bCtrl ) m_pDiffVScrollBar->setValue( m_pDiffVScrollBar->maxValue() ); + case TQt::Key_End: if ( bCtrl ) m_pDiffVScrollBar->setValue( m_pDiffVScrollBar->maxValue() ); else m_pHScrollBar->setValue( m_pHScrollBar->maxValue() ); break; default: break; @@ -902,36 +902,36 @@ bool KDiff3App::eventFilter( QObject* o, QEvent* e ) return true; // eat event } - else if (e->type() == QEvent::Wheel ) // wheel event + else if (e->type() == TQEvent::Wheel ) // wheel event { - QWheelEvent *w = (QWheelEvent*)e; + TQWheelEvent *w = (TQWheelEvent*)e; w->accept(); int deltaX=0; int d=w->delta(); - int deltaY = -d/120 * QApplication::wheelScrollLines(); + int deltaY = -d/120 * TQApplication::wheelScrollLines(); scrollDiffTextWindow( deltaX, deltaY ); return true; } - else if (e->type() == QEvent::Drop ) + else if (e->type() == TQEvent::Drop ) { - QDropEvent* pDropEvent = static_cast<QDropEvent*>(e); + TQDropEvent* pDropEvent = static_cast<TQDropEvent*>(e); pDropEvent->accept(); - if ( QUriDrag::canDecode(pDropEvent) ) + if ( TQUriDrag::canDecode(pDropEvent) ) { #ifdef KREPLACEMENTS_H - QStringList stringList; - QUriDrag::decodeLocalFiles( pDropEvent, stringList ); + TQStringList stringList; + TQUriDrag::decodeLocalFiles( pDropEvent, stringList ); if ( canContinue() && !stringList.isEmpty() ) { raise(); - QString filename = stringList.first(); - if ( o == m_pDiffTextWindow1 ) m_sd1.setFilename( filename ); - else if ( o == m_pDiffTextWindow2 ) m_sd2.setFilename( filename ); - else if ( o == m_pDiffTextWindow3 ) m_sd3.setFilename( filename ); + TQString filename = stringList.first(); + if ( TQT_BASE_OBJECT(o) == TQT_BASE_OBJECT(m_pDiffTextWindow1) ) m_sd1.setFilename( filename ); + else if ( TQT_BASE_OBJECT(o) == TQT_BASE_OBJECT(m_pDiffTextWindow2) ) m_sd2.setFilename( filename ); + else if ( TQT_BASE_OBJECT(o) == TQT_BASE_OBJECT(m_pDiffTextWindow3) ) m_sd3.setFilename( filename ); init(); } #else @@ -941,30 +941,30 @@ bool KDiff3App::eventFilter( QObject* o, QEvent* e ) { raise(); FileAccess fa( urlList.first().url() ); - if ( o == m_pDiffTextWindow1 ) m_sd1.setFileAccess( fa ); - else if ( o == m_pDiffTextWindow2 ) m_sd2.setFileAccess( fa ); - else if ( o == m_pDiffTextWindow3 ) m_sd3.setFileAccess( fa ); + if ( TQT_BASE_OBJECT(o) == TQT_BASE_OBJECT(m_pDiffTextWindow1) ) m_sd1.setFileAccess( fa ); + else if ( TQT_BASE_OBJECT(o) == TQT_BASE_OBJECT(m_pDiffTextWindow2) ) m_sd2.setFileAccess( fa ); + else if ( TQT_BASE_OBJECT(o) == TQT_BASE_OBJECT(m_pDiffTextWindow3) ) m_sd3.setFileAccess( fa ); init(); } #endif } - else if ( QTextDrag::canDecode(pDropEvent) ) + else if ( TQTextDrag::canDecode(pDropEvent) ) { - QString text; - bool bDecodeSuccess = QTextDrag::decode( pDropEvent, text ); + TQString text; + bool bDecodeSuccess = TQTextDrag::decode( pDropEvent, text ); if ( bDecodeSuccess && canContinue() ) { raise(); - if ( o == m_pDiffTextWindow1 ) m_sd1.setData(text); - else if ( o == m_pDiffTextWindow2 ) m_sd2.setData(text); - else if ( o == m_pDiffTextWindow3 ) m_sd3.setData(text); + if ( TQT_BASE_OBJECT(o) == TQT_BASE_OBJECT(m_pDiffTextWindow1) ) m_sd1.setData(text); + else if ( TQT_BASE_OBJECT(o) == TQT_BASE_OBJECT(m_pDiffTextWindow2) ) m_sd2.setData(text); + else if ( TQT_BASE_OBJECT(o) == TQT_BASE_OBJECT(m_pDiffTextWindow3) ) m_sd3.setData(text); init(); } } return true; } - return QSplitter::eventFilter( o, e ); // standard event processing + return TQSplitter::eventFilter( o, e ); // standard event processing } @@ -990,22 +990,22 @@ void KDiff3App::slotFileOpen() { OpenDialog d(this, - QDir::convertSeparators( m_bDirCompare ? m_pDirectoryMergeWindow->getDirNameA() : m_sd1.isFromBuffer() ? QString("") : m_sd1.getAliasName() ), - QDir::convertSeparators( m_bDirCompare ? m_pDirectoryMergeWindow->getDirNameB() : m_sd2.isFromBuffer() ? QString("") : m_sd2.getAliasName() ), - QDir::convertSeparators( m_bDirCompare ? m_pDirectoryMergeWindow->getDirNameC() : m_sd3.isFromBuffer() ? QString("") : m_sd3.getAliasName() ), + TQDir::convertSeparators( m_bDirCompare ? m_pDirectoryMergeWindow->getDirNameA() : m_sd1.isFromBuffer() ? TQString("") : m_sd1.getAliasName() ), + TQDir::convertSeparators( m_bDirCompare ? m_pDirectoryMergeWindow->getDirNameB() : m_sd2.isFromBuffer() ? TQString("") : m_sd2.getAliasName() ), + TQDir::convertSeparators( m_bDirCompare ? m_pDirectoryMergeWindow->getDirNameC() : m_sd3.isFromBuffer() ? TQString("") : m_sd3.getAliasName() ), m_bDirCompare ? ! m_pDirectoryMergeWindow->getDirNameDest().isEmpty() : !m_outputFilename.isEmpty(), - QDir::convertSeparators( m_bDirCompare ? m_pDirectoryMergeWindow->getDirNameDest() : m_bDefaultFilename ? QString("") : m_outputFilename ), - SLOT(slotConfigure()), m_pOptionDialog ); + TQDir::convertSeparators( m_bDirCompare ? m_pDirectoryMergeWindow->getDirNameDest() : m_bDefaultFilename ? TQString("") : m_outputFilename ), + TQT_SLOT(slotConfigure()), m_pOptionDialog ); /*OpenDialog d(this, - m_sd1.isFromBuffer() ? QString("") : m_sd1.getAliasName(), - m_sd2.isFromBuffer() ? QString("") : m_sd2.getAliasName(), - m_sd3.isFromBuffer() ? QString("") : m_sd3.getAliasName(), + m_sd1.isFromBuffer() ? TQString("") : m_sd1.getAliasName(), + m_sd2.isFromBuffer() ? TQString("") : m_sd2.getAliasName(), + m_sd3.isFromBuffer() ? TQString("") : m_sd3.getAliasName(), !m_outputFilename.isEmpty(), - m_bDefaultFilename ? QString("") : m_outputFilename, - SLOT(slotConfigure()), m_pOptionDialog );*/ + m_bDefaultFilename ? TQString("") : m_outputFilename, + TQT_SLOT(slotConfigure()), m_pOptionDialog );*/ int status = d.exec(); - if ( status == QDialog::Accepted ) + if ( status == TQDialog::Accepted ) { m_sd1.setFilename( d.m_pLineA->currentText() ); m_sd2.setFilename( d.m_pLineB->currentText() ); @@ -1049,7 +1049,7 @@ void KDiff3App::slotFileOpen() ! m_sd2.isEmpty() && !m_sd2.hasData() || ! m_sd3.isEmpty() && !m_sd3.hasData() ) { - QString text( i18n("Opening of these files failed:") ); + TQString text( i18n("Opening of these files failed:") ); text += "\n\n"; if ( ! m_sd1.isEmpty() && !m_sd1.hasData() ) text += " - " + m_sd1.getAliasName() + "\n"; @@ -1070,8 +1070,8 @@ void KDiff3App::slotFileOpen() slotStatusMsg(i18n("Ready.")); } -void KDiff3App::slotFileOpen2(QString fn1, QString fn2, QString fn3, QString ofn, - QString an1, QString an2, QString an3, TotalDiffStatus* pTotalDiffStatus ) +void KDiff3App::slotFileOpen2(TQString fn1, TQString fn2, TQString fn3, TQString ofn, + TQString an1, TQString an2, TQString an3, TotalDifftqStatus* pTotalDifftqStatus ) { if ( !canContinue() ) return; @@ -1111,16 +1111,16 @@ void KDiff3App::slotFileOpen2(QString fn1, QString fn2, QString fn3, QString ofn else { m_bDirCompare = bDirCompare; // Don't allow this to change here. - init( false, pTotalDiffStatus ); + init( false, pTotalDifftqStatus ); - if ( pTotalDiffStatus!=0 ) + if ( pTotalDifftqStatus!=0 ) return; if ( ! m_sd1.isEmpty() && ! m_sd1.hasData() || ! m_sd2.isEmpty() && ! m_sd2.hasData() || ! m_sd3.isEmpty() && ! m_sd3.hasData() ) { - QString text( i18n("Opening of these files failed:") ); + TQString text( i18n("Opening of these files failed:") ); text += "\n\n"; if ( ! m_sd1.isEmpty() && !m_sd1.hasData() ) text += " - " + m_sd1.getAliasName() + "\n"; @@ -1143,14 +1143,14 @@ void KDiff3App::slotFileOpen2(QString fn1, QString fn2, QString fn3, QString ofn } -void KDiff3App::slotFileNameChanged(const QString& fileName, int winIdx) +void KDiff3App::slotFileNameChanged(const TQString& fileName, int winIdx) { - QString fn1 = m_sd1.getFilename(); - QString an1 = m_sd1.getAliasName(); - QString fn2 = m_sd2.getFilename(); - QString an2 = m_sd2.getAliasName(); - QString fn3 = m_sd3.getFilename(); - QString an3 = m_sd3.getAliasName(); + TQString fn1 = m_sd1.getFilename(); + TQString an1 = m_sd1.getAliasName(); + TQString fn2 = m_sd2.getFilename(); + TQString an2 = m_sd2.getAliasName(); + TQString fn3 = m_sd3.getFilename(); + TQString an3 = m_sd3.getAliasName(); if (winIdx==1) { fn1 = fileName; an1 = ""; } if (winIdx==2) { fn2 = fileName; an2 = ""; } if (winIdx==3) { fn3 = fileName; an3 = ""; } @@ -1163,7 +1163,7 @@ void KDiff3App::slotEditCut() { slotStatusMsg(i18n("Cutting selection...")); - QString s; + TQString s; if ( m_pMergeResultWindow!=0 ) { s = m_pMergeResultWindow->getSelection(); @@ -1174,7 +1174,7 @@ void KDiff3App::slotEditCut() if ( !s.isNull() ) { - QApplication::clipboard()->setText( s, QClipboard::Clipboard ); + TQApplication::tqclipboard()->setText( s, TQClipboard::Clipboard ); } slotStatusMsg(i18n("Ready.")); @@ -1183,14 +1183,14 @@ void KDiff3App::slotEditCut() void KDiff3App::slotEditCopy() { slotStatusMsg(i18n("Copying selection to clipboard...")); - QString s; + TQString s; if ( m_pDiffTextWindow1!=0 ) s = m_pDiffTextWindow1->getSelection(); if ( s.isNull() && m_pDiffTextWindow2!=0 ) s = m_pDiffTextWindow2->getSelection(); if ( s.isNull() && m_pDiffTextWindow3!=0 ) s = m_pDiffTextWindow3->getSelection(); if ( s.isNull() && m_pMergeResultWindow!=0 ) s = m_pMergeResultWindow->getSelection(); if ( !s.isNull() ) { - QApplication::clipboard()->setText( s, QClipboard::Clipboard ); + TQApplication::tqclipboard()->setText( s, TQClipboard::Clipboard ); } slotStatusMsg(i18n("Ready.")); @@ -1208,17 +1208,17 @@ void KDiff3App::slotEditPaste() { if ( m_pDiffTextWindow1->hasFocus() ) { - m_sd1.setData( QApplication::clipboard()->text(QClipboard::Clipboard) ); + m_sd1.setData( TQApplication::tqclipboard()->text(TQClipboard::Clipboard) ); init(); } else if ( m_pDiffTextWindow2->hasFocus() ) { - m_sd2.setData( QApplication::clipboard()->text(QClipboard::Clipboard) ); + m_sd2.setData( TQApplication::tqclipboard()->text(TQClipboard::Clipboard) ); init(); } else if ( m_pDiffTextWindow3->hasFocus() ) { - m_sd3.setData( QApplication::clipboard()->text(QClipboard::Clipboard) ); + m_sd3.setData( TQApplication::tqclipboard()->text(TQClipboard::Clipboard) ); init(); } } @@ -1296,7 +1296,7 @@ void KDiff3App::choose( int choice ) if ( autoAdvance->isChecked() ) { m_bTimerBlock = true; - QTimer::singleShot( m_pOptionDialog->m_autoAdvanceDelay, this, SLOT( slotGoNextUnsolvedConflict() ) ); + TQTimer::singleShot( m_pOptionDialog->m_autoAdvanceDelay, this, TQT_SLOT( slotGoNextUnsolvedConflict() ) ); } } } @@ -1396,7 +1396,7 @@ void KDiff3App::slotJoinDiffs() void KDiff3App::slotConfigure() { m_pOptionDialog->setState(); - m_pOptionDialog->incInitialSize ( QSize(0,40) ); + m_pOptionDialog->incInitialSize ( TQSize(0,40) ); m_pOptionDialog->exec(); slotRefresh(); } @@ -1447,16 +1447,16 @@ void KDiff3App::slotSelectionStart() //editCopy->setEnabled( false ); //editCut->setEnabled( false ); - const QObject* s = sender(); - if (m_pDiffTextWindow1 && s!=m_pDiffTextWindow1) m_pDiffTextWindow1->resetSelection(); - if (m_pDiffTextWindow2 && s!=m_pDiffTextWindow2) m_pDiffTextWindow2->resetSelection(); - if (m_pDiffTextWindow3 && s!=m_pDiffTextWindow3) m_pDiffTextWindow3->resetSelection(); - if (m_pMergeResultWindow && s!=m_pMergeResultWindow) m_pMergeResultWindow->resetSelection(); + const TQObject* s = TQT_TQOBJECT(const_cast<TQT_BASE_OBJECT_NAME*>(sender())); + if (m_pDiffTextWindow1 && TQT_BASE_OBJECT_CONST(s)!=TQT_BASE_OBJECT(m_pDiffTextWindow1)) m_pDiffTextWindow1->resetSelection(); + if (m_pDiffTextWindow2 && TQT_BASE_OBJECT_CONST(s)!=TQT_BASE_OBJECT(m_pDiffTextWindow2)) m_pDiffTextWindow2->resetSelection(); + if (m_pDiffTextWindow3 && TQT_BASE_OBJECT_CONST(s)!=TQT_BASE_OBJECT(m_pDiffTextWindow3)) m_pDiffTextWindow3->resetSelection(); + if (m_pMergeResultWindow && TQT_BASE_OBJECT_CONST(s)!=TQT_BASE_OBJECT(m_pMergeResultWindow)) m_pMergeResultWindow->resetSelection(); } void KDiff3App::slotSelectionEnd() { - //const QObject* s = sender(); + //const TQObject* s = sender(); //editCopy->setEnabled(true); //editCut->setEnabled( s==m_pMergeResultWindow ); if ( m_pOptionDialog->m_bAutoCopySelection ) @@ -1465,18 +1465,18 @@ void KDiff3App::slotSelectionEnd() } else { - QClipboard *clipBoard = QApplication::clipboard(); + TQClipboard *clipBoard = TQApplication::tqclipboard(); if (clipBoard->supportsSelection ()) { - QString s; + TQString s; if ( m_pDiffTextWindow1!=0 ) s = m_pDiffTextWindow1->getSelection(); if ( s.isNull() && m_pDiffTextWindow2!=0 ) s = m_pDiffTextWindow2->getSelection(); if ( s.isNull() && m_pDiffTextWindow3!=0 ) s = m_pDiffTextWindow3->getSelection(); if ( s.isNull() && m_pMergeResultWindow!=0 ) s = m_pMergeResultWindow->getSelection(); if ( !s.isNull() ) { - clipBoard->setText( s, QClipboard::Selection ); + clipBoard->setText( s, TQClipboard::Selection ); } } } @@ -1484,7 +1484,7 @@ void KDiff3App::slotSelectionEnd() void KDiff3App::slotClipboardChanged() { - QString s = QApplication::clipboard()->text(); + TQString s = TQApplication::tqclipboard()->text(); //editPaste->setEnabled(!s.isEmpty()); } @@ -1832,7 +1832,7 @@ void KDiff3App::slotEditFind() m_pFindDialog->currentPos = 0; m_pFindDialog->currentWindow = 1; - if ( QDialog::Accepted == m_pFindDialog->exec() ) + if ( TQDialog::Accepted == m_pFindDialog->exec() ) { slotEditFindNext(); } @@ -1840,7 +1840,7 @@ void KDiff3App::slotEditFind() void KDiff3App::slotEditFindNext() { - QString s = m_pFindDialog->m_pSearchString->text(); + TQString s = m_pFindDialog->m_pSearchString->text(); if ( s.isEmpty() ) { slotEditFind(); @@ -1969,13 +1969,13 @@ void KDiff3App::slotMergeCurrentFile() void KDiff3App::slotWinFocusNext() { - QWidget* focus = qApp->focusWidget(); + TQWidget* focus = tqApp->tqfocusWidget(); if ( focus == m_pDirectoryMergeWindow && m_pDirectoryMergeWindow->isVisible() && ! dirShowBoth->isChecked() ) { slotDirViewToggle(); } - std::list<QWidget*> visibleWidgetList; + std::list<TQWidget*> visibleWidgetList; if ( m_pDiffTextWindow1 && m_pDiffTextWindow1->isVisible() ) visibleWidgetList.push_back(m_pDiffTextWindow1); if ( m_pDiffTextWindow2 && m_pDiffTextWindow2->isVisible() ) visibleWidgetList.push_back(m_pDiffTextWindow2); if ( m_pDiffTextWindow3 && m_pDiffTextWindow3->isVisible() ) visibleWidgetList.push_back(m_pDiffTextWindow3); @@ -1983,7 +1983,7 @@ void KDiff3App::slotWinFocusNext() if ( m_bDirCompare /*m_pDirectoryMergeWindow->isVisible()*/ ) visibleWidgetList.push_back(m_pDirectoryMergeWindow); //if ( m_pDirectoryMergeInfo->isVisible() ) visibleWidgetList.push_back(m_pDirectoryMergeInfo->getInfoList()); - std::list<QWidget*>::iterator i = std::find( visibleWidgetList.begin(), visibleWidgetList.end(), focus); + std::list<TQWidget*>::iterator i = std::find( visibleWidgetList.begin(), visibleWidgetList.end(), focus); ++i; if ( i==visibleWidgetList.end() ) i = visibleWidgetList.begin(); @@ -1999,13 +1999,13 @@ void KDiff3App::slotWinFocusNext() void KDiff3App::slotWinFocusPrev() { - QWidget* focus = qApp->focusWidget(); + TQWidget* focus = tqApp->tqfocusWidget(); if ( focus == m_pDirectoryMergeWindow && m_pDirectoryMergeWindow->isVisible() && ! dirShowBoth->isChecked() ) { slotDirViewToggle(); } - std::list<QWidget*> visibleWidgetList; + std::list<TQWidget*> visibleWidgetList; if ( m_pDiffTextWindow1 && m_pDiffTextWindow1->isVisible() ) visibleWidgetList.push_back(m_pDiffTextWindow1); if ( m_pDiffTextWindow2 && m_pDiffTextWindow2->isVisible() ) visibleWidgetList.push_back(m_pDiffTextWindow2); if ( m_pDiffTextWindow3 && m_pDiffTextWindow3->isVisible() ) visibleWidgetList.push_back(m_pDiffTextWindow3); @@ -2013,7 +2013,7 @@ void KDiff3App::slotWinFocusPrev() if (m_bDirCompare /* m_pDirectoryMergeWindow->isVisible() */ ) visibleWidgetList.push_back(m_pDirectoryMergeWindow); //if ( m_pDirectoryMergeInfo->isVisible() ) visibleWidgetList.push_back(m_pDirectoryMergeInfo->getInfoList()); - std::list<QWidget*>::iterator i = std::find( visibleWidgetList.begin(), visibleWidgetList.end(), focus); + std::list<TQWidget*>::iterator i = std::find( visibleWidgetList.begin(), visibleWidgetList.end(), focus); if ( i==visibleWidgetList.begin() ) i=visibleWidgetList.end(); --i; @@ -2074,7 +2074,7 @@ void KDiff3App::slotNoRelevantChangesDetected() //KMessageBox::information( this, "No relevant changes detected", "KDiff3" ); if (!m_pOptionDialog->m_IrrelevantMergeCmd.isEmpty()) { - QString cmd = m_pOptionDialog->m_IrrelevantMergeCmd + " \"" + m_sd1.getAliasName()+ "\" \"" + m_sd2.getAliasName() + "\" \"" + m_sd3.getAliasName(); + TQString cmd = m_pOptionDialog->m_IrrelevantMergeCmd + " \"" + m_sd1.getAliasName()+ "\" \"" + m_sd2.getAliasName() + "\" \"" + m_sd3.getAliasName(); ::system( cmd.local8Bit() ); } } diff --git a/src/smalldialogs.cpp b/src/smalldialogs.cpp index d748611..006ffcf 100644 --- a/src/smalldialogs.cpp +++ b/src/smalldialogs.cpp @@ -21,17 +21,17 @@ #include "smalldialogs.h" #include "optiondialog.h" -#include <qcombobox.h> -#include <qcheckbox.h> -#include <qlineedit.h> -#include <qlabel.h> -#include <qlayout.h> -#include <qpushbutton.h> -#include <qdragobject.h> -#include <qregexp.h> -#include <qtooltip.h> -#include <qpopupmenu.h> -#include <qcursor.h> +#include <tqcombobox.h> +#include <tqcheckbox.h> +#include <tqlineedit.h> +#include <tqlabel.h> +#include <tqlayout.h> +#include <tqpushbutton.h> +#include <tqdragobject.h> +#include <tqregexp.h> +#include <tqtooltip.h> +#include <tqpopupmenu.h> +#include <tqcursor.h> #include <kfiledialog.h> @@ -40,105 +40,105 @@ // OpenDialog ************************************************************** OpenDialog::OpenDialog( - QWidget* pParent, const QString& n1, const QString& n2, const QString& n3, - bool bMerge, const QString& outputName, const char* slotConfigure, OptionDialog* pOptions ) -: QDialog( pParent, "OpenDialog", true /*modal*/ ) + TQWidget* pParent, const TQString& n1, const TQString& n2, const TQString& n3, + bool bMerge, const TQString& outputName, const char* slotConfigure, OptionDialog* pOptions ) +: TQDialog( pParent, "OpenDialog", true /*modal*/ ) { m_pOptions = pOptions; - QVBoxLayout* v = new QVBoxLayout( this, 5 ); - QGridLayout* h = new QGridLayout( v, 5, 4, 5 ); + TQVBoxLayout* v = new TQVBoxLayout( this, 5 ); + TQGridLayout* h = new TQGridLayout( v, 5, 4, 5 ); h->setColStretch( 1, 10 ); - QLabel* label = new QLabel( i18n("A (Base):"), this ); + TQLabel* label = new TQLabel( i18n("A (Base):"), this ); - m_pLineA = new QComboBox( true, this ); + m_pLineA = new TQComboBox( true, this ); m_pLineA->insertStringList( m_pOptions->m_recentAFiles ); m_pLineA->setEditText( KURL(n1).prettyURL() ); m_pLineA->setMinimumSize( 200, m_pLineA->size().height() ); - QPushButton * button = new QPushButton( i18n("File..."), this ); - connect( button, SIGNAL(clicked()), this, SLOT( selectFileA() ) ); - QPushButton * button2 = new QPushButton( i18n("Dir..."), this ); - connect( button2, SIGNAL(clicked()), this, SLOT( selectDirA() ) ); - connect( m_pLineA, SIGNAL(textChanged(const QString&)), this, SLOT(inputFilenameChanged() ) ); + TQPushButton * button = new TQPushButton( i18n("File..."), this ); + connect( button, TQT_SIGNAL(clicked()), this, TQT_SLOT( selectFileA() ) ); + TQPushButton * button2 = new TQPushButton( i18n("Dir..."), this ); + connect( button2, TQT_SIGNAL(clicked()), this, TQT_SLOT( selectDirA() ) ); + connect( m_pLineA, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(inputFilenameChanged() ) ); h->addWidget( label, 0, 0 ); h->addWidget( m_pLineA, 0, 1 ); h->addWidget( button, 0, 2 ); h->addWidget( button2, 0, 3 ); - label = new QLabel( "B:", this ); - m_pLineB = new QComboBox( true, this ); + label = new TQLabel( "B:", this ); + m_pLineB = new TQComboBox( true, this ); m_pLineB->insertStringList( m_pOptions->m_recentBFiles ); m_pLineB->setEditText( KURL(n2).prettyURL() ); m_pLineB->setMinimumSize( 200, m_pLineB->size().height() ); - button = new QPushButton( i18n("File..."), this ); - connect( button, SIGNAL(clicked()), this, SLOT( selectFileB() ) ); - button2 = new QPushButton( i18n("Dir..."), this ); - connect( button2, SIGNAL(clicked()), this, SLOT( selectDirB() ) ); - connect( m_pLineB, SIGNAL(textChanged(const QString&)), this, SLOT(inputFilenameChanged() ) ); + button = new TQPushButton( i18n("File..."), this ); + connect( button, TQT_SIGNAL(clicked()), this, TQT_SLOT( selectFileB() ) ); + button2 = new TQPushButton( i18n("Dir..."), this ); + connect( button2, TQT_SIGNAL(clicked()), this, TQT_SLOT( selectDirB() ) ); + connect( m_pLineB, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(inputFilenameChanged() ) ); h->addWidget( label, 1, 0 ); h->addWidget( m_pLineB, 1, 1 ); h->addWidget( button, 1, 2 ); h->addWidget( button2, 1, 3 ); - label = new QLabel( i18n("C (Optional):"), this ); - m_pLineC= new QComboBox( true, this ); + label = new TQLabel( i18n("C (Optional):"), this ); + m_pLineC= new TQComboBox( true, this ); m_pLineC->insertStringList( m_pOptions->m_recentCFiles ); m_pLineC->setEditText( KURL(n3).prettyURL() ); m_pLineC->setMinimumSize( 200, m_pLineC->size().height() ); - button = new QPushButton( i18n("File..."), this ); - connect( button, SIGNAL(clicked()), this, SLOT( selectFileC() ) ); - button2 = new QPushButton( i18n("Dir..."), this ); - connect( button2, SIGNAL(clicked()), this, SLOT( selectDirC() ) ); - connect( m_pLineC, SIGNAL(textChanged(const QString&)), this, SLOT(inputFilenameChanged() ) ); + button = new TQPushButton( i18n("File..."), this ); + connect( button, TQT_SIGNAL(clicked()), this, TQT_SLOT( selectFileC() ) ); + button2 = new TQPushButton( i18n("Dir..."), this ); + connect( button2, TQT_SIGNAL(clicked()), this, TQT_SLOT( selectDirC() ) ); + connect( m_pLineC, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(inputFilenameChanged() ) ); h->addWidget( label, 2, 0 ); h->addWidget( m_pLineC, 2, 1 ); h->addWidget( button, 2, 2 ); h->addWidget( button2, 2, 3 ); - m_pMerge = new QCheckBox( i18n("Merge"), this ); + m_pMerge = new TQCheckBox( i18n("Merge"), this ); h->addWidget( m_pMerge, 3, 0 ); - QHBoxLayout* hl = new QHBoxLayout(); + TQHBoxLayout* hl = new TQHBoxLayout(); h->addLayout( hl, 3, 1 ); hl->addStretch(2); - button = new QPushButton(i18n("Swap/Copy Names ..."), this); + button = new TQPushButton(i18n("Swap/Copy Names ..."), this); //button->setToggleButton(false); hl->addWidget( button ); - QPopupMenu* m = new QPopupMenu(this); + TQPopupMenu* m = new TQPopupMenu(this); int id=0; - m->insertItem( i18n("Swap %1<->%2").arg("A").arg("B"), id++ ); - m->insertItem( i18n("Swap %1<->%2").arg("B").arg("C"), id++ ); - m->insertItem( i18n("Swap %1<->%2").arg("C").arg("A"), id++ ); - m->insertItem( i18n("Copy %1->Output").arg("A"), id++ ); - m->insertItem( i18n("Copy %1->Output").arg("B"), id++ ); - m->insertItem( i18n("Copy %1->Output").arg("C"), id++ ); - m->insertItem( i18n("Swap %1<->Output").arg("A"), id++ ); - m->insertItem( i18n("Swap %1<->Output").arg("B"), id++ ); - m->insertItem( i18n("Swap %1<->Output").arg("C"), id++ ); - connect( m, SIGNAL(activated(int)), this, SLOT(slotSwapCopyNames(int))); + m->insertItem( i18n("Swap %1<->%2").tqarg("A").tqarg("B"), id++ ); + m->insertItem( i18n("Swap %1<->%2").tqarg("B").tqarg("C"), id++ ); + m->insertItem( i18n("Swap %1<->%2").tqarg("C").tqarg("A"), id++ ); + m->insertItem( i18n("Copy %1->Output").tqarg("A"), id++ ); + m->insertItem( i18n("Copy %1->Output").tqarg("B"), id++ ); + m->insertItem( i18n("Copy %1->Output").tqarg("C"), id++ ); + m->insertItem( i18n("Swap %1<->Output").tqarg("A"), id++ ); + m->insertItem( i18n("Swap %1<->Output").tqarg("B"), id++ ); + m->insertItem( i18n("Swap %1<->Output").tqarg("C"), id++ ); + connect( m, TQT_SIGNAL(activated(int)), this, TQT_SLOT(slotSwapCopyNames(int))); button->setPopup(m); hl->addStretch(2); - label = new QLabel( i18n("Output (optional):"), this ); - m_pLineOut = new QComboBox( true, this ); + label = new TQLabel( i18n("Output (optional):"), this ); + m_pLineOut = new TQComboBox( true, this ); m_pLineOut->insertStringList( m_pOptions->m_recentOutputFiles ); m_pLineOut->setEditText( KURL(outputName).prettyURL() ); m_pLineOut->setMinimumSize( 200, m_pLineOut->size().height() ); - button = new QPushButton( i18n("File..."), this ); - connect( button, SIGNAL(clicked()), this, SLOT( selectOutputName() ) ); - button2 = new QPushButton( i18n("Dir..."), this ); - connect( button2, SIGNAL(clicked()), this, SLOT( selectOutputDir() ) ); - connect( m_pMerge, SIGNAL(stateChanged(int)), this, SLOT(internalSlot(int)) ); - connect( this, SIGNAL(internalSignal(bool)), m_pLineOut, SLOT(setEnabled(bool)) ); - connect( this, SIGNAL(internalSignal(bool)), button, SLOT(setEnabled(bool)) ); - connect( this, SIGNAL(internalSignal(bool)), button2, SLOT(setEnabled(bool)) ); + button = new TQPushButton( i18n("File..."), this ); + connect( button, TQT_SIGNAL(clicked()), this, TQT_SLOT( selectOutputName() ) ); + button2 = new TQPushButton( i18n("Dir..."), this ); + connect( button2, TQT_SIGNAL(clicked()), this, TQT_SLOT( selectOutputDir() ) ); + connect( m_pMerge, TQT_SIGNAL(stateChanged(int)), this, TQT_SLOT(internalSlot(int)) ); + connect( this, TQT_SIGNAL(internalSignal(bool)), m_pLineOut, TQT_SLOT(setEnabled(bool)) ); + connect( this, TQT_SIGNAL(internalSignal(bool)), button, TQT_SLOT(setEnabled(bool)) ); + connect( this, TQT_SIGNAL(internalSignal(bool)), button2, TQT_SLOT(setEnabled(bool)) ); m_pMerge->setChecked( !bMerge ); m_pMerge->setChecked( bMerge ); @@ -153,24 +153,24 @@ OpenDialog::OpenDialog( h->addColSpacing( 1, 200 ); - QHBoxLayout* l = new QHBoxLayout( v, 5 ); + TQHBoxLayout* l = new TQHBoxLayout( v, 5 ); - button = new QPushButton( i18n("Configure..."), this ); - connect( button, SIGNAL(clicked()), pParent, slotConfigure ); + button = new TQPushButton( i18n("Configure..."), this ); + connect( button, TQT_SIGNAL(clicked()), pParent, slotConfigure ); l->addWidget( button, 1 ); l->addStretch(1); - button = new QPushButton( i18n("&OK"), this ); + button = new TQPushButton( i18n("&OK"), this ); button->setDefault( true ); - connect( button, SIGNAL(clicked()), this, SLOT( accept() ) ); + connect( button, TQT_SIGNAL(clicked()), this, TQT_SLOT( accept() ) ); l->addWidget( button, 1 ); - button = new QPushButton( i18n("&Cancel"), this ); - connect( button, SIGNAL(clicked()), this, SLOT( reject() ) ); + button = new TQPushButton( i18n("&Cancel"), this ); + connect( button, TQT_SIGNAL(clicked()), this, TQT_SLOT( reject() ) ); l->addWidget( button,1 ); - QSize sh = sizeHint(); + TQSize sh = tqsizeHint(); setFixedHeight( sh.height() ); m_bInputFileNameChanged = false; @@ -185,23 +185,23 @@ OpenDialog::OpenDialog( // Eventfilter: Only needed under Windows. // Without this, files dropped in the line edit have URL-encoding. // This eventfilter decodes the filenames as needed by KDiff3. -bool OpenDialog::eventFilter(QObject* o, QEvent* e) +bool OpenDialog::eventFilter(TQObject* o, TQEvent* e) { - if (e->type()==QEvent::Drop) + if (e->type()==TQEvent::Drop) { - QDropEvent* d = static_cast<QDropEvent*>(e); + TQDropEvent* d = static_cast<TQDropEvent*>(e); - if ( !QUriDrag::canDecode( d ) ) { + if ( !TQUriDrag::canDecode( d ) ) { return false; } - QStringList lst; - QUriDrag::decodeLocalFiles( d, lst ); + TQStringList lst; + TQUriDrag::decodeLocalFiles( d, lst ); if ( lst.count() > 0 ) { - static_cast<QLineEdit*>(o)->setText( lst[0] ); - static_cast<QLineEdit*>(o)->setFocus(); + static_cast<TQLineEdit*>(TQT_TQWIDGET(o))->setText( lst[0] ); + static_cast<TQLineEdit*>(TQT_TQWIDGET(o))->setFocus(); } return true; @@ -210,9 +210,9 @@ bool OpenDialog::eventFilter(QObject* o, QEvent* e) } -void OpenDialog::selectURL( QComboBox* pLine, bool bDir, int i, bool bSave ) +void OpenDialog::selectURL( TQComboBox* pLine, bool bDir, int i, bool bSave ) { - QString current = pLine->currentText(); + TQString current = pLine->currentText(); if (current.isEmpty() && i>3 ){ current = m_pLineC->currentText(); } if (current.isEmpty() ){ current = m_pLineB->currentText(); } if (current.isEmpty() ){ current = m_pLineA->currentText(); } @@ -252,14 +252,14 @@ void OpenDialog::inputFilenameChanged() } } -static void fixCurrentText( QComboBox* pCB ) +static void fixCurrentText( TQComboBox* pCB ) { - QString s = pCB->currentText(); + TQString s = pCB->currentText(); - int pos = s.find( '\n' ); + int pos = s.tqfind( '\n' ); if ( pos>=0 ) s=s.left(pos); - pos = s.find( '\r' ); + pos = s.tqfind( '\r' ); if ( pos>=0 ) s=s.left(pos); @@ -271,9 +271,9 @@ void OpenDialog::accept() unsigned int maxNofRecentFiles = 10; fixCurrentText( m_pLineA ); - QString s = m_pLineA->currentText(); + TQString s = m_pLineA->currentText(); s = KURL::fromPathOrURL(s).prettyURL(); - QStringList* sl = &m_pOptions->m_recentAFiles; + TQStringList* sl = &m_pOptions->m_recentAFiles; // If an item exist, remove it from the list and reinsert it at the beginning. sl->remove(s); if ( !s.isEmpty() ) sl->prepend( s ); @@ -303,13 +303,13 @@ void OpenDialog::accept() if ( !s.isEmpty() ) sl->prepend( s ); if (sl->count()>maxNofRecentFiles) sl->erase( sl->at(maxNofRecentFiles), sl->end() ); - QDialog::accept(); + TQDialog::accept(); } void OpenDialog::slotSwapCopyNames( int id ) // id selected in the popup menu { - QComboBox* cb1=0; - QComboBox* cb2=0; + TQComboBox* cb1=0; + TQComboBox* cb2=0; switch(id) { case 0: cb1=m_pLineA; cb2=m_pLineB; break; @@ -324,8 +324,8 @@ void OpenDialog::slotSwapCopyNames( int id ) // id selected in the popup menu } if ( cb1 && cb2 ) { - QString t1 = cb1->currentText(); - QString t2 = cb2->currentText(); + TQString t1 = cb1->currentText(); + TQString t2 = cb2->currentText(); cb2->setCurrentText(t1); if ( id<=2 || id>=6 ) { @@ -336,172 +336,172 @@ void OpenDialog::slotSwapCopyNames( int id ) // id selected in the popup menu // FindDialog ********************************************* -FindDialog::FindDialog(QWidget* pParent) -: QDialog( pParent ) +FindDialog::FindDialog(TQWidget* pParent) +: TQDialog( pParent ) { - QGridLayout* layout = new QGridLayout( this ); - layout->setMargin(5); - layout->setSpacing(5); + TQGridLayout* tqlayout = new TQGridLayout( this ); + tqlayout->setMargin(5); + tqlayout->setSpacing(5); int line=0; - layout->addMultiCellWidget( new QLabel(i18n("Search text:"),this), line,line,0,1 ); + tqlayout->addMultiCellWidget( new TQLabel(i18n("Search text:"),this), line,line,0,1 ); ++line; - m_pSearchString = new QLineEdit( this ); - layout->addMultiCellWidget( m_pSearchString, line,line,0,1 ); + m_pSearchString = new TQLineEdit( this ); + tqlayout->addMultiCellWidget( m_pSearchString, line,line,0,1 ); ++line; - m_pCaseSensitive = new QCheckBox(i18n("Case sensitive"),this); - layout->addWidget( m_pCaseSensitive, line, 1 ); + m_pCaseSensitive = new TQCheckBox(i18n("Case sensitive"),this); + tqlayout->addWidget( m_pCaseSensitive, line, 1 ); - m_pSearchInA = new QCheckBox(i18n("Search A"),this); - layout->addWidget( m_pSearchInA, line, 0 ); + m_pSearchInA = new TQCheckBox(i18n("Search A"),this); + tqlayout->addWidget( m_pSearchInA, line, 0 ); m_pSearchInA->setChecked( true ); ++line; - m_pSearchInB = new QCheckBox(i18n("Search B"),this); - layout->addWidget( m_pSearchInB, line, 0 ); + m_pSearchInB = new TQCheckBox(i18n("Search B"),this); + tqlayout->addWidget( m_pSearchInB, line, 0 ); m_pSearchInB->setChecked( true ); ++line; - m_pSearchInC = new QCheckBox(i18n("Search C"),this); - layout->addWidget( m_pSearchInC, line, 0 ); + m_pSearchInC = new TQCheckBox(i18n("Search C"),this); + tqlayout->addWidget( m_pSearchInC, line, 0 ); m_pSearchInC->setChecked( true ); ++line; - m_pSearchInOutput = new QCheckBox(i18n("Search output"),this); - layout->addWidget( m_pSearchInOutput, line, 0 ); + m_pSearchInOutput = new TQCheckBox(i18n("Search output"),this); + tqlayout->addWidget( m_pSearchInOutput, line, 0 ); m_pSearchInOutput->setChecked( true ); ++line; - QPushButton* pButton = new QPushButton( i18n("&Search"), this ); - layout->addWidget( pButton, line, 0 ); - connect( pButton, SIGNAL(clicked()), this, SLOT(accept())); + TQPushButton* pButton = new TQPushButton( i18n("&Search"), this ); + tqlayout->addWidget( pButton, line, 0 ); + connect( pButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(accept())); - pButton = new QPushButton( i18n("&Cancel"), this ); - layout->addWidget( pButton, line, 1 ); - connect( pButton, SIGNAL(clicked()), this, SLOT(reject())); + pButton = new TQPushButton( i18n("&Cancel"), this ); + tqlayout->addWidget( pButton, line, 1 ); + connect( pButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(reject())); hide(); } -RegExpTester::RegExpTester( QWidget* pParent, const QString& autoMergeRegExpToolTip, - const QString& historyStartRegExpToolTip, const QString& historyEntryStartRegExpToolTip, const QString& historySortKeyOrderToolTip ) -: QDialog( pParent) +RegExpTester::RegExpTester( TQWidget* pParent, const TQString& autoMergeRegExpToolTip, + const TQString& historyStartRegExpToolTip, const TQString& historyEntryStartRegExpToolTip, const TQString& historySortKeyOrderToolTip ) +: TQDialog( pParent) { int line=0; setCaption(i18n("Regular Expression Tester")); - QGridLayout* pGrid = new QGridLayout( this, 11, 2, 5, 5 ); + TQGridLayout* pGrid = new TQGridLayout( this, 11, 2, 5, 5 ); - QLabel* l = new QLabel(i18n("Auto merge regular expression:"), this); + TQLabel* l = new TQLabel(i18n("Auto merge regular expression:"), this); pGrid->addWidget(l,line,0); - QToolTip::add( l, autoMergeRegExpToolTip ); - m_pAutoMergeRegExpEdit = new QLineEdit(this); + TQToolTip::add( l, autoMergeRegExpToolTip ); + m_pAutoMergeRegExpEdit = new TQLineEdit(this); pGrid->addWidget(m_pAutoMergeRegExpEdit,line,1); - connect( m_pAutoMergeRegExpEdit, SIGNAL(textChanged(const QString&)), this, SLOT(slotRecalc())); + connect( m_pAutoMergeRegExpEdit, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(slotRecalc())); ++line; - l = new QLabel(i18n("Example auto merge line:"), this); + l = new TQLabel(i18n("Example auto merge line:"), this); pGrid->addMultiCellWidget(l,line,line,0,1); - QToolTip::add( l, i18n("For auto merge test copy a line as used in your files.") ); - m_pAutoMergeExampleEdit = new QLineEdit(this); + TQToolTip::add( l, i18n("For auto merge test copy a line as used in your files.") ); + m_pAutoMergeExampleEdit = new TQLineEdit(this); pGrid->addWidget(m_pAutoMergeExampleEdit,line,1); - connect( m_pAutoMergeExampleEdit, SIGNAL(textChanged(const QString&)), this, SLOT(slotRecalc())); + connect( m_pAutoMergeExampleEdit, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(slotRecalc())); ++line; - l = new QLabel(i18n("Match result:"), this); + l = new TQLabel(i18n("Match result:"), this); pGrid->addWidget(l,line,0); - m_pAutoMergeMatchResult = new QLineEdit(this); + m_pAutoMergeMatchResult = new TQLineEdit(this); m_pAutoMergeMatchResult->setReadOnly(true); pGrid->addWidget(m_pAutoMergeMatchResult,line,1); ++line; - pGrid->addItem( new QSpacerItem(100,20), line, 0 ); + pGrid->addItem( new TQSpacerItem(100,20), line, 0 ); pGrid->setRowStretch( line, 5); ++line; - l = new QLabel(i18n("History start regular expression:"), this); + l = new TQLabel(i18n("History start regular expression:"), this); pGrid->addWidget(l,line,0); - QToolTip::add( l, historyStartRegExpToolTip ); - m_pHistoryStartRegExpEdit = new QLineEdit(this); + TQToolTip::add( l, historyStartRegExpToolTip ); + m_pHistoryStartRegExpEdit = new TQLineEdit(this); pGrid->addWidget(m_pHistoryStartRegExpEdit,line,1); - connect( m_pHistoryStartRegExpEdit, SIGNAL(textChanged(const QString&)), this, SLOT(slotRecalc())); + connect( m_pHistoryStartRegExpEdit, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(slotRecalc())); ++line; - l = new QLabel(i18n("Example history start line (with leading comment):"), this); + l = new TQLabel(i18n("Example history start line (with leading comment):"), this); pGrid->addMultiCellWidget(l,line,line,0,1); ++line; - QToolTip::add( l, i18n("Copy a history start line as used in your files,\n" + TQToolTip::add( l, i18n("Copy a history start line as used in your files,\n" "including the leading comment.") ); - m_pHistoryStartExampleEdit = new QLineEdit(this); + m_pHistoryStartExampleEdit = new TQLineEdit(this); pGrid->addWidget(m_pHistoryStartExampleEdit,line,1); - connect( m_pHistoryStartExampleEdit, SIGNAL(textChanged(const QString&)), this, SLOT(slotRecalc())); + connect( m_pHistoryStartExampleEdit, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(slotRecalc())); ++line; - l = new QLabel(i18n("Match result:"), this); + l = new TQLabel(i18n("Match result:"), this); pGrid->addWidget(l,line,0); - m_pHistoryStartMatchResult = new QLineEdit(this); + m_pHistoryStartMatchResult = new TQLineEdit(this); m_pHistoryStartMatchResult->setReadOnly(true); pGrid->addWidget(m_pHistoryStartMatchResult,line,1); ++line; - pGrid->addItem( new QSpacerItem(100,20), line, 0 ); + pGrid->addItem( new TQSpacerItem(100,20), line, 0 ); pGrid->setRowStretch( line, 5); ++line; - l = new QLabel(i18n("History entry start regular expression:"), this); + l = new TQLabel(i18n("History entry start regular expression:"), this); pGrid->addWidget(l,line,0); - QToolTip::add( l, historyEntryStartRegExpToolTip ); - m_pHistoryEntryStartRegExpEdit = new QLineEdit(this); + TQToolTip::add( l, historyEntryStartRegExpToolTip ); + m_pHistoryEntryStartRegExpEdit = new TQLineEdit(this); pGrid->addWidget(m_pHistoryEntryStartRegExpEdit,line,1); - connect( m_pHistoryEntryStartRegExpEdit, SIGNAL(textChanged(const QString&)), this, SLOT(slotRecalc())); + connect( m_pHistoryEntryStartRegExpEdit, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(slotRecalc())); ++line; - l = new QLabel(i18n("History sort key order:"), this); + l = new TQLabel(i18n("History sort key order:"), this); pGrid->addWidget(l,line,0); - QToolTip::add( l, historySortKeyOrderToolTip ); - m_pHistorySortKeyOrderEdit = new QLineEdit(this); + TQToolTip::add( l, historySortKeyOrderToolTip ); + m_pHistorySortKeyOrderEdit = new TQLineEdit(this); pGrid->addWidget(m_pHistorySortKeyOrderEdit,line,1); - connect( m_pHistorySortKeyOrderEdit, SIGNAL(textChanged(const QString&)), this, SLOT(slotRecalc())); + connect( m_pHistorySortKeyOrderEdit, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(slotRecalc())); ++line; - l = new QLabel(i18n("Example history entry start line (without leading comment):"), this); + l = new TQLabel(i18n("Example history entry start line (without leading comment):"), this); pGrid->addMultiCellWidget(l,line,line,0,1); - QToolTip::add( l, i18n("Copy a history entry start line as used in your files,\n" + TQToolTip::add( l, i18n("Copy a history entry start line as used in your files,\n" "but omit the leading comment.") ); ++line; - m_pHistoryEntryStartExampleEdit = new QLineEdit(this); + m_pHistoryEntryStartExampleEdit = new TQLineEdit(this); pGrid->addWidget(m_pHistoryEntryStartExampleEdit,line,1); - connect( m_pHistoryEntryStartExampleEdit, SIGNAL(textChanged(const QString&)), this, SLOT(slotRecalc())); + connect( m_pHistoryEntryStartExampleEdit, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(slotRecalc())); ++line; - l = new QLabel(i18n("Match result:"), this); + l = new TQLabel(i18n("Match result:"), this); pGrid->addWidget(l,line,0); - m_pHistoryEntryStartMatchResult = new QLineEdit(this); + m_pHistoryEntryStartMatchResult = new TQLineEdit(this); m_pHistoryEntryStartMatchResult->setReadOnly(true); pGrid->addWidget(m_pHistoryEntryStartMatchResult,line,1); ++line; - l = new QLabel(i18n("Sort key result:"), this); + l = new TQLabel(i18n("Sort key result:"), this); pGrid->addWidget(l,line,0); - m_pHistorySortKeyResult = new QLineEdit(this); + m_pHistorySortKeyResult = new TQLineEdit(this); m_pHistorySortKeyResult->setReadOnly(true); pGrid->addWidget(m_pHistorySortKeyResult,line,1); ++line; - QPushButton* pButton = new QPushButton(i18n("OK"), this); + TQPushButton* pButton = new TQPushButton(i18n("OK"), this); pGrid->addWidget(pButton,line,0); - connect( pButton, SIGNAL(clicked()), this, SLOT(accept())); + connect( pButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(accept())); - pButton = new QPushButton(i18n("Cancel"), this); + pButton = new TQPushButton(i18n("Cancel"), this); pGrid->addWidget(pButton,line,1); - connect( pButton, SIGNAL(clicked()), this, SLOT(reject())); + connect( pButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(reject())); - resize( 800, sizeHint().height() ); + resize( 800, tqsizeHint().height() ); } -void RegExpTester::init( const QString& autoMergeRegExp, const QString& historyStartRegExp, const QString& historyEntryStartRegExp, const QString historySortKeyOrder ) +void RegExpTester::init( const TQString& autoMergeRegExp, const TQString& historyStartRegExp, const TQString& historyEntryStartRegExp, const TQString historySortKeyOrder ) { m_pAutoMergeRegExpEdit->setText( autoMergeRegExp ); m_pHistoryStartRegExpEdit->setText( historyStartRegExp ); @@ -509,29 +509,29 @@ void RegExpTester::init( const QString& autoMergeRegExp, const QString& historyS m_pHistorySortKeyOrderEdit->setText( historySortKeyOrder ); } -QString RegExpTester::autoMergeRegExp() +TQString RegExpTester::autoMergeRegExp() { return m_pAutoMergeRegExpEdit->text(); } -QString RegExpTester::historyStartRegExp() +TQString RegExpTester::historyStartRegExp() { return m_pHistoryStartRegExpEdit->text(); } -QString RegExpTester::historyEntryStartRegExp() +TQString RegExpTester::historyEntryStartRegExp() { return m_pHistoryEntryStartRegExpEdit->text(); } -QString RegExpTester::historySortKeyOrder() +TQString RegExpTester::historySortKeyOrder() { return m_pHistorySortKeyOrderEdit->text(); } void RegExpTester::slotRecalc() { - QRegExp autoMergeRegExp = m_pAutoMergeRegExpEdit->text(); + TQRegExp autoMergeRegExp = m_pAutoMergeRegExpEdit->text(); if ( autoMergeRegExp.exactMatch( m_pAutoMergeExampleEdit->text() ) ) { m_pAutoMergeMatchResult->setText( i18n("Match success.") ); @@ -541,7 +541,7 @@ void RegExpTester::slotRecalc() m_pAutoMergeMatchResult->setText( i18n("Match failed.") ); } - QRegExp historyStartRegExp = m_pHistoryStartRegExpEdit->text(); + TQRegExp historyStartRegExp = m_pHistoryStartRegExpEdit->text(); if ( historyStartRegExp.exactMatch( m_pHistoryStartExampleEdit->text() ) ) { m_pHistoryStartMatchResult->setText( i18n("Match success.") ); @@ -552,21 +552,21 @@ void RegExpTester::slotRecalc() } - QStringList parenthesesGroups; - bool bSuccess = findParenthesesGroups( m_pHistoryEntryStartRegExpEdit->text(), parenthesesGroups ); + TQStringList tqparenthesesGroups; + bool bSuccess = findParenthesesGroups( m_pHistoryEntryStartRegExpEdit->text(), tqparenthesesGroups ); if ( ! bSuccess ) { - m_pHistoryEntryStartMatchResult->setText( i18n("Opening and closing parentheses don't match in regular expression.") ); + m_pHistoryEntryStartMatchResult->setText( i18n("Opening and closing tqparentheses don't match in regular expression.") ); m_pHistorySortKeyResult->setText( i18n("") ); return; } - QRegExp historyEntryStartRegExp = m_pHistoryEntryStartRegExpEdit->text(); - QString s = m_pHistoryEntryStartExampleEdit->text(); + TQRegExp historyEntryStartRegExp = m_pHistoryEntryStartRegExpEdit->text(); + TQString s = m_pHistoryEntryStartExampleEdit->text(); if ( historyEntryStartRegExp.exactMatch( s ) ) { m_pHistoryEntryStartMatchResult->setText( i18n("Match success.") ); - QString key = calcHistorySortKey( m_pHistorySortKeyOrderEdit->text(),historyEntryStartRegExp,parenthesesGroups); + TQString key = calcHistorySortKey( m_pHistorySortKeyOrderEdit->text(),historyEntryStartRegExp,tqparenthesesGroups); m_pHistorySortKeyResult->setText(key); } else diff --git a/src/smalldialogs.h b/src/smalldialogs.h index 5791b13..88e6146 100644 --- a/src/smalldialogs.h +++ b/src/smalldialogs.h @@ -21,34 +21,35 @@ #ifndef SMALLDIALOGS_H #define SMALLDIALOGS_H -#include <qdialog.h> +#include <tqdialog.h> #include "diff.h" class OptionDialog; -class QComboBox; -class QCheckBox; -class QLineEdit; -class QLabel; +class TQComboBox; +class TQCheckBox; +class TQLineEdit; +class TQLabel; -class OpenDialog : public QDialog +class OpenDialog : public TQDialog { Q_OBJECT + TQ_OBJECT public: OpenDialog( - QWidget* pParent, const QString& n1, const QString& n2, const QString& n3, - bool bMerge, const QString& outputName, const char* slotConfigure, OptionDialog* pOptions ); + TQWidget* pParent, const TQString& n1, const TQString& n2, const TQString& n3, + bool bMerge, const TQString& outputName, const char* slotConfigure, OptionDialog* pOptions ); - QComboBox* m_pLineA; - QComboBox* m_pLineB; - QComboBox* m_pLineC; - QComboBox* m_pLineOut; + TQComboBox* m_pLineA; + TQComboBox* m_pLineB; + TQComboBox* m_pLineC; + TQComboBox* m_pLineOut; - QCheckBox* m_pMerge; + TQCheckBox* m_pMerge; virtual void accept(); - virtual bool eventFilter(QObject* o, QEvent* e); + virtual bool eventFilter(TQObject* o, TQEvent* e); private: OptionDialog* m_pOptions; - void selectURL( QComboBox* pLine, bool bDir, int i, bool bSave ); + void selectURL( TQComboBox* pLine, bool bDir, int i, bool bSave ); bool m_bInputFileNameChanged; private slots: void selectFileA(); @@ -66,22 +67,23 @@ signals: void internalSignal(bool); }; -class FindDialog : public QDialog +class FindDialog : public TQDialog { Q_OBJECT + TQ_OBJECT public: - FindDialog(QWidget* pParent); + FindDialog(TQWidget* pParent); signals: void findNext(); public: - QLineEdit* m_pSearchString; - QCheckBox* m_pSearchInA; - QCheckBox* m_pSearchInB; - QCheckBox* m_pSearchInC; - QCheckBox* m_pSearchInOutput; - QCheckBox* m_pCaseSensitive; + TQLineEdit* m_pSearchString; + TQCheckBox* m_pSearchInA; + TQCheckBox* m_pSearchInB; + TQCheckBox* m_pSearchInC; + TQCheckBox* m_pSearchInOutput; + TQCheckBox* m_pCaseSensitive; int currentLine; int currentPos; @@ -89,30 +91,31 @@ public: }; -class RegExpTester : public QDialog +class RegExpTester : public TQDialog { Q_OBJECT + TQ_OBJECT private: - QLineEdit* m_pAutoMergeRegExpEdit; - QLineEdit* m_pAutoMergeMatchResult; - QLineEdit* m_pAutoMergeExampleEdit; - QLineEdit* m_pHistoryStartRegExpEdit; - QLineEdit* m_pHistoryStartMatchResult; - QLineEdit* m_pHistoryStartExampleEdit; - QLineEdit* m_pHistoryEntryStartRegExpEdit; - QLineEdit* m_pHistorySortKeyOrderEdit; - QLineEdit* m_pHistoryEntryStartExampleEdit; - QLineEdit* m_pHistoryEntryStartMatchResult; - QLineEdit* m_pHistorySortKeyResult; + TQLineEdit* m_pAutoMergeRegExpEdit; + TQLineEdit* m_pAutoMergeMatchResult; + TQLineEdit* m_pAutoMergeExampleEdit; + TQLineEdit* m_pHistoryStartRegExpEdit; + TQLineEdit* m_pHistoryStartMatchResult; + TQLineEdit* m_pHistoryStartExampleEdit; + TQLineEdit* m_pHistoryEntryStartRegExpEdit; + TQLineEdit* m_pHistorySortKeyOrderEdit; + TQLineEdit* m_pHistoryEntryStartExampleEdit; + TQLineEdit* m_pHistoryEntryStartMatchResult; + TQLineEdit* m_pHistorySortKeyResult; OptionDialog* m_pOptionDialog; public: - RegExpTester( QWidget* pParent, const QString& autoMergeRegExpToolTip, const QString& historyStartRegExpToolTip, - const QString& historyEntryStartRegExpToolTip, const QString& historySortKeyOrderToolTip ); - void init( const QString& autoMergeRegExp, const QString& historyStartRegExp, const QString& historyEntryStartRegExp, const QString sortKeyOrder ); - QString autoMergeRegExp(); - QString historyStartRegExp(); - QString historyEntryStartRegExp(); - QString historySortKeyOrder(); + RegExpTester( TQWidget* pParent, const TQString& autoMergeRegExpToolTip, const TQString& historyStartRegExpToolTip, + const TQString& historyEntryStartRegExpToolTip, const TQString& historySortKeyOrderToolTip ); + void init( const TQString& autoMergeRegExp, const TQString& historyStartRegExp, const TQString& historyEntryStartRegExp, const TQString sortKeyOrder ); + TQString autoMergeRegExp(); + TQString historyStartRegExp(); + TQString historyEntryStartRegExp(); + TQString historySortKeyOrder(); public slots: void slotRecalc(); }; |