Commit 1f95ea34 authored by Méven Car's avatar Méven Car
Browse files

Converts a couple foreach

Reviewers: #plasma, davidedmundson

Reviewed By: #plasma, davidedmundson

Subscribers: plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D24913
parent a59e39ef
......@@ -90,13 +90,15 @@ View::View(QWindow *)
}
};
auto screenAdded = [this](QScreen* screen) {
auto screenAdded = [this](const QScreen* screen) {
connect(screen, &QScreen::geometryChanged, this, &View::screenGeometryChanged);
screenGeometryChanged();
};
foreach(QScreen* s, QGuiApplication::screens())
const auto screens = QGuiApplication::screens();
for(QScreen* s : screens) {
screenAdded(s);
}
connect(qGuiApp, &QGuiApplication::screenAdded, this, screenAdded);
connect(qGuiApp, &QGuiApplication::screenRemoved, this, screenRemoved);
......@@ -219,7 +221,8 @@ void View::positionOnScreen()
{
QScreen *shownOnScreen = QGuiApplication::primaryScreen();
Q_FOREACH (QScreen* screen, QGuiApplication::screens()) {
const auto screens = QGuiApplication::screens();
for (QScreen* screen : screens) {
if (screen->geometry().contains(QCursor::pos(screen))) {
shownOnScreen = screen;
break;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment