Commit Graph

59 Commits

Author SHA1 Message Date
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
287a7c9268 VcsBase: Introduce vcsExecWithHandler()
Before, vcsExec() returned already started VcsCommand.
Later, callers of vcsExec() were establishing connections
to the retured VcsCommand::done() signal. However, when
process fails to start (e.g. because of non-existing
executable), the done() signal may be emitted synchonously
from inside VcsCommand::start(). In this scenario
callers of VcsCommand could miss the emission of done()
signal and connect to already finished command.

Instead, provide a vcsExecWithHandler() function which
takes a handler to be called when command finished.
In addition it takes the context object, too.
Don't return VcsCommand from vcsExec() anymore.

Change-Id: I2fb5fbe5d27632ea039c650d37e5d7d1b60cebc0
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-12-09 10:29:04 +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
Marc Mutz
8eb4d52342 Port from qAsConst() to std::as_const()
We've been requiring C++17 since Qt 6.0, and our qAsConst use finally
starts to bother us (QTBUG-99313), so time to port away from it
now.

Since qAsConst has exactly the same semantics as std::as_const (down
to rvalue treatment, constexpr'ness and noexcept'ness), there's really
nothing more to it than a global search-and-replace.

Task-number: QTBUG-99313
Change-Id: I88edd91395849574436299b8badda21bb93bea39
Reviewed-by: hjk <hjk@qt.io>
2022-10-07 13:47:53 +00:00
Alessandro Portale
928a7d2087 Git: Convert to Tr::tr
Change-Id: I7fb1753109a9263c70c01713f5f4895db6b73662
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2022-10-06 12:32:58 +00:00
Jarek Kobus
b795bd8042 VcsPlugin: Use VcsCommand::done() signal instead of finished()
Conform to QtcProcess interface. Use result() when needed.

Change-Id: Idd4c71d9a103e8649b08ec7787c2f286423a31ec
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-09-20 10:41:35 +00:00
Eike Ziller
04e50438eb Utils: Remove Utils::optional
Since we are now requiring macOS 10.14 we can remove our local
implementation of optional and use std::optional for macOS too.

Change-Id: I2bd018261b68da64f7f031a812045dd7784697e1
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2022-09-01 06:58:04 +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
60302debd7 Move ShellCommand into VcsBase plugin
Rename it to VcsCommand. Move also ShellCommandPage into
VcsBase plugin.

Change-Id: I335ac47e3090f2be497643ebcda0eaad2987ac81
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-08-01 14:33:06 +00:00
Jarek Kobus
89e7201048 VcsBase: Hide VcsCommand class
Make it an implementation detail.
Introduce VcsBaseClient::createVcsCommand() method instead
for instantiating VcsCommands.

Replace all occuriences of VcsBase::VcsCommand in public API
with Utils::ShellCommand.

Change-Id: Ie438cc3a5e867b3ee8f9e935b56b2f16ea453f8a
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-07-13 16:01:28 +00:00
Jarek Kobus
0490e3426d ShellCommand: Merge VcsCommand::VcsRunFlags into RunFlags
Use ShellCommand class name in signal-slot connections.

Change-Id: Id50ee6887708558a2ba0972ece6c420b0be36f72
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-07-12 14:49:10 +00:00
Orgad Shaneh
dd70101d7b Git: Block branch refresh for actions that open a new editor
Refresh is called twice - first time when the editor is just opened, on
this call the repository can be either empty, or the active project (even
if the current file is from another repository). After the editor is
initialized, setSource is called, and the state is recovered.

But between these 2 calls, m_repository is empty, and synchronous actions
are still executed (and fail).

Fixes: QTCREATORBUG-26952
Change-Id: I1767b35f0e9f24da2c447d0b565b410742c560d9
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Reviewed-by: Robert Löhning <robert.loehning@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2022-02-06 06:20:28 +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
11f574fef9 Core: Unify INavigationWidget creation a bit
Move toolbutton creation/listing closer to the widget.

Change-Id: I0e1342ede40fada1c5c9fb0b11d77852b78cc053
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-05-18 08:35:28 +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
Andre Hartmann
7883110e45 Git: Clarify rebase and merge actions in branch view
While merge should be clear, it's sometimes
hard to understand which branch is rebased
on top of the other.

Let's be explicit and state that in the
context menu.

Change-Id: I9755a9220a0a5930ce96893e2fad06221d449d9c
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2020-12-27 14:59:08 +00:00
Andre Hartmann
2bc736a4f7 Git: Do not refresh branch view when hidden
Change-Id: Ia2e327b6396657255f9b40b792d794a647fc5745
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2020-10-27 13:56:14 +00:00
Orgad Shaneh
52d1b31a67 Git: Enable push also for detached HEAD
Task-number: QTCREATORBUG-24508
Change-Id: I326b701c79b21f2d4495d752c7928fadd80901d9
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2020-09-30 08:40:57 +00:00
Orgad Shaneh
14e3a379c1 Git: Suggest branch name based on the commit subject
... when the checked out commit is not a remote branch.

