UI-Files: Codacy fix codacy errors and warnings

This commit is contained in:
refractionpcsx2 2022-08-26 22:58:42 +01:00
parent f841a8ba58
commit 93f4277b3c
4 changed files with 4 additions and 6 deletions

View File

@ -76,7 +76,7 @@ static std::time_t ConvertFileTimeToUnixTime(const FILETIME& ft)
static inline bool FileSystemCharacterIsSane(char c, bool StripSlashes) static inline bool FileSystemCharacterIsSane(char c, bool StripSlashes)
{ {
if (!(c >= 'a' && c <= 'z') && !(c >= 'A' && c <= 'Z') && !(c >= '0' && c <= '9') && c != ' ' && c != ' ' && if (!(c >= 'a' && c <= 'z') && !(c >= 'A' && c <= 'Z') && !(c >= '0' && c <= '9') && c != ' ' &&
c != '_' && c != '-' && c != '.') c != '_' && c != '-' && c != '.')
{ {
if (!StripSlashes && (c == '/' || c == '\\')) if (!StripSlashes && (c == '/' || c == '\\'))

View File

@ -180,7 +180,7 @@ GraphicsSettingsWidget::GraphicsSettingsWidget(SettingsDialog* dialog, QWidget*
SettingWidgetBinder::BindWidgetToIntSetting( SettingWidgetBinder::BindWidgetToIntSetting(
sif, m_ui.trilinearFiltering, "EmuCore/GS", "UserHacks_TriFilter", static_cast<int>(TriFiltering::Automatic), -1); sif, m_ui.trilinearFiltering, "EmuCore/GS", "UserHacks_TriFilter", static_cast<int>(TriFiltering::Automatic), -1);
SettingWidgetBinder::BindWidgetToEnumSetting( SettingWidgetBinder::BindWidgetToEnumSetting(
sif, m_ui.anisotropicFiltering, "EmuCore/GS", "MaxAnisotropy", s_anisotropic_filtering_entries, s_anisotropic_filtering_values, "1"); sif, m_ui.anisotropicFiltering, "EmuCore/GS", "MaxAnisotropy", s_anisotropic_filtering_entries, s_anisotropic_filtering_values, "0");
SettingWidgetBinder::BindWidgetToIntSetting(sif, m_ui.dithering, "EmuCore/GS", "dithering_ps2", 2); SettingWidgetBinder::BindWidgetToIntSetting(sif, m_ui.dithering, "EmuCore/GS", "dithering_ps2", 2);
SettingWidgetBinder::BindWidgetToIntSetting(sif, m_ui.mipmapping, "EmuCore/GS", "mipmap_hw", static_cast<int>(HWMipmapLevel::Automatic), -1); SettingWidgetBinder::BindWidgetToIntSetting(sif, m_ui.mipmapping, "EmuCore/GS", "mipmap_hw", static_cast<int>(HWMipmapLevel::Automatic), -1);
SettingWidgetBinder::BindWidgetToIntSetting(sif, m_ui.crcFixLevel, "EmuCore/GS", "crc_hack_level", static_cast<int>(CRCHackLevel::Automatic), -1); SettingWidgetBinder::BindWidgetToIntSetting(sif, m_ui.crcFixLevel, "EmuCore/GS", "crc_hack_level", static_cast<int>(CRCHackLevel::Automatic), -1);

View File

@ -655,8 +655,6 @@ void ImGuiManager::DrawPerformanceOverlay()
text += " (Max)"; text += " (Max)";
else else
fmt::format_to(std::back_inserter(text), " ({:.0f}%)", EmuConfig.GS.LimitScalar * 100.0); fmt::format_to(std::back_inserter(text), " ({:.0f}%)", EmuConfig.GS.LimitScalar * 100.0);
first = false;
} }
if (!text.empty()) if (!text.empty())
{ {

View File

@ -159,7 +159,7 @@ void GameDatabase::parseAndInsert(const std::string_view& serial, const c4::yml:
if (StringUtil::EndsWith(fix, "Hack")) if (StringUtil::EndsWith(fix, "Hack"))
{ {
fix.erase(fix.size() - 4); fix.erase(fix.size() - 4);
for (GamefixId id = GamefixId_FIRST; id < pxEnumEnd; id++) for (GamefixId id = GamefixId_FIRST; id < pxEnumEnd; ++id)
{ {
if (fix.compare(EnumToString(id)) == 0 && if (fix.compare(EnumToString(id)) == 0 &&
std::find(gameEntry.gameFixes.begin(), gameEntry.gameFixes.end(), id) == gameEntry.gameFixes.end()) std::find(gameEntry.gameFixes.begin(), gameEntry.gameFixes.end(), id) == gameEntry.gameFixes.end())
@ -190,7 +190,7 @@ void GameDatabase::parseAndInsert(const std::string_view& serial, const c4::yml:
if (StringUtil::EndsWith(speedHack, "SpeedHack")) if (StringUtil::EndsWith(speedHack, "SpeedHack"))
{ {
speedHack.erase(speedHack.size() - 9); speedHack.erase(speedHack.size() - 9);
for (SpeedhackId id = SpeedhackId_FIRST; id < pxEnumEnd; id++) for (SpeedhackId id = SpeedhackId_FIRST; id < pxEnumEnd; ++id)
{ {
if (speedHack.compare(EnumToString(id)) == 0 && if (speedHack.compare(EnumToString(id)) == 0 &&
std::none_of(gameEntry.speedHacks.begin(), gameEntry.speedHacks.end(), [id](const auto& it) { return it.first == id; })) std::none_of(gameEntry.speedHacks.begin(), gameEntry.speedHacks.end(), [id](const auto& it) { return it.first == id; }))