summaryrefslogtreecommitdiff
path: root/src/plugins/cppcheck
Commit message (Collapse)AuthorAgeFilesLines
* Utils: Make PagedSettings::readSettings() calls shorterhjk2023-05-161-1/+1
| | | | | | | | | | Ideally, this would not be needed on the user code side at all, but there's no way to ensure the settings are read timing before sibling constructors might need it. So keep the 'poor man's two-phase initialization', but make it less intrusive. Change-Id: Ica7f6510cd05072d7286f4e85cd72c494e8f10f8 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
* CppCheck: Rework settings handlinghjk2023-05-168-338/+179
| | | | | Change-Id: Id9c9b316c5e0d39bc5fcba14951664e72d947a71 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
* Utils: Rename qtcprocess.{cpp,h} -> process.{cpp,h}Jarek Kobus2023-05-041-1/+1
| | | | | | | | Follows QtcProcess -> Process rename. Change-Id: I97235a9a40cb7fd52944515b7ab878d96528f919 Reviewed-by: hjk <hjk@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Utils: Rename QtcProcess -> ProcessJarek Kobus2023-05-042-4/+4
| | | | | | | | Task-number: QTCREATORBUG-29102 Change-Id: Ibc264f9db6a32206e4097766ee3f7d0b35225a5c Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: hjk <hjk@qt.io>
* Layouts: Add/remove contentMargins where neededAlessandro Portale2023-05-041-0/+1
| | | | | | | Some cases were preexisting, some were introduced recently Change-Id: I0e7e7b74422c420fbf4563d7cbf384e53931c3a0 Reviewed-by: hjk <hjk@qt.io>
* CppCheck: Use IOptionPage::setWidgetCreator() for settingshjk2023-04-212-30/+30
| | | | | Change-Id: I0c2b9d96e53ddcecc3d25e519c3df21b1d09ddf7 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* Merge remote-tracking branch 'origin/10.0'Eike Ziller2023-04-131-0/+1
|\ | | | | | | | | | | | | | | | | | | Conflicts: src/plugins/python/pipsupport.cpp src/plugins/qtsupport/exampleslistmodel.cpp src/plugins/qtsupport/examplesparser.cpp tests/auto/examples/tst_examples.cpp Change-Id: I00273622423fa99d41621969f6ecbbdaa0e18664
| * Fix lots of tr.h files not being mentioned in CMakeLists.txtEike Ziller2023-04-011-0/+1
| | | | | | | | | | | | | | Change-Id: I63d364ac50d9587339b10a5571870cb9a81c54ee Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: hjk <hjk@qt.io>
* | ProjectExplorer: Move some not-fully-session related bitshjk2023-03-012-7/+8
|/ | | | | | | | | | | | | | | ... out of SessionManager. The idea is to later move SessionManager into the Core plugin, which both is sensible conceptually and also prerequisite to merge the Bookmark plugin into TextEditor plugin. Currently, only the interface is split, as the load/save implemetations are non-mechanical to disentangle. Change-Id: I31631db3094ea192825a2ccaa6add6188662940b Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
* Translations: Change translation context prefix from "::" to "QtC::"Alessandro Portale2023-02-101-1/+1
| | | | | | | lupdate would be confused by translation contexts starting with :: Change-Id: Ie95e73436fd3cafc80a8e89f908efadc747e644c Reviewed-by: hjk <hjk@qt.io>
* Translations: Replace QCoreApplication::translate() with Tr::tr()Alessandro Portale2023-02-101-1/+2
| | | | | | | | | Calling <Module>::Tr::tr() is preferred over QCoreApplication::translate("::<Module>", "..."). This changes occurrences in .cpp files. Change-Id: I3311ef0dbf3e7d105a3f181b6b988f3b444468f1 Reviewed-by: hjk <hjk@qt.io>
* Qbs: Update some qbs filesChristian Stenger2023-02-081-0/+1
| | | | | | | | List respective tr files and while at it shuffle some of the listed files to match common sort order. Change-Id: I73845ad1dae5e8c86d3741067f40b7b2b37e2a6e Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Translations: Fix stray QApplication::translate() callsAlessandro Portale2023-02-081-1/+1
| | | | | | | | | For references to the module-own context, use Tr::tr(). For references to other modules, use the right context name (with "::" prefix). Change-Id: I6dce8f1ceccb23c44d93f1826402cd3be8e98e5a Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* Use simpler Plugin::initialize() when feasiblehjk2023-01-202-7/+2
| | | | | Change-Id: I567965d266f20526bda9f823e31a04b354d53fb1 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* TextEditor: Tr::trhjk2023-01-181-1/+3
| | | | | | Change-Id: I28aa68e25c53c3a4d1c370074d7b3318944dc45a Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
* Prefix Tr::tr contexts with ::hjk2023-01-131-1/+1
| | | | | | | To make outliers better visible in Linguist Change-Id: Ic35ea2a858b7e3576d9a416fb494fddb616eaaa1 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* Editor: Allow to hide annotations for a group of text marksDavid Schulz2023-01-121-5/+8
| | | | | | | | | The hiding is not persistent, so on the next Qt Creator start all annotations are visible again. This is meant to quickly get rid of annotations if there are to many irrelevant of a specific kind. Change-Id: I4862e56e0f5624f30aadda26efc9dea672ab1f57 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* CppEditor: Use FilePath for ProjectPath::m_sourceFileshjk2023-01-112-8/+7
| | | | | | | ... and update using code. Change-Id: I682727a4b2982dba388e7cc7b9488225748d591f Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Utils: Rename QtcProcess::readAllStandard* to readAllRawStandard*hjk2023-01-101-1/+1
| | | | | | | | | | | | ... and re-use the old QtcProcess::readAllStandard* names for a QString-returning 'decoded' version. For now, only use that in 'full Utf8' cases, to stay bug-compatible, the plan is, however, to employ the QTextCodecs we have already in the channel buffers. That will be one-by-one, though. Change-Id: Id209e0671920d4ea4197918e872f441254112d52 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
* CppCheck: Tr::tr and code cosmeticshjk2023-01-1024-203/+155
| | | | | Change-Id: I5e6583984f7dc94e998df3c20840f2ba2e801ab8 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
* Remove GPL-3.0+ from license identifiersKai Köhne2023-01-0625-25/+25
| | | | | | | | | | | | | | | 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>
* CMake build: Use version-less Qt targetsEike Ziller2023-01-051-1/+1
| | | | | | | | | Since we do not support Qt < 5.15 anymore, and as a first step for getting rid of our special FindQt5.cmake. Change-Id: Icc5dbaf9b0a3a622b1f609ff114b9decb6d2856c Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Cristian Adam <cristian.adam@qt.io>
* Cppcheck: Do not start non-existing toolChristian Stenger2022-10-271-1/+1
| | | | | | | | Just pollutes the General Messages pane, so skip execution if tool is not existing. Change-Id: Ib78e3a8ccd992ff2d58f183102c778c800156b89 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Fix lupdate issuesEike Ziller2022-10-141-1/+2
| | | | | | | | | | - missing Q_DECLARE_TR_FUNCTIONS - some full qualifications needed for confused lupdate - avoid breaking some translations from former TaskListPlugin, VcsCommand and highlighter settings refactoring Change-Id: Ia3b34095512a7bad6903f0aff6095313ee39e3e4 Reviewed-by: hjk <hjk@qt.io>
* Port from qAsConst() to std::as_const()Marc Mutz2022-10-071-1/+1
| | | | | | | | | | | | | | 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>
* Various: Use qtcEnvironmentVariable* instead of qEnvironmentVariable*Eike Ziller2022-08-301-1/+2
| | | | | | | | | | | | And instead of qgetenv. Takes Qt Creator's setting at "Environment > System > Environment" into account, which makes it easier on some platforms to set them (e.g. macOS), can be configured differently in different settings paths, and potentially can be changed at runtime (depending on usage). Change-Id: I724eecc040e33e249a88243f27e8a9e72e54f24b Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Use SPDX license identifiersLucie Gérard2022-08-2625-600/+50
| | | | | | | | | 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>
* Merge remote-tracking branch 'origin/8.0'hjk2022-08-051-12/+13
|\ | | | | | | Change-Id: Icbb87ac8bcee5fb86042d3863a973573510651b4
| * TextMark: Delay context menu tooltip action creationhjk2022-08-041-12/+13
| | | | | | | | | | Change-Id: I25bad9a774a6d95162251c8f0512eb3f8439d9ae Reviewed-by: David Schulz <david.schulz@qt.io>
* | filesystem: Add QFSEngine for filepathsMarcus Tillmanns2022-07-211-3/+2
| | | | | | | | | | Change-Id: Ibd0c88c69863c0877138d8cc45541530c359bd9c Reviewed-by: hjk <hjk@qt.io>
* | Use setClipboardAndSelection more broadlyhjk2022-07-151-3/+2
| | | | | | | | | | | | | | | | Basically everywhere besides the EmacsKeys plugin. Change-Id: Iaf2a0a5d791b5b3dd6df2c05c1b862516630d3f8 Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
* | Utils: More porting.h related changeshjk2022-07-141-1/+0
| | | | | | | | | | Change-Id: I528a6950dfa6e09eb7f7ada265c8c41dba816bfd Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* | Utils: Collapse most of porting,hhjk2022-07-132-2/+2
| | | | | | | | | | | | | | | | | | Taking the Qt 6 branches, leaving some dummies until downstream adapted. Change-Id: Ib9b86568d73c341c8f740ba497c3cbfab830d8a1 Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* | Add plugintr.h files to all pluginshjk2022-06-271-0/+37
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Except FakeVim, which had it before. for i in [a-eg-z]*/*.json ; do upper=${i##*/} upper=${upper/.json/} lower=${i%/*} trfile=$lower/${lower}tr.h cat << EOT > $lower/${lower}tr.h /**************************************************************************** ** ** Copyright (C) 2022 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 3 as published by the Free Software ** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT ** included in the packaging of this file. Please review the following ** information to ensure the GNU General Public License requirements will ** be met: https://www.gnu.org/licenses/gpl-3.0.html. ** ****************************************************************************/ namespace $upper { struct Tr { Q_DECLARE_TR_FUNCTIONS($upper) }; } // namespace $upper EOT git add $trfile perl -pi -e "s/(${lower}_global.h)/\1\n ${lower}tr.h/" $lower/CMakeLists.txt perl -pi -e "s/(\"${lower}_global.h\",)/\1 \"${lower}tr.h\",/" $lower/$lower.qbs done Change-Id: I15ebbaaa9443c57b391b9e143f592d8a0c9208a9 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* Fix lupdate issuesEike Ziller2022-06-271-1/+1
| | | | | | | Change-Id: I7256c8aff5eb77b264b76ba24e79c26ab2924e84 Reviewed-by: hjk <hjk@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Code cosmeticshjk2022-06-241-3/+4
| | | | | | | | | | Mostly unused #include's, also sort them or reduce scope. A few namespaces, ... Change-Id: I9ee71e07de7157c9942125672addf87dd41e78f1 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: hjk <hjk@qt.io>
* CppcheckRunner: Connect to done() signal instead of finished()Jarek Kobus2022-06-212-48/+29
| | | | | | | | Simplify internals a bit. Change-Id: I4871b73f605af4d56e4993b6d71bbb22b4fce27d Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: hjk <hjk@qt.io>
* Remove or replace a few unnecessary #includeshjk2022-05-201-1/+1
| | | | | | Change-Id: I0545533baab57a4383fda5fd680603fdc6459a01 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Cppcheck: Escape error message format stringSergey Morozov2022-05-021-1/+1
| | | | | | | | | Some shells try to expand {} otherwise. Fixes: QTCREATORBUG-27284 Change-Id: Ifd2bd7bc58f005339eebd150b98ced59395d24bc Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* CppCheck: Add copy to clipboard action to tooltipAndre Hartmann2022-02-221-0/+16
| | | | | | | Fixes: QTCREATORBUG-27092 Change-Id: Ie5b504b0b23c54fd72d56df8ff72971864475ee8 Reviewed-by: David Schulz <david.schulz@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Rename QtSupport::BaseQtVersion to QtVersionhjk2022-01-241-1/+1
| | | | | | | | | | ... 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>
* Remove qmake build filesEike Ziller2022-01-202-38/+0
| | | | | | | | | | Removes qmake as a build system for building Qt Creator itself. Keep them for some tests that are not completely moved to CMake yet. Change-Id: I846c6ef65626b6dfae6375fdc85d00677aa8c2fb Reviewed-by: hjk <hjk@qt.io> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* Use QtcProcess in CppcheckRunnerJarek Kobus2021-11-051-2/+3
| | | | | Change-Id: I0b5f9956a20673acb44903b2e35564a8862810ae Reviewed-by: hjk <hjk@qt.io>
* Fix qHash-related size compatibility warnings by MSVCOrgad Shaneh2021-10-202-2/+3
| | | | | | Change-Id: I3b7981ce78b67db4b996f99682284a0b911d8cd7 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* CppCheck: Use more FilePathhjk2021-10-054-18/+17
| | | | | Change-Id: I45da67df4b76032303b57f567d73ae01bf9f2e91 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* Make some headers self-containedChristian Kandeler2021-09-201-5/+3
| | | | | | | This fixes the build in certain configurations, e.g. MSVC + qbs + Qt 6. Change-Id: Ia72dfd6dcfe1d1ecc08c40a3af6e60a935dc355f Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* Merge CppTools into CppEditorChristian Kandeler2021-09-017-20/+20
| | | | | | | | | | | | | | | | 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>
* CppTools: Use only const pointers for ProjectInfo and ProjectPartChristian Kandeler2021-08-273-7/+7
| | | | | | | | All members were already const, but this makes it clear at all points of use that these data structures are immutable. Change-Id: Iea615c090bde462c445d15223caccc561b0c713d Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
* Merge remote-tracking branch 'origin/5.0'Eike Ziller2021-08-261-1/+2
|\ | | | | | | | | | | | | | | Conflicts: qbs/modules/qtc/qtc.qbs src/plugins/android/androidconfigurations.cpp Change-Id: If8dc2cdf131811e08ca147c6f58dbb3ed3bf7227
| * CppTools: Code model fix for C++20, MSVC, and newer CMake versionsCristian Adam2021-08-201-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | Starting with version 3.20 CMake adds -std:c++20, which breaks the code model when using MSVC. Clang-cl 12 doesn't know about -std:c++20, but clang driver knows about -std=c++20. Fixes: QTCREATORBUG-26146 Change-Id: I696842e11b0a9ba8849455d2f81f8dde6dd95a27 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>