diff -up apper-0.9.1/apperd/RefreshCacheTask.cpp.orig apper-0.9.1/apperd/RefreshCacheTask.cpp
--- apper-0.9.1/apperd/RefreshCacheTask.cpp.orig 2014-08-25 13:51:50.000000000 -0500
+++ apper-0.9.1/apperd/RefreshCacheTask.cpp 2015-04-28 09:54:49.676361482 -0500
@@ -33,7 +33,8 @@ RefreshCacheTask::RefreshCacheTask(QObje
QObject(parent),
m_transaction(0),
m_notification(0),
- m_lastError(Transaction::ErrorUnknown)
+ m_lastError(Transaction::ErrorUnknown),
+ m_cacheAge(3600)
{
}
@@ -43,6 +44,7 @@ void RefreshCacheTask::refreshCache()
if (!m_transaction) {
// Refresh Cache is false otherwise it will rebuild
// the whole cache on Fedora
+ Daemon::setHints (QLatin1String("cache-age=")+QString::number(m_cacheAge));
m_transaction = Daemon::refreshCache(false);
connect(m_transaction, SIGNAL(finished(PackageKit::Transaction::Exit,uint)),
this, SLOT(refreshCacheFinished(PackageKit::Transaction::Exit,uint)));
diff -up apper-0.9.1/apperd/RefreshCacheTask.h.orig apper-0.9.1/apperd/RefreshCacheTask.h
--- apper-0.9.1/apperd/RefreshCacheTask.h.orig 2014-08-25 13:51:50.000000000 -0500
+++ apper-0.9.1/apperd/RefreshCacheTask.h 2015-04-28 09:54:49.676361482 -0500
@@ -44,6 +44,7 @@ private:
Transaction *m_transaction;
KNotification *m_notification;
Transaction::Error m_lastError;
+ uint m_cacheAge;
QString m_lastErrorString;
};
diff -up apper-0.9.1/ApperKCM/ApperKCM.cpp.orig apper-0.9.1/ApperKCM/ApperKCM.cpp
--- apper-0.9.1/ApperKCM/ApperKCM.cpp.orig 2014-08-25 13:51:50.000000000 -0500
+++ apper-0.9.1/ApperKCM/ApperKCM.cpp 2015-04-28 09:54:49.677361486 -0500
@@ -77,6 +77,7 @@ ApperKCM::ApperKCM(QWidget *parent, cons
m_findIcon("edit-find"),
m_cancelIcon("dialog-cancel"),
m_forceRefreshCache(false),
+ m_cacheAge(600),
m_history(0),
m_searchRole(Transaction::RoleUnknown)
{
@@ -760,6 +761,7 @@ void ApperKCM::refreshCache()
PkTransactionWidget *transactionW = new PkTransactionWidget(this);
connect(transactionW, SIGNAL(titleChangedProgress(QString)), this, SIGNAL(caption(QString)));
QPointer<PkTransaction> transaction = new PkTransaction(transactionW);
+ Daemon::setHints (QLatin1String("cache-age=")+QString::number(m_cacheAge));
transaction->refreshCache(m_forceRefreshCache);
transactionW->setTransaction(transaction, Transaction::RoleRefreshCache);
diff -up apper-0.9.1/ApperKCM/ApperKCM.h.orig apper-0.9.1/ApperKCM/ApperKCM.h
--- apper-0.9.1/ApperKCM/ApperKCM.h.orig 2014-08-25 13:51:50.000000000 -0500
+++ apper-0.9.1/ApperKCM/ApperKCM.h 2015-04-28 09:54:49.677361486 -0500
@@ -119,6 +119,7 @@ private:
FiltersMenu *m_filtersMenu;
Transaction::Roles m_roles;
bool m_forceRefreshCache;
+ uint m_cacheAge;
TransactionHistory *m_history;
diff -up apper-0.9.1/declarative-plugins/daemonhelper.cpp.orig apper-0.9.1/declarative-plugins/daemonhelper.cpp
--- apper-0.9.1/declarative-plugins/daemonhelper.cpp.orig 2014-08-25 13:51:50.000000000 -0500
+++ apper-0.9.1/declarative-plugins/daemonhelper.cpp 2015-04-28 09:56:00.150621345 -0500
@@ -32,3 +32,8 @@ uint DaemonHelper::getTimeSinceLastRefre
{
return Daemon::global()->getTimeSinceAction(Transaction::RoleRefreshCache);
}
+
+void DaemonHelper::setCacheAge (int age)
+{
+ Daemon::setHints(QLatin1String("cache-age=")+QString::number(age));
+}
diff -up apper-0.9.1/declarative-plugins/daemonhelper.h.orig apper-0.9.1/declarative-plugins/daemonhelper.h
--- apper-0.9.1/declarative-plugins/daemonhelper.h.orig 2014-08-25 13:51:50.000000000 -0500
+++ apper-0.9.1/declarative-plugins/daemonhelper.h 2015-04-28 09:55:29.216507280 -0500
@@ -30,6 +30,7 @@ public:
public slots:
uint getTimeSinceLastRefresh();
+ void setCacheAge (int age);
};
#endif // DAEMONHELPER_H
diff -up apper-0.9.1/plasmoid/package/contents/ui/Transaction.qml.orig apper-0.9.1/plasmoid/package/contents/ui/Transaction.qml
--- apper-0.9.1/plasmoid/package/contents/ui/Transaction.qml.orig 2014-08-25 13:51:50.000000000 -0500
+++ apper-0.9.1/plasmoid/package/contents/ui/Transaction.qml 2015-04-28 09:56:59.005838365 -0500
@@ -27,6 +27,7 @@ FocusScope {
clip: true
property int progressWidth: 30
+ property int cacheAge: 600
property alias transaction: updateTransaction
signal finished(bool success);
@@ -38,6 +39,7 @@ FocusScope {
function refreshCache() {
updateTransaction.enableJobWatcher(false);
+ DaemonHelper.setCacheAge(cacheAge);
updateTransaction.refreshCache(false);
}