Commit Graph

326 Commits

Author SHA1 Message Date
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
Jarek Kobus
8224c1c95d DiffEditor: fix revert chunk for diffs of modified files
Apply chunk action doesn't make sense for that case,
will stay disabled.

Task-number: QTCREATORBUG-17136
Change-Id: Idce31b3aa9d354536a01607c10b20273158961d5
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-10-21 09:49:08 +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
Jarek Kobus
d3a743d77e Use namespace Core in diff editor plugin
Change-Id: I2409a6186d590a83ccde064c855e0261d600014e
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-10-21 09:20:35 +00:00
Jarek Kobus
4ae306a5e1 Handle "Diff All Modified Files" action enablement
Also rename it to "Diff Open Files".

Task-number: QTCREATORBUG-17094
Change-Id: I370c32497fcb56cb2bd84700ef7cb4aa7ba0a573
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-10-21 09:20:29 +00:00
Jarek Kobus
1414826183 Implement diff on close, on revert and on external modification
Task-number: QTCREATORBUG-1531
Change-Id: I8c9a740d66eb7836b3df6850ac243260fd282b32
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-10-21 09:20:20 +00:00
Jarek Kobus
52faf32770 Drop unneeded override
Change-Id: Ia29517a56f23472d7015130abc8c8753b40afe33
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-10-07 12:11:26 +00:00
Christian Stenger
ad615ece16 DiffEditor: Fix compile with gcc 4.8 / Qt5.6
Broke with ee095ef5d5.

Change-Id: Ib8cc5a0b8d79cf6ca542eb2fc9c0a4f06e885d88
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2016-10-07 05:31:58 +00:00
Jarek Kobus
ee095ef5d5 Implement diff for unsaved changes
Task-number: QTCREATORBUG-9732
Change-Id: I7e0f1d18046451ac1bc84b8c28113d72f63642a8
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-10-06 14:14:03 +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
Nikita Baryshnikov
0598202d3d DiffEditor: do not show reload prompt
for text document, after reverting some change in diff editor

Change-Id: I3511f00e52beffba1cce67fb6940d1b580ef99cd
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2016-07-25 14:01:26 +00:00
Jarek Kobus
adbc3f611f Show proper diff when one of diff files is missing
Task-number: QTCREATORBUG-16540
Change-Id: I185ac8e7c8be364c1e2f74bfe0af6f9e393c89be
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2016-07-25 13:29:10 +00:00
Jarek Kobus
3c1647e6b2 Refactor DiffEditorWidgets, introduce common widget controller
Reduce code repetition.

Change-Id: I416555dd83ce888088a6a259777c294a6feb35f4
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2016-07-25 13:28:45 +00:00
hjk
39a38d5679 Wholesale conversion to #pragma once
Kudos to cgmb and https://github.com/cgmb/guardonce

Change-Id: Ifa8970734b8d43fd08c9260c645bdb0228633791
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2016-03-30 15:20:19 +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
Eike Ziller
cfc89a685e IDocument: Rename defaultPath and suggestedFileName
To fallbackSaveAsPath and fallbackSaveAsFileName. That makes it clearer
what they are for, and that they actually belong to each other.

Change-Id: Ie5b83b9db77d39a7fe9e979cc8f22b7f5b9101a3
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
2016-01-14 14:40:45 +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
Orgad Shaneh
4b8a14e10f DiffEditor: Remove "slots"
Change-Id: I31335ffd95e4e7955966d06c78bde166ad6d5555
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@theqtcompany.com>
2015-11-02 09:22:11 +00:00