Changeset View
Changeset View
Standalone View
Standalone View
virtualdesktops.cpp
Show First 20 Lines • Show All 72 Lines • ▼ Show 20 Line(s) | 72 | connect(pvd, &PlasmaVirtualDesktopInterface::activateRequested, this, | |||
---|---|---|---|---|---|
73 | [this, desktop] { | 73 | [this, desktop] { | ||
74 | setCurrent(desktop); | 74 | setCurrent(desktop); | ||
75 | } | 75 | } | ||
76 | ); | 76 | ); | ||
77 | }; | 77 | }; | ||
78 | 78 | | |||
79 | connect(this, &VirtualDesktopManager::desktopCreated, m_virtualDesktopManagement, createPlasmaVirtualDesktop); | 79 | connect(this, &VirtualDesktopManager::desktopCreated, m_virtualDesktopManagement, createPlasmaVirtualDesktop); | ||
80 | 80 | | |||
81 | connect(this, &VirtualDesktopManager::rowsChanged, m_virtualDesktopManagement, | ||||
zzag: I think it would be better to use m_virtualDesktopManagement as the context object. | |||||
zzag: Also, I think we don't need this lambda at all. | |||||
82 | &PlasmaVirtualDesktopManagementInterface::setRows); | ||||
81 | //handle removed: from VirtualDesktopManager to the wayland interface | 83 | //handle removed: from VirtualDesktopManager to the wayland interface | ||
82 | connect(this, &VirtualDesktopManager::desktopRemoved, m_virtualDesktopManagement, | 84 | connect(this, &VirtualDesktopManager::desktopRemoved, m_virtualDesktopManagement, | ||
83 | [this](VirtualDesktop *desktop) { | 85 | [this](VirtualDesktop *desktop) { | ||
84 | m_virtualDesktopManagement->removeDesktop(desktop->id()); | 86 | m_virtualDesktopManagement->removeDesktop(desktop->id()); | ||
85 | } | 87 | } | ||
86 | ); | 88 | ); | ||
87 | 89 | | |||
88 | //create a new desktop when the client asks to | 90 | //create a new desktop when the client asks to | ||
▲ Show 20 Lines • Show All 581 Lines • ▼ Show 20 Line(s) | 668 | if (m_rootInfo) { | |||
670 | orientation = m_rootInfo->desktopLayoutOrientation() == NET::OrientationHorizontal ? Qt::Horizontal : Qt::Vertical; | 672 | orientation = m_rootInfo->desktopLayoutOrientation() == NET::OrientationHorizontal ? Qt::Horizontal : Qt::Vertical; | ||
671 | } | 673 | } | ||
672 | 674 | | |||
673 | if (columns == 0) { | 675 | if (columns == 0) { | ||
674 | // Not given, set default layout | 676 | // Not given, set default layout | ||
675 | m_rows = count() == 1u ? 1 : 2; | 677 | m_rows = count() == 1u ? 1 : 2; | ||
676 | columns = count() / m_rows; | 678 | columns = count() / m_rows; | ||
677 | } | 679 | } | ||
678 | setNETDesktopLayout(orientation, | 680 | setNETDesktopLayout(orientation, | ||
zzag: Unrelated whitespace change. | |||||
679 | columns, m_rows, 0 //rootInfo->desktopLayoutCorner() // Not really worth implementing right now. | 681 | columns, m_rows, 0 //rootInfo->desktopLayoutCorner() // Not really worth implementing right now. | ||
680 | ); | 682 | ); | ||
681 | } | 683 | } | ||
682 | 684 | | |||
683 | void VirtualDesktopManager::load() | 685 | void VirtualDesktopManager::load() | ||
684 | { | 686 | { | ||
685 | s_loadingDesktopSettings = true; | 687 | s_loadingDesktopSettings = true; | ||
686 | if (!m_config) { | 688 | if (!m_config) { | ||
▲ Show 20 Lines • Show All 241 Lines • Show Last 20 Lines |
I think it would be better to use m_virtualDesktopManagement as the context object.