-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathmain.cpp
More file actions
41 lines (34 loc) · 1.21 KB
/
main.cpp
File metadata and controls
41 lines (34 loc) · 1.21 KB
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
35
36
37
38
39
40
41
// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd.
//
// SPDX-License-Identifier: LGPL-3.0-or-later
#include "dbusfaceservice.h"
#include "definehead.h"
#include <DLog>
#include <QCoreApplication>
DCORE_USE_NAMESPACE
static QString logPath = "/var/log/deepin-face.log";
int main(int argc, char *argv[])
{
QCoreApplication a(argc, argv);
DLogManager::setlogFilePath(logPath);
DLogManager::registerConsoleAppender();
DLogManager::registerFileAppender();
DbusFaceService w;
QDBusConnection connection = QDBusConnection::systemBus();
if ( !connection.registerObject(SERVERPATH,
&w,
QDBusConnection::ExportAllSlots
| QDBusConnection::ExportScriptableProperties
| QDBusConnection::ExportAllSignals)) {
qWarning() << "dbus object registere error!";
return -1;
}
auto reply = connection.registerService(SERVERNAME);
if (reply != QDBusConnectionInterface::ServiceRegistered)
{
qWarning() << "dbus service registere error!";
/* code */
return -1;
}
return a.exec();
}