gthumb r2373 - in trunk: . libgthumb src
- From: mjc svn gnome org
- To: svn-commits-list gnome org
- Subject: gthumb r2373 - in trunk: . libgthumb src
- Date: Fri, 1 Aug 2008 12:55:05 +0000 (UTC)
Author: mjc
Date: Fri Aug 1 12:55:05 2008
New Revision: 2373
URL: http://svn.gnome.org/viewvc/gthumb?rev=2373&view=rev
Log:
2008-08-01 Michael J. Chudobiak <mjc svn gnome org>
Merge from gthumb-2-10:
* src/gth-browser.c (window_update_sensitivity): set only_one_is_selected
when n_selected is 1 (was 0).
Fixes bug: doesn't allow to go to the image destination folder from the
catalog list.
* libgthumb/thumb-loader.c (thumb_loader_start__step2): move the
5 seconds test after the valid failed thumbnail test.
* src/dlg-search.c (directory_load_cb): update the files mime type or the
thumbnail will not be created if necessary.
* libgthumb/comments.c (save_comment): just check if data is NULL
before saving (#543771).
* src/catalog-web-exporter.c (get_var_value): check whether
ce->eval_image is NULL before using it.
(export__save_html_files): init ce->eval_image to NULL.
Modified:
trunk/ChangeLog
trunk/libgthumb/comments.c
trunk/libgthumb/thumb-loader.c
trunk/src/catalog-png-exporter.c
trunk/src/catalog-web-exporter.c
trunk/src/dlg-search.c
trunk/src/dlg-web-exporter.c
trunk/src/gth-browser.c
trunk/src/gth-location.c
Modified: trunk/libgthumb/comments.c
==============================================================================
--- trunk/libgthumb/comments.c (original)
+++ trunk/libgthumb/comments.c Fri Aug 1 12:55:05 2008
@@ -579,17 +579,17 @@
char *dest_dir = NULL;
char *e_comment = NULL, *e_place = NULL, *e_keywords = NULL;
- if ((uri == NULL) || ! is_local_file (uri))
+ if ((data == NULL) || (uri == NULL) || ! is_local_file (uri))
return;
+ if (save_embedded)
+ save_comment_to_metadata (uri, data);
+
if (comment_data_is_void (data)) {
comment_delete (uri);
return;
}
- if (save_embedded)
- save_comment_to_metadata (uri, data);
-
/* Convert data to strings. */
time_str = g_strdup_printf ("%ld", data->time);
Modified: trunk/libgthumb/thumb-loader.c
==============================================================================
--- trunk/libgthumb/thumb-loader.c (original)
+++ trunk/libgthumb/thumb-loader.c Fri Aug 1 12:55:05 2008
@@ -387,11 +387,12 @@
tl->priv->file->path,
tl->priv->file->mtime);
- if ((cache_path == NULL) &&
- ((time (NULL) - tl->priv->file->mtime) > (time_t) 5) &&
- gnome_thumbnail_factory_has_valid_failed_thumbnail (tl->priv->thumb_factory,
- tl->priv->file->path,
- tl->priv->file->mtime)) {
+ if ((cache_path == NULL)
+ && gnome_thumbnail_factory_has_valid_failed_thumbnail (tl->priv->thumb_factory,
+ tl->priv->file->path,
+ tl->priv->file->mtime)
+ && ((time (NULL) - tl->priv->file->mtime) > (time_t) 5))
+ {
/* Use the existing "failed" thumbnail, if it is over
5 seconds old. Otherwise, try to thumbnail it again.
The minimum age requirement addresses bug 432759,
Modified: trunk/src/catalog-png-exporter.c
==============================================================================
--- trunk/src/catalog-png-exporter.c (original)
+++ trunk/src/catalog-png-exporter.c Fri Aug 1 12:55:05 2008
@@ -1456,9 +1456,10 @@
int h = gdk_pixbuf_get_height (pixbuf);
if (scale_keeping_ratio (&w, &h,
- ce->thumb_width,
- ce->thumb_height,
- FALSE)) {
+ ce->thumb_width,
+ ce->thumb_height,
+ FALSE))
+ {
GdkPixbuf *scaled;
scaled = gdk_pixbuf_scale_simple (pixbuf, w, h, GDK_INTERP_BILINEAR);
g_object_unref (idata->thumb);
Modified: trunk/src/catalog-web-exporter.c
==============================================================================
--- trunk/src/catalog-web-exporter.c (original)
+++ trunk/src/catalog-web-exporter.c Fri Aug 1 12:55:05 2008
@@ -780,6 +780,14 @@
}
+#define RETURN_IMAGE_FIELD(image, field) { \
+ if (image == NULL) \
+ return 0; \
+ else \
+ return image->field; \
+}
+
+
static int
get_var_value (const char *var_name,
gpointer data)
@@ -806,17 +814,17 @@
return GTH_VISIBILITY_ALWAYS;
else if (strcmp (var_name, "image_width") == 0)
- return ce->eval_image->image_width;
+ RETURN_IMAGE_FIELD (ce->eval_image, image_width)
else if (strcmp (var_name, "image_height") == 0)
- return ce->eval_image->image_height;
+ RETURN_IMAGE_FIELD (ce->eval_image, image_height)
else if (strcmp (var_name, "preview_width") == 0)
- return ce->eval_image->preview_width;
+ RETURN_IMAGE_FIELD (ce->eval_image, preview_width)
else if (strcmp (var_name, "preview_height") == 0)
- return ce->eval_image->preview_height;
+ RETURN_IMAGE_FIELD (ce->eval_image, preview_height)
else if (strcmp (var_name, "thumb_width") == 0)
- return ce->eval_image->thumb_width;
+ RETURN_IMAGE_FIELD (ce->eval_image, thumb_width)
else if (strcmp (var_name, "thumb_height") == 0)
- return ce->eval_image->thumb_height;
+ RETURN_IMAGE_FIELD (ce->eval_image, thumb_height)
else if (strcmp (var_name, "image_dim_visibility_index") == 0)
return ce->index_caption_mask & GTH_CAPTION_IMAGE_DIM;
@@ -1466,10 +1474,10 @@
max_size = gth_tag_get_var (ce, tag, "max_size");
if (max_size > 0)
scale_keeping_ratio (&image_width,
- &image_height,
- max_size,
- max_size,
- FALSE);
+ &image_height,
+ max_size,
+ max_size,
+ FALSE);
image_src_relative = get_path_relative_to_uri (image_src, relative_to);
src_attr = _g_escape_text_for_html (image_src_relative, -1);
@@ -1652,6 +1660,7 @@
idx = get_image_idx (tag, ce);
idata = g_list_nth (ce->file_list, idx)->data;
ce->eval_image = idata;
+
if (idata->date_time == NULL)
break;
@@ -1741,7 +1750,6 @@
}
}
write_line (" </tr>\n", fout);
-
}
break;
@@ -1873,6 +1881,7 @@
idx = MIN (ce->image, ce->n_images - 1);
idata = g_list_nth (ce->file_list, idx)->data;
ce->eval_image = idata;
+
for (scan = tag->value.cond_list; scan; scan = scan->next) {
GthCondition *cond = scan->data;
if (expression_value (ce, cond->expr) != 0) {
@@ -2328,6 +2337,7 @@
exporter_set_info (ce, _("Saving HTML pages: Indexes"));
ce->image = 0;
+ ce->eval_image = NULL;
ce->page = 0;
ce->saving_timeout = g_timeout_add (SAVING_TIMEOUT,
save_html_index_cb,
@@ -2622,9 +2632,10 @@
int h = gdk_pixbuf_get_height (pixbuf);
if (scale_keeping_ratio (&w, &h,
- ce->preview_max_width,
- ce->preview_max_height,
- FALSE)) {
+ ce->preview_max_width,
+ ce->preview_max_height,
+ FALSE))
+ {
GdkPixbuf *scaled;
scaled = pixbuf_scale (pixbuf, w, h, GDK_INTERP_BILINEAR);
g_object_unref (idata->preview);
@@ -2654,9 +2665,10 @@
int h = gdk_pixbuf_get_height (pixbuf);
if (scale_keeping_ratio (&w, &h,
- ce->thumb_width,
- ce->thumb_height,
- FALSE)) {
+ ce->thumb_width,
+ ce->thumb_height,
+ FALSE))
+ {
GdkPixbuf *scaled;
scaled = pixbuf_scale (pixbuf, w, h, GDK_INTERP_BILINEAR);
g_object_unref (idata->thumb);
Modified: trunk/src/dlg-search.c
==============================================================================
--- trunk/src/dlg-search.c (original)
+++ trunk/src/dlg-search.c Fri Aug 1 12:55:05 2008
@@ -142,6 +142,8 @@
GHashTable *folders_comment;
GHashTable *hidden_files;
GHashTable *visited_dirs;
+
+ gboolean fast_file_type;
} DialogData;
@@ -557,6 +559,7 @@
data->folders_comment = g_hash_table_new (g_str_hash, g_str_equal);
data->hidden_files = NULL;
data->visited_dirs = NULL;
+ data->fast_file_type = eel_gconf_get_boolean (PREF_FAST_FILE_TYPE, TRUE);
/* Get the widgets. */
@@ -1023,8 +1026,13 @@
str_uri = gnome_vfs_uri_to_string (full_uri, GNOME_VFS_URI_HIDE_NONE);
unesc_uri = gnome_vfs_unescape_string (str_uri, "");
- if (file_respects_search_criteria (data, unesc_uri))
- files = g_list_prepend (files, file_data_new (str_uri, info));
+ if (file_respects_search_criteria (data, unesc_uri)) {
+ FileData *file;
+
+ file = file_data_new (str_uri, info);
+ file_data_update_mime_type (file, data->fast_file_type);
+ files = g_list_prepend (files, file);
+ }
else
g_free (str_uri);
Modified: trunk/src/dlg-web-exporter.c
==============================================================================
--- trunk/src/dlg-web-exporter.c (original)
+++ trunk/src/dlg-web-exporter.c Fri Aug 1 12:55:05 2008
@@ -861,7 +861,7 @@
/* Permit VFS URIs */
gtk_file_chooser_set_local_only (GTK_FILE_CHOOSER (file_sel), FALSE);
gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (file_sel), g_get_home_dir ());
- gtk_dialog_set_default_response(GTK_DIALOG (file_sel), GTK_RESPONSE_ACCEPT);
+ gtk_dialog_set_default_response (GTK_DIALOG (file_sel), GTK_RESPONSE_ACCEPT);
g_object_set_data (G_OBJECT (file_sel), "theme_dialog_data", tdata);
Modified: trunk/src/gth-browser.c
==============================================================================
--- trunk/src/gth-browser.c (original)
+++ trunk/src/gth-browser.c Fri Aug 1 12:55:05 2008
@@ -819,7 +819,7 @@
n_selected = gth_file_view_get_n_selected (priv->file_list->view);
sel_not_null = n_selected > 0;
- only_one_is_selected = n_selected == 0;
+ only_one_is_selected = n_selected == 1;
image_is_void = image_viewer_is_void (IMAGE_VIEWER (priv->viewer));
image_is_ani = image_viewer_is_animation (IMAGE_VIEWER (priv->viewer));
playing = image_viewer_is_playing_animation (IMAGE_VIEWER (priv->viewer));
Modified: trunk/src/gth-location.c
==============================================================================
--- trunk/src/gth-location.c (original)
+++ trunk/src/gth-location.c Fri Aug 1 12:55:05 2008
@@ -225,7 +225,7 @@
gtk_file_chooser_set_local_only (GTK_FILE_CHOOSER (chooser), FALSE);
gtk_file_chooser_set_current_folder_uri (GTK_FILE_CHOOSER (chooser), gth_location_get_folder_uri (location));
- gtk_dialog_set_default_response(GTK_DIALOG (chooser), GTK_RESPONSE_OK);
+ gtk_dialog_set_default_response (GTK_DIALOG (chooser), GTK_RESPONSE_OK);
g_signal_connect (G_OBJECT (chooser),
"response",
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]