Commit Graph

185 Commits

Author SHA1 Message Date
hjk
d76458a8b6 Utils: Replace Environment::size() check by some isValid() function
More descriptive, and later implementable without full expansion.

Change-Id: Ic3b17ea0b07273f292827a7b63e7695b4bd1cf23
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-06-03 09:42:26 +00:00
Artem Sokolovskii
646254f460 VCSbase: Remove foreach / Q_FOREACH usage
Task-number: QTCREATORBUG-27464
Change-Id: I1088047513e7660907182e80303607d8c48919f5
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-05-23 08:49:43 +00:00
Orgad Shaneh
5d14d127d7 VcsBase: Add a convenience function execBgCommand
Creates and executes a command asynchronously, passing its stdout to a
callback function.

Change-Id: I6be7e803fadf708ca7dc587b612a5a63e9bf09c3
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2022-05-12 08:03:37 +00:00
Orgad Shaneh
71ba0b8853 VcsBase: Remove unused argument in enqueueJob
Change-Id: Ib295b9add526025f0f24c6e1463b7fe3e19d5d08
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2022-05-12 08:03:30 +00:00
Jarek Kobus
92d7e4601d QtcProcess: Forward declare Environment in QtcProcess header
Change-Id: If85a8a07b144c94cb6e45f66dcb06573ef07c777
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: hjk <hjk@qt.io>
2022-05-09 07:42:40 +00:00
Jarek Kobus
8e0ae8ba96 QtcProcess: Limit the inclusion of qtcprocess.h
Move the rest of QtcProcess enums to processenums.h.
Move ExitCodeInterpreter into processenums.h.
Remove superfluous Utils:: prefix.

Change-Id: Iaa596f353d33d6930085a621b114cc15a35caa80
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-03-02 13:30:39 +00:00
Jarek Kobus
3562c5e96e Remove unneeded includes of QProcess from cpp files
QProcess wasn't used in these files.

Change-Id: I24900bcf312eb6ea1ca3bc0c753cebb505ec552b
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: hjk <hjk@qt.io>
2021-11-01 12:04:41 +00:00
hjk
bbde6ac9bf VCS: Use more FilePath in ShellCommand and surroundings
Change-Id: Ie8c5fac09b45a54bcbe9a876044b653e7fccede5
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2021-08-17 07:16:04 +00:00
hjk
ff57cb548d Vcs: Use more FilePath for file paths
Change-Id: I855cde65d034a9647972a7fddf1e8266d7ccfa88
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2021-08-02 14:40:33 +00:00
hjk
ecbd9f4558 VCS: Partially use FilePath in VcsBaseClient
Change-Id: I024b051ab98ece42ec011bd1c92887a946925c1a
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2021-07-30 13:10:59 +00:00
hjk
430e81facd All: Replace most SynchronousProcess by QtcProcess
Change-Id: I0bf22fef2cd4a7297ef5a1e9aa9c3e2b9348ba42
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-06-23 07:55:31 +00:00
hjk
b7096f1935 VcsBase: Remove unused VcsBaseClientImpl::commandOutputFromLocal8Bit()
Change-Id: I5300934f12bd06648bcdab08af4cae6dd61c2e70
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2021-06-22 02:15:53 +00:00
David Schulz
068873c9d5 Utils: add FilePath::baseName
Removing some FilePath::toFileInfo() calls

Change-Id: I49be2ef260f225e07b64ee8ace6a8cd47a9d8bb2
Reviewed-by: hjk <hjk@qt.io>
2021-06-03 11:23:35 +00:00
hjk
0ba4338467 Utils: Rename QtcProcess::Result::Finished to FinishedWithSuccess
To make clear that this is not just any finish.

Also change FinishedError to FinishedWithError, to create
symmetry.

Also adapt enum member description to reality.

Change-Id: I13e05391eb86fdb24e2ae660f14dfddb282e1104
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-06-02 14:16:36 +00:00
hjk
73c0175f4b Vcs: Simplify VcsCommand::runCommand interface
The timeout and exit code interpreter properties are already
accessible via the SynchronousProcess parameter.

Change-Id: I1ba9c768a781009df65b5070a1d017c41d7e2663
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2021-05-17 09:10:49 +00:00
hjk
55f768e1b0 Utils: Make process results accessible through QtcProcess object
The result is fully stored in the object anyway. Using the extra
SynchronousProcessResponse structure only causes copies of
the data and complicates access on the user side in
a lot of cases.

The result bits are now also accessible individually.

There's obvious room for follow-up changes on the topic, e.g.
ShellCommand::runCommand's parameter list could shrink to
just a SynchronousProcess parameter.

Change-Id: I45aa7eb23832340be06905929280c012e1217263
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-05-14 13:19:01 +00:00
hjk
0c8d8c6b2a Utils: Don't expose Utils::defaultExitCodeInterpreter
Instead, make its behavior implicit if none is given.

Change-Id: I3c1a054751a0afe22d0f40a2fed6dd00b5aef205
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-05-11 13:15:25 +00:00
hjk
c23cdd9262 Utils: Merge {synchronous,qtc}process.{h,cpp} file pairs
Mechanical to prepare merging the actual classes.
Adapting #includes.

Change-Id: I77a2c28129287778bc870c30cb890cd26bc2e62b
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-05-10 09:47:51 +00:00
hjk
793d673f39 Vcs/Utils: Use Utils::Environment for ShellCommand
Change-Id: Ica289ab2f83d52270923c4ff4983860cfbe0b494
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-05-05 12:21:29 +00:00
hjk
dec9169efe Utils: Move SynchronousProcess::normalizeNewlines to QtcProcess
Change-Id: I5ba8ba1061b04b032aafd08382d34ccb62272829
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-05-04 07:19:55 +00:00
hjk
ce85282866 VcsBase: Remove VcsBaseClientSettings
It's replaced by VcsBaseSettings.

Change-Id: I60a0e4e267337f71e8a32b9b220565b765c973b1
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2021-03-22 09:34:52 +00:00
hjk
78b4449692 CVS: Aspectify settings
Change-Id: Ib5170405b33b3e521470407065e85c95dad6163b
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2021-03-19 14:00:00 +00:00
hjk
aa69415ac7 Git: Aspectify settings
Change-Id: I87dfeba360967cc77cc230811bcd9f67b3ea6e38
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2021-03-19 13:39:33 +00:00
Eike Ziller
c87284356c VCS: Do not write defaults to settings
Saves useless entries in settings file and makes it possible to change
defaults later.

Task-number: QTCREATORBUG-24762
Change-Id: Iee7d39f2bf5d8de6903ca914ea533a678fad62f8
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2021-02-16 16:10:30 +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
e4a639c076 Vcs: Remove unneeded VcsBaseClient::StatusItem ctor implementation
Change-Id: Idab6f76e86b9ea50b345547017640253a9183126
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2020-02-13 16:42:38 +00:00
hjk
b23dc3a0bf VcsBase: Partially move vcsTimeoutS() to VcsBaseClientSettings
It's the source of information for this, and the plan is to
ramp down and merge *Client and *BasePlugin.

Change-Id: I13f813d1f94a2bd4a704d120493a28b92443605b
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2020-02-03 17:29:50 +00:00
hjk
61837aae0a Vcs: De-pimpl VcsBaseClient
Not necessary in this case anyway, and a step towards merging
client and pluginbase hierarchies.

Change-Id: I2240afe14019b764c5bfe4dcccfb4db69bf45ad9
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2020-02-03 07:15:56 +00:00
hjk
e0072ec165 Vcs: Move settings ownership from VcsBaseClientImpl to plugin
Turns out CVS and Bazaar already had an unused copy there...

Change-Id: I512c4d6322620e2b55d9008600ac676ce09032aa
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2020-01-24 09:55:35 +00:00
hjk
01e4f573e8 VcsBase: Un-pimpl VcsBaseClientImpl
Not helpful for a single pointer.

Change-Id: Id5cfdb67533ca1852d5594d25689b2e46baca992
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2020-01-24 09:02:25 +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
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
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
Alessandro Portale
f5974ad993 Fix warning: "Don't call QVector::first() on temporary QList/QVector"
[-Wclazy-detaching-temporary]

Change-Id: I23f5cbd80bb92d3f9f1bfb5ae07493818958c5b0
Reviewed-by: hjk <hjk@qt.io>
2019-01-28 11:03:39 +00:00
Orgad Shaneh
8f65486dfc VCSBase: Modernize
override, auto, nullptr, member initializers.

Change-Id: Ie21b8f4a4d6673947d82619bc3de677fcea63d7f
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2018-09-20 07:02:17 +00:00
Orgad Shaneh
afb60d0434 VCS: Use namespace Utils
Change-Id: I41c818362398fd194995baf5b1adb16899e83217
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-07-18 08:44:45 +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
Eike Ziller
cf47f3e807 Merge remote-tracking branch 'origin/4.2'
Change-Id: Ia346d86ad5fabe9d91454ea642cbeac5ec862699
2016-10-27 12:10:26 +02:00
Tobias Hunger
4b624ba7e9 Vcs: Optionally pass binary to run
Change-Id: I33eb1ce7d874bea27979068aca310f607ec7fde8
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2016-10-25 13:39:38 +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
Orgad Shaneh
1b34f2a4b8 Merge remote-tracking branch 'origin/4.1'
Change-Id: Ia90424d479936a898705c433e5810c77ae088b2c
2016-07-22 15:18:00 +03:00
Orgad Shaneh
9fd5d64194 Remove unneeded QSignalMapper includes
Change-Id: Idec6b1357d7c1db316c8cb29e82c7c9a62e4f6d5
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2016-07-20 08:12:30 +00:00
Tobias Hunger
ca7a924a06 VCS: VcsBaseClient::vcsFullySynchronousExec returns a SynchronousProcessResponse
Change-Id: Ic155da2ed1fd36f1f91327ac90f34a5cad3c210e
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-07-15 14:16:29 +00:00
Orgad Shaneh
3845c833fc VCS: Return the editor in VcsBaseClient::annotate
Will be used in a follow-up commit for setting base line number
for limited range blame.

Change-Id: Ibae90f3ac982ebe9f53aa282f70c2c703e9eeb9d
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-06-14 07:56:55 +00:00
Orgad Shaneh
94f0839f3f VcsBaseClient: Make some functions const
Change-Id: Ia82f4ca25b59adfbc96c03c1aaed873a572e4785
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2016-05-08 19:03:11 +00:00
Eike Ziller
967177d3d8 SynchronousProcess: Change exit code interpreter to function object
Change-Id: Ic48d4f5810f171c070f0980581fb6e45f6fe6b4a
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-04-27 08:48:32 +00:00
Orgad Shaneh
a63681c1d2 VCS: Simplify editor/command connections
* Move all the connections to setCommand()
* Move gotoLine logic to reportCommandFinished

Change-Id: I67ad74820b3d20b2b5fa97edad92f0f30111166f
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2016-03-29 09:19:01 +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
Orgad Shaneh
ab80f512a0 VCS: Fix encoding for editor-related commands
For example Git Log.

Change-Id: I1d838f86dc70f000e66443eece60adc07310c8b8
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2015-09-17 10:52:47 +00:00