summaryrefslogtreecommitdiff
path: root/libopie2
authormickeyl <mickeyl>2005-06-27 09:36:13 (UTC)
committer mickeyl <mickeyl>2005-06-27 09:36:13 (UTC)
commit3e1e2a8751a169b553570a585293dd9ea6de41cd (patch) (unidiff)
treef39093719df4bd0f3bc3418006a9e59c1c0e76c9 /libopie2
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') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opiecore/device/odevice_simpad.cpp45
-rw-r--r--libopie2/opiecore/device/odevice_zaurus.cpp4
2 files changed, 25 insertions, 24 deletions
diff --git a/libopie2/opiecore/device/odevice_simpad.cpp b/libopie2/opiecore/device/odevice_simpad.cpp
index f2805de..3337783 100644
--- a/libopie2/opiecore/device/odevice_simpad.cpp
+++ b/libopie2/opiecore/device/odevice_simpad.cpp
@@ -1,34 +1,33 @@
1/* 1/*
2                 This file is part of the Opie Project 2                 This file is part of the Opie Project
3 3 =. (C) 2002-2005 The Opie Team <opie-devel@handhelds.org>
4 Copyright (C)2002-2005 The Opie Team <opie-devel@handhelds.org>
5 =.
6 .=l. 4 .=l.
7           .>+-= 5           .>+-=
8 _;:,     .>    :=|. This program is free software; you can 6 _;:,     .>    :=|. This program is free software; you can
9.> <`_,   >  .   <= redistribute it and/or modify it under 7.> <`_,   >  .   <= redistribute it and/or modify it under
10:`=1 )Y*s>-.--   : the terms of the GNU Library General Public 8:`=1 )Y*s>-.--   : the terms of the GNU Library General Public
11.="- .-=="i,     .._ License as published by the Free Software 9.="- .-=="i,     .._ License as published by the Free Software
12 - .   .-<_>     .<> Foundation; either version 2 of the License, 10 - .   .-<_>     .<> Foundation; version 2 of the License.
13     ._= =}       : or (at your option) any later version. 11     ._= =}       :
14    .%`+i>       _;_. 12    .%`+i>       _;_.
15    .i_,=:_.      -<s. This program is distributed in the hope that 13    .i_,=:_.      -<s. This program is distributed in the hope that
16     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY; 14     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
17 : ..    .:,     . . . without even the implied warranty of 15    : ..    .:,     . . . without even the implied warranty of
18    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A 16    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
19  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU 17  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU
20..}^=.=       =       ; Library General Public License for more 18..}^=.=       =       ; Library General Public License for more
21++=   -.     .`     .: details. 19++=   -.     .`     .: details.
22:     =  ...= . :.=- 20 :     =  ...= . :.=-
23 -.   .:....=;==+<; You should have received a copy of the GNU 21 -.   .:....=;==+<; You should have received a copy of the GNU
24  -_. . .   )=.  = Library General Public License along with 22  -_. . .   )=.  = Library General Public License along with
25    --        :-=` this library; see the file COPYING.LIB. 23    --        :-=` this library; see the file COPYING.LIB.
26 If not, write to the Free Software Foundation, 24 If not, write to the Free Software Foundation,
27 Inc., 59 Temple Place - Suite 330, 25 Inc., 59 Temple Place - Suite 330,
28 Boston, MA 02111-1307, USA. 26 Boston, MA 02111-1307, USA.
27
29*/ 28*/
30 29
31#include "odevice_simpad.h" 30#include "odevice_simpad.h"
32 31
33/* QT */ 32/* QT */
34#include <qapplication.h> 33#include <qapplication.h>
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
@@ -653,13 +653,13 @@ bool Zaurus::filter ( int /*unicode*/, int keycode, int modifiers, bool isPress,
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 );
@@ -673,8 +673,10 @@ bool Zaurus::suspend() {
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}