Use set to track visited directories instead of removing duplicates

depth-refraction
elsid 2 years ago
parent b55313c08e
commit ff7fcd752a
No known key found for this signature in database
GPG Key ID: 4DE04C198CBA7625

@ -9,6 +9,7 @@
#include <algorithm>
#include <mutex>
#include <thread>
#include <unordered_set>
#include <apps/launcher/utils/cellnameloader.hpp>
@ -234,10 +235,12 @@ void Launcher::DataFilesPage::populateFileViews(const QString& contentModelName)
for (auto& currentDir : directories)
currentDir = QDir(QDir::cleanPath(currentDir)).canonicalPath();
// add directories, archives and content files
directories.removeDuplicates();
for (const auto& currentDir : directories)
std::unordered_set<QString> visitedDirectories;
for (const QString& currentDir : directories)
{
if (!visitedDirectories.insert(currentDir).second)
continue;
// add new achives files presents in current directory
addArchivesFromDir(currentDir);

Loading…
Cancel
Save