Commit Graph

510 Commits

Author SHA1 Message Date
Orgad Shaneh
424fd7c557 VCS: Resolve symlinks on blame
Fixes: QTCREATORBUG-20792
Change-Id: I60ac64957b23b80826c93ba73ff17a265549811f
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2022-10-14 11:32:14 +00:00
Orgad Shaneh
8c1cd7539c Git: Fix removing nested files
* Add -- before file list on add/remove.
* Run in the correct directory.

Fixes: QTCREATORBUG-27405
Change-Id: Ie04cd19981dac465cf70dba8b089fd18a4ecdf8b
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2022-10-11 15:32:13 +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
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
eec0679234 VcsBase: Move RunFlags into separate header
It is going to be used outside of VcsCommand, too.
Use RunFlags enum as an argument to several functions
instead of unsigned.

Change-Id: I355c80a845a9b5982108fbde3412754392dce702
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-10-06 12:00:35 +00:00
Jarek Kobus
604730f14d CleanDialog: Use more FilePath
Change-Id: Id545b8c412d55d8e1976cbe0bbdad36e22eb93a0
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-10-02 19:04:58 +00:00
Jarek Kobus
2f093aec66 GitPlugin: Drop unneeded namespace specifiers
We have using namespace in this file.

Change-Id: I6e9f1259c917c446e52c5e407ec2139cc29c7216
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-09-06 15:09:49 +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
f794bb0acf GitPlugin: Avoid using sender()
Change-Id: Ie711630dd4b92bdc69990f421f69b578bc0fe9dc
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-07-22 13:30:08 +00:00
hjk
d83eb0494a Use setClipboardAndSelection more broadly
Basically everywhere besides the EmacsKeys plugin.

Change-Id: Iaf2a0a5d791b5b3dd6df2c05c1b862516630d3f8
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-07-15 07:06:25 +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
Jarek Kobus
e793841b4f Remove Core::ShellCommand
Move the implementation into VcsCommand.
Use Utils::ShellCommand inside coreplugin API.

Change-Id: I74a34057b33832a138b05f1dfa6937565027edb4
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-07-11 10:04:08 +00:00
Eike Ziller
f4c60fdf58 Git: Do not run 'git --version' synchronously at startup
We can easily delay this, and if git acts up for some reason, we don't
have to block startup.

Task-number: QTCREATORBUG-27765
Change-Id: I25aa6f8d04d1fd4b9d87f8ccf7ffd591f7bbe519
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2022-06-29 12:39:28 +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
Eike Ziller
3c1a87290e Register some more windows
So they get an entry in the Window menu, and window related shortcuts
are registered correctly.

Change-Id: Ie7e882a009f928f1268fdd312e7fb5362f6a837f
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-02-09 09:12:29 +00:00
Christian Kandeler
b2d63bf79e Fix various compiler warnings
Change-Id: Ib64f04f154b2c44dad3248ef038449c2ac628686
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2021-12-02 15:48:52 +00:00
hjk
0781379345 Core: Use FilePaths in IVersionControl::additionalToolsPath()
Change-Id: I3c7d03b8695152f0830e809ce7a0709f48d8178b
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2021-11-11 12:19:27 +00:00
Jarek Kobus
50586c7bb8 Use QtcProcess in MergeTool
Change-Id: I9d08c455404a75a29874883dbdc4855a183a58e3
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2021-11-03 13:26:42 +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
b8b3970329 Git: Fix warning when applying settings with Ok
The current parentDialog is the settings window, but it is closed
immediately, so the warning just disappears.

Change-Id: I7f5033239bf18e758595965587947bec40facf6f
Reviewed-by: hjk <hjk@qt.io>
2021-09-30 07:26:04 +00:00
hjk
0416e15612 Utils: Return FilePath from PathChooser::homePath()
Change-Id: Ib67435cb828e6bb55f76bfd6eb13165f46922c00
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-08-19 04:29:25 +00:00
hjk
b72582c050 Git: Use FilePath in findRepositoryForDirectory
Change-Id: Ia711377111d529e14ed864669df83e1b1bb2bfc9
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2021-08-02 14:40:49 +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
ecbd9f4558 VCS: Partially use FilePath in VcsBaseClient
Change-Id: I024b051ab98ece42ec011bd1c92887a946925c1a
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2021-07-30 13:10:59 +00:00
hjk
edcedabed9 Vcs: Use FilePath in IVersionControl API
Adapt first level of users.

Change-Id: Ifcd7bff45631ff3b9e26a9e3176daa6cf0cf2e56
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2021-07-29 13:20:23 +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
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
2004399f38 Git: Use the new AspectContainer::applied signal
Change-Id: Ib40e206e84228e91e4816c5b91800a5611f441a1
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2021-04-06 06:24:34 +00:00
Eike Ziller
072607962d Locator: Add longer description to filters
This is shown as tool tips in the location options, and if any platform
supports this also as tool tips on the menu actions of the locator input
field.

