mirror of
https://github.com/nextcloud/desktop.git
synced 2025-10-26 11:17:43 +00:00
vfs: use native separators for displayed error message
i.e. `C:\Nextcloud` instead of `C:/Nextcloud` Signed-off-by: Jyrki Gadinger <nilsding@nilsding.org>
This commit is contained in:
parent
0b31319c79
commit
7cdf15bea9
@ -71,16 +71,17 @@ Result<void, QString> Vfs::checkAvailability(const QString &path, Vfs::Mode mode
|
||||
#ifdef Q_OS_WIN
|
||||
if (mode == Mode::WindowsCfApi) {
|
||||
const auto info = QFileInfo(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(path);
|
||||
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
|
||||
|
||||
Loading…
Reference in New Issue
Block a user