mirror of
https://github.com/linuxdeepin/dde-dock.git
synced 2025-06-04 17:33:05 +00:00
bugfix: there may be a NULL object add to layout and cause crash
Change-Id: Ife4df44296aecf4153b78d07f132c6c553b7c735
This commit is contained in:
parent
dc950f9a36
commit
b10111dffd
Notes:
Deepin Code Review
2016-06-14 07:19:47 +00:00
Verified+1: Anonymous Coward #1000004 Code-Review+2: Hualet Wang <mr.asianwang@gmail.com> Submitted-by: Hualet Wang <mr.asianwang@gmail.com> Submitted-at: Wed, 26 Aug 2015 15:36:57 +0800 Reviewed-on: https://cr.deepin.io/6593 Project: dde/dde-dock Branch: refs/heads/master
@ -9,6 +9,9 @@ DockLayout::DockLayout(QWidget *parent) :
|
||||
|
||||
void DockLayout::addItem(AbstractDockItem *item)
|
||||
{
|
||||
if (!item)
|
||||
return;
|
||||
|
||||
if (m_lastHoverIndex == -1)
|
||||
insertItem(item,m_appList.count());
|
||||
else
|
||||
@ -17,6 +20,9 @@ void DockLayout::addItem(AbstractDockItem *item)
|
||||
|
||||
void DockLayout::insertItem(AbstractDockItem *item, int index)
|
||||
{
|
||||
if (!item)
|
||||
return;
|
||||
|
||||
item->setParent(this);
|
||||
item->show();
|
||||
int appCount = m_appList.count();
|
||||
|
Loading…
x
Reference in New Issue
Block a user