summaryrefslogtreecommitdiff
path: root/libopie2/opiecore/device/odevice_zaurus.cpp
authormickeyl <mickeyl>2005-06-27 09:36:13 (UTC)
committer mickeyl <mickeyl>2005-06-27 09:36:13 (UTC)
commit3e1e2a8751a169b553570a585293dd9ea6de41cd (patch) (unidiff)
treef39093719df4bd0f3bc3418006a9e59c1c0e76c9 /libopie2/opiecore/device/odevice_zaurus.cpp
parent99330785fae22b2b9131cfd9c273f3a59a004bdf (diff)
downloadopie-3e1e2a8751a169b553570a585293dd9ea6de41cd.zip
opie-3e1e2a8751a169b553570a585293dd9ea6de41cd.tar.gz
opie-3e1e2a8751a169b553570a585293dd9ea6de41cd.tar.bz2
simpad: restore file header, zaurus: send returnFromSuspend message
Diffstat (limited to 'libopie2/opiecore/device/odevice_zaurus.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opiecore/device/odevice_zaurus.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/libopie2/opiecore/device/odevice_zaurus.cpp b/libopie2/opiecore/device/odevice_zaurus.cpp
index 0c421e3..8369f54 100644
--- a/libopie2/opiecore/device/odevice_zaurus.cpp
+++ b/libopie2/opiecore/device/odevice_zaurus.cpp
@@ -651,17 +651,17 @@ bool Zaurus::filter ( int /*unicode*/, int keycode, int modifiers, bool isPress,
651 return false; 651 return false;
652} 652}
653 653
654bool Zaurus::suspend() { 654bool Zaurus::suspend() {
655 if ( !isQWS( ) ) // only qwsserver is allowed to suspend 655 if ( !isQWS( ) ) // only qwsserver is allowed to suspend
656 return false; 656 return false;
657 657
658 bool res = false; 658 bool res = false;
659 OAbstractMobileDevice::sendSuspendmsg(); 659 QCopEnvelope( "QPE/System", "aboutToSuspend()" );
660 660
661 struct timeval tvs, tvn; 661 struct timeval tvs, tvn;
662 ::gettimeofday ( &tvs, 0 ); 662 ::gettimeofday ( &tvs, 0 );
663 663
664 ::sync(); // flush fs caches 664 ::sync(); // flush fs caches
665 res = ( ::system ( "apm --suspend" ) == 0 ); 665 res = ( ::system ( "apm --suspend" ) == 0 );
666 666
667 // This is needed because some apm implementations are asynchronous and we 667 // This is needed because some apm implementations are asynchronous and we
@@ -671,10 +671,12 @@ bool Zaurus::suspend() {
671 671
672 if ( res && m_embedix) { 672 if ( res && m_embedix) {
673 do { // wait at most 1.5 sec: either suspend didn't work or the device resumed 673 do { // wait at most 1.5 sec: either suspend didn't work or the device resumed
674 ::usleep ( 200 * 1000 ); 674 ::usleep ( 200 * 1000 );
675 ::gettimeofday ( &tvn, 0 ); 675 ::gettimeofday ( &tvn, 0 );
676 } while ((( tvn. tv_sec - tvs. tv_sec ) * 1000 + ( tvn. tv_usec - tvs. tv_usec ) / 1000 ) < m_timeOut ); 676 } while ((( tvn. tv_sec - tvs. tv_sec ) * 1000 + ( tvn. tv_usec - tvs. tv_usec ) / 1000 ) < m_timeOut );
677 } 677 }
678 678
679 QCopEnvelope( "QPE/System", "returnFromSuspend()" );
680
679 return res; 681 return res;
680} 682}