diff --git a/connd/com.jollamobile.Connectiond.xml b/connd/com.jollamobile.Connectiond.xml
index b356e57..4bcf60d 100644
--- a/connd/com.jollamobile.Connectiond.xml
+++ b/connd/com.jollamobile.Connectiond.xml
@@ -47,6 +47,9 @@
+
+
+
diff --git a/connd/qconnectionagent.cpp b/connd/qconnectionagent.cpp
index 08338fc..84d156c 100644
--- a/connd/qconnectionagent.cpp
+++ b/connd/qconnectionagent.cpp
@@ -864,7 +864,7 @@ void QConnectionAgent::startTethering(const QString &type)
}
}
-void QConnectionAgent::stopTethering()
+void QConnectionAgent::stopTethering(bool keepPowered)
{
delayedTethering = false;
QSettings confFile;
@@ -890,7 +890,7 @@ void QConnectionAgent::stopTethering()
}
b = confFile.value("tetheringTechPowered").toBool();
- if (!b && tetherTech) {
+ if (!b && tetherTech && !keepPowered) {
tetherTech->setPowered(false);
}
Q_EMIT tetheringFinished(false);
diff --git a/connd/qconnectionagent.h b/connd/qconnectionagent.h
index ecbb3b1..5d1a22e 100644
--- a/connd/qconnectionagent.h
+++ b/connd/qconnectionagent.h
@@ -77,7 +77,7 @@ public Q_SLOTS:
void connectToType(const QString &type);
void startTethering(const QString &type);
- void stopTethering();
+ void stopTethering(bool keepPowered = false);
private:
explicit QConnectionAgent(QObject *parent = 0);
diff --git a/connectionagentplugin/connectionagentplugin.cpp b/connectionagentplugin/connectionagentplugin.cpp
index 9354c71..441fcac 100644
--- a/connectionagentplugin/connectionagentplugin.cpp
+++ b/connectionagentplugin/connectionagentplugin.cpp
@@ -15,7 +15,7 @@
****************************************************************************/
#include "connectionagentplugin.h"
-#include "connectionamanagerinterface.h"
+#include "connectiond_interface.h"
#include
#include
@@ -192,7 +192,7 @@ void ConnectionAgentPlugin::onTetheringFinished(bool success)
Q_EMIT tetheringFinished(success);
}
-void ConnectionAgentPlugin::stopTethering()
+void ConnectionAgentPlugin::stopTethering(bool keepPowered)
{
- connManagerInterface->stopTethering();
+ connManagerInterface->stopTethering(keepPowered);
}
diff --git a/connectionagentplugin/connectionagentplugin.h b/connectionagentplugin/connectionagentplugin.h
index b7fc4a0..b6e2b1b 100644
--- a/connectionagentplugin/connectionagentplugin.h
+++ b/connectionagentplugin/connectionagentplugin.h
@@ -18,7 +18,7 @@
#define CONNECTIONAGENTPLUGIN_H
#include "connectionagentplugin.h"
-#include "connectionamanagerinterface.h"
+#include "connectiond_interface.h"
class NetworkManager;
class ConnectionAgentPlugin : public QObject
@@ -39,7 +39,7 @@ public slots:
void sendConnectReply(const QString &replyMessage, int timeout = 120);
void connectToType(const QString &type);
void startTethering(const QString &type);
- void stopTethering();
+ void stopTethering(bool keepPowered = false);
signals:
void userInputRequested(const QString &servicePath, const QVariantMap &fields);
diff --git a/connectionagentplugin/connectionagentplugin.pro b/connectionagentplugin/connectionagentplugin.pro
index a87c051..348bf0d 100644
--- a/connectionagentplugin/connectionagentplugin.pro
+++ b/connectionagentplugin/connectionagentplugin.pro
@@ -5,18 +5,18 @@ CONFIG += qt plugin
uri = com.jolla.connection
-#create client
-#system(qdbusxml2cpp ../connd/com.jollamobile.Connectiond.xml -c ConnectionManagerInterface -p connectionamanagerinterface)
-
SOURCES += \
connectionagentplugin_plugin.cpp \
- connectionagentplugin.cpp \
- connectionamanagerinterface.cpp
+ connectionagentplugin.cpp
HEADERS += \
connectionagentplugin_plugin.h \
- connectionagentplugin.h \
- connectionamanagerinterface.h
+ connectionagentplugin.h
+
+DBUS_INTERFACES = connectiond_interface
+connectiond_interface.files = ../connd/com.jollamobile.Connectiond.xml
+connectiond_interface.header_flags = "-c ConnectionManagerInterface"
+connectiond_interface.source_flags = "-c ConnectionManagerInterface"
OTHER_FILES = qmldir
diff --git a/connectionagentplugin/connectionamanagerinterface.cpp b/connectionagentplugin/connectionamanagerinterface.cpp
deleted file mode 100644
index 51d59cf..0000000
--- a/connectionagentplugin/connectionamanagerinterface.cpp
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * This file was generated by qdbusxml2cpp version 0.7
- * Command line was: qdbusxml2cpp ../connd/com.jollamobile.Connectiond.xml -c ConnectionManagerInterface -p connectionamanagerinterface
- *
- * qdbusxml2cpp is Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
- *
- * This is an auto-generated file.
- * This file may have been hand-edited. Look for HAND-EDIT comments
- * before re-generating it.
- */
-
-#include "connectionamanagerinterface.h"
-
-/*
- * Implementation of interface class ConnectionManagerInterface
- */
-
-ConnectionManagerInterface::ConnectionManagerInterface(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent)
- : QDBusAbstractInterface(service, path, staticInterfaceName(), connection, parent)
-{
-}
-
-ConnectionManagerInterface::~ConnectionManagerInterface()
-{
-}
-
diff --git a/connectionagentplugin/connectionamanagerinterface.h b/connectionagentplugin/connectionamanagerinterface.h
deleted file mode 100644
index 7462873..0000000
--- a/connectionagentplugin/connectionamanagerinterface.h
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- * This file was generated by qdbusxml2cpp version 0.7
- * Command line was: qdbusxml2cpp ../connd/com.jollamobile.Connectiond.xml -c ConnectionManagerInterface -p connectionamanagerinterface
- *
- * qdbusxml2cpp is Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
- *
- * This is an auto-generated file.
- * Do not edit! All changes made to it will be lost.
- */
-
-#ifndef CONNECTIONAMANAGERINTERFACE_H_1366057321
-#define CONNECTIONAMANAGERINTERFACE_H_1366057321
-
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-
-/*
- * Proxy class for interface com.jolla.Connectiond
- */
-class ConnectionManagerInterface: public QDBusAbstractInterface
-{
- Q_OBJECT
-public:
- static inline const char *staticInterfaceName()
- { return "com.jolla.Connectiond"; }
-
-public:
- ConnectionManagerInterface(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent = 0);
-
- ~ConnectionManagerInterface();
-
- Q_PROPERTY(bool askRoaming READ askRoaming WRITE setAskRoaming)
- inline bool askRoaming() const
- { return qvariant_cast< bool >(property("askRoaming")); }
- inline void setAskRoaming(bool value)
- { setProperty("askRoaming", QVariant::fromValue(value)); }
-
-public Q_SLOTS: // METHODS
- inline QDBusPendingReply<> connectToType(const QString &in0)
- {
- QList argumentList;
- argumentList << QVariant::fromValue(in0);
- return asyncCallWithArgumentList(QLatin1String("connectToType"), argumentList);
- }
-
- inline QDBusPendingReply<> sendConnectReply(const QString &in0, int in1)
- {
- QList argumentList;
- argumentList << QVariant::fromValue(in0) << QVariant::fromValue(in1);
- return asyncCallWithArgumentList(QLatin1String("sendConnectReply"), argumentList);
- }
-
- inline QDBusPendingReply<> sendUserReply(const QVariantMap &input)
- {
- QList argumentList;
- argumentList << QVariant::fromValue(input);
- return asyncCallWithArgumentList(QLatin1String("sendUserReply"), argumentList);
- }
-
- inline QDBusPendingReply<> startTethering(const QString &in0)
- {
- QList argumentList;
- argumentList << QVariant::fromValue(in0);
- return asyncCallWithArgumentList(QLatin1String("startTethering"), argumentList);
- }
-
- inline QDBusPendingReply<> stopTethering()
- {
- return asyncCall(QLatin1String("stopTethering"));
- }
-
-
-Q_SIGNALS: // SIGNALS
- void configurationNeeded(const QString &type);
- void connectionRequest();
- void connectionState(const QString &state, const QString &type);
- void errorReported(const QString &servicePath, const QString &error);
- void requestBrowser(const QString &url);
- void roamingAskChanged(bool askRoaming);
- void userInputCanceled();
- void userInputRequested(const QString &service, const QVariantMap &fields);
- void tetheringFinished(bool);
-};
-
-namespace com {
- namespace jolla {
- typedef ::ConnectionManagerInterface Connectiond;
- }
-}
-#endif
diff --git a/test/auto/tst_connectionagent_plugin/tst_connectionagent_plugin.pro b/test/auto/tst_connectionagent_plugin/tst_connectionagent_plugin.pro
index 35923fb..6d91b9b 100644
--- a/test/auto/tst_connectionagent_plugin/tst_connectionagent_plugin.pro
+++ b/test/auto/tst_connectionagent_plugin/tst_connectionagent_plugin.pro
@@ -16,12 +16,15 @@ TEMPLATE = app
SOURCES += tst_connectionagent_plugintest.cpp \
- ../../../connectionagentplugin/connectionagentplugin.cpp \
- ../../../connectionagentplugin/connectionamanagerinterface.cpp
+ ../../../connectionagentplugin/connectionagentplugin.cpp
HEADERS += \
- ../../../connectionagentplugin/connectionagentplugin.h \
- ../../../connectionagentplugin/connectionamanagerinterface.h
+ ../../../connectionagentplugin/connectionagentplugin.h
+
+DBUS_INTERFACES = connectiond_interface
+connectiond_interface.files = ../../../connd/com.jollamobile.Connectiond.xml
+connectiond_interface.header_flags = "-c ConnectionManagerInterface"
+connectiond_interface.source_flags = "-c ConnectionManagerInterface"
DEFINES += SRCDIR=\\\"$$PWD/\\\"