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
v3.5.13-sru
tpearson 13 years ago
parent 63862fdfcb
commit f636ba5ba2

@ -135,7 +135,7 @@ void readTranslationFile()
static tstring getTranslation( const tstring& fallback ) static tstring getTranslation( const tstring& fallback )
{ {
std::map< std::wstring, std::wstring >::iterator i = s_translationMap.find( fallback ); std::map< std::wstring, std::wstring >::iterator i = s_translationMap.tqfind( fallback );
if (i!=s_translationMap.end()) if (i!=s_translationMap.end())
return i->second; return i->second;
return fallback; return fallback;
@ -153,14 +153,14 @@ static tstring getTranslation( const tstring& fallback )
static void replaceArgs( tstring& s, const tstring& r1, const tstring& r2=TEXT(""), const tstring& r3=TEXT("") ) static void replaceArgs( tstring& s, const tstring& r1, const tstring& r2=TEXT(""), const tstring& r3=TEXT("") )
{ {
tstring arg1 = TEXT("%1"); tstring arg1 = TEXT("%1");
size_t pos1 = s.find( arg1 ); size_t pos1 = s.tqfind( arg1 );
tstring arg2 = TEXT("%2"); tstring arg2 = TEXT("%2");
size_t pos2 = s.find( arg2 ); size_t pos2 = s.tqfind( arg2 );
tstring arg3 = TEXT("%3"); tstring arg3 = TEXT("%3");
size_t pos3 = s.find( arg3 ); size_t pos3 = s.tqfind( arg3 );
if ( pos1 != size_t(-1) ) if ( pos1 != size_t(-1) )
{ {
s.replace( pos1, arg1.length(), r1 ); s.tqreplace( pos1, arg1.length(), r1 );
if ( pos2 != size_t(-1) && pos1<pos2 ) if ( pos2 != size_t(-1) && pos1<pos2 )
pos2 += r1.length() - arg1.length(); pos2 += r1.length() - arg1.length();
if ( pos3 != size_t(-1) && pos1<pos3 ) if ( pos3 != size_t(-1) && pos1<pos3 )
@ -168,13 +168,13 @@ static void replaceArgs( tstring& s, const tstring& r1, const tstring& r2=TEXT("
} }
if ( pos2 != size_t(-1) ) if ( pos2 != size_t(-1) )
{ {
s.replace( pos2, arg2.length(), r2 ); s.tqreplace( pos2, arg2.length(), r2 );
if ( pos3 != size_t(-1) && pos2<pos3 ) if ( pos3 != size_t(-1) && pos2<pos3 )
pos3 += r2.length() - arg2.length(); pos3 += r2.length() - arg2.length();
} }
if ( pos3 != size_t(-1) ) if ( pos3 != size_t(-1) )
{ {
s.replace( pos3, arg3.length(), r3 ); s.tqreplace( pos3, arg3.length(), r3 );
} }
} }

@ -108,7 +108,7 @@ class STRING {
return tmp; return tmp;
} }
STRING& replace( size_t pos, size_t num, const STRING& s ) STRING& tqreplace( size_t pos, size_t num, const STRING& s )
{ {
*this = substr( 0, pos ) + s + substr( pos+num ); *this = substr( 0, pos ) + s + substr( pos+num );
return *this; return *this;
@ -118,7 +118,7 @@ class STRING {
return (lstrcmp(_str, s) == 0); return (lstrcmp(_str, s) == 0);
} }
size_t find(const STRING& s) const size_t tqfind(const STRING& s) const
{ {
const TCHAR* p = _tcsstr( _str, s._str ); const TCHAR* p = _tcsstr( _str, s._str );
if (p) if (p)

@ -6,7 +6,7 @@ kde_module_LTLIBRARIES = libkdiff3plugin.la
libkdiff3plugin_la_SOURCES = kdiff3plugin.cpp libkdiff3plugin_la_SOURCES = kdiff3plugin.cpp
libkdiff3plugin_la_LIBADD = -lkonq libkdiff3plugin_la_LIBADD = -lkonq
libkdiff3plugin_la_LDFLAGS = -module $(all_libraries) $(KDE_PLUGIN) libkdiff3plugin_la_LDFLAGS = -module $(all_libraries) $(KDE_PLUGIN) $(LIB_QT)
#KDE_ICON = KDiff3 #KDE_ICON = KDiff3

@ -31,7 +31,7 @@
//#include <iostream> //#include <iostream>
static QStringList* s_pHistory=0; static TQStringList* s_pHistory=0;
class KDiff3PluginFactory : public KGenericFactory < KDiff3Plugin, KonqPopupMenu > class KDiff3PluginFactory : public KGenericFactory < KDiff3Plugin, KonqPopupMenu >
{ {
@ -44,7 +44,7 @@ public:
if (s_pHistory==0) if (s_pHistory==0)
{ {
//std::cout << "New History: " << instanceName << std::endl; //std::cout << "New History: " << instanceName << std::endl;
s_pHistory = new QStringList; s_pHistory = new TQStringList;
m_pConfig = new KSimpleConfig( "kdiff3pluginrc", false ); m_pConfig = new KSimpleConfig( "kdiff3pluginrc", false );
*s_pHistory = m_pConfig->readListEntry("HistoryStack"); *s_pHistory = m_pConfig->readListEntry("HistoryStack");
} }
@ -64,17 +64,17 @@ public:
K_EXPORT_COMPONENT_FACTORY (libkdiff3plugin, KDiff3PluginFactory ("kdiff3plugin")) K_EXPORT_COMPONENT_FACTORY (libkdiff3plugin, KDiff3PluginFactory ("kdiff3plugin"))
KDiff3Plugin::KDiff3Plugin( KonqPopupMenu* pPopupmenu, const char *name, const QStringList & /* list */ ) KDiff3Plugin::KDiff3Plugin( KonqPopupMenu* pPopupmenu, const char *name, const TQStringList & /* list */ )
:KonqPopupMenuPlugin (pPopupmenu, name) :KonqPopupMenuPlugin (pPopupmenu, name)
{ {
if (KStandardDirs::findExe ("kdiff3").isNull ()) if (KStandardDirs::findExe ("kdiff3").isNull ())
return; return;
m_pParentWidget = pPopupmenu->parentWidget(); m_pParentWidget = pPopupmenu->tqparentWidget();
KGlobal::locale()->insertCatalogue("kdiff3_plugin"); KGlobal::locale()->insertCatalogue("kdiff3_plugin");
// remember currently selected files (copy to a QStringList) // remember currently selected files (copy to a TQStringList)
KFileItemList itemList = pPopupmenu->fileItemList(); KFileItemList itemList = pPopupmenu->fileItemList();
for ( KFileItem *item = itemList.first(); item; item = itemList.next() ) for ( KFileItem *item = itemList.first(); item; item = itemList.next() )
{ {
@ -96,27 +96,27 @@ KDiff3Plugin::KDiff3Plugin( KonqPopupMenu* pPopupmenu, const char *name, const Q
KActionMenu* pActionMenu = new KActionMenu (i18n ("KDiff3"), "kdiff3", actionCollection (), "kdiff3_menu" ); KActionMenu* pActionMenu = new KActionMenu (i18n ("KDiff3"), "kdiff3", actionCollection (), "kdiff3_menu" );
KAction* pAction = 0; KAction* pAction = 0;
QString s; TQString s;
if(m_list.count() == 1) if(m_list.count() == 1)
{ {
int historyCount = s_pHistory ? s_pHistory->count() : 0; int historyCount = s_pHistory ? s_pHistory->count() : 0;
s = i18n("Compare with %1").arg( historyCount>0 ? s_pHistory->front() : QString() ); s = i18n("Compare with %1").tqarg( historyCount>0 ? s_pHistory->front() : TQString() );
pAction = new KAction ( s,0, this, SLOT(slotCompareWith()), actionCollection()); pAction = new KAction ( s,0, this, TQT_SLOT(slotCompareWith()), actionCollection());
pAction->setEnabled( m_list.count()>0 && historyCount>0 ); pAction->setEnabled( m_list.count()>0 && historyCount>0 );
pActionMenu->insert (pAction); pActionMenu->insert (pAction);
s = i18n("Merge with %1").arg( historyCount>0 ? s_pHistory->front() : QString() ); s = i18n("Merge with %1").tqarg( historyCount>0 ? s_pHistory->front() : TQString() );
pAction = new KAction( s, 0, this, SLOT(slotMergeWith()), actionCollection()); pAction = new KAction( s, 0, this, TQT_SLOT(slotMergeWith()), actionCollection());
pAction->setEnabled( m_list.count()>0 && historyCount>0 ); pAction->setEnabled( m_list.count()>0 && historyCount>0 );
pActionMenu->insert (pAction); pActionMenu->insert (pAction);
s = i18n("Save '%1' for later").arg( ( m_list.front() ) ); s = i18n("Save '%1' for later").tqarg( ( m_list.front() ) );
pAction = new KAction ( s, 0, this, SLOT(slotSaveForLater()), actionCollection()); pAction = new KAction ( s, 0, this, TQT_SLOT(slotSaveForLater()), actionCollection());
pAction->setEnabled( m_list.count()>0 ); pAction->setEnabled( m_list.count()>0 );
pActionMenu->insert(pAction); pActionMenu->insert(pAction);
pAction = new KAction (i18n("3-way merge with base"), 0, this, SLOT(slotMergeThreeWay()), actionCollection()); pAction = new KAction (i18n("3-way merge with base"), 0, this, TQT_SLOT(slotMergeThreeWay()), actionCollection());
pAction->setEnabled( m_list.count()>0 && historyCount>=2 ); pAction->setEnabled( m_list.count()>0 && historyCount>=2 );
pActionMenu->insert (pAction); pActionMenu->insert (pAction);
@ -125,32 +125,32 @@ KDiff3Plugin::KDiff3Plugin( KonqPopupMenu* pPopupmenu, const char *name, const Q
KActionMenu* pHistoryMenu = new KActionMenu( i18n("Compare with ..."), "CompareWith", actionCollection (), "kdiff3_history_menu"); KActionMenu* pHistoryMenu = new KActionMenu( i18n("Compare with ..."), "CompareWith", actionCollection (), "kdiff3_history_menu");
pHistoryMenu->setEnabled( m_list.count()>0 && historyCount>0 ); pHistoryMenu->setEnabled( m_list.count()>0 && historyCount>0 );
pActionMenu->insert(pHistoryMenu); pActionMenu->insert(pHistoryMenu);
for (QStringList::iterator i = s_pHistory->begin(); i!=s_pHistory->end(); ++i) for (TQStringList::iterator i = s_pHistory->begin(); i!=s_pHistory->end(); ++i)
{ {
pAction = new KAction( *i, "History", 0, this, SLOT(slotCompareWithHistoryItem()), actionCollection()); pAction = new KAction( *i, "History", 0, this, TQT_SLOT(slotCompareWithHistoryItem()), actionCollection());
pHistoryMenu->insert (pAction); pHistoryMenu->insert (pAction);
} }
pAction = new KAction (i18n("Clear list"), 0, this, SLOT(slotClearList()), actionCollection()); pAction = new KAction (i18n("Clear list"), 0, this, TQT_SLOT(slotClearList()), actionCollection());
pActionMenu->insert (pAction); pActionMenu->insert (pAction);
pAction->setEnabled( historyCount>0 ); pAction->setEnabled( historyCount>0 );
} }
} }
else if(m_list.count() == 2) else if(m_list.count() == 2)
{ {
pAction = new KAction (i18n("Compare"), 0, this, SLOT(slotCompareTwoFiles()), actionCollection()); pAction = new KAction (i18n("Compare"), 0, this, TQT_SLOT(slotCompareTwoFiles()), actionCollection());
pActionMenu->insert (pAction); pActionMenu->insert (pAction);
} }
else if ( m_list.count() == 3 ) else if ( m_list.count() == 3 )
{ {
pAction = new KAction (i18n("3 way comparison"), 0, this, SLOT(slotCompareThreeFiles()), actionCollection()); pAction = new KAction (i18n("3 way comparison"), 0, this, TQT_SLOT(slotCompareThreeFiles()), actionCollection());
pActionMenu->insert (pAction); pActionMenu->insert (pAction);
} }
pAction = new KAction (i18n("About KDiff3 menu plugin ..."), 0, this, SLOT(slotAbout()), actionCollection()); pAction = new KAction (i18n("About KDiff3 menu plugin ..."), 0, this, TQT_SLOT(slotAbout()), actionCollection());
pActionMenu->insert (pAction); pActionMenu->insert (pAction);
addSeparator(); addSeparator();
addAction( pActionMenu ); tqaddAction( pActionMenu );
addSeparator(); addSeparator();
} }
@ -162,7 +162,7 @@ void KDiff3Plugin::slotCompareWith()
{ {
if ( m_list.count() > 0 && s_pHistory && ! s_pHistory->empty() ) if ( m_list.count() > 0 && s_pHistory && ! s_pHistory->empty() )
{ {
QStringList args; TQStringList args;
args << s_pHistory->front(); args << s_pHistory->front();
args << m_list.front(); args << m_list.front();
kapp->kdeinitExec ("kdiff3", args); kapp->kdeinitExec ("kdiff3", args);
@ -174,7 +174,7 @@ void KDiff3Plugin::slotCompareWithHistoryItem()
const KAction* pAction = dynamic_cast<const KAction*>( sender() ); const KAction* pAction = dynamic_cast<const KAction*>( sender() );
if ( m_list.count() > 0 && pAction ) if ( m_list.count() > 0 && pAction )
{ {
QStringList args; TQStringList args;
args << pAction->text(); args << pAction->text();
args << m_list.front(); args << m_list.front();
kapp->kdeinitExec ("kdiff3", args); kapp->kdeinitExec ("kdiff3", args);
@ -185,7 +185,7 @@ void KDiff3Plugin::slotCompareTwoFiles()
{ {
if ( m_list.count() == 2 ) if ( m_list.count() == 2 )
{ {
QStringList args; TQStringList args;
args << m_list.front(); args << m_list.front();
args << m_list.back(); args << m_list.back();
kapp->kdeinitExec ("kdiff3", args); kapp->kdeinitExec ("kdiff3", args);
@ -196,7 +196,7 @@ void KDiff3Plugin::slotCompareThreeFiles()
{ {
if ( m_list.count() == 3 ) if ( m_list.count() == 3 )
{ {
QStringList args; TQStringList args;
args << m_list[0]; args << m_list[0];
args << m_list[1]; args << m_list[1];
args << m_list[2]; args << m_list[2];
@ -208,7 +208,7 @@ void KDiff3Plugin::slotMergeWith()
{ {
if ( m_list.count() > 0 && s_pHistory && ! s_pHistory->empty() ) if ( m_list.count() > 0 && s_pHistory && ! s_pHistory->empty() )
{ {
QStringList args; TQStringList args;
args << s_pHistory->front(); args << s_pHistory->front();
args << m_list.front(); args << m_list.front();
args << ( "-o" + m_list.front() ); args << ( "-o" + m_list.front() );
@ -220,7 +220,7 @@ void KDiff3Plugin::slotMergeThreeWay()
{ {
if ( m_list.count() > 0 && s_pHistory && s_pHistory->count()>=2 ) if ( m_list.count() > 0 && s_pHistory && s_pHistory->count()>=2 )
{ {
QStringList args; TQStringList args;
args << (*s_pHistory)[1]; args << (*s_pHistory)[1];
args << (*s_pHistory)[0]; args << (*s_pHistory)[0];
args << m_list.front(); args << m_list.front();
@ -247,7 +247,7 @@ void KDiff3Plugin::slotClearList()
void KDiff3Plugin::slotAbout() void KDiff3Plugin::slotAbout()
{ {
QString s = i18n("KDiff3 Menu Plugin: Copyright (C) 2006 Joachim Eibl\n" TQString s = i18n("KDiff3 Menu Plugin: Copyright (C) 2006 Joachim Eibl\n"
"KDiff3 homepage: http://kdiff3.sourceforge.net\n\n"); "KDiff3 homepage: http://kdiff3.sourceforge.net\n\n");
s += i18n("Using the contextmenu extension:\n" s += i18n("Using the contextmenu extension:\n"
"For simple comparison of two selected 2 files choose \"Compare\".\n" "For simple comparison of two selected 2 files choose \"Compare\".\n"

@ -23,13 +23,14 @@
#include <konq_popupmenu.h> #include <konq_popupmenu.h>
class QStringList; class TQStringList;
class KDiff3Plugin : public KonqPopupMenuPlugin class KDiff3Plugin : public KonqPopupMenuPlugin
{ {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
KDiff3Plugin (KonqPopupMenu *, const char *name, const QStringList & list); KDiff3Plugin (KonqPopupMenu *, const char *name, const TQStringList & list);
virtual ~KDiff3Plugin(); virtual ~KDiff3Plugin();
private slots: private slots:
@ -44,7 +45,7 @@ private slots:
void slotAbout(); void slotAbout();
private: private:
QStringList m_list; TQStringList m_list;
QWidget* m_pParentWidget; TQWidget* m_pParentWidget;
}; };
#endif #endif

@ -46,7 +46,7 @@ libkdiff3part_la_SOURCES = kdiff3_part.cpp kdiff3.cpp directorymergewindow.cpp \
merger.cpp pdiff.cpp difftextwindow.cpp diff.cpp optiondialog.cpp \ merger.cpp pdiff.cpp difftextwindow.cpp diff.cpp optiondialog.cpp \
mergeresultwindow.cpp fileaccess.cpp gnudiff_analyze.cpp gnudiff_io.cpp gnudiff_xmalloc.cpp \ mergeresultwindow.cpp fileaccess.cpp gnudiff_analyze.cpp gnudiff_io.cpp gnudiff_xmalloc.cpp \
common.cpp smalldialogs.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) libkdiff3part_la_LIBADD = $(LIB_KDEPRINT) $(LIB_KPARTS) $(LIB_KFILE)
# this is where the desktop file will go # this is where the desktop file will go

@ -19,7 +19,7 @@ YACCFLAGS= -d
INCPATH = -I$(QTDIR)/mkspecs/default -I. -Ikreplacements -I/usr/include -I$(QTDIR)/include INCPATH = -I$(QTDIR)/mkspecs/default -I. -Ikreplacements -I/usr/include -I$(QTDIR)/include
LINK = g++ LINK = g++
LFLAGS = 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 AR = ar cqs
RANLIB = RANLIB =
MOC = $(QTDIR)/bin/moc MOC = $(QTDIR)/bin/moc

@ -260,7 +260,7 @@ int integrateWithClearCase( const char* subCommand, const char* kdiff3CommandPat
for( ; i!=lineItemList.end(); ++i ) for( ; i!=lineItemList.end(); ++i )
{ {
LineItem& li = *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(); std::list<LineItem>::const_iterator j = lineItemListBak.begin();
for (;j!=lineItemListBak.end();++j) for (;j!=lineItemListBak.end();++j)

@ -20,12 +20,12 @@
#include "common.h" #include "common.h"
#include <map> #include <map>
#include <qfont.h> #include <tqfont.h>
#include <qcolor.h> #include <tqcolor.h>
#include <qsize.h> #include <tqsize.h>
#include <qpoint.h> #include <tqpoint.h>
#include <qstringlist.h> #include <tqstringlist.h>
#include <qtextstream.h> #include <tqtextstream.h>
ValueMap::ValueMap() 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) for( i=m_map.begin(); i!=m_map.end(); ++i)
{ {
QString key = i->first; TQString key = i->first;
QString val = i->second; TQString val = i->second;
ts << key << "=" << val << "\n"; ts << key << "=" << val << "\n";
} }
} }
QString ValueMap::getAsString() TQString ValueMap::getAsString()
{ {
QString result; TQString result;
std::map<QString,QString>::iterator i; std::map<TQString,TQString>::iterator i;
for( i=m_map.begin(); i!=m_map.end(); ++i) for( i=m_map.begin(); i!=m_map.end(); ++i)
{ {
QString key = i->first; TQString key = i->first;
QString val = i->second; TQString val = i->second;
result += key + "=" + val + "\n"; result += key + "=" + val + "\n";
} }
return result; return result;
} }
void ValueMap::load( QTextStream& ts ) void ValueMap::load( TQTextStream& ts )
{ {
while ( !ts.eof() ) while ( !ts.eof() )
{ // until end of file... { // until end of file...
QString s = ts.readLine(); // line of text excluding '\n' TQString s = ts.readLine(); // line of text excluding '\n'
int pos = s.find('='); int pos = s.tqfind('=');
if( pos > 0 ) // seems not to have a tag if( pos > 0 ) // seems not to have a tag
{ {
QString key = s.left(pos); TQString key = s.left(pos);
QString val = s.mid(pos+1); TQString val = s.mid(pos+1);
m_map[key] = val; m_map[key] = val;
} }
} }
} }
/* /*
void ValueMap::load( const QString& s ) void ValueMap::load( const TQString& s )
{ {
int pos=0; int pos=0;
while ( pos<(int)s.length() ) while ( pos<(int)s.length() )
{ // until end of file... { // until end of file...
int pos2 = s.find('=', pos); int pos2 = s.tqfind('=', pos);
int pos3 = s.find('\n', pos2 ); int pos3 = s.tqfind('\n', pos2 );
if (pos3<0) if (pos3<0)
pos3=s.length(); pos3=s.length();
if( pos2 > 0 ) // seems not to have a tag if( pos2 > 0 ) // seems not to have a tag
{ {
QString key = s.mid(pos, pos2-pos); TQString key = s.mid(pos, pos2-pos);
QString val = s.mid(pos2+1, pos3-pos2-1); TQString val = s.mid(pos2+1, pos3-pos2-1);
m_map[key] = val; m_map[key] = val;
} }
pos = pos3; 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 // 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. // 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 ',' // Join the strings in the list, using the separator ','
// If a string contains the separator character, it will be replaced with "\,". // 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); assert(sepChar!=metaChar);
QString sep; TQString sep;
sep += sepChar; sep += sepChar;
QString meta; TQString meta;
meta += metaChar; meta += metaChar;
QString safeString; TQString safeString;
QStringList::const_iterator i; TQStringList::const_iterator i;
for (i=sl.begin(); i!=sl.end(); ++i) for (i=sl.begin(); i!=sl.end(); ++i)
{ {
QString s = *i; TQString s = *i;
s.replace(meta, meta+meta); // "\" -> "\\" s.tqreplace(meta, meta+meta); // "\" -> "\\"
s.replace(sep, meta+sep); // "," -> "\," s.tqreplace(sep, meta+sep); // "," -> "\,"
if ( i==sl.begin() ) if ( i==sl.begin() )
safeString = s; safeString = s;
else else
@ -126,14 +126,14 @@ QString safeStringJoin(const QStringList& sl, char sepChar, char metaChar )
} }
// Split a string that was joined with safeStringJoin // 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); assert(sepChar!=metaChar);
QStringList sl; TQStringList sl;
// Miniparser // Miniparser
int i=0; int i=0;
int len=s.length(); int len=s.length();
QString b; TQString b;
for(i=0;i<len;++i) for(i=0;i<len;++i)
{ {
if ( i+1<len && s[i]==metaChar && s[i+1]==metaChar ){ b+=metaChar; ++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 ); s.setNum( n );
return s; 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; int pos=0;
while( idx>0 ) while( idx>0 )
{ {
pos = s.find( sep, pos ); pos = s.tqfind( sep, pos );
--idx; --idx;
if (pos<0) break; if (pos<0) break;
++pos; ++pos;
} }
if ( pos>=0 ) if ( pos>=0 )
{ {
int pos2 = s.find( sep, pos ); int pos2 = s.tqfind( sep, pos );
if ( pos2>0 ) if ( pos2>0 )
return s.mid(pos, pos2-pos); return s.mid(pos, pos2-pos);
else else
@ -182,61 +182,61 @@ static QString subSection( const QString& s, int idx, char sep )
return ""; return "";
} }
static int num( QString& s, int idx ) static int num( TQString& s, int idx )
{ {
return subSection( s, idx, ',').toInt(); 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()); 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()); 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()); 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); 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); 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; 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; 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); 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; TQFont f = *defaultVal;
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() ) if ( i!=m_map.end() )
{ {
f.setFamily( subSection( i->second, 0, ',' ) ); f.setFamily( subSection( i->second, 0, ',' ) );
@ -248,76 +248,76 @@ QFont ValueMap::readFontEntry(const QString& k, QFont* defaultVal )
return f; return f;
} }
QColor ValueMap::readColorEntry(const QString& k, QColor* defaultVal ) TQColor ValueMap::readColorEntry(const TQString& k, TQColor* defaultVal )
{ {
QColor c= *defaultVal; TQColor c= *defaultVal;
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() ) if ( i!=m_map.end() )
{ {
QString s = i->second; TQString s = i->second;
c = QColor( num(s,0),num(s,1),num(s,2) ); c = TQColor( num(s,0),num(s,1),num(s,2) );
} }
return c; 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); TQSize size = defaultVal ? *defaultVal : TQSize(600,400);
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() ) if ( i!=m_map.end() )
{ {
QString s = i->second; TQString s = i->second;
size = QSize( num(s,0),num(s,1) ); size = TQSize( num(s,0),num(s,1) );
} }
return size; 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); TQPoint point = defaultVal ? *defaultVal : TQPoint(0,0);
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() ) if ( i!=m_map.end() )
{ {
QString s = i->second; TQString s = i->second;
point = QPoint( num(s,0),num(s,1) ); point = TQPoint( num(s,0),num(s,1) );
} }
return point; return point;
} }
bool ValueMap::readBoolEntry(const QString& k, bool bDefault ) bool ValueMap::readBoolEntry(const TQString& k, bool bDefault )
{ {
bool b = 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() ) if ( i!=m_map.end() )
{ {
QString s = i->second; TQString s = i->second;
b = (bool)num(s,0); b = (bool)num(s,0);
} }
return b; return b;
} }
int ValueMap::readNumEntry(const QString& k, int iDefault ) int ValueMap::readNumEntry(const TQString& k, int iDefault )
{ {
int ival = 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() ) if ( i!=m_map.end() )
{ {
QString s = i->second; TQString s = i->second;
ival = num(s,0); ival = num(s,0);
} }
return ival; return ival;
} }
QString ValueMap::readEntry(const QString& k, const QString& sDefault ) TQString ValueMap::readEntry(const TQString& k, const TQString& sDefault )
{ {
QString sval = sDefault; TQString sval = sDefault;
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() ) if ( i!=m_map.end() )
{ {
sval = i->second; sval = i->second;
@ -326,11 +326,11 @@ QString ValueMap::readEntry(const QString& k, const QString& sDefault )
return sval; 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() ) if ( i!=m_map.end() )
{ {
strList = safeStringSplit( i->second, separator ); strList = safeStringSplit( i->second, separator );

@ -66,48 +66,48 @@ T minMaxLimiter( T d, T minimum, T maximum )
} }
#include <map> #include <map>
#include <qstring.h> #include <tqstring.h>
class QFont; class TQFont;
class QColor; class TQColor;
class QSize; class TQSize;
class QPoint; class TQPoint;
class QStringList; class TQStringList;
class QTextStream; class TQTextStream;
class ValueMap class ValueMap
{ {
private: private:
std::map<QString,QString> m_map; std::map<TQString,TQString> m_map;
public: public:
ValueMap(); ValueMap();
virtual ~ValueMap(); virtual ~ValueMap();
void save( QTextStream& ts ); void save( TQTextStream& ts );
void load( QTextStream& ts ); void load( TQTextStream& ts );
QString getAsString(); TQString getAsString();
// void load( const QString& s ); // void load( const TQString& s );
virtual void writeEntry(const QString&, const QFont& ); virtual void writeEntry(const TQString&, const TQFont& );
virtual void writeEntry(const QString&, const QColor& ); virtual void writeEntry(const TQString&, const TQColor& );
virtual void writeEntry(const QString&, const QSize& ); virtual void writeEntry(const TQString&, const TQSize& );
virtual void writeEntry(const QString&, const QPoint& ); virtual void writeEntry(const TQString&, const TQPoint& );
virtual void writeEntry(const QString&, int ); virtual void writeEntry(const TQString&, int );
virtual void writeEntry(const QString&, bool ); virtual void writeEntry(const TQString&, bool );
virtual void writeEntry(const QString&, const QStringList&, char separator ); virtual void writeEntry(const TQString&, const TQStringList&, char separator );
virtual void writeEntry(const QString&, const QString& ); virtual void writeEntry(const TQString&, const TQString& );
virtual void writeEntry(const QString&, const char* ); virtual void writeEntry(const TQString&, const char* );
virtual QFont readFontEntry (const QString&, QFont* defaultVal ); virtual TQFont readFontEntry (const TQString&, TQFont* defaultVal );
virtual QColor readColorEntry(const QString&, QColor* defaultVal ); virtual TQColor readColorEntry(const TQString&, TQColor* defaultVal );
virtual QSize readSizeEntry (const QString&, QSize* defaultVal ); virtual TQSize readSizeEntry (const TQString&, TQSize* defaultVal );
virtual QPoint readPointEntry(const QString&, QPoint* defaultVal ); virtual TQPoint readPointEntry(const TQString&, TQPoint* defaultVal );
virtual bool readBoolEntry (const QString&, bool bDefault ); virtual bool readBoolEntry (const TQString&, bool bDefault );
virtual int readNumEntry (const QString&, int iDefault ); virtual int readNumEntry (const TQString&, int iDefault );
virtual QStringList readListEntry (const QString&, const QStringList& defaultVal, char separator ); virtual TQStringList readListEntry (const TQString&, const TQStringList& defaultVal, char separator );
virtual QString readEntry (const QString&, const QString& ); virtual TQString readEntry (const TQString&, const TQString& );
}; };
QStringList safeStringSplit(const QString& s, char sepChar=',', char metaChar='\\' ); TQStringList safeStringSplit(const TQString& s, char sepChar=',', char metaChar='\\' );
QString safeStringJoin(const QStringList& sl, char sepChar=',', char metaChar='\\' ); TQString safeStringJoin(const TQStringList& sl, char sepChar=',', char metaChar='\\' );
#endif #endif

@ -25,9 +25,9 @@
#include <kmessagebox.h> #include <kmessagebox.h>
#include <klocale.h> #include <klocale.h>
#include <qfileinfo.h> #include <tqfileinfo.h>
#include <qdir.h> #include <tqdir.h>
#include <qtextcodec.h> #include <tqtextcodec.h>
#include <map> #include <map>
#include <assert.h> #include <assert.h>
@ -69,11 +69,11 @@ bool equal( const LineData& l1, const LineData& l2, bool bStrict )
return false; return false;
// Ignore white space diff // Ignore white space diff
const QChar* p1 = l1.pLine; const TQChar* p1 = l1.pLine;
const QChar* p1End = p1 + l1.size; const TQChar* p1End = p1 + l1.size;
const QChar* p2 = l2.pLine; const TQChar* p2 = l2.pLine;
const QChar* p2End = p2 + l2.size; const TQChar* p2End = p2 + l2.size;
if ( g_bIgnoreWhiteSpace ) 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 return
i>=size // End of file 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()) if (filename.isEmpty())
{ {
@ -206,17 +206,17 @@ void SourceData::setOptionDialog( OptionDialog* pOptionDialog )
m_pOptionDialog = pOptionDialog; m_pOptionDialog = pOptionDialog;
} }
QString SourceData::getFilename() TQString SourceData::getFilename()
{ {
return m_fileAccess.absFilePath(); return m_fileAccess.absFilePath();
} }
QString SourceData::getAliasName() TQString SourceData::getAliasName()
{ {
return m_aliasName.isEmpty() ? m_fileAccess.prettyAbsPath() : m_aliasName; return m_aliasName.isEmpty() ? m_fileAccess.prettyAbsPath() : m_aliasName;
} }
void SourceData::setAliasName( const QString& name ) void SourceData::setAliasName( const TQString& name )
{ {
m_aliasName = name; m_aliasName = name;
} }
@ -224,7 +224,7 @@ void SourceData::setAliasName( const QString& name )
void SourceData::setFileAccess( const FileAccess& fileAccess ) void SourceData::setFileAccess( const FileAccess& fileAccess )
{ {
m_fileAccess = fileAccess; m_fileAccess = fileAccess;
m_aliasName = QString(); m_aliasName = TQString();
if ( !m_tempInputFileName.isEmpty() ) if ( !m_tempInputFileName.isEmpty() )
{ {
FileAccess::removeFile( m_tempInputFileName ); 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: // Create a temp file for preprocessing:
if ( m_tempInputFileName.isEmpty() ) if ( m_tempInputFileName.isEmpty() )
@ -241,7 +241,7 @@ void SourceData::setData( const QString& data )
} }
FileAccess f( m_tempInputFileName ); 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 ) if ( !bSuccess )
{ {
KMessageBox::error( m_pOptionDialog, i18n("Writing clipboard data to temp file failed.") ); KMessageBox::error( m_pOptionDialog, i18n("Writing clipboard data to temp file failed.") );
@ -308,7 +308,7 @@ void SourceData::FileData::reset()
m_bIsText = true; m_bIsText = true;
} }
bool SourceData::FileData::readFile( const QString& filename ) bool SourceData::FileData::readFile( const TQString& filename )
{ {
reset(); reset();
if ( filename.isEmpty() ) { return true; } if ( filename.isEmpty() ) { return true; }
@ -329,12 +329,12 @@ bool SourceData::FileData::readFile( const QString& filename )
return bSuccess; return bSuccess;
} }
bool SourceData::saveNormalDataAs( const QString& fileName ) bool SourceData::saveNormalDataAs( const TQString& fileName )
{ {
return m_normalData.writeFile( 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; } 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. // 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, static bool convertFileEncoding( const TQString& fileNameIn, TQTextCodec* pCodecIn,
const QString& fileNameOut, QTextCodec* pCodecOut ) const TQString& fileNameOut, TQTextCodec* pCodecOut )
{ {
QFile in( fileNameIn ); TQFile in( fileNameIn );
if ( ! in.open(IO_ReadOnly ) ) if ( ! in.open(IO_ReadOnly ) )
return false; return false;
QTextStream inStream( &in ); TQTextStream inStream( &in );
inStream.setCodec( pCodecIn ); 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 ) ) if ( ! out.open( IO_WriteOnly ) )
return false; return false;
QTextStream outStream( &out ); TQTextStream outStream( &out );
outStream.setCodec( pCodecOut ); outStream.setCodec( pCodecOut );
QString data = inStream.read(); TQString data = inStream.read();
outStream << data; outStream << data;
return true; 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) 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' ) 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' ) 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) if (size>=3)
{ {
skipBytes = 3; skipBytes = 3;
if (buf[0]=='\xEF' && buf[1]=='\xBB' && buf[2]=='\xBF' ) if (buf[0]=='\xEF' && buf[1]=='\xBB' && buf[2]=='\xBF' )
return QTextCodec::codecForName( "UTF-8-BOM" ); return TQTextCodec::codecForName( "UTF-8-BOM" );
} }
skipBytes = 0; skipBytes = 0;
return 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) ) if ( f.open(IO_ReadOnly) )
{ {
char buf[4]; char buf[4];
long size = f.readBlock( buf, sizeof(buf) ); long size = f.readBlock( buf, sizeof(buf) );
long skipBytes = 0; long skipBytes = 0;
QTextCodec* pCodec = ::detectEncoding( buf, size, skipBytes ); TQTextCodec* pCodec = ::detectEncoding( buf, size, skipBytes );
if (pCodec) if (pCodec)
return pCodec; return pCodec;
} }
return pFallbackCodec; return pFallbackCodec;
} }
void SourceData::readAndPreprocess( QTextCodec* pEncoding, bool bAutoDetectUnicode ) void SourceData::readAndPreprocess( TQTextCodec* pEncoding, bool bAutoDetectUnicode )
{ {
m_pEncoding = pEncoding; m_pEncoding = pEncoding;
QString fileNameIn1; TQString fileNameIn1;
QString fileNameOut1; TQString fileNameOut1;
QString fileNameIn2; TQString fileNameIn2;
QString fileNameOut2; TQString fileNameOut2;
bool bTempFileFromClipboard = !m_fileAccess.isValid(); 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. else // The input was set via setData(), probably from clipboard.
{ {
fileNameIn1 = m_tempInputFileName; fileNameIn1 = m_tempInputFileName;
m_pEncoding = QTextCodec::codecForName("UTF-8"); m_pEncoding = TQTextCodec::codecForName("UTF-8");
} }
QTextCodec* pEncoding1 = m_pEncoding; TQTextCodec* pEncoding1 = m_pEncoding;
QTextCodec* pEncoding2 = m_pEncoding; TQTextCodec* pEncoding2 = m_pEncoding;
m_normalData.reset(); m_normalData.reset();
m_lmppData.reset(); m_lmppData.reset();
@ -458,10 +458,10 @@ void SourceData::readAndPreprocess( QTextCodec* pEncoding, bool bAutoDetectUnico
{ {
#ifdef _WIN32 #ifdef _WIN32
QString catCmd = "type"; TQString catCmd = "type";
fileNameIn1.replace( '/', "\\" ); fileNameIn1.tqreplace( '/', "\\" );
#else #else
QString catCmd = "cat"; TQString catCmd = "cat";
#endif #endif
// Run the first preprocessor // Run the first preprocessor
@ -472,7 +472,7 @@ void SourceData::readAndPreprocess( QTextCodec* pEncoding, bool bAutoDetectUnico
} }
else else
{ {
QString fileNameInPP = fileNameIn1; TQString fileNameInPP = fileNameIn1;
if ( pEncoding1 != m_pOptionDialog->m_pEncodingPP ) if ( pEncoding1 != m_pOptionDialog->m_pEncodingPP )
{ {
@ -482,9 +482,9 @@ void SourceData::readAndPreprocess( QTextCodec* pEncoding, bool bAutoDetectUnico
convertFileEncoding( fileNameIn1, pEncoding, fileNameInPP, pEncoding1 ); convertFileEncoding( fileNameIn1, pEncoding, fileNameInPP, pEncoding1 );
} }
QString ppCmd = m_pOptionDialog->m_PreProcessorCmd; TQString ppCmd = m_pOptionDialog->m_PreProcessorCmd;
fileNameOut1 = FileAccess::tempFileName(); fileNameOut1 = FileAccess::tempFileName();
QString cmd = catCmd + " \"" + fileNameInPP + "\" | " + ppCmd + " >\"" + fileNameOut1+"\""; TQString cmd = catCmd + " \"" + fileNameInPP + "\" | " + ppCmd + " >\"" + fileNameOut1+"\"";
::system( encodeString(cmd) ); ::system( encodeString(cmd) );
bool bSuccess = m_normalData.readFile( fileNameOut1 ); bool bSuccess = m_normalData.readFile( fileNameOut1 );
if ( fileInSize >0 && ( !bSuccess || m_normalData.m_size==0 ) ) if ( fileInSize >0 && ( !bSuccess || m_normalData.m_size==0 ) )
@ -492,7 +492,7 @@ void SourceData::readAndPreprocess( QTextCodec* pEncoding, bool bAutoDetectUnico
KMessageBox::error(m_pOptionDialog, KMessageBox::error(m_pOptionDialog,
i18n("Preprocessing possibly failed. Check this command:\n\n %1" i18n("Preprocessing possibly failed. Check this command:\n\n %1"
"\n\nThe preprocessing command will be disabled now." "\n\nThe preprocessing command will be disabled now."
).arg(cmd) ); ).tqarg(cmd) );
m_pOptionDialog->m_PreProcessorCmd = ""; m_pOptionDialog->m_PreProcessorCmd = "";
m_normalData.readFile( fileNameIn1 ); m_normalData.readFile( fileNameIn1 );
pEncoding1 = m_pEncoding; pEncoding1 = m_pEncoding;
@ -507,7 +507,7 @@ void SourceData::readAndPreprocess( QTextCodec* pEncoding, bool bAutoDetectUnico
if ( ! m_pOptionDialog->m_LineMatchingPreProcessorCmd.isEmpty() ) if ( ! m_pOptionDialog->m_LineMatchingPreProcessorCmd.isEmpty() )
{ {
fileNameIn2 = fileNameOut1.isEmpty() ? fileNameIn1 : fileNameOut1; fileNameIn2 = fileNameOut1.isEmpty() ? fileNameIn1 : fileNameOut1;
QString fileNameInPP = fileNameIn2; TQString fileNameInPP = fileNameIn2;
pEncoding2 = pEncoding1; pEncoding2 = pEncoding1;
if ( pEncoding2 != m_pOptionDialog->m_pEncodingPP ) if ( pEncoding2 != m_pOptionDialog->m_pEncodingPP )
{ {
@ -517,9 +517,9 @@ void SourceData::readAndPreprocess( QTextCodec* pEncoding, bool bAutoDetectUnico
convertFileEncoding( fileNameIn2, pEncoding1, fileNameInPP, pEncoding2 ); convertFileEncoding( fileNameIn2, pEncoding1, fileNameInPP, pEncoding2 );
} }
QString ppCmd = m_pOptionDialog->m_LineMatchingPreProcessorCmd; TQString ppCmd = m_pOptionDialog->m_LineMatchingPreProcessorCmd;
fileNameOut2 = FileAccess::tempFileName(); fileNameOut2 = FileAccess::tempFileName();
QString cmd = catCmd + " \"" + fileNameInPP + "\" | " + ppCmd + " >\"" + fileNameOut2 + "\""; TQString cmd = catCmd + " \"" + fileNameInPP + "\" | " + ppCmd + " >\"" + fileNameOut2 + "\"";
::system( encodeString(cmd) ); ::system( encodeString(cmd) );
bool bSuccess = m_lmppData.readFile( fileNameOut2 ); bool bSuccess = m_lmppData.readFile( fileNameOut2 );
if ( FileAccess(fileNameIn2).size()>0 && ( !bSuccess || m_lmppData.m_size==0 ) ) 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, KMessageBox::error(m_pOptionDialog,
i18n("The line-matching-preprocessing possibly failed. Check this command:\n\n %1" i18n("The line-matching-preprocessing possibly failed. Check this command:\n\n %1"
"\n\nThe line-matching-preprocessing command will be disabled now." "\n\nThe line-matching-preprocessing command will be disabled now."
).arg(cmd) ); ).tqarg(cmd) );
m_pOptionDialog->m_LineMatchingPreProcessorCmd = ""; m_pOptionDialog->m_LineMatchingPreProcessorCmd = "";
m_lmppData.readFile( fileNameIn2 ); m_lmppData.readFile( fileNameIn2 );
} }
@ -557,7 +557,7 @@ void SourceData::readAndPreprocess( QTextCodec* pEncoding, bool bAutoDetectUnico
m_lmppData.m_v.resize( m_normalData.m_vSize ); m_lmppData.m_v.resize( m_normalData.m_vSize );
for(int i=m_lmppData.m_vSize; i<m_normalData.m_vSize; ++i ) 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. { // 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; m_lmppData.m_vSize = m_normalData.m_vSize;
@ -567,8 +567,8 @@ void SourceData::readAndPreprocess( QTextCodec* pEncoding, bool bAutoDetectUnico
if ( m_pOptionDialog->m_bIgnoreCase ) if ( m_pOptionDialog->m_bIgnoreCase )
{ {
int i; int i;
QChar* pBuf = const_cast<QChar*>(m_lmppData.m_unicodeBuf.unicode()); TQChar* pBuf = const_cast<TQChar*>(m_lmppData.m_tqunicodeBuf.tqunicode());
int ucSize = m_lmppData.m_unicodeBuf.length(); int ucSize = m_lmppData.m_tqunicodeBuf.length();
for(i=0; i<ucSize; ++i) for(i=0; i<ucSize; ++i)
{ {
pBuf[i] = pBuf[i].upper(); pBuf[i] = pBuf[i].upper();
@ -602,25 +602,25 @@ void SourceData::readAndPreprocess( QTextCodec* pEncoding, bool bAutoDetectUnico
/** Prepare the linedata vector for every input line.*/ /** 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; long skipBytes = 0;
QTextCodec* pCodec = ::detectEncoding( m_pBuf, m_size, skipBytes ); TQTextCodec* pCodec = ::detectEncoding( m_pBuf, m_size, skipBytes );
if ( pCodec != pEncoding ) if ( pCodec != pEncoding )
skipBytes=0; skipBytes=0;
QByteArray ba; TQByteArray ba;
ba.setRawData( m_pBuf+skipBytes, m_size-skipBytes ); ba.setRawData( m_pBuf+skipBytes, m_size-skipBytes );
QTextStream ts( ba, IO_ReadOnly ); TQTextStream ts( ba, IO_ReadOnly );
ts.setCodec( pEncoding); ts.setCodec( pEncoding);
//ts.setAutoDetectUnicode( false ); //ts.setAutoDetectUnicode( false );
m_unicodeBuf = ts.read(); m_tqunicodeBuf = ts.read();
ba.resetRawData( m_pBuf+skipBytes, m_size-skipBytes ); ba.resetRawData( m_pBuf+skipBytes, m_size-skipBytes );
int ucSize = m_unicodeBuf.length(); int ucSize = m_tqunicodeBuf.length();
const QChar* p = m_unicodeBuf.unicode(); const TQChar* p = m_tqunicodeBuf.tqunicode();
m_bIsText = true; m_bIsText = true;
int lines = 1; int lines = 1;
@ -680,7 +680,7 @@ void SourceData::FileData::preprocess( bool bPreserveCR, QTextCodec* pEncoding )
// Comments in white lines must remain, while comments in // Comments in white lines must remain, while comments in
// non-white lines are overwritten with spaces. // non-white lines are overwritten with spaces.
static void checkLineForComments( 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& i, // index of current position (in, out)
int size, // size of buffer int size, // size of buffer
bool& bWhite, // false if this line contains nonwhite characters (in, out) bool& bWhite, // false if this line contains nonwhite characters (in, out)
@ -770,9 +770,9 @@ static void checkLineForComments(
void SourceData::FileData::removeComments() void SourceData::FileData::removeComments()
{ {
int line=0; int line=0;
QChar* p = const_cast<QChar*>(m_unicodeBuf.unicode()); TQChar* p = const_cast<TQChar*>(m_tqunicodeBuf.tqunicode());
bool bWithinComment=false; bool bWithinComment=false;
int size = m_unicodeBuf.length(); int size = m_tqunicodeBuf.length();
for(int i=0; i<size; ++i ) for(int i=0; i<size; ++i )
{ {
// std::cout << "2 " << std::string(&p[i], m_v[line].size) << std::endl; // 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() ) if ( pManualDiffHelpList->empty() )
return; 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; ManualDiffHelpList::iterator iMDHL;
for( iMDHL = pManualDiffHelpList->begin(); iMDHL != pManualDiffHelpList->end(); ++iMDHL ) for( iMDHL = pManualDiffHelpList->begin(); iMDHL != pManualDiffHelpList->end(); ++iMDHL )
@ -1228,7 +1228,7 @@ void correctManualDiffAlignment( Diff3LineList& d3ll, ManualDiffHelpList* pManua
if (wi>=1 && wi <= 3) if (wi>=1 && wi <= 3)
{ {
// Found manual alignment for one source // Found manual tqalignment for one source
Diff3LineList::iterator iDest = i3; Diff3LineList::iterator iDest = i3;
// Move lines up until the next firstLine is found. Omit wi from move and search. // 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 // If bStrict then white space doesn't match

@ -18,12 +18,12 @@
#ifndef DIFF_H #ifndef DIFF_H
#define DIFF_H #define DIFF_H
#include <qwidget.h> #include <tqwidget.h>
#include <qpixmap.h> #include <tqpixmap.h>
#include <qtimer.h> #include <tqtimer.h>
#include <qframe.h> #include <tqframe.h>
#include <qtextstream.h> #include <tqtextstream.h>
#include <qpainter.h> #include <tqpainter.h>
#include <list> #include <list>
#include <vector> #include <vector>
#include <assert.h> #include <assert.h>
@ -48,8 +48,8 @@ typedef std::list<Diff> DiffList;
struct LineData struct LineData
{ {
const QChar* pLine; const TQChar* pLine;
const QChar* pFirstNonWhiteChar; const TQChar* pFirstNonWhiteChar;
int size; int size;
LineData(){ pLine=0; pFirstNonWhiteChar=0; size=0; /*occurances=0;*/ bContainsPureComment=false; } 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]; if ( src == 3 && lineC >= 0 ) return &m_pDiffBufferInfo->m_pLineDataC[lineC];
return 0; return 0;
} }
QString getString( int src ) const TQString getString( int src ) const
{ {
const LineData* pld = getLineData(src); const LineData* pld = getLineData(src);
if ( pld ) if ( pld )
return QString( pld->pLine, pld->size); return TQString( pld->pLine, pld->size);
else else
return QString(); return TQString();
} }
int getLineInFile( int src ) const int getLineInFile( int src ) const
{ {
@ -169,10 +169,10 @@ public:
typedef std::vector<Diff3WrapLine> Diff3WrapLineVector; typedef std::vector<Diff3WrapLine> Diff3WrapLineVector;
class TotalDiffStatus class TotalDifftqStatus
{ {
public: public:
TotalDiffStatus(){ reset(); } TotalDifftqStatus(){ reset(); }
void reset() {bBinaryAEqC=false; bBinaryBEqC=false; bBinaryAEqB=false; void reset() {bBinaryAEqC=false; bBinaryBEqC=false; bBinaryAEqB=false;
bTextAEqC=false; bTextBEqC=false; bTextAEqB=false; bTextAEqC=false; bTextBEqC=false; bTextAEqB=false;
nofUnsolvedConflicts=0; nofSolvedConflicts=0; nofUnsolvedConflicts=0; nofSolvedConflicts=0;
@ -257,34 +257,34 @@ public:
const LineData* getLineDataForDisplay() const; const LineData* getLineDataForDisplay() const;
const LineData* getLineDataForDiff() const; const LineData* getLineDataForDiff() const;
void setFilename(const QString& filename); void setFilename(const TQString& filename);
void setFileAccess( const FileAccess& fa ); void setFileAccess( const FileAccess& fa );
//FileAccess& getFileAccess(); //FileAccess& getFileAccess();
QString getFilename(); TQString getFilename();
void setAliasName(const QString& a); void setAliasName(const TQString& a);
QString getAliasName(); TQString getAliasName();
bool isEmpty(); // File was set bool isEmpty(); // File was set
bool hasData(); // Data was readable bool hasData(); // Data was readable
bool isText(); // is it pure text (vs. binary data) bool isText(); // is it pure text (vs. binary data)
bool isFromBuffer(); // was it set via setData() (vs. setFileAccess() or setFilename()) 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 bool isValid(); // Either no file is specified or reading was successful
void readAndPreprocess(QTextCodec* pEncoding, bool bAutoDetectUnicode ); void readAndPreprocess(TQTextCodec* pEncoding, bool bAutoDetectUnicode );
bool saveNormalDataAs( const QString& fileName ); bool saveNormalDataAs( const TQString& fileName );
bool isBinaryEqualWith( const SourceData& other ) const; bool isBinaryEqualWith( const SourceData& other ) const;
void reset(); void reset();
QTextCodec* getEncoding() const { return m_pEncoding; } TQTextCodec* getEncoding() const { return m_pEncoding; }
private: private:
QTextCodec* detectEncoding( const QString& fileName, QTextCodec* pFallbackCodec ); TQTextCodec* detectEncoding( const TQString& fileName, TQTextCodec* pFallbackCodec );
QString m_aliasName; TQString m_aliasName;
FileAccess m_fileAccess; FileAccess m_fileAccess;
OptionDialog* m_pOptionDialog; OptionDialog* m_pOptionDialog;
QString m_tempInputFileName; TQString m_tempInputFileName;
struct FileData struct FileData
{ {
@ -293,19 +293,19 @@ private:
const char* m_pBuf; const char* m_pBuf;
int m_size; int m_size;
int m_vSize; // Nr of lines in m_pBuf1 and size of m_v1, m_dv12 and m_dv13 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; std::vector<LineData> m_v;
bool m_bIsText; bool m_bIsText;
bool readFile( const QString& filename ); bool readFile( const TQString& filename );
bool writeFile( const QString& filename ); bool writeFile( const TQString& filename );
void preprocess(bool bPreserveCR, QTextCodec* pEncoding ); void preprocess(bool bPreserveCR, TQTextCodec* pEncoding );
void reset(); void reset();
void removeComments(); void removeComments();
void copyBufFrom( const FileData& src ); void copyBufFrom( const FileData& src );
}; };
FileData m_normalData; FileData m_normalData;
FileData m_lmppData; FileData m_lmppData;
QTextCodec* m_pEncoding; TQTextCodec* m_pEncoding;
}; };
void calcDiff3LineListTrim( Diff3LineList& d3ll, const LineData* pldA, const LineData* pldB, const LineData* pldC, ManualDiffHelpList* pManualDiffHelpList ); 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 ); void debugLineCheck( Diff3LineList& d3ll, int size, int idx );
class QStatusBar; class TQStatusBar;
class Selection class Selection
@ -365,18 +365,18 @@ public:
class OptionDialog; class OptionDialog;
QCString encodeString( const QString& s ); TQCString encodeString( const TQString& s );
// Helper class that swaps left and right for some commands. // Helper class that swaps left and right for some commands.
class MyPainter : public QPainter class MyPainter : public TQPainter
{ {
int m_factor; int m_factor;
int m_xOffset; int m_xOffset;
int m_fontWidth; int m_fontWidth;
public: public:
MyPainter(const QPaintDevice* pd, bool bRTL, int width, int fontWidth) MyPainter(const TQPaintDevice* pd, bool bRTL, int width, int fontWidth)
: QPainter(pd) : TQPainter(const_cast<TQPaintDevice*>(TQT_TQPAINTDEVICE_CONST(pd)))
{ {
if (bRTL) 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) if (m_factor==1)
QPainter::fillRect( m_xOffset + x , y, w, h, b ); TQPainter::fillRect( m_xOffset + x , y, w, h, b );
else 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; 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 ) 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'; return c==' ' || c=='\t' || c=='\r';
} }
@ -449,14 +449,14 @@ extern bool g_bIgnoreTrivialMatches;
extern int g_bAutoSolve; extern int g_bAutoSolve;
// Cursor conversions that consider g_tabSize. // Cursor conversions that consider g_tabSize.
int convertToPosInText( const QString& s, int posOnScreen, int tabSize ); int convertToPosInText( const TQString& s, int posOnScreen, int tabSize );
int convertToPosOnScreen( const QString& s, int posInText, int tabSize ); int convertToPosOnScreen( const TQString& s, int posInText, int tabSize );
enum e_CoordType { eFileCoords, eD3LLineCoords, eWrapCoords }; 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 ); TQString calcHistorySortKey( const TQString& keyOrder, TQRegExp& matchedRegExpr, const TQStringList& tqparenthesesGroupList );
bool findParenthesesGroups( const QString& s, QStringList& sl ); bool findParenthesesGroups( const TQString& s, TQStringList& sl );
#endif #endif

@ -17,23 +17,23 @@
#include "difftextwindow.h" #include "difftextwindow.h"
#include "merger.h" #include "merger.h"
#include <qpainter.h> #include <tqpainter.h>
#include <assert.h> #include <assert.h>
#include <qpixmap.h> #include <tqpixmap.h>
#include <qstatusbar.h> #include <tqstatusbar.h>
#include <qapplication.h> #include <tqapplication.h>
#include <qtooltip.h> #include <tqtooltip.h>
#include <qfont.h> #include <tqfont.h>
#include <qstringlist.h> #include <tqstringlist.h>
#include <qlineedit.h> #include <tqlineedit.h>
#include <qlabel.h> #include <tqlabel.h>
#include <qpushbutton.h> #include <tqpushbutton.h>
#include <qlayout.h> #include <tqlayout.h>
#include <qtextcodec.h> #include <tqtextcodec.h>
#include <optiondialog.h> #include <optiondialog.h>
#include <math.h> #include <math.h>
#include <cstdlib> #include <cstdlib>
#include <qdragobject.h> #include <tqdragobject.h>
#include <klocale.h> #include <klocale.h>
#include <kfiledialog.h> #include <kfiledialog.h>
@ -72,7 +72,7 @@ public:
bool m_bPaintingAllowed; bool m_bPaintingAllowed;
const LineData* m_pLineData; const LineData* m_pLineData;
int m_size; int m_size;
QString m_filename; TQString m_filename;
bool m_bWordWrap; bool m_bWordWrap;
int m_delayedDrawTimer; int m_delayedDrawTimer;
@ -81,10 +81,10 @@ public:
const ManualDiffHelpList* m_pManualDiffHelpList; const ManualDiffHelpList* m_pManualDiffHelpList;
OptionDialog* m_pOptionDialog; OptionDialog* m_pOptionDialog;
QColor m_cThis; TQColor m_cThis;
QColor m_cDiff1; TQColor m_cDiff1;
QColor m_cDiff2; TQColor m_cDiff2;
QColor m_cDiffBoth; TQColor m_cDiffBoth;
int m_fastSelectorLine1; int m_fastSelectorLine1;
int m_fastSelectorNofLines; int m_fastSelectorNofLines;
@ -103,19 +103,19 @@ public:
DiffList*& pFineDiff1, DiffList*& pFineDiff2, // return values DiffList*& pFineDiff1, DiffList*& pFineDiff2, // return values
int& changed, int& changed2 ); int& changed, int& changed2 );
QString getString( int d3lIdx ); TQString getString( int d3lIdx );
QString getLineString( int line ); TQString getLineString( int line );
void writeLine( void writeLine(
MyPainter& p, const LineData* pld, MyPainter& p, const LineData* pld,
const DiffList* pLineDiff1, const DiffList* pLineDiff2, int line, const DiffList* pLineDiff1, const DiffList* pLineDiff2, int line,
int whatChanged, int whatChanged2, int srcLineIdx, 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; Selection m_selection;
@ -129,26 +129,26 @@ public:
int convertLineOnScreenToLineInSource( int lineOnScreen, e_CoordType coordType, bool bFirstLine ); int convertLineOnScreenToLineInSource( int lineOnScreen, e_CoordType coordType, bool bFirstLine );
bool m_bSelectionInProgress; bool m_bSelectionInProgress;
QPoint m_lastKnownMousePos; TQPoint m_lastKnownMousePos;
}; };
DiffTextWindow::DiffTextWindow( DiffTextWindow::DiffTextWindow(
DiffTextWindowFrame* pParent, DiffTextWindowFrame* pParent,
QStatusBar* pStatusBar, TQStatusBar* pStatusBar,
OptionDialog* pOptionDialog, OptionDialog* pOptionDialog,
int winIdx int winIdx
) )
: QWidget(pParent, 0, Qt::WResizeNoErase | Qt::WRepaintNoErase) : TQWidget(pParent, 0, TQt::WResizeNoErase | TQt::WRepaintNoErase)
{ {
d = new DiffTextWindowData(this); d = new DiffTextWindowData(this);
d->m_pDiffTextWindowFrame = pParent; d->m_pDiffTextWindowFrame = pParent;
setFocusPolicy( ClickFocus ); setFocusPolicy( TQ_ClickFocus );
setAcceptDrops( true ); setAcceptDrops( true );
d->m_pOptionDialog = pOptionDialog; d->m_pOptionDialog = pOptionDialog;
init( 0, 0, 0, 0, 0, false ); init( 0, 0, 0, 0, 0, false );
setMinimumSize(QSize(20,20)); setMinimumSize(TQSize(20,20));
d->m_pStatusBar = pStatusBar; d->m_pStatusBar = pStatusBar;
d->m_bPaintingAllowed = true; d->m_bPaintingAllowed = true;
@ -164,7 +164,7 @@ DiffTextWindow::~DiffTextWindow()
} }
void DiffTextWindow::init( void DiffTextWindow::init(
const QString& filename, const TQString& filename,
const LineData* pLineData, const LineData* pLineData,
int size, int size,
const Diff3LineVector* pDiff3LineVector, 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(). // Note that the corresponding drop is handled in KDiff3App::eventFilter().
} }
@ -244,7 +244,7 @@ void DiffTextWindow::setFirstLine(int firstLine)
} }
else else
{ {
QWidget::scroll( 0, deltaY ); TQWidget::scroll( 0, deltaY );
} }
d->m_pDiffTextWindowFrame->setFirstLine( d->m_firstLine ); d->m_pDiffTextWindowFrame->setFirstLine( d->m_firstLine );
} }
@ -265,12 +265,12 @@ void DiffTextWindow::setFirstColumn(int firstCol)
d->m_firstColumn = newFirstColumn; d->m_firstColumn = newFirstColumn;
QRect r( xOffset, 0, width()-xOffset, height() ); TQRect r( xOffset, 0, width()-xOffset, height() );
if ( d->m_pOptionDialog->m_bRightToLeftLanguage ) if ( d->m_pOptionDialog->m_bRightToLeftLanguage )
{ {
deltaX = -deltaX; 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 ) if ( d->m_bSelectionInProgress && d->m_selection.firstLine != -1 )
@ -282,7 +282,7 @@ void DiffTextWindow::setFirstColumn(int firstCol)
} }
else 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 ); int l = pD3l->getLineInFile( d->m_winIdx );
QString s; TQString s;
if ( l!=-1 ) if ( l!=-1 )
s.sprintf("File %s: Line %d", d->m_filename.ascii(), l+1 ); s.sprintf("File %s: Line %d", d->m_filename.ascii(), l+1 );
else else
@ -390,13 +390,13 @@ void DiffTextWindow::showStatusLine(int line )
} }
} }
void DiffTextWindow::focusInEvent(QFocusEvent* e) void DiffTextWindow::focusInEvent(TQFocusEvent* e)
{ {
emit gotFocus(); emit gotFocus();
QWidget::focusInEvent(e); TQWidget::focusInEvent(e);
} }
void DiffTextWindow::mousePressEvent ( QMouseEvent* e ) void DiffTextWindow::mousePressEvent ( TQMouseEvent* e )
{ {
if ( e->button() == Qt::LeftButton ) if ( e->button() == Qt::LeftButton )
{ {
@ -421,15 +421,15 @@ void DiffTextWindow::mousePressEvent ( QMouseEvent* e )
} }
} }
bool isCTokenChar( QChar c ) bool isCTokenChar( TQChar c )
{ {
return (c=='_') || return (c=='_') ||
( c>='A' && c<='Z' ) || ( c>='a' && c<='z' ) || ( c.unicode()>='A' && c.unicode()<='Z' ) || ( c.unicode()>='a' && c.unicode()<='z' ) ||
(c>='0' && c<='9'); (c.unicode()>='0' && c.unicode()<='9');
} }
/// Calculate where a token starts and ends, given the x-position on screen. /// 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 // Cursor conversions that consider g_tabSize
int pos = convertToPosInText( s, max2( 0, posOnScreen ), 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_bSelectionInProgress = false;
d->m_lastKnownMousePos = e->pos(); d->m_lastKnownMousePos = e->pos();
@ -465,7 +465,7 @@ void DiffTextWindow::mouseDoubleClickEvent( QMouseEvent* e )
convertToLinePos( e->x(), e->y(), line, pos ); convertToLinePos( e->x(), e->y(), line, pos );
// Get the string data of the current line // Get the string data of the current line
QString s; TQString s;
if ( d->m_bWordWrap ) if ( d->m_bWordWrap )
{ {
if ( line<0 || line >= (int)d->m_diff3WrapLineVector.size() ) 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_bSelectionInProgress = false;
d->m_lastKnownMousePos = e->pos(); d->m_lastKnownMousePos = e->pos();
@ -514,7 +514,7 @@ void DiffTextWindow::mouseReleaseEvent ( QMouseEvent* e )
inline int sqr(int x){return x*x;} inline int sqr(int x){return x*x;}
void DiffTextWindow::mouseMoveEvent ( QMouseEvent * e ) void DiffTextWindow::mouseMoveEvent ( TQMouseEvent * e )
{ {
int line; int line;
int pos; int pos;
@ -528,7 +528,7 @@ void DiffTextWindow::mouseMoveEvent ( QMouseEvent * e )
showStatusLine( line ); showStatusLine( line );
// Scroll because mouse moved out of the window // Scroll because mouse moved out of the window
const QFontMetrics& fm = fontMetrics(); const TQFontMetrics& fm = fontMetrics();
int fontWidth = fm.width('W'); int fontWidth = fm.width('W');
int deltaX=0; int deltaX=0;
int deltaY=0; int deltaY=0;
@ -569,7 +569,7 @@ void DiffTextWindowData::myUpdate(int afterMilliSecs)
m_delayedDrawTimer = m_pDiffTextWindow->startTimer( afterMilliSecs ); m_delayedDrawTimer = m_pDiffTextWindow->startTimer( afterMilliSecs );
} }
void DiffTextWindow::timerEvent(QTimerEvent*) void DiffTextWindow::timerEvent(TQTimerEvent*)
{ {
killTimer(d->m_delayedDrawTimer); killTimer(d->m_delayedDrawTimer);
d->m_delayedDrawTimer = 0; d->m_delayedDrawTimer = 0;
@ -597,7 +597,7 @@ void DiffTextWindow::timerEvent(QTimerEvent*)
if ( y1<height() && y2>0 ) if ( y1<height() && y2>0 )
{ {
QRect invalidRect = QRect( 0, y1, width(), y2-y1 ); TQRect invalidRect = TQRect( 0, y1, width(), y2-y1 );
update( invalidRect ); update( invalidRect );
} }
} }
@ -622,7 +622,7 @@ void DiffTextWindow::resetSelection()
void DiffTextWindow::convertToLinePos( int x, int y, int& line, int& pos ) void DiffTextWindow::convertToLinePos( int x, int y, int& line, int& pos )
{ {
const QFontMetrics& fm = fontMetrics(); const TQFontMetrics& fm = fontMetrics();
int fontHeight = fm.height(); int fontHeight = fm.height();
int fontWidth = fm.width('W'); int fontWidth = fm.width('W');
int xOffset = ( d->leftInfoWidth() - d->m_firstColumn ) * fontWidth; int xOffset = ( d->leftInfoWidth() - d->m_firstColumn ) * fontWidth;
@ -715,14 +715,14 @@ void DiffTextWindowData::writeLine(
int wrapLineOffset, int wrapLineOffset,
int wrapLineLength, int wrapLineLength,
bool bWrapLine, bool bWrapLine,
const QRect& invalidRect, const TQRect& invalidRect,
int deviceWidth int deviceWidth
) )
{ {
QFont normalFont = p.font(); TQFont normalFont = p.font();
QFont diffFont = normalFont; TQFont diffFont = normalFont;
diffFont.setItalic( m_pOptionDialog->m_bItalicForDeltas ); diffFont.setItalic( m_pOptionDialog->m_bItalicForDeltas );
const QFontMetrics& fm = p.fontMetrics(); const TQFontMetrics& fm = p.fontMetrics();
int fontHeight = fm.height(); int fontHeight = fm.height();
int fontAscent = fm.ascent(); int fontAscent = fm.ascent();
int fontDescent = fm.descent(); int fontDescent = fm.descent();
@ -731,7 +731,7 @@ void DiffTextWindowData::writeLine(
int xOffset = (leftInfoWidth() - m_firstColumn)*fontWidth; int xOffset = (leftInfoWidth() - m_firstColumn)*fontWidth;
int yOffset = (line-m_firstLine) * fontHeight; int yOffset = (line-m_firstLine) * fontHeight;
QRect lineRect( 0, yOffset, deviceWidth, fontHeight ); TQRect lineRect( 0, yOffset, deviceWidth, fontHeight );
if ( ! invalidRect.intersects( lineRect ) ) if ( ! invalidRect.intersects( lineRect ) )
{ {
return; return;
@ -741,8 +741,8 @@ void DiffTextWindowData::writeLine(
int fastSelectorLine2 = m_pDiffTextWindow->convertDiff3LineIdxToLine(m_fastSelectorLine1+m_fastSelectorNofLines)-1; int fastSelectorLine2 = m_pDiffTextWindow->convertDiff3LineIdxToLine(m_fastSelectorLine1+m_fastSelectorNofLines)-1;
bool bFastSelectionRange = (line>=fastSelectorLine1 && line<= fastSelectorLine2 ); bool bFastSelectionRange = (line>=fastSelectorLine1 && line<= fastSelectorLine2 );
QColor bgColor = m_pOptionDialog->m_bgColor; TQColor bgColor = m_pOptionDialog->m_bgColor;
QColor diffBgColor = m_pOptionDialog->m_diffBgColor; TQColor diffBgColor = m_pOptionDialog->m_diffBgColor;
if ( bFastSelectionRange ) if ( bFastSelectionRange )
{ {
@ -757,7 +757,7 @@ void DiffTextWindowData::writeLine(
if ( pLineDiff1 != 0 ) changed |= 1; if ( pLineDiff1 != 0 ) changed |= 1;
if ( pLineDiff2 != 0 ) changed |= 2; if ( pLineDiff2 != 0 ) changed |= 2;
QColor c = m_pOptionDialog->m_fgColor; TQColor c = m_pOptionDialog->m_fgColor;
if ( changed == 2 ) { if ( changed == 2 ) {
c = m_cDiff2; c = m_cDiff2;
} else if ( changed == 1 ) { } else if ( changed == 1 ) {
@ -787,11 +787,11 @@ void DiffTextWindowData::writeLine(
} }
} }
QString s=" "; TQString s=" ";
// Convert tabs // Convert tabs
int outPos = 0; int outPos = 0;
QString lineString( pld->pLine, pld->size ); TQString lineString( pld->pLine, pld->size );
int lineLength = m_bWordWrap ? wrapLineOffset+wrapLineLength : lineString.length(); int lineLength = m_bWordWrap ? wrapLineOffset+wrapLineLength : lineString.length();
for( i=wrapLineOffset; i<lineLength; ++i ) for( i=wrapLineOffset; i<lineLength; ++i )
@ -808,7 +808,7 @@ void DiffTextWindowData::writeLine(
s[0] = lineString[i]; s[0] = lineString[i];
} }
QColor c = m_pOptionDialog->m_fgColor; TQColor c = m_pOptionDialog->m_fgColor;
int cchanged = charChanged[i] | whatChanged; int cchanged = charChanged[i] | whatChanged;
if ( cchanged == 2 ) { if ( cchanged == 2 ) {
@ -825,9 +825,9 @@ void DiffTextWindowData::writeLine(
c = m_pOptionDialog->m_fgColor; 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 ) 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 ( invalidRect.intersects( outRect ) )
{ {
if( !m_selection.within( line, outPos ) ) if( !m_selection.within( line, outPos ) )
@ -835,7 +835,7 @@ void DiffTextWindowData::writeLine(
if( c!=m_pOptionDialog->m_fgColor ) if( c!=m_pOptionDialog->m_fgColor )
{ {
QColor lightc = diffBgColor; TQColor lightc = diffBgColor;
p.fillRect( xOffset + fontWidth*outPos, yOffset, p.fillRect( xOffset + fontWidth*outPos, yOffset,
fontWidth*spaces, fontHeight, lightc ); fontWidth*spaces, fontHeight, lightc );
p.setFont(diffFont); p.setFont(diffFont);
@ -860,9 +860,9 @@ void DiffTextWindowData::writeLine(
else else
{ {
p.fillRect( xOffset + fontWidth*outPos, yOffset, 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 ); p.drawText( xOffset + fontWidth*outPos, yOffset + fontAscent, s );
m_selection.bSelectionContainsData = true; m_selection.bSelectionContainsData = true;
@ -875,7 +875,7 @@ void DiffTextWindowData::writeLine(
if( m_selection.lineWithin( line ) && m_selection.lineWithin( line+1 ) ) if( m_selection.lineWithin( line ) && m_selection.lineWithin( line+1 ) )
{ {
p.fillRect( xOffset + fontWidth*outPos, yOffset, 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 ) if ( m_pOptionDialog->m_bShowLineNumbers && !bWrapLine )
{ {
QString num; TQString num;
num.sprintf( "%0*d", m_lineNumberWidth, srcLineIdx+1); num.sprintf( "%0*d", m_lineNumberWidth, srcLineIdx+1);
p.drawText( 0, yOffset + fontAscent, num ); p.drawText( 0, yOffset + fontAscent, num );
//p.drawLine( xLeft -1, yOffset, xLeft -1, yOffset+fontHeight-1 ); //p.drawLine( xLeft -1, yOffset, xLeft -1, yOffset+fontHeight-1 );
} }
if ( !bWrapLine || wrapLineLength>0 ) 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.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 ) if ( c!=m_pOptionDialog->m_fgColor && whatChanged2==0 )//&& whatChanged==0 )
@ -905,7 +905,7 @@ void DiffTextWindowData::writeLine(
if ( m_pOptionDialog->m_bShowWhiteSpace ) if ( m_pOptionDialog->m_bShowWhiteSpace )
{ {
p.setBrushOrigin(0,0); 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 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 || if ( d->m_pDiff3LineVector==0 || ! d->m_bPaintingAllowed ||
( d->m_diff3WrapLineVector.empty() && d->m_bWordWrap ) ) ( d->m_diff3WrapLineVector.empty() && d->m_bWordWrap ) )
return; return;
QRect invalidRect = e->rect(); TQRect invalidRect = e->rect();
if ( invalidRect.isEmpty() ) if ( invalidRect.isEmpty() )
return; return;
@ -952,28 +952,28 @@ void DiffTextWindow::paintEvent( QPaintEvent* e )
int endLine = min2( d->m_firstLine + getNofVisibleLines()+2, getNofLines() ); int endLine = min2( d->m_firstLine + getNofVisibleLines()+2, getNofLines() );
//if ( invalidRect.size()==size() ) //if ( invalidRect.size()==size() )
{ // double buffering, obsolete with Qt4 { // double buffering, obsolete with TQt4
QPainter painter(this); // Remove for Qt4 TQPainter painter(this); // Remove for TQt4
QPixmap pixmap( invalidRect.size() );// Remove for Qt4 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.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 ); 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.drawLine( m_invalidRect.x(), m_invalidRect.y(), m_invalidRect.right(), m_invalidRect.bottom() ); // For test only
p.end(); p.end();
painter.drawPixmap( invalidRect.x(), invalidRect.y(), pixmap );// Remove for Qt4 painter.drawPixmap( invalidRect.x(), invalidRect.y(), pixmap );// Remove for TQt4
} }
// else // else
// { // no double buffering // { // no double buffering
// MyPainter p( this, d->m_pOptionDialog->m_bRightToLeftLanguage, width(), fontMetrics().width('W') ); // MyPainter p( this, d->m_pOptionDialog->m_bRightToLeftLanguage, width(), fontMetrics().width('W') );
// p.setFont( font() ); // 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 ); // d->draw( p, invalidRect, width(), d->m_firstLine, endLine );
// } // }
@ -988,7 +988,7 @@ void DiffTextWindow::paintEvent( QPaintEvent* e )
emit newSelection(); 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 || if ( d->m_pDiff3LineVector==0 || ! d->m_bPaintingAllowed ||
( d->m_diff3WrapLineVector.empty() && d->m_bWordWrap ) ) ( 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') ); // MyPainter p( this, d->m_pOptionDialog->m_bRightToLeftLanguage, width(), fontMetrics().width('W') );
int oldFirstLine = d->m_firstLine; int oldFirstLine = d->m_firstLine;
d->m_firstLine = firstLine; d->m_firstLine = firstLine;
QRect invalidRect = QRect(0,0,QCOORD_MAX,QCOORD_MAX); TQRect invalidRect = TQRect(0,0,TQCOORD_MAX,TQCOORD_MAX);
QColor bgColor = d->m_pOptionDialog->m_bgColor; TQColor bgColor = d->m_pOptionDialog->m_bgColor;
d->m_pOptionDialog->m_bgColor = Qt::white; d->m_pOptionDialog->m_bgColor = TQt::white;
d->draw( p, invalidRect, p.window().width(), firstLine, min2(firstLine+nofLinesPerPage,getNofLines()) ); d->draw( p, invalidRect, p.window().width(), firstLine, min2(firstLine+nofLinesPerPage,getNofLines()) );
d->m_pOptionDialog->m_bgColor = bgColor; d->m_pOptionDialog->m_bgColor = bgColor;
d->m_firstLine = oldFirstLine; 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; 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 ); getLineInfo( *d3l, srcLineIdx, pFineDiff1, pFineDiff2, changed, changed2 );
writeLine( writeLine(
p, // QPainter p, // TQPainter
srcLineIdx == -1 ? 0 : &m_pLineData[srcLineIdx], // Text in this line srcLineIdx == -1 ? 0 : &m_pLineData[srcLineIdx], // Text in this line
pFineDiff1, pFineDiff1,
pFineDiff2, 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() ) if ( d3lIdx<0 || d3lIdx>=(int)m_pDiff3LineVector->size() )
return QString(); return TQString();
const Diff3Line* d3l = (*m_pDiff3LineVector)[d3lIdx]; const Diff3Line* d3l = (*m_pDiff3LineVector)[d3lIdx];
DiffList* pFineDiff1; DiffList* pFineDiff1;
DiffList* pFineDiff2; DiffList* pFineDiff2;
@ -1087,16 +1087,16 @@ QString DiffTextWindowData::getString( int d3lIdx )
int lineIdx; int lineIdx;
getLineInfo( *d3l, lineIdx, pFineDiff1, pFineDiff2, changed, changed2 ); getLineInfo( *d3l, lineIdx, pFineDiff1, pFineDiff2, changed, changed2 );
if (lineIdx==-1) return QString(); if (lineIdx==-1) return TQString();
else else
{ {
const LineData* ld = &m_pLineData[lineIdx]; 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 ) if ( m_bWordWrap )
{ {
@ -1150,19 +1150,19 @@ void DiffTextWindowData::getLineInfo(
void DiffTextWindow::resizeEvent( QResizeEvent* e ) void DiffTextWindow::resizeEvent( TQResizeEvent* e )
{ {
QSize s = e->size(); TQSize s = e->size();
QFontMetrics fm = fontMetrics(); TQFontMetrics fm = fontMetrics();
int visibleLines = s.height()/fm.height()-2; int visibleLines = s.height()/fm.height()-2;
int visibleColumns = s.width()/fm.width('W') - d->leftInfoWidth(); int visibleColumns = s.width()/fm.width('W') - d->leftInfoWidth();
emit resizeSignal( visibleColumns, visibleLines ); emit resizeSignal( visibleColumns, visibleLines );
QWidget::resizeEvent(e); TQWidget::resizeEvent(e);
} }
int DiffTextWindow::getNofVisibleLines() int DiffTextWindow::getNofVisibleLines()
{ {
QFontMetrics fm = fontMetrics(); TQFontMetrics fm = fontMetrics();
int fmh = fm.height(); int fmh = fm.height();
int h = height(); int h = height();
return h/fmh -1;//height()/fm.height()-2; return h/fmh -1;//height()/fm.height()-2;
@ -1170,13 +1170,13 @@ int DiffTextWindow::getNofVisibleLines()
int DiffTextWindow::getNofVisibleColumns() int DiffTextWindow::getNofVisibleColumns()
{ {
QFontMetrics fm = fontMetrics(); TQFontMetrics fm = fontMetrics();
return width()/fm.width('W') - d->leftInfoWidth(); return width()/fm.width('W') - d->leftInfoWidth();
} }
QString DiffTextWindow::getSelection() TQString DiffTextWindow::getSelection()
{ {
QString selectionString; TQString selectionString;
int line=0; int line=0;
int lineIdx=0; int lineIdx=0;
@ -1193,9 +1193,9 @@ QString DiffTextWindow::getSelection()
if( lineIdx != -1 ) 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; int size = d->m_pLineData[lineIdx].size;
QString lineString = QString( pLine, size ); TQString lineString = TQString( pLine, size );
if ( d->m_bWordWrap ) if ( d->m_bWordWrap )
{ {
@ -1238,7 +1238,7 @@ QString DiffTextWindow::getSelection()
return selectionString; 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 it = d3vLine;
int endIt = bDirDown ? (int)d->m_pDiff3LineVector->size() : -1; 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 ) for( ; it!=endIt; it+=step )
{ {
QString line = d->getString( it ); TQString line = d->getString( it );
if ( !line.isEmpty() ) if ( !line.isEmpty() )
{ {
int pos = line.find( s, startPos, bCaseSensitive ); int pos = line.tqfind( s, startPos, bCaseSensitive );
if ( pos != -1 ) if ( pos != -1 )
{ {
d3vLine = it; d3vLine = it;
@ -1324,7 +1324,7 @@ void DiffTextWindow::setSelection( int firstLine, int startPos, int lastLine, in
if ( d->m_bWordWrap && d->m_pDiff3LineVector!=0 ) if ( d->m_bWordWrap && d->m_pDiff3LineVector!=0 )
{ {
QString s1 = d->getString(firstLine); TQString s1 = d->getString(firstLine);
int firstWrapLine = convertDiff3LineIdxToLine(firstLine); int firstWrapLine = convertDiff3LineIdxToLine(firstLine);
int wrapStartPos = startPos; int wrapStartPos = startPos;
while ( wrapStartPos > d->m_diff3WrapLineVector[firstWrapLine].wrapLineLength ) while ( wrapStartPos > d->m_diff3WrapLineVector[firstWrapLine].wrapLineLength )
@ -1334,7 +1334,7 @@ void DiffTextWindow::setSelection( int firstLine, int startPos, int lastLine, in
++firstWrapLine; ++firstWrapLine;
} }
QString s2 = d->getString(lastLine); TQString s2 = d->getString(lastLine);
int lastWrapLine = convertDiff3LineIdxToLine(lastLine); int lastWrapLine = convertDiff3LineIdxToLine(lastLine);
int wrapEndPos = endPos; int wrapEndPos = endPos;
while ( wrapEndPos > d->m_diff3WrapLineVector[lastWrapLine].wrapLineLength ) 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 // Returns the number of wrapped lines
// if pWrappedLines != 0 then the stringlist will contain the 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) if (nofColumns<=0)
nofColumns = 1; nofColumns = 1;
@ -1427,7 +1427,7 @@ int wordWrap( const QString& origLine, int nofColumns, Diff3WrapLine* pDiff3Wrap
} }
else else
{ {
int wsPos = max2( origLine.findRev( ' ', wrapPos ), origLine.findRev( '\t', wrapPos ) ); int wsPos = max2( origLine.tqfindRev( ' ', wrapPos ), origLine.tqfindRev( '\t', wrapPos ) );
if ( wsPos > pos ) if ( wsPos > pos )
{ {
@ -1460,7 +1460,7 @@ void DiffTextWindow::convertSelectionToD3LCoords()
// convert the d->m_selection to unwrapped coordinates: Later restore to new coords // convert the d->m_selection to unwrapped coordinates: Later restore to new coords
int firstD3LIdx, firstD3LPos; 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 ); int firstPosInText = convertToPosInText( s, d->m_selection.beginPos(), d->m_pOptionDialog->m_tabSize );
convertLineCoordsToD3LCoords( d->m_selection.beginLine(), firstPosInText, firstD3LIdx, firstD3LPos ); 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(); int size = d->m_pDiff3LineVector->size();
for( i=0; i<size; ++i ) 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] ); int linesNeeded = wordWrap( s, nofVisibleColumns, wrapLineVectorSize==0 ? 0 : &d->m_diff3WrapLineVector[wrapLineIdx] );
Diff3Line& d3l = *(*d->m_pDiff3LineVector)[i]; Diff3Line& d3l = *(*d->m_pDiff3LineVector)[i];
if ( d3l.linesNeededForDisplay<linesNeeded ) if ( d3l.linesNeededForDisplay<linesNeeded )
@ -1561,31 +1561,31 @@ class DiffTextWindowFrameData
{ {
public: public:
DiffTextWindow* m_pDiffTextWindow; DiffTextWindow* m_pDiffTextWindow;
QLineEdit* m_pFileSelection; TQLineEdit* m_pFileSelection;
QPushButton* m_pBrowseButton; TQPushButton* m_pBrowseButton;
OptionDialog* m_pOptionDialog; OptionDialog* m_pOptionDialog;
QLabel* m_pLabel; TQLabel* m_pLabel;
QLabel* m_pTopLine; TQLabel* m_pTopLine;
QWidget* m_pTopLineWidget; TQWidget* m_pTopLineWidget;
}; };
DiffTextWindowFrame::DiffTextWindowFrame( QWidget* pParent, QStatusBar* pStatusBar, OptionDialog* pOptionDialog, int winIdx ) DiffTextWindowFrame::DiffTextWindowFrame( TQWidget* pParent, TQStatusBar* pStatusBar, OptionDialog* pOptionDialog, int winIdx )
: QWidget( pParent ) : TQWidget( pParent )
{ {
d = new DiffTextWindowFrameData; d = new DiffTextWindowFrameData;
d->m_pOptionDialog = pOptionDialog; d->m_pOptionDialog = pOptionDialog;
d->m_pTopLineWidget = new QWidget(this); d->m_pTopLineWidget = new TQWidget(this);
d->m_pFileSelection = new QLineEdit(d->m_pTopLineWidget); d->m_pFileSelection = new TQLineEdit(d->m_pTopLineWidget);
d->m_pBrowseButton = new QPushButton( "...",d->m_pTopLineWidget ); d->m_pBrowseButton = new TQPushButton( "...",d->m_pTopLineWidget );
d->m_pBrowseButton->setFixedWidth( 30 ); d->m_pBrowseButton->setFixedWidth( 30 );
connect(d->m_pBrowseButton,SIGNAL(clicked()), this, SLOT(slotBrowseButtonClicked())); connect(d->m_pBrowseButton,TQT_SIGNAL(clicked()), this, TQT_SLOT(slotBrowseButtonClicked()));
connect(d->m_pFileSelection,SIGNAL(returnPressed()), this, SLOT(slotReturnPressed())); connect(d->m_pFileSelection,TQT_SIGNAL(returnPressed()), this, TQT_SLOT(slotReturnPressed()));
d->m_pLabel = new QLabel("A:",d->m_pTopLineWidget); d->m_pLabel = new TQLabel("A:",d->m_pTopLineWidget);
d->m_pTopLine = new QLabel(d->m_pTopLineWidget); d->m_pTopLine = new TQLabel(d->m_pTopLineWidget);
d->m_pDiffTextWindow = 0; d->m_pDiffTextWindow = 0;
d->m_pDiffTextWindow = new DiffTextWindow( this, pStatusBar, pOptionDialog, winIdx ); 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->setMargin(2);
pHL->setSpacing(2); pHL->setSpacing(2);
@ -1594,7 +1594,7 @@ DiffTextWindowFrame::DiffTextWindowFrame( QWidget* pParent, QStatusBar* pStatusB
pHL->addWidget( d->m_pBrowseButton, 0 ); pHL->addWidget( d->m_pBrowseButton, 0 );
pHL->addWidget( d->m_pTopLine, 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_pTopLineWidget, 0 );
pVL->addWidget( d->m_pDiffTextWindow, 1 ); pVL->addWidget( d->m_pDiffTextWindow, 1 );
@ -1614,9 +1614,9 @@ void DiffTextWindowFrame::init()
DiffTextWindow* pDTW = d->m_pDiffTextWindow; DiffTextWindow* pDTW = d->m_pDiffTextWindow;
if ( pDTW ) if ( pDTW )
{ {
QString s = pDTW->d->m_filename ; TQString s = pDTW->d->m_filename ;
d->m_pFileSelection->setText( QDir::convertSeparators(s) ); d->m_pFileSelection->setText( TQDir::convertSeparators(s) );
QString winId = pDTW->d->m_winIdx==1 ? TQString winId = pDTW->d->m_winIdx==1 ?
( pDTW->d->m_bTriple?"A (Base)":"A") : ( pDTW->d->m_bTriple?"A (Base)":"A") :
( pDTW->d->m_winIdx==2 ? "B" : "C" ); ( pDTW->d->m_winIdx==2 ? "B" : "C" );
d->m_pLabel->setText( winId + ":" ); d->m_pLabel->setText( winId + ":" );
@ -1641,22 +1641,22 @@ void DiffTextWindowFrame::setFirstLine( int firstLine )
DiffTextWindow* pDTW = d->m_pDiffTextWindow; DiffTextWindow* pDTW = d->m_pDiffTextWindow;
if ( pDTW && pDTW->d->m_pDiff3LineVector ) 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 lineNumberWidth = (int)log10((double)pDTW->d->m_size)+1;
int l=pDTW->calcTopLineInFile(firstLine); int l=pDTW->calcTopLineInFile(firstLine);
int w = d->m_pTopLine->fontMetrics().width( int w = d->m_pTopLine->fontMetrics().width(
s+" "+QString().fill('0',lineNumberWidth)); s+" "+TQString().fill('0',lineNumberWidth));
d->m_pTopLine->setMinimumWidth( w ); d->m_pTopLine->setMinimumWidth( w );
if (l==-1) if (l==-1)
s = i18n("End"); s = i18n("End");
else else
s += " " + QString::number( l+1 ); s += " " + TQString::number( l+1 );
d->m_pTopLine->setText( s ); d->m_pTopLine->setText( s );
d->m_pTopLine->repaint(); d->m_pTopLine->tqrepaint();
} }
} }
@ -1665,51 +1665,51 @@ DiffTextWindow* DiffTextWindowFrame::getDiffTextWindow()
return d->m_pDiffTextWindow; return d->m_pDiffTextWindow;
} }
bool DiffTextWindowFrame::eventFilter( QObject* o, QEvent* e ) bool DiffTextWindowFrame::eventFilter( TQObject* o, TQEvent* e )
{ {
DiffTextWindow* pDTW = d->m_pDiffTextWindow; 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; TQColor c1 = d->m_pOptionDialog->m_bgColor;
QColor c2 = pDTW->d->m_cThis; TQColor c2 = pDTW->d->m_cThis;
QPalette p = d->m_pTopLineWidget->palette(); TQPalette p = d->m_pTopLineWidget->palette();
if ( e->type()==QEvent::FocusOut ) if ( e->type()==TQEvent::FocusOut )
std::swap(c1,c2); std::swap(c1,c2);
p.setColor(QColorGroup::Background, c2); p.setColor(TQColorGroup::Background, c2);
d->m_pTopLineWidget->setPalette( p ); d->m_pTopLineWidget->setPalette( p );
d->m_pBrowseButton->setPalette( p ); d->m_pBrowseButton->setPalette( p );
d->m_pFileSelection->setPalette( p ); d->m_pFileSelection->setPalette( p );
p.setColor(QColorGroup::Foreground, c1); p.setColor(TQColorGroup::Foreground, c1);
d->m_pLabel->setPalette( p ); d->m_pLabel->setPalette( p );
d->m_pTopLine->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; TQStringList lst;
QUriDrag::decodeLocalFiles( d, lst ); TQUriDrag::decodeLocalFiles( d, lst );
if ( lst.count() > 0 ) if ( lst.count() > 0 )
{ {
static_cast<QLineEdit*>(o)->setText( lst[0] ); static_cast<TQLineEdit*>(TQT_TQWIDGET(o))->setText( lst[0] );
static_cast<QLineEdit*>(o)->setFocus(); static_cast<TQLineEdit*>(TQT_TQWIDGET(o))->setFocus();
emit fileNameChanged( lst[0], pDTW->d->m_winIdx ); emit fileNameChanged( lst[0], pDTW->d->m_winIdx );
return true; 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() ) /*if ( d->mimeData()->hasUrls() )
{ {
QList<QUrl> lst = d->mimeData()->urls(); TQList<TQUrl> lst = d->mimeData()->urls();
if ( !lst.empty() ) if ( !lst.empty() )
{ {
static_cast<QLineEdit*>(o)->setText( lst[0].toLocalFile() ); static_cast<TQLineEdit*>(o)->setText( lst[0].toLocalFile() );
static_cast<QLineEdit*>(o)->setFocus(); static_cast<TQLineEdit*>(o)->setFocus();
emit fileNameChanged( lst[0], pDTW->d->m_winIdx ); emit fileNameChanged( lst[0], pDTW->d->m_winIdx );
return true; return true;
} }
@ -1729,7 +1729,7 @@ void DiffTextWindowFrame::slotReturnPressed()
void DiffTextWindowFrame::slotBrowseButtonClicked() void DiffTextWindowFrame::slotBrowseButtonClicked()
{ {
QString current = d->m_pFileSelection->text(); TQString current = d->m_pFileSelection->text();
KURL newURL = KFileDialog::getOpenURL( current, 0, this); KURL newURL = KFileDialog::getOpenURL( current, 0, this);
if ( !newURL.isEmpty() ) 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) if (c!=0)
return c->fromUnicode( s ); return c->fromUnicode( s );
else else
return QCString( s.latin1() ); return TQCString( s.latin1() );
} }
#include "difftextwindow.moc" #include "difftextwindow.moc"

@ -20,26 +20,27 @@
#include "diff.h" #include "diff.h"
#include <qwidget.h> #include <tqwidget.h>
class QStatusBar; class TQStatusBar;
class OptionDialog; class OptionDialog;
class DiffTextWindowData; class DiffTextWindowData;
class DiffTextWindowFrame; class DiffTextWindowFrame;
class DiffTextWindow : public QWidget class DiffTextWindow : public TQWidget
{ {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
DiffTextWindow( DiffTextWindow(
DiffTextWindowFrame* pParent, DiffTextWindowFrame* pParent,
QStatusBar* pStatusBar, TQStatusBar* pStatusBar,
OptionDialog* pOptionDialog, OptionDialog* pOptionDialog,
int winIdx int winIdx
); );
~DiffTextWindow(); ~DiffTextWindow();
void init( void init(
const QString& fileName, const TQString& fileName,
const LineData* pLineData, const LineData* pLineData,
int size, int size,
const Diff3LineVector* pDiff3LineVector, const Diff3LineVector* pDiff3LineVector,
@ -49,7 +50,7 @@ public:
void reset(); void reset();
void convertToLinePos( int x, int y, int& line, int& pos ); void convertToLinePos( int x, int y, int& line, int& pos );
QString getSelection(); TQString getSelection();
int getFirstLine(); int getFirstLine();
int calcTopLineInFile( int firstLine ); int calcTopLineInFile( int firstLine );
@ -66,13 +67,13 @@ public:
void convertSelectionToD3LCoords(); 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 setSelection( int firstLine, int startPos, int lastLine, int endPos, int& l, int& p );
void getSelectionRange( int* firstLine, int* lastLine, e_CoordType coordType ); void getSelectionRange( int* firstLine, int* lastLine, e_CoordType coordType );
void setPaintingAllowed( bool bAllowPainting ); void setPaintingAllowed( bool bAllowPainting );
void recalcWordWrap( bool bWordWrap, int wrapLineVectorSize, int nofVisibleColumns ); 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: signals:
void resizeSignal( int nofVisibleColumns, int nofVisibleLines ); void resizeSignal( int nofVisibleColumns, int nofVisibleLines );
void scroll( int deltaX, int deltaY ); void scroll( int deltaX, int deltaY );
@ -89,17 +90,17 @@ public slots:
void setFastSelectorRange( int line1, int nofLines ); void setFastSelectorRange( int line1, int nofLines );
protected: protected:
virtual void mousePressEvent ( QMouseEvent * ); virtual void mousePressEvent ( TQMouseEvent * );
virtual void mouseReleaseEvent ( QMouseEvent * ); virtual void mouseReleaseEvent ( TQMouseEvent * );
virtual void mouseMoveEvent ( QMouseEvent * ); virtual void mouseMoveEvent ( TQMouseEvent * );
virtual void mouseDoubleClickEvent ( QMouseEvent * e ); virtual void mouseDoubleClickEvent ( TQMouseEvent * e );
virtual void paintEvent( QPaintEvent* ); virtual void paintEvent( TQPaintEvent* );
virtual void dragEnterEvent( QDragEnterEvent* e ); virtual void dragEnterEvent( TQDragEnterEvent* e );
virtual void focusInEvent( QFocusEvent* e ); virtual void focusInEvent( TQFocusEvent* e );
virtual void resizeEvent( QResizeEvent* ); virtual void resizeEvent( TQResizeEvent* );
virtual void timerEvent(QTimerEvent*); virtual void timerEvent(TQTimerEvent*);
private: private:
DiffTextWindowData* d; DiffTextWindowData* d;
@ -110,19 +111,20 @@ private:
class DiffTextWindowFrameData; class DiffTextWindowFrameData;
class DiffTextWindowFrame : public QWidget class DiffTextWindowFrame : public TQWidget
{ {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
DiffTextWindowFrame( QWidget* pParent, QStatusBar* pStatusBar, OptionDialog* pOptionDialog, int winIdx ); DiffTextWindowFrame( TQWidget* pParent, TQStatusBar* pStatusBar, OptionDialog* pOptionDialog, int winIdx );
~DiffTextWindowFrame(); ~DiffTextWindowFrame();
DiffTextWindow* getDiffTextWindow(); DiffTextWindow* getDiffTextWindow();
void init(); void init();
void setFirstLine(int firstLine); void setFirstLine(int firstLine);
signals: signals:
void fileNameChanged(const QString&, int); void fileNameChanged(const TQString&, int);
protected: protected:
bool eventFilter( QObject*, QEvent* ); bool eventFilter( TQObject*, TQEvent* );
private slots: private slots:
void slotReturnPressed(); void slotReturnPressed();
void slotBrowseButtonClicked(); void slotBrowseButtonClicked();

File diff suppressed because it is too large Load Diff

@ -18,26 +18,26 @@
#ifndef DIRECTORY_MERGE_WINDOW_H #ifndef DIRECTORY_MERGE_WINDOW_H
#define DIRECTORY_MERGE_WINDOW_H #define DIRECTORY_MERGE_WINDOW_H
#include <qfileinfo.h> #include <tqfileinfo.h>
#include <qlistview.h> #include <tqlistview.h>
#include <qtimer.h> #include <tqtimer.h>
#include <qdir.h> #include <tqdir.h>
#include <list> #include <list>
#include <map> #include <map>
#include "common.h" #include "common.h"
#include "fileaccess.h" #include "fileaccess.h"
#include "diff.h" //TotalDiffStatus #include "diff.h" //TotalDifftqStatus
class OptionDialog; class OptionDialog;
class KIconLoader; class KIconLoader;
class StatusInfo; class StatusInfo;
class DirectoryMergeInfo; class DirectoryMergeInfo;
class OneDirectoryInfo; class OneDirectoryInfo;
class QLabel; class TQLabel;
class KAction; class KAction;
class KToggleAction; class KToggleAction;
class KActionCollection; class KActionCollection;
class TotalDiffStatus; class TotalDifftqStatus;
enum e_MergeOperation enum e_MergeOperation
{ {
@ -70,7 +70,7 @@ public:
m_ageA = eNotThere; m_ageB=eNotThere; m_ageC=eNotThere; m_ageA = eNotThere; m_ageB=eNotThere; m_ageC=eNotThere;
m_bConflictingAges=false; } m_bConflictingAges=false; }
bool operator>( const MergeFileInfos& ); bool operator>( const MergeFileInfos& );
QString m_subPath; TQString m_subPath;
bool m_bExistsInA; bool m_bExistsInA;
bool m_bExistsInB; bool m_bExistsInB;
@ -99,26 +99,27 @@ public:
FileAccess m_fileInfoB; FileAccess m_fileInfoB;
FileAccess m_fileInfoC; FileAccess m_fileInfoC;
TotalDiffStatus m_totalDiffStatus; TotalDifftqStatus m_totalDifftqStatus;
}; };
class DirMergeItem : public QListViewItem class DirMergeItem : public TQListViewItem
{ {
public: public:
DirMergeItem( QListView* pParent, const QString&, MergeFileInfos*); DirMergeItem( TQListView* pParent, const TQString&, MergeFileInfos*);
DirMergeItem( DirMergeItem* pParent, const QString&, MergeFileInfos*); DirMergeItem( DirMergeItem* pParent, const TQString&, MergeFileInfos*);
~DirMergeItem(); ~DirMergeItem();
MergeFileInfos* m_pMFI; MergeFileInfos* m_pMFI;
virtual int compare(QListViewItem *i, int col, bool ascending) const; virtual int compare(TQListViewItem *i, int col, bool ascending) const;
virtual void paintCell(QPainter * p, const QColorGroup & cg, int column, int width, int align ); virtual void paintCell(TQPainter * p, const TQColorGroup & cg, int column, int width, int align );
void init(MergeFileInfos* pMFI); void init(MergeFileInfos* pMFI);
}; };
class DirectoryMergeWindow : public QListView class DirectoryMergeWindow : public TQListView
{ {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
DirectoryMergeWindow( QWidget* pParent, OptionDialog* pOptions, KIconLoader* pIconLoader ); DirectoryMergeWindow( TQWidget* pParent, OptionDialog* pOptions, KIconLoader* pIconLoader );
~DirectoryMergeWindow(); ~DirectoryMergeWindow();
void setDirectoryMergeInfo(DirectoryMergeInfo* p){ m_pDirectoryMergeInfo=p; } void setDirectoryMergeInfo(DirectoryMergeInfo* p){ m_pDirectoryMergeInfo=p; }
bool init( bool init(
@ -135,19 +136,19 @@ public:
int totalColumnWidth(); int totalColumnWidth();
bool isSyncMode() { return m_bSyncMode; } bool isSyncMode() { return m_bSyncMode; }
bool isScanning() { return m_bScanning; } bool isScanning() { return m_bScanning; }
void initDirectoryMergeActions( QObject* pKDiff3App, KActionCollection* ac ); void initDirectoryMergeActions( TQObject* pKDiff3App, KActionCollection* ac );
void updateAvailabilities( bool bDirCompare, bool bDiffWindowVisible, void updateAvailabilities( bool bDirCompare, bool bDiffWindowVisible,
KToggleAction* chooseA, KToggleAction* chooseB, KToggleAction* chooseC ); KToggleAction* chooseA, KToggleAction* chooseB, KToggleAction* chooseC );
void updateFileVisibilities(); void updateFileVisibilities();
virtual void keyPressEvent( QKeyEvent* e ); virtual void keyPressEvent( TQKeyEvent* e );
virtual void focusInEvent( QFocusEvent* e ); virtual void focusInEvent( TQFocusEvent* e );
virtual void focusOutEvent( QFocusEvent* e ); virtual void focusOutEvent( TQFocusEvent* e );
QString getDirNameA(){ return m_dirA.prettyAbsPath(); } TQString getDirNameA(){ return m_dirA.prettyAbsPath(); }
QString getDirNameB(){ return m_dirB.prettyAbsPath(); } TQString getDirNameB(){ return m_dirB.prettyAbsPath(); }
QString getDirNameC(){ return m_dirC.prettyAbsPath(); } TQString getDirNameC(){ return m_dirC.prettyAbsPath(); }
QString getDirNameDest(){ return m_dirDest.prettyAbsPath(); } TQString getDirNameDest(){ return m_dirDest.prettyAbsPath(); }
public slots: public slots:
void reload(); void reload();
@ -155,7 +156,7 @@ public slots:
void compareCurrentFile(); void compareCurrentFile();
void slotRunOperationForAllItems(); void slotRunOperationForAllItems();
void slotRunOperationForCurrentItem(); void slotRunOperationForCurrentItem();
void mergeResultSaved(const QString& fileName); void mergeResultSaved(const TQString& fileName);
void slotChooseAEverywhere(); void slotChooseAEverywhere();
void slotChooseBEverywhere(); void slotChooseBEverywhere();
void slotChooseCEverywhere(); void slotChooseCEverywhere();
@ -197,7 +198,7 @@ public slots:
protected: protected:
void mergeContinue( bool bStart, bool bVerbose ); void mergeContinue( bool bStart, bool bVerbose );
void resizeEvent(QResizeEvent* e); void resizeEvent(TQResizeEvent* e);
bool m_bAllowResizeEvents; bool m_bAllowResizeEvents;
void prepareListView(ProgressProxy& pp); void prepareListView(ProgressProxy& pp);
@ -206,33 +207,33 @@ protected:
friend class MergeFileInfos; friend class MergeFileInfos;
bool canContinue(); bool canContinue();
void prepareMergeStart( QListViewItem* pBegin, QListViewItem* pEnd, bool bVerbose ); void prepareMergeStart( TQListViewItem* pBegin, TQListViewItem* pEnd, bool bVerbose );
bool executeMergeOperation( MergeFileInfos& mfi, bool& bSingleFileMerge ); bool executeMergeOperation( MergeFileInfos& mfi, bool& bSingleFileMerge );
void scanDirectory( const QString& dirName, t_DirectoryList& dirList ); void scanDirectory( const TQString& dirName, t_DirectoryList& dirList );
void scanLocalDirectory( const QString& dirName, t_DirectoryList& dirList ); void scanLocalDirectory( const TQString& dirName, t_DirectoryList& dirList );
void fastFileComparison( FileAccess& fi1, FileAccess& fi2, void fastFileComparison( FileAccess& fi1, FileAccess& fi2,
bool& bEqual, bool& bError, QString& status ); bool& bEqual, bool& bError, TQString& status );
void compareFilesAndCalcAges( MergeFileInfos& mfi ); 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; } { 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; } { 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; } { 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); { if ( m_dirDestInternal.prettyAbsPath() == m_dirC.prettyAbsPath() ) return fullNameC(mfi);
else if ( m_dirDestInternal.prettyAbsPath() == m_dirB.prettyAbsPath() ) return fullNameB(mfi); else if ( m_dirDestInternal.prettyAbsPath() == m_dirB.prettyAbsPath() ) return fullNameB(mfi);
else return m_dirDestInternal.absFilePath() + "/" + mfi.m_subPath; else return m_dirDestInternal.absFilePath() + "/" + mfi.m_subPath;
} }
bool copyFLD( const QString& srcName, const QString& destName ); bool copyFLD( const TQString& srcName, const TQString& destName );
bool deleteFLD( const QString& name, bool bCreateBackup ); bool deleteFLD( const TQString& name, bool bCreateBackup );
bool makeDir( const QString& name, bool bQuiet=false ); bool makeDir( const TQString& name, bool bQuiet=false );
bool renameFLD( const QString& srcName, const QString& destName ); bool renameFLD( const TQString& srcName, const TQString& destName );
bool mergeFLD( const QString& nameA,const QString& nameB,const QString& nameC, bool mergeFLD( const TQString& nameA,const TQString& nameB,const TQString& nameC,
const QString& nameDest, bool& bSingleFileMerge ); const TQString& nameDest, bool& bSingleFileMerge );
FileAccess m_dirA; FileAccess m_dirA;
FileAccess m_dirB; FileAccess m_dirB;
@ -240,9 +241,9 @@ protected:
FileAccess m_dirDest; FileAccess m_dirDest;
FileAccess m_dirDestInternal; 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_bFollowDirLinks;
bool m_bFollowFileLinks; bool m_bFollowFileLinks;
@ -318,44 +319,45 @@ protected:
KAction* m_pDirSaveMergeState; KAction* m_pDirSaveMergeState;
KAction* m_pDirLoadMergeState; KAction* m_pDirLoadMergeState;
signals: 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 checkIfCanContinue( bool* pbContinue );
void updateAvailabilities(); void updateAvailabilities();
void statusBarMessage( const QString& msg ); void statusBarMessage( const TQString& msg );
protected slots: protected slots:
void onDoubleClick( QListViewItem* lvi ); void onDoubleClick( TQListViewItem* lvi );
void onClick( int button, QListViewItem* lvi, const QPoint&, int c ); void onClick( int button, TQListViewItem* lvi, const TQPoint&, int c );
void slotShowContextMenu(QListViewItem* lvi,const QPoint &,int c); void slotShowContextMenu(TQListViewItem* lvi,const TQPoint &,int c);
void onSelectionChanged(QListViewItem* lvi); void onSelectionChanged(TQListViewItem* lvi);
}; };
class DirectoryMergeInfo : public QFrame class DirectoryMergeInfo : public TQFrame
{ {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
DirectoryMergeInfo( QWidget* pParent ); DirectoryMergeInfo( TQWidget* pParent );
void setInfo( void setInfo(
const FileAccess& APath, const FileAccess& APath,
const FileAccess& BPath, const FileAccess& BPath,
const FileAccess& CPath, const FileAccess& CPath,
const FileAccess& DestPath, const FileAccess& DestPath,
MergeFileInfos& mfi ); MergeFileInfos& mfi );
QListView* getInfoList() {return m_pInfoList;} TQListView* getInfoList() {return m_pInfoList;}
virtual bool eventFilter( QObject* o, QEvent* e ); virtual bool eventFilter( TQObject* o, TQEvent* e );
signals: signals:
void gotFocus(); void gotFocus();
private: private:
QLabel* m_pInfoA; TQLabel* m_pInfoA;
QLabel* m_pInfoB; TQLabel* m_pInfoB;
QLabel* m_pInfoC; TQLabel* m_pInfoC;
QLabel* m_pInfoDest; TQLabel* m_pInfoDest;
QLabel* m_pA; TQLabel* m_pA;
QLabel* m_pB; TQLabel* m_pB;
QLabel* m_pC; TQLabel* m_pC;
QLabel* m_pDest; TQLabel* m_pDest;
QListView* m_pInfoList; TQListView* m_pInfoList;
}; };

File diff suppressed because it is too large Load Diff

@ -11,17 +11,17 @@
#ifndef FILEACCESS_H #ifndef FILEACCESS_H
#define FILEACCESS_H #define FILEACCESS_H
#include <qdialog.h> #include <tqdialog.h>
#include <qfileinfo.h> #include <tqfileinfo.h>
#include <kprogress.h> #include <kprogress.h>
#include <kio/job.h> #include <kio/job.h>
#include <kio/jobclasses.h> #include <kio/jobclasses.h>
#include <kurldrag.h> #include <kurldrag.h>
#include <list> #include <list>
#include <qstring.h> #include <tqstring.h>
#include <qdatetime.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; class t_DirectoryList;
@ -30,8 +30,8 @@ class FileAccess
public: public:
FileAccess(); FileAccess();
~FileAccess(); ~FileAccess();
FileAccess( const QString& name, bool bWantToWrite=false ); // name: local file or dirname or url (when supported) FileAccess( const TQString& name, bool bWantToWrite=false ); // name: local file or dirname or url (when supported)
void setFile( const QString& name, bool bWantToWrite=false ); void setFile( const TQString& name, bool bWantToWrite=false );
bool isValid() const; bool isValid() const;
bool isFile() const; bool isFile() const;
@ -44,43 +44,43 @@ public:
bool isWritable() const; bool isWritable() const;
bool isExecutable() const; bool isExecutable() const;
bool isHidden() const; bool isHidden() const;
QString readLink() const; TQString readLink() const;
QDateTime created() const; TQDateTime created() const;
QDateTime lastModified() const; TQDateTime lastModified() const;
QDateTime lastRead() const; TQDateTime lastRead() const;
QString fileName() const; // Just the name-part of the path, without parent directories TQString fileName() const; // Just the name-part of the path, without tqparent directories
QString filePath() const; // The path-string that was used during construction TQString filePath() const; // The path-string that was used during construction
QString prettyAbsPath() const; TQString prettyAbsPath() const;
KURL url() const; KURL url() const;
QString absFilePath() const; TQString absFilePath() const;
bool isLocal() const; bool isLocal() const;
bool readFile(void* pDestBuffer, unsigned long maxLength ); bool readFile(void* pDestBuffer, unsigned long maxLength );
bool writeFile(const void* pSrcBuffer, unsigned long length ); bool writeFile(const void* pSrcBuffer, unsigned long length );
bool listDir( t_DirectoryList* pDirList, bool bRecursive, bool bFindHidden, bool listDir( t_DirectoryList* pDirList, bool bRecursive, bool bFindHidden,
const QString& filePattern, const QString& fileAntiPattern, const TQString& filePattern, const TQString& fileAntiPattern,
const QString& dirAntiPattern, bool bFollowDirLinks, bool bUseCvsIgnore ); const TQString& dirAntiPattern, bool bFollowDirLinks, bool bUseCvsIgnore );
bool copyFile( const QString& destUrl ); bool copyFile( const TQString& destUrl );
bool createBackup( const QString& bakExtension ); bool createBackup( const TQString& bakExtension );
static QString tempFileName(); static TQString tempFileName();
static bool removeTempFile( const QString& ); static bool removeTempFile( const TQString& );
bool removeFile(); bool removeFile();
static bool removeFile( const QString& ); static bool removeFile( const TQString& );
static bool makeDir( const QString& ); static bool makeDir( const TQString& );
static bool removeDir( const QString& ); static bool removeDir( const TQString& );
static bool exists( const QString& ); static bool exists( const TQString& );
static QString cleanDirPath( const QString& ); static TQString cleanDirPath( const TQString& );
//bool chmod( const QString& ); //bool chmod( const TQString& );
bool rename( const QString& ); bool rename( const TQString& );
static bool symLink( const QString& linkTarget, const QString& linkLocation ); static bool symLink( const TQString& linkTarget, const TQString& linkLocation );
void addPath( const QString& txt ); void addPath( const TQString& txt );
QString getStatusText(); TQString getStatusText();
private: private:
void setUdsEntry( const KIO::UDSEntry& e ); void setUdsEntry( const KIO::UDSEntry& e );
KURL m_url; KURL m_url;
@ -88,9 +88,9 @@ private:
bool m_bValidData; bool m_bValidData;
unsigned long m_size; unsigned long m_size;
QDateTime m_modificationTime; TQDateTime m_modificationTime;
QDateTime m_accessTime; TQDateTime m_accessTime;
QDateTime m_creationTime; TQDateTime m_creationTime;
bool m_bReadable; bool m_bReadable;
bool m_bWritable; bool m_bWritable;
bool m_bExecutable; bool m_bExecutable;
@ -101,14 +101,14 @@ private:
bool m_bHidden; bool m_bHidden;
long m_fileType; // for testing only long m_fileType; // for testing only
QString m_linkTarget; TQString m_linkTarget;
QString m_user; TQString m_user;
QString m_group; TQString m_group;
QString m_name; TQString m_name;
QString m_path; TQString m_path;
QString m_absFilePath; TQString m_absFilePath;
QString m_localCopy; TQString m_localCopy;
QString m_statusText; // Might contain an error string, when the last operation didn't succeed. TQString m_statusText; // Might contain an error string, when the last operation didn't succeed.
friend class FileAccessJobHandler; friend class FileAccessJobHandler;
}; };
@ -117,24 +117,25 @@ class t_DirectoryList : public std::list<FileAccess>
{}; {};
class FileAccessJobHandler : public QObject class FileAccessJobHandler : public TQObject
{ {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
FileAccessJobHandler( FileAccess* pFileAccess ); FileAccessJobHandler( FileAccess* pFileAccess );
bool get( void* pDestBuffer, long maxLength ); bool get( void* pDestBuffer, long maxLength );
bool put( const void* pSrcBuffer, long maxLength, bool bOverwrite, bool bResume=false, int permissions=-1 ); bool put( const void* pSrcBuffer, long maxLength, bool bOverwrite, bool bResume=false, int permissions=-1 );
bool stat(int detailLevel=2, bool bWantToWrite=false ); bool stat(int detailLevel=2, bool bWantToWrite=false );
bool copyFile( const QString& dest ); bool copyFile( const TQString& dest );
bool rename( const QString& dest ); bool rename( const TQString& dest );
bool listDir( t_DirectoryList* pDirList, bool bRecursive, bool bFindHidden, bool listDir( t_DirectoryList* pDirList, bool bRecursive, bool bFindHidden,
const QString& filePattern, const QString& fileAntiPattern, const TQString& filePattern, const TQString& fileAntiPattern,
const QString& dirAntiPattern, bool bFollowDirLinks, bool bUseCvsIgnore ); const TQString& dirAntiPattern, bool bFollowDirLinks, bool bUseCvsIgnore );
bool mkDir( const QString& dirName ); bool mkDir( const TQString& dirName );
bool rmDir( const QString& dirName ); bool rmDir( const TQString& dirName );
bool removeFile( const QString& dirName ); bool removeFile( const TQString& dirName );
bool symLink( const QString& linkTarget, const QString& linkLocation ); bool symLink( const TQString& linkTarget, const TQString& linkLocation );
private: private:
FileAccess* m_pFileAccess; FileAccess* m_pFileAccess;
@ -145,39 +146,40 @@ private:
char* m_pTransferBuffer; // Needed during get or put char* m_pTransferBuffer; // Needed during get or put
long m_maxLength; long m_maxLength;
QString m_filePattern; TQString m_filePattern;
QString m_fileAntiPattern; TQString m_fileAntiPattern;
QString m_dirAntiPattern; TQString m_dirAntiPattern;
t_DirectoryList* m_pDirList; t_DirectoryList* m_pDirList;
bool m_bFindHidden; bool m_bFindHidden;
bool m_bRecursive; bool m_bRecursive;
bool m_bFollowDirLinks; bool m_bFollowDirLinks;
bool scanLocalDirectory( const QString& dirName, t_DirectoryList* dirList ); bool scanLocalDirectory( const TQString& dirName, t_DirectoryList* dirList );
private slots: private slots:
void slotStatResult( KIO::Job* ); void slotStatResult( KIO::Job* );
void slotSimpleJobResult( KIO::Job* pJob ); void slotSimpleJobResult( KIO::Job* pJob );
void slotPutJobResult( KIO::Job* pJob ); void slotPutJobResult( KIO::Job* pJob );
void slotGetData(KIO::Job*,const QByteArray&); void slotGetData(KIO::Job*,const TQByteArray&);
void slotPutData(KIO::Job*, QByteArray&); 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 slotListDirProcessNewEntries( KIO::Job *, const KIO::UDSEntryList& l );
void slotPercent( KIO::Job* pJob, unsigned long percent ); void slotPercent( KIO::Job* pJob, unsigned long percent );
}; };
class ProgressDialog : public QDialog class ProgressDialog : public TQDialog
{ {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
ProgressDialog( QWidget* pParent ); ProgressDialog( TQWidget* pParent );
void setStayHidden( bool bStayHidden ); void setStayHidden( bool bStayHidden );
void setInformation( const QString& info, bool bRedrawUpdate=true ); void setInformation( const TQString& info, bool bRedrawUpdate=true );
void setInformation( const QString& info, double dCurrent, bool bRedrawUpdate=true ); void setInformation( const TQString& info, double dCurrent, bool bRedrawUpdate=true );
void setCurrent( double dCurrent, bool bRedrawUpdate=true ); void setCurrent( double dCurrent, bool bRedrawUpdate=true );
void step( bool bRedrawUpdate=true ); void step( bool bRedrawUpdate=true );
void setMaxNofSteps( int dMaxNofSteps ); void setMaxNofSteps( int dMaxNofSteps );
@ -192,13 +194,13 @@ public:
void setSubRangeTransformation( double dMin, double dMax ); void setSubRangeTransformation( double dMin, double dMax );
void exitEventLoop(); void exitEventLoop();
void enterEventLoop( KIO::Job* pJob, const QString& jobInfo ); void enterEventLoop( KIO::Job* pJob, const TQString& jobInfo );
bool wasCancelled(); bool wasCancelled();
void show(); void show();
void hide(); void hide();
virtual void timerEvent(QTimerEvent*); virtual void timerEvent(TQTimerEvent*);
private: private:
struct ProgressLevelData struct ProgressLevelData
@ -221,16 +223,16 @@ private:
KProgress* m_pProgressBar; KProgress* m_pProgressBar;
KProgress* m_pSubProgressBar; KProgress* m_pSubProgressBar;
QLabel* m_pInformation; TQLabel* m_pInformation;
QLabel* m_pSubInformation; TQLabel* m_pSubInformation;
QLabel* m_pSlowJobInfo; TQLabel* m_pSlowJobInfo;
QPushButton* m_pAbortButton; TQPushButton* m_pAbortButton;
void recalc(bool bRedrawUpdate); void recalc(bool bRedrawUpdate);
QTime m_t1; TQTime m_t1;
QTime m_t2; TQTime m_t2;
bool m_bWasCancelled; bool m_bWasCancelled;
KIO::Job* m_pJob; 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; bool m_bStayHidden;
protected: protected:
virtual void reject(); virtual void reject();
@ -246,8 +248,8 @@ public:
ProgressProxy(); ProgressProxy();
~ProgressProxy(); ~ProgressProxy();
void setInformation( const QString& info, bool bRedrawUpdate=true ); void setInformation( const TQString& info, bool bRedrawUpdate=true );
void setInformation( const QString& info, double dCurrent, bool bRedrawUpdate=true ); void setInformation( const TQString& info, double dCurrent, bool bRedrawUpdate=true );
void setCurrent( double dCurrent, bool bRedrawUpdate=true ); void setCurrent( double dCurrent, bool bRedrawUpdate=true );
void step( bool bRedrawUpdate=true ); void step( bool bRedrawUpdate=true );
void setMaxNofSteps( int dMaxNofSteps ); void setMaxNofSteps( int dMaxNofSteps );

@ -535,7 +535,7 @@ void GnuDiff::discard_confusing_lines (struct file_data filevec[])
discards[i + j] = 0; discards[i + j] = 0;
/* Scan from beginning of run /* 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. or until the first nonprovisional at least 8 lines in.
Until that point, cancel any provisionals. */ Until that point, cancel any provisionals. */
for (j = 0, consec = 0; j < length; j++) for (j = 0, consec = 0; j < length; j++)

@ -27,14 +27,14 @@
#include "gnudiff_system.h" #include "gnudiff_system.h"
#include <stdio.h> #include <stdio.h>
#include <qstring.h> #include <tqstring.h>
#define TAB_WIDTH 8 #define TAB_WIDTH 8
class GnuDiff class GnuDiff
{ {
public: public:
/* What kind of changes a hunk contains. */ /* What kind of changes a hunk tqcontains. */
enum changes enum changes
{ {
/* No changes: lines common to both files. */ /* No changes: lines common to both files. */
@ -110,23 +110,23 @@ bool brief;
bool expand_tabs; bool expand_tabs;
/* Use a tab in the output, rather than a space, before the text of an /* 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). */ without changing the characters in it (-T). */
bool initial_tab; bool initial_tab;
/* In directory comparison, specify file to start with (-S). /* In directory comparison, specify file to start with (-S).
This is used for resuming an aborted comparison. This is used for resuming an aborted comparison.
All file names less than this name are ignored. */ 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). */ /* Pipe each file's output through pr (-l). */
bool paginate; bool paginate;
/* Line group formats for unchanged, old, new, and changed groups. */ /* 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. */ /* 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. */ /* If using OUTPUT_SDIFF print extra information to help the sdiff filter. */
bool sdiff_merge_assist; bool sdiff_merge_assist;
@ -180,9 +180,9 @@ struct change
struct file_data { struct file_data {
/* Buffer in which text of file is read. */ /* 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. */ sizeof *buffer. */
size_t bufsize; size_t bufsize;
@ -190,7 +190,7 @@ struct file_data {
size_t buffered; size_t buffered;
/* Array of pointers to lines in the file. */ /* Array of pointers to lines in the file. */
const QChar **linbuf; const TQChar **linbuf;
/* linbuf_base <= buffered_lines <= valid_lines <= alloc_lines. /* linbuf_base <= buffered_lines <= valid_lines <= alloc_lines.
linebuf[linbuf_base ... buffered_lines - 1] are possibly differing. 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; lin linbuf_base, buffered_lines, valid_lines, alloc_lines;
/* Pointer to end of prefix of this file to ignore when hashing. */ /* 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. /* Count of lines in the prefix.
There are this many lines in the file before linbuf[0]. */ There are this many lines in the file before linbuf[0]. */
lin prefix_lines; lin prefix_lines;
/* Pointer to start of suffix of this file to ignore when hashing. */ /* 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 /* Vector, indexed by line number, containing an equivalence code for
each line. It is this vector that is actually compared with that each line. It is this vector that is actually compared with that
@ -242,7 +242,7 @@ struct file_data {
struct comparison struct comparison
{ {
struct file_data file[2]; 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. */ /* 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); void print_context_script (struct change *, bool);
/* dir.c */ /* 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 */ /* ed.c */
void print_ed_script (struct change *); void print_ed_script (struct change *);
@ -286,8 +286,8 @@ void print_rcs_script (struct change *);
void print_sdiff_script (struct change *); void print_sdiff_script (struct change *);
/* util.c */ /* util.c */
QChar *concat (const QChar *, const QChar *, const QChar *); TQChar *concat (const TQChar *, const TQChar *, const TQChar *);
bool lines_differ ( const QChar *, size_t, const QChar *, size_t ); bool lines_differ ( const TQChar *, size_t, const TQChar *, size_t );
lin translate_line_number (struct file_data const *, lin); lin translate_line_number (struct file_data const *, lin);
struct change *find_change (struct change *); struct change *find_change (struct change *);
struct change *find_reverse_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 begin_output (void);
void debug_script (struct change *); void debug_script (struct change *);
void finish_output (void); void finish_output (void);
void message (const QChar *, const QChar *, const QChar *); void message (const TQChar *, const TQChar *, const TQChar *);
void message5 (const QChar *, const QChar *, const QChar *, const QChar *, const QChar *); void message5 (const TQChar *, const TQChar *, const TQChar *, const TQChar *, const TQChar *);
void output_1_line (const QChar *, const QChar *, const QChar *, const QChar *); void output_1_line (const TQChar *, const TQChar *, const TQChar *, const TQChar *);
void perror_with_name (const QChar *); void perror_with_name (const TQChar *);
void setup_output (const QChar *, const QChar *, bool); void setup_output (const TQChar *, const TQChar *, bool);
void translate_range (struct file_data const *, lin, lin, long *, long *); void translate_range (struct file_data const *, lin, lin, long *, long *);
/* version.c */ /* version.c */
//extern const QChar version_string[]; //extern const TQChar version_string[];
private: private:
// gnudiff_analyze.cpp // gnudiff_analyze.cpp
@ -325,7 +325,7 @@ private:
void *xrealloc(void *p, size_t n); void *xrealloc(void *p, size_t n);
void xalloc_die (void); void xalloc_die (void);
inline bool isWhite( QChar c ) inline bool isWhite( TQChar c )
{ {
return c==' ' || c=='\t' || c=='\r'; return c==' ' || c=='\t' || c=='\r';
} }

@ -42,7 +42,7 @@ struct equivclass
{ {
lin next; /* Next item in this bucket. */ lin next; /* Next item in this bucket. */
hash_value hash; /* Hash of lines in this class. */ 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. */ 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. but an option like -i might cause us to ignore the difference.
Return nonzero if the lines differ. */ 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 TQChar *t1 = s1;
const QChar *t2 = s2; const TQChar *t2 = s2;
const QChar *s1end = s1+len1; const TQChar *s1end = s1+len1;
const QChar *s2end = s2+len2; const TQChar *s2end = s2+len2;
for ( ; ; ++t1, ++t2 ) 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) void GnuDiff::find_and_hash_each_line (struct file_data *current)
{ {
hash_value h; hash_value h;
const QChar *p = current->prefix_end; const TQChar *p = current->prefix_end;
QChar c; TQChar c;
lin i, *bucket; lin i, *bucket;
size_t length; size_t length;
/* Cache often-used quantities in local variables to help the compiler. */ /* 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 alloc_lines = current->alloc_lines;
lin line = 0; lin line = 0;
lin linbuf_base = current->linbuf_base; 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; struct equivclass *eqs = equivs;
lin eqs_index = equivs_index; lin eqs_index = equivs_index;
lin eqs_alloc = equivs_alloc; lin eqs_alloc = equivs_alloc;
const QChar *suffix_begin = current->suffix_begin; const TQChar *suffix_begin = current->suffix_begin;
const QChar *bufend = current->buffer + current->buffered; const TQChar *bufend = current->buffer + current->buffered;
bool diff_length_compare_anyway = bool diff_length_compare_anyway =
ignore_white_space != IGNORE_NO_WHITE_SPACE || bIgnoreNumbers; ignore_white_space != IGNORE_NO_WHITE_SPACE || bIgnoreNumbers;
bool same_length_diff_contents_compare_anyway = 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) while ( p < suffix_begin)
{ {
const QChar *ip = p; const TQChar *ip = p;
h = 0; h = 0;
@ -169,7 +169,7 @@ void GnuDiff::find_and_hash_each_line (struct file_data *current)
while ( p<bufend && (c = *p) != '\n' ) while ( p<bufend && (c = *p) != '\n' )
{ {
if (! (isWhite(c) || bIgnoreNumbers && (c.isDigit() || c=='-' || c=='.' ) )) if (! (isWhite(c) || bIgnoreNumbers && (c.isDigit() || c=='-' || c=='.' ) ))
h = HASH (h, c.lower().unicode()); h = HASH (h, c.lower().tqunicode());
++p; ++p;
} }
break; break;
@ -177,7 +177,7 @@ void GnuDiff::find_and_hash_each_line (struct file_data *current)
default: default:
while ( p<bufend && (c = *p) != '\n' ) while ( p<bufend && (c = *p) != '\n' )
{ {
h = HASH (h, c.lower().unicode()); h = HASH (h, c.lower().tqunicode());
++p; ++p;
} }
break; break;
@ -189,7 +189,7 @@ void GnuDiff::find_and_hash_each_line (struct file_data *current)
while ( p<bufend && (c = *p) != '\n') while ( p<bufend && (c = *p) != '\n')
{ {
if (! (isWhite(c)|| bIgnoreNumbers && (c.isDigit() || c=='-' || c=='.' ) )) if (! (isWhite(c)|| bIgnoreNumbers && (c.isDigit() || c=='-' || c=='.' ) ))
h = HASH (h, c.unicode()); h = HASH (h, c.tqunicode());
++p; ++p;
} }
break; break;
@ -197,7 +197,7 @@ void GnuDiff::find_and_hash_each_line (struct file_data *current)
default: default:
while ( p<bufend && (c = *p) != '\n') while ( p<bufend && (c = *p) != '\n')
{ {
h = HASH (h, c.unicode()); h = HASH (h, c.tqunicode());
++p; ++p;
} }
break; break;
@ -228,7 +228,7 @@ void GnuDiff::find_and_hash_each_line (struct file_data *current)
} }
else if (eqs[i].hash == h) 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 /* Reuse existing class if lines_differ reports the lines
equal. */ 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. /* Reuse existing equivalence class if the lines are identical.
This detects the common case of exact identity This detects the common case of exact identity
faster than lines_differ would. */ faster than lines_differ would. */
if (memcmp (eqline, ip, length*sizeof(QChar)) == 0) if (memcmp (eqline, ip, length*sizeof(TQChar)) == 0)
break; break;
if (!same_length_diff_contents_compare_anyway) if (!same_length_diff_contents_compare_anyway)
continue; continue;
@ -260,7 +260,7 @@ void GnuDiff::find_and_hash_each_line (struct file_data *current)
alloc_lines = 2 * alloc_lines - linbuf_base; alloc_lines = 2 * alloc_lines - linbuf_base;
cureqs =(lin*) xrealloc (cureqs, alloc_lines * sizeof *cureqs); cureqs =(lin*) xrealloc (cureqs, alloc_lines * sizeof *cureqs);
linbuf += linbuf_base; linbuf += linbuf_base;
linbuf = (const QChar**) xrealloc (linbuf, linbuf = (const TQChar**) xrealloc (linbuf,
(alloc_lines - linbuf_base) * sizeof *linbuf); (alloc_lines - linbuf_base) * sizeof *linbuf);
linbuf -= linbuf_base; linbuf -= linbuf_base;
} }
@ -285,7 +285,7 @@ void GnuDiff::find_and_hash_each_line (struct file_data *current)
xalloc_die (); xalloc_die ();
alloc_lines = 2 * alloc_lines - linbuf_base; alloc_lines = 2 * alloc_lines - linbuf_base;
linbuf += linbuf_base; linbuf += linbuf_base;
linbuf = (const QChar**)xrealloc (linbuf, linbuf = (const TQChar**)xrealloc (linbuf,
(alloc_lines - linbuf_base) * sizeof *linbuf); (alloc_lines - linbuf_base) * sizeof *linbuf);
linbuf -= linbuf_base; 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); size_t guessed_bytes_per_line = n < 10 ? 32 : s / (n - 1);
lin guessed_lines = MAX (1, t / guessed_bytes_per_line); 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 /* 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[]) void GnuDiff::find_identical_ends (struct file_data filevec[])
{ {
/* Find identical prefix. */ /* Find identical prefix. */
const QChar *p0, *p1, *buffer0, *buffer1; const TQChar *p0, *p1, *buffer0, *buffer1;
p0 = buffer0 = filevec[0].buffer; p0 = buffer0 = filevec[0].buffer;
p1 = buffer1 = filevec[1].buffer; p1 = buffer1 = filevec[1].buffer;
size_t n0, n1; size_t n0, n1;
n0 = filevec[0].buffered; n0 = filevec[0].buffered;
n1 = filevec[1].buffered; n1 = filevec[1].buffered;
const QChar* const pEnd0 = p0 + n0; const TQChar* const pEnd0 = p0 + n0;
const QChar* const pEnd1 = p1 + n1; const TQChar* const pEnd1 = p1 + n1;
if (p0 == p1) if (p0 == p1)
/* The buffers are the same; sentinels won't work. */ /* 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; p0 = buffer0 + n0;
p1 = buffer1 + n1; p1 = buffer1 + n1;
const QChar *end0, *beg0; const TQChar *end0, *beg0;
end0 = p0; /* Addr of last char in file 0. */ end0 = p0; /* Addr of last char in file 0. */
/* Get value of P0 at which we should stop scanning backward: /* 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), 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. */ 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 alloc_lines0, alloc_lines1;
lin buffered_prefix, prefix_count, prefix_mask; lin buffered_prefix, prefix_count, prefix_tqmask;
lin middle_guess, suffix_guess; lin middle_guess, suffix_guess;
if (no_diff_means_no_output if (no_diff_means_no_output
&& context < (lin)(LIN_MAX / 4) && context < (lin)(n0)) && 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); alloc_lines0 = guess_lines (0, 0, n0);
} }
prefix_mask = prefix_count - 1; prefix_tqmask = prefix_count - 1;
lin lines = 0; lin lines = 0;
linbuf0 = (const QChar**) xmalloc (alloc_lines0 * sizeof(*linbuf0)); linbuf0 = (const TQChar**) xmalloc (alloc_lines0 * sizeof(*linbuf0));
p0 = buffer0; p0 = buffer0;
/* If the prefix is needed, find the prefix lines. */ /* 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; end0 = filevec[0].prefix_end;
while (p0 != end0) while (p0 != end0)
{ {
lin l = lines++ & prefix_mask; lin l = lines++ & prefix_tqmask;
if (l == alloc_lines0) if (l == alloc_lines0)
{ {
if ((lin)(PTRDIFF_MAX / (2 * sizeof *linbuf0)) <= alloc_lines0) if ((lin)(PTRDIFF_MAX / (2 * sizeof *linbuf0)) <= alloc_lines0)
xalloc_die (); xalloc_die ();
alloc_lines0 *= 2; alloc_lines0 *= 2;
linbuf0 = (const QChar**) xrealloc (linbuf0, alloc_lines0 * sizeof(*linbuf0)); linbuf0 = (const TQChar**) xrealloc (linbuf0, alloc_lines0 * sizeof(*linbuf0));
} }
linbuf0[l] = p0; linbuf0[l] = p0;
while ( p0<pEnd0 && *p0++ != '\n' ) while ( p0<pEnd0 && *p0++ != '\n' )
@ -473,14 +473,14 @@ void GnuDiff::find_identical_ends (struct file_data filevec[])
if (alloc_lines1 < buffered_prefix if (alloc_lines1 < buffered_prefix
|| (lin)(PTRDIFF_MAX / sizeof *linbuf1) <= alloc_lines1) || (lin)(PTRDIFF_MAX / sizeof *linbuf1) <= alloc_lines1)
xalloc_die (); xalloc_die ();
linbuf1 = (const QChar**)xmalloc (alloc_lines1 * sizeof(*linbuf1)); linbuf1 = (const TQChar**)xmalloc (alloc_lines1 * sizeof(*linbuf1));
lin i; lin i;
if (buffered_prefix != lines) if (buffered_prefix != lines)
{ {
/* Rotate prefix lines to proper location. */ /* Rotate prefix lines to proper location. */
for (i = 0; i < buffered_prefix; i++) 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++) for (i = 0; i < buffered_prefix; i++)
linbuf0[i] = linbuf1[i]; linbuf0[i] = linbuf1[i];
} }

@ -21,18 +21,18 @@
#include <iostream> #include <iostream>
// include files for QT // include files for QT
#include <qdir.h> #include <tqdir.h>
#include <qprinter.h> #include <tqprinter.h>
#include <qpainter.h> #include <tqpainter.h>
#include <qsplitter.h> #include <tqsplitter.h>
#include <qlineedit.h> #include <tqlineedit.h>
#include <qcheckbox.h> #include <tqcheckbox.h>
#include <qpushbutton.h> #include <tqpushbutton.h>
#include <qpopupmenu.h> #include <tqpopupmenu.h>
#include <qlabel.h> #include <tqlabel.h>
#include <qtextedit.h> #include <tqtextedit.h>
#include <qlayout.h> #include <tqlayout.h>
#include <qpaintdevicemetrics.h> #include <tqpaintdevicemetrics.h>
// include files for KDE // include files for KDE
#include <kiconloader.h> #include <kiconloader.h>
@ -91,8 +91,8 @@ bool KDiff3App::isFileSaved()
return m_bFileSaved; return m_bFileSaved;
} }
KDiff3App::KDiff3App(QWidget* pParent, const char* name, KDiff3Part* pKDiff3Part ) KDiff3App::KDiff3App(TQWidget* pParent, const char* name, KDiff3Part* pKDiff3Part )
:QSplitter(pParent, name) //previously KMainWindow :TQSplitter(pParent, name) //previously KMainWindow
{ {
m_pKDiff3Part = pKDiff3Part; m_pKDiff3Part = pKDiff3Part;
m_pKDiff3Shell = dynamic_cast<KParts::MainWindow*>(pParent); 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(). // All default values must be set before calling readOptions().
m_pOptionDialog = new OptionDialog( m_pKDiff3Shell!=0, this ); 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() ); 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(); KCmdLineArgs *args = isPart() ? 0 : KCmdLineArgs::parsedArgs();
if (args) if (args)
{ {
QString s; TQString s;
QString title; TQString title;
if ( args->isSet("confighelp") ) if ( args->isSet("confighelp") )
{ {
s = m_pOptionDialog->calcOptionHelp(); s = m_pOptionDialog->calcOptionHelp();
@ -154,13 +154,13 @@ KDiff3App::KDiff3App(QWidget* pParent, const char* name, KDiff3Part* pKDiff3Part
#ifdef _WIN32 #ifdef _WIN32
// A windows program has no console // A windows program has no console
//KMessageBox::information(0, s,i18n("KDiff3-Usage")); //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); pDialog->setCaption(title);
QVBoxLayout* pVBoxLayout = new QVBoxLayout( pDialog ); TQVBoxLayout* pVBoxLayout = new TQVBoxLayout( pDialog );
QTextEdit* pTextEdit = new QTextEdit(pDialog); TQTextEdit* pTextEdit = new TQTextEdit(pDialog);
pTextEdit->setText(s); pTextEdit->setText(s);
pTextEdit->setReadOnly(true); pTextEdit->setReadOnly(true);
pTextEdit->setWordWrap(QTextEdit::NoWrap); pTextEdit->setWordWrap(TQTextEdit::NoWrap);
pVBoxLayout->addWidget(pTextEdit); pVBoxLayout->addWidget(pTextEdit);
pDialog->resize(600,400); pDialog->resize(600,400);
pDialog->exec(); pDialog->exec();
@ -225,15 +225,15 @@ KDiff3App::KDiff3App(QWidget* pParent, const char* name, KDiff3Part* pKDiff3Part
QCStringList aliasList = args->getOptionList("fname"); QCStringList aliasList = args->getOptionList("fname");
QCStringList::Iterator ali = aliasList.begin(); QCStringList::Iterator ali = aliasList.begin();
QString an1 = args->getOption("L1"); TQString an1 = args->getOption("L1");
if ( !an1.isEmpty() ) { m_sd1.setAliasName(an1); } if ( !an1.isEmpty() ) { m_sd1.setAliasName(an1); }
else if ( ali != aliasList.end() ) { m_sd1.setAliasName(*ali); ++ali; } 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); } if ( !an2.isEmpty() ) { m_sd2.setAliasName(an2); }
else if ( ali != aliasList.end() ) { m_sd2.setAliasName(*ali); ++ali; } 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); } if ( !an3.isEmpty() ) { m_sd3.setAliasName(an3); }
else if ( ali != aliasList.end() ) { m_sd3.setAliasName(*ali); ++ali; } else if ( ali != aliasList.end() ) { m_sd3.setAliasName(*ali); ++ali; }
} }
@ -243,7 +243,7 @@ KDiff3App::KDiff3App(QWidget* pParent, const char* name, KDiff3Part* pKDiff3Part
initStatusBar(); initStatusBar();
m_pFindDialog = new FindDialog( this ); 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 ); autoAdvance->setChecked( m_pOptionDialog->m_bAutoAdvance );
showWhiteSpaceCharacters->setChecked( m_pOptionDialog->m_bShowWhiteSpaceCharacters ); showWhiteSpaceCharacters->setChecked( m_pOptionDialog->m_bShowWhiteSpaceCharacters );
@ -259,36 +259,36 @@ KDiff3App::KDiff3App(QWidget* pParent, const char* name, KDiff3Part* pKDiff3Part
slotViewStatusBar(); slotViewStatusBar();
if( toolBar("mainToolBar")!=0 ) if( toolBar("mainToolBar")!=0 )
toolBar("mainToolBar")->setBarPos( (KToolBar::BarPosition) m_pOptionDialog->m_toolBarPos ); toolBar("mainToolBar")->setBarPos( (KToolBar::BarPosition) m_pOptionDialog->m_toolBarPos );
/* QSize size = m_pOptionDialog->m_geometry; /* TQSize size = m_pOptionDialog->m_tqgeometry;
QPoint pos = m_pOptionDialog->m_position; TQPoint pos = m_pOptionDialog->m_position;
if(!size.isEmpty()) if(!size.isEmpty())
{ {
m_pKDiff3Shell->resize( size ); 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 ) if ( visibleRect.width()>100 && visibleRect.height()>100 )
m_pKDiff3Shell->move( pos ); m_pKDiff3Shell->move( pos );
}*/ }*/
} }
slotRefresh(); slotRefresh();
m_pMainSplitter = this; //new QSplitter(this); m_pMainSplitter = this; //new TQSplitter(this);
m_pMainSplitter->setOrientation( Vertical ); m_pMainSplitter->setOrientation(Qt::Vertical );
// setCentralWidget( m_pMainSplitter ); // setCentralWidget( m_pMainSplitter );
m_pDirectoryMergeSplitter = new QSplitter( m_pMainSplitter ); m_pDirectoryMergeSplitter = new TQSplitter( m_pMainSplitter );
m_pDirectoryMergeSplitter->setOrientation( Horizontal ); m_pDirectoryMergeSplitter->setOrientation(Qt::Horizontal );
m_pDirectoryMergeWindow = new DirectoryMergeWindow( m_pDirectoryMergeSplitter, m_pOptionDialog, m_pDirectoryMergeWindow = new DirectoryMergeWindow( m_pDirectoryMergeSplitter, m_pOptionDialog,
KApplication::kApplication()->iconLoader() ); KApplication::kApplication()->iconLoader() );
m_pDirectoryMergeInfo = new DirectoryMergeInfo( m_pDirectoryMergeSplitter ); m_pDirectoryMergeInfo = new DirectoryMergeInfo( m_pDirectoryMergeSplitter );
m_pDirectoryMergeWindow->setDirectoryMergeInfo( m_pDirectoryMergeInfo ); m_pDirectoryMergeWindow->setDirectoryMergeInfo( m_pDirectoryMergeInfo );
connect( m_pDirectoryMergeWindow, SIGNAL(startDiffMerge(QString,QString,QString,QString,QString,QString,QString,TotalDiffStatus*)), connect( m_pDirectoryMergeWindow, TQT_SIGNAL(startDiffMerge(TQString,TQString,TQString,TQString,TQString,TQString,TQString,TotalDifftqStatus*)),
this, SLOT( slotFileOpen2(QString,QString,QString,QString,QString,QString,QString,TotalDiffStatus*))); TQT_TQOBJECT(this), TQT_SLOT( slotFileOpen2(TQString,TQString,TQString,TQString,TQString,TQString,TQString,TotalDifftqStatus*)));
connect( m_pDirectoryMergeWindow, SIGNAL(selectionChanged()), this, SLOT(slotUpdateAvailabilities())); connect( m_pDirectoryMergeWindow, TQT_SIGNAL(selectionChanged()), TQT_TQOBJECT(this), TQT_SLOT(slotUpdateAvailabilities()));
connect( m_pDirectoryMergeWindow, SIGNAL(currentChanged(QListViewItem*)), this, SLOT(slotUpdateAvailabilities())); connect( m_pDirectoryMergeWindow, TQT_SIGNAL(currentChanged(TQListViewItem*)), TQT_TQOBJECT(this), TQT_SLOT(slotUpdateAvailabilities()));
connect( m_pDirectoryMergeWindow, SIGNAL(checkIfCanContinue(bool*)), this, SLOT(slotCheckIfCanContinue(bool*))); connect( m_pDirectoryMergeWindow, TQT_SIGNAL(checkIfCanContinue(bool*)), TQT_TQOBJECT(this), TQT_SLOT(slotCheckIfCanContinue(bool*)));
connect( m_pDirectoryMergeWindow, SIGNAL(updateAvailabilities()), this, SLOT(slotUpdateAvailabilities())); connect( m_pDirectoryMergeWindow, TQT_SIGNAL(updateAvailabilities()), TQT_TQOBJECT(this), TQT_SLOT(slotUpdateAvailabilities()));
connect( m_pDirectoryMergeWindow, SIGNAL(statusBarMessage(const QString&)), this, SLOT(slotStatusMsg(const QString&))); 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. 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) if (m_pKDiff3Shell!=0)
{ {
QSize size=m_pOptionDialog->m_geometry; TQSize size=m_pOptionDialog->m_tqgeometry;
QPoint pos=m_pOptionDialog->m_position; TQPoint pos=m_pOptionDialog->m_position;
if(!size.isEmpty()) if(!size.isEmpty())
{ {
m_pKDiff3Shell->resize( size ); 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 ) if ( visibleRect.width()>100 && visibleRect.height()>100 )
m_pKDiff3Shell->move( pos ); m_pKDiff3Shell->move( pos );
if (!m_bAutoMode) if (!m_bAutoMode)
@ -341,13 +341,13 @@ void KDiff3App::completeInit( const QString& fn1, const QString& fn2, const QStr
SourceData* pSD=0; SourceData* pSD=0;
if ( m_sd3.isEmpty() ) if ( m_sd3.isEmpty() )
{ {
if ( m_totalDiffStatus.bBinaryAEqB ){ pSD = &m_sd1; } if ( m_totalDifftqStatus.bBinaryAEqB ){ pSD = &m_sd1; }
} }
else else
{ {
if ( m_totalDiffStatus.bBinaryBEqC ){ pSD = &m_sd3; } // B==C (assume A is old) if ( m_totalDifftqStatus.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_totalDifftqStatus.bBinaryAEqB ){ pSD = &m_sd3; } // assuming C has changed
else if ( m_totalDiffStatus.bBinaryAEqC ){ pSD = &m_sd2; } // assuming B has changed else if ( m_totalDifftqStatus.bBinaryAEqC ){ pSD = &m_sd2; } // assuming B has changed
} }
if ( pSD!=0 ) if ( pSD!=0 )
@ -357,7 +357,7 @@ void KDiff3App::completeInit( const QString& fn1, const QString& fn2, const QStr
FileAccess fa( m_outputFilename ); FileAccess fa( m_outputFilename );
if ( m_pOptionDialog->m_bDmCreateBakFiles && fa.exists() ) 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 ) ) FileAccess::removeFile( newName );
if ( !FileAccess::exists( newName ) ) fa.rename( 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_sd2.isEmpty() && !m_sd2.hasData() ||
! m_sd3.isEmpty() && !m_sd3.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"; text += "\n\n";
if ( ! m_sd1.isEmpty() && !m_sd1.hasData() ) if ( ! m_sd1.isEmpty() && !m_sd1.hasData() )
text += " - " + m_sd1.getAliasName() + "\n"; text += " - " + m_sd1.getAliasName() + "\n";
@ -430,37 +430,37 @@ void KDiff3App::initActions( KActionCollection* ac )
{ {
if (ac==0) KMessageBox::error(0, "actionCollection==0"); 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...")); 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!")); 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...")); 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")); 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")); 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")); 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")); 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")); 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")); 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")); 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")); 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")); 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")); viewStatusBar->setStatusText(i18n("Enables/disables the statusbar"));
KStdAction::keyBindings(this, SLOT(slotConfigureKeys()), ac); KStdAction::keyBindings(TQT_TQOBJECT(this), TQT_SLOT(slotConfigureKeys()), ac);
KAction* pAction = KStdAction::preferences(this, SLOT(slotConfigure()), ac ); KAction* pAction = KStdAction::preferences(TQT_TQOBJECT(this), TQT_SLOT(slotConfigure()), ac );
if ( isPart() ) if ( isPart() )
pAction->setText(i18n("Configure KDiff3...")); pAction->setText(i18n("Configure KDiff3..."));
@ -483,79 +483,79 @@ void KDiff3App::initActions( KActionCollection* ac )
#include "xpm/showlinenumbers.xpm" #include "xpm/showlinenumbers.xpm"
//#include "reload.xpm" //#include "reload.xpm"
goCurrent = new KAction(i18n("Go to Current Delta"), QIconSet(QPixmap(currentpos)), CTRL+Key_Space, this, SLOT(slotGoCurrent()), ac, "go_current"); 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"), QIconSet(QPixmap(upend)), 0, this, SLOT(slotGoTop()), ac, "go_top"); 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"), QIconSet(QPixmap(downend)), 0, this, SLOT(slotGoBottom()), ac, "go_bottom"); goBottom = new KAction(i18n("Go to Last Delta"), TQIconSet(TQPixmap(downend)), 0, TQT_TQOBJECT(this), TQT_SLOT(slotGoBottom()), ac, "go_bottom");
QString omitsWhitespace = ".\n" + i18n("(Skips white space differences when \"Show White Space\" is disabled.)"); TQString 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.)"); 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"), QIconSet(QPixmap(up1arrow)), CTRL+Key_Up, this, SLOT(slotGoPrevDelta()), ac, "go_prev_delta"); 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 ); 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 ); 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 ); 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 ); 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 ); 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 ); 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"); 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"), QIconSet(QPixmap(iconB)), CTRL+Key_2, this, SLOT(slotChooseB()), ac, "merge_choose_b"); 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"), QIconSet(QPixmap(iconC)), CTRL+Key_3, this, SLOT(slotChooseC()), ac, "merge_choose_c"); 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"), QIconSet(QPixmap(autoadvance)), 0, this, SLOT(slotAutoAdvanceToggled()), ac, "merge_autoadvance"); 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"), QIconSet(QPixmap(showwhitespacechars)), 0, this, SLOT(slotShowWhiteSpaceToggled()), ac, "diff_show_whitespace_characters"); 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"), QIconSet(QPixmap(showwhitespace)), 0, this, SLOT(slotShowWhiteSpaceToggled()), ac, "diff_show_whitespace"); 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"), QIconSet(QPixmap(showlinenumbers)), 0, this, SLOT(slotShowLineNumbersToggled()), ac, "diff_showlinenumbers"); 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, this, SLOT(slotChooseAEverywhere()), ac, "merge_choose_a_everywhere"); 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, this, SLOT(slotChooseBEverywhere()), ac, "merge_choose_b_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, this, SLOT(slotChooseCEverywhere()), ac, "merge_choose_c_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, this, SLOT(slotChooseAForUnsolvedConflicts()), ac, "merge_choose_a_for_unsolved_conflicts"); 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, this, SLOT(slotChooseBForUnsolvedConflicts()), ac, "merge_choose_b_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, this, SLOT(slotChooseCForUnsolvedConflicts()), ac, "merge_choose_c_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, this, SLOT(slotChooseAForUnsolvedWhiteSpaceConflicts()), ac, "merge_choose_a_for_unsolved_whitespace_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, this, SLOT(slotChooseBForUnsolvedWhiteSpaceConflicts()), ac, "merge_choose_b_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, this, SLOT(slotChooseCForUnsolvedWhiteSpaceConflicts()), ac, "merge_choose_c_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, this, SLOT(slotAutoSolve()), ac, "merge_autosolve"); 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, this, SLOT(slotUnsolve()), ac, "merge_autounsolve"); 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, this, SLOT(slotRegExpAutoMerge()),ac, "merge_regexp_automerge" ); 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, this, SLOT(slotMergeHistory()), ac, "merge_versioncontrol_history" ); 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, this, SLOT(slotSplitDiff()), ac, "merge_splitdiff"); 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, this, SLOT(slotJoinDiffs()), ac, "merge_joindiffs"); 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, this, SLOT(slotShowWindowAToggled()), ac, "win_show_a"); 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, this, SLOT(slotShowWindowBToggled()), ac, "win_show_b"); 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, this, SLOT(slotShowWindowCToggled()), ac, "win_show_c"); 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, this, SLOT(slotWinFocusNext()), ac, "win_focus_next"); 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, this, SLOT(slotOverviewNormal()), ac, "diff_overview_normal"); 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, this, SLOT(slotOverviewAB()), ac, "diff_overview_ab"); 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, this, SLOT(slotOverviewAC()), ac, "diff_overview_ac"); 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, this, SLOT(slotOverviewBC()), ac, "diff_overview_bc"); 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, this, SLOT(slotWordWrapToggled()), ac, "diff_wordwrap"); 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"), Qt::CTRL+Qt::Key_Y, this, SLOT(slotAddManualDiffHelp()), ac, "diff_add_manual_diff_help"); 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"), Qt::CTRL+Qt::SHIFT+Qt::Key_Y, this, SLOT(slotClearManualDiffHelpList()), ac, "diff_clear_manual_diff_help_list"); 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 #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 #endif
winFocusPrev = new KAction(i18n("Focus Prev Window"), Qt::ALT+Qt::Key_Left, this, SLOT(slotWinFocusPrev()), ac, "win_focus_prev"); 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 Orientation"), 0, this, SLOT(slotWinToggleSplitterOrientation()), ac, "win_toggle_split_orientation"); 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 ); 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 ); chooseA->plug( m_pMergeEditorPopupMenu );
chooseB->plug( m_pMergeEditorPopupMenu ); chooseB->plug( m_pMergeEditorPopupMenu );
chooseC->plug( m_pMergeEditorPopupMenu ); chooseC->plug( m_pMergeEditorPopupMenu );
} }
void KDiff3App::showPopupMenu( const QPoint& point ) void KDiff3App::showPopupMenu( const TQPoint& point )
{ {
m_pMergeEditorPopupMenu->popup( point ); m_pMergeEditorPopupMenu->popup( point );
} }
@ -577,7 +577,7 @@ void KDiff3App::saveOptions( KConfig* config )
m_pOptionDialog->m_bMaximised = m_pKDiff3Shell->isMaximized(); m_pOptionDialog->m_bMaximised = m_pKDiff3Shell->isMaximized();
if( ! m_pKDiff3Shell->isMaximized() && m_pKDiff3Shell->isVisible() ) 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(); m_pOptionDialog->m_position = m_pKDiff3Shell->pos();
} }
if ( toolBar("mainToolBar")!=0 ) 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...")); 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()) if(!s.isEmpty())
{ {
m_outputFilename = s; 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); clipRect.setTop(0);
painter.setClipRect( clipRect ); painter.setClipRect( clipRect );
painter.translate( view.left() , 0 ); painter.translate( view.left() , 0 );
QFontMetrics fm = painter.fontMetrics(); TQFontMetrics fm = painter.fontMetrics();
//if ( fm.width(headerText) > view.width() ) //if ( fm.width(headerText) > view.width() )
{ {
// A simple wrapline algorithm // A simple wrapline algorithm
int l=0; int l=0;
for (unsigned int p=0; p<headerText.length(); ) for (unsigned int p=0; p<headerText.length(); )
{ {
QString s = headerText.mid(p); TQString s = headerText.mid(p);
unsigned int i; unsigned int i;
for(i=2;i<s.length();++i) for(i=2;i<s.length();++i)
if (fm.width(s,i)>view.width()) if (fm.width(s,i)>view.width())
@ -702,7 +702,7 @@ void printDiffTextWindow( MyPainter& painter, const QRect& view, const QString&
--i; --i;
break; break;
} }
//QString s2 = s.left(i); //TQString s2 = s.left(i);
painter.drawText( 0, l*fm.height() + fm.ascent(), s.left(i) ); painter.drawText( 0, l*fm.height() + fm.ascent(), s.left(i) );
p+=i; p+=i;
++l; ++l;
@ -757,19 +757,19 @@ void KDiff3App::slotFilePrint()
slotStatusMsg( i18n( "Printing aborted." ) ); slotStatusMsg( i18n( "Printing aborted." ) );
return; return;
} }
QPaintDeviceMetrics metrics( painter.device() ); TQPaintDeviceMetrics metrics( painter.device() );
int dpiy = metrics.logicalDpiY(); int dpiy = metrics.logicalDpiY();
int columnDistance = (int) ( (0.5/2.54)*dpiy ); // 0.5 cm between the columns int columnDistance = (int) ( (0.5/2.54)*dpiy ); // 0.5 cm between the columns
int columns = m_bTripleDiff ? 3 : 2; int columns = m_bTripleDiff ? 3 : 2;
int columnWidth = ( metrics.width() - (columns-1)*columnDistance ) / columns; 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. f.setPointSizeFloat(f.pointSizeFloat()-1); // Print with slightly smaller font.
painter.setFont( f ); 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 headerWidth = fm.width( m_sd1.getAliasName() + ", "+topLineText+": 01234567" );
int headerLines = fm.width( m_sd1.getAliasName() + ", "+topLineText+": 01234567" )/columnWidth+1; 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 headerMargin = headerLines * fm.height() + 3; // Text + one horizontal line
int footerMargin = fm.height() + 3; int footerMargin = fm.height() + 3;
QRect view ( 0, headerMargin, metrics.width(), metrics.height() - (headerMargin + footerMargin) ); TQRect view ( 0, headerMargin, metrics.width(), metrics.height() - (headerMargin + footerMargin) );
QRect view1( 0*(columnWidth + columnDistance), view.top(), columnWidth, view.height() ); TQRect view1( 0*(columnWidth + columnDistance), view.top(), columnWidth, view.height() );
QRect view2( 1*(columnWidth + columnDistance), view.top(), columnWidth, view.height() ); TQRect view2( 1*(columnWidth + columnDistance), view.top(), columnWidth, view.height() );
QRect view3( 2*(columnWidth + columnDistance), view.top(), columnWidth, view.height() ); TQRect view3( 2*(columnWidth + columnDistance), view.top(), columnWidth, view.height() );
int linesPerPage = view.height() / fm.height(); int linesPerPage = view.height() / fm.height();
int charactersPerLine = columnWidth / fm.width("W"); int charactersPerLine = columnWidth / fm.width("W");
if ( m_pOptionDialog->m_bWordWrap ) 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 ); recalcWordWrap( charactersPerLine );
} }
@ -794,7 +794,7 @@ void KDiff3App::slotFilePrint()
if ( m_bTripleDiff && m_pDiffTextWindow3) if ( m_bTripleDiff && m_pDiffTextWindow3)
totalNofLines = max2(totalNofLines, m_pDiffTextWindow3->getNofLines()); totalNofLines = max2(totalNofLines, m_pDiffTextWindow3->getNofLines());
QValueList<int> pageList = printer.pageList(); TQValueList<int> pageList = printer.pageList();
bool bPrintCurrentPage=false; bool bPrintCurrentPage=false;
bool bFirstPrintedPage = false; bool bFirstPrintedPage = false;
@ -830,7 +830,7 @@ void KDiff3App::slotFilePrint()
int page = 1; int page = 1;
QValueList<int>::iterator pageListIt = pageList.begin(); TQValueList<int>::iterator pageListIt = pageList.begin();
for(;;) for(;;)
{ {
if (!bPrintSelection) if (!bPrintSelection)
@ -867,25 +867,25 @@ void KDiff3App::slotFilePrint()
painter.setClipping(true); painter.setClipping(true);
painter.setPen( m_pOptionDialog->m_colorA ); 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 ); printDiffTextWindow( painter, view1, headerText1, m_pDiffTextWindow1, line, linesPerPage, m_pOptionDialog->m_fgColor );
painter.setPen( m_pOptionDialog->m_colorB ); 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 ); printDiffTextWindow( painter, view2, headerText2, m_pDiffTextWindow2, line, linesPerPage, m_pOptionDialog->m_fgColor );
if ( m_bTripleDiff && m_pDiffTextWindow3 ) if ( m_bTripleDiff && m_pDiffTextWindow3 )
{ {
painter.setPen( m_pOptionDialog->m_colorC ); 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 ); printDiffTextWindow( painter, view3, headerText3, m_pDiffTextWindow3, line, linesPerPage, m_pOptionDialog->m_fgColor );
} }
painter.setClipping(false); painter.setClipping(false);
painter.setPen( m_pOptionDialog->m_fgColor ); painter.setPen( m_pOptionDialog->m_fgColor );
painter.drawLine( 0, view.bottom()+3, view.width(), view.bottom()+3 ); painter.drawLine( 0, view.bottom()+3, view.width(), view.bottom()+3 );
QString s = bPrintCurrentPage ? QString("") TQString s = bPrintCurrentPage ? TQString("")
: QString::number( page ) + "/" + QString::number(totalNofPages); : TQString::number( page ) + "/" + TQString::number(totalNofPages);
if ( bPrintSelection ) s+=" (" + i18n("Selection") + ")"; if ( bPrintSelection ) s+=" (" + i18n("Selection") + ")";
painter.drawText( (view.right() - painter.fontMetrics().width( s ))/2, painter.drawText( (view.right() - painter.fontMetrics().width( s ))/2,
view.bottom() + painter.fontMetrics().ascent() + 5, s ); 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 // change status message permanently

@ -24,10 +24,10 @@
#include <config.h> #include <config.h>
#endif #endif
// include files for Qt // include files for TQt
#include <qdialog.h> #include <tqdialog.h>
#include <qsplitter.h> #include <tqsplitter.h>
#include <qscrollbar.h> #include <tqscrollbar.h>
// include files for KDE // include files for KDE
#include <kapplication.h> #include <kapplication.h>
@ -48,11 +48,11 @@ class MergeResultWindow;
class WindowTitleWidget; class WindowTitleWidget;
class Overview; class Overview;
class QScrollBar; class TQScrollBar;
class QComboBox; class TQComboBox;
class QLineEdit; class TQLineEdit;
class QCheckBox; class TQCheckBox;
class QSplitter; class TQSplitter;
class KDiff3Part; class KDiff3Part;
@ -60,18 +60,19 @@ class DirectoryMergeWindow;
class DirectoryMergeInfo; class DirectoryMergeInfo;
class ReversibleScrollBar : public QScrollBar class ReversibleScrollBar : public TQScrollBar
{ {
Q_OBJECT Q_OBJECT
TQ_OBJECT
bool* m_pbRightToLeftLanguage; bool* m_pbRightToLeftLanguage;
int m_realVal; int m_realVal;
public: public:
ReversibleScrollBar( Orientation o, QWidget* pParent, bool* pbRightToLeftLanguage ) ReversibleScrollBar( Qt::Orientation o, TQWidget* pParent, bool* pbRightToLeftLanguage )
: QScrollBar( o, pParent ) : TQScrollBar( o, pParent )
{ {
m_pbRightToLeftLanguage=pbRightToLeftLanguage; m_pbRightToLeftLanguage=pbRightToLeftLanguage;
m_realVal=0; 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); } void setAgain(){ setValue(m_realVal); }
public slots: public slots:
@ -85,22 +86,23 @@ public slots:
void setValue(int i) void setValue(int i)
{ {
if(m_pbRightToLeftLanguage && *m_pbRightToLeftLanguage) if(m_pbRightToLeftLanguage && *m_pbRightToLeftLanguage)
QScrollBar::setValue( maxValue()-(i-minValue()) ); TQScrollBar::setValue( maxValue()-(i-minValue()) );
else else
QScrollBar::setValue( i ); TQScrollBar::setValue( i );
} }
signals: signals:
void valueChanged2(int); void valueChanged2(int);
}; };
class KDiff3App : public QSplitter class KDiff3App : public TQSplitter
{ {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
/** constructor of KDiff3App, calls all init functions to create the application. /** 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(); ~KDiff3App();
bool isPart(); bool isPart();
@ -108,7 +110,7 @@ class KDiff3App : public QSplitter
/** initializes the KActions of the application */ /** initializes the KActions of the application */
void initActions( KActionCollection* ); 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 */ and the recent file list to the configuration file */
void saveOptions( KConfig* ); void saveOptions( KConfig* );
@ -116,7 +118,7 @@ class KDiff3App : public QSplitter
void readOptions( KConfig* ); void readOptions( KConfig* );
// Finish initialisation (virtual, so that it can be called from the shell too.) // 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 /** 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 * 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(); virtual bool isFileSaved();
signals: signals:
void createNewInstance( const QString& fn1, const QString& fn2, const QString& fn3 ); void createNewInstance( const TQString& fn1, const TQString& fn2, const TQString& fn3 );
protected: protected:
void initDirectoryMergeActions(); void initDirectoryMergeActions();
/** sets up the statusbar for the main window by initialzing a statuslabel. */ /** 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*/ /** open a file and load it into the document*/
void slotFileOpen(); void slotFileOpen();
void slotFileOpen2( QString fn1, QString fn2, QString fn3, QString ofn, void slotFileOpen2( TQString fn1, TQString fn2, TQString fn3, TQString ofn,
QString an1, QString an2, QString an3, TotalDiffStatus* pTotalDiffStatus ); 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 */ /** save a document */
void slotFileSave(); void slotFileSave();
@ -176,7 +178,7 @@ class KDiff3App : public QSplitter
/** changes the statusbar contents for the standard label permanently, used to indicate current actions. /** changes the statusbar contents for the standard label permanently, used to indicate current actions.
* @param text the text that is displayed in the statusbar * @param text the text that is displayed in the statusbar
*/ */
void slotStatusMsg(const QString &text); void slotStatusMsg(const TQString &text);
private: private:
/** the configuration object of the application */ /** the configuration object of the application */
@ -249,14 +251,14 @@ class KDiff3App : public QSplitter
KToggleAction *overviewModeBC; KToggleAction *overviewModeBC;
QPopupMenu* m_pMergeEditorPopupMenu; TQPopupMenu* m_pMergeEditorPopupMenu;
QSplitter* m_pMainSplitter; TQSplitter* m_pMainSplitter;
QWidget* m_pMainWidget; TQWidget* m_pMainWidget;
QWidget* m_pMergeWindowFrame; TQWidget* m_pMergeWindowFrame;
ReversibleScrollBar* m_pHScrollBar; ReversibleScrollBar* m_pHScrollBar;
QScrollBar* m_pDiffVScrollBar; TQScrollBar* m_pDiffVScrollBar;
QScrollBar* m_pMergeVScrollBar; TQScrollBar* m_pMergeVScrollBar;
DiffTextWindow* m_pDiffTextWindow1; DiffTextWindow* m_pDiffTextWindow1;
DiffTextWindow* m_pDiffTextWindow2; DiffTextWindow* m_pDiffTextWindow2;
@ -264,28 +266,28 @@ class KDiff3App : public QSplitter
DiffTextWindowFrame* m_pDiffTextWindowFrame1; DiffTextWindowFrame* m_pDiffTextWindowFrame1;
DiffTextWindowFrame* m_pDiffTextWindowFrame2; DiffTextWindowFrame* m_pDiffTextWindowFrame2;
DiffTextWindowFrame* m_pDiffTextWindowFrame3; DiffTextWindowFrame* m_pDiffTextWindowFrame3;
QSplitter* m_pDiffWindowSplitter; TQSplitter* m_pDiffWindowSplitter;
MergeResultWindow* m_pMergeResultWindow; MergeResultWindow* m_pMergeResultWindow;
WindowTitleWidget* m_pMergeResultWindowTitle; WindowTitleWidget* m_pMergeResultWindowTitle;
bool m_bTripleDiff; bool m_bTripleDiff;
QSplitter* m_pDirectoryMergeSplitter; TQSplitter* m_pDirectoryMergeSplitter;
DirectoryMergeWindow* m_pDirectoryMergeWindow; DirectoryMergeWindow* m_pDirectoryMergeWindow;
DirectoryMergeInfo* m_pDirectoryMergeInfo; DirectoryMergeInfo* m_pDirectoryMergeInfo;
bool m_bDirCompare; bool m_bDirCompare;
Overview* m_pOverview; Overview* m_pOverview;
QWidget* m_pCornerWidget; TQWidget* m_pCornerWidget;
TotalDiffStatus m_totalDiffStatus; TotalDifftqStatus m_totalDifftqStatus;
SourceData m_sd1; SourceData m_sd1;
SourceData m_sd2; SourceData m_sd2;
SourceData m_sd3; SourceData m_sd3;
QString m_outputFilename; TQString m_outputFilename;
bool m_bDefaultFilename; bool m_bDefaultFilename;
DiffList m_diffList12; DiffList m_diffList12;
@ -308,10 +310,10 @@ class KDiff3App : public QSplitter
OptionDialog* m_pOptionDialog; OptionDialog* m_pOptionDialog;
FindDialog* m_pFindDialog; 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 bool eventFilter( TQObject* o, TQEvent* e );
virtual void resizeEvent(QResizeEvent*); virtual void resizeEvent(TQResizeEvent*);
bool improveFilenames(bool bCreateNewInstance); bool improveFilenames(bool bCreateNewInstance);
@ -335,7 +337,7 @@ public slots:
void resizeMergeResultWindow(); void resizeMergeResultWindow();
void slotRecalcWordWrap(); void slotRecalcWordWrap();
void showPopupMenu( const QPoint& point ); void showPopupMenu( const TQPoint& point );
void scrollDiffTextWindow( int deltaX, int deltaY ); void scrollDiffTextWindow( int deltaX, int deltaY );
void scrollMergeResultWindow( int deltaX, int deltaY ); void scrollMergeResultWindow( int deltaX, int deltaY );

@ -24,8 +24,8 @@
#include <kstdaction.h> #include <kstdaction.h>
#include <kfiledialog.h> #include <kfiledialog.h>
#include <qfile.h> #include <tqfile.h>
#include <qtextstream.h> #include <tqtextstream.h>
#include "kdiff3.h" #include "kdiff3.h"
#include "fileaccess.h" #include "fileaccess.h"
@ -35,26 +35,26 @@
#include "version.h" #include "version.h"
KDiff3Part::KDiff3Part( QWidget *parentWidget, const char *widgetName, KDiff3Part::KDiff3Part( TQWidget *tqparentWidget, const char *widgetName,
QObject *parent, const char *name ) TQObject *tqparent, const char *name )
: KParts::ReadOnlyPart(parent, name) : KParts::ReadOnlyPart(tqparent, name)
{ {
// we need an instance // we need an instance
setInstance( KDiff3PartFactory::instance() ); setInstance( KDiff3PartFactory::instance() );
// this should be your custom internal widget // 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. // 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 // notify the part that this is our internal widget
setWidget(m_widget); setWidget(m_widget);
// create our actions // create our actions
//KStdAction::open(this, SLOT(fileOpen()), actionCollection()); //KStdAction::open(this, TQT_SLOT(fileOpen()), actionCollection());
//KStdAction::saveAs(this, SLOT(fileSaveAs()), actionCollection()); //KStdAction::saveAs(this, TQT_SLOT(fileSaveAs()), actionCollection());
//KStdAction::save(this, SLOT(save()), actionCollection()); //KStdAction::save(this, TQT_SLOT(save()), actionCollection());
setXMLFile("kdiff3_part.rc"); setXMLFile("kdiff3_part.rc");
@ -93,12 +93,12 @@ void KDiff3Part::setModified(bool /*modified*/)
else else
save->setEnabled(false); 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); 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() ) if ( str.left( lineStart.length() )==lineStart && fileName.isEmpty() )
{ {
@ -114,7 +114,7 @@ static void getNameAndVersion( const QString& str, const QString& lineStart, QSt
--pos2; --pos2;
} }
int vpos = str.findRev("\t", -1); int vpos = str.tqfindRev("\t", -1);
if ( vpos>0 && vpos>(int)pos2 ) if ( vpos>0 && vpos>(int)pos2 )
{ {
version = str.mid( vpos+1 ); version = str.mid( vpos+1 );
@ -127,20 +127,20 @@ static void getNameAndVersion( const QString& str, const QString& lineStart, QSt
bool KDiff3Part::openFile() 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; std::cerr << "KDiff3: " << m_file.latin1() << std::endl;
QFile file(m_file); TQFile file(m_file);
if (file.open(IO_ReadOnly) == false) if (file.open(IO_ReadOnly) == false)
return false; return false;
// our example widget is text-based, so we use QTextStream instead // our example widget is text-based, so we use TQTextStream instead
// of a raw QDataStream // of a raw TQDataStream
QTextStream stream(&file); TQTextStream stream(&file);
QString str; TQString str;
QString fileName1; TQString fileName1;
QString fileName2; TQString fileName2;
QString version1; TQString version1;
QString version2; TQString version2;
while (!stream.eof() && (fileName1.isEmpty() || fileName2.isEmpty()) ) while (!stream.eof() && (fileName1.isEmpty() || fileName2.isEmpty()) )
{ {
str = stream.readLine() + "\n"; str = stream.readLine() + "\n";
@ -168,8 +168,8 @@ bool KDiff3Part::openFile()
{ {
// Normal patch // Normal patch
// patch -f -u --ignore-whitespace -i [inputfile] -o [outfile] [patchfile] // patch -f -u --ignore-whitespace -i [inputfile] -o [outfile] [patchfile]
QString tempFileName = FileAccess::tempFileName(); TQString tempFileName = FileAccess::tempFileName();
QString cmd = "patch -f -u --ignore-whitespace -i \"" + m_file + TQString cmd = "patch -f -u --ignore-whitespace -i \"" + m_file +
"\" -o \""+tempFileName + "\" \"" + fileName1+ "\""; "\" -o \""+tempFileName + "\" \"" + fileName1+ "\"";
::system( cmd.ascii() ); ::system( cmd.ascii() );
@ -183,8 +183,8 @@ bool KDiff3Part::openFile()
{ {
// Reverse patch // Reverse patch
// patch -f -u -R --ignore-whitespace -i [inputfile] -o [outfile] [patchfile] // patch -f -u -R --ignore-whitespace -i [inputfile] -o [outfile] [patchfile]
QString tempFileName = FileAccess::tempFileName(); TQString tempFileName = FileAccess::tempFileName();
QString cmd = "patch -f -u -R --ignore-whitespace -i \"" + m_file + TQString cmd = "patch -f -u -R --ignore-whitespace -i \"" + m_file +
"\" -o \""+tempFileName + "\" \"" + fileName2+"\""; "\" -o \""+tempFileName + "\" \"" + fileName2+"\"";
::system( cmd.ascii() ); ::system( cmd.ascii() );
@ -200,12 +200,12 @@ bool KDiff3Part::openFile()
// Assuming that files are on CVS: Try to get them // Assuming that files are on CVS: Try to get them
// cvs update -p -r [REV] [FILE] > [OUTPUTFILE] // cvs update -p -r [REV] [FILE] > [OUTPUTFILE]
QString tempFileName1 = FileAccess::tempFileName(); TQString tempFileName1 = FileAccess::tempFileName();
QString cmd1 = "cvs update -p -r " + version1 + " \"" + fileName1 + "\" >\""+tempFileName1+"\""; TQString cmd1 = "cvs update -p -r " + version1 + " \"" + fileName1 + "\" >\""+tempFileName1+"\"";
::system( cmd1.ascii() ); ::system( cmd1.ascii() );
QString tempFileName2 = FileAccess::tempFileName(); TQString tempFileName2 = FileAccess::tempFileName();
QString cmd2 = "cvs update -p -r " + version2 + " \"" + fileName2 + "\" >\""+tempFileName2+"\""; TQString cmd2 = "cvs update -p -r " + version2 + " \"" + fileName2 + "\" >\""+tempFileName2+"\"";
::system( cmd2.ascii() ); ::system( cmd2.ascii() );
m_widget->slotFileOpen2( tempFileName1, tempFileName2, "", "", m_widget->slotFileOpen2( tempFileName1, tempFileName2, "", "",
@ -233,13 +233,13 @@ bool KDiff3Part::saveFile()
if (isReadWrite() == false) if (isReadWrite() == false)
return false; return false;
// m_file is always local, so we use QFile // m_file is always local, so we use TQFile
QFile file(m_file); TQFile file(m_file);
if (file.open(IO_WriteOnly) == false) if (file.open(IO_WriteOnly) == false)
return false; return false;
// use QTextStream to dump the text to the file // use TQTextStream to dump the text to the file
QTextStream stream(&file); TQTextStream stream(&file);
//stream << m_widget->text(); //stream << m_widget->text();
file.close(); file.close();
@ -270,15 +270,15 @@ KDiff3PartFactory::~KDiff3PartFactory()
s_instance = 0L; s_instance = 0L;
} }
KParts::Part* KDiff3PartFactory::createPartObject( QWidget *parentWidget, const char *widgetName, KParts::Part* KDiff3PartFactory::createPartObject( TQWidget *tqparentWidget, const char *widgetName,
QObject *parent, const char *name, TQObject *tqparent, const char *name,
const char *classname, const QStringList&/*args*/ ) const char *classname, const TQStringList&/*args*/ )
{ {
// Create an instance of our Part // 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 // See if we are to be read-write or not
if (QCString(classname) == "KParts::ReadOnlyPart") if (TQCString(classname) == "KParts::ReadOnlyPart")
obj->setReadWrite(false); obj->setReadWrite(false);
return obj; return obj;

@ -23,8 +23,8 @@
#include <kparts/part.h> #include <kparts/part.h>
#include <kparts/factory.h> #include <kparts/factory.h>
class QWidget; class TQWidget;
class QPainter; class TQPainter;
class KURL; class KURL;
class KDiff3App; class KDiff3App;
@ -38,12 +38,13 @@ class KDiff3App;
class KDiff3Part : public KParts::ReadOnlyPart class KDiff3Part : public KParts::ReadOnlyPart
{ {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
/** /**
* Default constructor * Default constructor
*/ */
KDiff3Part(QWidget *parentWidget, const char *widgetName, KDiff3Part(TQWidget *tqparentWidget, const char *widgetName,
QObject *parent, const char *name); TQObject *tqparent, const char *name);
/** /**
* Destructor * Destructor
@ -84,12 +85,13 @@ class KAboutData;
class KDiff3PartFactory : public KParts::Factory class KDiff3PartFactory : public KParts::Factory
{ {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
KDiff3PartFactory(); KDiff3PartFactory();
virtual ~KDiff3PartFactory(); virtual ~KDiff3PartFactory();
virtual KParts::Part* createPartObject( QWidget *parentWidget, const char *widgetName, virtual KParts::Part* createPartObject( TQWidget *tqparentWidget, const char *widgetName,
QObject *parent, const char *name, TQObject *tqparent, const char *name,
const char *classname, const QStringList &args ); const char *classname, const TQStringList &args );
static KInstance* instance(); static KInstance* instance();
private: private:

@ -55,7 +55,7 @@ KDiff3Shell::KDiff3Shell(bool bCompleteInit)
{ {
// now that the Part is loaded, we cast it to a Part to get // now that the Part is loaded, we cast it to a Part to get
// our hands on it // 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" )); "kdiff3_part", "KParts::ReadWritePart" ));
if (m_part) if (m_part)
@ -68,7 +68,7 @@ KDiff3Shell::KDiff3Shell(bool bCompleteInit)
if (bCompleteInit) if (bCompleteInit)
((KDiff3App*)m_part->widget())->completeInit(); ((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 else
@ -113,7 +113,7 @@ bool KDiff3Shell::queryExit()
return true; return true;
} }
void KDiff3Shell::closeEvent(QCloseEvent*e) void KDiff3Shell::closeEvent(TQCloseEvent*e)
{ {
if ( queryClose() ) if ( queryClose() )
{ {
@ -164,8 +164,8 @@ void KDiff3Shell::optionsConfigureToolbars()
// use the standard toolbar editor // use the standard toolbar editor
KEditToolbar dlg(factory()); KEditToolbar dlg(factory());
connect(&dlg, SIGNAL(newToolbarConfig()), connect(&dlg, TQT_SIGNAL(newToolbarConfig()),
this, SLOT(applyNewToolbarConfig())); this, TQT_SLOT(applyNewToolbarConfig()));
dlg.exec(); dlg.exec();
} }
@ -182,7 +182,7 @@ void KDiff3Shell::applyNewToolbarConfig()
#endif #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); KDiff3Shell* pKDiff3Shell = new KDiff3Shell(false);
((KDiff3App*)pKDiff3Shell->m_part->widget())->completeInit(fn1,fn2,fn3); ((KDiff3App*)pKDiff3Shell->m_part->widget())->completeInit(fn1,fn2,fn3);

@ -39,6 +39,7 @@ class KToggleAction;
class KDiff3Shell : public KParts::MainWindow class KDiff3Shell : public KParts::MainWindow
{ {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
/** /**
* Default Constructor * Default Constructor
@ -52,7 +53,7 @@ public:
bool queryClose(); bool queryClose();
bool queryExit(); bool queryExit();
virtual void closeEvent(QCloseEvent*e); virtual void closeEvent(TQCloseEvent*e);
private slots: private slots:
void optionsShowToolbar(); void optionsShowToolbar();
@ -61,7 +62,7 @@ private slots:
void optionsConfigureToolbars(); void optionsConfigureToolbars();
void applyNewToolbarConfig(); 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: private:
KParts::ReadWritePart *m_part; KParts::ReadWritePart *m_part;

@ -21,11 +21,11 @@
#include <windows.h> #include <windows.h>
#include <shlobj.h> #include <shlobj.h>
#include <malloc.h> #include <malloc.h>
#include <qstring.h> #include <tqstring.h>
#include <qstringlist.h> #include <tqstringlist.h>
#include <qwidget.h> #include <tqwidget.h>
#include <qdir.h> #include <tqdir.h>
#include <qpopupmenu.h> #include <tqpopupmenu.h>
#include "ShellContextMenu.h" #include "ShellContextMenu.h"
#ifdef _DEBUG #ifdef _DEBUG
@ -42,10 +42,10 @@ static char THIS_FILE[]=__FILE__;
#define MAX_ID 10000 #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; CShellContextMenu scm;
scm.SetObjects(QDir::convertSeparators(itemPath)); scm.SetObjects(TQDir::convertSeparators(itemPath));
int id = scm.ShowContextMenu (pParentWidget, pt, pMenu); int id = scm.ShowContextMenu (pParentWidget, pt, pMenu);
if (id>=1) if (id>=1)
pMenu->activateItemAt(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(); HWND hWnd = pParentWidget->winId();
int iMenuType = 0; // to know which version of IContextMenu is supported 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; UINT_PTR i;
for( i=0; i<pMenu->count(); ++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()) if (!s.isEmpty())
AppendMenuW( m_hMenu, MF_STRING, i+1, (LPCWSTR)s.ucs2() ); 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 // only one object is passed
QStringList strArray; TQStringList strArray;
strArray << strObject; // create a CStringArray with one element strArray << strObject; // create a CStringArray with one element
SetObjects (strArray); // and pass it to SetObjects (CStringArray &strArray) 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 // free all allocated datas
if (m_psfFolder && bDelete) 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); 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 LPITEMIDLIST pidlItem = NULL; // relative pidl
SHBindToParentEx (pidl, IID_IShellFolder, (void **) &m_psfFolder, NULL); SHBindToParentEx (pidl, IID_IShellFolder, (void **) &m_psfFolder, NULL);
free (pidlItem); free (pidlItem);
@ -255,9 +255,9 @@ void CShellContextMenu::SetObjects(const QStringList &strList)
SHGetMalloc (&lpMalloc); SHGetMalloc (&lpMalloc);
lpMalloc->Free (pidl); 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) // 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; IShellFolder * psfFolder = NULL;
nItems = strList.size (); nItems = strList.size ();
@ -295,7 +295,7 @@ void CShellContextMenu::SetObjects(LPITEMIDLIST /*pidl*/)
m_pidlArray = NULL; m_pidlArray = NULL;
// full qualified PIDL is passed so we need // 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; LPITEMIDLIST pidlItem = NULL;
SHBindToParent ((LPCITEMIDLIST) pidl, IID_IShellFolder, (void **) &m_psfFolder, (LPCITEMIDLIST *) &pidlItem); SHBindToParent ((LPCITEMIDLIST) pidl, IID_IShellFolder, (void **) &m_psfFolder, (LPCITEMIDLIST *) &pidlItem);

@ -33,9 +33,9 @@ public:
void SetObjects (IShellFolder * psfFolder, LPITEMIDLIST pidlItem); void SetObjects (IShellFolder * psfFolder, LPITEMIDLIST pidlItem);
void SetObjects (IShellFolder * psfFolder, LPITEMIDLIST * pidlArray, int nItemCount); void SetObjects (IShellFolder * psfFolder, LPITEMIDLIST * pidlArray, int nItemCount);
void SetObjects (LPITEMIDLIST pidl); void SetObjects (LPITEMIDLIST pidl);
void SetObjects (const QString& strObject); void SetObjects (const TQString& strObject);
void SetObjects (const QStringList& strList); void SetObjects (const TQStringList& strList);
UINT ShowContextMenu (QWidget* pParent, QPoint pt, QPopupMenu* pMenu); UINT ShowContextMenu (TQWidget* pParent, TQPoint pt, TQPopupMenu* pMenu);
CShellContextMenu(); CShellContextMenu();
virtual ~CShellContextMenu(); virtual ~CShellContextMenu();

File diff suppressed because it is too large Load Diff

@ -20,25 +20,25 @@
#include "common.h" #include "common.h"
#include <qobject.h> #include <tqobject.h>
#include <qtabdialog.h> #include <tqtabdialog.h>
#include <qmainwindow.h> #include <tqmainwindow.h>
#include <qaction.h> #include <tqaction.h>
#include <qfiledialog.h> #include <tqfiledialog.h>
#include <qapplication.h> #include <tqapplication.h>
#include <qvbox.h> #include <tqvbox.h>
#include <qpushbutton.h> #include <tqpushbutton.h>
#include <qstatusbar.h> #include <statusbar.h>
#include <qtoolbar.h> #include <tqtoolbar.h>
#include <qprogressbar.h> #include <tqprogressbar.h>
#include <qpopupmenu.h> #include <tqpopupmenu.h>
#include <qstringlist.h> #include <tqstringlist.h>
#include <qprinter.h> #include <tqprinter.h>
#include <map> #include <map>
#include <list> #include <list>
QString getTranslationDir(); TQString getTranslationDir();
class KMainWindow; class KMainWindow;
@ -46,61 +46,62 @@ class KURL
{ {
public: public:
KURL(){} KURL(){}
KURL(const QString& s){ m_s = s; } KURL(const TQString& s){ m_s = s; }
static KURL fromPathOrURL( const QString& s ){ return KURL(s); } static KURL fromPathOrURL( const TQString& s ){ return KURL(s); }
QString url() const { return m_s; } TQString url() const { return m_s; }
bool isEmpty() const { return m_s.isEmpty(); } 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 isLocalFile() const { return true; }
bool isValid() const { return true; } bool isValid() const { return true; }
QString path() const { return m_s; } TQString path() const { return m_s; }
void setPath( const QString& s ){ m_s=s; } void setPath( const TQString& s ){ m_s=s; }
QString fileName() const { return m_s; } // not really needed TQString fileName() const { return m_s; } // not really needed
void addPath( const QString& s ){ m_s += "/" + s; } void addPath( const TQString& s ){ m_s += "/" + s; }
private: private:
QString m_s; TQString m_s;
}; };
class KMessageBox class KMessageBox
{ {
public: public:
static void error( QWidget* parent, const QString& text, const QString& caption=QString() ); static void error( TQWidget* tqparent, const TQString& text, const TQString& caption=TQString() );
static int warningContinueCancel( QWidget* parent, const QString& text, const QString& caption=QString(), static int warningContinueCancel( TQWidget* tqparent, const TQString& text, const TQString& caption=TQString(),
const QString& button1=QString("Continue") ); const TQString& button1=TQString("Continue") );
static void sorry( QWidget* parent, const QString& text, const QString& caption=QString() ); static void sorry( TQWidget* tqparent, const TQString& text, const TQString& caption=TQString() );
static void information( QWidget* parent, const QString& text, const QString& caption=QString() ); static void information( TQWidget* tqparent, const TQString& text, const TQString& caption=TQString() );
static int warningYesNo( QWidget* parent, const QString& text, const QString& caption, static int warningYesNo( TQWidget* tqparent, const TQString& text, const TQString& caption,
const QString& button1, const QString& button2 ); const TQString& button1, const TQString& button2 );
static int warningYesNoCancel( static int warningYesNoCancel(
QWidget* parent, const QString& text, const QString& caption, TQWidget* tqparent, const TQString& text, const TQString& caption,
const QString& button1, const QString& button2 ); const TQString& button1, const TQString& button2 );
enum {Cancel=-1, No=0, Yes=1, Continue=1}; 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 I18N_NOOP(x) x
#define RESTORE(x) #define RESTORE(x)
#define _UNLOAD(x) #define _UNLOAD(x)
typedef QPopupMenu KPopupMenu; typedef TQPopupMenu KPopupMenu;
class KDialogBase : public QTabDialog class KDialogBase : public TQTabDialog
{ {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: 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 ); bool /*modal*/, bool );
~KDialogBase(); ~KDialogBase();
void incInitialSize ( const QSize& ); void incInitialSize ( const TQSize& );
void setHelp(const QString& helpfilename, const QString& ); void setHelp(const TQString& helpfilename, const TQString& );
enum {IconList, Help, Default, Apply, Ok, Cancel }; 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 ); TQVBox* addVBoxPage( const TQString& name, const TQString& info, int );
QFrame* addPage( const QString& name, const QString& info, int ); TQFrame* addPage( const TQString& name, const TQString& info, int );
int spacingHint(); int spacingHint();
virtual void accept(); virtual void accept();
@ -115,37 +116,37 @@ protected slots:
virtual void slotDefault( void ); virtual void slotDefault( void );
}; };
class KFileDialog : public QFileDialog class KFileDialog : public TQFileDialog
{ {
public: public:
static KURL getSaveURL( const QString &startDir=QString::null, static KURL getSaveURL( const TQString &startDir=TQString(),
const QString &filter=QString::null, const TQString &filter=TQString(),
QWidget *parent=0, const QString &caption=QString::null); TQWidget *tqparent=0, const TQString &caption=TQString());
static KURL getOpenURL( const QString & startDir = QString::null, static KURL getOpenURL( const TQString & startDir = TQString(),
const QString & filter = QString::null, const TQString & filter = TQString(),
QWidget * parent = 0, TQWidget * tqparent = 0,
const QString & caption = QString::null ); const TQString & caption = TQString() );
static KURL getExistingURL( const QString & startDir = QString::null, static KURL getExistingURL( const TQString & startDir = TQString(),
QWidget * parent = 0, TQWidget * tqparent = 0,
const QString & caption = QString::null ); const TQString & caption = TQString() );
static QString getSaveFileName (const QString &startDir=QString::null, static TQString getSaveFileName (const TQString &startDir=TQString(),
const QString &filter=QString::null, const TQString &filter=TQString(),
QWidget *parent=0, TQWidget *tqparent=0,
const QString &caption=QString::null); const TQString &caption=TQString());
}; };
typedef QStatusBar KStatusBar; typedef TQStatusBar KStatusBar;
class KToolBar : public QToolBar class KToolBar : public TQToolBar
{ {
public: public:
KToolBar(QMainWindow* parent); KToolBar(TQMainWindow* tqparent);
enum BarPosition {Top, Bottom, Left, Right}; enum BarPosition {Top, Bottom, Left, Right};
BarPosition barPos(); BarPosition barPos();
void setBarPos(BarPosition); void setBarPos(BarPosition);
private: private:
QMainWindow* m_pMainWindow; TQMainWindow* m_pMainWindow;
}; };
class KActionCollection class KActionCollection
@ -158,9 +159,9 @@ public:
class KKeyDialog class KKeyDialog
{ {
public: public:
static void configure(void*, QWidget*){} static void configure(void*, TQWidget*){}
static void configureKeys(KActionCollection*, const QString&){} static void configureKeys(KActionCollection*, const TQString&){}
static void configure(KActionCollection*, const QString&){} static void configure(KActionCollection*, const TQString&){}
}; };
namespace KParts namespace KParts
@ -168,9 +169,10 @@ namespace KParts
class ReadWritePart; class ReadWritePart;
} }
class KMainWindow : public QMainWindow class KMainWindow : public TQMainWindow
{ {
Q_OBJECT Q_OBJECT
TQ_OBJECT
private: private:
KStatusBar m_statusBar; KStatusBar m_statusBar;
KActionCollection m_actionCollection; KActionCollection m_actionCollection;
@ -178,27 +180,27 @@ protected:
virtual bool queryClose() = 0; virtual bool queryClose() = 0;
virtual bool queryExit() = 0; virtual bool queryExit() = 0;
public: public:
QPopupMenu* fileMenu; TQPopupMenu* fileMenu;
QPopupMenu* editMenu; TQPopupMenu* editMenu;
QPopupMenu* directoryMenu; TQPopupMenu* directoryMenu;
QPopupMenu* dirCurrentItemMenu; TQPopupMenu* dirCurrentItemMenu;
QPopupMenu* dirCurrentSyncItemMenu; TQPopupMenu* dirCurrentSyncItemMenu;
QPopupMenu* movementMenu; TQPopupMenu* movementMenu;
QPopupMenu* mergeMenu; TQPopupMenu* mergeMenu;
QPopupMenu* diffMenu; TQPopupMenu* diffMenu;
QPopupMenu* windowsMenu; TQPopupMenu* windowsMenu;
QPopupMenu* settingsMenu; TQPopupMenu* settingsMenu;
QPopupMenu* helpMenu; TQPopupMenu* helpMenu;
KToolBar* m_pToolBar; KToolBar* m_pToolBar;
KMainWindow( QWidget* parent, const char* name ); KMainWindow( TQWidget* tqparent, const char* name );
KToolBar* toolBar(const QString& s = QString::null); KToolBar* toolBar(const TQString& s = TQString());
KActionCollection* actionCollection(); KActionCollection* actionCollection();
void createGUI(); void createGUI();
void createGUI(KParts::ReadWritePart*){createGUI();} void createGUI(KParts::ReadWritePart*){createGUI();}
QList<KMainWindow>* memberList; TQList<KMainWindow>* memberList;
public slots: public slots:
void slotHelp(); void slotHelp();
void slotAbout(); void slotAbout();
@ -206,33 +208,34 @@ public slots:
class KConfig : public ValueMap class KConfig : public ValueMap
{ {
QString m_fileName; TQString m_fileName;
public: public:
KConfig(); KConfig();
~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 Q_OBJECT
TQ_OBJECT
public: 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 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 QString& text, int accel, QObject* 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(QObject* receiver, const char* slot, KActionCollection* actionCollection, void init(TQObject* receiver, const char* slot, KActionCollection* actionCollection,
const char* name, bool bToggle, bool bMenu); const char* name, bool bToggle, bool bMenu);
void setStatusText(const QString&); void setStatusText(const TQString&);
void plug(QPopupMenu*); void plug(TQPopupMenu*);
}; };
class KToggleAction : public KAction class KToggleAction : public KAction
{ {
public: 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 TQString& text, const TQIconSet& icon, int accel, TQObject* 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 TQString& text, int accel, TQObject* 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, KActionCollection* actionCollection, const char* name, bool bMenu=true);
void setChecked(bool); void setChecked(bool);
bool isChecked(); bool isChecked();
}; };
@ -241,24 +244,24 @@ public:
class KStdAction class KStdAction
{ {
public: public:
static KAction* open( QWidget* parent, const char* slot, KActionCollection* ); static KAction* open( TQWidget* tqparent, const char* slot, KActionCollection* );
static KAction* save( QWidget* parent, const char* slot, KActionCollection* ); static KAction* save( TQWidget* tqparent, const char* slot, KActionCollection* );
static KAction* saveAs( QWidget* parent, const char* slot, KActionCollection* ); static KAction* saveAs( TQWidget* tqparent, const char* slot, KActionCollection* );
static KAction* print( QWidget* parent, const char* slot, KActionCollection* ); static KAction* print( TQWidget* tqparent, const char* slot, KActionCollection* );
static KAction* quit( QWidget* parent, const char* slot, KActionCollection* ); static KAction* quit( TQWidget* tqparent, const char* slot, KActionCollection* );
static KAction* cut( QWidget* parent, const char* slot, KActionCollection* ); static KAction* cut( TQWidget* tqparent, const char* slot, KActionCollection* );
static KAction* copy( QWidget* parent, const char* slot, KActionCollection* ); static KAction* copy( TQWidget* tqparent, const char* slot, KActionCollection* );
static KAction* paste( QWidget* parent, const char* slot, KActionCollection* ); static KAction* paste( TQWidget* tqparent, const char* slot, KActionCollection* );
static KAction* selectAll( QWidget* parent, const char* slot, KActionCollection* ); static KAction* selectAll( TQWidget* tqparent, const char* slot, KActionCollection* );
static KToggleAction* showToolbar( QWidget* parent, const char* slot, KActionCollection* ); static KToggleAction* showToolbar( TQWidget* tqparent, const char* slot, KActionCollection* );
static KToggleAction* showStatusbar( QWidget* parent, const char* slot, KActionCollection* ); static KToggleAction* showStatusbar( TQWidget* tqparent, const char* slot, KActionCollection* );
static KAction* preferences( QWidget* parent, const char* slot, KActionCollection* ); static KAction* preferences( TQWidget* tqparent, const char* slot, KActionCollection* );
static KAction* about( QWidget* parent, const char* slot, KActionCollection* ); static KAction* about( TQWidget* tqparent, const char* slot, KActionCollection* );
static KAction* aboutQt( KActionCollection* ); static KAction* aboutTQt( KActionCollection* );
static KAction* help( QWidget* parent, const char* slot, KActionCollection* ); static KAction* help( TQWidget* tqparent, const char* slot, KActionCollection* );
static KAction* find( QWidget* parent, const char* slot, KActionCollection* ); static KAction* tqfind( TQWidget* tqparent, const char* slot, KActionCollection* );
static KAction* findNext( QWidget* parent, const char* slot, KActionCollection* ); static KAction* findNext( TQWidget* tqparent, const char* slot, KActionCollection* );
static KAction* keyBindings( QWidget* parent, const char* slot, KActionCollection* ); static KAction* keyBindings( TQWidget* tqparent, const char* slot, KActionCollection* );
}; };
class KIcon class KIcon
@ -267,40 +270,42 @@ public:
enum {SizeMedium,Small}; enum {SizeMedium,Small};
}; };
class KFontChooser : public QWidget class KFontChooser : public TQWidget
{ {
Q_OBJECT Q_OBJECT
QFont m_font; TQ_OBJECT
QPushButton* m_pSelectFont; TQFont m_font;
QLabel* m_pLabel; TQPushButton* m_pSelectFont;
QWidget* m_pParent; TQLabel* m_pLabel;
TQWidget* m_pParent;
public: public:
KFontChooser( QWidget* pParent, const QString& name, bool, const QStringList&, bool, int ); KFontChooser( TQWidget* pParent, const TQString& name, bool, const TQStringList&, bool, int );
QFont font(); TQFont font();
void setFont( const QFont&, bool ); void setFont( const TQFont&, bool );
private slots: private slots:
void slotSelectFont(); void slotSelectFont();
}; };
class KColorButton : public QPushButton class KColorButton : public TQPushButton
{ {
Q_OBJECT Q_OBJECT
QColor m_color; TQ_OBJECT
TQColor m_color;
public: public:
KColorButton(QWidget* parent); KColorButton(TQWidget* tqparent);
QColor color(); TQColor color();
void setColor(const QColor&); void setColor(const TQColor&);
virtual void paintEvent(QPaintEvent* e); virtual void paintEvent(TQPaintEvent* e);
public slots: public slots:
void slotClicked(); void slotClicked();
}; };
class KPrinter : public QPrinter class KPrinter : public TQPrinter
{ {
public: public:
KPrinter(); KPrinter();
enum e_PageSelection {ApplicationSide}; enum e_PageSelection {ApplicationSide};
QValueList<int> pageList(); TQValueList<int> pageList();
void setCurrentPage(int); void setCurrentPage(int);
void setPageSelection(e_PageSelection); void setPageSelection(e_PageSelection);
}; };
@ -308,7 +313,7 @@ public:
class KStandardDirs class KStandardDirs
{ {
public: public:
QString findResource(const QString& resource, const QString& appName); TQString findResource(const TQString& resource, const TQString& appName);
}; };
struct KCmdLineOptions struct KCmdLineOptions
@ -323,30 +328,30 @@ struct KCmdLineOptions
class KAboutData class KAboutData
{ {
public: public:
KAboutData( const QString& name, const QString& appName, const QString& version, KAboutData( const TQString& name, const TQString& appName, const TQString& version,
const QString& description, int licence, const TQString& description, int licence,
const QString& copyright, int w, const QString& homepage, const QString& email); const TQString& copyright, int w, const TQString& homepage, const TQString& email);
KAboutData( const QString& name, const QString& appName, const QString& version ); 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 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); void addCredit(const char* name=0, const char* task=0, const char* email=0, const char* weblink=0);
enum { License_GPL }; enum { License_GPL };
struct AboutDataEntry 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) : m_name(name), m_task(task), m_email(email), m_weblink(weblink)
{} {}
QString m_name; TQString m_name;
QString m_task; TQString m_task;
QString m_email; TQString m_email;
QString m_weblink; TQString m_weblink;
}; };
std::list<AboutDataEntry> m_authorList; std::list<AboutDataEntry> m_authorList;
std::list<AboutDataEntry> m_creditList; std::list<AboutDataEntry> m_creditList;
}; };
typedef QValueList<QCString> QCStringList; typedef TQValueList<TQCString> QCStringList;
class KCmdLineArgs class KCmdLineArgs
{ {
@ -356,21 +361,21 @@ public:
static void addCmdLineOptions( KCmdLineOptions* options ); // Add our own options. static void addCmdLineOptions( KCmdLineOptions* options ); // Add our own options.
int count(); int count();
QString arg(int); TQString arg(int);
KURL url(int i){ return KURL(arg(i)); } KURL url(int i){ return KURL(arg(i)); }
void clear(); void clear();
QString getOption(const QString&); TQString getOption(const TQString&);
QCStringList getOptionList( const QString& ); QCStringList getOptionList( const TQString& );
bool isSet(const QString&); bool isSet(const TQString&);
}; };
class KIconLoader class KIconLoader
{ {
public: public:
QPixmap loadIcon(const QString& name, int); TQPixmap loadIcon(const TQString& name, int);
}; };
class KApplication : public QApplication class KApplication : public TQApplication
{ {
KConfig m_config; KConfig m_config;
KIconLoader m_iconLoader; KIconLoader m_iconLoader;
@ -384,21 +389,22 @@ public:
extern KApplication* kapp; extern KApplication* kapp;
class KLibFactory : public QObject class KLibFactory : public TQObject
{ {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
QObject* create(QObject*,const QString&,const QString&); TQObject* create(TQObject*,const TQString&,const TQString&);
}; };
class KLibLoader class KLibLoader
{ {
public: public:
static KLibLoader* self(); static KLibLoader* self();
KLibFactory* factory(const QString&); KLibFactory* factory(const TQString&);
}; };
class KEditToolbar : public QDialog class KEditToolbar : public TQDialog
{ {
public: public:
KEditToolbar( int ){} KEditToolbar( int ){}
@ -413,13 +419,13 @@ public:
namespace KIO namespace KIO
{ {
enum UDSEntry {}; enum UDSEntry {};
typedef QValueList<UDSEntry> UDSEntryList; typedef TQValueList<UDSEntry> UDSEntryList;
class Job : public QObject class Job : public TQObject
{ {
public: public:
void kill(bool){} void kill(bool){}
bool error() {return false;} bool error() {return false;}
void showErrorDialog( QWidget* ) {} void showErrorDialog( TQWidget* ) {}
}; };
class SimpleJob : public Job {}; class SimpleJob : public Job {};
SimpleJob* mkdir( KURL ); SimpleJob* mkdir( KURL );
@ -442,9 +448,9 @@ namespace KIO
TransferJob* put( KURL, int, bool, bool, bool ); TransferJob* put( KURL, int, bool, bool, bool );
}; };
typedef QProgressBar KProgress; typedef TQProgressBar KProgress;
class KInstance : public QObject class KInstance : public TQObject
{ {
public: public:
KInstance(KAboutData*){} KInstance(KAboutData*){}
@ -455,49 +461,50 @@ namespace KParts
class MainWindow : public KMainWindow class MainWindow : public KMainWindow
{ {
public: public:
MainWindow( QWidget* parent, const char* name ) : KMainWindow(parent,name) {} MainWindow( TQWidget* tqparent, const char* name ) : KMainWindow(tqparent,name) {}
void setXMLFile(const QString&){} void setXMLFile(const TQString&){}
void setAutoSaveSettings(){} void setAutoSaveSettings(){}
void saveMainWindowSettings(KConfig*){} void saveMainWindowSettings(KConfig*){}
void applyMainWindowSettings(KConfig*){} void applyMainWindowSettings(KConfig*){}
int factory(){return 0;} int factory(){return 0;}
}; };
class Part : public QObject class Part : public TQObject
{ {
public: public:
KActionCollection* actionCollection(); KActionCollection* actionCollection();
KApplication* instance(); KApplication* instance();
void setWidget( QWidget* w ){ m_pWidget=w; } void setWidget( TQWidget* w ){ m_pWidget=w; }
QWidget* widget(){return m_pWidget;} TQWidget* widget(){return m_pWidget;}
void setXMLFile(const QString&){} void setXMLFile(const TQString&){}
private: private:
QWidget* m_pWidget; TQWidget* m_pWidget;
}; };
class ReadOnlyPart : public Part class ReadOnlyPart : public Part
{ {
public: public:
ReadOnlyPart(){} ReadOnlyPart(){}
ReadOnlyPart(QObject*,const QCString&){} ReadOnlyPart(TQObject*,const TQCString&){}
void setInstance( KInstance* ){} void setInstance( KInstance* ){}
QString m_file; TQString m_file;
}; };
class ReadWritePart : public ReadOnlyPart class ReadWritePart : public ReadOnlyPart
{ {
public: public:
ReadWritePart(QObject*,const QCString&){} ReadWritePart(TQObject*,const TQCString&){}
void setReadWrite(bool){} void setReadWrite(bool){}
}; };
class Factory : public KLibFactory class Factory : public KLibFactory
{ {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
virtual KParts::Part* createPartObject( QWidget *parentWidget, const char *widgetName, virtual KParts::Part* createPartObject( TQWidget *tqparentWidget, const char *widgetName,
QObject *parent, const char *name, TQObject *tqparent, const char *name,
const char *classname, const QStringList &args )=0; const char *classname, const TQStringList &args )=0;
}; };
}; };
#endif #endif

@ -21,9 +21,9 @@
#include "kdiff3_shell.h" #include "kdiff3_shell.h"
#include <kstandarddirs.h> #include <kstandarddirs.h>
#include "version.h" #include "version.h"
#include <qtextcodec.h> #include <tqtextcodec.h>
#include <qfile.h> #include <tqfile.h>
#include <qtextstream.h> #include <tqtextstream.h>
#include <vector> #include <vector>
#ifdef KREPLACEMENTS_H #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))); vOptions.insert( vOptions.end(), options, (KCmdLineOptions*)((char*)options+sizeof(options)));
QString configFileName = KStandardDirs().findResource("config","kdiff3rc"); TQString configFileName = KStandardDirs().findResource("config","kdiff3rc");
QFile configFile( configFileName ); TQFile configFile( configFileName );
if ( configFile.open( IO_ReadOnly ) ) if ( configFile.open( IO_ReadOnly ) )
{ {
QTextStream ts( &configFile ); TQTextStream ts( &configFile );
while(!ts.atEnd()) while(!ts.atEnd())
{ {
QString line = ts.readLine(); TQString line = ts.readLine();
if ( line.startsWith("IgnorableCmdLineOptions=") ) if ( line.startsWith("IgnorableCmdLineOptions=") )
{ {
int pos = line.find('='); int pos = line.tqfind('=');
if (pos>=0) if (pos>=0)
{ {
QString s = line.mid(pos+1); TQString s = line.mid(pos+1);
QStringList sl = QStringList::split( '|', s ); TQStringList sl = TQStringList::split( '|', s );
if (!sl.isEmpty()) if (!sl.isEmpty())
{ {
ignorableOptions = QStringList::split( ';', sl.front() ); ignorableOptions = TQStringList::split( ';', sl.front() );
for (QStringList::iterator i=ignorableOptions.begin(); i!=ignorableOptions.end(); ++i) for (TQStringList::iterator i=ignorableOptions.begin(); i!=ignorableOptions.end(); ++i)
{ {
KCmdLineOptions ignoreOption; KCmdLineOptions ignoreOption;
(*i).remove('-'); (*i).remove('-');
@ -112,7 +112,7 @@ void initialiseCmdLineArgs(std::vector<KCmdLineOptions>& vOptions, QStringList&
#ifdef _WIN32 #ifdef _WIN32
#include <process.h> #include <process.h>
// This command checks the comm // 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 ) for(int j=0; j<argc; ++j )
{ {
@ -168,7 +168,7 @@ int main(int argc, char *argv[])
} }
#endif #endif
//QApplication::setColorSpec( QApplication::ManyColor ); // Grab all 216 colors //TQApplication::setColorSpec( TQApplication::ManyColor ); // Grab all 216 colors
KAboutData aboutData( "kdiff3", I18N_NOOP("KDiff3"), KAboutData aboutData( "kdiff3", I18N_NOOP("KDiff3"),
VERSION, description, KAboutData::License_GPL, VERSION, description, KAboutData::License_GPL,
@ -192,29 +192,29 @@ int main(int argc, char *argv[])
KCmdLineArgs::init( argc, argv, &aboutData ); KCmdLineArgs::init( argc, argv, &aboutData );
std::vector<KCmdLineOptions> vOptions; std::vector<KCmdLineOptions> vOptions;
QStringList ignorableOptions; TQStringList ignorableOptions;
initialiseCmdLineArgs(vOptions, ignorableOptions); initialiseCmdLineArgs(vOptions, ignorableOptions);
KApplication app; KApplication app;
#ifdef KREPLACEMENTS_H #ifdef KREPLACEMENTS_H
QString locale; TQString locale;
locale = app.config()->readEntry("Language", "Auto"); locale = app.config()->readEntry("Language", "Auto");
int spacePos = locale.find(' '); int spacePos = locale.tqfind(' ');
if (spacePos>0) locale = locale.left(spacePos); if (spacePos>0) locale = locale.left(spacePos);
QTranslator kdiff3Translator( 0 ); TQTranslator kdiff3Translator( 0 );
QTranslator qtTranslator( 0 ); TQTranslator qtTranslator( 0 );
if (locale != "en_orig") if (locale != "en_orig")
{ {
if ( locale == "Auto" || locale.isEmpty() ) if ( locale == "Auto" || locale.isEmpty() )
locale = QTextCodec::locale(); locale = TQTextCodec::locale();
QString translationDir = getTranslationDir(); TQString translationDir = getTranslationDir();
kdiff3Translator.load( QString("kdiff3_")+locale, translationDir ); kdiff3Translator.load( TQString("kdiff3_")+locale, translationDir );
app.installTranslator( &kdiff3Translator ); app.installTranslator( &kdiff3Translator );
qtTranslator.load( QString("qt_")+locale, translationDir ); qtTranslator.load( TQString("qt_")+locale, translationDir );
app.installTranslator( &qtTranslator ); app.installTranslator( &qtTranslator );
} }
#endif #endif

File diff suppressed because it is too large Load Diff

@ -20,17 +20,18 @@
#include "diff.h" #include "diff.h"
#include <qwidget.h> #include <tqwidget.h>
#include <qpixmap.h> #include <tqpixmap.h>
#include <qtimer.h> #include <tqtimer.h>
class QPainter; class TQPainter;
class Overview : public QWidget class Overview : public TQWidget
{ {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
Overview( QWidget* pParent, OptionDialog* pOptions ); Overview( TQWidget* pParent, OptionDialog* pOptions );
void init( Diff3LineList* pDiff3LineList, bool bTripleDiff ); void init( Diff3LineList* pDiff3LineList, bool bTripleDiff );
void reset(); void reset();
@ -52,15 +53,15 @@ private:
bool m_bTripleDiff; bool m_bTripleDiff;
int m_firstLine; int m_firstLine;
int m_pageHeight; int m_pageHeight;
QPixmap m_pixmap; TQPixmap m_pixmap;
bool m_bPaintingAllowed; bool m_bPaintingAllowed;
e_OverviewMode m_eOverviewMode; e_OverviewMode m_eOverviewMode;
int m_nofLines; int m_nofLines;
virtual void paintEvent( QPaintEvent* e ); virtual void paintEvent( TQPaintEvent* e );
virtual void mousePressEvent( QMouseEvent* e ); virtual void mousePressEvent( TQMouseEvent* e );
virtual void mouseMoveEvent( QMouseEvent* e ); virtual void mouseMoveEvent( TQMouseEvent* e );
void drawColumn( QPainter& p, e_OverviewMode eOverviewMode, int x, int w, int h, int nofLines ); void drawColumn( TQPainter& p, e_OverviewMode eOverviewMode, int x, int w, int h, int nofLines );
}; };
@ -93,14 +94,15 @@ enum e_MergeSrcSelector
C=3 C=3
}; };
class MergeResultWindow : public QWidget class MergeResultWindow : public TQWidget
{ {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
MergeResultWindow( MergeResultWindow(
QWidget* pParent, TQWidget* pParent,
OptionDialog* pOptionDialog, OptionDialog* pOptionDialog,
QStatusBar* pStatusBar TQStatusBar* pStatusBar
); );
void init( void init(
@ -108,12 +110,12 @@ public:
const LineData* pLineDataB, int sizeB, const LineData* pLineDataB, int sizeB,
const LineData* pLineDataC, int sizeC, const LineData* pLineDataC, int sizeC,
const Diff3LineList* pDiff3LineList, const Diff3LineList* pDiff3LineList,
TotalDiffStatus* pTotalDiffStatus TotalDifftqStatus* pTotalDifftqStatus
); );
void reset(); void reset();
bool saveDocument( const QString& fileName, QTextCodec* pEncoding ); bool saveDocument( const TQString& fileName, TQTextCodec* pEncoding );
int getNrOfUnsolvedConflicts(int* pNrOfWhiteSpaceConflicts=0); int getNrOfUnsolvedConflicts(int* pNrOfWhiteSpaceConflicts=0);
void choose(int selector); void choose(int selector);
void chooseGlobal(int selector, bool bConflictsOnly, bool bWhiteSpaceOnly ); void chooseGlobal(int selector, bool bConflictsOnly, bool bWhiteSpaceOnly );
@ -122,7 +124,7 @@ public:
int getNofLines(); int getNofLines();
int getNofVisibleColumns(); int getNofVisibleColumns();
int getNofVisibleLines(); int getNofVisibleLines();
QString getSelection(); TQString getSelection();
void resetSelection(); void resetSelection();
void showNrOfConflicts(); void showNrOfConflicts();
bool isDeltaAboveCurrent(); bool isDeltaAboveCurrent();
@ -132,7 +134,7 @@ public:
bool isUnsolvedConflictAtCurrent(); bool isUnsolvedConflictAtCurrent();
bool isUnsolvedConflictAboveCurrent(); bool isUnsolvedConflictAboveCurrent();
bool isUnsolvedConflictBelowCurrent(); 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 setSelection( int firstLine, int startPos, int lastLine, int endPos );
void setOverviewMode( Overview::e_OverviewMode eOverviewMode ); void setOverviewMode( Overview::e_OverviewMode eOverviewMode );
Overview::e_OverviewMode getOverviewMode(); Overview::e_OverviewMode getOverviewMode();
@ -168,12 +170,12 @@ signals:
void selectionEnd(); void selectionEnd();
void newSelection(); void newSelection();
void updateAvailabilities(); void updateAvailabilities();
void showPopupMenu( const QPoint& point ); void showPopupMenu( const TQPoint& point );
void noRelevantChangesDetected(); void noRelevantChangesDetected();
private: private:
void merge(bool bAutoSolve, int defaultSelector, bool bConflictsOnly=false, bool bWhiteSpaceOnly=false ); void merge(bool bAutoSolve, int defaultSelector, bool bConflictsOnly=false, bool bWhiteSpaceOnly=false );
QString getString( int lineIdx ); TQString getString( int lineIdx );
OptionDialog* m_pOptionDialog; OptionDialog* m_pOptionDialog;
@ -185,7 +187,7 @@ private:
int m_sizeC; int m_sizeC;
const Diff3LineList* m_pDiff3LineList; const Diff3LineList* m_pDiff3LineList;
TotalDiffStatus* m_pTotalDiffStatus; TotalDifftqStatus* m_pTotalDifftqStatus;
bool m_bPaintingAllowed; bool m_bPaintingAllowed;
int m_delayedDrawTimer; int m_delayedDrawTimer;
@ -196,13 +198,13 @@ private:
{ {
public: public:
MergeEditLine(Diff3LineList::const_iterator i, int src=0){m_id3l=i; m_src=src; m_bLineRemoved=false; } 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(); } 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 isRemoved() { return m_bLineRemoved; }
bool isEditableText() { return !isConflict() && !isRemoved(); } bool isEditableText() { return !isConflict() && !isRemoved(); }
void setString( const QString& s ){ m_str=s; m_bLineRemoved=false; m_src=0; } void setString( const TQString& s ){ m_str=s; m_bLineRemoved=false; m_src=0; }
QString getString( const MergeResultWindow* ); TQString getString( const MergeResultWindow* );
bool isModified() { return ! m_str.isNull() || (m_bLineRemoved && m_src==0); } bool isModified() { return ! m_str.isNull() || (m_bLineRemoved && m_src==0); }
void setSource( int src, bool bLineRemoved ) { m_src=src; m_bLineRemoved =bLineRemoved; } void setSource( int src, bool bLineRemoved ) { m_src=src; m_bLineRemoved =bLineRemoved; }
@ -212,7 +214,7 @@ private:
private: private:
Diff3LineList::const_iterator m_id3l; 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. 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; bool m_bLineRemoved;
}; };
@ -339,7 +341,7 @@ private:
MergeEditLineList& choice( bool bThreeInputs ); MergeEditLineList& choice( bool bThreeInputs );
bool staysInPlace( bool bThreeInputs, Diff3LineList::const_iterator& iHistoryEnd ); 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 ); void collectHistoryInformation( int src, Diff3LineList::const_iterator iHistoryBegin, Diff3LineList::const_iterator iHistoryEnd, HistoryMap& historyMap, std::list< HistoryMap::iterator >& hitList );
typedef std::list<MergeLine> MergeLineList; typedef std::list<MergeLine> MergeLineList;
@ -364,28 +366,28 @@ private:
); );
MergeLineList::iterator splitAtDiff3LineIdx( int d3lLineIdx ); MergeLineList::iterator splitAtDiff3LineIdx( int d3lLineIdx );
virtual void paintEvent( QPaintEvent* e ); virtual void paintEvent( TQPaintEvent* e );
void myUpdate(int afterMilliSecs); void myUpdate(int afterMilliSecs);
virtual void timerEvent(QTimerEvent*); virtual void timerEvent(TQTimerEvent*);
void writeLine( 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 int srcSelect, e_MergeDetails mergeDetails, int rangeMark, bool bUserModified, bool bLineRemoved, bool bWhiteSpaceConflict
); );
void setFastSelector(MergeLineList::iterator i); void setFastSelector(MergeLineList::iterator i);
void convertToLinePos( int x, int y, int& line, int& pos ); void convertToLinePos( int x, int y, int& line, int& pos );
virtual void mousePressEvent ( QMouseEvent* e ); virtual void mousePressEvent ( TQMouseEvent* e );
virtual void mouseDoubleClickEvent ( QMouseEvent* e ); virtual void mouseDoubleClickEvent ( TQMouseEvent* e );
virtual void mouseReleaseEvent ( QMouseEvent * ); virtual void mouseReleaseEvent ( TQMouseEvent * );
virtual void mouseMoveEvent ( QMouseEvent * ); virtual void mouseMoveEvent ( TQMouseEvent * );
virtual void resizeEvent( QResizeEvent* e ); virtual void resizeEvent( TQResizeEvent* e );
virtual void keyPressEvent( QKeyEvent* e ); virtual void keyPressEvent( TQKeyEvent* e );
virtual void wheelEvent( QWheelEvent* e ); virtual void wheelEvent( TQWheelEvent* e );
virtual void focusInEvent( QFocusEvent* e ); virtual void focusInEvent( TQFocusEvent* e );
virtual bool focusNextPrevChild(bool){return false;} virtual bool focusNextPrevChild(bool){return false;}
QPixmap m_pixmap; TQPixmap m_pixmap;
int m_firstLine; int m_firstLine;
int m_firstColumn; int m_firstColumn;
int m_nofColumns; int m_nofColumns;
@ -402,13 +404,13 @@ private:
int m_cursorYPos; int m_cursorYPos;
int m_cursorOldXPos; int m_cursorOldXPos;
bool m_bCursorOn; // blinking on and off each second bool m_bCursorOn; // blinking on and off each second
QTimer m_cursorTimer; TQTimer m_cursorTimer;
bool m_bCursorUpdate; bool m_bCursorUpdate;
QStatusBar* m_pStatusBar; TQStatusBar* m_pStatusBar;
Selection m_selection; 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 ); MergeLineList::iterator& mlIt, MergeEditLineList::iterator& melIt );
bool doRelevantChangesExist(); bool doRelevantChangesExist();
public slots: public slots:
@ -418,31 +420,32 @@ private slots:
void slotCursorUpdate(); void slotCursorUpdate();
}; };
class QLineEdit; class TQLineEdit;
class QTextCodec; class TQTextCodec;
class QComboBox; class TQComboBox;
class QLabel; class TQLabel;
class WindowTitleWidget : public QWidget class WindowTitleWidget : public TQWidget
{ {
Q_OBJECT Q_OBJECT
TQ_OBJECT
private: private:
QLabel* m_pLabel; TQLabel* m_pLabel;
QLineEdit* m_pFileNameLineEdit; TQLineEdit* m_pFileNameLineEdit;
//QPushButton* m_pBrowseButton; //TQPushButton* m_pBrowseButton;
QLabel* m_pModifiedLabel; TQLabel* m_pModifiedLabel;
QLabel* m_pEncodingLabel; TQLabel* m_pEncodingLabel;
QComboBox* m_pEncodingSelector; TQComboBox* m_pEncodingSelector;
OptionDialog* m_pOptionDialog; OptionDialog* m_pOptionDialog;
std::map<int, QTextCodec*> m_codecMap; std::map<int, TQTextCodec*> m_codecMap;
public: public:
WindowTitleWidget(OptionDialog* pOptionDialog, QWidget* pParent ); WindowTitleWidget(OptionDialog* pOptionDialog, TQWidget* pParent );
QTextCodec* getEncoding(); TQTextCodec* getEncoding();
void setFileName(const QString& fileName ); void setFileName(const TQString& fileName );
QString getFileName(); TQString getFileName();
void setEncodings( QTextCodec* pCodecForA, QTextCodec* pCodecForB, QTextCodec* pCodecForC ); void setEncodings( TQTextCodec* pCodecForA, TQTextCodec* pCodecForB, TQTextCodec* pCodecForC );
void setEncoding( QTextCodec* pCodec ); void setEncoding( TQTextCodec* pCodec );
bool eventFilter( QObject* o, QEvent* e ); bool eventFilter( TQObject* o, TQEvent* e );
public slots: public slots:
void slotSetModified( bool bModified ); void slotSetModified( bool bModified );
//private slots: //private slots:

File diff suppressed because it is too large Load Diff

@ -22,15 +22,15 @@
#ifndef OPTION_DIALOG_H #ifndef OPTION_DIALOG_H
#define OPTION_DIALOG_H #define OPTION_DIALOG_H
class QCheckBox; class TQCheckBox;
class QLabel; class TQLabel;
class QLineEdit; class TQLineEdit;
class KColorButton; class KColorButton;
class KFontChooser; class KFontChooser;
class KConfig; class KConfig;
#include <kdialogbase.h> #include <kdialogbase.h>
#include <qstringlist.h> #include <tqstringlist.h>
#include <list> #include <list>
#include <kcmdlineargs.h> #include <kcmdlineargs.h>
@ -49,40 +49,41 @@ enum e_LineEndStyle
class OptionDialog : public KDialogBase class OptionDialog : public KDialogBase
{ {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
OptionDialog( bool bShowDirMergeSettings, QWidget *parent = 0, char *name = 0 ); OptionDialog( bool bShowDirMergeSettings, TQWidget *tqparent = 0, char *name = 0 );
~OptionDialog( void ); ~OptionDialog( void );
QString parseOptions( const QCStringList& optionList ); TQString parseOptions( const QCStringList& optionList );
QString calcOptionHelp(); TQString calcOptionHelp();
// Some settings are not available in the option dialog: // Some settings are not available in the option dialog:
QSize m_geometry; TQSize m_tqgeometry;
QPoint m_position; TQPoint m_position;
bool m_bMaximised; bool m_bMaximised;
bool m_bShowToolBar; bool m_bShowToolBar;
bool m_bShowStatusBar; bool m_bShowStatusBar;
int m_toolBarPos; int m_toolBarPos;
// These are the results of the option dialog. // These are the results of the option dialog.
QFont m_font; TQFont m_font;
bool m_bItalicForDeltas; bool m_bItalicForDeltas;
QColor m_fgColor; TQColor m_fgColor;
QColor m_bgColor; TQColor m_bgColor;
QColor m_diffBgColor; TQColor m_diffBgColor;
QColor m_colorA; TQColor m_colorA;
QColor m_colorB; TQColor m_colorB;
QColor m_colorC; TQColor m_colorC;
QColor m_colorForConflict; TQColor m_colorForConflict;
QColor m_currentRangeBgColor; TQColor m_currentRangeBgColor;
QColor m_currentRangeDiffBgColor; TQColor m_currentRangeDiffBgColor;
QColor m_oldestFileColor; TQColor m_oldestFileColor;
QColor m_midAgeFileColor; TQColor m_midAgeFileColor;
QColor m_newestFileColor; TQColor m_newestFileColor;
QColor m_missingFileColor; TQColor m_missingFileColor;
QColor m_manualHelpRangeColor; TQColor m_manualHelpRangeColor;
bool m_bWordWrap; bool m_bWordWrap;
@ -91,15 +92,15 @@ public:
int m_tabSize; int m_tabSize;
bool m_bAutoCopySelection; bool m_bAutoCopySelection;
bool m_bSameEncoding; bool m_bSameEncoding;
QTextCodec* m_pEncodingA; TQTextCodec* m_pEncodingA;
bool m_bAutoDetectUnicodeA; bool m_bAutoDetectUnicodeA;
QTextCodec* m_pEncodingB; TQTextCodec* m_pEncodingB;
bool m_bAutoDetectUnicodeB; bool m_bAutoDetectUnicodeB;
QTextCodec* m_pEncodingC; TQTextCodec* m_pEncodingC;
bool m_bAutoDetectUnicodeC; bool m_bAutoDetectUnicodeC;
QTextCodec* m_pEncodingOut; TQTextCodec* m_pEncodingOut;
bool m_bAutoSelectOutEncoding; bool m_bAutoSelectOutEncoding;
QTextCodec* m_pEncodingPP; TQTextCodec* m_pEncodingPP;
int m_lineEndStyle; int m_lineEndStyle;
bool m_bPreserveCarriageReturn; bool m_bPreserveCarriageReturn;
@ -114,27 +115,27 @@ public:
bool m_bIgnoreCase; bool m_bIgnoreCase;
bool m_bIgnoreNumbers; bool m_bIgnoreNumbers;
bool m_bIgnoreComments; bool m_bIgnoreComments;
QString m_PreProcessorCmd; TQString m_PreProcessorCmd;
QString m_LineMatchingPreProcessorCmd; TQString m_LineMatchingPreProcessorCmd;
bool m_bRunRegExpAutoMergeOnMergeStart; bool m_bRunRegExpAutoMergeOnMergeStart;
QString m_autoMergeRegExp; TQString m_autoMergeRegExp;
bool m_bRunHistoryAutoMergeOnMergeStart; bool m_bRunHistoryAutoMergeOnMergeStart;
QString m_historyStartRegExp; TQString m_historyStartRegExp;
QString m_historyEntryStartRegExp; TQString m_historyEntryStartRegExp;
bool m_bHistoryMergeSorting; bool m_bHistoryMergeSorting;
QString m_historyEntryStartSortKeyOrder; TQString m_historyEntryStartSortKeyOrder;
int m_maxNofHistoryEntries; int m_maxNofHistoryEntries;
QString m_IrrelevantMergeCmd; TQString m_IrrelevantMergeCmd;
bool m_bAutoSaveAndQuitOnMergeWithoutConflicts; bool m_bAutoSaveAndQuitOnMergeWithoutConflicts;
bool m_bAutoAdvance; bool m_bAutoAdvance;
int m_autoAdvanceDelay; int m_autoAdvanceDelay;
QStringList m_recentAFiles; TQStringList m_recentAFiles;
QStringList m_recentBFiles; TQStringList m_recentBFiles;
QStringList m_recentCFiles; TQStringList m_recentCFiles;
QStringList m_recentOutputFiles; TQStringList m_recentOutputFiles;
// Directory Merge options // Directory Merge options
bool m_bDmSyncMode; bool m_bDmSyncMode;
@ -154,14 +155,14 @@ public:
bool m_bDmUseCvsIgnore; bool m_bDmUseCvsIgnore;
bool m_bDmWhiteSpaceEqual; bool m_bDmWhiteSpaceEqual;
bool m_bDmCaseSensitiveFilenameComparison; bool m_bDmCaseSensitiveFilenameComparison;
QString m_DmFilePattern; TQString m_DmFilePattern;
QString m_DmFileAntiPattern; TQString m_DmFileAntiPattern;
QString m_DmDirAntiPattern; TQString m_DmDirAntiPattern;
QString m_language; TQString m_language;
bool m_bRightToLeftLanguage; bool m_bRightToLeftLanguage;
QString m_ignorableCmdLineOptions; TQString m_ignorableCmdLineOptions;
bool m_bIntegrateWithClearCase; bool m_bIntegrateWithClearCase;
void saveOptions(KConfig* config); void saveOptions(KConfig* config);

@ -23,7 +23,7 @@
#include <iostream> #include <iostream>
#include <algorithm> #include <algorithm>
#include <ctype.h> #include <ctype.h>
#include <qaccel.h> #include <tqaccel.h>
#include <klocale.h> #include <klocale.h>
#include <kmessagebox.h> #include <kmessagebox.h>
@ -31,17 +31,17 @@
#include <kstatusbar.h> #include <kstatusbar.h>
#include <kkeydialog.h> #include <kkeydialog.h>
#include <qclipboard.h> #include <tqclipboard.h>
#include <qscrollbar.h> #include <tqscrollbar.h>
#include <qlayout.h> #include <tqlayout.h>
#include <qcheckbox.h> #include <tqcheckbox.h>
#include <qsplitter.h> #include <tqsplitter.h>
#include <qdir.h> #include <tqdir.h>
#include <qfile.h> #include <tqfile.h>
#include <qvbuttongroup.h> #include <tqvbuttongroup.h>
#include <qdragobject.h> #include <tqdragobject.h>
#include <qlineedit.h> #include <tqlineedit.h>
#include <qcombobox.h> #include <tqcombobox.h>
#include <assert.h> #include <assert.h>
#include "kdiff3.h" #include "kdiff3.h"
@ -84,7 +84,7 @@ bool KDiff3App::runDiff( const LineData* p1, int size1, const LineData* p2, int
{ {
GnuDiff::comparison comparisonInput; GnuDiff::comparison comparisonInput;
memset( &comparisonInput, 0, sizeof(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].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[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 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; return true;
} }
void KDiff3App::init( bool bAuto, TotalDiffStatus* pTotalDiffStatus, bool bLoadFiles ) void KDiff3App::init( bool bAuto, TotalDifftqStatus* pTotalDifftqStatus, bool bLoadFiles )
{ {
ProgressProxy pp; ProgressProxy pp;
// When doing a full analysis in the directory-comparison, then the statistics-results // 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. // will be stored in the given TotalDifftqStatus. Otherwise it will be 0.
bool bGUI = pTotalDiffStatus == 0; bool bGUI = pTotalDifftqStatus == 0;
if (pTotalDiffStatus==0) if (pTotalDifftqStatus==0)
pTotalDiffStatus = &m_totalDiffStatus; pTotalDifftqStatus = &m_totalDifftqStatus;
bool bPreserveCarriageReturn = m_pOptionDialog->m_bPreserveCarriageReturn; bool bPreserveCarriageReturn = m_pOptionDialog->m_bPreserveCarriageReturn;
@ -251,7 +251,7 @@ void KDiff3App::init( bool bAuto, TotalDiffStatus* pTotalDiffStatus, bool bLoadF
{ {
bPreserveCarriageReturn = false; bPreserveCarriageReturn = false;
QString msg; TQString msg;
if ( !m_pOptionDialog->m_PreProcessorCmd.isEmpty() ) 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 pp.setMaxNofSteps( 6 ); // 3 comparisons, 3 finediffs
} }
pTotalDiffStatus->reset(); pTotalDifftqStatus->reset();
// Run the diff. // Run the diff.
if ( m_sd3.isEmpty() ) if ( m_sd3.isEmpty() )
{ {
pTotalDiffStatus->bBinaryAEqB = m_sd1.isBinaryEqualWith( m_sd2 ); pTotalDifftqStatus->bBinaryAEqB = m_sd1.isBinaryEqualWith( m_sd2 );
pp.setInformation(i18n("Diff: A <-> B")); pp.setInformation(i18n("Diff: A <-> B"));
runDiff( m_sd1.getLineDataForDiff(), m_sd1.getSizeLines(), m_sd2.getLineDataForDiff(), m_sd2.getSizeLines(), m_diffList12,1,2 ); 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")); pp.setInformation(i18n("Linediff: A <-> B"));
calcDiff3LineListUsingAB( &m_diffList12, m_diff3LineList ); calcDiff3LineListUsingAB( &m_diffList12, m_diff3LineList );
fineDiff( m_diff3LineList, 1, m_sd1.getLineDataForDisplay(), m_sd2.getLineDataForDisplay(), pTotalDiffStatus->bTextAEqB ); fineDiff( m_diff3LineList, 1, m_sd1.getLineDataForDisplay(), m_sd2.getLineDataForDisplay(), pTotalDifftqStatus->bTextAEqB );
if ( m_sd1.getSizeBytes()==0 ) pTotalDiffStatus->bTextAEqB=false; if ( m_sd1.getSizeBytes()==0 ) pTotalDifftqStatus->bTextAEqB=false;
pp.step(); pp.step();
} }
@ -337,9 +337,9 @@ void KDiff3App::init( bool bAuto, TotalDiffStatus* pTotalDiffStatus, bool bLoadF
pp.step(); pp.step();
} }
pTotalDiffStatus->bBinaryAEqB = m_sd1.isBinaryEqualWith( m_sd2 ); pTotalDifftqStatus->bBinaryAEqB = m_sd1.isBinaryEqualWith( m_sd2 );
pTotalDiffStatus->bBinaryAEqC = m_sd1.isBinaryEqualWith( m_sd3 ); pTotalDifftqStatus->bBinaryAEqC = m_sd1.isBinaryEqualWith( m_sd3 );
pTotalDiffStatus->bBinaryBEqC = m_sd3.isBinaryEqualWith( m_sd2 ); pTotalDifftqStatus->bBinaryBEqC = m_sd3.isBinaryEqualWith( m_sd2 );
pp.setInformation(i18n("Diff: A <-> B")); pp.setInformation(i18n("Diff: A <-> B"));
runDiff( m_sd1.getLineDataForDiff(), m_sd1.getSizeLines(), m_sd2.getLineDataForDiff(), m_sd2.getSizeLines(), m_diffList12,1,2 ); 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 ); debugLineCheck( m_diff3LineList, m_sd3.getSizeLines(), 3 );
pp.setInformation(i18n("Linediff: A <-> B")); 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.step();
pp.setInformation(i18n("Linediff: B <-> C")); 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.step();
pp.setInformation(i18n("Linediff: A <-> C")); 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(); pp.step();
if ( m_sd1.getSizeBytes()==0 ) { pTotalDiffStatus->bTextAEqB=false; pTotalDiffStatus->bTextAEqC=false; } if ( m_sd1.getSizeBytes()==0 ) { pTotalDifftqStatus->bTextAEqB=false; pTotalDifftqStatus->bTextAEqC=false; }
if ( m_sd2.getSizeBytes()==0 ) { pTotalDiffStatus->bTextAEqB=false; pTotalDiffStatus->bTextBEqC=false; } if ( m_sd2.getSizeBytes()==0 ) { pTotalDifftqStatus->bTextAEqB=false; pTotalDifftqStatus->bTextBEqC=false; }
} }
m_diffBufferInfo.init( &m_diff3LineList, &m_diff3LineVector, m_diffBufferInfo.init( &m_diff3LineList, &m_diff3LineVector,
m_sd1.getLineDataForDiff(), m_sd1.getSizeLines(), 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_sd2.getLineDataForDisplay(), m_sd2.getSizeLines(),
m_bTripleDiff ? m_sd3.getLineDataForDisplay() : 0, m_sd3.getSizeLines(), m_bTripleDiff ? m_sd3.getLineDataForDisplay() : 0, m_sd3.getSizeLines(),
&m_diff3LineList, &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 ) if ( !bGUI )
{ {
@ -459,17 +459,17 @@ void KDiff3App::init( bool bAuto, TotalDiffStatus* pTotalDiffStatus, bool bLoadF
if ( !isPart() ) if ( !isPart() )
{ {
// 1. If the filenames are equal then show only one filename // 1. If the filenames are equal then show only one filename
QString caption; TQString caption;
QString a1 = m_sd1.getAliasName(); TQString a1 = m_sd1.getAliasName();
QString a2 = m_sd2.getAliasName(); TQString a2 = m_sd2.getAliasName();
QString a3 = m_sd3.getAliasName(); TQString a3 = m_sd3.getAliasName();
QString f1, f2, f3; TQString f1, f2, f3;
int p1,p2,p3; int p1,p2,p3;
if ( !a1.isEmpty() && (p1=a1.findRev('/'))>=0 ) if ( !a1.isEmpty() && (p1=a1.tqfindRev('/'))>=0 )
f1 = a1.mid( p1+1 ); f1 = a1.mid( p1+1 );
if ( !a2.isEmpty() && (p2=a2.findRev('/'))>=0 ) if ( !a2.isEmpty() && (p2=a2.tqfindRev('/'))>=0 )
f2 = a2.mid( p2+1 ); f2 = a2.mid( p2+1 );
if ( !a3.isEmpty() && (p3=a3.findRev('/'))>=0 ) if ( !a3.isEmpty() && (p3=a3.tqfindRev('/'))>=0 )
f3 = a3.mid( p3+1 ); f3 = a3.mid( p3+1 );
if ( !f1.isEmpty() ) 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 // 2. If the files don't have the same name then show all names
if ( caption.isEmpty() && (!f1.isEmpty() || !f2.isEmpty() || !f3.isEmpty()) ) if ( caption.isEmpty() && (!f1.isEmpty() || !f2.isEmpty() || !f3.isEmpty()) )
{ {
caption = ( f1.isEmpty()? QString("") : QString(".../")+f1 ); caption = ( f1.isEmpty()? TQString("") : TQString(".../")+f1 );
caption += QString(caption.isEmpty() || f2.isEmpty() ? "" : " <-> ") + ( f2.isEmpty()? QString("") : QString(".../")+f2 ); caption += TQString(caption.isEmpty() || f2.isEmpty() ? "" : " <-> ") + ( f2.isEmpty()? TQString("") : TQString(".../")+f2 );
caption += QString(caption.isEmpty() || f3.isEmpty() ? "" : " <-> ") + ( f3.isEmpty()? QString("") : QString(".../")+f3 ) ; 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 ) if ( bLoadFiles )
@ -506,18 +506,18 @@ void KDiff3App::init( bool bAuto, TotalDiffStatus* pTotalDiffStatus, bool bLoadF
( m_sd1.isValid() && m_sd2.isValid() && m_sd3.isValid() ) ( m_sd1.isValid() && m_sd2.isValid() && m_sd3.isValid() )
) )
{ {
QString totalInfo; TQString totalInfo;
if ( pTotalDiffStatus->bBinaryAEqB && pTotalDiffStatus->bBinaryAEqC ) if ( pTotalDifftqStatus->bBinaryAEqB && pTotalDifftqStatus->bBinaryAEqC )
totalInfo += i18n("All input files are binary equal."); 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."); totalInfo += i18n("All input files contain the same text, but are not binary equal.");
else { else {
if ( pTotalDiffStatus->bBinaryAEqB ) totalInfo += i18n("Files %1 and %2 are binary equal.\n" ).arg("A").arg("B"); if ( pTotalDifftqStatus->bBinaryAEqB ) totalInfo += i18n("Files %1 and %2 are binary equal.\n" ).tqarg("A").tqarg("B");
else if ( pTotalDiffStatus->bTextAEqB ) totalInfo += i18n("Files %1 and %2 have equal text, but are not binary equal. \n").arg("A").arg("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 ( pTotalDiffStatus->bBinaryAEqC ) totalInfo += i18n("Files %1 and %2 are binary equal.\n" ).arg("A").arg("C"); if ( pTotalDifftqStatus->bBinaryAEqC ) totalInfo += i18n("Files %1 and %2 are binary equal.\n" ).tqarg("A").tqarg("C");
else if ( pTotalDiffStatus->bTextAEqC ) totalInfo += i18n("Files %1 and %2 have equal text, but are not binary equal. \n").arg("A").arg("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 ( pTotalDiffStatus->bBinaryBEqC ) totalInfo += i18n("Files %1 and %2 are binary equal.\n" ).arg("B").arg("C"); if ( pTotalDifftqStatus->bBinaryBEqC ) totalInfo += i18n("Files %1 and %2 are binary equal.\n" ).tqarg("B").tqarg("C");
else if ( pTotalDiffStatus->bTextBEqC ) totalInfo += i18n("Files %1 and %2 have equal text, but are not binary equal. \n").arg("B").arg("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() ) 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 ) if ( bVisibleMergeResultWindow && m_pMergeResultWindow )
{ {
@ -581,7 +581,7 @@ void KDiff3App::scrollDiffTextWindow( int deltaX, int deltaY )
m_pOverview->setRange( m_pDiffVScrollBar->value(), m_pDiffVScrollBar->pageStep() ); m_pOverview->setRange( m_pDiffVScrollBar->value(), m_pDiffVScrollBar->pageStep() );
} }
if ( deltaX!= 0) 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 ) 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. // Function uses setMinSize( tqsizeHint ) before adding the widget.
// void addWidget(QBoxLayout* layout, QWidget* widget); // void addWidget(TQBoxLayout* tqlayout, TQWidget* widget);
template <class W, class L> template <class W, class L>
void addWidget( L* layout, W* widget) void addWidget( L* tqlayout, W* widget)
{ {
QSize s = widget->sizeHint(); TQSize s = widget->tqsizeHint();
widget->setMinimumSize( QSize(max2(s.width(),0),max2(s.height(),0) ) ); widget->setMinimumSize( TQSize(max2(s.width(),0),max2(s.height(),0) ) );
layout->addWidget( widget ); tqlayout->addWidget( widget );
} }
void KDiff3App::initView() void KDiff3App::initView()
{ {
// set the main widget here // set the main widget here
QValueList<int> oldHeights; TQValueList<int> oldHeights;
if ( m_pDirectoryMergeSplitter->isVisible() ) if ( m_pDirectoryMergeSplitter->isVisible() )
{ {
oldHeights = m_pMainSplitter->sizes(); oldHeights = m_pMainSplitter->sizes();
@ -633,27 +633,27 @@ void KDiff3App::initView()
return; return;
//delete m_pMainWidget; //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 ); pVSplitter->setOrientation( Qt::Vertical );
pVLayout->addWidget( pVSplitter ); pVLayout->addWidget( pVSplitter );
QWidget* pDiffWindowFrame = new QWidget( pVSplitter ); TQWidget* pDiffWindowFrame = new TQWidget( pVSplitter );
QHBoxLayout* pDiffHLayout = new QHBoxLayout( pDiffWindowFrame,0,0 ); 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 ); m_pDiffWindowSplitter->setOrientation( m_pOptionDialog->m_bHorizDiffWindowSplitting ? Qt::Horizontal : Qt::Vertical );
pDiffHLayout->addWidget( m_pDiffWindowSplitter ); pDiffHLayout->addWidget( m_pDiffWindowSplitter );
m_pOverview = new Overview( pDiffWindowFrame, m_pOptionDialog ); m_pOverview = new Overview( pDiffWindowFrame, m_pOptionDialog );
pDiffHLayout->addWidget(m_pOverview); pDiffHLayout->addWidget(m_pOverview);
connect( m_pOverview, SIGNAL(setLine(int)), this, SLOT(setDiff3Line(int)) ); connect( m_pOverview, TQT_SIGNAL(setLine(int)), this, TQT_SLOT(setDiff3Line(int)) );
//connect( m_pOverview, SIGNAL(afterFirstPaint()), this, SLOT(slotAfterFirstPaint())); //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 ); pDiffHLayout->addWidget( m_pDiffVScrollBar );
m_pDiffTextWindowFrame1 = new DiffTextWindowFrame( m_pDiffWindowSplitter, statusBar(), m_pOptionDialog, 1 ); m_pDiffTextWindowFrame1 = new DiffTextWindowFrame( m_pDiffWindowSplitter, statusBar(), m_pOptionDialog, 1 );
@ -662,15 +662,15 @@ void KDiff3App::initView()
m_pDiffTextWindow1 = m_pDiffTextWindowFrame1->getDiffTextWindow(); m_pDiffTextWindow1 = m_pDiffTextWindowFrame1->getDiffTextWindow();
m_pDiffTextWindow2 = m_pDiffTextWindowFrame2->getDiffTextWindow(); m_pDiffTextWindow2 = m_pDiffTextWindowFrame2->getDiffTextWindow();
m_pDiffTextWindow3 = m_pDiffTextWindowFrame3->getDiffTextWindow(); m_pDiffTextWindow3 = m_pDiffTextWindowFrame3->getDiffTextWindow();
connect(m_pDiffTextWindowFrame1, 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, SIGNAL(fileNameChanged(const QString&,int)), this, SLOT(slotFileNameChanged(const QString&,int))); connect(m_pDiffTextWindowFrame2, TQT_SIGNAL(fileNameChanged(const TQString&,int)), this, TQT_SLOT(slotFileNameChanged(const TQString&,int)));
connect(m_pDiffTextWindowFrame3, SIGNAL(fileNameChanged(const QString&,int)), this, SLOT(slotFileNameChanged(const QString&,int))); connect(m_pDiffTextWindowFrame3, TQT_SIGNAL(fileNameChanged(const TQString&,int)), this, TQT_SLOT(slotFileNameChanged(const TQString&,int)));
// Merge window // Merge window
m_pMergeWindowFrame = new QWidget( pVSplitter ); m_pMergeWindowFrame = new TQWidget( pVSplitter );
QHBoxLayout* pMergeHLayout = new QHBoxLayout( m_pMergeWindowFrame,0,0 ); TQHBoxLayout* pMergeHLayout = new TQHBoxLayout( m_pMergeWindowFrame,0,0 );
QVBoxLayout* pMergeVLayout = new QVBoxLayout(); TQVBoxLayout* pMergeVLayout = new TQVBoxLayout();
pMergeHLayout->addLayout( pMergeVLayout, 1 ); pMergeHLayout->addLayout( pMergeVLayout, 1 );
m_pMergeResultWindowTitle = new WindowTitleWidget(m_pOptionDialog, m_pMergeWindowFrame); m_pMergeResultWindowTitle = new WindowTitleWidget(m_pOptionDialog, m_pMergeWindowFrame);
@ -679,12 +679,12 @@ void KDiff3App::initView()
m_pMergeResultWindow = new MergeResultWindow( m_pMergeWindowFrame, m_pOptionDialog, statusBar() ); m_pMergeResultWindow = new MergeResultWindow( m_pMergeWindowFrame, m_pOptionDialog, statusBar() );
pMergeVLayout->addWidget( m_pMergeResultWindow, 1 ); 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 ); pMergeHLayout->addWidget( m_pMergeVScrollBar );
autoAdvance->setEnabled(true); autoAdvance->setEnabled(true);
QValueList<int> sizes = pVSplitter->sizes(); TQValueList<int> sizes = pVSplitter->sizes();
int total = sizes[0] + sizes[1]; int total = sizes[0] + sizes[1];
sizes[0]=total/2; sizes[1]=total/2; sizes[0]=total/2; sizes[1]=total/2;
pVSplitter->setSizes( sizes ); pVSplitter->setSizes( sizes );
@ -692,68 +692,68 @@ void KDiff3App::initView()
m_pMergeResultWindow->installEventFilter( this ); // for Cut/Copy/Paste-shortcuts m_pMergeResultWindow->installEventFilter( this ); // for Cut/Copy/Paste-shortcuts
m_pMergeResultWindow->installEventFilter( m_pMergeResultWindowTitle ); // for focus tracking 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 ); m_pHScrollBar = new ReversibleScrollBar( Qt::Horizontal, m_pMainWidget, &m_pOptionDialog->m_bRightToLeftLanguage );
pHScrollBarLayout->addWidget( m_pHScrollBar ); pHScrollBarLayout->addWidget( m_pHScrollBar );
m_pCornerWidget = new QWidget( m_pMainWidget ); m_pCornerWidget = new TQWidget( m_pMainWidget );
pHScrollBarLayout->addWidget( m_pCornerWidget ); pHScrollBarLayout->addWidget( m_pCornerWidget );
connect( m_pDiffVScrollBar, SIGNAL(valueChanged(int)), m_pOverview, SLOT(setFirstLine(int))); connect( m_pDiffVScrollBar, TQT_SIGNAL(valueChanged(int)), m_pOverview, TQT_SLOT(setFirstLine(int)));
connect( m_pDiffVScrollBar, SIGNAL(valueChanged(int)), m_pDiffTextWindow1, SLOT(setFirstLine(int))); connect( m_pDiffVScrollBar, TQT_SIGNAL(valueChanged(int)), m_pDiffTextWindow1, TQT_SLOT(setFirstLine(int)));
connect( m_pHScrollBar, SIGNAL(valueChanged2(int)), m_pDiffTextWindow1, SLOT(setFirstColumn(int))); connect( m_pHScrollBar, TQT_SIGNAL(valueChanged2(int)), m_pDiffTextWindow1, TQT_SLOT(setFirstColumn(int)));
connect( m_pDiffTextWindow1, SIGNAL(newSelection()), this, SLOT(slotSelectionStart())); connect( m_pDiffTextWindow1, TQT_SIGNAL(newSelection()), this, TQT_SLOT(slotSelectionStart()));
connect( m_pDiffTextWindow1, SIGNAL(selectionEnd()), this, SLOT(slotSelectionEnd())); connect( m_pDiffTextWindow1, TQT_SIGNAL(selectionEnd()), this, TQT_SLOT(slotSelectionEnd()));
connect( m_pDiffTextWindow1, SIGNAL(scroll(int,int)), this, SLOT(scrollDiffTextWindow(int,int))); connect( m_pDiffTextWindow1, TQT_SIGNAL(scroll(int,int)), this, TQT_SLOT(scrollDiffTextWindow(int,int)));
m_pDiffTextWindow1->installEventFilter( this ); m_pDiffTextWindow1->installEventFilter( this );
connect( m_pDiffVScrollBar, SIGNAL(valueChanged(int)), m_pDiffTextWindow2, SLOT(setFirstLine(int))); connect( m_pDiffVScrollBar, TQT_SIGNAL(valueChanged(int)), m_pDiffTextWindow2, TQT_SLOT(setFirstLine(int)));
connect( m_pHScrollBar, SIGNAL(valueChanged2(int)), m_pDiffTextWindow2, SLOT(setFirstColumn(int))); connect( m_pHScrollBar, TQT_SIGNAL(valueChanged2(int)), m_pDiffTextWindow2, TQT_SLOT(setFirstColumn(int)));
connect( m_pDiffTextWindow2, SIGNAL(newSelection()), this, SLOT(slotSelectionStart())); connect( m_pDiffTextWindow2, TQT_SIGNAL(newSelection()), this, TQT_SLOT(slotSelectionStart()));
connect( m_pDiffTextWindow2, SIGNAL(selectionEnd()), this, SLOT(slotSelectionEnd())); connect( m_pDiffTextWindow2, TQT_SIGNAL(selectionEnd()), this, TQT_SLOT(slotSelectionEnd()));
connect( m_pDiffTextWindow2, SIGNAL(scroll(int,int)), this, SLOT(scrollDiffTextWindow(int,int))); connect( m_pDiffTextWindow2, TQT_SIGNAL(scroll(int,int)), this, TQT_SLOT(scrollDiffTextWindow(int,int)));
m_pDiffTextWindow2->installEventFilter( this ); m_pDiffTextWindow2->installEventFilter( this );
connect( m_pDiffVScrollBar, SIGNAL(valueChanged(int)), m_pDiffTextWindow3, SLOT(setFirstLine(int))); connect( m_pDiffVScrollBar, TQT_SIGNAL(valueChanged(int)), m_pDiffTextWindow3, TQT_SLOT(setFirstLine(int)));
connect( m_pHScrollBar, SIGNAL(valueChanged2(int)), m_pDiffTextWindow3, SLOT(setFirstColumn(int))); connect( m_pHScrollBar, TQT_SIGNAL(valueChanged2(int)), m_pDiffTextWindow3, TQT_SLOT(setFirstColumn(int)));
connect( m_pDiffTextWindow3, SIGNAL(newSelection()), this, SLOT(slotSelectionStart())); connect( m_pDiffTextWindow3, TQT_SIGNAL(newSelection()), this, TQT_SLOT(slotSelectionStart()));
connect( m_pDiffTextWindow3, SIGNAL(selectionEnd()), this, SLOT(slotSelectionEnd())); connect( m_pDiffTextWindow3, TQT_SIGNAL(selectionEnd()), this, TQT_SLOT(slotSelectionEnd()));
connect( m_pDiffTextWindow3, SIGNAL(scroll(int,int)), this, SLOT(scrollDiffTextWindow(int,int))); connect( m_pDiffTextWindow3, TQT_SIGNAL(scroll(int,int)), this, TQT_SLOT(scrollDiffTextWindow(int,int)));
m_pDiffTextWindow3->installEventFilter( this ); m_pDiffTextWindow3->installEventFilter( this );
MergeResultWindow* p = m_pMergeResultWindow; MergeResultWindow* p = m_pMergeResultWindow;
connect( m_pMergeVScrollBar, SIGNAL(valueChanged(int)), p, SLOT(setFirstLine(int))); connect( m_pMergeVScrollBar, TQT_SIGNAL(valueChanged(int)), p, TQT_SLOT(setFirstLine(int)));
connect( m_pHScrollBar, SIGNAL(valueChanged2(int)), p, SLOT(setFirstColumn(int))); connect( m_pHScrollBar, TQT_SIGNAL(valueChanged2(int)), p, TQT_SLOT(setFirstColumn(int)));
connect( p, SIGNAL(scroll(int,int)), this, SLOT(scrollMergeResultWindow(int,int))); connect( p, TQT_SIGNAL(scroll(int,int)), this, TQT_SLOT(scrollMergeResultWindow(int,int)));
connect( p, SIGNAL(sourceMask(int,int)), this, SLOT(sourceMask(int,int))); connect( p, TQT_SIGNAL(sourceMask(int,int)), this, TQT_SLOT(sourceMask(int,int)));
connect( p, SIGNAL( resizeSignal() ),this, SLOT(resizeMergeResultWindow())); connect( p, TQT_SIGNAL( resizeSignal() ),this, TQT_SLOT(resizeMergeResultWindow()));
connect( p, SIGNAL( selectionEnd() ), this, SLOT( slotSelectionEnd() ) ); connect( p, TQT_SIGNAL( selectionEnd() ), this, TQT_SLOT( slotSelectionEnd() ) );
connect( p, SIGNAL( newSelection() ), this, SLOT( slotSelectionStart() ) ); connect( p, TQT_SIGNAL( newSelection() ), this, TQT_SLOT( slotSelectionStart() ) );
connect( p, SIGNAL( modifiedChanged(bool) ), this, SLOT( slotOutputModified(bool) ) ); connect( p, TQT_SIGNAL( modifiedChanged(bool) ), this, TQT_SLOT( slotOutputModified(bool) ) );
connect( p, SIGNAL( modifiedChanged(bool) ), m_pMergeResultWindowTitle, SLOT( slotSetModified(bool) ) ); connect( p, TQT_SIGNAL( modifiedChanged(bool) ), m_pMergeResultWindowTitle, TQT_SLOT( slotSetModified(bool) ) );
connect( p, SIGNAL( updateAvailabilities() ), this, SLOT( slotUpdateAvailabilities() ) ); connect( p, TQT_SIGNAL( updateAvailabilities() ), this, TQT_SLOT( slotUpdateAvailabilities() ) );
connect( p, SIGNAL( showPopupMenu(const QPoint&) ), this, SLOT(showPopupMenu(const QPoint&))); connect( p, TQT_SIGNAL( showPopupMenu(const TQPoint&) ), this, TQT_SLOT(showPopupMenu(const TQPoint&)));
connect( p, SIGNAL( noRelevantChangesDetected() ), this, SLOT(slotNoRelevantChangesDetected())); connect( p, TQT_SIGNAL( noRelevantChangesDetected() ), this, TQT_SLOT(slotNoRelevantChangesDetected()));
sourceMask(0,0); sourceMask(0,0);
connect( p, SIGNAL(setFastSelectorRange(int,int)), m_pDiffTextWindow1, SLOT(setFastSelectorRange(int,int))); connect( p, TQT_SIGNAL(setFastSelectorRange(int,int)), m_pDiffTextWindow1, TQT_SLOT(setFastSelectorRange(int,int)));
connect( p, SIGNAL(setFastSelectorRange(int,int)), m_pDiffTextWindow2, SLOT(setFastSelectorRange(int,int))); connect( p, TQT_SIGNAL(setFastSelectorRange(int,int)), m_pDiffTextWindow2, TQT_SLOT(setFastSelectorRange(int,int)));
connect( p, SIGNAL(setFastSelectorRange(int,int)), m_pDiffTextWindow3, SLOT(setFastSelectorRange(int,int))); connect( p, TQT_SIGNAL(setFastSelectorRange(int,int)), m_pDiffTextWindow3, TQT_SLOT(setFastSelectorRange(int,int)));
connect(m_pDiffTextWindow1, SIGNAL(setFastSelectorLine(int)), p, SLOT(slotSetFastSelectorLine(int))); connect(m_pDiffTextWindow1, TQT_SIGNAL(setFastSelectorLine(int)), p, TQT_SLOT(slotSetFastSelectorLine(int)));
connect(m_pDiffTextWindow2, SIGNAL(setFastSelectorLine(int)), p, SLOT(slotSetFastSelectorLine(int))); connect(m_pDiffTextWindow2, TQT_SIGNAL(setFastSelectorLine(int)), p, TQT_SLOT(slotSetFastSelectorLine(int)));
connect(m_pDiffTextWindow3, SIGNAL(setFastSelectorLine(int)), p, SLOT(slotSetFastSelectorLine(int))); connect(m_pDiffTextWindow3, TQT_SIGNAL(setFastSelectorLine(int)), p, TQT_SLOT(slotSetFastSelectorLine(int)));
connect(m_pDiffTextWindow1, SIGNAL(gotFocus()), p, SLOT(updateSourceMask())); connect(m_pDiffTextWindow1, TQT_SIGNAL(gotFocus()), p, TQT_SLOT(updateSourceMask()));
connect(m_pDiffTextWindow2, SIGNAL(gotFocus()), p, SLOT(updateSourceMask())); connect(m_pDiffTextWindow2, TQT_SIGNAL(gotFocus()), p, TQT_SLOT(updateSourceMask()));
connect(m_pDiffTextWindow3, SIGNAL(gotFocus()), p, SLOT(updateSourceMask())); connect(m_pDiffTextWindow3, TQT_SIGNAL(gotFocus()), p, TQT_SLOT(updateSourceMask()));
connect(m_pDirectoryMergeInfo, SIGNAL(gotFocus()), p, 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. // 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_pDiffTextWindow2, TQT_SIGNAL( resizeSignal(int,int) ),this, TQT_SLOT(slotRecalcWordWrap()));
connect( m_pDiffTextWindow3, SIGNAL( resizeSignal(int,int) ),this, SLOT(slotRecalcWordWrap())); connect( m_pDiffTextWindow3, TQT_SIGNAL( resizeSignal(int,int) ),this, TQT_SLOT(slotRecalcWordWrap()));
m_pDiffTextWindow1->setFocus(); m_pDiffTextWindow1->setFocus();
m_pMainWidget->setMinimumSize(50,50); m_pMainWidget->setMinimumSize(50,50);
@ -827,51 +827,51 @@ void KDiff3App::slotAfterFirstPaint()
slotUpdateAvailabilities(); slotUpdateAvailabilities();
} }
void KDiff3App::resizeEvent(QResizeEvent* e) void KDiff3App::resizeEvent(TQResizeEvent* e)
{ {
QSplitter::resizeEvent(e); TQSplitter::resizeEvent(e);
if (m_pCornerWidget) if (m_pCornerWidget)
m_pCornerWidget->setFixedSize( m_pDiffVScrollBar->width(), m_pHScrollBar->height() ); 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 { // key press
QKeyEvent *k = (QKeyEvent*)e; TQKeyEvent *k = (TQKeyEvent*)e;
if (k->key()==Qt::Key_Insert && (k->state() & Qt::ControlButton)!=0 ) if (k->key()==TQt::Key_Insert && (k->state() & TQt::ControlButton)!=0 )
{ {
slotEditCopy(); slotEditCopy();
return true; 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(); slotEditPaste();
return true; 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(); slotEditCut();
return true; 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; bool bCtrl = (k->state() & TQt::ControlButton) != 0;
if (k->key()==Qt::Key_Insert && bCtrl ) if (k->key()==TQt::Key_Insert && bCtrl )
{ {
slotEditCopy(); slotEditCopy();
return true; 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(); slotEditPaste();
return true; return true;
@ -881,18 +881,18 @@ bool KDiff3App::eventFilter( QObject* o, QEvent* e )
int pageSize = m_DTWHeight; int pageSize = m_DTWHeight;
switch( k->key() ) switch( k->key() )
{ {
case Qt::Key_Down: if (!bCtrl) case TQt::Key_Down: if (!bCtrl)
++deltaY; ++deltaY;
break; break;
case Qt::Key_Up: if (!bCtrl) --deltaY; break; case TQt::Key_Up: if (!bCtrl) --deltaY; break;
case Qt::Key_PageDown: if (!bCtrl) deltaY+=pageSize; break; case TQt::Key_PageDown: if (!bCtrl) deltaY+=pageSize; break;
case Qt::Key_PageUp: if (!bCtrl) deltaY-=pageSize; break; case TQt::Key_PageUp: if (!bCtrl) deltaY-=pageSize; break;
case Qt::Key_Left: if (!bCtrl) --deltaX; break; case TQt::Key_Left: if (!bCtrl) --deltaX; break;
case Qt::Key_Right: if (!bCtrl) ++deltaX; break; case TQt::Key_Right: if (!bCtrl) ++deltaX; break;
case Qt::Key_Home: if ( bCtrl ) m_pDiffVScrollBar->setValue( 0 ); case TQt::Key_Home: if ( bCtrl ) m_pDiffVScrollBar->setValue( 0 );
else m_pHScrollBar->setValue( 0 ); else m_pHScrollBar->setValue( 0 );
break; 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() ); else m_pHScrollBar->setValue( m_pHScrollBar->maxValue() );
break; break;
default: break; default: break;
@ -902,36 +902,36 @@ bool KDiff3App::eventFilter( QObject* o, QEvent* e )
return true; // eat event 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(); w->accept();
int deltaX=0; int deltaX=0;
int d=w->delta(); int d=w->delta();
int deltaY = -d/120 * QApplication::wheelScrollLines(); int deltaY = -d/120 * TQApplication::wheelScrollLines();
scrollDiffTextWindow( deltaX, deltaY ); scrollDiffTextWindow( deltaX, deltaY );
return true; 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(); pDropEvent->accept();
if ( QUriDrag::canDecode(pDropEvent) ) if ( TQUriDrag::canDecode(pDropEvent) )
{ {
#ifdef KREPLACEMENTS_H #ifdef KREPLACEMENTS_H
QStringList stringList; TQStringList stringList;
QUriDrag::decodeLocalFiles( pDropEvent, stringList ); TQUriDrag::decodeLocalFiles( pDropEvent, stringList );
if ( canContinue() && !stringList.isEmpty() ) if ( canContinue() && !stringList.isEmpty() )
{ {
raise(); raise();
QString filename = stringList.first(); TQString filename = stringList.first();
if ( o == m_pDiffTextWindow1 ) m_sd1.setFilename( filename ); if ( TQT_BASE_OBJECT(o) == TQT_BASE_OBJECT(m_pDiffTextWindow1) ) m_sd1.setFilename( filename );
else if ( o == m_pDiffTextWindow2 ) m_sd2.setFilename( filename ); else if ( TQT_BASE_OBJECT(o) == TQT_BASE_OBJECT(m_pDiffTextWindow2) ) m_sd2.setFilename( filename );
else if ( o == m_pDiffTextWindow3 ) m_sd3.setFilename( filename ); else if ( TQT_BASE_OBJECT(o) == TQT_BASE_OBJECT(m_pDiffTextWindow3) ) m_sd3.setFilename( filename );
init(); init();
} }
#else #else
@ -941,30 +941,30 @@ bool KDiff3App::eventFilter( QObject* o, QEvent* e )
{ {
raise(); raise();
FileAccess fa( urlList.first().url() ); FileAccess fa( urlList.first().url() );
if ( o == m_pDiffTextWindow1 ) m_sd1.setFileAccess( fa ); if ( TQT_BASE_OBJECT(o) == TQT_BASE_OBJECT(m_pDiffTextWindow1) ) m_sd1.setFileAccess( fa );
else if ( o == m_pDiffTextWindow2 ) m_sd2.setFileAccess( fa ); else if ( TQT_BASE_OBJECT(o) == TQT_BASE_OBJECT(m_pDiffTextWindow2) ) m_sd2.setFileAccess( fa );
else if ( o == m_pDiffTextWindow3 ) m_sd3.setFileAccess( fa ); else if ( TQT_BASE_OBJECT(o) == TQT_BASE_OBJECT(m_pDiffTextWindow3) ) m_sd3.setFileAccess( fa );
init(); init();
} }
#endif #endif
} }
else if ( QTextDrag::canDecode(pDropEvent) ) else if ( TQTextDrag::canDecode(pDropEvent) )
{ {
QString text; TQString text;
bool bDecodeSuccess = QTextDrag::decode( pDropEvent, text ); bool bDecodeSuccess = TQTextDrag::decode( pDropEvent, text );
if ( bDecodeSuccess && canContinue() ) if ( bDecodeSuccess && canContinue() )
{ {
raise(); raise();
if ( o == m_pDiffTextWindow1 ) m_sd1.setData(text); if ( TQT_BASE_OBJECT(o) == TQT_BASE_OBJECT(m_pDiffTextWindow1) ) m_sd1.setData(text);
else if ( o == m_pDiffTextWindow2 ) m_sd2.setData(text); else if ( TQT_BASE_OBJECT(o) == TQT_BASE_OBJECT(m_pDiffTextWindow2) ) m_sd2.setData(text);
else if ( o == m_pDiffTextWindow3 ) m_sd3.setData(text); else if ( TQT_BASE_OBJECT(o) == TQT_BASE_OBJECT(m_pDiffTextWindow3) ) m_sd3.setData(text);
init(); init();
} }
} }
return true; 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, OpenDialog d(this,
QDir::convertSeparators( m_bDirCompare ? m_pDirectoryMergeWindow->getDirNameA() : m_sd1.isFromBuffer() ? QString("") : m_sd1.getAliasName() ), TQDir::convertSeparators( m_bDirCompare ? m_pDirectoryMergeWindow->getDirNameA() : m_sd1.isFromBuffer() ? TQString("") : m_sd1.getAliasName() ),
QDir::convertSeparators( m_bDirCompare ? m_pDirectoryMergeWindow->getDirNameB() : m_sd2.isFromBuffer() ? QString("") : m_sd2.getAliasName() ), TQDir::convertSeparators( m_bDirCompare ? m_pDirectoryMergeWindow->getDirNameB() : m_sd2.isFromBuffer() ? TQString("") : m_sd2.getAliasName() ),
QDir::convertSeparators( m_bDirCompare ? m_pDirectoryMergeWindow->getDirNameC() : m_sd3.isFromBuffer() ? QString("") : m_sd3.getAliasName() ), TQDir::convertSeparators( m_bDirCompare ? m_pDirectoryMergeWindow->getDirNameC() : m_sd3.isFromBuffer() ? TQString("") : m_sd3.getAliasName() ),
m_bDirCompare ? ! m_pDirectoryMergeWindow->getDirNameDest().isEmpty() : !m_outputFilename.isEmpty(), m_bDirCompare ? ! m_pDirectoryMergeWindow->getDirNameDest().isEmpty() : !m_outputFilename.isEmpty(),
QDir::convertSeparators( m_bDirCompare ? m_pDirectoryMergeWindow->getDirNameDest() : m_bDefaultFilename ? QString("") : m_outputFilename ), TQDir::convertSeparators( m_bDirCompare ? m_pDirectoryMergeWindow->getDirNameDest() : m_bDefaultFilename ? TQString("") : m_outputFilename ),
SLOT(slotConfigure()), m_pOptionDialog ); TQT_SLOT(slotConfigure()), m_pOptionDialog );
/*OpenDialog d(this, /*OpenDialog d(this,
m_sd1.isFromBuffer() ? QString("") : m_sd1.getAliasName(), m_sd1.isFromBuffer() ? TQString("") : m_sd1.getAliasName(),
m_sd2.isFromBuffer() ? QString("") : m_sd2.getAliasName(), m_sd2.isFromBuffer() ? TQString("") : m_sd2.getAliasName(),
m_sd3.isFromBuffer() ? QString("") : m_sd3.getAliasName(), m_sd3.isFromBuffer() ? TQString("") : m_sd3.getAliasName(),
!m_outputFilename.isEmpty(), !m_outputFilename.isEmpty(),
m_bDefaultFilename ? QString("") : m_outputFilename, m_bDefaultFilename ? TQString("") : m_outputFilename,
SLOT(slotConfigure()), m_pOptionDialog );*/ TQT_SLOT(slotConfigure()), m_pOptionDialog );*/
int status = d.exec(); int status = d.exec();
if ( status == QDialog::Accepted ) if ( status == TQDialog::Accepted )
{ {
m_sd1.setFilename( d.m_pLineA->currentText() ); m_sd1.setFilename( d.m_pLineA->currentText() );
m_sd2.setFilename( d.m_pLineB->currentText() ); m_sd2.setFilename( d.m_pLineB->currentText() );
@ -1049,7 +1049,7 @@ void KDiff3App::slotFileOpen()
! m_sd2.isEmpty() && !m_sd2.hasData() || ! m_sd2.isEmpty() && !m_sd2.hasData() ||
! m_sd3.isEmpty() && !m_sd3.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"; text += "\n\n";
if ( ! m_sd1.isEmpty() && !m_sd1.hasData() ) if ( ! m_sd1.isEmpty() && !m_sd1.hasData() )
text += " - " + m_sd1.getAliasName() + "\n"; text += " - " + m_sd1.getAliasName() + "\n";
@ -1070,8 +1070,8 @@ void KDiff3App::slotFileOpen()
slotStatusMsg(i18n("Ready.")); slotStatusMsg(i18n("Ready."));
} }
void KDiff3App::slotFileOpen2(QString fn1, QString fn2, QString fn3, QString ofn, void KDiff3App::slotFileOpen2(TQString fn1, TQString fn2, TQString fn3, TQString ofn,
QString an1, QString an2, QString an3, TotalDiffStatus* pTotalDiffStatus ) TQString an1, TQString an2, TQString an3, TotalDifftqStatus* pTotalDifftqStatus )
{ {
if ( !canContinue() ) return; if ( !canContinue() ) return;
@ -1111,16 +1111,16 @@ void KDiff3App::slotFileOpen2(QString fn1, QString fn2, QString fn3, QString ofn
else else
{ {
m_bDirCompare = bDirCompare; // Don't allow this to change here. m_bDirCompare = bDirCompare; // Don't allow this to change here.
init( false, pTotalDiffStatus ); init( false, pTotalDifftqStatus );
if ( pTotalDiffStatus!=0 ) if ( pTotalDifftqStatus!=0 )
return; return;
if ( ! m_sd1.isEmpty() && ! m_sd1.hasData() || if ( ! m_sd1.isEmpty() && ! m_sd1.hasData() ||
! m_sd2.isEmpty() && ! m_sd2.hasData() || ! m_sd2.isEmpty() && ! m_sd2.hasData() ||
! m_sd3.isEmpty() && ! m_sd3.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"; text += "\n\n";
if ( ! m_sd1.isEmpty() && !m_sd1.hasData() ) if ( ! m_sd1.isEmpty() && !m_sd1.hasData() )
text += " - " + m_sd1.getAliasName() + "\n"; 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(); TQString fn1 = m_sd1.getFilename();
QString an1 = m_sd1.getAliasName(); TQString an1 = m_sd1.getAliasName();
QString fn2 = m_sd2.getFilename(); TQString fn2 = m_sd2.getFilename();
QString an2 = m_sd2.getAliasName(); TQString an2 = m_sd2.getAliasName();
QString fn3 = m_sd3.getFilename(); TQString fn3 = m_sd3.getFilename();
QString an3 = m_sd3.getAliasName(); TQString an3 = m_sd3.getAliasName();
if (winIdx==1) { fn1 = fileName; an1 = ""; } if (winIdx==1) { fn1 = fileName; an1 = ""; }
if (winIdx==2) { fn2 = fileName; an2 = ""; } if (winIdx==2) { fn2 = fileName; an2 = ""; }
if (winIdx==3) { fn3 = fileName; an3 = ""; } if (winIdx==3) { fn3 = fileName; an3 = ""; }
@ -1163,7 +1163,7 @@ void KDiff3App::slotEditCut()
{ {
slotStatusMsg(i18n("Cutting selection...")); slotStatusMsg(i18n("Cutting selection..."));
QString s; TQString s;
if ( m_pMergeResultWindow!=0 ) if ( m_pMergeResultWindow!=0 )
{ {
s = m_pMergeResultWindow->getSelection(); s = m_pMergeResultWindow->getSelection();
@ -1174,7 +1174,7 @@ void KDiff3App::slotEditCut()
if ( !s.isNull() ) if ( !s.isNull() )
{ {
QApplication::clipboard()->setText( s, QClipboard::Clipboard ); TQApplication::tqclipboard()->setText( s, TQClipboard::Clipboard );
} }
slotStatusMsg(i18n("Ready.")); slotStatusMsg(i18n("Ready."));
@ -1183,14 +1183,14 @@ void KDiff3App::slotEditCut()
void KDiff3App::slotEditCopy() void KDiff3App::slotEditCopy()
{ {
slotStatusMsg(i18n("Copying selection to clipboard...")); slotStatusMsg(i18n("Copying selection to clipboard..."));
QString s; TQString s;
if ( m_pDiffTextWindow1!=0 ) s = m_pDiffTextWindow1->getSelection(); if ( m_pDiffTextWindow1!=0 ) s = m_pDiffTextWindow1->getSelection();
if ( s.isNull() && m_pDiffTextWindow2!=0 ) s = m_pDiffTextWindow2->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_pDiffTextWindow3!=0 ) s = m_pDiffTextWindow3->getSelection();
if ( s.isNull() && m_pMergeResultWindow!=0 ) s = m_pMergeResultWindow->getSelection(); if ( s.isNull() && m_pMergeResultWindow!=0 ) s = m_pMergeResultWindow->getSelection();
if ( !s.isNull() ) if ( !s.isNull() )
{ {
QApplication::clipboard()->setText( s, QClipboard::Clipboard ); TQApplication::tqclipboard()->setText( s, TQClipboard::Clipboard );
} }
slotStatusMsg(i18n("Ready.")); slotStatusMsg(i18n("Ready."));
@ -1208,17 +1208,17 @@ void KDiff3App::slotEditPaste()
{ {
if ( m_pDiffTextWindow1->hasFocus() ) if ( m_pDiffTextWindow1->hasFocus() )
{ {
m_sd1.setData( QApplication::clipboard()->text(QClipboard::Clipboard) ); m_sd1.setData( TQApplication::tqclipboard()->text(TQClipboard::Clipboard) );
init(); init();
} }
else if ( m_pDiffTextWindow2->hasFocus() ) else if ( m_pDiffTextWindow2->hasFocus() )
{ {
m_sd2.setData( QApplication::clipboard()->text(QClipboard::Clipboard) ); m_sd2.setData( TQApplication::tqclipboard()->text(TQClipboard::Clipboard) );
init(); init();
} }
else if ( m_pDiffTextWindow3->hasFocus() ) else if ( m_pDiffTextWindow3->hasFocus() )
{ {
m_sd3.setData( QApplication::clipboard()->text(QClipboard::Clipboard) ); m_sd3.setData( TQApplication::tqclipboard()->text(TQClipboard::Clipboard) );
init(); init();
} }
} }
@ -1296,7 +1296,7 @@ void KDiff3App::choose( int choice )
if ( autoAdvance->isChecked() ) if ( autoAdvance->isChecked() )
{ {
m_bTimerBlock = true; 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() void KDiff3App::slotConfigure()
{ {
m_pOptionDialog->setState(); m_pOptionDialog->setState();
m_pOptionDialog->incInitialSize ( QSize(0,40) ); m_pOptionDialog->incInitialSize ( TQSize(0,40) );
m_pOptionDialog->exec(); m_pOptionDialog->exec();
slotRefresh(); slotRefresh();
} }
@ -1447,16 +1447,16 @@ void KDiff3App::slotSelectionStart()
//editCopy->setEnabled( false ); //editCopy->setEnabled( false );
//editCut->setEnabled( false ); //editCut->setEnabled( false );
const QObject* s = sender(); const TQObject* s = TQT_TQOBJECT(const_cast<TQT_BASE_OBJECT_NAME*>(sender()));
if (m_pDiffTextWindow1 && s!=m_pDiffTextWindow1) m_pDiffTextWindow1->resetSelection(); if (m_pDiffTextWindow1 && TQT_BASE_OBJECT_CONST(s)!=TQT_BASE_OBJECT(m_pDiffTextWindow1)) m_pDiffTextWindow1->resetSelection();
if (m_pDiffTextWindow2 && s!=m_pDiffTextWindow2) m_pDiffTextWindow2->resetSelection(); if (m_pDiffTextWindow2 && TQT_BASE_OBJECT_CONST(s)!=TQT_BASE_OBJECT(m_pDiffTextWindow2)) m_pDiffTextWindow2->resetSelection();
if (m_pDiffTextWindow3 && s!=m_pDiffTextWindow3) m_pDiffTextWindow3->resetSelection(); if (m_pDiffTextWindow3 && TQT_BASE_OBJECT_CONST(s)!=TQT_BASE_OBJECT(m_pDiffTextWindow3)) m_pDiffTextWindow3->resetSelection();
if (m_pMergeResultWindow && s!=m_pMergeResultWindow) m_pMergeResultWindow->resetSelection(); if (m_pMergeResultWindow && TQT_BASE_OBJECT_CONST(s)!=TQT_BASE_OBJECT(m_pMergeResultWindow)) m_pMergeResultWindow->resetSelection();
} }
void KDiff3App::slotSelectionEnd() void KDiff3App::slotSelectionEnd()
{ {
//const QObject* s = sender(); //const TQObject* s = sender();
//editCopy->setEnabled(true); //editCopy->setEnabled(true);
//editCut->setEnabled( s==m_pMergeResultWindow ); //editCut->setEnabled( s==m_pMergeResultWindow );
if ( m_pOptionDialog->m_bAutoCopySelection ) if ( m_pOptionDialog->m_bAutoCopySelection )
@ -1465,18 +1465,18 @@ void KDiff3App::slotSelectionEnd()
} }
else else
{ {
QClipboard *clipBoard = QApplication::clipboard(); TQClipboard *clipBoard = TQApplication::tqclipboard();
if (clipBoard->supportsSelection ()) if (clipBoard->supportsSelection ())
{ {
QString s; TQString s;
if ( m_pDiffTextWindow1!=0 ) s = m_pDiffTextWindow1->getSelection(); if ( m_pDiffTextWindow1!=0 ) s = m_pDiffTextWindow1->getSelection();
if ( s.isNull() && m_pDiffTextWindow2!=0 ) s = m_pDiffTextWindow2->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_pDiffTextWindow3!=0 ) s = m_pDiffTextWindow3->getSelection();
if ( s.isNull() && m_pMergeResultWindow!=0 ) s = m_pMergeResultWindow->getSelection(); if ( s.isNull() && m_pMergeResultWindow!=0 ) s = m_pMergeResultWindow->getSelection();
if ( !s.isNull() ) if ( !s.isNull() )
{ {
clipBoard->setText( s, QClipboard::Selection ); clipBoard->setText( s, TQClipboard::Selection );
} }
} }
} }
@ -1484,7 +1484,7 @@ void KDiff3App::slotSelectionEnd()
void KDiff3App::slotClipboardChanged() void KDiff3App::slotClipboardChanged()
{ {
QString s = QApplication::clipboard()->text(); TQString s = TQApplication::tqclipboard()->text();
//editPaste->setEnabled(!s.isEmpty()); //editPaste->setEnabled(!s.isEmpty());
} }
@ -1832,7 +1832,7 @@ void KDiff3App::slotEditFind()
m_pFindDialog->currentPos = 0; m_pFindDialog->currentPos = 0;
m_pFindDialog->currentWindow = 1; m_pFindDialog->currentWindow = 1;
if ( QDialog::Accepted == m_pFindDialog->exec() ) if ( TQDialog::Accepted == m_pFindDialog->exec() )
{ {
slotEditFindNext(); slotEditFindNext();
} }
@ -1840,7 +1840,7 @@ void KDiff3App::slotEditFind()
void KDiff3App::slotEditFindNext() void KDiff3App::slotEditFindNext()
{ {
QString s = m_pFindDialog->m_pSearchString->text(); TQString s = m_pFindDialog->m_pSearchString->text();
if ( s.isEmpty() ) if ( s.isEmpty() )
{ {
slotEditFind(); slotEditFind();
@ -1969,13 +1969,13 @@ void KDiff3App::slotMergeCurrentFile()
void KDiff3App::slotWinFocusNext() void KDiff3App::slotWinFocusNext()
{ {
QWidget* focus = qApp->focusWidget(); TQWidget* focus = tqApp->tqfocusWidget();
if ( focus == m_pDirectoryMergeWindow && m_pDirectoryMergeWindow->isVisible() && ! dirShowBoth->isChecked() ) if ( focus == m_pDirectoryMergeWindow && m_pDirectoryMergeWindow->isVisible() && ! dirShowBoth->isChecked() )
{ {
slotDirViewToggle(); slotDirViewToggle();
} }
std::list<QWidget*> visibleWidgetList; std::list<TQWidget*> visibleWidgetList;
if ( m_pDiffTextWindow1 && m_pDiffTextWindow1->isVisible() ) visibleWidgetList.push_back(m_pDiffTextWindow1); if ( m_pDiffTextWindow1 && m_pDiffTextWindow1->isVisible() ) visibleWidgetList.push_back(m_pDiffTextWindow1);
if ( m_pDiffTextWindow2 && m_pDiffTextWindow2->isVisible() ) visibleWidgetList.push_back(m_pDiffTextWindow2); if ( m_pDiffTextWindow2 && m_pDiffTextWindow2->isVisible() ) visibleWidgetList.push_back(m_pDiffTextWindow2);
if ( m_pDiffTextWindow3 && m_pDiffTextWindow3->isVisible() ) visibleWidgetList.push_back(m_pDiffTextWindow3); 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_bDirCompare /*m_pDirectoryMergeWindow->isVisible()*/ ) visibleWidgetList.push_back(m_pDirectoryMergeWindow);
//if ( m_pDirectoryMergeInfo->isVisible() ) visibleWidgetList.push_back(m_pDirectoryMergeInfo->getInfoList()); //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; ++i;
if ( i==visibleWidgetList.end() ) if ( i==visibleWidgetList.end() )
i = visibleWidgetList.begin(); i = visibleWidgetList.begin();
@ -1999,13 +1999,13 @@ void KDiff3App::slotWinFocusNext()
void KDiff3App::slotWinFocusPrev() void KDiff3App::slotWinFocusPrev()
{ {
QWidget* focus = qApp->focusWidget(); TQWidget* focus = tqApp->tqfocusWidget();
if ( focus == m_pDirectoryMergeWindow && m_pDirectoryMergeWindow->isVisible() && ! dirShowBoth->isChecked() ) if ( focus == m_pDirectoryMergeWindow && m_pDirectoryMergeWindow->isVisible() && ! dirShowBoth->isChecked() )
{ {
slotDirViewToggle(); slotDirViewToggle();
} }
std::list<QWidget*> visibleWidgetList; std::list<TQWidget*> visibleWidgetList;
if ( m_pDiffTextWindow1 && m_pDiffTextWindow1->isVisible() ) visibleWidgetList.push_back(m_pDiffTextWindow1); if ( m_pDiffTextWindow1 && m_pDiffTextWindow1->isVisible() ) visibleWidgetList.push_back(m_pDiffTextWindow1);
if ( m_pDiffTextWindow2 && m_pDiffTextWindow2->isVisible() ) visibleWidgetList.push_back(m_pDiffTextWindow2); if ( m_pDiffTextWindow2 && m_pDiffTextWindow2->isVisible() ) visibleWidgetList.push_back(m_pDiffTextWindow2);
if ( m_pDiffTextWindow3 && m_pDiffTextWindow3->isVisible() ) visibleWidgetList.push_back(m_pDiffTextWindow3); 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_bDirCompare /* m_pDirectoryMergeWindow->isVisible() */ ) visibleWidgetList.push_back(m_pDirectoryMergeWindow);
//if ( m_pDirectoryMergeInfo->isVisible() ) visibleWidgetList.push_back(m_pDirectoryMergeInfo->getInfoList()); //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() ) if ( i==visibleWidgetList.begin() )
i=visibleWidgetList.end(); i=visibleWidgetList.end();
--i; --i;
@ -2074,7 +2074,7 @@ void KDiff3App::slotNoRelevantChangesDetected()
//KMessageBox::information( this, "No relevant changes detected", "KDiff3" ); //KMessageBox::information( this, "No relevant changes detected", "KDiff3" );
if (!m_pOptionDialog->m_IrrelevantMergeCmd.isEmpty()) 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() ); ::system( cmd.local8Bit() );
} }
} }

@ -21,17 +21,17 @@
#include "smalldialogs.h" #include "smalldialogs.h"
#include "optiondialog.h" #include "optiondialog.h"
#include <qcombobox.h> #include <tqcombobox.h>
#include <qcheckbox.h> #include <tqcheckbox.h>
#include <qlineedit.h> #include <tqlineedit.h>
#include <qlabel.h> #include <tqlabel.h>
#include <qlayout.h> #include <tqlayout.h>
#include <qpushbutton.h> #include <tqpushbutton.h>
#include <qdragobject.h> #include <tqdragobject.h>
#include <qregexp.h> #include <tqregexp.h>
#include <qtooltip.h> #include <tqtooltip.h>
#include <qpopupmenu.h> #include <tqpopupmenu.h>
#include <qcursor.h> #include <tqcursor.h>
#include <kfiledialog.h> #include <kfiledialog.h>
@ -40,105 +40,105 @@
// OpenDialog ************************************************************** // OpenDialog **************************************************************
OpenDialog::OpenDialog( OpenDialog::OpenDialog(
QWidget* pParent, const QString& n1, const QString& n2, const QString& n3, TQWidget* pParent, const TQString& n1, const TQString& n2, const TQString& n3,
bool bMerge, const QString& outputName, const char* slotConfigure, OptionDialog* pOptions ) bool bMerge, const TQString& outputName, const char* slotConfigure, OptionDialog* pOptions )
: QDialog( pParent, "OpenDialog", true /*modal*/ ) : TQDialog( pParent, "OpenDialog", true /*modal*/ )
{ {
m_pOptions = pOptions; m_pOptions = pOptions;
QVBoxLayout* v = new QVBoxLayout( this, 5 ); TQVBoxLayout* v = new TQVBoxLayout( this, 5 );
QGridLayout* h = new QGridLayout( v, 5, 4, 5 ); TQGridLayout* h = new TQGridLayout( v, 5, 4, 5 );
h->setColStretch( 1, 10 ); 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->insertStringList( m_pOptions->m_recentAFiles );
m_pLineA->setEditText( KURL(n1).prettyURL() ); m_pLineA->setEditText( KURL(n1).prettyURL() );
m_pLineA->setMinimumSize( 200, m_pLineA->size().height() ); m_pLineA->setMinimumSize( 200, m_pLineA->size().height() );
QPushButton * button = new QPushButton( i18n("File..."), this ); TQPushButton * button = new TQPushButton( i18n("File..."), this );
connect( button, SIGNAL(clicked()), this, SLOT( selectFileA() ) ); connect( button, TQT_SIGNAL(clicked()), this, TQT_SLOT( selectFileA() ) );
QPushButton * button2 = new QPushButton( i18n("Dir..."), this ); TQPushButton * button2 = new TQPushButton( i18n("Dir..."), this );
connect( button2, SIGNAL(clicked()), this, SLOT( selectDirA() ) ); connect( button2, TQT_SIGNAL(clicked()), this, TQT_SLOT( selectDirA() ) );
connect( m_pLineA, SIGNAL(textChanged(const QString&)), this, SLOT(inputFilenameChanged() ) ); connect( m_pLineA, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(inputFilenameChanged() ) );
h->addWidget( label, 0, 0 ); h->addWidget( label, 0, 0 );
h->addWidget( m_pLineA, 0, 1 ); h->addWidget( m_pLineA, 0, 1 );
h->addWidget( button, 0, 2 ); h->addWidget( button, 0, 2 );
h->addWidget( button2, 0, 3 ); h->addWidget( button2, 0, 3 );
label = new QLabel( "B:", this ); label = new TQLabel( "B:", this );
m_pLineB = new QComboBox( true, this ); m_pLineB = new TQComboBox( true, this );
m_pLineB->insertStringList( m_pOptions->m_recentBFiles ); m_pLineB->insertStringList( m_pOptions->m_recentBFiles );
m_pLineB->setEditText( KURL(n2).prettyURL() ); m_pLineB->setEditText( KURL(n2).prettyURL() );
m_pLineB->setMinimumSize( 200, m_pLineB->size().height() ); m_pLineB->setMinimumSize( 200, m_pLineB->size().height() );
button = new QPushButton( i18n("File..."), this ); button = new TQPushButton( i18n("File..."), this );
connect( button, SIGNAL(clicked()), this, SLOT( selectFileB() ) ); connect( button, TQT_SIGNAL(clicked()), this, TQT_SLOT( selectFileB() ) );
button2 = new QPushButton( i18n("Dir..."), this ); button2 = new TQPushButton( i18n("Dir..."), this );
connect( button2, SIGNAL(clicked()), this, SLOT( selectDirB() ) ); connect( button2, TQT_SIGNAL(clicked()), this, TQT_SLOT( selectDirB() ) );
connect( m_pLineB, SIGNAL(textChanged(const QString&)), this, SLOT(inputFilenameChanged() ) ); connect( m_pLineB, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(inputFilenameChanged() ) );
h->addWidget( label, 1, 0 ); h->addWidget( label, 1, 0 );
h->addWidget( m_pLineB, 1, 1 ); h->addWidget( m_pLineB, 1, 1 );
h->addWidget( button, 1, 2 ); h->addWidget( button, 1, 2 );
h->addWidget( button2, 1, 3 ); h->addWidget( button2, 1, 3 );
label = new QLabel( i18n("C (Optional):"), this ); label = new TQLabel( i18n("C (Optional):"), this );
m_pLineC= new QComboBox( true, this ); m_pLineC= new TQComboBox( true, this );
m_pLineC->insertStringList( m_pOptions->m_recentCFiles ); m_pLineC->insertStringList( m_pOptions->m_recentCFiles );
m_pLineC->setEditText( KURL(n3).prettyURL() ); m_pLineC->setEditText( KURL(n3).prettyURL() );
m_pLineC->setMinimumSize( 200, m_pLineC->size().height() ); m_pLineC->setMinimumSize( 200, m_pLineC->size().height() );
button = new QPushButton( i18n("File..."), this ); button = new TQPushButton( i18n("File..."), this );
connect( button, SIGNAL(clicked()), this, SLOT( selectFileC() ) ); connect( button, TQT_SIGNAL(clicked()), this, TQT_SLOT( selectFileC() ) );
button2 = new QPushButton( i18n("Dir..."), this ); button2 = new TQPushButton( i18n("Dir..."), this );
connect( button2, SIGNAL(clicked()), this, SLOT( selectDirC() ) ); connect( button2, TQT_SIGNAL(clicked()), this, TQT_SLOT( selectDirC() ) );
connect( m_pLineC, SIGNAL(textChanged(const QString&)), this, SLOT(inputFilenameChanged() ) ); connect( m_pLineC, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(inputFilenameChanged() ) );
h->addWidget( label, 2, 0 ); h->addWidget( label, 2, 0 );
h->addWidget( m_pLineC, 2, 1 ); h->addWidget( m_pLineC, 2, 1 );
h->addWidget( button, 2, 2 ); h->addWidget( button, 2, 2 );
h->addWidget( button2, 2, 3 ); 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 ); h->addWidget( m_pMerge, 3, 0 );
QHBoxLayout* hl = new QHBoxLayout(); TQHBoxLayout* hl = new TQHBoxLayout();
h->addLayout( hl, 3, 1 ); h->addLayout( hl, 3, 1 );
hl->addStretch(2); hl->addStretch(2);
button = new QPushButton(i18n("Swap/Copy Names ..."), this); button = new TQPushButton(i18n("Swap/Copy Names ..."), this);
//button->setToggleButton(false); //button->setToggleButton(false);
hl->addWidget( button ); hl->addWidget( button );
QPopupMenu* m = new QPopupMenu(this); TQPopupMenu* m = new TQPopupMenu(this);
int id=0; int id=0;
m->insertItem( i18n("Swap %1<->%2").arg("A").arg("B"), id++ ); m->insertItem( i18n("Swap %1<->%2").tqarg("A").tqarg("B"), id++ );
m->insertItem( i18n("Swap %1<->%2").arg("B").arg("C"), id++ ); m->insertItem( i18n("Swap %1<->%2").tqarg("B").tqarg("C"), id++ );
m->insertItem( i18n("Swap %1<->%2").arg("C").arg("A"), id++ ); m->insertItem( i18n("Swap %1<->%2").tqarg("C").tqarg("A"), id++ );
m->insertItem( i18n("Copy %1->Output").arg("A"), id++ ); m->insertItem( i18n("Copy %1->Output").tqarg("A"), id++ );
m->insertItem( i18n("Copy %1->Output").arg("B"), id++ ); m->insertItem( i18n("Copy %1->Output").tqarg("B"), id++ );
m->insertItem( i18n("Copy %1->Output").arg("C"), id++ ); m->insertItem( i18n("Copy %1->Output").tqarg("C"), id++ );
m->insertItem( i18n("Swap %1<->Output").arg("A"), id++ ); m->insertItem( i18n("Swap %1<->Output").tqarg("A"), id++ );
m->insertItem( i18n("Swap %1<->Output").arg("B"), id++ ); m->insertItem( i18n("Swap %1<->Output").tqarg("B"), id++ );
m->insertItem( i18n("Swap %1<->Output").arg("C"), id++ ); m->insertItem( i18n("Swap %1<->Output").tqarg("C"), id++ );
connect( m, SIGNAL(activated(int)), this, SLOT(slotSwapCopyNames(int))); connect( m, TQT_SIGNAL(activated(int)), this, TQT_SLOT(slotSwapCopyNames(int)));
button->setPopup(m); button->setPopup(m);
hl->addStretch(2); hl->addStretch(2);
label = new QLabel( i18n("Output (optional):"), this ); label = new TQLabel( i18n("Output (optional):"), this );
m_pLineOut = new QComboBox( true, this ); m_pLineOut = new TQComboBox( true, this );
m_pLineOut->insertStringList( m_pOptions->m_recentOutputFiles ); m_pLineOut->insertStringList( m_pOptions->m_recentOutputFiles );
m_pLineOut->setEditText( KURL(outputName).prettyURL() ); m_pLineOut->setEditText( KURL(outputName).prettyURL() );
m_pLineOut->setMinimumSize( 200, m_pLineOut->size().height() ); m_pLineOut->setMinimumSize( 200, m_pLineOut->size().height() );
button = new QPushButton( i18n("File..."), this ); button = new TQPushButton( i18n("File..."), this );
connect( button, SIGNAL(clicked()), this, SLOT( selectOutputName() ) ); connect( button, TQT_SIGNAL(clicked()), this, TQT_SLOT( selectOutputName() ) );
button2 = new QPushButton( i18n("Dir..."), this ); button2 = new TQPushButton( i18n("Dir..."), this );
connect( button2, SIGNAL(clicked()), this, SLOT( selectOutputDir() ) ); connect( button2, TQT_SIGNAL(clicked()), this, TQT_SLOT( selectOutputDir() ) );
connect( m_pMerge, SIGNAL(stateChanged(int)), this, SLOT(internalSlot(int)) ); connect( m_pMerge, TQT_SIGNAL(stateChanged(int)), this, TQT_SLOT(internalSlot(int)) );
connect( this, SIGNAL(internalSignal(bool)), m_pLineOut, SLOT(setEnabled(bool)) ); connect( this, TQT_SIGNAL(internalSignal(bool)), m_pLineOut, TQT_SLOT(setEnabled(bool)) );
connect( this, SIGNAL(internalSignal(bool)), button, SLOT(setEnabled(bool)) ); connect( this, TQT_SIGNAL(internalSignal(bool)), button, TQT_SLOT(setEnabled(bool)) );
connect( this, SIGNAL(internalSignal(bool)), button2, SLOT(setEnabled(bool)) ); connect( this, TQT_SIGNAL(internalSignal(bool)), button2, TQT_SLOT(setEnabled(bool)) );
m_pMerge->setChecked( !bMerge ); m_pMerge->setChecked( !bMerge );
m_pMerge->setChecked( bMerge ); m_pMerge->setChecked( bMerge );
@ -153,24 +153,24 @@ OpenDialog::OpenDialog(
h->addColSpacing( 1, 200 ); h->addColSpacing( 1, 200 );
QHBoxLayout* l = new QHBoxLayout( v, 5 ); TQHBoxLayout* l = new TQHBoxLayout( v, 5 );
button = new QPushButton( i18n("Configure..."), this ); button = new TQPushButton( i18n("Configure..."), this );
connect( button, SIGNAL(clicked()), pParent, slotConfigure ); connect( button, TQT_SIGNAL(clicked()), pParent, slotConfigure );
l->addWidget( button, 1 ); l->addWidget( button, 1 );
l->addStretch(1); l->addStretch(1);
button = new QPushButton( i18n("&OK"), this ); button = new TQPushButton( i18n("&OK"), this );
button->setDefault( true ); button->setDefault( true );
connect( button, SIGNAL(clicked()), this, SLOT( accept() ) ); connect( button, TQT_SIGNAL(clicked()), this, TQT_SLOT( accept() ) );
l->addWidget( button, 1 ); l->addWidget( button, 1 );
button = new QPushButton( i18n("&Cancel"), this ); button = new TQPushButton( i18n("&Cancel"), this );
connect( button, SIGNAL(clicked()), this, SLOT( reject() ) ); connect( button, TQT_SIGNAL(clicked()), this, TQT_SLOT( reject() ) );
l->addWidget( button,1 ); l->addWidget( button,1 );
QSize sh = sizeHint(); TQSize sh = tqsizeHint();
setFixedHeight( sh.height() ); setFixedHeight( sh.height() );
m_bInputFileNameChanged = false; m_bInputFileNameChanged = false;
@ -185,23 +185,23 @@ OpenDialog::OpenDialog(
// Eventfilter: Only needed under Windows. // Eventfilter: Only needed under Windows.
// Without this, files dropped in the line edit have URL-encoding. // Without this, files dropped in the line edit have URL-encoding.
// This eventfilter decodes the filenames as needed by KDiff3. // 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; return false;
} }
QStringList lst; TQStringList lst;
QUriDrag::decodeLocalFiles( d, lst ); TQUriDrag::decodeLocalFiles( d, lst );
if ( lst.count() > 0 ) if ( lst.count() > 0 )
{ {
static_cast<QLineEdit*>(o)->setText( lst[0] ); static_cast<TQLineEdit*>(TQT_TQWIDGET(o))->setText( lst[0] );
static_cast<QLineEdit*>(o)->setFocus(); static_cast<TQLineEdit*>(TQT_TQWIDGET(o))->setFocus();
} }
return true; 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() && i>3 ){ current = m_pLineC->currentText(); }
if (current.isEmpty() ){ current = m_pLineB->currentText(); } if (current.isEmpty() ){ current = m_pLineB->currentText(); }
if (current.isEmpty() ){ current = m_pLineA->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 ) if ( pos>=0 )
s=s.left(pos); s=s.left(pos);
pos = s.find( '\r' ); pos = s.tqfind( '\r' );
if ( pos>=0 ) if ( pos>=0 )
s=s.left(pos); s=s.left(pos);
@ -271,9 +271,9 @@ void OpenDialog::accept()
unsigned int maxNofRecentFiles = 10; unsigned int maxNofRecentFiles = 10;
fixCurrentText( m_pLineA ); fixCurrentText( m_pLineA );
QString s = m_pLineA->currentText(); TQString s = m_pLineA->currentText();
s = KURL::fromPathOrURL(s).prettyURL(); 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. // If an item exist, remove it from the list and reinsert it at the beginning.
sl->remove(s); sl->remove(s);
if ( !s.isEmpty() ) sl->prepend( s ); if ( !s.isEmpty() ) sl->prepend( s );
@ -303,13 +303,13 @@ void OpenDialog::accept()
if ( !s.isEmpty() ) sl->prepend( s ); if ( !s.isEmpty() ) sl->prepend( s );
if (sl->count()>maxNofRecentFiles) sl->erase( sl->at(maxNofRecentFiles), sl->end() ); 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 void OpenDialog::slotSwapCopyNames( int id ) // id selected in the popup menu
{ {
QComboBox* cb1=0; TQComboBox* cb1=0;
QComboBox* cb2=0; TQComboBox* cb2=0;
switch(id) switch(id)
{ {
case 0: cb1=m_pLineA; cb2=m_pLineB; break; 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 ) if ( cb1 && cb2 )
{ {
QString t1 = cb1->currentText(); TQString t1 = cb1->currentText();
QString t2 = cb2->currentText(); TQString t2 = cb2->currentText();
cb2->setCurrentText(t1); cb2->setCurrentText(t1);
if ( id<=2 || id>=6 ) if ( id<=2 || id>=6 )
{ {
@ -336,172 +336,172 @@ void OpenDialog::slotSwapCopyNames( int id ) // id selected in the popup menu
// FindDialog ********************************************* // FindDialog *********************************************
FindDialog::FindDialog(QWidget* pParent) FindDialog::FindDialog(TQWidget* pParent)
: QDialog( pParent ) : TQDialog( pParent )
{ {
QGridLayout* layout = new QGridLayout( this ); TQGridLayout* tqlayout = new TQGridLayout( this );
layout->setMargin(5); tqlayout->setMargin(5);
layout->setSpacing(5); tqlayout->setSpacing(5);
int line=0; 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; ++line;
m_pSearchString = new QLineEdit( this ); m_pSearchString = new TQLineEdit( this );
layout->addMultiCellWidget( m_pSearchString, line,line,0,1 ); tqlayout->addMultiCellWidget( m_pSearchString, line,line,0,1 );
++line; ++line;
m_pCaseSensitive = new QCheckBox(i18n("Case sensitive"),this); m_pCaseSensitive = new TQCheckBox(i18n("Case sensitive"),this);
layout->addWidget( m_pCaseSensitive, line, 1 ); tqlayout->addWidget( m_pCaseSensitive, line, 1 );
m_pSearchInA = new QCheckBox(i18n("Search A"),this); m_pSearchInA = new TQCheckBox(i18n("Search A"),this);
layout->addWidget( m_pSearchInA, line, 0 ); tqlayout->addWidget( m_pSearchInA, line, 0 );
m_pSearchInA->setChecked( true ); m_pSearchInA->setChecked( true );
++line; ++line;
m_pSearchInB = new QCheckBox(i18n("Search B"),this); m_pSearchInB = new TQCheckBox(i18n("Search B"),this);
layout->addWidget( m_pSearchInB, line, 0 ); tqlayout->addWidget( m_pSearchInB, line, 0 );
m_pSearchInB->setChecked( true ); m_pSearchInB->setChecked( true );
++line; ++line;
m_pSearchInC = new QCheckBox(i18n("Search C"),this); m_pSearchInC = new TQCheckBox(i18n("Search C"),this);
layout->addWidget( m_pSearchInC, line, 0 ); tqlayout->addWidget( m_pSearchInC, line, 0 );
m_pSearchInC->setChecked( true ); m_pSearchInC->setChecked( true );
++line; ++line;
m_pSearchInOutput = new QCheckBox(i18n("Search output"),this); m_pSearchInOutput = new TQCheckBox(i18n("Search output"),this);
layout->addWidget( m_pSearchInOutput, line, 0 ); tqlayout->addWidget( m_pSearchInOutput, line, 0 );
m_pSearchInOutput->setChecked( true ); m_pSearchInOutput->setChecked( true );
++line; ++line;
QPushButton* pButton = new QPushButton( i18n("&Search"), this ); TQPushButton* pButton = new TQPushButton( i18n("&Search"), this );
layout->addWidget( pButton, line, 0 ); tqlayout->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 );
layout->addWidget( pButton, line, 1 ); tqlayout->addWidget( pButton, line, 1 );
connect( pButton, SIGNAL(clicked()), this, SLOT(reject())); connect( pButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(reject()));
hide(); hide();
} }
RegExpTester::RegExpTester( QWidget* pParent, const QString& autoMergeRegExpToolTip, RegExpTester::RegExpTester( TQWidget* pParent, const TQString& autoMergeRegExpToolTip,
const QString& historyStartRegExpToolTip, const QString& historyEntryStartRegExpToolTip, const QString& historySortKeyOrderToolTip ) const TQString& historyStartRegExpToolTip, const TQString& historyEntryStartRegExpToolTip, const TQString& historySortKeyOrderToolTip )
: QDialog( pParent) : TQDialog( pParent)
{ {
int line=0; int line=0;
setCaption(i18n("Regular Expression Tester")); 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); pGrid->addWidget(l,line,0);
QToolTip::add( l, autoMergeRegExpToolTip ); TQToolTip::add( l, autoMergeRegExpToolTip );
m_pAutoMergeRegExpEdit = new QLineEdit(this); m_pAutoMergeRegExpEdit = new TQLineEdit(this);
pGrid->addWidget(m_pAutoMergeRegExpEdit,line,1); 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; ++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); pGrid->addMultiCellWidget(l,line,line,0,1);
QToolTip::add( l, i18n("For auto merge test copy a line as used in your files.") ); TQToolTip::add( l, i18n("For auto merge test copy a line as used in your files.") );
m_pAutoMergeExampleEdit = new QLineEdit(this); m_pAutoMergeExampleEdit = new TQLineEdit(this);
pGrid->addWidget(m_pAutoMergeExampleEdit,line,1); 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; ++line;
l = new QLabel(i18n("Match result:"), this); l = new TQLabel(i18n("Match result:"), this);
pGrid->addWidget(l,line,0); pGrid->addWidget(l,line,0);
m_pAutoMergeMatchResult = new QLineEdit(this); m_pAutoMergeMatchResult = new TQLineEdit(this);
m_pAutoMergeMatchResult->setReadOnly(true); m_pAutoMergeMatchResult->setReadOnly(true);
pGrid->addWidget(m_pAutoMergeMatchResult,line,1); pGrid->addWidget(m_pAutoMergeMatchResult,line,1);
++line; ++line;
pGrid->addItem( new QSpacerItem(100,20), line, 0 ); pGrid->addItem( new TQSpacerItem(100,20), line, 0 );
pGrid->setRowStretch( line, 5); pGrid->setRowStretch( line, 5);
++line; ++line;
l = new QLabel(i18n("History start regular expression:"), this); l = new TQLabel(i18n("History start regular expression:"), this);
pGrid->addWidget(l,line,0); pGrid->addWidget(l,line,0);
QToolTip::add( l, historyStartRegExpToolTip ); TQToolTip::add( l, historyStartRegExpToolTip );
m_pHistoryStartRegExpEdit = new QLineEdit(this); m_pHistoryStartRegExpEdit = new TQLineEdit(this);
pGrid->addWidget(m_pHistoryStartRegExpEdit,line,1); 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; ++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); pGrid->addMultiCellWidget(l,line,line,0,1);
++line; ++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.") ); "including the leading comment.") );
m_pHistoryStartExampleEdit = new QLineEdit(this); m_pHistoryStartExampleEdit = new TQLineEdit(this);
pGrid->addWidget(m_pHistoryStartExampleEdit,line,1); 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; ++line;
l = new QLabel(i18n("Match result:"), this); l = new TQLabel(i18n("Match result:"), this);
pGrid->addWidget(l,line,0); pGrid->addWidget(l,line,0);
m_pHistoryStartMatchResult = new QLineEdit(this); m_pHistoryStartMatchResult = new TQLineEdit(this);
m_pHistoryStartMatchResult->setReadOnly(true); m_pHistoryStartMatchResult->setReadOnly(true);
pGrid->addWidget(m_pHistoryStartMatchResult,line,1); pGrid->addWidget(m_pHistoryStartMatchResult,line,1);
++line; ++line;
pGrid->addItem( new QSpacerItem(100,20), line, 0 ); pGrid->addItem( new TQSpacerItem(100,20), line, 0 );
pGrid->setRowStretch( line, 5); pGrid->setRowStretch( line, 5);
++line; ++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); pGrid->addWidget(l,line,0);
QToolTip::add( l, historyEntryStartRegExpToolTip ); TQToolTip::add( l, historyEntryStartRegExpToolTip );
m_pHistoryEntryStartRegExpEdit = new QLineEdit(this); m_pHistoryEntryStartRegExpEdit = new TQLineEdit(this);
pGrid->addWidget(m_pHistoryEntryStartRegExpEdit,line,1); 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; ++line;
l = new QLabel(i18n("History sort key order:"), this); l = new TQLabel(i18n("History sort key order:"), this);
pGrid->addWidget(l,line,0); pGrid->addWidget(l,line,0);
QToolTip::add( l, historySortKeyOrderToolTip ); TQToolTip::add( l, historySortKeyOrderToolTip );
m_pHistorySortKeyOrderEdit = new QLineEdit(this); m_pHistorySortKeyOrderEdit = new TQLineEdit(this);
pGrid->addWidget(m_pHistorySortKeyOrderEdit,line,1); 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; ++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); 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.") ); "but omit the leading comment.") );
++line; ++line;
m_pHistoryEntryStartExampleEdit = new QLineEdit(this); m_pHistoryEntryStartExampleEdit = new TQLineEdit(this);
pGrid->addWidget(m_pHistoryEntryStartExampleEdit,line,1); 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; ++line;
l = new QLabel(i18n("Match result:"), this); l = new TQLabel(i18n("Match result:"), this);
pGrid->addWidget(l,line,0); pGrid->addWidget(l,line,0);
m_pHistoryEntryStartMatchResult = new QLineEdit(this); m_pHistoryEntryStartMatchResult = new TQLineEdit(this);
m_pHistoryEntryStartMatchResult->setReadOnly(true); m_pHistoryEntryStartMatchResult->setReadOnly(true);
pGrid->addWidget(m_pHistoryEntryStartMatchResult,line,1); pGrid->addWidget(m_pHistoryEntryStartMatchResult,line,1);
++line; ++line;
l = new QLabel(i18n("Sort key result:"), this); l = new TQLabel(i18n("Sort key result:"), this);
pGrid->addWidget(l,line,0); pGrid->addWidget(l,line,0);
m_pHistorySortKeyResult = new QLineEdit(this); m_pHistorySortKeyResult = new TQLineEdit(this);
m_pHistorySortKeyResult->setReadOnly(true); m_pHistorySortKeyResult->setReadOnly(true);
pGrid->addWidget(m_pHistorySortKeyResult,line,1); pGrid->addWidget(m_pHistorySortKeyResult,line,1);
++line; ++line;
QPushButton* pButton = new QPushButton(i18n("OK"), this); TQPushButton* pButton = new TQPushButton(i18n("OK"), this);
pGrid->addWidget(pButton,line,0); 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); 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_pAutoMergeRegExpEdit->setText( autoMergeRegExp );
m_pHistoryStartRegExpEdit->setText( historyStartRegExp ); m_pHistoryStartRegExpEdit->setText( historyStartRegExp );
@ -509,29 +509,29 @@ void RegExpTester::init( const QString& autoMergeRegExp, const QString& historyS
m_pHistorySortKeyOrderEdit->setText( historySortKeyOrder ); m_pHistorySortKeyOrderEdit->setText( historySortKeyOrder );
} }
QString RegExpTester::autoMergeRegExp() TQString RegExpTester::autoMergeRegExp()
{ {
return m_pAutoMergeRegExpEdit->text(); return m_pAutoMergeRegExpEdit->text();
} }
QString RegExpTester::historyStartRegExp() TQString RegExpTester::historyStartRegExp()
{ {
return m_pHistoryStartRegExpEdit->text(); return m_pHistoryStartRegExpEdit->text();
} }
QString RegExpTester::historyEntryStartRegExp() TQString RegExpTester::historyEntryStartRegExp()
{ {
return m_pHistoryEntryStartRegExpEdit->text(); return m_pHistoryEntryStartRegExpEdit->text();
} }
QString RegExpTester::historySortKeyOrder() TQString RegExpTester::historySortKeyOrder()
{ {
return m_pHistorySortKeyOrderEdit->text(); return m_pHistorySortKeyOrderEdit->text();
} }
void RegExpTester::slotRecalc() void RegExpTester::slotRecalc()
{ {
QRegExp autoMergeRegExp = m_pAutoMergeRegExpEdit->text(); TQRegExp autoMergeRegExp = m_pAutoMergeRegExpEdit->text();
if ( autoMergeRegExp.exactMatch( m_pAutoMergeExampleEdit->text() ) ) if ( autoMergeRegExp.exactMatch( m_pAutoMergeExampleEdit->text() ) )
{ {
m_pAutoMergeMatchResult->setText( i18n("Match success.") ); m_pAutoMergeMatchResult->setText( i18n("Match success.") );
@ -541,7 +541,7 @@ void RegExpTester::slotRecalc()
m_pAutoMergeMatchResult->setText( i18n("Match failed.") ); m_pAutoMergeMatchResult->setText( i18n("Match failed.") );
} }
QRegExp historyStartRegExp = m_pHistoryStartRegExpEdit->text(); TQRegExp historyStartRegExp = m_pHistoryStartRegExpEdit->text();
if ( historyStartRegExp.exactMatch( m_pHistoryStartExampleEdit->text() ) ) if ( historyStartRegExp.exactMatch( m_pHistoryStartExampleEdit->text() ) )
{ {
m_pHistoryStartMatchResult->setText( i18n("Match success.") ); m_pHistoryStartMatchResult->setText( i18n("Match success.") );
@ -552,21 +552,21 @@ void RegExpTester::slotRecalc()
} }
QStringList parenthesesGroups; TQStringList tqparenthesesGroups;
bool bSuccess = findParenthesesGroups( m_pHistoryEntryStartRegExpEdit->text(), parenthesesGroups ); bool bSuccess = findParenthesesGroups( m_pHistoryEntryStartRegExpEdit->text(), tqparenthesesGroups );
if ( ! bSuccess ) 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("") ); m_pHistorySortKeyResult->setText( i18n("") );
return; return;
} }
QRegExp historyEntryStartRegExp = m_pHistoryEntryStartRegExpEdit->text(); TQRegExp historyEntryStartRegExp = m_pHistoryEntryStartRegExpEdit->text();
QString s = m_pHistoryEntryStartExampleEdit->text(); TQString s = m_pHistoryEntryStartExampleEdit->text();
if ( historyEntryStartRegExp.exactMatch( s ) ) if ( historyEntryStartRegExp.exactMatch( s ) )
{ {
m_pHistoryEntryStartMatchResult->setText( i18n("Match success.") ); 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); m_pHistorySortKeyResult->setText(key);
} }
else else

@ -21,34 +21,35 @@
#ifndef SMALLDIALOGS_H #ifndef SMALLDIALOGS_H
#define SMALLDIALOGS_H #define SMALLDIALOGS_H
#include <qdialog.h> #include <tqdialog.h>
#include "diff.h" #include "diff.h"
class OptionDialog; class OptionDialog;
class QComboBox; class TQComboBox;
class QCheckBox; class TQCheckBox;
class QLineEdit; class TQLineEdit;
class QLabel; class TQLabel;
class OpenDialog : public QDialog class OpenDialog : public TQDialog
{ {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
OpenDialog( OpenDialog(
QWidget* pParent, const QString& n1, const QString& n2, const QString& n3, TQWidget* pParent, const TQString& n1, const TQString& n2, const TQString& n3,
bool bMerge, const QString& outputName, const char* slotConfigure, OptionDialog* pOptions ); bool bMerge, const TQString& outputName, const char* slotConfigure, OptionDialog* pOptions );
QComboBox* m_pLineA; TQComboBox* m_pLineA;
QComboBox* m_pLineB; TQComboBox* m_pLineB;
QComboBox* m_pLineC; TQComboBox* m_pLineC;
QComboBox* m_pLineOut; TQComboBox* m_pLineOut;
QCheckBox* m_pMerge; TQCheckBox* m_pMerge;
virtual void accept(); virtual void accept();
virtual bool eventFilter(QObject* o, QEvent* e); virtual bool eventFilter(TQObject* o, TQEvent* e);
private: private:
OptionDialog* m_pOptions; 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; bool m_bInputFileNameChanged;
private slots: private slots:
void selectFileA(); void selectFileA();
@ -66,22 +67,23 @@ signals:
void internalSignal(bool); void internalSignal(bool);
}; };
class FindDialog : public QDialog class FindDialog : public TQDialog
{ {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
FindDialog(QWidget* pParent); FindDialog(TQWidget* pParent);
signals: signals:
void findNext(); void findNext();
public: public:
QLineEdit* m_pSearchString; TQLineEdit* m_pSearchString;
QCheckBox* m_pSearchInA; TQCheckBox* m_pSearchInA;
QCheckBox* m_pSearchInB; TQCheckBox* m_pSearchInB;
QCheckBox* m_pSearchInC; TQCheckBox* m_pSearchInC;
QCheckBox* m_pSearchInOutput; TQCheckBox* m_pSearchInOutput;
QCheckBox* m_pCaseSensitive; TQCheckBox* m_pCaseSensitive;
int currentLine; int currentLine;
int currentPos; int currentPos;
@ -89,30 +91,31 @@ public:
}; };
class RegExpTester : public QDialog class RegExpTester : public TQDialog
{ {
Q_OBJECT Q_OBJECT
TQ_OBJECT
private: private:
QLineEdit* m_pAutoMergeRegExpEdit; TQLineEdit* m_pAutoMergeRegExpEdit;
QLineEdit* m_pAutoMergeMatchResult; TQLineEdit* m_pAutoMergeMatchResult;
QLineEdit* m_pAutoMergeExampleEdit; TQLineEdit* m_pAutoMergeExampleEdit;
QLineEdit* m_pHistoryStartRegExpEdit; TQLineEdit* m_pHistoryStartRegExpEdit;
QLineEdit* m_pHistoryStartMatchResult; TQLineEdit* m_pHistoryStartMatchResult;
QLineEdit* m_pHistoryStartExampleEdit; TQLineEdit* m_pHistoryStartExampleEdit;
QLineEdit* m_pHistoryEntryStartRegExpEdit; TQLineEdit* m_pHistoryEntryStartRegExpEdit;
QLineEdit* m_pHistorySortKeyOrderEdit; TQLineEdit* m_pHistorySortKeyOrderEdit;
QLineEdit* m_pHistoryEntryStartExampleEdit; TQLineEdit* m_pHistoryEntryStartExampleEdit;
QLineEdit* m_pHistoryEntryStartMatchResult; TQLineEdit* m_pHistoryEntryStartMatchResult;
QLineEdit* m_pHistorySortKeyResult; TQLineEdit* m_pHistorySortKeyResult;
OptionDialog* m_pOptionDialog; OptionDialog* m_pOptionDialog;
public: public:
RegExpTester( QWidget* pParent, const QString& autoMergeRegExpToolTip, const QString& historyStartRegExpToolTip, RegExpTester( TQWidget* pParent, const TQString& autoMergeRegExpToolTip, const TQString& historyStartRegExpToolTip,
const QString& historyEntryStartRegExpToolTip, const QString& historySortKeyOrderToolTip ); const TQString& historyEntryStartRegExpToolTip, const TQString& historySortKeyOrderToolTip );
void init( const QString& autoMergeRegExp, const QString& historyStartRegExp, const QString& historyEntryStartRegExp, const QString sortKeyOrder ); void init( const TQString& autoMergeRegExp, const TQString& historyStartRegExp, const TQString& historyEntryStartRegExp, const TQString sortKeyOrder );
QString autoMergeRegExp(); TQString autoMergeRegExp();
QString historyStartRegExp(); TQString historyStartRegExp();
QString historyEntryStartRegExp(); TQString historyEntryStartRegExp();
QString historySortKeyOrder(); TQString historySortKeyOrder();
public slots: public slots:
void slotRecalc(); void slotRecalc();
}; };

Loading…
Cancel
Save