Skip to content

Commit 472fb0e

Browse files
committed
gobject: split new/with_type for SignalGroup
1 parent db8666d commit 472fb0e

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

glib/Gir_GObject.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,9 @@ status = "generate"
109109
final_type = true
110110
concurrency = "send+sync"
111111
version = "2.74"
112+
[[object.function]]
113+
name = "new"
114+
rename = "with_type"
112115
[[object.function]]
113116
name = "connect"
114117
manual = true

glib/src/gobject/auto/signal_group.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ crate::wrapper! {
1616

1717
impl SignalGroup {
1818
#[doc(alias = "g_signal_group_new")]
19-
pub fn new(target_type: crate::types::Type) -> SignalGroup {
19+
#[doc(alias = "new")]
20+
pub fn with_type(target_type: crate::types::Type) -> SignalGroup {
2021
unsafe { from_glib_full(gobject_ffi::g_signal_group_new(target_type.into_glib())) }
2122
}
2223

glib/src/gobject/signal_group.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,14 @@ use std::mem::transmute;
55
use crate::{
66
signal::{connect_raw, SignalHandlerId},
77
translate::*,
8-
Object, ObjectType, RustClosure, SignalGroup, Value,
8+
IsA, Object, ObjectType, RustClosure, SignalGroup, Value,
99
};
1010

1111
impl SignalGroup {
12+
#[doc(alias = "g_signal_group_new")]
13+
pub fn new<T: IsA<Object>>() -> Self {
14+
Self::with_type(T::static_type())
15+
}
1216
#[doc(alias = "g_signal_group_connect_closure")]
1317
pub fn connect_closure(&self, signal_name: &str, after: bool, closure: RustClosure) {
1418
unsafe {
@@ -212,7 +216,7 @@ mod tests {
212216

213217
#[test]
214218
fn group_emit() {
215-
let group = SignalGroup::new(SignalObject::static_type());
219+
let group = SignalGroup::new::<SignalObject>();
216220

217221
let obj = Object::new::<SignalObject>();
218222
let store = Rc::new(RefCell::new(String::new()));

0 commit comments

Comments
 (0)