Commit Graph

396 Commits

Author SHA1 Message Date
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
Nikolai Kosjar
218457786d DiffEditor: Fix build
diffutils.cpp: In function 'QList<DiffEditor::RowData>
    DiffEditor::readLines(QStringRef, bool, bool*, bool*)':
diffutils.cpp:585:53: error: no match for 'operator+' (operand types are
    'QStringRef' and 'const QChar')

Change-Id: I44ad2237c033266d3832ce95174ec056ff7cae9f
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2017-06-28 14:12:00 +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
Jarek Kobus
f07fda598e Replace QRegExp with QRegularExpression
Use QStringRef where possible.
Speedup readGitPatch() approximately 2 times.

Change-Id: I7bd09d7ac768331b0600456e48c44cfc72b7001d
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2017-06-28 08:38:50 +00:00
Orgad Shaneh
9154a457fd DiffEditor: Add context info to side by side editor
Task-number: QTCREATORBUG-18289
Change-Id: Ibc4a626c22cc1d96b27e8744a87dd2780cec549e
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2017-06-02 09:52:29 +00:00
Eike Ziller
a901916710 DiffEditor: Remove dead code
It updates a local variable that is not used.

Change-Id: Id7ec92108bb3a35c9177bd3429b6f69ac23a9f28
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2017-05-23 09:00:07 +00:00
Orgad Shaneh
a4a146b3cb Move Git-specific logic from DiffEditor to Git
Change-Id: I29466c26a51844bb975ac3ecb68adf708021aa67
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2017-05-19 04:48:23 +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
Alessandro Portale
3624a663d8 Reduce usage of qApp in favor of static function calls
Q*Application classes have unusually many static functions. In many
cases in our code, these functions are unnecessarily called as instance
functions, using the qApp helper.

This patch replaces many occurencies of qApp with the according
Q*Application classname.

Change-Id: I6099a419fa7bf969891269c37ed7a9e817ef5124
Reviewed-by: hjk <hjk@qt.io>
2017-04-24 18:36:28 +00:00
Montel Laurent
158ab3316e Use QString::*Ref method
Change-Id: I63a10f274dd17e08b5b8a2577762cc9f7960b5af
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2017-04-21 12:04:38 +00:00
Montel Laurent
f976dc96fd Reserve some elements
Change-Id: Iceef4e9a6f213a747045db3b06a5608d77652f98
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2017-04-14 13:18:17 +00:00
Jarek Kobus
9774f11738 Support diff a file from project explorer against the current file
Task-number: QTCREATORBUG-9432
Change-Id: Ie370bbffdb67dac520f392a73c1358f887157806
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-03-28 14:36:54 +00:00
Orgad Shaneh
3ec5a18990 DiffEditor: De-slot
Change-Id: I132da3f0475ced470ffd7c4cace60825b9dec44f
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2017-03-20 08:05:06 +00:00
Orgad Shaneh
da7cb91446 Merge remote-tracking branch 'origin/4.2' into 4.3
Change-Id: I4931dcc81be872d7712e67123e94d15ee696459f
2017-03-14 16:20:14 +02:00
Samuel Gaist
4033471aa9 QRegExp include cleanup
This patch adds the missing include statements for QRegExp.

Change-Id: Ibb03b929940adb84ae190b5090cb6b88653cc14c
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2017-03-13 22:05:30 +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
Tobias Hunger
c6f90e575e Utils: Introduce a TemporaryDirectory and TemporaryFile class
Both wrap the corresponding Qt class, but make sure all temporary files
or directories are created inside a "master temporary directory".

Change-Id: I55461be507c828c965224c02863ea5ed9bbf9498
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-01-20 12:17:10 +00:00
Jarek Kobus
8b67458a95 Prefix editor's uniqueId with plugin name
In this way we minimize the chance of
generating non-unique id.

Change-Id: Idd177c5a4b44b17a58c2a944ec77b9517e91964e
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2017-01-10 15:14:19 +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
Eike Ziller
e487b3bd55 Merge remote-tracking branch 'origin/4.2'
Change-Id: I575f1cf98f2a4740577cdd94da21687d3392cdb7
2016-11-30 15:09:11 +01:00
Orgad Shaneh
329c24ce3a Git: Replace msysGit with Git for Windows in comments
msysGit is obsolete

Change-Id: Iaa2aee0de2e8280dcc060cdd26b41962fb38a112
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-11-29 16:34:44 +00:00
Tobias Hunger
1b174a30fd DiffEditor: Initialize pointers
Change-Id: I462dbb5596b23c18a23360d630ed54cd307ce7f7
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2016-11-29 15:21:14 +00:00
Orgad Shaneh
7b3642cce4 Merge remote-tracking branch 'origin/4.2'
Change-Id: I259a402bc896fc2e359cc96b7510453ac9a9a552
2016-11-28 15:27:51 +02: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
b8036e7d31 Don't save context chunks
Otherwise the saved patch file contains the whole contents
of the compared files.

Change-Id: I0f2d4c4e9b2c56ceab2b1e312e0895087060d0dc
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2016-11-24 10:33:20 +00:00
Jarek Kobus
f778880a3b Fix SideBySide diff editor icon
Broken in 033862f305.

Change-Id: I8930de03b02dcf2859b11218b25fa0099e957791
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2016-11-24 10:33:08 +00:00
Jarek Kobus
f720daed91 Clear the uniqueId of diff editor when saving
Saving diff editor transforms it to patch-file
read only editor. Clearing the uniqueId
ensures we don't use it anymore for showing
e.g. current file's modifications.

Change-Id: I2010161697bbad254ce1ebe5d0bb6a1f38ae323c
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2016-11-24 07:55:18 +00:00
Jarek Kobus
78c3590705 Make skipOpeningBigTextFile() public and use it in Diff Editor
Change-Id: I5e98d1ab93ac442c1f1a132a51ab838567a735a0
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2016-11-23 14:08:38 +00:00
Jarek Kobus
4aae6b730f Show progress indicator while reloading diff
Change-Id: Ieefdb885682f01e0e1c8cec90f4769e832650a0c
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2016-11-23 12:17:11 +00:00
Jarek Kobus
d34414b428 Make some variables const
Change-Id: If0b6939d2c8446526f6d779486776bbea62fbc67
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2016-11-23 10:57:34 +00:00
Jarek Kobus
2c050f7750 Don't use static variables in differ
Now the differ may run in parallel
in many threads. Static variables
may lead to crash.

Change-Id: Iae0d7678cdca3e57cb619141081250b458852bfb
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2016-11-23 10:57:15 +00:00
Jarek Kobus
2144fb5949 Move diff calculation to the separate thread
It doesn't freeze creator anymore.

Task-number: QTCREATORBUG-14255
Change-Id: I3d06ea7a848e321c6072e00a73b96e9ea9770b6a
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2016-11-21 15:43:03 +00:00
Jarek Kobus
fd460a11dc Add some missing consts
Change-Id: I1c5122b893e7255237310562fcad16bc53f15fd7
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-11-17 10:31:27 +00:00
Jarek Kobus
8c36249ffa Add missing overrides
Change-Id: I7e27a273044542537423c8f4b9ab5235c3fabc22
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-11-17 10:31:18 +00:00