Commit Graph

33594 Commits

Author SHA1 Message Date
Thiago Macieira
091fd6e524 Unbreak the build and add support for Qt 5.12 too
Unlike qdatastream.h, we can be ready for future versions. Current plans
say we should do Qt 5.12 and then begin working on 6.0.

Change-Id: I38341f8155354cc4a776fffd14e13c2f1362b483
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2017-09-04 18:35:48 +00:00
Frederik Gladhorn
df9de3e454 Bump version
Change-Id: I355b940f568273cf00d55c7c3abc569537be7950
2017-09-04 18:07:28 +02:00
Timur Pocheptsov
6a0f59f9c1 Fix MiniHttpServer (POST/PUT requests processing)
Teach our MiniHttpServer to better handle POST and PUT requests:
read the POST/PUT data too (not headers only), before replying
and flushing. The  original comment says MiniHttpServer does
not support POST/PUT requests, it's not true anymore - we can
handle them (perhaps the simplest/shortest ones).

Task-number: QTBUG-62844
Change-Id: I80260f8ede1bb1b0b9d6042ecd59558bb7e9a998
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2017-09-04 12:11:11 +00:00
Jesus Fernandez
3f1ac58994 Add QPlatformSurface::screen() const
Classes inheriting QPlatformSurface need to return the QPlatformScreen
to allow the platform integration plugin to know information about the
used screen by the surface.

QPlatformSurface and QPlatformWindow had the same function defined, but
it was not possible to call it without casting the QPlatformSurface
pointer.

Change-Id: I1f93fe7c13ebbc51769677038edeca4de5db0024
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2017-09-04 11:36:50 +00:00
Alexander Volkov
fefdb84662 moc: Use 'using' instead of 'typedef' in generated code
'using' is recommended by C++ Core Guidelines for improving readability:
https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#Rt-using
In the case of generated code it can be useful to leave
moc files unchanged when modernizing code with clang-tidy's
'modernize-use-using'.

Change-Id: Iabb4de2aa8d2f9396d8c8d4ee21f80fffff1dadc
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2017-09-04 09:51:52 +00:00
Timur Pocheptsov
50eb44cc9b Introduce Http2DirectAttribute
Now that we have a proper ALPN/NPN + Protocol Upgrade, we can also
add H2Direct - this can be useful for our users that have to work
with either Secure Transport or a TLS implementation not supporting
ALPN/NPN and with 'h2direct' servers in case they have prior knowledge
of HTTP/2 support. The difference with RFC 7540 is the fact we also
allow this 'direct' in case of 'https' scheme (it appears existing
HTTP/2 server implementations support such mode too).

[ChangeLog][QtNetwork] Add Http2DirectAttribute to enable 'direct' HTTP/2
protocol without ALPN/NPN and without protocol upgrade negotiations.

Task-number: QTBUG-61397
Change-Id: I0499d33ec45dede765890059fd9542dab236bd5d
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2017-09-04 07:27:03 +00:00
Giuseppe D'Angelo
75b5db3ce6 Item widgets: make indexFromItem const-correct
The item is not supposed to be modified, so it should be passed
as pointer-to-const. A similar change was already done for
QTreeWidget in b2aeeaf628.

Change-Id: I75d597867771f414821693a50f97c94b05a4ccb2
Reviewed-by: David Faure <david.faure@kdab.com>
2017-09-02 08:14:16 +00:00
Liang Qi
4fa90c1757 Merge "Merge remote-tracking branch 'origin/5.9' into dev" into refs/staging/dev 2017-08-31 14:34:38 +00:00
Liang Qi
112a4af107 Merge remote-tracking branch 'origin/5.9' into dev
Conflicts:
	examples/examples.pro
	qmake/library/qmakebuiltins.cpp
	src/corelib/global/qglobal.cpp
		Re-apply b525ec2 to qrandom.cpp(code movement in 030782e)
	src/corelib/global/qnamespace.qdoc
	src/corelib/global/qrandom.cpp
	src/gui/kernel/qwindow.cpp
		Re-apply a3d59c7 to QWindowPrivate::setVisible() (code movement in d7a9e08)
	src/network/ssl/qsslkey_openssl.cpp
	src/plugins/platforms/android/androidjniinput.cpp
	src/plugins/platforms/xcb/qxcbconnection.cpp
	src/plugins/platforms/xcb/qxcbconnection_xi2.cpp
	src/widgets/widgets/qmenu.cpp
	tests/auto/widgets/kernel/qwidget_window/tst_qwidget_window.cpp

