aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/git/instantblame.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Avoid including multiple Tr classesEike Ziller2025-09-261-2/+1
| | | | | | | | | | | | | | | | | | | | lupdate has issues finding the right translation context if there are both Tr::tr calls that should be resolved via a `namespace <name> {` scope, and another `using namespace <other>` with a namespace that has another Tr class. Many of the cases of this that we have were editor display names that were defined in the Core plugin for reasons unknown, and which would better be defined in the corresponding plugin anyway. For the other cases do not use Tr::tr from a different plugin, but instead introduce "msg<Something>" functions that do the Tr call plugin- internally. That is the "correct" way to do it anyway, since shared strings should be changeable centrally. Task-number: QTBUG-140548 Change-Id: Idacf62b400f50789b5e5957b690e16aa1ebe5a56 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* Utils: Work-around incorrectly themed iconsAlessandro Portale2025-09-041-1/+1
| | | | | | | | | | | | | | | | | | The selected application Qt::ColorScheme in Qt Creator can differ from the system Qt::ColorScheme. On some Linux desktop environments, this may lead to inappropriately colored icons being returned from QIcon::fromTheme. This change ensures that in this scenario, Qt Creator's own icons are used instead of QIcon::fromTheme. One usage of QIcon::fromTheme was changed to use the work-around code path. Fixes: QTCREATORBUG-33171 Change-Id: I439866983eb3bb05b573350cbc14385821cc62c1 Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: hjk <hjk@qt.io>
* Vcs: Get rid of vcsExecWithHandler()Jarek Kobus2025-07-091-4/+4
| | | | | | | Reuse enqueueCommand() instead. Change-Id: I28d325536d219b42517b32a8c0fda1aafe04b177 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* VCS: Further reduce QTextCodec dependencyhjk2025-06-131-9/+9
| | | | | | | | | Use the new Utils::TextEncoding (a thin wrapper containing a codec's name) instead of a codec itself. Change-Id: I29d61c9884b7e35dc59d8123e697c63f6b748caa Reviewed-by: André Hartmann <aha_1980@gmx.de> Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* Clean up some includeshjk2025-05-141-1/+0
| | | | | Change-Id: Id5fae9aeb14ab90766f24d8f599008d3e2149c3d Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* Utils: Introduce a TextCodec::displayName() and use ithjk2025-05-141-1/+1
| | | | | | | Effectively the same as name(), with a somewhat meaningful invalid value. Change-Id: I9d7474b0c4f4299e20261a00fbcb52c6f348f568 Reviewed-by: David Schulz <david.schulz@qt.io>
* Utils: Introduce a Utils::TextCodec classhjk2025-05-141-3/+3
| | | | | | | | | | | | | Meant as replacement for QTextCodec, which is deprecated. The initial attempt to just use the codec name everywhere turned out to be a bit limited and lead to "non-speaking code" (!isEmpty, ...), so this here is a bit more class-y. For now, the new Utils::TextCodec still uses QTextCodec internally. Change-Id: I001e0769acd4e2a044063dde98ffaca278b1ca03 Reviewed-by: David Schulz <david.schulz@qt.io>
* VCS: Replace more uses of QTextCodec with its namehjk2025-05-091-3/+3
| | | | | | | | QTextCodec is as part of Qt5Compat still deprecated, and may not survive a Qt 6 -> Qt 7 transition. This here reduces its direct use in some places. Change-Id: I71f1c0faf20b00125dee8eb4fb0cd5d7316ce369 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* Merge remote-tracking branch 'origin/16.0'Eike Ziller2025-04-241-42/+47
|\ | | | | | | | | | | | | Conflicts: src/plugins/git/instantblame.cpp Change-Id: I189133e56d8f0d637666d79a946435b29231f50d
| * Git: Fix potential crash in instant blameEike Ziller2025-04-231-34/+37
| | | | | | | | | | | | | | | | | | | | When clicking links in the tool tip. The connection was guarded with the label, but was accessing data from the BlameMark. We got a report for a crash that looks like the mark was already gone at this point. It is safer to capture the relevant data explicitly. Change-Id: I16aa30a37c4221c4bf3caf90692a660737be3870 Reviewed-by: André Hartmann <aha_1980@gmx.de>
* | Editor: use forked plaintexteditDavid Schulz2025-04-151-2/+2
| | | | | | | | | | | | Change-Id: I43f3b356d24d4e45e80ed9d25768f9eb805b436e Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* | Merge remote-tracking branch 'origin/16.0'Eike Ziller2025-03-131-1/+1
|\| | | | | | | Change-Id: I466d212f57f706c71fd0c2624abb33814ea3e783
| * Git: InstantBlame: Escape commit summaries in tooltipAndre Hartmann2025-03-081-1/+1
| | | | | | | | | | | | Fixes: QTCREATORBUG-32345 Change-Id: I2e948eb5e02156c7ff32d87424194865f8f1569f Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* | Git: InstantBlame: Reuse existing git functionAndre Hartmann2025-03-081-3/+1
| | | | | | | | | | Change-Id: Ibad43045d4603c3551afc3a3e1870edac078ef7e Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* | Git: InstantBlame: Add "revert commit" actionAndre Hartmann2025-02-131-3/+17
|/ | | | | | Change-Id: I536bcff0c0edab33b57d53730f4b2b33ff30848f Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* Git: InstantBlame: Make uncommited line info translatableAndre Hartmann2025-02-101-3/+8
| | | | | | | | | | | | The orginal output from git is: * "Not Committed Yet" for the author * "Version of %1 from %1" for the subject Fixes: QTCREATORBUG-32093 Change-Id: I541895b079880727ea0a47d1b4fda8c80b6d313c Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: Orgad Shaneh <orgads@gmail.com> Reviewed-by: Olivier Delaune <olivier+qt@delaune.info>
* Git: InstantBlame: Make tooltip actions translatableAndre Hartmann2025-02-101-6/+10
| | | | | Change-Id: I2c29a0ccfa055d8e5c10ca5d4988450341b5d716 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* Git: InstantBlame: Add more logging for blame setupAndre Hartmann2025-01-111-1/+7
| | | | | Change-Id: Ic3b36abe72a04331be09fafbfec114da578a95ff Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* Utils: Rename FilePath::toString() into toUrlishString()hjk2025-01-101-2/+2
| | | | | | | | | | | | | | | | toString() is almost always the wrong conversion, but unfortunately too easy to find and often even working at least for local setup. This here raises the bar as the non-availability of the "obvious" toString() hopefully helps people to think about the semantics of the needed conversion and choose the right toXXX() function. The chosen new name is intentional ugly to reduce the likelihood that this (still almost always wrong) function is used out of convenience. Change-Id: I57f1618dd95ef2629d7d978688d130275e096c0f Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* Git: InstantBlame: Remove trailing newline from outputAndre Hartmann2024-11-241-1/+1
| | | | | Change-Id: Ia2caff14104811255e1eddd036573c4a8a1f9a5d Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* Git: InstantBlame: Disable tooltip actions for modified linesAndre Hartmann2024-11-011-15/+25
| | | | | | | | They currently make no sense as we only provide actions for already committed changes. Change-Id: I054876a5a9a8fe659b4e9ae53364e6ea167adde1 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* Git: InstantBlame: No line diff for modified linesAndre Hartmann2024-10-081-0/+4
| | | | | | | | | Avoids the following error message: qtc.vcs.git.instantblame: "fatal: bad object 0000000000000000000000000000000000000000\n" Change-Id: I44e45f02e9aaa6d31910441034b77a034b59d499 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* Git: Replace "SHA1" with "hash" in translatable stringsAndre Hartmann2024-09-101-1/+1
| | | | | | Change-Id: I4af9f995ea53236ab0108ce45d3fc26a59d8ef43 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* Git: Replace "SHA1" with "hash" in code and commentsAndre Hartmann2024-09-091-1/+1
| | | | | Change-Id: Iaa6712338b86a5a7fd4889734d5650c6751fcf95 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* Git: InstantBlame: Improve logging outputAndre Hartmann2024-09-081-1/+1
| | | | | | | Makes it easier to copy the command line for manual testing. Change-Id: I96b6cad13466551606aaa5182e7debf9c8296f5c Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* Git: InstantBlame: Add tooltip line diffAndre Hartmann2024-09-051-2/+68
| | | | | Change-Id: I711dc2c288c263621ab7dd9fc89489b3d56f935a Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* Git: InstantBlame: Adjust to common terminologyAndre Hartmann2024-09-041-16/+16
| | | | | | | | We use "subject", "hash", and "date" in other places, like the colors. Change-Id: Ia34b1b7762931b31126554c7568e1e67301462fb Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* Git: InstantBlame: Improve tooltip appearanceAndre Hartmann2024-09-031-12/+14
| | | | | | | | * Improve commit/author/date layout * Use the same colors as in diff description Change-Id: Icc7b7c21cefa7aaca5c8a40a6d85cda30147afba Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* Git: InstantBlame: Add line log action to tooltipAndre Hartmann2024-08-291-4/+16
| | | | | | | | Shows a file log with commits touching the current line. Task-number: QTCREATORBUG-31146 Change-Id: I33e643a1bbc832659a52ed3bc43254660e427f5b Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* Git: InstantBlame: Simplify slot for editor setupAndre Hartmann2024-08-231-16/+6
| | | | | | | | | | | | | | The slot parameter `editor` can either be an active editor or nullptr. nullptr could either mean no parameter was supplied or we have no current editor. Therefore, we would have to query the current editor again anyway, and so its easier to remove the parameter right away and always query the current editor. Change-Id: Ib0495ca37863017719734bcea9bb6f61835bde95 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* Git: InstantBlame: Add commit subject to annotationAndre Hartmann2024-08-231-1/+7
| | | | | Change-Id: I6bcb8d74ae5d380506f0a98d845b002c76bb9ecb Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* Git: InstantBlame: Retrigger on more settings changedAndre Hartmann2024-08-231-0/+8
| | | | | | | | When one of the settings "ignore space changes" or "ignore line moves" are changed, retrigger the blame. Change-Id: I46a8cf738cf7ece2c35c650ab2c93ee531aaae14 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* Git: InstantBlame: Simplify lambda when settings changedAndre Hartmann2024-08-231-5/+2
| | | | | | | | setupBlameForEditor() already contains the needed code to stop instant blame when it was disabled. Change-Id: Iffe7dd08707f89c0f2e67890991d394bd0fe82f7 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* Git: Instant Blame: Improve porcelain blame descriptionAndre Hartmann2024-07-281-4/+10
| | | | | Change-Id: I74464928483da33c7bc56b659d581debcb2ec7f0 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* Git: Instant Blame: Use original line number for blameAndre Hartmann2024-07-281-3/+8
| | | | | | | | | The line might have been moved and therfore using the original line number asures the full blame is scrolled to the correct position. Change-Id: I07478d499af3509670a7d91771b2ee9777a06b3c Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* Git: Add full blame and showing file from Instant BlameAndre Hartmann2024-07-221-7/+42
| | | | | | | | | Add actions to get the full file blame at the current lines revsion respective its parent revision and to show the whole file at the lines revision. Change-Id: I2c6a1e98967cd40d658afe6bfedf0a0d9e988186 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* Git: Avoid crash when reloading filesChristian Stenger2024-05-211-0/+7
| | | | | | | | | Explicitly reset the document when the document gets closed. Task-number: QTCREATORBUG-30824 Change-Id: I4fb3d6fd6041990e5b8b4f6b7c4fd9ebc62f5a4a Reviewed-by: Orgad Shaneh <orgads@gmail.com> Reviewed-by: André Hartmann <aha_1980@gmx.de>
* Git: InstantBlame: Lower logging category for non-errorAndre Hartmann2024-01-221-1/+1
| | | | | | | | | `TextEditorWidget::fromEditor(editor)` fails in the DiffEditor, so this message is no warning but rather an info. Change-Id: I1635b77910e609bda470d2f657916bbc98860af4 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* Git: InstantBlame: Init m_cursorPositionChangedTimer in ctorAndre Hartmann2024-01-201-3/+3
| | | | | | | | Needs to be done only once, and fixes a dangling pointer if setup() was called twice. Change-Id: I02722daf5dffdfb2d4bb70de77436eb8d930806d Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* Git: InstantBlame: Fix multiple blame after file saveAndre Hartmann2024-01-201-6/+19
| | | | | | | | | | * Move document changed to slot and make sure it is a unique connection to prevent multiple slot calls * Still we get two changed signals after save, which caused two blame calls, avoid this with a marker Change-Id: I8f09ebc8c3cf9f9832fe2725c69acbea9a6b8c28 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* Git: InstantBlame: Add categorized loggingAndre Hartmann2024-01-201-5/+27
| | | | | Change-Id: Ic0e6e30a969fa4908d280e3dbb5c2395972d962d Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* Git: Separate internal plugin access API from plugin classhjk2024-01-151-2/+2
| | | | | | | Plan is to hide the plugin class definition to the .cpp later. Change-Id: I27f6d2dd23adb4f3ab47d99b0626956889d2750f Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* Git: Fix missing includeChristian Stenger2023-12-131-0/+1
| | | | | | | Fixes building withi qbs and Qt6.2. Change-Id: Ic87c81883286dbf96fa62ef3818af25001683737 Reviewed-by: hjk <hjk@qt.io>
* Git: Move Instant Blame into own classAndre Hartmann2023-12-101-0/+333
Change-Id: Ic7bdfb47d0de2a5499e40c9eeaead8bbf30a12e5 Reviewed-by: Orgad Shaneh <orgads@gmail.com>