summaryrefslogtreecommitdiffstats
path: root/src/plugins/bearer/connman/main.cpp
diff options
context:
space:
mode:
authorLorn Potter <lorn.potter@nokia.com>2010-06-07 18:40:42 (GMT)
committerLorn Potter <lorn.potter@nokia.com>2010-06-07 18:40:42 (GMT)
commit0948de26bca9a68a354b436895bdf9e2db9c4288 (patch)
treede6cceb7f76f335b05eee7a934055d76562703b9 /src/plugins/bearer/connman/main.cpp
parente3ee3780777b07e6283a8b33cd4f7e1d56241d1c (diff)
downloadQt-0948de26bca9a68a354b436895bdf9e2db9c4288.zip
Qt-0948de26bca9a68a354b436895bdf9e2db9c4288.tar.gz
Qt-0948de26bca9a68a354b436895bdf9e2db9c4288.tar.bz2
initial connman bearer backend.
still needs work, debugging, additional threading support, and probably refactoring. This includes a connman dbus service wrapper that has more functionality than is needed by the bearer backend but still missing some 'set' functionality for a complete connman wrapper. Developed with wifi/desktop on 'lucid' kubuntu, using the connman available at http://ppa.launchpad.net/indicator-network-developers/ppa/ubuntu
Diffstat (limited to 'src/plugins/bearer/connman/main.cpp')
-rw-r--r--src/plugins/bearer/connman/main.cpp93
1 files changed, 93 insertions, 0 deletions
diff --git a/src/plugins/bearer/connman/main.cpp b/src/plugins/bearer/connman/main.cpp
new file mode 100644
index 0000000..d483cf0
--- /dev/null
+++ b/src/plugins/bearer/connman/main.cpp
@@ -0,0 +1,93 @@
+/****************************************************************************
+**
+** 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 "qconnmanengine.h"
+
+#include <QtNetwork/private/qbearerplugin_p.h>
+
+#include <QtCore/qdebug.h>
+
+#ifndef QT_NO_BEARERMANAGEMENT
+#ifndef QT_NO_DBUS
+
+QT_BEGIN_NAMESPACE
+
+class QConnmanEnginePlugin : public QBearerEnginePlugin
+{
+public:
+ QConnmanEnginePlugin();
+ ~QConnmanEnginePlugin();
+
+ QStringList keys() const;
+ QBearerEngine *create(const QString &key) const;
+};
+
+QConnmanEnginePlugin::QConnmanEnginePlugin()
+{
+}
+
+QConnmanEnginePlugin::~QConnmanEnginePlugin()
+{
+}
+
+QStringList QConnmanEnginePlugin::keys() const
+{
+ return QStringList() << QLatin1String("connman");
+}
+
+QBearerEngine *QConnmanEnginePlugin::create(const QString &key) const
+{
+ if (key == QLatin1String("connman")) {
+ QConnmanEngine *engine = new QConnmanEngine;
+ if (engine->connmanAvailable())
+ return engine;
+ else
+ delete engine;
+ }
+ return 0;
+}
+
+Q_EXPORT_STATIC_PLUGIN(QConnmanEnginePlugin)
+Q_EXPORT_PLUGIN2(qconnmanbearer, QConnmanEnginePlugin)
+
+QT_END_NAMESPACE
+
+#endif
+#endif // QT_NO_BEARERMANAGEMENT