summaryrefslogtreecommitdiff
path: root/libopie2/opiecore/device/odevice_jornada.cpp
authormickeyl <mickeyl>2004-06-12 16:54:50 (UTC)
committer mickeyl <mickeyl>2004-06-12 16:54:50 (UTC)
commitb1235df3628d178891eeefed630a22da46b25952 (patch) (unidiff)
treec88a3cb04adcc9fe214ff08e3c0b96b21e3c4f0a /libopie2/opiecore/device/odevice_jornada.cpp
parent7a62e8e3601ee98f5f06261c361fe8132334cd56 (diff)
downloadopie-b1235df3628d178891eeefed630a22da46b25952.zip
opie-b1235df3628d178891eeefed630a22da46b25952.tar.gz
opie-b1235df3628d178891eeefed630a22da46b25952.tar.bz2
- refactor the distribution detection code
- add detection of OpenEmbedded and generic linux distributions - simplify the zaurus model detection code
Diffstat (limited to 'libopie2/opiecore/device/odevice_jornada.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opiecore/device/odevice_jornada.cpp19
1 files changed, 4 insertions, 15 deletions
diff --git a/libopie2/opiecore/device/odevice_jornada.cpp b/libopie2/opiecore/device/odevice_jornada.cpp
index 1f69326..5d32901 100644
--- a/libopie2/opiecore/device/odevice_jornada.cpp
+++ b/libopie2/opiecore/device/odevice_jornada.cpp
@@ -111,25 +111,14 @@ struct j_button jornada56x_buttons [] = {
111void Jornada::init(const QString&) 111void Jornada::init(const QString&)
112{ 112{
113 d->m_vendorstr = "HP"; 113 d->m_vendorstr = "HP";
114 d->m_vendor = Vendor_HP; 114 d->m_vendor = Vendor_HP;
115 d->m_modelstr = "Jornada 56x"; 115 d->m_modelstr = "Jornada 56x";
116 d->m_model = Model_Jornada_56x; 116 d->m_model = Model_Jornada_56x;
117 d->m_systemstr = "Familiar";
118 d->m_system = System_Familiar;
119 d->m_rotation = Rot0; 117 d->m_rotation = Rot0;
120 118 //Distribution detecting code is now in base class
121 QFile f ( "/etc/familiar-version" );
122 f.setName ( "/etc/familiar-version" );
123 if ( f.open ( IO_ReadOnly )) {
124
125 QTextStream ts ( &f );
126 d->m_sysverstr = ts.readLine().mid( 10 );
127
128 f. close();
129 }
130} 119}
131 120
132void Jornada::initButtons() 121void Jornada::initButtons()
133{ 122{
134 if ( d->m_buttons ) 123 if ( d->m_buttons )
135 return; 124 return;
@@ -175,15 +164,15 @@ bool Jornada::setDisplayBrightness( int bright )
175 164
176 int value = 255 - bright; 165 int value = 255 - bright;
177 if ( !bright ) 166 if ( !bright )
178 cmdline = QString().sprintf( "echo 4 > /sys/class/backlight/sa1100fb/power"); 167 cmdline = QString().sprintf( "echo 4 > /sys/class/backlight/sa1100fb/power");
179 else 168 else
180 cmdline = QString().sprintf( "echo 0 > /sys/class/backlight/sa1100fb/power; echo %d > /sys/class/backlight/sa1100fb/brightness", value ); 169 cmdline = QString().sprintf( "echo 0 > /sys/class/backlight/sa1100fb/power; echo %d > /sys/class/backlight/sa1100fb/brightness", value );
181 170
182 res = ( ::system( (const char*) cmdline ) == 0 ); 171 res = ( ::system( (const char*) cmdline ) == 0 );
183 172
184 return res; 173 return res;
185} 174}
186 175
187 176
188bool Jornada::suspend( ) 177bool Jornada::suspend( )
189{ 178{
@@ -206,13 +195,13 @@ bool Jornada::suspend( )
206 return res; 195 return res;
207} 196}
208 197
209bool Jornada::setDisplayStatus ( bool on ) 198bool Jornada::setDisplayStatus ( bool on )
210{ 199{
211 bool res = false; 200 bool res = false;
212 201
213 QString cmdline = QString().sprintf( "echo %d > /sys/class/lcd/sa1100fb/power; echo %d > /sys/class/backlight/sa1100fb/power", on ? "0" : "4", on? "0" : "4" ); 202 QString cmdline = QString().sprintf( "echo %d > /sys/class/lcd/sa1100fb/power; echo %d > /sys/class/backlight/sa1100fb/power", on ? "0" : "4", on? "0" : "4" );
214 203
215 res = ( ::system( (const char*) cmdline ) == 0 ); 204 res = ( ::system( (const char*) cmdline ) == 0 );
216 205
217 return res; 206 return res;
218} 207}