Comment 2 for bug 894123

Revision history for this message
Jonathan Thomas (echidnaman) wrote : [muon] updater: Apparently, desktop computers report having no A/C plug at all. (Maybe it doesn't count

Git commit 7c133dbe38c46201d9e9692066a2d25cfa51e292 by Jonathan Thomas.
Committed on 25/11/2011 at 04:14.
Pushed by jmthomas into branch 'master'.

Apparently, desktop computers report having no A/C plug at all. (Maybe it doesn't count
power supplies). At any rate, don't show the plug message if the list of plugs is empty.

CCMAIL:<email address hidden>

M +7 -0 updater/MainWindow.cpp

http://commits.kde.org/muon/7c133dbe38c46201d9e9692066a2d25cfa51e292

diff --git a/updater/MainWindow.cpp b/updater/MainWindow.cpp
index 73e6cb1..d18c6ef 100644
--- a/updater/MainWindow.cpp
+++ b/updater/MainWindow.cpp
@@ -238,6 +238,7 @@ void MainWindow::setActionsEnabled(bool enabled)
     m_undoAction->setEnabled(!m_backend->isUndoStackEmpty());
     m_redoAction->setEnabled(!m_backend->isRedoStackEmpty());
     m_revertAction->setEnabled(!m_backend->isUndoStackEmpty());
+ m_updaterWidget->setEnabled(true);
 }

 void MainWindow::checkForUpdates()
@@ -310,6 +311,12 @@ void MainWindow::closeHistoryDialog()
 void MainWindow::checkPlugState()
 {
     const QList<Solid::Device> acAdapters = Solid::Device::listFromType(Solid::DeviceInterface::AcAdapter);
+
+ if (acAdapters.isEmpty()) {
+ updatePlugState(true);
+ return;
+ }
+
     bool isPlugged = false;

     foreach(Solid::Device device_ac, acAdapters) {