Convert some signals and slots to the new syntax.
This commit is contained in:
parent
36caff20f6
commit
5a408305f2
|
@ -61,7 +61,6 @@ find_package(KF5 5.16 REQUIRED
|
||||||
|
|
||||||
# use sane compile flags
|
# use sane compile flags
|
||||||
add_definitions(
|
add_definitions(
|
||||||
# -fexceptions
|
|
||||||
-DQT_USE_QSTRINGBUILDER
|
-DQT_USE_QSTRINGBUILDER
|
||||||
-DQT_NO_CAST_TO_ASCII
|
-DQT_NO_CAST_TO_ASCII
|
||||||
-DQT_NO_CAST_FROM_ASCII
|
-DQT_NO_CAST_FROM_ASCII
|
||||||
|
|
|
@ -126,9 +126,9 @@ void ApplyProgressDialog::setupConnections()
|
||||||
connect(&timer(), SIGNAL(timeout()), SLOT(onSecondElapsed()));
|
connect(&timer(), SIGNAL(timeout()), SLOT(onSecondElapsed()));
|
||||||
connect(&detailsWidget().buttonSave(), SIGNAL(clicked()), SLOT(saveReport()));
|
connect(&detailsWidget().buttonSave(), SIGNAL(clicked()), SLOT(saveReport()));
|
||||||
connect(&detailsWidget().buttonBrowser(), SIGNAL(clicked()), SLOT(browserReport()));
|
connect(&detailsWidget().buttonBrowser(), SIGNAL(clicked()), SLOT(browserReport()));
|
||||||
connect(dialogButtonBox, SIGNAL(accepted()), this, SLOT(accept()));
|
connect(dialogButtonBox, &QDialogButtonBox::accepted, this, &ApplyProgressDialog::accept);
|
||||||
connect(dialogButtonBox, SIGNAL(rejected()), this, SLOT(reject()));
|
connect(dialogButtonBox, &QDialogButtonBox::rejected, this, &ApplyProgressDialog::reject);
|
||||||
connect(detailsButton, SIGNAL(clicked()), this, SLOT(toggleDetails()));
|
connect(detailsButton, &QPushButton::clicked, this, &ApplyProgressDialog::toggleDetails);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Shows the dialog */
|
/** Shows the dialog */
|
||||||
|
@ -277,8 +277,8 @@ void ApplyProgressDialog::onOpStarted(int num, Operation* op)
|
||||||
dialogWidget().progressSub().setValue(0);
|
dialogWidget().progressSub().setValue(0);
|
||||||
dialogWidget().progressSub().setRange(0, op->totalProgress());
|
dialogWidget().progressSub().setRange(0, op->totalProgress());
|
||||||
|
|
||||||
connect(op, SIGNAL(jobStarted(Job*, Operation*)), SLOT(onJobStarted(Job*, Operation*)));
|
connect(op, &Operation::jobStarted, this, &ApplyProgressDialog::onJobStarted);
|
||||||
connect(op, SIGNAL(jobFinished(Job*, Operation*)), SLOT(onJobFinished(Job*, Operation*)));
|
connect(op, &Operation::jobFinished, this, &ApplyProgressDialog::onJobFinished);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ApplyProgressDialog::onJobStarted(Job* job, Operation* op)
|
void ApplyProgressDialog::onJobStarted(Job* job, Operation* op)
|
||||||
|
|
|
@ -73,15 +73,16 @@ protected Q_SLOTS:
|
||||||
void onOkButton();
|
void onOkButton();
|
||||||
void onOpStarted(int num, Operation* op);
|
void onOpStarted(int num, Operation* op);
|
||||||
void onOpFinished(int num, Operation* op);
|
void onOpFinished(int num, Operation* op);
|
||||||
void onJobStarted(Job* job, Operation* op);
|
|
||||||
void onJobFinished(Job* job, Operation* op);
|
|
||||||
void onSecondElapsed();
|
void onSecondElapsed();
|
||||||
void saveReport();
|
void saveReport();
|
||||||
void toggleDetails();
|
|
||||||
void browserReport();
|
void browserReport();
|
||||||
void updateReport(bool force = false);
|
void updateReport(bool force = false);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
void onJobStarted(Job* job, Operation* op);
|
||||||
|
void onJobFinished(Job* job, Operation* op);
|
||||||
|
void toggleDetails();
|
||||||
|
|
||||||
void closeEvent(QCloseEvent* e) override;
|
void closeEvent(QCloseEvent* e) override;
|
||||||
void keyPressEvent(QKeyEvent* e) override;
|
void keyPressEvent(QKeyEvent* e) override;
|
||||||
|
|
||||||
|
|
|
@ -45,8 +45,8 @@ CreatePartitionTableDialog::CreatePartitionTableDialog(QWidget* parent, const De
|
||||||
mainLayout->addWidget(dialogButtonBox);
|
mainLayout->addWidget(dialogButtonBox);
|
||||||
|
|
||||||
connect(&widget().radioMSDOS(), SIGNAL(toggled(bool)), SLOT(onMSDOSToggled(bool)));
|
connect(&widget().radioMSDOS(), SIGNAL(toggled(bool)), SLOT(onMSDOSToggled(bool)));
|
||||||
connect(dialogButtonBox, SIGNAL(accepted()), this, SLOT(accept()));
|
connect(dialogButtonBox, &QDialogButtonBox::accepted, this, &CreatePartitionTableDialog::accept);
|
||||||
connect(dialogButtonBox, SIGNAL(rejected()), this, SLOT(reject()));
|
connect(dialogButtonBox, &QDialogButtonBox::rejected, this, &CreatePartitionTableDialog::reject);
|
||||||
}
|
}
|
||||||
|
|
||||||
PartitionTable::TableType CreatePartitionTableDialog::type() const
|
PartitionTable::TableType CreatePartitionTableDialog::type() const
|
||||||
|
|
|
@ -76,8 +76,8 @@ void DevicePropsDialog::setupDialog()
|
||||||
okButton->setEnabled(false);
|
okButton->setEnabled(false);
|
||||||
cancelButton->setFocus();
|
cancelButton->setFocus();
|
||||||
cancelButton->setDefault(true);
|
cancelButton->setDefault(true);
|
||||||
connect(dialogButtonBox, SIGNAL(accepted()), this, SLOT(accept()));
|
connect(dialogButtonBox, &QDialogButtonBox::accepted, this, &DevicePropsDialog::accept);
|
||||||
connect(dialogButtonBox, SIGNAL(rejected()), this, SLOT(reject()));
|
connect(dialogButtonBox, &QDialogButtonBox::rejected, this, &DevicePropsDialog::reject);
|
||||||
|
|
||||||
QString type = QStringLiteral("---");
|
QString type = QStringLiteral("---");
|
||||||
QString maxPrimaries = QStringLiteral("---");
|
QString maxPrimaries = QStringLiteral("---");
|
||||||
|
|
|
@ -107,7 +107,7 @@ void FileSystemSupportDialog::setupDialog()
|
||||||
|
|
||||||
void FileSystemSupportDialog::setupConnections()
|
void FileSystemSupportDialog::setupConnections()
|
||||||
{
|
{
|
||||||
connect(dialogButtonBox->button(QDialogButtonBox::Ok), SIGNAL(clicked()), SLOT(close()));
|
connect(dialogButtonBox->button(QDialogButtonBox::Ok), &QPushButton::clicked, this, &FileSystemSupportDialog::close);
|
||||||
connect(&dialogWidget().buttonRescan(), SIGNAL(clicked()), SLOT(onButtonRescanClicked()));
|
connect(&dialogWidget().buttonRescan(), SIGNAL(clicked()), SLOT(onButtonRescanClicked()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -115,7 +115,7 @@ void MainWindow::init()
|
||||||
{
|
{
|
||||||
treeLog().init();
|
treeLog().init();
|
||||||
|
|
||||||
connect(GlobalLog::instance(), SIGNAL(newMessage(Log::Level, const QString&)), &treeLog(), SLOT(onNewLogMessage(Log::Level, const QString&)));
|
connect(GlobalLog::instance(), &GlobalLog::newMessage, &treeLog(), &TreeLog::onNewLogMessage);
|
||||||
|
|
||||||
setupActions();
|
setupActions();
|
||||||
setupStatusBar();
|
setupStatusBar();
|
||||||
|
@ -657,7 +657,7 @@ void MainWindow::updateSeletedDeviceMenu()
|
||||||
action->setCheckable(true);
|
action->setCheckable(true);
|
||||||
action->setChecked(d->deviceNode() == pmWidget().selectedDevice()->deviceNode());
|
action->setChecked(d->deviceNode() == pmWidget().selectedDevice()->deviceNode());
|
||||||
action->setData(d->deviceNode());
|
action->setData(d->deviceNode());
|
||||||
connect(action, SIGNAL(triggered(bool)), SLOT(onSelectedDeviceMenuTriggered(bool)));
|
connect(action, &QAction::triggered, this, &MainWindow::onSelectedDeviceMenuTriggered);
|
||||||
devicesMenu->addAction(action);
|
devicesMenu->addAction(action);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -211,6 +211,8 @@ protected:
|
||||||
return *m_ScanProgressDialog;
|
return *m_ScanProgressDialog;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void onSelectedDeviceMenuTriggered(bool);
|
||||||
|
|
||||||
protected Q_SLOTS:
|
protected Q_SLOTS:
|
||||||
void on_m_PartitionManagerWidget_selectedPartitionChanged(const Partition* p);
|
void on_m_PartitionManagerWidget_selectedPartitionChanged(const Partition* p);
|
||||||
void on_m_PartitionManagerWidget_contextMenuRequested(const QPoint& pos);
|
void on_m_PartitionManagerWidget_contextMenuRequested(const QPoint& pos);
|
||||||
|
@ -251,7 +253,6 @@ protected Q_SLOTS:
|
||||||
|
|
||||||
void onSmartStatusDevice();
|
void onSmartStatusDevice();
|
||||||
void onPropertiesDevice(const QString& device_node = QString());
|
void onPropertiesDevice(const QString& device_node = QString());
|
||||||
void onSelectedDeviceMenuTriggered(bool);
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
OperationStack* m_OperationStack;
|
OperationStack* m_OperationStack;
|
||||||
|
|
|
@ -153,7 +153,7 @@ void PartitionManagerWidget::saveConfig() const
|
||||||
|
|
||||||
void PartitionManagerWidget::setupConnections()
|
void PartitionManagerWidget::setupConnections()
|
||||||
{
|
{
|
||||||
connect(treePartitions().header(), SIGNAL(customContextMenuRequested(const QPoint&)), SLOT(onHeaderContextMenu(const QPoint&)));
|
connect(treePartitions().header(), &QHeaderView::customContextMenuRequested, this, &PartitionManagerWidget::onHeaderContextMenu);
|
||||||
}
|
}
|
||||||
|
|
||||||
void PartitionManagerWidget::clear()
|
void PartitionManagerWidget::clear()
|
||||||
|
|
|
@ -135,6 +135,8 @@ protected:
|
||||||
return *m_TreePartitions;
|
return *m_TreePartitions;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void onHeaderContextMenu(const QPoint& p);
|
||||||
|
|
||||||
protected Q_SLOTS:
|
protected Q_SLOTS:
|
||||||
void on_m_TreePartitions_currentItemChanged(QTreeWidgetItem* current, QTreeWidgetItem* previous);
|
void on_m_TreePartitions_currentItemChanged(QTreeWidgetItem* current, QTreeWidgetItem* previous);
|
||||||
void on_m_TreePartitions_customContextMenuRequested(const QPoint& pos);
|
void on_m_TreePartitions_customContextMenuRequested(const QPoint& pos);
|
||||||
|
@ -144,8 +146,6 @@ protected Q_SLOTS:
|
||||||
void on_m_PartTableWidget_customContextMenuRequested(const QPoint& pos);
|
void on_m_PartTableWidget_customContextMenuRequested(const QPoint& pos);
|
||||||
void on_m_PartTableWidget_itemDoubleClicked();
|
void on_m_PartTableWidget_itemDoubleClicked();
|
||||||
|
|
||||||
void onHeaderContextMenu(const QPoint& p);
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
OperationStack* m_OperationStack;
|
OperationStack* m_OperationStack;
|
||||||
Device* m_SelectedDevice;
|
Device* m_SelectedDevice;
|
||||||
|
|
|
@ -107,8 +107,8 @@ void PartPropsDialog::setupDialog()
|
||||||
okButton->setEnabled(false);
|
okButton->setEnabled(false);
|
||||||
cancelButton->setFocus();
|
cancelButton->setFocus();
|
||||||
cancelButton->setDefault(true);
|
cancelButton->setDefault(true);
|
||||||
connect(dialogButtonBox, SIGNAL(accepted()), this, SLOT(accept()));
|
connect(dialogButtonBox, &QDialogButtonBox::accepted, this, &PartPropsDialog::accept);
|
||||||
connect(dialogButtonBox, SIGNAL(rejected()), this, SLOT(reject()));
|
connect(dialogButtonBox, &QDialogButtonBox::rejected, this, &PartPropsDialog::reject);
|
||||||
|
|
||||||
dialogWidget().partWidget().init(&partition());
|
dialogWidget().partWidget().init(&partition());
|
||||||
|
|
||||||
|
|
|
@ -71,9 +71,9 @@ SizeDialogBase::SizeDialogBase(QWidget* parent, Device& d, Partition& part, qint
|
||||||
mainLayout->setSizeConstraint(QLayout::SetFixedSize);
|
mainLayout->setSizeConstraint(QLayout::SetFixedSize);
|
||||||
mainLayout->addWidget(dialogButtonBox);
|
mainLayout->addWidget(dialogButtonBox);
|
||||||
|
|
||||||
connect(dialogButtonBox, SIGNAL(accepted()), this, SLOT(accept()));
|
connect(dialogButtonBox, &QDialogButtonBox::accepted, this, &SizeDialogBase::accept);
|
||||||
connect(dialogButtonBox, SIGNAL(rejected()), this, SLOT(reject()));
|
connect(dialogButtonBox, &QDialogButtonBox::rejected, this, &SizeDialogBase::reject);
|
||||||
connect(detailsButton, SIGNAL(clicked()), this, SLOT(toggleDetails()));
|
connect(detailsButton, &QPushButton::clicked, this, &SizeDialogBase::toggleDetails);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SizeDialogBase::setupDialog()
|
void SizeDialogBase::setupDialog()
|
||||||
|
|
|
@ -127,9 +127,9 @@ protected Q_SLOTS:
|
||||||
void onSpinLastSectorChanged(double newLast);
|
void onSpinLastSectorChanged(double newLast);
|
||||||
void onAlignToggled(bool);
|
void onAlignToggled(bool);
|
||||||
|
|
||||||
|
protected:
|
||||||
void toggleDetails();
|
void toggleDetails();
|
||||||
|
|
||||||
protected:
|
|
||||||
SizeDialogWidget* m_SizeDialogWidget;
|
SizeDialogWidget* m_SizeDialogWidget;
|
||||||
SizeDetailsWidget* m_SizeDetailsWidget;
|
SizeDetailsWidget* m_SizeDetailsWidget;
|
||||||
Device& m_Device;
|
Device& m_Device;
|
||||||
|
|
|
@ -141,8 +141,8 @@ void SmartDialog::setupDialog()
|
||||||
|
|
||||||
void SmartDialog::setupConnections()
|
void SmartDialog::setupConnections()
|
||||||
{
|
{
|
||||||
connect(buttonBox->button(QDialogButtonBox::Save), SIGNAL(clicked()), SLOT(saveSmartReport()));
|
connect(buttonBox->button(QDialogButtonBox::Save), &QPushButton::clicked, this, &SmartDialog::saveSmartReport);
|
||||||
connect(buttonBox->button(QDialogButtonBox::Close), SIGNAL(clicked()), SLOT(close()));
|
connect(buttonBox->button(QDialogButtonBox::Close), &QPushButton::clicked, this, &SmartDialog::close);
|
||||||
}
|
}
|
||||||
|
|
||||||
QString SmartDialog::toHtml() const
|
QString SmartDialog::toHtml() const
|
||||||
|
|
|
@ -38,17 +38,15 @@ class QDialogButtonBox;
|
||||||
*/
|
*/
|
||||||
class SmartDialog : public QDialog
|
class SmartDialog : public QDialog
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
|
||||||
Q_DISABLE_COPY(SmartDialog)
|
Q_DISABLE_COPY(SmartDialog)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
SmartDialog(QWidget* parent, Device& d);
|
SmartDialog(QWidget* parent, Device& d);
|
||||||
~SmartDialog();
|
~SmartDialog();
|
||||||
|
|
||||||
protected Q_SLOTS:
|
protected:
|
||||||
void saveSmartReport();
|
void saveSmartReport();
|
||||||
|
|
||||||
protected:
|
|
||||||
void setupDialog();
|
void setupDialog();
|
||||||
void setupConnections();
|
void setupConnections();
|
||||||
|
|
||||||
|
|
|
@ -122,7 +122,7 @@ void SmartDialogWidget::saveConfig() const
|
||||||
|
|
||||||
void SmartDialogWidget::setupConnections()
|
void SmartDialogWidget::setupConnections()
|
||||||
{
|
{
|
||||||
connect(treeSmartAttributes().header(), SIGNAL(customContextMenuRequested(const QPoint&)), SLOT(onHeaderContextMenu(const QPoint&)));
|
connect(treeSmartAttributes().header(), &QHeaderView::customContextMenuRequested, this, &SmartDialogWidget::onHeaderContextMenu);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SmartDialogWidget::onHeaderContextMenu(const QPoint& p)
|
void SmartDialogWidget::onHeaderContextMenu(const QPoint& p)
|
||||||
|
|
|
@ -29,8 +29,6 @@ class QPoint;
|
||||||
*/
|
*/
|
||||||
class SmartDialogWidget : public QWidget, public Ui::SmartDialogWidgetBase
|
class SmartDialogWidget : public QWidget, public Ui::SmartDialogWidgetBase
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
SmartDialogWidget(QWidget* parent);
|
SmartDialogWidget(QWidget* parent);
|
||||||
~SmartDialogWidget();
|
~SmartDialogWidget();
|
||||||
|
@ -95,8 +93,6 @@ protected:
|
||||||
void setupConnections();
|
void setupConnections();
|
||||||
void loadConfig();
|
void loadConfig();
|
||||||
void saveConfig() const;
|
void saveConfig() const;
|
||||||
|
|
||||||
protected Q_SLOTS:
|
|
||||||
void onHeaderContextMenu(const QPoint& p);
|
void onHeaderContextMenu(const QPoint& p);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
@ -51,7 +51,7 @@ TreeLog::TreeLog(QWidget* parent) :
|
||||||
setupUi(this);
|
setupUi(this);
|
||||||
|
|
||||||
treeLog().header()->setContextMenuPolicy(Qt::CustomContextMenu);
|
treeLog().header()->setContextMenuPolicy(Qt::CustomContextMenu);
|
||||||
connect(treeLog().header(), SIGNAL(customContextMenuRequested(const QPoint&)), SLOT(onHeaderContextMenu(const QPoint&)));
|
connect(treeLog().header(), &QHeaderView::customContextMenuRequested, this, &TreeLog::onHeaderContextMenu);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -44,15 +44,16 @@ Q_SIGNALS:
|
||||||
|
|
||||||
public:
|
public:
|
||||||
void init();
|
void init();
|
||||||
|
void onNewLogMessage(Log::Level logLevel, const QString& s);
|
||||||
|
|
||||||
protected Q_SLOTS:
|
protected Q_SLOTS:
|
||||||
void onNewLogMessage(Log::Level logLevel, const QString& s);
|
|
||||||
void onHeaderContextMenu(const QPoint& pos);
|
|
||||||
void onClearLog();
|
void onClearLog();
|
||||||
void onSaveLog();
|
void onSaveLog();
|
||||||
void on_m_TreeLog_customContextMenuRequested(const QPoint& pos);
|
void on_m_TreeLog_customContextMenuRequested(const QPoint& pos);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
void onHeaderContextMenu(const QPoint& pos);
|
||||||
|
|
||||||
QTreeWidget& treeLog() {
|
QTreeWidget& treeLog() {
|
||||||
Q_ASSERT(m_TreeLog);
|
Q_ASSERT(m_TreeLog);
|
||||||
return *m_TreeLog;
|
return *m_TreeLog;
|
||||||
|
|
Loading…
Reference in New Issue