mirror of
https://github.com/linuxdeepin/dde-dock.git
synced 2025-06-04 17:33:05 +00:00
fix crash when toggle mode and network is connecting
Change-Id: If4ebe279143f5ce397be6e61c7bc3b804987229e
This commit is contained in:
parent
abda1fa6f7
commit
a518f3655c
Notes:
Deepin Code Review
2017-11-29 11:58:16 +08:00
Verified+1: Anonymous Coward #1000004 Code-Review+2: 石博文 <sbw@sbw.so> Submitted-by: 石博文 <sbw@sbw.so> Submitted-at: Wed, 29 Nov 2017 11:58:16 +0800 Reviewed-on: https://cr.deepin.io/28997 Project: dde/dde-dock Branch: refs/heads/master
@ -67,11 +67,6 @@ int ContainerWidget::itemCount() const
|
||||
return m_itemList.count();
|
||||
}
|
||||
|
||||
const QList<QWidget *> ContainerWidget::itemList() const
|
||||
{
|
||||
return m_itemList;
|
||||
}
|
||||
|
||||
bool ContainerWidget::allowDragEnter(QDragEnterEvent *e)
|
||||
{
|
||||
if (!e->mimeData()->hasFormat(DOCK_PLUGIN_MIME))
|
||||
|
@ -35,8 +35,8 @@ public:
|
||||
void addWidget(QWidget * const w);
|
||||
void removeWidget(QWidget * const w);
|
||||
int itemCount() const;
|
||||
const QList<QWidget *> itemList() const;
|
||||
|
||||
inline bool contains(QWidget *w) const { return m_itemList.contains(w); }
|
||||
bool allowDragEnter(QDragEnterEvent *e);
|
||||
|
||||
protected:
|
||||
|
@ -60,9 +60,11 @@ void ContainerItem::removeItem(DockItem * const item)
|
||||
|
||||
bool ContainerItem::contains(DockItem * const item)
|
||||
{
|
||||
if (m_containerWidget->itemList().contains(item))
|
||||
if (m_containerWidget->contains(item))
|
||||
{
|
||||
item->setParent(m_containerWidget);
|
||||
// reset parent to container.
|
||||
if (item->parent() != m_containerWidget)
|
||||
item->setParent(m_containerWidget);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user