Commit Graph

271 Commits

Author SHA1 Message Date
Jarek Kobus
60302debd7 Move ShellCommand into VcsBase plugin
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>
2022-08-01 14:33:06 +00:00
Jarek Kobus
82553f16a1 ShellCommand: Remove exitCode arg from finished() signal
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>
2022-07-29 10:49:25 +00:00
Jarek Kobus
60a5f77ef2 Drop Qt5: VCS: Get rid of QComboBox QOverload
Change-Id: Ib2f21f28a0ec16b817f9227c6234424001752d50
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-07-19 21:45:59 +00:00
Jarek Kobus
7f4363e51a VcsBaseEditorWidget: Get rid of DiffChunkAction struct
Change-Id: Ia35a8ef6b836709f7e058cfe33bf902f015e89b9
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-07-19 20:17:20 +00:00
Jarek Kobus
52e649cf53 VcsBaseEditorWidget: Avoid using sender()
Change-Id: Id300535d40b52a2f7d3e69fca77ca75271da8711
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-07-19 20:17:09 +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
hjk
d842862944 Utils: More porting.h related changes
Change-Id: I528a6950dfa6e09eb7f7ada265c8c41dba816bfd
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-07-14 12:04: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
Jarek Kobus
89e7201048 VcsBase: Hide VcsCommand class
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>
2022-07-13 16:01:28 +00:00
hjk
802de0eb5e Utils: Collapse most of porting,h
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>
2022-07-13 09:44:09 +00:00
Jarek Kobus
0490e3426d ShellCommand: Merge VcsCommand::VcsRunFlags into RunFlags
Use ShellCommand class name in signal-slot connections.

Change-Id: Id50ee6887708558a2ba0972ece6c420b0be36f72
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-07-12 14:49:10 +00:00
Artem Sokolovskii
646254f460 VCSbase: Remove foreach / Q_FOREACH usage
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>
2022-05-23 08:49:43 +00:00
Jarek Kobus
6cd736fe6c Remove algorithm.h from buildtargetinfo.h
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>
2022-05-18 08:38:05 +00:00
Eike Ziller
195abefe7d EditorManager: Remove QString openEditor(At) overloads
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>
2021-11-02 08:11:14 +00:00
David Schulz
1a0c937485 VCS: use context menu actions of TextEditor in VcsBaseEditor
Change-Id: I1947190ad0147d15cd4e95c5dff102b795a78bfc
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2021-10-13 06:30:38 +00:00
David Schulz
9ea3d61aaa VCS: update the text cursor of VcsBaseEditorWidget
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>
2021-10-13 06:30:34 +00:00
hjk
59c01481d1 Core: PatchTool code cosmetics
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>
2021-08-17 11:55:11 +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
Eike Ziller
f8ae051816 VCS: Fix build with Qt6
QStringRef is gone.

Task-number: QTCREATORBUG-24098
Change-Id: I38dd1602294fcabf5cf7c1553bcfd93f3c47b601
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2020-09-21 06:56:58 +00:00
David Schulz
339db00f85 Core: replace QString with Utils::FilePath to get documents
Change-Id: I01777c227398be8bd3bf877c5429b84a75aa361b
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-09-04 10:14:14 +00:00
Andre Hartmann
d1b0966996 Git: Fix filling commit selection combobox for log
Broken by commit cbb70513bf, 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>
2020-05-16 19:47:46 +00:00
Andre Hartmann
02d216fa13 VcsBaseEditor: Reduce scope of local variable
As suggested by cppcheck. While at it, make it const.

Change-Id: I7800291545f8f14f4d939152d9a184da6eadc1f5
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2020-05-16 19:03:16 +00:00
Andre Hartmann
9c1e8a99d8 VcsBaseEditor: Make link colors theme-aware
Change-Id: I5323e0cd236276a5a74e7c55f81d9d9c9795d295
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2020-05-12 13:36:42 +00:00
Orgad Shaneh
ab3e2ac0fc VcsBaseEditor: Fix tr context for Copy action
This amends commit 7677e3e197368bd206dc565368cb3f33d951d092.

Change-Id: Ib07dc2a8110a8e09f43c035989d9ffa84e0427d3
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2020-02-28 09:44:55 +00:00
Orgad Shaneh
a01035fefb VcsBaseEditor: Highlight default actions on context menu
Change-Id: Idc493658dbc829394bd2898a59ba5686036bc3fe
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2020-02-28 09:39:14 +00:00
Orgad Shaneh
d9ca238ffe VcsBaseEditor: Remove default actions when right-clicking a reference
Change-Id: I2e8abd4487756be2535934ca8ab4d6b9105e6088
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2020-02-28 07:06:49 +00:00
Orgad Shaneh
9455b144b2 VcsBaseEditor: Remove unused functions
Change-Id: Ida1df50aee0c146d8070e62292163d34cd53f65a
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2020-02-28 07:02:44 +00:00
Orgad Shaneh
de5f4d1160 VCS: Fix broken annotation changes detection
isValid() is true for empty regexp...

Change-Id: I0af92574181736d5dde2ca48d3a8ab75ff6f14dc
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2020-02-24 08:32:03 +00:00
Orgad Shaneh
a83f0c5d74 VCS: Replace QRegExp with QRegularExpression in VcsBaseEditor
Change-Id: I8e8a6649e441597e29e88506d494ec69260bebd1
Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2020-02-21 08:28:34 +00:00
Orgad Shaneh
3c0b89f697 VCS: Refactor annotationChanges() in VcsBaseEditor
Devirtualize the function, and use QRegularExpression with globalMatch.

