Changeset View
Changeset View
Standalone View
Standalone View
applets/systemtray/systemtray.cpp
Show First 20 Lines • Show All 103 Lines • ▼ Show 20 Line(s) | |||||
104 | { | 104 | { | ||
105 | foreach (Plasma::Applet *applet, applets()) { | 105 | foreach (Plasma::Applet *applet, applets()) { | ||
106 | if (!applet->pluginInfo().isValid()) { | 106 | if (!applet->pluginInfo().isValid()) { | ||
107 | continue; | 107 | continue; | ||
108 | } | 108 | } | ||
109 | 109 | | |||
110 | //only allow one instance per applet | 110 | //only allow one instance per applet | ||
111 | if (task == applet->pluginInfo().pluginName()) { | 111 | if (task == applet->pluginInfo().pluginName()) { | ||
112 | //Applet::destroy doesn't delete the applet from Containment::applets in the same event | ||||
113 | //potentially a dbus activated service being restarted can be added in this time. | ||||
114 | if (!applet->destroyed()) { | ||||
112 | return; | 115 | return; | ||
113 | } | 116 | } | ||
114 | } | 117 | } | ||
118 | } | ||||
115 | 119 | | |||
116 | createApplet(task, QVariantList() << "org.kde.plasma:force-create"); | 120 | createApplet(task, QVariantList() << "org.kde.plasma:force-create"); | ||
117 | } | 121 | } | ||
118 | 122 | | |||
119 | void SystemTray::cleanupTask(const QString &task) | 123 | void SystemTray::cleanupTask(const QString &task) | ||
120 | { | 124 | { | ||
121 | foreach (Plasma::Applet *applet, applets()) { | 125 | foreach (Plasma::Applet *applet, applets()) { | ||
122 | if (!applet->pluginInfo().isValid() || task == applet->pluginInfo().pluginName()) { | 126 | if (!applet->pluginInfo().isValid() || task == applet->pluginInfo().pluginName()) { | ||
▲ Show 20 Lines • Show All 469 Lines • Show Last 20 Lines |