[file-roller] Fixed crash when clicking the open button after creation



commit d5a34c6485f8efb133c42deabf6eb0a7363d8eb9
Author: Paolo Bacchilega <paobac src gnome org>
Date:   Sun Oct 27 09:46:05 2013 +0100

    Fixed crash when clicking the open button after creation
    
    [bug #710576]

 src/fr-window.c |   43 +++++--------------------------------------
 1 files changed, 5 insertions(+), 38 deletions(-)
---
diff --git a/src/fr-window.c b/src/fr-window.c
index cc5e46b..3c459f5 100644
--- a/src/fr-window.c
+++ b/src/fr-window.c
@@ -6194,43 +6194,19 @@ fr_window_archive_reload (FrWindow *window)
 #ifdef ENABLE_NOTIFICATION
 
 
-typedef struct {
-       FrWindow *window;
-       gboolean  window_closed;
-} NotifyData;
-
-
-static void
-notification_closed_cb  (NotifyNotification *notification,
-                        gpointer            user_data)
-{
-       NotifyData *notify_data = user_data;
-       FrWindow   *window = notify_data->window;
-
-       if (! notify_data->window_closed)
-               gtk_window_present (GTK_WINDOW (window->priv->progress_dialog));
-
-       g_free (notify_data);
-}
-
-
 static void
 notify_action_open_archive_cb (NotifyNotification *notification,
                               char               *action,
                               gpointer            user_data)
 {
-       NotifyData *notify_data = user_data;
-       FrWindow   *window = notify_data->window;
-       GtkWidget  *new_window;
+       GFile     *saved_file = user_data;
+       GtkWidget *new_window;
 
        new_window = fr_window_new ();
        gtk_widget_show (new_window);
        fr_window_archive_open (FR_WINDOW (new_window),
-                               window->priv->saving_file,
+                               saved_file,
                                GTK_WINDOW (new_window));
-
-       notify_data->window_closed = TRUE;
-       _fr_window_close_after_notification (window);
 }
 
 
@@ -6242,7 +6218,6 @@ _fr_window_notify_creation_complete (FrWindow *window)
        NotifyNotification *notification;
        gboolean            notification_supports_actions;
        GList              *caps;
-       NotifyData         *notify_data;
 
        basename = _g_file_get_display_basename (window->priv->saving_file);
        /* Translators: %s is a filename */
@@ -6250,14 +6225,6 @@ _fr_window_notify_creation_complete (FrWindow *window)
        notification = notify_notification_new (window->priv->batch_title, message, "file-roller");
        notify_notification_set_hint_string (notification, "desktop-entry", "file-roller");
 
-       notify_data = g_new0 (NotifyData, 1);
-       notify_data->window = window;
-       notify_data->window_closed = FALSE;
-       g_signal_connect (notification,
-                         "closed",
-                         G_CALLBACK (notification_closed_cb),
-                         notify_data);
-
        notification_supports_actions = FALSE;
        caps = notify_get_server_caps ();
        if (caps != NULL) {
@@ -6270,8 +6237,8 @@ _fr_window_notify_creation_complete (FrWindow *window)
                                                "document-open-symbolic",
                                                _("Open"),
                                                notify_action_open_archive_cb,
-                                               notify_data,
-                                               NULL);
+                                               g_object_ref (window->priv->saving_file),
+                                               g_object_unref);
                /*notify_notification_set_hint (notification,
                                              "action-icons",
                                              g_variant_new_boolean (TRUE));*/


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