summaryrefslogtreecommitdiff
path: root/noncore/settings/networksettings2/usb
Side-by-side diff
Diffstat (limited to 'noncore/settings/networksettings2/usb') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/networksettings2/usb/usb_NN.cpp19
-rw-r--r--noncore/settings/networksettings2/usb/usbrun.cpp15
2 files changed, 6 insertions, 28 deletions
diff --git a/noncore/settings/networksettings2/usb/usb_NN.cpp b/noncore/settings/networksettings2/usb/usb_NN.cpp
index 9c07b82..6d90ae0 100644
--- a/noncore/settings/networksettings2/usb/usb_NN.cpp
+++ b/noncore/settings/networksettings2/usb/usb_NN.cpp
@@ -2,12 +2,8 @@
#include "usb_NN.h"
#include "usb_NNI.h"
-#ifndef MYPLUGIN
-
#include "netnodeinterface.h"
-#endif
-
static const char * USBNeeds[] =
{ 0
};
@@ -61,17 +57,4 @@ void USBNetNode::setSpecificAttribute( QString & , QString & ) {
void USBNetNode::saveSpecificAttribute( QTextStream & ) {
}
-#ifdef MYPLUGIN
-
-extern "C" {
-void create_plugin( QList<ANetNode> & PNN ) {
- PNN.append( new USBNetNode() );
-}
-
-#else
-
-OPIE_NS2_PLUGIN( NetNodeInterface<USBNetNode> )
-
-#endif
-
-}
+OPIE_NS2_PLUGIN( NetNodeInterface_T<USBNetNode> )
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
@@ -5,9 +5,11 @@
#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();
@@ -64,7 +66,9 @@ State_t USBRun::detectState( void ) {
! 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;
}
}
@@ -75,15 +79,6 @@ 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();
}