aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/cppcheck
Commit message (Collapse)AuthorAgeFilesLines
* Use QString::size() instead QString::length()hjk2025-11-131-1/+1
| | | | | | | Minor gain in debug builds and when stepping. Change-Id: I2540d309661e4babfd7331b068c17657ded2a098 Reviewed-by: David Schulz <david.schulz@qt.io>
* CppCheck: Some Filepathificationhjk2025-10-312-8/+8
| | | | | Change-Id: Ib897475bffa14a35e69fe39c17b5340eee1d9b87 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Fix lupdate issuesEike Ziller2025-09-291-1/+1
| | | | | | | | | | Almost all of them result from a namespace bug in lupdate, fixed by avoiding function return types with namespace and avoiding tr() after member variable declarations with namespaced types in class definitions. Task-number: QTBUG-140636 Change-Id: I406fba710d005cd455588185b971567bbe1b8f57 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* Avoid including multiple Tr classesEike Ziller2025-09-261-3/+2
| | | | | | | | | | | | | | | | | | | | lupdate has issues finding the right translation context if there are both Tr::tr calls that should be resolved via a `namespace <name> {` scope, and another `using namespace <other>` with a namespace that has another Tr class. Many of the cases of this that we have were editor display names that were defined in the Core plugin for reasons unknown, and which would better be defined in the corresponding plugin anyway. For the other cases do not use Tr::tr from a different plugin, but instead introduce "msg<Something>" functions that do the Tr call plugin- internally. That is the "correct" way to do it anyway, since shared strings should be changeable centrally. Task-number: QTBUG-140548 Change-Id: Idacf62b400f50789b5e5957b690e16aa1ebe5a56 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* CPlusPlus: Support explicit object parametersChristian Kandeler2025-08-271-1/+1
| | | | | Change-Id: I9324ee2dbf34fc15ea4573a7c13359611b313f10 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* PE: Make some cleanup in SelectableFilesModelJarek Kobus2025-08-211-1/+2
| | | | | Change-Id: Id9940a9bd834ec8777fcf4956641f4e0c181466a Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* CppCheck: Replace a potentially bad use of FilePath::toUrlishString()hjk2025-08-051-2/+1
| | | | | Change-Id: Ie7c62e956215a1ad4284b087beafdd3d480a3221 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* ProjectExplorer: Use FilePath as storage in HeaderPathshjk2025-07-211-1/+1
| | | | | | | | | This does not try to adjust callers beyond pure compilation needs. Most of the path.path.path() sequences will be shorter again once callers are switched to FilePath, too. Change-Id: I7c2abfd63021e0ddcec3e49b8be291037cd56216 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Utils: Make FilePaths a full class instead of a QList<FilePaths> aliashjk2025-07-113-3/+3
| | | | | | | | | | | | | Creates a natural place for named constructor and conversion functions. Api: Created Utils::FilePaths as full class instead of a QList<Utils::FilePaths> alias Api: Utils::FilePath::fromStrings -> Utils::FilePaths::fromStrings Api: Utils::FilePath::fromSettingsList -> Utils::FilePaths::fromSettings Api: Utils::toFilePathList -> Utils::FilePaths::fromStrings Change-Id: I1786519206dd1fb68f410d54ce77a0846dc1f9de Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* Merge remote-tracking branch 'origin/17.0'Eike Ziller2025-06-171-1/+1
|\ | | | | | | | | | | | | | | Conflicts: cmake/QtCreatorIDEBranding.cmake qbs/modules/qtc/qtc.qbs Change-Id: Iac555437405e993475736232b3cf2402cf9fe8ed
| * CppCheck: Fix truncating tooltip at '<' characterAndre Hartmann2025-06-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The following program: ``` static int array[3] = {1, 2, 3}; int test(int index) { return (index <= 3) ? array[index] : 0; } ``` gave the following CppCheck line annotation: ``` main.c:5: Either the condition 'index<=3' is redundant or the array 'array[3]' is accessed at index 3, which is out of bounds. ``` but in the tooltip it was truncated to: ``` main.c:5: Either the condition 'index ``` Change-Id: If9baf949e97e3e26efecf33246d15ecd3ebbd4b2 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* | Debugger: Fix column offset for Links that replaced DiagnosticsLocationDavid Schulz2025-06-171-3/+1
|/ | | | | | | | | | | Amends a40e803503e4186823e2ca4585c8a4555e89d9c2 The DiagnosticsLocation used 1 based column offset, but the column offset in Link is 0. This removes the need to substract 1 from column before passing the Link to openEditorAt. Change-Id: I81905eff4881320e197d55f5b1a27aa7a3b74864 Reviewed-by: hjk <hjk@qt.io>
* CppEditor: Change QVector to QListhjk2025-04-092-2/+2
| | | | | | | ... and drop a now needless QList::fromList(list). Change-Id: I69cef538312097cc0e56f48444aa3a51d59b3412 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Replace usage of Utils::FlowLayout with Layouting::FlowEike Ziller2025-04-041-1/+0
| | | | | | | | | | LayoutBuilder has a copy of FlowLayout that got fixes. It is not useful to have duplicate flow layouts, so just remove the one from Utils and replace the single usage with Layouting::Flow. Change-Id: I7899d964e139511677d4cabf718a4ace48da944a Reviewed-by: hjk <hjk@qt.io> Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
* Debugger: Replace DiagnosticsLocation with Utils::Linkhjk2025-02-212-14/+11
| | | | | Change-Id: I41166d4f54468e0953fd3231af9fd52560b7c74c Reviewed-by: David Schulz <david.schulz@qt.io>
* ProjectExplorer: Add convenience accessors to some classesChristian Kandeler2025-01-231-3/+3
| | | | | | | | | | | | Namely, Kit, BuildConfiguration, BuildSystem and RunConfiguration get functions to retrieve the active instance for a given project as well as the one for the current and active projects, respectively. This saves a ton of annoying null pointer checks. Some of these functions replace existing ones with the same purpose that were scattered around the code base. Change-Id: I18247061229bbeb8b8ad1e15a2bd7a6626438bc0 Reviewed-by: hjk <hjk@qt.io>
* Utils: Rename FilePath::toString() into toUrlishString()hjk2025-01-103-5/+5
| | | | | | | | | | | | | | | | toString() is almost always the wrong conversion, but unfortunately too easy to find and often even working at least for local setup. This here raises the bar as the non-availability of the "obvious" toString() hopefully helps people to think about the semantics of the needed conversion and choose the right toXXX() function. The chosen new name is intentional ugly to reduce the likelihood that this (still almost always wrong) function is used out of convenience. Change-Id: I57f1618dd95ef2629d7d978688d130275e096c0f Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* Debugger: Merge analyzerconstants.h into debuggerconstants.hhjk2024-12-201-1/+1
| | | | | Change-Id: Id092c8d0bedad987e963b36b0e9b46e7182209a2 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
* ProjectExplorer: Dissolve kitaspects.{h,cpp}Christian Kandeler2024-11-201-1/+1
| | | | | | | Move the remaining classes into their own files. Change-Id: I301e72004c21446fa9b8f15942bb042218b0ecef Reviewed-by: hjk <hjk@qt.io>
* Plugins: Improve display names of pluginsAlessandro Portale2024-11-191-0/+1
| | | | | | | | | | | This introduces a field "DisplayName" to PluginSpec and the plugin spec json files. If present in the spec, PluginSpec::displayName returns it, or otherways falls back to more established fields. Fixes: QTCREATORBUG-31761 Change-Id: I4f4c4f3e33b17dfb2ec63644b1f50b3b9c6c024a Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* Core: Provide settings categories centrallyChristian Kandeler2024-11-151-6/+0
| | | | | | | | | It was conceptually wrong that an options page was supposed to set its category's display name and icon. Instead, categories are now explicitly registered with name and icon. Change-Id: Ic10b3791c8068176f55470e6845ab4832160b8e7 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* Unify copyright string and remove yearEike Ziller2024-09-261-1/+1
| | | | | | | | | | | The year is not needed and requires us to update it manually each year. So just remove it. Centralize it in the branding file to avoid changes to be done at lots of places (About dialog, plugin specs, app info plist & rc, docs, ...) in the future. Task-number: QTCREATORBUG-30432 Change-Id: Ia421924c19a1331b121e765bcea137920025598d Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
* ExtensionSystem: Add PluginId and VendorIdMarcus Tillmanns2024-09-021-0/+2
| | | | | Change-Id: I4f47f95e1f4ff4af73c2b81320087b4592007993 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
* Plugins: Add URLs to manual page to plugin metadataAlessandro Portale2024-07-291-0/+1
| | | | | | Fixes: QTCREATORBUG-31199 Change-Id: Ideadc75499f32a8f1d1c95cd38dc4669a3d422c3 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* Cppcheck: Treat manual run settings as project settingsChristian Stenger2024-07-023-11/+62
| | | | | | | | | Instead of always deriving from global settings store the settings for the manual run into the project settings. Fixes: QTCREATORBUG-31092 Change-Id: I7854cff4e71b58225c7e9c1198c4e60128ed07e4 Reviewed-by: hjk <hjk@qt.io>
* Plugin meta data: Add full stop to descriptionsEike Ziller2024-06-281-1/+1
| | | | | | | | | Where they were missing. The text is shown as a paragraph in the extension manager. Change-Id: I6e15c89fe4023b222e9c476f4312e13fcb0905c0 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
* Cppcheck: Fix handling of settingsChristian Stenger2024-06-145-28/+31
| | | | | | | | | | We need to distinguish between the global settings and the settings used for a manual analyzer run. Fixes: QTCREATORBUG-28951 Fixes: QTCREATORBUG-30615 Change-Id: Ic2dabd14e4d06d77bebcedd9e653f54a4d179c82 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
* Cppcheck: Fix handling of default executableChristian Stenger2024-06-031-1/+1
| | | | | | | | | | | | On Unix we set the default just to cppcheck and mark it even as valid if it can be found in PATH. But when running we silently fail as we expect a full path before launching the executable. Use the effective binary instead. Change-Id: I03393b1d227c595da5142fce6b8bea5210a15747 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* Add long descriptions to some pluginsLeena Miettinen2024-05-311-1/+5
| | | | | | | | | | | | Edited the short descriptions to answer the question "What can I do with this extension" to help users decide whether they need it. In long descriptions, tell users what else they need to be able to use the plugin. Change-Id: Iefce7505b61fc77cf38cc915f1f7dbd25c9cb570 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* Cppcheck: Fix commandline usageChristian Stenger2024-05-311-1/+1
| | | | | | | | | | The parameter added as first additional parameter is not a file path, but a string holding additional arguments. Amends 26cfa86969bf7ebde80e16d530800d1c30fb343b. Task-number: QTCREATORBUG-28586 Change-Id: I6808e491f59f7eda8a63c5c990a7cc9c084135b9 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
* PluginSpecs: Change URLs from http:// to https://Alessandro Portale2024-05-281-1/+1
| | | | | | | | | | Avoid the redirect that is inevitable nowerdays. Also, change necessitas.kde.org to www.qt.io, since the orgininal page is offline. Change-Id: Ib1823f0df97d2df87822fd2bb7552e2f2c7e971e Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
* Cppcheck: Quote file pathsChristian Stenger2024-05-281-5/+6
| | | | | | | | This patch fixes the most common issues with path quoting. Fixes: QTCREATORBUG-28586 Change-Id: Ia5f400d062a2459f49288fcd4bc316ced2b269e6 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
* Cppcheck: Finish progress bar on failChristian Stenger2024-05-283-1/+10
| | | | | | Fixes: QTCREATORBUG-27961 Change-Id: If1bbd5b14ec77e8bde1617c692388a2868e3ce0f Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
* Use LayoutBuilder V2hjk2024-05-272-2/+2
| | | | | | | | | | | | This puts the implementation introduced in acf1ecb47fdf into use, after significant simplifications in the class hierarchy. CRTP is not used anymore, and the new tag based dispatch is also used for Layout::addItem, effectively reducing the number of different code paths. The Lua based settings access is disabled for now. Change-Id: Idb6d1a25675378757c5267bdb630bcd4c1f52d34 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
* CommandLine: Reuse new c'torJarek Kobus2024-05-221-1/+1
| | | | | | Change-Id: Id154881b4f5d8c488e5c1f5e0f843d36bf838759 Reviewed-by: Orgad Shaneh <orgads@gmail.com> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
* Utils: Fix build with MSVC with C++20Eike Ziller2024-02-281-1/+1
| | | | | | | | | | | | | | | | | Rename process.h back to qtcprocess.h MSVC's "threads" standard header includes <process.h>, and that ends up including our process.h from Utils. There already was a hacky workaround in place for a similar issue with MINGW, but that doesn't work with MSVC because that doesn't have Simply use a name that doesn't conflict. Change-Id: I1159cd2096b4f2dbc4a1728d0131dd6edd30ebd3 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>
* CppCheck: Use ActionBuilderhjk2024-02-011-14/+9
| | | | | | Change-Id: I385427232891826641760f463da26de3777387b6 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* Use more std::chrono and std::chrono_literals namespacesJarek Kobus2024-01-231-1/+2
| | | | | Change-Id: Ib8c83988d7afe35d81b87ff8c5c87eef2082f12d Reviewed-by: hjk <hjk@qt.io>
* Process: Change signature of waitForXxx() functionsJarek Kobus2024-01-231-1/+1
| | | | | | | | | Change the arg to QDeadlineTimer type. Change-Id: Id3dee0717e44130c16baf7925e5b06346a1a1ad1 Reviewed-by: hjk <hjk@qt.io> Reviewed-by: Orgad Shaneh <orgads@gmail.com> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Process: Use more rawStd{Out,Err} const methods instead of mutable onesJarek Kobus2024-01-211-1/+1
| | | | | | | | | Avoid using readAllStandard{Output,Error} mutable methods if possible. Use non-mutable methods when we are not connected to readyReadStandard{Output,Error} signals. Change-Id: I2e830e571b9eab2177fd856bbe06dfc5137d9c01 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* CppCheck: Hide plugin class definition in .cpphjk2024-01-124-59/+35
| | | | | Change-Id: I960ec6e0e4d63cf0edf7af55d191ba666f44739b Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
* ProjectExplorer: Some more ToolChain->Toolchain renamingshjk2023-12-121-1/+1
| | | | | Change-Id: I5cb2adf544a846f45f7fe7ce60f67b10ad100d91 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* ProjectExplorer: Rename Tool{C,c}hainKitAspecthjk2023-11-271-1/+1
| | | | | | Change-Id: I74460b6402ab00f972c208023f03fac617982a11 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
* Utils: Cache theme icon accesshjk2023-09-011-1/+1
| | | | | | | | These trigger over 120k file exist check on my machine on startup, just for a handful icons. Change-Id: Ic73f0783142ed329c2f8c8b852f622e69fc306da Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
* Utils: Make FilePathAspect::setDefaultValue take a QStringhjk2023-08-171-2/+2
| | | | | | | | | | This sets the unexpanded value, so going to a "cooked" FilePath can at least theoretically break. On the user side it saves a roundtrip in a few cases, but is more ugly when the input is already a proper FilePath. Change-Id: I8a7e8f6d46fcc34c96b55e41d656dca933fbef4e Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
* ProjectExplorer: Rename kitinformation.{h,cpp} to kitaspects.{h,cpp}hjk2023-08-151-1/+1
| | | | | Change-Id: I069bddeb457366210d339edcbb8ffb359a40fab8 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
* Various Plugins: Add context object into connectionsJarek Kobus2023-08-021-1/+1
| | | | | | Change-Id: I360677bebfef16a3233b3b8177cff6da57ec7c31 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Build: Change plugin json.in files to CMake styleEike Ziller2023-07-251-17/+17
| | | | | | | | | | | | | They were still using variables in qmake style. Directly use CMake variables in the json.in files and remove the no longer needed escaping of quotes. Adds a fatal message if it detects the old style in a .json.in file for easier porting. Change-Id: I8de88d8db2da55781f0e9d72eda03f943723188e Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Cristian Adam <cristian.adam@qt.io>
* CppCheck: Move widget creation for manual run closer to its usehjk2023-07-193-6/+6
| | | | | Change-Id: I08d50f5e4534b8a58d374ae37bfd03dbd234a483 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* CppCheck: Rename options to settingshjk2023-07-187-7/+7
| | | | | | | That's the by far more common name nowadays. Change-Id: Iae987221f9fa2e955fdee21496f895d25d44be4e Reviewed-by: Christian Stenger <christian.stenger@qt.io>