Register DBus type properly

This commit is contained in:
Simon Stürz 2018-11-22 11:02:08 +01:00
parent fe9a4c6048
commit 309f0b6c93
3 changed files with 8 additions and 0 deletions

View File

@ -30,6 +30,7 @@ NetworkConnection::NetworkConnection(const QDBusObjectPath &objectPath, QObject
QObject(parent),
m_objectPath(objectPath)
{
qRegisterMetaType<ConnectionSettings>("ConnectionSettings");
qDBusRegisterMetaType<ConnectionSettings>();
m_connectionInterface = new QDBusInterface(NetworkManagerUtils::networkManagerServiceString(), m_objectPath.path(), NetworkManagerUtils::connectionsInterfaceString(), QDBusConnection::systemBus(), this);

View File

@ -60,6 +60,7 @@ private:
ConnectionSettings m_connectionSettings;
};
Q_DECLARE_METATYPE(ConnectionSettings)
QDebug operator<<(QDebug debug, NetworkConnection *networkConnection);
#endif // NETWORKCONNECTION_H

View File

@ -174,6 +174,12 @@ void Core::evaluateNetworkManagerState(const NetworkManager::NetworkManagerState
if (m_mode != ModeOffline)
return;
// Note: if the wireless device is in the access point mode, the bluetooth server should stop
if (m_wirelessDevice->mode() == WirelessNetworkDevice::ModeAccessPoint) {
stopService();
return;
}
switch (state) {
case NetworkManager::NetworkManagerStateConnectedGlobal:
// We are online