From 1507ca2eaf760107cffa07ea60abbcb78480c3af Mon Sep 17 00:00:00 2001 From: Daniel Molkentin Date: Tue, 11 Dec 2012 12:09:33 +0100 Subject: [PATCH] Split download state --- modules/csync_owncloud.c | 10 ++++++---- src/csync.h | 5 +++-- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/modules/csync_owncloud.c b/modules/csync_owncloud.c index 981f3a1aa3..875ea98fbb 100644 --- a/modules/csync_owncloud.c +++ b/modules/csync_owncloud.c @@ -1610,8 +1610,9 @@ static int owncloud_sendfile(csync_vio_method_handle_t *src, csync_vio_method_ha if (_progresscb) { ne_set_notifier(dav_session.ctx, 0, 0); - _progresscb(write_ctx->clean_uri, rc != NE_OK ? CSYNC_NOTIFY_ERROR : CSYNC_NOTIFY_FINISHED, - error_code, (long long)(error_string), dav_session.userdata); + _progresscb(write_ctx->clean_uri, rc != NE_OK ? CSYNC_NOTIFY_ERROR : + CSYNC_NOTIFY_FINISHED_UPLOAD, error_code, + (long long)(error_string), dav_session.userdata); } } else { DEBUG_WEBDAV("Could not stat file descriptor"); @@ -1669,8 +1670,9 @@ static int owncloud_sendfile(csync_vio_method_handle_t *src, csync_vio_method_ha } if (_progresscb) { ne_set_notifier(dav_session.ctx, 0, 0); - _progresscb(write_ctx->clean_uri, (rc != NE_OK) ? CSYNC_NOTIFY_ERROR : CSYNC_NOTIFY_FINISHED, - error_code , (long long)(error_string), dav_session.userdata); + _progresscb(write_ctx->clean_uri, (rc != NE_OK) ? CSYNC_NOTIFY_ERROR : + CSYNC_NOTIFY_FINISHED_DOWNLOAD, error_code , + (long long)(error_string), dav_session.userdata); } } else { DEBUG_WEBDAV("Unknown method!"); diff --git a/src/csync.h b/src/csync.h index 74c26900c2..e0bf90f875 100644 --- a/src/csync.h +++ b/src/csync.h @@ -495,8 +495,9 @@ bool csync_file_known( char *statedb_file, const char* url ); */ int csync_set_module_property(CSYNC *ctx, const char *key, void *value); -enum csync_notify_type_e { CSYNC_NOTIFY_START_DOWNLOAD, CSYNC_NOTIFY_START_UPLOAD, CSYNC_NOTIFY_PROGRESS, - CSYNC_NOTIFY_FINISHED, CSYNC_NOTIFY_ERROR }; +enum csync_notify_type_e { CSYNC_NOTIFY_START_DOWNLOAD, CSYNC_NOTIFY_START_UPLOAD, + CSYNC_NOTIFY_PROGRESS, CSYNC_NOTIFY_FINISHED_DOWNLOAD, + CSYNC_NOTIFY_FINISHED_UPLOAD, CSYNC_NOTIFY_ERROR }; typedef void (*csync_progress_callback) (const char *remote_url, enum csync_notify_type_e kind, long long o1, long long o2, void *userdata);