summaryrefslogtreecommitdiff
path: root/core
authorharlekin <harlekin>2002-07-31 13:30:45 (UTC)
committer harlekin <harlekin>2002-07-31 13:30:45 (UTC)
commit3cd137ee5784ac9552650e4f8edb1696880ced28 (patch) (unidiff)
treef1668f52a53583843c68c51a8e636b8967b19064 /core
parent012abe9b9c667d24052a9f078030bfa7874b404e (diff)
downloadopie-3cd137ee5784ac9552650e4f8edb1696880ced28.zip
opie-3cd137ee5784ac9552650e4f8edb1696880ced28.tar.gz
opie-3cd137ee5784ac9552650e4f8edb1696880ced28.tar.bz2
try to make gcc3.x happy
Diffstat (limited to 'core') (more/less context) (ignore whitespace changes)
-rw-r--r--core/applets/cardmon/cardmon.cpp22
-rw-r--r--core/applets/cardmon/cardmon.h2
2 files changed, 12 insertions, 12 deletions
diff --git a/core/applets/cardmon/cardmon.cpp b/core/applets/cardmon/cardmon.cpp
index 0bd1ed3..ffead4d 100644
--- a/core/applets/cardmon/cardmon.cpp
+++ b/core/applets/cardmon/cardmon.cpp
@@ -65,15 +65,15 @@ CardMonitor::~CardMonitor() {
65 if( popupMenu ) { delete popupMenu; } 65 if( popupMenu ) { delete popupMenu; }
66} 66}
67 67
68void CardMonitor::popUp(QString message, QString icon="") { 68void CardMonitor::popUp( QString message, QString icon = QString::null ) {
69 if ( ! popupMenu ) { 69 if ( ! popupMenu ) {
70 popupMenu = new QPopupMenu(); 70 popupMenu = new QPopupMenu();
71 } 71 }
72 popupMenu->clear(); 72 popupMenu->clear();
73 if( icon == "" ) { 73 if( icon.isEmpty() ) {
74 popupMenu->insertItem( message, 0 ); 74 popupMenu->insertItem( message, 0 );
75 } else { 75 } else {
76 popupMenu->insertItem( QIconSet ( Resource::loadPixmap ( icon )), 76 popupMenu->insertItem( QIconSet ( Resource::loadPixmap ( icon )),
77 message, 0 ); 77 message, 0 );
78 } 78 }
79 79
@@ -100,12 +100,12 @@ void CardMonitor::mousePressEvent( QMouseEvent * ) {
100 } 100 }
101 101
102 if ( cardInPcmcia0 ) { 102 if ( cardInPcmcia0 ) {
103 menu->insertItem( QIconSet ( Resource::loadPixmap ( "cardmon/" + cardInPcmcia0Type )), 103 menu->insertItem( QIconSet ( Resource::loadPixmap ( "cardmon/" + cardInPcmcia0Type )),
104 tr("Eject card 0: %1").arg(cardInPcmcia0Name), 1 ); 104 tr("Eject card 0: %1").arg(cardInPcmcia0Name), 1 );
105 } 105 }
106 106
107 if ( cardInPcmcia1 ) { 107 if ( cardInPcmcia1 ) {
108 menu->insertItem( QIconSet ( Resource::loadPixmap ( "cardmon/" + cardInPcmcia1Type )), 108 menu->insertItem( QIconSet ( Resource::loadPixmap ( "cardmon/" + cardInPcmcia1Type )),
109 tr("Eject card 1: %1").arg(cardInPcmcia1Name), 2 ); 109 tr("Eject card 1: %1").arg(cardInPcmcia1Name), 2 );
110 } 110 }
111 111
@@ -122,21 +122,21 @@ void CardMonitor::mousePressEvent( QMouseEvent * ) {
122 if ( ( err == 127 ) || ( err < 0 ) ) { 122 if ( ( err == 127 ) || ( err < 0 ) ) {
123 qDebug("Could not execute `/sbin/cardctl eject 0'! err=%d", err); 123 qDebug("Could not execute `/sbin/cardctl eject 0'! err=%d", err);
124 popUp( tr("CF/PCMCIA card eject failed!")); 124 popUp( tr("CF/PCMCIA card eject failed!"));
125 } 125 }
126 } else if ( opt == 0 ) { 126 } else if ( opt == 0 ) {
127 cmd = "/etc/sdcontrol compeject"; 127 cmd = "/etc/sdcontrol compeject";
128 err = system( (const char *) cmd ); 128 err = system( (const char *) cmd );
129 if ( ( err != 0 ) ) { 129 if ( ( err != 0 ) ) {
130 qDebug("Could not execute `/etc/sdcontrol comeject'! err=%d", err); 130 qDebug("Could not execute `/etc/sdcontrol comeject'! err=%d", err);
131 popUp( tr("SD/MMC card eject failed!")); 131 popUp( tr("SD/MMC card eject failed!"));
132 } 132 }
133 } else if ( opt == 2 ) { 133 } else if ( opt == 2 ) {
134 cmd = "/sbin/cardctl eject 1"; 134 cmd = "/sbin/cardctl eject 1";
135 err = system( (const char *) cmd ); 135 err = system( (const char *) cmd );
136 if ( ( err == 127 ) || ( err < 0 ) ) { 136 if ( ( err == 127 ) || ( err < 0 ) ) {
137 qDebug("Could not execute `/sbin/cardctl eject 1'! err=%d", err); 137 qDebug("Could not execute `/sbin/cardctl eject 1'! err=%d", err);
138 popUp( tr("CF/PCMCIA card eject failed!")); 138 popUp( tr("CF/PCMCIA card eject failed!"));
139 } 139 }
140 } 140 }
141 141
142 delete menu; 142 delete menu;
@@ -211,8 +211,8 @@ bool CardMonitor::getStatusPcmcia( int showPopUp ) {
211 } 211 }
212 f.close(); 212 f.close();
213 if( !showPopUp && (cardWas0 != cardInPcmcia0 || cardWas1 != cardInPcmcia1)) { 213 if( !showPopUp && (cardWas0 != cardInPcmcia0 || cardWas1 != cardInPcmcia1)) {
214 QString text = ""; 214 QString text = QString::null;
215 QString what = ""; 215 QString what = QString::null;
216 if(cardWas0 != cardInPcmcia0) { 216 if(cardWas0 != cardInPcmcia0) {
217 if(cardInPcmcia0) { text += tr("New card: "); what="on";} 217 if(cardInPcmcia0) { text += tr("New card: "); what="on";}
218 else { text += tr("Ejected: "); what="off";} 218 else { text += tr("Ejected: "); what="off";}
@@ -258,7 +258,7 @@ bool CardMonitor::getStatusSd( int showPopUp ) {
258 endmntent( mntfp ); 258 endmntent( mntfp );
259 } 259 }
260 if(!showPopUp && cardWas != cardInSd) { 260 if(!showPopUp && cardWas != cardInSd) {
261 QString text = ""; 261 QString text = QString::null;
262 if(cardInSd) { text += "SD Inserted"; } 262 if(cardInSd) { text += "SD Inserted"; }
263 else { text += "SD Removed"; } 263 else { text += "SD Removed"; }
264 popUp( text); // XX add SD pic 264 popUp( text); // XX add SD pic
diff --git a/core/applets/cardmon/cardmon.h b/core/applets/cardmon/cardmon.h
index 9651783..49bcae8 100644
--- a/core/applets/cardmon/cardmon.h
+++ b/core/applets/cardmon/cardmon.h
@@ -51,7 +51,7 @@ private:
51 bool cardInSd; 51 bool cardInSd;
52 void iconShow(); 52 void iconShow();
53 QPopupMenu *popupMenu; 53 QPopupMenu *popupMenu;
54 void popUp(QString message, QString icon=""); 54 void popUp(QString message, QString icon = QString::null );
55 }; 55 };
56 56
57#endif 57#endif