MCPcopy Create free account
hub / github.com/ckaiser/Lightscreen / exportSettings

Method exportSettings

dialogs/optionsdialog.cpp:114–134  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

112}
113
114void 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
136void OptionsDialog::importSettings()
137{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected