# HG changeset patch # User Tom Fredrik Blenning Klaussen # Date 1345652300 -7200 # Node ID d7b384b4a834a2c5a5bca6bfd87c0dcc273cea56 # Parent d6fdca3bf24e6fa15f851c0e35b6b555f5feb9c2 Fix compilation problems. Fix printing issues. Introduce raise function in Exception. diff -r d6fdca3bf24e -r d7b384b4a834 CMakeLists.txt --- a/CMakeLists.txt Wed Aug 22 01:07:06 2012 +0200 +++ b/CMakeLists.txt Wed Aug 22 18:18:20 2012 +0200 @@ -24,9 +24,9 @@ DataController.cpp EditDistance.cpp IOException.cpp - FileDbLink.cpp - SqliteDbLink.cpp - MemoryDbLink.cpp + FileDBLink.cpp + SqliteDBLink.cpp + MemoryDBLink.cpp ) SET(MOC_HEADERS diff -r d6fdca3bf24e -r d7b384b4a834 DataController.cpp --- a/DataController.cpp Wed Aug 22 01:07:06 2012 +0200 +++ b/DataController.cpp Wed Aug 22 18:18:20 2012 +0200 @@ -30,6 +30,7 @@ #include #include "EditDistance.hpp" +#include void DataController::findFiles(const QDir& dir, QStringList& list) { @@ -38,7 +39,10 @@ findFiles(QDir(filename), list); } + qDebug() << dir.entryList(QDir::Files | QDir::NoSymLinks); + foreach(QString filename, dir.entryList(QDir::Files | QDir::NoSymLinks)) { + qDebug() << filename; list << dir.absoluteFilePath(filename); } } @@ -75,6 +79,7 @@ } int n = 0; + emit populateProgress(n); foreach(QString filename, findFiles(dir)) { try { dblink.updateIfModified(filename); @@ -84,7 +89,7 @@ } catch (Exception& e) { qDebug() << e.toString(); - exit(1); + e.raise(); } emit populateProgress(++n); @@ -169,7 +174,6 @@ foreach(QSharedPointer line, elems) { QTreeWidgetItem* item = 0; - bool anyAdded = false; if (showNameDups) { QTreeWidgetItem* topLevelItem = 0; @@ -181,7 +185,6 @@ if(!item) item = createItem(*line); item->addChild(topLevelItem); - anyAdded = true; } topLevelItem->addChild(createItem(*dup)); } @@ -198,7 +201,6 @@ if(!item) item = createItem(*line); item->addChild(topLevelItem); - anyAdded = true; } topLevelItem->addChild(createItem(*dup)); } @@ -215,7 +217,6 @@ if(!item) item = createItem(*line); item->addChild(topLevelItem); - anyAdded = true; } topLevelItem->addChild(createItem(*dup)); } @@ -232,7 +233,6 @@ if(!item) item = createItem(*line); item->addChild(topLevelItem); - anyAdded = true; } topLevelItem->addChild(createItem(*dup)); } @@ -260,7 +260,6 @@ if(!item) item = createItem(*line); item->addChild(topLevelItem); - anyAdded = true; } foreach(QSharedPointer dup, oList.values()) { @@ -395,8 +394,12 @@ QString str; if (p == 0) str.sprintf("Progress %6.2f%%", p * 100.0 / progressMax); - else - str.sprintf("\b\b\b\b\b\b%6.2f%%", p * 100.0 / progressMax); + else if (p == progressMax) { + 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 / progressMax); + } std::cout<