aboutsummaryrefslogtreecommitdiffstats
path: root/src/libs/cplusplus/CppDocument.cpp
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>
* Fix leaks in CPlusPlus autotestsChristian Kandeler2025-08-181-1/+1
| | | | | Change-Id: I4da9e96fea421f8aa4b6c6d1ffba8eb63930d4a7 Reviewed-by: hjk <hjk@qt.io>
* CPlusPlus: Drop a few simple accessor functionshjk2025-06-241-4/+4
| | | | | | | | | | ... in favor of direct access to const data members. No difference in release, no measurable difference in debug, but takes mental cycles to wonder whether there could be a difference. Change-Id: I0f99ba324110e64c5ce620659ad7286b045d2280 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* CPlusPlus: Paddle back a bit for fast pre-processingChristian Stenger2025-04-301-1/+2
| | | | | | | | There are code paths that expect unexpanded function-like macros. Amends b419f638ecdec1e39f94c632065d73eddf3399dc. Change-Id: I28e8dedbf30c2a06bb29f61cfa0f69fc68012b03 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* CplusPlus: Code cosmeticshjk2025-04-091-1/+1
| | | | | | | QVector->QList, #includes, ... Change-Id: If6052294f20f759ed600e29d6eec5598fdcb10fd Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* fix:ParseTranlationUnit is misspelledTian Shilin2025-02-281-3/+3
| | | | | | | Spelling mistakes this can lead to confusion. Change-Id: I25845911e4cbd670ea3b5e02dd4ae27542a67ff2 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* CppEditor: Add support for refactoring classes with conceptsMasoud Jami2024-11-121-0/+1
| | | | | | | | | | | | Add support for concepts that are used in class declartions by differentiating between "typename" template parameters and concepts. With this new patch it's possible to move (refactor) a member of a class that uses concepts to a cpp file, while respecting the concept definition. Fixes: QTCREATORBUG-31214 Change-Id: Id3e6f978e688c58c7291926823d5bddaaa587f60 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* CppEditor: Consider #pragma once when inserting includesChristian Kandeler2024-06-131-0/+9
| | | | | | Fixes: QTCREATORBUG-30808 Change-Id: Ib9f2ed1e428abfaa608b9dc42bc09dd2d403ee56 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* Merge remote-tracking branch 'origin/12.0'Eike Ziller2024-01-301-1/+1
|\ | | | | | | | | | | | | | | Conflicts: src/plugins/cppeditor/cppfilesettingspage.cpp src/plugins/haskell/haskellplugin.h Change-Id: I880693c2e4986853b7aa600a5b7d6c09ad14634e
| * CPlusPlus: deal with QByteArray::(c)begin() return nullptrThiago Macieira2024-01-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | You should either use begin() and end(), or data() and size(), and either way you shouldn't dereference the first iterator if the size is zero. Roberto's parser in 3rdparty/cplusplus assumes you've passed at least one character (I'm guessing the null terminator) and does pointer manipulation there: void Lexer::setSource(const char *firstChar, const char *lastChar) { _firstChar = firstChar; _lastChar = lastChar; _currentChar = _firstChar - 1; _currentCharUtf16 = ~0; _tokenStart = _currentChar; _yychar = '\n'; } Note the _firstChar - 1 math is technically UB if firstChar is the actual first character of any buffer allocation or string. Fixes: QTCREATORBUG-30044 Change-Id: I76ffba14ece04f24b43efffd17abcb8102497813 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* | CppEditor: Also rename function comments for declarationsChristian Kandeler2023-11-291-1/+7
|/ | | | | | | | | ... that are not definitions. Amends 0a058bb65717cddb3e01a44f3241c029253a1eea. Change-Id: I4ba19f915d653d05570f8cd244ea50ab40d4b9dd Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: David Schulz <david.schulz@qt.io>
* Fix occurrences of the contains/insert anti-patternChristian Kandeler2023-06-231-3/+1
| | | | | | | | | Introduce and make use of Utils::insert() for QSet with a return value that indicates whether insertion actually happened. Change-Id: I655e4bc3553b74fea5ae8956205e4d8070118d63 Reviewed-by: hjk <hjk@qt.io> Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* CPlusPlus: Don't double uniquifyMarcus Tillmanns2023-05-101-3/+4
| | | | | | | | | | | CppDocument::includedFiles removes duplicates. Snapshot::allIncludesForDocument also removes duplicates. Once is enough. This doubles test scan performance on my machine. Change-Id: I892908cf0820cfa11854ac3d82e9175d1fc38043 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Remove unused includes of QFutureInterfaceJarek Kobus2023-05-041-1/+0
| | | | | | Change-Id: I70f5e842801b628c7f9ad4d433334ce04d4e648e Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* CppElementEvaluator: Use QtConcurrent invocation for async runJarek Kobus2023-03-131-8/+2
| | | | | | | Change-Id: Idc67ecd4e9e95c5893a04ca1a9ee7b30662ec664 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
* Replace GPL-3.0 with GPL-3.0-onlyKai Köhne2023-01-101-1/+1
| | | | | | | | | | | | | GPL-3.0 is deprecated by SPDX. Change done by find . -type f -exec perl -pi -e 's/LicenseRef-Qt-Commercial OR GPL-3.0(?!-)/LicenseRef-Qt-Commercial OR GPL-3.0-only/g' {} \; Change-Id: If316a498e3f27d2030b86d4e7743b3237ce09939 Reviewed-by: Lucie Gerard <lucie.gerard@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* CPlusPlus: Use FilePath for resolved include pathshjk2022-11-301-7/+7
| | | | | | | | ... and fix fallout. Change-Id: I66886e91ff476eff15db51cc024a8021e952d44d Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* CPlusPlus: Code cosmeticshjk2022-11-291-10/+8
| | | | | | | | Rename a few 'fileName' into 'filePath'. Remove unneeded includes. Change-Id: I850e06cb4f58ec8dc70aa389f2521be8f5247b5c Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* CPlusPlus: Return FilePaths from Document::includedFilehjk2022-11-251-16/+18
| | | | | | | | ... and fix fallout. Change-Id: Ieaad57700fa48d0c4a0dd9bf2c284315579b9473 Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* CppEditor: Proliferate FilePath usehjk2022-11-241-12/+13
| | | | | | | | | | | 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>
* CPlusPlus: Proliferate FilePath usehjk2022-11-221-6/+6
| | | | | | | | | | | | | | | | | | | 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>
* CppEditor: Adapt include locations when renaming ui filesChristian Kandeler2022-10-241-3/+19
| | | | | | | Fixes: QTCREATORBUG-14259 Change-Id: I5e8209338b531f0e65d85b423053bd19a8b47652 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* Port from qAsConst() to std::as_const()Marc Mutz2022-10-071-4/+4
| | | | | | | | | | | | | | 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>
* CPlusPlus: Limit the usage of qMakePairJarek Kobus2022-10-041-1/+1
| | | | | | Change-Id: Ica59c320fb700369e968bb03a93deff34eb7ffb7 Reviewed-by: hjk <hjk@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
* Use SPDX license identifiersLucie Gérard2022-08-261-24/+2
| | | | | | | | | 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>
* CPlusPlus: Microoptimizationshjk2022-08-101-48/+0
| | | | | | | | Inline some simple accessors, return references instead of copies in some getters, Change-Id: I136574823c79ad0c63ed354b78e1ad83908e7ae5 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* CPlusPlus: Inline some simple central functionshjk2022-06-241-2/+2
| | | | | | | | | | | | | Depending on context, callgrind sees contributions of >8% to the total cost of project parsing for these functions. The functional are actualy executed executed out-of-line, often for a function body of one "payload" instruction only. Inlining removes the call/endbr64/ret overhead. Change-Id: I6886f08e322fcaa4e0f54d424279e0a8c24e4718 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* CppEditor: Fix looking up containing function for search resultChristian Kandeler2022-06-131-81/+9
| | | | | | | | | | | | | - Move look-up to CplusPlus::FindUsages, where we are guaranteed that we actually have the document source. - Use the same straightforward algorithm as with clangd. - Undo the changes to CppDocument::functionAt(), which broke the autotest. Amends 6f7e7980d2b604c79507f9165098f783db8ab2e3. Change-Id: I008d05ba41a3b63b71e3131d7021e0d4e7d0641f Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* Display parent functions in the Find Usages menuIhor Ivlev2022-05-251-9/+81
| | | | | | | | | | | | | | | | To display the parent function, first we find it in displayResults and store the information to SearchResultItem, then SearchResultTreeItemDelegate gets the information and renders it. Similar approach is applied to ClangdClient, in addSearchResultsForFile. This change also adds default style for containing function highlight in the search. Default foreground and background colors are same as usual text colors. Task-number: QTCREATORBUG-27550 Change-Id: Id1251afa192f8d1232524742b7c211770bcb83fb Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* CPlusPlus: Remove foreach / Q_FOREACH usageArtem Sokolovskii2022-05-201-8/+10
| | | | | | | | Task-number: QTCREATORBUG-27464 Change-Id: Idbcedd9f9a2e148cb18e53c9dc0b82b52b372d64 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: hjk <hjk@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Make canceling of Type Hierarchy evaluation more responsiveJarek Kobus2020-12-071-4/+11
| | | | | | | | | | | | | | | | | | On the beginning of the process of evaluating type hierarchy the evaluating thread may freeze on a first call to Snapshot::updateDependencyTable() for quite a long time (e.g. when showing the type hierarchy for IPlugin class inside Creator project - it may freeze up to about 3 seconds). So, when we want to cancel the evaluation (e.g. when we switch from "Type Hierarchy" into another view or when closing Creator) we may freeze for this period. In order to fix it we pass a future interface as an additional argument for Snapshot::updateDependencyTable() and cancel the update when cancellation of task was requested. Change-Id: I2147f10a68989587476c30369ec2ac552a57d5ae Reviewed-by: hjk <hjk@qt.io> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Add missing "final" to unexported/unshared classesAlessandro Portale2020-11-181-1/+1
| | | | | Change-Id: I84d5fc39d7ef5588a20545854d0cfd0b993db090 Reviewed-by: hjk <hjk@qt.io>
* C++: Print numeric template arguments in NamePrettyPrinterVolodymyr Zibarov2020-06-031-2/+0
| | | | | | | | | | | | | | | | | | | | | Improve type printed for template specializations with numeric or bool values. Code example: template<bool B, class T> struct enable_if{}; template<class T> struct enable_if<true, T>{ typedef T type; }; In outline: "enable_if<_Tp1, T> <T>" becomes "enable_if<true, T> <T>" TemplateArgument class holds pointer to numeric literal owned by CppDocument, so remove Control::squeeze() to not release numericLiterals in CppDocument::releaseSourceAndAST() This based on TemplateArgument class introduced in commit 9ee693ee229d28bd618e8dd44bc6b12750d43a29 Change-Id: Ib787a5e402c3e8d8467b520347a26afa6087d4bd Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Change recursive to loop in allIncludesForDocumentIgor Sidorov2020-02-051-13/+18
| | | | | Change-Id: I110294efa506b5a038cfc7f4202fab001e3eefd3 Reviewed-by: David Schulz <david.schulz@qt.io>
* Utils: Rename FilePathList to simply FilePathshjk2019-12-181-1/+1
| | | | | | | The exact storage type does not really matter here. Change-Id: Iefec40f0f5909c8e7ba3415db4a11962694e1b38 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* Some clang-tidy -use-modernize-nullptrhjk2019-08-011-10/+10
| | | | | Change-Id: I1bed5e85a5b7948d08502a72a10f80baa075c204 Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
* Standardize on int for line and column valueshjk2019-07-261-35/+29
| | | | | | | | | | | | | | | Recently tons of warnings show up for presumably "problematic" singned <-> unsigned and size conversions. The Qt side uses 'int', and that's the biggest 'integration surface' for us, so instead of establishing some internal boundary between signed and unsigned areas, push that boundary out of creator core code, and use 'int' everywhere. Because it reduces friction further, also do it in libcplusplus. Change-Id: I84f3b79852c8029713e7ea6f133ffb9ef7030a70 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
* CPlusPlus: Avoid a few deprecation warningshjk2019-06-051-2/+1
| | | | | | | The alternatives have been around since 2012. Change-Id: I0aa15d59efe8a547e2ad622ffda689746960d48c Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
* Utils: Rename FileName to FilePathhjk2019-05-281-7/+7
| | | | | | | | 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>
* Prefer using 'override' instead of 'virtual'Alessandro Portale2018-07-111-27/+27
| | | | | | | | warning: prefer using 'override' or (rarely) 'final' instead of 'virtual' [modernize-use-override] Change-Id: I6dac7a62b627fa1353b4455e1af92f869c2571cc Reviewed-by: Marco Benelli <marco.benelli@qt.io>
* C++: Fix use-after-free crash when handling auto expressionsNikolai Kosjar2017-01-091-3/+25
| | | | | | | | | | | | | The Control of the Document "exprDoc" in ResolveExpression::visit( SimpleNameAST*ast) owns names that are passed on further as part of the LookupItems. However, the life time of that Document and thus the Control ends in that function. Fix by using the appropriate Control object. Task-number: QTCREATORBUG-16731 Change-Id: I5a7af0a67613fff79f7e07865801585c13bb9b45 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* CppEditor: Generate doxygen comments for functions with macrosNikolai Kosjar2016-03-041-2/+22
| | | | | | | | | ...at least for object-like macros. This handles the common case where a macro before the function signature annotates the DLL import/export. Task-number: QTCREATORBUG-15819 Change-Id: I79f22508188019402fb7345222408aaf90106f20 Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
* Update License according to agreement with Free Qt FoundationTobias Hunger2016-01-191-17/+12
| | | | | | | * Update remaining files in src Change-Id: I1896f17fcf34f71c3310c87899fb5171b8e4afb1 Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
* CppTools: Fix highlighting and follow for template using argumentOrgad Shaneh2015-06-091-1/+1
| | | | | | | | | | Use-case: template<class T> using Foo = Bar<T>; // T not highlighted Task-number: QTCREATORBUG-9944 Change-Id: I04cb62ea6a21f158f7fb4fb7ac79ccd6eb1bbfbb Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
* C++: Remove redundant assignmentOrgad Shaneh2015-05-051-1/+0
| | | | | | | TranslationUnit assigns itself to the control in its ctor. Change-Id: I08cf70c32f557648709e29b03c2f939d294fdc6d Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
* C++: Use correct features for document parsingOrgad Shaneh2015-02-201-8/+16
| | | | | | Task-number: QTCREATORBUG-8007 Change-Id: Ic96aaa433442812a99bac9d16bb9124d66762e8c Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
* Merge commit '3c85058694ee2e41658d17f524fb48f0b187d2fe'Eike Ziller2015-02-121-6/+6
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/libs/utils/tooltip/tipcontents.cpp src/libs/utils/tooltip/tipcontents.h src/plugins/android/androiddeployqtstep.cpp src/plugins/baremetal/baremetalconstants.h src/plugins/baremetal/baremetaldevice.cpp src/plugins/baremetal/baremetaldevice.h src/plugins/baremetal/baremetaldeviceconfigurationwidget.cpp src/plugins/baremetal/baremetaldeviceconfigurationwidget.h src/plugins/baremetal/baremetaldeviceconfigurationwizard.cpp src/plugins/baremetal/baremetaldeviceconfigurationwizardpages.cpp src/plugins/baremetal/baremetaldeviceconfigurationwizardpages.h src/plugins/baremetal/baremetalplugin.cpp src/plugins/baremetal/baremetalplugin.h src/plugins/baremetal/baremetalruncontrolfactory.cpp src/plugins/baremetal/baremetalruncontrolfactory.h src/plugins/cppeditor/cppcodemodelinspectordialog.cpp src/plugins/cppeditor/cppdoxygen_test.cpp src/plugins/cppeditor/cppdoxygen_test.h src/plugins/debugger/breakpointmarker.cpp src/plugins/debugger/debuggeritemmodel.cpp src/plugins/debugger/debuggeritemmodel.h src/plugins/debugger/loadcoredialog.cpp src/plugins/genericprojectmanager/cppmodelmanagerhelper.cpp src/plugins/projectexplorer/addnewmodel.cpp src/plugins/projectexplorer/addnewmodel.h src/plugins/projectexplorer/jsonwizard/jsonfieldpage.cpp src/plugins/qmlprofiler/abstracttimelinemodel.cpp src/plugins/qmlprofiler/abstracttimelinemodel.h src/plugins/qmlprofiler/notesmodel.cpp src/plugins/qmlprofiler/qml/CategoryLabel.qml src/plugins/qmlprofiler/qml/MainView.qml src/plugins/qmlprofiler/qml/Overview.js src/plugins/qmlprofiler/qml/Overview.qml src/plugins/qmlprofiler/qml/TimeDisplay.qml src/plugins/qmlprofiler/qml/TimeMarks.qml src/plugins/qmlprofiler/qmlprofilertimelinemodelproxy.cpp src/plugins/qmlprofiler/sortedtimelinemodel.cpp src/plugins/qmlprofiler/sortedtimelinemodel.h src/plugins/qmlprofiler/timelinemodelaggregator.cpp src/plugins/qmlprofiler/timelinemodelaggregator.h src/plugins/qmlprofiler/timelinerenderer.cpp src/plugins/qmlprofiler/timelinerenderer.h src/plugins/qmlprojectmanager/QmlProjectManager.json.in src/plugins/texteditor/findinfiles.cpp src/plugins/vcsbase/vcsconfigurationpage.cpp src/shared/qbs src/shared/scriptwrapper/interface_wrap_helpers.h src/shared/scriptwrapper/wrap_helpers.h tests/auto/qmlprofiler/abstracttimelinemodel/tst_abstracttimelinemodel.cpp tests/system/suite_debugger/tst_debug_empty_main/test.py tests/system/suite_debugger/tst_qml_js_console/test.py tests/system/suite_debugger/tst_qml_locals/test.py Change-Id: I67540b648f8b162496f4aa606b04d50c7c9125c6
| * Update LicenseEike Ziller2015-01-161-6/+6
| | | | | | | | | | Change-Id: I711d5fb475ef814a1dc9d2822740e827f3f67125 Reviewed-by: Alessandro Portale <alessandro.portale@digia.com>
* | C++: Remove workaround for crashing if parsing invalid codeNikolai Kosjar2015-02-121-7/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts the changes commit beac7b9539457fe721de1709b9a406cac2379851 C++: Fix highlighting after "invalid code" commit 78ab287fc6d3770646012e461b0a518db4e9c9f4 C++: Stop parsing a declaration after two tries which were a work around for QTCREATORBUG-12890. A follow-up patch provides a proper fix. Task-number: QTCREATORBUG-12890 Change-Id: I2650a8e41c8ff1180cad9f069e463fc51bd2f1b1 Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
* | C++: Remove unneeded qualificationsOrgad Shaneh2015-02-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Mostly done using the following ruby script: Dir.glob('**/*.cpp').each { |file| next if file =~ %r{src/shared/qbs|/qmljs/} s = File.read(file) s.scan(/^using namespace (.*);$/) { ns = $1 t = s.gsub(/^(.*)\b#{ns}::((?!Const)[A-Z])/) { |m| before = $1 char = $2 if before =~ /"|\/\/|\\|using|SIGNAL|SLOT|Q_/ m else before + char end } if t != s puts file File.open(file, 'w').write(t) end } } Change-Id: I6fbe13ddc1485efe95c3156097bf41d90c0febac Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>