Fix translation.
[yandex-traffic] / mainwidget.cpp
index 8149f1f..89e9289 100644 (file)
@@ -32,7 +32,7 @@ MainWidget::MainWidget ()
     applySettings ();
 
     connect (_traffic, SIGNAL (updated ()), SLOT (trafficUpdated ()));
-    connect (_timer, SIGNAL (timeout ()), SLOT (updateDate ()));
+    connect (_timer, SIGNAL (timeout ()), SLOT (updateData ()));
 
     updateData ();
 }
@@ -72,8 +72,7 @@ void MainWidget::trafficUpdated ()
         _light->setColor (info.color ());
 
         if (_settings->check (Settings::C_ShowRank)) {
-            data.append (QString::number (info.level ()));
-            data.append (info.level () > 1 ? tr (" points") : tr (" point"));
+            data.append (tr ("%n point(s)", "", info.level ()));
             first = false;
         }
 
@@ -106,6 +105,8 @@ void MainWidget::updateData ()
 #if CHECK_FOR_CONNECTION
     update = ConnectionChecker::instance ()->checkConnection (_settings->check (Settings::C_UpdateOnGSM),
                                                               _settings->check (Settings::C_UpdateOnWiFi));
+    if (!_settings->check (Settings::C_UpdateWhenLocked))
+        update &= !DeviceState::instance ()->locked ();
 #endif
 
     if (update)