Change-Id: If7ab427804408877a93cbe02079fca58e568bfd3
2017-08-31 14:31:31 +02:00
Mårten Nordheim
1ff52e478b Modernize the json savegame example
Task-number: QTBUG-60625
Change-Id: I8d5bf860478ee2566b9f96854fc6491f088a28fa
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2017-08-31 11:46:04 +00:00
Alex Trotsenko
29ef0d2bcc Simplify QDataStream::skipRawData()
... by using the new QIODevice::skip() function.

Change-Id: I943c4feb896d677f3150da542950595d7f485e75
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-08-31 06:37:07 +00:00
Joni Jäntti
e938150412 Revert "tst_qwidget::activation expect fail on Win 10"
This reverts commit 8561281768.

This change needs to be reverted because Windows 10 Creator's
Update doesn't fail on this test anymore during CI runs.
Reason for this is unknown.

Change-Id: Ice250ecedb14ac96fb3693b2d9884ef452a91cc2
Reviewed-by: Tony Sarajärvi <tony.sarajarvi@qt.io>
2017-08-30 12:49:02 +00:00
Peter Seiderer
b7722c251c Fix error attribute(target("+crc")) is unknown
Task-number: QTBUG-61975
Change-Id: I0b1b55c0737dad485b5ace8e6eb7cb842589453d
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2017-08-29 20:30:59 +00:00
Peter Seiderer
6ce4b680cd examples: fix compile without opengl support
Compile examples/opengl only in case opengl support is available.

Task-number: QTBUG-62372
Change-Id: I742a1eb7b7639a5a722c4d5e9b4ee070b629b02e
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2017-08-29 20:30:45 +00:00
Liang Qi
3088f73cf4 testlib: move strings from functions to array in benchmark metric
Change-Id: Ida7ba60d26171b95ba0e9709eec5c6553efeecca
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2017-08-29 15:52:08 +00:00
Allan Sandfeld Jensen
789f9d0d56 Avoid assert on large clips in qt_alphamapblit_generic
It is (end - start) that represent the number of pixels being worked on
and needs to be smaller than the buffer size.

Change-Id: I75a22bc2656ac1c7d231278c3a1931758090f8ce
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2017-08-29 13:56:59 +00:00
Dongmei Wang
63002b2f37 QFbVtHandler: Remove unused sys/signalfd.h include
Change-Id: Ia9fa3c4de0a1dbdd1b36730c82f5180c2128cbcf
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2017-08-29 13:43:17 +00:00
Timur Pocheptsov
0270651dda Cocoa integration: do not use released session
QTBUG_10735_crashWithDialog started to show flakyness recently - it crashes,
but not every time (which fits the definition of UB perfectly).

While the test itself is doing weird things and puts our event dispatcher
into a weird state, our API allows to:

1. Using QDialog to enter event loop (with runModalSession under the hood), then ...
2. to call from a slot (e.g. timer-attached) QApplication::closeAllWindows() while ...
3. we are still inside that special loop and using the 'session' object, thus ...
4. on the next iteration with [NSApp runModalSession:session] we'll re-use already released
   session (released by endModalSession which in turn was called indirectly by closeAllWindows).

And Cocoa gives us a warning/hint: "Use of freed session detected. Do not call
runModalSession: after calling endModalSesion:."

Task-number: QTBUG-62589
Change-Id: Ie651cee1fba43cfd2b0fc44af5eddc5fd52e2907
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
2017-08-29 12:49:58 +00:00
Joni Jäntti
de6d6eb13e Revert "tst_qgraphicswidget expect fail on Win 10"
This reverts commit 3d5bf00f18.

This change needs to be reverted because Windows 10 Creator's
Update doesn't fail on this test anymore during CI runs.
Reason for this is unknown.

Change-Id: I9f1c88606c97afc5952af34e04310612b783a9c2
Reviewed-by: Tony Sarajärvi <tony.sarajarvi@qt.io>
2017-08-29 11:59:23 +00:00
Alessandro Portale
c827afa282 QWidgets/CommonStyle: Fix tooltip drawing under HighDPI
Delegating the border painting to qDrawPlainRect ensures that there are
no off-by-one pixel issues.

Task-number: QTBUG-61849
Change-Id: I56dc849da80fad00d02a0f9c60dbb621e6de7c48
Reviewed-by: Michael Winkelmann <michael.winkelmann@qt.io>
Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2017-08-29 11:53:03 +00:00
Eirik Aavitsland
01af6771c3 Fix: WebP missing from QMovie::supportedFormats()
Use QImageReader::supportsOption() instead of ::supportsAnimation(),
since the former checks what the handler supports in general, not just
the particular device.

