Commit Graph

214 Commits

Author SHA1 Message Date
Steffen Kieß
6d880185b1 Fix passing QDBusUnixFileDescriptors over peer-to-peer connections
Passing QDBusUnixFileDescriptors over peer-to-peer connections currently
does not work, because QDBusConnectionPrivate::setPeer() does not set
this->capabilities (unlike QDBusConnectionPrivate::setConnection()
which is executed for bus connections).

Keep track of whether the connection already has been authenticated, and
once the connection does get authenticated, update this->capabilities.

Note that sending a message directly after connecting (before any
message has been received from the peer) might still fail if the message
contains a QDBusUnixFileDescriptor.

Pick-to: 5.15
Fixes: QTBUG-85396
Change-Id: Ib83213ebcd3255fb091c6faefb3618745b8d736c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-07-13 20:45:20 +02:00
Alexandru Croitor
db397d1113 CMake: Regenerate subdir test projects
And generate a few more test projects that were missing.

Change-Id: I5df51106549aa5ae09bc3c42360e14b143719547
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2020-07-09 09:38:39 +02:00
Alexandru Croitor
e9a328bc0e CMake: Regenerate tests with new qt_ prefixed APIs
Use pro2cmake with '--api-version 2' to force regenerate
projects to use the new prefixed qt_foo APIs.

Change-Id: I055c4837860319e93aaa6b09d646dda4fc2a4069
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-07-09 09:38:35 +02:00
Jarek Kobus
273fcd0c05 Use QList instead of QVector in dbus tests
Task-number: QTBUG-84469
Change-Id: I37d169770f188837118b4e33aa3a3894bf7aed2c
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-06-25 07:54:33 +02:00
Lars Knoll
03326a2fec Move implementation of QVector/List back to qlist.h
And name the main class QList. That's also the one we document.

This gives less porting pain for our users, and a lot less churn
in our API, as we use QList in Qt 5 in 95% of our API.
In addition, it gives more consistent naming with QStringList and
QByteArrayList and disambiguates QList vs QVector(2|3|4)D.

Fixes: QTBUG-84468
Change-Id: I3cba9d1d3179969d8bf9320b31be2230d021d1a9
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-06-20 20:01:33 +02:00
Lars Knoll
d0689ec867 Get rid of the obsolete isEditable flag for properties
Change-Id: I54411bd8e223671523c9c8fad5c80bfa6b5b7097
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2020-06-11 19:39:56 +02:00
Lars Knoll
56ebc2363d Fix autotests after the QHash changes
Some test cases are sensitive to the exact ordering inside
QHash, and need adjustments when we change QHash or the
hashing functions.

Some rcc tests now also need 32bit specific data, as the hashing
functions for 32 and 64 bit are different now (as we use size_t).

Change-Id: Ieab01cd55b1288336493b13c41d27e42a008bdd9
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2020-04-09 20:04:15 +02:00
Olivier Goffart
33cd680ddb New QMetaType representation
the QMetaType is represented as a pointer to a "vtable" in the form of
a QtPrivate::QMetaTypeInterface*

The recomanded use of QMetaType is to construct an object with
QMetaType::fromType. This does not require any registration.

There is still an id() function which will do some registration
for compatibility with Qt5. Also the patch does not really touch
the other extra things that can be registered (data stream operator,
comparison operator, iteratable, ...) and this still uses the previous
system.

This is only the change in QMetaType, other changes to use it in QVariant
and QMetaObject will follow

