[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdebase/workspace/libs/solid/control
From:       Christopher Blauvelt <cblauvelt () gmail ! com>
Date:       2008-05-14 2:34:04
Message-ID: 1210732444.919746.20931.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 807597 by cblauvelt:

Implement the type function.  This returns the type of NetworkInterface as available in 
NetworkInterface::Type.



 M  +5 -0      networkinterface.cpp  
 M  +8 -0      networkinterface.h  
 M  +5 -0      wirednetworkinterface.cpp  
 M  +7 -0      wirednetworkinterface.h  
 M  +5 -0      wirelessnetworkinterface.cpp  
 M  +7 -0      wirelessnetworkinterface.h  


--- trunk/KDE/kdebase/workspace/libs/solid/control/networkinterface.cpp #807596:807597
@@ -57,6 +57,11 @@
 
 }
 
+Solid::Control::NetworkInterface::Type Solid::Control::NetworkInterface::type() const
+{
+    return UnknownType;
+}
+
 QString Solid::Control::NetworkInterface::uni() const
 {
     Q_D(const NetworkInterface);
--- trunk/KDE/kdebase/workspace/libs/solid/control/networkinterface.h #807596:807597
@@ -92,6 +92,14 @@
         virtual ~NetworkInterface();
 
         /**
+         * Retrieves the interface type.  This is a virtual function that will return the
+         * proper type of all sub-classes.
+         *
+         * @returns the NetworkInterface::Type that corresponds to this device.
+         */
+        virtual Type type() const;
+
+        /**
          * Retrieves the Unique Network Identifier (UNI) of the NetworkInterface.
          * This identifier is unique for each network and network interface in the system.
          *
--- trunk/KDE/kdebase/workspace/libs/solid/control/wirednetworkinterface.cpp #807596:807597
@@ -53,6 +53,11 @@
 
 }
 
+Solid::Control::NetworkInterface::Type Solid::Control::WiredNetworkInterface::type() const
+{
+    return Ieee8023;
+}
+
 QString Solid::Control::WiredNetworkInterface::hardwareAddress() const
 {
     Q_D(const WiredNetworkInterface);
--- trunk/KDE/kdebase/workspace/libs/solid/control/wirednetworkinterface.h #807596:807597
@@ -60,6 +60,13 @@
         virtual ~WiredNetworkInterface();
 
         /**
+         * The NetworkInterface type.
+         *
+         * @return the NetworkInterface::Type.  This always returns NetworkInterface::Ieee8023
+         */
+        virtual NetworkInterface::Type type() const;
+
+        /**
          * The hardware address assigned to the network interface
          */
         QString hardwareAddress() const;
--- trunk/KDE/kdebase/workspace/libs/solid/control/wirelessnetworkinterface.cpp #807596:807597
@@ -59,6 +59,11 @@
 
 }
 
+Solid::Control::NetworkInterface::Type Solid::Control::WirelessNetworkInterface::type() const
+{
+    return Ieee80211;
+}
+
 void Solid::Control::WirelessNetworkInterface::makeConnections(QObject * source)
 {
     connect(source, SIGNAL(accessPointAdded(const QString &)),
--- trunk/KDE/kdebase/workspace/libs/solid/control/wirelessnetworkinterface.h #807596:807597
@@ -74,6 +74,13 @@
         virtual ~WirelessNetworkInterface();
 
         /**
+         * The NetworkInterface type.
+         *
+         * @return the NetworkInterface::Type.  This always returns NetworkInterface::Ieee80211
+         */
+        virtual NetworkInterface::Type type() const;
+
+        /**
          * List of wireless networks currently visible to the hardware
          */
         AccessPointList accessPoints() const;
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic