Commit Graph

104 Commits

Author SHA1 Message Date
Jarek Kobus
10ff747a0f Use more std::chrono and std::chrono_literals namespaces
Change-Id: Ib8c83988d7afe35d81b87ff8c5c87eef2082f12d
Reviewed-by: hjk <hjk@qt.io>
2024-01-23 09:32:43 +00:00
Jarek Kobus
665beaead9 Process: Change signature of setReaperTimeout()
Change the arg to std::chrono::milliseconds type.

Change-Id: I7b79fc318e2fd06971148038a31fecd4c1805a79
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2024-01-22 20:42:36 +00:00
Eike Ziller
150441bf88 iOS: Avoid iostool for info gathering if possible
Previously we had a small workaround for retrieving the state of
developer mode for iOS 17 devices integrated into our own iostool.

Instead use devicectl for gathering device information for devices that
it can handle, and only fall back to iostool for the devices that it
cannot handle.

Since iostool cannot handle deployment, running, and debugging for
iOS 17 devices anyway, the end goal would be to only use devicectl
for these.

Also add a TaskTree wrapper for IosToolHandler for convenience.

Change-Id: I5bcd09eb354c2dce9b21e62e140de16f2e740d6e
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2024-01-11 07:38:11 +00:00
Marcus Tillmanns
32f69227f1 IOS: Unify error handling
Instead of using some flags in some struct, we convert the error handling
to use expected_str<ResponseData> to clean up the error handling with
the outside.

Change-Id: I0f8d10c99715989e0069568ebc1d799d412a0600
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-11-03 10:01:45 +00:00
Marcus Tillmanns
250b82ba32 Ios: Finish deploy on failure
Previously the deploy step would seemingly run forever if the
startSimulator step failed, as no result was added to the promise.

Change-Id: Ib320d051e78057e536d4ad371cb30108e848c65f
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-10-30 09:16:10 +00:00
Jarek Kobus
a31287dfe1 IosToolHandler: Avoid 3 arg connect
Fix signal arg for LogTailFiles::logMessage().

Change-Id: I8d50ee954e9fff2ececfcb17766e0b0cccb98a2b
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-10-06 18:55:14 +00:00
Jarek Kobus
301e18f12b LogTailFiles: Replace QProcess with Process
Change-Id: Ia154daf16a801d8d09ac1a1a5e00c669ad9f36ad
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-07-17 12:23:55 +00:00
Jarek Kobus
a9663d65ad IosDeviceToolHandlerPrivate: Replace QProcess with Process
The Process takes care of the proper destruction automatically.
This is a preparation step before creating a task tree adapter
for IosToolHandler.

Change-Id: I6a8ae12b46a83be3a7074d0a268a598c260a66b5
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-07-17 12:02:46 +00:00
hjk
6243c302d1 iOS: Proliferate FilePath a bit
Unlikely to make a difference in practice, but removes so unwanted
.toString/.exists.

Change-Id: I32c037aa87bb13cecb5b783fe0b36850e163f9c5
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-06-08 10:16:25 +00:00
Jarek Kobus
a0f6e8dc04 Utils: Rename qtcprocess.{cpp,h} -> process.{cpp,h}
Follows QtcProcess -> Process rename.

Change-Id: I97235a9a40cb7fd52944515b7ab878d96528f919
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-05-04 05:52:26 +00:00
Jarek Kobus
a3a5b8f806 Utils: Rename asynctask.{cpp,h} -> async.{cpp,h}
Follows AsyncTask -> Async rename.

Change-Id: I37f18368ab826c9960a24087b52f6691bb33f225
Reviewed-by: hjk <hjk@qt.io>
2023-05-03 13:24:20 +00:00
Jarek Kobus
070bfe9387 FutureSynchronizer: Change the default value of cancelOnWait to true
The "false" default wasn't really useful.

This changes the default value to the following usages:

1. AndroidDeployQtStep
   Introduced in 91f136ef3a
   The synchronizer was used to cancel the running tasks inside
   the doCancel(), so the similar behavior should be expected
   when destructing the AndroidDeployQtStep.

2. GitClient
   Introduced in f3106ebafe
   Is used only inside the last line of
   GitSubmitEditor::updateFileModel(). The running function
   (CommitDataFetchResult::fetch) doesn't take QPromise<>,
   so it can't detect if the future was canceled or not.
   In this case this change is no-op.

