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.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/libopie2/opiecore/device/odevice.cpp b/libopie2/opiecore/device/odevice.cpp
index 8f5be8b..e4233eb 100644
--- a/libopie2/opiecore/device/odevice.cpp
+++ b/libopie2/opiecore/device/odevice.cpp
@@ -18,48 +18,49 @@
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#include "odevice_motorola_ezx.h"
42#include "odevice_palm.h"
42 43
43/* QT */ 44/* QT */
44#include <qapplication.h> 45#include <qapplication.h>
45#include <qfile.h> 46#include <qfile.h>
46#include <qtextstream.h> 47#include <qtextstream.h>
47#include <qwindowsystem_qws.h> 48#include <qwindowsystem_qws.h>
48 49
49/* OPIE */ 50/* OPIE */
50#include <qpe/config.h> 51#include <qpe/config.h>
51#include <qpe/sound.h> 52#include <qpe/sound.h>
52#include <qpe/qcopenvelope_qws.h> 53#include <qpe/qcopenvelope_qws.h>
53#include <qpe/sound.h> 54#include <qpe/sound.h>
54 55
55#include <opie2/okeyfilter.h> 56#include <opie2/okeyfilter.h>
56#include <opie2/oresource.h> 57#include <opie2/oresource.h>
57 58
58/* STD */ 59/* STD */
59#include <fcntl.h> 60#include <fcntl.h>
60#include <math.h> 61#include <math.h>
61#include <stdlib.h> 62#include <stdlib.h>
62#include <signal.h> 63#include <signal.h>
63#include <sys/ioctl.h> 64#include <sys/ioctl.h>
64#include <sys/time.h> 65#include <sys/time.h>
65#include <unistd.h> 66#include <unistd.h>
@@ -127,48 +128,49 @@ ODevice *ODevice::inst()
127 128
128 if ( !dev ) 129 if ( !dev )
129 { 130 {
130 QFile f( PATH_PROC_CPUINFO ); 131 QFile f( PATH_PROC_CPUINFO );
131 if ( f.open( IO_ReadOnly ) ) 132 if ( f.open( IO_ReadOnly ) )
132 { 133 {
133 QTextStream s( &f ); 134 QTextStream s( &f );
134 while ( !s.atEnd() ) 135 while ( !s.atEnd() )
135 { 136 {
136 QString line; 137 QString line;
137 line = s.readLine(); 138 line = s.readLine();
138 if ( line.startsWith( "Hardware" ) ) 139 if ( line.startsWith( "Hardware" ) )
139 { 140 {
140 qDebug( "ODevice() - found '%s'", (const char*) line ); 141 qDebug( "ODevice() - found '%s'", (const char*) line );
141 cpu_info = line; 142 cpu_info = line;
142 if ( line.contains( "sharp", false ) ) dev = new Internal::Zaurus(); 143 if ( line.contains( "sharp", false ) ) dev = new Internal::Zaurus();
143 else if ( line.contains( "ipaq", false ) ) dev = new Internal::iPAQ(); 144 else if ( line.contains( "ipaq", false ) ) dev = new Internal::iPAQ();
144 else if ( line.contains( "mypal", false ) ) dev = new Internal::MyPal(); 145 else if ( line.contains( "mypal", false ) ) dev = new Internal::MyPal();
145 else if ( line.contains( "simpad", false ) ) dev = new Internal::SIMpad(); 146 else if ( line.contains( "simpad", false ) ) dev = new Internal::SIMpad();
146 else if ( line.contains( "jornada", false ) ) dev = new Internal::Jornada(); 147 else if ( line.contains( "jornada", false ) ) dev = new Internal::Jornada();
147 else if ( line.contains( "ramses", false ) ) dev = new Internal::Ramses(); 148 else if ( line.contains( "ramses", false ) ) dev = new Internal::Ramses();
148 else if ( line.contains( "Tradesquare.NL", false ) ) dev = new Internal::Beagle(); 149 else if ( line.contains( "Tradesquare.NL", false ) ) dev = new Internal::Beagle();
149 else if ( line.contains( "HTC", false ) ) dev = new Internal::HTC(); 150 else if ( line.contains( "HTC", false ) ) dev = new Internal::HTC();
150 else if ( line.contains( "Motorola", false ) ) dev = new Internal::Motorola_EZX(); 151 else if ( line.contains( "Motorola", false ) ) dev = new Internal::Motorola_EZX();
152 else if ( line.contains( "Palm", false ) ) dev = new Internal::Palm();
151 153
152 else qWarning( "ODevice() - unknown hardware - using default." ); 154 else qWarning( "ODevice() - unknown hardware - using default." );
153 break; 155 break;
154 } else if ( line.startsWith( "vendor_id" ) ) { 156 } else if ( line.startsWith( "vendor_id" ) ) {
155 qDebug( "ODevice() - found '%s'", (const char*) line ); 157 qDebug( "ODevice() - found '%s'", (const char*) line );
156 cpu_info = line; 158 cpu_info = line;
157 if( line.contains( "genuineintel", false ) ) { 159 if( line.contains( "genuineintel", false ) ) {
158 dev = new Internal::GenuineIntel(); 160 dev = new Internal::GenuineIntel();
159 break; 161 break;
160 } 162 }
161 } 163 }
162 } 164 }
163 } 165 }
164 else 166 else
165 { 167 {
166 qWarning( "ODevice() - can't open '%s' - unknown hardware - using default.", PATH_PROC_CPUINFO ); 168 qWarning( "ODevice() - can't open '%s' - unknown hardware - using default.", PATH_PROC_CPUINFO );
167 } 169 }
168 if ( !dev ) dev = new ODevice(); 170 if ( !dev ) dev = new ODevice();
169 dev->init(cpu_info); 171 dev->init(cpu_info);
170 } 172 }
171 return dev; 173 return dev;
172} 174}
173 175
174ODevice::ODevice() 176ODevice::ODevice()