Change-Id: Iffad20085cf33f33447f58a68236013a8b60fdbf
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2020-02-20 16:11:02 +01:00
Alexandru Croitor
0d177053b9 Regenerate projects one last time before merge
Change-Id: Ia24cf56b79ca6dacd370a7e397024e9b663e0167
Reviewed-by: Liang Qi <liang.qi@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2020-02-12 17:30:49 +00:00
Leander Beernaert
48c82e90af Post Merge Fixes
Change-Id: I1e06c01b76b119c3f23b6e6ecbaae8df719b70ce
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-01-24 12:29:18 +00:00
Leander Beernaert
502d3d6744 Merge remote-tracking branch 'origin/dev' into merge-dev
Change-Id: I31b761cfd5ea01373c60d02a5da8c33398d34739
2020-01-24 13:17:33 +01:00
Leander Beernaert
7c6f763d85 Regenerate Tests
Change-Id: I78f1efbec809610bcf6a8224392fa0dc8dbf3b3b
Reviewed-by: Qt CMake Build Bot
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2020-01-16 08:16:17 +00:00
Leander Beernaert
26600a069a Fix tst_qdbusmarshall
Change-Id: Ia7bb50a8c69a0083d0b8acdad0cb8eb6a71ca24e
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2020-01-10 13:01:21 +00:00
Alexandru Croitor
4dfb1eca1e Fix qmake builds
We did some changes in the .cpp files of some tests when converting
the build system to CMake, but didn't adjust the .pro files which
caused tests to fail when doing a qmake build.

Make the required changes. Was discovered when doing a test
wip/cmake -> dev merge.

Change-Id: I407a982412cb44df592a38a4cb997968bdfe3304
Reviewed-by: Qt CMake Build Bot
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-12-11 20:57:54 +00:00
Leander Beernaert
1c655fb0fc Post merge fixes
Change-Id: I78d3c9687f99c0a32da04257e297e88ef0b02581
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-11-25 14:53:27 +00:00
Qt Forward Merge Bot
58c69df4d3 Merge remote-tracking branch 'origin/5.15' into dev
Conflicts:
	src/corelib/tools/qhash.h
	src/gui/kernel/qevent.h
	src/widgets/kernel/qshortcut.cpp
	src/widgets/kernel/qshortcut.h

Change-Id: If61c206ee43ad1d97f5b07f58ac93c4583ce5620
2019-11-25 11:30:04 +01:00
Allan Sandfeld Jensen
af2daafde7 Deprecate constructing QFlags from a pointer
This was used to support QFlags f = 0 initialization, but with 0 used
as a pointer literal now considered bad form, it had been changed many
places to QFlags f = nullptr, which is meaningless and confusing.

Change-Id: I4bc592151c255dc5cab1a232615caecc520f02e8
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-11-20 19:43:38 +01:00
Leander Beernaert
26e8769124 Merge remote-tracking branch 'origin/dev' into wip/cmake
Change-Id: Ifecc2d9db396d783124df8567553ba5f846f30bb
2019-11-19 13:53:21 +01:00
Alexandru Croitor
8305b6fe3f Regenerate tests/auto/dbus
Change-Id: I105eb73065e02a4fa508d17f481047b32875f128
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-11-13 10:11:39 +00:00
Lars Knoll
5357231c0a Make QList an alias to QVector
This is almost 100% source compatible with Qt 5. Exceptions are

* Stability of references for large or non movable types
* taking a PMF for types that are now overloaded with r-value references
  in QVector
* The missing prepend optimization in QVector (that is still planned
  to come for Qt 6)

Change-Id: I96d44553304dd623def9c70d6fea8fa2fb0373b0
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-10-30 11:52:48 +01:00
Samuel Gaist
439f343416 test: migrate QDBusInterface test to QRegularExpression
This is part of the migration of qtbase from QRexExp to
QRegularExpression.

Task-number: QTBUG-72587
Change-Id: I47a047e27432c874b47bd25581806e1bc156e94f
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
2019-10-21 10:37:15 +02:00
Alexandru Croitor
3d1c6b76e7 Regenerate tests that use helper processes
This is needed to make sure the output directory is in the correct
place somewhere under tests, rather than in $prefix/bin.

