~ubuntu-branches/ubuntu/precise/networkmanagement/precise-updates

« back to all changes in this revision

Viewing changes to backends/NetworkManager/nmdbussettingsservice.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Michael Biebl, Modestas Vainius, Michael Biebl
  • Date: 2011-05-27 12:18:25 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20110527121825-vfufwquq3vy0k3zn
Tags: 0.1+git20110526.911025d-1
[ Modestas Vainius ]
* Use official KDE branding in the package descriptions.

[ Michael Biebl ]
* New upstream Git snapshot 911025d81fdfbe09b64705e94e5411f521c38e3e.
* debian/control
  - Bump Build-Depends on kdelibs5-dev and kdebase-workspace-dev to
    (>= 4:4.6.0).
  - Bump Build-Depends on network-manager-dev and libnm-util-dev to
    (>= 0.8.1).
  - Bump Depends on network-manager to (>= 0.8.1).

Show diffs side-by-side

added added

removed removed

Lines of Context:
41
41
#include <interfaceconnection.h>
42
42
#include <vpninterfaceconnection.h>
43
43
 
 
44
#ifdef COMPILE_MODEM_MANAGER_SUPPORT
 
45
#include <solid/control/networkgsminterface.h>
 
46
#include <solid/control/modeminterface.h>
 
47
#endif
 
48
 
44
49
#include "busconnection.h"
45
50
#include "exportedconnection.h"
46
51
#include "exportedconnectionsecrets.h"
101
106
        // trouble;
102
107
        kDebug() << "Unable to unregister service";
103
108
    }
 
109
    delete d_ptr;
104
110
}
105
111
 
106
112
QUuid NMDBusSettingsService::uuidForPath(const QDBusObjectPath& path) const
232
238
            deviceToActivateOn = ic->deviceUni();
233
239
        }
234
240
 
 
241
#ifdef COMPILE_MODEM_MANAGER_SUPPORT
 
242
        // Enable modem before connecting.
 
243
        Solid::Control::GsmNetworkInterface *iface = qobject_cast<Solid::Control::GsmNetworkInterface *>(Solid::Control::NetworkManager::findNetworkInterface(deviceToActivateOn));
 
244
        if (iface) {
 
245
            Solid::Control::ModemGsmCardInterface *modem = iface->getModemCardIface();
 
246
            if (modem && !modem->enabled()) {
 
247
                // Try to pin-unlock the modem.
 
248
                QMetaObject::invokeMethod(modem, "unlockRequiredChanged", Qt::DirectConnection,
 
249
                                          Q_ARG(QString, modem->unlockRequired()));
 
250
                kDebug() << "Trying to enable modem";
 
251
                modem->enable(true);
 
252
            }
 
253
        }
 
254
#endif
 
255
 
235
256
        Solid::Control::NetworkManager::activateConnection(deviceToActivateOn,
236
257
                QString::fromLatin1("%1 %2")
237
258
                .arg(ic->property("NMDBusService").toString(), ic->property("NMDBusObjectPath").toString()),