summaryrefslogtreecommitdiff
path: root/libopie2/opiecore/device/odevice.cpp
Unidiff
Diffstat (limited to 'libopie2/opiecore/device/odevice.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opiecore/device/odevice.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/libopie2/opiecore/device/odevice.cpp b/libopie2/opiecore/device/odevice.cpp
index 5e91d8b..56f305f 100644
--- a/libopie2/opiecore/device/odevice.cpp
+++ b/libopie2/opiecore/device/odevice.cpp
@@ -156,48 +156,49 @@ ODevice *ODevice::inst()
156 } 156 }
157 else 157 else
158 { 158 {
159 qWarning( "ODevice() - can't open '%s' - unknown hardware - using default.", PATH_PROC_CPUINFO ); 159 qWarning( "ODevice() - can't open '%s' - unknown hardware - using default.", PATH_PROC_CPUINFO );
160 } 160 }
161 if ( !dev ) dev = new ODevice(); 161 if ( !dev ) dev = new ODevice();
162 dev->init(cpu_info); 162 dev->init(cpu_info);
163 } 163 }
164 return dev; 164 return dev;
165} 165}
166 166
167ODevice::ODevice() 167ODevice::ODevice()
168{ 168{
169 d = new ODeviceData; 169 d = new ODeviceData;
170 170
171 d->m_modelstr = "Unknown"; 171 d->m_modelstr = "Unknown";
172 d->m_model = Model_Unknown; 172 d->m_model = Model_Unknown;
173 d->m_vendorstr = "Unknown"; 173 d->m_vendorstr = "Unknown";
174 d->m_vendor = Vendor_Unknown; 174 d->m_vendor = Vendor_Unknown;
175 d->m_systemstr = "Unknown"; 175 d->m_systemstr = "Unknown";
176 d->m_system = System_Unknown; 176 d->m_system = System_Unknown;
177 d->m_sysverstr = "0.0"; 177 d->m_sysverstr = "0.0";
178 d->m_rotation = Rot0; 178 d->m_rotation = Rot0;
179 d->m_direction = CW; 179 d->m_direction = CW;
180 d->m_qteDriver = "Transformed";
180 181
181 d->m_holdtime = 1000; // 1000ms 182 d->m_holdtime = 1000; // 1000ms
182 d->m_buttons = 0; 183 d->m_buttons = 0;
183 d->m_cpu_frequencies = new QStrList; 184 d->m_cpu_frequencies = new QStrList;
184 185
185 186
186 /* mixer */ 187 /* mixer */
187 d->m_sound = d->m_vol = d->m_mixer = -1; 188 d->m_sound = d->m_vol = d->m_mixer = -1;
188 189
189 /* System QCopChannel created */ 190 /* System QCopChannel created */
190 d->m_initializedButtonQcop = false; 191 d->m_initializedButtonQcop = false;
191 192
192 // New distribution detection code first checks for legacy distributions, 193 // New distribution detection code first checks for legacy distributions,
193 // identified by /etc/familiar-version or /etc/oz_version. 194 // identified by /etc/familiar-version or /etc/oz_version.
194 // Then check for OpenEmbedded and lastly, read /etc/issue 195 // Then check for OpenEmbedded and lastly, read /etc/issue
195 196
196 for ( unsigned int i = 0; i < sizeof(distributions)/sizeof(ODistribution); ++i ) 197 for ( unsigned int i = 0; i < sizeof(distributions)/sizeof(ODistribution); ++i )
197 { 198 {
198 if ( QFile::exists( distributions[i].sysvfile ) ) 199 if ( QFile::exists( distributions[i].sysvfile ) )
199 { 200 {
200 d->m_systemstr = distributions[i].sysstr; 201 d->m_systemstr = distributions[i].sysstr;
201 d->m_system = distributions[i].system; 202 d->m_system = distributions[i].system;
202 d->m_sysverstr = "<Unknown>"; 203 d->m_sysverstr = "<Unknown>";
203 QFile f( distributions[i].sysvfile ); 204 QFile f( distributions[i].sysvfile );
@@ -381,48 +382,53 @@ OSystem ODevice::system() const
381/** 382/**
382* @return the version string of the base system 383* @return the version string of the base system
383*/ 384*/
384QString ODevice::systemVersionString() const 385QString ODevice::systemVersionString() const
385{ 386{
386 return d->m_sysverstr; 387 return d->m_sysverstr;
387} 388}
388 389
389/** 390/**
390* @return the current Transformation 391* @return the current Transformation
391*/ 392*/
392Transformation ODevice::rotation() const 393Transformation ODevice::rotation() const
393{ 394{
394 return d->m_rotation; 395 return d->m_rotation;
395} 396}
396 397
397/** 398/**
398* @return the current rotation direction 399* @return the current rotation direction
399*/ 400*/
400ODirection ODevice::direction() const 401ODirection ODevice::direction() const
401{ 402{
402 return d->m_direction; 403 return d->m_direction;
403} 404}
404 405
406QString ODevice::qteDriver() const
407{
408 return d->m_qteDriver;
409}
410
405/** 411/**
406* This plays an alarm sound 412* This plays an alarm sound
407*/ 413*/
408void ODevice::playAlarmSound() 414void ODevice::playAlarmSound()
409{ 415{
410#ifndef QT_NO_SOUND 416#ifndef QT_NO_SOUND
411 static Sound snd ( "alarm" ); 417 static Sound snd ( "alarm" );
412 418
413 if ( snd. isFinished()) 419 if ( snd. isFinished())
414 snd. play(); 420 snd. play();
415#endif 421#endif
416} 422}
417 423
418/** 424/**
419* This plays a key sound 425* This plays a key sound
420*/ 426*/
421void ODevice::playKeySound() 427void ODevice::playKeySound()
422{ 428{
423#ifndef QT_NO_SOUND 429#ifndef QT_NO_SOUND
424 static Sound snd ( "keysound" ); 430 static Sound snd ( "keysound" );
425 431
426 if ( snd. isFinished()) 432 if ( snd. isFinished())
427 snd. play(); 433 snd. play();
428#endif 434#endif