[meld] linkmap: Remove use of setup flags in favour of checking real attrs
- From: Kai Willadsen <kaiw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [meld] linkmap: Remove use of setup flags in favour of checking real attrs
- Date: Sun, 14 Dec 2014 20:50:59 +0000 (UTC)
commit 4c02dc5f4c2b1a55cc8ee298265bff214030f957
Author: Kai Willadsen <kai willadsen gmail com>
Date: Fri Nov 28 06:52:46 2014 +1000
linkmap: Remove use of setup flags in favour of checking real attrs
meld/linkmap.py | 11 ++++-------
1 files changed, 4 insertions(+), 7 deletions(-)
---
diff --git a/meld/linkmap.py b/meld/linkmap.py
index 56fad3d..4645815 100644
--- a/meld/linkmap.py
+++ b/meld/linkmap.py
@@ -25,7 +25,7 @@ class LinkMap(Gtk.DrawingArea):
__gtype_name__ = "LinkMap"
def __init__(self):
- self._setup = False
+ self.filediff = None
def associate(self, filediff, left_view, right_view):
self.filediff = filediff
@@ -38,14 +38,12 @@ class LinkMap(Gtk.DrawingArea):
self.line_height = filediff.pixels_per_line
- self._setup = True
-
def set_color_scheme(self, color_map):
self.fill_colors, self.line_colors = color_map
self.queue_draw()
def do_draw(self, context):
- if not self._setup:
+ if not self.filediff:
return
context.set_line_width(1.0)
@@ -128,13 +126,12 @@ class ScrollLinkMap(Gtk.DrawingArea):
__gtype_name__ = "ScrollLinkMap"
def __init__(self):
- self._setup = False
+ self.melddoc = None
def associate(self, melddoc):
self.melddoc = melddoc
- self._setup = True
def do_scroll_event(self, event):
- if not self._setup:
+ if not self.melddoc:
return
self.melddoc.next_diff(event.direction)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]