diff options
author | Aaron McCarthy <aaron.mccarthy@nokia.com> | 2010-02-18 00:12:24 (GMT) |
---|---|---|
committer | Aaron McCarthy <aaron.mccarthy@nokia.com> | 2010-02-18 00:12:24 (GMT) |
commit | 49f63d8f37fcd45ebe527f3554ff7b4c34d8545e (patch) | |
tree | d00a20f7a61f6d6c5cb0dcd5d32de49a653cb113 /src/plugins/bearer/networkmanager/main.cpp | |
parent | 4cd7e2ebd675fdc0b00d9a29f64e4189e74f7656 (diff) | |
download | Qt-49f63d8f37fcd45ebe527f3554ff7b4c34d8545e.zip Qt-49f63d8f37fcd45ebe527f3554ff7b4c34d8545e.tar.gz Qt-49f63d8f37fcd45ebe527f3554ff7b4c34d8545e.tar.bz2 |
Don't load NetworkManager plugin in NetworkManager is not available.
Diffstat (limited to 'src/plugins/bearer/networkmanager/main.cpp')
-rw-r--r-- | src/plugins/bearer/networkmanager/main.cpp | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/plugins/bearer/networkmanager/main.cpp b/src/plugins/bearer/networkmanager/main.cpp index f62b847..6c97a22 100644 --- a/src/plugins/bearer/networkmanager/main.cpp +++ b/src/plugins/bearer/networkmanager/main.cpp @@ -72,10 +72,15 @@ QStringList QNetworkManagerEnginePlugin::keys() const QBearerEngine *QNetworkManagerEnginePlugin::create(const QString &key) const { - if (key == QLatin1String("networkmanager")) - return new QNetworkManagerEngine; - else - return 0; + if (key == QLatin1String("networkmanager")) { + QNetworkManagerEngine *engine = new QNetworkManagerEngine; + if (engine->networkManagerAvailable()) + return engine; + else + delete engine; + } + + return 0; } Q_EXPORT_STATIC_PLUGIN(QNetworkManagerEnginePlugin) |