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




commit cf5f52ab9aeffcfeb7d2a4e2339d0dafb2463c4a
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 | 2 +-
 src/nautilus-files-view.c  | 2 --
 2 files changed, 1 insertion(+), 3 deletions(-)
---
diff --git a/src/nautilus-app-chooser.c b/src/nautilus-app-chooser.c
index 568d3d8c0..cf78ff038 100644
--- a/src/nautilus-app-chooser.c
+++ b/src/nautilus-app-chooser.c
@@ -65,6 +65,7 @@ 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");
     }
 
     if (error != NULL)
@@ -82,7 +83,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]