Commit 04efa9d5 authored by Jean-Nicolas Artaud's avatar Jean-Nicolas Artaud

Make the kdesvn diff be loaded like a normal diff file.

BUG:137826

REVIEW:6988


svn path=/trunk/KDE/kdesdk/kompare/; revision=1305526
parent ab7453b6
......@@ -6,6 +6,7 @@
Copyright 2001-2003 John Firebaugh <jfirebaugh@kde.org>
Copyright 2004 Jeff Snyder <jeff@caffeinated.me.uk>
Copyright 2007-2011 Kevin Kofler <kevin.kofler@chello.at>
Copyright 2012 Jean-Nicolas Artaud <jeannicolasartaud@gmail.com>
****************************************************************************/
/***************************************************************************
......@@ -236,10 +237,9 @@ bool KomparePart::openDiff( const QString& diffOutput )
emit kompareInfo( &m_info );
if ( m_modelList->parseDiffOutput( diffOutput ) == 0 )
if ( m_modelList->parseAndOpenDiff( diffOutput ) == 0 )
{
value = true;
m_modelList->show();
updateActions();
updateCaption();
updateStatus();
......
......@@ -5,6 +5,7 @@
Copyright 2001-2005,2009 Otto Bruggeman <otto.bruggeman@home.nl>
Copyright 2001-2003 John Firebaugh <jfirebaugh@kde.org>
Copyright 2007-2010 Kevin Kofler <kevin.kofler@chello.at>
Copyright 2012 Jean-Nicolas Artaud <jeannicolasartaud@gmail.com>
***************************************************************************/
/***************************************************************************
......@@ -607,6 +608,25 @@ bool KompareModelList::openDiff( const QString& diffFile )
return true;
}
bool KompareModelList::parseAndOpenDiff(const QString& diff)
{
clear(); // Clear the current models
emit status( Kompare::Parsing );
if ( parseDiffOutput( diff ) != 0 )
{
emit error( i18n( "Could not parse diff output." ) );
return false;
}
updateModelListActions();
show();
emit status( Kompare::FinishedParsing );
return true;
}
QString KompareModelList::recreateDiff() const
{
QString diff;
......
......@@ -5,6 +5,7 @@
Copyright 2001-2003 John Firebaugh <jfirebaugh@kde.org>
Copyright 2001-2005,2009 Otto Bruggeman <bruggie@gmail.com>
Copyright 2007-2008 Kevin Kofler <kevin.kofler@chello.at>
Copyright 2012 Jean-Nicolas Artaud <jeannicolasartaud@gmail.com>
***************************************************************************/
/***************************************************************************
......@@ -70,6 +71,9 @@ public:
// This parses the difflines and creates new models
int parseDiffOutput( const QString& diff );
// This open the difflines after parsing them
bool parseAndOpenDiff( const QString& diff );
// Call this to emit the signals to the rest of the "world" to show the diff
void show();
......
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