dbustray: Do not change m_menu in QDBusTrayIcon::createMenu()

This method can be called for a submenu after it's called for the top-level
menu, and we should not replace it with a submenu.

Change-Id: I8e180ee074287cfcdc76dfe77c6c7aa7d5891741
Reviewed-by: Błażej Szczygieł <spaz16@wp.pl>
Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
This commit is contained in:
Dmitry Shachnev 2016-02-06 19:12:52 +03:00
parent 12b19ca56c
commit 7ad930987d

View File

@ -184,11 +184,7 @@ void QDBusTrayIcon::updateToolTip(const QString &tooltip)
QPlatformMenu *QDBusTrayIcon::createMenu() const
{
qCDebug(qLcTray);
QDBusPlatformMenu *ret = new QDBusPlatformMenu();
if (!m_menu)
const_cast<QDBusTrayIcon *>(this)->m_menu = ret;
return ret;
return new QDBusPlatformMenu();
}
void QDBusTrayIcon::updateMenu(QPlatformMenu * menu)