logic: removed "unknown" source group status type
* removed "unknown" source group status type and implemented falling back to "disabled", because "unknown" should not be handled anywhere in the rest of the code base.
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
#include "settings/SourceGroupStatusType.h"
|
||||
|
||||
#include "utility/logging/logging.h"
|
||||
|
||||
std::string sourceGroupStatusTypeToString(SourceGroupStatusType v)
|
||||
{
|
||||
switch (v)
|
||||
@@ -8,10 +10,9 @@ std::string sourceGroupStatusTypeToString(SourceGroupStatusType v)
|
||||
return "enabled";
|
||||
case SOURCE_GROUP_STATUS_DISABLED:
|
||||
return "disabled";
|
||||
case SOURCE_GROUP_STATUS_UNKNOWN:
|
||||
break;
|
||||
}
|
||||
return "unknown";
|
||||
LOG_WARNING("Trying to convert unknown Source Group status type to string, falling back to disabled status.");
|
||||
return "disabled";
|
||||
}
|
||||
|
||||
SourceGroupStatusType stringToSourceGroupStatusType(std::string v)
|
||||
@@ -25,5 +26,6 @@ SourceGroupStatusType stringToSourceGroupStatusType(std::string v)
|
||||
return SOURCE_GROUP_STATUS_DISABLED;
|
||||
}
|
||||
|
||||
return SOURCE_GROUP_STATUS_UNKNOWN;
|
||||
LOG_WARNING("Trying to convert unknown string to Source Group status type, falling back to disabled status.");
|
||||
return SOURCE_GROUP_STATUS_DISABLED;
|
||||
}
|
||||
|
||||
@@ -6,8 +6,7 @@
|
||||
enum SourceGroupStatusType
|
||||
{
|
||||
SOURCE_GROUP_STATUS_ENABLED,
|
||||
SOURCE_GROUP_STATUS_DISABLED,
|
||||
SOURCE_GROUP_STATUS_UNKNOWN
|
||||
SOURCE_GROUP_STATUS_DISABLED
|
||||
};
|
||||
|
||||
std::string sourceGroupStatusTypeToString(SourceGroupStatusType v);
|
||||
|
||||
Reference in New Issue
Block a user