hide preview if its empty

Change-Id: I04af518c834d26603de05a7ae7021fedc0c56675
This commit is contained in:
石博文 2017-05-03 16:53:23 +08:00
parent e69ffc5ae5
commit 023ed668e9
Notes: Deepin Code Review 2017-05-03 16:57:30 +08:00
Verified+1: Anonymous Coward #1000004
Code-Review+2: 石博文 <sbw@sbw.so>
Submitted-by: 石博文 <sbw@sbw.so>
Submitted-at: Wed, 03 May 2017 16:57:28 +0800
Reviewed-on: https://cr.deepin.io/22790
Project: dde/dde-dock
Branch: refs/heads/master

View File

@ -25,6 +25,14 @@ void PreviewContainer::setWindowInfos(const WindowDict &infos)
delete item;
}
if (infos.isEmpty())
{
emit requestCancelPreview();
emit requestHidePreview();
return;
}
for (auto it(infos.cbegin()); it != infos.cend(); ++it)
{
PreviewWidget *w = new PreviewWidget(it.key());