Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[stable-3.16] vfs: fix root folder detection regression #7878

Merged
merged 2 commits into from
Feb 18, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions src/common/vfs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/

#include "config.h"

Check failure on line 19 in src/common/vfs.cpp

View workflow job for this annotation

GitHub Actions / build

src/common/vfs.cpp:19:10 [clang-diagnostic-error]

'config.h' file not found
#include "vfs.h"
#include "plugin.h"
#include "version.h"
Expand Down Expand Up @@ -71,16 +71,17 @@
#ifdef Q_OS_WIN
if (mode == Mode::WindowsCfApi) {
const auto info = QFileInfo(path);
if (QDir(info.canonicalPath()).isRoot()) {
return tr("Please choose a different location. %1 is a drive. It doesn't support virtual files.").arg(path);
const auto nativePath = QDir::toNativeSeparators(path);
if (QDir(info.canonicalFilePath()).isRoot()) {
return tr("Please choose a different location. %1 is a drive. It doesn't support virtual files.").arg(nativePath);
}
if (const auto fileSystemForPath = FileSystem::fileSystemForPath(info.absoluteFilePath());
fileSystemForPath != QLatin1String("NTFS")) {
return tr("Please choose a different location. %1 isn't a NTFS file system. It doesn't support virtual files.").arg(path);
return tr("Please choose a different location. %1 isn't a NTFS file system. It doesn't support virtual files.").arg(nativePath);
}
const auto type = GetDriveTypeW(reinterpret_cast<const wchar_t *>(QDir::toNativeSeparators(info.absoluteFilePath().mid(0, 3)).utf16()));
if (type == DRIVE_REMOTE) {
return tr("Please choose a different location. %1 is a network drive. It doesn't support virtual files.").arg(path);
return tr("Please choose a different location. %1 is a network drive. It doesn't support virtual files.").arg(nativePath);
}
}
#else
Expand Down
Loading