Skip to content

ConnectionSettings: Allow creating a connection from MeCard data

Kai Uwe Broulik requested to merge work/kbroulik/settings-from-mecard into master

For connecting to a network by scanning a QR code. Connection code is lifted from QRCA with MeCardParser in Prison.


@vkrause @grulich @sune

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

Merge request reports