-
Notifications
You must be signed in to change notification settings - Fork 8
/
main.cpp
46 lines (37 loc) · 1.36 KB
/
main.cpp
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
42
43
44
45
46
#include <QApplication>
#include <QDBusConnection>
#include <QDBusConnectionInterface>
#include "menuimporter.h"
#include "menuimporteradaptor.h"
#include "gmenu-dbusmenu-proxy/menuproxy.h"
static const char* DBUS_SERVICE = "com.canonical.AppMenu.Registrar";
static const char* DBUS_OBJECT_PATH = "/com/canonical/AppMenu/Registrar";
int main(int argc, char *argv[]) {
QApplication app(argc, argv);
qputenv("QT_QPA_PLATFORM", "xcb");
QGuiApplication::setDesktopSettingsAware(false);
// QCoreApplication::setAttribute(Qt::AA_DisableSessionManager);
app.setQuitOnLastWindowClosed(false);
MenuProxy proxy;
/*
Create a Chat instance and register it with the session bus only if
the service isn't already available.
*/
auto *m_menuImporter = new MenuImporter(&app);
m_menuImporter->connectToBus();
// QDBusConnection connection = QDBusConnection::sessionBus();
// if (!connection.interface()->isServiceRegistered(DBUS_SERVICE))
// {
// auto *m_menuAdaptor = new MenuImporterAdaptor(m_menuImporter);
// if (!connection.registerService(DBUS_SERVICE))
// {
// qFatal("Could not register service!");
// }
//
// if (!connection.registerObject(DBUS_OBJECT_PATH, m_menuImporter))
// {
// qFatal("Could not register Chat object!");
// }
// }
return app.exec();
}