Change-Id: I98afa9c0a7517a8a10866b4c626bd4c4d2fd214f
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
Reviewed-by: Qt CMake Build Bot
2019-08-23 09:25:27 +00:00
Alexandru Croitor
c7ec7cd2a1 Merge branch 'wip/qt6' into wip/cmake
Change-Id: I50ac36b8803c296998149e98cc61e38687cdd14b
2019-08-15 16:53:19 +02:00
Alexandru Croitor
e76c83a879 Regenerate some of the test projects that do SUBDIRS += foo
This show cases the new cleaner subdirs handling code in
pro2cmake.

Change-Id: I25001942ef020e4c4191b355f55309c4fb033ecc
Reviewed-by: Qt CMake Build Bot
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-08-07 11:55:38 +00:00
Leander Beernaert
1035374040 Fix qdbusmarshall test
Fix target name for qdbushmarshall and fix missing include paths and
unresolved symbols.

Change-Id: I770e190e33d1de9b9d95ee92e63d868e2337c322
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-07-17 13:25:28 +00:00
Alexandru Croitor
4dac45c9ee Merge remote-tracking branch 'origin/wip/qt6' into wip/cmake
Change-Id: I715b1d743d5f11560e7b3fbeb8fd64a5e5ddb277
2019-07-11 17:17:51 +02:00
Daniel Smith
6c136973fd unblacklist passing tests
These tests have not failed on the removed platforms for at least 60 days

Task-number: QTBUG-76608
Change-Id: If7a9f4db907124e3cd54e3f4b0ad3e20717d1912
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2019-07-08 11:01:42 +00:00
Albert Astals Cid
4d72497e6e cmake: Fix tests that need helper binaries
Compile the binaries where they are expected not in builddir/bin

Change-Id: I5c9461424a4b3f9fb7f39f5b9d3cd9b96887cfbc
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-06-04 11:41:02 +00:00
Giuseppe D'Angelo
34fe9232db Port from QAtomic::load() to loadRelaxed()
Semi-automated, just needed ~20 manual fixes:

$ find \( -iname \*.cpp -or -iname \*.h \) -exec perl -pe 's/(\.|->)load\(\)/$1loadRelaxed\(\)/g' -i \{\} +
$ find \( -iname \*.cpp -or -iname \*.h \) -exec perl -pe 's/(\.|->)store\(/$1storeRelaxed\(/g' -i \{\} +

It can be easily improved (e.g. for store check that there are no commas
after the opening parens). The most common offender is QLibrary::load,
and some code using std::atomic directly.

Change-Id: I07c38a3c8ed32c924ef4999e85c7e45cf48f0f6c
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2019-06-20 20:48:59 +02:00
Alexandru Croitor
0efe6fc90f Don't link against dbus-1_nolink when dbus_linked feature is off
dbus1_linked is only evaluated to true when the dbus package is found.
If it was not found, then it makes no sense to link against the
_nolink target, because no package was found in the first place.

When the package is not found, QtDBus uses a minimal dbus header which
is included with QtDBus sources, so there is no need for the _nolink
target.

This amends cc141cc5c6 and fixes a build
failure on macOS.

Change-Id: I71dcbb7465ad13b0bf03579f51412c373125caba
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2019-05-08 12:32:53 +00:00
Tobias Hunger
6630937e63 Merge commit 'dev' into 'wip/cmake-merge'
Change-Id: I176c40d031be26a1dd1cf08843e448a660598783
2019-04-16 16:32:08 +02:00
Qt Forward Merge Bot
67c70b22f6 Merge remote-tracking branch 'origin/5.12' into 5.13
Change-Id: Ifa143cc462301aaa305c9c85360e543553a751f0
2019-02-19 01:00:08 +01:00
Joerg Bornemann
8fe3680193 Add cmdline feature to qmake
[ChangeLog][qmake] A new feature "cmdline" was added that implies
"CONFIG += console" and "CONFIG -= app_bundle".

Task-number: QTBUG-27079
Change-Id: I6e52b07c9341c904bb1424fc717057432f9360e1
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
2019-02-18 07:12:14 +00:00
Albert Astals Cid
3e784f2be0 cmake: we need two different qmyserver names
All the binaries now end up in bin/ and since the two qmyservers used
for testing dbus have slightly different implementations we need both,
so rename one to qmyserver_qdbusinterface

