summaryrefslogtreecommitdiff
path: root/libopie2/opiecore/device/odevice_ipaq.cpp
authorzecke <zecke>2004-05-01 18:13:29 (UTC)
committer zecke <zecke>2004-05-01 18:13:29 (UTC)
commit7a2cac7a65be07c1e82508e00c2d3d61e0823dc1 (patch) (unidiff)
tree70381a30c784957b22d9e644272ac96a0fced5a4 /libopie2/opiecore/device/odevice_ipaq.cpp
parentec6a887d8abddbab085a0a3aecae5760ff85dbe8 (diff)
downloadopie-7a2cac7a65be07c1e82508e00c2d3d61e0823dc1.zip
opie-7a2cac7a65be07c1e82508e00c2d3d61e0823dc1.tar.gz
opie-7a2cac7a65be07c1e82508e00c2d3d61e0823dc1.tar.bz2
Pass on the Hardware line of proc/cpuinfo so we don't need to parse the file again..
only adjusted iPAQ backend to use it Beginning of hh22xx Linux2.6 support
Diffstat (limited to 'libopie2/opiecore/device/odevice_ipaq.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opiecore/device/odevice_ipaq.cpp52
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
@@ -114,53 +114,51 @@ struct i_button ipaq_buttons [] = {
114 "sound", "raise()" }, 114 "sound", "raise()" },
115}; 115};
116 116
117void iPAQ::init() 117void 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 ) {
148 case Model_iPAQ_H31xx: 144 case Model_iPAQ_H31xx:
149 case Model_iPAQ_H38xx: 145 case Model_iPAQ_H38xx:
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";
166 d->m_system = System_Familiar; 164 d->m_system = System_Familiar;