Skip to content

Commit ba274d2

Browse files
authored
Merge branch 'master' into value_delegate
2 parents ef7c865 + 13e3079 commit ba274d2

File tree

34 files changed

+440
-78
lines changed

34 files changed

+440
-78
lines changed

CHANGELOG.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,40 @@
22

33
## [Unreleased]
44

5+
## [0.17.2]
6+
7+
Andrey Kutejko:
8+
- glib: Implement `PartialEq` and `PartialOrd` for `WeakRef`
9+
10+
Bilal Elmoussaoui:
11+
- glib: Add missing `ObjectImpl` vfuncs overrides
12+
- glib: Mention lack of finalize method on `ObjectImpl`
13+
14+
Jason Francis:
15+
- glib-macros: allow properties macro generated functions to be unused
16+
- glib: implement `WatchedObject` for `BorrowedObject`
17+
18+
Mathieu Duponchelle:
19+
- glib: object: address misleading casting docs
20+
21+
Matteo Biggio:
22+
- gio: `SimpleAction`: take ownership of value without leaking it
23+
24+
Paolo Borelli:
25+
- glib: properties: impl `HasParamSpec` for `Vec<String>` and `StrV`
26+
- glib-macros: Derive `HasParamSpec` for `SharedBoxed`
27+
- glib: Add `StrV::join()` method
28+
- glib: Add `StrV::contains()` method
29+
30+
SeaDve:
31+
- glib-macros: slightly improve `Properties` macro docs
32+
33+
Sebastian Dröge:
34+
- Update gir-files
35+
- Regenerate with latest gir-files
36+
- glib: Ignore new 2.76 free functions
37+
- gio: Don't pass `NULL` to `g_list_store_find_with_equal_func_full()`
38+
539
## [0.17.1]
640

741
Guillaume Desmottes:

