[nautilus-actions] NactICommandTab::legend_dialog_hide(): check that we have a GtkWindow
- From: Pierre Wieser <pwieser src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus-actions] NactICommandTab::legend_dialog_hide(): check that we have a GtkWindow
- Date: Thu, 12 Jan 2012 23:23:04 +0000 (UTC)
commit 2ad5043ec4e8278b78fbda45c0890064d4f0c03b
Author: Pierre Wieser <pwieser trychlos org>
Date: Thu Jan 12 23:47:42 2012 +0100
NactICommandTab::legend_dialog_hide(): check that we have a GtkWindow
ChangeLog | 3 +++
src/nact/nact-icommand-tab.c | 10 +++++++---
2 files changed, 10 insertions(+), 3 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 47fd623..e39d30b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
2012-01-12 Pierre Wieser <pwieser trychlos org>
+ * src/nact/nact-icommand-tab.c
+ (legend_dialog_hide): Check that legend_dialog is a GtkWindow.
+
* src/core/na-desktop-environment.c:
* src/core/na-desktop-environment.h: Fix comments.
diff --git a/src/nact/nact-icommand-tab.c b/src/nact/nact-icommand-tab.c
index 6871312..52c82c1 100644
--- a/src/nact/nact-icommand-tab.c
+++ b/src/nact/nact-icommand-tab.c
@@ -445,12 +445,14 @@ legend_dialog_hide( NactICommandTab *instance )
GtkButton *legend_button;
gboolean is_visible;
+ is_visible = FALSE;
legend_dialog = get_legend_dialog( instance );
- is_visible = ( gboolean ) GPOINTER_TO_INT(
- g_object_get_data( G_OBJECT( legend_dialog ), ICOMMAND_TAB_LEGEND_VISIBLE ));
+ if( GTK_IS_WINDOW( legend_dialog )){
+ is_visible = ( gboolean ) GPOINTER_TO_INT(
+ g_object_get_data( G_OBJECT( legend_dialog ), ICOMMAND_TAB_LEGEND_VISIBLE ));
+ }
if( is_visible ){
- g_return_if_fail( GTK_IS_WINDOW( legend_dialog ));
base_gtk_utils_save_window_position( BASE_WINDOW( instance ), NA_IPREFS_COMMAND_LEGEND_WSP );
gtk_widget_hide( GTK_WIDGET( legend_dialog ));
@@ -674,6 +676,8 @@ get_icommand_data( NactICommandTab *instance )
if( !data ){
data = g_new0( ICommandData, 1 );
+ /* g_object_set_data_full() would be called after the weak ref function
+ */
g_object_set_data( G_OBJECT( instance ), ICOMMAND_TAB_PROP_DATA, data );
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]