]> git.lyx.org Git - features.git/commitdiff
At least basic capability for VC comparison.
authorPavel Sanda <sanda@lyx.org>
Mon, 22 Feb 2010 02:01:04 +0000 (02:01 +0000)
committerPavel Sanda <sanda@lyx.org>
Mon, 22 Feb 2010 02:01:04 +0000 (02:01 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@33533 a592a061-630c-0410-9148-cb99ea01b6c8

src/frontends/qt4/GuiView.cpp

index 78163517cc79e1866fa5209768c19913515c0d30..292d23f2a7fdee4e07bf16b8eaff9e05163a2de1 100644 (file)
@@ -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 <FLAG> 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;
        }