[gthumb] Use file_data_set_path rather than setting fd->path directly
- From: Michael J. Chudobiak <mjc src gnome org>
- To: svn-commits-list gnome org
- Subject: [gthumb] Use file_data_set_path rather than setting fd->path directly
- Date: Wed, 6 May 2009 07:45:41 -0400 (EDT)
commit 06d9b5651d0d4bf14a252f38a65c9cb198ce5e8c
Author: Michael J. Chudobiak <mjc avtechpulse com>
Date: Wed May 6 07:44:58 2009 -0400
Use file_data_set_path rather than setting fd->path directly
---
libgthumb/file-data.c | 2 +-
libgthumb/thumb-loader.c | 4 ++--
src/gth-window-actions-callbacks.c | 5 ++---
3 files changed, 5 insertions(+), 6 deletions(-)
diff --git a/libgthumb/file-data.c b/libgthumb/file-data.c
index 08adaab..9d3159c 100644
--- a/libgthumb/file-data.c
+++ b/libgthumb/file-data.c
@@ -239,7 +239,7 @@ file_data_set_path (FileData *fd,
g_return_if_fail (path != NULL);
g_free (fd->path);
- fd->path = g_strdup (path);
+ fd->path = add_scheme_if_absent (path);
g_free (fd->utf8_path);
fd->utf8_path = get_utf8_display_name_from_uri (fd->path);
diff --git a/libgthumb/thumb-loader.c b/libgthumb/thumb-loader.c
index 579471e..9ad2b34 100644
--- a/libgthumb/thumb-loader.c
+++ b/libgthumb/thumb-loader.c
@@ -327,8 +327,8 @@ thumb_loader_set_file (ThumbLoader *tl,
tl->priv->file = file_data_dup (fd);
if (is_local_file (tl->priv->file->path)) {
char *resolved_path = NULL;
- if (resolve_all_symlinks (tl->priv->file->path, &resolved_path) == GNOME_VFS_OK)
- tl->priv->file->path = g_strdup (resolved_path);
+ if (resolve_all_symlinks (tl->priv->file->path, &resolved_path) == GNOME_VFS_OK)
+ file_data_set_path (tl->priv->file, resolved_path);
else {
file_data_unref (tl->priv->file);
tl->priv->file = NULL;
diff --git a/src/gth-window-actions-callbacks.c b/src/gth-window-actions-callbacks.c
index 9782b08..e59fe9a 100644
--- a/src/gth-window-actions-callbacks.c
+++ b/src/gth-window-actions-callbacks.c
@@ -246,9 +246,8 @@ gth_window_activate_action_file_print (GtkAction *action,
FileData *fd;
fd = file_data_dup (current->data);
- g_free (fd->path);
- fd->path = get_uri_from_local_path (tmp_filename);
- comment_copy (image_filename, fd->path);
+ file_data_set_path (fd, tmp_filename);
+ comment_copy (image_filename, fd->utf8_path);
}
print_catalog_dlg_full (GTK_WINDOW (window), list, print_done_cb, get_uri_from_local_path (tmp_filename));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]