Mercurial > hg > easyhg-kdiff3
changeset 98:236f1c9c3fbf
- Fixed redundant empty line in history merge.
- Fixed inconsistency in directory view info area after scan.
- Fixed crash if trying to disable "Dir & Text Split Screen View" and no
file is loaded.
- Fixed test dialog for regular expressions.
author | joachim99 |
---|---|
date | Sat, 15 May 2010 20:36:52 +0000 |
parents | 5024edf90636 |
children | f0c42ddbbda4 |
files | kdiff3/src-QT4/difftextwindow.cpp kdiff3/src-QT4/directorymergewindow.cpp kdiff3/src-QT4/mergeresultwindow.cpp kdiff3/src-QT4/mergeresultwindow.h kdiff3/src-QT4/pdiff.cpp kdiff3/src-QT4/smalldialogs.cpp |
diffstat | 6 files changed, 33 insertions(+), 19 deletions(-) [+] |
line wrap: on
line diff
--- a/kdiff3/src-QT4/difftextwindow.cpp Sun Mar 28 19:52:18 2010 +0000 +++ b/kdiff3/src-QT4/difftextwindow.cpp Sat May 15 20:36:52 2010 +0000 @@ -391,7 +391,7 @@ void DiffTextWindow::showStatusLine(int line ) { int d3lIdx = convertLineToDiff3LineIdx( line ); - if(d3lIdx >= 0 && d3lIdx<(int)d->m_pDiff3LineVector->size() ) + if( d->m_pDiff3LineVector!=0 && d3lIdx >= 0 && d3lIdx<(int)d->m_pDiff3LineVector->size() ) { const Diff3Line* pD3l = (*d->m_pDiff3LineVector)[d3lIdx]; if ( pD3l != 0 ) @@ -1020,14 +1020,17 @@ void DiffTextWindow::paintEvent( QPaintEvent* e ) { - if ( d->m_pDiff3LineVector==0 || ! d->m_bPaintingAllowed || - ( d->m_diff3WrapLineVector.empty() && d->m_bWordWrap ) ) + QRect invalidRect = e->rect(); + if ( invalidRect.isEmpty() || ! d->m_bPaintingAllowed ) return; - QRect invalidRect = e->rect(); - if ( invalidRect.isEmpty() ) + if ( d->m_pDiff3LineVector==0 || ( d->m_diff3WrapLineVector.empty() && d->m_bWordWrap ) ) + { + QPainter p(this); + p.fillRect( invalidRect, d->m_pOptionDialog->m_bgColor ); return; - + } + bool bOldSelectionContainsData = d->m_selection.bSelectionContainsData; d->m_selection.bSelectionContainsData = false;
--- a/kdiff3/src-QT4/directorymergewindow.cpp Sun Mar 28 19:52:18 2010 +0000 +++ b/kdiff3/src-QT4/directorymergewindow.cpp Sat May 15 20:36:52 2010 +0000 @@ -741,7 +741,10 @@ s += "\n" + i18n("Number of manual merges:") +" "+ QString::number(nofManualMerges); KMessageBox::information( this, s ); if ( topLevelItemCount()>0 ) + { topLevelItem(0)->setSelected(true); + setCurrentItem( topLevelItem(0) ); + } } if ( bReload )
--- a/kdiff3/src-QT4/mergeresultwindow.cpp Sun Mar 28 19:52:18 2010 +0000 +++ b/kdiff3/src-QT4/mergeresultwindow.cpp Sat May 15 20:36:52 2010 +0000 @@ -1387,6 +1387,14 @@ if (!mell.empty()) iMLLStart->mergeEditLineList.splice( iMLLStart->mergeEditLineList.end(), mell, mell.begin(), mell.end() ); } + // If the end of start is empty and the first line at the end is empty remove the last line of start + if ( !iMLLStart->mergeEditLineList.empty() && !iMLLEnd->mergeEditLineList.empty() ) + { + QString lastLineOfStart = iMLLStart->mergeEditLineList.back().getString(this); + QString firstLineOfEnd = iMLLEnd->mergeEditLineList.front().getString(this); + if ( lastLineOfStart.mid(lead.length()).trimmed().isEmpty() && firstLineOfEnd.mid(lead.length()).trimmed().isEmpty() ) + iMLLStart->mergeEditLineList.pop_back(); + } } setFastSelector( iMLLStart ); update();
--- a/kdiff3/src-QT4/mergeresultwindow.h Sun Mar 28 19:52:18 2010 +0000 +++ b/kdiff3/src-QT4/mergeresultwindow.h Sat May 15 20:36:52 2010 +0000 @@ -231,6 +231,7 @@ void clear() { ds(-m_size); BASE::clear(); } void push_back( const MergeEditLine& m) { ds(+1); BASE::push_back(m); } void push_front( const MergeEditLine& m) { ds(+1); BASE::push_front(m); } + void pop_back() { ds(-1); BASE::pop_back(); } iterator erase( iterator i ) { ds(-1); return BASE::erase(i); } iterator insert( iterator i, const MergeEditLine& m ) { ds(+1); return BASE::insert(i,m); } int size(){ if (!m_pTotalSize) m_size = BASE::size(); return m_size; }
--- a/kdiff3/src-QT4/pdiff.cpp Sun Mar 28 19:52:18 2010 +0000 +++ b/kdiff3/src-QT4/pdiff.cpp Sat May 15 20:36:52 2010 +0000 @@ -1828,7 +1828,8 @@ } else { - if ( m_pMainWidget!=0 ) + bool bTextDataAvailable = ( m_sd1.hasData() || m_sd2.hasData() || m_sd3.hasData() ); + if ( m_pMainWidget!=0 && bTextDataAvailable ) { m_pMainWidget->show(); m_pDirectoryMergeSplitter->hide();
--- a/kdiff3/src-QT4/smalldialogs.cpp Sun Mar 28 19:52:18 2010 +0000 +++ b/kdiff3/src-QT4/smalldialogs.cpp Sat May 15 20:36:52 2010 +0000 @@ -416,15 +416,15 @@ l->setToolTip( autoMergeRegExpToolTip ); m_pAutoMergeRegExpEdit = new QLineEdit(this); pGrid->addWidget(m_pAutoMergeRegExpEdit,line,1); - connect( m_pAutoMergeRegExpEdit, SIGNAL(editTextChanged(const QString&)), this, SLOT(slotRecalc())); + connect( m_pAutoMergeRegExpEdit, SIGNAL(textChanged(const QString&)), this, SLOT(slotRecalc())); ++line; l = new QLabel(i18n("Example auto merge line:"), this); - pGrid->addWidget(l,line,line,0,1); + pGrid->addWidget(l,line,0); l->setToolTip( i18n("For auto merge test copy a line as used in your files.") ); m_pAutoMergeExampleEdit = new QLineEdit(this); pGrid->addWidget(m_pAutoMergeExampleEdit,line,1); - connect( m_pAutoMergeExampleEdit, SIGNAL(editTextChanged(const QString&)), this, SLOT(slotRecalc())); + connect( m_pAutoMergeExampleEdit, SIGNAL(textChanged(const QString&)), this, SLOT(slotRecalc())); ++line; l = new QLabel(i18n("Match result:"), this); @@ -443,17 +443,16 @@ l->setToolTip( historyStartRegExpToolTip ); m_pHistoryStartRegExpEdit = new QLineEdit(this); pGrid->addWidget(m_pHistoryStartRegExpEdit,line,1); - connect( m_pHistoryStartRegExpEdit, SIGNAL(editTextChanged(const QString&)), this, SLOT(slotRecalc())); + connect( m_pHistoryStartRegExpEdit, SIGNAL(textChanged(const QString&)), this, SLOT(slotRecalc())); ++line; l = new QLabel(i18n("Example history start line (with leading comment):"), this); - pGrid->addWidget(l,line,line,0,1); - ++line; + pGrid->addWidget(l,line,0); l->setToolTip( i18n("Copy a history start line as used in your files,\n" "including the leading comment.") ); m_pHistoryStartExampleEdit = new QLineEdit(this); pGrid->addWidget(m_pHistoryStartExampleEdit,line,1); - connect( m_pHistoryStartExampleEdit, SIGNAL(editTextChanged(const QString&)), this, SLOT(slotRecalc())); + connect( m_pHistoryStartExampleEdit, SIGNAL(textChanged(const QString&)), this, SLOT(slotRecalc())); ++line; l = new QLabel(i18n("Match result:"), this); @@ -472,7 +471,7 @@ l->setToolTip( historyEntryStartRegExpToolTip ); m_pHistoryEntryStartRegExpEdit = new QLineEdit(this); pGrid->addWidget(m_pHistoryEntryStartRegExpEdit,line,1); - connect( m_pHistoryEntryStartRegExpEdit, SIGNAL(editTextChanged(const QString&)), this, SLOT(slotRecalc())); + connect( m_pHistoryEntryStartRegExpEdit, SIGNAL(textChanged(const QString&)), this, SLOT(slotRecalc())); ++line; l = new QLabel(i18n("History sort key order:"), this); @@ -480,17 +479,16 @@ l->setToolTip( historySortKeyOrderToolTip ); m_pHistorySortKeyOrderEdit = new QLineEdit(this); pGrid->addWidget(m_pHistorySortKeyOrderEdit,line,1); - connect( m_pHistorySortKeyOrderEdit, SIGNAL(editTextChanged(const QString&)), this, SLOT(slotRecalc())); + connect( m_pHistorySortKeyOrderEdit, SIGNAL(textChanged(const QString&)), this, SLOT(slotRecalc())); ++line; l = new QLabel(i18n("Example history entry start line (without leading comment):"), this); - pGrid->addWidget(l,line,line,0,1); + pGrid->addWidget(l,line,0); l->setToolTip( i18n("Copy a history entry start line as used in your files,\n" "but omit the leading comment.") ); - ++line; m_pHistoryEntryStartExampleEdit = new QLineEdit(this); pGrid->addWidget(m_pHistoryEntryStartExampleEdit,line,1); - connect( m_pHistoryEntryStartExampleEdit, SIGNAL(editTextChanged(const QString&)), this, SLOT(slotRecalc())); + connect( m_pHistoryEntryStartExampleEdit, SIGNAL(textChanged(const QString&)), this, SLOT(slotRecalc())); ++line; l = new QLabel(i18n("Match result:"), this);