[Kde-hardware-devel] [kde-workspace] /: Commit patch from http://reviewboard.kde.org/r/6393
Lamarque V. Souza
lamarque at gmail.com
Wed Mar 2 20:50:54 CET 2011
Git commit 3ba3c9ce6b61a6b19678f31158a797e190d02dda by Lamarque V. Souza.
Committed on 02/03/2011 at 20:46.
Pushed by lvsouza into branch 'master'.
Commit patch from http://reviewboard.kde.org/r/6393
I did not backport it to KDE/4.6 branch because the patch introduces
API changes. It will be available in KDE/4.7, which is schedule to be
released in July 27, 2011.
CCMAIL: gokcen at pardus.org.tr, kde-hardware-devel at kde.org
M +3 -0 libs/solid/control/backends/fakenet/fakenetworkinterface.cpp
M +1 -0 libs/solid/control/backends/fakenet/fakenetworkinterface.h
M +7 -0 libs/solid/control/ifaces/networkinterface.h
M +6 -0 libs/solid/control/networkinterface.cpp
M +6 -0 libs/solid/control/networkinterface.h
M +6 -0 solid/networkmanager-0.7/dbus/nm-deviceinterface.h
M +6 -0 solid/networkmanager-0.7/networkinterface.cpp
M +1 -0 solid/networkmanager-0.7/networkinterface.h
M +4 -0 solid/wicd/networkinterface.cpp
M +1 -0 solid/wicd/networkinterface.h
http://commits.kde.org/kde-workspace/3ba3c9ce6b61a6b19678f31158a797e190d02dda
diff --git a/libs/solid/control/backends/fakenet/fakenetworkinterface.cpp b/libs/solid/control/backends/fakenet/fakenetworkinterface.cpp
index 3e0a3a9..89cde87 100644
--- a/libs/solid/control/backends/fakenet/fakenetworkinterface.cpp
+++ b/libs/solid/control/backends/fakenet/fakenetworkinterface.cpp
@@ -111,6 +111,9 @@ void FakeNetworkInterface::deactivate()
mActiveConnection = "";
}
+void FakeNetworkInterface::disconnect()
+{
+}
Solid::Control::IPv4Config FakeNetworkInterface::ipV4Config() const
{
diff --git a/libs/solid/control/backends/fakenet/fakenetworkinterface.h b/libs/solid/control/backends/fakenet/fakenetworkinterface.h
index dd90ab6..d37f3a1 100644
--- a/libs/solid/control/backends/fakenet/fakenetworkinterface.h
+++ b/libs/solid/control/backends/fakenet/fakenetworkinterface.h
@@ -43,6 +43,7 @@ public:
QString udi() const;
QString interfaceName() const;
QString driver() const;
+ void disconnect();
bool isActive() const;
Solid::Control::IPv4Config ipV4Config() const;
Solid::Control::NetworkInterface::ConnectionState connectionState() const;
diff --git a/libs/solid/control/ifaces/networkinterface.h b/libs/solid/control/ifaces/networkinterface.h
index 0131920..0d7bfe4 100644
--- a/libs/solid/control/ifaces/networkinterface.h
+++ b/libs/solid/control/ifaces/networkinterface.h
@@ -70,6 +70,12 @@ namespace Ifaces
virtual QString driver() const = 0;
/**
+ * Disconnects a device and prevents the device from automatically
+ * activating further connections without user intervention.
+ */
+ virtual void disconnect() = 0;
+
+ /**
* Access the network configuration for this object
*/
virtual Solid::Control::IPv4Config ipV4Config() const = 0;
@@ -80,6 +86,7 @@ namespace Ifaces
* @return true if this network interface is active, false otherwise
*/
virtual bool isActive() const = 0;
+
/**
* Retrieves the current state of the network connection held by this device.
* It's a high level view of the connection. It's user oriented so technically
diff --git a/libs/solid/control/networkinterface.cpp b/libs/solid/control/networkinterface.cpp
index a04d323..94f63bd 100644
--- a/libs/solid/control/networkinterface.cpp
+++ b/libs/solid/control/networkinterface.cpp
@@ -83,6 +83,12 @@ QString Solid::Control::NetworkInterface::driver() const
return_SOLID_CALL(Ifaces::NetworkInterface *, d->backendObject(), QString(), driver());
}
+void Solid::Control::NetworkInterface::disconnect() const
+{
+ Q_D(const NetworkInterface);
+ SOLID_CALL(Ifaces::NetworkInterface *, d->backendObject(), disconnect());
+}
+
Solid::Control::IPv4Config Solid::Control::NetworkInterface::ipV4Config() const
{
Q_D(const NetworkInterface);
diff --git a/libs/solid/control/networkinterface.h b/libs/solid/control/networkinterface.h
index c1476cd..ea2bbc9 100644
--- a/libs/solid/control/networkinterface.h
+++ b/libs/solid/control/networkinterface.h
@@ -147,6 +147,12 @@ namespace Control
*/
QString driver() const;
+ /**
+ * Disconnects a device and prevents the device from automatically
+ * activating further connections without user intervention.
+ */
+ void disconnect() const;
+
Solid::Control::IPv4Config ipV4Config() const;
/**
* Retrieves the activation status of this network interface.
diff --git a/solid/networkmanager-0.7/dbus/nm-deviceinterface.h b/solid/networkmanager-0.7/dbus/nm-deviceinterface.h
index c7456f9..b8d0e2b 100644
--- a/solid/networkmanager-0.7/dbus/nm-deviceinterface.h
+++ b/solid/networkmanager-0.7/dbus/nm-deviceinterface.h
@@ -76,6 +76,12 @@ public:
{ return qvariant_cast< QString >(internalPropGet("Udi")); }
public Q_SLOTS: // METHODS
+ inline QDBusPendingReply<> Disconnect()
+ {
+ QList<QVariant> argumentList;
+ return asyncCallWithArgumentList(QLatin1String("Disconnect"), argumentList);
+ }
+
Q_SIGNALS: // SIGNALS
void StateChanged(uint new_state, uint old_state, uint reason);
};
diff --git a/solid/networkmanager-0.7/networkinterface.cpp b/solid/networkmanager-0.7/networkinterface.cpp
index 466e151..701cfaa 100644
--- a/solid/networkmanager-0.7/networkinterface.cpp
+++ b/solid/networkmanager-0.7/networkinterface.cpp
@@ -186,6 +186,12 @@ bool NMNetworkInterface::managed() const
return d->managed;
}
+void NMNetworkInterface::disconnect()
+{
+ Q_D(NMNetworkInterface);
+ d->deviceIface.Disconnect();
+}
+
void NMNetworkInterface::setManaged(const QVariant & driver)
{
Q_D(NMNetworkInterface);
diff --git a/solid/networkmanager-0.7/networkinterface.h b/solid/networkmanager-0.7/networkinterface.h
index d84deeb..d326160 100644
--- a/solid/networkmanager-0.7/networkinterface.h
+++ b/solid/networkmanager-0.7/networkinterface.h
@@ -56,6 +56,7 @@ public:
void setInterfaceName(const QVariant&);
QString driver() const;
void setDriver(const QVariant&);
+ void disconnect();
int ipV4Address() const;
Solid::Control::IPv4Config ipV4Config() const;
bool isActive() const;
diff --git a/solid/wicd/networkinterface.cpp b/solid/wicd/networkinterface.cpp
index 403b03c..736a96d 100644
--- a/solid/wicd/networkinterface.cpp
+++ b/solid/wicd/networkinterface.cpp
@@ -135,4 +135,8 @@ bool WicdNetworkInterface::deactivateConnection()
return false;
}
+void WicdNetworkInterface::disconnect()
+{
+}
+
#include "networkinterface.moc"
diff --git a/solid/wicd/networkinterface.h b/solid/wicd/networkinterface.h
index 0259e89..79198fc 100644
--- a/solid/wicd/networkinterface.h
+++ b/solid/wicd/networkinterface.h
@@ -49,6 +49,7 @@ public:
virtual bool activateConnection(const QString & connectionUni, const QVariantMap & connectionParameters);
virtual bool deactivateConnection();
+ virtual void disconnect();
Q_SIGNALS:
void ipDetailsChanged();
void connectionStateChanged(int state);
More information about the Kde-hardware-devel
mailing list