Commit Graph

1213 Commits

Author SHA1 Message Date
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
David Schulz
665c090039 Core: filepathify IDocument
Change-Id: I364a80d070c5f90433309c281c4906ee101a1a1a
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-05-19 09:45:22 +00:00
David Schulz
a13aef759e Utils: filepathify fileutils
Change-Id: Ic9048369f64d793f5f567cdb0c715488fb5a4ff6
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-05-18 14:30:53 +00:00
hjk
6830328ecf Utils: Drop SynchronousProcessResponse
Move the remnaining two members into QtcProcessPrivate, its
only user.

Change-Id: I8e0c23e1a56b36b750b5b4bd4e88d762260e42a1
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-05-17 11:49:11 +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
f2f40efa03 Utils: Move process arguments class out of QtcProcess
The main QtcProcess interface is nowadays a CommandLine, with no
explicit references left to QtcProcess::Arguments and related static
helper functions, so it only clutters the QtcProcess class interface

So move these items out of QtcProcess, later potentially to a separate
file pair.

Change-Id: I45c300b656f5b30e2e2717232c855fdd97c2d1d7
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-05-11 09:45:24 +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
c262f40b67 Utils: Re-do Replace SynchronousCommand::flags by a named bool
The potential extensibility was never used, and a similar use case
in QtcProcess (setLowPriority()) used a named setter.

Change-Id: I87d84ea2206995d5069265f8df78f40cf2ba8a36
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2021-05-07 14:09:56 +00:00
hjk
635993fbdc Revert "Utils: Replace SynchronousCommand::flags by a named bool"
This reverts commit c617632e4d9291f1b50ec0c7e1a914a6a689284e.

To early, dependencies missing.

Change-Id: I91433aebbaf2c04cbb212585deb3cde5f3208974
Reviewed-by: hjk <hjk@qt.io>
2021-05-07 08:35:58 +00:00
hjk
9a7a0098a3 Utils: Replace SynchronousCommand::flags by a named bool
The potential extensibility was never used, and a similar use case
in QtcProcess (setLowPriority()) used a named setter.

Change-Id: I77d84ea2206995d5069265f8df78f40cf2ba8a36
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2021-05-07 08:24:18 +00:00
hjk
8b4cd1e0aa VcsBase: Use QtcProcess in VcsBaseSubmitEditor
Replaces uses of SynchronousProcess helper functions.

Change-Id: I015306a7265248253bc37b297600adf746be9f5d
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2021-05-05 12:27:23 +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
Eike Ziller
3d1ad9db60 Merge remote-tracking branch 'origin/4.15'
Change-Id: I1d13f3543ab4bb17f0cbfe26bbea3f154f856ca6
2021-04-20 10:42:55 +02:00
Andre Hartmann
3d4b5c0269 VCS: Fix second line commit message verification
For commit messages consisting of only two lines, no
warning was shown when the second line was not empty.

Now a warning is print for:

 First
 Second
 Third

as well as:

 First
 Second

Change-Id: Ibf19bc46465446f1634f9fdc783bd194b837d5ec
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2021-04-17 17:41:33 +00:00
Eike Ziller
c0cfafdd3d Merge remote-tracking branch 'origin/4.15'
Conflicts:
	cmake/QtCreatorIDEBranding.cmake
	qbs/modules/qtc/qtc.qbs
	qtcreator_ide_branding.pri
	src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp

Change-Id: I403b236c40d73a61ae22304e289e9d4374366395
2021-04-06 15:17:40 +02:00
Robert Löhning
cd0a140bde Improve translatable strings
Change-Id: I0104209bb0f865a48f9ca2524f62457f7524bba9
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2021-03-25 16:53:40 +00:00
Alessandro Portale
3f265c37c6 VcsBase: Avoid extra 1-pixel frame around SubmitEditorWidget
Change-Id: I394bbce04f0feed01f917f81ce075a83776b71a4
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2021-03-25 12:23:11 +00:00
Eike Ziller
b213c87cf4 Merge remote-tracking branch 'origin/4.15'
Conflicts:
	src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp

Change-Id: I722a94f37bdd1d78625cfae503ba6d02ff083c63
2021-03-25 11:06:59 +01:00
hjk
46b1ac7d5b VcsBase: Actually write changed settings
Amends 8e507c215.

Change-Id: I245ef15be159039cee44cc2e1ea9dcafccb13bd0
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2021-03-25 04:52:57 +00:00
Alessandro Portale
13741671a6 VcsBase: Fix swapped defaults for lineWrap and lineWrapWidth
Also the types differ.

Change-Id: Ib514dd07ffdf6186d46c015f32160ed337127464
Reviewed-by: hjk <hjk@qt.io>
2021-03-24 15:52:13 +00:00
hjk
8e507c215b VCS: Aspectify common settings page
Change-Id: Ib860e40ba476b428c92766312bced2950d0390ac
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2021-03-24 11:58:58 +00:00
hjk
a694487711 Utils/VcsBase: Move ability to specify group settings keys to base
Merge it with the read/writeSettings implementation that was already
there.

Change-Id: I25dfbdf6fd1cf122b17f89eae82cb2598d8470c8
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-03-24 10:14:25 +00:00
Eike Ziller
e9bf841dc9 Fix lupdate issues
Some wrong tr calls / missing tr functions.
Some places where we need to bring lupdate to the right track with
regard to namespace resolution.

Change-Id: Idf552054a34e24d9671db68c816bf37f4d403dbc
Reviewed-by: hjk <hjk@qt.io>
2021-03-22 15:00:37 +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
hjk
61b278fe6e VCS: Allow VcsBaseEditorConfig to operate on aspects
Change-Id: Id7b5b1a1020ea002e631e401c49b8eda6dfb8944
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2021-03-16 07:18:50 +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
Eike Ziller
d2f7bea0b6 VCS: Remove reading of very old settings
Change-Id: Id75da5d764c0ea65942c49324c2db6d033cf62a1
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-02-16 16:10:17 +00:00
Andre Hartmann
8c92f40db8 VCS: Add commit message verification
Help writing good commit messages by verifying
that the complete message is not too short,
that the first line (subject) is not too long
and that the subject is separated from the rest
of the commit by an empty line.

Change-Id: I296c036433767f2508630f409c0e4b4c241391d1
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2020-12-23 15:26:55 +00:00
Eike Ziller
3f0e7bcbe1 Merge remote-tracking branch 'origin/4.14'
Change-Id: I9d1931b7862f4541ac7a064ff987128afd835cbe
2020-12-07 12:29:44 +01:00
Andre Hartmann
1d9be08e90 Git: Pass only project path to Init Repository dialog
It makes no sense to have the project file here,
and under Windows it even creates confusion
as you have to delete the project file name
from the "Get Existing Directory" dialog.

Change-Id: I51887d5665b4c61b507d64f8bdcc50f3d10c49c4
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2020-12-06 17:43:38 +00:00
Eike Ziller
41b73594ad Add API for saving settings with default value
We should never actually write default values into the settings, because

- if the default value changes in a later Qt Creator version, the new
  default should automatically take effect if the user didn't change the
  value
- it senselessly grows the settings file

Add a QtcSettings class that extends QSettings by a
"setValueWithDefault" method, which does not write default values to the
settings, and actually removes the settingskey if the user switches back
to the default.

Use it at the places where we already do this manually.

Task-number: QTCREATORBUG-24762
Change-Id: Ia76414cb21e8521f3aeed1e37b43ae4fb3393ea3
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2020-12-04 08:25:17 +00:00
Jarek Kobus
d2e1feceac Don't clash signal names with other methods
In case when signal name clashes with other method name -
rename accordingly.
Remove some repeated signal declarations - they are already
declared in superclass.

