Commit Graph

27 Commits

Author SHA1 Message Date
hjk
fa7dd2fd3b VcsBase: Convert to Tr::tr
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>
2023-01-18 15:33:59 +00:00
Kai Köhne
56baf8c058 Remove GPL-3.0+ from license identifiers
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>
2023-01-06 11:15:13 +00:00
Orgad Shaneh
b997d095a1 VCS: Linkify file names in diff output
Fixes: QTCREATORBUG-27309
Change-Id: I1236b3fb5a34d762b4eb42320cdb9ac5ec7e38a2
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2022-10-13 06:55:10 +00:00
Orgad Shaneh
7c623f99d8 Git: Fix pattern for commit hash matching
* Avoid matching mid-word.
* Avoid matching after "mode ".
* Change to raw string literals.

Fixes: QTCREATORBUG-24768
Fixes: QTCREATORBUG-28268
Change-Id: I68abbf3de7928c60e0fe2d944adedaa6db94b1a4
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2022-10-11 10:00:53 +00:00
Lucie Gérard
a7956df3ca Use SPDX license identifiers
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>
2022-08-26 12:27:18 +00:00
hjk
d83eb0494a Use setClipboardAndSelection more broadly
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>
2022-07-15 07:06:25 +00:00
Jarek Kobus
0da525d65c VcsBase: Cleanup some Utils:: in cpp files
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>
2022-07-13 16:01:35 +00:00
Andre Hartmann
eb7aad198f VcsOutputLineParser: Allow copying links to clipboard
Change-Id: I193225ed42db61966db9cc9cdf3db7e9dca26672
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-02-09 10:40:52 +00:00
hjk
ff57cb548d Vcs: Use more FilePath for file paths
Change-Id: I855cde65d034a9647972a7fddf1e8266d7ccfa88
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2021-08-02 14:40:33 +00:00
hjk
edcedabed9 Vcs: Use FilePath in IVersionControl API
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>
2021-07-29 13:20:23 +00:00
Orgad Shaneh
92a4c0d38a VCS: Pass links to the correct VCS
Current implementation requires each VCS to connect to the referenceClicked
signal. Only Git does it, but this is conceptually wrong. If other VCSs
would connect to the same signal, all of them will act upon clicking a
link, which can result in multiple editors, most of them are likely to be
invalid anyway.

By default executes vcsDescribe. Can be extended or modified by subclasses.

Change-Id: Ib953009efd77446a4b2963f0aa8a2f3f3d26509f
Reviewed-by: Artur Shepilko <artur.shepilko@nomadbyte.com>
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2020-06-21 06:47:20 +00:00
Orgad Shaneh
6cfd240285 OutputWindow: Do not activate links for empty reference
Change-Id: I1d4fc0f25f1882a34058c66c51376982cc70238e
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-06-18 16:52:03 +00:00
Christian Kandeler
c0c2df203d Utils: Split up OutputFormatter class
An OutputFormatter takes some string and prints it into a text edit.
In addition, it can ask any number of registered OutputLineParsers
whether they think any special formatting should be applied to the
current line.
This mechanism is now properly modeled by our class design, rather than
being hidden in a monolithic class where everything had the same type,
no matter what its purpose was.
Prospective contributors can now simply be pointed to the
OutputLineParser class and will see at one glance what they have to do.

Change-Id: I9844499f062c94fb038ce73fd6f26576910148c2
Reviewed-by: hjk <hjk@qt.io>
2020-04-14 14:15:26 +00:00
Christian Kandeler
0f16378188 OutputFormatter: Do all formatting centrally
Instead of working directly on the text edit, the specialized
OutputFormatter classes now simply ask the base class to do it for them.
In practice, the request currently always is "turn this part of the text
into a link", but the interface can be extended to other types of
formatting, should that ever be required.
This is a win/win situation: Derived classes no longer have to fiddle
with QTextCursor & friends (nor do they have to call any base class
functions), while the base class can make strong assumptions about what
the derived class does to the text edit (i.e.: nothing).

