示例#1
0
void NSISUpdater::versionInfoArrived(const UpdateInfo &info)
{
    ConfigFile cfg;
    QSettings settings(cfg.configFile(), QSettings::IniFormat);
    qint64 infoVersion = Helper::stringVersionToInt(info.version());
    qint64 seenVersion = Helper::stringVersionToInt(settings.value(seenVersionC).toString());
    qint64 currVersion = Helper::currentVersionToInt();
    if (info.version().isEmpty()
        || infoVersion <= currVersion
        || infoVersion <= seenVersion) {
        qCInfo(lcUpdater) << "Client is on latest version!";
        setDownloadState(UpToDate);
    } else {
        QString url = info.downloadUrl();
        qint64 autoUpdateFailedVersion =
            Helper::stringVersionToInt(settings.value(autoUpdateFailedVersionC).toString());
        if (url.isEmpty() || _showFallbackMessage || infoVersion == autoUpdateFailedVersion) {
            showDialog(info);
        }
        if (!url.isEmpty()) {
            _targetFile = cfg.configPath() + url.mid(url.lastIndexOf('/'));
            if (QFile(_targetFile).exists()) {
                setDownloadState(DownloadComplete);
            } else {
                QNetworkReply *reply = qnam()->get(QNetworkRequest(QUrl(url)));
                connect(reply, &QIODevice::readyRead, this, &NSISUpdater::slotWriteFile);
                connect(reply, &QNetworkReply::finished, this, &NSISUpdater::slotDownloadFinished);
                setDownloadState(Downloading);
                _file.reset(new QTemporaryFile);
                _file->setAutoRemove(true);
                _file->open();
            }
        }
    }
}
示例#2
0
void setConfiguration(ConfigFile config) {
	cout << "Using set-up for nTuple version " << config.nTupleVersion() << endl;
	cout << "Using set-up for center of mass energy = " << config.centerOfMassEnergy() << endl;
	cout << "Loading configuration..." << endl;
	cout << "Using config-file '" << config.configPath() << endl;
	cout << "Using Dataset info file:  '" << config.datasetInfoFile() << endl;
	cout << "Using pileup-file '" << config.PUFile() << endl;
	cout << "Using L7 jet energy corrections: " << config.bJetResoFile() << ", ";
	cout << config.lightJetResoFile() << endl;
	if (config.jesSystematic()!=0)
		cout << "Varying all the jets by " << config.jesSystematic() << " sigma(s) (JEC uncertainty)\n";
	long maxEvents(config.maxEvents());
	cout << "Maximal number of events to be processed: ";
	if (maxEvents > 0)
		cout << maxEvents << ".\n";
	else
		cout << "all available" << ".\n";
	cout << "Scaling to luminosity " << config.lumi() << "pb-1" << endl;
	if (config.useHitFit())
		cout << "Using HitFit.\n";

	config.loadIntoMemory();


	//@Deprecated: move to selections
	//jets
	Globals::jetAlgorithm = JetAlgorithm::PF2PAT;
	//electrons
	Globals::electronAlgorithm = ElectronAlgorithm::ParticleFlow;
	//muons
	Globals::muonAlgorithm = MuonAlgorithm::ParticleFlow;
	//mets
	Globals::metAlgorithm = METAlgorithm::patMETsPFlow;
}
示例#3
0
int FolderMan::setupFoldersMigration()
{
    ConfigFile cfg;
    QDir storageDir(cfg.configPath());
    _folderConfigPath = cfg.configPath() + QLatin1String("folders");

    qCInfo(lcFolderMan) << "Setup folders from " << _folderConfigPath << "(migration)";

    QDir dir(_folderConfigPath);
    //We need to include hidden files just in case the alias starts with '.'
    dir.setFilter(QDir::Files | QDir::Hidden);
    QStringList list = dir.entryList();

    // Normally there should be only one account when migrating.
    AccountState *accountState = AccountManager::instance()->accounts().value(0).data();
    foreach (const QString &alias, list) {
        Folder *f = setupFolderFromOldConfigFile(alias, accountState);
        if (f) {
            scheduleFolder(f);
            emit folderSyncStateChange(f);
        }
    }
示例#4
0
void setConfiguration(ConfigFile config) {
	// cout << "Using set-up for nTuple version " << config.nTupleVersion() << endl;
	cout << "Using set-up for center of mass energy = " << config.centerOfMassEnergy() << endl;
	cout << "Loading configuration..." << endl;
	cout << "Using config-file '" << config.configPath() << endl;
	cout << "Using Dataset info file:  '" << config.datasetInfoFile() << endl;
	cout << "Using pileup-file '" << config.PUFile() << endl;
	if (config.jesSystematic()!=0)
		cout << "Varying all the jets by " << config.jesSystematic() << " sigma(s) (JEC uncertainty)\n";
	long maxEvents(config.maxEvents());
	cout << "Maximum number of events to be processed: ";
	if (maxEvents > 0)
		cout << maxEvents << ".\n";
	else
		cout << "all available" << ".\n";
	cout << "Scaling to luminosity " << config.lumi() << "pb-1" << endl;
	if (config.useHitFit())
		cout << "Using HitFit.\n";

	cout << "Loading in to memory" << endl;
	config.loadIntoMemory();

}