Move connections to the ::setupConnecctions method

What's the reason of having a ::setupConnections if there's
connections for the GUI outside of it?
This commit is contained in:
Tomaz Canabrava 2021-11-30 09:43:25 -03:00
parent 1c5d0f5b4a
commit ae088e1ace
1 changed files with 15 additions and 7 deletions

View File

@ -99,9 +99,6 @@ MainWindow::MainWindow(QWidget* parent) :
setupObjectNames();
setupUi(this);
connect(&m_ListDevices->listDevices(), &QListWidget::customContextMenuRequested, this, &MainWindow::listDevicesContextMenuRequested);
connect(&m_TreeLog->treeLog(), &QTreeWidget::customContextMenuRequested, this, &MainWindow::treeLogContextMenuRequested);
connect(&m_ListOperations->listOperations(), &QListWidget::customContextMenuRequested, this, &MainWindow::listOperationsContextMenuRequested);
init();
}
@ -118,8 +115,6 @@ void MainWindow::init()
{
treeLog().init();
connect(GlobalLog::instance(), &GlobalLog::newMessage, &treeLog(), &TreeLog::onNewLogMessage);
setupActions();
setupStatusBar();
setupConnections();
@ -449,8 +444,21 @@ void MainWindow::setupActions()
void MainWindow::setupConnections()
{
connect(&listDevices(), &ListDevices::selectionChanged, &pmWidget(), qOverload<const QString&>(&PartitionManagerWidget::setSelectedDevice));
connect(&listDevices(), &ListDevices::deviceDoubleClicked, this, &MainWindow::onPropertiesDevice);
connect(&listDevices(), &ListDevices::selectionChanged,
&pmWidget(), qOverload<const QString&>(&PartitionManagerWidget::setSelectedDevice));
connect(&listDevices(), &ListDevices::deviceDoubleClicked,
this, &MainWindow::onPropertiesDevice);
connect(&m_ListDevices->listDevices(), &QListWidget::customContextMenuRequested,
this, &MainWindow::listDevicesContextMenuRequested);
connect(&m_TreeLog->treeLog(), &QTreeWidget::customContextMenuRequested,
this, &MainWindow::treeLogContextMenuRequested);
connect(&m_ListOperations->listOperations(), &QListWidget::customContextMenuRequested,
this, &MainWindow::listOperationsContextMenuRequested);
connect(GlobalLog::instance(), &GlobalLog::newMessage,
&treeLog(), &TreeLog::onNewLogMessage);
}
void MainWindow::setupStatusBar()