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 ++++++++++++----------- src/gui/kwindowconfig.h | 7 ------- 2 files changed, 12 insertions(+), 18 deletions(-) (limited to 'src') 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(" ")); -} diff --git a/src/gui/kwindowconfig.h b/src/gui/kwindowconfig.h index 3fda43c1..4bb56e12 100644 --- a/src/gui/kwindowconfig.h +++ b/src/gui/kwindowconfig.h @@ -82,12 +82,5 @@ KCONFIGGUI_EXPORT void saveWindowPosition(const QWindow *window, KConfigGroup &c * @since 5.74 */ KCONFIGGUI_EXPORT void restoreWindowPosition(QWindow *window, const KConfigGroup &config); - -/** - * Convenience function to get a space-separated list of all connected screens. - * - * @since 5.74 - */ -QString allConnectedScreens(); } #endif // KWINDOWCONFIG_H -- cgit v1.2.1