summaryrefslogtreecommitdiff
path: root/libopie2
Unidiff
Diffstat (limited to 'libopie2') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opiecore/device/odevice_jornada.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/libopie2/opiecore/device/odevice_jornada.cpp b/libopie2/opiecore/device/odevice_jornada.cpp
index 5f95e42..7d080ba 100644
--- a/libopie2/opiecore/device/odevice_jornada.cpp
+++ b/libopie2/opiecore/device/odevice_jornada.cpp
@@ -157,27 +157,28 @@ bool Jornada::setDisplayBrightness( int bright )
157 if ( bright < 0 ) 157 if ( bright < 0 )
158 bright = 0; 158 bright = 0;
159 159
160 QString cmdline; 160 QString cmdline;
161 161
162 if ( !bright ) 162 if ( !bright )
163 cmdline = QString().sprintf( "echo 4 > /sys/class/backlight/sa1100fb/power"); 163 cmdline = QString::fromLatin1( "echo 4 > /sys/class/backlight/sa1100fb/power");
164 else 164 else
165 cmdline = QString().sprintf( "echo 0 > /sys/class/backlight/sa1100fb/power; echo %d > /sys/class/backlight/sa1100fb/brightness", bright ); 165 cmdline = QString::fromLatin1( "echo 0 > /sys/class/backlight/sa1100fb/power; echo %1 > /sys/class/backlight/sa1100fb/brightness" ).arg( bright );
166 166
167 res = ( ::system( (const char*) cmdline ) == 0 ); 167 // No Global::shellQuote as we gurantee it to be sane
168 res = ( ::system( QFile::encodeName(cmdline) ) == 0 );
168 169
169 return res; 170 return res;
170} 171}
171 172
172 173
173bool Jornada::setDisplayStatus ( bool on ) 174bool Jornada::setDisplayStatus ( bool on )
174{ 175{
175 bool res = false; 176 bool res = false;
176 177
177 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" ); 178 QString cmdline = QString::fromLatin1( "echo %1 > /sys/class/lcd/sa1100fb/power; echo %2 > /sys/class/backlight/sa1100fb/power").arg( on ? "0" : "4" ).arg( on ? "0" : "4" );
178 179
179 res = ( ::system( (const char*) cmdline ) == 0 ); 180 res = ( ::system( QFile::encodeName(cmdline) ) == 0 );
180 181
181 return res; 182 return res;
182} 183}
183 184