[meld/deprecation-cleanup] melddoc: Move file-changed to Signal
- From: Kai Willadsen <kaiw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [meld/deprecation-cleanup] melddoc: Move file-changed to Signal
- Date: Sun, 9 Dec 2018 21:32:05 +0000 (UTC)
commit 3319cba74e5d46031eab579aa0bb8ec76a92993f
Author: Kai Willadsen <kai willadsen gmail com>
Date: Sun Dec 9 07:07:37 2018 +1000
melddoc: Move file-changed to Signal
meld/filediff.py | 2 +-
meld/melddoc.py | 6 ++++--
meld/meldwindow.py | 2 +-
3 files changed, 6 insertions(+), 4 deletions(-)
---
diff --git a/meld/filediff.py b/meld/filediff.py
index d091b638..76ace42f 100644
--- a/meld/filediff.py
+++ b/meld/filediff.py
@@ -1631,7 +1631,7 @@ class FileDiff(MeldDoc, Component):
self.state = ComparisonState.SavingError
return
- self.emit('file-changed', gfile.get_path())
+ self.file_changed_signal.emit(gfile.get_path())
self.undosequence.checkpoint(buf)
buf.data.update_mtime()
if pane == 1 and self.num_panes == 3:
diff --git a/meld/melddoc.py b/meld/melddoc.py
index f5f7aa3f..6f4b4dc3 100644
--- a/meld/melddoc.py
+++ b/meld/melddoc.py
@@ -73,8 +73,6 @@ class MeldDoc(LabeledObjectMixin, GObject.GObject):
"""
__gsignals__ = {
- 'file-changed': (GObject.SignalFlags.RUN_FIRST, None,
- (GObject.TYPE_STRING,)),
'create-diff': (GObject.SignalFlags.RUN_FIRST, None,
(GObject.TYPE_PYOBJECT,
GObject.TYPE_PYOBJECT)),
@@ -86,6 +84,10 @@ class MeldDoc(LabeledObjectMixin, GObject.GObject):
def close_signal(self, exit_code: int) -> None:
...
+ @GObject.Signal('file-changed')
+ def file_changed_signal(self, path: str) -> None:
+ ...
+
@GObject.Signal
def tab_state_changed(self, old_state: int, new_state: int) -> None:
...
diff --git a/meld/meldwindow.py b/meld/meldwindow.py
index bcc91c89..98877036 100644
--- a/meld/meldwindow.py
+++ b/meld/meldwindow.py
@@ -527,7 +527,7 @@ class MeldWindow(Gtk.ApplicationWindow):
if hasattr(page, 'scheduler'):
self.scheduler.add_scheduler(page.scheduler)
if isinstance(page, MeldDoc):
- page.connect("file-changed", self.on_file_changed)
+ page.file_changed_signal.connect(self.on_file_changed)
page.connect("create-diff", lambda obj, arg, kwargs:
self.append_diff(arg, **kwargs))
page.tab_state_changed.connect(self.on_page_state_changed)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]