Commit Graph

199 Commits

Author SHA1 Message Date
Eike Ziller
7c5ed6f7d9 Move InfoBar to Utils
The only reason it was required to be in Core plugin, was its use of Id,
which now is available in Utils.

Change-Id: I66ce863c24924e6448d339b3422538a7fe167336
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2020-06-18 06:39:54 +00:00
Orgad Shaneh
5ebe34a332 VCS: Add vcsDescribe
Already exists in all implementations, but there was no common declaration.

Change-Id: Ieb3d10d1936c207722b5001712bce41e8114dcdc
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2020-06-18 05:17:59 +00:00
Orgad Shaneh
e9df7825fa IVersionControl: Change vcsAnnotate return type to void
All implementations return true unconditionally, and the return
value is never read anyway.

+ Remove superfluous function with the same name in Perforce.

Change-Id: I83f361ec7fd8be3177cb4be52e6276e295cd4279
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Reviewed-by: hjk <hjk@qt.io>
2020-06-18 05:16:24 +00:00
hjk
1c81a3b3e8 All: Use Utils::SkipEmptyParts
Task-number: QTCREATORBUG-24098
Change-Id: Iab45de9a9c17ddc39a0e343b1175d4f6cb94b098
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-06-17 05:55:25 +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
b5710099bb Vcs: Make some editor factories proper plugin pimpl members
Change-Id: I7f815c53bac8621b2198c57d7f1d7d4bd43eb282
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2020-02-07 10:23:47 +00:00
hjk
d33710a180 ClearCase: Make a some items proper data members
Change-Id: I7d1c8490ca72c6ba0b16111d2191826583037c6e
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2020-02-07 09:40:15 +00:00
hjk
11c242427c ClearCase: Partially move plugin pimpl to .cpp
Unfortuately, some deep accesses are not easy to get rid of. Make them
available by static functions in the plugin itself. Definitely not the
favorite setup, but allows to proceed with the QObject removals.

Change-Id: Idc1624d2a4751b15159c3e36dcf8d2d476550167
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2020-02-07 09:27:09 +00:00
hjk
9c02a11039 Vcs: Separate plugin and QObject parent roles for VcsSubmitEditorFactory
These are different when the factories are used as real members,
as already done in Bazaar.

Change-Id: I3c187896dcbacb5156be1543424ccacb9140a493
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2020-02-06 15:02:04 +00:00
hjk
7f37c503db Vcs: Move responsibility to set editor parameters to editor factory
So it doesn't need to be named twice in the editor factory setup.

This intentially includes a de-optimiztion: storing the parameters
by value, not by pointer. That's more natural, does not need to
keep the parameters alive on the caller side, and it's uncritical
in this context.

Change-Id: I92867d3f2f75c38911ae82d3eeb4759cba71b723
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2020-02-06 07:03:44 +00:00
hjk
b8fe25db25 Vcs: Merge IVersionControl and VcsBasePlugin hierarchies
They were 1:1 in parallel, with quite a bit of function call
ping-pong inbetween, for code-sharing-by-inheritance. Merge
them by making VcsBasePlugin inherit IVersionControl and
merge the derived classes below.

Size of this patch is hard to avoid as all seven systems have to
move simultaneously. Non-necessary potential follow-up cleanup
have been left out on purpose.

Change-Id: Icb71e4182af3db21069cc637e7ae87ffa3829791
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2020-01-31 12:36:23 +00:00
hjk
1cd936c531 Vcs: Pimpl plugins
Essentially rename all *Plugin into *PluginPrivate, and pull out
the actual IPlugin related pieces into new *Plugin classes.

Shift the construction of the PluginPrivate to initialize(),
following the general pattern.

I tried to keep the patch as mechanical as possible, giving
room to some obvious but less mechanical cleanup needs,
that are intentionally left out of this here.

Change-Id: Iac662bf73338f9f7669064ed67b960246875c23c
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2020-01-24 09:47:28 +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
hjk
f5d4b65931 Vcs: Dissolve VcsManager::registerVersionControl
It's a somewhat unusual pattern, spelling it out will help
to move the vcs plugins setup closer to the now-usual pattern.

