ConfigLocation was erroneously inconsistent, by adding the org name
and app name on Windows (unintentionally) and not on Unix (while having
subdirs in ~/.config is actually common practice for some XDG desktops)
Therefore this adds AppConfigLocation, which always has the org name
and app name (while GenericConfigLocation never does).
[ChangeLog][QtCore][QStandardPaths] Added QStandardPaths::AppConfigLocation,
for application-specific configuration directory. ConfigLocation was inconsistent.
Task-number: QTBUG-38872
Task-number: QTBUG-38845
Change-Id: I80fb98f296436261f3996c9df87571c29b06ab35
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
qHashRange() takes an (input iterator) range and hashes each element, combining
the hash values using the hash combiner from Boost/N1837 with the magic number
0x9e3779b9, as described here:
http://stackoverflow.com/questions/4948780/magic-number-in-boosthash-combine
qHashRangeCommutative() does the same but with a cummutative combiner (unsigned
addition) to create hash values that are order-independent, e.g. for hashed
containers. The obvious combiner, XOR, is a bad one because it eliminates
duplicate elements. Signed addition cannot be used, since signed overflow
leads to undefined behavior.
[ChangeLog][QtCore] Added qHashRange() and qHashRangeCommutative() functions to aid
implementing qHash() overloads for custom types.
Change-Id: I3c2bbc9ce4bd0455262a70e0cf248486525e534f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This patch is a forward-port from 4.8 branch
(d869e1ad4b0007757e97046609de2097cd9e9c5d).
Change-Id: I6ae36a5417d1176fbecf775668f6033b1cb22a94
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
%{threadid} should have been %{qthreadptr} but we forgot to make the
change for Qt 5.4. So do it now.
[ChangeLog][QtCore][Logging framework] %{threadid} now prints the real
thread ID. On Linux, OS X, iOS, FreeBSD and Windows, the value is unique
system-wide. On other systems, it will print something that may be
process-specific (the value of pthread_self(3)). To print the pointer
to QThread::current(), use %{qthreadptr}.
Change-Id: Ie383ff864a11966cf5d095b966a30ace65d34ee6
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
... which is the module-wide include, bringing in the entire QtCore.
Change-Id: I5cd872efa4562917fc4e3850809cb7595710c43a
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
This has been deprecated since QDBusContext was introduced (Qt 4.3). So
it's time to remove the functionality.
[ChangeLog][Important Behavior Change] QDBusConnection::sender()
(deprecated since Qt 4.3) has changed to always return an invalid
QDBusConnection. To know what connection the incoming call was received
from, use QDBusContext.
Change-Id: I355efb82c14e54ed718c8f892d8267e727b19118
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
QFileSystemWatcher does not signal directoryChanged() when files are
modified in a watched directory. QTBUG-8945 was closed with the
decision that it should not signal. Updating the docs and tests to
reflect this fact.
The test code that is being changed is a partial revert of Qt4 commit
1428cc6d71a65c1ac7123c9c4cc3cfaf225cceed. It appears that Symbian
supported directoryChanged() on modification, hence why the check
was for 0 or 1.
Change-Id: I04320c68f227ca338ce65e525956ee201fd50699
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
This is in preparation of adding more qHash()-related tests.
Change-Id: Iae65bf8b123e1d6ac6d1eb34d74ba4eb9df8173c
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Under DBus it is possible to have methods and signals with the same name
or have methods which are reserved c++ keywords.
For example the logind session interface has a signal and method both
called Lock.
This patch allows generated methods to use a different method name
specified in the annotation that the original DBus name in the DBus
interface in a similar manner to how one can rename accessors.
[ChangeLog][QtDBus] Add annotation org.qtproject.QtDBus.MethodName to allow
autogenerating C++ methods with different names to the original DBus method
Change-Id: I08bbe77554fbdd348e93f82d45bab0d75d360c27
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
We already let enter/return key presses to reach text edits instead
of closing the editor. Do the same for tab/backtabs.
[ChangeLog][QtWidgets][Important behavior changes] QItemDelegate will
now not close a QTextEdit/QPlainTextEdit editor when the tab key
is pressed; instead, the key will reach the editor.
Task-number: QTBUG-3305
Change-Id: Ife9e6fdc5678535c596d1068770b0963134d8d5a
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Thorbjørn Lindeijer <bjorn@lindeijer.nl>
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
The interface macro needs to be in the Qt namespace, otherwise the
template specialization in Q_DECLARE_INTERFACE fails.
Task-number: QTBUG-41959
Change-Id: I818da5ba8460219d73c0d248ee410ac92f7498f4
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Tony Sarajärvi <tony.sarajarvi@digia.com>
Reviewed-by: Stephen Kelly <steveire@gmail.com>
We want to use "localhost" if the server's address is "any", as some OS
can't send datagrams to "any" (e.g., OS X and FreeBSD).
Change-Id: I1004bc2282e7f930cdb7ed394aa9f4b5a1cfcf82
Reviewed-by: Richard J. Moore <rich@kde.org>
On my Mac Mini, port 5000 is in use, which means the broadcasting test
fails.
Change-Id: Ifb0883263e277f388342430349ea7315d42f324a
Reviewed-by: Richard J. Moore <rich@kde.org>
It was unconditional. Someone forgot to check for IPv6 support before
skipping IPv6 tests.
Change-Id: I7b11528ad02560f0db9defde3c64f76f48a6c1f8
Reviewed-by: Richard J. Moore <rich@kde.org>
Fix indention, add empty line as separator, undef a local macro.
Change-Id: Ie0d8529322f87ca2bdedb9a7f2f4cf9f463a6e12
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Split off default-value check from getSetCheck().
This is in preparation of extracting getSetCheck_data().
Change-Id: I869c34014a92e29a07dc08584a93a4cbba372518
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
QUdpSocket doesn't support binding to QHostAddress::Any and then joining
an IPv4 multicat group since QHostAddress::Any is really an IPv6 socket
with v6only = false. The test did check this case, but failed to ignore
the warning.
Change-Id: I62d782408319a6e566e0ff1a6081b706ac1f669c
Reviewed-by: Richard J. Moore <rich@kde.org>
With IPv6, you cannot bind to a multicast address. You need to bind to a
local address only. The previous tests either checked this or didn't
check the result of bind().
Change-Id: Ief70887d8988fc1bc4394cf6ff34b5d560e5748e
Reviewed-by: Richard J. Moore <rich@kde.org>
[ChangeLog][QtCore][QThreadPool] Added QThreadPool::cancel() which allows
removing from the job queue a job that hasn't been started yet.
Change-Id: Ib8f1c1f32a34f5eec8338c641d820b928e470164
Reviewed-by: Nick Shaforostoff <shafff@ukr.net>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Sending 100*8 packets of each type of message is WAY overkill. That's a
stress test without limiting. My Linux system starts reporting EAGAIN on
the socket, so reduce the amount of data sent.
Change-Id: I153f44cf3b91d37526dac580b400114cc80b1769
Reviewed-by: Richard J. Moore <rich@kde.org>
IPv6 has no such thing, so don't try to bind to an IPv6 address to send
broadcasts (even though that works) and it's a poor idea to bind to IPv6
to receive broadcasts. Moreover, skip any IPv6 network addresses
(broadcast() is invalid).
Change-Id: I2829b042c000158565adfd92db682f37d67dacae
Reviewed-by: Richard J. Moore <rich@kde.org>
If you don't have /etc/lsb-release, you'd get
sh: line 0: [: =: unary operator expected
Change-Id: Idb5c79f799879e4d32cd640ef74fb388227f831e
Reviewed-by: Richard J. Moore <rich@kde.org>
It doesn't make sense because there is no command to ask the proxy
server to join a multicast group. At best, we could write a datagram via
proxy without joining, but we definitely can't receive.
Change-Id: Icc6b54572a053fb7821dfca1f4111f2046ff8686
Reviewed-by: Richard J. Moore <rich@kde.org>
Behavior will agree with the docs.
[ChangeLog][QtGui][QWindow] lastWindowClosed will be emitted even if
quitOnLastWindowClosed is not set
Task-number: QTBUG-32956
Change-Id: I7bb269d53894859fee27e171eea7ad472ea86af0
Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
This is a temporary measure while the Qt CI system is updated to have
the correct D-Bus configuration. Once it is fixed, this commit should be
reverted, so that we don't run into the situation in which the tests
aren't getting run on some configurations and we never know about it.
Change-Id: I7192d4d95a60dcb63acfa6cc90bfdc58592b0664
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
The /home path doesn't exist on Android, so it doesn't work as
a non-writable current dir. Instead we use /data on Android.
Change-Id: Ib779f60822da1bef421a16a00c1030245a8c5b90
Reviewed-by: BogDan Vatra <bogdan@kde.org>
The qtlogging.ini file needs to be detectable by QFINDTESTDATA,
so we put it in a qrc file on Android.
Change-Id: I5fb0217098c56f2b2e99ab8d1642c4a7904b18d1
Reviewed-by: BogDan Vatra <bogdan@kde.org>
This test requires building a console application first, deploying
this as part of the APK and then being able to execute the
bundled file from the main application. Since IPC is a limited
use case on Android, we just skip this test instead.
Change-Id: Ie68e495ff64b69e7027924291a411b5de0e2da76
Reviewed-by: BogDan Vatra <bogdan@kde.org>
Test requires that tst_qiodevice.cpp is available on file system,
but since we're not able to deploy directly to the file system
on Android and since we want to actually test file system access,
we bundle it in qrc and copy it out during initialization.
Change-Id: Ida2b5bf6f1dcd43bc740a2b9380352bab5eb6c62
Reviewed-by: BogDan Vatra <bogdan@kde.org>
Some of the tests expect QDir::homePath() and QDir::currentPath()
to be different, so we just set the current path to something
other than QDir::homePath().
Change-Id: Ib048d323f4745369821765230b995a73b8a97145
Reviewed-by: BogDan Vatra <bogdan@kde.org>
This test may not be possible on Android, since the file system
can be mounted with noatime or relatime which means read access
will not be registered.
Change-Id: I40f587e1a1f131ee06f0e3700e908ccaa19c83ce
Reviewed-by: BogDan Vatra <bogdan@kde.org>
Since there's no way to deploy files directly to the file file
system on Android, we put them in a qrc file and extract them
on startup.
Change-Id: I6a42aa5e0372bfd9fb2f7ccfea964c9c3c2e45d8
Reviewed-by: BogDan Vatra <bogdan@kde.org>
This test requires that the resources are also available
in the file system. Since it's not possible to deploy directly
to the file system using Android, we extract the files on
startup instead.
Change-Id: I1d1fe7d62c4c618a89713e3a7d1903e42bfb10b8
Reviewed-by: BogDan Vatra <bogdan@kde.org>
There's no way to install files automatically into the file
system on Android, so to test QDir on the file system, we have
to bundle the files in qrc and then copy them into the file system
on startup. This adds some complexity, but at least it will detect
regressions.
We also need to make sure the current directory is the same as
the data path, since the test assumes this, and /usr/ does not
exist on Android, so we have to use a different path to find the
root path.
Change-Id: I18d79b5ed99a0afff573beb30c61745c403f8991
Reviewed-by: BogDan Vatra <bogdan@kde.org>
This will arbitrarily fail at certain points. Adjusting the
timeouts helps, but it's very unpredictable, so it's better
to do what we do on Windows and just expect-fail the results
that we get.
Change-Id: Ie6033c73539c2dd69115b06096919e173f097367
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: BogDan Vatra <bogdan@kde.org>
Add all test data to resources.
Change-Id: Id42a4c033b75409f65cb4d56ebf1161336b93832
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
We must add all test data to resources.
Change-Id: Ic12f8fce9afb965aff32e7141516c8d223e64491
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
We must add all test data to resources.
Change-Id: I7f9e7650156b174b7c16270d86b78e9408dff254
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
Add test data to resources.
Change-Id: Ib8a5688e7caab8434b8f0676f53a2a79ec94b264
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
Wait for the subprocess to print "ready" before assuming that it is
ready to receive calls. waitForStarted() will return as soon as the
child is running, but it may not have registered on D-Bus yet.
This also solves the synchronization problem more elegantly than how
tst_qdbusmarshall.cpp was trying to do it.
Change-Id: I548dfba2677cc5a34ba50f4310c4d5baa98093b2
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
The executables are not in the same dir as on Unix, so we need to use
QFINDTESTDATA to find them. The DESTDIR setting prevents qmake from
placing the executables in a "debug/" subdir.
Change-Id: I1d6d10e6f6f109f55fd9809dcf83da0386f38772
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Rohan was right in e88f9a92b7 to stabilize
the test and reset the state, but killing the subprocess is overkill.
All we need is to reset the state in both applications, which includes
disconnecting and reconnecting to the peer, to discard any sent but not
yet received messages.
Change-Id: Ie01392e6e63bd70ef8345217d3fc641ed63c7aba
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
QDBusServer::address() will return an empty QString, which caused the
tests to fail later with no apparent reason.
Change-Id: I86f448dfc67a6cdb27ecda2d490f335766cfaf4f
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
This allows the tests to be run on Windows too by using TCP socket
connections instead of requiring Unix sockets. The tests shouldn't have
hardcoded the path, which came from QDBusServer anyway. Now the tests
simply defer to QDBusServer.
This is a slight behavior change for Windows, but not one that should
matter since anyone who was using the default constructor resulted in a
QDBusServer that failed to listen.
[ChangeLog][QtDBus][QDBusServer] Fixed a bug that made QDBusServer's
default constructor try to bind to a Unix socket on non-Unix systems.
Now QDBusServer will attempt to bind to a TCP socket instead.
Change-Id: I2a126019671c2d90257e739ed3aff7938d1fe946
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Basically, introduce a small check for this corner-case situation.
Setting a model doesn't just store a pointer, but also resets the current
index, changes the line edit completion model, and so on, and seems silly
to trigger changes in such cases.
[ChangeLog][QtWidgets][QComboBox] A QComboBox does not reset itself any
more when setting the same model more than once.
Change-Id: If028b36cdfaa5552c156dd900e123ca9a04d4e3d
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>