[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    extragear/utils/rsibreak/src
From:       Tom Albers <toma () kde ! org>
Date:       2010-10-01 18:22:51
Message-ID: 20101001182251.0DC15AC891 () svn ! kde ! org
[Download RAW message or body]

SVN commit 1181675 by toma:

Cleanup debugging setup, remove check for kde version, now we require at least that version.


 M  +3 -2      mainpage.dox  
 M  +1 -25     plasmaeffect.cpp  
 M  +0 -5      rsidock.cpp  
 M  +0 -1      rsidock.h  
 M  +1 -1      rsiglobals.cpp  
 M  +5 -9      rsitimer.cpp  
 M  +1 -6      rsitimer.h  
 M  +0 -1      rsiwidget.cpp  
 M  +5 -6      setuptiming.cpp  


--- trunk/extragear/utils/rsibreak/src/mainpage.dox #1181674:1181675
@@ -26,9 +26,10 @@
    All public classes are documented, and it is mandatory to do that, just like honouring
    the hacking style.
 
-   For debugging purposes, you can add a DEBUG=true to your [General Settings] in the
+   For debugging purposes, you can add a DEBUG=1 to your [General Settings] in the
    rsibreakrc config file. This will change the minutes in the settings to seconds.
-   This is essential for testing purposes.
+   This is essential for testing purposes. If you do DEBUG=2, you get detailled info
+   about the timers. Lots of output.
 
    You can contact me via email or on irc on the freenode network, channel \#rsibreak
 
--- trunk/extragear/utils/rsibreak/src/plasmaeffect.cpp #1181674:1181675
@@ -1,5 +1,5 @@
 /*
-   Copyright (C) 2009 Tom Albers <toma@kde.org>
+   Copyright (C) 2009-2010 Tom Albers <toma@kde.org>
 
    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public
@@ -17,7 +17,6 @@
 */
 
 #include "plasmaeffect.h"
-#include "kdeversion.h"
 
 #include <KDebug>
 
@@ -35,20 +34,8 @@
 
 void PlasmaEffect::activate()
 {
-    // Before 4.3 it was org.kde.plasma, after that it became org.kde.plasma-desktop
-#if KDE_IS_VERSION(4,3,0)
     QDBusInterface dbus( "org.kde.plasma-desktop", "/App" );
-#else
-    QDBusInterface dbus( "org.kde.plasma", "/App" );
-#endif
-
-    // Before 4.4 there was no showDashboard( bool ), only a toggle....
-#if KDE_IS_VERSION(4,3,60)
     QDBusMessage reply = dbus.call( QLatin1String( "showDashboard" ), true );
-#else
-    kDebug() << "Old style";
-    QDBusMessage reply = dbus.call( QLatin1String( "toggleDashboard" ) );
-#endif
     BreakBase::activate();
 
     if ( reply.type() == QDBusMessage::ErrorMessage ) {
@@ -58,19 +45,8 @@
 
 void PlasmaEffect::deactivate()
 {
-    // Before 4.3 it was org.kde.plasma, after that it became org.kde.plasma-desktop
-#if KDE_IS_VERSION(4,3,0)
     QDBusInterface dbus( "org.kde.plasma-desktop", "/App" );
-#else
-    QDBusInterface dbus( "org.kde.plasma", "/App" );
-#endif
-
-#if KDE_IS_VERSION(4,3,60)
     QDBusMessage reply = dbus.call( QLatin1String( "showDashboard" ), false );
-#else
-    kDebug() << "Old style";
-    QDBusMessage reply = dbus.call( QLatin1String( "toggleDashboard" ) );
-#endif
 
     if ( reply.type() == QDBusMessage::ErrorMessage ) {
         kDebug() << reply.errorMessage() << reply.errorName();
--- trunk/extragear/utils/rsibreak/src/rsidock.cpp #1181674:1181675
@@ -118,11 +118,6 @@
     emit breakRequest();
 }
 
-void RSIDock::slotDebugRequest()
-{
-    emit debugRequest();
-}
-
 void RSIDock::slotSuspend()
 {
     if ( m_suspended ) {
--- trunk/extragear/utils/rsibreak/src/rsidock.h #1181674:1181675
@@ -124,7 +124,6 @@
     void slotConfigureNotifications();
     void slotSuspend();
     void slotBreakRequest();
-    void slotDebugRequest();
     void slotShowStatistics();
     void slotResetStats();
     void slotQuit();
--- trunk/extragear/utils/rsibreak/src/rsiglobals.cpp #1181674:1181675
@@ -72,7 +72,7 @@
     m_intervals["big_maximized"] = config.readEntry( "BigDuration", 1 ) * 60;
     m_intervals["big_maximized"] = config.readEntry( "BigDuration", 1 ) * 60;
 
-    if ( config.readEntry( "DEBUG", false ) ) {
+    if ( config.readEntry( "DEBUG", 0 ) > 0 ) {
         kDebug() << "Debug mode activated";
         m_intervals["tiny_minimized"] = m_intervals["tiny_minimized"] / 60;
         m_intervals["big_minimized"] = m_intervals["big_minimized"] / 60;
--- trunk/extragear/utils/rsibreak/src/rsitimer.cpp #1181674:1181675
@@ -48,10 +48,11 @@
         , m_bigBreakRequested( false )
         , m_suspended( false )
         , m_needRestart( false )
-        , m_explicitDebug( false )
         , m_pause_left( 0 ), m_relax_left( 0 ), m_patience( 0 )
         , m_intervals( RSIGlobals::instance()->intervals() )
 {
+    KConfigGroup config = KGlobal::config()->group( "General Settings" );
+    m_debug = config.readEntry( "DEBUG", 0 );
 }
 
 RSITimer::~RSITimer()
@@ -104,7 +105,7 @@
     XGetScreenSaver( QX11Info::display(), &mXTimeout, &mXInterval, &mXBlanking, &mXExposures );
     static int originalTimeout = mXTimeout;
 
-    if ( m_explicitDebug ) {
+    if ( m_debug > 1 ) {
         kDebug() << "Screensaver timeout is set at " << mXTimeout;
     }
 
@@ -243,11 +244,6 @@
     m_breakRequested = true;
 }
 
-void RSITimer::slotRequestDebug()
-{
-    m_explicitDebug = true;
-}
-
 void RSITimer::slotRequestTinyBreak()
 {
     slotRequestBreak();
@@ -336,7 +332,7 @@
         return;
     }
 
-    if ( m_explicitDebug ) {
+    if ( m_debug > 1 ) {
         kDebug() << " patience: " << m_patience  << " pause_left: "
         << m_pause_left << " relax_left: " << m_relax_left
         <<  " tiny_left: " << m_tiny_left  << " big_left: "
@@ -545,7 +541,7 @@
     }
 
 
-    if ( m_explicitDebug ) {
+    if ( m_debug > 1 ) {
         kDebug() << " pause_left: " << m_pause_left
         <<  " tiny_left: " << m_tiny_left  << " big_left: "
         <<  m_big_left << " m_nextbeak: " << m_nextBreak << endl;
--- trunk/extragear/utils/rsibreak/src/rsitimer.h #1181674:1181675
@@ -92,11 +92,6 @@
     */
     void slotRequestBreak();
 
-    /**
-    The user can request debugging info from the timer...
-    */
-    void slotRequestDebug();
-
     /** Forces a tiny break. */
     void slotRequestTinyBreak();
 
@@ -229,7 +224,7 @@
     bool            m_needRestart;
     bool            m_nextBreak;
     bool            m_nextnextBreak;
-    bool            m_explicitDebug;
+    int             m_debug;
 
     int             m_tiny_left;
     int             m_big_left;
--- trunk/extragear/utils/rsibreak/src/rsiwidget.cpp #1181674:1181675
@@ -235,7 +235,6 @@
     connect( m_tray, SIGNAL( dialogEntered() ), m_timer, SLOT( slotStop() ) );
     connect( m_tray, SIGNAL( dialogLeft() ), m_timer, SLOT( slotStart() ) );
     connect( m_tray, SIGNAL( breakRequest() ), m_timer, SLOT( slotRequestBreak() ) );
-    connect( m_tray, SIGNAL( debugRequest() ), m_timer, SLOT( slotRequestDebug() ) );
     connect( m_tray, SIGNAL( suspend( bool ) ), m_timer, SLOT( slotSuspended( bool ) ) );
 
     connect( m_relaxpopup, SIGNAL( skip() ), m_timer, SLOT( skipBreak() ) );
--- trunk/extragear/utils/rsibreak/src/setuptiming.cpp #1181674:1181675
@@ -32,7 +32,6 @@
 #include <KVBox>
 #include <KConfigGroup>
 #include <KGlobal>
-#include <kdeversion.h>
 
 class SetupTimingPriv
 {
@@ -41,7 +40,7 @@
     KIntNumInput*          tinyDuration;
     KIntNumInput*          bigInterval;
     KIntNumInput*          bigDuration;
-    bool                   debug;
+    int                    debug;
 };
 
 SetupTiming::SetupTiming( QWidget* parent )
@@ -120,11 +119,11 @@
     setLayout( l );
     readSettings();
 
-    d->debug ? d->bigInterval->setSuffix( ki18np( " second", " seconds" ) )
+    d->debug > 0 ? d->bigInterval->setSuffix( ki18np( " second", " seconds" ) )
     : d->bigInterval->setSuffix( ki18np( " minute", " minutes" ) );
-    d->debug ? d->tinyInterval->setSuffix( ki18np( " second", " seconds" ) )
+    d->debug > 0 ? d->tinyInterval->setSuffix( ki18np( " second", " seconds" ) )
     : d->tinyInterval->setSuffix( ki18np( " minute", " minutes" ) );
-    d->debug ? d->bigDuration->setSuffix( ki18np( " second", " seconds" ) )
+    d->debug > 0 ? d->bigDuration->setSuffix( ki18np( " second", " seconds" ) )
     : d->bigDuration->setSuffix( ki18np( " minute", " minutes" ) );
     d->tinyDuration->setSuffix( ki18np( " second", " seconds" ) );
 
@@ -155,7 +154,7 @@
 void SetupTiming::readSettings()
 {
     KConfigGroup config = KGlobal::config()->group( "General Settings" );
-    d->debug = config.readEntry( "DEBUG", false );
+    d->debug = config.readEntry( "DEBUG", 0 );
 
     d->tinyInterval->setValue( config.readEntry( "TinyInterval", 10 ) );
     d->tinyDuration->setValue( config.readEntry( "TinyDuration", 20 ) );
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic