Commit Graph

469 Commits

Author SHA1 Message Date
Jarek Kobus
38b19bfae6 DiffEditor: Cleanup includes
Change-Id: Id8127b9b0c99ee2a0d5d367cb551a1d5779c5d38
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-09-29 15:15:12 +00:00
Jarek Kobus
67121e6cd3 DiffEditor: Fix scrolling to current file after reloading
This feature got broken during recent refactorings.

Change-Id: I9d2d24e7ed63d5512b64c53e4bb9303497871d5e
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-09-29 11:03:27 +00:00
Jarek Kobus
6ea3aad0a2 UnifiedDiffData: Remove unused charNumber argument
Change-Id: I40331b4471a1aa716003943ecfb92a9ee7a4e406
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-09-28 20:30:34 +00:00
Jarek Kobus
084c310c44 UnifiedDiffData: Rename setDiff into diffOutput and make it static
Conform to sibling struct SideDiffData.

Change-Id: I7630ec7480c34a94f17ef09904e332da768f0c37
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-09-28 20:30:30 +00:00
Jarek Kobus
53fc68bc08 SideBySideDiffEditor: Move showing diff into separate thread
Change-Id: I8b0a4835cf6f51e4acfd483dcfc7b94585c64bf5
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-09-28 20:30:25 +00:00
Jarek Kobus
83be3443de SideBySideDiffEditor: Avoid code repetition
Change-Id: I48d42bd4a6134b24df8bec4239678e7db32ad3e0
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-09-28 18:11:23 +00:00
Jarek Kobus
15fd4a0754 UnifiedDiffEditor: Avoid code repetition
Change-Id: I2e361b29c3d35fe5128b6b5a4a90b6c4ee0de432
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-09-28 18:11:17 +00:00
Jarek Kobus
472d791fec DiffEditor: Use DiffSide in DiffEditorInput
Change-Id: I195c37f29884f1d066acbb54c8ace07f8801f829
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-09-28 18:11:10 +00:00
Jarek Kobus
6ec7ce539b UnifiedDiffEditor: Move setting folding markers into thread
Change-Id: I4fc6f08039813c08e70a6798f65abcea219558be
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-09-28 18:11:03 +00:00
Jarek Kobus
f66320c413 DiffEditor: Simplify DiffSelection
Change-Id: I9de3774fafa9f257974a4231a83b64f375291d87
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-09-28 18:10:32 +00:00
Jarek Kobus
3877ced865 DiffEditorPlugin: Add SideBySideDiffOutput
Move generation of SideDiffData into static diffOutput()
method.

Change-Id: Ie38b3e09dd8222e0219fdfb345bc7cf4a39f6e21
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-09-28 18:10:26 +00:00
Jarek Kobus
0def7c83d4 DiffEditorPlugin: Various cleanups
Change-Id: Ic0c9c397067b899932bc39d938e63df36fa4caeb
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-09-28 18:10:02 +00:00
Jarek Kobus
e67e2121a7 UnifiedDiffEditor: Move polishing selections into working thread
In case of big commit (like 05c35356ab)
polishing selections took about 200 ms. Move this work into
thread to avoid extra 200 ms freeze of GUI thread.

Change-Id: If159e3f0869264f467c4c015f944a3054609f812
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-09-28 17:13:49 +00:00
Jarek Kobus
2f0ec75284 SideBySideDiffEditor: Refactor internal data
This is a preparation step before making diff showing more
interactive.

Change-Id: I15ab0583af6e4a2655b39b8ae3fb7da10ac245f0
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-09-28 15:48:47 +00:00
Jarek Kobus
91c4e06712 DiffEditor: Use DiffSide enum inside ReloadInput
Change-Id: Ib81eebdaf58686f27e8663787be5974aab46ce22
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-09-28 15:48:40 +00:00
Jarek Kobus
f3a7299761 DiffEditor: Use DiffSide enum inside FileData
Change-Id: I4c18c52a9737cc46c3faeadf0abd5c4771463e0e
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-09-28 15:48:34 +00:00
Jarek Kobus
6dc412e255 DiffEditor: Use DiffSide enum inside ChunkSelection
Change-Id: If23b0f46856eebec96624e58b6ad90b1b3e8be23
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-09-28 15:48:24 +00:00
Jarek Kobus
a1c4d563a1 DiffEditor: Use DiffSide enum inside RowData
Change-Id: I5511e443e2f76a1dab5cc78eec5faec04ee31bcc
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-09-28 15:48:16 +00:00
Jarek Kobus
cd8ff54b00 DiffEditor: Use DiffSide enum inside ChunkData
Change-Id: Ic10fe9faa6b6ccefcbf4c062663dedefa6bf5872
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-09-28 15:48:08 +00:00
Jarek Kobus
b4390a3a80 DiffEditor: Introduce DiffSide enum
This should simplify various diff structs.

