| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
| |
I didn't find any usage of it in Qt code.
[ChangeLog][QtCore][QDir] Deprecated QDir::Filter::Modified flag.
Change-Id: I800fa6b177c2697c9621307d04090b566290012b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
|
| |
|
|
|
| |
Change-Id: I6825fd32dd177d034d4f20a10674ffde96835c34
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
|
| |
|
|
|
|
|
|
|
| |
Convert the values of a QDir::Filters that can be represented by
QDirListing::IteratorFlags, and check the rest of the filters separately
in QDir.
Change-Id: Ib3cc8b04a2903111cf863b07d239d5a02f8397ca
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
QDir parses strings representing file paths. These strings may come
from untrusted sources, and even existing paths could be crafted to
trigger potential bugs in QDir. Therefore, this file is marked as
security-critical.
QUIP: 23
Pick-to: 6.10 6.9 6.8
Task-number: QTBUG-135187
Change-Id: I817ad336ddc978c4cba1f385d60017f3a8f8e4fd
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
std::optional:
- it's already used in private API in QFileSystemEngine and
QAbstractFileEngine and its subclasses, so there is no extra overhead
- less code duplication as it lets the existing overloads call the new
ones with std::nullopt to make it use the platform default permissions
- adding a new enumerator, e.g. "PlatormDefault", wouldn't work:
- 0x0 is ambiguous with setting the permissions to nothing
- the new enumerator mustn't set any other permission bits, so it'll
have to be > std::numeric_limits<short>::max(), which is
potentially BiC as the underlying type of the enum will become int
[ChangeLog][QtCore][QDir] Added mkdir() method that takes a
std::optional<QFile::Permissions>; the new method transparently replaces
the older mkdir() overloads.
[ChangeLog][QtCore][QDir] Added mkpath() method that takes a
std::optional<QFile::Permissions>; this new method transparently
replaces the older mkpath() overload.
Task-number: QTBUG-132633
Change-Id: Ic2cd1e01e6ad1a2b6d3a6180c41b6a0b260a4e55
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
|
| |
|
|
|
|
|
| |
Pick-to: 6.9 6.8 6.5
Task-number: QTBUG-132633
Change-Id: Iafe4a20bacbbf55d19377e8cd04f940d4f2a66f6
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
On Windows, using a URL of "file:///c:/" as a base to be resolved with
"../" should not result in the Windows drive being removed.
[ChangeLog][QtCore][QUrl] Fixed a bug (regression from 6.7) where
resolving a base URL of an absolute file path containing a Windows drive
could result in said drive being removed (e.g., resolving "file:///c:/"
with "../" would result in "file:///").
Fixes: QTBUG-133402
Pick-to: 6.9 6.8
Change-Id: I58286b9c5e5d02363f0efffdb06f983b560340df
Reviewed-by: David Faure <david.faure@kdab.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We have some patterns for how to document certain functions, but we
also vary the sentences a lot, and you have to look up one
documentation piece and copy it, essentially. If we ever want to
change them, we end up with shotgun surgery.
So apply DRY to the documentation and start a collection of macros to
help with repetitive C++ class documentation tasks.
The first macro is for member-swap(), and this second patch is for
documentation that used the simplified phrasing ("Swaps this X with \a
other."), which this patch adopts as the text for \memberswap, too,
because it doesn't repeat the macro argument, making it easier to find a
grammatically-fitting argument than in the traditional phrasing.
This doesn't change the documentation, except as follows:
* standardizes on simpified instead of traditional phrasing for docs
that already use the \memberswap macro
* adds the "very fast and never fails" blurb, if it was missing
* changes the function's argument name to `other`, as required by
the macro.
Task-number: QTBUG-129573
Pick-to: 6.8 6.7 6.5 6.2
Change-Id: I1123e783ce0da76c5997ff74007d77504ac5b334
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Split the logic of createDirectory() into mkdir and mkpath.
This matches QDir::mkdir()/mkpath().
"mkdir()" won't confuse the compiler about which method to call,
because libc's mkdir() is either used via QT_MKDIR which expands to
"::mkdir" or directly as ::mdkir(), whereas the static
QFileSystemEngine::mkdir() is always called with full scope.
Change-Id: I31b67727cce23f1bc560432d40231a24dc560d5b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
removeDirectory() acts in two mode, rmdir (one entry) and rmpath (the
entry and all empty parent directories). This is irregular behavior, and
API with a very specific use-case (in unittests, where you create a dir
tree and want to cleanup after the test finishes).
So, split the code into rmdir() and rmpath(), which matches
QDir::rmdir() and QDir::rmpath().
On Unix, a further optimization pointed out by Thiago in review, remove
the stat() call, ::rmdir() will fail with ENOTDIR if we try to remove
anything that isn't a dir.
Change-Id: I1bbb6e6c1ce49ba6d73d3c510b449223498612fb
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
AllowUncPaths (and the whole enum) is private API that is always enabled
only on Windows (build-time decision). So, remove it and change the
unittests to match reality. Now DefaultNormalization on Windows implies
handling UNC paths.
This was suggested in code review by Thiago; since this is a hot code
path, the goal is letting the compiler keep the flags parameter to
qt_normalizePathSegments() in a register, by keeping the
PathNormalization enum as small as possible.
Drive-by change: since those lines in the unittest are changed anyway,
take the chance and use u""_s syntax.
Change-Id: I3dcf30d888a0ea9f8898e260e65c5f85655296d5
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
... for local URLs too.
For example normalizing "/Users/sam/troll/qt4.0/.." by following the
alogrithm at https://www.ietf.org/rfc/rfc3986.html#section-5.2.4:
- replace "/.." with a "/" in the input buffer, then remove the previous
path segment from the output buffer up to, and including, the
previous "/"
- next iteration will find the input buffer starting with a "/" which
is moved to the output buffer; the final result would be:
"/Users/sam/troll/"
Remove the KeepLocalTrailingSlash enumerator, it's become redundant with
this change.
De-duplicate a row in tst_QDir.
[ChangeLog][Important Behavior Change] Aligned how QDir and QUrl
normalize paths with respect to preserving a trailing slash. That is,
QDir::cleanPath("/b/.") and
QUrl("file:///b/.).toString(QUrl::NormalizePathSegments) will return
"/b/" and "file:///b/" respectively. For more details see:
https://www.ietf.org/rfc/rfc3986.html#section-5.2.4
Task-number: QTBUG-128940
Change-Id: Id5a4bdab14e7312a60b1b54de07e5d9f3e8aa40a
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Both APFS and HFS+ can be both case-sensitive and case-insensitive
(the default), and the mounted file system may be any other file
system than these two as well, so hard-coding to case-sensitive
is not sufficient.
Pick-to: 6.8
Task-number: QTBUG-28246
Task-number: QTBUG-31103
Change-Id: Ibdb902df3f169b016a519f67ad5a79e6afb6aae3
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
|
| |
|
|
|
|
|
|
| |
'out' is at the first dot, so we only need to backtrack to the first
preceding slash, before removing the previous path segment.
Change-Id: I2e0be0583d4e9e984305a52f50a51801461077ba
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This loop backtracked multiple '/'s for local URLs, but for such URLs,
only the first slash is copied to the output stream; from the first
if-block in the do-while loop:
if (in[0] == u'/') {
*out++ = *in++;
while (in < end && in[0] == u'/') {
if (isRemote)
*out++ = *in++;
else
++in;
Change-Id: I09b79e3b859ecc7f8c20b2cf9c3ce3c2035668a7
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
|
| |
|
|
|
| |
Change-Id: I7a8ccd149b706e7822011cb40d86bd977bddabbe
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Removing the slash would be a drastic change in behavior. We can expect
many people to rely on the trailing slash to string-append further path
segments without inserting an extra slash.
Amends commit e7bcf41c0b23d83cfb31f966454945c705589a99.
Pick-to: 6.8 6.7 6.5
Fixes: QTBUG-128940
Change-Id: I71dfc957f383e4648b3b47a40aeb796d7237fb00
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Commit 4b1547adc9b195e6acc90471fc48dec7ee0c429d rewrote
mergePathSegments() but got one thing wrong: that ".." on a "//" should
only remove one slash, not all of them. That behavior was introduced by
commit eaf4438b3511c8380b9b691b656a87a60e342e2 to match what browsers
do.
QUrl will use the local file behavior if the URL scheme is "file",
unlike the browsers.
Task-number: QTBUG-120396
Pick-to: 6.5 6.7 6.8 6.8.0
Change-Id: I8a96935cf6c742259c9dfffd17e8fd3cfde46e25
Reviewed-by: David Faure <david.faure@kdab.com>
|
| |
|
|
|
|
|
|
|
|
|
| |
Since qt_normalizePathSegments very often modifies the path, pass that
as pointer, and return a boolean with whether the path is attempting to
go up above the root.
Pick-to: 6.8
Change-Id: I851fcb94db4606a6bd97fffd81910930dea8222a
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: David Faure <david.faure@kdab.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
Commit 4b1547adc9b195e6acc90471fc48dec7ee0c429d rewrote the latter for
simplicity and performance, so copy it over with intent to merging the
two together. In this copy, however, we keep the behavior introduced by
commit eaf4438b3511c8380b9b691b656a87a60e342e2, which made the
normalization match the behavior found in browsers, but didn't apply to
QUrl::resolved (that's the next commit)
Task-number: QTBUG-120396
Pick-to: 6.5 6.7 6.8 6.8.0
Change-Id: I2670423f6c6a5339771ffffdf15ebad46fd25cb4
Reviewed-by: David Faure <david.faure@kdab.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
By extending IteratorFlag so that it replaces both QDir::Filter and
QDirIterator::IteratorFlag enums, but with better defaults (based on how
QDir/Iterator is used in 15-20 years worth of code in Qt and KDE).
Make the QDirListing(QDir ~~) ctor private, also change it to use
QDirIterator::IteratatorFlags; it will be used to port existing code.
If QDir is ported to use QDirListing::IteratorFlags, instead of
QDir::Filters, a public QDirListing(QDir) constructor can then be added.
Pick-to: 6.8
Fixes: QTBUG-125504
Task-number: QTBUG-125859
Change-Id: Ide4ff8279f554029ac30d0579b0e8373ed4337f7
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
QDirSortItem contains three implicitly-shared members (two QStrings
and one QFileInfo), so the mere default-initialization of the
QDirSortItem[n] array with which we initialize the QScopedArrayPointer
will take quite some time.
Using QVarLengthArray, OTOH, delays construction until we have the
data to initialize the sort items, saving n default constructor and n
move assignment operator calls, plus the memory allocation for the
case where we have less than 65 elements to sort.
This code precedes the start of the public history, but the
emplacement won't work before 905bc6293354a0d3ee832b6dd3f632a647f809f3
introduced the QDirSortItem ctor, so not picking back further than
that.
Pick-to: 6.7
Change-Id: I262217eabaded2a6aef08b87fc6369812bc8958a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This makes the ownership of the returned pointer clearer. It also
matches reality, some call sites were already storing the pointer in a
unique_ptr.
Also shorten the function name to "createLegacyEngine", you have to read
its docs anyway to figure out what it does.
Drive-by changes: less magic numbers; use sliced(); return nullptr
instead of `0`.
Change-Id: I637759b4160b28b15adf5f6548de336887338dab
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
|
| |
|
|
|
|
|
|
|
|
| |
Bootstrapped tools don't usually need to list directories; they should
operate on file lists passed to it by the build system instead.
This may deserve a QT_FEATURE.
Change-Id: I01ec3c774d9943adb903fffd17b7ecfba2702fc5
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
The QStringView counterpart is somewhat faster because it doesn't go
through the UTF-16 codec in QUtf16::convertToUnicode(), which tries to
detect the BOM.
I've included QString::fromWCharArray in this because:
a) it's used extensively in Windows code
b) wide chars in memory probably don't have BOMs anyway
Change-Id: I01ec3c774d9943adb903fffd17b815be4d2ab8ba
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
|
| |
|
|
|
|
|
|
|
|
|
| |
Use QDirListing in the Bootstrap build instead of QDirIterator.
Drive-by changes:
- more const variables
- use emplace_back() instead of append() where appropriate
Change-Id: Ie1f0d03856e557c4bfabfff38a87edc7da86d091
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
|
| |
|
|
|
|
|
|
| |
... to describe the comparison operators provided by these classes.
Task-number: QTBUG-120303
Change-Id: I611a1801eb038586bfe57be9b502b6f17f3d5742
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
|
| |
|
|
|
|
|
|
|
|
|
|
| |
QDir had operator==() and operator!=() defined as public member
functions, so use QT_CORE_REMOVED_SINCE and removed_api.cpp to get
rid of these methods and replace them with a hidden friend.
Use QTestPrivate::testEqualityOperators() helper function in unit-tests.
Task-number: QTBUG-120303
Change-Id: I86c2ba18b8b114efd9f62fc2fd628bc9065b04b2
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
|
| |
|
|
|
|
|
| |
Task-number: QTBUG-110403
Pick-to: 6.5
Change-Id: Ie20a831f22212d56659cf3c6940d17134ab5f2c5
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
|
| |
|
|
|
|
|
|
| |
The Find Files example is gone.
Pick-to: 6.5
Change-Id: I63bc33c3b9db7c8bfcf07fbcee0182a492c01dbd
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
|
| |
|
|
|
|
|
|
|
| |
After commit b5a54d488cfc94a3, we now use QCollator and so no toLower()
when caching the filename, we can re-use it from the cache after
sorting.
Change-Id: I8602a11c6f68cfe61db3ec6330596066cd257dab
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
Return the file engine impl of QFileInfo::completeBaseName() and
QDir::absolutePath() and QFileInfo::fileName() (based on
QAbstractFileEngine::BaseName) if the file engine impl is valid.
Amends f77668ffec48d8aaad7c74069c6f3e770a305ae1.
Pick-to: 6.5 6.4 6.2 5.15
Task-number: QTBUG-98974
Change-Id: I28a8c75a6f25e30012b0791c12dbde51bfe8f62c
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
|
| |
|
|
|
|
|
|
| |
And don't use toLower() as QString::compare() and QCollator::compare()
can compare case-insensitively.
Change-Id: I999d787cb77e10a101da75d1bf0a5baf096a5c9b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
|
| |
|
|
|
|
|
|
|
|
| |
This improves the performance of tst_QDir_10000::iDontWantAnyStat
(QDir::entryList Unsorted)
from 9.7ms to 7.2ms, i.e. the same as iDontWantAnyStatIterator
(QDirIterator).
Change-Id: I3faf8af1a55575df97912b1ce720492c8fd903c9
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
|
| |
|
|
|
|
|
|
|
|
|
| |
Add some details about the support of Qt apis (QFile, QDir, QFileInfo)
for Android content uris.
Fixes: QTBUG-99664
Task-number: QTBUG-98974
Pick-to: 6.5 6.4 6.2 5.15
Change-Id: I4b884623702ccad116d47049e34ccddfe21f83ca
Reviewed-by: Nicholas Bennett <nicholas.bennett@qt.io>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
QDir caches data in mutable variables. Because of no protection, two
threads calling for instance QDir::count on two independent but shared
copies of a QDir object caused a data race.
Running the tst_QDir_tree and tst_QDir_10000 three times with and
without this change show no change beyond the difference between
each result. For instance tst_QDir_tree::thousandFiles:"src" took
36/35/37 ms before the change and 35/35/35 ms after.
This makes sense because the time to handle mutexes is very little
compared the time to make file operations.
Fixes: QTBUG-105753
Change-Id: I6886f84521410f88cce2b25f0cce8cfc3fea1a0b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
|
| |
|
|
|
|
| |
Task-number: QTBUG-105753
Change-Id: I7f3473ce21e71ccd04ff9f2575244167b5c3e3a4
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
The predicate passed to e.g. a std::sort shouldn't modify the objects
it's called on, so move filling the cache to the QDirSortItem
constructor where possible. While that can't be done in all cases, e.g.
filename_cache is used as the tie-breaker when two items have the same
time or type ...etc, so it's only assigned to _if_ needed, we can at
least move some stuff out of the predicate to the QDirSortItem c'tor.
Drive-by change: replace comment with asserts
Change-Id: I0199797ab8e261fe3c0fcb791cfc69b23b6fdc48
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
PASS : tst_QDir_10000::sorted_byTime()
RESULT : tst_QDir_10000::sorted_byTime():
345 msecs per iteration (total: 345, iterations: 1)
PASS : tst_QDir_10000::sorted_byTime()
RESULT : tst_QDir_10000::sorted_byTime():
0.000015 msecs per iteration (total: 54, iterations: 262144)
Change-Id: I7976c8668aa821d2b7ed3f774f29bdf1ba4a99d1
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
|
| |
|
|
|
|
|
|
|
|
| |
Get those values from the file engine instead, this is relevant
especially on Android for content uris.
Pick-to: 6.5 6.4 6.2
Task-number: QTBUG-98974
Change-Id: I65fe4c59e5f1feed0dcf14cc8988b4a40d9d979e
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
|
| |
|
|
|
|
|
|
|
| |
This saves (mostly in corelib/time/) some complications that used to
arise from needing different code-paths for different time-specs.
Task-number: QTBUG-108199
Change-Id: I5dbd09859fce7599f1ba761f8a0bfc4633d0bef9
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is a semantic patch using ClangTidyTransformator as in
qtbase/df9d882d41b741fef7c5beeddb0abe9d904443d8, but extended to
handle typedefs and accesses through pointers, too:
const std::string o = "object";
auto hasTypeIgnoringPointer = [](auto type) { return anyOf(hasType(type), hasType(pointsTo(type))); };
auto derivedFromAnyOfClasses = [&](ArrayRef<StringRef> classes) {
auto exprOfDeclaredType = [&](auto decl) {
return expr(hasTypeIgnoringPointer(hasUnqualifiedDesugaredType(recordType(hasDeclaration(decl))))).bind(o);
};
return exprOfDeclaredType(cxxRecordDecl(isSameOrDerivedFrom(hasAnyName(classes))));
};
auto renameMethod = [&] (ArrayRef<StringRef> classes,
StringRef from, StringRef to) {
return makeRule(cxxMemberCallExpr(on(derivedFromAnyOfClasses(classes)),
callee(cxxMethodDecl(hasName(from), parameterCountIs(0)))),
changeTo(cat(access(o, cat(to)), "()")),
cat("use '", to, "' instead of '", from, "'"));
};
renameMethod(<classes>, "count", "size");
renameMethod(<classes>, "length", "size");
except that the on() matcher has been replaced by one that doesn't
ignoreParens().
a.k.a qt-port-to-std-compatible-api V5 with config Scope: 'Container'.
Added two NOLINTNEXTLINEs in tst_qbitarray and tst_qcontiguouscache,
to avoid porting calls that explicitly test count().
Change-Id: Icfb8808c2ff4a30187e9935a51cad26987451c22
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
|
| |
|
|
|
|
|
|
|
|
|
| |
It had the d_func()s it needed, but wasn't using them.
This prepares the way for QEDSP-ification.
Pick-to: 6.4
Task-number: QTBUG-105753
Change-Id: I8b7ba79818f27ae6a2281b276b95b94673f05648
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
|
| |
|
|
|
|
|
|
|
| |
Added comment to clarify returned drives from QDir::drives()
Task-number: QTBUG-106896
Pick-to: 5.15 6.2 6.4
Change-Id: I7cf9642b11f9000a5e6382a2b29070ab2cd6442e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
|
| |
|
|
|
|
|
|
|
| |
static QFile::exists() calls static QFileInfo::exists().
Mention QFileInfo::exists in the QDir docs details.
Change-Id: I35ba9b00f33376a4ceb2f27ab587d368a95e4fe5
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is semantic patch using ClangTidyTransformator:
auto QtContainerClass = expr(hasType(namedDecl(hasAnyName(<classes>)))).bind(o)
makeRule(cxxMemberCallExpr(on(QtContainerClass),
callee(cxxMethodDecl(hasAnyName({"count", "length"),
parameterCountIs(0))))),
changeTo(cat(access(o, cat("size"), "()"))),
cat("use 'size()' instead of 'count()/length()'"))
a.k.a qt-port-to-std-compatible-api with config Scope: 'Container'.
<classes> are:
// sequential:
"QByteArray",
"QList",
"QQueue",
"QStack",
"QString",
"QVarLengthArray",
"QVector",
// associative:
"QHash",
"QMultiHash",
"QMap",
"QMultiMap",
"QSet",
// Qt has no QMultiSet
Change-Id: Ibe8837be96e8d30d1846881ecd65180c1bc459af
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
[ChangeLog][QtCore][QDir] The count() function now returns, and the
indexing operator now takes, qsizetype (was: uint and int,
respectively).
[ChangeLog][Potentially Source-Incompatible Changes][QDir] The count()
function now returns qsizetype (was: uint).
Task-number: QTBUG-103525
Change-Id: Ib84af36f6a95d9a0d1090a2d6fb973a4e363550c
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Port ints that should be qsizetype. None of these are likely to cause
bugs, because both path lengths and number of directory entries are
usually limited by the OS, not by INT_MAX.
As a drive-by, replace length() with size() and port some functions
from QString to QStringView.
Pick-to: 6.4 6.3 6.2
Task-number: QTBUG-103525
Change-Id: I79eb6d580631346a1e77eb1c7a73a3880943794e
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
|
| |
|
|
|
|
| |
Task-number: QTBUG-99313
Change-Id: I4dd219dcb9181bf23feb6639821764cd5dc19a24
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
|
| |
|
|
|
|
|
|
|
|
|
| |
Indexed for loops are prone to int/qsizetype mismatches, so use ranged
for loops where possible.
Pick-to: 6.4 6.3 6.2
Task-number: QTBUG-103525
Change-Id: Ia3e97a6b2924f92d3f7fb1a7ae075b59188006e9
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
|