forked from mer-hybris/geoclue-providers-hybris
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.cpp
41 lines (33 loc) · 1.52 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
/*
Copyright (C) 2015 Jolla Ltd.
Contact: Aaron McCarthy <[email protected]>
This file is part of geoclue-hybris.
Geoclue-hybris is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License.
*/
#include <QtCore/QCoreApplication>
#include <QtCore/QLoggingCategory>
#include <QtDBus/QDBusConnection>
#include "hybrisprovider.h"
#include <locationsettings.h>
int main(int argc, char *argv[])
{
#if QT_VERSION >= QT_VERSION_CHECK(5, 3, 0)
QCoreApplication::setSetuidAllowed(true);
#endif
QLoggingCategory::setFilterRules(QStringLiteral("geoclue.provider.hybris.debug=false\n"
"geoclue.provider.hybris.nmea.debug=false\n"
"geoclue.provider.hybris.position.debug=false"));
QCoreApplication a(argc, argv);
QDBusConnection session = QDBusConnection::sessionBus();
LocationSettings settings;
HybrisProvider provider;
provider.setLocationSettings(&settings);
if (!session.registerObject(QStringLiteral("/org/freedesktop/Geoclue/Providers/Hybris"), &provider))
qFatal("Failed to register object /org/freedesktop/Geoclue/Providers/Hybris");
if (!session.registerService(QStringLiteral("org.freedesktop.Geoclue.Providers.Hybris")))
qFatal("Failed to register service org.freedesktop.Geoclue.Providers.Hybris");
return a.exec();
}