Commit Graph

17 Commits

Author SHA1 Message Date
Eike Ziller
b4fed03c27 Merge remote-tracking branch 'origin/9.0'
Conflicts:
	src/plugins/cppeditor/cppeditorplugin.cpp
	src/plugins/docker/dockerdevice.cpp

Change-Id: I41747ff9490e4ab20340d4d4acb4655100aaa3d2
2022-12-07 10:47:47 +01:00
Artem Sokolovskii
f93404d405 CodeStyle: Fix loading settings at the start in codestylesettingspage
Fixes: QTCREATORBUG-28450
Change-Id: I578c6cd102e4753d3af562986dad62e10e54d06d
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2022-12-06 12:44:45 +00:00
hjk
9d80e23256 CppEditor: Proliferate FilePath use
This includes one functional change: It drops some cleaning
of the path used to create the CppDocument, which is now
assumed to be done on the caller side.

Change-Id: I5e2a182028e4d5b56282ad85f4a5c665f081754f
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-11-24 15:54:33 +00:00
hjk
fa1adf4d40 CPlusPlus: Proliferate FilePath use
The starts with CppDocument::filePath(), plus a bit of the fallout

This is one patch of potentially many. It is hard to draw the
line where to stop this kind of chunk, this here converts a few
additional functions for which including it in the patch looked
like less churn than without.

Converting is mostly fromString/toString, with a few exceptions
for "already seem" like caches, that use cheaper "path()" to
avoid likely performance regressions (on Windows FilePath
comparison is currently case-insenstive, and more expensive).

There should be no difference for local operation with this patch.

Change-Id: I7b35f98a0a6f0bfed4ea0f8f987faf586f7a8f2b
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2022-11-22 15:30:00 +00:00
Jarek Kobus
47b5613c53 CppCodeStyleSettingsPage: Use Layouting
Change-Id: Ied8991d32d5799af944c94a65ff3e85f3f454b26
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-11-18 08:14:00 +00:00
Marc Mutz
8eb4d52342 Port from qAsConst() to std::as_const()
We've been requiring C++17 since Qt 6.0, and our qAsConst use finally
starts to bother us (QTBUG-99313), so time to port away from it
now.

Since qAsConst has exactly the same semantics as std::as_const (down
to rvalue treatment, constexpr'ness and noexcept'ness), there's really
nothing more to it than a global search-and-replace.

Task-number: QTBUG-99313
Change-Id: I88edd91395849574436299b8badda21bb93bea39
Reviewed-by: hjk <hjk@qt.io>
2022-10-07 13:47:53 +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
Alexander Drozdov
4a79623959 Fix crash on Preferences dialog close
Mitigation for regression introduced by
74ac09346f.

On finish() method call m_widget maybe nullptr, so call for any him
methods is dangerous without checking for nullptr.

Change-Id: Ia7ab5572946fef9bcc62c63709e5ffc69cd2ebae
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Artem Sokolovskii <artem.sokolovskii@qt.io>
2022-08-17 22:28:41 +00:00
Artem Sokolovskii
74ac09346f CodeStyle: Remove edit pop-up
Removed the Edit pop-up on the CodeStyle page.
Now editing is available immediately after opening
CodeStyle tab.
I left a preview on the project CodeStyle page and
added a link to global settings.

ToDo:
In project CodeStyle page replace preview with CodeStyleEditor.
I'm not 100% sure that it is needed. If you have some thoughts
please write a comment.

Change-Id: I31032a97b9668b4f6b06fc6c5c704700fb44ee4f
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2022-08-16 11:49:19 +00:00
Artem Sokolovskii
e572bdd90c ClangFormat: Move global settings in main page
The settings: indenting instead formatting, format while
typing, format edited on file save are moved to Code Style
page.

Change-Id: I28787b44602ce288961c778fe704ad2a1a05913f
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2022-08-05 09:41:14 +00:00
hjk
2361353289 CPlusPlus: Remove Rreprocessor::run overload for QStrings
The preprocessor operates on QByteArray, making it less
convenient to use strings helps preventing accidental
conversion roundtrips.

Change-Id: Ifb2068a8fed137c52b05f2979b99cbce3462151e
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2022-08-01 12:18:06 +00:00
Artem Sokolovskii
7e69b64b74 CppEditor: Remove foreach / Q_FOREACH usage
Task-number: QTCREATORBUG-27464
Change-Id: I9915cf2c07bdcc570efc20601752d60f2ec82f34
Reviewed-by: David Schulz <david.schulz@qt.io>
2022-05-06 13:35:43 +00:00
Artem Sokolovskii
9afe4f958a ClangFormat: Remove unneeded warning
- Remove warning when .clang-format file is absent
- Remove warning when a page is nullptr in addTab function

Change-Id: I4232bc77eaac56c78707fc37aaf75b00b8af9006
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2022-04-26 09:10:05 +00:00
Artem Sokolovskii
059d20ed22 ClangFormat: Fix unsaving properties for global settings
- Fixed behavior "Formatting mode" combobox settings isn't
saved after pressing "Ok" button when no one project is
open. Now it works as expected, settings save after press
"Ok" button.
- Added additional applying interface for ICodeStylePreferenceFactory
which allows pass-through apply call from dialog to the editor.

Note: it doesn't work with read-only code style profiles

Change-Id: If4f0c85e3105550db4ffd9860e94b678f0d9b386
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2022-03-30 16:32:08 +00:00
Artem Sokolovskii
a997161dd6 ClangFormat: Synchronize ClangFormat settings with CppEditor codestyle
Added synchronization between ClangFormat codestyle settings and
CppEditors codestyle settings. All changes which will be done in
ClangFormat settings tab settings tabs will be automatically
retranslated to CppEditor codestyle settings tabs and vice versa.

Change-Id: I408d726c12552856e3c1b72d3ba09b77fff83321
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-11-24 21:35:31 +00:00
Artem Sokolovskii
9cb0bd94f0 ClangFormat: Move ClangFormat settings page
- Move ClangFormat settings page to TabWidget in the dialog
that opens when a user press "Edit" button in the CodeStyle tab

Change-Id: Ibd285344f07a6b2b20e275f2134976c50f91a019
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-10-08 13:09:12 +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