Task-number: QTBUG-61642
Change-Id: I57db24425b4fd8821446659936e6a8ca55008921
Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
2017-08-29 11:38:37 +00:00
Eike Ziller
3b962d16db Fix jumping to anchors with offline style
If the style changes after the browser already jumped to an anchor,
the resulting browser position will be messed up.
So, after we changed the style we need to make sure that we jump
to the anchor again.
Since browsers do not jump to anchors that they already jumped to,
that means first jumping to the top, then to the actual anchor.

Task-number: QTCREATORBUG-18448
Change-Id: I86c736adab6940903276f8a896b4054ddae11ebe
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2017-08-29 11:25:27 +00:00
Friedemann Kleint
041df6e2ae QFileInfo: Clarify documentation on symlinks
Explain symbolic links vs shortcuts.

Change-Id: I12176616be72c97607ee1f441d1ea05af5e9e549
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2017-08-29 11:15:42 +00:00
Kai Koehne
afb7d99af9 New AA_DisableWindowContextHelpButton to globally hide ? button
Dialogs and Sheets by default have the WindowsContextHelpButtonHint
set, which adds a question mark button to dialogs on Windows. This
button then triggers the 'What's this' mode by changing the cursor,
and letting the user explore the UI by showing whatsThis tooltips.

Anyhow, the paradigm is little used today and a lot of applications
do not set any whatsThis properties, leaving the mode pretty
non-functional. It's therefore common to explicitly remove the
WindowsContextHelpButtonHint from dialogs. However, this has to
be done for _every_ dialog.

Instead, this patch adds a global application flag to not set the
WindowsContextHelpButtonHint by default. This allows developers to
already buy into the Qt 6 behavior, where the flag will not be set
anymore by default.

[ChangeLog][QtWidgets] Added AA_DisableWindowContextHelpButton
attribute. Setting this attribute globally prevents the automatic
"What's this" button on dialogs on Windows
(WindowsContextHelpButtonHint).

Change-Id: I497a79575f222c78b2d5d051a6de346b231f72d3
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-08-29 07:23:44 +00:00
Thiago Macieira
9f5aec777a QProcess: add docs that the PID from startDetached() may be recycled
Change-Id: I209fcd5dbc2b4e5381cffffd14de2742eb1d8cd7
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2017-08-29 03:49:05 +00:00
Alexander Volkov
d61e61fa1a uic: Use nullptr instead of Q_NULLPTR in generated code
nullptr can be used directly in the Qt code since Qt 5.7.
Use it in generated code for consistency.

