blob: 48d52a57cd34cdf2dea6124e0248510a2359fc93 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
#include <QtCore/QCoreApplication>
#include <QtCore/QSettings>
#include <QtCore/QDebug>
#include "distfolder.h"
#include "localkey.h"
int main(int argc, char *argv[])
{
QCoreApplication a(argc, argv);
a.setOrganizationName("distfold");
a.setOrganizationDomain("com.javispedro.distfold");
a.setApplicationName("distfoldd");
a.setApplicationVersion("0.2");
if (!LocalKey::setupLocalKey()) {
qWarning() << "Failed to setup local private key";
return EXIT_FAILURE;
}
QSettings settings;
foreach (const QString& group, settings.childGroups()) {
settings.beginGroup(group);
QUuid uuid(settings.value("uuid").toString());
QString path = settings.value("path").toString();
DistFolder *f = new DistFolder(uuid, path);
f->setReadOnlySync(settings.value("ro", false).toBool());
f->setPullMode(settings.value("pull", false).toBool());
f->setCompress(settings.value("compress", true).toBool());
settings.endGroup();
}
return a.exec();
}
|