@@ -17,6 +17,7 @@
17#include "WorkspaceModel.h"
17#include "WorkspaceModel.h"
18#include "WorkspaceManager.h"
18#include "WorkspaceManager.h"
19#include "Workspace.h"
19#include "Workspace.h"
21#include <QQmlEngine>
22#include <QQmlEngine>
@@ -119,11 +120,6 @@ QVariant WorkspaceModel::data(const QModelIndex &index, int role) const
122−void WorkspaceModel::setSyncing(bool syncing)
124− m_syncing = syncing;
127void WorkspaceModel::sync(WorkspaceModel *proxy)
123void WorkspaceModel::sync(WorkspaceModel *proxy)
129 if (!proxy) return;
125 if (!proxy) return;
@@ -206,8 +202,9 @@ void WorkspaceModel::insertUnassigned(Workspace *workspace)
209−ProxyWorkspaceModel::ProxyWorkspaceModel(WorkspaceModel * const model)
205+ProxyWorkspaceModel::ProxyWorkspaceModel(WorkspaceModel * const model, ProxyScreen* screen)
210 : m_original(model)
206 : m_original(model)
212 Q_FOREACH(auto workspace, model->list()) {
209 Q_FOREACH(auto workspace, model->list()) {
213 auto proxy = new ProxyWorkspace(workspace);
210 auto proxy = new ProxyWorkspace(workspace);
@@ -215,12 +212,12 @@ ProxyWorkspaceModel::ProxyWorkspaceModel(WorkspaceModel * const model)
215 proxy->assign(this);
212 proxy->assign(this);
217 connect(m_original, &WorkspaceModel::workspaceInserted, this, [this](int index, Workspace* inserted) {
214 connect(m_original, &WorkspaceModel::workspaceInserted, this, [this](int index, Workspace* inserted) {
218− if (m_original->isSyncing()) return;
215+ if (isSyncing()) return;
220 (new ProxyWorkspace(inserted))->assign(this, index);
217 (new ProxyWorkspace(inserted))->assign(this, index);
222 connect(m_original, &WorkspaceModel::workspaceRemoved, this, [this](Workspace* removed) {
219 connect(m_original, &WorkspaceModel::workspaceRemoved, this, [this](Workspace* removed) {
223− if (m_original->isSyncing()) return;
220+ if (isSyncing()) return;
225 for (int i = 0; i < rowCount(); i++) {
222 for (int i = 0; i < rowCount(); i++) {
226 auto workspaceProxy = qobject_cast<ProxyWorkspace*>(get(i));
223 auto workspaceProxy = qobject_cast<ProxyWorkspace*>(get(i));
@@ -232,7 +229,7 @@ ProxyWorkspaceModel::ProxyWorkspaceModel(WorkspaceModel * const model)
234 connect(m_original, &WorkspaceModel::workspaceMoved, this, [this](int from, int to) {
231 connect(m_original, &WorkspaceModel::workspaceMoved, this, [this](int from, int to) {
235− if (m_original->isSyncing()) return;
232+ if (isSyncing()) return;
237 move(from, to);
234 move(from, to);
@@ -243,6 +240,11 @@ void ProxyWorkspaceModel::move(int from, int to)
243 WorkspaceModel::move(from, to);
240 WorkspaceModel::move(from, to);
243+bool ProxyWorkspaceModel::isSyncing() const
245+ return m_screen->isSyncing();
246void ProxyWorkspaceModel::addWorkspace()
248void ProxyWorkspaceModel::addWorkspace()
248 auto newWorkspace = WorkspaceManager::instance()->createWorkspace();
250 auto newWorkspace = WorkspaceManager::instance()->createWorkspace();