Commit Graph

530 Commits

Author SHA1 Message Date
Jarek Kobus
d892eaadae DiffEditor: detect binary files
Task-number: QTCREATORBUG-15767
Change-Id: Ic9f513ecaeb15b56c90933b1d5e4cf70e045b481
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-06-07 06:57:31 +00:00
Jarek Kobus
b2a1c189e0 DiffEditor: Keep horizontal scrollbar policy in sync
Task-number: QTCREATORBUG-14330
Change-Id: I4c45089f10a9b59cd1bc5b5368f14e0bb0738f22
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-05-16 11:59:47 +00:00
Jarek Kobus
1a23768563 Ignore index change when we set the document
Do the same as in case of sidebyside editor.

Task-number: QTCREATORBUG-18306
Change-Id: I1364aed0edb02dd9f5432e191ce4fb4b2db34430
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2018-05-04 07:58: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
Eike Ziller
428fcb476b Merge remote-tracking branch 'origin/4.6'
Conflicts:
	src/libs/utils/settingsaccessor.cpp
	src/plugins/autotest/autotestplugin.cpp
	src/plugins/git/gitclient.cpp
	src/plugins/qbsprojectmanager/qbsrunconfiguration.cpp
	src/plugins/qbsprojectmanager/qbsrunconfiguration.h

Change-Id: I65f143cad18af509a2621d6c5925abbd038ea70f
2018-04-13 10:54:42 +02:00
Jarek Kobus
e806ea40cc Pass this context object to the connect()
Otherwise when "this" instance
gets deleted and the sender still exists, the lambda
expression is still invoked for the deleted object.

Task-number: QTCREATORBUG-20223
Change-Id: Ifd5c9e6ce1fe7fde71698c6683cdfcd7566e8d35
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2018-04-09 09:31:40 +00:00
Orgad Shaneh
7d3a79c696 Utils: Purge asConst
Replace by qAsConst.

Change-Id: I3301366f73c066c86f08df7188d70dc3b613c55c
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2018-04-09 09:04:00 +00:00
Razi Alavizadeh
437199acd8 Plugins: Re-categorize plugins which are in "Qt Creator" category
Category of DiffEditor, ImageViewer, Macros and UpdateInfo
  was removed, i.e., they were moved to "Utilities" category.

Category of other plugins that were in "Qt Creator" category,
  changed to "Core".

By this patch, forks of QtCreator don't need to change *.json.in files locally.

Change-Id: I243c6b1831c0b880d32b2118db71f0b281590b7b
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-03-20 15:31:49 +00:00
Eike Ziller
cb84ae1a21 Merge remote-tracking branch 'origin/4.6'
Conflicts:
	src/plugins/android/androiddeployqtstep.cpp
	src/plugins/cmakeprojectmanager/cmakerunconfiguration.cpp
	src/plugins/qmakeprojectmanager/wizards/testwizard.cpp
	src/plugins/qtsupport/exampleslistmodel.cpp
	src/plugins/qtsupport/gettingstartedwelcomepage.cpp

Change-Id: I126823f5f60613509520c07f52be7bc9d4f4367c
2018-03-16 09:28:08 +01: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
Eike Ziller
124e4499eb Merge remote-tracking branch 'origin/4.6'
Change-Id: I421af2d62994436782dab6d37e97622bd055ed44
2018-03-05 09:28:34 +01: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
Eike Ziller
7c3cfa166d Merge remote-tracking branch 'origin/4.6'
Conflicts:
	src/plugins/coreplugin/helpmanager.cpp

Change-Id: I2feb60ec0afb2f22f75dc137a01c3fa217b299d8
2018-02-23 10:56:52 +01: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
64233a4fae Fix repeting Stage/Unstage actions in unified diff editor
Don't store diff file index, chunk index and diff editor
controller anymore. Pass needed indices by value,
retrieve them when needed as lambda copy.

Change-Id: I3a81f1ab6d131c0b1d9899ac4b061b6e25582f51
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-02-16 06:48:27 +00:00
Jarek Kobus
9494a9e0c0 Don't route request for chunk actions through diff doc
Change-Id: Ia2c052ab4a39e99466d697b44b5d58a574408fb0
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2018-02-16 06:48:16 +00:00
Jarek Kobus
11a6f000be Fix horizontal scrolling in sidebyside diff editor
Fix horizontal scrolling in sidebyside diff editor
when doing text search.

Change-Id: I6b52ee50544ef6005b8b79b87b9289dbc7f99dbf
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2018-02-16 06:48:05 +00:00
hjk
abe57f73b4 DiffEditor: Remove unneeded used of global object pool
Change-Id: I7b1cd980702313e3ef2501519aa64042d4483bb8
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-02-08 08:32:01 +00:00
David Schulz
0eb7bab20c Core: make useMacShortcut constexpr
Change-Id: I293b96428784b6efecac6dae4f2f9690af0027da
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-02-02 13:15:55 +00:00
Andre Hartmann
6bc12ff446 DiffEditor: Replace bool arguments with flags enum
Change-Id: I70262476d015ba5b73069b149093dac66f7c6008
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-01-17 09:13:40 +00:00
Orgad Shaneh
b8ee51fef1 DiffEditor: Simplify makePatch tests a bit
Change-Id: I205bda692dbb5f759ca84dd5cf4b73da9601a7b5
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-01-17 09:13:29 +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
5003f644ac SideDiffEditorWidget: Fix Clang semantic warnings
Change-Id: I0f92993aa6152836237f7429c66761c22692075d
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2017-12-09 14:45:49 +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
8e1fefd8de Merge remote-tracking branch 'origin/4.5'
Conflicts:
	qbs/modules/qtc/qtc.qbs
	qtcreator.pri

Change-Id: I29979e76cb01bc94ddcd7868ca1cbc34afb14c5d
2017-11-27 12:46:56 +01:00
Orgad Shaneh
63861c44c1 DiffEditor: Fix parsing of mode-only change in patch
If one of the files has mode-only change, the entire patch
fails as a git patch, and is parsed as a text patch.

Because of that, the prefixes (a/, b/) are not stripped and
jumping to a change by double-clicking does not work.

Change-Id: Ib54ce4fa7aad02cb956af1f7de73d3c732ac5a89
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2017-11-27 11:40:31 +00:00
Ulf Hermann
389ca50865 DiffEditor: Add missing override
Change-Id: Ic0541a8c902ae10c622cf8843990bdc4e21b9fe8
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-11-07 11:47:00 +00:00
Jarek Kobus
96aeabd0a6 Add folding to Side-by-side diff editor
Add folding for files and chunks.

Change-Id: I76476351e88f0b3e71e3cccbca0fa17b02c26226
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
2017-11-01 09:13:17 +00:00
David Schulz
3bea291427 DiffEditor: Remove indirect call to firstVisibleBlock
Change-Id: I37db7e280ea9f327ff8ab33b0f9b1fee813fcba9
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-10-25 06:21:32 +00:00
David Schulz
56260add50 DiffEditor: remove unused member of SideBySideDiffEditorWidget
Change-Id: Ic46fe95bc493c9242b0896737fb324f3816cc0d4
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-10-25 06:21:25 +00:00
Friedemann Kleint
0be8240002 Add folding to Unified diff editor
Add folding for files and chunks.

Change-Id: I0dd278d0bc69208a0c9c116b94e4ead7aec5fede
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2017-10-05 14:29:38 +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
Laurent Montel
b89cd0a78a DiffEditor: Clean forward declaration
Change-Id: Ifedc0041a5a7d736231057c092f430061c62f8fb
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-09-27 07:46:16 +00:00
Orgad Shaneh
139792ee25 Merge remote-tracking branch 'origin/4.4'
Change-Id: I9ab2c68d2bd07b0dd89051a2f5f6fa51676d8594
2017-08-30 01:24:11 +03:00
Eike Ziller
04da881268 Fix copyright year in plugin info, --version, and macOS info
By using the new QTCREATOR_COPYRIGHT_YEAR variable

Task-number: QTCREATORBUG-18612
Change-Id: I3bcf0319660d210436d3130c00f43325c460a66c
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
2017-08-24 11:23:40 +00:00
Nikita Baryshnikov
8de69d7b5f Replace QLatin1String, QStringLiteral ("") with QString()
Change-Id: I21e6165e7e8858df8436c04c9afcc1be5242bda4
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2017-08-21 09:27:21 +00:00
Eike Ziller
d8fd5292f1 Merge remote-tracking branch 'origin/4.4'
Conflicts:
	src/tools/clangbackend/ipcsource/clangiasyncjob.cpp
	src/tools/clangbackend/ipcsource/clangjobrequest.cpp
	src/tools/clangbackend/ipcsource/clangjobrequest.h

Change-Id: Ib8602530663813ade418f995dfd2a736908cfe75
2017-08-15 10:07:51 +02:00
Jarek Kobus
6213369675 DiffEditor: Fix saving diff containing new or deleted files
Fix also the case when new file was empty.
Fix some const correctness.

Change-Id: Ied71c3de0398914e595fbf542f1b8ec3659d69b6
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-08-10 16:59:54 +00:00
Jarek Kobus
e3ce4b150d DiffEditor: Optimize patch processing
Get rid of QRegularExpressions, they are very slow.
Simplify readGitPatch() a lot.
Make reading of the patch about 20 times faster,
especially make readGitDiff() itseft (excluding the calls to
readChunks) working about 1000 times faster for huge diffs.
So, the processing time for e.g. the bottom commit of
qttools module (the import commit) decreased from ~20 seconds
to ~1 second.
Implement nice progress of patch reading.

Change-Id: Ie24786596237bde475e37337663018a8bec086bb
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2017-08-10 16:58:45 +00:00
Orgad Shaneh
6334632f00 DiffEditor: Jump to original file on Enter
Task-number: QTCREATORBUG-18650
Change-Id: Id6bfb9892aee2e4d7b7772b7dd208107ec4b3b11
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-07-31 08:43:05 +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
Jarek Kobus
0b1eaacabb DiffEditor: fix the cancellation of diff requests
Change-Id: I36c4af4ec51473fb9da5d9f099f2251f75b2020a
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2017-07-17 09:32:28 +00:00
Jarek Kobus
323bee675a DiffEditor: make some public methods private
Change-Id: Idb7a506e81001fda79eff72c0c23b9945103cad0
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-07-10 08:19:05 +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
13fc3c8313 DiffEditor: Share "failed" state among multiple views
Change-Id: Id049ce8eafcb21d5e60fae17c47df8657c0e5779
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-07-05 14:20:46 +00:00
Jarek Kobus
6509753e86 Make it possible to cancel async diff calculation
Change-Id: I38fe86159daab794d060860de6ee5ab30fb395eb
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-07-05 14:20:16 +00:00
Jarek Kobus
0a2590e7be DiffEditor: process git diffs asynchronously
It won't freeze GUI in case of huge diffs.

Change-Id: Ida6bdcb1ef6867969cd86d4bc9652c64bc74e6ec
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-07-05 14:19:42 +00:00
Orgad Shaneh
f55d3c5c6f Merge remote-tracking branch 'origin/master' into 4.4
Change-Id: I071b3016e11f94c5421822935c13cecda7075f40
2017-06-30 14:22:00 +03:00
Jarek Kobus
bde0f1b0ff DiffEditor: disable saveAs action during reload
Change-Id: I6786139c1cd9c9e3c0786b14da058cb260fba3ed
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2017-06-29 10:38:23 +00:00