All pastes #82787 Raw Edit

Miscellany

public text v1 · immutable
·published 2006-07-08 22:45 UTC
rendered paste body
int HTC::displayBrightnessResolution() const
{
   if (d->m_model == HTC_Universal )
        return 120;
   else
        return 0;
}


bool HTC::setDisplayBrightness( int bright )
{
    bool res = false;

    if ( bright > 199 )
        bright = 199;
    if ( bright < 0 )
        bright = 0;

    QString cmdline;

    if ( d->m_model == Model_HTC_Universal ) {
        cmdline = QString::fromLatin1( "echo %1 > /sys/class/backlight/pxa2xx-fb/brightness" ).arg( bright );
    }
    // No Global::shellQuote as we gurantee it to be sane
    res = ( ::system( QFile::encodeName(cmdline) ) == 0 );

    return res;
}