diff --git a/rpcs3/rpcs3qt/debugger_frame.cpp b/rpcs3/rpcs3qt/debugger_frame.cpp index f5781632dc..d4beb3db79 100644 --- a/rpcs3/rpcs3qt/debugger_frame.cpp +++ b/rpcs3/rpcs3qt/debugger_frame.cpp @@ -172,18 +172,12 @@ void debugger_frame::closeEvent(QCloseEvent *event) void debugger_frame::showEvent(QShowEvent * event) { // resize splitter widgets - QByteArray state = xgui_settings->GetValue(gui::d_splitterState).toByteArray(); - - if (state.isEmpty()) // resize 2:1 + if (!m_splitter->restoreState(xgui_settings->GetValue(gui::d_splitterState).toByteArray())) { const int width_right = width() / 3; const int width_left = width() - width_right; m_splitter->setSizes({width_left, width_right}); } - else - { - m_splitter->restoreState(state); - } QDockWidget::showEvent(event); } diff --git a/rpcs3/rpcs3qt/game_list_frame.cpp b/rpcs3/rpcs3qt/game_list_frame.cpp index 8e404da761..cda1b7650c 100644 --- a/rpcs3/rpcs3qt/game_list_frame.cpp +++ b/rpcs3/rpcs3qt/game_list_frame.cpp @@ -174,12 +174,7 @@ game_list_frame::game_list_frame(std::shared_ptr guiSettings, std: void game_list_frame::LoadSettings() { QByteArray state = xgui_settings->GetValue(gui::gl_state).toByteArray(); - - if (!state.isEmpty()) - { - m_gameList->horizontalHeader()->restoreState(state); - } - else if (m_gameList->rowCount() > 0) + if (!m_gameList->horizontalHeader()->restoreState(state) && m_gameList->rowCount()) { // If no settings exist, go to default. m_gameList->verticalHeader()->resizeSections(QHeaderView::ResizeMode::ResizeToContents); @@ -198,9 +193,7 @@ void game_list_frame::LoadSettings() m_gameList->horizontalHeader()->restoreState(m_gameList->horizontalHeader()->saveState()); m_colSortOrder = xgui_settings->GetValue(gui::gl_sortAsc).toBool() ? Qt::AscendingOrder : Qt::DescendingOrder; - m_sortColumn = xgui_settings->GetValue(gui::gl_sortCol).toInt(); - m_categoryFilters = xgui_settings->GetGameListCategoryFilters(); Refresh(true); diff --git a/rpcs3/rpcs3qt/trophy_manager_dialog.cpp b/rpcs3/rpcs3qt/trophy_manager_dialog.cpp index 6c4dfe16c2..cb93dd97d6 100644 --- a/rpcs3/rpcs3qt/trophy_manager_dialog.cpp +++ b/rpcs3/rpcs3qt/trophy_manager_dialog.cpp @@ -243,24 +243,15 @@ trophy_manager_dialog::trophy_manager_dialog(std::shared_ptr gui_s if (!restoreGeometry(m_gui_settings->GetValue(gui::tr_geometry).toByteArray())) resize(QDesktopWidget().availableGeometry().size() * 0.7); - QByteArray splitterstate = m_gui_settings->GetValue(gui::tr_splitterState).toByteArray(); - if (splitterstate.isEmpty()) + if (!m_splitter->restoreState(m_gui_settings->GetValue(gui::tr_splitterState).toByteArray())) { const int width_left = m_splitter->width() * 0.4; const int width_right = m_splitter->width() - width_left; m_splitter->setSizes({ width_left, width_right }); } - else - { - m_splitter->restoreState(splitterstate); - } QByteArray game_table_state = m_gui_settings->GetValue(gui::tr_games_state).toByteArray(); - if (!game_table_state.isEmpty()) - { - m_game_table->horizontalHeader()->restoreState(game_table_state); - } - else if (m_game_table->rowCount() > 0) + if (!m_game_table->horizontalHeader()->restoreState(game_table_state) && m_game_table->rowCount()) { // If no settings exist, go to default. m_game_table->verticalHeader()->resizeSections(QHeaderView::ResizeMode::ResizeToContents); @@ -268,11 +259,7 @@ trophy_manager_dialog::trophy_manager_dialog(std::shared_ptr gui_s } QByteArray trophy_table_state = m_gui_settings->GetValue(gui::tr_trophy_state).toByteArray(); - if (!trophy_table_state.isEmpty()) - { - m_trophy_table->horizontalHeader()->restoreState(trophy_table_state); - } - else if (m_trophy_table->rowCount() > 0) + if (!m_trophy_table->horizontalHeader()->restoreState(trophy_table_state) && m_trophy_table->rowCount()) { // If no settings exist, go to default. m_trophy_table->verticalHeader()->resizeSections(QHeaderView::ResizeMode::ResizeToContents);