Change-Id: Ia8c77de558a92a2a64fc13c674a46192521970f0
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-09-28 15:47:49 +00:00
Jarek Kobus
054d7d65d2 UnifiedDiffEditor: Move showing diff into separate thread
Before, when all the data was finished, we called showDiff()
in main thread. This consisted of 2 parts:

1. Calculating some extra data and generating actual text
   for UnifiedDiffEditor out of input data.
2. Calling setPlainText() with generated text.

For a really big diffs this could freeze the main thread for a
couple of seconds. Like e.g. 05c35356ab
(initial Creator import) - it contained 7 million characters,
part 1. took about 500 ms and part 2. took about 2.5 seconds.

This two tasks are now done in separate thread.
However, since we can't call TextEditorWidget::setPlainText()
directly from non-GUI thread, we create a separate
TextDocument object in the worker thread, fill it with
generated diff input and move the TextDocument object
into the main thread as a result of async computation.
In main thread we replace TextDocument object of the
TextEditorWidget with the one generated in other thread.
This replacement is very fast.

Change-Id: I49a717ced1dc2d5b8946e0fd6bee244b25071f35
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-09-28 15:47:39 +00:00
Jarek Kobus
8d284c222c UnifiedDiffEditor: Refactor internal data
This is a preparation step before making diff showing more
interactive.

Change-Id: I149b76466c3ccce05d823bac91fe89ac806b9130
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-09-22 11:38:57 +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
d96bfdff84 DiffEditorWidgetController: Use Utils::Guard
Change-Id: I3d3e22ce26c85859eb8024f2b87c7c85c5ac65f1
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-07-25 13:02:43 +00:00
Jarek Kobus
e32ebe2146 Drop Qt5: Various plugins: Get rid of QOverload
Change-Id: I4913044f8897fd3449dbb537e4af6785eb3ad447
Reviewed-by: hjk <hjk@qt.io>
2022-07-20 13:52:38 +00:00
hjk
d842862944 Utils: More porting.h related changes
Change-Id: I528a6950dfa6e09eb7f7ada265c8c41dba816bfd
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-07-14 12:04:25 +00:00
hjk
802de0eb5e Utils: Collapse most of porting,h
Taking the Qt 6 branches, leaving some dummies until downstream
adapted.

Change-Id: Ib9b86568d73c341c8f740ba497c3cbfab830d8a1
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-07-13 09:44:09 +00:00
hjk
9e363c6421 Add plugintr.h files to all plugins
Except FakeVim, which had it before.

