mirror of
https://github.com/nextcloud/desktop.git
synced 2024-11-27 17:37:36 +03:00
Adopt to new progress API in csync, WIP
This commit is contained in:
parent
a827056d28
commit
8f912ca0c5
3 changed files with 30 additions and 2 deletions
|
@ -333,8 +333,7 @@ void CSyncThread::startSync()
|
|||
}
|
||||
csync_set_module_property(_csync_ctx, "bandwidth_limit_upload", &uploadLimit);
|
||||
|
||||
csync_set_file_progress_callback( _csync_ctx, cb_file_progress );
|
||||
csync_set_overall_progress_callback( _csync_ctx, cb_overall_progress );
|
||||
csync_set_progress_callback( _csync_ctx, cb_progress );
|
||||
|
||||
csync_set_module_property(_csync_ctx, "csync_context", _csync_ctx);
|
||||
csync_set_userdata(_csync_ctx, this);
|
||||
|
@ -406,6 +405,22 @@ void CSyncThread::startSync()
|
|||
qDebug() << Q_FUNC_INFO << "Sync finished";
|
||||
}
|
||||
|
||||
void CSyncThread::cb_progress( CSYNC_PROGRESS *progress, void *userdata )
|
||||
{
|
||||
if( !progress ) {
|
||||
qDebug() << "No progress block in progress callback found!";
|
||||
return;
|
||||
}
|
||||
if( !userdata ) {
|
||||
qDebug() << "No thread given in progress callback!";
|
||||
return;
|
||||
}
|
||||
QString path = QUrl::fromEncoded(progress->path).toString();
|
||||
CSyncThread *thread = static_cast<CSyncThread*>(userdata);
|
||||
|
||||
|
||||
}
|
||||
|
||||
void CSyncThread::cb_file_progress(const char *remote_url, enum csync_notify_type_e kind,
|
||||
long long o1, long long o2, void *userdata)
|
||||
{
|
||||
|
|
|
@ -54,6 +54,7 @@ signals:
|
|||
void csyncUnavailable();
|
||||
void treeWalkResult(const SyncFileItemVector&);
|
||||
|
||||
void transmissionProgress( Progress::Info progress );
|
||||
void fileTransmissionProgress( Progress::Kind, const QString&, qint64, qint64);
|
||||
void overallTransmissionProgress( const QString& file, int file_no, int file_cnt, qint64 o1, qint64 o2 );
|
||||
void csyncStateDbFile( const QString& );
|
||||
|
@ -72,6 +73,7 @@ private:
|
|||
void *userdata);
|
||||
static void cb_overall_progress(const char *file_name, int file_no,
|
||||
int file_cnt, long long o1, long long o2, void *userdata);
|
||||
static void cb_progress( CSYNC_PROGRESS *progress, void *userdata );
|
||||
|
||||
static int treewalkLocal( TREE_WALK_FILE*, void *);
|
||||
static int treewalkRemote( TREE_WALK_FILE*, void *);
|
||||
|
|
|
@ -37,6 +37,17 @@ public:
|
|||
};
|
||||
typedef ProgressKind_s Kind;
|
||||
|
||||
struct ProgressInfo_s {
|
||||
QString file;
|
||||
Kind kind;
|
||||
qint64 file_count;
|
||||
qint64 current_file_no;
|
||||
qint64 byte_sum;
|
||||
qint64 byte_current;
|
||||
|
||||
};
|
||||
typedef ProgressInfo_s Info;
|
||||
|
||||
static QString asString( Kind );
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue