[meld] Remove preferences creation and passing
- From: Kai Willadsen <kaiw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [meld] Remove preferences creation and passing
- Date: Fri, 6 Dec 2013 23:26:46 +0000 (UTC)
commit ce614b92c3368c7fdb64a496bed194fe15120f81
Author: Kai Willadsen <kai willadsen gmail com>
Date: Sat Dec 7 08:38:13 2013 +1000
Remove preferences creation and passing
meld/dirdiff.py | 4 ++--
meld/filediff.py | 4 ++--
meld/meldapp.py | 1 -
meld/melddoc.py | 7 +------
meld/meldwindow.py | 10 +++++-----
meld/preferences.py | 14 +-------------
meld/vcview.py | 4 ++--
7 files changed, 13 insertions(+), 31 deletions(-)
---
diff --git a/meld/dirdiff.py b/meld/dirdiff.py
index 5382fa2..ce92b82 100644
--- a/meld/dirdiff.py
+++ b/meld/dirdiff.py
@@ -302,8 +302,8 @@ class DirDiff(melddoc.MeldDoc, gnomeglade.Component):
tree.STATE_MODIFIED: ("modified", "ShowModified"),
}
- def __init__(self, prefs, num_panes):
- melddoc.MeldDoc.__init__(self, prefs)
+ def __init__(self, num_panes):
+ melddoc.MeldDoc.__init__(self)
gnomeglade.Component.__init__(self, "dirdiff.ui", "dirdiff",
["DirdiffActions"])
diff --git a/meld/filediff.py b/meld/filediff.py
index 66770ba..2fcbd14 100644
--- a/meld/filediff.py
+++ b/meld/filediff.py
@@ -164,10 +164,10 @@ class FileDiff(melddoc.MeldDoc, gnomeglade.Component):
'action-mode-changed': (GObject.SignalFlags.RUN_FIRST, None, (int,)),
}
- def __init__(self, prefs, num_panes):
+ def __init__(self, num_panes):
"""Start up an filediff with num_panes empty contents.
"""
- melddoc.MeldDoc.__init__(self, prefs)
+ melddoc.MeldDoc.__init__(self)
gnomeglade.Component.__init__(self, "filediff.ui", "filediff")
self.map_widgets_into_lists(["textview", "fileentry", "diffmap",
"scrolledwindow", "linkmap",
diff --git a/meld/meldapp.py b/meld/meldapp.py
index 6b19adb..a7e1fbc 100644
--- a/meld/meldapp.py
+++ b/meld/meldapp.py
@@ -43,7 +43,6 @@ class MeldApp(Gtk.Application):
self.set_application_id("org.gnome.meld")
GObject.set_application_name("Meld")
Gtk.Window.set_default_icon_name("meld")
- self.prefs = meld.preferences.MeldPreferences()
self.recent_comparisons = meld.recent.RecentFiles(sys.argv[0])
self.window = None
diff --git a/meld/melddoc.py b/meld/melddoc.py
index 749e93c..dbc6a05 100644
--- a/meld/melddoc.py
+++ b/meld/melddoc.py
@@ -70,11 +70,9 @@ class MeldDoc(GObject.GObject):
(bool, bool)),
}
- def __init__(self, prefs):
+ def __init__(self):
GObject.GObject.__init__(self)
self.scheduler = task.FifoScheduler()
- self.prefs = prefs
- self.prefs.notify_add(self.on_preference_changed)
self.num_panes = 0
self.label_text = _("untitled")
self.tooltip_text = _("untitled")
@@ -162,9 +160,6 @@ class MeldDoc(GObject.GObject):
def on_replace_activate(self, *extra):
pass
- def on_preference_changed(self, key, value):
- pass
-
def on_file_changed(self, filename):
pass
diff --git a/meld/meldwindow.py b/meld/meldwindow.py
index 0d4f9cc..1a13b29 100644
--- a/meld/meldwindow.py
+++ b/meld/meldwindow.py
@@ -625,7 +625,7 @@ class MeldWindow(gnomeglade.Component):
def append_dirdiff(self, dirs, auto_compare=False):
assert len(dirs) in (1, 2, 3)
- doc = dirdiff.DirDiff(app.prefs, len(dirs))
+ doc = dirdiff.DirDiff(len(dirs))
self._append_page(doc, "folder")
doc.set_locations(dirs)
# FIXME: This doesn't work, as dirdiff behaves differently to vcview
@@ -635,7 +635,7 @@ class MeldWindow(gnomeglade.Component):
def append_filediff(self, files, merge_output=None):
assert len(files) in (1, 2, 3)
- doc = filediff.FileDiff(app.prefs, len(files))
+ doc = filediff.FileDiff(len(files))
self._append_page(doc, "text-x-generic")
doc.set_files(files)
if merge_output is not None:
@@ -644,7 +644,7 @@ class MeldWindow(gnomeglade.Component):
def append_filemerge(self, files, merge_output=None):
assert len(files) == 3
- doc = filemerge.FileMerge(app.prefs, len(files))
+ doc = filemerge.FileMerge(len(files))
self._append_page(doc, "text-x-generic")
doc.set_files(files)
if merge_output is not None:
@@ -666,7 +666,7 @@ class MeldWindow(gnomeglade.Component):
return self.append_filediff(paths, merge_output=merge_output)
def append_vcview(self, location, auto_compare=False):
- doc = vcview.VcView(app.prefs)
+ doc = vcview.VcView()
# FIXME: need a good themed VC icon
self._append_page(doc, "vc-icon")
location = location[0] if isinstance(location, list) else location
@@ -691,7 +691,7 @@ class MeldWindow(gnomeglade.Component):
return tab
def _single_file_open(self, path):
- doc = vcview.VcView(app.prefs)
+ doc = vcview.VcView()
def cleanup():
self.scheduler.remove_scheduler(doc.scheduler)
diff --git a/meld/preferences.py b/meld/preferences.py
index 264de8b..594c11a 100644
--- a/meld/preferences.py
+++ b/meld/preferences.py
@@ -25,11 +25,9 @@ from gi.repository import Gtk
from gi.repository import GtkSource
from meld.filters import FilterEntry
+from meld.settings import settings
from meld.ui.gnomeglade import Component
from meld.ui.listwidget import ListWidget
-from .util import prefs
-
-from meld.settings import settings
class FilterList(ListWidget):
@@ -243,13 +241,3 @@ class PreferencesDialog(Component):
def on_response(self, dialog, response_id):
self.widget.destroy()
-
-
-class MeldPreferences(prefs.Preferences):
- defaults = {
- "window_size_x": prefs.Value(prefs.INT, 600),
- "window_size_y": prefs.Value(prefs.INT, 600),
- }
-
- def __init__(self):
- super(MeldPreferences, self).__init__("/apps/meld", self.defaults)
diff --git a/meld/vcview.py b/meld/vcview.py
index b3b5633..48934ec 100644
--- a/meld/vcview.py
+++ b/meld/vcview.py
@@ -162,8 +162,8 @@ class VcView(melddoc.MeldDoc, gnomeglade.Component):
"ignored": ("VcShowIgnored", entry_ignored),
}
- def __init__(self, prefs):
- melddoc.MeldDoc.__init__(self, prefs)
+ def __init__(self):
+ melddoc.MeldDoc.__init__(self)
gnomeglade.Component.__init__(self, "vcview.ui", "vcview",
["VcviewActions", 'liststore_vcs'])
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]