Commit Graph

82 Commits

Author SHA1 Message Date
Eike Ziller
430a9a03b7 Utils: Add workaround for sdktool
Which is compiled against an older Qt version to keep it more
compatible.

Change-Id: Ifee61a524055ca383c83da9f237e50536a3fd0cb
Reviewed-by: hjk <hjk@qt.io>
2020-10-06 06:14:53 +00:00
Eike Ziller
3433b8c24f Qt6: Adapt to removal of QProcess::setupChildProcess
And use QProcess::setChildProcessModifier when compiling against Qt6.

Task-number: QTCREATORBUG-24098
Change-Id: I4166a8e27f8f63dd661df119413cd2eb2ae1dc2e
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-10-02 07:25:10 +00:00
hjk
361b5e3530 Utils: Determine shell from $SHELL instead of hard-coding /bin/sh
Fixes: QTCREATORBUG-24659
Change-Id: Icafc001b681cc76af76b8759a4de84db51146fd4
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-09-23 15:55:55 +00:00
Eike Ziller
7e8c3e91a1 Utils: Fix build with Qt6
Do not use QStringRef related API, replace with QStringView where
appropriate.

Adapt to removal of QAbstractItemView::viewOptions().

Task-number: QTCREATORBUG-24098
Change-Id: I5a7a9821984583222083733f91b46df39c21d592
Reviewed-by: hjk <hjk@qt.io>
2020-09-07 09:07:57 +00:00
Orgad Shaneh
51453936cc Utils: Replace foreach with range-based for
Change-Id: I9aeea9c029ffc56cbadc04edd20e9b35b154f986
Reviewed-by: hjk <hjk@qt.io>
2020-06-16 04:43:29 +00:00
hjk
cbac89b0fd QtcProcess: Port to QRegularExpression
Task-number: QTCREATORBUG-24098
Change-Id: I9784989786ff65ceac6c9921f7f9f09d4e0f0a49
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-06-15 05:27:59 +00:00
hjk
f2e06d2764 Revert "Port to Qt 6's absence of QProcess::setupChildProcess"
This reverts commit 6a66ced594.

The patch that will introduce the alternative to setupChildProcess
(QProcess::setChildProcessModifier()) has not yet found its
way to qtbase and current Qt dev already identifies itself as
version 6.0.0, rendering the code here uncompilable.

Change-Id: I570b01598005070f0c17604226d245a3a381250e
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-06-11 13:17:00 +00:00
Thiago Macieira
6a66ced594 Port to Qt 6's absence of QProcess::setupChildProcess
Change-Id: I9709abb1c3734e10a7defffd1607e5b3fd46af0e
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-04-30 15:38:41 +00:00
Thiago Macieira
86fae567fa TerminalControllingProcess: don't use qWarning in the child process
qWarning() and all of QMessageLogger will get to qFormatLogMessage(),
which locks a mutex. Additionally, qWarning may call a number of
different backends that, in turn, may have mutexes of their own. Locking
mutexes in child processes between fork() and execve() is a big no-no:
it may have been locked by another thread before fork(), so it's still
locked in the child process and will never get unlocked. Result:
deadlock.

Plus, qWarning reacts to QT_FATAL_WARNINGS, which I guess was not
intended for this class.

So just use a plain perror(), which is guaranteed by POSIX to be
"MT-Safe race:stderr".

Change-Id: I4e559af2a9a1455ab770fffd15f4a37a3fd113ca
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2020-02-20 12:53:00 +00:00
Alessandro Portale
24a25eed14 Use isEmpty() instead of count() or size()
Change-Id: I0a89d2808c6d041da0dc41ea5aea58e6e8759bb4
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2020-01-20 20:56:57 +00:00
Orgad Shaneh
e38361b5a8 Lower priority on build
This should prevent slowdown of the IDE (and the rest of the system) while
building with all the CPU cores.

Fixes: QTCREATORBUG-5155
Change-Id: Icaadc53958f2d8e918035463e3c9344c91235615
Reviewed-by: hjk <hjk@qt.io>
2019-09-18 09:35:39 +00:00
Christian Kandeler
6d3f236aab Utils::Environment: Use expanded values
The Environment class is supposed to support values with references to
other variables, but we failed to actually expand them in most places.

Fixes: QTCREATORBUG-22687
Change-Id: I108cb59d3b4571471423455240f6f4f1cf64bf05
Reviewed-by: hjk <hjk@qt.io>
2019-08-20 12:39:16 +00:00
hjk
251287f0d3 Avoid warning on empty expressions
For some reason, Q_UNUSED includes already a semicolon, adding one
on the user side creates an additional empty statement.

