From 7ad60636538438b724251cff3641f3be60ccdb9c Mon Sep 17 00:00:00 2001 From: Martin Kleusberg Date: Mon, 27 Dec 2021 14:54:00 +0100 Subject: [PATCH] Fix clazy-connect-by-name warnings --- src/AddRecordDialog.cpp | 2 +- src/AddRecordDialog.h | 2 +- src/AddRecordDialog.ui | 4 +- src/CondFormatManager.cpp | 2 +- src/CondFormatManager.h | 2 +- src/CondFormatManager.ui | 31 ++++-------- src/MainWindow.cpp | 12 ++--- src/MainWindow.h | 12 ++--- src/MainWindow.ui | 102 ++++++++++++++++++++++++++++++++++++++ src/PlotDock.cpp | 11 ++-- src/PlotDock.h | 10 ++-- src/PlotDock.ui | 85 +++++++++++++++++++++++++++++++ src/PreferencesDialog.cpp | 4 +- src/PreferencesDialog.h | 4 +- src/PreferencesDialog.ui | 20 +++++++- src/TableBrowser.cpp | 11 ++-- src/TableBrowser.h | 5 +- src/TableBrowser.ui | 51 +++++++++++++++++++ 18 files changed, 303 insertions(+), 67 deletions(-) diff --git a/src/AddRecordDialog.cpp b/src/AddRecordDialog.cpp index 2e4ebe2d..4dbf8743 100644 --- a/src/AddRecordDialog.cpp +++ b/src/AddRecordDialog.cpp @@ -351,7 +351,7 @@ void AddRecordDialog::help() QWhatsThis::enterWhatsThisMode(); } -void AddRecordDialog::on_buttonBox_clicked(QAbstractButton* button) +void AddRecordDialog::buttonBoxClicked(QAbstractButton* button) { if (button == ui->buttonBox->button(QDialogButtonBox::Cancel)) reject(); diff --git a/src/AddRecordDialog.h b/src/AddRecordDialog.h index cc9767b4..6256f9a4 100644 --- a/src/AddRecordDialog.h +++ b/src/AddRecordDialog.h @@ -40,7 +40,7 @@ private slots: void accept() override; void itemChanged(QTreeWidgetItem* item, int column); void help(); - void on_buttonBox_clicked(QAbstractButton* button); + void buttonBoxClicked(QAbstractButton* button); private: Ui::AddRecordDialog* ui; diff --git a/src/AddRecordDialog.ui b/src/AddRecordDialog.ui index 74d1fe90..fcdf50e8 100644 --- a/src/AddRecordDialog.ui +++ b/src/AddRecordDialog.ui @@ -139,7 +139,7 @@ buttonBox clicked(QAbstractButton*) AddRecordDialog - on_buttonBox_clicked(QAbstractButton*) + buttonBoxClicked(QAbstractButton*) 324 @@ -153,6 +153,6 @@ - itemChanged() + buttonBoxClicked(QAbstractButton*) diff --git a/src/CondFormatManager.cpp b/src/CondFormatManager.cpp index 3f568d69..e8aec5ec 100644 --- a/src/CondFormatManager.cpp +++ b/src/CondFormatManager.cpp @@ -236,7 +236,7 @@ void CondFormatManager::itemClicked(QTreeWidgetItem* item, int column) } } -void CondFormatManager::on_buttonBox_clicked(QAbstractButton* button) +void CondFormatManager::buttonBoxClicked(QAbstractButton* button) { if (button == ui->buttonBox->button(QDialogButtonBox::Cancel)) reject(); diff --git a/src/CondFormatManager.h b/src/CondFormatManager.h index bf0e284d..8cfd6228 100644 --- a/src/CondFormatManager.h +++ b/src/CondFormatManager.h @@ -47,7 +47,7 @@ private slots: void moveItem(int offset); void upItem(); void downItem(); - void on_buttonBox_clicked(QAbstractButton* button); + void buttonBoxClicked(QAbstractButton* button); public slots: void itemClicked(QTreeWidgetItem* item, int column); diff --git a/src/CondFormatManager.ui b/src/CondFormatManager.ui index aeec94f5..57a3130b 100644 --- a/src/CondFormatManager.ui +++ b/src/CondFormatManager.ui @@ -245,35 +245,22 @@ buttonBox - accepted() + clicked(QAbstractButton*) CondFormatManager - accept() + buttonBoxClicked(QAbstractButton*) - 248 - 254 + 374 + 377 - 157 - 274 - - - - - buttonBox - rejected() - CondFormatManager - reject() - - - 316 - 260 - - - 286 - 274 + 374 + 199 + + buttonBoxClicked(QAbstractButton*) + diff --git a/src/MainWindow.cpp b/src/MainWindow.cpp index 8c0612be..0c5efba4 100644 --- a/src/MainWindow.cpp +++ b/src/MainWindow.cpp @@ -2419,13 +2419,13 @@ void MainWindow::checkNewVersion(const QString& versionstring, const QString& ur } } -void MainWindow::on_actionWiki_triggered() const +void MainWindow::openLinkWiki() const { QDesktopServices::openUrl(QUrl("https://github.com/sqlitebrowser/sqlitebrowser/wiki")); } // 'Help | Bug Report...' link will set an appropriate body, add the system information and set the label 'bug' automatically to the issue -void MainWindow::on_actionBug_report_triggered() const +void MainWindow::openLinkBugReport() const { const QString version = Application::versionString(); const QString os = QSysInfo::prettyProductName(); @@ -2464,7 +2464,7 @@ void MainWindow::on_actionBug_report_triggered() const } // 'Help | Feature Request...' link will set an appropriate body and add the label 'enhancement' automatically to the issue -void MainWindow::on_actionFeature_Request_triggered() const +void MainWindow::openLinkFeatureRequest() const { QUrlQuery query; @@ -2478,17 +2478,17 @@ void MainWindow::on_actionFeature_Request_triggered() const QDesktopServices::openUrl(url); } -void MainWindow::on_actionSqlCipherFaq_triggered() const +void MainWindow::openLinkSqlCipherFaq() const { QDesktopServices::openUrl(QUrl("https://discuss.zetetic.net/c/sqlcipher/sqlcipher-faq")); } -void MainWindow::on_actionWebsite_triggered() const +void MainWindow::openLinkWebsite() const { QDesktopServices::openUrl(QUrl("https://sqlitebrowser.org")); } -void MainWindow::on_actionDonatePatreon_triggered() const +void MainWindow::openLinkDonatePatreon() const { QDesktopServices::openUrl(QUrl("https://www.patreon.com/bePatron?u=11578749")); } diff --git a/src/MainWindow.h b/src/MainWindow.h index 94ec0ba3..8e176804 100644 --- a/src/MainWindow.h +++ b/src/MainWindow.h @@ -202,12 +202,12 @@ private slots: void saveSqlResultsAsView(); void loadExtension(); void checkNewVersion(const QString& versionstring, const QString& url); - void on_actionWiki_triggered() const; - void on_actionBug_report_triggered() const; - void on_actionFeature_Request_triggered() const; - void on_actionSqlCipherFaq_triggered() const; - void on_actionWebsite_triggered() const; - void on_actionDonatePatreon_triggered() const; + void openLinkWiki() const; + void openLinkBugReport() const; + void openLinkFeatureRequest() const; + void openLinkSqlCipherFaq() const; + void openLinkWebsite() const; + void openLinkDonatePatreon() const; bool loadProject(QString filename = QString(), bool readOnly = false); void saveProject(); void saveProjectAs(); diff --git a/src/MainWindow.ui b/src/MainWindow.ui index b478b288..966efa2e 100644 --- a/src/MainWindow.ui +++ b/src/MainWindow.ui @@ -3750,6 +3750,102 @@ You can drag SQL statements from the Schema column and drop them into the SQL ed + + actionWiki + triggered() + MainWindow + openLinkWiki() + + + -1 + -1 + + + -1 + -1 + + + + + actionBug_report + triggered() + MainWindow + openLinkBugReport() + + + -1 + -1 + + + -1 + -1 + + + + + actionFeature_Request + triggered() + MainWindow + openLinkFeatureRequest() + + + -1 + -1 + + + -1 + -1 + + + + + actionSqlCipherFaq + triggered() + MainWindow + openLinkSqlCipherFaq() + + + -1 + -1 + + + -1 + -1 + + + + + actionWebsite + triggered() + MainWindow + openLinkWebsite() + + + -1 + -1 + + + -1 + -1 + + + + + actionDonatePatreon + triggered() + MainWindow + openLinkDonatePatreon() + + + -1 + -1 + + + -1 + -1 + + + fileOpen() @@ -3812,5 +3908,11 @@ You can drag SQL statements from the Schema column and drop them into the SQL ed renameTableBrowserTab(int) showContextMenuTableBrowserTabBar(QPoint) newRowCountsTab() + openLinkWiki() + openLinkBugReport() + openLinkFeatureRequest() + openLinkSqlCipherFaq() + openLinkWebsite() + openLinkDonatePatreon() diff --git a/src/PlotDock.cpp b/src/PlotDock.cpp index 901a4375..0c40f9df 100644 --- a/src/PlotDock.cpp +++ b/src/PlotDock.cpp @@ -48,7 +48,6 @@ PlotDock::PlotDock(QWidget* parent) ui->comboPointShape->setCurrentIndex(Settings::getValue("PlotDock", "pointShape").toInt()); // Connect signals - connect(ui->treePlotColumns, &QTreeWidget::itemChanged, this, &PlotDock::on_treePlotColumns_itemChanged); connect(ui->plotWidget, &QCustomPlot::selectionChangedByUser, this, &PlotDock::selectionChanged); // connect slots that takes care that when an axis is selected, only that direction can be dragged and zoomed: @@ -573,7 +572,7 @@ void PlotDock::resetPlot() updatePlot(nullptr); } -void PlotDock::on_treePlotColumns_itemChanged(QTreeWidgetItem* changeitem, int column) +void PlotDock::columnItemChanged(QTreeWidgetItem* changeitem, int column) { // disable change updates, or we get unwanted redrawing and weird behavior ui->treePlotColumns->blockSignals(true); @@ -639,7 +638,7 @@ void PlotDock::on_treePlotColumns_itemChanged(QTreeWidgetItem* changeitem, int c updatePlot(m_currentPlotModel, m_currentTableSettings, false); } -void PlotDock::on_treePlotColumns_itemDoubleClicked(QTreeWidgetItem* item, int column) +void PlotDock::columnItemDoubleClicked(QTreeWidgetItem* item, int column) { // disable change updates, or we get unwanted redrawing and weird behavior ui->treePlotColumns->blockSignals(true); @@ -684,7 +683,7 @@ void PlotDock::on_treePlotColumns_itemDoubleClicked(QTreeWidgetItem* item, int c updatePlot(m_currentPlotModel, m_currentTableSettings, false); } -void PlotDock::on_butSavePlot_clicked() +void PlotDock::savePlot() { QString fileName = FileDialog::getSaveFileName( CreateDataFile, @@ -717,7 +716,7 @@ void PlotDock::on_butSavePlot_clicked() } } -void PlotDock::on_comboLineType_currentIndexChanged(int index) +void PlotDock::lineTypeChanged(int index) { Q_ASSERT(index >= QCPGraph::lsNone && index <= QCPGraph::lsImpulse); @@ -760,7 +759,7 @@ void PlotDock::on_comboLineType_currentIndexChanged(int index) } } -void PlotDock::on_comboPointShape_currentIndexChanged(int index) +void PlotDock::pointShapeChanged(int index) { // WARN: because ssDot point shape is removed if (index > 0) index += 1; diff --git a/src/PlotDock.h b/src/PlotDock.h index 85cc88ef..9a9f5a53 100644 --- a/src/PlotDock.h +++ b/src/PlotDock.h @@ -112,11 +112,11 @@ private: void adjustAxisFormat(); private slots: - void on_treePlotColumns_itemChanged(QTreeWidgetItem* item, int column); - void on_treePlotColumns_itemDoubleClicked(QTreeWidgetItem* item, int column); - void on_butSavePlot_clicked(); - void on_comboLineType_currentIndexChanged(int index); - void on_comboPointShape_currentIndexChanged(int index); + void columnItemChanged(QTreeWidgetItem* item, int column); + void columnItemDoubleClicked(QTreeWidgetItem* item, int column); + void savePlot(); + void lineTypeChanged(int index); + void pointShapeChanged(int index); void selectionChanged(); void mousePress(); void mouseWheel(); diff --git a/src/PlotDock.ui b/src/PlotDock.ui index a99cbf31..9e26602e 100644 --- a/src/PlotDock.ui +++ b/src/PlotDock.ui @@ -366,8 +366,93 @@ Select the axes or axes labels to drag and zoom only in that orientation. + + treePlotColumns + itemChanged(QTreeWidgetItem*,int) + PlotDock + columnItemChanged(QTreeWidgetItem*,int) + + + -1 + -1 + + + -1 + -1 + + + + + treePlotColumns + itemDoubleClicked(QTreeWidgetItem*,int) + PlotDock + columnItemDoubleClicked(QTreeWidgetItem*,int) + + + -1 + -1 + + + -1 + -1 + + + + + butSavePlot + clicked() + PlotDock + savePlot() + + + -1 + -1 + + + -1 + -1 + + + + + comboLineType + currentIndexChanged(int) + PlotDock + lineTypeChanged(int) + + + -1 + -1 + + + -1 + -1 + + + + + comboPointShape + currentIndexChanged(int) + PlotDock + pointShapeChanged(int) + + + -1 + -1 + + + -1 + -1 + + + fetchAllData() + columnItemChanged(QTreeWidgetItem*,int) + columnItemDoubleClicked(QTreeWidgetItem*,int) + savePlot() + lineTypeChanged(int) + pointShapeChanged(int) diff --git a/src/PreferencesDialog.cpp b/src/PreferencesDialog.cpp index 22520c5e..f17a0a35 100644 --- a/src/PreferencesDialog.cpp +++ b/src/PreferencesDialog.cpp @@ -672,7 +672,7 @@ void PreferencesDialog::updatePreviewFont() } } -void PreferencesDialog::on_buttonManageFileExtension_clicked() +void PreferencesDialog::showFileExtensionManager() { FileExtensionManager *manager = new FileExtensionManager(m_dbFileExtensions, this); @@ -682,7 +682,7 @@ void PreferencesDialog::on_buttonManageFileExtension_clicked() } } -void PreferencesDialog::on_buttonBox_clicked(QAbstractButton* button) +void PreferencesDialog::buttonBoxClicked(QAbstractButton* button) { if (button == ui->buttonBox->button(QDialogButtonBox::Cancel)) reject(); diff --git a/src/PreferencesDialog.h b/src/PreferencesDialog.h index c09bf1ff..45c0001b 100644 --- a/src/PreferencesDialog.h +++ b/src/PreferencesDialog.h @@ -48,8 +48,8 @@ private slots: void adjustColorsToStyle(int style); void configureProxy(); - void on_buttonManageFileExtension_clicked(); - void on_buttonBox_clicked(QAbstractButton* button); + void showFileExtensionManager(); + void buttonBoxClicked(QAbstractButton* button); private: Ui::PreferencesDialog* ui; diff --git a/src/PreferencesDialog.ui b/src/PreferencesDialog.ui index 124df7ff..304aa17a 100644 --- a/src/PreferencesDialog.ui +++ b/src/PreferencesDialog.ui @@ -2233,7 +2233,7 @@ Can be set to 0 for disabling completion. buttonBox clicked(QAbstractButton*) PreferencesDialog - on_buttonBox_clicked(QAbstractButton*) + buttonBoxClicked(QAbstractButton*) 394 @@ -2261,6 +2261,22 @@ Can be set to 0 for disabling completion. + + buttonManageFileExtension + clicked() + PreferencesDialog + showFileExtensionManager() + + + -1 + -1 + + + -1 + -1 + + + saveSettings() @@ -2273,5 +2289,7 @@ Can be set to 0 for disabling completion. removeClientCertificate() chooseRemoteCloneDirectory() configureProxy() + buttonBoxClicked() + showFileExtensionManager() diff --git a/src/TableBrowser.cpp b/src/TableBrowser.cpp index 6ea359ea..84b69be8 100644 --- a/src/TableBrowser.cpp +++ b/src/TableBrowser.cpp @@ -823,7 +823,7 @@ void TableBrowser::applyViewportSettings(const BrowseDataTableSettings& storedDa unlockViewEditing(!storedData.unlockViewPk.isEmpty() && storedData.unlockViewPk != "_rowid_", storedData.unlockViewPk); // Column hidden status - on_actionShowAllColumns_triggered(); + showAllColumns(); for(auto hiddenIt=storedData.hiddenColumns.cbegin();hiddenIt!=storedData.hiddenColumns.cend();++hiddenIt) hideColumns(hiddenIt->first, hiddenIt->second); @@ -1064,7 +1064,7 @@ void TableBrowser::hideColumns(int column, bool hide) emit projectModified(); } -void TableBrowser::on_actionShowAllColumns_triggered() +void TableBrowser::showAllColumns() { for(int col = 1; col < ui->dataTable->model()->columnCount(); col++) { @@ -1377,12 +1377,7 @@ void TableBrowser::selectTableLine(int lineToSelect) ui->dataTable->selectTableLine(lineToSelect); } -void TableBrowser::on_actionClearFilters_triggered() -{ - clearFilters(); -} - -void TableBrowser::on_actionClearSorting_triggered() +void TableBrowser::clearSorting() { // Get the current list of sort columns auto& columns = m_settings[currentlyBrowsedTableName()].sortColumns; diff --git a/src/TableBrowser.h b/src/TableBrowser.h index 74293dda..d2ff9bad 100644 --- a/src/TableBrowser.h +++ b/src/TableBrowser.h @@ -111,7 +111,7 @@ private slots: void freezeColumns(size_t columns); void unlockViewEditing(bool unlock, QString pk = QString()); void hideColumns(int column = -1, bool hide = true); - void on_actionShowAllColumns_triggered(); + void showAllColumns(); void updateInsertDeleteRecordButton(); void duplicateRecord(int currentRow); void headerClicked(int logicalindex); @@ -127,8 +127,7 @@ private slots: void navigateEnd(); void navigateGoto(); void selectTableLine(int lineToSelect); - void on_actionClearFilters_triggered(); - void on_actionClearSorting_triggered(); + void clearSorting(); void editDisplayFormat(); void exportCsvFilteredTable(); void exportJsonFilteredTable(); diff --git a/src/TableBrowser.ui b/src/TableBrowser.ui index 4d736926..0340e159 100644 --- a/src/TableBrowser.ui +++ b/src/TableBrowser.ui @@ -1446,6 +1446,54 @@ + + actionClearFilters + triggered() + TableBrowser + clearFilters() + + + -1 + -1 + + + -1 + -1 + + + + + actionClearSorting + triggered() + TableBrowser + clearSorting() + + + -1 + -1 + + + -1 + -1 + + + + + actionShowAllColumns + triggered() + TableBrowser + showAllColumns() + + + -1 + -1 + + + -1 + -1 + + + refresh() @@ -1467,5 +1515,8 @@ setDefaultTableEncoding() hideColumns() setTableEncoding() + clearFilters() + clearSorting() + showAllColumns()