44 #include "../qnetworksession_impl.h" 46 #include <QtNetwork/private/qnetworkconfiguration_p.h> 48 #include <QtNetwork/qnetworksession.h> 50 #include <QtCore/qdebug.h> 53 #include <QDBusConnection> 55 #include <QDBusInterface> 56 #include <QDBusMessage> 59 #ifndef QT_NO_BEARERMANAGEMENT 80 this,
SIGNAL(configurationsChanged()));
87 qDBusRegisterMetaType<QNmSettingsMap>();
156 activeConnection.connection().path()));
158 if (
id == identifier) {
185 if (
id == identifier)
209 dbusDevicePath = devicePath.
path();
213 dbusDevicePath = devicePath.
path();
218 dbusDevicePath = devicePath.
path();
238 activeConnection.connection().path()));
259 QMapIterator<QString, QVariant> i(properties);
260 while (i.hasNext()) {
270 foreach (
const QString &
id, identifiers)
273 QStringList priorActiveConnections = this->activeConnections.keys();
278 this->activeConnections.
value(acPath.
path());
279 if (!activeConnection) {
281 this->activeConnections.
insert(acPath.
path(), activeConnection);
296 if (activeConnection->
state() == 2 &&
310 while (!priorActiveConnections.
isEmpty())
311 delete this->activeConnections.take(priorActiveConnections.
takeFirst());
313 while (!identifiers.
isEmpty()) {
343 if (!activeConnection)
352 if (activeConnection->
state() == 2 &&
434 if (activeConnection.serviceName() == service &&
435 activeConnection.connection().path() == settingsPath &&
436 activeConnection.state() == 2) {
491 if (activeConnection.serviceName() == service &&
492 activeConnection.connection().path() == settingsPath &&
505 ptr->
id = cpPriv->
id;
526 activeConnection.connection().path()));
531 if (activeConnection.state() == 2 &&
573 if (accessPoint->
ssid() == connection->
getSsid()) {
631 if (accessPoint->
ssid() == connection->
getSsid()) {
681 if (accessPoint->
ssid() == connection->
getSsid()) {
723 if (wiredDevice.carrier()) {
730 }
else if (connectionType ==
QLatin1String(
"802-11-wireless")) {
735 if(!connectionSecurity.
isEmpty()) {
760 }
else if (connectionType ==
"gsm") {
762 }
else if (connectionType ==
"cdma") {
778 if (
id == identifier)
803 if (
id == identifier) {
804 switch (activeConnection->
state()) {
832 if (!networkInterface.
isEmpty()) {
860 if (!networkInterface.
isEmpty()) {
911 #endif // QT_NO_BEARERMANAGEMENT static QString number(int, int base=10)
This is an overloaded member function, provided for convenience. It differs from the above function o...
QList< QDBusObjectPath > activeConnections() const
QNetworkManagerInterface * interface
quint64 bytesReceived(const QString &id)
uint qHash(const QProcEnvKey &key)
#define QT_END_NAMESPACE
This macro expands to.
void lock()
Locks the mutex.
QString path() const
Returns the object path that this interface is associated with.
void deviceRemoved(const QDBusObjectPath &path)
QString getInterfaceFromId(const QString &id)
T qdbus_cast(const QDBusArgument &arg)
QNetworkConfiguration::StateFlags state
bool open(OpenMode flags)
Opens the file using OpenMode mode, returning true if successful; otherwise false.
The QDBusArgument class is used to marshall and demarshall D-Bus arguments.
void configurationChanged(QNetworkConfigurationPrivatePointer config)
T1 value() const
Returns the first argument in this reply, cast to type T1 (the first template parameter of this class...
QHash< QString, QNetworkManagerConnectionActive * > activeConnections
QDBusInterface * connectionInterface() const
void unlock()
Unlocks this mutex locker.
QString toString() const
Returns the variant as a QString if the variant has type() String , Bool , ByteArray ...
void connectToId(const QString &id)
#define NM_DBUS_SERVICE_SYSTEM_SETTINGS
State
This enum describes the connectivity state of the session.
void insert(int i, const T &t)
Inserts value at index position i in the list.
QNetworkManagerEngine(QObject *parent=0)
QNetworkConfigurationManager::Capabilities capabilities() const
bool isError() const
Returns true if the reply contains an error message, false if it contains a normal method reply...
QList< QNetworkManagerInterfaceAccessPoint * > accessPoints
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
int count(const T &t) const
Returns the number of occurrences of value in the list.
The QDBusPendingCallWatcher class provides a convenient way for waiting for asynchronous replies...
The QString class provides a Unicode character string.
T * qobject_cast(QObject *object)
T take(const Key &key)
Removes the item with the key from the hash and returns the value associated with it...
void activationFinished(QDBusPendingCallWatcher *watcher)
The QObject class is the base class of all Qt objects.
void updateConnection(const QNmSettingsMap &settings)
QHash< QString, QNetworkManagerInterfaceDeviceWireless * > wirelessDevices
void newConnection(const QDBusObjectPath &path, QNetworkManagerSettings *settings=0)
bool networkManagerAvailable() const
QDBusInterface * connectionInterface() const
QNetworkConfiguration::BearerType bearerType
const T value(const Key &key) const
Returns the value associated with the key.
bool isEmpty() const
Returns true if the list contains no items; otherwise returns false.
iterator insert(const Key &key, const T &value)
Inserts a new item with the key and a value of value.
QObject * sender() const
Returns a pointer to the object that sent the signal, if called in a slot activated by a signal; othe...
QNetworkManagerSettings * systemSettings
bool exists() const
Returns true if the file specified by fileName() exists; otherwise returns false. ...
void relock()
Relocks an unlocked mutex locker.
bool removeOne(const T &t)
Removes the first occurrence of value in the list and returns true on success; otherwise returns fals...
QList< QNetworkManagerInterfaceAccessPoint * > configuredAccessPoints
void append(const T &t)
Inserts value at the end of the list.
QList< QDBusObjectPath > listConnections()
#define QT_BEGIN_NAMESPACE
This macro expands to.
QBool contains(const T &t) const
Returns true if the list contains an occurrence of value; otherwise returns false.
quint64 startTime(const QString &id)
void updateAccessPoint(const QMap< QString, QVariant > &map)
QHash< QString, QNetworkConfigurationPrivatePointer > accessPointConfigurations
T takeFirst()
Removes the first item in the list and returns it.
static bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
Creates a connection of the given type from the signal in the sender object to the method in the rece...
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
Q_INVOKABLE void requestUpdate()
void activeConnectionPropertiesChanged(const QString &path, const QMap< QString, QVariant > &properties)
QList< QDBusObjectPath > getAccessPoints()
const T value(const Key &key) const
Returns the value associated with the key key.
const T & at(int i) const
Returns the item at index position i in the list.
The QStringList class provides a list of strings.
void configurationAdded(QNetworkConfigurationPrivatePointer config)
void interfacePropertiesChanged(const QString &path, const QMap< QString, QVariant > &properties)
void activateConnection(const QString &serviceName, QDBusObjectPath connection, QDBusObjectPath device, QDBusObjectPath specificObject)
QString path() const
Returns this object path.
QDBusObjectPath connection() const
T value(int i) const
Returns the value at index position i in the list.
const T * ptr(const T &t)
quint64 bytesWritten(const QString &id)
void deactivateConnection(QDBusObjectPath connectionPath) const
QList< QDBusObjectPath > getDevices() const
QString networkInterface() const
void unlock()
Unlocks the mutex.
QDBusInterface * connectionInterface() const
void deviceAdded(const QDBusObjectPath &path)
void disconnectFromId(const QString &id)
bool hasIdentifier(const QString &id)
Q_INVOKABLE void initialize()
QList< QNetworkManagerSettingsConnection * > connections
#define NM_DBUS_SERVICE_USER_SETTINGS
The QMutexLocker class is a convenience class that simplifies locking and unlocking mutexes...
QNetworkConfiguration::Purpose purpose
The QFile class provides an interface for reading from and writing to files.
QExplicitlySharedDataPointer< QNetworkConfigurationPrivate > QNetworkConfigurationPrivatePointer
The QTextStream class provides a convenient interface for reading and writing text.
QNetworkConfiguration::Type type
QNetworkManagerSettings * userSettings
QNetworkConfigurationPrivatePointer defaultConfiguration()
void removeConnection(const QString &path)
The QDBusObjectPath class enables the programmer to identify the OBJECT_PATH type provided by the D-B...
void configurationRemoved(QNetworkConfigurationPrivatePointer config)
QString serviceName() const
QString service() const
Returns the name of the service this interface is associated with.
static const QCssKnownValue properties[NumProperties - 1]
QNetworkConfigurationPrivate * parseConnection(const QString &service, const QString &settingsPath, const QNmSettingsMap &map)
void devicePropertiesChanged(const QString &path, const QMap< QString, QVariant > &properties)
void newAccessPoint(const QString &path, const QDBusObjectPath &objectPath)
The QDBusPendingReply class contains the reply to an asynchronous method call.
virtual void close()
Calls QFile::flush() and closes the file.
#define Q_UNUSED(x)
Indicates to the compiler that the parameter with the specified name is not used in the body of a fun...
Q_OUTOFLINE_TEMPLATE void qDeleteAll(ForwardIterator begin, ForwardIterator end)
QNetworkSessionPrivate * createSessionBackend()
QList< Key > keys() const
Returns a list containing all the keys in the hash, in an arbitrary order.
void deleteLater()
Schedules this object for deletion.
QNetworkManagerSettingsConnection * connectionFromId(const QString &id) const
QNmSettingsMap getSettings()
void removeAccessPoint(const QString &path, const QDBusObjectPath &objectPath)
The QList class is a template class that provides lists.
int removeAll(const T &t)
Removes all occurrences of value in the list and returns the number of entries removed.
QNetworkSession::State sessionStateForId(const QString &id)
#define NM_802_11_AP_FLAGS_PRIVACY