Diffstat (limited to 'libopie2/opiecore/device/odevice.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | libopie2/opiecore/device/odevice.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libopie2/opiecore/device/odevice.cpp b/libopie2/opiecore/device/odevice.cpp index 2355621..2b10034 100644 --- a/libopie2/opiecore/device/odevice.cpp +++ b/libopie2/opiecore/device/odevice.cpp | |||
@@ -18,24 +18,25 @@ | |||
18 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU | 18 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU |
19 | ..}^=.= = ; Library General Public License for more | 19 | ..}^=.= = ; Library General Public License for more |
20 | ++= -. .` .: details. | 20 | ++= -. .` .: details. |
21 | : = ...= . :.=- | 21 | : = ...= . :.=- |
22 | -. .:....=;==+<; You should have received a copy of the GNU | 22 | -. .:....=;==+<; You should have received a copy of the GNU |
23 | -_. . . )=. = Library General Public License along with | 23 | -_. . . )=. = Library General Public License along with |
24 | -- :-=` this library; see the file COPYING.LIB. | 24 | -- :-=` this library; see the file COPYING.LIB. |
25 | If not, write to the Free Software Foundation, | 25 | If not, write to the Free Software Foundation, |
26 | Inc., 59 Temple Place - Suite 330, | 26 | Inc., 59 Temple Place - Suite 330, |
27 | Boston, MA 02111-1307, USA. | 27 | Boston, MA 02111-1307, USA. |
28 | */ | 28 | */ |
29 | 29 | ||
30 | #include "odevice_beagle.h" | ||
30 | #include "odevice_ipaq.h" | 31 | #include "odevice_ipaq.h" |
31 | #include "odevice_jornada.h" | 32 | #include "odevice_jornada.h" |
32 | #include "odevice_ramses.h" | 33 | #include "odevice_ramses.h" |
33 | #include "odevice_simpad.h" | 34 | #include "odevice_simpad.h" |
34 | #include "odevice_yopy.h" | 35 | #include "odevice_yopy.h" |
35 | #include "odevice_zaurus.h" | 36 | #include "odevice_zaurus.h" |
36 | 37 | ||
37 | /* QT */ | 38 | /* QT */ |
38 | #include <qapplication.h> | 39 | #include <qapplication.h> |
39 | #include <qfile.h> | 40 | #include <qfile.h> |
40 | #include <qtextstream.h> | 41 | #include <qtextstream.h> |
41 | #include <qwindowsystem_qws.h> | 42 | #include <qwindowsystem_qws.h> |
@@ -130,24 +131,25 @@ ODevice *ODevice::inst() | |||
130 | { | 131 | { |
131 | QString line; | 132 | QString line; |
132 | line = s.readLine(); | 133 | line = s.readLine(); |
133 | if ( line.startsWith( "Hardware" ) ) | 134 | if ( line.startsWith( "Hardware" ) ) |
134 | { | 135 | { |
135 | qDebug( "ODevice() - found '%s'", (const char*) line ); | 136 | qDebug( "ODevice() - found '%s'", (const char*) line ); |
136 | cpu_info = line; | 137 | cpu_info = line; |
137 | if ( line.contains( "sharp", false ) ) dev = new Internal::Zaurus(); | 138 | if ( line.contains( "sharp", false ) ) dev = new Internal::Zaurus(); |
138 | else if ( line.contains( "ipaq", false ) ) dev = new Internal::iPAQ(); | 139 | else if ( line.contains( "ipaq", false ) ) dev = new Internal::iPAQ(); |
139 | else if ( line.contains( "simpad", false ) ) dev = new Internal::SIMpad(); | 140 | else if ( line.contains( "simpad", false ) ) dev = new Internal::SIMpad(); |
140 | else if ( line.contains( "jornada", false ) ) dev = new Internal::Jornada(); | 141 | else if ( line.contains( "jornada", false ) ) dev = new Internal::Jornada(); |
141 | else if ( line.contains( "ramses", false ) ) dev = new Internal::Ramses(); | 142 | else if ( line.contains( "ramses", false ) ) dev = new Internal::Ramses(); |
143 | else if ( line.contains( "Tradesquare.NL", false ) ) dev = new Internal::Beagle(); | ||
142 | else qWarning( "ODevice() - unknown hardware - using default." ); | 144 | else qWarning( "ODevice() - unknown hardware - using default." ); |
143 | break; | 145 | break; |
144 | } | 146 | } |
145 | } | 147 | } |
146 | } | 148 | } |
147 | else | 149 | else |
148 | { | 150 | { |
149 | qWarning( "ODevice() - can't open '%s' - unknown hardware - using default.", PATH_PROC_CPUINFO ); | 151 | qWarning( "ODevice() - can't open '%s' - unknown hardware - using default.", PATH_PROC_CPUINFO ); |
150 | } | 152 | } |
151 | if ( !dev ) dev = new ODevice(); | 153 | if ( !dev ) dev = new ODevice(); |
152 | dev->init(cpu_info); | 154 | dev->init(cpu_info); |
153 | } | 155 | } |
@@ -257,25 +259,24 @@ bool ODevice::setSoftSuspend ( bool /*soft*/ ) | |||
257 | * This method will try to suspend the device | 259 | * This method will try to suspend the device |
258 | * It only works if the user is the QWS Server and the apm application | 260 | * It only works if the user is the QWS Server and the apm application |
259 | * is installed. | 261 | * is installed. |
260 | * It tries to suspend and then waits some time cause some distributions | 262 | * It tries to suspend and then waits some time cause some distributions |
261 | * do have asynchronus apm implementations. | 263 | * do have asynchronus apm implementations. |
262 | * This method will either fail and return false or it'll suspend the | 264 | * This method will either fail and return false or it'll suspend the |
263 | * device and return once the device got woken up | 265 | * device and return once the device got woken up |
264 | * | 266 | * |
265 | * @return if the device got suspended | 267 | * @return if the device got suspended |
266 | */ | 268 | */ |
267 | bool ODevice::suspend() | 269 | bool ODevice::suspend() |
268 | { | 270 | { |
269 | qDebug("ODevice::suspend"); | ||
270 | if ( !isQWS( ) ) // only qwsserver is allowed to suspend | 271 | if ( !isQWS( ) ) // only qwsserver is allowed to suspend |
271 | return false; | 272 | return false; |
272 | 273 | ||
273 | if ( d->m_model == Model_Unknown ) // better don't suspend in qvfb / on unkown devices | 274 | if ( d->m_model == Model_Unknown ) // better don't suspend in qvfb / on unkown devices |
274 | return false; | 275 | return false; |
275 | 276 | ||
276 | bool res = false; | 277 | bool res = false; |
277 | ODevice::sendSuspendmsg(); | 278 | ODevice::sendSuspendmsg(); |
278 | 279 | ||
279 | struct timeval tvs, tvn; | 280 | struct timeval tvs, tvn; |
280 | ::gettimeofday ( &tvs, 0 ); | 281 | ::gettimeofday ( &tvs, 0 ); |
281 | 282 | ||