From: Christian Kamm Date: Tue, 19 Jan 2016 08:58:00 +0000 (+0100) Subject: Win: Fix filesystem detection for exFAT workaround #2701 X-Git-Tag: archive/raspbian/3.16.7-1_deb13u1+rpi1~1^2~1254^2~55 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=17895f3a30bf44469e183af7860333a5918ef9f0;p=nextcloud-desktop.git Win: Fix filesystem detection for exFAT workaround #2701 --- diff --git a/src/libsync/filesystem.cpp b/src/libsync/filesystem.cpp index 3cd2781cf..09fd16826 100644 --- a/src/libsync/filesystem.cpp +++ b/src/libsync/filesystem.cpp @@ -476,9 +476,10 @@ bool FileSystem::fileExists(const QString& filename, const QFileInfo& fileInfo) QString FileSystem::fileSystemForPath(const QString & path) { // See also QStorageInfo (Qt >=5.4) and GetVolumeInformationByHandleW (>= Vista) - QString drive = path.left(3); - if (! drive.endsWith(":\\")) + QString drive = path.left(2); + if (! drive.endsWith(":")) return QString(); + drive.append('\\'); const size_t fileSystemBufferSize = 4096; TCHAR fileSystemBuffer[fileSystemBufferSize]; diff --git a/src/libsync/syncjournaldb.cpp b/src/libsync/syncjournaldb.cpp index 1fa8c54c9..d492efa07 100644 --- a/src/libsync/syncjournaldb.cpp +++ b/src/libsync/syncjournaldb.cpp @@ -112,8 +112,9 @@ static QString defaultJournalMode(const QString & dbPath) // See #2693: Some exFAT file systems seem unable to cope with the // WAL journaling mode. They work fine with DELETE. QString fileSystem = FileSystem::fileSystemForPath(dbPath); + qDebug() << "Detected filesystem" << fileSystem << "for" << dbPath; if (fileSystem.contains("FAT")) { - qDebug() << "Detected filesystem" << fileSystem << "- using DELETE journal mode"; + qDebug() << "Filesystem contains FAT - using DELETE journal mode"; return "DELETE"; } #else