summaryrefslogtreecommitdiffstats
path: root/src/plugins/bearer/networkmanager/main.cpp
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-02-20 05:50:12 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-02-20 05:50:12 (GMT)
commit1449a1b84f12d937b56ae2b9f4a3ba3dc704281e (patch)
tree04371e32433d58f19c51de2df2a89193d6914c3c /src/plugins/bearer/networkmanager/main.cpp
parent8f10ca802dee1ed110f301191c4a56a85575033c (diff)
parent840dab97ee4bd68dcf75cfd2edd5e58c38040ae1 (diff)
downloadQt-1449a1b84f12d937b56ae2b9f4a3ba3dc704281e.zip
Qt-1449a1b84f12d937b56ae2b9f4a3ba3dc704281e.tar.gz
Qt-1449a1b84f12d937b56ae2b9f4a3ba3dc704281e.tar.bz2
Merge branch 'master' of scm.dev.nokia.troll.no:qt/mobility-staging into master-integration
* 'master' of scm.dev.nokia.troll.no:qt/mobility-staging: (114 commits) Create unit-test in parent directory. Allow QNAM to be created as a global variable. Don't load NetworkManager plugin in NetworkManager is not available. Disable NLA plugin, build generic on win32 and mac. Fix QNetworkSession unit test. Fix segfault. Remove debug output. Make this a warning. Don't block forever if no bearer plugins are loaded. Always build generic plugin when building NetworkManager plugin. Add QT_MODULE headers. Change docs: "phone" -> "device". Remove unused code. Simplify. Optimise iterations over QHash. Use snippets. Reorder members to remove hole. Expand documentation for QNAM::setConfiguration() and friends. Fix build on Windows, typo. Fix build on Windows. ...
Diffstat (limited to 'src/plugins/bearer/networkmanager/main.cpp')
-rw-r--r--src/plugins/bearer/networkmanager/main.cpp89
1 files changed, 89 insertions, 0 deletions
diff --git a/src/plugins/bearer/networkmanager/main.cpp b/src/plugins/bearer/networkmanager/main.cpp
new file mode 100644
index 0000000..6c97a22
--- /dev/null
+++ b/src/plugins/bearer/networkmanager/main.cpp
@@ -0,0 +1,89 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the plugins of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qnetworkmanagerengine.h"
+
+#include <QtNetwork/private/qbearerplugin_p.h>
+
+#include <QtCore/qdebug.h>
+
+QT_BEGIN_NAMESPACE
+
+class QNetworkManagerEnginePlugin : public QBearerEnginePlugin
+{
+public:
+ QNetworkManagerEnginePlugin();
+ ~QNetworkManagerEnginePlugin();
+
+ QStringList keys() const;
+ QBearerEngine *create(const QString &key) const;
+};
+
+QNetworkManagerEnginePlugin::QNetworkManagerEnginePlugin()
+{
+}
+
+QNetworkManagerEnginePlugin::~QNetworkManagerEnginePlugin()
+{
+}
+
+QStringList QNetworkManagerEnginePlugin::keys() const
+{
+ return QStringList() << QLatin1String("networkmanager");
+}
+
+QBearerEngine *QNetworkManagerEnginePlugin::create(const QString &key) const
+{
+ if (key == QLatin1String("networkmanager")) {
+ QNetworkManagerEngine *engine = new QNetworkManagerEngine;
+ if (engine->networkManagerAvailable())
+ return engine;
+ else
+ delete engine;
+ }
+
+ return 0;
+}
+
+Q_EXPORT_STATIC_PLUGIN(QNetworkManagerEnginePlugin)
+Q_EXPORT_PLUGIN2(qnmbearer, QNetworkManagerEnginePlugin)
+
+QT_END_NAMESPACE