diff --git a/krusader/FileSystem/filesystem.h b/krusader/FileSystem/filesystem.h --- a/krusader/FileSystem/filesystem.h +++ b/krusader/FileSystem/filesystem.h @@ -142,10 +142,8 @@ /// Returns true if this filesystem is currently refreshing the current directory. inline bool isRefreshing() const { return _isRefreshing; } - /// Delete or trash files in the current directory. Implemented async. - void deleteFiles(const QStringList &fileNames, bool moveToTrash = true); /// Delete or trash arbitrary files. Implemented async. Universal refresh not fully implemented. - void deleteAnyFiles(const QList &urls, bool moveToTrash); + void deleteFiles(const QList &urls, bool moveToTrash); /// Return the input URL with a trailing slash if absent. static QUrl ensureTrailingSlash(const QUrl &url); diff --git a/krusader/FileSystem/filesystem.cpp b/krusader/FileSystem/filesystem.cpp --- a/krusader/FileSystem/filesystem.cpp +++ b/krusader/FileSystem/filesystem.cpp @@ -149,13 +149,7 @@ return true; } -void FileSystem::deleteFiles(const QStringList &fileNames, bool moveToTrash) -{ - // get absolute URLs for file names - deleteAnyFiles(getUrls(fileNames), moveToTrash); -} - -void FileSystem::deleteAnyFiles(const QList &urls, bool moveToTrash) +void FileSystem::deleteFiles(const QList &urls, bool moveToTrash) { KrJob *krJob = KrJob::createDeleteJob(urls, moveToTrash); connect(krJob, &KrJob::started, this, [=](KIO::Job *job) { diff --git a/krusader/FileSystem/filesystemprovider.cpp b/krusader/FileSystem/filesystemprovider.cpp --- a/krusader/FileSystem/filesystemprovider.cpp +++ b/krusader/FileSystem/filesystemprovider.cpp @@ -70,7 +70,7 @@ // assume all URLs use the same filesystem FileSystem *fs = getFilesystemInstance(urls.first()); - fs->deleteAnyFiles(urls, moveToTrash); + fs->deleteFiles(urls, moveToTrash); } void FileSystemProvider::refreshFilesystems(const QUrl &directory, bool removed) @@ -98,7 +98,7 @@ // various places, we don't know if they were (re)moved. Refreshing is also fast enough. const QUrl fileSystemDir = fs->currentDirectory(); if ((!fs->hasAutoUpdate() && (fileSystemDir == FileSystem::cleanUrl(directory) || - (fileSystemDir.scheme() == "virt" && !fs->isRoot()))) + (fs->type() == FileSystem::FS_VIRTUAL && !fs->isRoot()))) // also refresh if a parent directory was (re)moved (not detected by file watcher) || (removed && directory.isParentOf(fileSystemDir))) { fs->refresh(); diff --git a/krusader/Panel/panelfunc.cpp b/krusader/Panel/panelfunc.cpp --- a/krusader/Panel/panelfunc.cpp +++ b/krusader/Panel/panelfunc.cpp @@ -673,7 +673,8 @@ void ListPanelFunc::deleteFiles(bool moveToTrash) { - if (files()->type() == FileSystem::FS_VIRTUAL && files()->isRoot()) { + const bool isVFS = files()->type() == FileSystem::FS_VIRTUAL; + if (isVFS && files()->isRoot()) { // only virtual deletion possible removeVirtualFiles(); return; @@ -690,7 +691,7 @@ // now ask the user if he/she is sure: const QList confirmedUrls = confirmDeletion( - files()->getUrls(fileNames), moveToTrash, files()->type() == FileSystem::FS_VIRTUAL, false); + files()->getUrls(fileNames), moveToTrash, isVFS, false); if (confirmedUrls.isEmpty()) return; // nothing to delete @@ -700,11 +701,7 @@ panel->prepareToDelete(); // let the filesystem do the job... - QStringList confirmedFileNames; - for (QUrl fileUrl : confirmedUrls) { - confirmedFileNames.append(fileUrl.fileName()); - } - files()->deleteFiles(confirmedFileNames, moveToTrash); + files()->deleteFiles(confirmedUrls, moveToTrash); } QList ListPanelFunc::confirmDeletion(const QList &urls, bool moveToTrash,