Fixes: QTCREATORBUG-24006
Change-Id: I175a3aedba88bd9e3b5cf298c5c161c56e9d0acd
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2020-08-04 20:23:45 +00:00
Andre Hartmann
c217b2c94a Git: Use multi-arg as recommended by clazy
Change-Id: I4be0341407a318bdd797744add4c6c94d5a4e01b
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2020-05-09 18:08:44 +00:00
Andre Hartmann
a59420a9c3 Git: Improve the Checkout > Create Branch > Add dialog
Suggest a local branch name here also.

Fixes: QTCREATORBUG-23797
Change-Id: I16228507858380bc2ff6dc8590279155624d3d28
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2020-04-04 19:26:52 +00:00
Lars Knoll
47e576528e Port QtCreator over to use filterRegularExpression
QSortFilterProxyModel::filterRegExp is going to go away in Qt6,
so port over to use QRegularExpression instead.

This required some changes where setFilterWildcard/FixedString()
was being used, as those would instantiate QRegExp based filters
in Qt 5, and will use QRegularExpression in Qt 6. Use the generic
setFilterRegularExpression here, to keep things portable between
5 and 6.

Change-Id: I6379be781aa3821b10ba783c088f82c1a0970911
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-04-01 20:36:49 +00:00
Orgad Shaneh
7c4f0a9b1e Git: Store singleton instance in GitClient
On many cases, GitPlugin is not required at all, and is only used as
a proxy for GitClient.

Change-Id: I246012658ab3e8c7a12f1a459b1b1748ff358e0b
Reviewed-by: hjk <hjk@qt.io>
2020-02-26 10:29:27 +00:00
Andre Hartmann
d21f72d0dd Git: Simplify action in branch view
Change-Id: Ic1a604baa7b83b7244febde776c95896b56a1467
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2020-02-20 18:46:13 +00:00
Orgad Shaneh
dec8113377 Git: Fix accelerator for reflog
R is already used for Rebase.

Change-Id: I64575c98bf22aef0a2825b68b1c9a92061821923
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2020-02-19 17:48:19 +00:00
Orgad Shaneh
c728d04b52 Git: Support reflog also for branches
Change-Id: I9321ba4964d086d90aaf540a2006f95b94de8375
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2020-02-19 07:23:11 +00:00
hjk
eb1226df68 Git: Partially move plugin pimpl to .cpp
Same procedure as for ClearCase.
Unfortuately, some deep accesses are not easy to get rid of. Make them
available by static functions in the plugin itself. Definitely not the
favorite setup, but allows to proceed with the QObject removals.

Change-Id: Id85ed07bc7a6c1c053431a14dd7f68892f7ebea0
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2020-02-07 12:56:10 +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
1cd936c531 Vcs: Pimpl plugins
Essentially rename all *Plugin into *PluginPrivate, and pull out
the actual IPlugin related pieces into new *Plugin classes.

Shift the construction of the PluginPrivate to initialize(),
following the general pattern.

I tried to keep the patch as mechanical as possible, giving
room to some obvious but less mechanical cleanup needs,
that are intentionally left out of this here.

Change-Id: Iac662bf73338f9f7669064ed67b960246875c23c
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2020-01-24 09:47:28 +00:00
Andre Hartmann
da6972e0a9 Git: Update current branch after some operations
... to refresh the branch view upstream status.

No need for a full model update here, only the current
branch is influenced.

Change-Id: I6bd17a841988b36221e5015a5858071d33a7b5e5
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2019-12-27 11:51:45 +00:00
Andre Hartmann
d29650b3ea Git: Remove unneded indirection from branch view
Change-Id: I273889ffe921a0312d9220aa0e3b339de764def8
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2019-12-27 11:48:00 +00:00
Andre Hartmann
00e04d5022 Git: Allow removing stale remote branches
... from the Branch View context menu on a
specific remote.

Change-Id: Ic7772abe32795a5d11bd4cae989f8d66cc4322e0
Reviewed-by: Miklós Márton <martonmiklosqdev@gmail.com>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2019-12-19 07:43:49 +00:00
Orgad Shaneh
a1ba347fa5 Git: Fix popping of branch-stash after checkout
Checking out a branch that has a saved stash, when
Pop branch stash is checked, is broken since checkout
became asynchronous.

We must wait for checkout to complete before popping
the branch stash.

