Skip to content

Commit a683a43

Browse files
authored
Merge pull request #1011 from mbiggio/wip/biggio/revert-simple-action
Revert "SimpleAction: take state by value"
2 parents 713401d + 4d10122 commit a683a43

File tree

3 files changed

+7
-22
lines changed

3 files changed

+7
-22
lines changed

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

0 commit comments

Comments
 (0)