summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobert Griebl <robert.griebl@pelagicore.com>2019-01-22 17:58:02 +0100
committerDominik Holland <dominik.holland@pelagicore.com>2019-03-14 09:58:47 +0000
commit4a7279159133241907ab68de7ec3295a7b0fe867 (patch)
tree90825e44784f6ad7e94518e9906fddc393f81f64
parent09f0e5808f039fc308e7d1f90dfb41c25383f040 (diff)
Better automatic dbus setup during development
The default is now to always start a private session bus, unless explicitly configured otherwise. This solves 2 problems: 1) There's no difference between Linux and Mac/Win in regards to configuration default values 2) The 'notifications end up in the desktop environment' problems on Linux desktops cannot happen anymore with a default setup. The --start-session-dbus command line option is now the default and thus obsolete. Change-Id: Ib0487307668ba6d5edfb9c4b0daa5888d1e3b327 Reviewed-by: Kavindra Palaraja <kpalaraja@luxoft.com> Reviewed-by: Dominik Holland <dominik.holland@pelagicore.com>
-rwxr-xr-xbenchmarks/appman-bench/run.sh2
-rw-r--r--doc/configuration.qdoc25
-rw-r--r--examples/applicationmanager/animated-windows/animated-windows.pro2
-rw-r--r--examples/applicationmanager/frame-timer/frame-timer.pro2
-rw-r--r--examples/applicationmanager/minidesk/doc/src/minidesk.qdoc8
-rw-r--r--examples/applicationmanager/minidesk/minidesk.pro2
-rw-r--r--examples/applicationmanager/multi-views/multi-views.pro2
-rw-r--r--examples/applicationmanager/process-status/process-status.pro2
-rw-r--r--qmake-features/am-qml-testcase.prf1
-rw-r--r--src/dbus-lib/dbusdaemon.cpp5
-rw-r--r--src/main-lib/defaultconfiguration.cpp13
-rw-r--r--src/main-lib/defaultconfiguration.h1
-rw-r--r--src/main-lib/main.cpp143
-rw-r--r--src/main-lib/main.h8
-rw-r--r--src/package-lib/package.cpp1
-rw-r--r--util/bash/appman-prompt2
16 files changed, 111 insertions, 108 deletions
diff --git a/benchmarks/appman-bench/run.sh b/benchmarks/appman-bench/run.sh
index 709afb4e..3c25d217 100755
--- a/benchmarks/appman-bench/run.sh
+++ b/benchmarks/appman-bench/run.sh
@@ -117,7 +117,7 @@ run_test()
echo "Running $test_qml in $temp_folder"
cp $test_qml $temp_folder/test.qml
- (cd $temp_folder && $APPMAN -c am-config.yaml -r --no-dlt-logging --start-session-dbus)
+ (cd $temp_folder && $APPMAN -c am-config.yaml -r --no-dlt-logging)
}
if [ -n "$TEST" ]
diff --git a/doc/configuration.qdoc b/doc/configuration.qdoc
index 72aded9d..96f87163 100644
--- a/doc/configuration.qdoc
+++ b/doc/configuration.qdoc
@@ -149,13 +149,19 @@ all your imports paths and file references relative to your main config file.
\br \e -
\li string
\li Register the ApplicationManager, ApplicationInstaller, NotificationManager and
- WindowManager on the specified D-Bus: can be either \c session, \c system, \c none (for no
- registration at all) or a full D-Bus bus specification string. (default: \c session on
- Linux, \c none on all other platforms)
- \note On production systems, you most likely want to put the application manager on the
- \c system bus, where you can set detailed security policies using standard D-Bus
- mechanisms, while keeping the NotificationManager on the session bus. See the more
- advanced config-file option \c dbus below.
+ WindowManager on the specified D-Bus: can be either a full D-Bus bus specification string,
+ \c session, \c system, \c auto (default), or \c none (for no registration at all).
+
+ Use the \c auto keyword on the desktop or during development only. This keyword implies that
+ the application manager tries to start a private session bus and uses that bus if
+ successful. Otherwise, it results in no registration at all, which is equivalent to \c none.
+
+ On production systems, you may want to put the application manager on the \c system bus,
+ where you can set detailed security policies using standard D-Bus mechanisms, while keeping
+ the NotificationManager on the session bus. See the more advanced config-file option
+ \c dbus below.
+
+ \note The new \c auto keyword replaces the old \c --start-session-dbus flag
\row
\li \b -
\br \e dbus
@@ -166,11 +172,6 @@ all your imports paths and file references relative to your main config file.
org.freedesktop.Notifications). If such a key is present, it will take precedence over the
command-line option \c dbus. Each key's value is a \l{D-Bus specification} object.
\row
- \li \b --start-session-dbus
- \br \e -
- \li bool
- \li Start a private session bus instead of using an existing one.
-\row
\li \b --fullscreen
\br \e ui/fullscreen
\li bool
diff --git a/examples/applicationmanager/animated-windows/animated-windows.pro b/examples/applicationmanager/animated-windows/animated-windows.pro
index aea1ce9e..539906b7 100644
--- a/examples/applicationmanager/animated-windows/animated-windows.pro
+++ b/examples/applicationmanager/animated-windows/animated-windows.pro
@@ -22,7 +22,7 @@ AM_COPY_FILES += am-config.yaml
prefix_build:tpath = $$target.path
else:tpath = $$_PRO_FILE_PWD_
-AM_DEFAULT_ARGS = -c $$tpath/am-config.yaml --start-session-dbus --verbose -r
+AM_DEFAULT_ARGS = -c $$tpath/am-config.yaml --verbose -r
example_sources.path = $$target.path
example_sources.files = $$AM_COPY_FILES $$AM_COPY_DIRECTORIES
diff --git a/examples/applicationmanager/frame-timer/frame-timer.pro b/examples/applicationmanager/frame-timer/frame-timer.pro
index 6139216e..db6258ef 100644
--- a/examples/applicationmanager/frame-timer/frame-timer.pro
+++ b/examples/applicationmanager/frame-timer/frame-timer.pro
@@ -22,7 +22,7 @@ AM_COPY_FILES += am-config.yaml
prefix_build:tpath = $$target.path
else:tpath = $$_PRO_FILE_PWD_
-AM_DEFAULT_ARGS = -c $$tpath/am-config.yaml --start-session-dbus --verbose -r
+AM_DEFAULT_ARGS = -c $$tpath/am-config.yaml --verbose -r
example_sources.path = $$target.path
example_sources.files = $$AM_COPY_FILES $$AM_COPY_DIRECTORIES
diff --git a/examples/applicationmanager/minidesk/doc/src/minidesk.qdoc b/examples/applicationmanager/minidesk/doc/src/minidesk.qdoc
index ec17a1d9..02d58ce5 100644
--- a/examples/applicationmanager/minidesk/doc/src/minidesk.qdoc
+++ b/examples/applicationmanager/minidesk/doc/src/minidesk.qdoc
@@ -70,14 +70,6 @@ The example can be started from within the minidesk folder with:
path/to/bin/appman -c am-config.yaml -r
\endcode
-\note The application-manager attempts to register a \c freedesktop.org compliant notification
-server. DBus errors might occur if it conflicts with the server running on the host desktop
-environment. In this case, a private session bus needs to be started by adding the
-\c --start-session-dbus option:
-\badcode
-path/to/bin/appman -c am-config.yaml -r --start-session-dbus
-\endcode
-
\section1 Walkthrough
\section2 System-UI Window
diff --git a/examples/applicationmanager/minidesk/minidesk.pro b/examples/applicationmanager/minidesk/minidesk.pro
index bf101c46..1a88507f 100644
--- a/examples/applicationmanager/minidesk/minidesk.pro
+++ b/examples/applicationmanager/minidesk/minidesk.pro
@@ -23,7 +23,7 @@ AM_COPY_FILES += am-config.yaml
prefix_build:tpath = $$target.path
else:tpath = $$_PRO_FILE_PWD_
-AM_DEFAULT_ARGS = -c $$tpath/am-config.yaml --start-session-dbus --verbose
+AM_DEFAULT_ARGS = -c $$tpath/am-config.yaml --verbose
example_sources.path = $$target.path
example_sources.files = $$AM_COPY_FILES $$AM_COPY_DIRECTORIES doc
diff --git a/examples/applicationmanager/multi-views/multi-views.pro b/examples/applicationmanager/multi-views/multi-views.pro
index 0cfa4ff7..2cff5f66 100644
--- a/examples/applicationmanager/multi-views/multi-views.pro
+++ b/examples/applicationmanager/multi-views/multi-views.pro
@@ -17,7 +17,7 @@ AM_COPY_FILES += am-config.yaml
prefix_build:tpath = $$target.path
else:tpath = $$_PRO_FILE_PWD_
-AM_DEFAULT_ARGS = -c $$tpath/am-config.yaml --start-session-dbus --verbose -r
+AM_DEFAULT_ARGS = -c $$tpath/am-config.yaml --verbose -r
example_sources.path = $$target.path
example_sources.files = $$AM_COPY_FILES $$AM_COPY_DIRECTORIES
diff --git a/examples/applicationmanager/process-status/process-status.pro b/examples/applicationmanager/process-status/process-status.pro
index f72ad26c..ac1576c6 100644
--- a/examples/applicationmanager/process-status/process-status.pro
+++ b/examples/applicationmanager/process-status/process-status.pro
@@ -25,7 +25,7 @@ AM_COPY_FILES += am-config.yaml
prefix_build:tpath = $$target.path
else:tpath = $$_PRO_FILE_PWD_
-AM_DEFAULT_ARGS = -c $$tpath/am-config.yaml --start-session-dbus --verbose -r
+AM_DEFAULT_ARGS = -c $$tpath/am-config.yaml --verbose -r
example_sources.path = $$target.path
example_sources.files = $$AM_COPY_FILES $$AM_COPY_DIRECTORIES
diff --git a/qmake-features/am-qml-testcase.prf b/qmake-features/am-qml-testcase.prf
index 125ae281..c7f2396a 100644
--- a/qmake-features/am-qml-testcase.prf
+++ b/qmake-features/am-qml-testcase.prf
@@ -42,7 +42,6 @@ prefix_build {
# The check command
COMMAND += $$AM_TESTRUNNER_DIR/appman-qmltestrunner -r --no-dlt-logging
mac: COMMAND += --dbus=none
-multi-process: COMMAND += --start-session-dbus
!multi-process: {
!build_pass:!qmltest-mode-auto:message("am-qml-testcase: forcing MODE to single-process, because application-manager is built in single-process mode")
MODE = single-process
diff --git a/src/dbus-lib/dbusdaemon.cpp b/src/dbus-lib/dbusdaemon.cpp
index 7e9e04b6..94533c3e 100644
--- a/src/dbus-lib/dbusdaemon.cpp
+++ b/src/dbus-lib/dbusdaemon.cpp
@@ -71,6 +71,8 @@ DBusDaemonProcess::DBusDaemonProcess(QObject *parent)
+ QString::number(QCoreApplication::applicationPid()) + qSL("-session.bus");
arguments << address;
+#elif defined(Q_OS_WIN)
+ arguments << qSL(" --address=tcp:host=localhost");
#endif
setProgram(program);
setArguments(arguments);
@@ -95,6 +97,8 @@ void DBusDaemonProcess::start() Q_DECL_NOEXCEPT_EXPR(false)
{
static const int timeout = 10000 * int(timeoutFactor());
+ qunsetenv("DBUS_SESSION_BUS_ADDRESS");
+
auto dbusDaemon = new DBusDaemonProcess(qApp);
dbusDaemon->QProcess::start(QIODevice::ReadOnly);
if (!dbusDaemon->waitForStarted(timeout) || !dbusDaemon->waitForReadyRead(timeout)) {
@@ -102,6 +106,7 @@ void DBusDaemonProcess::start() Q_DECL_NOEXCEPT_EXPR(false)
.arg(dbusDaemon->program(), dbusDaemon->errorString());
}
QByteArray busAddress = dbusDaemon->readAllStandardOutput().trimmed();
+
qputenv("DBUS_SESSION_BUS_ADDRESS", busAddress);
qCInfo(LogSystem, "NOTICE: running on private D-Bus session bus to avoid conflicts:");
qCInfo(LogSystem, " DBUS_SESSION_BUS_ADDRESS=%s", busAddress.constData());
diff --git a/src/main-lib/defaultconfiguration.cpp b/src/main-lib/defaultconfiguration.cpp
index cddaf459..00885676 100644
--- a/src/main-lib/defaultconfiguration.cpp
+++ b/src/main-lib/defaultconfiguration.cpp
@@ -93,8 +93,7 @@ DefaultConfiguration::DefaultConfiguration(const QStringList &defaultConfigFileP
m_clp.addOption({ qSL("disable-installer"), qSL("disable the application installer sub-system.") });
m_clp.addOption({ qSL("disable-intents"), qSL("disable the intents sub-system.") });
#if defined(QT_DBUS_LIB)
- m_clp.addOption({ qSL("dbus"), qSL("register on the specified D-Bus."), qSL("<bus>|system|session|none"), qSL("session") });
- m_clp.addOption({ qSL("start-session-dbus"), qSL("start a private session bus instead of using an existing one.") });
+ m_clp.addOption({ qSL("dbus"), qSL("register on the specified D-Bus."), qSL("<bus>|system|session|none|auto"), qSL("auto") });
#endif
m_clp.addOption({ qSL("fullscreen"), qSL("display in full-screen.") });
m_clp.addOption({ qSL("no-fullscreen"), qSL("do not display in full-screen.") });
@@ -402,15 +401,7 @@ QVariantMap DefaultConfiguration::dbusPolicy(const char *interfaceName) const
QString DefaultConfiguration::dbusRegistration(const char *interfaceName) const
{
- QString dbus = value<QString>("dbus", { "dbus", interfaceName, "register" });
- if (dbus == qL1S("none"))
- dbus.clear();
- return dbus;
-}
-
-bool DefaultConfiguration::dbusStartSessionBus() const
-{
- return value<bool>("start-session-dbus", { "dbus", "startSessionBus" });
+ return value<QString>("dbus", { "dbus", interfaceName, "register" });
}
QVariantMap DefaultConfiguration::rawSystemProperties() const
diff --git a/src/main-lib/defaultconfiguration.h b/src/main-lib/defaultconfiguration.h
index 0a21394f..2a1494e1 100644
--- a/src/main-lib/defaultconfiguration.h
+++ b/src/main-lib/defaultconfiguration.h
@@ -107,7 +107,6 @@ public:
QVariantMap dbusPolicy(const char *interfaceName) const;
QString dbusRegistration(const char *interfaceName) const;
- bool dbusStartSessionBus() const;
QVariantMap rawSystemProperties() const;
diff --git a/src/main-lib/main.cpp b/src/main-lib/main.cpp
index 302b795e..e02441cf 100644
--- a/src/main-lib/main.cpp
+++ b/src/main-lib/main.cpp
@@ -253,9 +253,8 @@ void Main::setup(const DefaultConfiguration *cfg, const QStringList &deploymentW
setupShellServer(cfg->telnetAddress(), cfg->telnetPort());
setupSSDPService();
- setupDBus(cfg->dbusStartSessionBus());
- registerDBusInterfaces(std::bind(&DefaultConfiguration::dbusRegistration, cfg, std::placeholders::_1),
- std::bind(&DefaultConfiguration::dbusPolicy, cfg, std::placeholders::_1));
+ setupDBus(std::bind(&DefaultConfiguration::dbusRegistration, cfg, std::placeholders::_1),
+ std::bind(&DefaultConfiguration::dbusPolicy, cfg, std::placeholders::_1));
}
bool Main::isSingleProcessMode() const
@@ -347,19 +346,6 @@ void Main::parseSystemProperties(const QVariantMap &rawSystemProperties)
iface->initialize(m_systemProperties.at(SP_SystemUi));
}
-void Main::setupDBus(bool startSessionBus) Q_DECL_NOEXCEPT_EXPR(false)
-{
-#if defined(QT_DBUS_LIB) && !defined(AM_DISABLE_EXTERNAL_DBUS_INTERFACES)
- if (Q_LIKELY(startSessionBus)) {
- DBusDaemonProcess::start();
-
- StartupTimer::instance()->checkpoint("after starting session D-Bus");
- }
-#else
- Q_UNUSED(startSessionBus)
-#endif
-}
-
void Main::setMainQmlFile(const QString &mainQml) Q_DECL_NOEXCEPT_EXPR(false)
{
// For some weird reason, QFile cannot cope with "qrc:/" and QUrl cannot cope with ":/" , so
@@ -905,17 +891,7 @@ void Main::setupSSDPService() Q_DECL_NOEXCEPT_EXPR(false)
#if defined(QT_DBUS_LIB) && !defined(AM_DISABLE_EXTERNAL_DBUS_INTERFACES)
-const char *Main::dbusInterfaceName(QObject *o) const Q_DECL_NOEXCEPT_EXPR(false)
-{
- int idx = o->metaObject()->indexOfClassInfo("D-Bus Interface");
- if (idx < 0) {
- throw Exception("Could not get class-info \"D-Bus Interface\" for D-Bus adapter %1")
- .arg(qL1S(o->metaObject()->className()));
- }
- return o->metaObject()->classInfo(idx).value();
-}
-
-void Main::registerDBusObject(QDBusAbstractAdaptor *adaptor, const QString &dbusName, const char *serviceName, const char *interfaceName, const char *path) Q_DECL_NOEXCEPT_EXPR(false)
+void Main::registerDBusObject(QDBusAbstractAdaptor *adaptor, QString dbusName, const char *serviceName, const char *interfaceName, const char *path) Q_DECL_NOEXCEPT_EXPR(false)
{
QString dbusAddress;
QDBusConnection conn((QString()));
@@ -932,6 +908,12 @@ void Main::registerDBusObject(QDBusAbstractAdaptor *adaptor, const QString &dbus
} else if (dbusName == qL1S("session")) {
dbusAddress = QString::fromLocal8Bit(qgetenv("DBUS_SESSION_BUS_ADDRESS"));
conn = QDBusConnection::sessionBus();
+ } else if (dbusName == qL1S("auto")) {
+ dbusAddress = QString::fromLocal8Bit(qgetenv("DBUS_SESSION_BUS_ADDRESS"));
+ conn = QDBusConnection::sessionBus();
+ if (!conn.isConnected())
+ return;
+ dbusName = qL1S("session");
} else {
dbusAddress = dbusName;
conn = QDBusConnection::connectToBus(dbusAddress, qSL("custom"));
@@ -979,56 +961,91 @@ void Main::registerDBusObject(QDBusAbstractAdaptor *adaptor, const QString &dbus
#endif // defined(QT_DBUS_LIB) && !defined(AM_DISABLE_EXTERNAL_DBUS_INTERFACES)
-void Main::registerDBusInterfaces(const std::function<QString(const char *)> &busForInterface,
- const std::function<QVariantMap(const char *)> &policyForInterface)
+void Main::setupDBus(const std::function<QString(const char *)> &busForInterface,
+ const std::function<QVariantMap(const char *)> &policyForInterface)
{
#if defined(QT_DBUS_LIB) && !defined(AM_DISABLE_EXTERNAL_DBUS_INTERFACES)
registerDBusTypes();
- try {
- qCDebug(LogSystem) << "Registering D-Bus services:";
+ // <0> AbstractDBusContextAdaptor instance
+ // <1> D-Bus name (extracted from callback function busForInterface)
+ // <2> D-Bus service
+ // <3> D-Bus path
+ // <4> Interface name (extracted from Q_CLASSINFO below)
- auto ama = new ApplicationManagerDBusContextAdaptor(m_applicationManager);
+ std::vector<std::tuple<AbstractDBusContextAdaptor *, QString, const char *, const char *, const char *>> ifaces;
- const char *amInterfaceName = dbusInterfaceName(ama->generatedAdaptor());
- registerDBusObject(ama->generatedAdaptor(), busForInterface(amInterfaceName),
- "io.qt.ApplicationManager", amInterfaceName, "/ApplicationManager");
- if (!DBusPolicy::add(ama->generatedAdaptor(), policyForInterface(amInterfaceName)))
- throw Exception(Error::DBus, "could not set DBus policy for ApplicationManager");
+ auto addInterface = [&ifaces, &busForInterface](AbstractDBusContextAdaptor *adaptor, const char *service, const char *path) {
+ int idx = adaptor->parent()->metaObject()->indexOfClassInfo("D-Bus Interface");
+ if (idx < 0) {
+ throw Exception("Could not get class-info \"D-Bus Interface\" for D-Bus adapter %1")
+ .arg(qL1S(adaptor->parent()->metaObject()->className()));
+ }
+ const char *interfaceName = adaptor->parent()->metaObject()->classInfo(idx).value();
+ ifaces.emplace_back(adaptor, busForInterface(interfaceName), service, path, interfaceName);
+ };
# if !defined(AM_DISABLE_INSTALLER)
- if (m_applicationInstaller) {
- auto aia = new ApplicationInstallerDBusContextAdaptor(m_applicationInstaller);
- const char *aiInterfaceName = dbusInterfaceName(m_applicationInstaller);
- registerDBusObject(aia->generatedAdaptor(), busForInterface(aiInterfaceName),
- "io.qt.ApplicationManager", aiInterfaceName, "/ApplicationInstaller");
- if (!DBusPolicy::add(aia->generatedAdaptor(), policyForInterface(aiInterfaceName)))
- throw Exception(Error::DBus, "could not set DBus policy for ApplicationInstaller");
- }
+ addInterface(new ApplicationInstallerDBusContextAdaptor(m_applicationInstaller),
+ "io.qt.ApplicationManager", "/ApplicationInstaller");
# endif
-
# if !defined(AM_HEADLESS)
+ addInterface(new WindowManagerDBusContextAdaptor(m_windowManager),
+ "io.qt.ApplicationManager", "/WindowManager");
+ addInterface(new NotificationManagerDBusContextAdaptor(m_notificationManager),
+ "org.freedesktop.Notifications", "/org/freedesktop/Notifications");
+# endif
+ addInterface(new ApplicationManagerDBusContextAdaptor(m_applicationManager),
+ "io.qt.ApplicationManager", "/ApplicationManager");
+
+ bool autoOnly = true;
+ bool noneOnly = true;
+
+ // check if all interfaces are on the "auto" bus and replace the "none" bus with nullptr
+ for (auto &&iface : ifaces) {
+ QString dbusName = std::get<1>(iface);
+ if (dbusName != qSL("auto"))
+ autoOnly = false;
+ if (dbusName == qSL("none"))
+ std::get<1>(iface).clear();
+ else
+ noneOnly = false;
+ }
+
+ // start a private dbus-daemon session instance if all interfaces are set to "auto"
+ if (Q_UNLIKELY(autoOnly)) {
try {
- auto nma = new NotificationManagerDBusContextAdaptor(m_notificationManager);
- const char *nmInterfaceName = dbusInterfaceName(m_notificationManager);
- registerDBusObject(nma->generatedAdaptor(), busForInterface(nmInterfaceName),
- "org.freedesktop.Notifications", nmInterfaceName, "/org/freedesktop/Notifications");
+ DBusDaemonProcess::start();
+ StartupTimer::instance()->checkpoint("after starting session D-Bus");
} catch (const Exception &e) {
- //TODO: what should we do here? on the desktop this will obviously always fail
- qCCritical(LogSystem) << "WARNING:" << e.what();
- qCCritical(LogSystem) << "NOTE: Please consider starting with the --start-session-dbus option to work around this issue.";
+ qCWarning(LogSystem) << "Disabling external D-Bus interfaces:" << e.what();
+ for (auto &&iface : ifaces)
+ std::get<1>(iface).clear();
+ noneOnly = true;
}
+ }
- auto wma = new WindowManagerDBusContextAdaptor(m_windowManager);
- const char *wmInterfaceName = dbusInterfaceName(m_windowManager);
- registerDBusObject(wma->generatedAdaptor(), busForInterface(wmInterfaceName),
- "io.qt.ApplicationManager", wmInterfaceName, "/WindowManager");
- if (!DBusPolicy::add(wma->generatedAdaptor(), policyForInterface(wmInterfaceName)))
- throw Exception(Error::DBus, "could not set DBus policy for WindowManager");
-# endif
- } catch (const std::exception &e) {
- qCCritical(LogSystem) << "ERROR:" << e.what();
- qApp->exit(2);
+ if (!noneOnly) {
+ try {
+ qCDebug(LogSystem) << "Registering D-Bus services:";
+
+ for (auto &&iface : ifaces) {
+ AbstractDBusContextAdaptor *dbusAdaptor = std::get<0>(iface);
+ QString &dbusName = std::get<1>(iface);
+ const char *interfaceName = std::get<4>(iface);
+
+ if (dbusName.isEmpty())
+ continue;
+
+ registerDBusObject(dbusAdaptor->generatedAdaptor(), dbusName,
+ std::get<2>(iface),interfaceName, std::get<3>(iface));
+ if (!DBusPolicy::add(dbusAdaptor->generatedAdaptor(), policyForInterface(interfaceName)))
+ throw Exception(Error::DBus, "could not set DBus policy for %1").arg(qL1S(interfaceName));
+ }
+ } catch (const std::exception &e) {
+ qCCritical(LogSystem) << "ERROR:" << e.what();
+ qApp->exit(2);
+ }
}
#else
Q_UNUSED(busForInterface)
diff --git a/src/main-lib/main.h b/src/main-lib/main.h
index 33b70215..1ce567c8 100644
--- a/src/main-lib/main.h
+++ b/src/main-lib/main.h
@@ -107,9 +107,8 @@ public:
protected:
void loadStartupPlugins(const QStringList &startupPluginPaths) Q_DECL_NOEXCEPT_EXPR(false);
void parseSystemProperties(const QVariantMap &rawSystemProperties);
- void setupDBus(bool startSessionBus) Q_DECL_NOEXCEPT_EXPR(false);
- void registerDBusInterfaces(const std::function<QString(const char *)> &busForInterface,
- const std::function<QVariantMap(const char *)> &policyForInterface);
+ void setupDBus(const std::function<QString(const char *)> &busForInterface,
+ const std::function<QVariantMap(const char *)> &policyForInterface);
void setMainQmlFile(const QString &mainQml) Q_DECL_NOEXCEPT_EXPR(false);
void setupSingleOrMultiProcess(bool forceSingleProcess, bool forceMultiProcess) Q_DECL_NOEXCEPT_EXPR(false);
void setupRuntimesAndContainers(const QVariantMap &runtimeConfigurations, const QVariantMap &openGLConfiguration,
@@ -143,8 +142,7 @@ protected:
private:
#if defined(QT_DBUS_LIB) && !defined(AM_DISABLE_EXTERNAL_DBUS_INTERFACES)
- const char *dbusInterfaceName(QObject *o) const Q_DECL_NOEXCEPT_EXPR(false);
- void registerDBusObject(QDBusAbstractAdaptor *adaptor, const QString &dbusName, const char *serviceName,
+ void registerDBusObject(QDBusAbstractAdaptor *adaptor, QString dbusName, const char *serviceName,
const char *interfaceName, const char *path) Q_DECL_NOEXCEPT_EXPR(false);
#endif
static QVector<AbstractApplicationInfo *> scanForApplication(const QString &singleAppInfoYaml,
diff --git a/src/package-lib/package.cpp b/src/package-lib/package.cpp
index 6d46189e..481117e9 100644
--- a/src/package-lib/package.cpp
+++ b/src/package-lib/package.cpp
@@ -60,6 +60,7 @@ bool Package::ensureCorrectLocale(QStringList *warnings)
#if defined(Q_OS_WIN)
// Windows is UTF16
+ Q_UNUSED(warnings)
return true;
#else
diff --git a/util/bash/appman-prompt b/util/bash/appman-prompt
index f42d4ae9..cd85278f 100644
--- a/util/bash/appman-prompt
+++ b/util/bash/appman-prompt
@@ -36,7 +36,7 @@ _appman()
--database --dbus --force-multi-process --force-single-process --fullscreen --help -I \
--installed-apps-manifest-dir --load-dummydata --logging-rule --no-config-cache --no-dlt-logging \
--no-fullscreen --no-security --no-ui-watchdog -o --option --qml-debug --recreate-database -r --single-app \
---slow-animations --start-session-dbus --verbose --version --wayland-socket-name"
+--slow-animations --verbose --version --wayland-socket-name"
if [[ ${cur} == -* ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )