diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2018-07-25 18:40:19 -0700 |
---|---|---|
committer | Lubomir I. Ivanov <neolit123@gmail.com> | 2018-07-26 16:32:51 +0300 |
commit | 0e6c3db24c77331f52d17fd22494565dbafc6f84 (patch) | |
tree | f59cf5c3d29d108972919a9ee12b7c47ab77d45e /desktop-widgets | |
parent | 00c0f94d8c8623aa97f3f5c44a79bd8e53c8fd94 (diff) | |
download | subsurface-0e6c3db24c77331f52d17fd22494565dbafc6f84.tar.gz |
Whitespace cleanup desktop-widget
Not entirely script based because of the broken 'else if'.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'desktop-widgets')
-rw-r--r-- | desktop-widgets/configuredivecomputerdialog.cpp | 17 | ||||
-rw-r--r-- | desktop-widgets/downloadfromdivecomputer.cpp | 30 |
2 files changed, 24 insertions, 23 deletions
diff --git a/desktop-widgets/configuredivecomputerdialog.cpp b/desktop-widgets/configuredivecomputerdialog.cpp index 9074d29e6..137859388 100644 --- a/desktop-widgets/configuredivecomputerdialog.cpp +++ b/desktop-widgets/configuredivecomputerdialog.cpp @@ -1,18 +1,18 @@ // SPDX-License-Identifier: GPL-2.0 #include "desktop-widgets/configuredivecomputerdialog.h" -#include "core/qthelper.h" -#include "desktop-widgets/mainwindow.h" #include "core/display.h" +#include "core/qthelper.h" #include "core/subsurface-qt/SettingsObjectWrapper.h" +#include "desktop-widgets/mainwindow.h" // For fill_computer_list, descriptorLookup #include "core/downloadfromdcthread.h" #include <QFileDialog> #include <QMessageBox> -#include <QSettings> #include <QNetworkReply> #include <QProgressDialog> +#include <QSettings> GasSpinBoxItemDelegate::GasSpinBoxItemDelegate(QObject *parent, column_type type) : QStyledItemDelegate(parent), type(type) { @@ -21,7 +21,7 @@ GasSpinBoxItemDelegate::~GasSpinBoxItemDelegate() { } -QWidget *GasSpinBoxItemDelegate::createEditor(QWidget *parent, const QStyleOptionViewItem&, const QModelIndex&) const +QWidget *GasSpinBoxItemDelegate::createEditor(QWidget *parent, const QStyleOptionViewItem &, const QModelIndex &) const { // Create the spinbox and give it it's settings QSpinBox *sb = new QSpinBox(parent); @@ -65,7 +65,7 @@ GasTypeComboBoxItemDelegate::~GasTypeComboBoxItemDelegate() { } -QWidget *GasTypeComboBoxItemDelegate::createEditor(QWidget *parent, const QStyleOptionViewItem&, const QModelIndex&) const +QWidget *GasTypeComboBoxItemDelegate::createEditor(QWidget *parent, const QStyleOptionViewItem &, const QModelIndex &) const { // Create the combobox and populate it QComboBox *cb = new QComboBox(parent); @@ -287,7 +287,7 @@ void OstcFirmwareCheck::checkLatest(QWidget *_parent, device_data_t *data) Y = (firmwareOnDevice & 0x07C0) >> 6; Z = (firmwareOnDevice & 0x003E) >> 1; beta = firmwareOnDevice & 0x0001; - firmwareOnDeviceString = QString("%1.%2.%3%4").arg(X).arg(Y).arg(Z).arg(beta?" beta":""); + firmwareOnDeviceString = QString("%1.%2.%3%4").arg(X).arg(Y).arg(Z).arg(beta ? " beta" : ""); latestFirmwareAvailableNumber = (fwParts[0].toInt() << 11) + (fwParts[1].toInt() << 6) + (fwParts[2].toInt() << 1); } else { // OSTC 3, Sport, Cr firmwareOnDeviceString = QString("%1.%2").arg(firmwareOnDevice / 256).arg(firmwareOnDevice % 256); @@ -358,7 +358,7 @@ ConfigureDiveComputerDialog::~ConfigureDiveComputerDialog() delete config; } -void ConfigureDiveComputerDialog::closeEvent(QCloseEvent*) +void ConfigureDiveComputerDialog::closeEvent(QCloseEvent *) { dc_close(); @@ -900,7 +900,8 @@ void ConfigureDiveComputerDialog::getDeviceData() { #ifdef BT_SUPPORT QString device = ui.bluetoothMode && btDeviceSelectionDialog ? - btDeviceSelectionDialog->getSelectedDeviceAddress() : ui.device->currentText(); + btDeviceSelectionDialog->getSelectedDeviceAddress() : + ui.device->currentText(); #else QString device = ui.device->currentText(); #endif diff --git a/desktop-widgets/downloadfromdivecomputer.cpp b/desktop-widgets/downloadfromdivecomputer.cpp index 1daf26d7b..4b5a0c917 100644 --- a/desktop-widgets/downloadfromdivecomputer.cpp +++ b/desktop-widgets/downloadfromdivecomputer.cpp @@ -1,19 +1,19 @@ // SPDX-License-Identifier: GPL-2.0 #include "desktop-widgets/downloadfromdivecomputer.h" -#include "core/qthelper.h" -#include "desktop-widgets/mainwindow.h" -#include "desktop-widgets/divelistview.h" #include "core/display.h" +#include "core/qthelper.h" +#include "core/subsurface-qt/SettingsObjectWrapper.h" #include "core/subsurface-string.h" #include "core/uemis.h" -#include "core/subsurface-qt/SettingsObjectWrapper.h" -#include "qt-models/models.h" +#include "desktop-widgets/divelistview.h" +#include "desktop-widgets/mainwindow.h" #include "qt-models/diveimportedmodel.h" +#include "qt-models/models.h" -#include <QTimer> #include <QFileDialog> #include <QMessageBox> #include <QShortcut> +#include <QTimer> DownloadFromDCWidget::DownloadFromDCWidget(QWidget *parent, Qt::WindowFlags f) : QDialog(parent, f), downloading(false), @@ -122,8 +122,8 @@ void DownloadFromDCWidget::updateProgressBar() if (IS_FP_SAME(progress_bar_fraction, 0.0)) { ui.progressBar->setFormat(tr("Connecting to dive computer")); #if defined(Q_OS_MAC) - // on mac the progress bar doesn't show its text - ui.progressText->setText(tr("Connecting to dive computer")); + // on mac the progress bar doesn't show its text + ui.progressText->setText(tr("Connecting to dive computer")); #endif } else { ui.progressBar->setFormat("%p%"); @@ -241,7 +241,7 @@ void DownloadFromDCWidget::on_vendor_currentIndexChanged(const QString &vendor) fill_device_list(dcType); } -void DownloadFromDCWidget::on_product_currentIndexChanged(const QString&) +void DownloadFromDCWidget::on_product_currentIndexChanged(const QString &) { updateDeviceEnabled(); } @@ -334,7 +334,8 @@ void DownloadFromDCWidget::on_downloadCancelRetryButton_clicked() // // We shouldn't do this for memory dumps. if ((product == "OSTC 3" || product == "OSTC 3+" || product == "OSTC cR" || - product == "OSTC Sport" || product == "OSTC 4") && !data->saveDump()) { + product == "OSTC Sport" || product == "OSTC 4") && + !data->saveDump()) { ostcFirmwareCheck = new OstcFirmwareCheck(product); } } @@ -359,7 +360,7 @@ void DownloadFromDCWidget::pickLogFile() QFileInfo fi(filename); filename = fi.absolutePath().append(QDir::separator()).append("subsurface.log"); QString logFile = QFileDialog::getSaveFileName(this, tr("Choose file for dive computer download logfile"), - filename, tr("Log files") + " (*.log)"); + filename, tr("Log files") + " (*.log)"); if (!logFile.isEmpty()) { free(logfile_name); logfile_name = copy_qstring(logFile); @@ -385,7 +386,7 @@ void DownloadFromDCWidget::pickDumpFile() QFileInfo fi(filename); filename = fi.absolutePath().append(QDir::separator()).append("subsurface.bin"); QString dumpFile = QFileDialog::getSaveFileName(this, tr("Choose file for dive computer binary dump file"), - filename, tr("Dump files") + " (*.bin)"); + filename, tr("Dump files") + " (*.bin)"); if (!dumpFile.isEmpty()) { free(dumpfile_name); dumpfile_name = copy_qstring(dumpFile); @@ -437,7 +438,7 @@ void DownloadFromDCWidget::on_ok_clicked() // record all the dives in the 'real' dive_table for (int i = 0; i < downloadTable.nr; i++) { - if (diveImportedModel->data(diveImportedModel->index(i, 0),Qt::CheckStateRole) == Qt::Checked) + if (diveImportedModel->data(diveImportedModel->index(i, 0), Qt::CheckStateRole) == Qt::Checked) record_dive(downloadTable.dives[i]); else clear_dive(downloadTable.dives[i]); @@ -546,7 +547,7 @@ void DownloadFromDCWidget::bluetoothSelectionDialogIsFinished(int result) if (result == QDialog::Accepted) { /* Make the selected Bluetooth device default */ ui.device->setEditText(btDeviceSelectionDialog->getSelectedDeviceText()); - } else if (result == QDialog::Rejected){ + } else if (result == QDialog::Rejected) { /* Disable Bluetooth download mode */ ui.bluetoothMode->setChecked(false); } @@ -577,4 +578,3 @@ void DownloadFromDCWidget::fill_device_list(int dc_type) if (deviceIndex >= 0) ui.device->setCurrentIndex(deviceIndex); } - |