format and apply the sugestion

Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
This commit is contained in:
Trial97 2023-08-12 12:54:10 +03:00
parent b3b2e9df35
commit 71890707c0
No known key found for this signature in database
GPG Key ID: 55EF5DA53DB36318

View File

@ -24,14 +24,11 @@
namespace ModPlatform {
static const QMap<QString, IndexedVersionType::Enum> s_indexed_version_type_names = {
{"release", IndexedVersionType::Enum::Release},
{"beta", IndexedVersionType::Enum::Beta},
{"alpha", IndexedVersionType::Enum::Alpha}
};
static const QMap<QString, IndexedVersionType::Enum> s_indexed_version_type_names = { { "release", IndexedVersionType::Enum::Release },
{ "beta", IndexedVersionType::Enum::Beta },
{ "alpha", IndexedVersionType::Enum::Alpha } };
IndexedVersionType::IndexedVersionType(const QString& type): IndexedVersionType(enumFromString(type))
{}
IndexedVersionType::IndexedVersionType(const QString& type) : IndexedVersionType(enumFromString(type)) {}
IndexedVersionType::IndexedVersionType(int type)
{
@ -66,7 +63,7 @@ IndexedVersionType& IndexedVersionType::operator=(const IndexedVersionType& othe
return *this;
}
const QString IndexedVersionType::toString (const IndexedVersionType::Enum& type)
const QString IndexedVersionType::toString(const IndexedVersionType::Enum& type)
{
switch (type) {
case IndexedVersionType::Enum::Release:
@ -78,18 +75,12 @@ const QString IndexedVersionType::toString (const IndexedVersionType::Enum& type
case IndexedVersionType::Enum::UNKNOWN:
default:
return "unknown";
}
}
IndexedVersionType::Enum IndexedVersionType::enumFromString(const QString& type)
{
auto found = s_indexed_version_type_names.constFind(type);
if (found != s_indexed_version_type_names.constEnd()) {
return *found;
} else {
return IndexedVersionType::Enum::UNKNOWN;
}
return s_indexed_version_type_names.value(type, IndexedVersionType::Enum::UNKNOWN);
}
auto ProviderCapabilities::name(ResourceProvider p) -> const char*