refactor: anonymous enum in ServerConfig => ServerConfig::AddResults enum class
This commit is contained in:
parent
79b445373b
commit
9413393057
3 changed files with 12 additions and 12 deletions
|
|
@ -1026,7 +1026,7 @@ void MainWindow::autoAddScreen(const QString &name)
|
||||||
if (name.isEmpty())
|
if (name.isEmpty())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (m_serverConfig.autoAddScreen(name) == kAutoAddScreenManualClient) {
|
if (m_serverConfig.autoAddScreen(name) == AutoAddScreenManualClient) {
|
||||||
showConfigureServer(
|
showConfigureServer(
|
||||||
tr("Please add the client (%1) to the grid.").arg(Settings::value(Settings::Core::ScreenName).toString())
|
tr("Please add the client (%1) to the grid.").arg(Settings::value(Settings::Core::ScreenName).toString())
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -330,23 +330,23 @@ int ServerConfig::autoAddScreen(const QString name)
|
||||||
int targetIndex = -1;
|
int targetIndex = -1;
|
||||||
const auto screenName = Settings::value(Settings::Core::ScreenName).toString();
|
const auto screenName = Settings::value(Settings::Core::ScreenName).toString();
|
||||||
if (!findScreenName(screenName, serverIndex) && !fixNoServer(screenName, serverIndex)) {
|
if (!findScreenName(screenName, serverIndex) && !fixNoServer(screenName, serverIndex)) {
|
||||||
return kAutoAddScreenManualServer;
|
return AutoAddScreenManualServer;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (findScreenName(name, targetIndex)) {
|
if (findScreenName(name, targetIndex)) {
|
||||||
qDebug("ignoring screen already in config: %s", qPrintable(name));
|
qDebug("ignoring screen already in config: %s", qPrintable(name));
|
||||||
return kAutoAddScreenIgnore;
|
return AutoAddScreenIgnore;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto result = static_cast<AddAction>(showAddClientDialog(name));
|
auto result = static_cast<AddAction>(showAddClientDialog(name));
|
||||||
|
|
||||||
if (result == AddClientIgnore) {
|
if (result == AddClientIgnore) {
|
||||||
return kAutoAddScreenIgnore;
|
return AutoAddScreenIgnore;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (result == AddClientOther) {
|
if (result == AddClientOther) {
|
||||||
addToFirstEmptyGrid(name);
|
addToFirstEmptyGrid(name);
|
||||||
return kAutoAddScreenManualClient;
|
return AutoAddScreenManualClient;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool success = false;
|
bool success = false;
|
||||||
|
|
@ -379,10 +379,10 @@ int ServerConfig::autoAddScreen(const QString name)
|
||||||
|
|
||||||
if (!success) {
|
if (!success) {
|
||||||
addToFirstEmptyGrid(name);
|
addToFirstEmptyGrid(name);
|
||||||
return kAutoAddScreenManualClient;
|
return AutoAddScreenManualClient;
|
||||||
}
|
}
|
||||||
|
|
||||||
return kAutoAddScreenOk;
|
return AutoAddScreenOk;
|
||||||
}
|
}
|
||||||
|
|
||||||
const QString ServerConfig::getServerName() const
|
const QString ServerConfig::getServerName() const
|
||||||
|
|
|
||||||
|
|
@ -276,10 +276,10 @@ private:
|
||||||
|
|
||||||
QTextStream &operator<<(QTextStream &outStream, const ServerConfig &config);
|
QTextStream &operator<<(QTextStream &outStream, const ServerConfig &config);
|
||||||
|
|
||||||
enum
|
enum AddResults
|
||||||
{
|
{
|
||||||
kAutoAddScreenOk,
|
AutoAddScreenOk,
|
||||||
kAutoAddScreenManualServer,
|
AutoAddScreenManualServer,
|
||||||
kAutoAddScreenManualClient,
|
AutoAddScreenManualClient,
|
||||||
kAutoAddScreenIgnore
|
AutoAddScreenIgnore
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue