Skip to content
Snippets Groups Projects
Commit 4d48cf88 authored by Alexandre Lision's avatar Alexandre Lision
Browse files

history: restore limit

Ask daemon about current history limit, and add only entries in the
allowed range

Change-Id: Ifcaf93a3ce2bd5376a2c66f1f309c6848aa829ba
Tuleap: #103
parent 687e709c
No related branches found
No related tags found
No related merge requests found
......@@ -218,14 +218,19 @@ bool LocalHistoryCollection::load()
lines << file.readLine().trimmed();
file.close();
int dayLimit = CategorizedHistoryModel::instance().historyLimit() * 24 * 3600;
time_t now = time(0); // get time now
for (const QString& line : lines) {
//The item is complete
if ((line.isEmpty() || !line.size()) && hc.size()) {
Call* pastCall = Call::buildHistoryCall(hc);
pastCall->setCollection(this);
if ((now - pastCall->startTimeStamp()) < dayLimit) {
pastCall->setCollection(this);
editor<Call>()->addExisting(pastCall);
}
editor<Call>()->addExisting(pastCall);
hc.clear();
}
// Add to the current set
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment