aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/cppcheck
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* | CppTools: Turn some classes into pure value typesChristian Kandeler2021-08-132-5/+9
|/ | | | | | | | | | | | | ProjectInfo, ProjectPart and ProjectUpdateInfo used to carry pointers to Project and/or Toolchain, even though they were used in contexts where these pointers were either unsafe to access or not guaranteed to be valid anymore, which made their use difficult and error-prone. We turn these classes into pure value types by copying in all relevant information before the first async operation takes place. Fixes: QTCREATORBUG-25678 Change-Id: I1914b0dbda6c7dfba6c95e5e92f2d69977755590 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
* Utils: Drop QProcess specific parameters from QtcProcess::finished()hjk2021-06-142-2/+2
| | | | | | | | | | | Mid-term plan is to concentrate on use of QtcProcess::result() instead which is a bit more system-agnostic. There's quite a bit of potential for downstream cleanup by re-using QtcProcess::exitMessage() now. Change-Id: I3806b3f5933d96e64b7cfb18cc6c52823fddcbcd Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* Core: filepathify FileIconProviderDavid Schulz2021-06-091-1/+1
| | | | | Change-Id: Id6fcc05317f3f5144c662fb4826438407f8d9d21 Reviewed-by: hjk <hjk@qt.io>
* Debugger: filepathify DiagnosticLocationDavid Schulz2021-06-092-3/+3
| | | | | Change-Id: Ibbbf137231b313ec10e3d57c0230217b0c1e0a6c Reviewed-by: hjk <hjk@qt.io>
* CppCheck: Use line-based output callbackChristian Stenger2021-06-041-36/+7
| | | | | Change-Id: I1b2341f71908a00f820b47109fcc4fda2134a83b Reviewed-by: hjk <hjk@qt.io>
* CppCheck: Fix getting output from QtcProcessChristian Stenger2021-06-031-16/+16
| | | | | Change-Id: Ic11d1f31afe7412ec606bdbd751deb4088d5cd3f Reviewed-by: hjk <hjk@qt.io>
* Utils: Move QProcess base to QtcProcessPrivatehjk2021-06-021-6/+5
| | | | | Change-Id: I4c6811d42e051fadfcf32edb664ff3bc09e692e6 Reviewed-by: David Schulz <david.schulz@qt.io>
* TextEditor: Let TextMark subclasses provide a settings pageChristian Kandeler2021-01-201-0/+1
| | | | | | Task-number: QTCREATORBUG-25150 Change-Id: Id5bbdcf2db7afacb823140d77ebd5bc141ac7f81 Reviewed-by: David Schulz <david.schulz@qt.io>
* Use new, more evocative MessageManager APIEike Ziller2020-12-162-5/+5
| | | | | | | At various places where semantics doesn't change. Change-Id: Ib4d4a5c9f067e109126c6de88257f9e198a71447 Reviewed-by: hjk <hjk@qt.io>
* Fix build with newest Qt 6Eike Ziller2020-11-201-1/+1
| | | | | | | | | No implicit casts from QString to QFileInfo anymore, and a few more QChar(int) fixes. Task-number: QTCREATORBUG-24098 Change-Id: I3326fc0701a9259c7bdd2d8c3025de0a4774f8aa Reviewed-by: hjk <hjk@qt.io>
* Remove unneeded includesJarek Kobus2020-11-121-1/+1
| | | | | Change-Id: I67fee9303509b7080e123a2a5826e200ce498ce2 Reviewed-by: hjk <hjk@qt.io>
* Utils: Fix matching wildcards to full pathsChristian Stenger2020-10-191-1/+2
| | | | | | Fixes: QTCREATORBUG-24792 Change-Id: I82b4edea6260b07e1bdff065b157a4cd044ec629 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* Utils/ProjectExplorer: Move re-usabled bits of aspects to Utilshjk2020-09-231-2/+2
| | | | | | | | | | | Classes involved are BaseAspect and some derived classes, LayoutBuilder and VariableChooser. This is mostly mechanical, with various include/using changes to make it compile. Change-Id: I624a457f3555f102e541c4c71e33a9423af32250 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* Various Qt6 portinghjk2020-07-161-1/+1
| | | | | | | | | | | | | | Rename QHashSeedType to QHashValueType and use it also for return values. Use qHashMulti directly instead of continuing using temporary QPairs. Avoids ugly namespace tricks to find the new pair overloads, and is actually clearer. Classes used in signals cannot be forward-declared. ... Change-Id: I22450a0c642437a43f876e8e89cc8788fff3db61 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* CppCheck: Replace QRegExp by QRegularExpressionChristian Stenger2020-07-132-3/+5
| | | | | | Task-number: QTCREATORBUG-24098 Change-Id: I7b9198f3762f5fa753b5be0e1c0a81abc7f94560 Reviewed-by: hjk <hjk@qt.io>
* Core/Utils: Migrate further to Utils::Idhjk2020-07-064-5/+5
| | | | | | | The coreplugin/id.h header is kept for downstream for now. Change-Id: I8c44590f7b988b3770ecdc177c40783e12353e66 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Merge remote-tracking branch 'origin/4.12'Eike Ziller2020-05-041-1/+1
|\ | | | | | | Change-Id: Ib95ec2c50c4bbaefd4ed0ec5af191ccc846c824f
| * CppCheck: Split QProcess::start command line manuallyhjk2020-05-041-1/+1
| | | | | | | | | | | | | | Qt6 removed the convenience function taking the whole command line. Change-Id: I0b77eb15c6cd9cff25028dec4baf4a4a70eba83c Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* | Utils: Replace FileChooser::path() by filePath().toString()hjk2020-04-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | Keep the old method for now to ease downstream porting. The change is kept mechanical, there's a lot of cleanup possible now on the user code side. Change-Id: I936baedd45b7ba057f1c789a1bec896886f48eff Reviewed-by: André Hartmann <aha_1980@gmx.de> Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* | Merge remote-tracking branch 'origin/4.12'Eike Ziller2020-03-191-5/+4
|\| | | | | | | | | | | | | Conflicts: src/plugins/qmldesigner/components/curveeditor/detail/graphicsview.cpp Change-Id: I2a0ccb84560174c5170d5baaff526c0e095f0ba0
| * Fix lupdate issuesEike Ziller2020-03-181-5/+4
| | | | | | | | | | Change-Id: I26f08ae82354c178f6d26f9138796328b50bfba8 Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
* | Merge remote-tracking branch 'origin/4.12'Eike Ziller2020-03-161-1/+1
|\| | | | | | | | | | | | | Conflicts: src/plugins/baremetal/debugservers/uvsc/uvtargetdevicemodel.cpp Change-Id: I4a90920e52dbbe9eb46aef3437ee3c5a6e7b31c6
| * CppCheck: Fix UI text according to the guidelinesLeena Miettinen2020-03-121-1/+1
| | | | | | | | | | | | | | | | | | https://doc.qt.io/qtcreator-extending/qtcreator-ui-text.html Task-number: QTCREATORBUG-23683 Change-Id: I7ad156fd5dca688a05bff3fc394ca67356378eb1 Reviewed-by: Sergey Morozov <dev@gres.biz> Reviewed-by: hjk <hjk@qt.io>
* | Merge remote-tracking branch 'origin/4.12'Eike Ziller2020-02-271-1/+1
|\| | | | | | | Change-Id: I4523ea36332772a310fd462df55683c93c61bb18
| * ProjectExplorer: Disentangle ProjectExplorer::updateRunActionshjk2020-02-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This enforces a linear pass through [static] ProjectExplorerPlugin::updateRunActions ProjectExplorerPluginPrivate::doUpdateRunAction [emit] ProjectExplorerPluginPrivate::runActionsUpdated instead of the previous direct emission of the signal from user code and connecting also the internal update to it. This is meant to simplify reasoning about execution order and maybe to help elimimating double executation. Change-Id: Id8cc41a46d9dec06afb5514855f2ae80560f3695 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* | ProjectExplorer: Introduce ToolChainKitAspect::{c,cxx}ToolChainhjk2020-02-191-1/+1
|/ | | | | | | | | Special accessors to the repeatedly used C and C++ cases to denoise and slim down user code. Plus some code cosmetics nearby. Change-Id: Iba4662bd4731d8c4256e658529f39d5c995691ce Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Provide an empty default IPlugin::extensionsInitialized()hjk2020-02-071-1/+0
| | | | | | | And remove all empy re-implementations. Change-Id: I19f0b4e55c042c96693ecb89766f97f0a97b54ae Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* Core: Introduce a IOptionsPage::setCategoryIconPathhjk2020-01-161-1/+1
| | | | | | | Less noise on the user side. Change-Id: I34dea09e8a3c8639f5a7db89b22f8b825b946395 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* Utils: Rename FilePathList to simply FilePathshjk2019-12-1810-34/+34
| | | | | | | The exact storage type does not really matter here. Change-Id: Iefec40f0f5909c8e7ba3415db4a11962694e1b38 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* Fix cmake buildOrgad Shaneh2019-12-051-1/+1
| | | | | | | This amends commit 0aa95576c282b59fa05a23d1f40da0d270547ae7. Change-Id: I956743690d4f42e8631d1f274d4a390642daf6d1 Reviewed-by: Cristian Adam <cristian.adam@qt.io>
* CppCheck: Fix compile for namespaced QtChristian Stenger2019-12-051-0/+2
| | | | | Change-Id: I676799ff449cffb129df10f8a8ef29a8af012ced Reviewed-by: David Schulz <david.schulz@qt.io>
* Cppcheck: Add ability to manually run cppcheckSergey Morozov2019-12-0420-131/+941
| | | | | | | | | Run cppcheck on selected files from current project via "Analyze"->"Cppcheck...." Show results in a separate view in the same manner as ClangTools plugin. Fixes: QTCREATORBUG-21673 Change-Id: Ibcaf4057a387a990f1da59025f15ba58f996953f Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
* Cppcheck: remove unused forward declarationLaurent Montel2019-10-182-5/+0
| | | | | Change-Id: I99f8afd16f98b9d7b2719aa95dfe07d0c5cd0054 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* CppTools: Move QtVersion and BuildTargetTypeEike Ziller2019-09-101-2/+1
| | | | | | | | | | | | | QtVersion to utils/cpplanguage_details.h which already contains similar flags. BuildTargetType to ProjectExplorer, next to BuildTargetInfo (but not in the same header to not pull that in everywhere). Removes dependency on ProjectPart from RawProjectPart. Change-Id: I5791065e4266f20c2657ee4b1b594df04b238a1c Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
* Avoid warning on empty expressionshjk2019-07-231-2/+2
| | | | | | | | For some reason, Q_UNUSED includes already a semicolon, adding one on the user side creates an additional empty statement. Change-Id: I9c5e8fac381345a60792cb75e2938fd53958d3b0 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* Utils: Encourage marking of raw command line parametershjk2019-06-061-1/+1
| | | | | Change-Id: Id66ac07732c66ab8c1232fe1f58042de8a61abb0 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Utils: Extract a CommandLine structure from a QtcProcesshjk2019-05-291-1/+3
| | | | | | | | | | | | We regularly pass around strings or filenames or pairs of strings or filenames and stringlist etc the in the end will be used as a kind of "command line", with quite a bit of ad-hoc user code and QtcProcess::addArg etc to set them up and manipulate them. Let's have a class for that concept. Change-Id: I288ab939d853b32c717135a65242c584c2beab50 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Utils: Rename FileName to FilePathhjk2019-05-289-46/+46
| | | | | | | | More in line with QFileInfo terminonlogy which appears to be best-of-breed within Qt. Change-Id: I1d051ff1c8363ebd4ee56376451df45216c4c9ab Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Qt Creator CMake portCristian Adam2019-05-171-0/+14
| | | | | | | | | | | | | | Based on Tobias Hunger's work from a few months ago. The CMake configuration needs libclang and Qt paths specified as CMAKE_PREFIX_PATH. Auto tests are run with "ctest". At the moment the pass rate is 87%. Change-Id: Iba98e39bf22077d52706dce6c85986be67a6eab0 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> Reviewed-by: Tobias Hunger <tobias.hunger@qt.io> Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* Utils: RemoveFileName::{size,count,length}hjk2019-05-101-1/+1
| | | | | | | Use .toString().{size,count,length} instead. Change-Id: Ib697155f441a8297fb179921bcd3397719a44073 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* Fix Utils::LanguageVersion::None handlingMarco Bubke2019-04-041-0/+2
| | | | | Change-Id: Id0d8bd59c1a317103ea309ee2f9b982ecfd6d6c7 Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
* Fix some deprecation warnings in basic pluginsFriedemann Kleint2019-02-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Fix warnings apppearing in 5.13, for example: warning: ‘QDir& QDir::operator=(const QString&)’ is deprecated: Use QDir::setPath() instead [-Wdeprecated-declarations] ... warning: ‘static QRgb QColorDialog::getRgba(QRgb, bool*, QWidget*)’ is deprecated: Use getColor() [-Wdeprecated-declarations] warning: ‘Qt::DropAction QDrag::start(Qt::DropActions)’ is deprecated: Use QDrag::exec() instead [-Wdeprecated-declarations] warning: ‘void QProcess::finished(int)’ is deprecated: Use QProcess::finished(int, QProcess::ExitStatus) instead [-Wdeprecated-declarations] ... warning: ‘const QRect QDesktopWidget::availableGeometry(int) const’ is deprecated: Use QGuiApplication::screens() [-Wdeprecated-declarations] ... warning: ‘const QBrush& QPalette::background() const’ is deprecated: Use QPalette::window() instead [-Wdeprecated-declarations] ... warning: ‘const QBrush& QPalette::foreground() const’ is deprecated: Use QPalette::windowText() instead [-Wdeprecated-declarations] ... warning: ‘void QTextOption::setTabStop(qreal)’ is deprecated [-Wdeprecated-declarations] warning: ‘void QList<T>::swap(int, int) [with T = ProjectExplorer::BuildStep*]’ is deprecated: Use QList<T>::swapItemsAt() [-Wdeprecated-declarations] warning: ‘void QProcess::setReadChannelMode(QProcess::ProcessChannelMode)’ is deprecated: Use QProcess::setProcessChannelMode() instead [-Wdeprecated-declarations] ... warning: ‘QString QFileInfo::readLink() const’ is deprecated: Use QFileInfo::symLinkTarget() instead [-Wdeprecated-declarations] Change-Id: I1d893d42d372245892f2de8406f52dbe7bbd552a Reviewed-by: Eike Ziller <eike.ziller@qt.io>