@@ -115,7 +115,15 @@ void Scopes::onScopesLoaded()
115115
116116void Scopes::onScopeRemoved(const unity::dash::Scope::Ptr& scope)
117117{
118− //TODO
118+ auto index = m_scopes.count();
119+ auto id = QString::fromStdString(scope->id);
120+ beginRemoveRows(QModelIndex(), index, index);
121+ auto removed_idx = removeUnityScope(id);
122+ endRemoveRows();
123+
124+ if (removed_idx >= 0) {
125+ Q_EMIT scopeRemoved(id, removed_idx);
126+ }
119127}
120128
121129void Scopes::onScopesReordered(const unity::dash::Scopes::ScopeList& scopes)
@@ -144,3 +152,14 @@ void Scopes::removeUnityScope(int index)
144152
145153 delete scope;
146154}
155+
156+int Scopes::removeUnityScope(const QString& scope_id)
157+{
158+ for (int i=0; i<m_scopes.count(); i++) {
159+ if (m_scopes[i]->id() == scope_id) {
160+ removeUnityScope(i);
161+ return i;
162+ }
163+ }
164+ return -1;
165+}