+
+void ChessClock::addTime(int msecs)
+{
+ timeAvailableBeforeTurn_ += msecs;
+}
+
+int ChessClock::currentTurnPlayed()
+{
+ if( currentTurn_ )
+ {
+ // Update current time
+ if( status_ == Running )
+ {
+ currentTurn_->addTime( clockTime_.restart());
+
+ // since 1.1.2
+ // emit dontEatBattery signal when screen should not to be keeped on
+ if ( currentTurn_->getDuration() > DONTEATBATTERYTIME && dontEatBatteryEmitted_ == false )
+ {
+ dontEatBatteryEmitted_ = true;
+ emit dontEatBattery();
+ }
+ }
+
+ // Return current time
+ return currentTurn_->getDuration();
+ }
+ else
+ // No current turn!
+ return 0;
+}
+