summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/applets/cardmon/cardmon.cpp4
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
@@ -33,24 +33,26 @@
33#include <stdio.h> 33#include <stdio.h>
34#include <unistd.h> 34#include <unistd.h>
35#include <stdlib.h> 35#include <stdlib.h>
36#include <string.h> 36#include <string.h>
37#include <fcntl.h> 37#include <fcntl.h>
38#include <qsound.h> 38#include <qsound.h>
39 39
40#if defined(_OS_LINUX_) || defined(Q_OS_LINUX) 40#if defined(_OS_LINUX_) || defined(Q_OS_LINUX)
41#include <sys/vfs.h> 41#include <sys/vfs.h>
42#include <mntent.h> 42#include <mntent.h>
43#endif 43#endif
44 44
45using namespace Opie;
46
45CardMonitor::CardMonitor( QWidget *parent ) : QWidget( parent ), 47CardMonitor::CardMonitor( QWidget *parent ) : QWidget( parent ),
46 pm( Resource::loadPixmap( "cardmon/pcmcia" ) ) { 48 pm( Resource::loadPixmap( "cardmon/pcmcia" ) ) {
47 49
48 QCopChannel* pcmciaChannel = new QCopChannel( "QPE/Card", this ); 50 QCopChannel* pcmciaChannel = new QCopChannel( "QPE/Card", this );
49 connect( pcmciaChannel, SIGNAL( received( const QCString &, const QByteArray &) ), 51 connect( pcmciaChannel, SIGNAL( received( const QCString &, const QByteArray &) ),
50 this, SLOT( cardMessage( const QCString &, const QByteArray &) ) ); 52 this, SLOT( cardMessage( const QCString &, const QByteArray &) ) );
51 53
52 QCopChannel* sdChannel = new QCopChannel( "QPE/Card", this ); 54 QCopChannel* sdChannel = new QCopChannel( "QPE/Card", this );
53 connect( sdChannel, SIGNAL( received( const QCString &, const QByteArray &) ), 55 connect( sdChannel, SIGNAL( received( const QCString &, const QByteArray &) ),
54 this, SLOT( cardMessage( const QCString &, const QByteArray &) ) ); 56 this, SLOT( cardMessage( const QCString &, const QByteArray &) ) );
55 57
56 cardInPcmcia0 = FALSE; 58 cardInPcmcia0 = FALSE;
@@ -119,25 +121,25 @@ void CardMonitor::mousePressEvent( QMouseEvent * ) {
119 int opt = menu->exec( QPoint ( 121 int opt = menu->exec( QPoint (
120 p. x ( ) + ( width ( ) / 2 ) - ( s. width ( ) / 2 ), 122 p. x ( ) + ( width ( ) / 2 ) - ( s. width ( ) / 2 ),
121 p. y ( ) - s. height ( ) ), 0); 123 p. y ( ) - s. height ( ) ), 0);
122 124
123 if ( opt == 1 ) { 125 if ( opt == 1 ) {
124 cmd = "/sbin/cardctl eject 0"; 126 cmd = "/sbin/cardctl eject 0";
125 err = system( ( const char * ) cmd ); 127 err = system( ( const char * ) cmd );
126 if ( ( err == 127 ) || ( err < 0 ) ) { 128 if ( ( err == 127 ) || ( err < 0 ) ) {
127 qDebug( "Could not execute `/sbin/cardctl eject 0'! err=%d", err ); 129 qDebug( "Could not execute `/sbin/cardctl eject 0'! err=%d", err );
128 popUp( tr( "CF/PCMCIA card eject failed!" ) ); 130 popUp( tr( "CF/PCMCIA card eject failed!" ) );
129 } 131 }
130 } else if ( opt == 0 ) { 132 } else if ( opt == 0 ) {
131 if ( ODevice::inst()->system() == OSYSTEM_Familiar ) { 133 if ( ODevice::inst()->system() == System_Familiar ) {
132 cmd = "umount /dev/mmc/part1"; 134 cmd = "umount /dev/mmc/part1";
133 err = system( ( const char *) cmd ); 135 err = system( ( const char *) cmd );
134 if ( ( err != 0 ) ) { 136 if ( ( err != 0 ) ) {
135 popUp( tr("SD/MMC card eject failed!") ); 137 popUp( tr("SD/MMC card eject failed!") );
136 } 138 }
137 } else { 139 } else {
138 cmd = "/etc/sdcontrol compeject"; 140 cmd = "/etc/sdcontrol compeject";
139 err = system( ( const char *) cmd ); 141 err = system( ( const char *) cmd );
140 if ( ( err != 0 ) ) { 142 if ( ( err != 0 ) ) {
141 qDebug( "Could not execute `/etc/sdcontrol comeject'! err=%d", err ); 143 qDebug( "Could not execute `/etc/sdcontrol comeject'! err=%d", err );
142 popUp( tr("SD/MMC card eject failed!") ); 144 popUp( tr("SD/MMC card eject failed!") );
143 } 145 }