for i in [a-eg-z]*/*.json ; do
    upper=${i##*/}
    upper=${upper/.json/}
    lower=${i%/*}
    trfile=$lower/${lower}tr.h

    cat << EOT > $lower/${lower}tr.h
/****************************************************************************
**
** Copyright (C) 2022 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of Qt Creator.
**
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3 as published by the Free Software
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
** included in the packaging of this file. Please review the following
** information to ensure the GNU General Public License requirements will
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
**
****************************************************************************/

namespace $upper {

struct Tr
{
    Q_DECLARE_TR_FUNCTIONS($upper)
};

} // namespace $upper
EOT

    git add $trfile

    perl -pi -e "s/(${lower}_global.h)/\1\n    ${lower}tr.h/"  $lower/CMakeLists.txt

    perl -pi -e "s/(\"${lower}_global.h\",)/\1 \"${lower}tr.h\",/"  $lower/$lower.qbs

done

Change-Id: I15ebbaaa9443c57b391b9e143f592d8a0c9208a9
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-06-27 13:34:57 +00:00
Jarek Kobus
457fe4eb87 DiffEditor: Drop Utils:: prefix when using namespace Utils
Change-Id: I640447bcd90bba4281b2b945f53c54040060d3bc
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-06-08 09:16:42 +00:00
Cristian Adam
88781a003f CMake: Qt Creator Static build support
This adds the build system feature that allows Qt Creator's libraries
and plugins to be compiled statically.

Fixes some symbol clashes when all plugins are linked into the same
executable.

Support for actually loading static plugins will be added in a separate
commit.

The feature is controlled by QTC_STATIC_BUILD which by default is OFF.

Change-Id: I1fab7953c43e42dc75619e35660029ee067106df
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-04-29 07:16:53 +00:00
Orgad Shaneh
be1f89c93c DiffEditor: Fix git diff parsing for rename + mode change
Sample output:
diff --git a/projects/cosign/build.sh b/projects/argo/build.sh
old mode 100755
new mode 100644
similarity index 88%
rename from projects/cosign/build.sh
rename to projects/argo/build.sh
index 87d865d2..14b8885c
--- a/projects/cosign/build.sh
+++ b/projects/argo/build.sh
@@ -13,7 +13,8 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 #
 ################################################################################

+$SRC/cncf-fuzzing/projects/argo/build.sh
+

-compile_go_fuzzer github.com/sigstore/cosign/test FuzzGetPassword fuzz_getPassword gofuzz

Change-Id: Ifa66dfdb80b309d72f524f15c681823ab7e133ba
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2022-02-07 12:56:40 +00:00
Eike Ziller
c6fdb66b2b Collect Qt Creator debug menu items into common submenu
instead of spreading them over the place.

- rename "Logger..." to "Show Logs..."
- create "Tools > Debug Qt Creator" menu and put "Show Logs", "Inspect
Language Clients" and "Inspect C++ Code Model" there
- add missing ellipsis

That gets rid of the otherwise not useful "Language Client" submenu, and
creates a nicer place for the "Show Logs" item.

Change-Id: I2588b4c93327669579979dfbfce37005ada29dab
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2022-01-26 12:59:21 +00:00
Eike Ziller
9d8a419d10 Remove qmake build files
Removes qmake as a build system for building Qt Creator itself.
Keep them for some tests that are not completely moved to CMake yet.

Change-Id: I846c6ef65626b6dfae6375fdc85d00677aa8c2fb
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-01-20 12:18:15 +00:00
Eike Ziller
3749cfc896 InfoBar: Make adding more buttons possible
Change-Id: Ic0c946cf3f87fe46cd06391f38e0bc71374ad340
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2022-01-18 09:33:20 +00:00
Eike Ziller
d422b408e0 Merge remote-tracking branch 'origin/6.0'
Conflicts:
	cmake/QtCreatorIDEBranding.cmake
	qbs/modules/qtc/qtc.qbs
	qtcreator_ide_branding.pri

Change-Id: I32991a77e52831dd2e24cf4a51ec252998c2d743
2021-12-09 12:04:32 +01:00
Jarek Kobus
b6a996a8d5 DiffEditor: Assert that we are operating on non-null documents
Task-number: QTCREATORBUG-26594
Change-Id: I4331c457a6360682229dbbbfd8ac3d50b44b8ead
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-12-07 08:36:56 +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
David Schulz
c00330f905 Editor: multi cursor support
Adding a way to create multiple cursors that can insert/remove text at
arbitrary positions in the document. Adding cursors is done by pressing
alt + up/down or by clicking into the editor while holding the alt key.

Fixes: QTCREATORBUG-16013
Change-Id: I495d27d95a3d277220946616ef30efc241da0120
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Artem Sokolovskii <artem.sokolovskii@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-09-27 10:56:54 +00:00
hjk
1167f0fac7 Core: FilePath-ify DocumentManager
And adjust users.

Change-Id: I10ca9aeb442a07f7c8d42af362b294aa3398f5c1
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-09-22 09:10:29 +00:00
hjk
4bf6008158 Vcs: Use FilePath for working directory in DiffEditorController
Change-Id: I7b5e1349bc679bd90b7781fbe0b40485ec653473
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2021-08-20 15:06:26 +00:00
Christian Kandeler
20a4afaaa4 Fix build
Change-Id: I76c03a364a8b3d9734ced3c948997dcfb5c0e685
Reviewed-by: hjk <hjk@qt.io>
2021-08-17 13:26:41 +00:00
hjk
8885ef7e5a Utils: Pass dialog parent to Utils::* file dialog
Amends 3edc5673b5.

Turns out quite a few potential uses have other parents than
ICore::dialogParent().

Use a nullptr parent to mean ICore::dialogParent() to keep the
caller side simple.

Change-Id: Icfe1daafd710ae273d286679e0c8e2a3a27da552
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-08-17 12:54:08 +00:00
hjk
59c01481d1 Core: PatchTool code cosmetics
Some more FilePath use, QLatin*, static, ...

Also fix default settings values, amends e2eab0e0 insofar.

Change-Id: I8e40ca9629351db3b3095636b4ea29a204f86da6
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2021-08-17 11:55:11 +00:00
hjk
2f44449a90 DiffEditor: Remove workingDir parameter from setDiff()
It was not used.

Change-Id: I33a77f4d8238218b90171a98aa25af5b31b17eb3
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2021-08-17 11:22:45 +00:00
hjk
b8f369c436 Use the new file dialog wrappers in some places
Change-Id: I326c883f2f76593e6fcb0f3e376d387273312982
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-08-06 08:56:51 +00:00
David Schulz
410b02f8c5 Core: filepathify expected document changes
Change-Id: Ifa9341e55c79459db9ecef3c441da9b2816695bf
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-06-17 06:30:51 +00:00
hjk
76db1e3746 Core: Add FilePath based overloads to EditorManager::openEditor{,at}
Part of the overall FilePath migration. Keep the original version for
a while to allow using code to catch up.

Change-Id: Ia7c5ea14416a06e679e8661c0e4045981db87b9b
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-05-25 09:55:50 +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
8b7a90ac51 Utils: filepathify TextFileFormat
Change-Id: I6a4e2d38b0bbdec661a4a492901d9182a9f2e502
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-05-18 12:35:49 +00:00
David Schulz
2727016f1d DiffEditor: Use unique action group id
Change-Id: I36e381518250b00cc8cbd9ac8630b2aa5c2fc631
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-04-19 10:56:18 +00:00