SLOT(slotAboutToRestoreBackup(bool*)));
connect(_engine.data(), SIGNAL(folderDiscovered(bool,QString)), this, SLOT(slotFolderDiscovered(bool,QString)));
connect(_engine.data(), SIGNAL(transmissionProgress(ProgressInfo)), this, SLOT(slotTransmissionProgress(ProgressInfo)));
- connect(_engine.data(), SIGNAL(itemCompleted(const SyncFileItem &, const PropagatorJob &)),
- this, SLOT(slotItemCompleted(const SyncFileItem &, const PropagatorJob &)));
+ connect(_engine.data(), SIGNAL(itemCompleted(const SyncFileItem &)),
+ this, SLOT(slotItemCompleted(const SyncFileItem &)));
connect(_engine.data(), SIGNAL(newBigFolder(QString)), this, SLOT(slotNewBigFolderDiscovered(QString)));
connect(_engine.data(), SIGNAL(seenLockedFile(QString)), FolderMan::instance(), SLOT(slotSyncOnceFileUnlocks(QString)));
connect(_engine.data(), SIGNAL(aboutToPropagate(SyncFileItemVector&)),
}
// a item is completed: count the errors and forward to the ProgressDispatcher
-void Folder::slotItemCompleted(const SyncFileItem &item, const PropagatorJob& job)
+void Folder::slotItemCompleted(const SyncFileItem &item)
{
if (Progress::isWarningKind(item._status)) {
// Count all error conditions.
_syncResult.setWarnCount(_syncResult.warnCount()+1);
}
_fileLog->logItem(item);
- emit ProgressDispatcher::instance()->itemCompleted(alias(), item, job);
+ emit ProgressDispatcher::instance()->itemCompleted(alias(), item);
}
void Folder::slotNewBigFolderDiscovered(const QString &newF)
void slotFolderDiscovered(bool local, QString folderName);
void slotTransmissionProgress(const ProgressInfo& pi);
- void slotItemCompleted(const SyncFileItem&, const PropagatorJob&);
+ void slotItemCompleted(const SyncFileItem&);
void slotRunEtagJob();
void etagRetreived(const QString &);
#include "syncfileitem.h"
#include "folder.h"
#include "openfilemanager.h"
-#include "owncloudpropagator.h"
#include "activityitemdelegate.h"
#include "ui_protocolwidget.h"
connect(ProgressDispatcher::instance(), SIGNAL(progressInfo(QString,ProgressInfo)),
this, SLOT(slotProgressInfo(QString,ProgressInfo)));
- connect(ProgressDispatcher::instance(), SIGNAL(itemCompleted(QString,SyncFileItem,PropagatorJob)),
- this, SLOT(slotItemCompleted(QString,SyncFileItem,PropagatorJob)));
+ connect(ProgressDispatcher::instance(), SIGNAL(itemCompleted(QString,SyncFileItem)),
+ this, SLOT(slotItemCompleted(QString,SyncFileItem)));
connect(_ui->_treeWidget, SIGNAL(itemActivated(QTreeWidgetItem*,int)), SLOT(slotOpenFile(QTreeWidgetItem*,int)));
}
}
-void ProtocolWidget::slotItemCompleted(const QString &folder, const SyncFileItem &item, const PropagatorJob &job)
+void ProtocolWidget::slotItemCompleted(const QString &folder, const SyncFileItem &item)
{
- if (qobject_cast<const PropagateDirectory*>(&job)) {
- return;
- }
-
QTreeWidgetItem *line = createCompletedTreewidgetItem(folder, item);
if(line) {
if( item.hasErrorStatus() ) {
public slots:
void slotProgressInfo( const QString& folder, const ProgressInfo& progress );
- void slotItemCompleted( const QString& folder, const SyncFileItem& item, const PropagatorJob& job);
+ void slotItemCompleted( const QString& folder, const SyncFileItem& item);
void slotOpenFile( QTreeWidgetItem* item, int );
protected:
_item->_status = status;
- emit itemCompleted(*_item, *this);
+ emit itemCompleted(*_item);
emit finished(status);
}
if( newJob ) {
newJob->setRestoreJobMsg(msg);
_restoreJob.reset(newJob);
- connect(_restoreJob.data(), SIGNAL(itemCompleted(const SyncFileItemPtr &, const PropagatorJob &)),
+ connect(_restoreJob.data(), SIGNAL(itemCompleted(const SyncFileItemPtr &)),
this, SLOT(slotRestoreJobCompleted(const SyncFileItemPtr &)));
QMetaObject::invokeMethod(newJob, "start");
}
_rootJob->append(it);
}
- connect(_rootJob.data(), SIGNAL(itemCompleted(const SyncFileItem &, const PropagatorJob &)),
- this, SIGNAL(itemCompleted(const SyncFileItem &, const PropagatorJob &)));
+ connect(_rootJob.data(), SIGNAL(itemCompleted(const SyncFileItem &)),
+ this, SIGNAL(itemCompleted(const SyncFileItem &)));
connect(_rootJob.data(), SIGNAL(progress(const SyncFileItem &,quint64)), this, SIGNAL(progress(const SyncFileItem &,quint64)));
connect(_rootJob.data(), SIGNAL(finished(SyncFileItem::Status)), this, SLOT(emitFinished(SyncFileItem::Status)));
connect(_rootJob.data(), SIGNAL(ready()), this, SLOT(scheduleNextJob()), Qt::QueuedConnection);
/**
* Emitted when one item has been completed within a job.
*/
- void itemCompleted(const SyncFileItem &, const PropagatorJob &);
+ void itemCompleted(const SyncFileItem &);
/**
* Emitted when all the sub-jobs have been finished and
bool possiblyRunNextJob(PropagatorJob *next) {
if (next->_state == NotYetStarted) {
connect(next, SIGNAL(finished(SyncFileItem::Status)), this, SLOT(slotSubJobFinished(SyncFileItem::Status)), Qt::QueuedConnection);
- connect(next, SIGNAL(itemCompleted(const SyncFileItem &, const PropagatorJob &)),
- this, SIGNAL(itemCompleted(const SyncFileItem &, const PropagatorJob &)));
+ connect(next, SIGNAL(itemCompleted(const SyncFileItem &)), this, SIGNAL(itemCompleted(const SyncFileItem &)));
connect(next, SIGNAL(progress(const SyncFileItem &,quint64)), this, SIGNAL(progress(const SyncFileItem &,quint64)));
connect(next, SIGNAL(ready()), this, SIGNAL(ready()));
_runningNow++;
void scheduleNextJob();
signals:
- void itemCompleted(const SyncFileItem &, const PropagatorJob &);
+ void itemCompleted(const SyncFileItem &);
void progress(const SyncFileItem&, quint64 bytes);
void finished(bool success);
namespace OCC {
-class PropagatorJob;
-
/**
* @brief The ProgressInfo class
* @ingroup libsync
/**
* @brief: the item was completed by a job
*/
- void itemCompleted(const QString &folder,
- const SyncFileItem & item,
- const PropagatorJob & job);
+ void itemCompleted(const QString &folder, const SyncFileItem & item);
protected:
void setProgressInfo(const QString& folder, const ProgressInfo& progress);
_propagator = QSharedPointer<OwncloudPropagator>(
new OwncloudPropagator (_account, _localPath, _remotePath, _journal));
- connect(_propagator.data(), SIGNAL(itemCompleted(const SyncFileItem &, const PropagatorJob &)),
- this, SLOT(slotItemCompleted(const SyncFileItem &, const PropagatorJob &)));
+ connect(_propagator.data(), SIGNAL(itemCompleted(const SyncFileItem &)),
+ this, SLOT(slotItemCompleted(const SyncFileItem &)));
connect(_propagator.data(), SIGNAL(progress(const SyncFileItem &,quint64)),
this, SLOT(slotProgress(const SyncFileItem &,quint64)));
connect(_propagator.data(), SIGNAL(finished(bool)), this, SLOT(slotFinished(bool)), Qt::QueuedConnection);
}
}
-void SyncEngine::slotItemCompleted(const SyncFileItem &item, const PropagatorJob &job)
+void SyncEngine::slotItemCompleted(const SyncFileItem &item)
{
const char * instruction_str = csync_instruction_str(item._instruction);
qDebug() << Q_FUNC_INFO << item._file << instruction_str << item._status << item._errorString;
}
emit transmissionProgress(*_progressInfo);
- emit itemCompleted(item, job);
+ emit itemCompleted(item);
}
void SyncEngine::slotFinished(bool success)
class SyncJournalFileRecord;
class SyncJournalDb;
class OwncloudPropagator;
-class PropagatorJob;
enum AnotherSyncNeeded
{
void aboutToPropagate(SyncFileItemVector&);
// after each item completed by a job (successful or not)
- void itemCompleted(const SyncFileItem&, const PropagatorJob&);
+ void itemCompleted(const SyncFileItem&);
// after sync is done
void treeWalkResult(const SyncFileItemVector&);
private slots:
void slotRootEtagReceived(const QString &);
- void slotItemCompleted(const SyncFileItem& item, const PropagatorJob & job);
+ void slotItemCompleted(const SyncFileItem& item);
void slotFinished(bool success);
void slotProgress(const SyncFileItem& item, quint64 curent);
void slotDiscoveryJobFinished(int updateResult);
{
connect(syncEngine, SIGNAL(aboutToPropagate(SyncFileItemVector&)),
SLOT(slotAboutToPropagate(SyncFileItemVector&)));
- connect(syncEngine, SIGNAL(itemCompleted(const SyncFileItem&, const PropagatorJob&)),
+ connect(syncEngine, SIGNAL(itemCompleted(const SyncFileItem&)),
SLOT(slotItemCompleted(const SyncFileItem&)));
connect(syncEngine, SIGNAL(finished(bool)), SLOT(slotSyncFinished()));
connect(syncEngine, SIGNAL(started()), SLOT(slotSyncEngineRunningChanged()));
}
void execUntilItemCompleted(const QString &relativePath) {
- QSignalSpy spy(_syncEngine.get(), SIGNAL(itemCompleted(const SyncFileItem &, const PropagatorJob &)));
+ QSignalSpy spy(_syncEngine.get(), SIGNAL(itemCompleted(const SyncFileItem &)));
QElapsedTimer t;
t.start();
while (t.elapsed() < 5000) {
private slots:
void testFileDownload() {
FakeFolder fakeFolder{FileInfo::A12_B12_C12_S12()};
- QSignalSpy completeSpy(&fakeFolder.syncEngine(), SIGNAL(itemCompleted(const SyncFileItem &, const PropagatorJob &)));
+ QSignalSpy completeSpy(&fakeFolder.syncEngine(), SIGNAL(itemCompleted(const SyncFileItem &)));
fakeFolder.remoteModifier().insert("A/a0");
fakeFolder.syncOnce();
QVERIFY(itemDidCompleteSuccessfully(completeSpy, "A/a0"));
void testFileUpload() {
FakeFolder fakeFolder{FileInfo::A12_B12_C12_S12()};
- QSignalSpy completeSpy(&fakeFolder.syncEngine(), SIGNAL(itemCompleted(const SyncFileItem &, const PropagatorJob &)));
+ QSignalSpy completeSpy(&fakeFolder.syncEngine(), SIGNAL(itemCompleted(const SyncFileItem &)));
fakeFolder.localModifier().insert("A/a0");
fakeFolder.syncOnce();
QVERIFY(itemDidCompleteSuccessfully(completeSpy, "A/a0"));
void testDirDownload() {
FakeFolder fakeFolder{FileInfo::A12_B12_C12_S12()};
- QSignalSpy completeSpy(&fakeFolder.syncEngine(), SIGNAL(itemCompleted(const SyncFileItem &, const PropagatorJob &)));
+ QSignalSpy completeSpy(&fakeFolder.syncEngine(), SIGNAL(itemCompleted(const SyncFileItem &)));
fakeFolder.remoteModifier().mkdir("Y");
fakeFolder.remoteModifier().mkdir("Z");
fakeFolder.remoteModifier().insert("Z/d0");
void testDirUpload() {
FakeFolder fakeFolder{FileInfo::A12_B12_C12_S12()};
- QSignalSpy completeSpy(&fakeFolder.syncEngine(), SIGNAL(itemCompleted(const SyncFileItem &, const PropagatorJob &)));
+ QSignalSpy completeSpy(&fakeFolder.syncEngine(), SIGNAL(itemCompleted(const SyncFileItem &)));
fakeFolder.localModifier().mkdir("Y");
fakeFolder.localModifier().mkdir("Z");
fakeFolder.localModifier().insert("Z/d0");
void testLocalDelete() {
FakeFolder fakeFolder{FileInfo::A12_B12_C12_S12()};
- QSignalSpy completeSpy(&fakeFolder.syncEngine(), SIGNAL(itemCompleted(const SyncFileItem &, const PropagatorJob &)));
+ QSignalSpy completeSpy(&fakeFolder.syncEngine(), SIGNAL(itemCompleted(const SyncFileItem &)));
fakeFolder.remoteModifier().remove("A/a1");
fakeFolder.syncOnce();
QVERIFY(itemDidCompleteSuccessfully(completeSpy, "A/a1"));
void testRemoteDelete() {
FakeFolder fakeFolder{FileInfo::A12_B12_C12_S12()};
- QSignalSpy completeSpy(&fakeFolder.syncEngine(), SIGNAL(itemCompleted(const SyncFileItem &, const PropagatorJob &)));
+ QSignalSpy completeSpy(&fakeFolder.syncEngine(), SIGNAL(itemCompleted(const SyncFileItem &)));
fakeFolder.localModifier().remove("A/a1");
fakeFolder.syncOnce();
QVERIFY(itemDidCompleteSuccessfully(completeSpy, "A/a1"));
// fakeFolder.syncOnce();
fakeFolder.syncOnce();
- QSignalSpy completeSpy(&fakeFolder.syncEngine(), SIGNAL(itemCompleted(const SyncFileItem &, const PropagatorJob &)));
+ QSignalSpy completeSpy(&fakeFolder.syncEngine(), SIGNAL(itemCompleted(const SyncFileItem &)));
// Touch the file without changing the content, shouldn't upload
fakeFolder.localModifier().setContents("a1.eml", 'A');
// Change the content/size
QCOMPARE(fakeFolder.currentLocalState(), remoteState);
expectedServerState = fakeFolder.currentRemoteState();
- QSignalSpy completeSpy(&fakeFolder.syncEngine(), SIGNAL(itemCompleted(const SyncFileItem &, const PropagatorJob &)));
+ QSignalSpy completeSpy(&fakeFolder.syncEngine(), SIGNAL(itemCompleted(const SyncFileItem &)));
fakeFolder.syncOnce(); // This sync should do nothing
QCOMPARE(completeSpy.count(), 0);