Diffstat (limited to 'libopie2/opiecore/device/odevice_zaurus.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | libopie2/opiecore/device/odevice_zaurus.cpp | 69 |
1 files changed, 27 insertions, 42 deletions
diff --git a/libopie2/opiecore/device/odevice_zaurus.cpp b/libopie2/opiecore/device/odevice_zaurus.cpp index e8b813e..6ac3157 100644 --- a/libopie2/opiecore/device/odevice_zaurus.cpp +++ b/libopie2/opiecore/device/odevice_zaurus.cpp | |||
@@ -117,19 +117,16 @@ struct z_button z_buttons_c700 [] = { | |||
117 | 117 | ||
118 | void Zaurus::init(const QString&) | 118 | void Zaurus::init(const QString& cpu_info) |
119 | { | 119 | { |
120 | d->m_vendorstr = "Sharp"; | 120 | // generic distribution code already scanned /etc/issue at that point - |
121 | d->m_vendor = Vendor_Sharp; | 121 | // embedix releases contain "Embedix <version> | Linux for Embedded Devices" |
122 | m_embedix = true; // Not openzaurus means: It has an embedix kernel ! | 122 | if ( d->m_sysverstr.contains( "embedix", false ) ) |
123 | 123 | { | |
124 | // QFile f ( "/proc/filesystems" ); | 124 | d->m_vendorstr = "Sharp"; |
125 | QString model; | 125 | d->m_vendor = Vendor_Sharp; |
126 | 126 | d->m_systemstr = "Zaurus"; | |
127 | // It isn't a good idea to check the system configuration to | 127 | d->m_system = System_Zaurus; |
128 | // detect the distribution ! | 128 | m_embedix = true; |
129 | // Otherwise it may happen that any other distribution is detected as openzaurus, just | 129 | } |
130 | // because it uses a jffs2 filesystem.. | 130 | else |
131 | // (eilers) | 131 | { |
132 | // if ( f. open ( IO_ReadOnly ) && ( QTextStream ( &f ). read(). find ( "\tjffs2\n" ) >= 0 )) { | ||
133 | QFile f ("/etc/oz_version"); | ||
134 | if ( f.exists() ){ | ||
135 | d->m_vendorstr = "OpenZaurus Team"; | 132 | d->m_vendorstr = "OpenZaurus Team"; |
@@ -137,12 +134,7 @@ void Zaurus::init(const QString&) | |||
137 | d->m_system = System_OpenZaurus; | 134 | d->m_system = System_OpenZaurus; |
135 | // sysver already gathered | ||
138 | 136 | ||
139 | if ( f. open ( IO_ReadOnly )) { | 137 | // Openzaurus sometimes uses the embedix kernel, check if this is one |
140 | QTextStream ts ( &f ); | ||
141 | d->m_sysverstr = ts. readLine();//. mid ( 10 ); | ||
142 | f. close(); | ||
143 | } | ||
144 | |||
145 | // Openzaurus sometimes uses the embedix kernel! | ||
146 | // => Check whether this is an embedix kernel | ||
147 | FILE *uname = popen("uname -r", "r"); | 138 | FILE *uname = popen("uname -r", "r"); |
139 | QFile f; | ||
148 | QString line; | 140 | QString line; |
@@ -156,3 +148,3 @@ void Zaurus::init(const QString&) | |||
156 | m_embedix = false; | 148 | m_embedix = false; |
157 | f. close(); | 149 | f.close(); |
158 | } | 150 | } |
@@ -160,19 +152,10 @@ void Zaurus::init(const QString&) | |||
160 | } | 152 | } |
161 | else { | ||
162 | d->m_systemstr = "Zaurus"; | ||
163 | d->m_system = System_Zaurus; | ||
164 | } | ||
165 | 153 | ||
166 | f. setName ( "/proc/cpuinfo" ); | 154 | // check the Zaurus model |
167 | if ( f. open ( IO_ReadOnly ) ) { | 155 | QString model; |
168 | QTextStream ts ( &f ); | 156 | int loc = cpu_info.find( ":" ); |
169 | QString line; | 157 | if ( loc != -1 ) |
170 | while( line = ts. readLine() ) { | 158 | model = cpu_info.mid( loc+2 ).simplifyWhiteSpace(); |
171 | if ( line. left ( 8 ) == "Hardware" ) | 159 | else |
172 | break; | 160 | model = cpu_info; |
173 | } | ||
174 | int loc = line. find ( ":" ); | ||
175 | if ( loc != -1 ) | ||
176 | model = line. mid ( loc + 2 ). simplifyWhiteSpace( ); | ||
177 | } | ||
178 | 161 | ||
@@ -195,5 +178,7 @@ void Zaurus::init(const QString&) | |||
195 | d->m_model = Model_Zaurus_SL5500; | 178 | d->m_model = Model_Zaurus_SL5500; |
196 | d->m_modelstr = "Zaurus (Model unknown)"; | 179 | d->m_modelstr = "Unkown Zaurus"; |
197 | } | 180 | } |
198 | 181 | ||
182 | // set initial rotation | ||
183 | |||
199 | bool flipstate = false; | 184 | bool flipstate = false; |