| 112 | } |
| 113 | |
| 114 | void OptionsDialog::exportSettings() |
| 115 | { |
| 116 | QString exportFileName = QFileDialog::getSaveFileName(this, |
| 117 | tr("Export Settings"), |
| 118 | QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation) + QDir::separator() + "config.ini", |
| 119 | tr("Lightscreen Settings (*.ini)")); |
| 120 | |
| 121 | if (exportFileName.isEmpty()) { |
| 122 | return; |
| 123 | } |
| 124 | |
| 125 | if (QFile::exists(exportFileName)) { |
| 126 | QFile::remove(exportFileName); |
| 127 | } |
| 128 | |
| 129 | QSettings exportedSettings(exportFileName, QSettings::IniFormat); |
| 130 | |
| 131 | for (auto key : settings()->allKeys()) { |
| 132 | exportedSettings.setValue(key, settings()->value(key)); |
| 133 | } |
| 134 | } |
| 135 | |
| 136 | void OptionsDialog::importSettings() |
| 137 | { |
nothing calls this directly
no outgoing calls
no test coverage detected