From a41c31c66f22d7fd4ea7587a2406ce307e252ff8 Mon Sep 17 00:00:00 2001 From: Tomaz Canabrava Date: Mon, 29 Nov 2021 09:29:46 -0300 Subject: [PATCH] Don't use `d` as variable name On KDE and Qt apps it's common to use a d-pointer, so naming a variable `d` has a serious implication of muscle memory. --- src/gui/scanprogressdialog.cpp | 9 +++++---- src/gui/scanprogressdialog.h | 3 ++- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/gui/scanprogressdialog.cpp b/src/gui/scanprogressdialog.cpp index 3cd1fb4..dbca0cc 100644 --- a/src/gui/scanprogressdialog.cpp +++ b/src/gui/scanprogressdialog.cpp @@ -26,12 +26,13 @@ void ScanProgressDialog::closeEvent(QCloseEvent* e) e->ignore(); } -void ScanProgressDialog::setDeviceName(const QString& d) +void ScanProgressDialog::setDeviceName(const QString& device) { - if (d.isEmpty()) + if (device.isEmpty()) { setLabelText(xi18nc("@label", "Scanning...")); - else - setLabelText(xi18nc("@label", "Scanning device: %1", d)); + } else { + setLabelText(xi18nc("@label", "Scanning device: %1", device)); + } } void ScanProgressDialog::showEvent(QShowEvent* e) diff --git a/src/gui/scanprogressdialog.h b/src/gui/scanprogressdialog.h index a6d53ca..b3d8566 100644 --- a/src/gui/scanprogressdialog.h +++ b/src/gui/scanprogressdialog.h @@ -19,7 +19,8 @@ public: void setProgress(int p) { setValue(p); } - void setDeviceName(const QString& d); + + void setDeviceName(const QString& device); protected: void closeEvent(QCloseEvent* e) override;