Commit Graph

112 Commits

Author SHA1 Message Date
Jarek Kobus
3caf82f746 Remove unused includes of Q[H/V]BoxLayout
Change-Id: Ia90b30b634281414268e00722771470f1e7b69c0
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: hjk <hjk@qt.io>
2022-11-18 15:29:06 +00:00
Orgad Shaneh
bf0d2426b8 DiffEditor: Persist description widget height
Fixes: QTCREATORBUG-24286
Change-Id: Ie1bf1136bce973b7197b7378b48a85ec776e8f6d
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2022-10-24 07:00:50 +00:00
Jarek Kobus
1359557f77 DiffEditor: Limit the usage of qMakePair
Change-Id: I0f7f4235cba4e1f6df4245cb51a37ff82a8e5109
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-09-30 07:42:00 +00:00
Jarek Kobus
835b278c00 DiffEditor: Use namespace Utils
Change-Id: I0869c6ed0e2173ce46ebde7deebe5352034daedb
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-09-29 15:53:50 +00:00
Jarek Kobus
2d360db2c3 SideBySideDiffEditor: Avoid code repetition
Change-Id: Ie49834a4896dbf32a87329345e52dc99ca2f86bd
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-09-29 15:15:21 +00:00
Jarek Kobus
0def7c83d4 DiffEditorPlugin: Various cleanups
Change-Id: Ic0c9c397067b899932bc39d938e63df36fa4caeb
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-09-28 18:10:02 +00:00
Jarek Kobus
f3a7299761 DiffEditor: Use DiffSide enum inside FileData
Change-Id: I4c18c52a9737cc46c3faeadf0abd5c4771463e0e
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-09-28 15:48:34 +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
Jarek Kobus
e32ebe2146 Drop Qt5: Various plugins: Get rid of QOverload
Change-Id: I4913044f8897fd3449dbb537e4af6785eb3ad447
Reviewed-by: hjk <hjk@qt.io>
2022-07-20 13:52:38 +00:00
hjk
2f44449a90 DiffEditor: Remove workingDir parameter from setDiff()
It was not used.

Change-Id: I33a77f4d8238218b90171a98aa25af5b31b17eb3
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2021-08-17 11:22:45 +00:00
hjk
206e9f95fb Core: Signal duplicated editors
FakeVim needs some notification even in cases where the
duplication is triggered outside the EditorManager as in
QmlDesigner's qml-editor.

Fixes: QTCREATORBUG-22344
Change-Id: Ia4950ff4b02d3f89779f03ff4c106a07ccff2106
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-01-14 08:31:44 +00:00
Orgad Shaneh
d02c69d1bc DiffEditor: Improve initial size of description widget
Fixes: QTCREATORBUG-24286
Change-Id: I8844b30d287fcdc5333906d00d92e00d05f5560a
Reviewed-by: David Schulz <david.schulz@qt.io>
2020-10-08 10:18:03 +00:00
hjk
430a33dcd9 Core/Utils: Migrate further to Utils::Id
The coreplugin/id.h header is kept for downstream for now.

Change-Id: I8c44590f7b988b3770ecdc177c40783e12353e66
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-07-06 06:07:13 +00:00
Christian Kandeler
92bae70432 DiffEditor: Fix leak
Change-Id: I39c73f2076420d2026bec58f5a383b27188a2720
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2020-06-17 10:59:30 +00:00
Eike Ziller
e5bb7d1ffe Remove unnecessary removeContextObject calls
They are removed on deletion now.

Change-Id: I08461ea4938e24ab450df013a0f8f820032381da
Reviewed-by: hjk <hjk@qt.io>
2020-05-27 08:42:00 +00:00
Alessandro Portale
2234c517c0 Utils: Add a non-toolbar variant of the "RELOAD" icon
New icon is: Utils::Icons::RELOAD. And the toolbar variant is now
Utils::Icons::RELOAD_TOOLBAR.

Change-Id: I811d83c7340a717968430ac1ce4a5c708c8ddcf9
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-02-07 09:22:07 +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
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
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
cce6975fd8 DiffEditor: Modernize
modernize-use-auto
modernize-use-override
modernize-use-equals-default

Change-Id: I4e70550ed2962781b62661a405517b5c79126bad
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2018-11-09 05:40:27 +00:00
Orgad Shaneh
1486359251 Core: Change IEditor::document() to const
All the implementations are const.

