[gjs: 1/2] GObject: Add convenience wrapper for signal_handler_(un)block()
- From: Philip Chimento <pchimento src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gjs: 1/2] GObject: Add convenience wrapper for signal_handler_(un)block()
- Date: Fri, 20 Sep 2019 01:11:15 +0000 (UTC)
commit c7d01ffc934477306fd3a6a74c5a2d87ea4a211e
Author: Florian Müllner <fmuellner gnome org>
Date: Tue Aug 13 17:24:03 2019 +0200
GObject: Add convenience wrapper for signal_handler_(un)block()
Just like the existing disconnect(), those functions are more
idiomatic as object methods than the underlying static functions.
https://gitlab.gnome.org/GNOME/gjs/merge_requests/326
modules/overrides/GObject.js | 6 ++++++
1 file changed, 6 insertions(+)
---
diff --git a/modules/overrides/GObject.js b/modules/overrides/GObject.js
index d33f7429..86b7fae2 100644
--- a/modules/overrides/GObject.js
+++ b/modules/overrides/GObject.js
@@ -473,6 +473,12 @@ function _init() {
GObject.Object.prototype.disconnect = function(id) {
return GObject.signal_handler_disconnect(this, id);
};
+ GObject.Object.prototype.block_signal_handler = function(id) {
+ return GObject.signal_handler_block(this, id);
+ };
+ GObject.Object.prototype.unblock_signal_handler = function(id) {
+ return GObject.signal_handler_unblock(this, id);
+ };
// A simple workaround if you have a class with .connect, .disconnect or .emit
// methods (such as Gio.Socket.connect or NMClient.Device.disconnect)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]