It turns out caching the information is unreliable due to a variety of reasons.
We remove the cache for now as its less dangerous than trying to fix each
use case.
Change-Id: I8238166486a2fb29c101f700af1c8d7e4ad7a172
Reviewed-by: hjk <hjk@qt.io>
Detected by memory analyzer.
When shutdown comes while pythonsFromRegistry() or
pythonsFromPath() is still running, the corresponding
QFutureWatcher is leaked.
Employ TaskTreeRunner instead. It handles the cancellation
of the running tasks automatically on its destruction.
Make pythonsFromRegistry() and pythonsFromPath() cancelable,
by providing QPromise as a parameter and check for canceled
state on every iteration.
Change-Id: Iae7c7d1ed764646b8203bd7ca8b9580cb999b80c
Reviewed-by: David Schulz <david.schulz@qt.io>
It never gained traction, was only used in thee places, and
the class(-hierarchy) is not really needed and only complicates
the code when the formatter creation is handled in free functions.
Also adapt the users.
Change-Id: Ieef7199f5a36f244b2f38cffef71a5fe0606065c
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
The same can be achieve with a factory method in `Command`, similar to
the existing ones for actions and buttons which synchronize their tool
tips with the shortcut.
Change-Id: I7e17654706b902dfa14f37b958fc2a60705d5cb5
Reviewed-by: hjk <hjk@qt.io>
It was not readily clear that Environment::appendOrSet/prependOrSet
needed a value for "sep", otherwise it would just concat the values without separator. This got apparent when looking at usages of
appendOrSet.
Instead there are now three options, "Auto", "Colon" or "Semicolon"
with the default being "Auto", which determines the separator based on
the Environment::OsType.
Usages of appendOrSet and prependOrSet are also fixed with this commit.
Change-Id: I868e14ce38f50be9cd07292fe3f22663a62d116d
Reviewed-by: hjk <hjk@qt.io>
Add an extra arg to runBlocking() function instead.
Use std::chrono::seconds for timeout.
Change-Id: I7c3c21e8f26a2ccbed157d15083d6ef0b4cd2f7e
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
FilePath::contains only checks whether the passed string is inside the
path, and not whether the path contains a folder or file with the passed
string.
Change-Id: I20a1a9a52a9f9a436433848ac2eccd38666274d7
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Instead of relying on the DebuggerRunWorkerFactory to match for all
RunConfiguration, every plugin needs to create a WorkerFactory for
its own RunConfiguration.
Similar to the SimpleTargetRunnerFactory there is now a
SimpleDebugRunnerFactory which makes the setup easy.
Change-Id: I25aaabcd70f7ac649baeab4eb4c7e88d53dac91e
Reviewed-by: hjk <hjk@qt.io>
The plugin classes partially changed there purpose, they are no more
meant to provide internal utility functionality.
Change-Id: I9b9200995eaa95dcd924c94dcedb28e6d5db0be9
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: David Schulz <david.schulz@qt.io>
The button should only be enabled if no kit can be associated with the
currently selected python interpreter.
Change-Id: I0357bf999c8abd2bc11b4ac5b2e79a10a0d94f01
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Checking for the venv and pip module can take some time. Since this is
done now whenever the kits are validated this has performance
implications for multiple actions. For example showing the target
selector wizard page or opening/switching sessions.
Use a cache to reduce the number of python processes started to check
the existence of the modules, and if the module can be found store that
info in a persistent store to avoid checking it again after a restart.
Change-Id: Ib899da0e6b2da28fbee2b5baff7f923e4595260a
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Install the language server into the Qt Creator resource directory
instead. Reuse the server for all interpreters with the same
version. This also reduces the amount of editor toolbars asking the user
to install a language server for a specific interpreter.
Change-Id: I48ef4ad30fe0097ee8d2b855b0f278e98be5ce57
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Loading .pyprojects file now doesnt add a target for the default kit but
results in showing the target setup page which is filtered for usable
kits.
Change-Id: I4c407960a90a27457314281b79dc8878510eca80
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This makes sure the project can be parsed even if we do not have a valid
build configuration for that target.
Amends 09e94ae4ac
Change-Id: I92214474f581af228bd5c2aaf2f3e4b620ffc9d5
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
In case we are having symbolic links on python or its parent
path(s) we added an interpreter for each of these.
Resolve the python path explicitly and only add them if they
are unique.
Change-Id: I21b9d7d85e82c5ec3a18e182dfcde2b98936a8af
Reviewed-by: David Schulz <david.schulz@qt.io>
Make naming consistent with recent changes.
"Done" is meant to be an event name when the task / group
finishes. "Done" may finish with "Success" or an "Error".
This addresses the 26th point in the task below.
Task-number: QTCREATORBUG-28741
Change-Id: I53ed6905b1c385c398f49e122e8ca60aa3ad0806
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>