-rw-r--r-- | core/applets/cardmon/cardmon.cpp | 2 | ||||
-rw-r--r-- | core/applets/irdaapplet/irda.cpp | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/core/applets/cardmon/cardmon.cpp b/core/applets/cardmon/cardmon.cpp index 3f07b41..48146ab 100644 --- a/core/applets/cardmon/cardmon.cpp +++ b/core/applets/cardmon/cardmon.cpp @@ -312,69 +312,69 @@ bool CardMonitor::getStatusSd( int showPopUp ) { #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; } void CardMonitor::execCommand( const QString &command ) { if ( m_process == 0 ) { m_process = new OProcess(); QStringList strList = QStringList::split( " ", command ); for ( QStringList::Iterator it = strList.begin(); it != strList.end(); ++it ) { *m_process << *it; } connect(m_process, SIGNAL( processExited(Opie::Core::OProcess*) ), this, SLOT( slotExited(Opie::Core::OProcess* ) ) ); if(!m_process->start(OProcess::NotifyOnExit, OProcess::AllOutput ) ) { delete m_process; m_process = 0; } } } -void CardMonitor::slotExited( OProcess* proc ) { +void CardMonitor::slotExited( OProcess* ) { if( m_process->normalExit() ) { int ret = m_process->exitStatus(); if( ret != 0 ) { if ( m_commandOrig == 1 ) { popUp( tr( "CF/PCMCIA card eject failed!" ) ); } else if ( m_commandOrig == 2 ) { popUp( tr( "SD/MMC card eject failed!" ) ); } else if ( m_commandOrig == 3 ) { popUp( tr( "CF/PCMCIA card eject failed!" ) ); } } } delete m_process; m_process = 0; } EXPORT_OPIE_APPLET_v1( CardMonitor ) diff --git a/core/applets/irdaapplet/irda.cpp b/core/applets/irdaapplet/irda.cpp index 7122b40..267714e 100644 --- a/core/applets/irdaapplet/irda.cpp +++ b/core/applets/irdaapplet/irda.cpp @@ -162,109 +162,109 @@ bool IrdaApplet::setIrdaDiscoveryStatus ( bool d ) if ( discovery. open ( IO_WriteOnly | IO_Raw )) { discovery.putch ( d ? '1' : '0' ); return true; } return false; } bool IrdaApplet::setIrdaReceiveStatus ( bool d ) { QCopEnvelope e ( "QPE/Obex", "receive(int)" ); e << ( d ? 1 : 0 ); m_receive_active = d; m_receive_state_changed = true; return true; } void IrdaApplet::showDiscovered ( ) { // static Sound snd_found ( "irdaapplet/irdaon" ); // static Sound snd_lost ( "irdaapplet/irdaoff" ); QFile discovery ( "/proc/net/irda/discovery" ); if ( discovery. open ( IO_ReadOnly )) { bool qcopsend = false; QString discoveredDevice; QString deviceAddr; // since it is /proc we _must_ use QTextStream QStringList list = QStringList::split ( "\n", QTextStream ( &discovery ). read ( )); QMap <QString, QString>::Iterator it; for ( it = m_devices. begin ( ); it != m_devices. end ( ); ++it ) it. data ( ). prepend ( "+++" ); for ( QStringList::Iterator lit = list. begin ( ); lit != list. end ( ); ++lit ) { const QString &line = *lit; if ( line. startsWith ( "nickname:" )) { discoveredDevice = line. mid ( line. find ( ':' ) + 2, line. find ( ',' ) - line. find ( ':' ) - 2 ); deviceAddr = line. mid ( line. find ( "daddr:" ) + 9, 8 ); - // odebug << discoveredDevice + "(" + deviceAddr + ")" << oendl; + // odebug << discoveredDevice + "(" + deviceAddr + ")" << oendl; if ( !m_devices. contains ( deviceAddr )) { popup ( tr( "Found:" ) + " " + discoveredDevice ); //snd_found. play ( ); qcopsend = true; } m_devices. replace ( deviceAddr, discoveredDevice ); } } for ( it = m_devices. begin ( ); it != m_devices. end ( ); ) { - // odebug << "IrdaMon: delete " + it.currentKey() + "=" + *devicesAvailable[it.currentKey()] + "?" << oendl; + // odebug << "IrdaMon: delete " + it.currentKey() + "=" + *devicesAvailable[it.currentKey()] + "?" << oendl; if ( it. data ( ). left ( 3 ) == "+++" ) { popup ( tr( "Lost:" ) + " " + it. data ( ). mid ( 3 )); //snd_lost. play ( ); QMap <QString, QString>::Iterator tmp = it; tmp++; m_devices. remove ( it ); // in contrast to QValueListIterator this remove doesn't return the next Iterator it = tmp; qcopsend = true; } else it++; } // XXX if( qcopsend ) { QCopEnvelope e ( "QPE/Network", "irdaSend(bool)" ); e << ( m_devices. count ( ) > 0 ); // } } } void IrdaApplet::mousePressEvent ( QMouseEvent * ) { QPopupMenu *menu = new QPopupMenu ( this ); QString cmd; /* Refresh active state */ timerEvent ( 0 ); // menu->insertItem( tr("More..."), 4 ); if ( m_irda_active && !m_devices. isEmpty ( )) { menu-> insertItem ( tr( "Discovered Device:" ), 9 ); for ( QMap<QString, QString>::Iterator it = m_devices. begin ( ); it != m_devices. end ( ); ++it ) menu-> insertItem ( *it ); menu-> insertSeparator ( ); } menu-> insertItem ( m_irda_active ? tr( "Disable IrDA" ) : tr( "Enable IrDA" ), 0 ); if ( m_irda_active ) { menu-> insertItem ( m_irda_discovery_active ? tr( "Disable Discovery" ) : tr( "Enable Discovery" ), 1 ); menu-> insertItem ( m_receive_active ? tr( "Disable Receive" ) : tr( "Enable Receive" ), 2 ); } @@ -286,78 +286,78 @@ void IrdaApplet::mousePressEvent ( QMouseEvent * ) setIrdaReceiveStatus ( !m_receive_active ); timerEvent( 0 ); break; } delete menu; } void IrdaApplet::timerEvent ( QTimerEvent * ) { bool oldactive = m_irda_active; bool olddiscovery = m_irda_discovery_active; bool receiveUpdate = false; if ( m_receive_state_changed ) { receiveUpdate = true; m_receive_state_changed = false; } m_irda_active = checkIrdaStatus ( ); m_irda_discovery_active = checkIrdaDiscoveryStatus ( ); if ( m_irda_discovery_active ) showDiscovered ( ); if (( m_irda_active != oldactive ) || ( m_irda_discovery_active != olddiscovery ) || receiveUpdate ) update ( ); } void IrdaApplet::paintEvent ( QPaintEvent * ) { QPainter p ( this ); p. drawPixmap ( 0, 1, m_irda_active ? m_irdaOnPixmap : m_irdaOffPixmap ); if ( m_irda_discovery_active ) p. drawPixmap( 0, 1, m_irdaDiscoveryOnPixmap ); if ( m_receive_active ) p. drawPixmap( 0, 1, m_receiveActivePixmap ); } /* * We know 3 calls * a) enable * b) disable * a and b will temp enable the IrDa device and disable will disable it again if it wasn't on * c) listDevices: We will return a list of known devices */ -void IrdaApplet::slotMessage( const QCString& str, const QByteArray& ar ) { +void IrdaApplet::slotMessage( const QCString& str, const QByteArray& ) { if ( str == "enableIrda()") { m_wasOn = checkIrdaStatus(); m_wasDiscover = checkIrdaDiscoveryStatus(); if (!m_wasOn) { setIrdaStatus( true ); } if ( !m_wasDiscover ) { setIrdaDiscoveryStatus ( true ); } } else if ( str == "disableIrda()") { if (!m_wasOn) { setIrdaStatus( false ); } if ( !m_wasDiscover ) { setIrdaDiscoveryStatus ( false ); } } else if ( str == "listDevices()") { QCopEnvelope e("QPE/IrDaAppletBack", "devices(QStringList)"); QStringList list; QMap<QString, QString>::Iterator it; for (it = m_devices.begin(); it != m_devices.end(); ++it ) list << (*it); e << list; } } EXPORT_OPIE_APPLET_v1( IrdaApplet ) |