Since we now use QRegularExpression and state Perl compatibility.
- & and \& expand to &
- $<number> exapands to capture group at position <number>
- $$ expands to $
- $& exapnds to whole match
- \<number> and $<number> expand to nothing if <number> is greater than
number of capture groups
Task-number: QTCREATORBUG-9602
Task-number: QTCREATORBUG-15175
Change-Id: I17cea3239abaf130626f2bf224aabf0e9b1c6cef
Reviewed-by: David Schulz <david.schulz@qt.io>
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>
If a container is given to mapReduce, it takes the responsibility to
report progress information for the whole operation. If the map function
reports its own progress, that is taken into account for the overall
progress.
The (so far only unordered) Utils::map operation can be used to replace
MultiTask, by passing a member function of the items in the container as
a map function.
Change-Id: I18ca38a6ad2899d73f590bfe59bf2e6eb2f1a57a
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
Give iterators 'a' and 'b', if a == b, either both are non-dereference
or *a and *b are references bound to the same object.
Also add missing default constructor, copy constructor and copy
assignment operator.
Change-Id: I53fd30a620155b9faa9850b2ffcf546376b14cff
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
- QThread instead of std::thread for better integration with Qt
- Use thread pool for recycling threads
- Map and reduce functions are handled like any function passed
to runAsync, so they either report results through the
QFutureInterface, or through the return value.
- Automatically deduce the reduce result type
Change-Id: I7a31370c21f8c27b378cd87c3d5974b162449ce1
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
QtConcurrent limits resource usage to a global number of simultaneous
threads. That means that if some QtConcurrent based algorithm currently
grabs all threads, any other use of QtConcurrent blocks, which is not
what we want.
Use the new threading methods of C++11 instead, but still use
QFuture(Interface) manually for the progress, result and status
reporting.
Task-number: QTCREATORBUG-14640
Change-Id: I6379d2f2a01b6d200811ef4be0bbfcd4493dd154
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This fixes a race condition when searching in multiple files.
Task-number: QTCREATORBUG-14403
Change-Id: I5572d7f2cd9fe3c399efdf37e874d9773be76f57
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
Converting std::unary_function to std::function will create a copy,
which we do not want. Actually std::unary_function as a base class
doesn't serve a purpose at all in this context, so we can just remove
it. Bind a std::function to a pointer to our search object instead.
Change-Id: I31db62312eefdff19b09fbb4eb20e8e666125874
Reviewed-by: Daniel Teske <daniel.teske@theqtcompany.com>
We need this when we want to use QtConcurrent::mappedReduced.
Change-Id: I4a6a31f4a0cc9a739a263cc148a1d51d7aa5d418
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
Introduced by recent refactoring
Change-Id: Ifb7300549ce1791a90d287d5d8dd66f7d2217755
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
Only the way individual files are searched is different, so the rest of
the code is now shared.
Change-Id: Ia550de1b5d381c5f7c26c3f3e7a943fea7d0efa9
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
Replace all* remaining deprecated Qt 4 functions with
their Qt 5 counterparts. This means we no longer need to
define the QT_DISABLE_DEPRECATED_BEFORE macro.
This patch is relatively small because most source-compatible
changes of this kind have been done before.
* The one exception is the QmlDesigner, which uses QWeakPointer
in a deprecated way all over the place.
Change-Id: Id4b839c6685f3b5bdf2b89137f95231758ec53c7
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
Reviewed-by: hjk <hjk121@nokiamail.com>
Searching for aaaa in aaaaaaaa would give 5 results instead of 2 in case
of non-regexp search.
Task-number: QTCREATORBUG-7883
Change-Id: I5936090b3eef5e68405201fe63d02bf0dd2469d5
Reviewed-by: David Schulz <david.schulz@digia.com>
Forward-declare QGraphicsOpacityEffect in DetailsButton,
QProcessEnvironment in Environment, QFileInfo in fileutils,
QUrl in IWelcomePage, FancyLineEdit in PathChooser and
remove unneeded headers.
Change-Id: I7d5f273530dd2059bbdaf0899f0a3bc7e49e8482
Reviewed-by: hjk <hjk121@nokiamail.com>
#!/usr/bin/env ruby
Dir.glob('**/*.cpp') { |file|
# skip ast (excluding paste, astpath, and canv'ast'imer)
next if file =~ /ast[^eip]|keywords\.|qualifiers|preprocessor|names.cpp/i
s = File.read(file)
next if s.include?('qlalr')
orig = s.dup
s.gsub!(/\n *if [^\n]*{\n[^\n]*\n\s+}(\s+else if [^\n]* {\n[^\n]*\n\s+})*(\s+else {\n[^\n]*\n\s+})?\n/m) { |m|
res = $&
if res =~ /^\s*(\/\/|[A-Z_]{3,})/ # C++ comment or macro (Q_UNUSED, SDEBUG), do not touch braces
res
else
res.gsub!('} else', 'else')
res.gsub!(/\n +} *\n/m, "\n")
res.gsub(/ *{$/, '')
end
}
s.gsub!(/ *$/, '')
File.open(file, 'wb').write(s) if s != orig
}
Change-Id: I3b30ee60df0986f66c02132c65fc38a3fbb6bbdc
Reviewed-by: hjk <qthjk@ovi.com>
When making a case insensitive search, try to keep the string capitalization when doing
the replace:
- All upper-case matches are replaced with the upper-case new text.
- All lower-case matches are replaced with the lower-case new text.
- Capitalized matches are replace with the capitalized new text.
- Other matches are replaced with the new text as provided.
Note: this does not work with regexp replace, only plain text.
Change-Id: I87cbc28eb64688bdf3c8c6ec173fcb22f91abcd0
Reviewed-by: Cristian Tibirna <tibirna@kde.org>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@digia.com>
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
Commit 75a0c7f9b52cde47f20fdc1b89e1264d60350848 in qt5/qtbase changed
some QRegExp methods to be non-const (they were previously const). This
change makes Qt Creator compile again.
Change-Id: Ibc98c678126c3b3189df7fcc043463b940951445
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
Getting the #include directives ready for Qt5. This includes the
new-project wizards.
Change-Id: Ia9261f1e8faec06b9285b694d2b7e9a095978d2b
Reviewed-by: Eike Ziller <eike.ziller@nokia.com>
It causes a conflict with the new QtConcurrent library
of Qt 5 and is quite small.
Change-Id: Ib97ab6daf8f67a88300cf03f044ba3593a4cd270
Reviewed-by: Eike Ziller <eike.ziller@nokia.com>
This e.g. avoids "lines" of several MB if file search hits a binary
file.
Task-number: QTCREATORBUG-6116
Change-Id: Ibf89a332bc82ddbdb2aeb83c4b3886e784dab4b8
Reviewed-by: Ralf Neubersch <neubersch@neubersch.de>
Reviewed-by: Robert Löhning <robert.loehning@nokia.com>
Affects e.g. Advanced Find->All Projects. Progress bar was not updating
at all, except at the end of the search.
The fix is a workaround for regression in
QFutureInterface::isProgressUpdateNeeded that would no longer return
true the very first time in Qt 4.7. To be reverted when this is fixed
in a released Qt version.
Reviewed-by: dt