summaryrefslogtreecommitdiff
authorzecke <zecke>2003-09-20 12:42:21 (UTC)
committer zecke <zecke>2003-09-20 12:42:21 (UTC)
commitaf02302ec3615007e34cedfb8d91dd3a55832fbb (patch) (side-by-side diff)
tree01fcb010245fb7fcba29389f128b3e652b4df9e7
parent0468cfef459d613ae0a32a3fa03e67726d19f6e9 (diff)
downloadopie-af02302ec3615007e34cedfb8d91dd3a55832fbb.zip
opie-af02302ec3615007e34cedfb8d91dd3a55832fbb.tar.gz
opie-af02302ec3615007e34cedfb8d91dd3a55832fbb.tar.bz2
Fix double suspend on key input
ServerApp proxied the power() signal from KeyFilter and we've connected togglePower() twice to it. We only need to connect to the ServerApp power signal and not to keyfilter because we emit power() from ServerApp on QCOP
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/launcher/serverapp.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/core/launcher/serverapp.cpp b/core/launcher/serverapp.cpp
index 28316a4..69e083d 100644
--- a/core/launcher/serverapp.cpp
+++ b/core/launcher/serverapp.cpp
@@ -288,97 +288,97 @@ ServerApplication::ServerApplication( int& argc, char **argv, Type t )
// We know we'll have lots of cached pixmaps due to App/DocLnks
QPixmapCache::setCacheLimit(512);
m_ps = new PowerStatus;
m_ps_last = new PowerStatus;
pa = new DesktopPowerAlerter( 0 );
m_apm_timer = new QTimer( this );
connect(m_apm_timer, SIGNAL( timeout() ),
this, SLOT( apmTimeout() ) );
reloadPowerWarnSettings();
QCopChannel *channel = new QCopChannel( "QPE/System", this );
connect(channel, SIGNAL(received( const QCString&, const QByteArray& ) ),
this, SLOT(systemMessage(const QCString&, const QByteArray& ) ) );
channel = new QCopChannel("QPE/Launcher", this );
connect(channel, SIGNAL(received( const QCString&, const QByteArray& ) ),
this, SLOT(launcherMessage( const QCString&, const QByteArray& ) ) );
m_screensaver = new OpieScreenSaver();
m_screensaver->setInterval( -1 );
QWSServer::setScreenSaver( m_screensaver );
connect( qApp, SIGNAL( volumeChanged( bool ) ),
this, SLOT( rereadVolumes() ) );
/* ### PluginLoader libqtopia SafeMode */
#if 0
if ( PluginLoader::inSafeMode() )
QTimer::singleShot(500, this, SLOT(showSafeMode()) );
QTimer::singleShot(20*1000, this, SLOT(clearSafeMode()) );
#endif
kf = new KeyFilter(this);
connect( kf, SIGNAL(launch()), this, SIGNAL(launch()) );
connect( kf, SIGNAL(power()), this, SIGNAL(power()) );
connect( kf, SIGNAL(backlight()), this, SIGNAL(backlight()) );
connect( kf, SIGNAL(symbol()), this, SIGNAL(symbol()));
connect( kf, SIGNAL(numLockStateToggle()), this,SIGNAL(numLockStateToggle()));
connect( kf, SIGNAL(capsLockStateToggle()), this,SIGNAL(capsLockStateToggle()));
connect( kf, SIGNAL(activate(const Opie::ODeviceButton*,bool)),
this,SIGNAL(activate(const Opie::ODeviceButton*,bool)));
- connect( kf, SIGNAL(power()), this, SLOT(togglePower()) );
+
connect( kf, SIGNAL(backlight()), this, SLOT(toggleLight()) );
connect( this, SIGNAL(power() ),
SLOT(togglePower() ) );
rereadVolumes();
serverApp = this;
apmTimeout();
grabKeyboard();
/* make sure the event filter is installed */
const Opie::ODeviceButton* but = Opie::ODevice::inst()->buttonForKeycode( -1 );
}
ServerApplication::~ServerApplication()
{
ungrabKeyboard();
delete pa;
delete m_ps;
delete m_ps_last;
}
void ServerApplication::apmTimeout() {
serverApp-> checkMemory( ); // in case no events are generated
*m_ps_last = *m_ps;
*m_ps = PowerStatusManager::readStatus();
if ( m_ps->acStatus() != m_ps_last-> acStatus() )
m_screensaver-> powerStatusChanged( *m_ps );
if ( m_ps->acStatus() == PowerStatus::Online )
return;
int bat = m_ps-> batteryPercentRemaining();
if ( bat < m_ps_last-> batteryPercentRemaining() ) {
if ( bat <= m_powerCritical )
pa->alert( tr( "Battery level is critical!\nKeep power off until power restored!" ), 1 );
else if ( bat <= m_powerVeryLow )
pa->alert( tr( "Battery is running very low. "), 2 );
}
if ( m_ps-> backupBatteryStatus() == PowerStatus::VeryLow )
pa->alert( tr("The Back-up battery is very low.\nPlease charge the back-up battery." ), 2);