summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/applets/cardmon/cardmon.cpp50
1 files changed, 26 insertions, 24 deletions
diff --git a/core/applets/cardmon/cardmon.cpp b/core/applets/cardmon/cardmon.cpp
index c0a936f..74e8837 100644
--- a/core/applets/cardmon/cardmon.cpp
+++ b/core/applets/cardmon/cardmon.cpp
@@ -76,3 +76,3 @@ void CardMonitor::popUp( QString message, QString icon ) {
76 if ( ! popupMenu ) { 76 if ( ! popupMenu ) {
77 popupMenu = new QPopupMenu(); 77 popupMenu = new QPopupMenu();
78 } 78 }
@@ -81,5 +81,5 @@ void CardMonitor::popUp( QString message, QString icon ) {
81 if( icon.isEmpty() ) { 81 if( icon.isEmpty() ) {
82 popupMenu->insertItem( message, 0 ); 82 popupMenu->insertItem( message, 0 );
83 } else { 83 } else {
84 popupMenu->insertItem( QIconSet ( Resource::loadPixmap ( icon ) ), message, 0 ); 84 popupMenu->insertItem( QIconSet ( Resource::loadPixmap ( icon ) ), message, 0 );
85 } 85 }
@@ -115,3 +115,3 @@ void CardMonitor::mousePressEvent( QMouseEvent * ) {
115 menu->insertItem( QIconSet ( Resource::loadPixmap ( "cardmon/" + cardInPcmcia1Type ) ), 115 menu->insertItem( QIconSet ( Resource::loadPixmap ( "cardmon/" + cardInPcmcia1Type ) ),
116 tr( "Eject card 1: %1" ).arg( cardInPcmcia1Name ), 2 ); 116 tr( "Eject card 1: %1" ).arg( cardInPcmcia1Name ), 2 );
117 } 117 }
@@ -121,4 +121,4 @@ void CardMonitor::mousePressEvent( QMouseEvent * ) {
121 int opt = menu->exec( QPoint ( 121 int opt = menu->exec( QPoint (
122 p. x ( ) + ( width ( ) / 2 ) - ( s. width ( ) / 2 ), 122 p. x ( ) + ( width ( ) / 2 ) - ( s. width ( ) / 2 ),
123 p. y ( ) - s. height ( ) ), 0); 123 p. y ( ) - s. height ( ) ), 0);
124 124
@@ -126,7 +126,7 @@ void CardMonitor::mousePressEvent( QMouseEvent * ) {
126 cmd = "/sbin/cardctl eject 0"; 126 cmd = "/sbin/cardctl eject 0";
127 err = system( ( const char * ) cmd ); 127 err = system( ( const char * ) cmd );
128 if ( ( err == 127 ) || ( err < 0 ) ) { 128 if ( ( err == 127 ) || ( err < 0 ) ) {
129 qDebug( "Could not execute `/sbin/cardctl eject 0'! err=%d", err ); 129 qDebug( "Could not execute `/sbin/cardctl eject 0'! err=%d", err );
130 popUp( tr( "CF/PCMCIA card eject failed!" ) ); 130 popUp( tr( "CF/PCMCIA card eject failed!" ) );
131 } 131 }
132 } else if ( opt == 0 ) { 132 } else if ( opt == 0 ) {
@@ -149,6 +149,6 @@ void CardMonitor::mousePressEvent( QMouseEvent * ) {
149 err = system( ( const char *) cmd ); 149 err = system( ( const char *) cmd );
150 if ( ( err == 127 ) || ( err < 0 ) ) { 150 if ( ( err == 127 ) || ( err < 0 ) ) {
151 qDebug( "Could not execute `/sbin/cardctl eject 1'! err=%d", err ); 151 qDebug( "Could not execute `/sbin/cardctl eject 1'! err=%d", err );
152 popUp( tr( "CF/PCMCIA card eject failed!" ) ); 152 popUp( tr( "CF/PCMCIA card eject failed!" ) );
153 } 153 }
154 } 154 }
@@ -206,4 +206,4 @@ bool CardMonitor::getStatusPcmcia( int showPopUp ) {
206 line++; 206 line++;
207 int pos=(*line).find('\t' ) + 1; 207 int pos=(*line).find('\t' ) + 1;
208 cardInPcmcia0Type = (*line).mid( pos, (*line).find( "\t" , pos) - pos ); 208 cardInPcmcia0Type = (*line).mid( pos, (*line).find( "\t" , pos) - pos );
209 } 209 }
@@ -218,4 +218,4 @@ bool CardMonitor::getStatusPcmcia( int showPopUp ) {
218 line++; 218 line++;
219 int pos=(*line).find('\t') + 1; 219 int pos=(*line).find('\t') + 1;
220 cardInPcmcia1Type = (*line).mid( pos, (*line).find("\t", pos) - pos ); 220 cardInPcmcia1Type = (*line).mid( pos, (*line).find("\t", pos) - pos );
221 } 221 }
@@ -237,3 +237,3 @@ bool CardMonitor::getStatusPcmcia( int showPopUp ) {
237 text += cardInPcmcia0Name; 237 text += cardInPcmcia0Name;
238 popUp( text, "cardmon/" + cardInPcmcia0Type ); 238 popUp( text, "cardmon/" + cardInPcmcia0Type );
239 } 239 }
@@ -248,4 +248,4 @@ bool CardMonitor::getStatusPcmcia( int showPopUp ) {
248 } 248 }
249 text += cardInPcmcia1Name; 249 text += cardInPcmcia1Name;
250 popUp( text, "cardmon/" + cardInPcmcia1Type ); 250 popUp( text, "cardmon/" + cardInPcmcia1Type );
251 } 251 }
@@ -266,2 +266,3 @@ bool CardMonitor::getStatusSd( int showPopUp ) {
266 bool cardWas = cardInSd; // remember last state 266 bool cardWas = cardInSd; // remember last state
267 cardInSd = FALSE;
267 268
@@ -278,5 +279,6 @@ bool CardMonitor::getStatusSd( int showPopUp ) {
278 show(); 279 show();
279 } else {
280 cardInSd = FALSE;
281 } 280 }
281// else {
282// cardInSd = FALSE;
283// }
282 } 284 }