Change-Id: I9c5e8fac381345a60792cb75e2938fd53958d3b0
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-07-23 11:55:59 +00:00
Christian Kandeler
acfe45c434 SSH: Fix running remote process in terminal
ConsoleProcess stumbles over the special characters in the remote
command and as a result silently runs the command locally instead.
Prevent that. We can (and should) simply leave these characters alone,
as they have no special meaning on the local machine.

Change-Id: I31b3afe1cf170e51d431372b15f4df3656006959
Reviewed-by: hjk <hjk@qt.io>
2019-06-14 12:18:48 +00:00
hjk
959fec76dc Utils: Move CommandLine to fileutils.{cpp,h}
Causes less #include hassle when using downstream instead of
command/argument pairs.

Change-Id: I0fa0d016374df0b8e0a22f3786623652af684d36
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-06-03 12:32:07 +00:00
hjk
a7345b67c1 ProjectExplorer/Android: Some more use of Utils::CommandLine
And surrounding cosmetics.

Change-Id: Iad3d2d43856b1fcd9530d4a209fff9887e6cec42
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-05-29 16:49:47 +00:00
hjk
0e0a8e9204 WinRt: Use new Utils::CommandLine
Change-Id: I7320f92199af439225233b6a1bcf0ec0b185cdcb
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-05-29 14:43:36 +00:00
hjk
4098be05b2 Utils: Extract a CommandLine structure from a QtcProcess
We regularly pass around strings or filenames or pairs of strings
or filenames and stringlist etc the in the end will be used
as a kind of "command line", with quite a bit of ad-hoc user
code and QtcProcess::addArg etc to set them up and manipulate them.

Let's have a class for that concept.

Change-Id: I288ab939d853b32c717135a65242c584c2beab50
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-05-29 14:36:46 +00:00
Alessandro Portale
f6943a712a Utils: Modernize further
Many issues, mostly in headers, were not addressed in
e38410b76c

modernize-use-auto
modernize-use-nullptr
modernize-use-override
modernize-use-using
modernize-use-default-member-init
modernize-use-equals-default

Change-Id: I320a51726db881e582b898948d53735ebb06887a
Reviewed-by: hjk <hjk@qt.io>
2018-07-24 12:21:42 +00:00
Nikita Baryshnikov
e4c3e04ebd Environment: make usage of Environment.iterators more consistent
Change-Id: I114ddb2238ad19ac0681b8405925f283f2460f21
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-09-28 08:59:55 +00:00
Montel Laurent
158ab3316e Use QString::*Ref method
Change-Id: I63a10f274dd17e08b5b8a2577762cc9f7960b5af
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2017-04-21 12:04:38 +00:00
Orgad Shaneh
da7cb91446 Merge remote-tracking branch 'origin/4.2' into 4.3
Change-Id: I4931dcc81be872d7712e67123e94d15ee696459f
2017-03-14 16:20:14 +02:00
Samuel Gaist
4033471aa9 QRegExp include cleanup
This patch adds the missing include statements for QRegExp.

Change-Id: Ibb03b929940adb84ae190b5090cb6b88653cc14c
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2017-03-13 22:05:30 +00:00
Tim Jenssen
2631ffabd5 Remove spaces in initializer lists
Format initializer lists code style like.

Change-Id: Ib82c235e4ba7dc75ee96a7abc0c47eff7b0a9013
Reviewed-by: hjk <hjk@qt.io>
2017-02-22 16:25:09 +00:00
Christian Stenger
e952b9d4f3 Replace occurrences of QStringList() << pattern
Change-Id: I598d8c06193c2e72435a76165d1afc9ee3465b48
Reviewed-by: hjk <hjk@qt.io>
2017-02-09 13:17:49 +00:00
Orgad Shaneh
a6c17fc537 Remove all QT_VERSION_CHECK
We only support Qt 5.6 now.

Change-Id: If94864400545b057623e3af0743c55ea1e84e33b
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2016-08-12 13:29:58 +00:00
Orgad Shaneh
5bc8d10baa Remove uses of deprecated QProcess::error signal
This overload of error is deprecated in 5.6.

Replace with errorOccurred, which was introduced in 5.6.

Change-Id: Iccfba7e7103b7ce377471696f1f2ec217e52c840
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2016-08-09 16:02:43 +00:00
Ulf Hermann
dd4e185eb3 Utils: Register metatypes for QProcess enums
Apparently they aren't automatically registered on Qt 5.5

