From 21379cbef98b804cd6a71aa0801e31b4878ab0ef Mon Sep 17 00:00:00 2001 From: Pavel Sanda Date: Mon, 22 Feb 2010 02:01:04 +0000 Subject: [PATCH] At least basic capability for VC comparison. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@33533 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/frontends/qt4/GuiView.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/frontends/qt4/GuiView.cpp b/src/frontends/qt4/GuiView.cpp index 78163517cc..292d23f2a7 100644 --- a/src/frontends/qt4/GuiView.cpp +++ b/src/frontends/qt4/GuiView.cpp @@ -39,6 +39,7 @@ #include "BufferList.h" #include "BufferParams.h" #include "BufferView.h" +#include "Compare.h" #include "Converter.h" #include "Cursor.h" #include "CutAndPaste.h" @@ -2597,9 +2598,16 @@ void GuiView::dispatchVC(FuncRequest const & cmd) if (!buffer->lyxvc().prepareFileRevision(rev2, f2)) break; } - // FIXME We need to call comparison feature here - // I'm not sure whether with or without dialog. - // (Gui)Compare::compare(f1, f2); + // FIXME We need to call comparison feature here. + // This is quick and dirty code for testing VC. + // We need that comparison feature has some LFUN_COMPARE file1 file1 + FileName initpath(lyxrc.document_path); + Buffer * dest = newUnnamedFile(initpath, to_utf8(_("differences"))); + CompareOptions options; + Compare * compare = new Compare(loadIfNeeded(FileName(f1)), loadIfNeeded(FileName(f2)), dest, options); + compare->start(QThread::LowPriority); + sleep(2); + lyx::dispatch(FuncRequest(LFUN_BUFFER_SWITCH, dest->absFileName())); break; } -- 2.39.5