mirror of
https://github.com/linuxdeepin/dde-dock.git
synced 2025-06-04 17:33:05 +00:00
fixed:tray error
托盘加载插件时,插件对应的dbus服务有时候还没启动,这时会绑定一个QDBusConnectionInterface::serviceOwnerChanged,当事件触发时,调用插件的init方法。托盘里每次init都会重新创建所有widget,导致托盘内的插件图标全部消失。
This commit is contained in:
parent
1b8aa5fa44
commit
e6a106fe24
@ -43,6 +43,7 @@ using org::kde::StatusNotifierWatcher;
|
||||
|
||||
TrayPlugin::TrayPlugin(QObject *parent)
|
||||
: QObject(parent)
|
||||
, m_pluginLoaded(false)
|
||||
{
|
||||
}
|
||||
|
||||
@ -68,6 +69,12 @@ void TrayPlugin::init(PluginProxyInterface *proxyInter)
|
||||
return;
|
||||
}
|
||||
|
||||
if (m_pluginLoaded) {
|
||||
return;
|
||||
}
|
||||
|
||||
m_pluginLoaded = true;
|
||||
|
||||
m_trayInter = new DBusTrayManager(this);
|
||||
m_sniWatcher = new StatusNotifierWatcher(SNI_WATCHER_SERVICE, SNI_WATCHER_PATH, QDBusConnection::sessionBus(), this);
|
||||
m_fashionItem = new FashionTrayItem(this);
|
||||
|
@ -99,6 +99,7 @@ private:
|
||||
QMap<QString, IndicatorTray*> m_indicatorMap;
|
||||
|
||||
TipsWidget *m_tipsLabel;
|
||||
bool m_pluginLoaded;
|
||||
};
|
||||
|
||||
#endif // TRAYPLUGIN_H
|
||||
|
Loading…
x
Reference in New Issue
Block a user