3. ExtraCompiler
   Introduced in c99ce1f455
   The intention was to make it cancellable and finish
   early on cancel.

4. PluginManager global future synchronizer
   Introduced in 72bddf9f51
   The intention was to make it cancellable and finish
   early on cancel.

The relevant places in code are marked explicitly for
points: 1, 2 and 3.

Change-Id: I1a52deb8d1f81d355950c8772bbaa6d0a202fd7e
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-04-26 08:17:27 +00:00
Jarek Kobus
7ab0fd56ae RunExtensions: Move onResultReady and onFinished into asynctask.h
Change-Id: I96dbf5b0253251224ae678172cd5fca12b34326a
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-04-17 09:10:33 +00:00
Jarek Kobus
8175d5abda onResultReady: Provide a context object for all usages
Remove overloads for onResultReady() and onFinished()
that don't take context object.

Change-Id: Iaec538bcccd29e22791ec65cc95b4b87640708c3
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-04-12 11:05:16 +00:00
Jarek Kobus
4a121833b1 Ios: Use QtConcurrent invocation for async run
Change-Id: I1d02a7a0467864a702bed8f73793f8f21832762b
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-03-14 09:10:46 +00:00
Eike Ziller
425262ce7e iOS: Fix freeze when stopping application
The target of the connection determines in which thread the slot is
executed, and in these cases the slot needs to be executed in the
logging thread. But the LogTailFiles object is created and stays on the
main thread. So, the slot that was supposed to stop the event loop in
the logging thread was blocked from being executed when
IosToolHanderPrivate waited for the canceled threads to finish with
futureSynchronizer.waitForFinished().

Use the event loop as the "target" of the connections.

Amends 33e8251edf

Change-Id: Ie78fcb33b88c1fe7a138fac790fd4f3b7dd9bad9
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2023-03-13 09:13:02 +00:00
hjk
6a1a6d85b8 iOS: Tr::tr
Change-Id: I547af218546927622414999e5b9019ab62916e7e
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-01-16 16:11:20 +00:00
Kai Köhne
56baf8c058 Remove GPL-3.0+ from license identifiers
Since we also license under GPL-3.0 WITH Qt-GPL-exception-1.0,
this applies only to a hypothetical newer version of GPL, that doesn't
exist yet. If such a version emerges, we can still decide to relicense...

While at it, replace (deprecated) GPL-3.0 with more explicit GPL-3.0-only

Change was done by running

  find . -type f -exec perl -pi -e "s/LicenseRef-Qt-Commercial OR GPL-3.0\+ OR GPL-3.0 WITH Qt-GPL-exception-1.0/LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0/g" {} \;

Change-Id: I5097e6ce8d10233993ee30d7e25120e2659eb10b
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-01-06 11:15:13 +00:00
Jarek Kobus
33e8251edf Ios: Pass context object to lambda connections
Change-Id: I69a7a2ff3e91256961b2b501e75fe1a21d9c8b6f
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-01-06 10:28:30 +00:00
Lucie Gérard
a7956df3ca Use SPDX license identifiers
Replace the current license disclaimer in files by
a SPDX-License-Identifier.

Task-number: QTBUG-67283
Change-Id: I708fd1f9f2b73d60f57cc3568646929117825813
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-08-26 12:27:18 +00:00
Jarek Kobus
a98b185e90 Drop Qt5: Android, IOS & WASM: Get rid of QOverload
Add a context object into some lambdas.

Change-Id: I72631aeb36703f8f335f3819796fb52148f1b377
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-07-20 10:30:48 +00:00
Marcus Tillmanns
30f9f68b15 iostool: Cleanup and improve debug output
Replaced the custom command line arg parsing code
with QCommandLineParser

Change-Id: I14e8695b5ee327b1d111558271bf98afd0c942b0
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-06-24 13:18:09 +00:00
Eike Ziller
016321f0c8 Merge remote-tracking branch 'origin/8.0'
Change-Id: I9f41e115adb25c08acc01110b6027020eff1a1e7
2022-06-17 11:29:14 +02:00
Marcus Tillmanns
e3fd840f98 iostool: Improve deployment speed using delta deploy
The iostool did always deploy the whole bundle, without taking
into account whether anything has actually changed. This meant
that for big bundles anytime the user starts the application
on his device, a full deployment was done.

