Misc: Fix a couple of code analysis warnings

pull/3568/head
Stenzek 1 month ago
parent ae570b0aca
commit 7807a6847b
No known key found for this signature in database

@ -1379,7 +1379,12 @@ GPUTexture* FullscreenUI::GetUserThemeableTexture(const std::string_view png_nam
const u32 svg_height = static_cast<u32>(svg_size.y); const u32 svg_height = static_cast<u32>(svg_size.y);
tex = ImGuiFullscreen::FindCachedTexture(svg_name, svg_width, svg_height); tex = ImGuiFullscreen::FindCachedTexture(svg_name, svg_width, svg_height);
if (tex) if (tex)
{
if (is_colorable)
*is_colorable = true;
return tex; return tex;
}
// slow path, check filesystem for override // slow path, check filesystem for override
if (EmuFolders::Resources != EmuFolders::UserResources && if (EmuFolders::Resources != EmuFolders::UserResources &&

@ -5384,15 +5384,7 @@ void System::SaveScreenshot(const char* path, DisplayScreenshotMode mode, Displa
std::string auto_path; std::string auto_path;
if (!path || path[0] == '\0') if (!path || path[0] == '\0')
{
path = (auto_path = GetScreenshotPath(Settings::GetDisplayScreenshotFormatExtension(format))).c_str(); path = (auto_path = GetScreenshotPath(Settings::GetDisplayScreenshotFormatExtension(format))).c_str();
}
else
{
// If the user chose a specific format, use that.
format =
Settings::GetDisplayScreenshotFormatFromFileName(FileSystem::GetDisplayNameFromPath(path)).value_or(format);
}
GPUBackend::RenderScreenshotToFile(path, mode, quality, true); GPUBackend::RenderScreenshotToFile(path, mode, quality, true);
} }

@ -1874,7 +1874,7 @@ GameListListView::GameListListView(GameListModel* model, GameListSortModel* sort
loadColumnVisibilitySettings(); loadColumnVisibilitySettings();
loadColumnSortSettings(); loadColumnSortSettings();
connect(horizontal_header, &QHeaderView::sortIndicatorChanged, this, &GameListListView::onHeaderSortIndicatorChanged); connect(horizontal_header, &QHeaderView::sortIndicatorChanged, this, &GameListListView::saveColumnSortSettings);
connect(horizontal_header, &QHeaderView::customContextMenuRequested, this, connect(horizontal_header, &QHeaderView::customContextMenuRequested, this,
&GameListListView::onHeaderContextMenuRequested); &GameListListView::onHeaderContextMenuRequested);
} }
@ -2036,11 +2036,6 @@ void GameListListView::setAndSaveColumnHidden(int column, bool hidden)
Host::CommitBaseSettingChanges(); Host::CommitBaseSettingChanges();
} }
void GameListListView::onHeaderSortIndicatorChanged(int, Qt::SortOrder)
{
saveColumnSortSettings();
}
void GameListListView::onHeaderContextMenuRequested(const QPoint& point) void GameListListView::onHeaderContextMenuRequested(const QPoint& point)
{ {
QMenu menu; QMenu menu;

@ -182,16 +182,16 @@ public:
protected: protected:
void wheelEvent(QWheelEvent* e) override; void wheelEvent(QWheelEvent* e) override;
private: private Q_SLOTS:
void onHeaderSortIndicatorChanged(int, Qt::SortOrder);
void onHeaderContextMenuRequested(const QPoint& point); void onHeaderContextMenuRequested(const QPoint& point);
void saveColumnSortSettings();
private:
void setFixedColumnWidth(int column, int width); void setFixedColumnWidth(int column, int width);
void setFixedColumnWidths(); void setFixedColumnWidths();
void loadColumnVisibilitySettings(); void loadColumnVisibilitySettings();
void loadColumnSortSettings(); void loadColumnSortSettings();
void saveColumnSortSettings();
GameListModel* m_model = nullptr; GameListModel* m_model = nullptr;
GameListSortModel* m_sort_model = nullptr; GameListSortModel* m_sort_model = nullptr;

Loading…
Cancel
Save