diff options
author | Berthold Stoeger <bstoeger@mail.tuwien.ac.at> | 2019-02-23 18:31:02 +0100 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2019-04-12 18:19:07 +0300 |
commit | 9ed5cf16a4a0f982f0fae170740ee2886f634a14 (patch) | |
tree | 4b2852b5ea4f915346fe7afcbbdd50e9d679f60d /desktop-widgets | |
parent | 73a230b6e652f4bba1bf08cb21fec112a968ff0d (diff) | |
download | subsurface-9ed5cf16a4a0f982f0fae170740ee2886f634a14.tar.gz |
Coding style: remove Java-style function definition
Remove a few cases of
void fun() {
...
}
While touching these functions, fix a few other whitespace
coding style violations.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'desktop-widgets')
-rw-r--r-- | desktop-widgets/divelogimportdialog.cpp | 3 | ||||
-rw-r--r-- | desktop-widgets/filterwidget2.cpp | 6 | ||||
-rw-r--r-- | desktop-widgets/mainwindow.cpp | 12 | ||||
-rw-r--r-- | desktop-widgets/tab-widgets/maintab.cpp | 6 | ||||
-rw-r--r-- | desktop-widgets/usermanual.cpp | 7 |
5 files changed, 21 insertions, 13 deletions
diff --git a/desktop-widgets/divelogimportdialog.cpp b/desktop-widgets/divelogimportdialog.cpp index a6242ec8d..7675e94c2 100644 --- a/desktop-widgets/divelogimportdialog.cpp +++ b/desktop-widgets/divelogimportdialog.cpp @@ -242,7 +242,8 @@ ColumnNameResult::ColumnNameResult(QObject *parent) : QAbstractTableModel(parent } -void ColumnNameResult::swapValues(int firstIndex, int secondIndex) { +void ColumnNameResult::swapValues(int firstIndex, int secondIndex) +{ QString one = columnNames[firstIndex]; QString two = columnNames[secondIndex]; setData(index(0, firstIndex), QVariant(two), Qt::EditRole); diff --git a/desktop-widgets/filterwidget2.cpp b/desktop-widgets/filterwidget2.cpp index f106c354e..d95311da3 100644 --- a/desktop-widgets/filterwidget2.cpp +++ b/desktop-widgets/filterwidget2.cpp @@ -213,13 +213,15 @@ void FilterWidget2::updateFilter() filterDataChanged(filterData); } -void FilterWidget2::updateLogged(int value) { +void FilterWidget2::updateLogged(int value) +{ if (value == Qt::Unchecked) ui.planned->setChecked(true); updateFilter(); } -void FilterWidget2::updatePlanned(int value) { +void FilterWidget2::updatePlanned(int value) +{ if (value == Qt::Unchecked) ui.logged->setChecked(true); updateFilter(); diff --git a/desktop-widgets/mainwindow.cpp b/desktop-widgets/mainwindow.cpp index 95b714d00..2a198110e 100644 --- a/desktop-widgets/mainwindow.cpp +++ b/desktop-widgets/mainwindow.cpp @@ -403,11 +403,11 @@ void MainWindow::enableDisableOtherDCsActions() ui.actionPreviousDC->setEnabled(nr); } -void MainWindow::setDefaultState() { +void MainWindow::setDefaultState() +{ setApplicationState("Default"); - if (mainTab->getEditMode() != MainTab::NONE) { + if (mainTab->getEditMode() != MainTab::NONE) ui.bottomLeft->currentWidget()->setEnabled(false); - } } MainWindow *MainWindow::instance() @@ -437,7 +437,8 @@ void MainWindow::recreateDiveList() MultiFilterSortModel::instance()->myInvalidate(); } -void MainWindow::configureToolbar() { +void MainWindow::configureToolbar() +{ if (current_dive) { bool freeDiveMode = current_dive->dc.divemode == FREEDIVE; ui.profCalcCeiling->setDisabled(freeDiveMode); @@ -1839,7 +1840,8 @@ void MainWindow::registerApplicationState(const QByteArray& state, QWidget *topL } } -void MainWindow::setApplicationState(const QByteArray& state) { +void MainWindow::setApplicationState(const QByteArray &state) +{ if (!applicationState.keys().contains(state)) return; diff --git a/desktop-widgets/tab-widgets/maintab.cpp b/desktop-widgets/tab-widgets/maintab.cpp index 8b23eb147..fe4f6186a 100644 --- a/desktop-widgets/tab-widgets/maintab.cpp +++ b/desktop-widgets/tab-widgets/maintab.cpp @@ -1195,9 +1195,9 @@ void MainTab::escDetected() setFocus(); } -void MainTab::clearTabs() { - for (auto widget : extraWidgets) { +void MainTab::clearTabs() +{ + for (auto widget: extraWidgets) widget->clear(); - } clearEquipment(); } diff --git a/desktop-widgets/usermanual.cpp b/desktop-widgets/usermanual.cpp index 66262e2ac..69e86864b 100644 --- a/desktop-widgets/usermanual.cpp +++ b/desktop-widgets/usermanual.cpp @@ -128,7 +128,8 @@ void UserManual::linkClickedSlot(const QUrl& url) } #ifdef Q_OS_MAC -void UserManual::showEvent(QShowEvent *e) { +void UserManual::showEvent(QShowEvent *e) +{ MainWindow *m = MainWindow::instance(); filterAction = m->findChild<QAction *>(QLatin1String("actionFilterTags"), Qt::FindDirectChildrenOnly); if (filterAction != nullptr) @@ -137,7 +138,9 @@ void UserManual::showEvent(QShowEvent *e) { if (closeAction != nullptr) closeAction->setShortcut(QKeySequence()); } -void UserManual::hideEvent(QHideEvent *e) { + +void UserManual::hideEvent(QHideEvent *e) +{ if (closeAction != NULL) closeAction->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_W)); if (filterAction != NULL) |