author | mickeyl <mickeyl> | 2005-05-13 09:15:37 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2005-05-13 09:15:37 (UTC) |
commit | b010c50f099d197c0a89755eeef4dc1e40559a83 (patch) (unidiff) | |
tree | 8225bcb4ec5c12a16183382a6dc350490831f97b | |
parent | 6d8b3f413347126d49fec3283dba42db9fc2c858 (diff) | |
download | opie-b010c50f099d197c0a89755eeef4dc1e40559a83.zip opie-b010c50f099d197c0a89755eeef4dc1e40559a83.tar.gz opie-b010c50f099d197c0a89755eeef4dc1e40559a83.tar.bz2 |
/proc/cpuinfo format is architecture dependent :/
-rw-r--r-- | noncore/settings/sysinfo/devicesinfo.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/noncore/settings/sysinfo/devicesinfo.cpp b/noncore/settings/sysinfo/devicesinfo.cpp index b463e43..7e8aee8 100644 --- a/noncore/settings/sysinfo/devicesinfo.cpp +++ b/noncore/settings/sysinfo/devicesinfo.cpp | |||
@@ -95,129 +95,129 @@ DevicesInfo::DevicesInfo( QWidget* parent, const char* name, WFlags fl ) | |||
95 | view = new DevicesView( this ); | 95 | view = new DevicesView( this ); |
96 | layout->addWidget( view, 100 ); | 96 | layout->addWidget( view, 100 ); |
97 | stack = new QWidgetStack( this ); | 97 | stack = new QWidgetStack( this ); |
98 | layout->addWidget( stack, 70 ); | 98 | layout->addWidget( stack, 70 ); |
99 | } | 99 | } |
100 | 100 | ||
101 | 101 | ||
102 | DevicesInfo::~DevicesInfo() | 102 | DevicesInfo::~DevicesInfo() |
103 | { | 103 | { |
104 | } | 104 | } |
105 | 105 | ||
106 | 106 | ||
107 | void DevicesInfo::setDetailsWidget( QWidget* w ) | 107 | void DevicesInfo::setDetailsWidget( QWidget* w ) |
108 | { | 108 | { |
109 | if ( details ) | 109 | if ( details ) |
110 | { | 110 | { |
111 | qDebug( "hiding widget '%s' ('%s')", details->name(), details->className() ); | 111 | qDebug( "hiding widget '%s' ('%s')", details->name(), details->className() ); |
112 | stack->removeWidget( w ); | 112 | stack->removeWidget( w ); |
113 | } | 113 | } |
114 | 114 | ||
115 | stack->addWidget( details = w, 40 ); | 115 | stack->addWidget( details = w, 40 ); |
116 | stack->raiseWidget( details ); | 116 | stack->raiseWidget( details ); |
117 | } | 117 | } |
118 | 118 | ||
119 | 119 | ||
120 | //================================================================================================= | 120 | //================================================================================================= |
121 | Category::Category( DevicesView* parent, const QString& name ) | 121 | Category::Category( DevicesView* parent, const QString& name ) |
122 | :OListViewItem( parent, name ) | 122 | :OListViewItem( parent, name ) |
123 | { | 123 | { |
124 | odebug << "Category '" << name << "' inserted. Scanning for devices..." << oendl; | 124 | odebug << "Category '" << name << "' inserted. Scanning for devices..." << oendl; |
125 | } | 125 | } |
126 | 126 | ||
127 | Category::~Category() | 127 | Category::~Category() |
128 | { | 128 | { |
129 | } | 129 | } |
130 | 130 | ||
131 | //================================================================================================= | 131 | //================================================================================================= |
132 | CpuCategory::CpuCategory( DevicesView* parent ) | 132 | CpuCategory::CpuCategory( DevicesView* parent ) |
133 | :Category( parent, "1. Central Processing Unit" ) | 133 | :Category( parent, "1. Central Processing Unit" ) |
134 | { | 134 | { |
135 | } | 135 | } |
136 | 136 | ||
137 | CpuCategory::~CpuCategory() | 137 | CpuCategory::~CpuCategory() |
138 | { | 138 | { |
139 | } | 139 | } |
140 | 140 | ||
141 | void CpuCategory::populate() | 141 | void CpuCategory::populate() |
142 | { | 142 | { |
143 | odebug << "CpuCategory::populate()" << oendl; | 143 | odebug << "CpuCategory::populate()" << oendl; |
144 | QFile cpuinfofile( "/proc/cpuinfo" ); | 144 | QFile cpuinfofile( "/proc/cpuinfo" ); |
145 | if ( !cpuinfofile.exists() || !cpuinfofile.open( IO_ReadOnly ) ) | 145 | if ( !cpuinfofile.exists() || !cpuinfofile.open( IO_ReadOnly ) ) |
146 | { | 146 | { |
147 | new CpuDevice( this, "ERROR: /proc/cpuinfo not found or unaccessible" ); | 147 | new CpuDevice( this, "ERROR: /proc/cpuinfo not found or unaccessible" ); |
148 | return; | 148 | return; |
149 | } | 149 | } |
150 | QTextStream cpuinfo( &cpuinfofile ); | 150 | QTextStream cpuinfo( &cpuinfofile ); |
151 | 151 | ||
152 | int cpucount = 0; | 152 | int cpucount = 0; |
153 | CpuDevice* dev = 0; | 153 | CpuDevice* dev = 0; |
154 | 154 | ||
155 | while ( !cpuinfo.atEnd() ) | 155 | while ( !cpuinfo.atEnd() ) |
156 | { | 156 | { |
157 | QString line = cpuinfo.readLine(); | 157 | QString line = cpuinfo.readLine(); |
158 | odebug << "got line '" << line << "'" << oendl; | 158 | odebug << "got line '" << line << "'" << oendl; |
159 | if ( line.startsWith( "processor" ) ) | 159 | if ( line.lower().startsWith( "processor" ) ) |
160 | { | 160 | { |
161 | dev = new CpuDevice( this, QString( "CPU #%1" ).arg( cpucount++ ) ); | 161 | dev = new CpuDevice( this, QString( "CPU #%1" ).arg( cpucount++ ) ); |
162 | dev->addInfo( line ); | 162 | dev->addInfo( line ); |
163 | } | 163 | } |
164 | else | 164 | else |
165 | { | 165 | { |
166 | if ( dev ) dev->addInfo( line ); | 166 | if ( dev ) dev->addInfo( line ); |
167 | } | 167 | } |
168 | } | 168 | } |
169 | } | 169 | } |
170 | 170 | ||
171 | //================================================================================================= | 171 | //================================================================================================= |
172 | InputCategory::InputCategory( DevicesView* parent ) | 172 | InputCategory::InputCategory( DevicesView* parent ) |
173 | :Category( parent, "2. Input Subsystem" ) | 173 | :Category( parent, "2. Input Subsystem" ) |
174 | { | 174 | { |
175 | } | 175 | } |
176 | 176 | ||
177 | InputCategory::~InputCategory() | 177 | InputCategory::~InputCategory() |
178 | { | 178 | { |
179 | } | 179 | } |
180 | 180 | ||
181 | void InputCategory::populate() | 181 | void InputCategory::populate() |
182 | { | 182 | { |
183 | odebug << "InputCategory::populate()" << oendl; | 183 | odebug << "InputCategory::populate()" << oendl; |
184 | OInputSystem* sys = OInputSystem::instance(); | 184 | OInputSystem* sys = OInputSystem::instance(); |
185 | OInputSystem::DeviceIterator it = sys->iterator(); | 185 | OInputSystem::DeviceIterator it = sys->iterator(); |
186 | while ( it.current() ) | 186 | while ( it.current() ) |
187 | { | 187 | { |
188 | OInputDevice* dev = it.current(); | 188 | OInputDevice* dev = it.current(); |
189 | new InputDevice( this, dev->identity() ); | 189 | new InputDevice( this, dev->identity() ); |
190 | ++it; | 190 | ++it; |
191 | } | 191 | } |
192 | } | 192 | } |
193 | 193 | ||
194 | //================================================================================================= | 194 | //================================================================================================= |
195 | CardsCategory::CardsCategory( DevicesView* parent ) | 195 | CardsCategory::CardsCategory( DevicesView* parent ) |
196 | :Category( parent, "3. Removable Cards" ) | 196 | :Category( parent, "3. Removable Cards" ) |
197 | { | 197 | { |
198 | } | 198 | } |
199 | 199 | ||
200 | CardsCategory::~CardsCategory() | 200 | CardsCategory::~CardsCategory() |
201 | { | 201 | { |
202 | } | 202 | } |
203 | 203 | ||
204 | void CardsCategory::populate() | 204 | void CardsCategory::populate() |
205 | { | 205 | { |
206 | odebug << "CardsCategory::populate()" << oendl; | 206 | odebug << "CardsCategory::populate()" << oendl; |
207 | QString fileName; | 207 | QString fileName; |
208 | if ( QFile::exists( "/var/run/stab" ) ) { fileName = "/var/run/stab"; } | 208 | if ( QFile::exists( "/var/run/stab" ) ) { fileName = "/var/run/stab"; } |
209 | else if ( QFile::exists( "/var/state/pcmcia/stab" ) ) { fileName = "/var/state/pcmcia/stab"; } | 209 | else if ( QFile::exists( "/var/state/pcmcia/stab" ) ) { fileName = "/var/state/pcmcia/stab"; } |
210 | else { fileName = "/var/lib/pcmcia/stab"; } | 210 | else { fileName = "/var/lib/pcmcia/stab"; } |
211 | QFile cardinfofile( fileName ); | 211 | QFile cardinfofile( fileName ); |
212 | if ( !cardinfofile.exists() || !cardinfofile.open( IO_ReadOnly ) ) | 212 | if ( !cardinfofile.exists() || !cardinfofile.open( IO_ReadOnly ) ) |
213 | { | 213 | { |
214 | new CardDevice( this, "ERROR: pcmcia info file not found or unaccessible" ); | 214 | new CardDevice( this, "ERROR: pcmcia info file not found or unaccessible" ); |
215 | return; | 215 | return; |
216 | } | 216 | } |
217 | QTextStream cardinfo( &cardinfofile ); | 217 | QTextStream cardinfo( &cardinfofile ); |
218 | while ( !cardinfo.atEnd() ) | 218 | while ( !cardinfo.atEnd() ) |
219 | { | 219 | { |
220 | QString line = cardinfo.readLine(); | 220 | QString line = cardinfo.readLine(); |
221 | odebug << "got line '" << line << "'" << oendl; | 221 | odebug << "got line '" << line << "'" << oendl; |
222 | if ( line.startsWith( "Socket" ) ) | 222 | if ( line.startsWith( "Socket" ) ) |
223 | { | 223 | { |