[gthumb] Tidy up file_data_new* functions
- From: Michael J. Chudobiak <mjc src gnome org>
- To: svn-commits-list gnome org
- Subject: [gthumb] Tidy up file_data_new* functions
- Date: Sun, 7 Jun 2009 15:02:57 -0400 (EDT)
commit d3e52613bb7be68b85ffe317a439f75a9ce5f11e
Author: Michael J. Chudobiak <mjc avtechpulse com>
Date: Sun Jun 7 15:02:32 2009 -0400
Tidy up file_data_new* functions
---
libgthumb/catalog.c | 2 +-
libgthumb/comments.c | 8 ++--
libgthumb/dlg-save-image.c | 4 +-
libgthumb/file-data.c | 55 ++++++++++++----------------------
libgthumb/file-data.h | 2 +-
libgthumb/file-utils.c | 6 ++--
libgthumb/gfile-utils.c | 2 +-
libgthumb/gth-exif-utils.c | 4 +-
libgthumb/image-loader.c | 2 +-
libgthumb/image-viewer.c | 2 +-
libgthumb/jpegutils/jpegtran.c | 2 +-
libgthumb/thumb-cache.c | 2 +-
libgthumb/thumb-loader.c | 2 +-
src/catalog-png-exporter.c | 2 +-
src/catalog-web-exporter.c | 2 +-
src/dlg-comment.c | 6 ++--
src/dlg-convert.c | 2 +-
src/dlg-file-utils.c | 2 +-
src/dlg-image-prop.c | 2 +-
src/dlg-photo-importer.c | 10 +++---
src/dlg-scripts.c | 6 ++--
src/dlg-search.c | 2 +-
src/dlg-tags.c | 2 +-
src/dlg-web-exporter.c | 2 +-
src/gth-batch-op.c | 2 +-
src/gth-browser-actions-callbacks.c | 16 +++++-----
src/gth-browser.c | 4 +-
src/gth-fullscreen.c | 6 ++--
src/gth-viewer.c | 4 +-
src/gth-window-actions-callbacks.c | 4 +-
30 files changed, 76 insertions(+), 91 deletions(-)
diff --git a/libgthumb/catalog.c b/libgthumb/catalog.c
index 99501d9..d6c9d57 100644
--- a/libgthumb/catalog.c
+++ b/libgthumb/catalog.c
@@ -509,7 +509,7 @@ catalog_get_file_data_list (Catalog *catalog,
char *path = scan->data;
FileData *fd;
- fd = file_data_new (path);
+ fd = file_data_new_from_path (path);
if (file_filter (fd, TRUE, FALSE, fast_file_type))
list = g_list_prepend (list, fd);
}
diff --git a/libgthumb/comments.c b/libgthumb/comments.c
index 89a7507..1cbe5b6 100644
--- a/libgthumb/comments.c
+++ b/libgthumb/comments.c
@@ -343,7 +343,7 @@ load_comment_from_metadata (const char *uri)
GSList *metadata_list, *tmp;
char **keywords_v;
- file = file_data_new (uri);
+ file = file_data_new_from_path (uri);
file_data_update_all (file, FALSE);
data = comment_data_new ();
@@ -425,7 +425,7 @@ save_comment_to_metadata (const char *uri,
char *buf;
struct tm tm;
- file = file_data_new (uri);
+ file = file_data_new_from_path (uri);
file_data_update_all (file, FALSE);
add_metadata = simple_add_metadata (add_metadata, TAG_NAME_SETS[COMMENT_TAG_NAMES][0], data->comment);
@@ -469,7 +469,7 @@ load_comment_from_xml (const char *uri)
return NULL;
comment_uri = comments_get_comment_filename (uri, TRUE);
- fd = file_data_new (comment_uri);
+ fd = file_data_new_from_path (comment_uri);
g_free (comment_uri);
if (! path_is_file (fd->utf8_path) || ! file_data_has_local_path (fd, NULL)) {
@@ -580,7 +580,7 @@ save_comment (const char *uri,
/* Write to disk. */
comment_uri = comments_get_comment_filename (uri, TRUE);
- fd = file_data_new (comment_uri);
+ fd = file_data_new_from_path (comment_uri);
if (file_data_has_local_path (fd, NULL)) {
dest_dir = remove_level_from_path (fd->local_path);
diff --git a/libgthumb/dlg-save-image.c b/libgthumb/dlg-save-image.c
index 098d301..2b33795 100644
--- a/libgthumb/dlg-save-image.c
+++ b/libgthumb/dlg-save-image.c
@@ -126,7 +126,7 @@ save_image (GtkWindow *parent,
if (dlg_save_options (parent, image_type, &keys, &values)) {
FileData *fd_orig;
- fd_orig = file_data_new (original_file);
+ fd_orig = file_data_new_from_path (original_file);
if (file_data_has_local_path (file, parent) &&
file_data_has_local_path (fd_orig, parent)) {
@@ -187,7 +187,7 @@ file_save_ok_cb (GtkDialog *file_sel,
data = g_object_get_data (G_OBJECT (file_sel), "data");
original_file = g_object_get_data (G_OBJECT (file_sel), "uri");
- file = file_data_new (gtk_file_chooser_get_uri (GTK_FILE_CHOOSER (file_sel)));
+ file = file_data_new_from_path (gtk_file_chooser_get_uri (GTK_FILE_CHOOSER (file_sel)));
combo_box = g_object_get_data (G_OBJECT (file_sel), "combo_box");
idx = gtk_combo_box_get_active (GTK_COMBO_BOX (combo_box));
diff --git a/libgthumb/file-data.c b/libgthumb/file-data.c
index d635f42..68be117 100644
--- a/libgthumb/file-data.c
+++ b/libgthumb/file-data.c
@@ -116,19 +116,24 @@ load_info (FileData *fd)
}
-FileData *
-file_data_new_from_gfile (GFile *gfile)
+static FileData *
+file_data_new (GFile *gfile, const char *path)
{
- FileData *fd;
+ if (!gfile && !path)
+ return NULL;
- if (gfile == NULL)
- return NULL;
+ FileData *fd;
fd = g_new0 (FileData, 1);
fd->ref = 1;
- fd->gfile = gfile;
- g_object_ref (gfile);
+ if (gfile) {
+ fd->gfile = gfile;
+ g_object_ref (gfile);
+ } else {
+ fd->gfile = gfile_new (path);
+ }
+
fd->utf8_path = g_file_get_parse_name (fd->gfile);
fd->utf8_name = file_name_from_path (fd->utf8_path);
@@ -151,36 +156,16 @@ file_data_new_from_gfile (GFile *gfile)
FileData *
-file_data_new (const char *path)
+file_data_new_from_path (const char *path)
{
- FileData *fd;
-
- if (path == NULL)
- return NULL;
-
- fd = g_new0 (FileData, 1);
-
- fd->ref = 1;
-
- fd->gfile = gfile_new (path);
- fd->utf8_path = g_file_get_parse_name (fd->gfile);
- fd->utf8_name = file_name_from_path (fd->utf8_path);
-
- load_info (fd);
-
- /* The Exif DateTime tag is only recorded on an as-needed basis during
- DateTime sorts. The tag in memory is refreshed if the file mtime has
- changed, so it is recorded as well. */
-
- fd_free_metadata (fd);
+ return file_data_new (NULL, path);
+}
- fd->error = FALSE;
- fd->thumb_loaded = FALSE;
- fd->thumb_created = FALSE;
- fd->comment = g_strdup ("");
- fd->tags = g_strdup ("");
- return fd;
+FileData *
+file_data_new_from_gfile (GFile *gfile)
+{
+ return file_data_new (gfile, NULL);
}
@@ -337,7 +322,7 @@ file_data_list_from_uri_list (GList *list)
for (scan = list; scan; scan = scan->next) {
char *path = scan->data;
- result = g_list_prepend (result, file_data_new (path));
+ result = g_list_prepend (result, file_data_new_from_path (path));
}
return g_list_reverse (result);
diff --git a/libgthumb/file-data.h b/libgthumb/file-data.h
index 71aacfe..fa00b18 100644
--- a/libgthumb/file-data.h
+++ b/libgthumb/file-data.h
@@ -67,7 +67,7 @@ typedef struct {
GType file_data_get_type (void);
FileData * file_data_new_from_gfile (GFile *gfile);
-FileData * file_data_new (const char *path);
+FileData * file_data_new_from_path (const char *path);
FileData * file_data_dup (FileData *fd);
FileData * file_data_ref (FileData *fd);
void file_data_unref (FileData *fd);
diff --git a/libgthumb/file-utils.c b/libgthumb/file-utils.c
index 1c83952..3893687 100644
--- a/libgthumb/file-utils.c
+++ b/libgthumb/file-utils.c
@@ -149,7 +149,7 @@ path_list_classify_files_cb (gpointer data)
case G_FILE_TYPE_REGULAR:
child = g_file_get_child (pli->gfile, g_file_info_get_name (info));
uri_txt = g_file_get_uri (child);
- file = file_data_new (uri_txt);
+ file = file_data_new_from_path (uri_txt);
if ((pli->filter_func != NULL) && pli->filter_func (pli, file, pli->filter_data))
pli->files = g_list_prepend (pli->files, file);
else
@@ -703,7 +703,7 @@ delete_thumbnail (const char *path)
char *normal_thumbnail;
FileData *fd;
- fd = file_data_new (path);
+ fd = file_data_new_from_path (path);
/* delete associated thumbnails, if present */
large_thumbnail = gnome_thumbnail_path_for_uri (fd->uri, GNOME_THUMBNAIL_SIZE_LARGE);
@@ -2426,7 +2426,7 @@ gth_pixbuf_new_from_video (FileData *file,
file->mtime);
if (thumbnail_uri != NULL) {
FileData *fd_thumb;
- fd_thumb = file_data_new (thumbnail_uri);
+ fd_thumb = file_data_new_from_path (thumbnail_uri);
pixbuf = gdk_pixbuf_new_from_file (fd_thumb->local_path, error);
file_data_unref (fd_thumb);
}
diff --git a/libgthumb/gfile-utils.c b/libgthumb/gfile-utils.c
index 300dbc9..fc863a7 100644
--- a/libgthumb/gfile-utils.c
+++ b/libgthumb/gfile-utils.c
@@ -702,7 +702,7 @@ gfile_path_list_new (GFile *gfile,
break;
case G_FILE_TYPE_REGULAR:
if (files) {
- f_list = g_list_prepend (f_list, file_data_new (uri));
+ f_list = g_list_prepend (f_list, file_data_new_from_path (uri));
}
break;
default:
diff --git a/libgthumb/gth-exif-utils.c b/libgthumb/gth-exif-utils.c
index e439a62..a4a7ce0 100644
--- a/libgthumb/gth-exif-utils.c
+++ b/libgthumb/gth-exif-utils.c
@@ -426,8 +426,8 @@ update_and_save_metadata (const char *uri_src,
FileData *from_fd;
FileData *to_fd;
- from_fd = file_data_new (uri_src);
- to_fd = file_data_new (uri_dest);
+ from_fd = file_data_new_from_path (uri_src);
+ to_fd = file_data_new_from_path (uri_dest);
update_and_save_metadata_fd (from_fd, to_fd, metadata);
diff --git a/libgthumb/image-loader.c b/libgthumb/image-loader.c
index 70ec7e6..26a3098 100644
--- a/libgthumb/image-loader.c
+++ b/libgthumb/image-loader.c
@@ -392,7 +392,7 @@ image_loader_set_path (ImageLoader *il,
{
FileData *file;
- file = file_data_new (path);
+ file = file_data_new_from_path (path);
if (mime_type != NULL)
file->mime_type = get_static_string (mime_type);
else
diff --git a/libgthumb/image-viewer.c b/libgthumb/image-viewer.c
index 53b50c3..59c853c 100644
--- a/libgthumb/image-viewer.c
+++ b/libgthumb/image-viewer.c
@@ -1221,7 +1221,7 @@ image_viewer_load_image_from_uri (ImageViewer *viewer,
lidata = g_new (LoadImageData, 1);
lidata->viewer = viewer;
- lidata->file = file_data_new (path);
+ lidata->file = file_data_new_from_path (path);
image_loader_stop (priv->loader, (DoneFunc) load_image__step2, lidata);
}
diff --git a/libgthumb/jpegutils/jpegtran.c b/libgthumb/jpegutils/jpegtran.c
index ca91039..788b19b 100644
--- a/libgthumb/jpegutils/jpegtran.c
+++ b/libgthumb/jpegutils/jpegtran.c
@@ -347,7 +347,7 @@ jpegtran (const char *input_filename,
fclose (output_file);
/* Update Exif data */
- FileData *file = file_data_new (output_filename);
+ FileData *file = file_data_new_from_path (output_filename);
file_data_update_all (file, FALSE);
update_metadata (file);
update_exif_dimensions (file->metadata, transformation);
diff --git a/libgthumb/thumb-cache.c b/libgthumb/thumb-cache.c
index 41cf496..eab2a63 100644
--- a/libgthumb/thumb-cache.c
+++ b/libgthumb/thumb-cache.c
@@ -52,7 +52,7 @@ cache_get_nautilus_cache_name (const char *path)
char *retval;
FileData *fd;
- fd = file_data_new (path);
+ fd = file_data_new_from_path (path);
retval = gnome_thumbnail_path_for_uri (fd->uri, GNOME_THUMBNAIL_SIZE_NORMAL);
file_data_unref (fd);
diff --git a/libgthumb/thumb-loader.c b/libgthumb/thumb-loader.c
index e30f447..dbe75cd 100644
--- a/libgthumb/thumb-loader.c
+++ b/libgthumb/thumb-loader.c
@@ -343,7 +343,7 @@ thumb_loader_set_path (ThumbLoader *tl,
g_return_if_fail (tl != NULL);
g_return_if_fail (path != NULL);
- fd = file_data_new (path);
+ fd = file_data_new_from_path (path);
file_data_update (fd);
thumb_loader_set_file (tl, fd);
}
diff --git a/src/catalog-png-exporter.c b/src/catalog-png-exporter.c
index 7953e2a..995f017 100644
--- a/src/catalog-png-exporter.c
+++ b/src/catalog-png-exporter.c
@@ -1672,7 +1672,7 @@ end_page (CatalogPngExporter *ce,
name = _g_get_name_from_template (ce->templatev, ce->start_at + page_n - 1);
uri = g_strconcat (ce->location, "/", name, ".", ce->file_type, NULL);
- fd = file_data_new (uri);
+ fd = file_data_new_from_path (uri);
if (file_data_has_local_path (fd, NULL)) {
if (strcmp (ce->file_type, "jpeg") == 0)
_gdk_pixbuf_save (pixbuf, fd->local_path, NULL, "jpeg", NULL, "quality", "85", NULL);
diff --git a/src/catalog-web-exporter.c b/src/catalog-web-exporter.c
index 9f03fa4..aa5d4a3 100644
--- a/src/catalog-web-exporter.c
+++ b/src/catalog-web-exporter.c
@@ -2630,7 +2630,7 @@ export__copy_image (CatalogWebExporter *ce)
GthTransform transform;
FileData *fd;
- fd = file_data_new (uri);
+ fd = file_data_new_from_path (uri);
transform = get_orientation_from_fd (fd);
if (transform > 1) {
diff --git a/src/dlg-comment.c b/src/dlg-comment.c
index 78628d3..199b565 100644
--- a/src/dlg-comment.c
+++ b/src/dlg-comment.c
@@ -141,7 +141,7 @@ get_requested_time (DialogData *data,
FileData *file;
- file = file_data_new (filename);
+ file = file_data_new_from_path (filename);
file_data_update_all (file, FALSE);
switch (idx) {
@@ -297,7 +297,7 @@ date_optionmenu_changed_cb (GtkOptionMenu *option_menu,
gtk_widget_set_sensitive (data->date_dateedit, idx == FOLLOWING_DATE);
- file = file_data_new (first_image);
+ file = file_data_new_from_path (first_image);
file_data_update_all (file, FALSE);
switch (idx) {
@@ -479,7 +479,7 @@ dlg_comment_update (GtkWidget *dlg)
data->have_exif_data = FALSE;
for (scan = data->file_list; scan; scan = scan->next) {
FileData *file;
- file = file_data_new (scan->data);
+ file = file_data_new_from_path (scan->data);
file_data_update_all (file, FALSE);
if (get_exif_time (file)) {
data->have_exif_data = TRUE;
diff --git a/src/dlg-convert.c b/src/dlg-convert.c
index c238115..b8fa5bf 100644
--- a/src/dlg-convert.c
+++ b/src/dlg-convert.c
@@ -227,7 +227,7 @@ save_image_and_remove_original (DialogData *data)
FileData *fd_old;
fd_old = (FileData*) data->current_image->data;
- fd_new = file_data_new (data->new_path);
+ fd_new = file_data_new_from_path (data->new_path);
if (file_data_has_local_path (fd_old, GTK_WINDOW (data->dialog)) &&
file_data_has_local_path (fd_new, GTK_WINDOW (data->dialog))) {
diff --git a/src/dlg-file-utils.c b/src/dlg-file-utils.c
index 519b4fb..7026f29 100644
--- a/src/dlg-file-utils.c
+++ b/src/dlg-file-utils.c
@@ -553,7 +553,7 @@ set_filename_labels (GladeXML *gui,
char *file_size_txt;
FileData *fd;
- fd = file_data_new (filename);
+ fd = file_data_new_from_path (filename);
label = glade_xml_get_widget (gui, filename_widget);
eventbox = glade_xml_get_widget (gui, filename_eventbox);
diff --git a/src/dlg-image-prop.c b/src/dlg-image-prop.c
index e11e38a..bdd5ec7 100644
--- a/src/dlg-image-prop.c
+++ b/src/dlg-image-prop.c
@@ -401,7 +401,7 @@ update_general_info (DialogData *data)
} else {
FileData *fd;
- fd = file_data_new (image_filename);
+ fd = file_data_new_from_path (image_filename);
gtk_label_set_text (GTK_LABEL (data->i_name_label), fd->utf8_name);
diff --git a/src/dlg-photo-importer.c b/src/dlg-photo-importer.c
index 83bffb9..aeddfa5 100644
--- a/src/dlg-photo-importer.c
+++ b/src/dlg-photo-importer.c
@@ -958,7 +958,7 @@ adjust_orientation__step (AsyncOperationData *aodata,
FileData *fd;
GthTransform transform;
- fd = file_data_new (uri);
+ fd = file_data_new_from_path (uri);
if (data->msg_text != NULL)
g_free (data->msg_text);
data->msg_text = g_strdup_printf (_("Adjusting orientation of \'%s\'."), fd->utf8_name);
@@ -1045,7 +1045,7 @@ save_images__step (AsyncOperationData *aodata,
char *path = g_file_get_parse_name (gfile);
subfolder_value = gtk_combo_box_get_active (GTK_COMBO_BOX (data->subfolder_combobox));
- folder_fd = file_data_new (data->main_dest_folder);
+ folder_fd = file_data_new_from_path (data->main_dest_folder);
/* When grouping by exif date, we need a temporary directory to upload the
photo to. The exif date tags are then read, and the file is then moved
@@ -1087,7 +1087,7 @@ save_images__step (AsyncOperationData *aodata,
FileData *file;
/* Name a subfolder based on the exif date */
- file = file_data_new (initial_dest_path);
+ file = file_data_new_from_path (initial_dest_path);
file_data_update_all (file, FALSE);
exif_date = get_exif_time_or_mtime (file);
file_data_unref (file);
@@ -1311,7 +1311,7 @@ ok_clicked_cb (GtkButton *button,
return;
}
- folder_fd = file_data_new (data->main_dest_folder);
+ folder_fd = file_data_new_from_path (data->main_dest_folder);
if (!file_data_has_local_path (folder_fd, GTK_WINDOW (data->dialog)) ||
!ensure_dir_exists (folder_fd->local_path)) {
char *msg;
@@ -1333,7 +1333,7 @@ ok_clicked_cb (GtkButton *button,
const char *utf8_path = scan->data;
FileData *fd;
- fd = file_data_new (utf8_path);
+ fd = file_data_new_from_path (utf8_path);
total_size += fd->size;
file_data_unref (fd);
}
diff --git a/src/dlg-scripts.c b/src/dlg-scripts.c
index 5cd9c8c..18c23f0 100644
--- a/src/dlg-scripts.c
+++ b/src/dlg-scripts.c
@@ -245,7 +245,7 @@ char* get_date_strings (GtkWindow *window,
if (!prompt_mode) {
const gint date_str_replacement_size = date_str->len + 128;
- FileData* fd = file_data_new (filename);
+ FileData* fd = file_data_new_from_path (filename);
time_t exif_time = get_exif_time_or_mtime (fd);
file_data_unref(fd);
@@ -571,7 +571,7 @@ exec_shell_script (GtkWindow *window,
char *new_file_list;
FileData *fd;
- fd = file_data_new (scan->data);
+ fd = file_data_new_from_path (scan->data);
if (fd->local_path != NULL)
e_filename = shell_escape (fd->local_path);
@@ -630,7 +630,7 @@ exec_shell_script (GtkWindow *window,
load_thumbnail (data, scan->data);
- fd = file_data_new (scan->data);
+ fd = file_data_new_from_path (scan->data);
if (fd->local_path != NULL)
filename = g_strdup (fd->local_path);
else
diff --git a/src/dlg-search.c b/src/dlg-search.c
index 9115ee9..b19bb4b 100644
--- a/src/dlg-search.c
+++ b/src/dlg-search.c
@@ -1031,7 +1031,7 @@ directory_load_cb (GnomeVFSAsyncHandle *handle,
if (file_respects_search_criteria (data, unesc_uri)) {
FileData *file;
- file = file_data_new (str_uri);
+ file = file_data_new_from_path (str_uri);
file_data_update_mime_type (file, data->fast_file_type);
files = g_list_prepend (files, file);
}
diff --git a/src/dlg-tags.c b/src/dlg-tags.c
index a818deb..3bc9d36 100644
--- a/src/dlg-tags.c
+++ b/src/dlg-tags.c
@@ -597,7 +597,7 @@ dlg_choose_tags (GtkWindow *parent,
GList *fd_list = NULL, *tmp;
for (tmp = file_list; tmp; tmp = tmp->next)
- fd_list = g_list_prepend (fd_list, file_data_new (tmp->data));
+ fd_list = g_list_prepend (fd_list, file_data_new_from_path (tmp->data));
dlg_tags_common (parent,
NULL,
diff --git a/src/dlg-web-exporter.c b/src/dlg-web-exporter.c
index 4f2e047..5cca69d 100644
--- a/src/dlg-web-exporter.c
+++ b/src/dlg-web-exporter.c
@@ -897,7 +897,7 @@ theme_dialog__sel_changed_cb (GtkTreeSelection *selection,
GdkPixbuf *image = NULL;
filename = build_uri (path, "preview.png", NULL);
- fd = file_data_new (filename);
+ fd = file_data_new_from_path (filename);
g_free (filename);
if (file_data_has_local_path (fd, NULL)
diff --git a/src/gth-batch-op.c b/src/gth-batch-op.c
index 232d7d0..4ff8938 100644
--- a/src/gth-batch-op.c
+++ b/src/gth-batch-op.c
@@ -448,7 +448,7 @@ pixbuf_op_done_cb (GthPixbufOp *pixop,
}
fd_old = (FileData*) PD(bop)->current_image->data;
- fd_new = file_data_new (PD(bop)->new_path);
+ fd_new = file_data_new_from_path (PD(bop)->new_path);
if (file_data_has_local_path (fd_new, PD(bop)->parent) &&
file_data_has_local_path (fd_old, PD(bop)->parent)) {
diff --git a/src/gth-browser-actions-callbacks.c b/src/gth-browser-actions-callbacks.c
index 287307f..c5b90de 100644
--- a/src/gth-browser-actions-callbacks.c
+++ b/src/gth-browser-actions-callbacks.c
@@ -449,7 +449,7 @@ catalog_rename (GthBrowser *browser,
return;
is_dir = path_is_dir (catalog_path);
- old_fd = file_data_new (catalog_path);
+ old_fd = file_data_new_from_path (catalog_path);
if (! is_dir)
name_only = remove_extension_from_path (old_fd->utf8_name);
@@ -487,7 +487,7 @@ catalog_rename (GthBrowser *browser,
g_free (path_only);
g_free (new_name);
- new_fd = file_data_new (new_catalog_path);
+ new_fd = file_data_new_from_path (new_catalog_path);
g_free (new_catalog_path);
if (path_is_file (new_fd->utf8_path)) {
@@ -676,7 +676,7 @@ gth_browser_activate_action_edit_current_catalog_new (GtkAction *action,
new_name,
CATALOG_EXT,
NULL);
- fd = file_data_new (new_catalog_path);
+ fd = file_data_new_from_path (new_catalog_path);
gfile = gfile_new (fd->utf8_path);
g_free (new_name);
g_free (new_catalog_path);
@@ -745,7 +745,7 @@ create_new_folder_or_library (GthBrowser *browser,
/* Create folder */
new_path = build_uri (current_path, new_name, NULL);
- fd = file_data_new (new_path);
+ fd = file_data_new_from_path (new_path);
g_free (new_path);
if (path_is_dir (fd->utf8_path)) {
@@ -914,7 +914,7 @@ folder_rename (GtkWindow *window,
if (old_path == NULL)
return;
- old_fd = file_data_new (old_path);
+ old_fd = file_data_new_from_path (old_path);
new_name = _gtk_request_dialog_run (window,
GTK_DIALOG_MODAL,
@@ -942,7 +942,7 @@ folder_rename (GtkWindow *window,
new_path = build_uri (parent_path, new_name, NULL);
g_free (new_name);
g_free (parent_path);
- new_fd = file_data_new (new_path);
+ new_fd = file_data_new_from_path (new_path);
g_free (new_path);
gth_monitor_pause ();
@@ -1198,8 +1198,8 @@ folder_copy__response_cb (GObject *object,
dir_name = file_name_from_path (old_path);
new_path = build_uri (dest_dir, dir_name, NULL);
- old_fd = file_data_new (old_path);
- new_fd = file_data_new (new_path);
+ old_fd = file_data_new_from_path (old_path);
+ new_fd = file_data_new_from_path (new_path);
message = move ? _("Could not move the folder \"%s\": %s") : _("Could not copy the folder \"%s\": %s");
diff --git a/src/gth-browser.c b/src/gth-browser.c
index 026252d..4c9cafb 100644
--- a/src/gth-browser.c
+++ b/src/gth-browser.c
@@ -5507,7 +5507,7 @@ gth_browser_notify_files_created (GthBrowser *browser,
if (same_uri (parent_dir, current_dir)) {
FileData *file;
- file = file_data_new (path);
+ file = file_data_new_from_path (path);
if (file_filter (file,
browser->priv->show_hidden_files,
browser->priv->show_only_images,
@@ -8377,7 +8377,7 @@ gth_browser_load_image_from_uri (GthBrowser *browser,
{
FileData *file;
- file = file_data_new (filename);
+ file = file_data_new_from_path (filename);
file_data_update_all (file, FALSE);
gth_browser_load_image (browser, file);
file_data_unref (file);
diff --git a/src/gth-fullscreen.c b/src/gth-fullscreen.c
index 70ffae2..1a33ff6 100644
--- a/src/gth-fullscreen.c
+++ b/src/gth-fullscreen.c
@@ -1369,7 +1369,7 @@ delete_list_from_file_list (GthFullscreen *fullscreen,
FileData *file;
GList *deleted;
- file = file_data_new (scan->data);
+ file = file_data_new_from_path (scan->data);
deleted = g_list_find_custom (fullscreen->priv->file_list,
file,
(GCompareFunc) filedatacmp);
@@ -1472,7 +1472,7 @@ monitor_file_renamed_cb (GthMonitor *monitor,
FileData *file;
GList *renamed_image;
- file = file_data_new (old_name);
+ file = file_data_new_from_path (old_name);
renamed_image = g_list_find_custom (fullscreen->priv->file_list,
file,
(GCompareFunc) filedatacmp);
@@ -1493,7 +1493,7 @@ monitor_file_renamed_cb (GthMonitor *monitor,
return;
file_data_unref (fullscreen->priv->file);
- fullscreen->priv->file = file_data_new (new_name);
+ fullscreen->priv->file = file_data_new_from_path (new_name);
file_data_update (fullscreen->priv->file);
load_current_image (fullscreen);
diff --git a/src/gth-viewer.c b/src/gth-viewer.c
index b35a6f2..bae6bd1 100644
--- a/src/gth-viewer.c
+++ b/src/gth-viewer.c
@@ -1683,7 +1683,7 @@ gth_viewer_construct (GthViewer *viewer,
/**/
if (filename != NULL) {
- priv->image = file_data_new (filename);
+ priv->image = file_data_new_from_path (filename);
file_data_update_all (priv->image, FALSE); /* FIXME: always slow mime type ? */
}
}
@@ -1750,7 +1750,7 @@ gth_viewer_load_from_uri (GthViewer *viewer,
{
FileData *file;
- file = file_data_new (uri);
+ file = file_data_new_from_path (uri);
file_data_update_all (file, FALSE); /* FIXME: always slow mime type ? */
gth_viewer_load (viewer, file);
file_data_unref (file);
diff --git a/src/gth-window-actions-callbacks.c b/src/gth-window-actions-callbacks.c
index bced265..29237ce 100644
--- a/src/gth-window-actions-callbacks.c
+++ b/src/gth-window-actions-callbacks.c
@@ -642,7 +642,7 @@ set_wallpaper_step_2 (const char *uri,
if (path_is_file (uri)) {
FileData *fd;
- fd = file_data_new (uri);
+ fd = file_data_new_from_path (uri);
if (file_data_has_local_path (fd, GTK_WINDOW (data->window)))
gconf_client_set_string (client,
"/desktop/gnome/background/picture_filename",
@@ -765,7 +765,7 @@ set_wallpaper_from_window (GthWindow *window,
wallpaper_filename = get_new_wallpaper_filename ();
- fd = file_data_new (wallpaper_filename);
+ fd = file_data_new_from_path (wallpaper_filename);
if (file_data_has_local_path (fd, GTK_WINDOW (window))) {
if (! _gdk_pixbuf_save (pixbuf,
fd->local_path,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]