mirror of
https://github.com/nextcloud/desktop.git
synced 2024-12-23 06:00:27 +03:00
46 lines
831 B
C++
46 lines
831 B
C++
|
#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"
|