Qt plugin wizard: Fix excess whitespace

Amends 075e1da67e.

Fixes: QTCREATORBUG-21974
Change-Id: I4216b06ac9753e552e34575ff10f3789ff5ad8dc
Reviewed-by: Robert Loehning <robert.loehning@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
Christian Kandeler
2019-02-18 15:34:43 +01:00
parent 4d40254619
commit 1487997551
3 changed files with 6 additions and 4 deletions

View File

@@ -32,6 +32,8 @@
#include <QTextStream> #include <QTextStream>
#include <QStringList> #include <QStringList>
#include <cstring>
namespace QmakeProjectManager { namespace QmakeProjectManager {
namespace Internal { namespace Internal {
@@ -150,7 +152,7 @@ void LibraryParameters::generateCode(QtProjectParameters:: Type t,
} }
QTC_ASSERT(nameIndex != -1, continue); QTC_ASSERT(nameIndex != -1, continue);
sourceStr << '\n' << namespaceIndent << signature.left(nameIndex); sourceStr << '\n' << namespaceIndent << signature.left(nameIndex);
if (signature.at(nameIndex - 1) != ' ') if (!std::strchr("&* ", signature.at(nameIndex - 1).toLatin1()))
sourceStr << ' '; sourceStr << ' ';
sourceStr << unqualifiedClassName << "::" << signature.mid(nameIndex) << '\n'; sourceStr << unqualifiedClassName << "::" << signature.mid(nameIndex) << '\n';
sourceStr << namespaceIndent << "{\n" << indent sourceStr << namespaceIndent << "{\n" << indent

View File

@@ -56,7 +56,7 @@ using QSL = QStringList;
static const PluginBaseClasses pluginBaseClasses[] = static const PluginBaseClasses pluginBaseClasses[] =
{ {
{"QAccessiblePlugin", "QtGui", {"QAccessiblePlugin", "QtGui",
QSL{"QAccessibleInterface * create(const QString &key, QObject *object)"}, QSL{"QAccessibleInterface *create(const QString &key, QObject *object)"},
"QtCore", "accessible", "QAccessibleFactoryInterface"}, "QtCore", "accessible", "QAccessibleFactoryInterface"},
{"QGenericPlugin", "QtGui", QSL{"QObject *create(const QString &name, const QString &spec)"}, {"QGenericPlugin", "QtGui", QSL{"QObject *create(const QString &name, const QString &spec)"},
"QtCore", "generic", "QGenericPluginFactoryInterface"}, "QtCore", "generic", "QGenericPluginFactoryInterface"},

View File

@@ -103,7 +103,7 @@ def main():
continue continue
editor = getEditorForFileSuffix("%s.cpp" % className.lower()) editor = getEditorForFileSuffix("%s.cpp" % className.lower())
initialContent = str(editor.plainText) 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.") "Verifying whether pure virtual function has been added to the source file.")
if not openDocument("%s.Headers.%s\.h" % (projectName, className.lower())): if not openDocument("%s.Headers.%s\.h" % (projectName, className.lower())):
test.fatal("Could not open %s.h - continuing." % 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.") "Verifying whether event() definition has been added to the source file.")
# add return to not run into build issues of missing return values # add return to not run into build issues of missing return values
addReturn(editor, "bool %s::event.*" % className, "true") 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) placeCursorToLine(editor, 'static_assert\(false, .*', True)
invokeContextMenuItem(editor, "Toggle Comment Selection") invokeContextMenuItem(editor, "Toggle Comment Selection")
virtualFunctionsAdded = True virtualFunctionsAdded = True