qt6-bb10/src/corelib/io
Fabian Kosmale 7b1b1d990b QFileSelector: Preserve path to root directory
While QFileSelector is documented to work on files, select accepts
arbitrary URLs. Moreover, the QML engine can end up intercepting
arbitrary (user provided) URLs, including to directories.
Prior to this change, passing "file:///" or "/" to the function would
break: We would temporarily get a "//" path, which is invalid, and thus
we would return an invalid in the end.
Prevent this by only appending a slash to the path when it doesn't have
one.

Fixes: QTBUG-85410
Pick-to: 6.2
Change-Id: I1d2807a9d225df611c3a5e871e3c1d90a6a25953
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2021-07-21 19:37:16 +02:00
..
forkfd_qt.cpp forkfd: Add C11 and C++11 atomic support 2019-08-20 16:56:55 -07:00
qabstractfileengine.cpp Implement QFileInfo::junctionTarget(), adjust auto-test 2021-06-05 01:16:06 +02:00
qabstractfileengine_p.h Implement QFileInfo::junctionTarget(), adjust auto-test 2021-06-05 01:16:06 +02:00
qbuffer.cpp Doc/QtBase: replace some 0 with \nullptr 2020-01-26 17:52:02 +01:00
qbuffer.h Whitespace cleanup in corelib/io 2020-10-20 21:09:00 +02:00
qdataurl.cpp
qdataurl_p.h
qdebug.cpp QDebug: add missing docs for new QVLA streaming operator 2021-06-15 00:48:46 +02:00
qdebug.h QDebug: add support for QVarLengthArray 2021-06-13 21:01:24 +02:00
qdebug_p.h Consolidate debug string generation 2021-05-31 21:50:07 +03:00
qdir.cpp Unify behavior for long path or UNC prefix removal 2021-06-05 01:16:06 +02:00
qdir.h Whitespace cleanup in corelib/io 2020-10-20 21:09:00 +02:00
qdir_p.h Standardize on unique_ptr to hold QAbstractFileEngine 2019-07-28 12:16:22 +00:00
qdiriterator.cpp QDir(Iterator): code tidies 2021-05-16 11:42:05 +02:00
qdiriterator.h Whitespace cleanup in corelib/io 2020-10-20 21:09:00 +02:00
qfile.cpp Extend documentation for QFile:copy() 2021-06-23 20:09:46 +02:00
qfile.h Fix some qdoc warnings: std::filesystem::path getters 2020-09-22 20:56:07 +02:00
qfile_p.h QFile: code tidies 2021-05-17 11:07:35 +02:00
qfiledevice.cpp QFileDevice: code tidies 2021-05-14 21:26:40 +02:00
qfiledevice.h Turn QFileDevice::MemoryMapFlags into a proper QFlag 2020-09-02 21:53:42 +00:00
qfiledevice_p.h QFile: hold engine by unique_ptr 2019-07-19 17:08:45 +02:00
qfileinfo.cpp QFileInfo: remove a couple of QFlags->int implicit conversions 2021-06-17 00:53:36 +02:00
qfileinfo.h Implement QFileInfo::junctionTarget(), adjust auto-test 2021-06-05 01:16:06 +02:00
qfileinfo_p.h Standardize on unique_ptr to hold QAbstractFileEngine 2019-07-28 12:16:22 +00:00
qfileselector.cpp QFileSelector: Preserve path to root directory 2021-07-21 19:37:16 +02:00
qfileselector.h
qfileselector_p.h
qfilesystemengine.cpp Implement QFileInfo::junctionTarget(), adjust auto-test 2021-06-05 01:16:06 +02:00
qfilesystemengine_mac.mm Fix compile error on iOS 2020-05-02 18:53:03 +02:00
qfilesystemengine_p.h Implement QFileInfo::junctionTarget(), adjust auto-test 2021-06-05 01:16:06 +02:00
qfilesystemengine_unix.cpp QF*Engine: port a couple of QFlags->int implicit conversions to toInt() 2021-06-23 12:49:19 +02:00
qfilesystemengine_win.cpp Implement QFileInfo::junctionTarget(), adjust auto-test 2021-06-05 01:16:06 +02:00
qfilesystementry.cpp Unify behavior for long path or UNC prefix removal 2021-06-05 01:16:06 +02:00
qfilesystementry_p.h Unify behavior for long path or UNC prefix removal 2021-06-05 01:16:06 +02:00
qfilesystemiterator_p.h Use Q_DISABLE_COPY_MOVE for private classes 2018-12-12 07:23:54 +00:00
qfilesystemiterator_unix.cpp Convert a couple of APIs to use views 2020-10-06 11:16:36 +02:00
qfilesystemiterator_win.cpp Add ; to Q_UNUSED 2020-07-07 11:51:48 +02:00
qfilesystemmetadata_p.h QFileSystemMetaData: code tidies 2021-05-17 00:11:28 +02:00
qfilesystemwatcher.cpp Adjust code format, add space after 'if' 2020-11-16 12:53:37 +00:00
qfilesystemwatcher.h Modernize the "filesystemwatcher" feature 2018-09-27 08:18:55 +00:00
qfilesystemwatcher_fsevents.mm Fix race in QFseventsFileSystemWatcher destructor 2020-07-24 09:47:57 +00:00
qfilesystemwatcher_fsevents_p.h Use QList instead of QVector in corelib 2020-06-25 22:30:59 +02:00
qfilesystemwatcher_inotify.cpp fix: Optimize the performance of the inotify file system monitoring program。 2021-04-30 09:37:03 +00:00
qfilesystemwatcher_inotify_p.h Modernize the "filesystemwatcher" feature 2018-09-27 08:18:55 +00:00
qfilesystemwatcher_kqueue.cpp Introduce QSocketNotifier::activate(QSocketDescriptor, QSN::Type) 2020-04-16 13:52:11 +02:00
qfilesystemwatcher_kqueue_p.h Add override to addPaths and removePaths in kqueue filesystem watcher 2021-04-26 17:35:55 +00:00
qfilesystemwatcher_p.h Remove winrt 2020-06-06 20:25:49 +02:00
qfilesystemwatcher_polling.cpp Don't store iterators on QHash while erasing 2020-04-01 21:33:57 +01:00
qfilesystemwatcher_polling_p.h Modernize the "filesystemwatcher" feature 2018-09-27 08:18:55 +00:00
qfilesystemwatcher_win.cpp QFileSystemWatcher: use nullptr, instead of 0 2020-10-20 01:25:38 +02:00
qfilesystemwatcher_win_p.h Replace discouraged Q_MOVABLE_TYPE by Q_RELOCATABLE_TYPE 2020-11-30 17:16:21 +01:00
qfsfileengine.cpp QFSFileEngine: code tidies 2021-05-17 00:11:26 +02:00
qfsfileengine_iterator.cpp
qfsfileengine_iterator_p.h
qfsfileengine_p.h Whitespace cleanup in corelib/io 2020-10-20 21:09:00 +02:00
qfsfileengine_unix.cpp QF*Engine: port a couple of QFlags->int implicit conversions to toInt() 2021-06-23 12:49:19 +02:00
qfsfileengine_win.cpp Switch-ify QFSFileEngine::fileName and update implementation 2021-06-08 00:05:44 +02:00
qiodevice.cpp Clarify readLine() behavior on sequential devices 2021-07-06 14:50:55 +03:00
qiodevice.h Documentation: Fix broken links to QIODeviceBase::OpenMode 2021-04-21 15:01:13 +02:00
qiodevice_p.h QLocalSocket/Win: avoid double buffering on write 2021-06-09 20:29:04 +03:00
qiodevicebase.h Disentangle QIODevice dependencies 2020-08-15 20:55:31 +02:00
qipaddress.cpp Allow surrogate pairs for various "single character" locale data 2020-02-17 14:55:24 +01:00
qipaddress_p.h Make QIPAddressUtils::toString() const-correct for IPv6 2019-06-15 18:40:37 +02:00
qlockfile.cpp QLockFile: don't use the local timezone to compare file times 2021-04-26 04:42:30 +00:00
qlockfile.h Add std::chrono overloads for QLockFile functions 2021-04-01 15:38:08 +02:00
qlockfile_p.h
qlockfile_unix.cpp QLockFile/Unix: remove the " (deleted)" suffix from kernel-supplied names 2021-04-26 04:42:32 +00:00
qlockfile_win.cpp Whitespace cleanup in corelib/io 2020-10-20 21:09:00 +02:00
qloggingcategory.cpp Clarify that QLoggingCategory works independent of compiler build type 2021-05-27 14:28:17 +02:00
qloggingcategory.h Unify QLoggingCategory's two constructors 2020-07-27 11:19:59 +02:00
qloggingregistry.cpp QLoggingSettingsParser: port setContent() to QStringView 2021-06-16 13:22:18 +02:00
qloggingregistry_p.h QLoggingSettingsParser: port setContent() to QStringView 2021-06-16 13:22:18 +02:00
qnoncontiguousbytedevice.cpp Hold QRingBuffer and QNonContiguousByteDevice in shared_ptr 2021-07-14 20:05:41 +02:00
qnoncontiguousbytedevice_p.h Hold QRingBuffer and QNonContiguousByteDevice in shared_ptr 2021-07-14 20:05:41 +02:00
qprocess.cpp QProcess/Win: avoid double buffering on write 2021-06-18 22:20:47 +03:00
qprocess.h QProcess/Win: avoid double buffering on write 2021-06-18 22:20:47 +03:00
qprocess_darwin.mm
qprocess_p.h QProcess/Win: avoid double buffering on write 2021-06-18 22:20:47 +03:00
qprocess_unix.cpp QProcess: untangle platform-specific details 2021-06-04 14:50:47 +03:00
qprocess_win.cpp QProcess/Win: cleanup startProcess() 2021-06-19 17:59:40 +03:00
qresource.cpp QDuplicateTracker: accept the number of elements to reserve as a ctor argument 2021-07-14 08:57:39 +02:00
qresource.h Whitespace cleanup in corelib/io 2020-10-20 21:09:00 +02:00
qresource_iterator.cpp
qresource_iterator_p.h
qresource_p.h More nullptr usage in headers 2019-03-14 07:37:52 +00:00
qsavefile.cpp QSaveFile: code tidies 2021-05-16 17:22:30 +02:00
qsavefile.h
qsavefile_p.h
qsettings.cpp Port QSettingsPrivate::get() to std::optional 2021-06-30 07:30:13 +02:00
qsettings.h Use Core library for qmake instead of the Bootstrap library 2021-02-25 16:08:43 +01:00
qsettings_mac.cpp macOS: Don't mangle QByteArray settings with @ prefix by decoding as UTF-8 2021-07-13 00:59:49 +02:00
qsettings_p.h Port QSettingsPrivate::get() to std::optional 2021-06-30 07:30:13 +02:00
qsettings_wasm.cpp Port QSettingsPrivate::get() to std::optional 2021-06-30 07:30:13 +02:00
qsettings_win.cpp QWinSettings: port readKey() helper to std::optional 2021-06-30 07:30:42 +02:00
qstandardpaths.cpp Remove usage of deprecated QStandardPaths::DataLocation 2020-10-23 11:36:47 +02:00
qstandardpaths.h Remove usage of deprecated QStandardPaths::DataLocation 2020-10-23 11:36:47 +02:00
qstandardpaths_android.cpp Fix build error when using -qtnamespace flag 2021-04-23 14:31:04 +03:00
qstandardpaths_haiku.cpp
qstandardpaths_mac.mm QStandardPaths: Add translation comment for macOS-specific item 2021-02-24 13:17:33 +01:00
qstandardpaths_unix.cpp QStandardPaths: Don't change permissions of XDG_RUNTIME_DIR 2020-11-30 19:16:21 +03:00
qstandardpaths_win.cpp Remove usage of deprecated QStandardPaths::DataLocation 2020-10-23 11:36:47 +02:00
qstorageinfo.cpp QStorageInfo: Make comparison operators hidden friends 2020-10-29 09:48:52 +01:00
qstorageinfo.h QStorageInfo: Make comparison operators hidden friends 2020-10-29 09:48:52 +01:00
qstorageinfo_mac.cpp
qstorageinfo_p.h Remove winrt 2020-06-06 20:25:49 +02:00
qstorageinfo_unix.cpp Fix a compiler warning on Android 2020-10-08 22:32:59 +02:00
qstorageinfo_win.cpp QChar: make construction from integral explicit 2020-11-15 14:41:05 +01:00
qtemporarydir.cpp
qtemporarydir.h
qtemporaryfile.cpp Fix QSaveFile and QTemporaryFile issues with windows network shares 2021-05-11 13:22:44 +02:00
qtemporaryfile.h QTemporaryFile: purge deprecated API 2020-07-20 16:06:28 +02:00
qtemporaryfile_p.h Initialize variables to make coverity happy 2019-07-05 09:33:50 +02:00
qurl.cpp Fix QUrl::fromLocalFile with long path prefix 2021-05-19 21:38:38 +02:00
qurl.h QUrl: use QFlags::toInt / qToUnderlying 2021-05-23 21:54:29 +02:00
qurl_p.h Purge redundant recoding of URL fragments from QByteArray 2020-07-27 11:25:49 +02:00
qurlidna.cpp Try to workaround bogus compiler warning in gcc 9 for ARMv7 2020-07-06 21:31:40 +02:00
qurlquery.cpp Use (new) erase()/erase_if() algorithms 2020-12-05 00:47:44 +01:00
qurlquery.h Whitespace cleanup in corelib/io 2020-10-20 21:09:00 +02:00
qurlrecode.cpp Fix -Wmaybe-uninitialized warnings 2020-09-26 11:40:21 +02:00
qwindowspipereader.cpp QLocalSocket/Win: reimplement skipData() function 2021-07-08 16:14:11 +03:00
qwindowspipereader_p.h QLocalSocket/Win: reimplement skipData() function 2021-07-08 16:14:11 +03:00
qwindowspipewriter.cpp QLocalSocket/Win: simplify flush() 2021-06-19 01:01:49 +03:00
qwindowspipewriter_p.h QLocalSocket/Win: simplify flush() 2021-06-19 01:01:49 +03:00