summaryrefslogtreecommitdiff
path: root/src/plugins/vcsbase/vcsbaseeditor.cpp
Commit message (Collapse)AuthorAgeFilesLines
* ProjectExplorer: Move some not-fully-session related bitshjk2023-03-011-2/+2
| | | | | | | | | | | | | | | ... out of SessionManager. The idea is to later move SessionManager into the Core plugin, which both is sensible conceptually and also prerequisite to merge the Bookmark plugin into TextEditor plugin. Currently, only the interface is split, as the load/save implemetations are non-mechanical to disentangle. Change-Id: I31631db3094ea192825a2ccaa6add6188662940b Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
* VcsBase: Proliferate use of FilePathhjk2023-01-201-29/+20
| | | | | | | ... and update user code. Change-Id: I52c08e9e07238536d31fc72f97312ac582a1e32f Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* VcsBase: Convert to Tr::trhjk2023-01-181-10/+11
| | | | | | | | | | To reduce the amount of duplicated strings for translators to handle. The problem is not very prominent in vcsbase, but that's where we are moving everywhere else. Change-Id: Icb11fad3bccfea8a1408420e729566a75adccb66 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> 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>
* VcsBase & dependent: Fix const correctnessJarek Kobus2022-12-141-1/+1
| | | | | | | And some minor cleanups. Change-Id: Id0c2df6865ba84c054f0fb97c0ac42a76a128355 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* DiffEditor/VCS: Save document before applying/reverting patch chunkOrgad Shaneh2022-10-191-1/+8
| | | | | | | Fixes: QTCREATORBUG-22506 Change-Id: I646f24068c0c81890f36052537320a743fdeb498 Reviewed-by: André Hartmann <aha_1980@gmx.de> Reviewed-by: hjk <hjk@qt.io>
* VcsBase: Fix buildChristian Stenger2022-10-181-1/+1
| | | | | | | Amends 46df40a9190. Change-Id: I7afb3086634ecb3e617f203d4715cf9d3538ab0e Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
* VCS: Fix blaming previous revisions for renamed filesOrgad Shaneh2022-10-181-3/+4
| | | | | | | | | | For example, run Git Blame on logchangedialog.cpp, then right-click a hash and choose Blame or Blame Parent. Amends 424fd7c557907c03cb957fadc90cd81f87063f5d. Change-Id: I4cf502f73e18fecde9c9b37d1f7ca8648c07932a Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
* VCS: Resolve symlinks on blameOrgad Shaneh2022-10-141-2/+2
| | | | | | Fixes: QTCREATORBUG-20792 Change-Id: I60ac64957b23b80826c93ba73ff17a265549811f Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
* VCS: Use more FilePath in VcsBaseEditorOrgad Shaneh2022-10-141-38/+28
| | | | | Change-Id: I5b9ec56b5669c81872796511b56f5c5e59e452af Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
* Port from qAsConst() to std::as_const()Marc Mutz2022-10-071-1/+1
| | | | | | | | | | | | | | 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>
* VcsBase: Use FilePath in editorTag()Jarek Kobus2022-10-061-5/+3
| | | | | Change-Id: I4093fa46a51767afd00a8de2f94986c708dc1efa Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* VcsBaseEditor: Get rid of diffChunkApplied()Jarek Kobus2022-09-291-6/+2
| | | | | | | Drop unused arg from diffChunkReverted(). Change-Id: I5531645d317d62ae92cd0e63dadd583f8ab8996d Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* PatchTool: Introduce PatchAction enumJarek Kobus2022-09-291-12/+8
| | | | | | | | | | Add static PatchTool::confirmPatching() and reuse it in two places. Use Tr::tr() inside PatchTool. Change-Id: I70779619dbb58ab6e46a585bbeff51588ccb2f53 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* VcsBaseClient: Fix going to default line numberJarek Kobus2022-09-211-12/+7
| | | | | | | | | | | | | | | | | | | | | Since we are being connected to the same done() signal twice, the order of slot invocations started to play a role. We were connecting done() signal to VcsBaseEditorWidget::reportCommandFinished() first and to VcsBaseEditorWidget::setPlainText() afterwards, so they were executed exactly in this order. However, this order isn't desired, as we need to set text first and jump to line afterwards. In order to fix it so that we don't rely on connection order we handle setting the content and jumping into the default line in one common handler. Amends c767f193ce09135f04a70927b034a212b8d09add Change-Id: Iea17476cc25b54759457710ecb6b6de2f0f5caf7 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* VcsPlugin: Use VcsCommand::done() signal instead of finished()Jarek Kobus2022-09-201-1/+3
| | | | | | | Conform to QtcProcess interface. Use result() when needed. Change-Id: Idd4c71d9a103e8649b08ec7787c2f286423a31ec Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* VcsCommand: Get rid of abort()Jarek Kobus2022-09-021-1/+1
| | | | | | | | Use destructor of VcsCommand instead. Change-Id: Ie914d016c6d3d57a88674ce8534d5edec4bc79c1 Reviewed-by: Orgad Shaneh <orgads@gmail.com> 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>
* VcsCommand: Limit the usage of setCookie()Jarek Kobus2022-08-021-7/+10
| | | | | | | | | Don't use setCookie() for setting the line number to be shown on annotation. Add setDefaultLineNumber() setter to VcsBaseEditorWidget instead. Change-Id: I6c52874d48532132a27b2a7a9d161705170f7ade Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* Move ShellCommand into VcsBase pluginJarek Kobus2022-08-011-4/+4
| | | | | | | | | | Rename it to VcsCommand. Move also ShellCommandPage into VcsBase plugin. Change-Id: I335ac47e3090f2be497643ebcda0eaad2987ac81 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* ShellCommand: Remove exitCode arg from finished() signalJarek Kobus2022-07-291-4/+2
| | | | | | | | | | The only 2 handlers were taking it into account and they interpreted the non-zero exit code as a failure, so basically they repeated the work of default exitCodeInterpreter. Change-Id: I9848ef0cf5ca9017f02a02ae59dc09ec426f7626 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* Drop Qt5: VCS: Get rid of QComboBox QOverloadJarek Kobus2022-07-191-2/+2
| | | | | Change-Id: Ib2f21f28a0ec16b817f9227c6234424001752d50 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* VcsBaseEditorWidget: Get rid of DiffChunkAction structJarek Kobus2022-07-191-31/+14
| | | | | | Change-Id: Ia35a8ef6b836709f7e058cfe33bf902f015e89b9 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* VcsBaseEditorWidget: Avoid using sender()Jarek Kobus2022-07-191-13/+13
| | | | | | Change-Id: Id300535d40b52a2f7d3e69fca77ca75271da8711 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* Use setClipboardAndSelection more broadlyhjk2022-07-151-13/+17
| | | | | | | | Basically everywhere besides the EmacsKeys plugin. Change-Id: Iaf2a0a5d791b5b3dd6df2c05c1b862516630d3f8 Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
* Utils: More porting.h related changeshjk2022-07-141-1/+0
| | | | | Change-Id: I528a6950dfa6e09eb7f7ada265c8c41dba816bfd Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* VcsBase: Cleanup some Utils:: in cpp filesJarek Kobus2022-07-131-2/+2
| | | | | | | | We are using namespace Utils in these files. Change-Id: I0526f7e4fff2fe0d24d1e2b9fa087298d5331955 Reviewed-by: Orgad Shaneh <orgads@gmail.com> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
* VcsBase: Hide VcsCommand classJarek Kobus2022-07-131-5/+6
| | | | | | | | | | | | Make it an implementation detail. Introduce VcsBaseClient::createVcsCommand() method instead for instantiating VcsCommands. Replace all occuriences of VcsBase::VcsCommand in public API with Utils::ShellCommand. Change-Id: Ie438cc3a5e867b3ee8f9e935b56b2f16ea453f8a Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* Utils: Collapse most of porting,hhjk2022-07-131-1/+1
| | | | | | | | | Taking the Qt 6 branches, leaving some dummies until downstream adapted. Change-Id: Ib9b86568d73c341c8f740ba497c3cbfab830d8a1 Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* ShellCommand: Merge VcsCommand::VcsRunFlags into RunFlagsJarek Kobus2022-07-121-1/+1
| | | | | | | Use ShellCommand class name in signal-slot connections. Change-Id: Id50ee6887708558a2ba0972ece6c420b0be36f72 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* VCSbase: Remove foreach / Q_FOREACH usageArtem Sokolovskii2022-05-231-4/+5
| | | | | | | | Task-number: QTCREATORBUG-27464 Change-Id: I1088047513e7660907182e80303607d8c48919f5 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>
* Remove algorithm.h from buildtargetinfo.hJarek Kobus2022-05-181-0/+1
| | | | | | | Change-Id: I777212fb94d46c1c71f017288b7e38dd5db62a91 Reviewed-by: Cristian Adam <cristian.adam@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
* EditorManager: Remove QString openEditor(At) overloadsEike Ziller2021-11-021-1/+1
| | | | | | | | In favor of the FilePath/Link ones. Change-Id: I5caf9e0f8de304ff4ee12329557aa50a6f3a0c69 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: David Schulz <david.schulz@qt.io>
* VCS: use context menu actions of TextEditor in VcsBaseEditorDavid Schulz2021-10-131-2/+4
| | | | | Change-Id: I1947190ad0147d15cd4e95c5dff102b795a78bfc Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* VCS: update the text cursor of VcsBaseEditorWidgetDavid Schulz2021-10-131-10/+11
| | | | | | | | | | TextEditorWidget::slotCursorPositionChanged makes sure that the multi text cursor in the TextEditorWidget reflects all changes of the QPlainTextEdit cursor. Fixes: QTCREATORBUG-26360 Change-Id: I43d612c6f85fedbf45179898e044b516a93a3ed8 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* Core: PatchTool code cosmeticshjk2021-08-171-1/+1
| | | | | | | | | Some more FilePath use, QLatin*, static, ... Also fix default settings values, amends e2eab0e0 insofar. Change-Id: I8e40ca9629351db3b3095636b4ea29a204f86da6 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
* Vcs: Use more FilePath for file pathshjk2021-08-021-20/+25
| | | | | Change-Id: I855cde65d034a9647972a7fddf1e8266d7ccfa88 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* Vcs: Use FilePath in IVersionControl APIhjk2021-07-291-1/+2
| | | | | | | | Adapt first level of users. Change-Id: Ifcd7bff45631ff3b9e26a9e3176daa6cf0cf2e56 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* VCS: Fix build with Qt6Eike Ziller2020-09-211-6/+7
| | | | | | | | | QStringRef is gone. Task-number: QTCREATORBUG-24098 Change-Id: I38dd1602294fcabf5cf7c1553bcfd93f3c47b601 Reviewed-by: hjk <hjk@qt.io> Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* Core: replace QString with Utils::FilePath to get documentsDavid Schulz2020-09-041-1/+2
| | | | | Change-Id: I01777c227398be8bd3bf877c5429b84a75aa361b Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* Git: Fix filling commit selection combobox for logAndre Hartmann2020-05-161-0/+6
| | | | | | | | | | | | | | Broken by commit cbb70513bfa935, which changed the format for the normal log to override the highlighter. We still need the hightlighter for the log with diff. Therefore, a separation between highlighting and parsing the log is needed to populate the combobox for commit selection again. Change-Id: I902ce548fc25875f2cd67b165283ff1236329afa Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* VcsBaseEditor: Reduce scope of local variableAndre Hartmann2020-05-161-2/+1
| | | | | | | As suggested by cppcheck. While at it, make it const. Change-Id: I7800291545f8f14f4d939152d9a184da6eadc1f5 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* VcsBaseEditor: Make link colors theme-awareAndre Hartmann2020-05-121-2/+3
| | | | | Change-Id: I5323e0cd236276a5a74e7c55f81d9d9c9795d295 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* VcsBaseEditor: Fix tr context for Copy actionOrgad Shaneh2020-02-281-1/+1
| | | | | | | This amends commit 7677e3e197368bd206dc565368cb3f33d951d092. Change-Id: Ib07dc2a8110a8e09f43c035989d9ffa84e0427d3 Reviewed-by: André Hartmann <aha_1980@gmx.de>
* VcsBaseEditor: Highlight default actions on context menuOrgad Shaneh2020-02-281-5/+6
| | | | | Change-Id: Idc493658dbc829394bd2898a59ba5686036bc3fe Reviewed-by: André Hartmann <aha_1980@gmx.de>
* VcsBaseEditor: Remove default actions when right-clicking a referenceOrgad Shaneh2020-02-281-2/+6
| | | | | | Change-Id: I2e8abd4487756be2535934ca8ab4d6b9105e6088 Reviewed-by: hjk <hjk@qt.io> Reviewed-by: André Hartmann <aha_1980@gmx.de>
* VcsBaseEditor: Remove unused functionsOrgad Shaneh2020-02-281-14/+2
| | | | | | Change-Id: Ida1df50aee0c146d8070e62292163d34cd53f65a Reviewed-by: hjk <hjk@qt.io> Reviewed-by: André Hartmann <aha_1980@gmx.de>
* VCS: Fix broken annotation changes detectionOrgad Shaneh2020-02-241-1/+1
| | | | | | | isValid() is true for empty regexp... Change-Id: I0af92574181736d5dde2ca48d3a8ab75ff6f14dc Reviewed-by: André Hartmann <aha_1980@gmx.de>
* VCS: Replace QRegExp with QRegularExpression in VcsBaseEditorOrgad Shaneh2020-02-211-32/+39
| | | | | | Change-Id: I8e8a6649e441597e29e88506d494ec69260bebd1 Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch> Reviewed-by: André Hartmann <aha_1980@gmx.de>
* VCS: Refactor annotationChanges() in VcsBaseEditorOrgad Shaneh2020-02-201-0/+37
| | | | | | | Devirtualize the function, and use QRegularExpression with globalMatch. Change-Id: I18c92cb37b535c616f03f45dff8b18249c961d5d Reviewed-by: hjk <hjk@qt.io>