diff options
| author | Ahmad Samir <a.samirh78@gmail.com> | 2023-12-14 18:26:33 +0200 |
|---|---|---|
| committer | Ahmad Samir <a.samirh78@gmail.com> | 2024-02-09 18:44:23 +0200 |
| commit | 83f7125ac866ed5a2aaace56ffc866f21f9730b4 (patch) | |
| tree | 516df9233f82076d678c11733b0d2520813f18a9 /src/sql/kernel/qsqldatabase.cpp | |
| parent | 74722411d3fbfcc30d8eff98efcc627be451aea9 (diff) | |
QFileSystemIterator/Unix: use QStringDecoder
The end result is a QFileInfo constructed from the QFileSystemEntry;
QFileSystemEntry's API will at some point convert the NativePath (QBA on
Unix) to a QString, e.g. when it calls findLastSeparator().
So instead of converting the parent dir path from Utf8 to Utf16 multiple
times, store the dir path as a QString once in the constructor.
Use QStringDecoder to convert the dirent->d_name to Utf16 and check the
decoder's hasError(); which as Thiago pointed out, is more efficient
than using isValidUtf8(), throwing away the results, then converting to
unicode anyway later on in QDirIteratorPrivate::advance().
(Ironically) `QFileSystemEntry::NativePath nativePath` is still used on
Windows.
Change-Id: Icd2b130103640b502862d210d64926b99c499a01
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/sql/kernel/qsqldatabase.cpp')
0 files changed, 0 insertions, 0 deletions
