author | kergoth <kergoth> | 2002-12-12 00:28:48 (UTC) |
---|---|---|
committer | kergoth <kergoth> | 2002-12-12 00:28:48 (UTC) |
commit | cb783a8ddbeb6c85481c5b1a807f21be83817255 (patch) (side-by-side diff) | |
tree | ba7823d58f7cf34d8fffd5818ea5e1ff72432182 | |
parent | 474b8efcacfffb04bf72f486eca7b1455a2b81dd (diff) | |
download | opie-cb783a8ddbeb6c85481c5b1a807f21be83817255.zip opie-cb783a8ddbeb6c85481c5b1a807f21be83817255.tar.gz opie-cb783a8ddbeb6c85481c5b1a807f21be83817255.tar.bz2 |
Proper zaurus model checking for ODevice
-rw-r--r-- | libopie/odevice.cpp | 19 | ||||
-rw-r--r-- | libopie/odevice.h | 1 |
2 files changed, 18 insertions, 2 deletions
diff --git a/libopie/odevice.cpp b/libopie/odevice.cpp index bc43c52..a33d4ad 100644 --- a/libopie/odevice.cpp +++ b/libopie/odevice.cpp @@ -705,49 +705,64 @@ int iPAQ::lightSensorResolution ( ) const } /************************************************** * * Zaurus * **************************************************/ void Zaurus::init ( ) { - d-> m_modelstr = "Zaurus SL5000"; - d-> m_model = Model_Zaurus_SL5000; d-> m_vendorstr = "Sharp"; d-> m_vendor = Vendor_Sharp; QFile f ( "/proc/filesystems" ); if ( f. open ( IO_ReadOnly ) && ( QTextStream ( &f ). read ( ). find ( "\tjffs2\n" ) >= 0 )) { d-> m_systemstr = "OpenZaurus"; d-> m_system = System_OpenZaurus; f. close ( ); f. setName ( "/etc/oz_version" ); if ( f. open ( IO_ReadOnly )) { QTextStream ts ( &f ); d-> m_sysverstr = ts. readLine ( );//. mid ( 10 ); f. close ( ); } } else { d-> m_systemstr = "Zaurus"; d-> m_system = System_Zaurus; } + f. setName ( "/proc/deviceinfo/product" ); + if ( f. open ( IO_ReadOnly ) ) { + QTextStream ts ( &f ); + QString model = ts. readLine ( ); + f. close ( ); + if ( model == "SL-5000D" ) { + d-> m_model = Model_Zaurus_SL5000; + d-> m_modelstr = "Zaurus SL-5000D"; + } else if ( model == "SL-5500" ) { + d-> m_model = Model_Zaurus_SL5500; + d-> m_modelstr = "Zaurus SL-5500"; + } + } + else { + d-> m_model = Model_Zaurus_SL5000; + d-> m_modelstr = "Zaurus SL-5000D (unverified)"; + } m_leds [0] = Led_Off; } #include <unistd.h> #include <fcntl.h> #include <sys/ioctl.h> //#include <asm/sharp_char.h> // including kernel headers is evil ... #define SHARP_DEV_IOCTL_COMMAND_START 0x5680 diff --git a/libopie/odevice.h b/libopie/odevice.h index e50009c..86491d4 100644 --- a/libopie/odevice.h +++ b/libopie/odevice.h @@ -35,24 +35,25 @@ enum OModel { Model_iPAQ = ( 1 << 24 ), Model_iPAQ_All = ( Model_iPAQ | 0xffffff ), Model_iPAQ_H31xx = ( Model_iPAQ | 0x000001 ), Model_iPAQ_H36xx = ( Model_iPAQ | 0x000002 ), Model_iPAQ_H37xx = ( Model_iPAQ | 0x000004 ), Model_iPAQ_H38xx = ( Model_iPAQ | 0x000008 ), Model_iPAQ_H39xx = ( Model_iPAQ | 0x000010 ), Model_Zaurus = ( 2 << 24 ), Model_Zaurus_SL5000 = ( Model_Zaurus | 0x000001 ), + Model_Zaurus_SL5500 = ( Model_Zaurus | 0x000002 ), }; enum OVendor { Vendor_Unknown, Vendor_HP, Vendor_Sharp }; enum OSystem { System_Unknown, |