Commit 97eb1b35 authored by Elvis Angelaccio's avatar Elvis Angelaccio

archivemodel: check for ListJob errors

If a ListJob ends up with an error (e.g. job aborted due to corrupted archive),
we should not add the listed entries in the model.

BUG: 361757
FIXED-IN: 16.04.3

Differential Revision: D2082
parent 1ddaecf5
......@@ -842,16 +842,18 @@ void ArchiveModel::newEntry(const ArchiveEntry& receivedEntry, InsertBehaviour b
void ArchiveModel::slotLoadingFinished(KJob *job)
{
int i = 0;
foreach(const ArchiveEntry &entry, m_newArchiveEntries) {
newEntry(entry, DoNotNotifyViews);
i++;
}
beginResetModel();
endResetModel();
m_newArchiveEntries.clear();
if (!job->error()) {
int i = 0;
foreach(const ArchiveEntry &entry, m_newArchiveEntries) {
newEntry(entry, DoNotNotifyViews);
i++;
}
beginResetModel();
endResetModel();
m_newArchiveEntries.clear();
qCDebug(ARK) << "Added" << i << "entries to model";
qCDebug(ARK) << "Added" << i << "entries to model";
}
emit loadingFinished(job);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment