From 1487997551fb982d6c2c9a95b6ff43cfad5ddbcf Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Mon, 18 Feb 2019 15:34:43 +0100 Subject: [PATCH] Qt plugin wizard: Fix excess whitespace Amends 075e1da67e. Fixes: QTCREATORBUG-21974 Change-Id: I4216b06ac9753e552e34575ff10f3789ff5ad8dc Reviewed-by: Robert Loehning Reviewed-by: Alessandro Portale --- src/plugins/qmakeprojectmanager/wizards/libraryparameters.cpp | 4 +++- .../qmakeprojectmanager/wizards/librarywizarddialog.cpp | 2 +- tests/system/suite_APTW/tst_APTW03/test.py | 4 ++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/plugins/qmakeprojectmanager/wizards/libraryparameters.cpp b/src/plugins/qmakeprojectmanager/wizards/libraryparameters.cpp index aa46476ae03..83217ce2bf3 100644 --- a/src/plugins/qmakeprojectmanager/wizards/libraryparameters.cpp +++ b/src/plugins/qmakeprojectmanager/wizards/libraryparameters.cpp @@ -32,6 +32,8 @@ #include #include +#include + namespace QmakeProjectManager { namespace Internal { @@ -150,7 +152,7 @@ void LibraryParameters::generateCode(QtProjectParameters:: Type t, } QTC_ASSERT(nameIndex != -1, continue); sourceStr << '\n' << namespaceIndent << signature.left(nameIndex); - if (signature.at(nameIndex - 1) != ' ') + if (!std::strchr("&* ", signature.at(nameIndex - 1).toLatin1())) sourceStr << ' '; sourceStr << unqualifiedClassName << "::" << signature.mid(nameIndex) << '\n'; sourceStr << namespaceIndent << "{\n" << indent diff --git a/src/plugins/qmakeprojectmanager/wizards/librarywizarddialog.cpp b/src/plugins/qmakeprojectmanager/wizards/librarywizarddialog.cpp index 0381e2670a6..2aed6d43cd0 100644 --- a/src/plugins/qmakeprojectmanager/wizards/librarywizarddialog.cpp +++ b/src/plugins/qmakeprojectmanager/wizards/librarywizarddialog.cpp @@ -56,7 +56,7 @@ using QSL = QStringList; static const PluginBaseClasses pluginBaseClasses[] = { {"QAccessiblePlugin", "QtGui", - QSL{"QAccessibleInterface * create(const QString &key, QObject *object)"}, + QSL{"QAccessibleInterface *create(const QString &key, QObject *object)"}, "QtCore", "accessible", "QAccessibleFactoryInterface"}, {"QGenericPlugin", "QtGui", QSL{"QObject *create(const QString &name, const QString &spec)"}, "QtCore", "generic", "QGenericPluginFactoryInterface"}, diff --git a/tests/system/suite_APTW/tst_APTW03/test.py b/tests/system/suite_APTW/tst_APTW03/test.py index bab90c9459d..6c508e09ca7 100644 --- a/tests/system/suite_APTW/tst_APTW03/test.py +++ b/tests/system/suite_APTW/tst_APTW03/test.py @@ -103,7 +103,7 @@ def main(): continue editor = getEditorForFileSuffix("%s.cpp" % className.lower()) initialContent = str(editor.plainText) - test.verify("QObject * %s::create(" % className in initialContent, + test.verify("QObject *%s::create(" % className in initialContent, "Verifying whether pure virtual function has been added to the source file.") if not openDocument("%s.Headers.%s\.h" % (projectName, className.lower())): test.fatal("Could not open %s.h - continuing." % className.lower()) @@ -131,7 +131,7 @@ def main(): "Verifying whether event() definition has been added to the source file.") # add return to not run into build issues of missing return values addReturn(editor, "bool %s::event.*" % className, "true") - addReturn(editor, "QObject \* %s::create.*" % className, "0") + addReturn(editor, "QObject \*%s::create.*" % className, "0") placeCursorToLine(editor, 'static_assert\(false, .*', True) invokeContextMenuItem(editor, "Toggle Comment Selection") virtualFunctionsAdded = True