From a1ffd1418f355ae927c9b7859cffcb6caa767306 Mon Sep 17 00:00:00 2001 From: Nate Graham Date: Thu, 3 Sep 2020 11:27:49 -0600 Subject: Make KWindowConfig::allConnectedScreens() static and internal It doesn't need to be public since it's just an internal convenience function. So let's make it static. BUG: 425953 --- src/gui/kwindowconfig.cpp | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) (limited to 'src/gui/kwindowconfig.cpp') diff --git a/src/gui/kwindowconfig.cpp b/src/gui/kwindowconfig.cpp index 5785bdbc..bb541b8e 100644 --- a/src/gui/kwindowconfig.cpp +++ b/src/gui/kwindowconfig.cpp @@ -14,6 +14,18 @@ static const char s_initialSizePropertyName[] = "_kconfig_initial_size"; static const char s_initialScreenSizePropertyName[] = "_kconfig_initial_screen_size"; +// Convenience function to get a space-separated list of all connected screens +static QString allConnectedScreens() +{ + QStringList names; + const auto screens = QGuiApplication::screens(); + names.reserve(screens.length()); + for (auto screen : screens) { + names << screen->name(); + } + return names.join(QLatin1Char(' ')); +} + void KWindowConfig::saveWindowSize(const QWindow *window, KConfigGroup &config, KConfigGroup::WriteConfigFlags options) { // QWindow::screen() shouldn't return null, but it sometimes does due to bugs. @@ -127,14 +139,3 @@ void KWindowConfig::restoreWindowPosition(QWindow *window, const KConfigGroup &c window->setX(xPos); window->setY(yPos); } - -QString KWindowConfig::allConnectedScreens() -{ - QStringList names; - const auto screens = QGuiApplication::screens(); - names.reserve(screens.length()); - for (auto screen : screens) { - names << screen->name(); - } - return names.join(QStringLiteral(" ")); -} -- cgit v1.2.1