Change-Id: Ia4d43649e742ced0121ffe106986b4d6ed1e7b38
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2019-07-01 19:57:02 +00:00
Orgad Shaneh
a33386e014 Git: Support different reset types in branches view
Change-Id: Idce57062cbb92edd4c26647aabef040ec92b9f3c
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2019-04-06 17:58:58 +00:00
Andre Hartmann
0161729c23 Git: Add tags from log window
Fixes: QTCREATORBUG-22202
Change-Id: Id6cbaf036d25fe5e9e8fcf2fe4d131649746e128
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2019-04-03 19:44:11 +00:00
Andre Hartmann
e77729a05a Git: Allow direct checkout in add branch dialog
Avoid one modal message box by adding a checkbox in the
dialog. In case the user misses to check the box, the
branch can still be checked out later with the context
menu action "checkout".

Change-Id: I51262e694aad9f55511beefa0d8d23ea66429664
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2018-11-26 11:20:06 +00:00
Eike Ziller
3d1d9aae2e Merge remote-tracking branch 'origin/4.8'
Conflicts:
	src/plugins/winrt/winrtdevicefactory.cpp

Change-Id: I33b8697e2ebf2bea051d7f1144449e0743ee16a5
2018-11-19 10:00:18 +01:00
Orgad Shaneh
e38c8724e4 Git: Fix checking out a branch after adding it
Fallout from a9ac438ad8.

Change-Id: I07b36dd1bc5e9fb63f7d4552d9cb6ccd7ea2e22d
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-11-15 09:46:07 +00:00
Orgad Shaneh
92431932e3 Git: Show detached HEAD in branches view when applicable
Fixes: QTCREATORBUG-21311
Change-Id: Ia4297d23a965d83ea2814bd1e41f35a3017b8e9b
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-11-12 09:48:25 +00:00
Eike Ziller
1473bc5891 Merge remote-tracking branch 'origin/4.8'
Conflicts:
	src/plugins/debugger/debuggermainwindow.cpp
	src/plugins/qbsprojectmanager/qbsbuildstep.cpp
	src/plugins/winrt/winrtdevicefactory.cpp
	tests/unit/unittest/gtest-creator-printing.cpp
	tests/unit/unittest/gtest-creator-printing.h
	tests/unit/unittest/unittest.pro

Change-Id: Ie9b80b87a8a4fa81baf72a2daa7919b21371c15e
2018-11-06 09:20:00 +01:00
Orgad Shaneh
7d888d58fc Git: Add accelerators to branches context-menu
Change-Id: Ife79519fbd5b006838b09a3d45bd44461aec8d59
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2018-11-05 19:55:11 +00:00
Orgad Shaneh
a82dd10518 Git: Enable renaming local branches by direct editing
Change-Id: I7edab94d949a6e48642f280af52fd156c803cafb
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2018-11-04 20:37:44 +00:00
Andre Hartmann
44205a961e Git: Add push to branch view
Allows pushing the selected local branch to any remote branch.

Change-Id: I6fb9ee8e1659070c1c759fe64b713fb2235c8816
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2018-10-28 17:33:30 +00:00
Orgad Shaneh
8278b4a24d Git: Remove wrong soft assertion
There is no restriction of renaming the current branch.

Change-Id: I51f3f8d69d1fb108a23a9e9f98364361828531d3
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2018-10-28 11:51:52 +00:00
Orgad Shaneh
ce15a0f447 Git: Fix detection of current selected index
Comparing the row is not enough. Row is relative to the parent, so the
second row in locals was wrongfully considered identical to the second row
in a remote.

This amends commit 299c777c01.

Change-Id: I4c5e43e3107a1f01bbed7abf9b7e2a2d3feb4feb
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2018-10-28 11:51:33 +00:00
Orgad Shaneh
a9ac438ad8 Git: Add quick filter for branches panel
Change-Id: Idef4ab2db69f24bb004c00fa010b814fdaa7d56d
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-10-18 12:26:26 +00:00
Andre Hartmann
4e0f14b8a5 BranchView: Add ellipsis to rename and remove action
Both open a new dialog to perform the action.

Change-Id: Ie93b99b1ff64927de24de49cd5e30ee729d749b2
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-10-18 08:16:23 +00:00
Andre Hartmann
299c777c01 Git: Fix context menu actions in BranchViews second column
m_branchView->indexAt(point) returned another model index
[column 1] than m_model->currentBranch() [column 0], if the
context menu was requested in thesecond (date/time) column.

The failed comparison then gave a lot of invalid actions
(like merge) for the current branch.

Change-Id: Icefc084c81f9b573cd151460db793d3c5a01eb2b
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2018-10-13 16:36:14 +00:00
Andre Hartmann
81a4c1d934 Git: Simplify conditions in BranchView
index.isValid() is already checked in line 165,
so it does not need to be checked afterwards
because it is always true there.

isLeaf is only used once, so join the assignment.

Change-Id: I5f21486fd440b82d8e99be1248adf023da664c1e
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2018-10-13 16:34:22 +00:00