void CFEManager::copySettings(CFrontend * fe) { if (CFrontend::linked(fe->getMode())) { for(fe_map_iterator_t it = femap.begin(); it != femap.end(); it++) { if (it->second->fenumber == fe->getMaster()) { copySettings(it->second, fe); break; } } } else if (fe->getMode() == CFrontend::FE_MODE_MASTER) { for (unsigned int i = 1; i < fe->linkmap.size(); i++) { CFrontend * lfe = fe->linkmap[i]; copySettings(fe, lfe); } } }
void validateSettings() { QSettings oldSettings("sieren", "QSyncthingTray"); oldSettings.setFallbacksEnabled(false); mSettings.setFallbacksEnabled(false); if (oldSettings.childKeys().size() > 1 && mSettings.childKeys().size() == 0) { copySettings(mSettings, oldSettings); } createDefaultSettings(); }
void Settings::restore() { Settings appSettings; if ( isLastSaveUnfinished() ) { log("Restoring application settings", LogWarning); if ( appSettings.isEmpty() ) { log("Cannot restore application settings", LogError); } else { QSettings settings; copySettings(appSettings.m_settings, &settings); } endSave(); } else { const QSettings settings; if ( needsUpdate(appSettings, settings) ) copySettings(settings, &appSettings.m_settings); } }
Settings::~Settings() { // Only main application is allowed to change settings. if (canModifySettings() && m_changed) { m_settings.sync(); beginSave(); QSettings to; while ( !m_settings.group().isEmpty() ) m_settings.endGroup(); copySettings(m_settings, &to); endSave(); } }
Trigger :: Trigger(){ flashImage.loadImage("img/TriggerFlash.png"); // the amount typename = "TriggerRocket"; of power a rocket takes away elapsedTime = 0; lastTriggerTime = 0; elapsedTime = 0; //type = TRIGGER_TYPE_FIRE_ON_MOTION; stopping = false; active = false; scale = 0; lastScale = 0; // the power level for the trigger unitPower =1; // passed in by manager triggerSampleSize = 0; multiSampleSize = 0; // SETTINGS : lastSettings = NULL; settings = NULL; // get defaults from the default TriggerSettings object copySettings(TriggerSettings::blank); //rechargeSettings = TriggerRechargeSettings::defaultSettings; motionValueCount = 20; showDebugData = true; angle = 0; triggerCount = 0; sampleBrightness = 1; }
/*! * Saves the settings to a file. The settings are first * saved to a temporary file, and then that file is copied * over the original settings. This avoids clearing settings * when there's no disk space. * \param originalSettings Settings to save. */ static bool doSync(QSettings &originalSettings, QScopedPointer<QFileSystemWatcher>& watcher) { bool returnValue = false; QString tempFileName = createTempFile(originalSettings.fileName()); if (!tempFileName.isEmpty()) { QSettings copiedSettings(tempFileName, QSettings::IniFormat); if (copySettings(originalSettings, copiedSettings)) { copiedSettings.sync(); if (copiedSettings.status() == QSettings::NoError) { renameSettingFile(tempFileName, originalSettings.fileName()); originalSettings.sync(); returnValue = true; } } } addPathsToWatcher(originalSettings.fileName(), watcher); return returnValue; }
void PlotSettings::copyExport() { emit copySettings(PlotSettingsFiller::make(PlotSettingsFiller::EXPORT_SETTINGS, plot)); }
void PlotSettings::copyLegend() { emit copySettings(PlotSettingsFiller::make(PlotSettingsFiller::LEGEND_SETTINGS, plot)); }
void PlotSettings::copyY() { emit copySettings(PlotSettingsFiller::make(PlotSettingsFiller::ORDINATE_SETTINGS, plot)); }
void PlotSettings::copyX() { emit copySettings(PlotSettingsFiller::make(PlotSettingsFiller::ABSCISS_SETTINGS, plot)); }
void PlotSettings::copyPlotTitle() { emit copySettings(PlotSettingsFiller::make(PlotSettingsFiller::PLOT_TITLE_SETTINGS, plot)); }