ConnectionSettings: Allow creating a connection from MeCard data
For connecting to a network by scanning a QR code. Connection code is lifted from QRCA with MeCardParser in Prison.
I modeled it after the existing fromMap
, so the caller is responsible for creating the relevant settings object and setting a UUID:
using namespace NetworkManager;
auto settings = ConnectionSettings::Ptr(new ConnectionSettings(ConnectionSettings::Wireless));
settings->setUuid(ConnectionSettings::createNewUuid());
settings->setAutoconnect(true);
settings->fromMeCard(m_parsedContent); // <-- You are here.
NetworkManager::addConnection(settings->toMap());
See also prison!38 (merged)
Edited by Kai Uwe Broulik