Commit Graph

447 Commits

Author SHA1 Message Date
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
Alessandro Portale
72d91dc94a Use qAsConst with non-const Qt containers in range-loops
... in various places

Change-Id: Ic6c0c1b9437a1ed402105c7a14a1f5f9454a68d4
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2021-02-17 14:43:29 +00:00
Jarek Kobus
d6574a6e5f DiffEditor: Rely on compiler generated constructors
Change-Id: I16527f2f971fa110ceb0b35755a1f49663ccb460
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-02-17 11:07:22 +00:00
hjk
206e9f95fb Core: Signal duplicated editors
FakeVim needs some notification even in cases where the
duplication is triggered outside the EditorManager as in
QmlDesigner's qml-editor.

Fixes: QTCREATORBUG-22344
Change-Id: Ia4950ff4b02d3f89779f03ff4c106a07ccff2106
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-01-14 08:31:44 +00:00
Jarek Kobus
48c2afe157 Decorate some classes and methods with final keyword
This way we silence the clang warnings about calling
virtual methods from c'tor or from d'tor:
[clang-analyzer-optin.cplusplus.VirtualCall]

Change-Id: I8d6318b490152133da4833bda2ba28622bce30dd
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-11-19 09:45:53 +00:00
Alessandro Portale
b2a766a79a Don't access static functions/fields via instance
Courtesy of readability-static-accessed-through-instance

Change-Id: I71f54244f1e091315dac2943d9e1bfad6efa56a9
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2020-11-19 08:42:14 +00:00
Orgad Shaneh
d02c69d1bc DiffEditor: Improve initial size of description widget
Fixes: QTCREATORBUG-24286
Change-Id: I8844b30d287fcdc5333906d00d92e00d05f5560a
Reviewed-by: David Schulz <david.schulz@qt.io>
2020-10-08 10:18:03 +00:00
Eike Ziller
03db57f524 DiffEditor: Fix Qt6 build
QStringRef is gone. QStringView::split is not available until Qt6.
Since using a ref/view might actually have a performance impact in this
case, work around this with a typedef to the available type.

Task-number: QTCREATORBUG-24098
Change-Id: I72dcb4a9c93b73e396dfb9a2760af924db809eaf
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2020-09-09 06:03:10 +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
89296a98a0 Qt6: Adapt to removed QMap functionality
QMap::iterator::operator+() was removed in 14090760a8, necessitating
extra code using std::next/prev to workaround.

QMap::unite is gone, the replacement QMap::insert was only introduced
in 5.15.

QMap key values need to have an operator==() available.

Task-number: QTCREATORBUG-24098
Change-Id: Ic4cf429ab18cad58b1218180de40eb65586afd77
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2020-08-13 12:11:36 +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
Eike Ziller
7c5ed6f7d9 Move InfoBar to Utils
The only reason it was required to be in Core plugin, was its use of Id,
which now is available in Utils.

Change-Id: I66ce863c24924e6448d339b3422538a7fe167336
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2020-06-18 06:39:54 +00:00
Christian Kandeler
92bae70432 DiffEditor: Fix leak
Change-Id: I39c73f2076420d2026bec58f5a383b27188a2720
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2020-06-17 10:59:30 +00:00
Eike Ziller
f75d1ae61a DiffUtils: Remove unused include and declaration
Change-Id: I6acfa0d964530f9309594dfd2ae18c06c2235c85
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2020-05-29 13:12:37 +00:00
Eike Ziller
e5bb7d1ffe Remove unnecessary removeContextObject calls
They are removed on deletion now.

Change-Id: I08461ea4938e24ab450df013a0f8f820032381da
Reviewed-by: hjk <hjk@qt.io>
2020-05-27 08:42:00 +00:00
Christian Kandeler
3f9e517754 DiffEditor: Fix clang warning about hidden overloads
Change-Id: Iad4cbe1f2e97b862626deeecbcec496fe3457370
Reviewed-by: David Schulz <david.schulz@qt.io>
2020-04-23 13:49:37 +00:00
David Schulz
2f53f58280 DiffEditor: add info bar for documents with encoding errors
... with the option to reload the diff document with another encoding.

Fixes: QTCREATORBUG-23835
Change-Id: I1ce07b292688059b37535f2972970d8ea91be81b
Reviewed-by: hjk <hjk@qt.io>
2020-04-15 16:41:16 +00:00
hjk
9c934ed44c TextEditor: De-QObject-ify TextEditorActionHandler
Change-Id: I8c4919b89ce35d421edd4a21a650d5e0df4a7ead
Reviewed-by: David Schulz <david.schulz@qt.io>
2020-02-10 13:54:39 +00:00
hjk
a44bfdd779 Provide an empty default IPlugin::extensionsInitialized()
And remove all empy re-implementations.

Change-Id: I19f0b4e55c042c96693ecb89766f97f0a97b54ae
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-02-07 10:21:34 +00:00
Alessandro Portale
2234c517c0 Utils: Add a non-toolbar variant of the "RELOAD" icon
New icon is: Utils::Icons::RELOAD. And the toolbar variant is now
Utils::Icons::RELOAD_TOOLBAR.

Change-Id: I811d83c7340a717968430ac1ce4a5c708c8ddcf9
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-02-07 09:22:07 +00:00
hjk
b22768e980 Diff/Vcs: Use a function object for reloading
Helps with slimming down the user code side.

Change-Id: I4b0aac76c0d1516eb05bff9c18594e64f8b41a7a
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2020-02-06 11:21:59 +00:00
hjk
ca89d1b8a6 DiffEditor: Pimpl plugin
The standard pattern, and allows to drop the QObject parent on
the editor factory which gets into the way of de-QObject-ifing
the IEditorFactory hierarchy.

Change-Id: I5c6a50f8075a99592ed4459b417ca8ba7471ae96
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-02-06 09:47:00 +00:00
hjk
d7ae3b79f8 Core: Make IEditorFactory::createEditor use a function object
Also, replace or remove unneeded Q_OBJECTs, and make base
setters and adders protected.

Change-Id: I212257ef53984d8852dc8c478537199fc9483486
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-02-05 11:41:29 +00:00