Fix crash when load multi systray

This commit is contained in:
杨万青 2015-07-06 10:56:10 +08:00
parent 58902d6274
commit 13a2fb8ec5

View File

@ -81,6 +81,8 @@ void DockLayout::sortRightToLeft()
bool DockLayout::hasSpacingItemInList()
{
if (sortDirection == RightToLeft)
return false;
if (appList.count() <= 1)
return false;
if (appList.at(0)->x() > itemSpacing)
@ -165,7 +167,7 @@ int DockLayout::getContentsWidth()
tmpWidth += appList.at(i)->width();
}
if (hasSpacingItemInList())
if (hasSpacingItemInList() && tmpAppMap.firstKey())
tmpWidth += tmpAppMap.firstKey()->width() + itemSpacing;
return tmpWidth;