author | zecke <zecke> | 2004-05-01 18:13:29 (UTC) |
---|---|---|
committer | zecke <zecke> | 2004-05-01 18:13:29 (UTC) |
commit | 7a2cac7a65be07c1e82508e00c2d3d61e0823dc1 (patch) (unidiff) | |
tree | 70381a30c784957b22d9e644272ac96a0fced5a4 /libopie2/opiecore/device/odevice.cpp | |
parent | ec6a887d8abddbab085a0a3aecae5760ff85dbe8 (diff) | |
download | opie-7a2cac7a65be07c1e82508e00c2d3d61e0823dc1.zip opie-7a2cac7a65be07c1e82508e00c2d3d61e0823dc1.tar.gz opie-7a2cac7a65be07c1e82508e00c2d3d61e0823dc1.tar.bz2 |
Pass on the Hardware line of proc/cpuinfo so we don't need to parse the file again..
only adjusted iPAQ backend to use it
Beginning of hh22xx Linux2.6 support
Diffstat (limited to 'libopie2/opiecore/device/odevice.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | libopie2/opiecore/device/odevice.cpp | 6 |
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 [] = { | |||
87 | 87 | ||
88 | ODevice *ODevice::inst() | 88 | ODevice *ODevice::inst() |
89 | { | 89 | { |
90 | static ODevice *dev = 0; | 90 | static ODevice *dev = 0; |
91 | 91 | ||
92 | // rewrite this to only use /proc/cpuinfo or so | 92 | // rewrite this to only use /proc/cpuinfo or so |
93 | QString cpu_info; | ||
93 | 94 | ||
94 | if ( !dev ) | 95 | if ( !dev ) |
95 | { | 96 | { |
96 | QFile f( PATH_PROC_CPUINFO ); | 97 | QFile f( PATH_PROC_CPUINFO ); |
97 | if ( f.open( IO_ReadOnly ) ) | 98 | if ( f.open( IO_ReadOnly ) ) |
98 | { | 99 | { |
@@ -101,12 +102,13 @@ ODevice *ODevice::inst() | |||
101 | { | 102 | { |
102 | QString line; | 103 | QString line; |
103 | line = s.readLine(); | 104 | line = s.readLine(); |
104 | if ( line.startsWith( "Hardware" ) ) | 105 | if ( line.startsWith( "Hardware" ) ) |
105 | { | 106 | { |
106 | qDebug( "ODevice() - found '%s'", (const char*) line ); | 107 | qDebug( "ODevice() - found '%s'", (const char*) line ); |
108 | cpu_info = line; | ||
107 | if ( line.contains( "sharp", false ) ) dev = new Internal::Zaurus(); | 109 | if ( line.contains( "sharp", false ) ) dev = new Internal::Zaurus(); |
108 | else if ( line.contains( "ipaq", false ) ) dev = new Internal::iPAQ(); | 110 | else if ( line.contains( "ipaq", false ) ) dev = new Internal::iPAQ(); |
109 | else if ( line.contains( "simpad", false ) ) dev = new Internal::SIMpad(); | 111 | else if ( line.contains( "simpad", false ) ) dev = new Internal::SIMpad(); |
110 | else if ( line.contains( "jornada", false ) ) dev = new Internal::Jornada(); | 112 | else if ( line.contains( "jornada", false ) ) dev = new Internal::Jornada(); |
111 | else if ( line.contains( "ramses", false ) ) dev = new Internal::Ramses(); | 113 | else if ( line.contains( "ramses", false ) ) dev = new Internal::Ramses(); |
112 | else qWarning( "ODevice() - unknown hardware - using default." ); | 114 | else qWarning( "ODevice() - unknown hardware - using default." ); |
@@ -116,13 +118,13 @@ ODevice *ODevice::inst() | |||
116 | } | 118 | } |
117 | else | 119 | else |
118 | { | 120 | { |
119 | qWarning( "ODevice() - can't open '%s' - unknown hardware - using default.", PATH_PROC_CPUINFO ); | 121 | qWarning( "ODevice() - can't open '%s' - unknown hardware - using default.", PATH_PROC_CPUINFO ); |
120 | } | 122 | } |
121 | if ( !dev ) dev = new ODevice(); | 123 | if ( !dev ) dev = new ODevice(); |
122 | dev->init(); | 124 | dev->init(cpu_info); |
123 | } | 125 | } |
124 | return dev; | 126 | return dev; |
125 | } | 127 | } |
126 | 128 | ||
127 | ODevice::ODevice() | 129 | ODevice::ODevice() |
128 | { | 130 | { |
@@ -147,13 +149,13 @@ void ODevice::systemMessage ( const QCString &msg, const QByteArray & ) | |||
147 | { | 149 | { |
148 | if ( msg == "deviceButtonMappingChanged()" ) { | 150 | if ( msg == "deviceButtonMappingChanged()" ) { |
149 | reloadButtonMapping(); | 151 | reloadButtonMapping(); |
150 | } | 152 | } |
151 | } | 153 | } |
152 | 154 | ||
153 | void ODevice::init() | 155 | void ODevice::init(const QString&) |
154 | { | 156 | { |
155 | } | 157 | } |
156 | 158 | ||
157 | /** | 159 | /** |
158 | * This method initialises the button mapping | 160 | * This method initialises the button mapping |
159 | */ | 161 | */ |