summaryrefslogtreecommitdiff
authorzecke <zecke>2004-04-04 23:31:29 (UTC)
committer zecke <zecke>2004-04-04 23:31:29 (UTC)
commitfb8ce053c0f08769d359fe4153785e3de72f83ea (patch) (side-by-side diff)
tree2f0081cf8739c6daba81c791ec77bde37cbbba1a
parentf2da7b706fd5e0512222e11ce0d94d2750074fd1 (diff)
downloadopie-fb8ce053c0f08769d359fe4153785e3de72f83ea.zip
opie-fb8ce053c0f08769d359fe4153785e3de72f83ea.tar.gz
opie-fb8ce053c0f08769d359fe4153785e3de72f83ea.tar.bz2
Comitting a fix is probably a good idea
use EXPORT_OPIE_APPLET_v1 instead of OTaskBarAppletWrapper directly
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/applets/cardmon/cardmon.cpp5
1 files changed, 1 insertions, 4 deletions
diff --git a/core/applets/cardmon/cardmon.cpp b/core/applets/cardmon/cardmon.cpp
index ed4bfc7..1ad8b55 100644
--- a/core/applets/cardmon/cardmon.cpp
+++ b/core/applets/cardmon/cardmon.cpp
@@ -327,101 +327,98 @@ bool CardMonitor::getStatusPcmcia( int showPopUp )
#endif
}
}
else
{
// no file found
qDebug( "no file found" );
cardInPcmcia0 = FALSE;
cardInPcmcia1 = FALSE;
}
repaint( FALSE );
return ( ( cardWas0 == cardInPcmcia0
&& cardWas1 == cardInPcmcia1 ) ? FALSE : TRUE );
}
bool CardMonitor::getStatusSd( int showPopUp )
{
bool cardWas = cardInSd; // remember last state
cardInSd = FALSE;
#if defined(_OS_LINUX_) || defined(Q_OS_LINUX)
struct mntent *me;
FILE *mntfp = setmntent( "/etc/mtab", "r" );
if ( mntfp )
{
while ( ( me = getmntent( mntfp ) ) != 0 )
{
QString fs = me->mnt_fsname;
//qDebug( fs );
if ( fs.left( 14 ) == "/dev/mmc/part1" || fs.left( 7 ) == "/dev/sd"
|| fs.left( 9 ) == "/dev/mmcd" )
{
cardInSd = TRUE;
show();
}
// else {
// cardInSd = FALSE;
// }
}
endmntent( mntfp );
}
if ( !showPopUp && cardWas != cardInSd )
{
QString text = QString::null;
QString what = QString::null;
if ( cardInSd )
{
text += "New card: SD/MMC";
what = "on";
}
else
{
text += "Ejected: SD/MMC";
what = "off";
}
//qDebug("TEXT: " + text );
#ifndef QT_NO_SOUND
QSound::play( Resource::findSound( "cardmon/card" + what ) );
#endif
popUp( text, "cardmon/ide" ); // XX add SD pic
}
#else
#error "Not on Linux"
#endif
repaint( FALSE );
return ( ( cardWas == cardInSd ) ? FALSE : TRUE );
}
void CardMonitor::paintEvent( QPaintEvent * )
{
QPainter p( this );
if ( cardInPcmcia0 || cardInPcmcia1 || cardInSd )
{
p.drawPixmap( 0, 0, pm );
show();
}
else
{
//p.eraseRect(rect());
hide();
}
}
int CardMonitor::position()
{
return 7;
}
-Q_EXPORT_INTERFACE()
-{
- Q_CREATE_INSTANCE( Opie::Ui::Private::OTaskbarAppletWrapper<CardMonitor> );
-}
+EXPORT_OPIE_APPLET_v1( CardMonitor )