-rw-r--r-- | libopie/odevice.cpp | 20 |
1 files changed, 6 insertions, 14 deletions
diff --git a/libopie/odevice.cpp b/libopie/odevice.cpp index 501b601..62e3569 100644 --- a/libopie/odevice.cpp +++ b/libopie/odevice.cpp @@ -58,4 +58,2 @@ class ODeviceData { public: - bool m_qwsserver : 1; - QString m_vendorstr; @@ -241,4 +239,6 @@ static QCString makeChannel ( const char *str ) - - +static inline bool isQWS() +{ + return qApp ? ( qApp-> type ( ) == QApplication::GuiServer ) : false; +} @@ -273,4 +273,2 @@ ODevice::ODevice ( ) - d-> m_qwsserver = qApp ? ( qApp-> type ( ) == QApplication::GuiServer ) : false; - d-> m_modelstr = "Unknown"; @@ -308,4 +306,2 @@ void ODevice::initButtons ( ) - d-> m_qwsserver = qApp ? ( qApp-> type ( ) == QApplication::GuiServer ) : false; - // Simulation uses iPAQ 3660 device buttons @@ -361,3 +357,3 @@ bool ODevice::suspend ( ) { - if ( !d-> m_qwsserver ) // only qwsserver is allowed to suspend + if ( !isQWS( ) ) // only qwsserver is allowed to suspend return false; @@ -809,5 +805,3 @@ void iPAQ::initButtons ( ) - d-> m_qwsserver = qApp ? ( qApp-> type ( ) == QApplication::GuiServer ) : false; - - if ( d-> m_qwsserver ) + if ( isQWS( ) ) QWSServer::setKeyboardFilter ( this ); @@ -1209,4 +1203,2 @@ void Zaurus::initButtons ( ) - d-> m_qwsserver = qApp ? ( qApp-> type ( ) == QApplication::GuiServer ) : false; - d-> m_buttons = new QValueList <ODeviceButton>; |