summaryrefslogtreecommitdiffstats
path: root/src/mergeresultwindow.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-27 05:58:16 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-27 05:58:16 +0000
commitf636ba5ba2df9d34d56b1c85f24c6598fa1cb645 (patch)
tree5365045e6bce685a7cbaeb81b4797a719e86089f /src/mergeresultwindow.cpp
parent63862fdfcb61f302ef69e86d40772bb1318d3763 (diff)
downloadkdiff3-f636ba5ba2df9d34d56b1c85f24c6598fa1cb645.tar.gz
kdiff3-f636ba5ba2df9d34d56b1c85f24c6598fa1cb645.zip
TQt4 port kdiff3
This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/kdiff3@1238464 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'src/mergeresultwindow.cpp')
-rw-r--r--src/mergeresultwindow.cpp456
1 files changed, 228 insertions, 228 deletions
diff --git a/src/mergeresultwindow.cpp b/src/mergeresultwindow.cpp
index 0e0aad9..c0a3a8a 100644
--- a/src/mergeresultwindow.cpp
+++ b/src/mergeresultwindow.cpp
@@ -18,21 +18,21 @@
#include "mergeresultwindow.h"
#include "optiondialog.h"
-#include <qpainter.h>
-#include <qapplication.h>
-#include <qclipboard.h>
-#include <qdir.h>
-#include <qfile.h>
-#include <qcursor.h>
-#include <qpopupmenu.h>
-#include <qstatusbar.h>
-#include <qregexp.h>
-#include <qlabel.h>
-#include <qlineedit.h>
-#include <qcombobox.h>
-#include <qlayout.h>
-#include <qtextcodec.h>
-#include <qdragobject.h>
+#include <tqpainter.h>
+#include <tqapplication.h>
+#include <tqclipboard.h>
+#include <tqdir.h>
+#include <tqfile.h>
+#include <tqcursor.h>
+#include <tqpopupmenu.h>
+#include <tqstatusbar.h>
+#include <tqregexp.h>
+#include <tqlabel.h>
+#include <tqlineedit.h>
+#include <tqcombobox.h>
+#include <tqlayout.h>
+#include <tqtextcodec.h>
+#include <tqdragobject.h>
#include <klocale.h>
#include <kmessagebox.h>
@@ -44,13 +44,13 @@ int g_bAutoSolve = true;
#define leftInfoWidth 3
MergeResultWindow::MergeResultWindow(
- QWidget* pParent,
+ TQWidget* pParent,
OptionDialog* pOptionDialog,
- QStatusBar* pStatusBar
+ TQStatusBar* pStatusBar
)
-: QWidget( pParent, 0, WRepaintNoErase )
+: TQWidget( pParent, 0, WRepaintNoErase )
{
- setFocusPolicy( QWidget::ClickFocus );
+ setFocusPolicy( TQ_ClickFocus );
m_firstLine = 0;
m_firstColumn = 0;
@@ -72,7 +72,7 @@ MergeResultWindow::MergeResultWindow(
m_sizeC = 0;
m_pDiff3LineList = 0;
- m_pTotalDiffStatus = 0;
+ m_pTotalDifftqStatus = 0;
m_pStatusBar = pStatusBar;
m_pOptionDialog = pOptionDialog;
@@ -84,11 +84,11 @@ MergeResultWindow::MergeResultWindow(
m_cursorYPos=0;
m_bCursorOn = true;
m_bCursorUpdate = false;
- connect( &m_cursorTimer, SIGNAL(timeout()), this, SLOT( slotCursorUpdate() ) );
+ connect( &m_cursorTimer, TQT_SIGNAL(timeout()), this, TQT_SLOT( slotCursorUpdate() ) );
m_cursorTimer.start( 500 /*ms*/, true /*single shot*/ );
m_selection.reset();
- setMinimumSize( QSize(20,20) );
+ setMinimumSize( TQSize(20,20) );
setFont( m_pOptionDialog->m_font );
}
@@ -97,7 +97,7 @@ void MergeResultWindow::init(
const LineData* pLineDataB, int sizeB,
const LineData* pLineDataC, int sizeC,
const Diff3LineList* pDiff3LineList,
- TotalDiffStatus* pTotalDiffStatus
+ TotalDifftqStatus* pTotalDifftqStatus
)
{
m_firstLine = 0;
@@ -118,7 +118,7 @@ void MergeResultWindow::init(
m_sizeC = sizeC;
m_pDiff3LineList = pDiff3LineList;
- m_pTotalDiffStatus = pTotalDiffStatus;
+ m_pTotalDifftqStatus = pTotalDifftqStatus;
m_selection.reset();
m_cursorXPos=0;
@@ -134,13 +134,13 @@ void MergeResultWindow::init(
int nofUnsolved = getNrOfUnsolvedConflicts(&wsc);
if (m_pStatusBar)
m_pStatusBar->message( i18n("Number of remaining unsolved conflicts: %1 (of which %2 are whitespace)")
- .arg(nofUnsolved).arg(wsc) );
+ .tqarg(nofUnsolved).tqarg(wsc) );
}
void MergeResultWindow::reset()
{
m_pDiff3LineList = 0;
- m_pTotalDiffStatus = 0;
+ m_pTotalDifftqStatus = 0;
m_pldA = 0;
m_pldB = 0;
m_pldC = 0;
@@ -467,9 +467,9 @@ void MergeResultWindow::merge(bool bAutoSolve, int defaultSelector, bool bConfli
++nrOfWhiteSpaceConflicts;
}
- m_pTotalDiffStatus->nofUnsolvedConflicts = nrOfUnsolvedConflicts;
- m_pTotalDiffStatus->nofSolvedConflicts = nrOfSolvedConflicts;
- m_pTotalDiffStatus->nofWhitespaceConflicts = nrOfWhiteSpaceConflicts;
+ m_pTotalDifftqStatus->nofUnsolvedConflicts = nrOfUnsolvedConflicts;
+ m_pTotalDifftqStatus->nofSolvedConflicts = nrOfSolvedConflicts;
+ m_pTotalDifftqStatus->nofWhitespaceConflicts = nrOfWhiteSpaceConflicts;
m_cursorXPos=0;
@@ -511,19 +511,19 @@ int MergeResultWindow::getNofLines()
int MergeResultWindow::getNofVisibleColumns()
{
- QFontMetrics fm = fontMetrics();
+ TQFontMetrics fm = fontMetrics();
return width()/fm.width('W')-4;
}
int MergeResultWindow::getNofVisibleLines()
{
- QFontMetrics fm = fontMetrics();
+ TQFontMetrics fm = fontMetrics();
return (height()-3)/fm.height()-2;
}
-void MergeResultWindow::resizeEvent( QResizeEvent* e )
+void MergeResultWindow::resizeEvent( TQResizeEvent* e )
{
- QWidget::resizeEvent(e);
+ TQWidget::resizeEvent(e);
emit resizeSignal();
}
@@ -803,26 +803,26 @@ void MergeResultWindow::showNrOfConflicts()
if ( i->bConflict || i->bDelta )
++nrOfConflicts;
}
- QString totalInfo;
- if ( m_pTotalDiffStatus->bBinaryAEqB && m_pTotalDiffStatus->bBinaryAEqC )
+ TQString totalInfo;
+ if ( m_pTotalDifftqStatus->bBinaryAEqB && m_pTotalDifftqStatus->bBinaryAEqC )
totalInfo += i18n("All input files are binary equal.");
- else if ( m_pTotalDiffStatus->bTextAEqB && m_pTotalDiffStatus->bTextAEqC )
+ else if ( m_pTotalDifftqStatus->bTextAEqB && m_pTotalDifftqStatus->bTextAEqC )
totalInfo += i18n("All input files contain the same text.");
else {
- if ( m_pTotalDiffStatus->bBinaryAEqB ) totalInfo += i18n("Files %1 and %2 are binary equal.\n").arg("A").arg("B");
- else if ( m_pTotalDiffStatus->bTextAEqB ) totalInfo += i18n("Files %1 and %2 have equal text.\n").arg("A").arg("B");
- if ( m_pTotalDiffStatus->bBinaryAEqC ) totalInfo += i18n("Files %1 and %2 are binary equal.\n").arg("A").arg("C");
- else if ( m_pTotalDiffStatus->bTextAEqC ) totalInfo += i18n("Files %1 and %2 have equal text.\n").arg("A").arg("C");
- if ( m_pTotalDiffStatus->bBinaryBEqC ) totalInfo += i18n("Files %1 and %2 are binary equal.\n").arg("B").arg("C");
- else if ( m_pTotalDiffStatus->bTextBEqC ) totalInfo += i18n("Files %1 and %2 have equal text.\n").arg("B").arg("C");
+ if ( m_pTotalDifftqStatus->bBinaryAEqB ) totalInfo += i18n("Files %1 and %2 are binary equal.\n").tqarg("A").tqarg("B");
+ else if ( m_pTotalDifftqStatus->bTextAEqB ) totalInfo += i18n("Files %1 and %2 have equal text.\n").tqarg("A").tqarg("B");
+ if ( m_pTotalDifftqStatus->bBinaryAEqC ) totalInfo += i18n("Files %1 and %2 are binary equal.\n").tqarg("A").tqarg("C");
+ else if ( m_pTotalDifftqStatus->bTextAEqC ) totalInfo += i18n("Files %1 and %2 have equal text.\n").tqarg("A").tqarg("C");
+ if ( m_pTotalDifftqStatus->bBinaryBEqC ) totalInfo += i18n("Files %1 and %2 are binary equal.\n").tqarg("B").tqarg("C");
+ else if ( m_pTotalDifftqStatus->bTextBEqC ) totalInfo += i18n("Files %1 and %2 have equal text.\n").tqarg("B").tqarg("C");
}
int nrOfUnsolvedConflicts = getNrOfUnsolvedConflicts();
KMessageBox::information( this,
- i18n("Total number of conflicts: ") + QString::number(nrOfConflicts) +
- i18n("\nNr of automatically solved conflicts: ") + QString::number(nrOfConflicts-nrOfUnsolvedConflicts) +
- i18n("\nNr of unsolved conflicts: ") + QString::number(nrOfUnsolvedConflicts) +
+ i18n("Total number of conflicts: ") + TQString::number(nrOfConflicts) +
+ i18n("\nNr of automatically solved conflicts: ") + TQString::number(nrOfConflicts-nrOfUnsolvedConflicts) +
+ i18n("\nNr of unsolved conflicts: ") + TQString::number(nrOfUnsolvedConflicts) +
"\n"+totalInfo,
i18n("Conflicts")
);
@@ -948,7 +948,7 @@ void MergeResultWindow::choose( int selector )
int wsc;
int nofUnsolved = getNrOfUnsolvedConflicts(&wsc);
m_pStatusBar->message( i18n("Number of remaining unsolved conflicts: %1 (of which %2 are whitespace)")
- .arg(nofUnsolved).arg(wsc) );
+ .tqarg(nofUnsolved).tqarg(wsc) );
}
// bConflictsOnly: automatically choose for conflicts only (true) or for everywhere (false)
@@ -962,7 +962,7 @@ void MergeResultWindow::chooseGlobal(int selector, bool bConflictsOnly, bool bWh
int wsc;
int nofUnsolved = getNrOfUnsolvedConflicts(&wsc);
m_pStatusBar->message( i18n("Number of remaining unsolved conflicts: %1 (of which %2 are whitespace)")
- .arg(nofUnsolved).arg(wsc) );
+ .tqarg(nofUnsolved).tqarg(wsc) );
}
void MergeResultWindow::slotAutoSolve()
@@ -974,7 +974,7 @@ void MergeResultWindow::slotAutoSolve()
int wsc;
int nofUnsolved = getNrOfUnsolvedConflicts(&wsc);
m_pStatusBar->message( i18n("Number of remaining unsolved conflicts: %1 (of which %2 are whitespace)")
- .arg(nofUnsolved).arg(wsc) );
+ .tqarg(nofUnsolved).tqarg(wsc) );
}
void MergeResultWindow::slotUnsolve()
@@ -986,10 +986,10 @@ void MergeResultWindow::slotUnsolve()
int wsc;
int nofUnsolved = getNrOfUnsolvedConflicts(&wsc);
m_pStatusBar->message( i18n("Number of remaining unsolved conflicts: %1 (of which %2 are whitespace)")
- .arg(nofUnsolved).arg(wsc) );
+ .tqarg(nofUnsolved).tqarg(wsc) );
}
-static QString calcHistoryLead(const QString& s )
+static TQString calcHistoryLead(const TQString& s )
{
// Return the start of the line until the first white char after the first non white char.
unsigned int i;
@@ -1010,10 +1010,10 @@ static QString calcHistoryLead(const QString& s )
return ""; // Must be an empty string, not a null string.
}
-static void findHistoryRange( const QRegExp& historyStart, bool bThreeFiles, const Diff3LineList* pD3LList,
+static void findHistoryRange( const TQRegExp& historyStart, bool bThreeFiles, const Diff3LineList* pD3LList,
Diff3LineList::const_iterator& iBegin, Diff3LineList::const_iterator& iEnd, int& idxBegin, int& idxEnd )
{
- QString historyLead;
+ TQString historyLead;
// Search for start of history
for( iBegin = pD3LList->begin(), idxBegin=0; iBegin!=pD3LList->end(); ++iBegin, ++idxBegin )
{
@@ -1028,9 +1028,9 @@ static void findHistoryRange( const QRegExp& historyStart, bool bThreeFiles, con
// Search for end of history
for( iEnd = iBegin, idxEnd = idxBegin; iEnd!=pD3LList->end(); ++iEnd, ++idxEnd )
{
- QString sA = iEnd->getString(A);
- QString sB = iEnd->getString(B);
- QString sC = iEnd->getString(C);
+ TQString sA = iEnd->getString(A);
+ TQString sB = iEnd->getString(B);
+ TQString sC = iEnd->getString(C);
if ( ! ((sA.isNull() || historyLead == calcHistoryLead(sA) ) &&
(sB.isNull() || historyLead == calcHistoryLead(sB) ) &&
(!bThreeFiles || sC.isNull() || historyLead == calcHistoryLead(sC) )
@@ -1041,7 +1041,7 @@ static void findHistoryRange( const QRegExp& historyStart, bool bThreeFiles, con
}
}
-bool findParenthesesGroups( const QString& s, QStringList& sl )
+bool findParenthesesGroups( const TQString& s, TQStringList& sl )
{
sl.clear();
int i=0;
@@ -1067,30 +1067,30 @@ bool findParenthesesGroups( const QString& s, QStringList& sl )
sl.push_back( s.mid( startPos+1, i-startPos-1 ) );
}
}
- return startPosStack.empty(); // false if parentheses don't match
+ return startPosStack.empty(); // false if tqparentheses don't match
}
-QString calcHistorySortKey( const QString& keyOrder, QRegExp& matchedRegExpr, const QStringList& parenthesesGroupList )
+TQString calcHistorySortKey( const TQString& keyOrder, TQRegExp& matchedRegExpr, const TQStringList& tqparenthesesGroupList )
{
- QStringList keyOrderList = QStringList::split(',', keyOrder );
- QString key;
- for ( QStringList::iterator keyIt = keyOrderList.begin(); keyIt!=keyOrderList.end(); ++keyIt )
+ TQStringList keyOrderList = TQStringList::split(',', keyOrder );
+ TQString key;
+ for ( TQStringList::iterator keyIt = keyOrderList.begin(); keyIt!=keyOrderList.end(); ++keyIt )
{
if ( (*keyIt).isEmpty() )
continue;
bool bOk=false;
int groupIdx = (*keyIt).toInt(&bOk);
- if (!bOk || groupIdx<0 || groupIdx >(int)parenthesesGroupList.size() )
+ if (!bOk || groupIdx<0 || groupIdx >(int)tqparenthesesGroupList.size() )
continue;
- QString s = matchedRegExpr.cap( groupIdx );
+ TQString s = matchedRegExpr.cap( groupIdx );
if ( groupIdx == 0 )
{
key += s + " ";
continue;
}
- QString groupRegExp = parenthesesGroupList[groupIdx-1];
- if( groupRegExp.find('|')<0 || groupRegExp.find('(')>=0 )
+ TQString groupRegExp = tqparenthesesGroupList[groupIdx-1];
+ if( groupRegExp.tqfind('|')<0 || groupRegExp.tqfind('(')>=0 )
{
bool bOk = false;
int i = s.toInt( &bOk );
@@ -1103,15 +1103,15 @@ QString calcHistorySortKey( const QString& keyOrder, QRegExp& matchedRegExpr, co
// Assume that the groupRegExp consists of something like "Jan|Feb|Mar|Apr"
// s is the string that managed to match.
// Now we want to know at which position it occurred. e.g. Jan=0, Feb=1, Mar=2, etc.
- QStringList sl = QStringList::split( '|', groupRegExp );
- int idx = sl.findIndex( s );
+ TQStringList sl = TQStringList::split( '|', groupRegExp );
+ int idx = sl.tqfindIndex( s );
if (idx<0)
{
// Didn't match
}
else
{
- QString sIdx;
+ TQString sIdx;
sIdx.sprintf("%02d", idx+1 ); // Up to 99 words in the groupRegExp (more than 12 aren't expected)
key += sIdx + " ";
}
@@ -1128,18 +1128,18 @@ void MergeResultWindow::collectHistoryInformation(
{
std::list< HistoryMap::iterator >::iterator itHitListFront = hitList.begin();
Diff3LineList::const_iterator id3l = iHistoryBegin;
- QString historyLead;
+ TQString historyLead;
{
const LineData* pld = id3l->getLineData(src);
- QString s( pld->pLine, pld->size );
+ TQString s( pld->pLine, pld->size );
historyLead = calcHistoryLead(s);
}
- QRegExp historyStart = m_pOptionDialog->m_historyStartRegExp;
+ TQRegExp historyStart = m_pOptionDialog->m_historyStartRegExp;
++id3l; // Skip line with "$Log ... $"
- QRegExp newHistoryEntry = m_pOptionDialog->m_historyEntryStartRegExp;
- QStringList parenthesesGroups;
- findParenthesesGroups( m_pOptionDialog->m_historyEntryStartRegExp, parenthesesGroups );
- QString key;
+ TQRegExp newHistoryEntry = m_pOptionDialog->m_historyEntryStartRegExp;
+ TQStringList tqparenthesesGroups;
+ findParenthesesGroups( m_pOptionDialog->m_historyEntryStartRegExp, tqparenthesesGroups );
+ TQString key;
MergeEditLineList melList;
bool bPrevLineIsEmpty = true;
bool bUseRegExp = !m_pOptionDialog->m_historyEntryStartRegExp.isEmpty();
@@ -1147,9 +1147,9 @@ void MergeResultWindow::collectHistoryInformation(
{
const LineData* pld = id3l->getLineData(src);
if ( !pld ) continue;
- QString s( pld->pLine, pld->size );
+ TQString s( pld->pLine, pld->size );
if (historyLead.isNull()) historyLead = calcHistoryLead(s);
- QString sLine = s.mid(historyLead.length());
+ TQString sLine = s.mid(historyLead.length());
if ( ( !bUseRegExp && !sLine.stripWhiteSpace().isEmpty() && bPrevLineIsEmpty )
|| bUseRegExp && newHistoryEntry.exactMatch( sLine )
)
@@ -1171,7 +1171,7 @@ void MergeResultWindow::collectHistoryInformation(
if ( ! bUseRegExp )
key = sLine;
else
- key = calcHistorySortKey(m_pOptionDialog->m_historyEntryStartSortKeyOrder,newHistoryEntry,parenthesesGroups);
+ key = calcHistorySortKey(m_pOptionDialog->m_historyEntryStartSortKeyOrder,newHistoryEntry,tqparenthesesGroups);
melList.clear();
melList.push_back( MergeEditLine(id3l,src) );
@@ -1330,7 +1330,7 @@ void MergeResultWindow::slotMergeHistory()
iMLLStart->mergeEditLineList.clear();
// Now insert the complete history into the first MergeLine of the history
iMLLStart->mergeEditLineList.push_back( MergeEditLine( iD3LHistoryBegin, m_pldC == 0 ? B : C ) );
- QString lead = calcHistoryLead( iD3LHistoryBegin->getString(A) );
+ TQString lead = calcHistoryLead( iD3LHistoryBegin->getString(A) );
MergeEditLine mel( m_pDiff3LineList->end() );
mel.setString( lead );
iMLLStart->mergeEditLineList.push_back(mel);
@@ -1376,7 +1376,7 @@ void MergeResultWindow::slotRegExpAutoMerge()
if ( m_pOptionDialog->m_autoMergeRegExp.isEmpty() )
return;
- QRegExp vcsKeywords = m_pOptionDialog->m_autoMergeRegExp;
+ TQRegExp vcsKeywords = m_pOptionDialog->m_autoMergeRegExp;
MergeLineList::iterator i;
for ( i=m_mergeLineList.begin(); i!=m_mergeLineList.end(); ++i )
{
@@ -1507,7 +1507,7 @@ void MergeResultWindow::myUpdate(int afterMilliSecs)
m_delayedDrawTimer = startTimer( afterMilliSecs );
}
-void MergeResultWindow::timerEvent(QTimerEvent*)
+void MergeResultWindow::timerEvent(TQTimerEvent*)
{
killTimer(m_delayedDrawTimer);
m_delayedDrawTimer = 0;
@@ -1527,14 +1527,14 @@ void MergeResultWindow::timerEvent(QTimerEvent*)
}
}
-QString MergeResultWindow::MergeEditLine::getString( const MergeResultWindow* mrw )
+TQString MergeResultWindow::MergeEditLine::getString( const MergeResultWindow* mrw )
{
- if ( isRemoved() ) { return QString(); }
+ if ( isRemoved() ) { return TQString(); }
if ( ! isModified() )
{
int src = m_src;
- if ( src == 0 ) { return QString(); }
+ if ( src == 0 ) { return TQString(); }
const Diff3Line& d3l = *m_id3l;
const LineData* pld = 0;
assert( src == A || src == B || src == C );
@@ -1545,10 +1545,10 @@ QString MergeResultWindow::MergeEditLine::getString( const MergeResultWindow* mr
if ( pld == 0 )
{
// assert(false); This is no error.
- return QString();
+ return TQString();
}
- return QString( pld->pLine, pld->size );
+ return TQString( pld->pLine, pld->size );
}
else
{
@@ -1558,7 +1558,7 @@ QString MergeResultWindow::MergeEditLine::getString( const MergeResultWindow* mr
}
/// Converts the cursor-posOnScreen into a text index, considering tabulators.
-int convertToPosInText( const QString& s, int posOnScreen, int tabSize )
+int convertToPosInText( const TQString& s, int posOnScreen, int tabSize )
{
int localPosOnScreen = 0;
int size=s.length();
@@ -1580,7 +1580,7 @@ int convertToPosInText( const QString& s, int posOnScreen, int tabSize )
/// Converts the index into the text to a cursor-posOnScreen considering tabulators.
-int convertToPosOnScreen( const QString& p, int posInText, int tabSize )
+int convertToPosOnScreen( const TQString& p, int posInText, int tabSize )
{
int posOnScreen = 0;
for ( int i=0; i<posInText; ++i )
@@ -1594,11 +1594,11 @@ int convertToPosOnScreen( const QString& p, int posInText, int tabSize )
}
void MergeResultWindow::writeLine(
- MyPainter& p, int line, const QString& str,
+ MyPainter& p, int line, const TQString& str,
int srcSelect, e_MergeDetails mergeDetails, int rangeMark, bool bUserModified, bool bLineRemoved, bool bWhiteSpaceConflict
)
{
- const QFontMetrics& fm = fontMetrics();
+ const TQFontMetrics& fm = fontMetrics();
int fontHeight = fm.height();
int fontWidth = fm.width("W");
int fontAscent = fm.ascent();
@@ -1612,7 +1612,7 @@ void MergeResultWindow::writeLine(
yOffset += topLineYOffset;
- QString srcName = " ";
+ TQString srcName = " ";
if ( bUserModified ) srcName = "m";
else if ( srcSelect == A && mergeDetails != eNoChange ) srcName = "A";
else if ( srcSelect == B ) srcName = "B";
@@ -1626,7 +1626,7 @@ void MergeResultWindow::writeLine(
if( (srcSelect > 0 || bUserModified ) && !bLineRemoved )
{
int outPos = 0;
- QString s;
+ TQString s;
int size = str.length();
for ( int i=0; i<size; ++i )
{
@@ -1661,12 +1661,12 @@ void MergeResultWindow::writeLine(
if( m_selection.lineWithin( line+1 ) )
p.fillRect( xOffset + fontWidth*(firstPosInLine2-m_firstColumn), yOffset,
- width(), fontHeight, colorGroup().highlight() );
+ width(), fontHeight, tqcolorGroup().highlight() );
else if ( lengthInLine2>0 )
p.fillRect( xOffset + fontWidth*(firstPosInLine2-m_firstColumn), yOffset,
- fontWidth*lengthInLine2, fontHeight, colorGroup().highlight() );
+ fontWidth*lengthInLine2, fontHeight, tqcolorGroup().highlight() );
- p.setPen( colorGroup().highlightedText() );
+ p.setPen( tqcolorGroup().highlightedText() );
p.drawText( xOffset + fontWidth*(firstPosInLine2-m_firstColumn), yOffset+fontAscent,
s.mid(firstPosInLine2,lengthInLine2), true );
}
@@ -1745,12 +1745,12 @@ void MergeResultWindow::setPaintingAllowed(bool bPaintingAllowed)
}
}
-void MergeResultWindow::paintEvent( QPaintEvent* )
+void MergeResultWindow::paintEvent( TQPaintEvent* )
{
if (m_pDiff3LineList==0 || !m_bPaintingAllowed) return;
bool bOldSelectionContainsData = m_selection.bSelectionContainsData;
- const QFontMetrics& fm = fontMetrics();
+ const TQFontMetrics& fm = fontMetrics();
int fontHeight = fm.height();
int fontWidth = fm.width("W");
int fontAscent = fm.ascent();
@@ -1761,9 +1761,9 @@ void MergeResultWindow::paintEvent( QPaintEvent* )
if ( size() != m_pixmap.size() )
m_pixmap.resize(size());
- MyPainter p(&m_pixmap, m_pOptionDialog->m_bRightToLeftLanguage, width(), fontWidth);
+ MyPainter p(TQT_TQPAINTDEVICE(&m_pixmap), m_pOptionDialog->m_bRightToLeftLanguage, width(), fontWidth);
p.setFont( font() );
- p.QPainter::fillRect( rect(), m_pOptionDialog->m_bgColor );
+ p.TQPainter::fillRect( rect(), m_pOptionDialog->m_bgColor );
//int visibleLines = height() / fontHeight;
@@ -1795,7 +1795,7 @@ void MergeResultWindow::paintEvent( QPaintEvent* )
if ( mlIt == m_currentMergeLineIt ) rangeMark |= 4; // Mark of the current line
- QString s;
+ TQString s;
s = mel.getString( this );
if ( convertToPosOnScreen(s,s.length(),m_pOptionDialog->m_tabSize) >nofColumns)
nofColumns = s.length();
@@ -1820,7 +1820,7 @@ void MergeResultWindow::paintEvent( QPaintEvent* )
p.end();
}
- QPainter painter(this);
+ TQPainter painter(this);
int topLineYOffset = 0;
int xOffset = fontWidth * leftInfoWidth;
@@ -1843,7 +1843,7 @@ void MergeResultWindow::paintEvent( QPaintEvent* )
if ( m_bCursorOn && hasFocus() && m_cursorYPos>=m_firstLine )
{
- MyPainter painter(this, m_pOptionDialog->m_bRightToLeftLanguage, width(), fontWidth);
+ MyPainter painter(TQT_TQPAINTDEVICE(this), m_pOptionDialog->m_bRightToLeftLanguage, width(), fontWidth);
int topLineYOffset = 0;
int xOffset = fontWidth * leftInfoWidth;
@@ -1898,15 +1898,15 @@ void MergeResultWindow::updateSourceMask()
emit sourceMask( srcMask, enabledMask );
}
-void MergeResultWindow::focusInEvent( QFocusEvent* e )
+void MergeResultWindow::focusInEvent( TQFocusEvent* e )
{
updateSourceMask();
- QWidget::focusInEvent(e);
+ TQWidget::focusInEvent(e);
}
void MergeResultWindow::convertToLinePos( int x, int y, int& line, int& pos )
{
- const QFontMetrics& fm = fontMetrics();
+ const TQFontMetrics& fm = fontMetrics();
int fontHeight = fm.height();
int fontWidth = fm.width('W');
int xOffset = (leftInfoWidth-m_firstColumn)*fontWidth;
@@ -1921,7 +1921,7 @@ void MergeResultWindow::convertToLinePos( int x, int y, int& line, int& pos )
pos = ( (width() - 1 - x) - xOffset ) / fontWidth;
}
-void MergeResultWindow::mousePressEvent ( QMouseEvent* e )
+void MergeResultWindow::mousePressEvent ( TQMouseEvent* e )
{
m_bCursorOn = true;
@@ -1956,14 +1956,14 @@ void MergeResultWindow::mousePressEvent ( QMouseEvent* e )
if (bRMB)
{
- showPopupMenu( QCursor::pos() );
+ showPopupMenu( TQCursor::pos() );
}
}
else if ( bLMB ) // Normal cursor placement
{
pos = max2(pos,0);
line = max2(line,0);
- if ( e->state() & Qt::ShiftButton )
+ if ( e->state() & TQt::ShiftButton )
{
if (m_selection.firstLine==-1)
m_selection.start( line, pos );
@@ -1997,7 +1997,7 @@ void MergeResultWindow::mousePressEvent ( QMouseEvent* e )
}
}
-void MergeResultWindow::mouseDoubleClickEvent( QMouseEvent* e )
+void MergeResultWindow::mouseDoubleClickEvent( TQMouseEvent* e )
{
if ( e->button() == Qt::LeftButton )
{
@@ -2013,7 +2013,7 @@ void MergeResultWindow::mouseDoubleClickEvent( QMouseEvent* e )
MergeLineList::iterator mlIt;
MergeEditLineList::iterator melIt;
calcIteratorFromLineNr( line, mlIt, melIt );
- QString s = melIt->getString( this );
+ TQString s = melIt->getString( this );
if ( !s.isEmpty() )
{
@@ -2031,7 +2031,7 @@ void MergeResultWindow::mouseDoubleClickEvent( QMouseEvent* e )
}
}
-void MergeResultWindow::mouseReleaseEvent ( QMouseEvent * e )
+void MergeResultWindow::mouseReleaseEvent ( TQMouseEvent * e )
{
if ( e->button() == Qt::LeftButton )
{
@@ -2045,7 +2045,7 @@ void MergeResultWindow::mouseReleaseEvent ( QMouseEvent * e )
}
}
-void MergeResultWindow::mouseMoveEvent ( QMouseEvent * e )
+void MergeResultWindow::mouseMoveEvent ( TQMouseEvent * e )
{
int line;
int pos;
@@ -2061,7 +2061,7 @@ void MergeResultWindow::mouseMoveEvent ( QMouseEvent * e )
//showStatusLine( line, m_winIdx, m_pFilename, m_pDiff3LineList, m_pStatusBar );
// Scroll because mouse moved out of the window
- const QFontMetrics& fm = fontMetrics();
+ const TQFontMetrics& fm = fontMetrics();
int fontWidth = fm.width('W');
int topLineYOffset = 0;
int deltaX=0;
@@ -2097,7 +2097,7 @@ void MergeResultWindow::slotCursorUpdate()
{
m_bCursorUpdate = true;
- const QFontMetrics& fm = fontMetrics();
+ const TQFontMetrics& fm = fontMetrics();
int fontWidth = fm.width("W");
int topLineYOffset = 0;
int xOffset = fontWidth * leftInfoWidth;
@@ -2105,9 +2105,9 @@ void MergeResultWindow::slotCursorUpdate()
int xCursor = ( m_cursorXPos - m_firstColumn ) * fontWidth + xOffset;
if (!m_pOptionDialog->m_bRightToLeftLanguage)
- repaint( xCursor-2, yOffset, 5, fm.ascent()+2 );
+ tqrepaint( xCursor-2, yOffset, 5, fm.ascent()+2 );
else
- repaint( width()-1-4-(xCursor-2), yOffset, 5, fm.ascent()+2 );
+ tqrepaint( width()-1-4-(xCursor-2), yOffset, 5, fm.ascent()+2 );
m_bCursorUpdate=false;
}
@@ -2116,28 +2116,28 @@ void MergeResultWindow::slotCursorUpdate()
}
-void MergeResultWindow::wheelEvent( QWheelEvent* e )
+void MergeResultWindow::wheelEvent( TQWheelEvent* e )
{
- int d = -e->delta()*QApplication::wheelScrollLines()/120;
+ int d = -e->delta()*TQApplication::wheelScrollLines()/120;
e->accept();
scroll( 0, min2(d, getNofVisibleLines()) );
}
-void MergeResultWindow::keyPressEvent( QKeyEvent* e )
+void MergeResultWindow::keyPressEvent( TQKeyEvent* e )
{
int y = m_cursorYPos;
MergeLineList::iterator mlIt;
MergeEditLineList::iterator melIt;
calcIteratorFromLineNr( y, mlIt, melIt );
- QString str = melIt->getString( this );
+ TQString str = melIt->getString( this );
int x = convertToPosInText( str, m_cursorXPos, m_pOptionDialog->m_tabSize );
- bool bCtrl = ( e->state() & Qt::ControlButton ) != 0 ;
- bool bShift = ( e->state() & Qt::ShiftButton ) != 0 ;
+ bool bCtrl = ( e->state() & TQt::ControlButton ) != 0 ;
+ bool bShift = ( e->state() & TQt::ShiftButton ) != 0 ;
#ifdef _WIN32
- bool bAlt = ( e->state() & Qt::AltButton ) != 0 ;
+ bool bAlt = ( e->state() & TQt::AltButton ) != 0 ;
if ( bCtrl && bAlt ){ bCtrl=false; bAlt=false; } // AltGr-Key pressed.
#endif
@@ -2145,10 +2145,10 @@ void MergeResultWindow::keyPressEvent( QKeyEvent* e )
// Special keys
switch ( e->key() )
{
- case Qt::Key_Escape: break;
+ case TQt::Key_Escape: break;
//case Key_Tab: break;
- case Qt::Key_Backtab: break;
- case Qt::Key_Delete:
+ case TQt::Key_Backtab: break;
+ case TQt::Key_Delete:
{
if ( deleteSelection2( str, x, y, mlIt, melIt )) break;
if( !melIt->isEditableText() ) break;
@@ -2162,7 +2162,7 @@ void MergeResultWindow::keyPressEvent( QKeyEvent* e )
calcIteratorFromLineNr( y+1, mlIt1, melIt1 );
if ( melIt1->isEditableText() )
{
- QString s2 = melIt1->getString( this );
+ TQString s2 = melIt1->getString( this );
melIt->setString( str + s2 );
// Remove the line
@@ -2175,14 +2175,14 @@ void MergeResultWindow::keyPressEvent( QKeyEvent* e )
}
else
{
- QString s = str.left(x);
+ TQString s = str.left(x);
s += str.mid( x+1 );
melIt->setString( s );
setModified();
}
break;
}
- case Qt::Key_Backspace:
+ case TQt::Key_Backspace:
{
if ( deleteSelection2( str, x, y, mlIt, melIt )) break;
if( !melIt->isEditableText() ) break;
@@ -2196,7 +2196,7 @@ void MergeResultWindow::keyPressEvent( QKeyEvent* e )
calcIteratorFromLineNr( y-1, mlIt1, melIt1 );
if ( melIt1->isEditableText() )
{
- QString s1 = melIt1->getString( this );
+ TQString s1 = melIt1->getString( this );
melIt1->setString( s1 + str );
// Remove the previous line
@@ -2212,7 +2212,7 @@ void MergeResultWindow::keyPressEvent( QKeyEvent* e )
}
else
{
- QString s = str.left( x-1 );
+ TQString s = str.left( x-1 );
s += str.mid( x );
--x;
melIt->setString( s );
@@ -2220,19 +2220,19 @@ void MergeResultWindow::keyPressEvent( QKeyEvent* e )
}
break;
}
- case Qt::Key_Return:
- case Qt::Key_Enter:
+ case TQt::Key_Return:
+ case TQt::Key_Enter:
{
if( !melIt->isEditableText() ) break;
deleteSelection2( str, x, y, mlIt, melIt );
setModified();
- QString indentation;
+ TQString indentation;
if ( m_pOptionDialog->m_bAutoIndentation )
{ // calc last indentation
MergeLineList::iterator mlIt1 = mlIt;
MergeEditLineList::iterator melIt1 = melIt;
for(;;) {
- const QString s = melIt1->getString(this);
+ const TQString s = melIt1->getString(this);
if ( !s.isEmpty() ) {
unsigned int i;
for( i=0; i<s.length(); ++i ){ if(s[i]!=' ' && s[i]!='\t') break; }
@@ -2259,7 +2259,7 @@ void MergeResultWindow::keyPressEvent( QKeyEvent* e )
if ( x<(int)str.length() ) // Cut off the old line.
{
// Since ps possibly points into melIt->str, first copy it into a temporary.
- QString temp = str.left(x);
+ TQString temp = str.left(x);
melIt->setString( temp );
}
@@ -2269,16 +2269,16 @@ void MergeResultWindow::keyPressEvent( QKeyEvent* e )
++y;
break;
}
- case Qt::Key_Insert: m_bInsertMode = !m_bInsertMode; break;
- case Qt::Key_Pause: break;
- case Qt::Key_Print: break;
- case Qt::Key_SysReq: break;
- case Qt::Key_Home: x=0; if(bCtrl){y=0; } break; // cursor movement
- case Qt::Key_End: x=INT_MAX; if(bCtrl){y=INT_MAX;} break;
+ case TQt::Key_Insert: m_bInsertMode = !m_bInsertMode; break;
+ case TQt::Key_Pause: break;
+ case TQt::Key_Print: break;
+ case TQt::Key_SysReq: break;
+ case TQt::Key_Home: x=0; if(bCtrl){y=0; } break; // cursor movement
+ case TQt::Key_End: x=INT_MAX; if(bCtrl){y=INT_MAX;} break;
- case Qt::Key_Left:
- case Qt::Key_Right:
- if ( (e->key()==Qt::Key_Left) ^ m_pOptionDialog->m_bRightToLeftLanguage ) // operator^: XOR
+ case TQt::Key_Left:
+ case TQt::Key_Right:
+ if ( (e->key()==TQt::Key_Left) ^ m_pOptionDialog->m_bRightToLeftLanguage ) // operator^: XOR
{
if ( !bCtrl )
{
@@ -2306,13 +2306,13 @@ void MergeResultWindow::keyPressEvent( QKeyEvent* e )
}
break;
- case Qt::Key_Up: if (!bCtrl){ --y; bYMoveKey=true; } break;
- case Qt::Key_Down: if (!bCtrl){ ++y; bYMoveKey=true; } break;
- case Qt::Key_PageUp: if (!bCtrl){ y-=getNofVisibleLines(); bYMoveKey=true; } break;
- case Qt::Key_PageDown: if (!bCtrl){ y+=getNofVisibleLines(); bYMoveKey=true; } break;
+ case TQt::Key_Up: if (!bCtrl){ --y; bYMoveKey=true; } break;
+ case TQt::Key_Down: if (!bCtrl){ ++y; bYMoveKey=true; } break;
+ case TQt::Key_PageUp: if (!bCtrl){ y-=getNofVisibleLines(); bYMoveKey=true; } break;
+ case TQt::Key_PageDown: if (!bCtrl){ y+=getNofVisibleLines(); bYMoveKey=true; } break;
default:
{
- QString t = e->text();
+ TQString t = e->text();
if( t.isEmpty() || bCtrl )
{ e->ignore(); return; }
else
@@ -2328,7 +2328,7 @@ void MergeResultWindow::keyPressEvent( QKeyEvent* e )
setModified();
// Characters to insert
- QString s=str;
+ TQString s=str;
if ( t[0]=='\t' && m_pOptionDialog->m_bReplaceTabs )
{
int spaces = (m_cursorXPos / m_pOptionDialog->m_tabSize + 1)*m_pOptionDialog->m_tabSize - m_cursorXPos;
@@ -2337,7 +2337,7 @@ void MergeResultWindow::keyPressEvent( QKeyEvent* e )
if ( m_bInsertMode )
s.insert( x, t );
else
- s.replace( x, t.length(), t );
+ s.tqreplace( x, t.length(), t );
melIt->setString( s );
x += t.length();
@@ -2425,9 +2425,9 @@ void MergeResultWindow::calcIteratorFromLineNr(
}
-QString MergeResultWindow::getSelection()
+TQString MergeResultWindow::getSelection()
{
- QString selectionString;
+ TQString selectionString;
int line = 0;
MergeLineList::iterator mlIt = m_mergeLineList.begin();
@@ -2444,7 +2444,7 @@ QString MergeResultWindow::getSelection()
int outPos = 0;
if (mel.isEditableText())
{
- const QString str = mel.getString( this );
+ const TQString str = mel.getString( this );
// Consider tabs
@@ -2485,7 +2485,7 @@ QString MergeResultWindow::getSelection()
return selectionString;
}
-bool MergeResultWindow::deleteSelection2( QString& s, int& x, int& y,
+bool MergeResultWindow::deleteSelection2( TQString& s, int& x, int& y,
MergeLineList::iterator& mlIt, MergeEditLineList::iterator& melIt )
{
if (m_selection.firstLine!=-1 && m_selection.bSelectionContainsData )
@@ -2511,7 +2511,7 @@ void MergeResultWindow::deleteSelection()
int line = 0;
MergeLineList::iterator mlItFirst;
MergeEditLineList::iterator melItFirst;
- QString firstLineString;
+ TQString firstLineString;
int firstLine = -1;
int lastLine = -1;
@@ -2554,7 +2554,7 @@ void MergeResultWindow::deleteSelection()
if ( mel.isEditableText() && m_selection.lineWithin(line) )
{
- QString lineString = mel.getString( this );
+ TQString lineString = mel.getString( this );
int firstPosInLine = m_selection.firstPosInLine(line);
int lastPosInLine = m_selection.lastPosInLine(line);
@@ -2610,21 +2610,21 @@ void MergeResultWindow::pasteClipboard( bool bFromSelection )
calcIteratorFromLineNr( y, mlIt, melIt );
melItAfter = melIt;
++melItAfter;
- QString str = melIt->getString( this );
+ TQString str = melIt->getString( this );
int x = convertToPosInText( str, m_cursorXPos, m_pOptionDialog->m_tabSize );
- if ( !QApplication::clipboard()->supportsSelection() )
+ if ( !TQApplication::tqclipboard()->supportsSelection() )
bFromSelection = false;
- QString clipBoard = QApplication::clipboard()->text( bFromSelection ? QClipboard::Selection : QClipboard::Clipboard );
+ TQString clipBoard = TQApplication::tqclipboard()->text( bFromSelection ? TQClipboard::Selection : TQClipboard::Clipboard );
- QString currentLine = str.left(x);
- QString endOfLine = str.mid(x);
+ TQString currentLine = str.left(x);
+ TQString endOfLine = str.mid(x);
int i;
int len = clipBoard.length();
for( i=0; i<len; ++i )
{
- QChar c = clipBoard[i];
+ TQChar c = clipBoard[i];
if ( c == '\r' ) continue;
if ( c == '\n' )
{
@@ -2668,7 +2668,7 @@ void MergeResultWindow::setModified(bool bModified)
}
/// Saves and returns true when successful.
-bool MergeResultWindow::saveDocument( const QString& fileName, QTextCodec* pEncoding )
+bool MergeResultWindow::saveDocument( const TQString& fileName, TQTextCodec* pEncoding )
{
// Are still conflicts somewhere?
if ( getNrOfUnsolvedConflicts()>0 )
@@ -2693,8 +2693,8 @@ bool MergeResultWindow::saveDocument( const QString& fileName, QTextCodec* pEnco
}
}
- QByteArray dataArray;
- QTextStream textOutStream(dataArray, IO_WriteOnly);
+ TQByteArray dataArray;
+ TQTextStream textOutStream(dataArray, IO_WriteOnly);
textOutStream.setCodec( pEncoding );
int line = 0;
@@ -2709,7 +2709,7 @@ bool MergeResultWindow::saveDocument( const QString& fileName, QTextCodec* pEnco
if ( mel.isEditableText() )
{
- QString str = mel.getString( this );
+ TQString str = mel.getString( this );
if (line>0) // Prepend line feed, but not for first line
{
@@ -2737,16 +2737,16 @@ bool MergeResultWindow::saveDocument( const QString& fileName, QTextCodec* pEnco
return true;
}
-QString MergeResultWindow::getString( int lineIdx )
+TQString MergeResultWindow::getString( int lineIdx )
{
MergeResultWindow::MergeLineList::iterator mlIt;
MergeResultWindow::MergeEditLineList::iterator melIt;
calcIteratorFromLineNr( lineIdx, mlIt, melIt );
- QString s = melIt->getString( this );
+ TQString s = melIt->getString( this );
return s;
}
-bool MergeResultWindow::findString( const QString& s, int& d3vLine, int& posInLine, bool bDirDown, bool bCaseSensitive )
+bool MergeResultWindow::findString( const TQString& s, int& d3vLine, int& posInLine, bool bDirDown, bool bCaseSensitive )
{
int it = d3vLine;
int endIt = bDirDown ? getNofLines() : -1;
@@ -2755,10 +2755,10 @@ bool MergeResultWindow::findString( const QString& s, int& d3vLine, int& posInLi
for( ; it!=endIt; it+=step )
{
- QString line = getString( it );
+ TQString line = getString( it );
if ( !line.isEmpty() )
{
- int pos = line.find( s, startPos, bCaseSensitive );
+ int pos = line.tqfind( s, startPos, bCaseSensitive );
if ( pos != -1 )
{
d3vLine = it;
@@ -2777,7 +2777,7 @@ void MergeResultWindow::setSelection( int firstLine, int startPos, int lastLine,
if ( lastLine >= getNofLines() )
{
lastLine = getNofLines()-1;
- QString s = getString( lastLine );
+ TQString s = getString( lastLine );
endPos = s.length();
}
m_selection.reset();
@@ -2786,8 +2786,8 @@ void MergeResultWindow::setSelection( int firstLine, int startPos, int lastLine,
update();
}
-Overview::Overview( QWidget* pParent, OptionDialog* pOptions )
-: QWidget( pParent, 0, WRepaintNoErase )
+Overview::Overview( TQWidget* pParent, OptionDialog* pOptions )
+: TQWidget( pParent, 0, WRepaintNoErase )
{
m_pDiff3LineList = 0;
m_pOptions = pOptions;
@@ -2802,7 +2802,7 @@ void Overview::init( Diff3LineList* pDiff3LineList, bool bTripleDiff )
{
m_pDiff3LineList = pDiff3LineList;
m_bTripleDiff = bTripleDiff;
- m_pixmap.resize( QSize(0,0) ); // make sure that a redraw happens
+ m_pixmap.resize( TQSize(0,0) ); // make sure that a redraw happens
update();
}
@@ -2813,7 +2813,7 @@ void Overview::reset()
void Overview::slotRedraw()
{
- m_pixmap.resize( QSize(0,0) ); // make sure that a redraw happens
+ m_pixmap.resize( TQSize(0,0) ); // make sure that a redraw happens
update();
}
@@ -2840,7 +2840,7 @@ Overview::e_OverviewMode Overview::getOverviewMode()
return m_eOverviewMode;
}
-void Overview::mousePressEvent( QMouseEvent* e )
+void Overview::mousePressEvent( TQMouseEvent* e )
{
int h = height()-1;
int h1 = h * m_pageHeight / max2(1,m_nofLines)+3;
@@ -2848,7 +2848,7 @@ void Overview::mousePressEvent( QMouseEvent* e )
emit setLine( ( e->y() - h1/2 )*m_nofLines/h );
}
-void Overview::mouseMoveEvent( QMouseEvent* e )
+void Overview::mouseMoveEvent( TQMouseEvent* e )
{
mousePressEvent(e);
}
@@ -2863,9 +2863,9 @@ void Overview::setPaintingAllowed( bool bAllowPainting )
}
}
-void Overview::drawColumn( QPainter& p, e_OverviewMode eOverviewMode, int x, int w, int h, int nofLines )
+void Overview::drawColumn( TQPainter& p, e_OverviewMode eOverviewMode, int x, int w, int h, int nofLines )
{
- p.setPen(Qt::black);
+ p.setPen(TQt::black);
p.drawLine( x, 0, x, h );
if (nofLines==0) return;
@@ -2885,7 +2885,7 @@ void Overview::drawColumn( QPainter& p, e_OverviewMode eOverviewMode, int x, int
int src;
mergeOneLine( d3l, md, bConflict, bLineRemoved, src, !m_bTripleDiff );
- QColor c = m_pOptions->m_bgColor;
+ TQColor c = m_pOptions->m_bgColor;
bool bWhiteSpaceChange = false;
//if( bConflict ) c=m_pOptions->m_colorForConflict;
//else
@@ -2972,12 +2972,12 @@ void Overview::drawColumn( QPainter& p, e_OverviewMode eOverviewMode, int x, int
// Make sure that lines with conflict are not overwritten.
if ( c == m_pOptions->m_colorForConflict )
{
- p.fillRect(x+1, oldY, w, max2(1,y-oldY), bWhiteSpaceChange ? QBrush(c,Qt::Dense4Pattern) : QBrush(c) );
+ p.fillRect(x+1, oldY, w, max2(1,y-oldY), bWhiteSpaceChange ? TQBrush(c,TQt::Dense4Pattern) : TQBrush(c) );
oldConflictY = oldY;
}
else if ( c!=m_pOptions->m_bgColor && oldY>oldConflictY )
{
- p.fillRect(x+1, oldY, w, max2(1,y-oldY), bWhiteSpaceChange ? QBrush(c,Qt::Dense4Pattern) : QBrush(c) );
+ p.fillRect(x+1, oldY, w, max2(1,y-oldY), bWhiteSpaceChange ? TQBrush(c,TQt::Dense4Pattern) : TQBrush(c) );
}
}
@@ -3000,7 +3000,7 @@ void Overview::drawColumn( QPainter& p, e_OverviewMode eOverviewMode, int x, int
}
}
-void Overview::paintEvent( QPaintEvent* )
+void Overview::paintEvent( TQPaintEvent* )
{
if (m_pDiff3LineList==0 || !m_bPaintingAllowed ) return;
int h = height()-1;
@@ -3025,7 +3025,7 @@ void Overview::paintEvent( QPaintEvent* )
m_pixmap.resize( size() );
- QPainter p(&m_pixmap);
+ TQPainter p(&m_pixmap);
p.fillRect( rect(), m_pOptions->m_bgColor );
if ( !m_bTripleDiff || m_eOverviewMode == eOMNormal )
@@ -3039,75 +3039,75 @@ void Overview::paintEvent( QPaintEvent* )
}
}
- QPainter painter( this );
+ TQPainter painter( this );
painter.drawPixmap( 0,0, m_pixmap );
int y1 = h * m_firstLine / m_nofLines-1;
int h1 = h * m_pageHeight / m_nofLines+3;
- painter.setPen(Qt::black);
+ painter.setPen(TQt::black);
painter.drawRect( 1, y1, w-1, h1 );
}
-WindowTitleWidget::WindowTitleWidget(OptionDialog* pOptionDialog, QWidget* pParent)
-:QWidget(pParent)
+WindowTitleWidget::WindowTitleWidget(OptionDialog* pOptionDialog, TQWidget* pParent)
+:TQWidget(pParent)
{
m_pOptionDialog = pOptionDialog;
//setAutoFillBackground(true);
- QHBoxLayout* pHLayout = new QHBoxLayout(this);
+ TQHBoxLayout* pHLayout = new TQHBoxLayout(this);
pHLayout->setMargin(2);
pHLayout->setSpacing(2);
- m_pLabel = new QLabel(i18n("Output")+":", this);
+ m_pLabel = new TQLabel(i18n("Output")+":", this);
pHLayout->addWidget( m_pLabel );
- m_pFileNameLineEdit = new QLineEdit(this);
+ m_pFileNameLineEdit = new TQLineEdit(this);
pHLayout->addWidget( m_pFileNameLineEdit, 6 );
m_pFileNameLineEdit->installEventFilter( this );
m_pFileNameLineEdit->setReadOnly( true );
- //m_pBrowseButton = new QPushButton("...");
+ //m_pBrowseButton = new TQPushButton("...");
//pHLayout->addWidget( m_pBrowseButton, 0 );
- //connect( m_pBrowseButton, SIGNAL(clicked()), this, SLOT(slotBrowseButtonClicked()));
+ //connect( m_pBrowseButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotBrowseButtonClicked()));
- m_pModifiedLabel = new QLabel(i18n("[Modified]"),this);
+ m_pModifiedLabel = new TQLabel(i18n("[Modified]"),this);
pHLayout->addWidget( m_pModifiedLabel );
- m_pModifiedLabel->setMinimumSize( m_pModifiedLabel->sizeHint() );
+ m_pModifiedLabel->setMinimumSize( m_pModifiedLabel->tqsizeHint() );
m_pModifiedLabel->setText("");
pHLayout->addStretch(1);
- m_pEncodingLabel = new QLabel(i18n("Encoding for saving")+":",this);
+ m_pEncodingLabel = new TQLabel(i18n("Encoding for saving")+":",this);
pHLayout->addWidget( m_pEncodingLabel );
- m_pEncodingSelector = new QComboBox(this);
+ m_pEncodingSelector = new TQComboBox(this);
pHLayout->addWidget( m_pEncodingSelector, 3 );
setEncodings(0,0,0);
}
-void WindowTitleWidget::setFileName( const QString& fileName )
+void WindowTitleWidget::setFileName( const TQString& fileName )
{
- m_pFileNameLineEdit->setText( QDir::convertSeparators(fileName) );
+ m_pFileNameLineEdit->setText( TQDir::convertSeparators(fileName) );
}
-QString WindowTitleWidget::getFileName()
+TQString WindowTitleWidget::getFileName()
{
return m_pFileNameLineEdit->text();
}
-void WindowTitleWidget::setEncodings( QTextCodec* pCodecForA, QTextCodec* pCodecForB, QTextCodec* pCodecForC )
+void WindowTitleWidget::setEncodings( TQTextCodec* pCodecForA, TQTextCodec* pCodecForB, TQTextCodec* pCodecForC )
{
m_pEncodingSelector->clear();
m_codecMap.clear();
// First sort codec names:
- std::map<QString, QTextCodec*> names;
+ std::map<TQString, TQTextCodec*> names;
int i;
for(i=0;;++i)
{
- QTextCodec* c = QTextCodec::codecForIndex(i);
+ TQTextCodec* c = TQTextCodec::codecForIndex(i);
if ( c==0 ) break;
- else names[QString(c->name())]=c;
+ else names[TQString(c->name())]=c;
}
i=0;
@@ -3130,14 +3130,14 @@ void WindowTitleWidget::setEncodings( QTextCodec* pCodecForA, QTextCodec* pCodec
++i;
}
- std::map<QString, QTextCodec*>::iterator it;
+ std::map<TQString, TQTextCodec*>::iterator it;
for(it=names.begin();it!=names.end();++it)
{
m_pEncodingSelector->insertItem( it->first, i );
m_codecMap[i]=it->second;
++i;
}
- m_pEncodingSelector->setMinimumSize( m_pEncodingSelector->sizeHint() );
+ m_pEncodingSelector->setMinimumSize( m_pEncodingSelector->tqsizeHint() );
if ( pCodecForC && pCodecForB && pCodecForA )
{
@@ -3154,19 +3154,19 @@ void WindowTitleWidget::setEncodings( QTextCodec* pCodecForA, QTextCodec* pCodec
m_pEncodingSelector->setCurrentItem( 0 );
}
-QTextCodec* WindowTitleWidget::getEncoding()
+TQTextCodec* WindowTitleWidget::getEncoding()
{
return m_codecMap[ m_pEncodingSelector->currentItem() ];
}
-void WindowTitleWidget::setEncoding(QTextCodec* pEncoding)
+void WindowTitleWidget::setEncoding(TQTextCodec* pEncoding)
{
- m_pEncodingSelector->setCurrentText( QString( pEncoding->name() ) );
+ m_pEncodingSelector->setCurrentText( TQString( pEncoding->name() ) );
}
//void WindowTitleWidget::slotBrowseButtonClicked()
//{
-// QString current = m_pFileNameLineEdit->text();
+// TQString current = m_pFileNameLineEdit->text();
//
// KURL newURL = KFileDialog::getSaveURL( current, 0, this, i18n("Select file (not saving yet)"));
// if ( !newURL.isEmpty() )
@@ -3180,38 +3180,38 @@ void WindowTitleWidget::slotSetModified( bool bModified )
m_pModifiedLabel->setText( bModified ? i18n("[Modified]") : "" );
}
-bool WindowTitleWidget::eventFilter( QObject* o, QEvent* e )
+bool WindowTitleWidget::eventFilter( TQObject* o, TQEvent* e )
{
- if ( e->type()==QEvent::FocusIn || e->type()==QEvent::FocusOut )
+ if ( e->type()==TQEvent::FocusIn || e->type()==TQEvent::FocusOut )
{
- QPalette p = m_pLabel->palette();
+ TQPalette p = m_pLabel->palette();
- QColor c1 = m_pOptionDialog->m_fgColor;
- QColor c2 = Qt::lightGray;
- if ( e->type()==QEvent::FocusOut )
+ TQColor c1 = m_pOptionDialog->m_fgColor;
+ TQColor c2 = TQt::lightGray;
+ if ( e->type()==TQEvent::FocusOut )
c2 = m_pOptionDialog->m_bgColor;
- p.setColor(QColorGroup::Background, c2);
+ p.setColor(TQColorGroup::Background, c2);
setPalette( p );
- p.setColor(QColorGroup::Foreground, c1);
+ p.setColor(TQColorGroup::Foreground, c1);
m_pLabel->setPalette( p );
m_pEncodingLabel->setPalette( p );
m_pEncodingSelector->setPalette( p );
}
- if (o == m_pFileNameLineEdit && e->type()==QEvent::Drop)
+ if (TQT_BASE_OBJECT(o) == TQT_BASE_OBJECT(m_pFileNameLineEdit) && e->type()==TQEvent::Drop)
{
- QDropEvent* d = static_cast<QDropEvent*>(e);
+ TQDropEvent* d = static_cast<TQDropEvent*>(e);
- if ( QUriDrag::canDecode( d ) )
+ if ( TQUriDrag::canDecode( d ) )
{
- QStringList lst;
- QUriDrag::decodeLocalFiles( d, lst );
+ TQStringList lst;
+ TQUriDrag::decodeLocalFiles( d, lst );
if ( lst.count() > 0 )
{
- static_cast<QLineEdit*>(o)->setText( lst[0] );
- static_cast<QLineEdit*>(o)->setFocus();
+ static_cast<TQLineEdit*>(TQT_TQWIDGET(o))->setText( lst[0] );
+ static_cast<TQLineEdit*>(TQT_TQWIDGET(o))->setFocus();
return true;
}
}