[gthumb] contact sheet: set the current directory as destination if possible
- From: Paolo Bacchilega <paobac src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gthumb] contact sheet: set the current directory as destination if possible
- Date: Thu, 10 Jan 2019 18:17:43 +0000 (UTC)
commit db830e78c49f72f40e1494f9e75ee1d9ed54a838
Author: Paolo Bacchilega <paobac src gnome org>
Date: Sat Jan 5 11:05:18 2019 +0100
contact sheet: set the current directory as destination if possible
otherwise set the last used directory
extensions/contact_sheet/dlg-contact-sheet.c | 16 ++++++++--------
extensions/contact_sheet/dlg-image-wall.c | 16 ++++++++--------
2 files changed, 16 insertions(+), 16 deletions(-)
---
diff --git a/extensions/contact_sheet/dlg-contact-sheet.c b/extensions/contact_sheet/dlg-contact-sheet.c
index 0297e0db..18c6a922 100644
--- a/extensions/contact_sheet/dlg-contact-sheet.c
+++ b/extensions/contact_sheet/dlg-contact-sheet.c
@@ -687,6 +687,7 @@ dlg_contact_sheet (GthBrowser *browser,
GList *sort_types;
GList *scan;
char *caption;
+ GFile *location;
char *s_value;
char *default_mime_type;
GArray *savers;
@@ -733,14 +734,13 @@ dlg_contact_sheet (GthBrowser *browser,
gtk_entry_set_text (GTK_ENTRY (GET_WIDGET ("footer_entry")), s_value);
g_free (s_value);
- s_value = _g_settings_get_uri (data->settings, PREF_CONTACT_SHEET_DESTINATION);
- if (s_value == NULL) {
- GFile *location = gth_browser_get_location (data->browser);
- if (location != NULL)
- s_value = g_file_get_uri (location);
- else
- s_value = g_strdup (get_home_uri ());
- }
+ location = gth_browser_get_location (data->browser);
+ if ((location != NULL) && g_file_has_uri_scheme (location, 'file'))
+ s_value = g_file_get_uri (location);
+ else
+ s_value = _g_settings_get_uri (data->settings, PREF_CONTACT_SHEET_DESTINATION);
+ if (s_value == NULL)
+ s_value = g_strdup (get_home_uri ());
gtk_file_chooser_set_uri (GTK_FILE_CHOOSER (GET_WIDGET ("destination_filechooserbutton")), s_value);
g_free (s_value);
diff --git a/extensions/contact_sheet/dlg-image-wall.c b/extensions/contact_sheet/dlg-image-wall.c
index d3095d1b..4df354fa 100644
--- a/extensions/contact_sheet/dlg-image-wall.c
+++ b/extensions/contact_sheet/dlg-image-wall.c
@@ -223,6 +223,7 @@ dlg_image_wall (GthBrowser *browser,
char *default_sort_type;
GList *sort_types;
GList *scan;
+ GFile *location;
char *s_value;
char *default_mime_type;
GArray *savers;
@@ -258,14 +259,13 @@ dlg_image_wall (GthBrowser *browser,
/* Set widgets data. */
- s_value = _g_settings_get_uri (data->settings, PREF_IMAGE_WALL_DESTINATION);
- if (s_value == NULL) {
- GFile *location = gth_browser_get_location (data->browser);
- if (location != NULL)
- s_value = g_file_get_uri (location);
- else
- s_value = g_strdup (get_home_uri ());
- }
+ location = gth_browser_get_location (data->browser);
+ if (location != NULL)
+ s_value = g_file_get_uri (location);
+ else
+ s_value = _g_settings_get_uri (data->settings, PREF_IMAGE_WALL_DESTINATION);
+ if (s_value == NULL)
+ s_value = g_strdup (get_home_uri ());
gtk_file_chooser_set_uri (GTK_FILE_CHOOSER (GET_WIDGET ("destination_filechooserbutton")), s_value);
g_free (s_value);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]