[Xfce4-commits] <tumbler:master> Send the cache operation replies after they are completed.
Nick Schermer
noreply at xfce.org
Sun Jul 28 18:46:03 CEST 2013
Updating branch refs/heads/master
to b4a9a81442a34dc902689f7e2d5d2b540f5f1704 (commit)
from 21c0e5f761153df4ffc420044fd8d9b782354968 (commit)
commit b4a9a81442a34dc902689f7e2d5d2b540f5f1704
Author: Nick Schermer <nick at xfce.org>
Date: Sun Jul 28 16:33:55 2013 +0200
Send the cache operation replies after they are completed.
The reply was send when the operation was queued, but this does
not allow applications to properly handle new thumbs after a
copy/move operation.
plugins/xdg-cache/xdg-cache-cache.c | 14 ++++++-------
tumblerd/tumbler-cache-service.c | 38 +++++++++++++++++++++--------------
2 files changed, 30 insertions(+), 22 deletions(-)
diff --git a/plugins/xdg-cache/xdg-cache-cache.c b/plugins/xdg-cache/xdg-cache-cache.c
index 2037bd9..6c85523 100644
--- a/plugins/xdg-cache/xdg-cache-cache.c
+++ b/plugins/xdg-cache/xdg-cache-cache.c
@@ -300,13 +300,13 @@ xdg_cache_cache_copy_or_move_file (TumblerCache *cache,
const gchar *to_uri,
guint64 mtime)
{
- GFile *from_file;
- GFile *temp_file;
- gchar *temp_path;
- gchar *dest_path;
- gchar *from_path;
- gboolean result;
- GFile *dest_file;
+ GFile *from_file;
+ GFile *temp_file;
+ gchar *temp_path;
+ gchar *dest_path;
+ gchar *from_path;
+ gboolean result;
+ GFile *dest_file;
from_file = xdg_cache_cache_get_file (from_uri, flavor);
temp_file = xdg_cache_cache_get_temp_file (to_uri, flavor);
diff --git a/tumblerd/tumbler-cache-service.c b/tumblerd/tumbler-cache-service.c
index 47d0b8e..ab00645 100644
--- a/tumblerd/tumbler-cache-service.c
+++ b/tumblerd/tumbler-cache-service.c
@@ -99,25 +99,29 @@ struct _TumblerCacheService
struct _MoveRequest
{
- gchar **from_uris;
- gchar **to_uris;
+ gchar **from_uris;
+ gchar **to_uris;
+ DBusGMethodInvocation *context;
};
struct _CopyRequest
{
- gchar **from_uris;
- gchar **to_uris;
+ gchar **from_uris;
+ gchar **to_uris;
+ DBusGMethodInvocation *context;
};
struct _DeleteRequest
{
- gchar **uris;
+ gchar **uris;
+ DBusGMethodInvocation *context;
};
struct _CleanupRequest
{
- guint32 since;
- gchar **base_uris;
+ guint32 since;
+ gchar **base_uris;
+ DBusGMethodInvocation *context;
};
@@ -270,6 +274,8 @@ tumbler_cache_service_move_thread (gpointer data,
(const gchar *const *)request->to_uris);
}
+ dbus_g_method_return (request->context);
+
g_strfreev (request->from_uris);
g_strfreev (request->to_uris);
g_slice_free (MoveRequest, request);
@@ -302,6 +308,8 @@ tumbler_cache_service_copy_thread (gpointer data,
(const gchar *const *)request->to_uris);
}
+ dbus_g_method_return (request->context);
+
g_strfreev (request->from_uris);
g_strfreev (request->to_uris);
g_slice_free (CopyRequest, request);
@@ -330,6 +338,8 @@ tumbler_cache_service_delete_thread (gpointer data,
if (service->cache != NULL)
tumbler_cache_delete (service->cache, (const gchar *const *)request->uris);
+ dbus_g_method_return (request->context);
+
g_strfreev (request->uris);
g_slice_free (DeleteRequest, request);
@@ -361,6 +371,8 @@ tumbler_cache_service_cleanup_thread (gpointer data,
request->since);
}
+ dbus_g_method_return (request->context);
+
g_strfreev (request->base_uris);
g_slice_free (CleanupRequest, request);
@@ -445,11 +457,10 @@ tumbler_cache_service_move (TumblerCacheService *service,
request = g_slice_new0 (MoveRequest);
request->from_uris = g_strdupv ((gchar **)from_uris);
request->to_uris = g_strdupv ((gchar **)to_uris);
+ request->context = context;
g_thread_pool_push (service->move_pool, request, NULL);
- dbus_g_method_return (context);
-
/* try to keep tumbler alive */
tumbler_component_keep_alive (TUMBLER_COMPONENT (service), NULL);
}
@@ -476,11 +487,10 @@ tumbler_cache_service_copy (TumblerCacheService *service,
request = g_slice_new0 (CopyRequest);
request->from_uris = g_strdupv ((gchar **)from_uris);
request->to_uris = g_strdupv ((gchar **)to_uris);
+ request->context = context;
g_thread_pool_push (service->copy_pool, request, NULL);
- dbus_g_method_return (context);
-
/* try to keep tumbler alive */
tumbler_component_keep_alive (TUMBLER_COMPONENT (service), NULL);
}
@@ -503,11 +513,10 @@ tumbler_cache_service_delete (TumblerCacheService *service,
request = g_slice_new0 (DeleteRequest);
request->uris = g_strdupv ((gchar **)uris);
+ request->context = context;
g_thread_pool_push (service->delete_pool, request, NULL);
- dbus_g_method_return (context);
-
/* try to keep tumbler alive */
tumbler_component_keep_alive (TUMBLER_COMPONENT (service), NULL);
}
@@ -531,11 +540,10 @@ tumbler_cache_service_cleanup (TumblerCacheService *service,
request = g_slice_new0 (CleanupRequest);
request->base_uris = g_strdupv ((gchar **)base_uris);
request->since = since;
+ request->context = context;
g_thread_pool_push (service->cleanup_pool, request, NULL);
- dbus_g_method_return (context);
-
/* try to keep tumbler alive */
tumbler_component_keep_alive (TUMBLER_COMPONENT (service), NULL);
}
More information about the Xfce4-commits
mailing list