Change-Id: I0932cc7c5f56019300380ebb905d67d99eb8e9d0
Reviewed-by: hjk <hjk@theqtcompany.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2016-06-08 11:44:23 +00:00
hjk
bebdad0df1 Utils: Adapt to QChar changes.
Less warnings.

Change-Id: I435abb1f39d179be10e4d0446b352f2ff7636437
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2016-05-18 11:13:30 +00:00
Tobias Hunger
f72370f20a Update License according to agreement with Free Qt Foundation
* Update remaining files in src

Change-Id: I1896f17fcf34f71c3310c87899fb5171b8e4afb1
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2016-01-19 15:59:41 +00:00
Jake Petroules
46b5eefcbf Explicitly document usage of Qt bug workaround.
Task-number: QTBUG-49694
Change-Id: I4516949af78320a1cdead9bce8ac90fe2ddc7fa9
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2015-11-30 16:18:19 +00:00
hjk
77661e378a Utils: Remove qPidToPid() adapter function
Since Qt 5.3, there's a QProcess::processId() providing direct access.

Change-Id: Ia9c143c7a92ec61d1aa36ff3f4670ba72a509634
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
2015-09-16 12:08:16 +00:00
Orgad Shaneh
220882128a Utils: Fix parentheses parsing in arguments iteration
Opening parenthesis is stored in the value, but closing parenthesis
is not. This makes the value unbalanced.

Since the parenthesis unconditionally unset m_simple, the value is
cleared anyway and is never read.

In case that math (or other) expression will ever be evaluated, this
needs to be reworked to include both parentheses.

Change-Id: Ie56f5a5d9cec5a47649751db4245888bee8e85d8
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2015-03-09 13:41:49 +00:00
Eike Ziller
3c85058694 Update License
Change-Id: I711d5fb475ef814a1dc9d2822740e827f3f67125
Reviewed-by: Alessandro Portale <alessandro.portale@digia.com>
2015-01-16 12:37:56 +01:00
Eike Ziller
8295b503be License update
Change-Id: I3c22ef2685d7aa589f5d0ab74d693653a4c32082
Reviewed-by: Alessandro Portale <alessandro.portale@digia.com>
2014-10-09 11:41:44 +02:00
Alessandro Portale
0c3f1dd71c QtcProcess: avoid compiler warning
The "enabled" parameter is unused with QT_DEBUG

Change-Id: I5dc0cbb88f06e9c5323bcf3988cbf1cbdba2a09e
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2014-05-21 09:11:53 +02:00
Joerg Bornemann
3d38541b14 disable Ctrl-C stub in debug build
Activating the controlcstub in a debug build will send Ctrl-C to
Qt Creator too, because he stub and Qt Creator share the same
Windows.
We're disabling the stub in debug builds. Cancelling a build
still works but takes a bit longer.

Task-number: QTCREATORBUG-11995
Change-Id: I766c2eac1f07205c411a7e4164e7d73b6c0441aa
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2014-05-19 11:33:03 +02:00
Sergio Ahumada
c375436847 Fix some typos
Change-Id: I3be73c2a4d256a0d28e863fd2517a4d7442b34d8
Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@digia.com>
2014-03-05 09:39:42 +01:00
hjk
3702586577 Re-arrange Ctrl-C stub argument passing.
Change-Id: I59b96446c5430b96a6daf05aa785f4c0e7e4a42b
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
2014-02-21 10:45:20 +01:00
Joerg Bornemann
156330cd5d QtcProcess: pass arguments only once to child process
When not using the ctrlc stub, then the whole arguments string was
passed to QProcess::start as one argument, prefixed to the actual
arguments.

Task-number: QTCREATORBUG-11514

Change-Id: I8111749b5c2f0a0abbfa3e9f8441bb5cdcfe0531
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: hjk <hjk121@nokiamail.com>
2014-02-19 14:22:30 +01:00
hjk
c68ebeed2e QtcProcess: Introduce a QtcProcess::Arguments class
This is used to get a platform-agnostic handle on "command line
arguments". It essentially wraps a single QString on Windows,
and a QStringList everywhere else.

As a consequence, several occurrences of #ifdef Q_OS_*
can be removed from the codebase.

