summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/tools/clock/clock.cpp47
-rw-r--r--noncore/tools/clock/clock.h2
2 files changed, 28 insertions, 21 deletions
diff --git a/noncore/tools/clock/clock.cpp b/noncore/tools/clock/clock.cpp
index 9898332..0eb2b83 100644
--- a/noncore/tools/clock/clock.cpp
+++ b/noncore/tools/clock/clock.cpp
@@ -267,2 +267,23 @@ void Clock::clearClock( void )
+void Clock::startSWatch()
+{
+ swatch_start.start();
+ set->setText( tr( "Stop" ) );
+ t->start( 1000 );
+ swatch_running = TRUE;
+ // disable screensaver while stop watch is running
+ toggleScreenSaver( FALSE );
+}
+
+void Clock::stopSWatch()
+{
+ swatch_totalms += swatch_start.elapsed();
+ set->setText( tr( "Start" ) );
+ t->stop();
+ swatch_running = FALSE;
+ toggleScreenSaver( TRUE );
+ updateClock();
+}
+
+
void Clock::slotSet()
@@ -271,8 +292,3 @@ void Clock::slotSet()
{
- swatch_totalms += swatch_start.elapsed();
- set->setText( tr( "Start" ) );
- t->stop();
- swatch_running = FALSE;
- toggleScreenSaver( TRUE );
- updateClock();
+ startSWatch();
}
@@ -280,8 +296,3 @@ void Clock::slotSet()
{
- swatch_start.start();
- set->setText( tr( "Stop" ) );
- t->start( 1000 );
- swatch_running = TRUE;
- // disable screensaver while stop watch is running
- toggleScreenSaver( FALSE );
+ stopSWatch();
}
@@ -603,8 +614,5 @@ void Clock::slotStartTimer()
{
- Config cfg( "Clock" );
- cfg.setGroup( "Mode" );
- int mode = cfg.readBoolEntry( "clockMode");
if ( clockRB->isChecked() )
setSwatchMode( 1);
- slotSet();
+ startSWatch();
}
@@ -613,8 +621,5 @@ void Clock::slotStopTimer()
{
- Config cfg( "Clock" );
- cfg.setGroup( "Mode" );
- int mode = cfg.readBoolEntry( "clockMode");
if ( clockRB->isChecked() )
setSwatchMode( 1);
-slotSet();
+ stopSWatch();
}
@@ -630,3 +635,3 @@ void Clock::setSwatchMode(int mode)
{
- qDebug("Clock::setSwatchMode( %d)"), mode;
+ qDebug("Clock::setSwatchMode( %d)", mode);
swatchRB->setChecked( mode);
diff --git a/noncore/tools/clock/clock.h b/noncore/tools/clock/clock.h
index 9b00e28..1e5aa2c 100644
--- a/noncore/tools/clock/clock.h
+++ b/noncore/tools/clock/clock.h
@@ -102,2 +102,4 @@ private:
void clearTimer();
+ void startSWatch();
+ void stopSWatch();
};