-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 @@ -57,6 +57,4 @@ using namespace Opie; class ODeviceData { public: - bool m_qwsserver : 1; - QString m_vendorstr; OVendor m_vendor; @@ -240,6 +238,8 @@ static QCString makeChannel ( const char *str ) } - - +static inline bool isQWS() +{ + return qApp ? ( qApp-> type ( ) == QApplication::GuiServer ) : false; +} ODevice *ODevice::inst ( ) @@ -272,6 +272,4 @@ ODevice::ODevice ( ) d = new ODeviceData; - d-> m_qwsserver = qApp ? ( qApp-> type ( ) == QApplication::GuiServer ) : false; - d-> m_modelstr = "Unknown"; d-> m_model = Model_Unknown; @@ -307,6 +305,4 @@ void ODevice::initButtons ( ) return; - d-> m_qwsserver = qApp ? ( qApp-> type ( ) == QApplication::GuiServer ) : false; - // Simulation uses iPAQ 3660 device buttons @@ -360,5 +356,5 @@ bool ODevice::setSoftSuspend ( bool /*soft*/ ) bool ODevice::suspend ( ) { - if ( !d-> m_qwsserver ) // only qwsserver is allowed to suspend + if ( !isQWS( ) ) // only qwsserver is allowed to suspend return false; @@ -808,7 +804,5 @@ void iPAQ::initButtons ( ) return; - d-> m_qwsserver = qApp ? ( qApp-> type ( ) == QApplication::GuiServer ) : false; - - if ( d-> m_qwsserver ) + if ( isQWS( ) ) QWSServer::setKeyboardFilter ( this ); @@ -1208,6 +1202,4 @@ void Zaurus::initButtons ( ) return; - d-> m_qwsserver = qApp ? ( qApp-> type ( ) == QApplication::GuiServer ) : false; - d-> m_buttons = new QValueList <ODeviceButton>; |