aboutsummaryrefslogtreecommitdiffstats
path: root/src/libs/utils/changeset.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Utils: Speed up ChangeSet::apply()Christian Kandeler2025-05-191-13/+25
| | | | | | | | | | | | | | | | The previous algorithm traversed the remaining list of operations on every application of an operation, incurring quadratic effort. This was done because the positions of the other operations potentially need updating if they are located after the current one in the file. We solve this by sorting the list by position and applying the operations starting at the back, with some extra logic for operations with the same position. The cost is now linear for real-world cases. Example benchmark: Applying ~5000 operations (from clang-tidy) to a file used to take four seconds and now takes one second. Task-number: QTCREATORBUG-25394 Change-Id: Ie386ddbc12696b67406b37e67f52072d9c1bf6a0 Reviewed-by: David Schulz <david.schulz@qt.io>
* Utils: Add factory functions for ChangeSetChristian Kandeler2024-05-271-0/+35
| | | | | | | | This greatly simplifies code that produces change sets with a single EditOp. Change-Id: If042bb91e5132b7141d88404cfbd3ba12632b52d Reviewed-by: David Schulz <david.schulz@qt.io>
* Utils: Add formatting information to ChangeSet::EditOpChristian Kandeler2023-12-131-40/+79
| | | | | | | | | | | ... and make use of that in TextEditor::RefactoringFile. This allows calling code to have fine-grained control over which parts of a refactoring should get re-formatted, while also providing sensible default values that are "almost always" right, so things typically work as expected out of the box. Change-Id: I9200c2135b7477c33bc5a61c5d410b34853e4b61 Reviewed-by: David Schulz <david.schulz@qt.io>
* Utils: add convenience function to ChangeSetDavid Schulz2023-07-041-0/+6
| | | | | | | | Creating a QTextCursor just for the ChangeSet gives no benefit for the calling code, but reduces the readability. Change-Id: I34acb6083b6f7ab54fce042e29cd6e80498338ef Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* CppEditor: Format code inserted by quickfixesChristian Kandeler2023-06-281-4/+2
| | | | | | | | Task-number: QTCREATORBUG-10807 Task-number: QTCREATORBUG-19158 Change-Id: Ieac52e1a1a10afad91fea56290e7dcfd1d302e7f Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> Reviewed-by: David Schulz <david.schulz@qt.io>
* Remove GPL-3.0+ from license identifiersKai Köhne2023-01-061-1/+1
| | | | | | | | | | | | | | | 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>
* 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>
* Aggregation/Utils/ExtensionSystem: Make member functions const/staticAlessandro Portale2020-11-271-1/+1
| | | | | | | | | | | | | | | | | | readability-make-member-function-const finds lots of member functions that could be made const. This change just picks getter functions that really should be const. readability-convert-member-functions-to-static finds non-static member functions which do not access this. This change turns most of them into static ones, but leaves some non static to keep the class API consistent. readability-static-accessed-through-instance fixes the places where the originally non-static, now static functions were called through instance. Change-Id: I8cf16c01f7988a7c9d073b5f8ede6a9706b94fb0 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* Compile fix with recent Qt devhjk2019-07-291-7/+3
| | | | | | | | | The reasoning in 1b4766e26c6b did not take into account that the scope of QT_NO_JAVA_STYLE_ITERATORS may change over time, as done with f70905448f6 in Qt base. Change-Id: Ib1966ff26c4d36d5f62e149d6b45baa4aecf825d Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* Utils: ModernizeAlessandro Portale2018-07-201-4/+4
| | | | | | | | | | | | modernize-use-auto modernize-use-nullptr modernize-use-override modernize-use-using modernize-use-default-member-init modernize-use-equals-default Change-Id: I8d44d9405011a1878353baf9325f7af90b89db02 Reviewed-by: hjk <hjk@qt.io>
* Utils: Clean up ChangeSetNikolai Kosjar2018-05-241-23/+20
| | | | | | | | | * Stick to coding rules * Fix a variable name, probably a left-over. * Simplify removing first items. Change-Id: Ibfcc5ab4d6fd4cd21e6ab24c6964da4ad4478e8e Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
* Convert some 0 to nullptrMontel Laurent2017-02-231-2/+2
| | | | | Change-Id: Ib3ca8e2cc0d63fd35582c73b3cf7c915fb64ddfb Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* 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>
* Update LicenseEike Ziller2015-01-161-6/+6
| | | | | Change-Id: I711d5fb475ef814a1dc9d2822740e827f3f67125 Reviewed-by: Alessandro Portale <alessandro.portale@digia.com>
* License updateEike Ziller2014-10-091-7/+8
| | | | | Change-Id: I3c22ef2685d7aa589f5d0ab74d693653a4c32082 Reviewed-by: Alessandro Portale <alessandro.portale@digia.com>
* Incremented year in copyright infoRobert Loehning2014-01-081-1/+1
| | | | | | Change-Id: Ib5423fdd064e4546f848c0b640b0ed0514c26d3a Reviewed-by: Leena Miettinen <riitta-leena.miettinen@digia.com> Reviewed-by: Kai Koehne <kai.koehne@digia.com>
* Merge remote-tracking branch 'origin/2.6'Oswald Buddenhagen2013-01-311-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/plugins/autotoolsprojectmanager/AutotoolsProjectManager.pluginspec.in src/plugins/debugger/qtmessageloghandler.cpp src/plugins/debugger/qtmessagelogwindow.cpp src/plugins/madde/maemodeployconfigurationwidget.cpp src/plugins/qmldesigner/components/integration/designdocumentcontroller.cpp src/plugins/qmldesigner/designercore/include/widgetqueryview.h src/plugins/qmldesigner/designercore/metainfo/metainfoparser.cpp src/plugins/qmldesigner/designercore/model/modelnodecontextmenu.cpp src/plugins/qmldesigner/designercore/model/modelnodecontextmenu.h src/plugins/qmlprojectmanager/qmlprojectapplicationwizard.cpp src/plugins/qnx/bardescriptormagicmatcher.h src/plugins/qt4projectmanager/profilekeywords.cpp src/plugins/remotelinux/deployablefilesperprofile.cpp src/plugins/remotelinux/deployablefilesperprofile.h src/plugins/remotelinux/deploymentinfo.cpp src/plugins/remotelinux/deploymentsettingsassistant.cpp src/plugins/remotelinux/profilesupdatedialog.cpp tests/auto/icheckbuild/ichecklib.cpp tests/auto/icheckbuild/parsemanager.cpp tests/auto/icheckbuild/parsemanager.h Change-Id: Ie465a578446a089e1c502d1cb1096e84ca058104
| * Incremented year in copyright infov2.6.2Robert Loehning2013-01-291-1/+1
| | | | | | | | | | Change-Id: Ic6a9ff0359625021ebc061d22db6811814534205 Reviewed-by: Kai Koehne <kai.koehne@digia.com>
* | CppEditor: quick fix to generate getters and settersErik Verbruggen2013-01-241-0/+2
|/ | | | | | | | | | This does not take namespaces on the implementation side into account and does not properly position/indent things. Task-number: QTCREATORBUG-1890 Change-Id: I779d12fefc79521bce38361729d4f66dada71147 Reviewed-by: hjk <hjk121@nokiamail.com> Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
* Adjust license headershjk2012-10-051-21/+20
| | | | | Change-Id: Ice592c6de9951ee3b2c4cb52ed0bb3b6770e0825 Reviewed-by: Eike Ziller <eike.ziller@digia.com>
* Contact -> qt-project.orgEike Ziller2012-07-191-3/+1
| | | | | Change-Id: I7134d7de30bcf9f9dcfad42520dd45ee083a852d Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
* Removed module names from #include directives.Erik Verbruggen2012-02-151-1/+1
| | | | | | | | Getting the #include directives ready for Qt5. This includes the new-project wizards. Change-Id: Ia9261f1e8faec06b9285b694d2b7e9a095978d2b Reviewed-by: Eike Ziller <eike.ziller@nokia.com>
* Long live the king!hjk2012-01-261-1/+1
| | | | | Change-Id: I2b72b34c0cfeafc8bdbaf49b83ff723544f2b6e2 Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
* all: s/info@qt.nokia.com/qt-info@nokia.com/hjk2011-11-031-2/+2
| | | | | Change-Id: If18afb5d4665924e7d9250dccbc60a65e6daa75e Reviewed-by: Eike Ziller <eike.ziller@nokia.com>
* C++: Synchronize function decl/def refactoring.Christian Kamm2011-08-161-0/+5
| | | | | | | | | | | When editing a function declaration or definition the code model may realize the same changes have to be applied somewhere else. A refactoring marker will pop up that can be clicked to perform the changes. Alternatively, press enter to apply. Change-Id: I2299a2ecfb6a8f87d4853fc7cfa99486f890a1d3 Reviewed-on: http://codereview.qt.nokia.com/2909 Reviewed-by: Leandro T. C. Melo <leandro.melo@nokia.com>
* Fix/add copyright headersTobias Hunger2011-05-061-1/+1
| | | | Change-Id: I8b73d583be1ee7183f4074bce49d5390e38631a2
* Update license.hjk2011-04-131-14/+13
|
* License header fix.Christian Kamm2011-02-181-16/+8
|
* Exported header cleanup.Friedemann Kleint2011-01-201-0/+2
|
* It's 2011 now.con2011-01-121-1/+1
| | | | Reviewed-by: hjk
* CleanupRoberto Raggi2010-06-221-0/+30
|
* Generalized the changeset operations.Roberto Raggi2010-06-221-15/+15
|
* Long live the king!hjk2010-03-051-1/+1
|
* Make flip in ChangeSet move two different-length strings around.Christian Kamm2009-11-261-27/+29
| | | | | Instead of just flipping same-length strings. Also fix an incorrect replace position adjustment.
* Improve ChangeSet to support more rewriting operations.Christian Kamm2009-11-261-119/+235
|
* Initialize the members.Roberto Raggi2009-11-241-21/+37
|
* Added gettersRoberto Raggi2009-11-241-18/+28
|
* Renamed TextWriter to ChangeSetRoberto Raggi2009-11-241-0/+215