Revision: 1316
http://geeqie.svn.sourceforge.net/geeqie/?rev=1316&view=rev
Author: nadvornik
Date: 2008-12-25 12:19:37 +0000 (Thu, 25 Dec 2008)
Log Message:
-----------
perform internal commands in idle call
Modified Paths:
--------------
trunk/src/utilops.c
Modified: trunk/src/utilops.c
===================================================================
--- trunk/src/utilops.c 2008-12-23 22:42:57 UTC (rev 1315)
+++ trunk/src/utilops.c 2008-12-25 12:19:37 UTC (rev 1316)
@@ -285,6 +285,8 @@
gint update_idle_id;
+ gint perform_idle_id;
+
gboolean with_sidecars; /* operate on grouped or single files; TRUE =
use file_data_sc_, FALSE = use file_data_ functions */
/* alternative dialog parts */
@@ -339,6 +341,7 @@
ud->type = type;
ud->phase = UTILITY_PHASE_START;
ud->update_idle_id = -1;
+ ud->perform_idle_id = -1;
ud->external_command = -1;
return ud;
}
@@ -348,6 +351,7 @@
if (!ud) return;
if (ud->update_idle_id != -1) g_source_remove(ud->update_idle_id);
+ if (ud->perform_idle_id != -1) g_source_remove(ud->perform_idle_id);
file_data_unref(ud->dir_fd);
filelist_free(ud->content_list);
@@ -464,7 +468,7 @@
}
-static void file_util_perform_ci_internal(UtilityData *ud);
+static gboolean file_util_perform_ci_internal(gpointer data);
void file_util_dialog_run(UtilityData *ud);
static gint file_util_perform_ci_cb(gpointer resume_data, gint flags, GList
*list, gpointer data);
@@ -578,10 +582,16 @@
*/
-static void file_util_perform_ci_internal(UtilityData *ud)
+static gboolean file_util_perform_ci_internal(gpointer data)
{
+ UtilityData *ud = data;
+
+ /* this is removed when ud is destroyed */
+ if (ud->perform_idle_id == -1) ud->perform_idle_id =
g_idle_add(file_util_perform_ci_internal, ud);
+
+ g_assert(ud->flist);
- while (ud->flist)
+ if (ud->flist)
{
gint ret;
@@ -597,16 +607,16 @@
ret = file_util_perform_ci_cb(GINT_TO_POINTER(!last), status,
single_entry, ud);
g_list_free(single_entry);
- if (ret == EDITOR_CB_SUSPEND || last) return;
+ if (ret == EDITOR_CB_SUSPEND || last) return FALSE;
if (ret == EDITOR_CB_SKIP)
{
file_util_perform_ci_cb(NULL, EDITOR_ERROR_SKIPPED,
ud->flist, ud);
+ return FALSE;
}
-
- /* FIXME: convert the loop to idle call */
-
}
+
+ return TRUE;
}
static void file_util_perform_ci_dir(UtilityData *ud, gboolean internal,
gboolean ext_result)
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