mirror of
				https://github.com/SoftFever/OrcaSlicer.git
				synced 2025-10-30 20:21:12 -06:00 
			
		
		
		
	Fixing AppConfig::reset(), calling reset() before load().
This fixes some issues when importing newer configuration over the current.
This commit is contained in:
		
							parent
							
								
									12756e7979
								
							
						
					
					
						commit
						41fa4a05f9
					
				
					 2 changed files with 7 additions and 4 deletions
				
			
		|  | @ -43,6 +43,10 @@ const std::string AppConfig::SECTION_MATERIALS = "sla_materials"; | |||
| void AppConfig::reset() | ||||
| { | ||||
|     m_storage.clear(); | ||||
|     m_vendors.clear(); | ||||
|     m_dirty = false; | ||||
|     m_orig_version = Semver::invalid(); | ||||
|     m_legacy_datadir = false; | ||||
|     set_defaults(); | ||||
| }; | ||||
| 
 | ||||
|  | @ -245,6 +249,8 @@ static bool verify_config_file_checksum(boost::nowide::ifstream &ifs) | |||
| 
 | ||||
| std::string AppConfig::load(const std::string &path) | ||||
| { | ||||
|     this->reset(); | ||||
| 
 | ||||
|     // 1) Read the complete config file into a boost::property_tree.
 | ||||
|     namespace pt = boost::property_tree; | ||||
|     pt::ptree tree; | ||||
|  |  | |||
|  | @ -22,10 +22,7 @@ public: | |||
| 	}; | ||||
| 
 | ||||
| 	explicit AppConfig(EAppMode mode) : | ||||
| 		m_dirty(false), | ||||
| 		m_orig_version(Semver::invalid()), | ||||
| 		m_mode(mode), | ||||
| 		m_legacy_datadir(false) | ||||
| 		m_mode(mode) | ||||
| 	{ | ||||
| 		this->reset(); | ||||
| 	} | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Vojtech Bubnik
						Vojtech Bubnik