author | kergoth <kergoth> | 2003-04-20 21:58:05 (UTC) |
---|---|---|
committer | kergoth <kergoth> | 2003-04-20 21:58:05 (UTC) |
commit | 0da3e7316b90cfa0fd84b0de3c3b92cd3159b4e0 (patch) (side-by-side diff) | |
tree | 44ea26ac04180526bc4a5a7c859b6f4bac5609a5 | |
parent | 258feac229c2e8b5016670c1edc442e923c58628 (diff) | |
download | opie-0da3e7316b90cfa0fd84b0de3c3b92cd3159b4e0.zip opie-0da3e7316b90cfa0fd84b0de3c3b92cd3159b4e0.tar.gz opie-0da3e7316b90cfa0fd84b0de3c3b92cd3159b4e0.tar.bz2 |
Revamp the zaurus model detection to actually work on the C700.
-rw-r--r-- | libopie/odevice.cpp | 37 |
1 files changed, 21 insertions, 16 deletions
diff --git a/libopie/odevice.cpp b/libopie/odevice.cpp index cb7dd74..d78277f 100644 --- a/libopie/odevice.cpp +++ b/libopie/odevice.cpp @@ -1126,2 +1126,3 @@ void Zaurus::init ( ) QFile f ( "/proc/filesystems" ); + QString model; @@ -1146,23 +1147,27 @@ void Zaurus::init ( ) - f. setName ( "/proc/deviceinfo/product" ); + f. setName ( "/proc/cpuinfo" ); if ( f. open ( IO_ReadOnly ) ) { QTextStream ts ( &f ); - QString model = ts. readLine ( ); - f. close ( ); + 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( ); + } - d-> m_modelstr = QString("Zaurus ") + model; - if ( model == "SL-5500" ) - d-> m_model = Model_Zaurus_SL5500; - else if ( model == "SL-C700" ) + if ( model == "SHARP Corgi" ) { d-> m_model = Model_Zaurus_SLC700; - else if ( model == "SL-A300" ) - d-> m_model = Model_Zaurus_SLA300; - else if ( model == "SL-B600" || model == "SL-5600" ) + d-> m_modelstr = "Zaurus SL-C700"; + } else if ( model == "SHARP Poodle" ) { d-> m_model = Model_Zaurus_SLB600; - else - d-> m_model = Model_Zaurus_SL5000; - } - else { - d-> m_model = Model_Zaurus_SL5000; - d-> m_modelstr = "Zaurus (model unknown)"; + d-> m_modelstr = "Zaurus SL-B500 or SL-5600"; + } else if ( model = "Sharp-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)"; } |