-rw-r--r-- | core/applets/cardmon/cardmon.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/core/applets/cardmon/cardmon.cpp b/core/applets/cardmon/cardmon.cpp index 53497df..452339c 100644 --- a/core/applets/cardmon/cardmon.cpp +++ b/core/applets/cardmon/cardmon.cpp | |||
@@ -258,65 +258,65 @@ bool CardMonitor::getStatusPcmcia( int showPopUp ) { | |||
258 | QSound::play( Resource::findSound( "cardmon/card" + what ) ); | 258 | QSound::play( Resource::findSound( "cardmon/card" + what ) ); |
259 | #endif | 259 | #endif |
260 | 260 | ||
261 | } | 261 | } |
262 | } else { | 262 | } else { |
263 | // no file found | 263 | // no file found |
264 | odebug << "no file found" << oendl; | 264 | odebug << "no file found" << oendl; |
265 | cardInPcmcia0 = FALSE; | 265 | cardInPcmcia0 = FALSE; |
266 | cardInPcmcia1 = FALSE; | 266 | cardInPcmcia1 = FALSE; |
267 | } | 267 | } |
268 | repaint( FALSE ); | 268 | repaint( FALSE ); |
269 | return ( ( cardWas0 == cardInPcmcia0 | 269 | return ( ( cardWas0 == cardInPcmcia0 |
270 | && cardWas1 == cardInPcmcia1 ) ? FALSE : TRUE ); | 270 | && cardWas1 == cardInPcmcia1 ) ? FALSE : TRUE ); |
271 | 271 | ||
272 | } | 272 | } |
273 | 273 | ||
274 | 274 | ||
275 | bool CardMonitor::getStatusSd( int showPopUp ) { | 275 | bool CardMonitor::getStatusSd( int showPopUp ) { |
276 | 276 | ||
277 | bool cardWas = cardInSd; // remember last state | 277 | bool cardWas = cardInSd; // remember last state |
278 | cardInSd = FALSE; | 278 | cardInSd = FALSE; |
279 | 279 | ||
280 | #if defined(_OS_LINUX_) || defined(Q_OS_LINUX) | 280 | #if defined(_OS_LINUX_) || defined(Q_OS_LINUX) |
281 | 281 | ||
282 | struct mntent *me; | 282 | struct mntent *me; |
283 | FILE *mntfp = setmntent( "/etc/mtab", "r" ); | 283 | FILE *mntfp = setmntent( "/etc/mtab", "r" ); |
284 | 284 | ||
285 | if ( mntfp ) { | 285 | if ( mntfp ) { |
286 | while ( ( me = getmntent( mntfp ) ) != 0 ) { | 286 | while ( ( me = getmntent( mntfp ) ) != 0 ) { |
287 | QString fs = QFile::decodeName( me->mnt_fsname ); | 287 | QString fs = QFile::decodeName( me->mnt_fsname ); |
288 | //odebug << fs << oendl; | 288 | //odebug << fs << oendl; |
289 | if ( fs.left( 14 ) == "/dev/mmc/part1" || fs.left( 7 ) == "/dev/sd" | 289 | if ( fs.left( 14 ) == "/dev/mmc/part1" || fs.left( 7 ) == "/dev/sd" |
290 | || fs.left( 9 ) == "/dev/mmcd" ) { | 290 | || fs.left( 9 ) == "/dev/mmcd" || fs.left(11) == "/dev/mmcblk" ) { |
291 | cardInSd = TRUE; | 291 | cardInSd = TRUE; |
292 | cardSdName = fs; | 292 | cardSdName = fs; |
293 | show(); | 293 | show(); |
294 | } | 294 | } |
295 | // else { | 295 | // else { |
296 | // cardInSd = FALSE; | 296 | // cardInSd = FALSE; |
297 | // } | 297 | // } |
298 | } | 298 | } |
299 | endmntent( mntfp ); | 299 | endmntent( mntfp ); |
300 | } | 300 | } |
301 | 301 | ||
302 | if ( !showPopUp && cardWas != cardInSd ) { | 302 | if ( !showPopUp && cardWas != cardInSd ) { |
303 | QString text = QString::null; | 303 | QString text = QString::null; |
304 | QString what = QString::null; | 304 | QString what = QString::null; |
305 | if ( cardInSd ) { | 305 | if ( cardInSd ) { |
306 | text += tr("New card: SD/MMC"); | 306 | text += tr("New card: SD/MMC"); |
307 | what = "on"; | 307 | what = "on"; |
308 | } else { | 308 | } else { |
309 | text += tr("Ejected: SD/MMC"); | 309 | text += tr("Ejected: SD/MMC"); |
310 | what = "off"; | 310 | what = "off"; |
311 | } | 311 | } |
312 | //odebug << "TEXT: " + text << oendl; | 312 | //odebug << "TEXT: " + text << oendl; |
313 | #ifndef QT_NO_SOUND | 313 | #ifndef QT_NO_SOUND |
314 | QSound::play( Resource::findSound( "cardmon/card" + what ) ); | 314 | QSound::play( Resource::findSound( "cardmon/card" + what ) ); |
315 | #endif | 315 | #endif |
316 | 316 | ||
317 | popUp( text, "cardmon/ide" ); // XX add SD pic | 317 | popUp( text, "cardmon/ide" ); // XX add SD pic |
318 | } | 318 | } |
319 | #else | 319 | #else |
320 | #error "Not on Linux" | 320 | #error "Not on Linux" |
321 | #endif | 321 | #endif |
322 | repaint( FALSE ); | 322 | repaint( FALSE ); |