Commit Graph

193 Commits

Author SHA1 Message Date
Eike Ziller
f562ebf239 Mimetypes: Make implementation switchable between new and old
- configure with QTC_USE_NEW_MIMEDATABASE to switch to the new one in
  utils/mimetypes2/
- added utils/mimeutils.h header for the Qt Creator specific static
  wrappers, that also includes the "public" headers for MimeType et al
  from the new or old implementation, depending on configuration
- change all utils/mimetypes/ includes to utils/mimeutils.h
- move the implementation for the wrappers to
  utils/mimetypes(2)/mimeutils.cpp
- also move the MimeDatabase declaration in the "old" implementation
  back to utils/mimetypes/mimedatabase.h

Change-Id: Ie8de229c035d6cd9a5e4739dc0fa78d9c17228e3
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-02-25 07:19:58 +00:00
Fawzi Mohamed
bdd7fcbac2 qmljs: fix scan out of build dir
Scan outside the build directory was possible on mac and windows.
Avoid it by checking the relative path to the build directory.

Change-Id: I6a7082998429f902745146446bf89fc0cc75ca54
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2022-02-11 13:17:18 +00:00
hjk
25f5771aa4 Rename QtSupport::BaseQtVersion to QtVersion
... and the Utils::QtVersion enum to Utils::QtMajorVersion to avoid
conflicts.

Change-Id: Ib688c67388272b7204a91444155f60b8c18a56bd
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2022-01-24 12:13:19 +00:00
Maximilian Goldstein
3d47a0ef09 qmljsmodelmanager: Add additional directories to find qmltypes
This works around the issue that we only looked for qmltypes in the
directory the binary ends up being stored in. This did not work
for macOS and Windows as those are stored in subdirectories due
the platform specific ways binaries are stored there.

Now we also look in the directory where the qmltypes should be located
on these platforms.

Task-number: QTCREATORBUG-24987
Change-Id: I23d46e68f8fad0b4e2e8a01fc7c41360f1e6961e
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-12-07 10:15:11 +00:00
hjk
d68bb4687c QmlJS: Proliferate FilePath and QtcProcess use in QmlJSPluginDumper
Change-Id: Ie483bb2e9b5d812d380470949564a6bc57801fa9
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-10-27 07:57:13 +00:00
Christian Kandeler
284817fae6 Merge CppTools into CppEditor
There was no proper separation of responsibilities between these
plugins. In particular, CppTools had lots of editor-related
functionality, so it's not clear why it was separated out in the first
place.
In fact, for a lot of code, it seemed quite arbitrary where it was put
(just one example: switchHeaderSource() was in CppTools, wheras
switchDeclarationDefinition() was in CppEditor).
Merging the plugins will enable us to get rid of various convoluted
pseudo-abstractions that were only introduced to keep up the artificial
separation.

Change-Id: Iafc3bce625b4794f6d4aa03df6cddc7f2d26716a
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-09-01 14:53:58 +00:00
Tim Jenssen
22121885fe baseqtversion: commands are FilePathes
also renamed the qmlscene* qmlRuntime*

Change-Id: Ifd522e21f5ce30aaa54060fdcebee2cd8b9463c4
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2021-07-14 09:50:01 +00:00
Robert Löhning
e065107fa5 QmlJSTools: Guard against null pointer access
Fixes: QTCREATORBUG-25943
Change-Id: If9e6528b0dc5642dbd150e7d20aeb9347f3d4465
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Erik Verbruggen <erik.verbruggen@me.com>
2021-07-07 09:45:52 +00:00
hjk
6f5d78a297 QtSupport: Use FilePath for several BaseQtVersion members
uicCommand(), designerCommand(), linguistCommand(), qscxmlcCommand(),
qmlsceneCommand(), qmlplugindumpCommand().

No change in functionality intented.

Change-Id: I43121de559019f96c2c1ff3b423974dddfc37124
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-07-01 09:30:29 +00:00
David Schulz
e13c2b7403 MimeDatabase: add FilePath convenience function
Change-Id: I59c825490b3b5c49f3c177584ea4cc885c4f920b
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-06-23 12:03:28 +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
Kai Köhne
4f8474e532 Simplify handling of qmlplugindump
Much of it isn't needed anymore:
- we do not build a debug version of qmlplugindump anymore since Qt 5.0
- on mac, qmlplugindump is not an app bundle since Qt 5.1
- since commit 6871f31b4e, the env parameter was just passed through