For a ~1GB bundle this would take around a minute on a recent
Mac and iPhone 12.

This fix uses a new function from the mobiledevice framework
called AMDeviceSecureInstallApplicationBundle.
This function takes a new parameter "ShadowPathKey" which points
to a directory where the last deploy state is captured temporarily.

Before deploying to the device, the function compares
what is to be deployed against the last deploy state and
only deploys the parts that actually changed.

QtCreator provides a temporary folder for this. Due to this,
the initial deployment still does a complete deployment as
no state is available yet. All subsequent deployments
take the captured state into account.

For backwards compatibility, the old deployment method is left intact.

Fixes: QTCREATORBUG-24371
Change-Id: I4df6aa79d41b34c326d78be7952d7eeb23774648
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-06-17 07:09:45 +00:00
Artem Sokolovskii
1241761035 ios: Remove foreach / Q_FOREACH usage
Task-number: QTCREATORBUG-27464
Change-Id: If29d2960692c42456967025d60e6d6d7ddd09928
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-06-02 09:42:19 +00:00
Eike Ziller
fcf9c42e40 iOS: Make SimulatorControl static
It already contained only static members, so creating instances didn't
serve a purpose.

Change-Id: I261503b606c21cf498dcd8470d5645d92d97c325
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2021-05-25 11:46:23 +00:00
Jarek Kobus
69b3c6c1fd Use Utils::FutureSynchronizer in IosSimulatorToolHandlerPrivate
Add a new method: void FutureSynchronizer::cancelAllFutures().

Change-Id: I5a4e1ea3230ac3c0ce9d3f26b751b2c05fe3dfd4
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-05-25 10:13:11 +00:00
hjk
c23cdd9262 Utils: Merge {synchronous,qtc}process.{h,cpp} file pairs
Mechanical to prepare merging the actual classes.
Adapting #includes.

Change-Id: I77a2c28129287778bc870c30cb890cd26bc2e62b
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-05-10 09:47:51 +00:00
hjk
8e352af0ec Core: Add a default parameter to various ICore::*path functions
Saves some code on the user side.

Change-Id: I32cd220b6e533f5497a1865f9c34ab9db4cfda79
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-04-27 06:52:05 +00:00
Eike Ziller
c1f90aeca2 ICore: Change some path API to use FilePath
Change-Id: Id841d6177206a021c9e606ce560b47d1ae6e52b9
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: hjk <hjk@qt.io>
2021-04-26 08:03:47 +00:00
Jarek Kobus
48c2afe157 Decorate some classes and methods with final keyword
This way we silence the clang warnings about calling
virtual methods from c'tor or from d'tor:
[clang-analyzer-optin.cplusplus.VirtualCall]

Change-Id: I8d6318b490152133da4833bda2ba28622bce30dd
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-11-19 09:45:53 +00:00
Jarek Kobus
34c97ac868 Fix a build with Qt 6
In Qt 6 implicit conversion between QFuture and other types
is forbidden. Make it explicit instead.
See ff0ba7e2d7b91fd5809cb314935a1ca1a436f6c9.

Change-Id: Ie42e6b9b5047ba5eeec9f63fd03179e73f95314d
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-11-05 08:46:43 +00:00
Eike Ziller
3f42c989ee Fix Qt 6 build of ProjectExplorer and targets & build systems
QStringRef is gone.
qsizetype vs int.
QMultiHash::insertMulti is gone.
QXmlStreamWriter writes UTF-8 by default.

Task-number: QTCREATORBUG-24098
Change-Id: Id217e40a1f17993a84fc725976e9cb84618b0580
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-09-21 11:31:54 +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
hjk
473a741c9f Utils: Rename FileName to FilePath
More in line with QFileInfo terminonlogy which appears to be
best-of-breed within Qt.

Change-Id: I1d051ff1c8363ebd4ee56376451df45216c4c9ab
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-05-28 12:23:26 +00:00
hjk
274bbefeff iOS: Remove remaining FileName::appendPath uses
Change-Id: Ia550151bbcad696a3bd59e630e80a8f89a908e08
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-05-24 07:32:17 +00:00
hjk
6f37348b4c Replace static_casts by QOverload where possible
Mainly to get rid of the QProcess::finished deprecation warning.

Also adjust coding style in the surrounding connects when needed.

