[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    [PATCH] apperd: Restrict creation of KJobs to the more interesting transaction roles.
From:       Marc Schmitzer <marc () marc-schmitzer ! de>
Date:       2014-05-04 19:33:48
Message-ID: 2938245.6nSgQcM6Dk () lenny
[Download RAW message or body]

Hi everybody,

I've hacked up a patch to apperd that (for me) fixes KDE BUG #318864 [1].
The commit message and patch are inlined below, it would be awesome if this 
would be reviewed and merged.

Please tell me if I should submit the patch any other way.

Regards,
Marc Schmitzer

[1] https://bugs.kde.org/show_bug.cgi?id=318864



apperd: Restrict creation of KJobs to the more interesting transaction roles.

Creating a job for every transaction (including e.g. fetching of update
details) is way too noisy (KDE BUG #318864).

The list of roles is the same as that used to filter messages from
transactions in watchTransaction().
---
 apperd/TransactionWatcher.cpp | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/apperd/TransactionWatcher.cpp b/apperd/TransactionWatcher.cpp
index 23ded5c..260625c 100644
--- a/apperd/TransactionWatcher.cpp
+++ b/apperd/TransactionWatcher.cpp
@@ -204,7 +204,13 @@ void TransactionWatcher::transactionChanged(Transaction 
*transaction, bool inter
     }
 
     // If the
-    if (!m_transactionJob.contains(tid) && interactive) {
+    Transaction::Role role = transaction->role();
+    if (!m_transactionJob.contains(tid) && interactive &&
+       (role == Transaction::RoleInstallPackages ||
+        role == Transaction::RoleInstallFiles    ||
+        role == Transaction::RoleRemovePackages  ||
+        role == Transaction::RoleUpdatePackages  ||
+        role == Transaction::RoleUpgradeSystem)) {
         TransactionJob *job = new TransactionJob(transaction, this);
         connect(transaction, 
SIGNAL(errorCode(PackageKit::Transaction::Error,QString)),
                 this, 
SLOT(errorCode(PackageKit::Transaction::Error,QString)));
-- 
1.9.0



>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic