Changeset View
Changeset View
Standalone View
Standalone View
virtualdesktops.cpp
Show First 20 Lines • Show All 61 Lines • ▼ Show 20 Line(s) | 57 | { | |||
---|---|---|---|---|---|
62 | auto createPlasmaVirtualDesktop = [this](VirtualDesktop *desktop) { | 62 | auto createPlasmaVirtualDesktop = [this](VirtualDesktop *desktop) { | ||
63 | PlasmaVirtualDesktopInterface *pvd = m_virtualDesktopManagement->createDesktop(desktop->id(), desktop->x11DesktopNumber() - 1); | 63 | PlasmaVirtualDesktopInterface *pvd = m_virtualDesktopManagement->createDesktop(desktop->id(), desktop->x11DesktopNumber() - 1); | ||
64 | pvd->setName(desktop->name()); | 64 | pvd->setName(desktop->name()); | ||
65 | pvd->sendDone(); | 65 | pvd->sendDone(); | ||
66 | 66 | | |||
67 | connect(desktop, &VirtualDesktop::nameChanged, pvd, | 67 | connect(desktop, &VirtualDesktop::nameChanged, pvd, | ||
68 | [desktop, pvd] { | 68 | [desktop, pvd] { | ||
69 | pvd->setName(desktop->name()); | 69 | pvd->setName(desktop->name()); | ||
70 | pvd->sendDone(); | ||||
70 | } | 71 | } | ||
71 | ); | 72 | ); | ||
72 | connect(pvd, &PlasmaVirtualDesktopInterface::activateRequested, this, | 73 | connect(pvd, &PlasmaVirtualDesktopInterface::activateRequested, this, | ||
73 | [this, desktop] { | 74 | [this, desktop] { | ||
74 | setCurrent(desktop); | 75 | setCurrent(desktop); | ||
75 | } | 76 | } | ||
76 | ); | 77 | ); | ||
77 | }; | 78 | }; | ||
Show All 25 Lines | |||||
103 | 104 | | |||
104 | std::for_each(m_desktops.constBegin(), m_desktops.constEnd(), createPlasmaVirtualDesktop); | 105 | std::for_each(m_desktops.constBegin(), m_desktops.constEnd(), createPlasmaVirtualDesktop); | ||
105 | 106 | | |||
106 | //Now we are sure all ids are there | 107 | //Now we are sure all ids are there | ||
107 | save(); | 108 | save(); | ||
108 | 109 | | |||
109 | connect(this, &VirtualDesktopManager::currentChanged, m_virtualDesktopManagement, | 110 | connect(this, &VirtualDesktopManager::currentChanged, m_virtualDesktopManagement, | ||
110 | [this]() { | 111 | [this]() { | ||
111 | for (auto *deskInt : m_virtualDesktopManagement->desktops()) { | 112 | for (auto *deskInt : m_virtualDesktopManagement->desktops()) { | ||
112 | if (deskInt->id() == currentDesktop()->id()) { | 113 | if (deskInt->id() == currentDesktop()->id()) { | ||
113 | deskInt->setActive(true); | 114 | deskInt->setActive(true); | ||
114 | } else { | 115 | } else { | ||
115 | deskInt->setActive(false); | 116 | deskInt->setActive(false); | ||
116 | } | 117 | } | ||
117 | } | 118 | } | ||
zzag: Do we have to send the done event here as well? | |||||
Depends on whether you consider "activated" to be a property, which is quite a loosely defined concept. You could argue a case for either. davidedmundson: Depends on whether you consider "activated" to be a property, which is quite a loosely defined… | |||||
118 | } | 119 | } | ||
119 | ); | 120 | ); | ||
120 | } | 121 | } | ||
121 | 122 | | |||
122 | void VirtualDesktop::setId(const QByteArray &id) | 123 | void VirtualDesktop::setId(const QByteArray &id) | ||
123 | { | 124 | { | ||
124 | Q_ASSERT(m_id.isEmpty()); | 125 | Q_ASSERT(m_id.isEmpty()); | ||
125 | m_id = id; | 126 | m_id = id; | ||
▲ Show 20 Lines • Show All 802 Lines • Show Last 20 Lines |
Do we have to send the done event here as well?