[gitg] Add gsetting key to use patience algorithm



commit 45fe889adf4adc4941aac1ce0b1f4caedb12b070
Author: Alberto Fanjul <albertofanjul gmail com>
Date:   Sun Oct 14 22:15:35 2018 +0200

    Add gsetting key to use patience algorithm

 data/org.gnome.gitg.gschema.xml.in.in     | 7 +++++++
 gitg/gitg-commit-action-create-patch.vala | 5 +++++
 2 files changed, 12 insertions(+)
---
diff --git a/data/org.gnome.gitg.gschema.xml.in.in b/data/org.gnome.gitg.gschema.xml.in.in
index 7a24233d..7d86dcdc 100644
--- a/data/org.gnome.gitg.gschema.xml.in.in
+++ b/data/org.gnome.gitg.gschema.xml.in.in
@@ -208,6 +208,13 @@
     </key>
   </schema>
   <schema gettext-domain="@GETTEXT_PACKAGE@" id="org.gnome.gitg.preferences.diff" 
path="/org/gnome/gitg/preferences/diff/">
+    <key name="patience" type="b">
+      <default>false</default>
+      <_summary>Use patience algorithm to show diffs</_summary>
+      <_description>
+         Setting to use patience algorithm to show diffs of a commit.
+      </_description>
+    </key>
     <key name="ignore-whitespace" type="b">
       <default>false</default>
       <_summary>Ignore Whitespace Changes</_summary>
diff --git a/gitg/gitg-commit-action-create-patch.vala b/gitg/gitg-commit-action-create-patch.vala
index 793c583c..d31bc5f9 100644
--- a/gitg/gitg-commit-action-create-patch.vala
+++ b/gitg/gitg-commit-action-create-patch.vala
@@ -102,6 +102,11 @@ class CommitActionCreatePatch : GitgExt.UIElement, GitgExt.Action, GitgExt.Commi
                        opts.flags |= Ggit.DiffOption.IGNORE_WHITESPACE;
                }
 
+               if (settings.get_boolean("patience"))
+               {
+                       opts.flags |= Ggit.DiffOption.PATIENCE;
+               }
+
                var nc = settings.get_int("context-lines");
 
                opts.n_context_lines = nc;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]