on xenial help sign in
Fix the detach assigning to a const list
412458dAlbert Astals Cid
src/ShellApplication.cpp+4−3
@@ -183,12 +183,13 @@ void ShellApplication::onScreenAboutToBeRemoved(QScreen *screen)
183 // TODO: Support an arbitrary number of screens and different policies
183 // TODO: Support an arbitrary number of screens and different policies
184 // (eg cloned desktop, several desktops, etc)
184 // (eg cloned desktop, several desktops, etc)
185 if (screen == m_shellView->screen()) {
185 if (screen == m_shellView->screen()) {
186− Q_ASSERT(screens().count() > 1);
186+ const QList<QScreen *> allScreens = screens();
187+ Q_ASSERT(allScreens.count() > 1);
187− Q_ASSERT(screens().at(0) != screen);
188+ Q_ASSERT(allScreens.at(0) != screen);
188 Q_ASSERT(m_secondaryWindow);
189 Q_ASSERT(m_secondaryWindow);
189 delete m_secondaryWindow;
190 delete m_secondaryWindow;
190 m_secondaryWindow = nullptr;
191 m_secondaryWindow = nullptr;
191− m_shellView->setScreen(screens().at(0));
192+ m_shellView->setScreen(allScreens.first());
192 m_qmlArgs.setDeviceName(m_deviceName);
193 m_qmlArgs.setDeviceName(m_deviceName);
193 // Changing the QScreen where a QWindow is drawn makes it also lose focus (besides having
194 // Changing the QScreen where a QWindow is drawn makes it also lose focus (besides having
194 // its backing QPlatformWindow recreated). So lets refocus it.
195 // its backing QPlatformWindow recreated). So lets refocus it.