-rw-r--r-- | libopie/odevice.cpp | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/libopie/odevice.cpp b/libopie/odevice.cpp index fef623a..58254a7 100644 --- a/libopie/odevice.cpp +++ b/libopie/odevice.cpp @@ -1123,32 +1123,33 @@ void iPAQ::init ( ) else if ( d-> m_modelstr == "H5400" ) d-> m_model = Model_iPAQ_H5xxx; else d-> m_model = Model_Unknown; f. close ( ); } switch ( d-> m_model ) { case Model_iPAQ_H31xx: case Model_iPAQ_H38xx: d-> m_rotation = Rot90; break; case Model_iPAQ_H36xx: case Model_iPAQ_H37xx: case Model_iPAQ_H39xx: + default: d-> m_rotation = Rot270; break; case Model_iPAQ_H5xxx: d-> m_rotation = Rot0; } f. setName ( "/etc/familiar-version" ); if ( f. open ( IO_ReadOnly )) { d-> m_systemstr = "Familiar"; d-> m_system = System_Familiar; QTextStream ts ( &f ); d-> m_sysverstr = ts. readLine ( ). mid ( 10 ); f. close ( ); @@ -1487,54 +1488,55 @@ int iPAQ::lightSensorResolution ( ) const /************************************************** * * Zaurus * **************************************************/ // Check whether this device is the sharp zaurus.. bool Zaurus::isZaurus() { // If the special devices by embedix exist, it is quite simple: it is a Zaurus ! if ( QFile::exists ( "/dev/sharp_buz" ) || QFile::exists ( "/dev/sharp_led" ) ){ return true; } - // On non-embedix kenrnels, we have too look closer. + // On non-embedix kernels, we have to look closer. bool is_zaurus = false; QFile f ( "/proc/cpuinfo" ); if ( f. open ( IO_ReadOnly ) ) { QString model; QFile f ( "/proc/cpuinfo" ); QTextStream ts ( &f ); QString line; while( line = ts. readLine ( ) ) { if ( line. left ( 8 ) == "Hardware" ) break; } int loc = line. find ( ":" ); if ( loc != -1 ) model = line. mid ( loc + 2 ). simplifyWhiteSpace( ); if ( model == "Sharp-Collie" || model == "Collie" || model == "SHARP Corgi" || model == "SHARP Shepherd" || model == "SHARP Poodle" + || model == "SHARP Husky" ) ) is_zaurus = true; } return is_zaurus; } void Zaurus::init ( ) { d-> m_vendorstr = "Sharp"; d-> m_vendor = Vendor_Sharp; m_embedix = true; // Not openzaurus means: It has an embedix kernel ! // QFile f ( "/proc/filesystems" ); QString model; @@ -1579,54 +1581,57 @@ void Zaurus::init ( ) } f. setName ( "/proc/cpuinfo" ); if ( f. open ( IO_ReadOnly ) ) { QTextStream ts ( &f ); QString line; while( line = ts. readLine ( ) ) { if ( line. left ( 8 ) == "Hardware" ) break; } int loc = line. find ( ":" ); if ( loc != -1 ) model = line. mid ( loc + 2 ). simplifyWhiteSpace( ); } if ( model == "SHARP Corgi" ) { - d-> m_model = Model_Zaurus_SLC700; + d-> m_model = Model_Zaurus_SLC7x0; d-> m_modelstr = "Zaurus SL-C700"; } else if ( model == "SHARP Shepherd" ) { - d-> m_model = Model_Zaurus_SLC700; // Do we need a special type for the C750 ? (eilers) + d-> m_model = Model_Zaurus_SLC7x0; d-> m_modelstr = "Zaurus SL-C750"; + } else if ( model == "SHARP Husky" ) { + d-> m_model = Model_Zaurus_SLC7x0; + d-> m_modelstr = "Zaurus SL-C760"; } else if ( model == "SHARP Poodle" ) { d-> m_model = Model_Zaurus_SLB600; d-> m_modelstr = "Zaurus SL-B500 or SL-5600"; } else if ( model == "Sharp-Collie" || model == "Collie" ) { d-> m_model = Model_Zaurus_SL5500; d-> m_modelstr = "Zaurus SL-5500 or SL-5000d"; } else { d-> m_model = Model_Zaurus_SL5500; d-> m_modelstr = "Zaurus (Model unknown)"; } bool flipstate = false; switch ( d-> m_model ) { case Model_Zaurus_SLA300: d-> m_rotation = Rot0; break; - case Model_Zaurus_SLC700: + case Model_Zaurus_SLC7x0: // Note: need to 1) set flipstate based on physical screen orientation // and 2) check to see if the user overrode the rotation direction // using appearance, and if so, remove that item from the Config to // ensure the rotate applet flips us back to the previous state. if ( flipstate ) { // 480x640 d-> m_rotation = Rot0; d-> m_direction = CW; } else { // 640x480 d-> m_rotation = Rot270; d-> m_direction = CCW; } break; case Model_Zaurus_SLB600: case Model_Zaurus_SL5500: @@ -1635,33 +1640,33 @@ void Zaurus::init ( ) d-> m_rotation = Rot270; break; } m_leds [0] = Led_Off; } void Zaurus::initButtons ( ) { if ( d-> m_buttons ) return; d-> m_buttons = new QValueList <ODeviceButton>; struct z_button * pz_buttons; int buttoncount; switch ( d-> m_model ) { - case Model_Zaurus_SLC700: + case Model_Zaurus_SLC7x0: pz_buttons = z_buttons_c700; buttoncount = ARRAY_SIZE(z_buttons_c700); break; default: pz_buttons = z_buttons; buttoncount = ARRAY_SIZE(z_buttons); break; } for ( int i = 0; i < buttoncount; i++ ) { struct z_button *zb = pz_buttons + i; ODeviceButton b; b. setKeycode ( zb-> code ); b. setUserText ( QObject::tr ( "Button", zb-> utext )); b. setPixmap ( Resource::loadPixmap ( zb-> pix )); @@ -1739,37 +1744,35 @@ typedef struct sharp_led_status { #define LED_MAIL_UNREAD_MAIL_EX 2 /* for SHARP_LED_MAIL_EXISTS */ // #include <asm/sharp_apm.h> // including kernel headers is evil ... #define APM_IOCGEVTSRC OD_IOR( 'A', 203, int ) #define APM_IOCSEVTSRC OD_IORW( 'A', 204, int ) #define APM_EVT_POWER_BUTTON (1 << 0) #define FL_IOCTL_STEP_CONTRAST 100 void Zaurus::buzzer ( int sound ) { #ifndef QT_NO_SOUND QString soundname; - // Not all devices have real sound. But I expect - // that Openzaurus now has a sound driver which - // I will use instead the buzzer... - if ( ( d->m_model == Model_Zaurus_SLC700 ) - || d->m_system == System_OpenZaurus ){ + // Not all devices have real sound + if ( d->m_model == Model_Zaurus_SLC7x0 + || d->m_model == Model_Zaurus_SLB600 ){ switch ( sound ){ case SHARP_BUZ_SCHEDULE_ALARM: soundname = "alarm"; break; case SHARP_BUZ_TOUCHSOUND: soundname = "touchsound"; break; case SHARP_BUZ_KEYSOUND: soundname = "keysound"; break; default: soundname = "alarm"; } } |