Skip to content

Commit

Permalink
Do not register "send to" as last used app (Bug #14118)
Browse files Browse the repository at this point in the history
I know this code doesn't look elegant, but it was the best
I could think of. Patches are welcome.
  • Loading branch information
Andre Miranda committed Jul 16, 2019
1 parent 9bdad84 commit 9c87733
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 5 additions & 2 deletions thunar/thunar-gio-extensions.c
Original file line number Diff line number Diff line change
Expand Up @@ -559,14 +559,16 @@ thunar_g_app_info_launch (GAppInfo *info,
gboolean result = FALSE;
gchar *new_path = NULL;
gchar *old_path = NULL;
gboolean update_app_info = TRUE;
gboolean skip_app_info_update;

_thunar_return_val_if_fail (G_IS_APP_INFO (info), FALSE);
_thunar_return_val_if_fail (working_directory == NULL || G_IS_FILE (working_directory), FALSE);
_thunar_return_val_if_fail (path_list != NULL, FALSE);
_thunar_return_val_if_fail (G_IS_APP_LAUNCH_CONTEXT (context), FALSE);
_thunar_return_val_if_fail (error == NULL || *error == NULL, FALSE);

skip_app_info_update = (g_object_get_data (G_OBJECT (info), "skip-app-info-update") != NULL);

/* check if we want to set the working directory of the spawned app */
if (working_directory != NULL)
{
Expand All @@ -590,11 +592,12 @@ thunar_g_app_info_launch (GAppInfo *info,
{
for (lp = path_list; lp != NULL; lp = lp->next)
{
gboolean update_app_info = !skip_app_info_update;

file = thunar_file_get (lp->data, NULL);
if (file == NULL)
continue;

update_app_info = TRUE;
content_type = thunar_file_get_content_type (file);

/* determine default application */
Expand Down
2 changes: 2 additions & 0 deletions thunar/thunar-launcher.c
Original file line number Diff line number Diff line change
Expand Up @@ -1772,6 +1772,7 @@ G_GNUC_BEGIN_IGNORE_DEPRECATIONS
/* allocate a new action for the device */
action = gtk_action_new (name, device_name, tooltip, NULL);
g_object_set_qdata_full (G_OBJECT (action), thunar_launcher_handler_quark, lp->data, g_object_unref);
g_object_set_data (G_OBJECT (lp->data), "skip-app-info-update", GUINT_TO_POINTER (1));
g_signal_connect (G_OBJECT (action), "activate", G_CALLBACK (thunar_launcher_action_sendto_device), launcher);
gtk_action_group_add_action (launcher->action_group, action);
gtk_ui_manager_add_ui (launcher->ui_manager, launcher->ui_addons_merge_id,
Expand Down Expand Up @@ -1829,6 +1830,7 @@ G_GNUC_BEGIN_IGNORE_DEPRECATIONS
action = gtk_action_new (name, label, tooltip, NULL);
gtk_action_set_gicon (action, g_app_info_get_icon (lp->data));
g_object_set_qdata_full (G_OBJECT (action), thunar_launcher_handler_quark, lp->data, g_object_unref);
g_object_set_data (G_OBJECT (lp->data), "skip-app-info-update", GUINT_TO_POINTER (1));
g_signal_connect (G_OBJECT (action), "activate", G_CALLBACK (thunar_launcher_action_open), launcher);
gtk_action_group_add_action (launcher->action_group, action);
gtk_ui_manager_add_ui (launcher->ui_manager, launcher->ui_addons_merge_id,
Expand Down

0 comments on commit 9c87733

Please sign in to comment.