static void custom_app_set_cb (GtkFileChooserButton *button, gpointer user_data) { NemoMimeApplicationChooser *chooser = user_data; gchar *unescaped = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (button)); gchar *escaped = eel_str_escape_spaces (unescaped); gtk_entry_set_text (GTK_ENTRY (chooser->details->custom_entry), escaped); g_free (unescaped); g_free (escaped); }
static gchar * get_path (NemoAction *action, NemoFile *file) { gchar *ret; if (action->escape_space) { gchar *path = nemo_file_get_path (file); ret = eel_str_escape_spaces (path); g_free (path); } else { ret = nemo_file_get_path (file); } return ret; }
static gchar * get_device_path (NemoAction *action, NemoFile *file) { GMount *mount = nemo_file_get_mount (file); GVolume *volume = g_mount_get_volume (mount); gchar *ret = NULL; if (action->escape_space) { gchar *id = g_volume_get_identifier (volume, G_VOLUME_IDENTIFIER_KIND_UNIX_DEVICE); ret = eel_str_escape_spaces (id); g_free (id); } else { ret = g_volume_get_identifier (volume, G_VOLUME_IDENTIFIER_KIND_UNIX_DEVICE); } g_object_unref (mount); g_object_unref (volume); return ret; }