Commit a33176c9 authored by Lukas Appelhans's avatar Lukas Appelhans
Browse files

Optimize polkit method

parent cdfca017
......@@ -33,6 +33,7 @@ public:
, m_partialSize(0)
, m_root(root)
, m_options(options)
, m_oldProgress(-1)
{
chdir(root.toUtf8().data());
}
......@@ -68,7 +69,10 @@ public:
if (m_handle.totalEntrySize() > 0) {
percent = (int)(m_partialSize * 100 / m_handle.totalEntrySize());
}
m_parent->streamProgress(m_handle.filename(), percent);
if (percent != m_oldProgress) {
m_parent->streamProgress(m_handle.filename(), percent);
m_oldProgress = percent;
}
/*
* The path may vary if the entry is marked with the NoUpgrade option
......@@ -89,6 +93,7 @@ private:
qint64 m_partialSize;
QDir m_root;
Akabei::ProcessingOptions m_options;
int m_oldProgress;
};
class UpgradeFunctorPriv : public Akabei::EntryHandlerFunctor
......
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