summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--libopie/odevice.cpp20
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
@@ -56,8 +56,6 @@ using namespace Opie;
class ODeviceData {
public:
- bool m_qwsserver : 1;
-
QString m_vendorstr;
OVendor m_vendor;
@@ -239,8 +237,10 @@ static QCString makeChannel ( const char *str )
return str;
}
-
-
+static inline bool isQWS()
+{
+ return qApp ? ( qApp-> type ( ) == QApplication::GuiServer ) : false;
+}
ODevice *ODevice::inst ( )
{
@@ -271,8 +271,6 @@ ODevice::ODevice ( )
{
d = new ODeviceData;
- d-> m_qwsserver = qApp ? ( qApp-> type ( ) == QApplication::GuiServer ) : false;
-
d-> m_modelstr = "Unknown";
d-> m_model = Model_Unknown;
d-> m_vendorstr = "Unknown";
@@ -306,8 +304,6 @@ 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" );
@@ -359,7 +355,7 @@ 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;
if ( d-> m_model == Model_Unknown ) // better don't suspend in qvfb / on unkown devices
@@ -807,9 +803,7 @@ void iPAQ::initButtons ( )
if ( d-> m_buttons )
return;
- d-> m_qwsserver = qApp ? ( qApp-> type ( ) == QApplication::GuiServer ) : false;
-
- if ( d-> m_qwsserver )
+ if ( isQWS( ) )
QWSServer::setKeyboardFilter ( this );
d-> m_buttons = new QValueList <ODeviceButton>;
@@ -1207,8 +1201,6 @@ void Zaurus::initButtons ( )
if ( d-> m_buttons )
return;
- d-> m_qwsserver = qApp ? ( qApp-> type ( ) == QApplication::GuiServer ) : false;
-
d-> m_buttons = new QValueList <ODeviceButton>;
struct z_button * pz_buttons;