summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opiecore/device/odevice_jornada.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/libopie2/opiecore/device/odevice_jornada.cpp b/libopie2/opiecore/device/odevice_jornada.cpp
index 60736a1..2cab0c8 100644
--- a/libopie2/opiecore/device/odevice_jornada.cpp
+++ b/libopie2/opiecore/device/odevice_jornada.cpp
@@ -117,92 +117,91 @@ void Jornada::init(const QString&)
d->m_rotation = Rot0;
//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;
if (( ib->model & d->m_model ) == d->m_model ) {
b. setKeycode ( ib->code );
b. setUserText ( QObject::tr ( "Button", ib->utext ));
b. setPixmap ( Resource::loadPixmap ( ib->pix ));
b. setFactoryPresetPressedAction ( OQCopMessage ( makeChannel ( ib->fpressedservice ), ib->fpressedaction ));
b. setFactoryPresetHeldAction ( OQCopMessage ( makeChannel ( ib->fheldservice ), ib->fheldaction ));
d->m_buttons->append ( b );
}
}
reloadButtonMapping();
QCopChannel *sysch = new QCopChannel ( "QPE/System", this );
connect ( sysch, SIGNAL( received(const QCString&,const QByteArray&)), this, SLOT( systemMessage(const QCString&,const QByteArray&)));
}
int Jornada::displayBrightnessResolution() const
{
return 255;
}
bool Jornada::setDisplayBrightness( int bright )
{
bool res = false;
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 );
+ cmdline = QString().sprintf( "echo 0 > /sys/class/backlight/sa1100fb/power; echo %d > /sys/class/backlight/sa1100fb/brightness", bright );
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;
bool res = false;
ODevice::sendSuspendmsg();
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( "echo %1 > /sys/class/lcd/sa1100fb/power; echo %2 > /sys/class/backlight/sa1100fb/power").arg( on ? "0" : "4" ).arg( on ? "0" : "4" );
res = ( ::system( (const char*) cmdline ) == 0 );
return res;
}