summaryrefslogtreecommitdiff
path: root/noncore/settings/networksettings2/usb/usbrun.cpp
authorwimpie <wimpie>2005-01-07 15:23:23 (UTC)
committer wimpie <wimpie>2005-01-07 15:23:23 (UTC)
commitb4eced64efad35beeb2004243ca26bf7eb20eaba (patch) (side-by-side diff)
tree14caf32705c787a8bffc917ecdf216ad40cfbdc0 /noncore/settings/networksettings2/usb/usbrun.cpp
parent7af7203a51ddcf85f9f60e39157fcad21f7d9e34 (diff)
downloadopie-b4eced64efad35beeb2004243ca26bf7eb20eaba.zip
opie-b4eced64efad35beeb2004243ca26bf7eb20eaba.tar.gz
opie-b4eced64efad35beeb2004243ca26bf7eb20eaba.tar.bz2
All NS2 libraries are now properly working plugins
Diffstat (limited to 'noncore/settings/networksettings2/usb/usbrun.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/networksettings2/usb/usbrun.cpp15
1 files changed, 5 insertions, 10 deletions
diff --git a/noncore/settings/networksettings2/usb/usbrun.cpp b/noncore/settings/networksettings2/usb/usbrun.cpp
index 0a46642..eb439c1 100644
--- a/noncore/settings/networksettings2/usb/usbrun.cpp
+++ b/noncore/settings/networksettings2/usb/usbrun.cpp
@@ -2,15 +2,17 @@
#include <qfileinfo.h>
#include <qtextstream.h>
#include <resources.h>
#include "usbrun.h"
State_t USBRun::detectState( void ) {
+
// unavailable : no card found
// available : card found and assigned to us or free
// up : card found and assigned to us and up
+
NodeCollection * NC = nodeCollection();
QString S = QString( "/tmp/profile-%1.up" ).arg(NC->number());
System & Sys = NSResources->system();
InterfaceInfo * Run;
QFile F( S );
Log(("Detecting for %s\n", NC->name().latin1() ));
@@ -61,32 +63,25 @@ State_t USBRun::detectState( void ) {
if( handlesInterface( Run->Name ) &&
Run->CardType == ARPHRD_ETHER &&
! Run->IsUp
) {
// proper type, and Not UP -> free
- return Off;
+ // usb cables are currently always available when requested
+ // until we can detect if we are plugged in
+ return Available;
}
}
return Unavailable;
}
QString USBRun::setMyState( NodeCollection * NC, Action_t A, bool ) {
// nothing needs to be done to 'activate' or 'deactivate'
// a cable
-
- // perhaps (later) we can figure out if the device is IN the
- // cradle
- if( A == Activate ) {
- NC->setCurrentState( Available );
- } else if ( A == Deactivate ) {
- NC->setCurrentState( Unavailable );
- }
-
return QString();
}
// get interface that is free or assigned to us
InterfaceInfo * USBRun::getInterface( void ) {