Change-Id: Ie7b70e52d75e34cd36b6a1d55ca868e3edab44a7
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2020-01-22 11:32:04 +00:00
hjk
01ce55f7dd ClearCase: Use new IOptionPage convenience functions
Change-Id: Ie239a972de57f8f145fc3343f7cabac86917760e
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2020-01-14 08:45:43 +00:00
hjk
8b72e92167 Utils: Add CommandLine convenience constructors
... taking a QString for the executable.

This weakens the very explicit QString -> FileName conversion via the
named constructors for the special case of constructing a CommandLine.

I think that's worthwhile here, as it reduces the noise on the caller
site under circumstance where the nature of the thing is obvious.

Change-Id: I27b4a73639728893d053b2e7ba65cb745f0ffe83
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-07-23 15:51:45 +00:00
hjk
00b692e67e Utils: Use CommandLine in ShellCommand
... and adapt users.

Change-Id: I218523ffe34720d5fe199aa0ca6892a8dc2985fc
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2019-06-11 11:01:16 +00:00
hjk
ca4ba34229 Use Utils::FilePath in SynchronousProcess
Adapt callers and surrounding code.

Change-Id: Ie6c1883a44169cf9d790d06b660f46d24dc24c89
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-06-11 08:11:07 +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
Orgad Shaneh
15b176e30c VCS: Improve dialog on submit prompt
The dialog appears when closing the commit dialog without committing,
or when "prompt to submit" setting is enabled.

Fixes: QTCREATORBUG-18799
Change-Id: I8eb20becbcee7281b9f673a35ec698c6f8e04a40
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Robert Loehning <robert.loehning@qt.io>
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2018-11-12 18:35:44 +00:00
Alessandro Portale
4979c384ce ClearCase: Modernize
modernize-use-using
Turn a parameter of ClearCaseSync::updateTotalFilesCount into a &.

Change-Id: I1ee95b64374c77abb228e586544c8675ec74433a
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2018-11-05 10:12:42 +00:00
Orgad Shaneh
a334650953 ClearCase: Pass dialogParent where needed
Change-Id: I5f2de5191472fc0414fc5aa7074ad5e8e8251db1
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2018-09-22 17:25:37 +00:00
Orgad Shaneh
b9e39ed5e0 ClearCase: Modernize
override, auto, nullptr

Change-Id: I07ba03d44e2560797cc496acc96b57b41703320c
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2018-09-20 05:31:28 +00:00
Orgad Shaneh
767137157e VCS: Consolidate submit editor actions setup
Change-Id: I36754779b6a9aa35de705b368daf8c2a1de058c6
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-08-28 07:26:14 +00:00
Orgad Shaneh
6e59d31095 VCS: Capitalize commitDisplayName
To be used by the submit editor.

Change-Id: I73fc13abfd37f207d92669c1893b7edda35ed1e4
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-08-28 07:20:13 +00:00
hjk
713b8636ea Vcs/Text search: Remove a few addAutoReleaseObject uses
Using a QObject parent suffices here.

Change-Id: I4dc5448511d55bf14fbd8f810e91336a49e94094
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2018-02-06 11:58:15 +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
Tobias Hunger
18f38ff18e Project: Make Project::files return a FileNameList
Change-Id: I75ceb22ac65b8288d824f229d44089cba6fc8ea3
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2017-12-08 09:09:59 +00:00
Robert Loehning
0683042141 ClearCase: Don't try reading when file cannot be opened
Change-Id: Id403f9ed58fb624aef7f6d54607e19a5dd057fd5
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Robert Loehning <robert.loehning@qt.io>
2017-09-18 11:56:58 +00:00
Tobias Hunger
21ab4c427c VCS: Offer to save-all before commit
Task-number: QTCREATORBUG-3857
Change-Id: I3ff3d90803eec4134b9da4af5567753ad7bffafb
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2017-09-12 10:04:20 +00:00
Tobias Hunger
19c9194b11 VcsManager: Register IVersionControls with VcsManager
Get some more objects out of the pool.

