diff options
author | jan Iversen <jani@libreoffice.org> | 2018-05-21 18:09:09 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2018-05-21 12:48:04 -0700 |
commit | e536682b84eda7444be1c9b85e0d5942596c6914 (patch) | |
tree | aebfcb65c29609ddc1442281a30c64a55f518d1b | |
parent | e47f6df07662feb15c30a7f4bd0df3d1c23a022b (diff) | |
download | subsurface-e536682b84eda7444be1c9b85e0d5942596c6914.tar.gz |
desktop-widgets: Change Q_UNUSED to no parameter name
C++ permits use of parameters without name, which signals unused
Signed-off-by: Jan Iversen <jani@apache.org>
-rw-r--r-- | desktop-widgets/configuredivecomputerdialog.cpp | 11 | ||||
-rw-r--r-- | desktop-widgets/divelistview.cpp | 3 | ||||
-rw-r--r-- | desktop-widgets/divelogexportdialog.cpp | 3 | ||||
-rw-r--r-- | desktop-widgets/divelogimportdialog.cpp | 29 | ||||
-rw-r--r-- | desktop-widgets/downloadfromdivecomputer.cpp | 3 | ||||
-rw-r--r-- | desktop-widgets/locationinformation.cpp | 27 | ||||
-rw-r--r-- | desktop-widgets/mainwindow.cpp | 4 | ||||
-rw-r--r-- | desktop-widgets/modeldelegates.cpp | 51 | ||||
-rw-r--r-- | desktop-widgets/printdialog.cpp | 3 | ||||
-rw-r--r-- | desktop-widgets/simplewidgets.cpp | 6 | ||||
-rw-r--r-- | desktop-widgets/starwidget.cpp | 3 | ||||
-rw-r--r-- | desktop-widgets/subsurfacewebservices.cpp | 3 |
12 files changed, 43 insertions, 103 deletions
diff --git a/desktop-widgets/configuredivecomputerdialog.cpp b/desktop-widgets/configuredivecomputerdialog.cpp index b0925ddb0..1b11e66de 100644 --- a/desktop-widgets/configuredivecomputerdialog.cpp +++ b/desktop-widgets/configuredivecomputerdialog.cpp @@ -21,10 +21,8 @@ GasSpinBoxItemDelegate::~GasSpinBoxItemDelegate() { } -QWidget *GasSpinBoxItemDelegate::createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const +QWidget *GasSpinBoxItemDelegate::createEditor(QWidget *parent, const QStyleOptionViewItem&, const QModelIndex&) const { - Q_UNUSED(option) - Q_UNUSED(index) // Create the spinbox and give it it's settings QSpinBox *sb = new QSpinBox(parent); if (type == PERCENT) { @@ -67,10 +65,8 @@ GasTypeComboBoxItemDelegate::~GasTypeComboBoxItemDelegate() { } -QWidget *GasTypeComboBoxItemDelegate::createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const +QWidget *GasTypeComboBoxItemDelegate::createEditor(QWidget *parent, const QStyleOptionViewItem&, const QModelIndex&) const { - Q_UNUSED(option) - Q_UNUSED(index) // Create the combobox and populate it QComboBox *cb = new QComboBox(parent); cb->addItem(QString("Disabled")); @@ -362,9 +358,8 @@ ConfigureDiveComputerDialog::~ConfigureDiveComputerDialog() delete config; } -void ConfigureDiveComputerDialog::closeEvent(QCloseEvent *event) +void ConfigureDiveComputerDialog::closeEvent(QCloseEvent*) { - Q_UNUSED(event) dc_close(); QSettings settings; diff --git a/desktop-widgets/divelistview.cpp b/desktop-widgets/divelistview.cpp index 0014c31f2..e45563680 100644 --- a/desktop-widgets/divelistview.cpp +++ b/desktop-widgets/divelistview.cpp @@ -515,9 +515,8 @@ void DiveListView::toggleColumnVisibilityByIndex() setColumnWidth(lastVisibleColumn(), 10); } -void DiveListView::currentChanged(const QModelIndex ¤t, const QModelIndex &previous) +void DiveListView::currentChanged(const QModelIndex ¤t, const QModelIndex&) { - Q_UNUSED(previous) if (!isVisible()) return; if (!current.isValid()) diff --git a/desktop-widgets/divelogexportdialog.cpp b/desktop-widgets/divelogexportdialog.cpp index 078e5d0d1..bf01b0e9f 100644 --- a/desktop-widgets/divelogexportdialog.cpp +++ b/desktop-widgets/divelogexportdialog.cpp @@ -112,9 +112,8 @@ void DiveLogExportDialog::exportHtmlInit(const QString &filename) exportHtmlInitLogic(filename, hes); } -void DiveLogExportDialog::on_exportGroup_buttonClicked(QAbstractButton *button) +void DiveLogExportDialog::on_exportGroup_buttonClicked(QAbstractButton*) { - Q_UNUSED(button) showExplanation(); } diff --git a/desktop-widgets/divelogimportdialog.cpp b/desktop-widgets/divelogimportdialog.cpp index 5633d50a2..edb93b9fd 100644 --- a/desktop-widgets/divelogimportdialog.cpp +++ b/desktop-widgets/divelogimportdialog.cpp @@ -52,20 +52,16 @@ ColumnNameProvider::ColumnNameProvider(QObject *parent) : QAbstractListModel(par tr("Sample setpoint") << tr("Visibility") << tr("Rating"); } -bool ColumnNameProvider::insertRows(int row, int count, const QModelIndex &parent) +bool ColumnNameProvider::insertRows(int row, int, const QModelIndex&) { - Q_UNUSED(count) - Q_UNUSED(parent) beginInsertRows(QModelIndex(), row, row); columnNames.append(QString()); endInsertRows(); return true; } -bool ColumnNameProvider::removeRows(int row, int count, const QModelIndex &parent) +bool ColumnNameProvider::removeRows(int row, int, const QModelIndex&) { - Q_UNUSED(count) - Q_UNUSED(parent) beginRemoveRows(QModelIndex(), row, row); columnNames.removeAt(row); endRemoveRows(); @@ -91,9 +87,8 @@ QVariant ColumnNameProvider::data(const QModelIndex &index, int role) const return QVariant(columnNames[index.row()]); } -int ColumnNameProvider::rowCount(const QModelIndex &parent) const +int ColumnNameProvider::rowCount(const QModelIndex&) const { - Q_UNUSED(parent) return columnNames.count(); } @@ -114,9 +109,8 @@ int ColumnNameProvider::mymatch(QString value) const -ColumnNameView::ColumnNameView(QWidget *parent) +ColumnNameView::ColumnNameView(QWidget*) { - Q_UNUSED(parent) setAcceptDrops(true); setDragEnabled(true); } @@ -145,9 +139,8 @@ void ColumnNameView::mousePressEvent(QMouseEvent *press) } } -void ColumnNameView::dragLeaveEvent(QDragLeaveEvent *leave) +void ColumnNameView::dragLeaveEvent(QDragLeaveEvent*) { - Q_UNUSED(leave); } void ColumnNameView::dragEnterEvent(QDragEnterEvent *event) @@ -176,15 +169,13 @@ void ColumnNameView::dropEvent(QDropEvent *event) } } -ColumnDropCSVView::ColumnDropCSVView(QWidget *parent) +ColumnDropCSVView::ColumnDropCSVView(QWidget*) { - Q_UNUSED(parent) setAcceptDrops(true); } -void ColumnDropCSVView::dragLeaveEvent(QDragLeaveEvent *leave) +void ColumnDropCSVView::dragLeaveEvent(QDragLeaveEvent*) { - Q_UNUSED(leave); } void ColumnDropCSVView::dragEnterEvent(QDragEnterEvent *event) @@ -272,15 +263,13 @@ QVariant ColumnNameResult::data(const QModelIndex &index, int role) const return QVariant(); } -int ColumnNameResult::rowCount(const QModelIndex &parent) const +int ColumnNameResult::rowCount(const QModelIndex&) const { - Q_UNUSED(parent); return columnValues.count() + 1; // +1 == the header. } -int ColumnNameResult::columnCount(const QModelIndex &parent) const +int ColumnNameResult::columnCount(const QModelIndex&) const { - Q_UNUSED(parent); return columnNames.count(); } diff --git a/desktop-widgets/downloadfromdivecomputer.cpp b/desktop-widgets/downloadfromdivecomputer.cpp index 3f5799e13..b2476d77c 100644 --- a/desktop-widgets/downloadfromdivecomputer.cpp +++ b/desktop-widgets/downloadfromdivecomputer.cpp @@ -241,9 +241,8 @@ void DownloadFromDCWidget::on_vendor_currentIndexChanged(const QString &vendor) fill_device_list(dcType); } -void DownloadFromDCWidget::on_product_currentIndexChanged(const QString &product) +void DownloadFromDCWidget::on_product_currentIndexChanged(const QString&) { - Q_UNUSED(product) updateDeviceEnabled(); } diff --git a/desktop-widgets/locationinformation.cpp b/desktop-widgets/locationinformation.cpp index 7cdbeb687..fea0b93de 100644 --- a/desktop-widgets/locationinformation.cpp +++ b/desktop-widgets/locationinformation.cpp @@ -340,16 +340,14 @@ void LocationInformationWidget::updateLocationOnMap() emit coordinatesChanged(); } -DiveLocationFilterProxyModel::DiveLocationFilterProxyModel(QObject *parent) +DiveLocationFilterProxyModel::DiveLocationFilterProxyModel(QObject*) { - Q_UNUSED(parent) } DiveLocationLineEdit *location_line_edit = 0; -bool DiveLocationFilterProxyModel::filterAcceptsRow(int source_row, const QModelIndex &source_parent) const +bool DiveLocationFilterProxyModel::filterAcceptsRow(int source_row, const QModelIndex&) const { - Q_UNUSED(source_parent) if (source_row == 0) return true; @@ -363,9 +361,8 @@ bool DiveLocationFilterProxyModel::lessThan(const QModelIndex &source_left, cons } -DiveLocationModel::DiveLocationModel(QObject *o) +DiveLocationModel::DiveLocationModel(QObject*) { - Q_UNUSED(o) resetModel(); } @@ -424,21 +421,18 @@ QVariant DiveLocationModel::data(const QModelIndex &index, int role) const return QVariant(); } -int DiveLocationModel::columnCount(const QModelIndex &parent) const +int DiveLocationModel::columnCount(const QModelIndex&) const { - Q_UNUSED(parent) return COLUMNS; } -int DiveLocationModel::rowCount(const QModelIndex &parent) const +int DiveLocationModel::rowCount(const QModelIndex&) const { - Q_UNUSED(parent) return dive_site_table.nr + 2; } -bool DiveLocationModel::setData(const QModelIndex &index, const QVariant &value, int role) +bool DiveLocationModel::setData(const QModelIndex &index, const QVariant &value, int) { - Q_UNUSED(role) if (!index.isValid()) return false; if (index.row() > 1) @@ -481,9 +475,8 @@ DiveLocationLineEdit::DiveLocationLineEdit(QWidget *parent) : QLineEdit(parent), connect(view, &DiveLocationListView::currentIndexChanged, this, &DiveLocationLineEdit::currentChanged); } -bool DiveLocationLineEdit::eventFilter(QObject *o, QEvent *e) +bool DiveLocationLineEdit::eventFilter(QObject*, QEvent *e) { - Q_UNUSED(o) if (e->type() == QEvent::KeyPress) { QKeyEvent *keyEv = (QKeyEvent *)e; @@ -565,9 +558,8 @@ static struct dive_site *get_dive_site_name_start_which_str(const QString &str) return NULL; } -void DiveLocationLineEdit::setTemporaryDiveSiteName(const QString &s) +void DiveLocationLineEdit::setTemporaryDiveSiteName(const QString&) { - Q_UNUSED(s) QModelIndex i0 = model->index(0, DiveLocationModel::NAME); QModelIndex i1 = model->index(1, DiveLocationModel::NAME); model->setData(i0, text()); @@ -676,9 +668,8 @@ uint32_t DiveLocationLineEdit::currDiveSiteUuid() const return currUuid; } -DiveLocationListView::DiveLocationListView(QWidget *parent) +DiveLocationListView::DiveLocationListView(QWidget*) { - Q_UNUSED(parent) } void DiveLocationListView::currentChanged(const QModelIndex ¤t, const QModelIndex &previous) diff --git a/desktop-widgets/mainwindow.cpp b/desktop-widgets/mainwindow.cpp index 030b33b70..883b81d23 100644 --- a/desktop-widgets/mainwindow.cpp +++ b/desktop-widgets/mainwindow.cpp @@ -1655,10 +1655,8 @@ void MainWindow::updateRecentFiles() updateRecentFilesMenu(); } -void MainWindow::recentFileTriggered(bool checked) +void MainWindow::recentFileTriggered(bool) { - Q_UNUSED(checked); - if (!okToClose(tr("Please save or cancel the current dive edit before opening a new file."))) return; diff --git a/desktop-widgets/modeldelegates.cpp b/desktop-widgets/modeldelegates.cpp index 6a33e60f4..8258c7d39 100644 --- a/desktop-widgets/modeldelegates.cpp +++ b/desktop-widgets/modeldelegates.cpp @@ -22,10 +22,8 @@ #include <QColor> #include <QAbstractProxyModel> -QSize DiveListDelegate::sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const +QSize DiveListDelegate::sizeHint(const QStyleOptionViewItem&, const QModelIndex&) const { - Q_UNUSED(option) - Q_UNUSED(index) return QSize(50, 22); } @@ -66,10 +64,8 @@ void StarWidgetsDelegate::paint(QPainter *painter, const QStyleOptionViewItem &o painter->restore(); } -QSize StarWidgetsDelegate::sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const +QSize StarWidgetsDelegate::sizeHint(const QStyleOptionViewItem&, const QModelIndex&) const { - Q_UNUSED(option) - Q_UNUSED(index) return minStarSize; } @@ -107,9 +103,8 @@ struct CurrSelected { bool ignoreSelection; } currCombo; -QWidget *ComboBoxDelegate::createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const +QWidget *ComboBoxDelegate::createEditor(QWidget *parent, const QStyleOptionViewItem&, const QModelIndex &index) const { - Q_UNUSED(option) QComboBox *comboDelegate = new QComboBox(parent); comboDelegate->setModel(model); comboDelegate->setEditable(true); @@ -220,9 +215,8 @@ bool ComboBoxDelegate::eventFilter(QObject *object, QEvent *event) return QStyledItemDelegate::eventFilter(object, event); } -void ComboBoxDelegate::updateEditorGeometry(QWidget *editor, const QStyleOptionViewItem &option, const QModelIndex &index) const +void ComboBoxDelegate::updateEditorGeometry(QWidget *editor, const QStyleOptionViewItem &option, const QModelIndex&) const { - Q_UNUSED(index) QRect defaultRect = option.rect; defaultRect.setX(defaultRect.x() - 1); defaultRect.setY(defaultRect.y() - 1); @@ -237,12 +231,8 @@ struct RevertCylinderData { int size; } currCylinderData; -void TankInfoDelegate::setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &thisindex) const +void TankInfoDelegate::setModelData(QWidget*, QAbstractItemModel*, const QModelIndex&) const { - Q_UNUSED(model) - Q_UNUSED(editor) - Q_UNUSED(thisindex) - CylindersModel *mymodel = qobject_cast<CylindersModel *>(currCombo.model); TankInfoModel *tanks = TankInfoModel::instance(); QModelIndexList matches = tanks->match(tanks->index(0, 0), Qt::DisplayRole, currCombo.activeText); @@ -270,19 +260,16 @@ TankInfoDelegate::TankInfoDelegate(QObject *parent) : ComboBoxDelegate(TankInfoM this, SLOT(reenableReplot(QWidget *, QAbstractItemDelegate::EndEditHint))); } -void TankInfoDelegate::reenableReplot(QWidget *widget, QAbstractItemDelegate::EndEditHint hint) +void TankInfoDelegate::reenableReplot(QWidget*, QAbstractItemDelegate::EndEditHint) { - Q_UNUSED(widget) - Q_UNUSED(hint) MainWindow::instance()->graphics()->setReplot(true); // FIXME: We need to replot after a cylinder is selected but the replot below overwrites // the newly selected cylinder. // MainWindow::instance()->graphics()->replot(); } -void TankInfoDelegate::revertModelData(QWidget *widget, QAbstractItemDelegate::EndEditHint hint) +void TankInfoDelegate::revertModelData(QWidget*, QAbstractItemDelegate::EndEditHint hint) { - Q_UNUSED(widget) if (hint == QAbstractItemDelegate::NoHint || hint == QAbstractItemDelegate::RevertModelCache) { CylindersModel *mymodel = qobject_cast<CylindersModel *>(currCombo.model); @@ -310,10 +297,8 @@ TankUseDelegate::TankUseDelegate(QObject *parent) : QStyledItemDelegate(parent) { } -QWidget *TankUseDelegate::createEditor(QWidget * parent, const QStyleOptionViewItem & option, const QModelIndex & index) const +QWidget *TankUseDelegate::createEditor(QWidget * parent, const QStyleOptionViewItem&, const QModelIndex&) const { - Q_UNUSED(option) - Q_UNUSED(index) QComboBox *comboBox = new QComboBox(parent); for (int i = 0; i < NUM_GAS_USE; i++) comboBox->addItem(gettextFromC::instance()->trGettext(cylinderuse_text[i])); @@ -338,9 +323,8 @@ struct RevertWeightData { int weight; } currWeight; -void WSInfoDelegate::revertModelData(QWidget *widget, QAbstractItemDelegate::EndEditHint hint) +void WSInfoDelegate::revertModelData(QWidget*, QAbstractItemDelegate::EndEditHint hint) { - Q_UNUSED(widget) if (hint == QAbstractItemDelegate::NoHint || hint == QAbstractItemDelegate::RevertModelCache) { WeightModel *mymodel = qobject_cast<WeightModel *>(currCombo.model); @@ -349,12 +333,8 @@ void WSInfoDelegate::revertModelData(QWidget *widget, QAbstractItemDelegate::End } } -void WSInfoDelegate::setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &thisindex) const +void WSInfoDelegate::setModelData(QWidget*, QAbstractItemModel*, const QModelIndex&) const { - Q_UNUSED(editor) - Q_UNUSED(model) - Q_UNUSED(thisindex) - WeightModel *mymodel = qobject_cast<WeightModel *>(currCombo.model); WSInfoModel *wsim = WSInfoModel::instance(); QModelIndexList matches = wsim->match(wsim->index(0, 0), Qt::DisplayRole, currCombo.activeText); @@ -389,10 +369,8 @@ QWidget *WSInfoDelegate::createEditor(QWidget *parent, const QStyleOptionViewIte return editor; } -void AirTypesDelegate::revertModelData(QWidget *widget, QAbstractItemDelegate::EndEditHint hint) +void AirTypesDelegate::revertModelData(QWidget*, QAbstractItemDelegate::EndEditHint) { - Q_UNUSED(widget) - Q_UNUSED(hint) } void AirTypesDelegate::setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const @@ -407,10 +385,8 @@ AirTypesDelegate::AirTypesDelegate(QObject *parent) : ComboBoxDelegate(GasSelect { } -void DiveTypesDelegate::revertModelData(QWidget *widget, QAbstractItemDelegate::EndEditHint hint) +void DiveTypesDelegate::revertModelData(QWidget*, QAbstractItemDelegate::EndEditHint) { - Q_UNUSED(widget) - Q_UNUSED(hint) } void DiveTypesDelegate::setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const @@ -457,9 +433,8 @@ QWidget *DoubleSpinBoxDelegate::createEditor(QWidget *parent, const QStyleOption return w; } -LocationFilterDelegate::LocationFilterDelegate(QObject *parent) +LocationFilterDelegate::LocationFilterDelegate(QObject*) { - Q_UNUSED(parent) } void LocationFilterDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &origIdx) const diff --git a/desktop-widgets/printdialog.cpp b/desktop-widgets/printdialog.cpp index e8aeb5176..bbbade2e4 100644 --- a/desktop-widgets/printdialog.cpp +++ b/desktop-widgets/printdialog.cpp @@ -191,9 +191,8 @@ void PrintDialog::printClicked(void) } } -void PrintDialog::onPaintRequested(QPrinter *printerPtr) +void PrintDialog::onPaintRequested(QPrinter*) { - Q_UNUSED(printerPtr) createPrinterObj(); connect(printer, SIGNAL(progessUpdated(int)), progressBar, SLOT(setValue(int))); printer->print(); diff --git a/desktop-widgets/simplewidgets.cpp b/desktop-widgets/simplewidgets.cpp index 2566c7b12..86b705cfc 100644 --- a/desktop-widgets/simplewidgets.cpp +++ b/desktop-widgets/simplewidgets.cpp @@ -68,9 +68,8 @@ double MinMaxAvgWidget::minimum() const return d->minValue->text().toDouble(); } -MinMaxAvgWidget::MinMaxAvgWidget(QWidget *parent) : d(new MinMaxAvgWidgetPrivate(this)) +MinMaxAvgWidget::MinMaxAvgWidget(QWidget*) : d(new MinMaxAvgWidgetPrivate(this)) { - Q_UNUSED(parent) } MinMaxAvgWidget::~MinMaxAvgWidget() @@ -261,9 +260,8 @@ void ShiftTimesDialog::buttonClicked(QAbstractButton *button) } } -void ShiftTimesDialog::showEvent(QShowEvent *event) +void ShiftTimesDialog::showEvent(QShowEvent*) { - Q_UNUSED(event) ui.timeEdit->setTime(QTime(0, 0, 0, 0)); when = get_times(); //get time of first selected dive ui.currentTime->setText(get_dive_date_string(when)); diff --git a/desktop-widgets/starwidget.cpp b/desktop-widgets/starwidget.cpp index 6f65a33a3..f5ba43be8 100644 --- a/desktop-widgets/starwidget.cpp +++ b/desktop-widgets/starwidget.cpp @@ -61,9 +61,8 @@ void StarWidget::mouseReleaseEvent(QMouseEvent *event) update(); } -void StarWidget::paintEvent(QPaintEvent *event) +void StarWidget::paintEvent(QPaintEvent*) { - Q_UNUSED(event) QPainter p(this); QImage star = hasFocus() ? focusedImage(starActive()) : starActive(); QPixmap selected = QPixmap::fromImage(star); diff --git a/desktop-widgets/subsurfacewebservices.cpp b/desktop-widgets/subsurfacewebservices.cpp index 361958329..3a9dd3d1f 100644 --- a/desktop-widgets/subsurfacewebservices.cpp +++ b/desktop-widgets/subsurfacewebservices.cpp @@ -958,9 +958,8 @@ void DivelogsDeWebServices::uploadFinished() } } -void DivelogsDeWebServices::setStatusText(int status) +void DivelogsDeWebServices::setStatusText(int) { - Q_UNUSED(status) } void DivelogsDeWebServices::downloadError(QNetworkReply::NetworkError) |