diff --git a/src/libsync/discoveryphase.cpp b/src/libsync/discoveryphase.cpp index 5e5f3a309..2414c53d0 100644 --- a/src/libsync/discoveryphase.cpp +++ b/src/libsync/discoveryphase.cpp @@ -222,7 +222,7 @@ static csync_vio_file_stat_t* propertyMapToFileStat(QMap map) file_stat->remotePerm[0] = ' '; // see _csync_detect_update() file_stat->fields |= CSYNC_VIO_FILE_STAT_FIELDS_PERM; - } else if (value.length() < sizeof(file_stat->remotePerm)) { + } else if (value.length() < int(sizeof(file_stat->remotePerm))) { strncpy(file_stat->remotePerm, value.toUtf8(), sizeof(file_stat->remotePerm)); file_stat->fields |= CSYNC_VIO_FILE_STAT_FIELDS_PERM; } else { @@ -291,7 +291,7 @@ void DiscoverySingleDirectoryJob::lsJobFinishedWithErrorSlot(QNetworkReply *r) deleteLater(); } -void DiscoveryMainThread::setupHooks(CSYNC *ctx, DiscoveryJob *discoveryJob, QString pathPrefix) +void DiscoveryMainThread::setupHooks(DiscoveryJob *discoveryJob, const QString &pathPrefix) { qDebug() << Q_FUNC_INFO; _discoveryJob = discoveryJob; diff --git a/src/libsync/discoveryphase.h b/src/libsync/discoveryphase.h index 226a1065b..2cc567c8a 100644 --- a/src/libsync/discoveryphase.h +++ b/src/libsync/discoveryphase.h @@ -34,12 +34,12 @@ class Account; * if the files are new, or changed. */ -typedef struct { +struct DiscoveryDirectoryResult { QString msg; int code; QLinkedList::iterator iterator; QLinkedList list; -} DiscoveryDirectoryResult; +}; // Run in the main thread, reporting to the DiscoveryJobMainThread object class DiscoverySingleDirectoryJob : public QObject { @@ -74,12 +74,12 @@ class DiscoveryMainThread : public QObject { // If it is not in this map it needs to be requested QMap > _directoryContents; - DiscoveryDirectoryResult *_currentDiscoveryDirectoryResult; QPointer _discoveryJob; QPointer _singleDirJob; QString _pathPrefix; AccountPtr _account; + DiscoveryDirectoryResult *_currentDiscoveryDirectoryResult; public: DiscoveryMainThread(AccountPtr account) : QObject(), _account(account), _currentDiscoveryDirectoryResult(0) { @@ -100,7 +100,7 @@ public slots: void singleDirectoryJobFinishedWithErrorSlot(int csyncErrnoCode, QString msg); void singleDirectoryJobFirstDirectoryPermissionsSlot(QString); public: - void setupHooks(CSYNC *ctx, DiscoveryJob *discoveryJob, QString pathPrefix); + void setupHooks(DiscoveryJob* discoveryJob, const QString &pathPrefix); }; diff --git a/src/libsync/syncengine.cpp b/src/libsync/syncengine.cpp index 283e5c737..81668d1d9 100644 --- a/src/libsync/syncengine.cpp +++ b/src/libsync/syncengine.cpp @@ -618,7 +618,7 @@ void SyncEngine::startSync() // This is used for the DiscoveryJob to be able to request the main thread/ // to read in directory contents. qDebug() << Q_FUNC_INFO << _remotePath << _remoteUrl; - _discoveryMainThread->setupHooks(_csync_ctx, discoveryJob, _remotePath); + _discoveryMainThread->setupHooks( discoveryJob, _remotePath); // Starts the update in a seperate thread QMetaObject::invokeMethod(discoveryJob, "start", Qt::QueuedConnection);