Mercurial > dedupe
changeset 89:cfd2a417475a
Avoid multiple filesystem searches.
Some cosmetics.
| author | Tom Fredrik Blenning Klaussen <bfg@bfgconsult.no> |
|---|---|
| date | Mon, 21 Oct 2013 16:19:23 +0200 |
| parents | 6e1d4d2fc49b |
| children | 7b7a959c993b |
| files | DataController.cpp |
| diffstat | 1 files changed, 6 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/DataController.cpp Thu Oct 10 16:53:06 2013 +0200 +++ b/DataController.cpp Mon Oct 21 16:19:23 2013 +0200 @@ -41,7 +41,7 @@ } catch (boost::system::system_error &e) { printf("%s\n", dir_iter->path().c_str()); - std::cout << e.what() <<std::endl; + std::cout << e.what() << std::endl; } if (!wpath.empty()) { if (fs::is_directory(dir_iter->status()) ) { @@ -75,15 +75,15 @@ void DataController::findFiles(const QDir& dir, FileDBLink& dblink) { - QStringList list = findFiles(dir); + QStringList paths = findFiles(dir); QDateTime last = QDateTime::currentDateTime(); - dblink.keepOnlyFromPrefix(dir.path(), list); + dblink.keepOnlyFromPrefix(dir.path(), paths); std::auto_ptr<QProgressBar> bar; - progressMax = list.size(); + progressMax = paths.size(); if (showGUI) { bar = std::auto_ptr<QProgressBar>(new QProgressBar()); @@ -100,7 +100,8 @@ int n = 0; emit populateProgress(n); - foreach(QString filename, findFiles(dir)) { + + foreach(QString filename, paths) { try { dblink.updateIfModified(filename); }