Change-Id: I18c92cb37b535c616f03f45dff8b18249c961d5d
Reviewed-by: hjk <hjk@qt.io>
2020-02-20 10:42:31 +00:00
hjk
9c96a1c4de Vcs: Make VcsBaseEditorWidget::test* operate on factories directly
Saves re-discovery by id.

Change-Id: I026c1388d02f125147a9b4f5367d7a1a266bff3c
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2020-02-13 07:10:21 +00:00
hjk
823c44de18 Vcs: Move static functions out of VcsPlugin "namespace"
Plan is to split VcsPlugin in the pure IPlugin and a new class
the remaining non-IPlugin bits of VcsPlugin, call it VcsPluginPrivate
and use that d-ptr for VcsPlugin. VcsPlugin-derived classes can
then use VcsPluginPrivate derived private, later pointer members
of the *Privates can be made proper members, moving towards the
otherwise predominant plugin setup pattern.

Change-Id: I62db9269e8ca50633c24b6d1d735d59c8fa8e5a5
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2020-01-23 08:20:36 +00:00
Tobias Hunger
d272a64eab Project: Remove Project::document() method
The document is used to do file watching, which may or may not be
ideal. So make sure we do not leak the information how we watch
files into the API and its users.

The method is not used sensibly anywhere in creator, so it seems
safe to remove it entirely.

Change-Id: Ieed755bd5c852875378e4e96665dc906499975b0
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-08-19 14:27:06 +00:00
hjk
251287f0d3 Avoid warning on empty expressions
For some reason, Q_UNUSED includes already a semicolon, adding one
on the user side creates an additional empty statement.

Change-Id: I9c5e8fac381345a60792cb75e2938fd53958d3b0
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-07-23 11:55:59 +00:00
Christian Stenger
9da3077651 VCS: FakeVim: Ensure log editor is handled as readonly
Fixes: QTCREATORBUG-22595
Change-Id: Iab51eda5e55d36e98cf0ba5116853d6bee1dbd10
Reviewed-by: hjk <hjk@qt.io>
2019-07-02 08:41:51 +00:00
hjk
473a741c9f Utils: Rename FileName to FilePath
More in line with QFileInfo terminonlogy which appears to be
best-of-breed within Qt.

Change-Id: I1d051ff1c8363ebd4ee56376451df45216c4c9ab
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-05-28 12:23:26 +00:00
hjk
19e1cf1520 Replace uses of qVariantFromValue with QVariant::fromValue
Deprecated in Qt 5.14, alternative has been around since Qt 4 at least.

Change-Id: I4e3a53c289088368609e0d0ce2405a832d311308
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2019-05-27 12:33:29 +00:00
hjk
6f37348b4c Replace static_casts by QOverload where possible
Mainly to get rid of the QProcess::finished deprecation warning.

Also adjust coding style in the surrounding connects when needed.

Change-Id: I12f9b248c7974b892c4a069356e578e80f8c59e9
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-02-26 15:18:14 +00:00
Alessandro Portale
672bee2ed1 Don't detach temporaries
[-Wclazy-detaching-temporary]

Change-Id: I278873fff8592249f0c4519a4e4a6faff2dff6e3
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2019-02-06 12:28:10 +00:00
Orgad Shaneh
8f65486dfc VCSBase: Modernize
override, auto, nullptr, member initializers.

Change-Id: Ie21b8f4a4d6673947d82619bc3de677fcea63d7f
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2018-09-20 07:02:17 +00:00
Orgad Shaneh
afb60d0434 VCS: Use namespace Utils
Change-Id: I41c818362398fd194995baf5b1adb16899e83217
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-07-18 08:44:45 +00:00
Orgad Shaneh
eb711d9864 VCS: Fix off-by-one line in blame
Line is blockNumber()+1. When executing blame, the cursor jumps to one line
above the selected line.

Change-Id: Ia28b6c5a353ee979fae3f463b864d1409d9649cd
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-07-02 11:21:42 +00:00
David Schulz
464a9ad9ab Editor: Fix block for offset calculation
Take block bounding rects into account, when calculating the row count
or the center visible line.

Change-Id: If933828867df25920eeb56359e9a42a8b95d9c6d
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-02-15 09:51:46 +00:00
Tobias Hunger
c330cf0679 Replace manual signal blocking/unblocking with QSignalBlocker
Change-Id: Ibb59fab4e37d045e506c5a8172b6f5cbb955b028
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2017-10-04 09:35:06 +00:00
Tobias Hunger
5d8b0e6352 Utils: Separate rendering out of ProgressIndicator
I want to reuse the rendering of the progress indicator outside
of a widget.

Change-Id: Icaeeb798578ad838693b68556bf2193c4ba45cfa
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-07-27 09:15:05 +00:00
Orgad Shaneh
a36536813f VCS: Set user choices on editor reload
Broke by 2c6adc1e74.

Change-Id: Iba435899c7b0da4b270f4ef8ece84c1839bf6b72
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-06-19 08:08:02 +00:00
Tim Jenssen
f2b8e9acd1 SessionManager: Clean up methods around projects
Clean up methods around projects() and update its usages to modern
language standards.

Change-Id: Ia0a4574d014ce41e0d511a392e4eed4680981d0e
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-03-02 09:31:23 +00:00
Orgad Shaneh
414f49ea19 VCS: Use Qt5 connect for annotate
Connect directly to the editor widget, which has a strong type.

Change-Id: I4d9778bc4a3c8ba1b37c5a5c0286fd72cda135de
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-11-28 09:39:38 +00:00
Orgad Shaneh
5832f52cee VCS: Replace describe slots with lambdas
Change-Id: I05ca25aad8be43fdfa15d3fb5eaaa9bf753ee79f
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-11-28 09:38:12 +00:00