mirror of
https://github.com/linuxdeepin/dde-dock.git
synced 2025-06-04 17:33:05 +00:00
fix crash when unmount all mounted devices
Change-Id: Ia4f59bf9c8e44516c6e16ee3a43baa99ca2be7af
This commit is contained in:
parent
05015516f5
commit
4bb26d98bb
Notes:
gerrit
2018-03-02 03:00:49 +00:00
Verified+1: Anonymous Coward #1000004 Verified+1: <yefei@linuxdeepin.com> Code-Review+2: 石博文 <sbw@sbw.so> Submitted-by: 石博文 <sbw@sbw.so> Submitted-at: Fri, 02 Mar 2018 03:00:44 +0000 Reviewed-on: https://cr.deepin.io/32118 Project: dde/dde-dock Branch: refs/heads/master
@ -199,11 +199,8 @@ void DockItem::showContextMenu()
|
||||
DBusMenu *menuInter = new DBusMenu(path.path(), this);
|
||||
|
||||
connect(menuInter, &DBusMenu::ItemInvoked, this, &DockItem::invokedMenuItem);
|
||||
connect(menuInter, &DBusMenu::MenuUnregistered, this, [=] {
|
||||
emit requestRefershWindowVisible();
|
||||
emit requestWindowAutoHide(true);
|
||||
menuInter->deleteLater();
|
||||
});
|
||||
connect(menuInter, &DBusMenu::ItemInvoked, menuInter, &DBusMenu::deleteLater);
|
||||
connect(menuInter, &DBusMenu::MenuUnregistered, this, &DockItem::onContextMenuAccepted, Qt::QueuedConnection);
|
||||
|
||||
menuInter->ShowMenu(QString(QJsonDocument(menuObject).toJson()));
|
||||
|
||||
@ -211,6 +208,12 @@ void DockItem::showContextMenu()
|
||||
emit requestWindowAutoHide(false);
|
||||
}
|
||||
|
||||
void DockItem::onContextMenuAccepted()
|
||||
{
|
||||
emit requestRefershWindowVisible();
|
||||
emit requestWindowAutoHide(true);
|
||||
}
|
||||
|
||||
void DockItem::showHoverTips()
|
||||
{
|
||||
// another model popup window is alread exists
|
||||
|
@ -89,6 +89,7 @@ protected:
|
||||
|
||||
protected slots:
|
||||
void showContextMenu();
|
||||
void onContextMenuAccepted();
|
||||
|
||||
private:
|
||||
void updatePopupPosition();
|
||||
|
Loading…
x
Reference in New Issue
Block a user