mirror of
https://github.com/nextcloud/desktop.git
synced 2024-10-28 07:54:49 +03:00
refactoring as requested in pull request
This commit is contained in:
parent
018cc54a94
commit
79f7ea0965
4 changed files with 6 additions and 6 deletions
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Reference in a new issue