From 157f3e553592882612642d89d955ce95ee892a6c Mon Sep 17 00:00:00 2001 From: NeoTheFox Date: Sat, 21 Mar 2015 01:16:15 +0300 Subject: [PATCH] Refactoring --- mainwindow.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/mainwindow.cpp b/mainwindow.cpp index c67a0b8..46cdb00 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -94,10 +94,6 @@ MainWindow::MainWindow(QWidget *parent) : //Update serial ports serialupdate(); - //Internal signal-slots - connect(statusTimer, &QTimer::timeout, this, &MainWindow::checkStatus); - connect(progressSDTimer, &QTimer::timeout, this, &MainWindow::checkSDStatus); - //Register all the types qRegisterMetaType("TemperatureReadings"); qRegisterMetaType("SDProgress"); @@ -106,6 +102,10 @@ MainWindow::MainWindow(QWidget *parent) : qRegisterMetaType("FileProgress"); qRegisterMetaType("QSerialPort::SerialPortError"); + //Internal signal-slots + connect(statusTimer, &QTimer::timeout, this, &MainWindow::checkStatus); + connect(progressSDTimer, &QTimer::timeout, this, &MainWindow::checkSDStatus); + //Parser thread signal-slots and init parserWorker->moveToThread(parserThread); connect(parserThread, &QThread::finished, parserWorker, &QObject::deleteLater); @@ -612,7 +612,7 @@ void MainWindow::updateRecent() action->setText(str); //Set filepath as a title action->setObjectName(str); //Also set name to the path so we can get it later recentMenu->addAction(action); //Add action to the menu - connect(action, SIGNAL(triggered()), this, SLOT(recentClicked())); + connect(action, &QAction::trigger, this, &MainWindow::recentClicked); } } } @@ -807,8 +807,8 @@ void MainWindow::openEEPROMeditor() { EEPROMWindow eepromwindow(EEPROMSettings, this); - eepromwindow.setWindowModality(Qt::NonModal); //Do not bloct the UI when EEPROM editor is shown - connect(&eepromwindow, SIGNAL(changesComplete(QStringList)), this, SLOT(sendEEPROMsettings(QStringList))); + eepromwindow.setWindowModality(Qt::NonModal); //Do not block the UI when EEPROM editor is shown + connect(&eepromwindow, &EEPROMWindow::changesComplete, this, &MainWindow::sendEEPROMsettings); eepromwindow.exec(); }