Change-Id: I8b439e45e6097a16a5f932d25d4e5d3e9bddb6ad
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-03-23 08:29:30 +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
6ebfc77d35 Git: Add missing emit
Found by clazy.

Change-Id: I1b74f28e86a1bddf1ef4c77aa20eda1141ec8045
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2020-12-27 14:59:22 +00:00
Orgad Shaneh
48c56416f5 Git: Do not prompt to add files in a submodule
Fixes: QTCREATORBUG-23845
Change-Id: Ibf20eed26469b5a8599927e5ac2d458bbff9a156
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2020-10-04 17:06:23 +00:00
Eike Ziller
f811b87c66 EditorManager: Small API clean-up
- Move private enum to private header
- Add missing parameter to openEditorAtSearchResult
- Remove convenience singular close* methods, we have {} nowadays

Change-Id: Ic5b6d831a9f506ffee09b89b3358874433d62998
Reviewed-by: David Schulz <david.schulz@qt.io>
2020-09-30 14:57:20 +00:00
Orgad Shaneh
eb6a2f2b89 Git: Enable Show for file in a specified revision
Fixes: QTCREATORBUG-24689
Change-Id: Ic4ceb1c59f39009c28be7f34ee62f65fd41506c1
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2020-09-29 07:09:18 +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
Eike Ziller
3944162039 Merge remote-tracking branch 'origin/4.13' into master
Conflicts:
	cmake/QtCreatorIDEBranding.cmake
	qbs/modules/qtc/qtc.qbs
	qtcreator_ide_branding.pri
	src/plugins/cmakeprojectmanager/cmakebuildstep.cpp
	src/plugins/cmakeprojectmanager/cmakebuildstep.h
	tests/auto/debugger/tst_namedemangler.cpp
	tests/auto/qml/codemodel/check/tst_check.cpp

Change-Id: Iefd5f71c03c0078513b76a92af764a4fb22ee4c2
2020-08-10 15:56:54 +02:00
Orgad Shaneh
be16ac2371 Git: Avoid translation of git commands
Fixes: QTCREATORBUG-24390
Change-Id: I9bb041045d6adf0ae91f6d22723846f058662275
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Robert Loehning <robert.loehning@qt.io>
2020-08-07 13:32:14 +00:00
Orgad Shaneh
c0c5773345 Git: Add new files with --intent-to-add
Sometimes the file is modified after adding it, either by Qt Creator itself
or by the user.

Running Diff on such a file may look strange. Instead of showing the entire
file, it shows the diff since it was added with its initial content.

Fixes: QTCREATORBUG-23441
Change-Id: I712cc574053f39753250685aec148d2b6d7db192
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2020-07-19 03:59:45 +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
Andre Hartmann
884de236be Git: Fix whitespace
Change-Id: I9b61d018179449f61fd38de7957fabc1c9bc917d
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2020-07-04 19:12:05 +00:00
Orgad Shaneh
92a4c0d38a VCS: Pass links to the correct VCS
Current implementation requires each VCS to connect to the referenceClicked
signal. Only Git does it, but this is conceptually wrong. If other VCSs
would connect to the same signal, all of them will act upon clicking a
link, which can result in multiple editors, most of them are likely to be
invalid anyway.

By default executes vcsDescribe. Can be extended or modified by subclasses.

Change-Id: Ib953009efd77446a4b2963f0aa8a2f3f3d26509f
Reviewed-by: Artur Shepilko <artur.shepilko@nomadbyte.com>
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2020-06-21 06:47:20 +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
Orgad Shaneh
5ebe34a332 VCS: Add vcsDescribe
Already exists in all implementations, but there was no common declaration.

Change-Id: Ieb3d10d1936c207722b5001712bce41e8114dcdc
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2020-06-18 05:17:59 +00:00
Orgad Shaneh
e9df7825fa IVersionControl: Change vcsAnnotate return type to void
All implementations return true unconditionally, and the return
value is never read anyway.

+ Remove superfluous function with the same name in Perforce.

Change-Id: I83f361ec7fd8be3177cb4be52e6276e295cd4279
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Reviewed-by: hjk <hjk@qt.io>
2020-06-18 05:16:24 +00:00
Andre Hartmann
d5cbdde11f Git: No else after return
Change-Id: I1c054bbb3b7a7060775e8015a74ee396cf84cca1
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2020-05-09 18:09:13 +00:00
Andre Hartmann
f486ff7dab Git: Add git bash to tools menu
Can be useful to perform tasks that don't have
a dedicated UI in Creator.

In my setup, git bash was directly in the git
installation folder %ProgramFiles%\Git and
therefore one level above git.exe itself.

Change-Id: I1ca0d3439690170d7fb840bca17e2c412effe0a4
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2020-05-05 14:23:03 +00:00