Change-Id: I1db1aa8f96f35c6ca41254295e2477c35f915850
Reviewed-by: Kevin Funk <kevin.funk@kdab.com>
2019-02-11 11:07:38 +00:00
Albert Astals Cid
f80a37dcca cmake: Enable qdbusinterface test
Change-Id: Ia25911216790abdf463306cdb2e9aecb7dcd276e
Reviewed-by: Mikhail Svetkin <mikhail.svetkin@qt.io>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2019-01-31 09:45:38 +00:00
Albert Astals Cid
e2dc030ac0 cmake: test: Enable the build of qdbusabstractinterface
Since the code wants pinger_interface.h as include
name and the qt_create_qdbusxml2cpp_command function was
using the filename as source for the next filename i introduced
a new option DBUS_ADAPTOR_BASENAME/DBUS_INTERFACE_BASENAME to set the
name of the resulting file

Change-Id: I582d578b68275e4530e91a88631ae43fd1ae06fd
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2019-01-30 16:15:08 +00:00
Albert Astals Cid
7d5978df7c cmake: test: Fix qdbusabstractadaptor
Change-Id: Ibe3e64bd68df1f1f46308f6f622822cb9caa99e5
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2019-01-30 16:14:57 +00:00
Albert Astals Cid
23b3100c56 cmake: test: Enable qdbusxmlparser
Change-Id: Ieb3640a00b6f00fcbef5d42fee028b1edca12782
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2019-01-30 16:13:10 +00:00
David Edmundson
d761c62783 QDBusServiceWatcher namespace prefix support
This allows a user to efficiently watch for services with a common
domain prefix.

This is exposed in the API via a wildcard character in the service name.

For example creating a watcher on "org.mpris*" will match
"org.mpris.foo" "org.mpris.bar" and "org.mpris" itself. It will not
match org.mprisasdf.

Internally the argument match rules have been expanded from a single
QStringList to a struct containing args and arg0namespace. This was done
so that we can easily use argpath in match rules in the future.

Change-Id: I55882ab603cc6ba478e8c0ea9a6800f6e483a50c
Reviewed-by: Kai Uwe Broulik <kde@privat.broulik.de>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: David Faure <david.faure@kdab.com>
2018-11-06 09:52:09 +00:00
Simon Hausmann
e9c45bbddd Begin port of qtbase to CMake
Done-by: Alexandru Croitor <alexandru.croitor@qt.io>
Done-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
Done-by: Kevin Funk <kevin.funk@kdab.com>
Done-by: Mikhail Svetkin <mikhail.svetkin@qt.io>
Done-by: Simon Hausmann <simon.hausmann@qt.io>
Done-by: Tobias Hunger <tobias.hunger@qt.io>
Done-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Done-by: Volker Krause <volker.krause@kdab.com>
Change-Id: Ida4f8bd190f9a4849a1af7b5b7981337a5df5310
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Reviewed-by: Mikhail Svetkin <mikhail.svetkin@qt.io>
2018-11-01 11:48:46 +00:00
Richard Weickelt
f8c15fe63c Fix wrong relative path to qdbus_symbols.cpp
Commit d743df975d broke tst_qdbusinterface
when not using dbus-linked config option.

Change-Id: Iae5725ac781151e3a3d70032d6530bf4363daafa
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-07-24 04:24:31 +00:00
Kai Uwe Broulik
d743df975d Support interactive authorization flag in DBusMessage
This flag was introduced to serve as a replacement for a dedicated "interactive" boolean
argument in method calls guarded by Polkit.

Change-Id: Ida91c9872e70f8ca6672563d0ca6642f38c498ab
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-07-10 19:46:40 +00:00
Kari Oikarinen
350a64196f tests/auto/dbus: Avoid unconditional qWait()s
Use QTRY_COMPARE instead of a wait followed by QCOMPARE. Unless the condition
doesn't change and the wait provides the opportunity for things to go wrong.

