From 7208635502a21e565b1b613504709e1d161a39a0 Mon Sep 17 00:00:00 2001 From: Gianluca Recchia Date: Sun, 28 Oct 2018 14:29:57 +0100 Subject: [PATCH] Enhance readability when accessing static members The sole purpose of a few objects was calling a static member of the class they belonged to. This is not needed, as you can access a static member with the :: notation. --- src/autotype/AutoType.cpp | 3 +-- src/gui/entry/EditEntryWidget.cpp | 3 +-- src/sshagent/BinaryStream.cpp | 2 +- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/autotype/AutoType.cpp b/src/autotype/AutoType.cpp index c2c16bc75..eee93c52c 100644 --- a/src/autotype/AutoType.cpp +++ b/src/autotype/AutoType.cpp @@ -731,8 +731,7 @@ bool AutoType::checkHighRepetition(const QString& string) bool AutoType::verifyAutoTypeSyntax(const QString& sequence) { if (!AutoType::checkSyntax(sequence)) { - QMessageBox messageBox; - messageBox.critical(nullptr, tr("Auto-Type"), tr("The Syntax of your Auto-Type statement is incorrect!")); + QMessageBox::critical(nullptr, tr("Auto-Type"), tr("The Syntax of your Auto-Type statement is incorrect!")); return false; } else if (AutoType::checkHighDelay(sequence)) { QMessageBox::StandardButton reply; diff --git a/src/gui/entry/EditEntryWidget.cpp b/src/gui/entry/EditEntryWidget.cpp index e8a450026..26bb419ce 100644 --- a/src/gui/entry/EditEntryWidget.cpp +++ b/src/gui/entry/EditEntryWidget.cpp @@ -1311,8 +1311,7 @@ void EditEntryWidget::pickColor() oldColor = QColor(m_advancedUi->bgColorButton->property("color").toString()); } - QColorDialog colorDialog(this); - QColor newColor = colorDialog.getColor(oldColor); + QColor newColor = QColorDialog::getColor(oldColor); if (newColor.isValid()) { setupColorButton(isForeground, newColor); setUnsavedChanges(true); diff --git a/src/sshagent/BinaryStream.cpp b/src/sshagent/BinaryStream.cpp index 2aa8ac1c7..2af04cee5 100644 --- a/src/sshagent/BinaryStream.cpp +++ b/src/sshagent/BinaryStream.cpp @@ -151,7 +151,7 @@ bool BinaryStream::readString(QString& str) return false; } - str = str.fromLatin1(ba); + str = QString::fromLatin1(ba); return true; }