summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortygyh <jonis9898@hotmail.com>2024-11-15 09:15:06 +0100
committerDr. Dystopia <jonis9898@hotmail.com>2025-03-26 18:21:46 +0100
commit1ecd6fbc9b5f5350d26c106844470f44c970ae11 (patch)
tree3926a5930af56247449ac1a041e86780e8657b03
parent18979129f35f56de9f87e2a7919788679337abfa (diff)
Move variables to inner scope
-rw-r--r--Source/Core/DolphinQt/Debugger/CodeWidget.cpp2
-rw-r--r--Source/Core/DolphinQt/GameList/GameList.cpp12
2 files changed, 6 insertions, 8 deletions
diff --git a/Source/Core/DolphinQt/Debugger/CodeWidget.cpp b/Source/Core/DolphinQt/Debugger/CodeWidget.cpp
index af8315f179..d8c4f14286 100644
--- a/Source/Core/DolphinQt/Debugger/CodeWidget.cpp
+++ b/Source/Core/DolphinQt/Debugger/CodeWidget.cpp
@@ -543,8 +543,8 @@ void CodeWidget::StepOut()
clock::time_point timeout = clock::now() + std::chrono::seconds(5);
auto& power_pc = m_system.GetPowerPC();
- auto& ppc_state = power_pc.GetPPCState();
{
+ auto& ppc_state = power_pc.GetPPCState();
Core::CPUThreadGuard guard(m_system);
PowerPC::CoreMode old_mode = power_pc.GetMode();
diff --git a/Source/Core/DolphinQt/GameList/GameList.cpp b/Source/Core/DolphinQt/GameList/GameList.cpp
index a4514a0449..8a9f57500b 100644
--- a/Source/Core/DolphinQt/GameList/GameList.cpp
+++ b/Source/Core/DolphinQt/GameList/GameList.cpp
@@ -187,12 +187,11 @@ void GameList::MakeListView()
if (!Settings::GetQSettings().contains(QStringLiteral("tableheader/state")))
m_list->sortByColumn(static_cast<int>(GameListModel::Column::Title), Qt::AscendingOrder);
-
- const auto SetResizeMode = [&hor_header](const GameListModel::Column column,
- const QHeaderView::ResizeMode mode) {
- hor_header->setSectionResizeMode(static_cast<int>(column), mode);
- };
{
+ const auto SetResizeMode = [&hor_header](const GameListModel::Column column,
+ const QHeaderView::ResizeMode mode) {
+ hor_header->setSectionResizeMode(static_cast<int>(column), mode);
+ };
using Column = GameListModel::Column;
using Mode = QHeaderView::ResizeMode;
SetResizeMode(Column::Platform, Mode::Fixed);
@@ -1024,8 +1023,6 @@ void GameList::OnSectionResized(int index, int, int)
{
auto* hor_header = m_list->horizontalHeader();
- std::vector<int> sections;
-
const int vis_index = hor_header->visualIndex(index);
const int col_count = hor_header->count() - hor_header->hiddenSectionCount();
@@ -1043,6 +1040,7 @@ void GameList::OnSectionResized(int index, int, int)
if (!last)
{
+ std::vector<int> sections;
for (int i = 0; i < vis_index; i++)
{
const int logical_index = hor_header->logicalIndex(i);