summaryrefslogtreecommitdiffstats
path: root/src/dbus/qdbusxmlgenerator.cpp
Commit message (Collapse)AuthorAgeFilesLines
* QDBus: Remove commented out codeIevgenii Meshcheriakov2023-06-201-50/+0
| | | | | | | The code is commented out since 12 years ago. Change-Id: I5cd7380f8f1e778ea62b510aeece1aced111d662 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Port from container.count()/length() to size()Marc Mutz2022-10-041-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is semantic patch using ClangTidyTransformator: auto QtContainerClass = expr(hasType(namedDecl(hasAnyName(<classes>)))).bind(o) makeRule(cxxMemberCallExpr(on(QtContainerClass), callee(cxxMethodDecl(hasAnyName({"count", "length"), parameterCountIs(0))))), changeTo(cat(access(o, cat("size"), "()"))), cat("use 'size()' instead of 'count()/length()'")) a.k.a qt-port-to-std-compatible-api with config Scope: 'Container'. <classes> are: // sequential: "QByteArray", "QList", "QQueue", "QStack", "QString", "QVarLengthArray", "QVector", // associative: "QHash", "QMultiHash", "QMap", "QMultiMap", "QSet", // Qt has no QMultiSet Change-Id: Ibe8837be96e8d30d1846881ecd65180c1bc459af Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Use SPDX license identifiersLucie Gérard2022-05-161-38/+2
| | | | | | | | | | | | | Replace the current license disclaimer in files by a SPDX-License-Identifier. Files that have to be modified by hand are modified. License files are organized under LICENSES directory. Task-number: QTBUG-67283 Change-Id: Id880c92784c40f3bbde861c0d93f58151c18b9f1 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* QtDBus: replace remaining uses of QLatin1String with QLatin1StringViewSona Kurazyan2022-04-121-7/+7
| | | | | | | Task-number: QTBUG-98434 Change-Id: I733af3126f126e5025f709cfe023b9f6bbc13e3e Reviewed-by: Marc Mutz <marc.mutz@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* QtDBus: use _L1 for for creating Latin-1 string literalsSona Kurazyan2022-04-121-23/+23
| | | | | | Task-number: QTBUG-98434 Change-Id: I99d9a82c77d00124ea8953b98406959f1bf9413a Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* QtDBus: stop using QLatin1Char constructor for creating char literalsSona Kurazyan2022-04-121-7/+7
| | | | | | | | | Required for porting away from QLatin1Char/QLatin1String in scope of QTBUG-98434. Change-Id: I48e2946c4cc8d0a6c3e0cc37e1f73510b878d574 Reviewed-by: Marc Mutz <marc.mutz@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QDBus: fix ExportScriptableInvokables to allow calling scriptable invokablesDavid Faure2021-08-231-6/+11
| | | | | | | | | The "wantedMask" check in the xml generator didn't distinguish slots from invokables, so exporting an object with just ExportScriptableInvokables didn't allow calling Q_SCRIPTABLE methods. Change-Id: I7b408755da5b28e67a9384d9df95e22dc5de2369 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Use QMetaType instead of integer based type idsLars Knoll2020-09-231-12/+12
| | | | | | | | | Change the implementation of Qt DBus to use QMetaType directly instead of integer based type ids. Change-Id: I999023b58fa50dcc3504386467faf09874f7d2cf Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Deprecate the static int based API in QMetaTypeLars Knoll2020-08-241-4/+4
| | | | | | | | | | | | | And remove one of the type id to name mapping that still existed in QMetaType. QMetaTypeInterface can provide that, so there's no need to have a second copy of the data. qMetaTypeTypeInternal() can still map all the names of all builtin types to ids. That functionality is for now still required by moc and can't be removed yet. Change-Id: Ib4f8e9c71e1e7d99d52da9e44477c9a1f1805e57 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Use QList instead of QVector in dbusJarek Kobus2020-06-251-1/+1
| | | | | | | | Omitted type replacement in qDBusParametersForMethod() for now. Task-number: QTBUG-84469 Change-Id: Ieb9fbb30b431c5e4183ad57acd35640e9556bf6c Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Use Qt::SplitBehavior in preference to QString::SplitBehaviorEdward Welbourne2020-02-281-1/+1
| | | | | | | | The Qt version was added in 5.14 "for use as eventual replacement for QString::SplitBehavior." Move another step closer to that goal. Change-Id: I399b5ea56e9255e775ca1746632f7421519a6616 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Replace most use of QVariant::type and occurrences of QVariant::TypeOlivier Goffart2020-01-231-3/+3
| | | | | | | | | | | | | | | | | | | | | I made a clazy automated check that replaced the use of QVariant::Type by the equivalent in QMetaType. This has been deprecated since Qt 5.0, but many uses were not yet removed. In addition, there was some manual changes to fix the compilation errors. Adapted the Private API of QDateTimeParser and QMimeDataPrivate and adjust QDateTimeEdit and QSpinBox. QVariant(QVariant::Invalid) in qstylesheet made no sense. But note that in QVariant::save, we actually wanted to use the non-user type. In the SQL module, many changes were actually reverted because the API still expects QVarient::Type. Change-Id: I98c368490e4ee465ed3a3b63bda8b8eaa50ea67e Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* QtDBus: use new QLatin1String::arg()Marc Mutz2019-06-031-7/+7
| | | | | | | | | | | | | | | Saves more than 4KiB in text size (~0.7%) on optimized GCC 9.1 Linux AMD64 builds. Change-Id: I5b29eae620370abd91e3a7f98e660c32470aed1c Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Use QString::asprintf(), QStringBuilder, and the multi-arg overload of ↵Alexander Volkov2017-01-121-7/+4
| | | | | | | | | | | | | QString::arg() ... instead of sequential .arg(const QString &) callings. It saves memory allocations and prevents unexpected results if replacing strings contain place markers. Found with clazy's qstring-arg check. Change-Id: I3912275a6e11c6fb7559ff5623f2e8cde9b7f07a Reviewed-by: Anton Kudryavtsev <antkudr@mail.ru> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* qdbusxmlgenerator.cpp: reduce allocations in typeNameToXml()Anton Kudryavtsev2016-08-231-3/+3
| | | | | | | | | Don't create QString from QL1S, just iterate over QL1S directly. Change-Id: I35196991224c206841efb11894a9baf736ead97e Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Updated license headersJani Heikkinen2016-01-151-14/+20
| | | | | | | | | | | From Qt 5.7 -> LGPL v2.1 isn't an option anymore, see http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/ Updated license headers to use new LGPL header instead of LGPL21 one (in those files which will be under LGPL v3) Change-Id: I046ec3e47b1876cd7b4b0353a576b352e3a946d9 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* Skip non-exported slots early when creating a XML interface description.Robert Griebl2015-03-251-1/+6
| | | | | | | | This will prevent unnecessary warnings about unknown types for signals or slots that are not even exported to the D-Bus. Change-Id: Iecda5beca5ebe6665a193245fe1c2578156f6abe Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Update copyright headersJani Heikkinen2015-02-111-7/+7
| | | | | | | | | | | | | | | | | | Qt copyrights are now in The Qt Company, so we could update the source code headers accordingly. In the same go we should also fix the links to point to qt.io. Outdated header.LGPL removed (use header.LGPL21 instead) Old header.LGPL3 renamed to header.LGPL3-COMM to match actual licensing combination. New header.LGPL-COMM taken in the use file which were using old header.LGPL3 (src/plugins/platforms/android/extract.cpp) Added new header.LGPL3 containing Commercial + LGPLv3 + GPLv2 license combination Change-Id: I6f49b819a8a20cc4f88b794a8f6726d975e8ffbe Reviewed-by: Matti Paaso <matti.paaso@theqtcompany.com>
* Update license headers and add new license filesMatti Paaso2014-09-241-19/+11
| | | | | | | | | - Renamed LICENSE.LGPL to LICENSE.LGPLv21 - Added LICENSE.LGPLv3 - Removed LICENSE.GPL Change-Id: Iec3406e3eb3f133be549092015cefe33d259a3f2 Reviewed-by: Iikka Eklund <iikka.eklund@digia.com>
* QDBus: replace arg-chain with multi-argMarc Mutz2014-02-141-3/+3
| | | | | | | | | | The arguments are all strings, so multi-arg is available without other changes to the code. Even though insertion of a format placeholder can be ruled out in the present case, multi-arg should be faster than a 3-chain of arg() calls. Change-Id: I8d030227e1bd30c56f1062a0c9dbbaae0143885f Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QDBus: avoid relocationsMarc Mutz2014-02-141-8/+9
| | | | | | | | Instead of using Q_STRINGTABLE, use a switch/if construct to be able to share the string data for "write" and "readwrite". Change-Id: Ia1c7b8a0f13a809372de2e5a956978dc2d569e92 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2013-07-231-1/+1
|\ | | | | | | | | | | | | Conflicts: tests/auto/dbus/qdbusabstractinterface/tst_qdbusabstractinterface.cpp Change-Id: I18a9d83fc14f4a9afdb1e40523ec51e3fa1d7754
| * Changed digia contact details to */legal, updated licensesTeemu Kaukoranta2013-07-201-1/+1
| | | | | | | | | | | | | | | | Scripts are available in internal mkdist repo. Added license tags, updated licenses and copyrights/contacts Change-Id: Ibc734275f3000987eaa4f5c57f19d4e1fda2c479 Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* | QDBus: improve error handling, to give the developer feedback.David Faure2013-07-011-4/+12
|/ | | | | | | | | | | | | For instance, exporting an object with a slot like QString complexMethod(const MyVariantMap& vars); (even with a simple typedef QVariantMap MyVariantMap) used to silently skip that method in the introspection. Now it outputs: generateInterfaceXml: Skipped method "complexMethod" : Invalid type in parameter list: MyVariantMap Change-Id: I7964cfb63e973257ce1abe47b9625e361b2ad23f Reviewed-by: Kevin Ottens <kevin.ottens@kdab.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Doc: Fix module name formatSze Howe Koh2013-01-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Follow the conventions at http://qt-project.org/wiki/Spelling_Module_Names_in_Qt_Documentation QtCore -> Qt Core QtDBus -> Qt D-Bus QtDesigner -> Qt Designer QtGui -> Qt GUI QtImageFormats -> Qt Image Formats QtNetwork -> Qt Network QtPrintSupport -> Qt Print Support QtScript -> Qt Script QtSql -> Qt SQL QtSvg -> Qt SVG QtTest -> Qt Test QtWebKit -> Qt WebKit QtWidgets -> Qt Widgets QtXml -> Qt XML QtConcurrent -> Qt Concurrent (partial) QtQuick -> Qt Quick (partial) Also, distinguish between "module" and "library" Change-Id: Icb8aa695ae60b0e45920b0c8fce4dc763a12b0cd Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* Update copyright year in Digia's license headersSergio Ahumada2013-01-181-1/+1
| | | | | Change-Id: Ic804938fc352291d011800d21e549c10acac66fb Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Change license header from Nokia to DigiaSergio Ahumada2012-11-261-1/+1
| | | | | Change-Id: I2be215284d7670f60f8b5838fce1e6832dde2270 Reviewed-by: Martin Smith <martin.smith@digia.com>
* Change copyrights from Nokia to DigiaIikka Eklund2012-09-221-22/+22
| | | | | | | | Change copyrights and license headers from Nokia to Digia Change-Id: If1cc974286d29fd01ec6c19dd4719a67f4c3f00e Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* QDBusMetaTypeId: don't cache the result of qMetaTypeId<>() in static intsMarc Mutz2012-09-221-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | There's not much point in caching the result of qMetaTypeId<>, because it's already internally memoised. In addition, the code that initialised the static int caches wasn't protected against concurrent access under the assumption that the operations performed were thread-safe. That is true for most of them, but not for the stores to the static ints, which race against each other: // Thread A // Thread B r1 = initialized /*=false*/ r1 = initialized /*=false*/ r2 = qMetaTypeId<...>(); r2 = qMetaTypeId<...>(); message = r2; message = r2; // race, ditto for all other ints To fix, turn the ints into inline functions that just call the respective qMetaTypeId<>() function. Change-Id: I5aa80c624872c3867232abc26ffdcde70cd54022 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Replace QVariant::typeToName usage by QMetaType::typeName call.Jędrzej Nowacki2012-05-281-3/+3
| | | | | | | | | Type information is kept in QMetaType class. QVariant is delegating operations, so it is better to use QMetaType directly. Change-Id: I91209fa1c9dc4303d6bd47c96824d3cd64ce5291 Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Finish cleaning up com.trolltech -> org.qtproject in QtDBusThiago Macieira2012-04-161-5/+5
| | | | | | | | | | | | | | Lots of uses of the annotations and error names, plus a bunch of local unit test names (including one file that had to be renamed). The meta object generator is updated to support both the old and new names. That means some references to com.trolltech *must* remain in the source code. Task-number: QTBUG-23274 Change-Id: Icc38ae040232f07c437e7546ee744a4703f41726 Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com> Reviewed-by: Lorn Potter <lorn.potter@nokia.com>
* Merge master into api_changesKent Hansen2012-03-271-1/+1
|\ | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/global/qisenum.h src/dbus/qdbusconnection_p.h src/widgets/kernel/qwidget.cpp tests/auto/other/qaccessibility/tst_qaccessibility.cpp Change-Id: I85102515d5fec835832cc20ffdc5c1ba578bd01d
| * Use QVector<int> instead of QList<int> for storing metatypes in QtDBusThiago Macieira2012-03-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Change I00020eed fixed a bug present in 64-bit machines because it tried to access QList<int>'s internal array data, assuming it was a vector of ints. That worked in 32-bit, but not 64-bit. The fix involves a conversion between QList and QVector. Now fix it properly by changing everything to be QVector. The benefit is that on 64-bit, they are real vectors, not the 50%-overhead pointer array that QList is. Change-Id: I989ad279d0d8b2c9ab262a1eed413ab2365b5461 Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* | Use the new QMetaMethod API in QtDBusKent Hansen2012-03-201-6/+4
| | | | | | | | | | | | | | | | | | Use QMetaMethod::name() instead of parsing the signature. Use QMetaMethod::returnType() instead of resolving the type id via the type name. Change-Id: If5d0198c5f1329fd9d9340acd58bd4a36933d960 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Rename QMetaMethod::signature() to methodSignature()Kent Hansen2012-02-291-1/+1
|/ | | | | | | | | | | | | | | | | | | | In Qt5 the meta-data format will be changed to not store the method signature string explicitly; the signature will be reconstructed on demand from the method name and parameter type information. The QMetaMethod::signature() method returns a const char pointer. Changing the return type to QByteArray can lead to silent bugs due to the implicit conversion to char *. Even though it's a source- incompatible change, it's therefore better to introduce a new function, methodSignature(), and remove the old signature(). Task-number: QTBUG-24154 Change-Id: Ib3579dedd27a3c7c8914d5f1b231947be2cf4027 Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
* Remove "All rights reserved" line from license headers.Jason McDonald2012-01-301-1/+1
| | | | | | | | | | As in the past, to avoid rewriting various autotests that contain line-number information, an extra blank line has been inserted at the end of the license text to ensure that this commit does not change the total number of lines in the license header. Change-Id: I311e001373776812699d6efc045b5f742890c689 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Remove qDBusNameToTypeId function.Jędrzej Nowacki2012-01-271-2/+2
| | | | | | | | The function is redundant and can be replaced by QMetaType::type(). Change-Id: I131a7fd285a60d8bd0f3b958668a43bd5da2d6c4 Reviewed-by: Jonas Gastal <jgastal@profusion.mobi> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Update contact information in license headers.Jason McDonald2012-01-231-1/+1
| | | | | | | Replace Nokia contact email address with Qt Project website. Change-Id: I431bbbf76d7c27d8b502f87947675c116994c415 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Update copyright year in license headers.Jason McDonald2012-01-051-1/+1
| | | | | Change-Id: I02f2c620296fcd91d4967d58767ea33fc4e1e7dc Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Update licenseheader text in source files for qtbase Qt moduleJyri Tahtela2011-05-241-17/+17
| | | | | | | Updated version of LGPL and FDL licenseheaders. Apply release phase licenseheaders for all source files. Reviewed-by: Trust Me
* Initial import from the monolithic Qt.Qt by Nokia2011-04-271-0/+308
This is the beginning of revision history for this module. If you want to look at revision history older than this, please refer to the Qt Git wiki for how to use Git history grafting. At the time of writing, this wiki is located here: http://qt.gitorious.org/qt/pages/GitIntroductionWithQt If you have already performed the grafting and you don't see any history beyond this commit, try running "git log" with the "--follow" argument. Branched from the monolithic repo, Qt master branch, at commit 896db169ea224deb96c59ce8af800d019de63f12