refactor: AddResults => enum class ScreenAddResults

This commit is contained in:
sithlord48
2025-07-30 19:36:28 -04:00
committed by Nick Bolton
parent ffa5b88cdf
commit 7c06ae39ef
3 changed files with 12 additions and 11 deletions

View File

@ -1037,7 +1037,7 @@ void MainWindow::autoAddScreen(const QString &name)
if (name.isEmpty())
return;
if (m_serverConfig.autoAddScreen(name) == AutoAddScreenManualClient) {
if (m_serverConfig.autoAddScreen(name) == ScreenAddResults::AutoAddScreenManualClient) {
showConfigureServer(
tr("Please add the client (%1) to the grid.").arg(Settings::value(Settings::Core::ScreenName).toString())
);

View File

@ -321,9 +321,10 @@ int ServerConfig::numScreens() const
return rval;
}
int ServerConfig::autoAddScreen(const QString name)
ScreenAddResults ServerConfig::autoAddScreen(const QString name)
{
using enum AddAction;
using enum ScreenAddResults;
int serverIndex = -1;
int targetIndex = -1;

View File

@ -37,6 +37,14 @@ const auto kDefaultProtocol = ServerProtocol::kBarrier;
} // namespace deskflow::gui
enum class ScreenAddResults
{
AutoAddScreenOk,
AutoAddScreenManualServer,
AutoAddScreenManualClient,
AutoAddScreenIgnore
};
class ServerConfig : public ScreenConfig, public deskflow::gui::IServerConfig
{
using ServerProtocol = deskflow::gui::ServerProtocol;
@ -148,7 +156,7 @@ public:
//
void commit();
int numScreens() const;
int autoAddScreen(const QString name);
ScreenAddResults autoAddScreen(const QString name);
const QString getServerName() const;
void updateServerName();
const QString configFile() const;
@ -275,11 +283,3 @@ private:
};
QTextStream &operator<<(QTextStream &outStream, const ServerConfig &config);
enum AddResults
{
AutoAddScreenOk,
AutoAddScreenManualServer,
AutoAddScreenManualClient,
AutoAddScreenIgnore
};