[Pkg-owncloud-commits] [owncloud-client] 261/333: Remove progress info from csync

Sandro Knauß hefee-guest at moszumanska.debian.org
Thu Apr 17 23:17:01 UTC 2014


This is an automated email from the git hooks/post-receive script.

hefee-guest pushed a commit to branch master
in repository owncloud-client.

commit 8de9bec122619f7516dec8b29d4139c94f14c714
Author: Olivier Goffart <ogoffart at woboq.com>
Date:   Fri Mar 28 10:50:15 2014 +0100

    Remove progress info from csync
    
    csync doesn't do no propagation no more
---
 csync/src/csync.c                             | 33 ------------------------
 csync/src/csync.h                             | 36 ---------------------------
 csync/src/csync_misc.h                        |  8 ------
 csync/src/csync_owncloud.c                    |  6 -----
 csync/src/csync_owncloud.h                    |  3 ---
 csync/src/csync_owncloud_recursive_propfind.c |  1 -
 csync/src/csync_owncloud_util.c               | 25 -------------------
 csync/src/csync_private.h                     |  5 ----
 src/mirall/syncengine.h                       |  1 -
 9 files changed, 118 deletions(-)

diff --git a/csync/src/csync.c b/csync/src/csync.c
index ac109ca..87b77e1 100644
--- a/csync/src/csync.c
+++ b/csync/src/csync.c
@@ -262,7 +262,6 @@ int csync_update(CSYNC *ctx) {
   }
 
   /* update detection for local replica */
-  oc_notify_progress(NULL, CSYNC_NOTIFY_START_LOCAL_UPDATE, 0, 0);
   csync_gettime(&start);
   ctx->current = LOCAL_REPLICA;
   ctx->replica = ctx->local.type;
@@ -275,7 +274,6 @@ int csync_update(CSYNC *ctx) {
   }
 
   csync_gettime(&finish);
