Changeset View
Changeset View
Standalone View
Standalone View
shell/shellcorona.cpp
Show First 20 Lines • Show All 766 Lines • ▼ Show 20 Line(s) | |||||
767 | } | 767 | } | ||
768 | 768 | | |||
769 | #ifndef NDEBUG | 769 | #ifndef NDEBUG | ||
770 | void ShellCorona::screenInvariants() const | 770 | void ShellCorona::screenInvariants() const | ||
771 | { | 771 | { | ||
772 | Q_ASSERT(m_desktopViewforId.keys().count() <= QGuiApplication::screens().count()); | 772 | Q_ASSERT(m_desktopViewforId.keys().count() <= QGuiApplication::screens().count()); | ||
773 | 773 | | |||
774 | QSet<QScreen*> screens; | 774 | QSet<QScreen*> screens; | ||
775 | foreach (const int id, m_desktopViewforId.keys()) { | 775 | const auto keys = m_desktopViewforId.keys(); | ||
776 | for (const int id : keys) { | ||||
776 | const DesktopView *view = m_desktopViewforId.value(id); | 777 | const DesktopView *view = m_desktopViewforId.value(id); | ||
777 | QScreen *screen = view->screenToFollow(); | 778 | QScreen *screen = view->screenToFollow(); | ||
778 | Q_ASSERT(!screens.contains(screen)); | 779 | Q_ASSERT(!screens.contains(screen)); | ||
779 | Q_ASSERT(!m_redundantOutputs.contains(screen)); | 780 | Q_ASSERT(!m_redundantOutputs.contains(screen)); | ||
780 | // commented out because a different part of the code-base is responsible for this | 781 | // commented out because a different part of the code-base is responsible for this | ||
781 | // and sometimes is not yet called here. | 782 | // and sometimes is not yet called here. | ||
782 | // Q_ASSERT(!view->fillScreen() || view->geometry() == screen->geometry()); | 783 | // Q_ASSERT(!view->fillScreen() || view->geometry() == screen->geometry()); | ||
783 | Q_ASSERT(view->containment()); | 784 | Q_ASSERT(view->containment()); | ||
784 | 785 | | |||
785 | Q_ASSERT(view->containment()->screen() == id || view->containment()->screen() == -1); | 786 | Q_ASSERT(view->containment()->screen() == id || view->containment()->screen() == -1); | ||
786 | Q_ASSERT(view->containment()->lastScreen() == id || view->containment()->lastScreen() == -1); | 787 | Q_ASSERT(view->containment()->lastScreen() == id || view->containment()->lastScreen() == -1); | ||
787 | Q_ASSERT(view->isVisible()); | 788 | Q_ASSERT(view->isVisible()); | ||
788 | 789 | | |||
789 | foreach (const PanelView *panel, panelsForScreen(screen)) { | 790 | const auto panels = panelsForScreen(screen); | ||
791 | for (const PanelView *panel : panels) { | ||||
790 | Q_ASSERT(panel->containment()); | 792 | Q_ASSERT(panel->containment()); | ||
791 | Q_ASSERT(panel->containment()->screen() == id || panel->containment()->screen() == -1); | 793 | Q_ASSERT(panel->containment()->screen() == id || panel->containment()->screen() == -1); | ||
792 | //If any kscreen related activities occurred | 794 | //If any kscreen related activities occurred | ||
793 | //during startup, the panel wouldn't be visible yet, and this would assert | 795 | //during startup, the panel wouldn't be visible yet, and this would assert | ||
794 | if (panel->containment()->isUiReady()) { | 796 | if (panel->containment()->isUiReady()) { | ||
795 | Q_ASSERT(panel->isVisible()); | 797 | Q_ASSERT(panel->isVisible()); | ||
796 | } | 798 | } | ||
797 | } | 799 | } | ||
798 | 800 | | |||
799 | screens.insert(screen); | 801 | screens.insert(screen); | ||
800 | } | 802 | } | ||
801 | 803 | | |||
802 | foreach (QScreen* out, m_redundantOutputs) { | 804 | for (QScreen* out : qAsConst(m_redundantOutputs)) { | ||
803 | Q_ASSERT(isOutputRedundant(out)); | 805 | Q_ASSERT(isOutputRedundant(out)); | ||
804 | } | 806 | } | ||
805 | 807 | | |||
806 | if (m_desktopViewforId.isEmpty()) { | 808 | if (m_desktopViewforId.isEmpty()) { | ||
807 | qWarning() << "no screens!!"; | 809 | qWarning() << "no screens!!"; | ||
808 | } | 810 | } | ||
809 | } | 811 | } | ||
810 | #endif | 812 | #endif | ||
▲ Show 20 Lines • Show All 1337 Lines • Show Last 20 Lines |