Revision: 1309
http://geeqie.svn.sourceforge.net/geeqie/?rev=1309&view=rev
Author: nadvornik
Date: 2008-12-22 18:29:25 +0000 (Mon, 22 Dec 2008)
Log Message:
-----------
write metadata after timeout, image change or dir change
Modified Paths:
--------------
trunk/src/layout.c
trunk/src/layout_util.c
trunk/src/main.c
trunk/src/metadata.c
trunk/src/metadata.h
Modified: trunk/src/layout.c
===================================================================
--- trunk/src/layout.c 2008-12-22 18:15:26 UTC (rev 1308)
+++ trunk/src/layout.c 2008-12-22 18:29:25 UTC (rev 1309)
@@ -32,6 +32,7 @@
#include "ui_misc.h"
#include "ui_tabcomp.h"
#include "window.h"
+#include "metadata.h"
#ifdef HAVE_LIRC
#include "lirc.h"
@@ -1045,6 +1046,9 @@
layout_image_set_index(lw, 0);
}
+ if (options->metadata.confirm_on_dir_change)
+ metadata_write_queue_confirm();
+
return TRUE;
}
Modified: trunk/src/layout_util.c
===================================================================
--- trunk/src/layout_util.c 2008-12-22 18:15:26 UTC (rev 1308)
+++ trunk/src/layout_util.c 2008-12-22 18:29:25 UTC (rev 1309)
@@ -43,6 +43,7 @@
#include "utilops.h"
#include "view_dir.h"
#include "window.h"
+#include "metadata.h"
#include <gdk/gdkkeysyms.h> /* for keyboard values */
@@ -2036,6 +2037,10 @@
{
layout_bar_info_new_image(lw);
layout_bar_exif_new_image(lw);
+
+ /* this should be called here to handle the metadata edited in bars */
+ if (options->metadata.confirm_on_image_change)
+ metadata_write_queue_confirm();
}
void layout_bars_new_selection(LayoutWindow *lw, gint count)
Modified: trunk/src/main.c
===================================================================
--- trunk/src/main.c 2008-12-22 18:15:26 UTC (rev 1308)
+++ trunk/src/main.c 2008-12-22 18:29:25 UTC (rev 1309)
@@ -30,6 +30,7 @@
#include "ui_utildlg.h"
#include "cache_maint.h"
#include "thumb.h"
+#include "metadata.h"
#include <gdk/gdkkeysyms.h> /* for keyboard values */
@@ -648,6 +649,8 @@
{
layout_image_full_screen_stop(NULL);
+ if (metadata_write_queue_confirm()) return;
+
if (exit_confirm_dlg()) return;
exit_program_final();
Modified: trunk/src/metadata.c
===================================================================
--- trunk/src/metadata.c 2008-12-22 18:15:26 UTC (rev 1308)
+++ trunk/src/metadata.c 2008-12-22 18:29:25 UTC (rev 1309)
@@ -123,7 +123,16 @@
metadata_write_queue = g_list_prepend(metadata_write_queue, fd);
file_data_ref(fd);
- if (metadata_write_idle_id == -1) metadata_write_idle_id =
g_idle_add(metadata_write_queue_idle_cb, NULL);
+ if (metadata_write_idle_id != -1)
+ {
+ g_source_remove(metadata_write_idle_id);
+ metadata_write_idle_id = -1;
+ }
+
+ if (options->metadata.confirm_timeout > 0)
+ {
+ metadata_write_idle_id =
g_timeout_add(options->metadata.confirm_timeout * 1000,
metadata_write_queue_idle_cb, NULL);
+ }
}
@@ -161,7 +170,7 @@
}
-static gboolean metadata_write_queue_idle_cb(gpointer data)
+gboolean metadata_write_queue_confirm()
{
GList *work;
GList *to_approve = NULL;
@@ -184,11 +193,18 @@
file_util_write_metadata(NULL, to_approve, NULL);
filelist_free(to_approve);
+
+ return (metadata_write_queue != NULL);
+}
+static gboolean metadata_write_queue_idle_cb(gpointer data)
+{
+ metadata_write_queue_confirm();
metadata_write_idle_id = -1;
return FALSE;
}
+
gboolean metadata_write_exif(FileData *fd, FileData *sfd)
{
gboolean success;
Modified: trunk/src/metadata.h
===================================================================
--- trunk/src/metadata.h 2008-12-22 18:15:26 UTC (rev 1308)
+++ trunk/src/metadata.h 2008-12-22 18:29:25 UTC (rev 1309)
@@ -16,8 +16,10 @@
gboolean metadata_write_queue_remove(FileData *fd);
gboolean metadata_write_queue_remove_list(GList *list);
gboolean metadata_write_perform(FileData *fd);
+gboolean metadata_write_queue_confirm(void);
+
gint metadata_write(FileData *fd, GList *keywords, const gchar *comment);
gint metadata_read(FileData *fd, GList **keywords, gchar **comment);
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
_______________________________________________
Geeqie-svn mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geeqie-svn