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) (side-by-side diff)
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
@@ -105,37 +105,26 @@ struct j_button jornada56x_buttons [] = {
Qt::Key_F12, QT_TRANSLATE_NOOP("Button", "Record Button"),
"devicebuttons/jornada56x_record",
"QPE/VMemo", "toggleRecord()",
"sound", "raise()" },
};
void Jornada::init(const QString&)
{
d->m_vendorstr = "HP";
d->m_vendor = Vendor_HP;
d->m_modelstr = "Jornada 56x";
d->m_model = Model_Jornada_56x;
- d->m_systemstr = "Familiar";
- d->m_system = System_Familiar;
d->m_rotation = Rot0;
-
- QFile f ( "/etc/familiar-version" );
- f.setName ( "/etc/familiar-version" );
- if ( f.open ( IO_ReadOnly )) {
-
- QTextStream ts ( &f );
- d->m_sysverstr = ts.readLine().mid( 10 );
-
- f. close();
- }
+ //Distribution detecting code is now in base class
}
void Jornada::initButtons()
{
if ( d->m_buttons )
return;
d->m_buttons = new QValueList <ODeviceButton>;
for ( uint i = 0; i < ( sizeof( jornada56x_buttons ) / sizeof( j_button )); i++ ) {
j_button *ib = jornada56x_buttons + i;
ODeviceButton b;
@@ -169,27 +158,27 @@ bool Jornada::setDisplayBrightness( int bright )
if ( bright > 255 )
bright = 255;
if ( bright < 0 )
bright = 0;
QString cmdline;
int value = 255 - bright;
if ( !bright )
cmdline = QString().sprintf( "echo 4 > /sys/class/backlight/sa1100fb/power");
else
cmdline = QString().sprintf( "echo 0 > /sys/class/backlight/sa1100fb/power; echo %d > /sys/class/backlight/sa1100fb/brightness", value );
-
+
res = ( ::system( (const char*) cmdline ) == 0 );
-
+
return res;
}
bool Jornada::suspend( )
{
qDebug("ODevice::suspend");
if ( !isQWS( ) ) // only qwsserver is allowed to suspend
return false;
if ( d->m_model == Model_Unknown ) // better don't suspend in qvfb / on unkown devices
return false;
@@ -200,20 +189,20 @@ bool Jornada::suspend( )
struct timeval tvs;
::gettimeofday ( &tvs, 0 );
::sync(); // flush fs caches
res = ( ::system ( "apm --suspend" ) == 0 );
return res;
}
bool Jornada::setDisplayStatus ( bool on )
{
bool res = false;
-
+
QString cmdline = QString().sprintf( "echo %d > /sys/class/lcd/sa1100fb/power; echo %d > /sys/class/backlight/sa1100fb/power", on ? "0" : "4", on? "0" : "4" );
res = ( ::system( (const char*) cmdline ) == 0 );
return res;
}