format and apply the sugestion
Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
This commit is contained in:
parent
b3b2e9df35
commit
71890707c0
@ -24,14 +24,11 @@
|
|||||||
|
|
||||||
namespace ModPlatform {
|
namespace ModPlatform {
|
||||||
|
|
||||||
static const QMap<QString, IndexedVersionType::Enum> s_indexed_version_type_names = {
|
static const QMap<QString, IndexedVersionType::Enum> s_indexed_version_type_names = { { "release", IndexedVersionType::Enum::Release },
|
||||||
{"release", IndexedVersionType::Enum::Release},
|
{ "beta", IndexedVersionType::Enum::Beta },
|
||||||
{"beta", IndexedVersionType::Enum::Beta},
|
{ "alpha", IndexedVersionType::Enum::Alpha } };
|
||||||
{"alpha", IndexedVersionType::Enum::Alpha}
|
|
||||||
};
|
|
||||||
|
|
||||||
IndexedVersionType::IndexedVersionType(const QString& type): IndexedVersionType(enumFromString(type))
|
IndexedVersionType::IndexedVersionType(const QString& type) : IndexedVersionType(enumFromString(type)) {}
|
||||||
{}
|
|
||||||
|
|
||||||
IndexedVersionType::IndexedVersionType(int type)
|
IndexedVersionType::IndexedVersionType(int type)
|
||||||
{
|
{
|
||||||
@ -60,13 +57,13 @@ IndexedVersionType::IndexedVersionType(const IndexedVersionType& other)
|
|||||||
m_type = other.m_type;
|
m_type = other.m_type;
|
||||||
}
|
}
|
||||||
|
|
||||||
IndexedVersionType& IndexedVersionType::operator=(const IndexedVersionType& other)
|
IndexedVersionType& IndexedVersionType::operator=(const IndexedVersionType& other)
|
||||||
{
|
{
|
||||||
m_type = other.m_type;
|
m_type = other.m_type;
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
const QString IndexedVersionType::toString (const IndexedVersionType::Enum& type)
|
const QString IndexedVersionType::toString(const IndexedVersionType::Enum& type)
|
||||||
{
|
{
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case IndexedVersionType::Enum::Release:
|
case IndexedVersionType::Enum::Release:
|
||||||
@ -78,18 +75,12 @@ const QString IndexedVersionType::toString (const IndexedVersionType::Enum& type
|
|||||||
case IndexedVersionType::Enum::UNKNOWN:
|
case IndexedVersionType::Enum::UNKNOWN:
|
||||||
default:
|
default:
|
||||||
return "unknown";
|
return "unknown";
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
IndexedVersionType::Enum IndexedVersionType::enumFromString(const QString& type)
|
IndexedVersionType::Enum IndexedVersionType::enumFromString(const QString& type)
|
||||||
{
|
{
|
||||||
auto found = s_indexed_version_type_names.constFind(type);
|
return s_indexed_version_type_names.value(type, IndexedVersionType::Enum::UNKNOWN);
|
||||||
if (found != s_indexed_version_type_names.constEnd()) {
|
|
||||||
return *found;
|
|
||||||
} else {
|
|
||||||
return IndexedVersionType::Enum::UNKNOWN;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
auto ProviderCapabilities::name(ResourceProvider p) -> const char*
|
auto ProviderCapabilities::name(ResourceProvider p) -> const char*
|
||||||
|
Loading…
Reference in New Issue
Block a user