summaryrefslogtreecommitdiff
path: root/libopie2
Unidiff
Diffstat (limited to 'libopie2') (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 56f305f..62bb68a 100644
--- a/libopie2/opiecore/device/odevice.cpp
+++ b/libopie2/opiecore/device/odevice.cpp
@@ -9,48 +9,49 @@
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_jornada.h" 34#include "odevice_jornada.h"
34#include "odevice_ramses.h" 35#include "odevice_ramses.h"
35#include "odevice_simpad.h" 36#include "odevice_simpad.h"
36#include "odevice_yopy.h" 37#include "odevice_yopy.h"
37#include "odevice_zaurus.h" 38#include "odevice_zaurus.h"
38#include "odevice_genuineintel.h" 39#include "odevice_genuineintel.h"
39 40
40/* QT */ 41/* QT */
41#include <qapplication.h> 42#include <qapplication.h>
42#include <qfile.h> 43#include <qfile.h>
43#include <qtextstream.h> 44#include <qtextstream.h>
44#include <qwindowsystem_qws.h> 45#include <qwindowsystem_qws.h>
45 46
46/* OPIE */ 47/* OPIE */
47#include <qpe/config.h> 48#include <qpe/config.h>
48#include <qpe/sound.h> 49#include <qpe/sound.h>
49#include <qpe/qcopenvelope_qws.h> 50#include <qpe/qcopenvelope_qws.h>
50#include <qpe/sound.h> 51#include <qpe/sound.h>
51 52
52#include <opie2/okeyfilter.h> 53#include <opie2/okeyfilter.h>
53#include <opie2/oresource.h> 54#include <opie2/oresource.h>
54 55
55/* STD */ 56/* STD */
56#include <fcntl.h> 57#include <fcntl.h>
@@ -117,48 +118,49 @@ struct default_button default_buttons [] = {
117 "opiemail", "newMail()" }, 118 "opiemail", "newMail()" },
118}; 119};
119 120
120ODevice *ODevice::inst() 121ODevice *ODevice::inst()
121{ 122{
122 static ODevice *dev = 0; 123 static ODevice *dev = 0;
123 QString cpu_info; 124 QString cpu_info;
124 125
125 if ( !dev ) 126 if ( !dev )
126 { 127 {
127 QFile f( PATH_PROC_CPUINFO ); 128 QFile f( PATH_PROC_CPUINFO );
128 if ( f.open( IO_ReadOnly ) ) 129 if ( f.open( IO_ReadOnly ) )
129 { 130 {
130 QTextStream s( &f ); 131 QTextStream s( &f );
131 while ( !s.atEnd() ) 132 while ( !s.atEnd() )
132 { 133 {
133 QString line; 134 QString line;
134 line = s.readLine(); 135 line = s.readLine();
135 if ( line.startsWith( "Hardware" ) ) 136 if ( line.startsWith( "Hardware" ) )
136 { 137 {
137 qDebug( "ODevice() - found '%s'", (const char*) line ); 138 qDebug( "ODevice() - found '%s'", (const char*) line );
138 cpu_info = line; 139 cpu_info = line;
139 if ( line.contains( "sharp", false ) ) dev = new Internal::Zaurus(); 140 if ( line.contains( "sharp", false ) ) dev = new Internal::Zaurus();
140 else if ( line.contains( "ipaq", false ) ) dev = new Internal::iPAQ(); 141 else if ( line.contains( "ipaq", false ) ) dev = new Internal::iPAQ();
142 else if ( line.contains( "mypal", false ) ) dev = new Internal::MyPal();
141 else if ( line.contains( "simpad", false ) ) dev = new Internal::SIMpad(); 143 else if ( line.contains( "simpad", false ) ) dev = new Internal::SIMpad();
142 else if ( line.contains( "jornada", false ) ) dev = new Internal::Jornada(); 144 else if ( line.contains( "jornada", false ) ) dev = new Internal::Jornada();
143 else if ( line.contains( "ramses", false ) ) dev = new Internal::Ramses(); 145 else if ( line.contains( "ramses", false ) ) dev = new Internal::Ramses();
144 else if ( line.contains( "Tradesquare.NL", false ) ) dev = new Internal::Beagle(); 146 else if ( line.contains( "Tradesquare.NL", false ) ) dev = new Internal::Beagle();
145 else qWarning( "ODevice() - unknown hardware - using default." ); 147 else qWarning( "ODevice() - unknown hardware - using default." );
146 break; 148 break;
147 } else if ( line.startsWith( "vendor_id" ) ) { 149 } else if ( line.startsWith( "vendor_id" ) ) {
148 qDebug( "ODevice() - found '%s'", (const char*) line ); 150 qDebug( "ODevice() - found '%s'", (const char*) line );
149 cpu_info = line; 151 cpu_info = line;
150 if( line.contains( "genuineintel", false ) ) { 152 if( line.contains( "genuineintel", false ) ) {
151 dev = new Internal::GenuineIntel(); 153 dev = new Internal::GenuineIntel();
152 break; 154 break;
153 } 155 }
154 } 156 }
155 } 157 }
156 } 158 }
157 else 159 else
158 { 160 {
159 qWarning( "ODevice() - can't open '%s' - unknown hardware - using default.", PATH_PROC_CPUINFO ); 161 qWarning( "ODevice() - can't open '%s' - unknown hardware - using default.", PATH_PROC_CPUINFO );
160 } 162 }
161 if ( !dev ) dev = new ODevice(); 163 if ( !dev ) dev = new ODevice();
162 dev->init(cpu_info); 164 dev->init(cpu_info);
163 } 165 }
164 return dev; 166 return dev;