nextcloud-desktop/src/mirall/unisonfolder.cpp

46 lines
831 B
C++
Raw Normal View History

#include <QMutexLocker>
#include <QProcess>
#include <QStringList>
#include "mirall/unisonfolder.h"
namespace Mirall {
UnisonFolder::UnisonFolder(const QString &path, const QString &secondPath, QObject *parent)
: Folder(path, parent),
_unison(new QProcess(this)),
_secondPath(secondPath)
{
}
UnisonFolder::~UnisonFolder()
{
}
QString UnisonFolder::secondPath() const
{
return _secondPath;
}
void UnisonFolder::startSync()
{
QMutexLocker locker(&_syncMutex);
QString program = "unison";
QStringList args;
args << "-ui" << "text";
args << "-auto" << "-batch";
args << "-confirmbigdel";
//args << "-path";
args << path();
args << secondPath();
_unison->start(program, args);
emit syncStarted();
emit syncFinished();
}
} // ns
#include "unisonfolder.moc"