Task-number: QTBUG-63992
Change-Id: I13474a45f1f4df9d77a418729a5748235ae0dd1a
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
2018-04-12 05:49:07 +00:00
Liang Qi
305dd1b61f Merge remote-tracking branch 'origin/5.9' into 5.11
Conflicts:
	.qmake.conf
	src/corelib/animation/qvariantanimation.cpp
	src/corelib/global/qglobal.cpp
	src/corelib/global/qlogging.cpp
	src/corelib/io/qprocess_win.cpp
	src/corelib/json/qjsonarray.cpp
	src/corelib/tools/qsimd_p.h
	src/corelib/tools/qtimezoneprivate_p.h
	src/corelib/xml/qxmlstream_p.h
	src/gui/kernel/qsimpledrag.cpp
	src/gui/kernel/qsimpledrag_p.h
	src/plugins/generic/generic.pro
	src/plugins/platforms/cocoa/qcocoamenu.mm
	src/widgets/styles/qmacstyle_mac.mm
	tests/auto/concurrent/qtconcurrentmap/BLACKLIST
	tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp
	tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp
	tests/auto/gui/kernel/qwindow/BLACKLIST
	tests/auto/widgets/dialogs/qmessagebox/BLACKLIST

Change-Id: I508d686cf20f7f8cc6a7119b9bc7c3bbb505c58e
2018-02-14 12:51:24 +01:00
Christian Ehrlicher
b2b32682a9 qtbase: Remove BLACKLIST files which are no longer active
Remove BLACKLIST files which are no longer valid because the mentioned
CI systems are no longer active:
 - opensuse-13.1
 - opensuse-42.1
 - rhel-7.1
 - rhel-7.2
 - rhel-7.3
 - ubuntu-14.04
or the testcases are no longer available:
 - QTBUG_14292_filesystem in qactiongroup

Change-Id: I80a4397059fafba169096440fdc07d45c76a1ed8
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
2018-02-12 17:40:12 +00:00
Sami Nurmenniemi
44402f5075 Skip tst_QDBusAbstractAdaptor peer tests
The peer Tests for QDBusAbstractAdaptor are so flaky that it's
very difficult to get any commits through to qtbase.

Task-number: QTBUG-66216
Change-Id: I8da80f71aa832e683f72129cb2d4785425d39c00
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
Reviewed-by: Sami Nurmenniemi <sami.nurmenniemi@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2018-02-09 18:45:15 +00:00
Allan Sandfeld Jensen
2c25a431d0 Use dependencies instead of CONFIG+=ordered
Also drops a few instances where the dependency was purely runtime,
especially for examples.

Change-Id: I2a0476f79928143596bdb3b8f01193af90574ae8
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2017-12-02 11:09:15 +00:00
Marc Mutz
94cf203f36 Use QSharedPointer::create() more
This is the result of running the (experimental) clang-tidy check
   qt-modernize-qsharedpointer-create

Discarded changes:

- tst_qsharedpointer.cpp: not sure we want these replacements there
  (→ separate change)
- tst_collations.cpp: hit in a template specialization that is
  instantiated with both QSharedPointer and QSharedDataPointer.

Change-Id: I203c2646e91d026735d923473af3d151d19e3820
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-07-19 13:40:42 +00:00
Simon Hausmann
3fb0852091 Skip the dbus abstract adaptor test on OpenSuSE 42.1
It has been crashing for months...

Change-Id: I1d6077f949d642465771c4d618babc64ebc340f6
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2017-07-07 09:40:14 +00:00
Thiago Macieira
19296bc7b0 Add Q_FALLTHROUGH to QtDBus tests
There was only one place that needed it.

Change-Id: I067fcfe299b34ab6a771fffd14bf2945f1953d10
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2017-05-17 16:16:02 +00:00