Diffstat (limited to 'libopie2/opiecore/device/odevice.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | libopie2/opiecore/device/odevice.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/libopie2/opiecore/device/odevice.cpp b/libopie2/opiecore/device/odevice.cpp index c6e031f..8f5be8b 100644 --- a/libopie2/opiecore/device/odevice.cpp +++ b/libopie2/opiecore/device/odevice.cpp | |||
@@ -1,64 +1,65 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of the Opie Project | 2 | This file is part of the Opie Project |
3 | =. (C) 2002-2005 The Opie Team <opie-devel@handhelds.org> | 3 | =. (C) 2002-2006 The Opie Team <opie-devel@handhelds.org> |
4 | .=l. | 4 | .=l. |
5 | .>+-= | 5 | .>+-= |
6 | _;:, .> :=|. This program is free software; you can | 6 | _;:, .> :=|. This program is free software; you can |
7 | .> <`_, > . <= redistribute it and/or modify it under | 7 | .> <`_, > . <= redistribute it and/or modify it under |
8 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public | 8 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public |
9 | .="- .-=="i, .._ License as published by the Free Software | 9 | .="- .-=="i, .._ License as published by the Free Software |
10 | - . .-<_> .<> Foundation; version 2 of the License. | 10 | - . .-<_> .<> Foundation; version 2 of the License. |
11 | ._= =} : | 11 | ._= =} : |
12 | .%`+i> _;_. | 12 | .%`+i> _;_. |
13 | .i_,=:_. -<s. This program is distributed in the hope that | 13 | .i_,=:_. -<s. This program is distributed in the hope that |
14 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | 14 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; |
15 | : .. .:, . . . without even the implied warranty of | 15 | : .. .:, . . . without even the implied warranty of |
16 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | 16 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A |
17 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU | 17 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU |
18 | ..}^=.= = ; Library General Public License for more | 18 | ..}^=.= = ; Library General Public License for more |
19 | ++= -. .` .: details. | 19 | ++= -. .` .: details. |
20 | : = ...= . :.=- | 20 | : = ...= . :.=- |
21 | -. .:....=;==+<; You should have received a copy of the GNU | 21 | -. .:....=;==+<; You should have received a copy of the GNU |
22 | -_. . . )=. = Library General Public License along with | 22 | -_. . . )=. = Library General Public License along with |
23 | -- :-=` this library; see the file COPYING.LIB. | 23 | -- :-=` this library; see the file COPYING.LIB. |
24 | If not, write to the Free Software Foundation, | 24 | If not, write to the Free Software Foundation, |
25 | Inc., 59 Temple Place - Suite 330, | 25 | Inc., 59 Temple Place - Suite 330, |
26 | Boston, MA 02111-1307, USA. | 26 | Boston, MA 02111-1307, USA. |
27 | 27 | ||
28 | */ | 28 | */ |
29 | 29 | ||
30 | 30 | ||
31 | #include "odevice_beagle.h" | 31 | #include "odevice_beagle.h" |
32 | #include "odevice_ipaq.h" | 32 | #include "odevice_ipaq.h" |
33 | #include "odevice_mypal.h" | 33 | #include "odevice_mypal.h" |
34 | #include "odevice_jornada.h" | 34 | #include "odevice_jornada.h" |
35 | #include "odevice_ramses.h" | 35 | #include "odevice_ramses.h" |
36 | #include "odevice_simpad.h" | 36 | #include "odevice_simpad.h" |
37 | #include "odevice_yopy.h" | 37 | #include "odevice_yopy.h" |
38 | #include "odevice_zaurus.h" | 38 | #include "odevice_zaurus.h" |
39 | #include "odevice_genuineintel.h" | 39 | #include "odevice_genuineintel.h" |
40 | #include "odevice_htc.h" | 40 | #include "odevice_htc.h" |
41 | #include "odevice_motorola_ezx.h" | ||
41 | 42 | ||
42 | /* QT */ | 43 | /* QT */ |
43 | #include <qapplication.h> | 44 | #include <qapplication.h> |
44 | #include <qfile.h> | 45 | #include <qfile.h> |
45 | #include <qtextstream.h> | 46 | #include <qtextstream.h> |
46 | #include <qwindowsystem_qws.h> | 47 | #include <qwindowsystem_qws.h> |
47 | 48 | ||
48 | /* OPIE */ | 49 | /* OPIE */ |
49 | #include <qpe/config.h> | 50 | #include <qpe/config.h> |
50 | #include <qpe/sound.h> | 51 | #include <qpe/sound.h> |
51 | #include <qpe/qcopenvelope_qws.h> | 52 | #include <qpe/qcopenvelope_qws.h> |
52 | #include <qpe/sound.h> | 53 | #include <qpe/sound.h> |
53 | 54 | ||
54 | #include <opie2/okeyfilter.h> | 55 | #include <opie2/okeyfilter.h> |
55 | #include <opie2/oresource.h> | 56 | #include <opie2/oresource.h> |
56 | 57 | ||
57 | /* STD */ | 58 | /* STD */ |
58 | #include <fcntl.h> | 59 | #include <fcntl.h> |
59 | #include <math.h> | 60 | #include <math.h> |
60 | #include <stdlib.h> | 61 | #include <stdlib.h> |
61 | #include <signal.h> | 62 | #include <signal.h> |
62 | #include <sys/ioctl.h> | 63 | #include <sys/ioctl.h> |
63 | #include <sys/time.h> | 64 | #include <sys/time.h> |
64 | #include <unistd.h> | 65 | #include <unistd.h> |
@@ -125,48 +126,49 @@ ODevice *ODevice::inst() | |||
125 | QString cpu_info; | 126 | QString cpu_info; |
126 | 127 | ||
127 | if ( !dev ) | 128 | if ( !dev ) |
128 | { | 129 | { |
129 | QFile f( PATH_PROC_CPUINFO ); | 130 | QFile f( PATH_PROC_CPUINFO ); |
130 | if ( f.open( IO_ReadOnly ) ) | 131 | if ( f.open( IO_ReadOnly ) ) |
131 | { | 132 | { |
132 | QTextStream s( &f ); | 133 | QTextStream s( &f ); |
133 | while ( !s.atEnd() ) | 134 | while ( !s.atEnd() ) |
134 | { | 135 | { |
135 | QString line; | 136 | QString line; |
136 | line = s.readLine(); | 137 | line = s.readLine(); |
137 | if ( line.startsWith( "Hardware" ) ) | 138 | if ( line.startsWith( "Hardware" ) ) |
138 | { | 139 | { |
139 | qDebug( "ODevice() - found '%s'", (const char*) line ); | 140 | qDebug( "ODevice() - found '%s'", (const char*) line ); |
140 | cpu_info = line; | 141 | cpu_info = line; |
141 | if ( line.contains( "sharp", false ) ) dev = new Internal::Zaurus(); | 142 | if ( line.contains( "sharp", false ) ) dev = new Internal::Zaurus(); |
142 | else if ( line.contains( "ipaq", false ) ) dev = new Internal::iPAQ(); | 143 | else if ( line.contains( "ipaq", false ) ) dev = new Internal::iPAQ(); |
143 | else if ( line.contains( "mypal", false ) ) dev = new Internal::MyPal(); | 144 | else if ( line.contains( "mypal", false ) ) dev = new Internal::MyPal(); |
144 | else if ( line.contains( "simpad", false ) ) dev = new Internal::SIMpad(); | 145 | else if ( line.contains( "simpad", false ) ) dev = new Internal::SIMpad(); |
145 | else if ( line.contains( "jornada", false ) ) dev = new Internal::Jornada(); | 146 | else if ( line.contains( "jornada", false ) ) dev = new Internal::Jornada(); |
146 | else if ( line.contains( "ramses", false ) ) dev = new Internal::Ramses(); | 147 | else if ( line.contains( "ramses", false ) ) dev = new Internal::Ramses(); |
147 | else if ( line.contains( "Tradesquare.NL", false ) ) dev = new Internal::Beagle(); | 148 | else if ( line.contains( "Tradesquare.NL", false ) ) dev = new Internal::Beagle(); |
148 | else if ( line.contains( "HTC", false ) ) dev = new Internal::HTC(); | 149 | else if ( line.contains( "HTC", false ) ) dev = new Internal::HTC(); |
150 | else if ( line.contains( "Motorola", false ) ) dev = new Internal::Motorola_EZX(); | ||
149 | 151 | ||
150 | else qWarning( "ODevice() - unknown hardware - using default." ); | 152 | else qWarning( "ODevice() - unknown hardware - using default." ); |
151 | break; | 153 | break; |
152 | } else if ( line.startsWith( "vendor_id" ) ) { | 154 | } else if ( line.startsWith( "vendor_id" ) ) { |
153 | qDebug( "ODevice() - found '%s'", (const char*) line ); | 155 | qDebug( "ODevice() - found '%s'", (const char*) line ); |
154 | cpu_info = line; | 156 | cpu_info = line; |
155 | if( line.contains( "genuineintel", false ) ) { | 157 | if( line.contains( "genuineintel", false ) ) { |
156 | dev = new Internal::GenuineIntel(); | 158 | dev = new Internal::GenuineIntel(); |
157 | break; | 159 | break; |
158 | } | 160 | } |
159 | } | 161 | } |
160 | } | 162 | } |
161 | } | 163 | } |
162 | else | 164 | else |
163 | { | 165 | { |
164 | qWarning( "ODevice() - can't open '%s' - unknown hardware - using default.", PATH_PROC_CPUINFO ); | 166 | qWarning( "ODevice() - can't open '%s' - unknown hardware - using default.", PATH_PROC_CPUINFO ); |
165 | } | 167 | } |
166 | if ( !dev ) dev = new ODevice(); | 168 | if ( !dev ) dev = new ODevice(); |
167 | dev->init(cpu_info); | 169 | dev->init(cpu_info); |
168 | } | 170 | } |
169 | return dev; | 171 | return dev; |
170 | } | 172 | } |
171 | 173 | ||
172 | ODevice::ODevice() | 174 | ODevice::ODevice() |