Commit Graph

18 Commits

Author SHA1 Message Date
Alessandro Portale
4d6827dde9 Utils: Tr::tr
Change-Id: Ic03e20993f05fb5b49a12c891d86afb2c8e18e08
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: hjk <hjk@qt.io>
2023-02-01 13:48:22 +00:00
Marcus Tillmanns
b5df17cee3 Utils: Use ReadWriteLock
Changes usage of QMutex to QReadWriteLock since the cache is read
more often than written.

Change-Id: Ifb29de6c14fecea373bfcb7c92eb6e3450a61811
Reviewed-by: hjk <hjk@qt.io>
2023-01-18 08:05:37 +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
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
Fawzi Mohamed
fd89043de2 qmljs: (QString -> Utils::FilePath)++
convert more QString containing paths to Utils::FilePath

Change-Id: I1219d7d147993e48cfa641dc9bea72ab38c90f51
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-07-13 17:13:23 +00:00
Fawzi Mohamed
a235aa29a1 qmljs: avoid linking to files in the build directory
cmake creates a consistent uri structure in the build directory.
We use that as import path, but when we find a type in them we should
refer back to the original file, as editing those is dangerous because
any edit are lost with the next build.
To find the original file we use the qrc, as the qrc path is mostly
the same of as the uri path.
It is possible to add prefixes which would make an exact match fail,
so we compare the paths from the right to the left and find the
longest match.

To acheive this:
 * QrcParser keeps a reversedResources, so the match from right can be
   done efficiently, and provides a longestReverseMatches method
 * the model manager keeps a list of all common prefixes of the
   application paths (build directories), and identify all files in
   build directories
 * the method fileToSource identifies the files in the build directory
   and tries to find the corresponding source file, warning if he
   cannot find it
 * fileToSource is used for follow Symbol and find usages

We could use fileToSource much more aggressively, to use to in editor
content for the files in the build directory, increasing the
consistency, but that is a more dangerous change for later.

Fixes: QTCREATORBUG-27173
Change-Id: Iea61b9825e5f6e433a7390cf2de9564b792458a5
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2022-06-21 10:39:52 +00:00
Jarek Kobus
ed40753ed1 Utils: Drop unused headers [I-Z]
Round 2 - focus on sources.
For classes with initial in range [I-Z].
Try to keep the same separators between different kind of headers.

Change-Id: I8a7ab99bab8120ee72cda6433ee3dc6f260a4d76
Reviewed-by: hjk <hjk@qt.io>
2022-05-25 07:49:25 +00:00
Jarek Kobus
0a8dbaf153 Utils lib: Remove unneeded includes from cpp files
It's a result of a team work consisting of yellow triangle and me.

Change-Id: I8b4812766da70e0785ae71bf0cb71357379e2514
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2022-05-19 12:37:20 +00:00
Orgad Shaneh
699d89290e QrcParser: Fixup last change
Missed a spot.

This amends commit a050ae84e2.

Change-Id: Iee25352e7142c59d371e90c6f9a99bf136fd9f35
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-06-17 07:30:45 +00:00
Orgad Shaneh
a050ae84e2 Utils: Use range-based for in QrcParser
+ Avoid modifying the list while iterating it, and also avoid second scan.

Change-Id: Idea74c338e24c300dbc3ca2e4f50797914cc5a1a
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-06-17 07:12:28 +00:00
Eike Ziller
eadfe1a421 Merge remote-tracking branch 'origin/4.11'
Change-Id: Iaa3142a7109bc23c2e6ff96d061a58a9c0e31a54
2020-02-07 16:20:03 +01:00
Leena Miettinen
13cd5add85 Doc: Fix errors in QrcParser and QrcCache docs
Task-number: QTCREATORBUG-23544
Change-Id: Ibd3bdd0b1aecf594b191b2ff902b38cdb335b1d4
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-02-07 14:28:02 +00:00
Eike Ziller
0795a5ae6f Merge remote-tracking branch 'origin/4.11'
Conflicts:
	cmake/QtCreatorIDEBranding.cmake
	qbs/modules/qtc/qtc.qbs
	qtcreator_ide_branding.pri

Change-Id: I4e339410b17df4098f17e3bb621e1c02e3f8026b
2020-02-07 10:41:09 +01:00
Leena Miettinen
392690e565 Doc: Fix Utils::QrcCache and Utils::QrcParser docs
- Move class docs away from the internal namespace
- Add missing docs
- Remove \brief commands and fix capitalization and punctuation

Task-number: QTCREATORBUG-23544
Change-Id: I60440a603e73c78447fd4d923d8631debeb25116
Reviewed-by: hjk <hjk@qt.io>
2020-02-07 07:35:30 +00:00
Alessandro Portale
9904464074 Make various Q_LOGGING_CATEGORY's static
Change-Id: I43d3a198b0863d85a7fb305c7cb768f68acbd139
Reviewed-by: hjk <hjk@qt.io>
2020-01-15 14:54:10 +00:00
hjk
2e14df7561 Some clang-tidy -use-modernize-nullptr
Change-Id: I1bed5e85a5b7948d08502a72a10f80baa075c204
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2019-08-01 13:20:26 +00:00
hjk
06e3e23aa5 Utils: Replace a few macros in qrcparser
Change-Id: I8e3953ad7003115334a490d6ebf8222414722e85
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-03-19 14:27:17 +00:00
Christian Kandeler
2f7f1aaec3 Move qrc parser from QmlJS to Utils
We'd like to make use of it in a more general context, and it's not
directly related to QML.

Change-Id: I025ec67829f85544667684cdb8c99d1ee4c18197
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-02-13 11:48:27 +00:00