MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / writeSettings

Method writeSettings

app/src/Licensing/LemonSqueezy.cpp:407–425  ·  view source on GitHub ↗

* @brief Encrypts and writes the current license key and metadata to QSettings. */

Source from the content-addressed store, hash-verified

405 * @brief Encrypts and writes the current license key and metadata to QSettings.
406 */
407void Licensing::LemonSqueezy::writeSettings()
408{
409 auto json = QJsonDocument(m_licensingData).toJson(QJsonDocument::Compact);
410
411 if (!json.isEmpty() && canActivate()) {
412 m_settings.beginGroup("licensing");
413 m_settings.setValue("license", m_simpleCrypt.encryptToString(m_license));
414 m_settings.setValue("data", m_simpleCrypt.encryptToString(json));
415 m_settings.endGroup();
416 }
417
418 else {
419 m_settings.beginGroup("licensing");
420 m_settings.setValue("data", "");
421 m_settings.setValue("license", "");
422 m_settings.setValue("lastCheck", "");
423 m_settings.endGroup();
424 }
425}
426
427/**
428 * @brief Returns now floored at the highest wall-clock ever observed (anti clock-rewind).

Callers

nothing calls this directly

Calls 3

isEmptyMethod · 0.80
encryptToStringMethod · 0.80
toJsonMethod · 0.45

Tested by

no test coverage detected