Change-Id: Icc4bc52d4001b0359247563e39a206fa274833d7
Reviewed-by: hjk <hjk@qt.io>
2020-04-14 09:46:34 +00:00
Eike Ziller
10114dc036 Merge remote-tracking branch 'origin/4.12'
Conflicts:
	src/plugins/android/androidmanifesteditorwidget.cpp

Change-Id: I8143d9e02837dcd78a637da7b333a6eeebb105cb
2020-04-07 11:13:58 +02:00
Andre Hartmann
93e788fd19 VcsOutputFormatter: Allow ranges with three dots also
This can, for example happen after a forced push to Gitlab.
The VCS output looks like this in that case:

  + 7c145ae...c301cc6 master -> master (forced update)

Change-Id: I84bec1a6cf2bf875732461f767ebbf4703cdbadb
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2020-04-06 10:28:09 +00:00
Eike Ziller
ee2840d5b8 Merge remote-tracking branch 'origin/4.12'
Change-Id: Ic741fdedc168430e5be6cb1645d9329dbc7a6b08
2020-03-23 09:35:54 +01:00
Andre Hartmann
59f6c6282c VCS: Capture more hashes with suffixes
Recognize multiple trailing carets and
tilde/number combinations too.

Amends 098ee51a9b

Change-Id: I91ea33f7e2dae61f18c2899c949034ebedca0157
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2020-03-21 18:50:48 +00:00
Christian Kandeler
04a99c1de1 Remove the limitation that output formatters have to be exclusive
Introduce an aggregating output formatter that forwards its input to a
sub-formatter that feels responsible for it, or otherwise lets the base
class handle it.
Our output panes now use such an aggregating formatter.
In particular, this means that in the future, we won't have to stuff all
run control output formatting into the Qt output formatter anymore.

Change-Id: I5498f200a61db10ccff3ec8974c6825da7f7072d
Reviewed-by: hjk <hjk@qt.io>
2020-03-20 13:48:15 +00:00
Eike Ziller
d80f3972a4 Merge remote-tracking branch 'origin/4.12'
Change-Id: Ia8254720b2ba6e3e7b859017e1c2b6e289bed771
2020-03-20 08:16:19 +01:00
Andre Hartmann
098ee51a9b VCS: Capture hashes with trailing caret
The Push-to-Gerrit dialog calls

  git branch -r --contains 3fa72ff^

for example.

Change-Id: I6c0bd792dd5bf85dec61fa576fbd8bba3aa9f06d
Reviewed-by: Miklós Márton <martonmiklosqdev@gmail.com>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2020-03-20 06:08:30 +00:00
Christian Kandeler
0ff5bf75e1 Move some code from OutputWindow to OutputFormatter
That's where it belongs: The logic there is applicable to all output
formatters, not just those used via an output window.

Change-Id: Idf4ca8d22631ca96feb97553f28724c0275e0bf8
Reviewed-by: hjk <hjk@qt.io>
2020-03-17 09:39:12 +00:00
Orgad Shaneh
ba87fb2083 Git: Add actions for changes in output window context menu
Change-Id: I5aa46f87b82670286ac225d71a3a045133976e86
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2020-02-28 09:53:51 +00:00
Andre Hartmann
937e2b56e7 VcsOutputFormatter: Fix multiple regexp matches
Fixes: QTCREATORBUG-23614
Change-Id: I86e548a1f727113782afbc6b934d6dddc92c92ea
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2020-02-18 19:19:26 +00:00
Andre Hartmann
4cbb24906f Git: Allow clicking references in VcsOutputWindow
Fixes: QTCREATORBUG-16477
Change-Id: If1f36bec0826a3116e5261a270cd63a1536e13f5
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2020-02-16 19:13:53 +00:00
Christian Kandeler
67f66a39be VcsBase: Fix memory leak
Change-Id: Icb0c2a86ee0d5a1e22dc17fbc2a5d155b928e459
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2020-02-06 12:14:03 +00:00
Miklos Marton
8f88b89d81 Make http(s) urls clickable in the VCS output pane
Fixes: QTCREATORBUG-23536
Fixes: QTCREATORBUG-19171
Change-Id: Ibf6d632031068c7f52cb15f534960e8238bdb21d
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2020-02-05 22:02:39 +00:00