From 667da4143ff65ac9502d55fb09ca8223b16a8994 Mon Sep 17 00:00:00 2001 From: harlekin Date: Thu, 24 Oct 2002 11:52:25 +0000 Subject: today refreshes itself now by a timer, important for fast load and on retail rom which might not get the pim signal we will have soon - closes bug #335 --- (limited to 'core/pim/today/today.cpp') diff --git a/core/pim/today/today.cpp b/core/pim/today/today.cpp index dd98824..8184730 100644 --- a/core/pim/today/today.cpp +++ b/core/pim/today/today.cpp @@ -65,6 +65,9 @@ Today::Today( QWidget* parent, const char* name, WFlags fl ) #endif setOwnerField(); + m_refreshTimer = new QTimer( this ); + connect( m_refreshTimer, SIGNAL( timeout() ), this, SLOT( refresh() ) ); + m_refreshTimer->start( 15000 ); refresh(); showMaximized(); } @@ -81,6 +84,14 @@ void Today::channelReceived( const QCString &msg, const QByteArray & data ) { } } +void Today::setRefreshTimer( int interval ) { + + if ( m_refreshTimerEnabled ) { + m_refreshTimer->changeInterval( interval ); + } +} + + /** * Initialises the owner field with the default value, the username */ @@ -111,12 +122,15 @@ void Today::setOwnerField( QString &message ) { void Today::init() { // read config Config cfg( "today" ); - cfg.setGroup( "Plugins" ); + cfg.setGroup( "Plugins" ); m_excludeApplets = cfg.readListEntry( "ExcludeApplets", ',' ); m_allApplets = cfg.readListEntry( "AllApplets", ',' ); + cfg.setGroup( "General" ); m_iconSize = cfg.readNumEntry( "IconSize", 18 ); + m_refreshTimer->changeInterval( cfg.readNumEntry( "checkinterval", 15000 ) ); + } @@ -293,6 +307,7 @@ void Today::startConfig() { void Today::refresh() { init(); + qDebug(" refresh "); // set the date in top label QDate date = QDate::currentDate(); QString time = ( tr( date.toString() ) ); -- cgit v0.9.0.2