aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/diffeditor/diffutils.h
Commit message (Collapse)AuthorAgeFilesLines
* DiffEditor: Eliminate some FilePath::toUrlishString()hjk2025-05-091-1/+2
| | | | | Change-Id: Ie7f71700b137ca8f63917ee1bda403266087861d Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
* DiffEditor: Use QtConcurrent invocation for async tasksJarek Kobus2023-03-091-4/+4
| | | | | Change-Id: I06640837ffee830e60e8dd2a566f9388f8444010 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* DiffUtils: Get rid of PatchFormattingFlagsJarek Kobus2023-02-051-7/+1
| | | | | | | | | | | | | Get rid of PatchFormattingFlags argument inside DiffUtils::makePatch(), as there is the only caller of this method. Internally, behave like the GitFormat flag was passed. As all callers to sideFileName() were always passing AddLevel (GitFormat flag contained AddLevel), the flag is not needed anymore. Change-Id: I1993cfd7212f5f60a5bdb2c9e1e4317c3ecd91d7 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* 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>
* Utils: Move DiffUtils::interpolate into MathUtilsJarek Kobus2022-11-281-2/+0
| | | | | Change-Id: Iac4a21a6c760d8fbf0dce380b1a9a587a9d3468e Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* DiffFileInfo: Export it back againJarek Kobus2022-09-301-1/+1
| | | | | | | | | | It should be still exported as it's a part of FileData class, which is also exported. Amends b677fbe9927043e8993d06f2d522f3dbda792e36 Change-Id: I0d53dff2c355cddf7d1f3d001cb7b71210c75223 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* DiffUtils: Introduce DiffChunkInfoJarek Kobus2022-09-291-1/+16
| | | | | | | Avoid code repetition. Change-Id: Iea9acef8f8b27793528fa7eaf7044e12dcd21d10 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* DiffEditorPlugin: Introduce DiffFileInfoArrayJarek Kobus2022-09-291-1/+5
| | | | | Change-Id: I884d72e6c500e41969f379d969bcf1f46be8fd5c Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* SideBySideDiffEditor: Avoid code repetitionJarek Kobus2022-09-291-6/+1
| | | | | Change-Id: Ie49834a4896dbf32a87329345e52dc99ca2f86bd Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* DiffEditor: Cleanup includesJarek Kobus2022-09-291-1/+0
| | | | | Change-Id: Id8127b9b0c99ee2a0d5d367cb551a1d5779c5d38 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* DiffEditorPlugin: Add SideBySideDiffOutputJarek Kobus2022-09-281-0/+2
| | | | | | | | Move generation of SideDiffData into static diffOutput() method. Change-Id: Ie38b3e09dd8222e0219fdfb345bc7cf4a39f6e21 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* DiffEditor: Use DiffSide enum inside FileDataJarek Kobus2022-09-281-2/+1
| | | | | Change-Id: I4c18c52a9737cc46c3faeadf0abd5c4771463e0e Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* DiffEditor: Use DiffSide enum inside ChunkSelectionJarek Kobus2022-09-281-4/+4
| | | | | Change-Id: If23b0f46856eebec96624e58b6ad90b1b3e8be23 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* DiffEditor: Use DiffSide enum inside RowDataJarek Kobus2022-09-281-4/+3
| | | | | Change-Id: I5511e443e2f76a1dab5cc78eec5faec04ee31bcc Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* DiffEditor: Use DiffSide enum inside ChunkDataJarek Kobus2022-09-281-2/+1
| | | | | Change-Id: Ic10fe9faa6b6ccefcbf4c062663dedefa6bf5872 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* DiffEditor: Introduce DiffSide enumJarek Kobus2022-09-281-0/+6
| | | | | | | This should simplify various diff structs. Change-Id: Ia8c77de558a92a2a64fc13c674a46192521970f0 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* 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>
* Vcs: Use FilePath for working directory in DiffEditorControllerhjk2021-08-201-1/+3
| | | | | Change-Id: I7b5e1349bc679bd90b7781fbe0b40485ec653473 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
* DiffEditor: Rely on compiler generated constructorsJarek Kobus2021-02-171-7/+5
| | | | | Change-Id: I16527f2f971fa110ceb0b35755a1f49663ccb460 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
* DiffUtils: Remove unused include and declarationEike Ziller2020-05-291-2/+0
| | | | | Change-Id: I6acfa0d964530f9309594dfd2ae18c06c2235c85 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
* Git/DiffEditor: Fix staging added/removed lines separatelyJarek Kobus2019-12-021-4/+6
| | | | | | | | Fixes: QTCREATORBUG-23243 Change-Id: Ice19e1c778aabd9cb1b9fe0681234073de85cfcb Reviewed-by: hjk <hjk@qt.io> Reviewed-by: André Hartmann <aha_1980@gmx.de> Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* DiffEditor: Stage and unstage selected lines for GitAndre Hartmann2019-11-191-0/+9
| | | | | | | Fixes: QTCREATORBUG-19071 Change-Id: I560ba208e68e477ea865e499847d819cfdfeb6f3 Reviewed-by: Orgad Shaneh <orgads@gmail.com> Reviewed-by: André Hartmann <aha_1980@gmx.de>
* DiffEditor: ModernizeAlessandro Portale2018-11-091-1/+1
| | | | | | | | | modernize-use-auto modernize-use-override modernize-use-equals-default Change-Id: I4e70550ed2962781b62661a405517b5c79126bad Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* Beautifier: Move formatting tools to TextEditorIvan Donchevskii2018-08-301-4/+4
| | | | | | | | | | | | Formatting is moved from Beautifier plugin to formattexteditor.h/.cpp. Diff and Differ classes are extracted from DiffEditor to Utils to prevent extra TextEditor dependencies. This change will make possible to use formatCurrentFile and similar functions not only from Beautifier code. Change-Id: Ic5ca668afe88f4e9376d49e6bd3594807172b0dd Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* DiffEditor: fix various warningsJarek Kobus2018-05-031-5/+5
| | | | | Change-Id: I555aa30c8925ba8eeb314dd836f1544b93d7a66f Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* DiffEditor: ModernizeAndre Hartmann2017-12-091-24/+15
| | | | | | | | | | | * Use member init * Use nullptr * Use range-for * omit QLatin1{String|Char} where possible Change-Id: Ib231b747cdd9073b3d4fc6779b8e0afb2b404a31 Reviewed-by: Orgad Shaneh <orgads@gmail.com> Reviewed-by: André Hartmann <aha_1980@gmx.de>
* DiffEditor: Fix parsing of mode-only change in patchOrgad Shaneh2017-11-271-0/+1
| | | | | | | | | | | | If one of the files has mode-only change, the entire patch fails as a git patch, and is parsed as a text patch. Because of that, the prefixes (a/, b/) are not stripped and jumping to a change by double-clicking does not work. Change-Id: Ib54ce4fa7aad02cb956af1f7de73d3c732ac5a89 Reviewed-by: André Hartmann <aha_1980@gmx.de> Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
* Make it possible to cancel async diff calculationJarek Kobus2017-07-051-1/+6
| | | | | Change-Id: I38fe86159daab794d060860de6ee5ab30fb395eb Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
* DiffEditor: fix revert chunk for diffs of modified filesJarek Kobus2016-10-211-0/+6
| | | | | | | | | Apply chunk action doesn't make sense for that case, will stay disabled. Task-number: QTCREATORBUG-17136 Change-Id: Idce31b3aa9d354536a01607c10b20273158961d5 Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
* Wholesale conversion to #pragma oncehjk2016-03-301-4/+1
| | | | | | | Kudos to cgmb and https://github.com/cgmb/guardonce Change-Id: Ifa8970734b8d43fd08c9260c645bdb0228633791 Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
* Update License according to agreement with Free Qt FoundationTobias Hunger2016-01-191-17/+12
| | | | | | | * Update files in src/plugins Change-Id: Ia5d77fad7d19d4bb3498e78661982f68729adb22 Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
* Clean headers of the DiffEditor plugin.Tobias Hunger2015-03-101-3/+0
| | | | | | Change-Id: I1c49527f010acbece31849127fc4d182678b6f37 Reviewed-by: Jarek Kobus <jaroslaw.kobus@theqtcompany.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
* DiffEditor: Refactor the user-facing partsTobias Hunger2015-03-101-1/+1
| | | | | | | | | | | | | | | | | * Move all data handling into DiffEditorDocument * Move much of the logic of how to update views into the DiffEditor. * Introduce a base class for the different views on the diff to implement. * Remove DiffEditorGuiController * Make DiffEditorController smaller and merge the DiffEditorReloader into the class * Simplify communication between the classes involved * Make much of the implementation private to the plugin Change-Id: I7ccb9df6061923bcb34cf3090d6d8331895e83c7 Reviewed-by: Orgad Shaneh <orgads@gmail.com> Reviewed-by: Jarek Kobus <jaroslaw.kobus@theqtcompany.com>
* Update LicenseEike Ziller2015-01-161-6/+6
| | | | | Change-Id: I711d5fb475ef814a1dc9d2822740e827f3f67125 Reviewed-by: Alessandro Portale <alessandro.portale@digia.com>
* DiffEditor: Save description along with diff.Friedemann Kleint2014-11-131-1/+6
| | | | | | | | | | Save complete, git-applicable patch when saving the result of for example 'git show'. Strips some Creator-specific tags off the description and reformats the description such that it is accepted by git. Change-Id: I739d85a7263f97e2149a2794974ba026f2eca067 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* Hide some diff editor controls when diff editor is bound to a file.jkobus2014-11-051-1/+0
| | | | | | | | | | | Remove unnecessary anymore "ignoreWhitespace" argument from functions which read a patch file. Transfer the ownership of reloader into controller. Task-number: QTCREATORBUG-13250 Change-Id: I68183005b845d6ece9ea2be9888abc8597310426 Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
* License updateEike Ziller2014-10-091-7/+8
| | | | | Change-Id: I3c22ef2685d7aa589f5d0ab74d693653a4c32082 Reviewed-by: Alessandro Portale <alessandro.portale@digia.com>
* Show the chunk context info in unified diffjkobus2014-08-141-0/+1
| | | | | | Task-number: QTCREATORBUG-12394 Change-Id: I827fb894fd373b34cbae19f686b15acb697489c3 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* Handle similarity index in git commitsjkobus2014-07-071-6/+16
| | | | | | Task-number: QTCREATORBUG-12619 Change-Id: I5af39f18bc02ce1f06bf72f155bf0aaabe8b228d Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* Make it possible to save diff editor contentsjkobus2014-07-041-0/+3
| | | | | | | Task-number: QTCREATORBUG-12548 Task-number: QTCREATORBUG-12549 Change-Id: Ia27080cc689da48fc5401010e2277edaf0a01f4d Reviewed-by: Eike Ziller <eike.ziller@digia.com>
* Implement unified diff editorjkobus2014-06-061-24/+54
| | | | | Change-Id: I93e0bfd71a8a650afbe2ca9e0f1f3dbfc9d57db0 Reviewed-by: Jarek Kobus <jaroslaw.kobus@digia.com>
* DiffEditor: refactor internal structures.jkobus2014-03-111-3/+10
| | | | | | | Simplify the implementation a lot. Change-Id: I3f5daa3d2ce14c28d48c2e1e996ec4935d1dae3f Reviewed-by: Jarek Kobus <jaroslaw.kobus@digia.com>
* Move more function into diffutils, fix calculateOriginalData.jkobus2014-03-101-1/+10
| | | | | Change-Id: Id7bbdbf7778d21cb9aa15148876db95e9228fab3 Reviewed-by: Jarek Kobus <jaroslaw.kobus@digia.com>
* Move internal structures and some functions into diffutils.hjkobus2014-02-281-0/+96
Change-Id: Ia55e556fdb8de3a2aeebf768ad9db66d840766f2 Reviewed-by: Jarek Kobus <jaroslaw.kobus@digia.com>