fix trash item count calculate error

trash item count different with dde-file-manager

Change-Id: I707b3b718157f23d262d9db6b95d0c125b320e8a
This commit is contained in:
石博文 2016-08-22 20:30:19 +08:00
parent 7cfe23ff92
commit 9f19967068
Notes: Deepin Code Review 2016-08-22 12:36:53 +00:00
Verified+1: Anonymous Coward #1000004
Code-Review+2: 石博文 <sbw@sbw.so>
Submitted-by: 石博文 <sbw@sbw.so>
Submitted-at: Mon, 22 Aug 2016 12:36:53 +0000
Reviewed-on: https://cr.deepin.io/15445
Project: dde/dde-dock
Branch: refs/heads/master
3 changed files with 20 additions and 5 deletions

View File

@ -58,7 +58,14 @@ void DockPluginsController::itemRemoved(PluginsItemInterface * const itemInter,
void DockPluginsController::requestRefershWindowVisible()
{
emit m_pluginList.first().first()->requestRefershWindowVisible();
for (auto list : m_pluginList.values())
{
for (auto item : list.values())
{
emit item->requestRefershWindowVisible();
return;
}
}
}
//void DockPluginsController::requestPopupApplet(PluginsItemInterface * const itemInter, const QString &itemKey)

View File

@ -139,7 +139,7 @@ void NetworkManager::reloadDevices()
m_types = types;
emit deviceTypesChanged(m_types);
qDebug() << "device type: " << m_types;
// qDebug() << "device type: " << m_types;
}
void NetworkManager::reloadActiveConnections()
@ -182,5 +182,5 @@ void NetworkManager::reloadActiveConnections()
m_states = states;
emit networkStateChanged(m_states);
qDebug() << "network states: " << m_states;
// qDebug() << "network states: " << m_states;
}

View File

@ -101,12 +101,20 @@ void PopupControlWidget::clearTrashFloder()
int PopupControlWidget::trashItemCount() const
{
return QDir(TrashDir + "/files").entryInfoList().count() - 2;
return QDir(TrashDir + "/info").entryInfoList().count() - 2;
}
void PopupControlWidget::trashStatusChanged()
{
const bool empty = QDir(TrashDir).entryList().count() == 2;
const bool files = QDir(TrashDir + "/files").exists();
const bool info = QDir(TrashDir + "/info").exists();
bool empty;
if ((!info || QDir(TrashDir + "/info").entryList().count() == 2) &&
(!files || QDir(TrashDir + "/files").entryList().count() == 2))
empty = true;
else
empty = false;
if (m_empty == empty)
return;