summaryrefslogtreecommitdiff
path: root/libopie2/opiecore/device/odevice.cpp
Side-by-side diff
Diffstat (limited to 'libopie2/opiecore/device/odevice.cpp') (more/less context) (show whitespace changes)
-rw-r--r--libopie2/opiecore/device/odevice.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/libopie2/opiecore/device/odevice.cpp b/libopie2/opiecore/device/odevice.cpp
index 62a2e03..cef7f63 100644
--- a/libopie2/opiecore/device/odevice.cpp
+++ b/libopie2/opiecore/device/odevice.cpp
@@ -87,12 +87,13 @@ struct default_button default_buttons [] = {
ODevice *ODevice::inst()
{
static ODevice *dev = 0;
// rewrite this to only use /proc/cpuinfo or so
+ QString cpu_info;
if ( !dev )
{
QFile f( PATH_PROC_CPUINFO );
if ( f.open( IO_ReadOnly ) )
{
@@ -101,12 +102,13 @@ ODevice *ODevice::inst()
{
QString line;
line = s.readLine();
if ( line.startsWith( "Hardware" ) )
{
qDebug( "ODevice() - found '%s'", (const char*) line );
+ cpu_info = line;
if ( line.contains( "sharp", false ) ) dev = new Internal::Zaurus();
else if ( line.contains( "ipaq", false ) ) dev = new Internal::iPAQ();
else if ( line.contains( "simpad", false ) ) dev = new Internal::SIMpad();
else if ( line.contains( "jornada", false ) ) dev = new Internal::Jornada();
else if ( line.contains( "ramses", false ) ) dev = new Internal::Ramses();
else qWarning( "ODevice() - unknown hardware - using default." );
@@ -116,13 +118,13 @@ ODevice *ODevice::inst()
}
else
{
qWarning( "ODevice() - can't open '%s' - unknown hardware - using default.", PATH_PROC_CPUINFO );
}
if ( !dev ) dev = new ODevice();
- dev->init();
+ dev->init(cpu_info);
}
return dev;
}
ODevice::ODevice()
{
@@ -147,13 +149,13 @@ void ODevice::systemMessage ( const QCString &msg, const QByteArray & )
{
if ( msg == "deviceButtonMappingChanged()" ) {
reloadButtonMapping();
}
}
-void ODevice::init()
+void ODevice::init(const QString&)
{
}
/**
* This method initialises the button mapping
*/