author | kergoth <kergoth> | 2003-04-20 21:58:05 (UTC) |
---|---|---|
committer | kergoth <kergoth> | 2003-04-20 21:58:05 (UTC) |
commit | 0da3e7316b90cfa0fd84b0de3c3b92cd3159b4e0 (patch) (unidiff) | |
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 | 41 |
1 files changed, 23 insertions, 18 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 ( ) | |||
1126 | QFile f ( "/proc/filesystems" ); | 1126 | QFile f ( "/proc/filesystems" ); |
1127 | QString model; | ||
1127 | 1128 | ||
@@ -1146,23 +1147,27 @@ void Zaurus::init ( ) | |||
1146 | 1147 | ||
1147 | f. setName ( "/proc/deviceinfo/product" ); | 1148 | f. setName ( "/proc/cpuinfo" ); |
1148 | if ( f. open ( IO_ReadOnly ) ) { | 1149 | if ( f. open ( IO_ReadOnly ) ) { |
1149 | QTextStream ts ( &f ); | 1150 | QTextStream ts ( &f ); |
1150 | QString model = ts. readLine ( ); | 1151 | QString line; |
1151 | f. close ( ); | 1152 | while( line = ts. readLine ( ) ) { |
1152 | 1153 | if ( line. left ( 8 ) == "Hardware" ) | |
1153 | d-> m_modelstr = QString("Zaurus ") + model; | 1154 | break; |
1154 | if ( model == "SL-5500" ) | 1155 | } |
1155 | d-> m_model = Model_Zaurus_SL5500; | 1156 | int loc = line. find ( ":" ); |
1156 | else if ( model == "SL-C700" ) | 1157 | if ( loc != -1 ) |
1157 | d-> m_model = Model_Zaurus_SLC700; | 1158 | model = line. mid ( loc + 2 ). simplifyWhitespace( ); |
1158 | else if ( model == "SL-A300" ) | ||
1159 | d-> m_model = Model_Zaurus_SLA300; | ||
1160 | else if ( model == "SL-B600" || model == "SL-5600" ) | ||
1161 | d-> m_model = Model_Zaurus_SLB600; | ||
1162 | else | ||
1163 | d-> m_model = Model_Zaurus_SL5000; | ||
1164 | } | 1159 | } |
1165 | else { | 1160 | |
1166 | d-> m_model = Model_Zaurus_SL5000; | 1161 | if ( model == "SHARP Corgi" ) { |
1167 | d-> m_modelstr = "Zaurus (model unknown)"; | 1162 | d-> m_model = Model_Zaurus_SLC700; |
1163 | d-> m_modelstr = "Zaurus SL-C700"; | ||
1164 | } else if ( model == "SHARP Poodle" ) { | ||
1165 | d-> m_model = Model_Zaurus_SLB600; | ||
1166 | d-> m_modelstr = "Zaurus SL-B500 or SL-5600"; | ||
1167 | } else if ( model = "Sharp-Collie" ) { | ||
1168 | d-> m_model = Model_Zaurus_SL5500; | ||
1169 | d-> m_modelstr = "Zaurus SL-5500 or SL-5000d"; | ||
1170 | } else { | ||
1171 | d-> m_model = Model_Zaurus_SL5500; | ||
1172 | d-> m_modelstr = "Zaurus (Model unknown)"; | ||
1168 | } | 1173 | } |