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();
}
示例#3
0
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);
    }
}
示例#4
0
文件: settings.cpp 项目: Ack0/CopyQ
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();
    }
}
示例#5
0
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;
	
	
		
	
}
示例#6
0
/*!
 * 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;
}
示例#7
0
void PlotSettings::copyExport()
{
    emit copySettings(PlotSettingsFiller::make(PlotSettingsFiller::EXPORT_SETTINGS, plot));
}
示例#8
0
void PlotSettings::copyLegend()
{
    emit copySettings(PlotSettingsFiller::make(PlotSettingsFiller::LEGEND_SETTINGS, plot));
}
示例#9
0
void PlotSettings::copyY()
{
    emit copySettings(PlotSettingsFiller::make(PlotSettingsFiller::ORDINATE_SETTINGS, plot));
}
示例#10
0
void PlotSettings::copyX()
{
    emit copySettings(PlotSettingsFiller::make(PlotSettingsFiller::ABSCISS_SETTINGS, plot));
}
示例#11
0
void PlotSettings::copyPlotTitle()
{
    emit copySettings(PlotSettingsFiller::make(PlotSettingsFiller::PLOT_TITLE_SETTINGS, plot));
}