From 3580b4ead9edbed328112c6c19ed61b0fbe98e89 Mon Sep 17 00:00:00 2001 From: sithlord48 Date: Mon, 27 Oct 2025 18:43:18 -0400 Subject: [PATCH] chore: rm unused ServerConfig::autoAddScreen --- src/lib/gui/config/ServerConfig.cpp | 64 ----------------------------- src/lib/gui/config/ServerConfig.h | 1 - translations/deskflow_es.ts | 4 -- 3 files changed, 69 deletions(-) diff --git a/src/lib/gui/config/ServerConfig.cpp b/src/lib/gui/config/ServerConfig.cpp index 3fa4a43f8..5aeb5b842 100644 --- a/src/lib/gui/config/ServerConfig.cpp +++ b/src/lib/gui/config/ServerConfig.cpp @@ -322,70 +322,6 @@ int ServerConfig::numScreens() const return rval; } -ScreenAddResults ServerConfig::autoAddScreen(const QString name) -{ - using enum AddAction; - using enum ScreenAddResults; - - int serverIndex = -1; - int targetIndex = -1; - const auto screenName = Settings::value(Settings::Core::ScreenName).toString(); - if (!findScreenName(screenName, serverIndex) && !fixNoServer(screenName, serverIndex)) { - return AutoAddScreenManualServer; - } - - if (findScreenName(name, targetIndex)) { - qDebug("ignoring screen already in config: %s", qPrintable(name)); - return AutoAddScreenIgnore; - } - - auto result = static_cast(showAddClientDialog(name)); - - if (result == AddClientIgnore) { - return AutoAddScreenIgnore; - } - - if (result == AddClientOther) { - addToFirstEmptyGrid(name); - return AutoAddScreenManualClient; - } - - bool success = false; - int startIndex = serverIndex; - int offset = 1; - int dirIndex = 0; - - if (result == AddClientLeft) { - offset = -1; - dirIndex = 1; - } else if (result == AddClientUp) { - offset = -5; - dirIndex = 2; - } else if (result == AddClientDown) { - offset = 5; - dirIndex = 3; - } - - int idx = adjacentScreenIndex(startIndex, neighbourDirs[dirIndex].x, neighbourDirs[dirIndex].y); - while (idx != -1) { - if (screens()[idx].isNull()) { - m_Screens[idx].setName(name); - success = true; - break; - } - - startIndex += offset; - idx = adjacentScreenIndex(startIndex, neighbourDirs[dirIndex].x, neighbourDirs[dirIndex].y); - } - - if (!success) { - addToFirstEmptyGrid(name); - return AutoAddScreenManualClient; - } - - return AutoAddScreenOk; -} - QString ServerConfig::getServerName() const { return Settings::value(Settings::Core::ScreenName).toString(); diff --git a/src/lib/gui/config/ServerConfig.h b/src/lib/gui/config/ServerConfig.h index e631705fc..9f7549c2d 100644 --- a/src/lib/gui/config/ServerConfig.h +++ b/src/lib/gui/config/ServerConfig.h @@ -149,7 +149,6 @@ public: // void commit(); int numScreens() const; - ScreenAddResults autoAddScreen(const QString name); QString getServerName() const; void updateServerName(); QString configFile() const; diff --git a/translations/deskflow_es.ts b/translations/deskflow_es.ts index b0c1cbf0a..e6b605a4d 100644 --- a/translations/deskflow_es.ts +++ b/translations/deskflow_es.ts @@ -486,10 +486,6 @@ Do you want to connect to the server? %1 is disconnected %1 está desconectado - - Please add the client (%1) to the grid. - Por favor agregue el cliente (%1) a la cuadrícula. - Invalid Screen Name Nombre de pantalla no válido