Change-Id: Ie1430b85d6436d26996494fa44c7554fb354b6ce
Reviewed-by: hjk <hjk@qt.io>
2020-11-18 12:20:43 +00:00
Orgad Shaneh
7e4364fb70 VCS: Do not focus on the pane every time it becomes visible
Fixes: QTCREATORBUG-24425
Change-Id: I727913eeeae34e6d656bfc5b17a737c5bcbffe88
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2020-10-09 05:23:28 +00:00
Christian Kandeler
b55825a420 ProjectExplorer: Clean up variables
Global variables with names such as "CurrentProject*", "CurrentKit*" etc
are harmful, because the term "current project" as used in Qt Creator
does not refer to the "active project", but simply stands for the
project that contains the node that is currently selected in the project
tree, which in turn may or may not correspond to the current editor
document, depending on the "sync with editor" setting. In other words,
the "current project" is almost a random value with little meaning
outside the project tree itself.
Therefore, we remove "CurrentProject*" and friends, except the ones that
are currently intentionally in use. The latter get renamed to
"CurrentDocument:Project*", so their purpose becomes clear. Their old
names are kept around for backward compatibility, but are not suggested
by the variable chooser anymore, so new usages are unlikely and we can
remove them at some point.
We also add some ActiveProject* variants that have been requested in the
past.
Also remove the "CurrentSession" prefix that was deprecated six years
ago.

Fixes: QTCREATORBUG-12724
Fixes: QTCREATORBUG-24606
Change-Id: Ibba5d0e0ce3d2beb444a5eec01fbb9b745d90a1d
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-10-02 07:49:08 +00:00
Eike Ziller
4dc9d92b1e Remove unneeded QStringList forward declarations
Fixes build issue with Qt6, for which QStringList is now a
QList<QString>.

Task-number: QTCREATORBUG-24098
Change-Id: I0c81aa5bae413b836dbedea0bb6117b46f6f24c2
Reviewed-by: hjk <hjk@qt.io>
2020-09-29 08:58:12 +00:00
Eike Ziller
423ea729f8 Merge remote-tracking branch 'origin/4.13' into master
Conflicts:
	cmake/QtCreatorIDEBranding.cmake
	qbs/modules/qtc/qtc.qbs
	qtcreator_ide_branding.pri
	src/plugins/mcusupport/mcusupportoptions.cpp

Change-Id: I3fd0d0a6a3ff30bb990da3dc0f78e69f9e1247ef
2020-09-23 10:11:44 +02:00
Kai Koehne
71e2138517 Fix copyright/license of vcsconfigurationpage.cpp
The copyright and license was changed as part of the 397e7f48
mass change, arguably by erroneously copying it from
imageviewer/imageview.h or imageviewer/imageview.cpp.

Fixes: QTCREATORBUG-24620
Change-Id: I1f6a631c3b0a437af862d929a921693db367cef2
Reviewed-by: Denis Mingulov <denis@mingulov.com>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-09-21 12:33:35 +00:00
Eike Ziller
f8ae051816 VCS: Fix build with Qt6
QStringRef is gone.

Task-number: QTCREATORBUG-24098
Change-Id: I38dd1602294fcabf5cf7c1553bcfd93f3c47b601
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2020-09-21 06:56:58 +00:00
David Schulz
339db00f85 Core: replace QString with Utils::FilePath to get documents
Change-Id: I01777c227398be8bd3bf877c5429b84a75aa361b
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-09-04 10:14:14 +00:00
hjk
6c590531b0 Small Qt 6 migration stuff
- qsizetype vs int
- QJsonValue vs QJsonValueRef
- #include for metatype system

Task-number: QTCREATORBUG-24098
Change-Id: I066d9e3d5c35766b8aa3adc1c5835b23feb20b37
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-07-29 14:03:19 +00:00
Christian Kandeler
a54d24d497 VCS: Fix unit tests
... when building with cmake or qbs.

Change-Id: Ib3a04da6e145a21e60488dab80c5fde86eaaa06b
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-07-27 13:56:14 +00:00
hjk
43b658e9e7 Utils: Drop Utils::SkipEmptyParts again
We require Qt 5.14 nowadays.

Change-Id: Iff245257d3cb19207007c0445ee13814e66152dd
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-07-21 12:42:27 +00:00
hjk
e1c88116b3 Core/Utils: Migrate further to Utils::Id
The coreplugin/id.h header is kept for downstream for now.

Change-Id: I8c44590f7b988b3770ecdc177c40783e12353e66
(cherry picked from commit 430a33dcd9)
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-07-06 11:15:18 +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
611a3bb68a Even more Qt6 porting
Task-number: QTCREATORBUG-24098
Change-Id: Ib6ef0e521483153c9716c9a1870072e836d6b026
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-06-23 11:24:44 +00:00