# HG changeset patch # User Tom Fredrik Blenning Klaussen # Date 1392299711 -3600 # Node ID f4ebbfa3ffae8b32c2ed3bdd0ada6cd602572609 # Parent b821d627074164997b1fb13d6829c4157888d9bf Beautify progressreport update, and do lstat rather than stat when checking if a file is a link diff -r b821d6270741 -r f4ebbfa3ffae DataController.cpp --- a/DataController.cpp Thu Feb 13 14:53:35 2014 +0100 +++ b/DataController.cpp Thu Feb 13 14:55:11 2014 +0100 @@ -7,6 +7,7 @@ #include "Exception/PermissionException.hpp" +#include #include #include @@ -47,7 +48,7 @@ if (fs::is_directory(dir_iter->status()) ) { findFiles(QString::fromStdWString(wpath), list); } - if (fs::is_regular_file(dir_iter->status()) ) { + if (fs::is_regular_file(dir_iter->symlink_status()) ) { list << QString::fromStdWString(wpath); } } @@ -79,7 +80,10 @@ QDateTime last = QDateTime::currentDateTime(); - dblink.keepOnlyFromPrefix(dir.path(), paths); + qDebug() << "Start Delete"; + dblink.keepOnlyFromPrefix(dir.path(), paths, true); + dblink.commit(dir.path()); + qDebug() << "End Delete"; std::auto_ptr bar; @@ -429,13 +433,21 @@ void DataController::progressUpdate(int p, int max) { QString str; - if (p == 0) - str.sprintf("Progress %6.2f%%", p * 100.0 / max); - else if (p == max) { - str.sprintf("\b\b\b\b\b\b\b%6.2f%%\n", 100.0); + if (max == 0) { + str.sprintf("Progress %6.2f%%", 100.0); } else { - str.sprintf("\b\b\b\b\b\b\b%6.2f%%", p * 100.0 / max); + if (p == 0) + str.sprintf("Progress %6.2f%%", p * 100.0 / max); + else if (p == max) { + str.sprintf("\b\b\b\b\b\b\b%6.2f%%\n", 100.0); + } + else { + str.sprintf("\b\b\b\b\b\b\b%6.2f%%", p * 100.0 / max); + } + } + if (p == max) { + str+="\n"; } std::cout<