diff --git a/src/gui/folder.cpp b/src/gui/folder.cpp index eec14d14d..fa50a289b 100644 --- a/src/gui/folder.cpp +++ b/src/gui/folder.cpp @@ -186,12 +186,12 @@ QString Folder::path() const return p; } -QString Folder::cleanPath(QString path) +QString Folder::cleanPath() { - QString cleanedPath = QDir::cleanPath(path); + QString cleanedPath = QDir::cleanPath(_path); if(cleanedPath.length() == 3 && cleanedPath.endsWith(":/")) - return cleanedPath.left(2); + cleanedPath.remove(2,1); return cleanedPath; } diff --git a/src/gui/folder.h b/src/gui/folder.h index ee4be5581..e2f47a2e1 100644 --- a/src/gui/folder.h +++ b/src/gui/folder.h @@ -74,7 +74,7 @@ public: /** * wrapper for QDir::cleanPath("Z:\\"), which returns "Z:\\", but we need "Z:" instead */ - static QString cleanPath(QString path); + QString cleanPath(); /** * remote folder path diff --git a/src/gui/folderman.cpp b/src/gui/folderman.cpp index 80ae20113..6e3984754 100644 --- a/src/gui/folderman.cpp +++ b/src/gui/folderman.cpp @@ -736,7 +736,7 @@ Folder *FolderMan::folderForPath(const QString &path) QString absolutePath = QDir::cleanPath(path)+QLatin1Char('/'); foreach(Folder* folder, this->map().values()) { - const QString folderPath = Folder::cleanPath(folder->path())+QLatin1Char('/'); + const QString folderPath = folder->cleanPath()+QLatin1Char('/'); if(absolutePath.startsWith(folderPath)) { //qDebug() << "found folder: " << folder->path() << " for " << absolutePath; diff --git a/src/gui/socketapi.cpp b/src/gui/socketapi.cpp index 9a71b2d31..1a7f64101 100644 --- a/src/gui/socketapi.cpp +++ b/src/gui/socketapi.cpp @@ -402,7 +402,7 @@ void SocketApi::command_RETRIEVE_FILE_STATUS(const QString& argument, QLocalSock DEBUG << "folder offline or not watched:" << argument; statusString = QLatin1String("NOP"); } else { - const QString file = QDir::cleanPath(argument).mid(Folder::cleanPath(syncFolder->path()).length()+1); + const QString file = QDir::cleanPath(argument).mid(syncFolder->cleanPath().length()+1); SyncFileStatus fileStatus = this->fileStatus(syncFolder, file, _excludes); statusString = fileStatus.toSocketAPIString();