Revert "qdbusxml2cpp: invert Q_DECL_DEPRECATED and inline in the output"
This reverts commit 310f6666150f18d40630b54cf5c9424e4cfb5567. Reason for revert: Causes a fail-to-build regression Task-number: QTBUG-111330 Change-Id: I08a6a68d2c81e1a1189356aa7cf36aaf24fd8c9b Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
This commit is contained in:
parent
22943b3a3f
commit
aea92807be
@ -606,15 +606,13 @@ static void writeProxy(const QString &filename, const QDBusIntrospection::Interf
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isDeprecated)
|
hs << " inline "
|
||||||
hs << " Q_DECL_DEPRECATED ";
|
<< (isDeprecated ? "Q_DECL_DEPRECATED " : "");
|
||||||
else
|
|
||||||
hs << " ";
|
|
||||||
|
|
||||||
if (isNoReply) {
|
if (isNoReply) {
|
||||||
hs << "Q_NOREPLY inline void ";
|
hs << "Q_NOREPLY void ";
|
||||||
} else {
|
} else {
|
||||||
hs << "inline QDBusPendingReply<";
|
hs << "QDBusPendingReply<";
|
||||||
for (qsizetype i = 0; i < method.outputArgs.size(); ++i)
|
for (qsizetype i = 0; i < method.outputArgs.size(); ++i)
|
||||||
hs << (i > 0 ? ", " : "")
|
hs << (i > 0 ? ", " : "")
|
||||||
<< templateArg(qtTypeName(method.outputArgs.at(i).name, method.outputArgs.at(i).type,
|
<< templateArg(qtTypeName(method.outputArgs.at(i).name, method.outputArgs.at(i).type,
|
||||||
@ -650,7 +648,7 @@ static void writeProxy(const QString &filename, const QDBusIntrospection::Interf
|
|||||||
|
|
||||||
if (method.outputArgs.size() > 1) {
|
if (method.outputArgs.size() > 1) {
|
||||||
// generate the old-form QDBusReply methods with multiple incoming parameters
|
// generate the old-form QDBusReply methods with multiple incoming parameters
|
||||||
hs << (isDeprecated ? " Q_DECL_DEPRECATED " : " ") << "inline QDBusReply<"
|
hs << " inline " << (isDeprecated ? "Q_DECL_DEPRECATED " : "") << "QDBusReply<"
|
||||||
<< templateArg(qtTypeName(method.outputArgs.first().name, method.outputArgs.first().type,
|
<< templateArg(qtTypeName(method.outputArgs.first().name, method.outputArgs.first().type,
|
||||||
method.annotations, 0, "Out"))
|
method.annotations, 0, "Out"))
|
||||||
<< "> ";
|
<< "> ";
|
||||||
|
@ -240,46 +240,6 @@ void tst_qdbusxml2cpp::process_data()
|
|||||||
<< QRegularExpression("Q_SLOTS:.*QString Method\\(const QString &\\w*, const QString &\\w*, QString &",
|
<< QRegularExpression("Q_SLOTS:.*QString Method\\(const QString &\\w*, const QString &\\w*, QString &",
|
||||||
QRegularExpression::DotMatchesEverythingOption);
|
QRegularExpression::DotMatchesEverythingOption);
|
||||||
|
|
||||||
QTest::newRow("method-deprecated-0out")
|
|
||||||
<< "<method name=\"Method\">"
|
|
||||||
"<annotation name=\"org.freedesktop.DBus.Deprecated\" value=\"true\"/>"
|
|
||||||
"</method>"
|
|
||||||
<< QRegularExpression("Q_SLOTS:.*Q_DECL_DEPRECATED inline QDBusPendingReply<> Method\\(\\)",
|
|
||||||
QRegularExpression::DotMatchesEverythingOption)
|
|
||||||
<< QRegularExpression("Q_SLOTS:.*void Method\\(\\)",
|
|
||||||
QRegularExpression::DotMatchesEverythingOption);
|
|
||||||
|
|
||||||
QTest::newRow("method-deprecated-2out")
|
|
||||||
<< "<method name=\"Method\">"
|
|
||||||
"<annotation name=\"org.freedesktop.DBus.Deprecated\" value=\"true\"/>"
|
|
||||||
"<arg type=\"s\" direction=\"out\"/>"
|
|
||||||
"<arg type=\"s\" direction=\"out\"/>"
|
|
||||||
"</method>"
|
|
||||||
<< QRegularExpression("Q_SLOTS:.*Q_DECL_DEPRECATED inline QDBusPendingReply<QString, QString> Method\\(\\)"
|
|
||||||
".*Q_DECL_DEPRECATED inline QDBusReply<QString> Method\\(QString &\\w*\\)",
|
|
||||||
QRegularExpression::DotMatchesEverythingOption)
|
|
||||||
<< QRegularExpression("Q_SLOTS:.*QString Method\\(QString &",
|
|
||||||
QRegularExpression::DotMatchesEverythingOption);
|
|
||||||
|
|
||||||
QTest::newRow("method-noreply")
|
|
||||||
<< "<method name=\"Method\">"
|
|
||||||
"<annotation name=\"org.freedesktop.DBus.Method.NoReply\" value=\"true\"/>"
|
|
||||||
"</method>"
|
|
||||||
<< QRegularExpression("Q_SLOTS:.*Q_NOREPLY inline void Method\\(\\).*\\bQDBus::NoBlock\\b",
|
|
||||||
QRegularExpression::DotMatchesEverythingOption)
|
|
||||||
<< QRegularExpression("Q_SLOTS:.*Q_NOREPLY void Method\\(",
|
|
||||||
QRegularExpression::DotMatchesEverythingOption);
|
|
||||||
|
|
||||||
QTest::newRow("method-deprecated-noreply")
|
|
||||||
<< "<method name=\"Method\">"
|
|
||||||
"<annotation name=\"org.freedesktop.DBus.Method.NoReply\" value=\"true\"/>"
|
|
||||||
"<annotation name=\"org.freedesktop.DBus.Deprecated\" value=\"true\"/>"
|
|
||||||
"</method>"
|
|
||||||
<< QRegularExpression("Q_SLOTS:.*Q_DECL_DEPRECATED Q_NOREPLY inline void Method\\(\\).*\\bQDBus::NoBlock\\b",
|
|
||||||
QRegularExpression::DotMatchesEverythingOption)
|
|
||||||
<< QRegularExpression("Q_SLOTS:.*Q_NOREPLY void Method\\(",
|
|
||||||
QRegularExpression::DotMatchesEverythingOption);
|
|
||||||
|
|
||||||
// -- signals --
|
// -- signals --
|
||||||
for (int i = 0; i < basicTypeCount; ++i) {
|
for (int i = 0; i < basicTypeCount; ++i) {
|
||||||
QRegularExpression rx(QString("Q_SIGNALS:.*\\bvoid Signal\\((const )?%1\\b")
|
QRegularExpression rx(QString("Q_SIGNALS:.*\\bvoid Signal\\((const )?%1\\b")
|
||||||
@ -301,15 +261,6 @@ void tst_qdbusxml2cpp::process_data()
|
|||||||
<annotation name="org.qtproject.QtDBus.QtTypeName.Out0" value="QVariantMap"/>"
|
<annotation name="org.qtproject.QtDBus.QtTypeName.Out0" value="QVariantMap"/>"
|
||||||
</signal>)"
|
</signal>)"
|
||||||
<< rx << rx;
|
<< rx << rx;
|
||||||
|
|
||||||
QTest::newRow("signal-deprecated")
|
|
||||||
<< R"(<signal name="Signal">
|
|
||||||
<annotation name="org.freedesktop.DBus.Deprecated" value="true"/>
|
|
||||||
</signal>)"
|
|
||||||
<< QRegularExpression(R"(Q_SIGNALS:.*\bQ_DECL_DEPRECATED void Signal\(\))",
|
|
||||||
QRegularExpression::DotMatchesEverythingOption)
|
|
||||||
<< QRegularExpression(R"(Q_SIGNALS:.*\bvoid Signal\(\))",
|
|
||||||
QRegularExpression::DotMatchesEverythingOption);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void tst_qdbusxml2cpp::process()
|
void tst_qdbusxml2cpp::process()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user