diff --git a/src/gui/folder.cpp b/src/gui/folder.cpp index f94ba71b4..b1112e13a 100644 --- a/src/gui/folder.cpp +++ b/src/gui/folder.cpp @@ -124,6 +124,11 @@ void Folder::checkLocalPath() { const QFileInfo fi(_definition.localPath); + _canonicalLocalPath = fi.canonicalFilePath(); + if( !_canonicalLocalPath.endsWith('/') ) { + _canonicalLocalPath.append('/'); + } + if( fi.isDir() && fi.isReadable() ) { qDebug() << "Checked local path ok"; } else { @@ -161,11 +166,7 @@ QString Folder::alias() const QString Folder::path() const { - QString p(_definition.localPath); - if( ! p.endsWith('/') ) { - p.append('/'); - } - return p; + return _canonicalLocalPath; } QString Folder::shortGuiLocalPath() const @@ -198,7 +199,7 @@ void Folder::setIgnoreHiddenFiles(bool ignore) QString Folder::cleanPath() { - QString cleanedPath = QDir::cleanPath(_definition.localPath); + QString cleanedPath = QDir::cleanPath(_canonicalLocalPath); if(cleanedPath.length() == 3 && cleanedPath.endsWith(":/")) cleanedPath.remove(2,1); diff --git a/src/gui/folder.h b/src/gui/folder.h index 40ff6deb1..f5967c9b6 100644 --- a/src/gui/folder.h +++ b/src/gui/folder.h @@ -288,6 +288,7 @@ private: AccountStatePtr _accountState; FolderDefinition _definition; + QString _canonicalLocalPath; // As returned with QFileInfo:canonicalFilePath. Always ends with "/" SyncResult _syncResult; QScopedPointer _engine;