QDBusTrayIcon: always save the temp icon in Unity

We enforce the check of saving the icon when the indicator
process name isn't available (as we might be running in a
confined world), but we're running in Unity.

Change-Id: I80d3be1a8c6eba8c391364260746e78cf89a5b98
Reviewed-by: Dmitry Shachnev <mitya57@gmail.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
bb10
Marco Trevisan (Treviño) 2017-01-13 17:40:56 +01:00 committed by Giuseppe D'Angelo
parent 3edeb5c909
commit b934572b30
1 changed files with 6 additions and 0 deletions

View File

@ -171,6 +171,12 @@ QTemporaryFile *QDBusTrayIcon::tempIcon(const QIcon &icon)
uint pid = session.interface()->servicePid(KDEWatcherService).value();
QString processName = QLockFilePrivate::processNameByPid(pid);
necessary = processName.endsWith(QLatin1String("indicator-application-service"));
if (!necessary && QGuiApplication::desktopSettingsAware()) {
// Accessing to process name might be not allowed if the application
// is confined, thus we can just rely on the current desktop in use
const QPlatformServices *services = QGuiApplicationPrivate::platformIntegration()->services();
necessary = services->desktopEnvironment().split(':').contains("UNITY");
}
necessity_checked = true;
}
if (!necessary)