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