[gitg] Only update diff when options really change
- From: Jesse van den Kieboom <jessevdk src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gitg] Only update diff when options really change
- Date: Thu, 10 Jul 2014 12:03:42 +0000 (UTC)
commit 0dc64527137b33ac06dfa5e9634e46d907101d05
Author: Jesse van den Kieboom <jessevdk gnome org>
Date: Thu Jul 10 14:03:24 2014 +0200
Only update diff when options really change
libgitg/gitg-diff-view.vala | 24 ++++++++++++++++--------
1 files changed, 16 insertions(+), 8 deletions(-)
---
diff --git a/libgitg/gitg-diff-view.vala b/libgitg/gitg-diff-view.vala
index 44fe3d3..9502104 100644
--- a/libgitg/gitg-diff-view.vala
+++ b/libgitg/gitg-diff-view.vala
@@ -111,16 +111,22 @@ namespace Gitg
private void flag_set(Ggit.DiffOption f, bool val)
{
+ var flags = options.flags;
+
if (val)
{
- options.flags |= f;
+ flags |= f;
}
else
{
- options.flags &= ~f;
+ flags &= ~f;
}
- update();
+ if (flags != options.flags)
+ {
+ options.flags = flags;
+ update();
+ }
}
public bool ignore_whitespace
@@ -140,9 +146,8 @@ namespace Gitg
if (d_changes_inline != value)
{
d_changes_inline = value;
+ update();
}
-
- update();
}
default = false;
@@ -154,10 +159,13 @@ namespace Gitg
set
{
- options.n_context_lines = value;
- options.n_interhunk_lines = value;
+ if (options.n_context_lines != value)
+ {
+ options.n_context_lines = value;
+ options.n_interhunk_lines = value;
- update();
+ update();
+ }
}
default = 3;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]