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>
Using QPointers (or any type that makes a QPointer part of its identity) as a key
in any associative container is wrong. They get externally set to nullptr,
violating the associative container's class invariants, which could lead to
data corruption, even though bucket-based hash implementations are less susceptible
than binary trees.
To fix, write a new class that acts much like the old QPair<QPointer<>,QByteArray>,
but uses the QPointer only as a guard, not as part of its identity. To preseve
identity, also saves the naked pointer originally passed and uses that for op==
and qHash().
Change-Id: I4fa5a6bf86bad8fe7f5abe53d7c7f3ad3754d8d6
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The old code creates a RestorableId from the passed (QObject*, QByteArray)
and used it for lookup in a hash table (ok) and as a container for the
(QObject*, QByteArray), satisfying later references to those parameters
from the RestorableId instance instead of using the parameters directly.
Now, RestorableId holds the QObject* in a QPointer, so the code might have
wanted to detect the object being destroyed as part of the operation, BUT:
a) the operation is a read-only one, and b) the code didn't check for
nullness before dereferencing the QObject*.
Fix by moving the creation of the RestorableId into the scope it's used
and otherwise using the parameters directly.
Change-Id: Iaf12f722fe6841ee1a55037fe33a6115aa699aca
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 is the modern, correct way of providing a swap
operation. See http://stackoverflow.com/a/8439357/134841 for more
information. By changing this, we also fix Qt building with ICC
and libc++.
This patch also adds a noexcept() rule to match what the C++11 standard
requires.
Change-Id: I18f22fe7c92cf253e94168e1312346b4c183f536
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
This is primarily to get a cleaner build of src/tools
under -Wnoexcept.
Change-Id: I0dea21e70aad56b25675fc59fac0327b55ee83e3
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
If reset is disabled then POST and PUT requests can not be authenticated
as the upload device can not be reset. There shouldn't be any reason
that shouldn't be allowed if the QIODevice given supports resetting.
The disableReset feature of QNonContiguousByteDevice is removed as it
is not used anywhere else, and is redundant when reset can indicate
success or failure.
Task-number: QTBUG-43628
Change-Id: If941a98fd3f797872351c10bdca6aa6745dbefea
Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.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>
Adds a configure check for System V and POSIX IPC.
System V takes precedence over POSIX IPC, and if both
are not supported, QT_NO_SHAREDMEMORY and
QT_NO_SYSTEMSEMAPHORE are defined.
This patch is a forward-port from 4.8 branch
(6ef4abaa9cd7d465cbae5cbf8cb4664bef387d10).
Change-Id: I3ec20342f0f0266843479634109b67c6989dd296
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This removes one of the last references to 10.6.
Change-Id: Ie23d9aba698714460e7478a421e85d4ad50d4ec9
Task-number: QTBUG-43505
Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
Exposes two options from libjpeg: the optimize option and progressive scan option.
These are both lossless operations, so they do not change the image's quality.
Using these switches can result in smaller jpeg files.
Task-number: QTBUG-20075
Change-Id: I8d0bd6a712b8a365265b7bd517e136b0755b90cb
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
Reviewed-by: aavit <eirik.aavitsland@theqtcompany.com>
Do not include other headers from the main qlibinputhandler_p.h that
serves as the external interface to the generic plugin for example.
This way the clients do not need to care about xkbcommon headers and
such.
Task-number: QTBUG-43498
Change-Id: I56335cb19200fee830bdf4b1d203904f741f7489
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
Detect OS kernel version 10.0 as Windows 10.
Task-number: QTBUG-43413
Change-Id: I39307cf8cc2e7cc209d6a88b8576db87086fa20e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
And only export those functions which are actually out-of-line.
This prevents exporting all the inline methods of QVersionNumber,
so we can more freely tune the implementation after its release.
Change-Id: Ie0c5e3f95fea9ec9b3dd481058db6c9f5ef2653c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Following c61f8df404, we now prefer overloading
toString() in the type's namespace over specializing the primary template.
Let the docs reflect that and add an example. Also suggest to delegate the messy
raw char pointer handling to the existing toString(QString)/toString(QBA)
overloads.
Change-Id: Id76181faba86aea52588611ea64ea9b95371a733
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The member functions are a bit more complicated, since they require
<type_traits> support, so they're left for another commit.
Change-Id: Icb792468e35c63eb1ae97f62ed023266fb86b89b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This greatly increases the value of qSwap(), since not only does it
automatically do the parallel std+ADL lookup of swap(), but also
now centralizes the rather messy code involved to create a correct
noexcept specification.
Other code now can simply use
Q_DECL_NOEXCEPT_EXPT(noexcept(qSwap(lhs, rhs))).
Change-Id: Ia35df4876b143e86c4150ac452a48c3775c3702b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This is mostly straight-forward, but some things are worth noting:
1. Yes, this is necessary. The noexcept operator looks for noexcept tagging,
not at the contents of the function to determine whether to return true.
The more conditionally-noexcept functions are used, the more important it
becomes that low-level classes are correctly marked noexcept. In that, it
is like constexpr.
2. In accordance with the rules governing noexcept specifications for the
standard library itself, the operator/-family of functions are not marked
as noexcept, since they have preconditions and thus a narrow contract.
Narrow-contract functions should not be noexcept. All other functions
have wide contracts (ie. no preconditions).
Change-Id: I2cb1f951a92dcb25eac4d9afc5b7780311e39492
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This is mostly straight-forward, but some things are worth noting:
1. Yes, this is necessary. The noexcept operator looks for noexcept tagging,
not at the contents of the function to determine whether to return true.
The more conditionally-noexcept functions are used, the more important it
becomes that low-level classes are correctly marked noexcept. In that, it
is like constexpr.
2. In accordance with the rules governing noexcept specifications for the
standard library itself, the get*()-family of functions are not marked
as noexcept, since they have preconditions and thus a narrow contract.
Narrow-contract functions should not be noexcept. All other functions
have wide contracts (ie. no preconditions).
Change-Id: I82e5d34a0293d73ddc98ee231e17e26463ab6686
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>
...because transposed() is inline (and transpose() is not).
This is such a simple transformation (basically, a register rename)
that it should be inlined, even a the expense of another assignment.
(the expense being in the source, not the executable code, of course).
Change-Id: I4e5a574e899a84444de8042d305f34f5a6045a3e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
...because transposed() is inline (and transpose() is not),
and because it makes the code more readable and compact.
Change-Id: I5661ee6251be638fb40c5c748aa50a89de6f7735
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This is mostly straight-forward, but some things are worth noting:
1. Yes, this is necessary. The noexcept operator looks for noexcept tagging,
not at the contents of the function to determine whether to return true.
The more conditionally-noexcept functions are used, the more important it
becomes that low-level classes are correctly marked noexcept. In that, it
is like constexpr.
2. In accordance with the rules governing noexcept specifications for the
standard library itself, the operator/-family of functions are not marked
as noexcept, since they have preconditions and thus a narrow contract.
Narrow-contract functions should not be noexcept. All other functions
have wide contracts (ie. no preconditions).
Change-Id: I9fc94218a2728c272483f9c2826c265f5b11c9b4
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The methods where introduced with commit 01fb843af8, but removed before
the next release in a1898f4466.
Also add a comment that we should get rid of the special Q_CC_MSVC
handling in Qt 6.
Change-Id: I8bb992a59f31a0de7e3f14f34d1d4f604ebfe8f3
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
This should be completely source-compatible, aside from the indirect
header order change.
Change-Id: I4cf8800ea1bfeb3023c7319991ab8ae281c925e8
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>
Since some of the algorithms use other ones, we should not warn about
those. The warnings are supposed to happen only in user code.
Warnings obtained with GCC 5. The Clang change is just to be on the safe
side.
Change-Id: If295899f6ff6534de7b19741d33efc0b5c4c912c
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
It's been there forever, but never used. The timeout is set during the
actual call.
I moved QDBusMessage::type only for padding purposes.
Change-Id: I41dd638ac423078be642077dbf17439d15b5d405
Reviewed-by: Richard J. Moore <rich@kde.org>
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
Instead of the libdbus-1 constants. Though they're exactly the same
because they are based on the protocol wire format, so this is
technically a no-op change.
Change-Id: Ia2c638c4b508497ca693afd9c76e60ba9245f5e7
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.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>
This makes the output slightly easier to read.
Change-Id: I590b9abcb0263ae5f0580391b42e179c47569a8a
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
Very useful to track memory leaks and other silly stuff going wrong.
Requires C++11, but since it isn't enabled by default, it's not a
problem. ALso, only works with "runtime" dbus -- for linked, use
ltrace(1) instead.
Change-Id: Iccb18516cfb729b2b1bf9ee592df4a1adefeb3b7
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
This does not try to remove support for RVCT. There has been no report
of it working or failing to work, so the status continues to be unknown.
In particular, the inline assembly code in atomic_armv[56].h remains in
place.
This commit only removes workarounds for compiler bugs or bogus
warnings, assuming that anyone using this compiler has updated since Qt
last tried to use it for Symbian in 2011. Note also how anonymous unions
are now part of the language in C++11.
Change-Id: Idc4fab092beb31239eb08b7e139bce2602adae81
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Some example code creates the backing store before the platform window.
Make this case working by calling create().
Task-number: QTBUG-43543
Change-Id: I29c260f38eddd15ea09931e814c5dbd031b65505
Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
With non-monospaced fonts the dialog constantly resized itself when hovering
with the mouse.
This patch has the side effect of fixing another annoyance. Don't present duplicated
information to the user, the color name is already shown in the HTML line edit
and it's also updated dynamically.
Task-number: QTBUG-43448
Change-Id: Ieaeda2a5b876cf15391616aed7d30ed352b463df
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Fixes warning with MSVC:
config.cpp(973) : warning C4996: 'getenv': This function or variable may be unsafe
Change-Id: I32d2a521ff82ee9779fbcba76e80ef36a8e02094
Reviewed-by: Martin Smith <martin.smith@digia.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>
Make it compatible with eglfs. The behavior is the same: By default
mouse, keyboard and touch will all be initialized and, when having
libudev support, discovered automatically. The environment variables
QT_QPA_FB_DISABLE_INPUT and QT_QPA_FB_TSLIB can be used to used to
disable the built-in input handlers and to force tslib instead of
evdev, respectively.
This allows embedded systems and applications to easily fall back
from eglfs to linuxfb on devices that are not rendering via OpenGL.
Dynamic hiding/showing of the mouse cursor is to be done separately,
here we provide the necessary device discovery hooks only.
[ChangeLog][QtGui] The linuxfb platform plugin's input device handling
is now compatible with eglfs. The evdev keyboard, mouse and touch code
is compiled in by default.
Change-Id: I44bc661c53ae78c39b0f30486a475b4e639ab2d6
Reviewed-by: Pasi Petäjäjärvi <pasi.petajajarvi@theqtcompany.com>
Reviewed-by: Gatis Paeglis <gatis.paeglis@digia.com>
Coverity (not rightfully) complains that the code is using "iscii",
a uchar obtained by looking up into a table, as an index into the
"uni_to_iscii_pairs" array. Since the array is only 18 elements
long, there's the theoretic risk of accessing it past its end.
However, the lookup of "iscii" never returns values that may
actually go out of bounds. Coverity may be smart enough
to see the values that "iscii" can get and not raise the warning,
but since it does, make the code more robust and add an assert.
Task-number: QTBUG-43642
Change-Id: Id75ca105758b343102ca94137d0379c10e55581a
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
On a small display leftLay is left initialized to a null pointer,
therefore don't try to dereference it.
Task-number: QTBUG-43643
Change-Id: I9d22dac88a3a853ce154a6f64b35fc113abd9262
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>