csync_set_log_level(options.silent ? 1 : 11);
opts = &options;
- cred->syncContextPreInit(_csync_ctx);
if( csync_init( _csync_ctx ) < 0 ) {
qFatal("Could not initialize csync!");
return EXIT_FAILURE;
}
- cred->syncContextPreStart(_csync_ctx);
-
Cmd cmd;
SyncJournalDb db(options.source_dir);
if (!selectiveSyncList.empty()) {
}
}
-
-void ShibbolethCredentials::syncContextPreInit(CSYNC* ctx)
-{
- Q_UNUSED(ctx);
-}
-
-QByteArray ShibbolethCredentials::prepareCookieData() const
-{
- QString cookiesAsString;
- QList<QNetworkCookie> cookies = accountCookies(_account);
-
- foreach(const QNetworkCookie &cookie, cookies) {
- cookiesAsString += cookie.toRawForm(QNetworkCookie::NameAndValueOnly) + QLatin1String("; ");
- }
-
- return cookiesAsString.toLatin1();
-}
-
-void ShibbolethCredentials::syncContextPreStart (CSYNC* ctx)
-{
- Q_UNUSED(ctx);
-}
-
bool ShibbolethCredentials::changed(AbstractCredentials* credentials) const
{
ShibbolethCredentials* other(qobject_cast< ShibbolethCredentials* >(credentials));
ShibbolethCredentials(const QNetworkCookie &cookie);
void setAccount(Account* account) Q_DECL_OVERRIDE;
- void syncContextPreInit(CSYNC* ctx) Q_DECL_OVERRIDE;
- void syncContextPreStart(CSYNC* ctx) Q_DECL_OVERRIDE;
bool changed(AbstractCredentials* credentials) const Q_DECL_OVERRIDE;
QString authType() const Q_DECL_OVERRIDE;
QString user() const Q_DECL_OVERRIDE;
csync_set_log_level( 11 );
Q_ASSERT( _accountState );
- _accountState->account()->credentials()->syncContextPreInit(_csync_ctx);
if( csync_init( _csync_ctx ) < 0 ) {
qDebug() << "Could not initialize csync!" << csync_get_status(_csync_ctx) << csync_get_status_string(_csync_ctx);
*/
virtual void setAccount(Account* account);
- virtual void syncContextPreInit(CSYNC* ctx) = 0;
- virtual void syncContextPreStart(CSYNC* ctx) = 0;
virtual bool changed(AbstractCredentials* credentials) const = 0;
virtual QString authType() const = 0;
virtual QString user() const = 0;
namespace OCC
{
-void DummyCredentials::syncContextPreInit(CSYNC*)
-{}
-
-void DummyCredentials::syncContextPreStart(CSYNC*)
-{}
-
bool DummyCredentials::changed(AbstractCredentials* credentials) const
{
DummyCredentials* dummy(dynamic_cast< DummyCredentials* >(credentials));
QString _user;
QString _password;
- void syncContextPreInit(CSYNC* ctx) Q_DECL_OVERRIDE;
- void syncContextPreStart(CSYNC* ctx) Q_DECL_OVERRIDE;
bool changed(AbstractCredentials* credentials) const Q_DECL_OVERRIDE;
QString authType() const Q_DECL_OVERRIDE;
QString user() const Q_DECL_OVERRIDE;
{
}
-void HttpCredentials::syncContextPreInit (CSYNC* ctx)
-{
- Q_UNUSED(ctx);
-}
-
-void HttpCredentials::syncContextPreStart (CSYNC* ctx)
-{
- Q_UNUSED(ctx);
-}
-
bool HttpCredentials::changed(AbstractCredentials* credentials) const
{
HttpCredentials* other(qobject_cast< HttpCredentials* >(credentials));
explicit HttpCredentials();
HttpCredentials(const QString& user, const QString& password, const QString& certificatePath, const QString& certificatePasswd);
- void syncContextPreInit(CSYNC* ctx) Q_DECL_OVERRIDE;
- void syncContextPreStart(CSYNC* ctx) Q_DECL_OVERRIDE;
bool changed(AbstractCredentials* credentials) const Q_DECL_OVERRIDE;
QString authType() const Q_DECL_OVERRIDE;
QNetworkAccessManager* getQNAM() const Q_DECL_OVERRIDE;
{
}
-void TokenCredentials::syncContextPreInit (CSYNC* ctx)
-{
- Q_UNUSED(ctx);
-}
-
-void TokenCredentials::syncContextPreStart (CSYNC* ctx)
-{
- Q_UNUSED(ctx);
-}
-
bool TokenCredentials::changed(AbstractCredentials* credentials) const
{
TokenCredentials* other(dynamic_cast< TokenCredentials* >(credentials));
TokenCredentials();
TokenCredentials(const QString& user, const QString& password, const QString &token);
- void syncContextPreInit(CSYNC* ctx) Q_DECL_OVERRIDE;
- void syncContextPreStart(CSYNC* ctx) Q_DECL_OVERRIDE;
bool changed(AbstractCredentials* credentials) const Q_DECL_OVERRIDE;
QString authType() const Q_DECL_OVERRIDE;
QNetworkAccessManager* getQNAM() const Q_DECL_OVERRIDE;
void itemCompleted(const SyncFileItem &, const PropagatorJob &);
void progress(const SyncFileItem&, quint64 bytes);
void finished();
- /**
- * Called when we detect that the total number of bytes changes (because a download or upload
- * turns out to be bigger or smaller than what was initially computed in the update phase
- */
- void adjustTotalTransmissionSize( qint64 adjust );
private:
}
}
-void ProgressInfo::adjustTotalSize(qint64 change)
-{
- _sizeProgress._total += change;
-}
-
quint64 ProgressInfo::totalFiles() const
{
return _fileProgress._total;
*/
void adjustTotalsForFile(const SyncFileItem & item);
- /**
- * Adjust the total size by some value.
- *
- * Deprecated. Used only in the legacy propagator.
- */
- void adjustTotalSize(qint64 change);
-
quint64 totalFiles() const;
quint64 completedFiles() const;
qDebug() << (usingSelectiveSync ? "====Using Selective Sync" : "====NOT Using Selective Sync");
csync_set_userdata(_csync_ctx, this);
- _account->credentials()->syncContextPreStart(_csync_ctx);
_stopWatch.start();
this, SLOT(slotItemCompleted(const SyncFileItem &, const PropagatorJob &)));
connect(_propagator.data(), SIGNAL(progress(const SyncFileItem &,quint64)),
this, SLOT(slotProgress(const SyncFileItem &,quint64)));
- connect(_propagator.data(), SIGNAL(adjustTotalTransmissionSize(qint64)), this, SLOT(slotAdjustTotalTransmissionSize(qint64)));
connect(_propagator.data(), SIGNAL(finished()), this, SLOT(slotFinished()), Qt::QueuedConnection);
// apply the network limits to the propagator
}
-void SyncEngine::slotAdjustTotalTransmissionSize(qint64 change)
-{
- _progressInfo->adjustTotalSize(change);
-}
-
/* Given a path on the remote, give the path as it is when the rename is done */
QString SyncEngine::adjustRenamedPath(const QString& original)
{
void slotItemCompleted(const SyncFileItem& item, const PropagatorJob & job);
void slotFinished();
void slotProgress(const SyncFileItem& item, quint64 curent);
- void slotAdjustTotalTransmissionSize(qint64 change);
void slotDiscoveryJobFinished(int updateResult);
void slotCleanPollsJobAborted(const QString &error);