Commit Graph

345 Commits

Author SHA1 Message Date
Jarek Kobus
de1d73216e Perforce: Replace QSharedPointer with std::shared_ptr
According to https://wiki.qt.io/Things_To_Look_Out_For_In_Reviews
QSharedPointer impl is poor and it's going to be removed from Qt 7.

Change-Id: I6b48189134c741e6d8ab6bb0c94d27d4504c14b5
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2024-02-01 16:50:22 +00:00
hjk
ce1e565a10 Utils: Also rename parameteraction.{h,cpp} to action.{h,cpp}
Change-Id: I203909d9b2d460012b9347d507ac7a701700c48a
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2024-01-29 14:23:39 +00:00
hjk
66b50438d8 Utils: Rename ParameterAction into Action
It became the defacto-type for action when ActionBuilder started
creating them as default.

Change-Id: I1008d60b78ea83919ce1c80a7ef828527fe9902c
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2024-01-29 13:01:29 +00:00
Jarek Kobus
afc67468e6 Process: Get rid of setTimeoutS()
Add an extra arg to runBlocking() function instead.
Use std::chrono::seconds for timeout.

Change-Id: I7c3c21e8f26a2ccbed157d15083d6ef0b4cd2f7e
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2024-01-22 20:27:51 +00:00
Jarek Kobus
1c79724519 Perforce: Get rid of the message field from PerforceResponse struct
It's not used anymore.

Change-Id: Icfdefd38942fba1a64052339aa373c0a9254f826
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2024-01-21 21:08:25 +00:00
Jarek Kobus
b92b0d4100 Perforce: Move logging the error directly into the synchronousProcess()
Change-Id: I9d090f2da36d3868e9b4ca2a7f297be62e36e65a
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2024-01-21 21:08:20 +00:00
Jarek Kobus
a4177fb238 Perforce: Merge fullySynchronousProcess() with synchronousProcess()
Change-Id: I3b37fca5f66da521540a5dcd4e4a19ff592fa7ef
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2024-01-21 20:56:13 +00:00
Jarek Kobus
ee13281a27 Perforce: Use exitMessage() in synchronousProcess()
This is a standarized equivalent.

Change-Id: I609db7072e9eb645ca391c1eaca9a83dad40e460
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2024-01-21 20:45:20 +00:00
Jarek Kobus
c1e8688eea Perforce: Inline msgWhereFailed() helper
Change-Id: I41da19c488e3a4a72abfb5c7912fdcbc190cc603
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2024-01-21 20:45:13 +00:00
Jarek Kobus
3769c40cbb Perforce: Simplify fileNameFromPerforceName()
Drop errorMessage arg. There are 2 callers of this method
1. PerforcePluginPrivate::printOpenedFileList() was ignoring this arg.
2. PerforceEditorWidget::findDiffFile() was just printing qWarning().
   In this case, instead of printing a warning, append a relevant
   error message to the VcsOutputWindow. Note, that this is done
   in case the passed quiet is false. Once, it's done implicitly
   by the call to runP4Cmd() and passing ErrorToWindow flag.
   The second possible message is explicitly sent to VcsOutputWindow
   in case of !quiet.

Change-Id: I257d474b958b09965ffabdd09ff2e0fb253a0bf8
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2024-01-21 20:45:07 +00:00
hjk
e0dae4d0b3 Perforce: Hide plugin class definition in .cpp
Change-Id: I6ae58a937b069ccc6a9b9f411bc42178f57133e6
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2024-01-15 15:10:38 +00:00
hjk
60d1fe4cb7 All: Even less #include <QSettings>
Change-Id: Ifbb2af34169036236e6f2f7b09ef115de5c6a6c7
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-09-27 14:10:07 +00:00
hjk
256ee1c05a Perforce: Inline PerforcePluginPrivate::applySettings
... into its only user, hope is to move it into the settings proper
at some time.

Change-Id: I5877e7e19f4c3ef0ad5dba2761b12545ab59a1e8
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2023-08-10 09:25:54 +00:00
hjk
5a9cc840d5 Perforce: Allow delay-created settings
... in theory. The first argument of the connect() call in
perforceplugin.cpp:555 currently spoils the fun.

Change-Id: I041c7707264d8ba64098c37f8fbb5ee4ea1e1753
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2023-08-08 16:53:42 +00:00
Jarek Kobus
d45ece1732 Bazaar, Cvs, Fossil, Mercurial, Perforce, Svn: Simplify returns
Change-Id: Ic0d6a7510a26a4a9db180594f140156b036c5090
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2023-08-02 11:30:15 +00:00
hjk
93d96c9d75 Vcs: Code cosmetics
Drop some Utils:: and rely on some aspects' operator()()

Change-Id: I40d2c2973c1c9eff443bb74b8da44e0824d8d5c6
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-07-14 09:53:50 +00:00
hjk
28e9591052 Perforce: Use more direct check for executable presence
The !isEmpty check is actually redundant, but currently cheaper than the
diversion through FilePath::fileAccess().

Change-Id: I44e6ec128c78cccf57c7276da70577a87b8c2f96
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2023-07-10 12:03:28 +00:00
hjk
91513a53dd Utils: Make aspect settings access implicit
Generally, aspects should use fromMap/toMap, but some older pages
use {from,to}Settings with always the same ICore::settings().

To make that less intrusive on the user code side, make that globally
implicit.

Task-number: QTCREATORBUG-29167
Change-Id: I29a8e23a31eb8061bb143e93931a07c6741eb7f9
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-07-07 09:02:29 +00:00
hjk
569e73c5ed Perforce: Some more direct FilePath use
Change-Id: I78e28714fef577a9129e39b03273f3651de8adcc
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2023-06-29 12:52:41 +00:00
Eike Ziller
7bd06829c4 Tr/VCS: Fix various issues with translations
Inserting the name for the "commit" operation into messages relies on a
certain sentence structure and doesn't work with translations. Same for
"optional" error messages. Use different complete messages for the
different cases instead.

Avoid explicit line endings, use automatic word wrap instead.

Add some quotes and full stops.

Fix message with plural.

Don't use %n for constant number (inline in message with assert).

Improve confusing tool tip for instant blame.

Change-Id: Ic8453763279753ebd5898858951acddcf311e6e4
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2023-05-31 10:53:24 +00:00
hjk
c85b72000f All: Use the shorter access to aspect values in a few places
Change-Id: Ie0ff0e4e1cf4c2750897ea733dfccb743f44fa93
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-05-12 16:04:38 +00:00
Jarek Kobus
a0f6e8dc04 Utils: Rename qtcprocess.{cpp,h} -> process.{cpp,h}
Follows QtcProcess -> Process rename.

Change-Id: I97235a9a40cb7fd52944515b7ab878d96528f919
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-05-04 05:52:26 +00:00
Jarek Kobus
470c95c94b Utils: Rename QtcProcess -> Process
Task-number: QTCREATORBUG-29102
Change-Id: Ibc264f9db6a32206e4097766ee3f7d0b35225a5c
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
2023-05-04 05:52:16 +00:00
Alessandro Portale
6e24d3eec8 Translations: Fix some Tr::tr() calls
Tr::Tr::tr("Foo") would introduce extra translation contexts.

Change-Id: I43903d53d7d65677bb6b7a8bfd85eb5013c1fe6b
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-02-17 10:17:40 +00:00
Alessandro Portale
9f2f2f3390 Translations: Change translation context prefix from "::" to "QtC::"
lupdate would be confused by translation contexts starting with ::

Change-Id: Ie95e73436fd3cafc80a8e89f908efadc747e644c
Reviewed-by: hjk <hjk@qt.io>
2023-02-10 16:27:55 +00:00
hjk
118b84ffd6 Use simpler Plugin::initialize() when feasible
Change-Id: I567965d266f20526bda9f823e31a04b354d53fb1
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-01-20 12:13:10 +00:00
hjk
013ad1345e VcsBase: Proliferate use of FilePath
... and update user code.

Change-Id: I52c08e9e07238536d31fc72f97312ac582a1e32f
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2023-01-20 12:02:32 +00:00
hjk
fa7dd2fd3b VcsBase: Convert to Tr::tr
To reduce the amount of duplicated strings for translators to handle.
The problem is not very prominent in vcsbase, but that's where we
are moving everywhere else.

Change-Id: Icb11fad3bccfea8a1408420e729566a75adccb66
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2023-01-18 15:33:59 +00:00
hjk
91696f8bf3 Perforce: Tr::tr
Change-Id: Id8f4d5fbd3f20ec750bbfbbac2662e5b3a79ecd3
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-01-17 15:29:35 +00:00
Kai Köhne
56baf8c058 Remove GPL-3.0+ from license identifiers
Since we also license under GPL-3.0 WITH Qt-GPL-exception-1.0,
this applies only to a hypothetical newer version of GPL, that doesn't
exist yet. If such a version emerges, we can still decide to relicense...

While at it, replace (deprecated) GPL-3.0 with more explicit GPL-3.0-only

Change was done by running

  find . -type f -exec perl -pi -e "s/LicenseRef-Qt-Commercial OR GPL-3.0\+ OR GPL-3.0 WITH Qt-GPL-exception-1.0/LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0/g" {} \;

Change-Id: I5097e6ce8d10233993ee30d7e25120e2659eb10b
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-01-06 11:15:13 +00:00
Jarek Kobus
ce161d0b16 VcsBase & dependent: Fix const correctness
And some minor cleanups.

Change-Id: Id0c2df6865ba84c054f0fb97c0ac42a76a128355
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-12-14 16:57:14 +00:00
Jarek Kobus
0313470db0 VcsBase: Pass context object to lambda connections
Remove some unneeded lambda () brackets.

Change-Id: I20e43625793401544e86efb627f5921c395026bb
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-12-07 21:54:39 +00:00
Jarek Kobus
9381429e4f Perforce: PendingChangesDialog: Use Layouting
Change-Id: I0c4ea45f89b694df89ec304171779cb1b796280f
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-11-16 15:37:38 +00:00
Orgad Shaneh
d63bfa4a29 VCS: Simplify submit editor accept/close flow
* Replace message box with an error on the output pane.
* Separate logic for accept and close.

Change-Id: Ib9fa201a1a67ee195086f7a22bc6678a9642452a
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2022-10-25 19:19:40 +00:00
Orgad Shaneh
9b61e484be VCS: Deduplicate some submit editor closing logic
Change-Id: I622f5703c222a48606fcca3b99e87f9398e6a815
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2022-10-17 16:37:26 +00:00
Orgad Shaneh
eaad78547c VCS: Remove "Prompt to submit" settings
Task-number: QTCREATORBUG-22233
Change-Id: Ifbfd738281066af7913357ff9e2466a6c983452c
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2022-10-17 16:37:17 +00:00
Orgad Shaneh
82b2b2cae9 VCS: Fix misuses of parentDir().absolutePath()
absolutePath() *is* the parent directory.

Change-Id: I59f2c4ae65b265270d432f381258b95c65e53581
Reviewed-by: hjk <hjk@qt.io>
2022-10-11 13:49:50 +00:00
Jarek Kobus
b8efc2f14d VcsBase: Use FilePath in editorTag()
Change-Id: I4093fa46a51767afd00a8de2f94986c708dc1efa
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-10-06 12:06:03 +00:00
Lucie Gérard
a7956df3ca Use SPDX license identifiers
Replace the current license disclaimer in files by
a SPDX-License-Identifier.

Task-number: QTBUG-67283
Change-Id: I708fd1f9f2b73d60f57cc3568646929117825813
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-08-26 12:27:18 +00:00
Jarek Kobus
f330a7b1e9 QtcProcess: Make timeoutS a default arg of 30 seconds
Change-Id: Id11911e74ede109b49583d82592b333ad577e8ee
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-07-11 10:21:46 +00:00
Jarek Kobus
61258bd658 QtcProcess: Get rid of unneeded arg from readDataFromProcess()
Change-Id: Ifecf7b4a9668bc362e454a6e5084eb1d7308e4eb
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-07-11 10:21:38 +00:00
David Schulz
153ff77a6b Utils: use cleaned stdout all over the place again
Amends 5ee880ce5e

Change-Id: Ie0202db7d8455372c3697087d9571db6706b45a1
Reviewed-by: hjk <hjk@qt.io>
2022-06-17 13:04:42 +00:00
hjk
152b14207c Replace QtcProcess::stopProcess() by stop() plus waitForFinished
... or nothing, if the process object is destroyed immediately.

Change-Id: I6a1e1928bc49fc20a1c0e0ee9b8f4f723276bbca
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2022-06-16 08:26:10 +00:00
Artem Sokolovskii
30e60e9979 macros: Remove foreach / Q_FOREACH usage
Task-number: QTCREATORBUG-27464
Change-Id: Id779aaf869406571288519083883ab57e5c29cec
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
2022-06-03 07:58:05 +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
5127d155d2 QtcProcess: Get rid of setProcessUserEventWhileRunning()
Introduce EventLoopMode enum and pass it to the
QtcProcess::runBlocking() instead. There is no need to
store this setting. By default this value is NoEventLoop.

Change-Id: Icad98b77bec5280b79039b7e5aa4ec408261521c
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-01-25 08:44:11 +00:00
Jarek Kobus
d6f56254d1 Get rid of QtcProcess::workingDirectory() overload
Adapt all callers' code so that it passes the FilePath
instead of QString. As a consequence introduce
TemporaryDirectory::masterDirectoryFilePath() and use
it where easily possible.

Change-Id: I14564949b3b916921e32a2957c84c03d1da43af2
Reviewed-by: hjk <hjk@qt.io>
2022-01-18 17:18:34 +00:00
Eike Ziller
195abefe7d EditorManager: Remove QString openEditor(At) overloads
In favor of the FilePath/Link ones.

Change-Id: I5caf9e0f8de304ff4ee12329557aa50a6f3a0c69
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-11-02 08:11:14 +00:00
Orgad Shaneh
d76c9bec06 Perforce: Update document permissions after p4 edit
Task-number: QTCREATORBUG-22447
Change-Id: I9d521c17409e082b66141ba607fc0256d78798b7
Reviewed-by: hjk <hjk@qt.io>
2021-10-13 17:39:02 +00:00