Change-Id: I249aeaf0a39b46ce1106b29d3ea4569a399908b7
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2017-08-28 15:25:07 +00:00
Robert Loehning
e81f430e30 Doc: Fix example
Change-Id: Ic678b69c6c9820701c4cc10c7797f599e5d71b7a
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2017-08-28 14:36:49 +00:00
Jesus Fernandez
eeaaac8f0e Remove unneded pointer check
CID 158429 (#1 of 1): Dereference before null check (REVERSE_INULL)
check_after_deref: Null-checking ctx suggests that it may be null, but it has already been dereferenced on all paths leading to the check.

Coverity-Id: 158429
Change-Id: I6d202599e962dae5ea4a45401f34237dd496d38b
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2017-08-28 13:58:46 +00:00
Gabriel de Dietrich
48784486a3 QCocoaMenu: Stop update timer
This amends patch f27d1ccbb2.

Change-Id: I4c7a390a5f2cdd3307007c7b6708692c36f861b4
Task-number: QTBUG-62396
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2017-08-28 13:45:41 +00:00
Joerg Bornemann
ea168ead1a Remove unused mkspecs variable QMAKE_LIBS_NIS
Change-Id: I09a161fe4706c19eba4ff54cdb03a10edc34871a
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2017-08-28 13:10:44 +00:00
Joerg Bornemann
d7438593a8 Remove QMAKE_LIBS_CORE variable
Define the lib dependencies for corelib in corelib.pro, where they
belong.

Change-Id: I973d3b0c571782d869b27dea243e899db4dddc43
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2017-08-28 13:10:38 +00:00
Joerg Bornemann
3380c7949e Remove QMAKE_LIBS_NETWORK from QSqlQuery benchmark
This was added in c6612de3 for WEC7 which we do not support anymore.

Change-Id: I329374bb8375d629a6f7619236371c0fc953792d
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2017-08-28 13:10:34 +00:00
Joerg Bornemann
1bb70830d4 Make it possible to override QT_LOGGING_TO_CONSOLE in test cases
It is currently impossible to get output from autotests in Visual Studio
or Qt Creator when running under the debugger. Qt Creator's cdb
integration cannot distinguish between the inferior's console output and
cdb's console output. If the inferior's output came from
OutputDebugString we'd be able to catch and display it.

Pave a way to force QTestLib's logging facility use OutputDebugString.

Task-number: QTCREATORBUG-16161
Change-Id: Iccd69c283626266ee4384a6163a8b72bb0e7df27
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2017-08-28 11:01:17 +00:00
Orgad Shaneh
30331afda1 MSVC: Support precompiled header also for C files
It was already done correctly in the GCC generators, but lacked in MSVC.

Task-number: QTBUG-11117
Change-Id: I5e6c2e4802dbe33c0f15c46a227a08c3f0cc5707
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2017-08-28 07:28:01 +00:00
Gabriel de Dietrich
f1a857c079 QCompleter: Add check before setting the widget
This prevents unnecessarily removing and reinstalling the completer
as event filter on the same widget.

This does not prevent what's going on in QComboBox::focusInEvent(),
where we'd set the line edit as widget just to immediately override
it with combo box itself.

Change-Id: I70c081a920f4daf4d7560e5cd7158e4070042d42
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2017-08-28 07:10:48 +00:00
Simo Fält
f480a25d1a Drop 32 bit iOS configs from mkspec
Qt 5.10 won't support 32 bit iOS.

Task-number: QTQAINFRA-1288
Change-Id: If3cfdb65ed94166d685d3cf444b5ab03d18680a9
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2017-08-28 05:03:36 +00:00
Thiago Macieira
23d52de321 QUdpSocket: use faster ways to get datagram size on Linux and macOS
With MSG_TRUNC on Linux, recv/recvfrom/recvmsg will return the full size
of the datagram, even if it won't fit the buffer you passed. On Darwin,
we have a getsockopt() option to get that value.

Change-Id: I6e9274c1e7444ad48c81fffd14da7d5b93815f90
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2017-08-27 16:38:50 +00:00
Thiago Macieira
db0585d63a Fix crashes with libproxy+webkitgtk: it's not threadsafe
I'm getting crashes in Akonadi processes due to libproxy. I don't have
direct evidence that this was caused by a threading condition, but it's
clear from the source code of libproxy that the plugins it runs for
expanding PAC scripts are not thread-safe. To overcome this problem, we
only run libproxy functions in one thread only.

 #0  0x00007f745f0ac1d8 in JSC::HeapTimer::timerDidFire() () at /usr/lib64/libjavascriptcoregtk-4.0.so.18
 #1  0x00007f745f0ac287 in  () at /usr/lib64/libjavascriptcoregtk-4.0.so.18
 #2  0x00007f748e5ae9c5 in g_main_context_dispatch () at /usr/lib64/libglib-2.0.so.0
 #3  0x00007f748e5aed88 in  () at /usr/lib64/libglib-2.0.so.0
 #4  0x00007f748e5aee1c in g_main_context_iteration () at /usr/lib64/libglib-2.0.so.0
 #5  0x00007f7494f4268f in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib64/libQt5Core.so.5
 #6  0x00007f7494eeb35a in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib64/libQt5Core.so.5
 #7  0x00007f7494d1b31a in QThread::exec() () at /usr/lib64/libQt5Core.so.5
 #8  0x00007f7494d1fd2e in  () at /usr/lib64/libQt5Core.so.5
 #9  0x00007f74913174e7 in start_thread () at /lib64/libpthread.so.0

The pacrunner implementation of libproxy uses libdbus-1 which
(officially) is thread-safe, but experience tells that it has
problems. Since it is not running a JS engine, we don't need a thread,
but we do need to lock around it.

Change-Id: I84e45059a888497fb55ffffd14d2f638f21e807d
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2017-08-27 16:37:08 +00:00
Alex Trotsenko
5de734bc18 QSslSocketBackendPrivate::transmit(): improve writing to OpenSSL
This patch avoids intermediate copying of the data by using a
new QIODevice::skip() API.

Change-Id: I358a83b21e2a58b59481745162fce1894549c0ac
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Markus Goetz (Woboq GmbH) <markus@woboq.com>
2017-08-27 06:17:52 +00:00
Friedemann Kleint
eb93d7b517 Testlib: Format QVector2/3/4D in QCOMPARE
Change-Id: Ia0709e598d2fddd6c2f448633b484749146265f7
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2017-08-27 06:17:32 +00:00
Alex Trotsenko
ca0df4b269 Introduce QIODevice::skip()
[ChangeLog][QtCore][QIODevice] Added skip() method to improve
performance in read operations.

Change-Id: I79068a3e9df108756abe37ba3d431e27e7413621
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-08-27 06:17:09 +00:00
Timur Pocheptsov
53357f0156 HTTP/2 - implement the proper 'h2c' (protocol upgrade)
Without TLS (and thus ALPN/NPN negotiation) HTTP/2 requires
a protocol upgrade procedure, as described in RFC 7540, 3.2.
We start as HTTP/1.1 (and thus we create QHttpProtocolHandler first),
augmenting the headers we send with 'Upgrade: h2c'. In case
we receive HTTP/1.1 response with status code 101 ('Switching
Protocols'), we continue as HTTP/2 session, creating QHttp2ProtocolHandler
and pretending the first request we sent was HTTP/2 request
on a real HTTP/2 stream. If the first response is something different
from 101, we continue as HTTP/1.1. This change also required
auto-test update: our toy-server now has to respond to
the initial HTTP/1.1 request on a platform without ALPN/NPN.
As a bonus a subtle flakyness in 'goaway' auto-test went
away (well, it was fixed).

[ChangeLog][QtNetwork][HTTP/2] In case of clear text HTTP/2 we
now initiate a required protocol upgrade procedure instead of
'H2Direct' connection.

Task-number: QTBUG-61397
Change-Id: I573fa304fdaf661490159037dc47775d97c8ea5b
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2017-08-27 04:54:55 +00:00
Orgad Shaneh
0f11fab6f7 Fix resolution of relative symlinks from relative path on unix
Consider the following:
/root/target - a file
/root/path/link -> ../target
/root/path/other/exe - executable

Running from /root/path/other.

exe is:

#include <QDebug>
#include <QFileInfo>

int main()
{
    qDebug() << QFileInfo("../link").symLinkTarget()
    return 0;
}

The link references /root/target, but the current output is
/root/path/target.

The link doesn't depend on the PWD. It depends on its own directory.

Change-Id: I61e95018154a75e0e0d795ee801068e18870a5df
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-08-27 02:39:57 +00:00
André Klitzing
e51dbda067 Update bundled libpng to version 1.6.32
Also add import script.
The remaining diff to clean 1.6.32 is archived in the qtpatches.diff file.

[ChangeLog][Third-Party Code] libpng was updated to version 1.6.32

Change-Id: I1b4b78e39a6eb098d1b66c2528e47544bd9e6713
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-08-26 18:04:32 +00:00
Orgad Shaneh
3635b78c54 QFileInfo: Fix typo in doc
Change-Id: Id1051f08a870461b172b646c126eb44e8addc114
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
2017-08-26 17:39:45 +00:00
Oswald Buddenhagen
e8b9a17a3b qmake: fix hypothetical raw data leak in $$replace()
the replacement value may well constitute the whole output string - this
is in fact common, given this rather typical usage pattern:

  BAR = $$replace(FOO, -flag, -otherflag)

this must be considered when constructing the return value.
compare 3c8134958c.

as of now, this is irrelevant, as QString::replace(QRegExp, QString) will
always memcpy the replacement into a detached copy of the target, but one
never knows.

Change-Id: Ia1f271f45023746040fc28ce6d88a6609e05e5c2
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2017-08-26 12:12:10 +00:00
Oswald Buddenhagen
702be65532 qmake: fix hypothetical raw data leaks relating to qt i/o classes
technically, we should not rely on the i/o classes not storing the
strings beyond the instantiated object's life time.

Change-Id: I0990769b3cf86860184869036c096c531160e9be
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2017-08-26 12:12:06 +00:00
Oswald Buddenhagen
18533ae2a7 qmake: remove pointless use of raw data in $$[QMAKEFEATURES] access
property values are de-facto guaranteed to be backed by full QStrings,
so there is nothing to be gained from using the raw data optimization,
while doing so risks raw data leaks.

Change-Id: I3d43da9aaadd4d5811c4b1a9d7ac734049da423c
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2017-08-26 12:12:02 +00:00
Oswald Buddenhagen
14505bbfea qmake: remove seemingly pointless QString::detach() calls
it's not clear why detaching would be necessary; there is no danger of a
raw data leak here.
concatenating a QStringRef with a non-empty QLatin1String (the only
expected use of this overload) will yield a detached QString anyway, so
this makes little difference in practice.

amends f137957e08.

Change-Id: I521c0e89a8b0c1ae62b1450e81b0ae91a931bcfa
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2017-08-26 12:11:57 +00:00
Oswald Buddenhagen
9f98935d33 qmake: prune obsolete QString::detach() call
no m_tmp is involved any more in this code path; it uses QStringRef.

amends 11d957d043.

Change-Id: Ib272d61edfb150a549c5e6a9a60d53502702e802
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2017-08-26 12:11:53 +00:00