Commit Graph

47 Commits

Author SHA1 Message Date
Christian Kandeler
d3deefc3a4 Core: Streamline SearchResultWindow interface
That is, make SearchResultItem the one data type for adding search
results.
This will allow us to add additional properties to search results
without adding more and more parameters to a bunch of functions.

Change-Id: Ic2740477ae47449cee75caa2525727fe2b460f91
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-02-18 16:46:08 +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
Eike Ziller
f8ae051816 VCS: Fix build with Qt6
QStringRef is gone.

Task-number: QTCREATORBUG-24098
Change-Id: I38dd1602294fcabf5cf7c1553bcfd93f3c47b601
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2020-09-21 06:56:58 +00:00
Orgad Shaneh
a48cde86f3 Git: Show full description on tooltip in commit chooser dialogs
Like Push to Gerrit, Rebase, Reset, Fixup Commit.

Fixes: QTCREATORBUG-24366
Change-Id: I0f596f84661a1a4f37fe971683cc0d985a6c9b1f
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2020-08-02 05:00:50 +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
hjk
6f2beafaf2 Git: Make a few objects proper plugin pimpl members
Change-Id: Ib996ed248cd6e10d49fa3ae1086189acfc04de34
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2020-02-07 13:01:35 +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
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
Sona Kurazyan
8e31932c29 Remove usages of deprecated APIs of QLayout
Replaced:
  QLayout::setMargin() -> QLayout::setContentsMargins()
  QLayout::margin() -> QLayout::getContentsMargins()

Task-number: QTBUG-76491
Change-Id: If28ef6910b3afe5d04e4746b74f9362a3e3b3c8e
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-09-02 13:01:07 +00:00
hjk
00b692e67e Utils: Use CommandLine in ShellCommand
... and adapt users.

Change-Id: I218523ffe34720d5fe199aa0ca6892a8dc2985fc
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2019-06-11 11:01:16 +00:00
hjk
19e1cf1520 Replace uses of qVariantFromValue with QVariant::fromValue
Deprecated in Qt 5.14, alternative has been around since Qt 4 at least.

Change-Id: I4e3a53c289088368609e0d0ce2405a832d311308
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2019-05-27 12:33:29 +00:00
Orgad Shaneh
feb2db61fc Git: Support non-recursive grep
Change-Id: Ib38239e28e8b24d993015e5568df02fe2a67f0e8
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2019-03-18 08:37:51 +00:00
Alessandro Portale
710e57a628 Fix warning: "Use midRef() instead of mid()"
[-Wclazy-qstring-ref]

Change-Id: If8a0844b39377feb3772542559655854a92b93cd
Reviewed-by: hjk <hjk@qt.io>
2019-01-17 13:00:37 +00:00
Alessandro Portale
128a33548b Fix warning: "Missing reference in range-for with non trivial type"
[-Wclazy-range-loop]

Change-Id: I5dcb263c754d423740e7bce3dcb948d52f2dec67
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2019-01-16 20:22:56 +00:00
Orgad Shaneh
86732dbdc0 Git: Use correct flags type in grep
Change-Id: Iebd65827518576b48ff8f401612baae8350fe6a3
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-10-10 08:30:03 +00:00
Orgad Shaneh
c879a78c03 Git: Fix regexp substitution with multiple occurrences in line
If the line has multiple occurrences of the search pattern, all occurrences
got the same capture groups.

For example, text:
Foo(1); Foo(2);

Search for Foo\((.)\) and replace with \1, the result was:
1; 1

Change-Id: Idd4dc21397d5331b1e31a2860eca39d9bc407437
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-10-10 08:29:55 +00:00
Orgad Shaneh
202d40f256 Git: Modernize
* Use auto
* Use override
* Use some member initializers

Change-Id: I3ca000d1c8e4d02331d58b85e68e4d771c636b29
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2018-09-19 19:47:07 +00:00
Orgad Shaneh
7d3a79c696 Utils: Purge asConst
Replace by qAsConst.

Change-Id: I3301366f73c066c86f08df7188d70dc3b613c55c
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2018-04-09 09:04:00 +00:00
hjk
713b8636ea Vcs/Text search: Remove a few addAutoReleaseObject uses
Using a QObject parent suffices here.

Change-Id: I4dc5448511d55bf14fbd8f810e91336a49e94094
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2018-02-06 11:58:15 +00:00
Orgad Shaneh
948fad02d1 Git: Recurse into submodules on grep if applicable (Git >= 2.13)
Change-Id: I5028d6a46749b22cc0e0f5707c9e283126511902
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-07-24 15:10:15 +00:00
Orgad Shaneh
f073c39b86 Git: Minor cleanup in grep
Change-Id: I2a686b6f56947d3fbb6dc70757e539bf4f274bff
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2017-07-23 20:24:28 +00:00
Eike Ziller
1f8b2dc361 Advanced search: Add exclusion patterns
All files with full file path matching one of the exclusion patterns are
ignored in the search.
Searching with "git grep" now requires git >= 1.9

Change-Id: Ied5d11499bc1ff21247e50f8e146e8e5011dd2c1
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2017-02-28 10:48:23 +00:00
Eike Ziller
e724934393 Merge remote-tracking branch 'origin/4.2'
Conflicts:
	doc/src/qtquick/creator-tutorial-create-qq-project.qdocinc
	doc/src/qtquick/qtquick-creating.qdoc
	doc/src/qtquick/qtquick-uiforms-tutorial.qdoc
	share/qtcreator/welcomescreen/qtcreator_tutorials.xml
	src/plugins/git/gitgrep.cpp
	src/shared/qbs

Change-Id: I6f4d168d888d9547c3af0819f79cc9ebb4186ca0
2017-02-14 15:32:04 +01:00
Orgad Shaneh
148e793dec Git: Prepend -e to the pattern on grep
This fixes searching for patterns that start with dash.

Change-Id: I824f64151842008a034757de6a00fd8a6cc46d72
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2017-02-07 19:57:58 +00:00
Orgad Shaneh
e366e135b7 Git: Eradicate Q_FOREACH loops
Change-Id: I29b6071ea244d1b3ae0701d36c90b1e93cf21fbb
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Reviewed-by: hjk <hjk@qt.io>
2017-02-06 09:37:44 +00:00
Jarek Kobus
8b67458a95 Prefix editor's uniqueId with plugin name
In this way we minimize the chance of
generating non-unique id.

Change-Id: Idd177c5a4b44b17a58c2a944ec77b9517e91964e
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2017-01-10 15:14:19 +00:00
Eike Ziller
57ca90b846 BaseFileFind/FindInFiles: Clean up enabled / valid state handling
IFindFilter:  Separate enabledChanged and validChanged
SearchEngine: Add enabledChanged
GitGrep:      Enable widget based on enabled state
FindInFiles:  Update validity on search engine enabledChanged instead of
              hardcoding it to when the search path changed

Change-Id: I0c684423b871a3a4f1f164574f42e23b64cf9da0
Reviewed-by: David Schulz <david.schulz@qt.io>
2016-11-25 08:42:53 +00:00
Marco Bubke
ddfd29852a Utils: First step to extend search results for clang query support
We need multi line support, multi text range support. This is only adding
enablers and adds later the multi line and multi text support because this
triggers larger changes because you have to know the text document.

Change-Id: I44e46d9d80d7d73b2650c69cc83657c20c85bfae
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2016-11-23 10:48:59 +00:00
Przemyslaw Gorszkowski
6b2cf5cd03 FindInFiles: make possible to have more than one extension
This change adds a possibility to add more than
one external tool which can be used instead of internal finder.
Currently there is one extension: 'gitgrep'.
By default we use internal finder.

Change-Id: If644358552f3cea9ebda8308539322a1b6d3ab77
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2016-11-16 09:52:05 +00:00
Przemyslaw Gorszkowski
39d85833b5 GitGrep: fixed substitution of regexp
Task-number: QTCREATORBUG-17193
Change-Id: I7e11a5a55f373dce98a9e203bb3bcb5e929174fc
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2016-11-03 10:35:59 +00:00
Orgad Shaneh
516161c875 Git: De-noise
* Remove QLatin1{String|Char} where possible
* Use initializer lists for QStringList

Change-Id: I8479f87f4fc909b5d74d854956885564209538e4
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-07-22 10:12:59 +00:00
Thiago Macieira
cdf1c924a3 Git: make git grep not duplicate leading path names
Make sure we pass --no-full-name to counter the grep.fullname=true
option that the user may have set. Otherwise, Creator will complain that
it can't find the files that matched the search terms if the search
directory was not the root of the Git repository.

