Commit Graph

272 Commits

Author SHA1 Message Date
Eike Ziller
f811b87c66 EditorManager: Small API clean-up
- Move private enum to private header
- Add missing parameter to openEditorAtSearchResult
- Remove convenience singular close* methods, we have {} nowadays

Change-Id: Ic5b6d831a9f506ffee09b89b3358874433d62998
Reviewed-by: David Schulz <david.schulz@qt.io>
2020-09-30 14:57:20 +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
hjk
8b3e0d7122 Perforce: Remove QRegExp use
Task-number: QTCREATORBUG-24098
Change-Id: Id234cc2206afd3e1372c25749e73d7c31c7ebd7f
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2020-06-24 08:38:27 +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
Eike Ziller
5b364de168 Use dialogParent() instead of mainWindow()
There are very few reasons to use mainWindow() directly.
Especially for modal dialogs, using dialogParent() is important, since
that guarantees the stacking order in case of other dialogs currently
being open.

Change-Id: I7ad2c23c5034b43195eb35cfe405932a7ea003e6
Reviewed-by: hjk <hjk@qt.io>
2020-06-02 11:44:53 +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
299d34d547 Remove apparently unneeded QtPlugin includes
Change-Id: I511c0318a72dbf2a92e4749dee02eabfc9826139
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-02-12 16:03:37 +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
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
76d31dd93d Perforce: Move PluginPimpl definition to .cpp file
Helps to get rid of on option page parent, and a couple of
accesses to singletons.

Change-Id: Ifff2fb4aa56216f78acd5eb2a67c4b0f64a45c0e
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2020-02-05 06:15:04 +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
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
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
1269217be3 Perforce: Get top level also when env is set
Fixes: QTCREATORBUG-18771
Change-Id: Ic90f6a96ea6d978f7c36b188527b222a7a13f510
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2019-01-11 11:51:18 +00:00
Orgad Shaneh
667e622d5f Perforce: Fix soft assertion
Fixes: QTCREATORBUG-18404
Change-Id: I274f8cbc4512c5142d54a3b4faf39747bfa16bd8
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2019-01-11 11:51:03 +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
Orgad Shaneh
e0520794f5 Perforce: Modernize
override, auto, nullptr

Change-Id: I82f63fbe06d098e71876c30af0fe247a5bae3a55
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2018-09-20 06:59:17 +00:00
Eike Ziller
bd59472f40 Perforce: Fix warnings and modernize
Change-Id: Id43718869aaf2bc24e6a6614bcddcc35715502fe
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2018-08-28 09:04:20 +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
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
Orgad Shaneh
a36536813f VCS: Set user choices on editor reload
Broke by 2c6adc1e74.

Change-Id: Iba435899c7b0da4b270f4ef8ece84c1839bf6b72
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-06-19 08:08:02 +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
Orgad Shaneh
6031892f96 VCS: De-slot
Change-Id: I805eb88dee7ec1243d59c32be23f2fb401f1f46e
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-03-20 11:39:01 +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
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
Jarek Kobus
2c6adc1e74 VCS: Replace QToolButtons in VCS toolbar with QActions
Change VcsBaseEditorParameterWidget to add actions/widgets to an
existing toolbar, instead of being a widget itself.

The class is renamed in a follow-up commit.

Task-number: QTCREATORBUG-14934
Change-Id: I473a439d12a096f4cbb64f06faa0598ee72000de
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2016-10-24 16:23:33 +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
Tobias Hunger
8b46136b60 Perforce: Modernize
* use pragma once
* remove debug code
* Remove some "slots"
* Use Qt5 style connects (almost everywhere)

Change-Id: Iaa9c3bbacbb2be3c96502c52cc169ad4ec7015a5
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2016-02-10 13:32:50 +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
Orgad Shaneh
aecfeb8758 Perforce: Complete Qt5 connects
Change-Id: Ifdcda2c529fc2b6c0313a6d0b521694d0ab32012
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2015-11-20 12:00:43 +00:00
Tobias Hunger
bbb7f180f1 Perforce: Use Qt5-style connects
The heavy lifting was done by clazy.

Change-Id: I3617564f4cff494423c42c1665a4e54c503101c2
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2015-11-20 07:46:25 +00:00
Cristian Adam
dffd71f4f1 Perforce: Reduced delay before submit dialog is shown
Qt Creator's Perforce plugin uses "fstat" command to gather the files in
the project.

This takes ~40 seconds on a 12.000 files project.

By using "files" command the operation of gathering the files in the
project takes ~1 second.

Change-Id: Id8257d33a5dda2e06f0f365d5e3b30a49a094483
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
Reviewed-by: Alexander Drozdov <adrozdoff@gmail.com>
2015-07-21 08:24:14 +00:00
Cristian Adam
0a0a620489 Perforce: Diff for files in submit changelist dialog works
Perforce repositories configured with P4CONFIG had a bug
in the submit dialog, one could not see the differences for
the submited files.

Change-Id: Ie15fd66667dca1c0863a29e87ff76583d9aa3bbb
Task-number: QTCREATORBUG-14538
Reviewed-by: Alexander Drozdov <adrozdoff@gmail.com>
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2015-07-21 08:22:03 +00:00
Tobias Hunger
5a2459d1e1 VcsBase: Make some slots protected and update users accordingly
Change-Id: If38be72e9037126b6b697c5064a07de29a2ef8e5
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2015-06-11 08:41:01 +00:00
Cristian Adam
ad9b4ce499 Perforce: Ability to use multiple workspaces/projects
By the use of P4CONFIG (p4config.txt) one can now specify workspace
details (P4USER, P4CLIENT, P4PORT) individually for specific projects.

Previously one had to reconfigure Qt Creator in Settings for every
workspace switch.

Change-Id: I117829ab3cf592562a4662f85314aa3c125e7610
Task-number: QTCREATORBUG-14378
Reviewed-by: Alexander Drozdov <adrozdoff@gmail.com>
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2015-05-05 16:32:28 +00:00
Orgad Shaneh
a79df8e1e7 Utils: Make SynchronousProcess use second based timeouts
Change-Id: Ie2de2359225017cae7181bee0df17542fa36efd8
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2015-04-15 12:42:46 +00:00