gdk-pixbuf/src/auto/versions.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
Generated by gir (https://github.com/gtk-rs/gir @ 425f84d5af7f)
2-
from gir-files (https://github.com/gtk-rs/gir-files @ 4eaad6a722bf)
2+
from gir-files (https://github.com/gtk-rs/gir-files @ 318e14efee40)

gdk-pixbuf/sys/versions.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
Generated by gir (https://github.com/gtk-rs/gir @ 425f84d5af7f)
2-
from gir-files (https://github.com/gtk-rs/gir-files @ 4eaad6a722bf)
2+
from gir-files (https://github.com/gtk-rs/gir-files @ 318e14efee40)

gio/Gir.toml

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1157,21 +1157,6 @@ status = "generate"
11571157
name = "state"
11581158
#value glib::VariantTy
11591159
ignore = true
1160-
[[object.function]]
1161-
name = "new_stateful"
1162-
[[object.function.parameter]]
1163-
name = "state"
1164-
move = true
1165-
[[object.function]]
1166-
name = "set_state"
1167-
[[object.function.parameter]]
1168-
name = "value"
1169-
move = true
1170-
[[object.function]]
1171-
name = "set_state_hint"
1172-
[[object.function.parameter]]
1173-
name = "state_hint"
1174-
move = true
11751160

11761161
[[object]]
11771162
name = "Gio.SimpleIOStream"

gio/src/action_map.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ impl<O: IsA<ActionMap>> ActionMapExtManual for O {
1515
fn add_action_entries(&self, entries: impl IntoIterator<Item = ActionEntry<Self>>) {
1616
for entry in entries.into_iter() {
1717
let action = if let Some(state) = entry.state() {
18-
SimpleAction::new_stateful(entry.name(), entry.parameter_type(), state.clone())
18+
SimpleAction::new_stateful(entry.name(), entry.parameter_type(), state)
1919
} else {
2020
SimpleAction::new(entry.name(), entry.parameter_type())
2121
};

gio/src/auto/simple_action.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,13 @@ impl SimpleAction {
3434
pub fn new_stateful(
3535
name: &str,
3636
parameter_type: Option<&glib::VariantTy>,
37-
state: glib::Variant,
37+
state: &glib::Variant,
3838
) -> SimpleAction {
3939
unsafe {
4040
from_glib_full(ffi::g_simple_action_new_stateful(
4141
name.to_glib_none().0,
4242
parameter_type.to_glib_none().0,
43-
state.into_glib_ptr(),
43+
state.to_glib_none().0,
4444
))
4545
}
4646
}
@@ -53,16 +53,16 @@ impl SimpleAction {
5353
}
5454

5555
#[doc(alias = "g_simple_action_set_state")]
56-
pub fn set_state(&self, value: glib::Variant) {
56+
pub fn set_state(&self, value: &glib::Variant) {
5757
unsafe {
58-
ffi::g_simple_action_set_state(self.to_glib_none().0, value.into_glib_ptr());
58+
ffi::g_simple_action_set_state(self.to_glib_none().0, value.to_glib_none().0);
5959
}
6060
}
6161

6262
#[doc(alias = "g_simple_action_set_state_hint")]
63-
pub fn set_state_hint(&self, state_hint: Option<glib::Variant>) {
63+
pub fn set_state_hint(&self, state_hint: Option<&glib::Variant>) {
6464
unsafe {
65-
ffi::g_simple_action_set_state_hint(self.to_glib_none().0, state_hint.into_glib_ptr());
65+
ffi::g_simple_action_set_state_hint(self.to_glib_none().0, state_hint.to_glib_none().0);
6666
}
6767
}
6868

gio/src/auto/versions.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
Generated by gir (https://github.com/gtk-rs/gir @ 425f84d5af7f)
2-
from gir-files (https://github.com/gtk-rs/gir-files @ 4eaad6a722bf)
2+
from gir-files (https://github.com/gtk-rs/gir-files @ 318e14efee40)

gio/src/list_store.rs

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,16 @@ impl ListStore {
8787
}
8888

8989
unsafe {
90+
// GIO requires a non-NULL item to be passed in so we're constructing a fake item here.
91+
// See https://gitlab.gnome.org/GNOME/glib/-/merge_requests/3284
92+
let item = glib::gobject_ffi::GObject {
93+
g_type_instance: glib::gobject_ffi::GTypeInstance {
94+
g_class: glib::gobject_ffi::g_type_class_peek(self.item_type().into_glib())
95+
as *mut _,
96+
},
97+
ref_count: 1,
98+
qdata: std::ptr::null_mut(),
99+
};
90100
let mut func = equal_func;
91101
let func_obj: &mut (dyn FnMut(&Object) -> bool) = &mut func;
92102
let func_ptr =
@@ -96,7 +106,7 @@ impl ListStore {
96106

97107
let found = bool::from_glib(ffi::g_list_store_find_with_equal_func_full(
98108
self.to_glib_none().0,
99-
std::ptr::null_mut(),
109+
mut_override(&item as *const _),
100110
Some(equal_func_trampoline),
101111
func_ptr,
102112
position.as_mut_ptr(),
@@ -190,4 +200,17 @@ mod tests {
190200
assert_eq!(list.item(1).as_ref(), Some(item1.upcast_ref()));
191201
assert_eq!(list.item(2).as_ref(), None);
192202
}
203+
204+
#[cfg(feature = "v2_74")]
205+
#[test]
206+
fn find() {
207+
let item0 = ListStore::new(ListStore::static_type());
208+
let item1 = ListStore::new(ListStore::static_type());
209+
let list = ListStore::new(ListStore::static_type());
210+
list.append(&item0);
211+
list.append(&item1);
212+
213+
let res = list.find_with_equal_func(|item| item == &item1);
214+
assert_eq!(res, Some(1));
215+
}
193216
}

gio/sys/versions.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
Generated by gir (https://github.com/gtk-rs/gir @ 425f84d5af7f)
2-
from gir-files (https://github.com/gtk-rs/gir-files @ 4eaad6a722bf)
2+
from gir-files (https://github.com/gtk-rs/gir-files @ 318e14efee40)

0 commit comments

Comments
 (0)