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

List:       kde-commits
Subject:    extragear/sysadmin/muon/installer
From:       Jonathan Michael Thomas <echidnaman () kubuntu ! org>
Date:       2010-12-15 15:40:15
Message-ID: 20101215154015.A5BE2AC8A8 () svn ! kde ! org
[Download RAW message or body]

SVN commit 1206713 by jmthomas:

Fix a bug where a transaction cancelled due to an authorization error/cancelment \
wasn't removed from the transaction stack, as well as a bug where the \
ApplicationDelegate would not repaint after a cancel until the next mouseover.


 M  +3 -1      ApplicationBackend.cpp  
 M  +11 -3     ApplicationModel/ApplicationModel.cpp  
 M  +1 -0      ApplicationModel/ApplicationModel.h  


--- trunk/extragear/sysadmin/muon/installer/ApplicationBackend.cpp #1206712:1206713
@@ -27,6 +27,7 @@
 #include <KLocale>
 #include <KMessageBox>
 #include <KService>
+#include <KDebug>
 
 #include <LibQApt/Backend>
 #include <DebconfGui.h>
@@ -176,7 +177,7 @@
     // buttons do both marking and committing
     switch (error) {
     case QApt::AuthError:
-        emit transactionCancelled((*m_currentTransaction)->application());
+        cancelTransaction((*m_currentTransaction)->application());
         m_backend->undo();
         break;
     case QApt::UserCancelError:
@@ -236,6 +237,7 @@
                 m_backend->cancelDownload();
                 m_backend->undo();
             }
+
             m_queue.erase(iter);
             break;
         }
--- trunk/extragear/sysadmin/muon/installer/ApplicationModel/ApplicationModel.cpp \
#1206712:1206713 @@ -41,6 +41,8 @@
                 this, SLOT(updateTransactionProgress(Transaction *, int)));
     connect(m_appBackend, SIGNAL(workerEvent(QApt::WorkerEvent, Transaction *)),
             this, SLOT(workerEvent(QApt::WorkerEvent, Transaction *)));
+    connect(m_appBackend, SIGNAL(transactionCancelled(Application *)),
+            this, SLOT(transactionCancelled(Application *)));
 }
 
 ApplicationModel::~ApplicationModel()
@@ -91,11 +93,11 @@
                 return 0;
             }
 
-            if (transaction->state() != InvalidState) {
+            if (transaction->state() == (DoneState | InvalidState)) {
+                return false;
+            }
                 return true;
             }
-            return false;
-        }
         case ProgressRole: {
             Transaction *transaction = transactionAt(index);
 
@@ -193,6 +195,12 @@
     }
 }
 
+void ApplicationModel::transactionCancelled(Application *application)
+{
+    emit dataChanged(index(m_apps.indexOf(application), 0),
+                     index(m_apps.indexOf(application), 0));
+}
+
 Application *ApplicationModel::applicationAt(const QModelIndex &index) const
 {
     return m_apps.at(index.row());
--- trunk/extragear/sysadmin/muon/installer/ApplicationModel/ApplicationModel.h \
#1206712:1206713 @@ -69,6 +69,7 @@
 
 private Q_SLOTS:
     void workerEvent(QApt::WorkerEvent event, Transaction *trans);
+    void transactionCancelled(Application *app);
 
 Q_SIGNALS:
    void dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight);


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

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