~ubuntu-branches/ubuntu/oneiric/kdenetwork/oneiric-updates

« back to all changes in this revision

Viewing changes to kopete/libkopete/kopetestatusmanager.cpp

  • Committer: Package Import Robot
  • Author(s): Philip Muškovac, Philip Muškovac
  • Date: 2011-07-10 12:36:35 UTC
  • mfrom: (1.1.59 upstream)
  • Revision ID: package-import@ubuntu.com-20110710123635-3db9oyxdswp4sp1e
Tags: 4:4.6.90-0ubuntu1
* New upstream release
 - Bump on kde-sc-dev-latest
 - s/kdebase-runtime-dev/kde-runtime-dev
* Dropped kubuntu_05_samba_sharing.diff <- went upstream
* Added kubuntu_05_make_old_symbols_reappear_and_fix_building.diff
* Refreshed *.install
* Refreshed symbols

[ Philip Muškovac ]
* fix debug package depends on kdebase-runtime-dbg -> kde-runtime-dbg 
  and recommends on kde-workspace-dbg

Show diffs side-by-side

added added

removed removed

Lines of Context:
72
72
 
73
73
        connect( Kopete::AccountManager::self(), SIGNAL(accountUnregistered(const Kopete::Account*)),
74
74
                 this, SLOT(accountUnregistered(const Kopete::Account*)));
 
75
 
 
76
        connect( Kopete::AccountManager::self(), SIGNAL(accountOnlineStatusChanged(Kopete::Account*, const Kopete::OnlineStatus&, const Kopete::OnlineStatus&)),
 
77
                 this, SLOT(checkIdleTimer()));
 
78
 
75
79
}
76
80
 
77
81
StatusManager::~StatusManager()
451
455
        d->autoAwayAccounts.removeAll( const_cast<Kopete::Account *>(account) );
452
456
}
453
457
 
 
458
void StatusManager::checkIdleTimer()
 
459
{
 
460
        // TODO: should we check for d->autoAwayAccounts to see whether to stop the timer?
 
461
        Kopete::IdleTimer* idleTimer = Kopete::IdleTimer::self();
 
462
        idleTimer->unregisterTimeout( this );
 
463
 
 
464
        if(Kopete::AccountManager::self()->isAnyAccountConnected()) {
 
465
                if ( Kopete::BehaviorSettings::self()->useAutoAway() ) {
 
466
                        if (Kopete::BehaviorSettings::self()->autoAwayAskAvailable())
 
467
                                idleTimer->registerTimeout( d->awayTimeout, this, SLOT(askAndSetActive()), SLOT(setAutoAway()) );
 
468
                        else
 
469
                                idleTimer->registerTimeout( d->awayTimeout, this, SLOT(setActive()), SLOT(setAutoAway()) );
 
470
                }
 
471
        }
 
472
}
 
473
 
454
474
void StatusManager::loadSettings()
455
475
{
456
476
        KConfigGroup config( KGlobal::config(), "Status Manager" );
473
493
        customStatusMessage.setMessage( Kopete::BehaviorSettings::self()->autoAwayCustomMessage() );
474
494
        d->customStatusMessage = customStatusMessage;
475
495
 
476
 
        Kopete::IdleTimer* idleTimer = Kopete::IdleTimer::self();
477
 
        idleTimer->unregisterTimeout( this );
478
 
        
479
 
        if ( Kopete::BehaviorSettings::self()->useAutoAway() ) {
480
 
                if (Kopete::BehaviorSettings::self()->autoAwayAskAvailable())
481
 
                        idleTimer->registerTimeout( d->awayTimeout, this, SLOT(askAndSetActive()), SLOT(setAutoAway()) );
482
 
                else
483
 
                        idleTimer->registerTimeout( d->awayTimeout, this, SLOT(setActive()), SLOT(setAutoAway()) );
484
 
        }
 
496
        checkIdleTimer();
485
497
}
486
498
 
487
499
}