mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-05-13 08:48:10 +08:00
One more fix of the preceding commit.
This commit is contained in:
parent
38aca5047f
commit
67ce4d862b
@ -680,7 +680,7 @@ public:
|
|||||||
|
|
||||||
static bool has(T value)
|
static bool has(T value)
|
||||||
{
|
{
|
||||||
for (const std::map<std::string,int> &kvp : get_enum_values())
|
for (const std::pair<std::string, int> &kvp : ConfigOptionEnum<T>::get_enum_values())
|
||||||
if (kvp.second == value)
|
if (kvp.second == value)
|
||||||
return true;
|
return true;
|
||||||
return false;
|
return false;
|
||||||
@ -694,11 +694,11 @@ public:
|
|||||||
// Initialize the map.
|
// Initialize the map.
|
||||||
const t_config_enum_values &enum_keys_map = ConfigOptionEnum<T>::get_enum_values();
|
const t_config_enum_values &enum_keys_map = ConfigOptionEnum<T>::get_enum_values();
|
||||||
int cnt = 0;
|
int cnt = 0;
|
||||||
for (auto &kvp : enum_keys_map)
|
for (const std::pair<std::string, int> &kvp : enum_keys_map)
|
||||||
cnt = std::max(cnt, kvp.second);
|
cnt = std::max(cnt, kvp.second);
|
||||||
cnt += 1;
|
cnt += 1;
|
||||||
names.assign(cnt, "");
|
names.assign(cnt, "");
|
||||||
for (auto &kvp : enum_keys_map)
|
for (const std::pair<std::string, int> &kvp : enum_keys_map)
|
||||||
names[kvp.second] = kvp.first;
|
names[kvp.second] = kvp.first;
|
||||||
}
|
}
|
||||||
return names;
|
return names;
|
||||||
@ -998,7 +998,7 @@ protected:
|
|||||||
class UnknownOptionException : public std::exception
|
class UnknownOptionException : public std::exception
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
const char* what() const override { return "Unknown config option"; }
|
const char* what() const _NOEXCEPT override { return "Unknown config option"; }
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -265,7 +265,7 @@ private: \
|
|||||||
} \
|
} \
|
||||||
} \
|
} \
|
||||||
/* Cache object holding a key/option map, a list of option keys and a copy of this static config initialized with the defaults. */ \
|
/* Cache object holding a key/option map, a list of option keys and a copy of this static config initialized with the defaults. */ \
|
||||||
static StaticCache<CLASS_NAME> s_cache_##CLASS_NAME;
|
static StaticPrintConfig::StaticCache<CLASS_NAME> s_cache_##CLASS_NAME;
|
||||||
|
|
||||||
#define STATIC_PRINT_CONFIG_CACHE(CLASS_NAME) \
|
#define STATIC_PRINT_CONFIG_CACHE(CLASS_NAME) \
|
||||||
STATIC_PRINT_CONFIG_CACHE_BASE(CLASS_NAME) \
|
STATIC_PRINT_CONFIG_CACHE_BASE(CLASS_NAME) \
|
||||||
|
Loading…
x
Reference in New Issue
Block a user