|
|
|
@ -235,14 +235,14 @@ bool KDiff3App::runDiff( const LineData* p1, int size1, const LineData* p2, int
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void KDiff3App::init( bool bAuto, TotalDifftqStatus* pTotalDifftqStatus, bool bLoadFiles )
|
|
|
|
|
void KDiff3App::init( bool bAuto, TotalDiffStatus* pTotalDiffStatus, bool bLoadFiles )
|
|
|
|
|
{
|
|
|
|
|
ProgressProxy pp;
|
|
|
|
|
// When doing a full analysis in the directory-comparison, then the statistics-results
|
|
|
|
|
// will be stored in the given TotalDifftqStatus. Otherwise it will be 0.
|
|
|
|
|
bool bGUI = pTotalDifftqStatus == 0;
|
|
|
|
|
if (pTotalDifftqStatus==0)
|
|
|
|
|
pTotalDifftqStatus = &m_totalDifftqStatus;
|
|
|
|
|
// will be stored in the given TotalDiffStatus. Otherwise it will be 0.
|
|
|
|
|
bool bGUI = pTotalDiffStatus == 0;
|
|
|
|
|
if (pTotalDiffStatus==0)
|
|
|
|
|
pTotalDiffStatus = &m_totalDiffStatus;
|
|
|
|
|
|
|
|
|
|
bool bPreserveCarriageReturn = m_pOptionDialog->m_bPreserveCarriageReturn;
|
|
|
|
|
|
|
|
|
@ -310,11 +310,11 @@ void KDiff3App::init( bool bAuto, TotalDifftqStatus* pTotalDifftqStatus, bool bL
|
|
|
|
|
pp.setMaxNofSteps( 6 ); // 3 comparisons, 3 finediffs
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
pTotalDifftqStatus->reset();
|
|
|
|
|
pTotalDiffStatus->reset();
|
|
|
|
|
// Run the diff.
|
|
|
|
|
if ( m_sd3.isEmpty() )
|
|
|
|
|
{
|
|
|
|
|
pTotalDifftqStatus->bBinaryAEqB = m_sd1.isBinaryEqualWith( m_sd2 );
|
|
|
|
|
pTotalDiffStatus->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, TotalDifftqStatus* pTotalDifftqStatus, bool bL
|
|
|
|
|
|
|
|
|
|
pp.setInformation(i18n("Linediff: A <-> B"));
|
|
|
|
|
calcDiff3LineListUsingAB( &m_diffList12, m_diff3LineList );
|
|
|
|
|
fineDiff( m_diff3LineList, 1, m_sd1.getLineDataForDisplay(), m_sd2.getLineDataForDisplay(), pTotalDifftqStatus->bTextAEqB );
|
|
|
|
|
if ( m_sd1.getSizeBytes()==0 ) pTotalDifftqStatus->bTextAEqB=false;
|
|
|
|
|
fineDiff( m_diff3LineList, 1, m_sd1.getLineDataForDisplay(), m_sd2.getLineDataForDisplay(), pTotalDiffStatus->bTextAEqB );
|
|
|
|
|
if ( m_sd1.getSizeBytes()==0 ) pTotalDiffStatus->bTextAEqB=false;
|
|
|
|
|
|
|
|
|
|
pp.step();
|
|
|
|
|
}
|
|
|
|
@ -337,9 +337,9 @@ void KDiff3App::init( bool bAuto, TotalDifftqStatus* pTotalDifftqStatus, bool bL
|
|
|
|
|
pp.step();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
pTotalDifftqStatus->bBinaryAEqB = m_sd1.isBinaryEqualWith( m_sd2 );
|
|
|
|
|
pTotalDifftqStatus->bBinaryAEqC = m_sd1.isBinaryEqualWith( m_sd3 );
|
|
|
|
|
pTotalDifftqStatus->bBinaryBEqC = m_sd3.isBinaryEqualWith( m_sd2 );
|
|
|
|
|
pTotalDiffStatus->bBinaryAEqB = m_sd1.isBinaryEqualWith( m_sd2 );
|
|
|
|
|
pTotalDiffStatus->bBinaryAEqC = m_sd1.isBinaryEqualWith( m_sd3 );
|
|
|
|
|
pTotalDiffStatus->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, TotalDifftqStatus* pTotalDifftqStatus, bool bL
|
|
|
|
|
debugLineCheck( m_diff3LineList, m_sd3.getSizeLines(), 3 );
|
|
|
|
|
|
|
|
|
|
pp.setInformation(i18n("Linediff: A <-> B"));
|
|
|
|
|
fineDiff( m_diff3LineList, 1, m_sd1.getLineDataForDisplay(), m_sd2.getLineDataForDisplay(), pTotalDifftqStatus->bTextAEqB );
|
|
|
|
|
fineDiff( m_diff3LineList, 1, m_sd1.getLineDataForDisplay(), m_sd2.getLineDataForDisplay(), pTotalDiffStatus->bTextAEqB );
|
|
|
|
|
pp.step();
|
|
|
|
|
pp.setInformation(i18n("Linediff: B <-> C"));
|
|
|
|
|
fineDiff( m_diff3LineList, 2, m_sd2.getLineDataForDisplay(), m_sd3.getLineDataForDisplay(), pTotalDifftqStatus->bTextBEqC );
|
|
|
|
|
fineDiff( m_diff3LineList, 2, m_sd2.getLineDataForDisplay(), m_sd3.getLineDataForDisplay(), pTotalDiffStatus->bTextBEqC );
|
|
|
|
|
pp.step();
|
|
|
|
|
pp.setInformation(i18n("Linediff: A <-> C"));
|
|
|
|
|
fineDiff( m_diff3LineList, 3, m_sd3.getLineDataForDisplay(), m_sd1.getLineDataForDisplay(), pTotalDifftqStatus->bTextAEqC );
|
|
|
|
|
fineDiff( m_diff3LineList, 3, m_sd3.getLineDataForDisplay(), m_sd1.getLineDataForDisplay(), pTotalDiffStatus->bTextAEqC );
|
|
|
|
|
pp.step();
|
|
|
|
|
if ( m_sd1.getSizeBytes()==0 ) { pTotalDifftqStatus->bTextAEqB=false; pTotalDifftqStatus->bTextAEqC=false; }
|
|
|
|
|
if ( m_sd2.getSizeBytes()==0 ) { pTotalDifftqStatus->bTextAEqB=false; pTotalDifftqStatus->bTextBEqC=false; }
|
|
|
|
|
if ( m_sd1.getSizeBytes()==0 ) { pTotalDiffStatus->bTextAEqB=false; pTotalDiffStatus->bTextAEqC=false; }
|
|
|
|
|
if ( m_sd2.getSizeBytes()==0 ) { pTotalDiffStatus->bTextAEqB=false; pTotalDiffStatus->bTextBEqC=false; }
|
|
|
|
|
}
|
|
|
|
|
m_diffBufferInfo.init( &m_diff3LineList, &m_diff3LineVector,
|
|
|
|
|
m_sd1.getLineDataForDiff(), m_sd1.getSizeLines(),
|
|
|
|
@ -420,7 +420,7 @@ void KDiff3App::init( bool bAuto, TotalDifftqStatus* pTotalDifftqStatus, bool bL
|
|
|
|
|
m_sd2.getLineDataForDisplay(), m_sd2.getSizeLines(),
|
|
|
|
|
m_bTripleDiff ? m_sd3.getLineDataForDisplay() : 0, m_sd3.getSizeLines(),
|
|
|
|
|
&m_diff3LineList,
|
|
|
|
|
pTotalDifftqStatus
|
|
|
|
|
pTotalDiffStatus
|
|
|
|
|
);
|
|
|
|
|
m_pMergeResultWindowTitle->setFileName( m_outputFilename.isEmpty() ? TQString("unnamed.txt") : m_outputFilename );
|
|
|
|
|
|
|
|
|
@ -507,17 +507,17 @@ void KDiff3App::init( bool bAuto, TotalDifftqStatus* pTotalDifftqStatus, bool bL
|
|
|
|
|
)
|
|
|
|
|
{
|
|
|
|
|
TQString totalInfo;
|
|
|
|
|
if ( pTotalDifftqStatus->bBinaryAEqB && pTotalDifftqStatus->bBinaryAEqC )
|
|
|
|
|
if ( pTotalDiffStatus->bBinaryAEqB && pTotalDiffStatus->bBinaryAEqC )
|
|
|
|
|
totalInfo += i18n("All input files are binary equal.");
|
|
|
|
|
else if ( pTotalDifftqStatus->bTextAEqB && pTotalDifftqStatus->bTextAEqC )
|
|
|
|
|
else if ( pTotalDiffStatus->bTextAEqB && pTotalDiffStatus->bTextAEqC )
|
|
|
|
|
totalInfo += i18n("All input files contain the same text, but are not binary equal.");
|
|
|
|
|
else {
|
|
|
|
|
if ( pTotalDifftqStatus->bBinaryAEqB ) totalInfo += i18n("Files %1 and %2 are binary equal.\n" ).tqarg("A").tqarg("B");
|
|
|
|
|
else if ( pTotalDifftqStatus->bTextAEqB ) totalInfo += i18n("Files %1 and %2 have equal text, but are not binary equal. \n").tqarg("A").tqarg("B");
|
|
|
|
|
if ( pTotalDifftqStatus->bBinaryAEqC ) totalInfo += i18n("Files %1 and %2 are binary equal.\n" ).tqarg("A").tqarg("C");
|
|
|
|
|
else if ( pTotalDifftqStatus->bTextAEqC ) totalInfo += i18n("Files %1 and %2 have equal text, but are not binary equal. \n").tqarg("A").tqarg("C");
|
|
|
|
|
if ( pTotalDifftqStatus->bBinaryBEqC ) totalInfo += i18n("Files %1 and %2 are binary equal.\n" ).tqarg("B").tqarg("C");
|
|
|
|
|
else if ( pTotalDifftqStatus->bTextBEqC ) totalInfo += i18n("Files %1 and %2 have equal text, but are not binary equal. \n").tqarg("B").tqarg("C");
|
|
|
|
|
if ( pTotalDiffStatus->bBinaryAEqB ) totalInfo += i18n("Files %1 and %2 are binary equal.\n" ).tqarg("A").tqarg("B");
|
|
|
|
|
else if ( pTotalDiffStatus->bTextAEqB ) totalInfo += i18n("Files %1 and %2 have equal text, but are not binary equal. \n").tqarg("A").tqarg("B");
|
|
|
|
|
if ( pTotalDiffStatus->bBinaryAEqC ) totalInfo += i18n("Files %1 and %2 are binary equal.\n" ).tqarg("A").tqarg("C");
|
|
|
|
|
else if ( pTotalDiffStatus->bTextAEqC ) totalInfo += i18n("Files %1 and %2 have equal text, but are not binary equal. \n").tqarg("A").tqarg("C");
|
|
|
|
|
if ( pTotalDiffStatus->bBinaryBEqC ) totalInfo += i18n("Files %1 and %2 are binary equal.\n" ).tqarg("B").tqarg("C");
|
|
|
|
|
else if ( pTotalDiffStatus->bTextBEqC ) totalInfo += i18n("Files %1 and %2 have equal text, but are not binary equal. \n").tqarg("B").tqarg("C");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ( !totalInfo.isEmpty() )
|
|
|
|
@ -609,12 +609,12 @@ void KDiff3App::sourceMask( int srcMask, int enabledMask )
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Function uses setMinSize( tqsizeHint ) before adding the widget.
|
|
|
|
|
// Function uses setMinSize( sizeHint ) before adding the widget.
|
|
|
|
|
// void addWidget(TQBoxLayout* tqlayout, TQWidget* widget);
|
|
|
|
|
template <class W, class L>
|
|
|
|
|
void addWidget( L* tqlayout, W* widget)
|
|
|
|
|
{
|
|
|
|
|
TQSize s = widget->tqsizeHint();
|
|
|
|
|
TQSize s = widget->sizeHint();
|
|
|
|
|
widget->setMinimumSize( TQSize(max2(s.width(),0),max2(s.height(),0) ) );
|
|
|
|
|
tqlayout->addWidget( widget );
|
|
|
|
|
}
|
|
|
|
@ -1071,7 +1071,7 @@ void KDiff3App::slotFileOpen()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void KDiff3App::slotFileOpen2(TQString fn1, TQString fn2, TQString fn3, TQString ofn,
|
|
|
|
|
TQString an1, TQString an2, TQString an3, TotalDifftqStatus* pTotalDifftqStatus )
|
|
|
|
|
TQString an1, TQString an2, TQString an3, TotalDiffStatus* pTotalDiffStatus )
|
|
|
|
|
{
|
|
|
|
|
if ( !canContinue() ) return;
|
|
|
|
|
|
|
|
|
@ -1111,9 +1111,9 @@ void KDiff3App::slotFileOpen2(TQString fn1, TQString fn2, TQString fn3, TQString
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
m_bDirCompare = bDirCompare; // Don't allow this to change here.
|
|
|
|
|
init( false, pTotalDifftqStatus );
|
|
|
|
|
init( false, pTotalDiffStatus );
|
|
|
|
|
|
|
|
|
|
if ( pTotalDifftqStatus!=0 )
|
|
|
|
|
if ( pTotalDiffStatus!=0 )
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
if ( ! m_sd1.isEmpty() && ! m_sd1.hasData() ||
|
|
|
|
@ -1969,7 +1969,7 @@ void KDiff3App::slotMergeCurrentFile()
|
|
|
|
|
|
|
|
|
|
void KDiff3App::slotWinFocusNext()
|
|
|
|
|
{
|
|
|
|
|
TQWidget* focus = tqApp->tqfocusWidget();
|
|
|
|
|
TQWidget* focus = tqApp->focusWidget();
|
|
|
|
|
if ( focus == m_pDirectoryMergeWindow && m_pDirectoryMergeWindow->isVisible() && ! dirShowBoth->isChecked() )
|
|
|
|
|
{
|
|
|
|
|
slotDirViewToggle();
|
|
|
|
@ -1999,7 +1999,7 @@ void KDiff3App::slotWinFocusNext()
|
|
|
|
|
|
|
|
|
|
void KDiff3App::slotWinFocusPrev()
|
|
|
|
|
{
|
|
|
|
|
TQWidget* focus = tqApp->tqfocusWidget();
|
|
|
|
|
TQWidget* focus = tqApp->focusWidget();
|
|
|
|
|
if ( focus == m_pDirectoryMergeWindow && m_pDirectoryMergeWindow->isVisible() && ! dirShowBoth->isChecked() )
|
|
|
|
|
{
|
|
|
|
|
slotDirViewToggle();
|
|
|
|
|