[fractal/bilelmoussaoui/bump-gtk-rs: 9/16] WidgetExt::destroy is unsafe now
- From: Daniel Garcia Moreno <danigm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [fractal/bilelmoussaoui/bump-gtk-rs: 9/16] WidgetExt::destroy is unsafe now
- Date: Fri, 28 Aug 2020 17:54:02 +0000 (UTC)
commit 687bad3f4da15c5341eccc22d173868dc7d0d99b
Author: Bilal Elmoussaoui <bil elmoussaoui gmail com>
Date: Wed Jul 15 19:35:36 2020 +0200
WidgetExt::destroy is unsafe now
see gtk-rs release for details
fractal-gtk/src/appop/about.rs | 2 +-
fractal-gtk/src/appop/account.rs | 10 +++++-----
fractal-gtk/src/appop/attach.rs | 4 ++--
fractal-gtk/src/appop/message.rs | 10 +++++++---
fractal-gtk/src/widgets/divider.rs | 2 +-
fractal-gtk/src/widgets/error_dialog.rs | 2 +-
fractal-gtk/src/widgets/message.rs | 4 +++-
7 files changed, 20 insertions(+), 14 deletions(-)
---
diff --git a/fractal-gtk/src/appop/about.rs b/fractal-gtk/src/appop/about.rs
index 7ffd535e..8820c36e 100644
--- a/fractal-gtk/src/appop/about.rs
+++ b/fractal-gtk/src/appop/about.rs
@@ -44,7 +44,7 @@ impl AppOp {
dialog.add_credit_section(i18n("Name by").as_str(), &["Regina Bíró"]);
dialog.connect_response(move |d, _| {
- d.destroy();
+ d.close();
});
dialog.show();
diff --git a/fractal-gtk/src/appop/account.rs b/fractal-gtk/src/appop/account.rs
index 6d7d0e60..37ab4292 100644
--- a/fractal-gtk/src/appop/account.rs
+++ b/fractal-gtk/src/appop/account.rs
@@ -130,7 +130,7 @@ impl AppOp {
}
});
}
- w.destroy();
+ w.close();
});
self.get_three_pid();
dialog.show_all();
@@ -177,7 +177,7 @@ impl AppOp {
}
});
}
- w.destroy();
+ w.close();
});
self.get_three_pid();
dialog.show_all();
@@ -185,14 +185,14 @@ impl AppOp {
pub fn show_error_dialog_in_settings(&self, error: String) {
let dialog = self.create_error_dialog(error);
- dialog.connect_response(move |w, _| w.destroy());
+ dialog.connect_response(move |w, _| w.close());
self.get_three_pid();
dialog.show_all();
}
pub fn show_load_settings_error_dialog(&self, error: String) {
let dialog = self.create_error_dialog(error);
- dialog.connect_response(move |w, _| w.destroy());
+ dialog.connect_response(move |w, _| w.close());
dialog.show_all();
}
@@ -811,7 +811,7 @@ impl AppOp {
}
});
}
- w.destroy();
+ w.close();
});
dialog.show_all();
}
diff --git a/fractal-gtk/src/appop/attach.rs b/fractal-gtk/src/appop/attach.rs
index c5dc844c..44315b98 100644
--- a/fractal-gtk/src/appop/attach.rs
+++ b/fractal-gtk/src/appop/attach.rs
@@ -59,14 +59,14 @@ impl AppOp {
headerbar.show_all();
closebtn.connect_clicked(clone!(@strong dialog => move |_| {
- dialog.destroy();
+ dialog.close();
}));
/* FIXME: make this a action */
okbtn.connect_clicked(clone!(@strong pixb, @strong dialog => move |_| {
if let Ok(path) = store_pixbuf(&pixb) {
APPOP!(attach_message, (path))
}
- dialog.destroy();
+ dialog.close();
}));
okbtn.grab_focus();
diff --git a/fractal-gtk/src/appop/message.rs b/fractal-gtk/src/appop/message.rs
index 32de2443..b0536fad 100644
--- a/fractal-gtk/src/appop/message.rs
+++ b/fractal-gtk/src/appop/message.rs
@@ -101,7 +101,9 @@ impl AppOp {
pub fn clear_tmp_msgs(&mut self) {
for t in self.msg_queue.iter_mut() {
if let Some(ref w) = t.widget {
- w.destroy();
+ unsafe {
+ w.destroy();
+ }
}
t.widget = None;
}
@@ -183,7 +185,9 @@ impl AppOp {
pub fn msg_sent(&mut self, _txid: String, evid: Option<EventId>) {
if let Some(ref mut m) = self.msg_queue.pop() {
if let Some(ref w) = m.widget {
- w.destroy();
+ unsafe {
+ w.destroy();
+ }
}
m.widget = None;
m.msg.id = evid;
@@ -358,7 +362,7 @@ impl AppOp {
if let Some(i) = p {
let w = self.msg_queue.remove(i);
if let Some(w) = w.widget {
- w.destroy()
+ unsafe { w.destroy() }
}
}
self.add_tmp_room_message(msg);
diff --git a/fractal-gtk/src/widgets/divider.rs b/fractal-gtk/src/widgets/divider.rs
index 6af7504f..17efdbbd 100644
--- a/fractal-gtk/src/widgets/divider.rs
+++ b/fractal-gtk/src/widgets/divider.rs
@@ -56,7 +56,7 @@ impl NewMessageDivider {
revealer.connect_property_child_revealed_notify(clone!(
@weak row as r
=> move |_| {
- r.destroy();
+ unsafe { r.destroy(); }
remove_divider();
}));
NewMessageDivider {
diff --git a/fractal-gtk/src/widgets/error_dialog.rs b/fractal-gtk/src/widgets/error_dialog.rs
index 3bb50792..4465a2a0 100644
--- a/fractal-gtk/src/widgets/error_dialog.rs
+++ b/fractal-gtk/src/widgets/error_dialog.rs
@@ -18,7 +18,7 @@ pub fn new(fatal: bool, text: &str) -> gtk::MessageDialog {
);
let app_weak = app.downgrade();
dialog.connect_response(move |dialog, _| {
- dialog.destroy();
+ dialog.close();
if let (Some(app), true) = (app_weak.upgrade(), fatal) {
app.quit();
diff --git a/fractal-gtk/src/widgets/message.rs b/fractal-gtk/src/widgets/message.rs
index 73970ebb..44b9d11b 100644
--- a/fractal-gtk/src/widgets/message.rs
+++ b/fractal-gtk/src/widgets/message.rs
@@ -158,7 +158,9 @@ impl MessageBox {
self.small_widget(thread_pool, &msg)
};
if let Some(eb) = self.eventbox.get_child() {
- eb.destroy(); // clean the eventbox
+ unsafe {
+ eb.destroy();
+ } // clean the eventbox
}
self.eventbox.add(&w);
self.row.show_all();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]