author | sandman <sandman> | 2002-09-30 21:10:57 (UTC) |
---|---|---|
committer | sandman <sandman> | 2002-09-30 21:10:57 (UTC) |
commit | f02403852366623aef6f53258b237e467a25e597 (patch) (side-by-side diff) | |
tree | 091ae74adbb8aad80d2055e775cb65e3c377ae87 /core | |
parent | f49ad5cf3bdc1d1c06be4615a649b6be6f179b83 (diff) | |
download | opie-f02403852366623aef6f53258b237e467a25e597.zip opie-f02403852366623aef6f53258b237e467a25e597.tar.gz opie-f02403852366623aef6f53258b237e467a25e597.tar.bz2 |
small change to work with the new ODevice API
-rw-r--r-- | core/applets/cardmon/cardmon.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/core/applets/cardmon/cardmon.cpp b/core/applets/cardmon/cardmon.cpp index 583f2da..c0a936f 100644 --- a/core/applets/cardmon/cardmon.cpp +++ b/core/applets/cardmon/cardmon.cpp @@ -21,48 +21,50 @@ #include <qpe/resource.h> #include <opie/odevice.h> #include <qcopchannel_qws.h> #include <qpainter.h> #include <qmessagebox.h> #include <qfile.h> #include <qtextstream.h> #include <qtimer.h> #include <stdio.h> #include <unistd.h> #include <stdlib.h> #include <string.h> #include <fcntl.h> #include <qsound.h> #if defined(_OS_LINUX_) || defined(Q_OS_LINUX) #include <sys/vfs.h> #include <mntent.h> #endif +using namespace Opie; + CardMonitor::CardMonitor( QWidget *parent ) : QWidget( parent ), pm( Resource::loadPixmap( "cardmon/pcmcia" ) ) { QCopChannel* pcmciaChannel = new QCopChannel( "QPE/Card", this ); connect( pcmciaChannel, SIGNAL( received( const QCString &, const QByteArray &) ), this, SLOT( cardMessage( const QCString &, const QByteArray &) ) ); QCopChannel* sdChannel = new QCopChannel( "QPE/Card", this ); connect( sdChannel, SIGNAL( received( const QCString &, const QByteArray &) ), this, SLOT( cardMessage( const QCString &, const QByteArray &) ) ); cardInPcmcia0 = FALSE; cardInPcmcia1 = FALSE; cardInSd = FALSE; setFixedSize( pm.size() ); getStatusPcmcia( TRUE ); getStatusSd( TRUE ); repaint( FALSE ); popupMenu = 0; } CardMonitor::~CardMonitor() { if( popupMenu ) { @@ -107,49 +109,49 @@ void CardMonitor::mousePressEvent( QMouseEvent * ) { if ( cardInPcmcia0 ) { menu->insertItem( QIconSet ( Resource::loadPixmap ( "cardmon/" + cardInPcmcia0Type ) ), tr( "Eject card 0: %1" ).arg(cardInPcmcia0Name ), 1 ); } if ( cardInPcmcia1 ) { menu->insertItem( QIconSet ( Resource::loadPixmap ( "cardmon/" + cardInPcmcia1Type ) ), tr( "Eject card 1: %1" ).arg( cardInPcmcia1Name ), 2 ); } QPoint p = mapToGlobal ( QPoint ( 0, 0 ) ); QSize s = menu->sizeHint (); int opt = menu->exec( QPoint ( p. x ( ) + ( width ( ) / 2 ) - ( s. width ( ) / 2 ), p. y ( ) - s. height ( ) ), 0); if ( opt == 1 ) { cmd = "/sbin/cardctl eject 0"; err = system( ( const char * ) cmd ); if ( ( err == 127 ) || ( err < 0 ) ) { qDebug( "Could not execute `/sbin/cardctl eject 0'! err=%d", err ); popUp( tr( "CF/PCMCIA card eject failed!" ) ); } } else if ( opt == 0 ) { - if ( ODevice::inst()->system() == OSYSTEM_Familiar ) { + if ( ODevice::inst()->system() == System_Familiar ) { cmd = "umount /dev/mmc/part1"; err = system( ( const char *) cmd ); if ( ( err != 0 ) ) { popUp( tr("SD/MMC card eject failed!") ); } } else { cmd = "/etc/sdcontrol compeject"; err = system( ( const char *) cmd ); if ( ( err != 0 ) ) { qDebug( "Could not execute `/etc/sdcontrol comeject'! err=%d", err ); popUp( tr("SD/MMC card eject failed!") ); } } } else if ( opt == 2 ) { cmd = "/sbin/cardctl eject 1"; err = system( ( const char *) cmd ); if ( ( err == 127 ) || ( err < 0 ) ) { qDebug( "Could not execute `/sbin/cardctl eject 1'! err=%d", err ); popUp( tr( "CF/PCMCIA card eject failed!" ) ); } } delete menu; } |