Changeset View
Changeset View
Standalone View
Standalone View
shell/shellcorona.cpp
Show First 20 Lines • Show All 1219 Lines • ▼ Show 20 Line(s) | 1176 | { | |||
---|---|---|---|---|---|
1220 | //in the list. We still don't want to have an invisible view added. | 1220 | //in the list. We still don't want to have an invisible view added. | ||
1221 | containment->reactToScreenChange(); | 1221 | containment->reactToScreenChange(); | ||
1222 | 1222 | | |||
1223 | //were there any panels for this screen before it popped up? | 1223 | //were there any panels for this screen before it popped up? | ||
1224 | if (!m_waitingPanels.isEmpty()) { | 1224 | if (!m_waitingPanels.isEmpty()) { | ||
1225 | m_waitingPanelsTimer.start(); | 1225 | m_waitingPanelsTimer.start(); | ||
1226 | } | 1226 | } | ||
1227 | 1227 | | |||
1228 | QStringList existingActivities = m_activityController->activities(); | ||||
broulik: `const` | |||||
1229 | for (const auto &id : existingActivities) { | ||||
1230 | view->activitiesModel()->addActivity(id, containmentGraphicsItemPreview(id, containment->screen())); | ||||
1231 | } | ||||
1232 | | ||||
1228 | emit availableScreenRectChanged(); | 1233 | emit availableScreenRectChanged(); | ||
1229 | emit screenAdded(m_screenPool->id(screen->name())); | 1234 | emit screenAdded(m_screenPool->id(screen->name())); | ||
1230 | 1235 | | |||
1231 | CHECK_SCREEN_INVARIANTS | 1236 | CHECK_SCREEN_INVARIANTS | ||
1232 | } | 1237 | } | ||
1233 | 1238 | | |||
1234 | Plasma::Containment *ShellCorona::containmentGraphicsItemPreview(const QString& activity, int screenNum) | 1239 | Plasma::Containment *ShellCorona::containmentGraphicsItemPreview(const QString& activity, int screenNum) | ||
This is generically finding a containment. The method name and comment shouldn't have anything to do with what 1 usage of it is doing. davidedmundson: This is generically finding a containment.
The method name and comment shouldn't have… | |||||
1235 | { | 1240 | { | ||
1236 | if (m_desktopContainments.contains(activity)) { | 1241 | if (m_desktopContainments.contains(activity)) { | ||
1237 | for (Plasma::Containment *cont : m_desktopContainments.value(activity)) { | 1242 | for (Plasma::Containment *cont : m_desktopContainments.value(activity)) { | ||
1238 | if (!cont->destroyed() && cont->lastScreen() == screenNum && cont->activity() == activity) { | 1243 | if (!cont->destroyed() && cont->lastScreen() == screenNum && cont->activity() == activity) { | ||
1239 | return cont; | 1244 | return cont; | ||
1240 | } | 1245 | } | ||
1241 | } | 1246 | } | ||
1242 | } | 1247 | } | ||
▲ Show 20 Lines • Show All 315 Lines • ▼ Show 20 Line(s) | |||||
1558 | { | 1563 | { | ||
1559 | //TODO more sanity checks | 1564 | //TODO more sanity checks | ||
1560 | if (m_activityContainmentPlugins.contains(id)) { | 1565 | if (m_activityContainmentPlugins.contains(id)) { | ||
1561 | qWarning() << "Activity added twice" << id; | 1566 | qWarning() << "Activity added twice" << id; | ||
1562 | return; | 1567 | return; | ||
1563 | } | 1568 | } | ||
1564 | 1569 | | |||
1565 | m_activityContainmentPlugins.insert(id, defaultContainmentPlugin()); | 1570 | m_activityContainmentPlugins.insert(id, defaultContainmentPlugin()); | ||
1571 | for (const auto desktopView : m_desktopViewforId) { | ||||
broulik: `qAsConst`? | |||||
1572 | desktopView->activitiesModel()->addActivity(id, containmentGraphicsItemPreview(id, desktopView->containment()->screen())); | ||||
1573 | } | ||||
1566 | } | 1574 | } | ||
1567 | 1575 | | |||
1568 | void ShellCorona::activityRemoved(const QString &id) | 1576 | void ShellCorona::activityRemoved(const QString &id) | ||
1569 | { | 1577 | { | ||
1570 | m_activityContainmentPlugins.remove(id); | 1578 | m_activityContainmentPlugins.remove(id); | ||
1571 | if (m_desktopContainments.contains(id)) { | 1579 | if (m_desktopContainments.contains(id)) { | ||
1572 | for (auto cont : m_desktopContainments.value(id)) { | 1580 | for (auto cont : m_desktopContainments.value(id)) { | ||
1573 | cont->destroy(); | 1581 | cont->destroy(); | ||
▲ Show 20 Lines • Show All 582 Lines • Show Last 20 Lines |
const