Added counter to MainWindow::toggleProgressIndicator.
[situare] / src / ui / mainwindow.cpp
index 5d54ec7..7901573 100644 (file)
@@ -899,7 +899,20 @@ void MainWindow::toggleProgressIndicator(bool value)
     qDebug() << __PRETTY_FUNCTION__;
 
 #ifdef Q_WS_MAEMO_5
-    setAttribute(Qt::WA_Maemo5ShowProgressIndicator, value);
+    static int counter = 0;
+
+    if (value)
+        counter++;
+    else
+        counter--;
+
+    if (counter < 0)
+        counter = 0;
+
+    if (counter == 0)
+        setAttribute(Qt::WA_Maemo5ShowProgressIndicator, false);
+    else
+        setAttribute(Qt::WA_Maemo5ShowProgressIndicator, true);
 #else
     Q_UNUSED(value);
 #endif // Q_WS_MAEMO_5