Changeset View
Changeset View
Standalone View
Standalone View
src/kdbusservice.cpp
Show First 20 Lines • Show All 104 Lines • ▼ Show 20 Line(s) | 72 | public: | |||
---|---|---|---|---|---|
105 | void generateServiceName() | 105 | void generateServiceName() | ||
106 | { | 106 | { | ||
107 | d->serviceName = d->generateServiceName(); | 107 | d->serviceName = d->generateServiceName(); | ||
108 | objectPath = QLatin1Char('/') + d->serviceName; | 108 | objectPath = QLatin1Char('/') + d->serviceName; | ||
109 | objectPath.replace(QLatin1Char('.'), QLatin1Char('/')); | 109 | objectPath.replace(QLatin1Char('.'), QLatin1Char('/')); | ||
110 | objectPath.replace(QLatin1Char('-'), QLatin1Char('_')); // see spec change at https://bugs.freedesktop.org/show_bug.cgi?id=95129 | 110 | objectPath.replace(QLatin1Char('-'), QLatin1Char('_')); // see spec change at https://bugs.freedesktop.org/show_bug.cgi?id=95129 | ||
111 | 111 | | |||
112 | if (options & KDBusService::Multiple) { | 112 | if (options & KDBusService::Multiple) { | ||
113 | const bool inSandbox = QFileInfo::exists(QStringLiteral("/flatpak-info")); | 113 | const bool inSandbox = QFileInfo::exists(QStringLiteral("/.flatpak-info")); | ||
114 | if (inSandbox) { | 114 | if (inSandbox) { | ||
115 | d->serviceName += QStringLiteral(".kdbus-") + QDBusConnection::sessionBus().baseService().replace(QRegularExpression(QStringLiteral("[\\.:]")), QStringLiteral("_")); | 115 | d->serviceName += QStringLiteral(".kdbus-") + QDBusConnection::sessionBus().baseService().replace(QRegularExpression(QStringLiteral("[\\.:]")), QStringLiteral("_")); | ||
116 | } else { | 116 | } else { | ||
117 | d->serviceName += QLatin1Char('-') + QString::number(QCoreApplication::applicationPid()); | 117 | d->serviceName += QLatin1Char('-') + QString::number(QCoreApplication::applicationPid()); | ||
118 | } | 118 | } | ||
119 | } | 119 | } | ||
120 | } | 120 | } | ||
121 | 121 | | |||
▲ Show 20 Lines • Show All 220 Lines • Show Last 20 Lines |