Change-Id: I12f9b248c7974b892c4a069356e578e80f8c59e9
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-02-26 15:18:14 +00:00
Alessandro Portale
616e19ff9e Fix warning: "Missing emit keyword on signal call"
[-Wclazy-incorrect-emit]

Change-Id: I93bdc6e23cdaccf35c9899ae16870ccc65a54f80
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2019-01-17 15:54:56 +00:00
Alessandro Portale
eef5131962 Fix: Emit keyword being used with non-signal
-Wclazy-incorrect-emit

Change-Id: I02e54b1170fdd812f3bfee97e9b7ecd6b0560270
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2019-01-15 08:53:29 +00:00
Christian Kandeler
c6a6c12f05 Canonicalize some includes
Our canonical style is
    #include <utils/fileutils.h>
rather than
    #include "utils/fileutils.h"
Which makes sense, as such headers will never be found in the local
directory.

Change-Id: I4ca46e90d6c4d19d4b1f235f4c79caad864ef222
Reviewed-by: hjk <hjk@qt.io>
2019-01-10 09:04:46 +00:00
Alessandro Portale
39400381b3 iOS: Modernize
modernize-*

Change-Id: I64d2bb4320c9b444bc13e90099600628eac1f5a6
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2018-11-13 15:44:34 +00:00
Orgad Shaneh
bdc2b4b59f Remove hard-coded disabling of debug logs
Instead, set the default level of all logs to QtWarningMsg.

The call to setFilterRules overrides the user preferences in qtlogging.ini.

Change-Id: Id5f6cd550d14ff7f45ae04c5d3110e0bafb0f072
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2018-10-13 16:36:58 +00:00
Vikas Pachdha
4d082b9500 iOS: Use stdout of smctl commands
Avoid MessageTracer logs being fed to the device listing json document

Change-Id: Ia35b39d787d2df27e6f743e0b6dc401799c383db
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-05-23 07:03:11 +00:00
Orgad Shaneh
eea6a7c3b3 Utils: Purge qtcfallthrough.h
No longer needed.

Change-Id: I9b0bee014df89d4c567f1d2431b5ff9404f5f925
Reviewed-by: hjk <hjk@qt.io>
2018-04-09 09:04:13 +00:00
Robert Loehning
300041cc6e ios: Initialize members
Change-Id: I01cbbbfa9e8906768cc71d1c5b0d366d99924c7f
Reviewed-by: hjk <hjk@qt.io>
2017-12-13 13:35:24 +00:00
Leena Miettinen
6c25c67b98 iOS: Write "error" and "simulator" in lower case in messages
Change-Id: I20d2266b2f40dc19b367e7704b72977a84814c3c
Reviewed-by: Vikas Pachdha <vikas.pachdha@qt.io>
2017-07-28 08:06:35 +00:00
Christian Kandeler
be2b3c91ae Add Q_FALLTHROUGH for Qt < 5.8
... and make use of it.
With gcc 7, the new option -Wimplicit-fallthrough is introduced and
added to the -Wextra set, triggering dozens of warnings in our sources.
Therefore, we annotate all obviously intended fall-throughs. The ones
that are still left are unclear and need to be checked by the respective
maintainer.

Change-Id: I44ead33cd42a4b41c28ee5fcb5a31db272710bbc
Reviewed-by: Nikita Baryshnikov <nib952051@gmail.com>
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2017-07-17 07:51:23 +00:00
Thiago Macieira
80bdcb95de Add unnecessary break to switch statements that don't fall through
GCC 7 can't tell that it's unnecessary, so it complained.

 registerhandler.cpp:528:13: warning: this statement may fall through [-Wimplicit-fallthrough=]

Change-Id: Ia3e896da908f42939148fffd14c6a15f3ec05524
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2017-06-12 16:19:49 +00:00
Christian Stenger
a86c28f4d5 iOS: Fix compile
Change-Id: I0a7d7f7a40762dfc260eed65f51ee93ecb3d61f5
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2017-06-06 05:45:17 +00:00
Vikas Pachdha
f9350a5dbd iOS: Fix isRunning state of the app running on Simulator
Refactored IostoolHandler code and fixed isRunning(..)
for Simulator

Change-Id: Ib24431fc8e66f8d1be983c2e41d36df2169a9cb4
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2017-06-02 12:51:43 +00:00