Change-Id: I149e0540c00745fe8119fffd14628a3d7887e55e
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2016-07-19 05:23:08 +00:00
Orgad Shaneh
754b8ededb Git: Suppress failure message on grep
It fails when no results are found.

Change-Id: I3390f1119457bb47fb09a95a395cb68a0dd58e82
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2016-05-04 02:58:03 +00:00
Orgad Shaneh
fbffd3abae Git: Reduce grep approximated time to 5 seconds
It typically doesn't take more than that. On Windows it might be more,
but for this we have the slowly increasing progress.

Change-Id: I4cae5ec6d8488f31387a306f841798ca079cdac5
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2016-02-18 11:13:18 +00:00
Orgad Shaneh
2d4ea0b623 Git: Shorten grep tree description
Task-number: QTCREATORBUG-15743
Change-Id: I2f18bef84a8284d03d68797d1fb70165df6628d4
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@theqtcompany.com>
2016-02-16 07:52:12 +00:00
Orgad Shaneh
ecdc2013cd Git: Fix tree validator in grep
Allow all non-space characters

Change-Id: I6f64392d80aed7ac560f9564d91305074ed0996d
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2016-02-15 10:21:13 +00:00
Tobias Hunger
b4195d5174 Git: Modernize
* pragma once
* member initialization
* s/struct/class/
* Introduce a static GitPlugin::client() method and use it

Change-Id: Ifdcac86dd16f3cdba11d564d03e9a15f00a6afdb
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2016-02-10 15:01:57 +00:00
Orgad Shaneh
84f2875f6d Git: Support tree argument for Grep
Change-Id: Ic7dfcd8bad98223d68725f1a0c1f103ad8ea4e0f
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2016-02-10 13:10:17 +00:00
Eike Ziller
72af6b7834 runAsync: Remove ResultType template parameter.
It is now deduced from either the type of the
QFutureInterface<ResultType> function argument, or the return type.

Change-Id: Iddab3cc329206c649a6e55a44b2de2d406701dee
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2016-02-10 10:58:55 +00:00
Orgad Shaneh
654aa3a0d7 Git: Use a progress timer for Grep
Change-Id: I579bd9bf9e4060f4620afcbd42ac866d0d19bd37
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
2016-02-09 09:09:14 +00:00
Orgad Shaneh
71166d06d0 Git: Minor cleanup
* Remove unused includes
* Remove QObject qualification
* Use a raw pointer for widget instead of QPointer. It is owned by GitGrep.

Change-Id: I4e2c9878289ed3491bfd7b0565a683bc01e485f3
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2016-02-08 14:49:02 +00:00
Orgad Shaneh
5db0ef191e Git: Do not report canceled for Grep when no results were found
Change-Id: Ib1916c345bd345ee3dd5179c84bb259c2992303e
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
2016-02-08 08:07:58 +00:00
Orgad Shaneh
36d5bc1e98 Git: Use VcsCommand for Grep
* Logs the command in the Version Control pane
* Simplifies the client code

Change-Id: I398d57ab12ed6ba6bab1878934b929083f0bf6cb
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2016-02-05 11:55:20 +00:00
Orgad Shaneh
558c08e2c5 Git: Hook grep into Find In File System dialog
Change-Id: I0fc77ad61c8874a21afd5b5135df4d30fa795a8e
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
2016-02-04 11:58:29 +00:00
Orgad Shaneh
6a3e687d14 Git: Fix crash on Grep
If the process is already finished, and cancel is triggered Creator crashes.

For example, search for "q" in qt-creator, wait for >200K popup, then wait a few
seconds for the process to finish and press Cancel.

The reason for the crash is that reportFinished() is called twice - one from
GitGrepRunner::finish() and another one from Utils::runAsyncImpl().

Change-Id: I61d379f5e3a5ae86c9a48a3751dbb2e00203516d
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
2016-02-03 08:13:58 +00:00
Orgad Shaneh
f26a4c2954 Git: Default to * file pattern in Grep
Change-Id: I5f763b7b2f8c0bc2373bf1151691b3e8b4cff757
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
2016-01-27 08:19:24 +00:00
Orgad Shaneh
6fee5a88f3 Git: Support Git Grep
Task-number: QTCREATORBUG-3556
Change-Id: Ieca1bdaa39281a2e085340f045e5a48b875f7967
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
2016-01-25 14:43:00 +00:00