diff --git a/tabbox/clientmodel.cpp b/tabbox/clientmodel.cpp index eae1cfa817..b3f8954212 100644 --- a/tabbox/clientmodel.cpp +++ b/tabbox/clientmodel.cpp @@ -57,10 +57,7 @@ QVariant ClientModel::data(const QModelIndex& index, int role) const return QVariant(); if (m_clientList.isEmpty()) { - if (role == EmptyRole) - return true; - else - return i18n("*** No Windows ***"); + return QVariant(); } int clientIndex = index.row() * columnCount() + index.column(); @@ -75,8 +72,6 @@ QVariant ClientModel::data(const QModelIndex& index, int role) const case DesktopNameRole: { return tabBox->desktopName(m_clientList[ clientIndex ]); } - case EmptyRole: - return false; case WIdRole: return qulonglong(m_clientList[ clientIndex ]->window()); case MinimizedRole: @@ -235,7 +230,7 @@ void ClientModel::createClientList(int desktop, bool partialReset) m_clientList.removeAll(c); m_clientList.prepend(c); } - if (tabBox->config().showDesktopMode() == TabBoxConfig::ShowDesktopClient) { + if (tabBox->config().showDesktopMode() == TabBoxConfig::ShowDesktopClient || m_clientList.isEmpty()) { TabBoxClient* desktopClient = tabBox->desktopClient(); if (desktopClient) m_clientList.append(desktopClient); diff --git a/tabbox/clientmodel.h b/tabbox/clientmodel.h index 450d66515c..6d646ab4d2 100644 --- a/tabbox/clientmodel.h +++ b/tabbox/clientmodel.h @@ -53,7 +53,6 @@ public: CaptionRole = Qt::UserRole + 1, ///< The caption of TabBoxClient DesktopNameRole = Qt::UserRole + 2, ///< The name of the desktop the TabBoxClient is on IconRole = Qt::UserRole + 3, // TODO: to be removed - EmptyRole = Qt::UserRole + 4, ///< Indicates if the model contains TabBoxClients WIdRole = Qt::UserRole + 5, ///< The window ID of TabBoxClient MinimizedRole = Qt::UserRole + 6, ///< TabBoxClient is minimized CloseableRole = Qt::UserRole + 7 ///< TabBoxClient can be closed diff --git a/tabbox/declarative.cpp b/tabbox/declarative.cpp index 274b85de91..c8abf6036c 100644 --- a/tabbox/declarative.cpp +++ b/tabbox/declarative.cpp @@ -69,9 +69,6 @@ QPixmap ImageProvider::requestPixmap(const QString &id, QSize *size, const QSize if (!index.isValid()) { return QDeclarativeImageProvider::requestPixmap(id, size, requestedSize); } - if (index.model()->data(index, ClientModel::EmptyRole).toBool()) { - return QDeclarativeImageProvider::requestPixmap(id, size, requestedSize); - } TabBoxClient* client = static_cast< TabBoxClient* >(index.model()->data(index, ClientModel::ClientRole).value()); if (!client) { return QDeclarativeImageProvider::requestPixmap(id, size, requestedSize); diff --git a/tabbox/tabboxhandler.cpp b/tabbox/tabboxhandler.cpp index ff4406c1a5..2950e51464 100644 --- a/tabbox/tabboxhandler.cpp +++ b/tabbox/tabboxhandler.cpp @@ -119,7 +119,7 @@ void TabBoxHandlerPrivate::updateOutline() if (config.tabBoxMode() != TabBoxConfig::ClientTabBox) return; // if ( c == NULL || !m_isShown || !c->isShown( true ) || !c->isOnCurrentDesktop()) - if (!isShown || clientModel()->data(index, ClientModel::EmptyRole).toBool()) { + if (!isShown) { q->hideOutline(); return; } @@ -410,8 +410,7 @@ TabBoxClientList TabBoxHandler::clientList() const TabBoxClient* TabBoxHandler::client(const QModelIndex& index) const { if ((!index.isValid()) || - (d->config.tabBoxMode() != TabBoxConfig::ClientTabBox) || - (d->clientModel()->data(index, ClientModel::EmptyRole).toBool())) + (d->config.tabBoxMode() != TabBoxConfig::ClientTabBox)) return NULL; TabBoxClient* c = static_cast< TabBoxClient* >( d->clientModel()->data(index, ClientModel::ClientRole).value());