Commit Graph

4907 Commits

Author SHA1 Message Date
Christian Kandeler
daf1b29b2d Core: Try not to evict still-running searches
... when the maximum number of searches has been reached.

Task-number: QTCREATORBUG-28976
Change-Id: I12bad860ce61f71aad9ba2fec93333a5d98bc61d
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-04-25 08:04:03 +00:00
Jarek Kobus
57d982e5ca OpenDocumentsFilter: Reimplement matchers()
Change-Id: Ie458d74321286d720b3eef62b7b3273c5c222e44
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-04-25 07:32:27 +00:00
Jarek Kobus
e9ae45bfcc FileSystemFilter: Reimplement matchers()
Change-Id: I47547713cadfe9aa1212336ffbfbdace3dd84430
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-04-24 07:39:29 +00:00
Jarek Kobus
9a1be79c0d LocatorWidget: Reuse LocatorMatcher in LocatorWidget
Introduce QTC_USE_MATCHER env var temporarily. When
this var is set, the locator will use LocatorMatcher
internally.

It's very hard to migrate all the matchesFor() implementations
into the LocatorMatcherTask in one patch, so this var
is going to be removed when all filters are migrated.

Whenever a new patch providing the filter's migration
is added, it may be tested by setting this env var.

Add a temporary printout with info about which implementation
is selected in runtime.

Change-Id: If2d6006a89f3669ea4f6f8f171e59e00917419c4
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-04-24 06:19:36 +00:00
Eike Ziller
e596ee2b68 Examples/Marketplace: Put horizontal ruler into the heading
Avoid the separate line above the heading, which also doesn't
make much sense for the first item.

Change-Id: I2cb4aa270f805552215f4f3dc114103f9f3c313f
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-04-21 12:17:45 +00:00
Eike Ziller
54177ebccd Locator: Fix opening of remote files
Opening remote files can pop up a ssh prompt, and before that happens we
need to hide the locator popup, which otherwise can stay on front of
that ssh prompt window, preventing the user from entering their password
and opening the file.

Otherwise for example modal error dialogs could also be shown.

So, delay the EditorManager::open call to after the popup is hidden.

Amends 07b1e1c5fe and
7f49d93fc1

Change-Id: If2dd9e745d5d98615b851ee4315e7de9a75afb00
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2023-04-21 10:37:52 +00:00
Jarek Kobus
f21e2ff65c LocatorMatcher: Add more comments, do some renaming
Rename:
OutputDataProvider -> ResultsDeduplicator
OutputFilter -> ResultsCollector

Change-Id: If29ae29a2fa6895ad36d94577824fbb2e6b65a4d
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-04-21 08:27:54 +00:00
Jarek Kobus
0ab1eaa31c LocatorMatcherTask: Refactor the storage class
Considering the case that a locator task is running
its task in a separate thread, at least 3 threads are
involved:
1. Main thread
2. Task's thread
3. OutputFilter's thread (the thread that removes
   duplicates from tasks' results)

State before this patch:

The task (2) was always delivering the results into
the main thread (1), and when main thread received
the result it was passed to the OutputFilter's thread (3).
The drawback is that we needlessly block the main thread
for intermediate handling.

State after this patch:

The task (2) is delivering the results directly to
the OutputFilter's thread (3), without blocking
the main thread (1).
Currently the common object shared between all 3
threads is OutputDataProvider.

Rename addOutput() into reportOutput().
Make ILocatorFilter::matchers() private.

Change-Id: Ie8ad7d82ae02825e232f65b82fe329e780f58626
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-04-21 08:27:35 +00:00
hjk
61aef4aba5 Core: Use IOptionPage::setWidgetCreator() for mime settings
Less boilerplate for the implementation add user code access to
IOptionPage::{apply,finish} is planned to be removed.

Change-Id: I75c9ca893f49d66b72f6108f2451f3b0cb46722a
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-04-21 08:15:08 +00:00
Jarek Kobus
38d4f3fef3 LocatorFilter: Introduce LocatorMatcherTasks
Change-Id: I775c88b8ac7d7bb0719a6b20d1e5171dbd62a94d
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-04-21 06:45:28 +00:00
Jarek Kobus
422d422deb LocatorMatcherTask: Get rid of Input/OutputData typedefs
Introduce LocatorFilterEntries instead.