Change-Id: Ib9753fe764dd482d4f4392eec70878d42edc737a
Reviewed-by: hjk <hjk@qt.io>
2018-09-26 06:20:51 +00:00
Alessandro Portale
b16ba2ba59 Remove a few redundant occurrences of 'virtual' and 'override'
warning: 'virtual' is redundant since the function is already declared
'override' [modernize-use-override]

warning: 'override' is redundant since the function is already declared
'final' [modernize-use-override]

Change-Id: I9036a0dc88ed70c4f6e37b916bb24ff65074863d
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-06-18 08:41:37 +00:00
Jarek Kobus
7d60710608 DiffEditor: fix various warnings
Change-Id: I555aa30c8925ba8eeb314dd836f1544b93d7a66f
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2018-05-03 13:03:31 +00:00
Jarek Kobus
da2c66b1d0 Move git specific stuff out of diff editor plugin
Move it to the git plugin.

Change-Id: I8151573ed50df70776f7ebf0475dd41fb84fae83
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-03-15 11:21:01 +00:00
Alessandro Portale
807c7c6380 utils: Let the link icon have a LINK and a LINK_TOOLBAR version
Change-Id: I910d491f7f5ac47c55c966f687b004c0e0793c5f
Change-Id: I910d491f7f5ac47c55c966f687b004c0e0793c5e
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-03-02 10:32:47 +00:00
Orgad Shaneh
b114b0c95e DiffEditor: Minor cleanup
There is no need to enclose the argument with parentheses, and there is no
need to cast to QSharedPointer.

Change-Id: Ie8f6e4228e09203d1c42f614ee8a84de4a1e110b
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2018-02-20 11:05:26 +00:00
Jarek Kobus
990da15c1e Refactor HighlightScrollBar
Rename it into HighlightScrollBarController.
Don't derive it anymore from QScrollBar.
Make it based on QObject and decorate
the existing instance of QAbstractScrollArea as needed.

Fix the highlight of the shared scrollbar of the SideBySideDiffEditor.
Both left and right diff editors have their own
HighlightScrollBarController and their own separate overlays, but both
overlays are created as children of the same right editor instance.

Synchronize also the cursor between left and right editors.
Make highlight current line working.

Make the overlay transparent for mouse events - this fixes
issues on macOS when scolling over invisible scrollbar.

Change-Id: Iab05c360173e09d8748658c59785da86438a7189
Reviewed-by: David Schulz <david.schulz@qt.io>
2017-12-12 08:17:58 +00:00
Andre Hartmann
aae3056b33 DiffEditor: Modernize
* 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>
2017-12-09 14:45:37 +00:00
Eike Ziller
72e9afd8d0 Fix underline color in diff description when hovering
Since e.g. whitespace can have a different foreground color than
"normal" text, we have to explicitly set the color for the underline
when hovering. Use foreground color if there is no specific text color
set for "normal" text.

Change-Id: I9825d24af0d598b039a0db9ed86966605e22ac04
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2017-07-10 07:17:19 +00:00
Eike Ziller
3188a5abb1 Fix style of whitespace in diff description
Task-number: QTCREATORBUG-9445
Change-Id: I1c60181b7e15c66b88cc1d5ec7584951d3aa46a0
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2017-07-07 13:27:37 +00:00
Jarek Kobus
228e4a7542 DiffEditor: refactor loops and const correctness
Change-Id: I21af8db55ff5a012de04b4934de1940babf75058
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2017-06-28 08:51:36 +00:00
Eike Ziller
ee722a047c DiffEditor: Fix editor actions
The text editor widgets all need a TextEditorActionHandler that takes
care of the editor actions for them.
Each text editor needs its own context, so the editor with focus
receives the actions. This does not happen automatically for these text
editors, since the diff editor manages these itself.

Task-number: QTCREATORBUG-9445
Change-Id: Ib42f095ec23550e401e8ee9b36f3f49517a22877
Reviewed-by: David Schulz <david.schulz@qt.io>
2017-05-18 08:24:26 +00:00
Tobias Hunger
836252990a DiffEditor: Fix warning about unused constant
Change-Id: I5a2fbf4e91319d2da41fb364f60688e81498b708
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-01-30 13:17:33 +00:00
Arnold Dumas
708185e211 DiffEditor: drop legacy settings
Change-Id: I94147168c33d7b44a1288b51fe3d9a3ae46c8cdd
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2017-01-23 12:51:36 +00:00
Jarek Kobus
b29513aa5b Display "Waiting for data" properly
Display "Waiting for data" instead of "No differences" when creating new
instance of an editor for the same document (e.g. by splitting the view)
during document reload.

