chore: rm unused ServerConfig::autoAddScreen

This commit is contained in:
sithlord48
2025-10-27 18:43:18 -04:00
committed by Nick Bolton
parent a82e9a4a74
commit 3580b4ead9
3 changed files with 0 additions and 69 deletions

View File

@ -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<AddAction>(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();