* @brief Encrypts and writes the current license key and metadata to QSettings. */
| 405 | * @brief Encrypts and writes the current license key and metadata to QSettings. |
| 406 | */ |
| 407 | void 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). |
nothing calls this directly
no test coverage detected