Change-Id: If254006de3914ad4416c7405874e8cbea57ddd8d
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-01-09 10:49:13 +00:00
Jarek Kobus
dbfb5eaba1 Fix showing/hiding context lines spinbox in diff editor
Widgets which were added to a toolbar can only be shown or hidden
by calling setVisible() on their respective action, which was
created while addWidget() was called.

Change-Id: If09257abf5a7a054513fe01b2a1c69d584865dfa
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2016-11-25 08:45:36 +00:00
Jarek Kobus
344f255fa9 Reuse the Guard class
Change-Id: Ia742ab92fd7947f4d156d03e112ee32363312996
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-10-21 09:48:40 +00:00
Ulf Hermann
15fbfaf2e9 Move icons to Utils
This way we can use them from libraries, not only from plugins.

Change-Id: Ic35cfd5f04d638d87606bf272b2c00ded1267c1b
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2016-08-05 10:52:53 +00:00
Tobias Hunger
397e7f4843 Update License according to agreement with Free Qt Foundation
* Update files in src/plugins

Change-Id: Ia5d77fad7d19d4bb3498e78661982f68729adb22
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2016-01-19 15:57:01 +00:00
Andre Hartmann
9bf7f83845 DiffEditor: Sort includes
Change-Id: If646e27683e351e4308906f58b325dc47ff83c8b
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2015-12-22 11:54:30 +00:00
Alessandro Portale
03c07b80fd Core: Unify the close icons
Use the same image file and recolor it as needed,

Change-Id: I914819a53ca05d83ca5b88adf44706b460b48ac0
Reviewed-by: Alessandro Portale <alessandro.portale@theqtcompany.com>
2015-12-04 10:47:32 +00:00
Alessandro Portale
033862f305 Themed Icons: Introduce Utils::Icon
Instead of describing icons via file name or in the themed icons case
via
a string that is a list of mask/color pairs, we have now a class for it.

Icons are now listed in per-plugin *icons.h headers.

RunControl::m_icon was The only place left where an icon property was in
fact a string. This patch changes that member to be a Utils::Icon.

Change-Id: Ibcfa8bb25e6d2e330c567ee7ccc0b97ead603177
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
2015-11-25 12:30:52 +00:00
Orgad Shaneh
d8d7acbe75 Git: Scroll to active file on Show invoked from file log
Change-Id: I0935bf8b8b30ee78716a14ee0a88c21b9caf62dc
Reviewed-by: Jarek Kobus <jaroslaw.kobus@theqtcompany.com>
2015-11-03 08:45:41 +00:00
Alessandro Portale
b8bdc6f669 Icon refresh: First step towards the new Qt Creator themes
http://blog.qt.io/blog/author/didesous/ announced new designs/themes
for Qt Creator. This patch replaces many of the existing toolbar icons
with recolorizable masks for better theming support.

Change-Id: I557aa485205fe2624f33724226f698c303342b40
Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
Reviewed-by: Alessandro Portale <alessandro.portale@theqtcompany.com>
2015-10-23 16:04:52 +00:00
Daniel Teske
da4ab870a1 Vcs: Simplify code by using Utils::equal
Change-Id: I8c58010e85c7e2a4b8a7c01fb81ce6b528f77b7d
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2015-09-07 12:26:47 +00:00
Eike Ziller
4f927e4c87 Move "open" from IEditor to IDocument
For non-editor documents it currently is not used, but for editors it
makes more sense to have that on the document instead of the editor.
Most actual implementations of "open" were done in the documents already
anyhow, because it is needed for reloading.

Change-Id: I29d4df2078995cbe80172b51a9bebeecb3afad3c
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
2015-06-10 11:21:17 +00:00
Eike Ziller
e00aa54f4e Add override keyword to IEditor & TextEditorWidget implementations
Change-Id: I403101d788d9edfea5c5c9440ab4f39ad00e81f7
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2015-06-09 04:17:42 +00:00
Tobias Hunger
ee7d0a7bf7 DiffEditor: Do not load settings when splitting views
Change-Id: I7fac89714ff9a603af29e19664b091e5e62be22f
Reviewed-by: Jarek Kobus <jaroslaw.kobus@theqtcompany.com>
2015-04-10 14:14:57 +00:00
Tobias Hunger
fb6d7ce91b Remove some duplicate includes
Change-Id: If7bae084cd34c6fb0fe77f9227d9848517c0e691
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2015-03-20 14:45:04 +00:00
Leena Miettinen
9e2501c3a2 DiffEditor: use sentence style capitalization for labels
Change-Id: I3d8142d934b126bf13cab4729f6ed3f46cadbcea
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2015-03-16 14:59:58 +00:00