[meld/deprecation-cleanup] meldbuffer: Move file-changed to Signal
- From: Kai Willadsen <kaiw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [meld/deprecation-cleanup] meldbuffer: Move file-changed to Signal
- Date: Sun, 9 Dec 2018 21:32:00 +0000 (UTC)
commit 9ce12d048d813a5e6d9fa148f1f08f740634fcc0
Author: Kai Willadsen <kai willadsen gmail com>
Date: Sun Dec 9 07:04:06 2018 +1000
meldbuffer: Move file-changed to Signal
Note that this is the buffer-specific file-changed signal, *not* the
file-changed from MeldDoc. Naming is hard, okay?
meld/filediff.py | 2 +-
meld/meldbuffer.py | 8 ++++----
2 files changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/meld/filediff.py b/meld/filediff.py
index ab2d3bf8..d091b638 100644
--- a/meld/filediff.py
+++ b/meld/filediff.py
@@ -178,7 +178,7 @@ class FileDiff(MeldDoc, Component):
buf.undo_sequence = self.undosequence
buf.connect("notify::has-selection",
self.update_text_actions_sensitivity)
- buf.data.connect('file-changed', self.notify_file_changed)
+ buf.data.file_changed_signal.connect(self.notify_file_changed)
self.ui_file = ui_file("filediff-ui.xml")
self.actiongroup = self.FilediffActions
diff --git a/meld/meldbuffer.py b/meld/meldbuffer.py
index 35e8f4f9..fd95aa14 100644
--- a/meld/meldbuffer.py
+++ b/meld/meldbuffer.py
@@ -87,9 +87,9 @@ class MeldBuffer(GtkSource.Buffer):
class MeldBufferData(GObject.GObject):
- __gsignals__ = {
- str('file-changed'): (GObject.SignalFlags.RUN_FIRST, None, ()),
- }
+ @GObject.Signal('file-changed')
+ def file_changed_signal(self) -> None:
+ ...
encoding = GObject.Property(
type=GtkSource.Encoding,
@@ -160,7 +160,7 @@ class MeldBufferData(GObject.GObject):
def _handle_file_change(self, monitor, f, other_file, event_type):
mtime = self._query_mtime(f)
if self._disk_mtime and mtime and mtime > self._disk_mtime:
- self.emit('file-changed')
+ self.file_changed_signal.emit()
self._disk_mtime = mtime or self._disk_mtime
@property
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]