Diffstat (limited to 'libopie2/opiecore/device/odevice_ipaq.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | libopie2/opiecore/device/odevice_ipaq.cpp | 52 |
1 files changed, 25 insertions, 27 deletions
diff --git a/libopie2/opiecore/device/odevice_ipaq.cpp b/libopie2/opiecore/device/odevice_ipaq.cpp index 98e2ffa..efe35e7 100644 --- a/libopie2/opiecore/device/odevice_ipaq.cpp +++ b/libopie2/opiecore/device/odevice_ipaq.cpp | |||
@@ -115,33 +115,29 @@ struct i_button ipaq_buttons [] = { | |||
115 | }; | 115 | }; |
116 | 116 | ||
117 | void iPAQ::init() | 117 | void iPAQ::init(const QString& model) |
118 | { | 118 | { |
119 | d->m_vendorstr = "HP"; | 119 | d->m_vendorstr = "HP"; |
120 | d->m_vendor = Vendor_HP; | 120 | d->m_vendor = Vendor_HP; |
121 | 121 | ||
122 | QFile f ( "/proc/hal/model" ); | 122 | d->m_modelstr = model.mid(model.findRev('H')); |
123 | |||
124 | if ( d->m_modelstr == "H3100" ) | ||
125 | d->m_model = Model_iPAQ_H31xx; | ||
126 | else if ( d->m_modelstr == "H3600" ) | ||
127 | d->m_model = Model_iPAQ_H36xx; | ||
128 | else if ( d->m_modelstr == "H3700" ) | ||
129 | d->m_model = Model_iPAQ_H37xx; | ||
130 | else if ( d->m_modelstr == "H3800" ) | ||
131 | d->m_model = Model_iPAQ_H38xx; | ||
132 | else if ( d->m_modelstr == "H3900" ) | ||
133 | d->m_model = Model_iPAQ_H39xx; | ||
134 | else if ( d->m_modelstr == "H5400" ) | ||
135 | d->m_model = Model_iPAQ_H5xxx; | ||
136 | else if ( d->m_modelstr == "H2200" ) | ||
137 | d->m_model = Model_iPAQ_H22xx; | ||
138 | else | ||
139 | d->m_model = Model_Unknown; | ||
123 | 140 | ||
124 | if ( f. open ( IO_ReadOnly )) { | ||
125 | QTextStream ts ( &f ); | ||
126 | 141 | ||
127 | d->m_modelstr = "H" + ts. readLine(); | ||
128 | |||
129 | if ( d->m_modelstr == "H3100" ) | ||
130 | d->m_model = Model_iPAQ_H31xx; | ||
131 | else if ( d->m_modelstr == "H3600" ) | ||
132 | d->m_model = Model_iPAQ_H36xx; | ||
133 | else if ( d->m_modelstr == "H3700" ) | ||
134 | d->m_model = Model_iPAQ_H37xx; | ||
135 | else if ( d->m_modelstr == "H3800" ) | ||
136 | d->m_model = Model_iPAQ_H38xx; | ||
137 | else if ( d->m_modelstr == "H3900" ) | ||
138 | d->m_model = Model_iPAQ_H39xx; | ||
139 | else if ( d->m_modelstr == "H5400" ) | ||
140 | d->m_model = Model_iPAQ_H5xxx; | ||
141 | else | ||
142 | d->m_model = Model_Unknown; | ||
143 | |||
144 | f. close(); | ||
145 | } | ||
146 | 142 | ||
147 | switch ( d->m_model ) { | 143 | switch ( d->m_model ) { |
@@ -150,16 +146,18 @@ void iPAQ::init() | |||
150 | d->m_rotation = Rot90; | 146 | d->m_rotation = Rot90; |
151 | break; | 147 | break; |
148 | case Model_iPAQ_H5xxx: | ||
149 | case Model_iPAQ_H22xx: | ||
150 | d->m_rotation = Rot0; | ||
151 | break; | ||
152 | case Model_iPAQ_H36xx: | 152 | case Model_iPAQ_H36xx: |
153 | case Model_iPAQ_H37xx: | 153 | case Model_iPAQ_H37xx: |
154 | case Model_iPAQ_H39xx: | 154 | case Model_iPAQ_H39xx: |
155 | |||
156 | default: | 155 | default: |
157 | d->m_rotation = Rot270; | 156 | d->m_rotation = Rot270; |
158 | break; | 157 | break; |
159 | case Model_iPAQ_H5xxx: | 158 | |
160 | d->m_rotation = Rot0; | ||
161 | } | 159 | } |
162 | 160 | ||
163 | f. setName ( "/etc/familiar-version" ); | 161 | QFile f( "/etc/familiar-version" ); |
164 | if ( f. open ( IO_ReadOnly )) { | 162 | if ( f. open ( IO_ReadOnly )) { |
165 | d->m_systemstr = "Familiar"; | 163 | d->m_systemstr = "Familiar"; |