diff ui/mainwindow.cpp @ 716:929c3db85eb7

Add central place to obtain current change count.
author Andre Heinecke <andre.heinecke@intevation.de>
date Wed, 02 Jul 2014 16:09:19 +0200
parents 57bd73145e48
children 77c9c2dfc8ac
line wrap: on
line diff
--- a/ui/mainwindow.cpp	Wed Jul 02 16:08:55 2014 +0200
+++ b/ui/mainwindow.cpp	Wed Jul 02 16:09:19 2014 +0200
@@ -829,7 +829,8 @@
 
 void MainWindow::listChanged(int selected)
 {
-    int totalCount = mUpdatesRemove->selectedCertCount() +
+    Q_UNUSED (selected);
+    mChangeCount = mUpdatesRemove->selectedCertCount() +
         mUpdatesNew->selectedCertCount() + mUpdatesManual->certificates().size();
 
     if (mUpdatesManual->certificates().size()) {
@@ -840,7 +841,7 @@
         mUpdatesManualCertificates->hide();
     }
 
-    if (!totalCount) {
+    if (!changeCount()) {
         /* No changes */
         mQuitButton->setText(" " + tr("Quit"));
         mUpdatesHeader->setText("<h2>" + tr("Certificates unchanged") +
@@ -848,7 +849,7 @@
     } else {
         mQuitButton->setText(" " + tr("Quit without saving"));
         mUpdatesHeader->setText("<h2>" + tr("Changes to certificate stores (%1)")
-                .arg(totalCount) +
+                .arg(changeCount()) +
                 "</h2>");
     }
 
@@ -1190,3 +1191,8 @@
         syslog_info_printf(tr("Sucessfully checked for updates.").toUtf8().constData());
     }
 }
+
+int MainWindow::changeCount()
+{
+    return mChangeCount;
+}

http://wald.intevation.org/projects/trustbridge/