Change-Id: I082e0405441aa4b70a5e8fb796aa5c4fa3879265
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-04-21 06:45:04 +00:00
Jarek Kobus
c09951d1b7 LocatorFilterEntry: Get rid of filter field
Remove also c'tor taking a pointer to filter.

Change-Id: Ic0fe62daeb6e79a729bee24d07d7eb77559e19c4
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-20 13:46:03 +00:00
Jarek Kobus
f13c39c912 ILocatorFilter: Get rid of accept() method
Change-Id: I3ad3c2cd5cb7a08b7539918b7713bfcd27fde297
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-04-20 13:26:06 +00:00
Jarek Kobus
74322dfedf LocatorFilterEntry: Get rid of internalData
Change-Id: I2bcd64c39bdaf0fe8504b68ba4aaaef7cdcab475
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>
2023-04-20 12:14:02 +00:00
Jarek Kobus
107d16fe34 ExternalToolsFilter: Use Acceptor for LocatorFilterEntry
Change-Id: I1d9073f9849be7ada05a9f12237db2a32a5c802b
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>
2023-04-20 12:09:53 +00:00
Jarek Kobus
64f946445c CppLocatorFilter: Add cppCurrentDocumentMatcher()
Add also a test for it.

Change-Id: I324b1a2cbe89c0a1258dde93524689cb85e06737
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-04-20 11:59:01 +00:00
Jarek Kobus
0b5db8e558 ExecuteFilter: Use Acceptor for LocatorFilterEntry
Change-Id: I44bac91b192f8f9eb15b3151cd3d0d21caed0312
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-04-20 11:56:43 +00:00
Jarek Kobus
7f49d93fc1 FileSystemFilter: Use Acceptor for LocatorFilterEntry
Change-Id: I64059f0b02f8b893ba092b8ccea6c85453463078
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-04-20 11:56:35 +00:00
Jarek Kobus
c118f8cae4 UrlLocatorFilter: Use Acceptor for LocatorFilterEntry
Change-Id: Id4b97a10bc01ab4392d7e7fc6e5890dcd3d42be9
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-04-20 10:28:44 +00:00
Jarek Kobus
99b5d93cfb LocatorMatcher: Introduce MatcherType enum
Use it for registering/getting different kinds of matchers.

Change-Id: I6f944e0332bf8c512892a00b8ba88f9939f34682
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-04-20 09:18:11 +00:00
Jarek Kobus
129fc0583f ILocatorFilter: Move allLocatorFilters() into private section
This shouldn't be used outside of locator scope.
For other usages that could reuse some filter's
implementation use LocatorMatcher with shared
list of LocatorMatcherTask.

Change-Id: I63a62c79b38985e24835fecd38d016dfb164a16e
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-04-19 13:47:33 +00:00
Eike Ziller
a353e9fde1 Markdown: Reuse Markdown highlighter from change log viewer
Change-Id: Ief1b0c135a34bfd5e9b5220e9fbf93f281d8e95a
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-04-19 11:48:15 +00:00
Jarek Kobus
eb98f2f404 ActionsFilter: Use Acceptor for LocatorFilterEntry
Change-Id: I433f9b44173efd0c66130bcf411cf0ec04816edb
Reviewed-by: David Schulz <david.schulz@qt.io>
2023-04-19 09:40:13 +00:00
Jarek Kobus
9eb826f393 JavaScriptFilter: Use Acceptor for LocatorFilterEntry
Change-Id: Icceb830a391809cc760adf106e6c9e8b71dcb176
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-04-19 08:02:51 +00:00
Jarek Kobus
fadbc55cdf OutputDataProvider: Fix workingList initialization
Broken in patchset 57 of the amended change.

Amends 2eba3584a1

Change-Id: I92c54793c8a31dd0f3f9a1e0b2cf8c4efde741ec
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-18 14:11:31 +00:00
Jarek Kobus
9f78ca6f11 Reapply "CommandLocator: Use Acceptor for LocatorFilterEntry"
This reverts commit 20a4954cbd.

Change-Id: I52a969ee8a26a9835ef15f906e4e418af5352aab
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2023-04-18 12:16:02 +00:00
Jarek Kobus
9388ab252e LocatorFiltersFilter: Use Acceptor for LocatorFilterEntry
Change-Id: I917ce346bf66cb18890d7d055501218d12a2c3ad
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-04-18 12:12:19 +00:00
Jarek Kobus
0c3789726d LocatorMatcher: Introduce LocatorMatcherTaskCreator
Register cpp and lsp matchers for all symbols,
classes and functions.

Change-Id: Id85c8164077ec395dac7e6ff45acc89db9e6ae08
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2023-04-18 11:40:16 +00:00
Eike Ziller
5adb656550 Show locator filter descriptions more prominently
- Sort items in the menu.
- Disable items for disabled filters.
- Show a tool tip when hovering over the magnifying glass menu.
- Add descriptions to all filters and make them more consistent.

Change-Id: Ic03e303c50422f9de5dd3c512fe32bbdc958d2ba
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-04-18 11:19:17 +00:00
Jarek Kobus
07b1e1c5fe LocatorFilterEntry: Add Acceptor field
Add also AcceptResult structure, returned by acceptor.
The Acceptor, being a member of LocatorFilterEntry,
is going to be used instead of virtual ILocatorFilter::accept()
method. By default, when no Acceptor is provided, the
locator widget is going to call EditorManager::openEditor()
with a LocatorFilterEntry instance.

Change-Id: Ic9697492738d65fd1331bbd0872bc374285c4e53
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-04-18 10:08:42 +00:00
Eike Ziller
abf7dd23ed Show filter description in locator settings
Directly in the items, instead of just in the tooltip.

Change-Id: I631598ef3e38967a6fcf84fd70f22bccc8b97ea7
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-04-18 09:19:43 +00:00
Jarek Kobus
2eba3584a1 ILocatorFilter: Introduce LocatorMatcher
This machinery is going to replace
ILocatorFilter::matchesFor() and filter usages outside
of locator scope, e.g. in find unused functions.

In contrary to LocatorWidget, which calls
Core::Internal::runSearch() in a separate thread
and the latter executes matchesFor() sequentially for all filters,
this patch offers a possibility to run all filters in parallel.

Change-Id: Ia59463c95294299090173f3d510d57c9f8c7f993
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-04-17 12:32:20 +00:00
Jarek Kobus
20a4954cbd Revert "CommandLocator: Use Acceptor for LocatorFilterEntry"
This reverts commit 962888cb02.

Reason for revert: Applied too early and produced a conflict

Change-Id: I98a2895a81196b61cf7020a187d3740be231f671
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2023-04-17 09:21:09 +00:00
Jarek Kobus
962888cb02 CommandLocator: Use Acceptor for LocatorFilterEntry
Change-Id: I965cf7117d882afe4ac60df7d16dc67d4dac3891
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2023-04-17 09:10:46 +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
Eike Ziller
9650a2bded Examples: Limit categories to single row and allow showing all
Limit the items shown for categories to a single row (two rows for first,
"featured" category), and add a "Show All" link/button in the heading,
that shows all items in that category only (with a "Back" button).

The "Search in Examples" input ignores categories.

Change-Id: I7c8561a306ad86c3b537587621d3fd030cd08af8
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-04-13 13:05:32 +00:00
Jarek Kobus
59c1fae60b DirectoryFilter: Hide public methods
Make most of the public methods of DirectoryFilter
protected. Move connection to project manager signals
into AllProjectFilesFilter c'tor. Remove unused
DirectoryFilter::directories().

Change-Id: I66d16c2c90188de6a03fb072fed6c87ea3d9ce4c
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>
2023-04-11 14:03:19 +00:00
Jarek Kobus
a22e3acf28 LocatorFilterEntry: Discourage the use of internalData
Drop internalData from c'tor. The internalData is going to be
removed, soon. Drop also the icon arg from c'tor since
LocatorFilterEntry instances are usually created in non-main
thread, while operating on QIcon instances isn't really safe
in non-main thread. The use of QIcon inside this struct is
a subject to change in the future, in a way like it was done
in other parts of code that generated icons from non-main thread.

Change-Id: Ic6aa719a64e5fbd65883c54149796057c632780e
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-04-05 05:33:57 +00:00
Tim Jenssen
adb664f521 Merge remote-tracking branch 'origin/qds/dev'
Conflicts: src/libs/utils/filepath.cpp
  src/plugins/qmldesigner/qmldesignerexternaldependencies.cpp
  src/plugins/qmlprojectmanager/cmakegen/generatecmakelists.cpp
  tests/unit/unittest/CMakeLists.txt

Change-Id: I017a6075db41a5233487ac855ffe23de2b2bb0ee
2023-03-30 13:30:42 +00:00
Eike Ziller
29108a1463 Do not automatically reset progress details position
Add a "pin" button that appears on hover if the details have been
dragged around. Clicking on it resets the position.

Position is also reset when hiding & re-showing the details with the
button. And the details snap to the original position when dragged near
it.

Fixes: QTCREATORBUG-28829
Change-Id: I6a6f13ca1baac79951c20f2e8edf6fac137a8cfc
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-03-29 06:43:17 +00:00
Ali Kianian
5644fa1b9c QmlDesigner: Move StyleAnimator to Utils
StyleAnimator moved to Utils in order to be used by other modules and
styles.
Since Utils is the most common dependency, it's chosen as the right
place of StyleAnimator.

Task-number: QDS-9522
Change-Id: Idbf55875e0c320ccfa21e1c479bf5997ea7d150d
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2023-03-28 10:13:28 +00:00
Eike Ziller
3afe94777c Examples/Marketplace: Create grid view with all items on demand
No need to create that at startup.

Change-Id: Iff4cc634777fdd6cc9920a60e3260ee6d5a1a619
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-03-27 06:48:35 +00:00
Tim Jenßen
feabda3aa7 Merge remote-tracking branch 'origin/10.0' into qds/dev
bigger conflicts resolved at:
  src/plugins/qmldesigner/CMakeLists.txt
  src/plugins/qmlprojectmanager/qmlprojectrunconfiguration.cpp

Change-Id: I08e2a109d8e37cbd77225129854e9e633725bfc7
2023-03-26 16:26:18 +02:00
Jarek Kobus
b5af4501df Fix include style
Change-Id: I64cb77f8d39dac35821fe96d735bc5dda35738e7
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-03-24 13:42:50 +00:00
Alessandro Portale
83d40683d9 Core: Fix error text color in SearchResultWidget
Remove the CanceledSearchTextColor theme role and use TextColorError
instead.

Change-Id: I3dde538d107ecfdd9c9a3f2406f6cd26ad28c902
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-03-24 08:47:24 +00:00
hjk
2766b4004b Utils: Continue Environment/EnvironmentChange consolidation
Make Environment a stack of changes that gets "expanded" to
a full environment before things are actively accessed.

Later this expansion should be done lazily if possible.

Task-number: QTCREATORBUG-28357
Change-Id: If1c7bfdb9f58b81e71c51ed87ee75d6964a47019
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-03-24 07:45:35 +00:00
Marcus Tillmanns
1d9c96a9f4 Terminal: Add enable setting
Change-Id: I13cca8b2d4c55df7db29807c1252718e2819ea0b
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2023-03-23 11:42:00 +00:00
Artem Sokolovskii
5a0ec63895 Core: Refactor disambiguateDisplayNames
- Used FilePath utils for finding common ancestor

Change-Id: I2491a66196128e927bd0da5729ed45eeb0b35646
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-03-22 08:06:21 +00:00
Alessandro Portale
50a214de9e Qbs build system: Add a component for test files groups
Mainly in order to enforce a unified group name across QtC libraries and
plugins.

Change-Id: I6eafe0f9d227ec73d8c9029675866c67063768fb
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-03-21 14:54:08 +00:00
Eike Ziller
c7e94d80c7 Merge remote-tracking branch 'origin/10.0'
Conflicts:
	src/shared/qbs

Change-Id: I33e13270c8c15a51b4ce4eaa6b4584041ed124e0
2023-03-13 12:30:04 +01:00