Starting from iOS 11.0 (SDK) Apple has exposed two new functions:
SSLSetALPNProtocols and SSLCopyALPNProtocols. This allows us to
negotiate http/2 (and any other application layer protocol) via TLS on
iOS. Unlike OpenSSL, SecureTransport's version is very limited - we
have to compare protocols manually after the SSL handshake has
finished. Still, this is better than nothing. These two functions are
also declared in macOS SDK starting from 10.13, but unfortunately the
symbols are missing and for now this feature is only enabled on iOS.
Change-Id: I3ed2f287bfa864f8aca0c231171e804f7d6b8016
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
In the case when user's local encoding is UTF-8, QDirIterator
may list entries which names can't be correctly converted from
UTF-8 to UTF-16, e.g. for "\xC0\xB0" file name QDirIterator::fileName()
returns "\uFFFD\uFFFD" (FFFD is a code of Replacement Character).
The problem is that you can't do anything with such directory
entries because there is no way to get the original entry names.
List only those names that can be converted to QString
and then back to the local encoding without corruption.
Change-Id: Ib6a71dea8ce9601876040c07276c325fd997e767
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Adds support for OpenURI and Email Flatpak portals. To support them we
just do specific DBus calls, which are then caught and forwarded by
xdg-desktop-portal daemon/service. This is needed for Qt applications
running in sandbox, otherwise they cannot open links or email clients
inside sandbox. Other portal support, like for opening files can be
added into a platform theme, but adding support for OpenURI and Email
portal requires writing custom platform services plugin and this is only
possible when you write complete platform plugin, thus we want to have
this support directly in Qt. Support for other portals will most likely
follow soon, but at this moment we have to get rid of creating our
custom platform plugin to just have our own platform services for
flatpak support.
[ChangeLog][Platform Specific Changes][Linux] Added support for flatpak
portals. Flatpak is a software utility for software deployment and
package management. It provides a sandbox environment in which users
can run applications in isolation from the rest of the system. To
communicate with the system flatpak uses portals, which are designed to
be a bridge between sandboxed applications and desktop/system running on
user's computer. Flatpak runs automatically this as service, called
xdg-desktop-portal, which exports portals on DBus and which are by
default visible to all applications running under Flatpak.
Change-Id: Ice57ad120d30a3154b133172c79d8e9d6e61bd4c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This allows us to make sure that the PID we read is from the same boot
as we are right now running. The collision could happen on embedded
systems where the boot sequence is fixed, so all the same processes
would have the exact same PIDs after reboot as they did before.
[ChangeLog][QtCore][QLockFile] QLockFile can now properly conclude that
a lock file from a previous boot of the same device is stale and can be
removed. This is implemented only for Linux and Apple operating systems.
Task-number: QTBUG-63425
Change-Id: I0b48fc8e90304e0dacc3fffd14e8e3a197211788
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
Looks like there are conditions in which they could be used during shut
down and thus access an already-destroyed static. This was tested in
test tst_lockfile.cpp:LockFileUsageInGlobalDtor.
Change-Id: I57a1bd6e0c194530b732fffd14f4dae39ab1ae2c
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
This allow retrieving the value of the known PMTU for the current
socket. This works on Linux (IPv6 and IPv4) and FreeBSD (IPv6 only) --
the other OSes don't have the necessary API.
Note: do we need add IP_MTU_DISCOVER?
Change-Id: I6e9274c1e7444ad48c81fffd14dcaf97a18ce335
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
We document that -1 is not a valid value. The Windows structure's type
is unsigned, so the value is actually ULONG_MAX.
Change-Id: Ic632b4163d784b83951cfffd14f668645c4da3a9
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Since we very often need to write our intrinsic-using code in C to avoid
"leakage" of not-inlined inline functions, this file is very handy.
Change-Id: I57a1bd6e0c194530b732fffd14f45d27a32538f8
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
because some packages create resource input files at build time
and thus get the build date embedded in binaries,
so that they differ for each build.
See https://reproducible-builds.org/ for why this matters
and https://reproducible-builds.org/specs/source-date-epoch/
for the definition of this variable.
Task-number: QTBUG-62511
Change-Id: I8908ac6182fab066e6ea398df2567f6d050c77e7
Reviewed-by: hjk <hjk@qt.io>
This amends f8807b8220.
Q_PROCESSOR_ARM_64 was only tested in qt5 integration.
Task-number: QTBUG-64393
Change-Id: I4471c2db3dc07e47e1825c2539c32c4d2a073396
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Exclude the relevant files from being built if it is disabled, and add
QT_REQUIRE_CONFIG(dnslookup) to the headers.
Change-Id: I3af298dc87d63c93f724928dd1135c20eba33045
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
The different flip-functions have been replaced by a single function,
qt_mac_flip, with overloads for points and rects. This function is
primarily used to implement QCocoaScreen::map(To|From)Native, which
most clients of qt_flip* have been moved to. This makes it clearer
what kind of reference geometry we're flipping in relation to, and
simplifies call-sites.
Change-Id: I8a0862f94bb2c64a83a1c3168f984a195c0af6db
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Replaced two AArch64 specific instructions with 2-3 instruction
replacements from ARM32.
Change-Id: I5cbbda5afdaabea52babaaf8e5cc57262d897159
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
[ChangeLog][QtWidgets] QDesktopWidget has been deprecated. Use the
corresponding QScreen functions instead.
Task-number: QTBUG-62094
Change-Id: I0941d2aa27a06ec650ca52d6467e5bfb0ad43459
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
In c2049f67e4, all DBus I/O was
moved into a service thread. The dispatch lock used to protect
DBus I/O in the threading setup before that commit. It is not
needed anymore.
No discernible difference in QtDBus benchmarks, roughly 500
bytes code size reduction on AMD64. The main point is to reduce
confusion from unnecessary code.
Change-Id: Idcbdd2b7e2b317cf6da0b5bfc5ec70afed1f1b48
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
There's no replacement function from Apple's side, so we have to iterate
the available displays and pick the right one based on the vendor, product
and serial number.
Change-Id: I437bee06bc6826c3214a701cd2c65f6109eeb3e7
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
We're not going to rewrite this code until we can also share the rewrite
with QPpdPrintDevice, which can only happen once we drop support for
RHEL 6, which still ships CUPS 1.4.
Until then, silence these deprecation warnings so that they don't add
noise to other potential build warnings/issues. This matches the
approach taken by Chromium in crbug.com/622493.
Task-number: QTBUG-56545
Change-Id: Ia308ae1e8064dc046745350b0be3992d02f2b760
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
We want to know when a plugin uses deprecated Qt APIs, especially
deprecations in the QPA APIs, which today is not the case, so
platform plugins have no idea that they should transition.
Change-Id: If9d3d95dc6f1f4178b103f177c9eb8326767ffab
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
[ChangeLog][QtNetwork][QNetworkInterface] Added dnsEligibility() to
QNetworkAddressEntry to indicate whether the address is eligible or not
for publication in DNS or similar mechanisms.
Change-Id: Id3ae5f853d964358ac1ab19b525334a426e0e052
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
[ChangeLog][QtNetwork][QNetworkInterface] Added preferredLifetime() and
validityLifetime() to QNetworkAddressEntry that report the remaining
lifetime of the address in the network interface.
Change-Id: I292b84e2193979446e43344b0727642812cba630
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
This allows us a lot greater detail in getting information than relying
on getifaddrs() function. It is also the only way of getting some extra
information we'll need in the future, like address lifetimes.
The parser will also be helpful if we want to add a network interface
monitor in the future, though I currently have no clue how to do the
equivalent on macOS and Windows.
This commit does not remove the support for getifaddrs() on Linux, but I
will no longer add features to it. Note that Android does not support
getifaddrs(), so this may be an improvement if AF_NETLINK works there.
Change-Id: I3868166e5efc45538544fffd14d8e6f993e1eb91
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
The test OPENSSL_VERSION_NUMBER >= 0x1010000000L was introduced before
1.1 support. Now a couple of conditional inclusions can be converted
into QT_CONFIG(opensslv11).
Task-number: QTBUG-64275
Change-Id: I627e6b06f334deac70c827e463ecbfad879dfc24
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
The feature belongs to qtdeclarative and will be added there.
Change-Id: I2faf89f6caf841958e60efed8ff3882e530f0720
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
QWinTimeZonePrivate is based on QTimeZonePrivate, so can reference its
members without prefix.
Change-Id: I7b6bc33f70c4a497ec0caf897d48886a21f8fd65
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The milli-seconds since epoch value for an invalid transition is,
of course, invalidMSecs(), not invalidSeconds().
Added a comment while I was at it, explaining why we expect a
transition before the epoch, if such transitions are supported.
Change-Id: I0f376f9d69c0e6e79a309dc011943baa41175135
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Exclude QHttp(Multi)Part from being built if http is disabled, and
replace the exclusion macros. Use the qmake project files to exclude
source files, and QT_REQUIRE_CONFIG(http) in headers.
Change-Id: I432fa3c78aa97b5ed2eb1027ac1dc3bdb134f9ba
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
... that become apparent after switching qtestlib to use enhanced mouse
event (a37785ec76). With the old code path,
where QGuiApplication was deducing event type it would deduce mouse release
event even when there wasn't one. The new code path doesn't do that, which
revealed an obscure problem when mixing QTest::mouse* APIs (where QWindow
overload goes through QWindowSystemInterface API and QWidget overload goes
through QApplication::notify() and sets mouse_buttons from there). What
happened in this specific test case "./tst_qtreeview selection statusTip" was:
// tst_QTreeView::selection sets mouse_buttons = Qt::LeftButton from QApplication::notify
QTest::mousePress(widget, Qt::LeftButton, ..)
// tst_QTreeView::statusTip
QTest::mouseMove(window, )
The old code path sees that position and state has changed, creates a fake
mouse event, which gets deduced as mouse release even if there wasn't one.
And by luck this happened to set mouse_buttons=Qt::NoButton. So when we use
mouse_buttons later to create QMouseEvent everything works as expected. With
the enhanced mouse we don't clear the pressed button from mouse_buttons (set
in tst_QTreeView::selection) as this is done only from press/release events,
then pass it to QMouseEvent and later because of that QApplicationPrivate::
pickMouseReceiver() returns nullptr.
The fix here is to use e->buttons when constructing QMouseEvent, instead of
relying on mouse_buttons which gets changed from various places and has other
issues that can not be solved without invalidating the current documentation
of QGuiApplication::mouseButtons() (e.g QTBUG-33161). Tests and any Qt code
in general should avoid using the fragile QGuiApplication::mouseButtons() API.
This patch does not affect the old code path (it continues working as before)
and fixes the issue described above for the enhanced mouse API. The enhanced
mouse API actually is better in a way that it does not get affected by button
state from test functions that run earlier, as opposed to the old code path
where every subsequent test function uses mouse_buttons in whatever state it
was left by the test functions that run earlier.
Not relying on mouse_buttons when creating QMouseEvent helped also to discover
other logic error. This caused an in incorrect button state for a mouse move
event that is generated for a release event that simultaneously changes a mouse
position.
Task-number: QTBUG-64043
Change-Id: I6ad8e49d8437ab0858180c2d0d45694f3b3c2d60
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
We can use the D-Bus / systemd machine-id file (which is a UUID without
the dashes) on systems with D-Bus. On Windows, there's a value in the
registry that is filled when Windows is installed, like on Linux. For
BSD systems, the kernel has a UUID we can use too, so extract that.
Task-number: QTBUG-63425
Change-Id: I27eaacb532114dd188c4ffff13d32f2e3c1d74bb
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Remove long unused preload defines, make sign of alpha more consistent
and use the RGB64 define structure more.
This is preparing for trying to unify the declarations in case we need
a third form with floating points for HDR.
Change-Id: I47fc283aff1fe31a1eaba17e0413bc1e722f6a06
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
ultrix and reliant have not seen a release since 1995. dgux not since
2001. bsdi not since 2003. irix not since 2006. osf not since 2010.
dynix... unclear, but no later than 2002. symbian needs no mention.
All considered obsolete, all gone.
sco and unixware are effectively obsolete. Remove them until someone
expresses a real need.
Change-Id: Ia3d9d370016adce9213ae5ad0ef965ef8de2a3ff
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
We don't actually need it in that case, but as the code that uses it is
disabled by a constant expression we cannot disable the variable itself
by a macro. The static_cast makes sure the compiler does not complain
about implicitly casting a 64bit value to a 32bit one.
thread/qsemaphore.cpp:156:59: error: large integer implicitly truncated to unsigned type [-Werror=overflow]
Task-number: QTBUG-64261
Change-Id: I96f53e28b290e57033737b4f994f8af5b5666587
Reviewed-by: Liang Qi <liang.qi@qt.io>
The RENAME_NOREPLACE flag is supported for all Linux local filesystems,
since that can be easily checked by the VFS layer (it knows which files
exist and which ones don't). For non-local filesystems, the backend
needs support and that might need server-side support too. So we may get
EINVAL errors for those, in which case we fall back to link/unlink,
which in turn can fall back to rename().
EINVAL can also happen if we attempt to make a directory a
subdirectory of itself. In that case, we will attempt to link() it,
which will result in EPERM as we can't hardlink directories. Then we try
rename() again, which should result in the expected EINVAL.
Task-number: QTBUG-64008
Change-Id: Icaa86fc7b54d4b368c0efffd14f09ca23602dd2e
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
All accessible interfaces are stored in a cache, we never pass ownership
to callers.
Change-Id: I99f0e27baf111e4ca820c8f31875c0c55b4d6edb
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
This warning used to be part of -Wconversion, but that generates too
more noise than we're willing to fix now (like conversion from qint64 to
int). The float conversion does trigger for conversion from double to
float, as shown in all the QVectorND uses of float, but more
importantly, it triggers on passing floats to ints.
Change-Id: I69f37f9304f24709a823fffd14e69cfd33f75988
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Discussed during Qt Contributor Summit 2017. We concluded that we don't
want to make these functions public, as they do not follow Qt coding
style API. Specifically,
qStartsWith(a, b)
is not easily understood which argument is the needle and which argument
is the haystack (same problem memcpy() has). Compare that to
a.startsWith(b)
which can clearly be read in English as a subject-verb-object sentence.
This commit removes the unit tests that called compare().
Discussed-on: http://lists.qt-project.org/pipermail/development/2017-October/031060.html
Change-Id: Icaa86fc7b54d4b368c0efffd14ee6205eb9043fb
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Right now,this does really nothing. This commit is just to allow us to
transition the other modules (besides qtbase) to use the syntax that
will become the API.
I've marked three places to use the system CSPRNG:
1) the QHash seed
2) QUuid
3) QAuthenticator
I didn't think the HTTP multipart boundary needed to be
cryptographically safe, so I changed that one to the global generator.
Change-Id: Ib17dde1a1dbb49a7bba8fffd14ecf1938bd8ff61
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
I'll need it in the AF_NETLINK implementation of QNetworkInterface.
Change-Id: Icaa86fc7b54d4b368c0efffd14ef5ce895d0ed5b
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
It fails for me on Windows 10. Therefore, this is wrong.
FAIL! : tst_QHostInfo::initTestCase() 'networkSession->waitForOpened(30000)' returned FALSE. ()
S:\qt\qt5-msvc2017-x64\qtbase\tests\auto\network\kernel\qhostinfo\tst_qhostinfo.cpp(194) : failure location
Change-Id: Ib17dde1a1dbb49a7bba8fffd14ed5691472a4760
Reviewed-by: Jesus Fernandez <Jesus.Fernandez@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
A follow-up patch for 8e70241dcc:
Make 'shareContext' conditionally included/compiled
(protected by QT_CONFIG(opengl)).
Change-Id: Ieaeea6b146b47fba7a77e2576ae0a33042280199
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
This patch removes mouse_buttons related code from qwidgetwindow.cpp
as it does not belong there for the following reasons:
- The commit (ed2a2dc6da) that added it in
Qt5 says that the logic was copied from qapplication_x11.cpp (filename
in Qt4 repository). Other qapplication_*.cpp platform implementations
did not have this kind of logic; thus having it in cross platform location
qwidgetwindow.cpp does not make sense.
- According to the documentation, QApplicationPrivate::mouse_buttons:
"Returns the current state of the buttons on the mouse. The current state
is updated synchronously as the event queue is emptied".
So the only place where changing this variable makes sense is in
QGuiApplicationPrivate::processMouseEvent, which is *when the event
queue is emptied*.
There are other places in source code where this variable is changed,
but all of those are hacks and should be cleaned out eventually:
// a hack due to insufficient QWindowSystemInterface API
plugins/platforms/windows/qwindowsdrag.cpp
// a hack to support code that bypasses QWSI API when sending mouse events
// via qApp->notify().
widgets/kernel/qapplication.cpp
- AFACT, the released button bit will be already unset by the time mouse
release event reaches QWidgetWindow::handleMouseEvent.
Change-Id: Ifb2b3b443ffff0274545e5d3c631cf1e77160502
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>