So if we take out this and all the infrastructure around it,
qmlplugindump is just a tool that we can handle like all the other
tools.

Change-Id: Ifa583ce7052a9030858312ab7c2e20f7ebce4051
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@qt.io>
2021-03-23 08:41:01 +00:00
Erik Verbruggen
7dc82b1af9 MCU: Do not add fall-back path for QUL kits
Fixes: UL-3609
Change-Id: I9912c7476f3b45346835d60be61fed7399046162
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-02-16 10:33:52 +00:00
Eike Ziller
eaefcbd8f0 Use new, more evocative MessageManager API
At various places where semantics doesn't change.

Change-Id: Ib4d4a5c9f067e109126c6de88257f9e198a71447
Reviewed-by: hjk <hjk@qt.io>
2020-12-16 09:30:44 +00:00
Christian Stenger
deda9b7e37 QmlJSTools: Remove unused include
Change-Id: I4bc61fdebd9b2c20497e7569cdb5f5000317f22d
Reviewed-by: hjk <hjk@qt.io>
2020-07-20 10:23:26 +00:00
hjk
dd980e23f8 ProjectExplorer: Remove Target::applicationTargets()
That's BuildSystem::applicationTargets() nowadays.

Change-Id: I01cf0a491e4cb289af08f529fd15c85bfcdf5493
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-03-25 10:42:22 +00:00
Ulf Hermann
1e587831d1 QmlJS: Scan app.qmltypes and lib.qmltypes for type information
app.qmltypes is being added as a new convention to Qt 5.15. These files
are to be found next to application binaries, and contain the QML types
those application register themselves, in contrast to QML types
registered from plugins loaded via the regular import mechanism.

lib.qmltypes works the same way, in principle, for libraries. This
change only adds it to the possible names for qmltypes files, though.

Change-Id: I1d7c5835c8c3e988d214c5cdb949ca677b48dfc5
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-10-31 09:07:57 +00:00
Ulf Hermann
58c023e7c4 QmlJS: Clean up qmljsmodelmanagerinterface.{h|cpp}
Avoid foreach, fix linter warnings, simplify types, apply coding style.

Change-Id: I7cec65e775ee14ce60e1e57077e917285d58c152
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-10-29 11:45:32 +00:00
Ulf Hermann
987288bcec QmlJSTools: make setupProjectInfoQmlBundles private
No one needs to call this function.

Change-Id: I5647475ef2ec7dce5dcf7834245985bfb45632e6
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2019-10-28 07:47:03 +00:00
Ulf Hermann
6371725dbf QmlJS: Clean up ViewerContext
The special ctor wasn't used anywhere, the default ctor can be replaced
by inline initialization, maybeAddPath is only meaningful in the model
manager and the language compatibility check should definitely not
pretend to be a general rule either.

Change-Id: I11cf25fe1c696550d33b56ce57316100321d564b
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2019-10-23 10:14:47 +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
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
Orgad Shaneh
1e138fbe10 Remove excess blank lines after namespace
Change-Id: I4e4f83017f2bfc2cf842c4c971ed4b05e0447e6a
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-05-27 06:50:16 +00:00
Christian Kandeler
83dd031960 ProjectExplorer: Rename KitInformation to KitAspect
The name "KitInformation" does not properly convey the fact that it
represents a certain *aspect* of a kit. The same goes for
"KitConfigWidget", which in addition was inconsistent with
"KitInformation".
We now use "KitAspect" and "KitAspectWidget".

Change-Id: I9804ee4cedc4d61fad533ea1dd4e4720e67fde97
Reviewed-by: hjk <hjk@qt.io>
2019-02-11 11:55:01 +00:00
Alessandro Portale
f5974ad993 Fix warning: "Don't call QVector::first() on temporary QList/QVector"
[-Wclazy-detaching-temporary]

Change-Id: I23f5cbd80bb92d3f9f1bfb5ae07493818958c5b0
Reviewed-by: hjk <hjk@qt.io>
2019-01-28 11:03:39 +00:00
Tim Jenssen
372e239d2d QmlJS: remove qtquick1 leftovers
QT_INSTALL_IMPORTS and the used ProjectInfo.qtImportsPath variable
were only used for QtQuick1.

Change-Id: I34da0cfc77effa84f3a7578e7f91fed0768a9bf4
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2019-01-18 13:16:30 +00:00
Alessandro Portale
134bb1b8b6 QmlJSTools: Modernize
modernize-*

Change-Id: Ifc270455ab7500d18798ac0130744662ad3303fb
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2018-12-07 18:42:04 +00:00
hjk
4248c53c79 QmlJSPlugin: reorganize setup
Pimpl, remove use of global object pool, cosmetics, ...

Change-Id: I9e1415b07d7ff8e95db0998c87ce7d75ca638a8e
Reviewed-by: Marco Benelli <marco.benelli@qt.io>
2018-02-08 10:37:12 +00:00
hjk
cc88302309 De-emphasize PluginManager::getObjects<Type>()
... by additionally keeping local (currently non-owning) pools per
"interesting" type.

Current situation:
  - The global object pool does not scale well for looking up
    objects, as iteration plus qobject_cast typically iterates
    over all pooled objects.
  - User code that can use typed results from the object
    pool need to have access to the full type definition anyway,
    i.e.  depend on the plugin of the target class anyway.

The patch here solves the scaling problem is to have local
type-specific pools to which objects register in their
constructors and deregister in their destructors.

This patch here does *not* change the ownership model of the
pooled objects, however, it opens the possibility to change
the ownership model per type (e.g. by not putting things into
the global pool at all anymore and make the local pool 'owning')
and the intent is to handle that in later patchs.

Even without the follow-up patches this here is a performance
improvement for the cases that access the local pools instead
the global one, i.e. "practically all".

Change-Id: Ib11a42df2c4ecf5e1155534730083a520dd1995b
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2017-12-15 07:08:05 +00:00
Tobias Hunger
f542e24eca Project: Make Project::file take a std::function to match files
Make Project::files take a standard function to match files with instead
of an enum (and a std::function).

Change-Id: I6a24e40dba0e972ff96c0a57e775d2377e2545e0
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2017-12-08 09:56:29 +00:00
Tobias Hunger
18f38ff18e Project: Make Project::files return a FileNameList
Change-Id: I75ceb22ac65b8288d824f229d44089cba6fc8ea3
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2017-12-08 09:09:59 +00:00
Ulf Hermann
defcb6a55a QtSupport: Add a method to retrieve the QML path
We check that qmake property in many different places.

Change-Id: Ifd5efe4ad2831385493bd3afe8538929578e8fb4
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-09-29 08:26:33 +00:00
Tobias Hunger
96df9f9189 QmlJSModelManager: Simplify code
Change-Id: Idb4fef70063ce3b42c497e302e4b69bb73f314d7
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-07-25 14:29:03 +00:00
Tomasz Olszak
70ffdb99d8 Add QML2_IMPORT_PATH to qmlplugindump if defined in build configuration
Change-Id: I0e3a6beda6cca2a065b2d47115b04362d82c879a
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Reviewed-by: Marco Benelli <marco.benelli@qt.io>
2017-07-04 14:45:29 +00:00
Marco Benelli
7a940febbe QmlJs: initialize qmlDumpEnvironment
Task-number: QTCREATORBUG-18335
Change-Id: I4f70da8062fde5aadef978f73351d8938d2267eb
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-06-08 15:47:40 +00:00
Tobias Hunger
0a3409112b ProjectNodes: add listInProject() to Node
Add a setter/getter for listInProject to Node and make the project
list all nodes with this property set in Project::files.

Task-number: QTCREATORBUG-18132
Change-Id: I334e627856d1bc0d033e13c5d629f6657d8d7fee
Reviewed-by: hjk <hjk@qt.io>
2017-05-04 09:16:56 +00:00
Tobias Hunger
437af83c9a QmlJSModelManager: Avoid needless Mime database lookups
This speeds up processing of a cmake project without any QML files by a
factor of 16 on my machine.

Task-number: QTCREATORBUG-17884
Change-Id: I823d4a051451adbca10a8b73c17d288e03387378
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2017-03-27 15:18:15 +00:00
hjk
3f5caf4cdc Utils: Wrap MimeDatabase into static functions
To avoid repeating the 'MimeDatabase mdb; mdb.something(); ' mantra
all over the place.

Change-Id: I4bfef62e73275a991455141671d6071162788e9d
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2017-03-03 07:57:54 +00:00
Ulf Hermann
c70b689526 Unify projectexplorer language IDs
We don't need two IDs for C++ and the QmlJS ID should look the same as
as the others.

Change-Id: Ib9747f6b36a90bb652951d85eec69666615670c4
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-01-30 15:34:46 +00:00
Tobias Hunger
6871f31b4e QtSupport: Pass kit to QmlDumpTool::pathAndEnvironment
Pass the complete kit to QmlDumpTool::pathAndEnvironment instead
of just the Qt Version. That removes the need to guess at the toolchain
used and makes sure we have a better environment set up.

This also removes the need for BaseQtVersion::qmlToolsEnvironment() which
played the toolchain guessing game.

Change-Id: I4f4b9bb14b3ceb3892652901b459b53fcc4cb1ac
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-01-16 10:49:16 +00:00
Orgad Shaneh
7609e56ee3 QmlJS[|Editor|Tools]: Use Qt5-style connects
The heavy lifting was done by clazy.

Change-Id: I56550546b341d486d321329e9a90b9369d56af40
Reviewed-by: Marco Benelli <marco.benelli@qt.io>
2016-06-28 08:47:26 +00:00
Tim Jenssen
a6d21cc1f7 Qmljs: small QHash improvements
Change-Id: I79a5504c8471b66540aac8047fbcf760ceb6b10f
Reviewed-by: Marco Benelli <marco.benelli@qt.io>
2016-06-20 14:08:43 +00:00
Thomas Hartmann
7e7246bd25 QmlJS: Do not rely on Qt Creator plugins running
This is not the case in some tests.

Change-Id: I531997bc6eb0b9cb8057b7e488bca1c301c88add
Reviewed-by: Marco Benelli <marco.benelli@qt.io>
2016-06-14 08:02:06 +00:00
Orgad Shaneh
e5459fb9dc QmlJS: Limit MIME type matching to extension
This improves performance of MIME type resolving on project loading.

When the MIME type cannot be resolved uniquely by extension to >50 weight,
the file preamble is read in order to match against magic values in the
MIME database.

In 3953e2b447862576902abef11ffb4efc56d7a625 the weight of the standard
file extensions was increased to 70, to at least avoid expensive matching
when the answer is obvious.

Qml types only have glob patterns anyway, so this shouldn't break
anything.

Change-Id: If3add50809a4361f877ea261fba6d6f333b2b740
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
2016-03-15 11:57:38 +00:00
Thomas Hartmann
e3a3792fd6 Removing support for DebuggingHelpers
This patch removes infrastructure and ui for DebuggingHelpers
and specifically qmldumptool.

The qmldumptool was the last relevant DebuggingHelper and is only required
for Qt < 4.8.

Change-Id: I3767be0858e5eba16a33a3ab8436e95fc06a9e99
Reviewed-by: hjk <hjk@theqtcompany.com>
2016-01-25 08:55:27 +00:00
Tobias Hunger
397e7f4843 Update License according to agreement with Free Qt Foundation
* Update files in src/plugins

Change-Id: Ia5d77fad7d19d4bb3498e78661982f68729adb22
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2016-01-19 15:57:01 +00:00
Ulf Hermann
42d570a3fe Rename Project::ExcludeGeneratedFiles
We want to distinguish between source files and generated files. So
let's call them by their names.

Change-Id: I324c4b82ca7fb7d8d0e175ea6c4f14f1306ec929
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2016-01-13 14:12:08 +00:00
hjk
d972b3b091 QtSupport: Remove SimulatorQt
Unused for years.

Change-Id: I721068ecf18afb09fb928a348cbb5e8127a3dfc2
Reviewed-by: Rainer Keller <rainer.keller@theqtcompany.com>
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
2015-04-24 13:45:08 +00:00
Friedemann Kleint
fb80206f3c Clean exported headers of the CppTools plugin.
Change-Id: I0144ac33e88980c431c54a6d69bbde28da4b1967
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2015-03-05 08:16:48 +00:00