refactoring as requested in pull request

This commit is contained in:
Christian Burger 2015-05-05 16:34:01 +01:00
parent 018cc54a94
commit 79f7ea0965
4 changed files with 6 additions and 6 deletions

View file

@ -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;
}

View file

@ -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

View file

@ -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;

View file

@ -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();