From 80355ba4a8da8e1d36a9c805728e9d9bbe81650a Mon Sep 17 00:00:00 2001 From: ElBread3 <92335081+ElBread3@users.noreply.github.com> Date: Thu, 8 Aug 2024 10:24:29 -0500 Subject: [PATCH] simplify (thx raziel) --- src/qt_gui/game_grid_frame.cpp | 1 - src/qt_gui/game_grid_frame.h | 1 - src/qt_gui/game_list_frame.cpp | 2 -- src/qt_gui/game_list_frame.h | 1 - src/qt_gui/main_window.cpp | 3 +++ 5 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/qt_gui/game_grid_frame.cpp b/src/qt_gui/game_grid_frame.cpp index 3d05d2b1..3d5ab14e 100644 --- a/src/qt_gui/game_grid_frame.cpp +++ b/src/qt_gui/game_grid_frame.cpp @@ -37,7 +37,6 @@ GameGridFrame::GameGridFrame(std::shared_ptr game_info_get, QWidg crtColumn = this->currentColumn(); columnCnt = this->columnCount(); }); - connect(this, &QTableWidget::cellDoubleClicked, this, &MainWindow::StartGame); } void GameGridFrame::PopulateGameGrid(QVector m_games_search, bool fromSearch) { diff --git a/src/qt_gui/game_grid_frame.h b/src/qt_gui/game_grid_frame.h index 305a58b7..ce775315 100644 --- a/src/qt_gui/game_grid_frame.h +++ b/src/qt_gui/game_grid_frame.h @@ -19,7 +19,6 @@ #include "game_info.h" #include "game_list_utils.h" #include "gui_context_menus.h" -#include "main_window.h" class GameGridFrame : public QTableWidget { Q_OBJECT diff --git a/src/qt_gui/game_list_frame.cpp b/src/qt_gui/game_list_frame.cpp index 703dc5e6..2699c961 100644 --- a/src/qt_gui/game_list_frame.cpp +++ b/src/qt_gui/game_list_frame.cpp @@ -54,8 +54,6 @@ GameListFrame::GameListFrame(std::shared_ptr game_info_get, QWidg connect(this->horizontalScrollBar(), &QScrollBar::valueChanged, this, &GameListFrame::RefreshListBackgroundImage); - connect(this, &QTableWidget::cellDoubleClicked, this, &MainWindow::StartGame); - this->horizontalHeader()->setSortIndicatorShown(true); this->horizontalHeader()->setSectionsClickable(true); QObject::connect( diff --git a/src/qt_gui/game_list_frame.h b/src/qt_gui/game_list_frame.h index bcb3f4b1..d8bccf46 100644 --- a/src/qt_gui/game_list_frame.h +++ b/src/qt_gui/game_list_frame.h @@ -20,7 +20,6 @@ #include "game_info.h" #include "game_list_utils.h" #include "gui_context_menus.h" -#include "main_window.h" class GameListFrame : public QTableWidget { Q_OBJECT diff --git a/src/qt_gui/main_window.cpp b/src/qt_gui/main_window.cpp index 6b51a371..db60c644 100644 --- a/src/qt_gui/main_window.cpp +++ b/src/qt_gui/main_window.cpp @@ -180,6 +180,9 @@ void MainWindow::CreateConnects() { }); connect(ui->playButton, &QPushButton::clicked, this, &MainWindow::StartGame); + connect(m_game_list_grid.get(), &QTableWidget::cellDoubleClicked, this, &MainWindow::StartGame); + connect(m_game_list_frame.get(), &QTableWidget::cellDoubleClicked, this, + &MainWindow::StartGame); connect(ui->setIconSizeTinyAct, &QAction::triggered, this, [this]() { if (isTableList) {