summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleix Pol <aleixpol@kde.org>2015-10-30 18:05:00 (GMT)
committerAleix Pol <aleixpol@kde.org>2015-10-30 18:05:00 (GMT)
commit78a4813fa32cd69065e06fe7969186385c980560 (patch)
treeecd326a055246e978450c4b5137945aedd5645cd
parente3c5ce632805a52a2e5865e7685b5fc2d73aa9cd (diff)
We already know if the process is running
No need to keep a variable to keep track of it.
-rw-r--r--libmuon/backends/ApplicationBackend/ApplicationNotifier.cpp6
-rw-r--r--libmuon/backends/ApplicationBackend/ApplicationNotifier.h1
2 files changed, 1 insertions, 6 deletions
diff --git a/libmuon/backends/ApplicationBackend/ApplicationNotifier.cpp b/libmuon/backends/ApplicationBackend/ApplicationNotifier.cpp
index 99de086..2c092bd 100644
--- a/libmuon/backends/ApplicationBackend/ApplicationNotifier.cpp
+++ b/libmuon/backends/ApplicationBackend/ApplicationNotifier.cpp
@@ -38,7 +38,6 @@ ApplicationNotifier::ApplicationNotifier(QObject* parent)
: BackendNotifierModule(parent)
, m_checkerProcess(Q_NULLPTR)
, m_updateCheckerProcess(Q_NULLPTR)
- , m_checkingForUpdates(false)
, m_securityUpdates(0)
, m_normalUpdates(0)
{
@@ -109,10 +108,9 @@ void ApplicationNotifier::upgradeActivated()
void ApplicationNotifier::recheckSystemUpdateNeeded()
{
- if (m_checkingForUpdates)
+ if (m_updateCheckerProcess->state() == QProcess::Running)
return;
- m_checkingForUpdates = true;
m_updateCheckerProcess = new QProcess(this);
connect(m_updateCheckerProcess, SIGNAL(finished(int)), this, SLOT(parseUpdateInfo()));
m_updateCheckerProcess->start("/usr/lib/update-notifier/apt-check");
@@ -138,8 +136,6 @@ void ApplicationNotifier::parseUpdateInfo()
int securityUpdates = securityString.toInt();
setUpdates(updatesString.toInt() - securityUpdates, securityUpdates);
}
-
- m_checkingForUpdates = false;
}
void ApplicationNotifier::setUpdates(int normal, int security)
diff --git a/libmuon/backends/ApplicationBackend/ApplicationNotifier.h b/libmuon/backends/ApplicationBackend/ApplicationNotifier.h
index 4150df7..3f575f1 100644
--- a/libmuon/backends/ApplicationBackend/ApplicationNotifier.h
+++ b/libmuon/backends/ApplicationBackend/ApplicationNotifier.h
@@ -53,7 +53,6 @@ private:
QProcess *m_checkerProcess;
QProcess *m_updateCheckerProcess;
- bool m_checkingForUpdates;
int m_securityUpdates;
int m_normalUpdates;
};