Read project/version-info from tariff-config ...
... if available
This commit is contained in:
		@@ -88,13 +88,26 @@ bool Configuration::ParseJson(Configuration* cfg, const char* json)
 | 
			
		||||
			const char* mb_name = i->name.GetString();
 | 
			
		||||
            if (mb_name == NULL) continue;
 | 
			
		||||
 | 
			
		||||
            // if (!document[mb_name].IsArray()) {
 | 
			
		||||
                std::string const _mb_name(mb_name);
 | 
			
		||||
                if (_mb_name == "version" || _mb_name == "project" ||
 | 
			
		||||
                    _mb_name == "zone" || _mb_name == "info") {
 | 
			
		||||
            if (document[mb_name].IsString()) {
 | 
			
		||||
                QString const _mb_name(mb_name);
 | 
			
		||||
                if (_mb_name.startsWith("Project", Qt::CaseInsensitive)) {
 | 
			
		||||
                    cfg->project.project = document[mb_name].GetString();
 | 
			
		||||
                    continue;
 | 
			
		||||
                 }
 | 
			
		||||
                if (_mb_name.startsWith("Version", Qt::CaseInsensitive)) {
 | 
			
		||||
                    cfg->project.version = document[mb_name].GetString();
 | 
			
		||||
                    continue;
 | 
			
		||||
                }
 | 
			
		||||
            // }
 | 
			
		||||
                if (_mb_name.startsWith("Info", Qt::CaseInsensitive)) {
 | 
			
		||||
                    cfg->project.info = document[mb_name].GetString();
 | 
			
		||||
                    continue;
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            // ... everything else should be an array
 | 
			
		||||
            if (!document[mb_name].IsArray()) {
 | 
			
		||||
                continue;
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
			//printf(" -%s\n", mb_name);
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user