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.cpp17
1 files changed, 10 insertions, 7 deletions
diff --git a/libopie2/opiecore/device/odevice.cpp b/libopie2/opiecore/device/odevice.cpp
index 27b0e53..f3e2cfb 100644
--- a/libopie2/opiecore/device/odevice.cpp
+++ b/libopie2/opiecore/device/odevice.cpp
@@ -57,13 +57,13 @@ _;:, .> :=|. This program is free software; you can
57#ifndef QT_NO_SOUND 57#ifndef QT_NO_SOUND
58#include <linux/soundcard.h> 58#include <linux/soundcard.h>
59#endif 59#endif
60 60
61const char* PATH_PROC_CPUINFO = "/proc/cpuinfo"; 61const char* PATH_PROC_CPUINFO = "/proc/cpuinfo";
62 62
63using namespace Opie; 63using namespace Opie::Core;
64 64
65ODevice *ODevice::inst() 65ODevice *ODevice::inst()
66{ 66{
67 static ODevice *dev = 0; 67 static ODevice *dev = 0;
68 68
69 // rewrite this to only use /proc/cpuinfo or so 69 // rewrite this to only use /proc/cpuinfo or so
@@ -78,17 +78,17 @@ ODevice *ODevice::inst()
78 { 78 {
79 QString line; 79 QString line;
80 line = s.readLine(); 80 line = s.readLine();
81 if ( line.startsWith( "Hardware" ) ) 81 if ( line.startsWith( "Hardware" ) )
82 { 82 {
83 qDebug( "ODevice() - found '%s'", (const char*) line ); 83 qDebug( "ODevice() - found '%s'", (const char*) line );
84 if ( line.contains( "sharp", false ) ) dev = new Zaurus(); 84 if ( line.contains( "sharp", false ) ) dev = new Private::Zaurus();
85 else if ( line.contains( "ipaq", false ) ) dev = new iPAQ(); 85 else if ( line.contains( "ipaq", false ) ) dev = new Private::iPAQ();
86 else if ( line.contains( "simpad", false ) ) dev = new SIMpad(); 86 else if ( line.contains( "simpad", false ) ) dev = new Private::SIMpad();
87 else if ( line.contains( "jornada", false ) ) dev = new Jornada(); 87 else if ( line.contains( "jornada", false ) ) dev = new Private::Jornada();
88 else if ( line.contains( "ramses", false ) ) dev = new Ramses(); 88 else if ( line.contains( "ramses", false ) ) dev = new Private::Ramses();
89 else qWarning( "ODevice() - unknown hardware - using default." ); 89 else qWarning( "ODevice() - unknown hardware - using default." );
90 break; 90 break;
91 } 91 }
92 } 92 }
93 } 93 }
94 else 94 else
@@ -184,13 +184,13 @@ bool ODevice::suspend()
184 184
185 if ( d->m_model == Model_Unknown ) // better don't suspend in qvfb / on unkown devices 185 if ( d->m_model == Model_Unknown ) // better don't suspend in qvfb / on unkown devices
186 return false; 186 return false;
187 187
188 bool res = false; 188 bool res = false;
189 ODevice::sendSuspendmsg(); 189 ODevice::sendSuspendmsg();
190 190
191 struct timeval tvs, tvn; 191 struct timeval tvs, tvn;
192 ::gettimeofday ( &tvs, 0 ); 192 ::gettimeofday ( &tvs, 0 );
193 193
194 ::sync(); // flush fs caches 194 ::sync(); // flush fs caches
195 res = ( ::system ( "apm --suspend" ) == 0 ); 195 res = ( ::system ( "apm --suspend" ) == 0 );
196 196
@@ -621,8 +621,11 @@ void ODevice::remapHeldAction ( int button, const OQCopMessage &action )
621void ODevice::virtual_hook(int, void* ){ 621void ODevice::virtual_hook(int, void* ){
622 622
623} 623}
624 624
625void ODevice::sendSuspendmsg() 625void ODevice::sendSuspendmsg()
626{ 626{
627 if ( isQWS() )
628 return;
629
627 QCopEnvelope ( "QPE/System", "aboutToSuspend()" ); 630 QCopEnvelope ( "QPE/System", "aboutToSuspend()" );
628} 631}