From e570da2879fb3220a46f1a19bb797512fca144c6 Mon Sep 17 00:00:00 2001 From: mickeyl Date: Sat, 21 May 2005 15:43:07 +0000 Subject: catch up with pcmcia changes --- diff --git a/noncore/applets/pcmcia/pcmcia.cpp b/noncore/applets/pcmcia/pcmcia.cpp index 5183572..7f24371 100644 --- a/noncore/applets/pcmcia/pcmcia.cpp +++ b/noncore/applets/pcmcia/pcmcia.cpp @@ -112,7 +112,7 @@ void PcmciaManager::popupTimeout() void PcmciaManager::mousePressEvent( QMouseEvent* ) { - QPopupMenu * menu = new QPopupMenu( this ); + QPopupMenu* menu = new QPopupMenu( this ); QStringList cmd; bool execute = true; @@ -123,11 +123,20 @@ void PcmciaManager::mousePressEvent( QMouseEvent* ) int i = 0; while ( it.current() ) { - menu->insertItem( tr( "Eject card %1: %2" ).arg( i++ ).arg( it.currentKey() ), 1 ); + + QPopupMenu* submenu = new QPopupMenu( menu ); + submenu->insertItem( "Eject" ); + submenu->insertItem( "Insert" ); + submenu->insertItem( "Suspend" ); + submenu->insertItem( "Resume" ); + submenu->insertItem( "Configure" ); + + menu->insertItem( tr( "%1: %2" ).arg( i++ ).arg( it.current()->identity() ), submenu, 1 ); ++it; } + /* insert items depending on number of cards etc. if ( cardInSd ) { @@ -135,7 +144,7 @@ void PcmciaManager::mousePressEvent( QMouseEvent* ) tr( "Eject SD/MMC card" ), 0 ); } - + if ( cardInPcmcia0 ) { menu-> @@ -168,7 +177,7 @@ void PcmciaManager::cardMessage( const QCString & msg, const QByteArray & ) /* check if a previously unknown card has been inserted */ OPcmciaSystem::instance()->synchronize(); - if ( !OPcmciaSystem::instance()->count() ) return; + if ( !OPcmciaSystem::instance()->cardCount() ) return; OConfig cfg( "PCMCIA" ); cfg.setGroup( "Global" ); @@ -178,9 +187,10 @@ void PcmciaManager::cardMessage( const QCString & msg, const QByteArray & ) OPcmciaSystem::CardIterator it = sys->iterator(); bool newCard = true; - while ( it.current() && newCard ) + + while ( it.current() && !it.current()->isEmpty() && newCard ) { - QString name = it.currentKey(); + QString name = it.current()->identity(); for ( int i = 0; i < nCards; ++i ) { QString cardSection = QString( "Card_%1" ).arg( i ); @@ -195,10 +205,10 @@ void PcmciaManager::cardMessage( const QCString & msg, const QByteArray & ) } if ( !newCard ) ++it; else break; } - QString newCardName = it.currentKey(); if ( newCard ) { + QString newCardName = it.current()->identity(); odebug << "pcmcia: new card detected" << oendl; cfg.setGroup( QString( "Card_%1" ).arg( nCards ) ); cfg.writeEntry( "name", newCardName ); diff --git a/noncore/settings/sysinfo/devicesinfo.cpp b/noncore/settings/sysinfo/devicesinfo.cpp index 945edea..4940286 100644 --- a/noncore/settings/sysinfo/devicesinfo.cpp +++ b/noncore/settings/sysinfo/devicesinfo.cpp @@ -208,7 +208,7 @@ void CardsCategory::populate() OPcmciaSystem::CardIterator it = sys->iterator(); while ( it.current() ) { - new CardDevice( this, (const char*) it.currentKey() ); + new CardDevice( this, it.current()->identity() ); ++it; } } -- cgit v0.9.0.2