Change-Id: Id93021b712307c4777dc39b9d15aa18a46318885
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2017-07-10 08:44:47 +00:00
Tobias Hunger
74c1ebdcaa VcsManager: Simplify usage of clearVersionControlCache
Change-Id: Iaf2f65da31a33979c30e63c29a706a568cc5fd1c
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2017-07-10 08:21:42 +00:00
Montel Laurent
5d27bc747b Use QFileInfo::exists(...) which is faster that QFileInfo(..).exists
Change-Id: I0d2e61d84c74e60ef4f54074a4ca00f2d0835562
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2017-04-14 13:18:28 +00:00
hjk
c1bfc5d8ec ProjectExplorer: Follow up on too-much-magic in IProjectManager
Use a ProjectManager::registerProjectType<Project>(MimeType) function,
removing cryptic IProjectManager object ownership.

Change-Id: I212cd25bd4ee757022a8cb0decb4b8de3a112d12
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-03-09 10:41:33 +00:00
Eike Ziller
d64e17ad55 Move mimetype definitions to plugin specs
- Avoids the hassle of QRC files and manually registering mime types
- Avoids performance regressions because of mime types that are
  registered after mime database has been used
- Makes it technically possible to detect that a disabled plugin could
  handle a mime type if it was enabled

Change-Id: I373008b1b56e9c6b4853055f20b3eeb112a6eff9
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2017-02-27 13:54:59 +00:00
Tim Jenssen
2631ffabd5 Remove spaces in initializer lists
Format initializer lists code style like.

Change-Id: Ib82c235e4ba7dc75ee96a7abc0c47eff7b0a9013
Reviewed-by: hjk <hjk@qt.io>
2017-02-22 16:25:09 +00:00
hjk
56409f5afa Replace a few occurrences of QStringList() << ...
... by something shorter.

Change-Id: I363b4e509adb07997517b2d233246a333aea4aea
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-02-08 11:21:45 +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
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
Orgad Shaneh
c844071627 Rename VcsBaseEditorParameterWidget -> VcsBaseEditorConfig
Change-Id: I5626e66ba2b7a760ce55263edce9e716067ea6a4
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2016-10-24 16:23:59 +00:00
Tobias Hunger
5efd82468b SynchronousProcess: Store raw bytes from stdout/stderr of the process
Only convert the raw output later in a stdOut() and stdErr() method of
the SynchronousProcessResponse.

This is necessary since we have processes that use different encodings
for different sections of the file (I am looking at you, git).

Also remove the signals for raw data on stdout/stderr, leaving only the
signals returning buffered QString lines. This should be safe, even
with UTF-16 output.

Change-Id: Ida613fa86d1468cbd33bc6b3a1506a849c2d1c0a
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-07-15 14:16:03 +00:00
Orgad Shaneh
44b0ca4754 ClearCase: Adapt to removed signal
Change-Id: I6296f23af08890cc82880715db7c84f51d9cd6ce
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-05-30 11:28:58 +00:00
Nikita Baryshnikov
7c5836986f vcs: fix compiler warning
this 'if' clause does not guard

Change-Id: I91cdabf9b770f58cc59ca00df6574c757c2618b5
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-05-13 08:48:12 +00:00
Tobias Hunger
ddefe062c7 Fix up QProcess::waitForFinished()
waitForFinish returns false if the process is no longer running at
the time of the call. Handle that throughout the codebase.

Change-Id: Ia7194095454e82efbd4eb88f2d55926bdd09e094
Reviewed-by: hjk <hjk@theqtcompany.com>
2016-05-11 10:04:38 +00:00
Eike Ziller
61bcbd872e ClearCase: Use Utils::runAsync
Change-Id: Ib2752b2874258a9736b329b2d0ca66ca15998f23
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2016-02-12 09:51:20 +00:00
Tobias Hunger
9b3016c2e4 ClearCase: Modernize
* Use pragma once
* Use static member initialization

Change-Id: Icec025b7c3b310286c675cef30cf01e220002ca8
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2016-02-04 10:40:19 +00:00
Friedemann Kleint
97af238656 Preferably use QStringRef::toInt().
Avoid allocations for converting to int.

Change-Id: Id8c79334f4809ec075ffe7e6b7635be4873eafd8
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
2016-02-04 07:56:58 +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