Change-Id: Ic93118c1bd0bce0ebb58f416d395dbaebb861772
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
2014-02-19 09:19:28 +01:00
Robert Loehning
746c5d8863 Incremented year in copyright info
Change-Id: Ib5423fdd064e4546f848c0b640b0ed0514c26d3a
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@digia.com>
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
2014-01-08 08:29:47 +01:00
Eike Ziller
63ff745213 Merge remote-tracking branch 'origin/2.8'
Conflicts:
	src/libs/extensionsystem/pluginmanager.cpp
	src/libs/extensionsystem/pluginspec.cpp
	src/plugins/coreplugin/basefilewizard.cpp
	src/plugins/coreplugin/coreplugin.pro
	src/plugins/coreplugin/coreplugin.qbs
	src/plugins/coreplugin/editormanager/ieditor.cpp
	src/plugins/coreplugin/externaltool.cpp
	src/plugins/coreplugin/icore.cpp
	src/plugins/cpptools/cppmodelmanager.cpp
	src/plugins/fakevim/fakevimhandler.cpp
	src/plugins/find/ifindfilter.cpp
	src/plugins/projectexplorer/buildstep.cpp
	src/plugins/projectexplorer/devicesupport/idevice.cpp
	src/plugins/projectexplorer/runconfiguration.cpp
	src/plugins/vcsbase/vcsbaseeditor.cpp
	tests/system/suite_debugger/tst_simple_analyze/test.py

Change-Id: I11dc9e60bfc14bad4f8af747d041fc7678a07c17
2013-09-27 10:44:32 +02:00
Tobias Hunger
dfbe799590 Utils: Remove dead code
Change-Id: I9e9c7192308630fd85c4ff49120f34dbc8b0c724
Reviewed-by: hjk <hjk121@nokiamail.com>
2013-09-13 14:08:02 +02:00
hjk
242ad7e527 Debugger: Remove avoidable platform dependent compilation
Less chance for compile fix ping pong.

Change-Id: I2b055d1a12ba848f86d5246592ed7bb6d06fff51
Reviewed-by: Nicolas Arnaud-Cormos <nicolas@kdab.com>
Reviewed-by: David Schulz <david.schulz@digia.com>
2013-09-13 11:35:33 +02:00
Leena Miettinen
efbecf21db Doc: edit utils docs
Use \a for all attributes in function descriptions
to avoid QDoc errors. Do not use \param, because
it is not a valid QDoc command.

Do not use \returns as it does not exist.

Do not use \brief for functions. It is not obligatory, so
rather than add them for all functions, let's consistenly leave them out.

Fix typos, grammar and style issues, and punctuation.

Change-Id: Ib8f296f93976265bb93dbeab40c5b47156518122
Reviewed-by: hjk <hjk121@nokiamail.com>
2013-09-09 12:55:00 +02:00
hjk
b89afac9d4 Utils: Rename winQPidToPid to qPidToPid
... and make it a no-op on non-Windows. Saves #ifdefs.

Change-Id: Ie791f7b9f1a425325d0b889e73758c5f7f7e6ad2
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2013-07-12 09:39:35 +02:00
Leena Miettinen
41411165ba Doc: use standard wording in \brief commands
QDoc does some magic with the \class and \namespaces
and \brief commands, so the following wording must be used:
"The xxx class yyy ..."

Change-Id: Id231f30e8464898b776888d5423523de404aae34
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
2013-06-20 11:22:47 +02:00
Tobias Nätterlund
515b6266c5 QNX: Fix shutdown of inferior and inserting breakpoints on Windows
When debugging on a QNX device on Windows, neither
DebugBreakProcess(..) nor "-exec-interrupt" works for interrupting
the inferior process. Neither does sending it a SIGINT signal using
"kill" on the device.

This changes the local gdb process to run under the CtrlC stub on
Windows when debugging on QNX. This enables us to send a Ctrl+C
message to gdb, which interrupts the inferior, and allows us to
insert breakpoints during runtime on Windows.

Change-Id: I4b01fbe81138f3fe7a939a7e64267bac4eb8bf43
Reviewed-by: Andreas Holzammer <andreas.holzammer@kdab.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: hjk <hjk121@nokiamail.com>
2013-05-06 08:59:41 +02:00
Leena Miettinen
419c6de735 Doc: replace deprecated QDoc commands
The \i and \o commands were replaced with \li and
\bold was replaced with \b in QDoc for Qt 5.

The \input command was replaced with \include in the docs.

Change-Id: I257d1bebb8ebc739ca20e0d29fcf0406ecb14534
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
2013-02-06 09:44:18 +01:00