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>
Adds a std::expected implementation that is compatible with >= C++11.
FilePath::fileContents and FilePath::writeFileContents as well as
FilePath::copyFile are changed to return std::expected.
A couple of macros have been added to aid in using the expected types.
An auto test was added showing how to use the library.
Change-Id: Ibe3aecfc1029a0cf13b45bf5184ff03a04a2393b
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
This saves about 2 seconds out of 5 seconds spent in
displayResult() for converting from QString into
FilePath in main thread (use case: gitgrep with
2 million hits).
Change-Id: I6334e8559986501c34c90a5c7c6b4acc9a6953e0
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
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>
Round 2 - focus on sources.
For classes with initial in range [A-H].
Try to keep the same separators between different kind of headers.
Change-Id: I838a8324ddd5b4d8d5a51b8f30605f783c663813
Reviewed-by: hjk <hjk@qt.io>
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>
Gone in Qt6. Read the whole file contents and decode instead.
This is not ideal since we possibly load big files into memory.
But otherwise we'd have to implement a buffering, file-based IODevice
that reads into a buffer, part by part converting to unicode with
QTextCodec::toUnicode(const char *input, int size,
QTextCodec::ConverterState *state), similar to how it is done in
QTextStream from Qt5 (QTextStreamPrivate::fillReadBuffer).
Task-number: QTCREATORBUG-24098
Change-Id: I22e251c8217d49880df59980cf32a8febf93364b
Reviewed-by: hjk <hjk@qt.io>
Having a search inside a document and switching the find options
to use regular expressions may end up in lots of warnings
regarding using an invalid expression for a match call.
Check beforehand to avoid this.
Change-Id: Ia929090ae3910ff3fa87b57a5718293d2b6ccd04
Reviewed-by: David Schulz <david.schulz@qt.io>
Looks like this was always broken, but got more prominent by the
introduction of automatic directory locator filters for all open
projects.
Task-number: QTCREATORBUG-22662
Change-Id: I248fb611bb1a6226b27901ea6ab310fc640def7a
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
More in line with QFileInfo terminonlogy which appears to be
best-of-breed within Qt.
Change-Id: I1d051ff1c8363ebd4ee56376451df45216c4c9ab
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
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>