Commit d1ccf55c authored by Joachim Eibl's avatar Joachim Eibl

- 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.



git-svn-id: https://kdiff3.svn.sourceforge.net/svnroot/kdiff3/trunk@102 c8aa9fed-2811-0410-8543-893ada326672
parent fd815b05
......@@ -391,7 +391,7 @@ void DiffTextWindow::setFastSelectorRange( int line1, int nofLines )
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 DiffTextWindowData::writeLine(
void DiffTextWindow::paintEvent( QPaintEvent* e )
{
if ( d->m_pDiff3LineVector==0 || ! d->m_bPaintingAllowed ||
( d->m_diff3WrapLineVector.empty() && d->m_bWordWrap ) )
return;
QRect invalidRect = e->rect();
if ( invalidRect.isEmpty() )
if ( invalidRect.isEmpty() || ! d->m_bPaintingAllowed )
return;
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;
......
......@@ -741,7 +741,10 @@ bool DirectoryMergeWindow::init
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 )
......
......@@ -1387,6 +1387,14 @@ void MergeResultWindow::slotMergeHistory()
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();
......
......@@ -231,6 +231,7 @@ private:
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; }
......
......@@ -1828,7 +1828,8 @@ void KDiff3App::slotDirShowBoth()
}
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();
......
......@@ -416,15 +416,15 @@ RegExpTester::RegExpTester( QWidget* pParent, const QString& autoMergeRegExpTool
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 @@ RegExpTester::RegExpTester( QWidget* pParent, const QString& autoMergeRegExpTool
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 @@ RegExpTester::RegExpTester( QWidget* pParent, const QString& autoMergeRegExpTool
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 @@ RegExpTester::RegExpTester( QWidget* pParent, const QString& autoMergeRegExpTool
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);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment