diff --git a/ChangeLog b/ChangeLog index 543964736f2e6aa4266d49693f9d1dfd981585a2..8b40d7631cca8d8b5da30d1f84d16145a747337d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,24 @@ +2004-09-02 Paolo Bacchilega + + [ gthumb 2.5.1 released ] + +2004-09-01 Paolo Bacchilega + + * configure.in: updated required libraries versions. + + * src/fullscreen.c (create_popup_window): use stock icons for + previous and next image buttons. + +2004-08-31 Paolo Bacchilega + + * src/dlg-web-exporter.c (wa_destination_button_clicked_cb): + (theme_dialog__install_theme_clicked): + set the file chooser dialog modal. + + * src/gthumb-window.c (_window_add_monitor_event): fire + a CREATED event if a CHANGED event happended on a file not present + in the file list. + 2004-08-30 Paolo Bacchilega * src/fullscreen.c (fullscreen_start): fixed fullscreen mode. diff --git a/NEWS b/NEWS index b0086a1fb38221631ee6551e7e64477ad56d7ff4..2c8b721f2cbc684e7c7f2e8ba884bb4a854ae68b 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,11 @@ +version 2.5.1 +------------- + * Added supported mime types list to the .desktop file. + * Fixed bug #150729: Problems saving .JPEG images. + * Added a resize grip to the statubar. + * Added nautilus:required_directory_content_mime_types + attribute to the catalog view component. + version 2.5.0 ------------- * Use the Gtk+ UI Manager to handle menus and toolbar. diff --git a/README b/README index 67ac496aeda6dab3aa2d3f08c6a08e90ee8c29f8..e59d8392a4419cf0b70bdd5edd0139e08c3568f9 100644 --- a/README +++ b/README @@ -3,9 +3,6 @@ for the GNOME environment. Notes: - * more information about gthumb can be found at: - http://gthumb.sourceforge.net - * versions from 0.1 to 0.13 are for the GNOME 1.x environment. * versions from 1.100 to 2.0 are for the GNOME 2.0 environment, though @@ -14,6 +11,9 @@ Notes: * versions 2.2.0 and higher are for GNOME 2.2 and GNOME 2.4. + * more information about gthumb can be found at: + http://gthumb.sourceforge.net + What is gThumb ============== @@ -62,6 +62,7 @@ What is gThumb + Find duplicated images. + Maintenance tools: remove old comments; backup and restore comments; remove old thumbnails. + + Write images to CD/DVD. * gThumb is a Bonobo component diff --git a/configure.in b/configure.in index f6c58243ec3d26da4b6a43e7b2c29511a51d0bae..032ea803c070b401c748315df0f8b883e6c7aff6 100644 --- a/configure.in +++ b/configure.in @@ -2,7 +2,7 @@ dnl Process this file with autoconf to produce a configure script. AC_PREREQ(2.52) -AC_INIT(gthumb, 2.5.0, http://bugzilla.gnome.org/enter_bug.cgi?product=gthumb) +AC_INIT(gthumb, 2.5.1, http://bugzilla.gnome.org/enter_bug.cgi?product=gthumb) AC_CONFIG_SRCDIR(src/main.c) AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION) @@ -19,18 +19,18 @@ dnl it too, or it will never make it into the spec file! dnl dnl ========================================================================== -GLIB_REQUIRED=2.2.0 -GTK_REQUIRED=2.2.0 +GLIB_REQUIRED=2.4.0 +GTK_REQUIRED=2.4.0 LIBXML_REQUIRED=2.4.0 -LIBGNOME_REQUIRED=2.2.0 -LIBGNOMEUI_REQUIRED=2.2.0 -LIBGNOMECANVAS_REQUIRED=2.0.0 -GNOME_VFS_REQUIRED=2.1.3 -LIBGLADE_REQUIRED=2.0.0 -LIBGNOMEPRINT_REQUIRED=2.1.0 -LIBGNOMEPRINTUI_REQUIRED=2.1.0 -LIBBONOBO_REQUIRED=2.3.3 -LIBBONOBOUI_REQUIRED=2.3.3 +LIBGNOME_REQUIRED=2.6.0 +LIBGNOMEUI_REQUIRED=2.6.0 +LIBGNOMECANVAS_REQUIRED=2.6.0 +GNOME_VFS_REQUIRED=2.6.0 +LIBGLADE_REQUIRED=2.4.0 +LIBGNOMEPRINT_REQUIRED=2.6.0 +LIBGNOMEPRINTUI_REQUIRED=2.6.0 +LIBBONOBO_REQUIRED=2.6.0 +LIBBONOBOUI_REQUIRED=2.6.0 LIBEXIF_0_5_REQUIRED=0.5.12 LIBEXIF_REQUIRED=0.6.9 LIBGPHOTO_REQUIRED=2.1.3 diff --git a/libgthumb/comments.c b/libgthumb/comments.c index 47b768c7392c8cf3a18afb64b7aae80350ae86a9..a99ab85d4b24c22d195e8440147a11a05b800b00 100644 --- a/libgthumb/comments.c +++ b/libgthumb/comments.c @@ -187,7 +187,7 @@ comments_get_comment_filename__old (const char *source, NULL); if (!unescape) { - char *escaped_path = gnome_vfs_escape_host_and_path_string (path); + char *escaped_path = escape_uri (path); g_free (path); path = escaped_path; } @@ -274,7 +274,7 @@ comments_get_comment_filename (const char *source, path = g_build_filename (directory, ".comments", filename, NULL); if (!unescape) { - char *escaped_path = gnome_vfs_escape_host_and_path_string (path); + char *escaped_path = escape_uri (path); g_free (path); path = escaped_path; } diff --git a/libgthumb/file-data.c b/libgthumb/file-data.c index e92bb0b539328e7461b1feb85b0c0d633162507c..926b15478f600943c2ed03b2b8df51e09671115f 100644 --- a/libgthumb/file-data.c +++ b/libgthumb/file-data.c @@ -67,7 +67,7 @@ file_data_update (FileData *fd) g_return_if_fail (fd != NULL); - escaped = gnome_vfs_escape_host_and_path_string (fd->path); + escaped = escape_uri (fd->path); info = gnome_vfs_file_info_new (); result = gnome_vfs_get_file_info (escaped, info, diff --git a/libgthumb/file-utils.c b/libgthumb/file-utils.c index 51c0236fcfc9f88e7469ac3831843bf579dd2501..bb1b6da3cad265b7089b25d7761295ed82ecdbbc 100644 --- a/libgthumb/file-utils.c +++ b/libgthumb/file-utils.c @@ -192,7 +192,7 @@ path_list_async_new (const char *uri, pli = path_list_data_new (); - escaped = gnome_vfs_escape_host_and_path_string (uri); + escaped = escape_uri (uri); if (escaped == NULL) { path_list_data_free (pli); if (f != NULL) @@ -601,7 +601,7 @@ check_permissions (const char *path, int perm; info = gnome_vfs_file_info_new (); - escaped = gnome_vfs_escape_host_and_path_string (path); + escaped = escape_uri (path); result = gnome_vfs_get_file_info (escaped, info, (GNOME_VFS_FILE_INFO_DEFAULT @@ -642,10 +642,11 @@ path_is_file (const char *path) gboolean is_file; char *escaped; - if (! path || ! *path) return FALSE; + if (! path || ! *path) + return FALSE; info = gnome_vfs_file_info_new (); - escaped = gnome_vfs_escape_host_and_path_string (path); + escaped = escape_uri (path); result = gnome_vfs_get_file_info (escaped, info, @@ -662,6 +663,40 @@ path_is_file (const char *path) } +char * +escape_uri (const char *uri) +{ + const char *start = NULL; + const char *uri_no_method; + char *method; + char *epath, *euri; + + if (uri == NULL) + return NULL; + + start = strstr (uri, "://"); + if (start != NULL) { + uri_no_method = start + strlen ("://"); + method = g_strndup (uri, start - uri); + } else { + uri_no_method = uri; + method = NULL; + } + + epath = gnome_vfs_escape_host_and_path_string (uri_no_method); + + if (method != NULL) { + euri = g_strdup_printf ("%s://%s", method, epath); + g_free (epath); + } else + euri = epath; + + g_free (method); + + return euri; +} + + gboolean path_is_dir (const char *path) { @@ -674,7 +709,7 @@ path_is_dir (const char *path) return FALSE; info = gnome_vfs_file_info_new (); - escaped = gnome_vfs_escape_host_and_path_string (path); + escaped = escape_uri (path); result = gnome_vfs_get_file_info (escaped, info, @@ -726,7 +761,7 @@ get_file_size (const char *path) if (! path || ! *path) return 0; info = gnome_vfs_file_info_new (); - escaped = gnome_vfs_escape_host_and_path_string (path); + escaped = escape_uri (path); result = gnome_vfs_get_file_info (escaped, info, (GNOME_VFS_FILE_INFO_DEFAULT @@ -753,7 +788,7 @@ get_file_mtime (const char *path) if (! path || ! *path) return 0; info = gnome_vfs_file_info_new (); - escaped = gnome_vfs_escape_host_and_path_string (path); + escaped = escape_uri (path); result = gnome_vfs_get_file_info (escaped, info, (GNOME_VFS_FILE_INFO_DEFAULT @@ -781,7 +816,7 @@ get_file_ctime (const gchar *path) if (! path || ! *path) return 0; info = gnome_vfs_file_info_new (); - escaped = gnome_vfs_escape_host_and_path_string (path); + escaped = escape_uri (path); result = gnome_vfs_get_file_info (escaped, info, (GNOME_VFS_FILE_INFO_DEFAULT @@ -809,7 +844,7 @@ set_file_mtime (const gchar *path, file_info->mtime = mtime; file_info->atime = mtime; - escaped_path = gnome_vfs_escape_host_and_path_string (path); + escaped_path = escape_uri (path); gnome_vfs_set_file_info (escaped_path, file_info, GNOME_VFS_SET_FILE_INFO_TIME); @@ -1182,7 +1217,8 @@ ensure_dir_exists (const char *a_path, char *path; char *p; - if (! a_path) return FALSE; + if (! a_path) + return FALSE; if (path_is_dir (a_path)) return TRUE; @@ -1551,7 +1587,7 @@ new_uri_from_path (const char *path) char *uri_txt; GnomeVFSURI *uri; - escaped = gnome_vfs_escape_host_and_path_string (path); + escaped = escape_uri (path); if (escaped[0] == '/') uri_txt = g_strconcat ("file://", escaped, NULL); else diff --git a/libgthumb/file-utils.h b/libgthumb/file-utils.h index 894200307b94774f176b64a653ec057fcb33d55c..2e0511fc75ece8e2081ab0ee2455343fbcf38ff4 100644 --- a/libgthumb/file-utils.h +++ b/libgthumb/file-utils.h @@ -168,6 +168,8 @@ char* shell_escape (const char *filename); char * escape_underscore (const char *name); +char * escape_uri (const char *uri); + char * get_terminal (gboolean with_exec_flag); char * application_get_command (const GnomeVFSMimeApplication *app); diff --git a/libgthumb/gth-file-list.c b/libgthumb/gth-file-list.c index 4ea4ccb56f10988f44d4f53663385861f1ef0330..7f50f4e94ce2ec80b3063df0a5a7f71ba3e4cbee 100644 --- a/libgthumb/gth-file-list.c +++ b/libgthumb/gth-file-list.c @@ -539,7 +539,7 @@ gth_file_list_set_list (GthFileList *file_list, || ! file_is_image (full_path, fast_file_type)) continue; - escaped = gnome_vfs_escape_host_and_path_string (full_path); + escaped = escape_uri (full_path); uri = gnome_vfs_uri_new (escaped); g_free (escaped); @@ -782,7 +782,7 @@ gth_file_list_add_list (GthFileList *file_list, || ! file_is_image (full_path, eel_gconf_get_boolean (PREF_FAST_FILE_TYPE, TRUE))) continue; - escaped = gnome_vfs_escape_host_and_path_string (full_path); + escaped = escape_uri (full_path); uri = gnome_vfs_uri_new (escaped); g_free (escaped); diff --git a/libgthumb/icons/next-image-24.png b/libgthumb/icons/next-image-24.png index 9a60afdbed39d2cc61ae5ff31db97ca5ec382f65..da50e837eb7875260acfc9e96f5cfbe0af00ffb2 100644 Binary files a/libgthumb/icons/next-image-24.png and b/libgthumb/icons/next-image-24.png differ diff --git a/libgthumb/icons/prev-image-24.png b/libgthumb/icons/prev-image-24.png index 225d4ed0f76a169cd40c92bbea98cfd26ce60e5d..92b6edc7f53d12972571358344c3f3e8d6983fe7 100644 Binary files a/libgthumb/icons/prev-image-24.png and b/libgthumb/icons/prev-image-24.png differ diff --git a/libgthumb/jpeg-utils.c b/libgthumb/jpeg-utils.c index 096d06c900b813723efbb0993beb98e0d385b73d..87c71e79b0ee294395de6dc9439591b32ec6a2f8 100644 --- a/libgthumb/jpeg-utils.c +++ b/libgthumb/jpeg-utils.c @@ -41,6 +41,9 @@ #include #include +#include "file-utils.h" + + #define BUFFER_SIZE 8192 typedef struct { @@ -198,7 +201,7 @@ do_load_internal (const char *path, if (original_height_return != NULL) *original_height_return = 0; - e_path = gnome_vfs_escape_host_and_path_string (path); + e_path = escape_uri (path); if (e_path[0] == '/') uri = g_strconcat ("file://", e_path, NULL); else diff --git a/libgthumb/thumb-loader.c b/libgthumb/thumb-loader.c index 49903478bb1c7cdfcd29faffdad5f05bc8907c87..0077e0d2f4c6be68d214ac5cc0140fb02dbbb123 100644 --- a/libgthumb/thumb-loader.c +++ b/libgthumb/thumb-loader.c @@ -351,7 +351,7 @@ thumb_loader_set_path (ThumbLoader *tl, g_free (priv->uri); g_free (priv->path); - escaped_path = gnome_vfs_escape_host_and_path_string (path); + escaped_path = escape_uri (path); vfs_uri = gnome_vfs_uri_new (escaped_path); g_free (escaped_path); @@ -400,7 +400,7 @@ thumb_loader_get_uri (ThumbLoader *tl) priv = tl->priv; - escaped_path = gnome_vfs_escape_host_and_path_string (priv->path); + escaped_path = escape_uri (priv->path); uri = gnome_vfs_uri_new (escaped_path); g_free (escaped_path); diff --git a/src/catalog-web-exporter.c b/src/catalog-web-exporter.c index 0e0c01895d29ea9a3f82be4df920ba948414dd64..ff2bfa3c20b30bed8b04bdb4ba70d1a8a1345b2d 100644 --- a/src/catalog-web-exporter.c +++ b/src/catalog-web-exporter.c @@ -1039,7 +1039,7 @@ gth_parsed_doc_print (GList *document, image_src_relative = get_path_relative_to_dir (image_src, ce->location); - escaped_path = gnome_vfs_escape_host_and_path_string (image_src_relative); + escaped_path = escape_uri (image_src_relative); line = g_strdup_printf ("\"\"", escaped_path, @@ -1059,7 +1059,7 @@ gth_parsed_doc_print (GList *document, line = g_strconcat (file_name_from_path (idata->dest_filename), ".html", NULL); - escaped_path = gnome_vfs_escape_host_and_path_string (line); + escaped_path = escape_uri (line); g_free (line); line = escaped_path; @@ -1107,7 +1107,7 @@ gth_parsed_doc_print (GList *document, if (gth_tag_get_var (ce, tag, "utf8") != 0) write_locale_line (line, fout); else { - escaped_path = gnome_vfs_escape_host_and_path_string (line); + escaped_path = escape_uri (line); g_free (line); line = escaped_path; write_line (line, fout); @@ -1132,7 +1132,7 @@ gth_parsed_doc_print (GList *document, if (gth_tag_get_var (ce, tag, "utf8") != 0) write_locale_line (line, fout); else { - escaped_path = gnome_vfs_escape_host_and_path_string (line); + escaped_path = escape_uri (line); g_free (line); line = escaped_path; write_line (line, fout); diff --git a/src/dlg-duplicates.c b/src/dlg-duplicates.c index aa68632c5625337a23a206679209e8c929b0a8f3..7a7f309130998218c0f0325607824247840832b7 100644 --- a/src/dlg-duplicates.c +++ b/src/dlg-duplicates.c @@ -1568,7 +1568,7 @@ search_dir_async (DialogData *data, const char *path) if (data->uri != NULL) gnome_vfs_uri_unref (data->uri); - escaped = gnome_vfs_escape_host_and_path_string (path); + escaped = escape_uri (path); data->uri = gnome_vfs_uri_new (escaped); g_free (escaped); diff --git a/src/dlg-file-utils.c b/src/dlg-file-utils.c index 23cc449485c49ad83b0cb75fdf4a15b2a3c7cb58..af96c7b0a656dab6cba348860799d848f99aeeb9 100644 --- a/src/dlg-file-utils.c +++ b/src/dlg-file-utils.c @@ -1638,7 +1638,7 @@ dlg_files_move_to_trash (GThumbWindow *window, g_return_if_fail (file_list != NULL); - e_path = gnome_vfs_escape_host_and_path_string (file_list->data); + e_path = escape_uri (file_list->data); first_uri = gnome_vfs_uri_new (e_path); g_free (e_path); @@ -2276,7 +2276,7 @@ dlg_folder_move_to_trash (GThumbWindow *window, GnomeVFSURI *parent_uri, *trash_uri; parent_dir = remove_level_from_path (folder); - e_parent_dir = gnome_vfs_escape_host_and_path_string (parent_dir); + e_parent_dir = escape_uri (parent_dir); parent_uri = gnome_vfs_uri_new (e_parent_dir); gnome_vfs_find_directory (parent_uri, diff --git a/src/dlg-search.c b/src/dlg-search.c index 2ed3e10d965bb2da83a5395577604306bd284183..ec85657982efd57e7bebf012f38610092361b762 100644 --- a/src/dlg-search.c +++ b/src/dlg-search.c @@ -1087,7 +1087,7 @@ search_dir_async (DialogData *data, char *dir) if (data->uri != NULL) gnome_vfs_uri_unref (data->uri); - escaped = gnome_vfs_escape_host_and_path_string (start_from); + escaped = escape_uri (start_from); data->uri = gnome_vfs_uri_new (escaped); g_free (start_from); diff --git a/src/dlg-web-exporter.c b/src/dlg-web-exporter.c index a997784556f692a0ef4b7b9b17e261f8bc84c485..971928a89d2ba8bc12c439003ff0128cc6bc98f5 100644 --- a/src/dlg-web-exporter.c +++ b/src/dlg-web-exporter.c @@ -298,7 +298,8 @@ wa_destination_button_clicked_cb (GtkWidget *button, GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT, NULL); - + gtk_window_set_modal (GTK_WINDOW (file_sel), TRUE); + gtk_file_chooser_set_local_only (GTK_FILE_CHOOSER (file_sel), FALSE); g_signal_connect (G_OBJECT (file_sel), "response", @@ -747,6 +748,7 @@ theme_dialog__install_theme_clicked (GtkWidget *widget, GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT, NULL); + gtk_window_set_modal (GTK_WINDOW (file_sel), TRUE); g_object_set_data (G_OBJECT (file_sel), "theme_dialog_data", tdata); home = g_strconcat (g_get_home_dir (), "/", NULL); diff --git a/src/fullscreen.c b/src/fullscreen.c index ee8c44eccac452b9e3cd576f5495ea7014d50ba7..5265bbd9d04726efbed7200a33abf822cf27f4e2 100644 --- a/src/fullscreen.c +++ b/src/fullscreen.c @@ -649,6 +649,7 @@ hide_mouse_pointer_cb (gpointer data) gtk_widget_hide (popup_window); if (! fullscreen->wm_state_fullscreen_support) grab_window (fullscreen->window); + image_viewer_hide_cursor (IMAGE_VIEWER (fullscreen->viewer)); fullscreen->mouse_hide_id = 0; @@ -888,7 +889,7 @@ create_popup_window (void) /* back */ - button = create_button (GTK_STOCK_GO_BACK, _("Back"), FALSE); + button = create_button (GTHUMB_STOCK_PREVIOUS_IMAGE, _("Back"), FALSE); gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 0); g_signal_connect (G_OBJECT (button), "clicked", @@ -897,7 +898,7 @@ create_popup_window (void) /* forward */ - button = create_button (GTK_STOCK_GO_FORWARD, _("Forward"), FALSE); + button = create_button (GTHUMB_STOCK_NEXT_IMAGE, _("Forward"), FALSE); gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 0); g_signal_connect (G_OBJECT (button), "clicked", @@ -1118,7 +1119,7 @@ fullscreen_stop (FullScreen *fullscreen) if (! eel_gconf_get_boolean (PREF_BLACK_BACKGROUND, FALSE)) image_viewer_set_black_background (IMAGE_VIEWER (fullscreen->viewer), FALSE); - gtk_window_unfullscreen (fullscreen->window); + gtk_window_unfullscreen (GTK_WINDOW (fullscreen->window)); gtk_widget_hide (fullscreen->window); g_signal_handlers_disconnect_by_func (G_OBJECT (fullscreen->viewer), diff --git a/src/gth-folder-selection-dialog.c b/src/gth-folder-selection-dialog.c index 8d1a26ba5a1213960e0c05237ea3c27fd75395f3..c3ce527f96c155da30606de3f9ae52a3196a2682 100644 --- a/src/gth-folder-selection-dialog.c +++ b/src/gth-folder-selection-dialog.c @@ -284,6 +284,7 @@ browse_button_clicked_cb (GtkWidget *widget, GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT, NULL); + gtk_window_set_modal (GTK_WINDOW (file_sel), TRUE); entry = folder_sel->priv->file_entry; diff --git a/src/gthumb-window.c b/src/gthumb-window.c index 1527bbd7f54c94636d8b35a157b9b6aa3d8bc2ed..09dd4b7eb2517f7b2f8b66d030b47ffe25707a29 100644 --- a/src/gthumb-window.c +++ b/src/gthumb-window.c @@ -6107,7 +6107,7 @@ _proc_monitor_events (gpointer data) GList *dir_created_list, *dir_deleted_list; GList *file_created_list, *file_deleted_list, *file_changed_list; GList *scan; - + dir_created_list = window->monitor_events[MONITOR_EVENT_DIR_CREATED]; window->monitor_events[MONITOR_EVENT_DIR_CREATED] = NULL; @@ -6174,16 +6174,16 @@ _proc_monitor_events (gpointer data) static gboolean -remove_if_present (GThumbWindow *window, - MonitorEventType type, - const char *path) +remove_if_present (GList **monitor_events, + MonitorEventType type, + const char *path) { GList *list, *link; - list = window->monitor_events[type]; + list = monitor_events[type]; link = path_list_find_path (list, path); if (link != NULL) { - window->monitor_events[type] = g_list_remove_link (list, link); + monitor_events[type] = g_list_remove_link (list, link); path_list_free (link); return TRUE; } @@ -6192,14 +6192,34 @@ remove_if_present (GThumbWindow *window, } +static gboolean +add_if_not_present (GList **monitor_events, + MonitorEventType type, + MonitorEventType add_type, + const char *path) +{ + GList *list, *link; + + list = monitor_events[type]; + link = path_list_find_path (list, path); + if (link == NULL) { + monitor_events[add_type] = g_list_append (list, g_strdup (path)); + return TRUE; + } + + return FALSE; +} + + static void -_window_add_monitor_event (GThumbWindow *window, - GnomeVFSMonitorEventType event_type, - char *path) +_window_add_monitor_event (GThumbWindow *window, + GnomeVFSMonitorEventType event_type, + char *path, + GList **monitor_events) { MonitorEventType type; -#ifdef DEBUG +#ifdef DEBUG /* FIXME */ { char *op; @@ -6229,27 +6249,46 @@ _window_add_monitor_event (GThumbWindow *window, } else { if (! path_is_dir (path)) type = MONITOR_EVENT_FILE_CHANGED; - else + else return; } if (type == MONITOR_EVENT_FILE_CREATED) { - if (remove_if_present (window, + if (remove_if_present (monitor_events, MONITOR_EVENT_FILE_DELETED, path)) type = MONITOR_EVENT_FILE_CHANGED; } else if (type == MONITOR_EVENT_FILE_DELETED) { - remove_if_present (window, MONITOR_EVENT_FILE_CREATED, path); - remove_if_present (window, MONITOR_EVENT_FILE_CHANGED, path); + remove_if_present (monitor_events, + MONITOR_EVENT_FILE_CREATED, + path); + remove_if_present (monitor_events, + MONITOR_EVENT_FILE_CHANGED, + path); + + } else if (type == MONITOR_EVENT_FILE_CHANGED) { + remove_if_present (monitor_events, + MONITOR_EVENT_FILE_CHANGED, + path); + + if (gth_file_list_pos_from_path (window->file_list, path) == -1) + add_if_not_present (monitor_events, + MONITOR_EVENT_FILE_CHANGED, + MONITOR_EVENT_FILE_CREATED, + path); } else if (type == MONITOR_EVENT_DIR_CREATED) { - remove_if_present (window, MONITOR_EVENT_DIR_DELETED, path); + remove_if_present (monitor_events, + MONITOR_EVENT_DIR_DELETED, + path); } else if (type == MONITOR_EVENT_DIR_DELETED) - remove_if_present (window, MONITOR_EVENT_DIR_CREATED, path); + remove_if_present (monitor_events, + MONITOR_EVENT_DIR_CREATED, + path); - window->monitor_events[type] = g_list_append (window->monitor_events[type], g_strdup (path)); + monitor_events[type] = g_list_append (monitor_events[type], g_strdup (path)); } @@ -6266,11 +6305,11 @@ directory_changed (GnomeVFSMonitorHandle *handle, if (window->sidebar_content != GTH_SIDEBAR_DIR_LIST) return; - if (window->update_changes_timeout != 0) + if (window->update_changes_timeout != 0) return; path = gnome_vfs_unescape_string (info_uri + strlen ("file://"), NULL); - _window_add_monitor_event (window, event_type, path); + _window_add_monitor_event (window, event_type, path, window->monitor_events); g_free (path); window->update_changes_timeout = g_timeout_add (UPDATE_DIR_DELAY, diff --git a/src/gthumb-window.h b/src/gthumb-window.h index 095e677d2da2bf17ba6b36ec0453280b63cb9d06..bcd68025962030d858eb8aa5ceca36d5d427507d 100644 --- a/src/gthumb-window.h +++ b/src/gthumb-window.h @@ -51,7 +51,7 @@ typedef enum { typedef enum { - MONITOR_EVENT_FILE_CREATED, + MONITOR_EVENT_FILE_CREATED = 0, MONITOR_EVENT_FILE_DELETED, MONITOR_EVENT_DIR_CREATED, MONITOR_EVENT_DIR_DELETED, diff --git a/src/ui.h b/src/ui.h index 535dbf0e5e03ef3a78a792b83e3ee65f2cd3f591..16406aea9a0ea25fbff76e4e74bcdff26ca1e27a 100644 --- a/src/ui.h +++ b/src/ui.h @@ -1020,11 +1020,12 @@ static const gchar *viewer_ui_info = " " " " " " +" " " " -" " +" " " " " " -" " +" " " " " " " "