summaryrefslogtreecommitdiff
authorkergoth <kergoth>2003-04-16 22:46:26 (UTC)
committer kergoth <kergoth>2003-04-16 22:46:26 (UTC)
commit43f1d8c741f37b7fa3021bd480b5370b2b22cb53 (patch) (side-by-side diff)
tree49c96c4048f3ff53242e7ee56105e66bc3126d1d
parentb98b64367e3871f3b34cf090376130f79698ce94 (diff)
downloadopie-43f1d8c741f37b7fa3021bd480b5370b2b22cb53.zip
opie-43f1d8c741f37b7fa3021bd480b5370b2b22cb53.tar.gz
opie-43f1d8c741f37b7fa3021bd480b5370b2b22cb53.tar.bz2
Attempt to workaround oliver's reported suspend issue. Check for a qws server at runtime rather than init time, and set the keyboard filter in initButtons rather than init.
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--libopie/odevice.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/libopie/odevice.cpp b/libopie/odevice.cpp
index 8f954b1..0e1c0dd 100644
--- a/libopie/odevice.cpp
+++ b/libopie/odevice.cpp
@@ -275,12 +275,14 @@ void ODevice::init ( )
*/
void ODevice::initButtons ( )
{
if ( d-> m_buttons )
return;
+ d-> m_qwsserver = qApp ? ( qApp-> type ( ) == QApplication::GuiServer ) : false;
+
// Simulation uses iPAQ 3660 device buttons
qDebug ( "init Buttons" );
d-> m_buttons = new QValueList <ODeviceButton>;
for ( uint i = 0; i < ( sizeof( ipaq_buttons ) / sizeof( i_button )); i++ ) {
@@ -759,21 +761,24 @@ void iPAQ::init ( )
m_leds [0] = m_leds [1] = Led_Off;
m_power_timer = 0;
- if ( d-> m_qwsserver )
- QWSServer::setKeyboardFilter ( this );
}
void iPAQ::initButtons ( )
{
if ( d-> m_buttons )
return;
+ d-> m_qwsserver = qApp ? ( qApp-> type ( ) == QApplication::GuiServer ) : false;
+
+ if ( d-> m_qwsserver )
+ QWSServer::setKeyboardFilter ( this );
+
d-> m_buttons = new QValueList <ODeviceButton>;
for ( uint i = 0; i < ( sizeof( ipaq_buttons ) / sizeof( i_button )); i++ ) {
i_button *ib = ipaq_buttons + i;
ODeviceButton b;
@@ -1146,12 +1151,14 @@ void Zaurus::init ( )
void Zaurus::initButtons ( )
{
if ( d-> m_buttons )
return;
+ d-> m_qwsserver = qApp ? ( qApp-> type ( ) == QApplication::GuiServer ) : false;
+
d-> m_buttons = new QValueList <ODeviceButton>;
for ( uint i = 0; i < ( sizeof( z_buttons ) / sizeof( z_button )); i++ ) {
z_button *zb = z_buttons + i;
ODeviceButton b;