[gnome-commander] search: update gnome_cmd_data.search_defaults.width & gnome_cmd_data.search_defaults.height during g



commit 023b2dbcd2c25cdd7b9bb5b9a6880b17fb63a458
Author: Piotr Eljasiak <epiotr src gnome org>
Date:   Tue May 3 23:02:47 2011 +0200

    search: update gnome_cmd_data.search_defaults.width & gnome_cmd_data.search_defaults.height
    during gnome_cmd_search_dialog_finalize() only

 src/gnome-cmd-search-dialog.cc |   13 +++++--------
 src/gnome-cmd-user-actions.cc  |    1 -
 2 files changed, 5 insertions(+), 9 deletions(-)
---
diff --git a/src/gnome-cmd-search-dialog.cc b/src/gnome-cmd-search-dialog.cc
index 9fdbf2a..29173d8 100755
--- a/src/gnome-cmd-search-dialog.cc
+++ b/src/gnome-cmd-search-dialog.cc
@@ -464,13 +464,6 @@ static void on_dialog_destroy (GnomeCmdSearchDialog *dialog, gpointer user_data)
 }
 
 
-static void on_dialog_size_allocate (GtkWidget *widget, GtkAllocation *allocation, GnomeCmdSearchDialog *dialog)
-{
-    gnome_cmd_data.search_defaults.width = allocation->width;
-    gnome_cmd_data.search_defaults.height = allocation->height;
-}
-
-
 static gboolean start_generic_search (SearchData *data)
 {
     // create an re for file name matching
@@ -718,6 +711,11 @@ static void combo_box_insert_text (gpointer  data, gpointer  user_data)
 static void gnome_cmd_search_dialog_finalize (GObject *object)
 {
     GnomeCmdSearchDialog *dialog = GNOME_CMD_SEARCH_DIALOG (object);
+    GtkAllocation allocation;
+
+    gtk_widget_get_allocation (GTK_WIDGET (dialog), &allocation);
+    gnome_cmd_data.search_defaults.width = allocation.width;
+    gnome_cmd_data.search_defaults.height = allocation.height;
 
     g_free (dialog->priv);
 
@@ -860,7 +858,6 @@ static void gnome_cmd_search_dialog_init (GnomeCmdSearchDialog *dialog)
 
 
     g_signal_connect (dialog, "destroy", G_CALLBACK (on_dialog_destroy), NULL);
-    g_signal_connect (dialog, "size-allocate", G_CALLBACK (on_dialog_size_allocate), NULL);
     g_signal_connect (dialog->priv->result_list, "key-press-event", G_CALLBACK (on_list_keypressed), dialog);
 
     g_signal_connect (dialog->priv->find_text_check, "toggled", G_CALLBACK (find_text_toggled), dialog);
diff --git a/src/gnome-cmd-user-actions.cc b/src/gnome-cmd-user-actions.cc
index 36a2ea9..a66799d 100644
--- a/src/gnome-cmd-user-actions.cc
+++ b/src/gnome-cmd-user-actions.cc
@@ -1006,7 +1006,6 @@ void edit_search (GtkMenuItem *menuitem, gpointer not_used)
 {
     GnomeCmdFileSelector *fs = get_fs (ACTIVE);
     GtkWidget *dialog = gnome_cmd_search_dialog_new (fs->get_directory());
-    g_object_ref (dialog);
     gtk_widget_show (dialog);
 }
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]