[nautilus/wip/coreyberla/app-chooser-fixes: 2/6] app-chooser: Only emit "mime-data-changed" if it changed




commit 33e871b2daa8eb1d35884405f3b673d5edef252b
Author: Corey Berla <corey berla me>
Date:   Sun Aug 7 21:10:03 2022 -0700

    app-chooser: Only emit "mime-data-changed" if it changed

 src/nautilus-app-chooser.c | 3 ++-
 src/nautilus-files-view.c  | 2 --
 2 files changed, 2 insertions(+), 3 deletions(-)
---
diff --git a/src/nautilus-app-chooser.c b/src/nautilus-app-chooser.c
index 091f51160..19de95977 100644
--- a/src/nautilus-app-chooser.c
+++ b/src/nautilus-app-chooser.c
@@ -61,11 +61,13 @@ open_button_clicked_cb (GtkButton          *button,
         info = gtk_app_chooser_get_app_info (GTK_APP_CHOOSER (self->app_chooser_widget));
         g_app_info_set_as_default_for_type (info, self->content_type,
                                             &error);
+        g_signal_emit_by_name (nautilus_signaller_get_current (), "mime-data-changed");
     }
     else
     {
         g_app_info_reset_type_associations (self->content_type);
         gtk_app_chooser_refresh (GTK_APP_CHOOSER (self->app_chooser_widget));
+        g_signal_emit_by_name (nautilus_signaller_get_current (), "mime-data-changed");
     }
 
     if (error != NULL)
@@ -83,7 +85,6 @@ open_button_clicked_cb (GtkButton          *button,
     }
 
     gtk_app_chooser_refresh (GTK_APP_CHOOSER (self->app_chooser_widget));
-    g_signal_emit_by_name (nautilus_signaller_get_current (), "mime-data-changed");
 }
 
 static void
diff --git a/src/nautilus-files-view.c b/src/nautilus-files-view.c
index 937f9af7f..32f08cce6 100644
--- a/src/nautilus-files-view.c
+++ b/src/nautilus-files-view.c
@@ -1471,8 +1471,6 @@ app_chooser_dialog_response_cb (GtkDialog *dialog,
 
     info = nautilus_app_chooser_get_app_info (NAUTILUS_APP_CHOOSER (dialog));
 
-    g_signal_emit_by_name (nautilus_signaller_get_current (), "mime-data-changed");
-
     nautilus_launch_application (info, files, parent_window);
 
     g_object_unref (info);


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