-  oc_notify_progress(NULL, CSYNC_NOTIFY_FINISHED_LOCAL_UPDATE, 0, 0);
 
   CSYNC_LOG(CSYNC_LOG_PRIORITY_DEBUG,
             "Update detection for local replica took %.2f seconds walking %zu files.",
@@ -289,7 +287,6 @@ int csync_update(CSYNC *ctx) {
 
   /* update detection for remote replica */
   if( ! ctx->options.local_only_mode ) {
-    oc_notify_progress(NULL, CSYNC_NOTIFY_START_REMOTE_UPDATE, 0, 0);
     csync_gettime(&start);
     ctx->current = REMOTE_REPLICA;
     ctx->replica = ctx->remote.type;
@@ -303,7 +300,6 @@ int csync_update(CSYNC *ctx) {
 
 
     csync_gettime(&finish);
-    oc_notify_progress(NULL, CSYNC_NOTIFY_FINISHED_REMOTE_UPDATE, 0, 0);
 
     CSYNC_LOG(CSYNC_LOG_PRIORITY_DEBUG,
               "Update detection for remote replica took %.2f seconds "
@@ -647,11 +643,6 @@ int csync_commit(CSYNC *ctx) {
     goto out;
   }
 
-  /* reset the progress */
-  ctx->overall_progress.file_count = 0;
-  ctx->overall_progress.current_file_no = 0;
-  ctx->overall_progress.byte_sum = 0;
-  ctx->overall_progress.byte_current = 0;
 
   ctx->status = CSYNC_STATUS_INIT;
   SAFE_FREE(ctx->error_string);
@@ -932,27 +923,3 @@ int csync_set_module_property(CSYNC* ctx, const char* key, void* value)
     return csync_vio_set_property(ctx, key, value);
 }
 
-int csync_set_progress_callback(CSYNC* ctx, csync_progress_callback cb)
-{
-  if (ctx == NULL) {
-    return -1;
-  }
-  if (cb == NULL ) {
-    ctx->status_code = CSYNC_STATUS_PARAM_ERROR;
-    return -1;
-  }
-
-  ctx->callbacks.progress_cb = cb;
-  ctx->status_code = CSYNC_STATUS_OK;
-  return 0;
-
-}
-
-csync_progress_callback csync_get_progress_callback(CSYNC *ctx)
-{
-  if (ctx == NULL) {
-    return NULL;
-  }
-
-  return ctx->callbacks.progress_cb;
-}
diff --git a/csync/src/csync.h b/csync/src/csync.h
index 403e293..1b7614d 100644
--- a/csync/src/csync.h
+++ b/csync/src/csync.h
@@ -161,23 +161,6 @@ enum csync_notify_type_e {
   CSYNC_NOTIFY_FINISHED_REMOTE_UPDATE
 };
 
-struct csync_progress_s {
-  enum csync_notify_type_e kind;
-
-  /* individual file progress information */
-  const char *path;
-  int64_t curr_bytes;
-  int64_t file_size;
-
-  /* overall progress */
-  int64_t overall_transmission_size;
-  int64_t current_overall_bytes;
-  int64_t overall_file_count;
-  int64_t current_file_no;
-
-};
-typedef struct csync_progress_s CSYNC_PROGRESS;
-
 /**
  * CSync File Traversal structure.
  *
@@ -588,25 +571,6 @@ int csync_set_iconv_codec(const char *from);
 int csync_set_module_property(CSYNC *ctx, const char *key, void *value);
 
 /**
- * @brief Callback definition for file progress callback.
- *
- * @param progress  A struct containing progress information.
- *
- * @param userdata  User defined data for the callback.
- */
-typedef void (*csync_progress_callback)( CSYNC_PROGRESS *progress, void *userdata);
-
-/**
- * @brief Set a progress callback.
- *
- * This callback reports about up- or download progress of a individual file
- * as well as overall progress.
- */
-int csync_set_progress_callback( CSYNC *ctx, csync_progress_callback cb);
-
-csync_progress_callback csync_get_progress_callback(CSYNC *ctx);
-
-/**
  * @brief Aborts the current sync run as soon as possible. Can be called from another thread.
  *
  * @param ctx           The csync context.
diff --git a/csync/src/csync_misc.h b/csync/src/csync_misc.h
index 61389b4..4fba1c8 100644
--- a/csync/src/csync_misc.h
+++ b/csync/src/csync_misc.h
@@ -49,14 +49,6 @@ int csync_fnmatch(__const char *__pattern, __const char *__name, int __flags);
  */
 CSYNC_STATUS csync_errno_to_status(int error, CSYNC_STATUS default_status);
 
-typedef struct {
-    int64_t file_count;
-    int64_t current_file_no;
-    int64_t byte_sum;
-    int64_t byte_current;
-} csync_overall_progress_t;
-
-
 char *csync_normalize_etag(const char *);
 
 #endif /* _CSYNC_MISC_H */
diff --git a/csync/src/csync_owncloud.c b/csync/src/csync_owncloud.c
index 2726353..35da836 100644
--- a/csync/src/csync_owncloud.c
+++ b/csync/src/csync_owncloud.c
@@ -683,9 +683,6 @@ static struct listdir_context *fetch_resource_list(const char *uri, int depth)
                          req_status->reason_phrase);
             ret = NE_CONNECT;
             set_error_message(req_status->reason_phrase);
-            oc_notify_progress( uri, CSYNC_NOTIFY_ERROR,
-                                req_status->code,
-                                (intptr_t)(req_status->reason_phrase) );
         }
         DEBUG_WEBDAV("Simple propfind result code %d.", req_status->code);
     } else {
@@ -1036,9 +1033,6 @@ int owncloud_set_property(const char *key, void *data) {
         dav_session.no_recursive_propfind = *(bool*)(data);
         return 0;
     }
-    if( c_streq(key, "overall_progress_data")) {
-      dav_session.overall_progress_data = (csync_overall_progress_t*)(data);
-    }
     if( c_streq(key, "redirect_callback")) {
         if (data) {
             csync_owncloud_redirect_callback_t* cb_wrapper = data;
diff --git a/csync/src/csync_owncloud.h b/csync/src/csync_owncloud.h
index fe41b24..745e3af 100644
--- a/csync/src/csync_owncloud.h
+++ b/csync/src/csync_owncloud.h
@@ -139,7 +139,6 @@ struct dav_session_s {
 
     bool no_recursive_propfind;
 
-    csync_overall_progress_t *overall_progress_data;
     csync_owncloud_redirect_callback_t redir_callback;
 };
 extern struct dav_session_s dav_session;
@@ -167,8 +166,6 @@ char *_cleanPath( const char* uri );
 int _stat_perms( int type );
 csync_vio_file_stat_t *resourceToFileStat( struct resource *res );
 
-void oc_notify_progress(const char *file, enum csync_notify_type_e kind, int64_t current_size, int64_t full_size);
-
 // Public API from vio
 csync_vio_handle_t *owncloud_opendir(const char *uri);
 csync_vio_file_stat_t *owncloud_readdir(csync_vio_handle_t *dhandle);
diff --git a/csync/src/csync_owncloud_recursive_propfind.c b/csync/src/csync_owncloud_recursive_propfind.c
index 4522fc3..29abd19 100644
--- a/csync/src/csync_owncloud_recursive_propfind.c
+++ b/csync/src/csync_owncloud_recursive_propfind.c
@@ -273,7 +273,6 @@ void fetch_resource_list_recursive(const char *uri, const char *curi)
                          req_status->reason_phrase);
             ret = NE_CONNECT;
             set_error_message(req_status->reason_phrase);
-            oc_notify_progress(uri, CSYNC_NOTIFY_ERROR,  req_status->code, (intptr_t)(req_status->reason_phrase));
         }
         DEBUG_WEBDAV("Recursive propfind result code %d.", req_status ? req_status->code : 0);
     } else {
diff --git a/csync/src/csync_owncloud_util.c b/csync/src/csync_owncloud_util.c
index 39a6f77..ef57f77 100644
--- a/csync/src/csync_owncloud_util.c
+++ b/csync/src/csync_owncloud_util.c
@@ -339,28 +339,3 @@ int _stat_perms( int type ) {
     return ret;
 }
 
-void oc_notify_progress(const char *file, enum csync_notify_type_e kind, int64_t current_size, int64_t full_size)
-{
-  csync_progress_callback progress_cb = csync_get_progress_callback(dav_session.csync_ctx);
-
-  csync_overall_progress_t overall_progress;
-  ZERO_STRUCT(overall_progress);
-
-  if( dav_session.overall_progress_data) {
-    overall_progress = *dav_session.overall_progress_data;
-  }
-
-  if (progress_cb) {
-    CSYNC_PROGRESS progress;
-    progress.kind = kind;
-    progress.path = file;
-    progress.curr_bytes = current_size;
-    progress.file_size  = full_size;
-    progress.overall_transmission_size = overall_progress.byte_sum;
-    progress.current_overall_bytes     = overall_progress.byte_current+current_size;
-    progress.overall_file_count        = overall_progress.file_count;
-    progress.current_file_no           = overall_progress.current_file_no;
-
-    progress_cb(&progress, csync_get_userdata(dav_session.csync_ctx));
-  }
-}
diff --git a/csync/src/csync_private.h b/csync/src/csync_private.h
index 5bbc31a..a416de2 100644
--- a/csync/src/csync_private.h
+++ b/csync/src/csync_private.h
@@ -96,7 +96,6 @@ typedef struct csync_file_stat_s csync_file_stat_t;
 struct csync_s {
   struct {
       csync_auth_callback auth_function;
-      csync_progress_callback progress_cb;
       void *userdata;
   } callbacks;
   c_strlist_t *excludes;
@@ -144,10 +143,6 @@ struct csync_s {
     uid_t euid;
   } pwd;
 
-  csync_overall_progress_t overall_progress;
-
-  struct csync_progressinfo_s *progress_info;
-
   /* replica we are currently walking */
   enum csync_replica_e current;
 
diff --git a/src/mirall/syncengine.h b/src/mirall/syncengine.h
index e7d53ee..563bbaa 100644
--- a/src/mirall/syncengine.h
+++ b/src/mirall/syncengine.h
@@ -47,7 +47,6 @@ void csyncLogCatcher(int /*verbosity*/,
 class SyncEngine : public QObject
 {
     Q_OBJECT
-    friend void csyncthread_updater_progress_callback(CSYNC_PROGRESS *progress, void *userdata);
 public:
     SyncEngine(CSYNC *, const QString &localPath, const QString &remoteURL, const QString &remotePath, SyncJournalDb *journal);
     ~SyncEngine();

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud-client.git



More information about the Pkg-owncloud-commits mailing list