mirror of
				https://github.com/SoftFever/OrcaSlicer.git
				synced 2025-10-31 04:31:15 -06:00 
			
		
		
		
	FIX: [STUDIO-2183] presets/filaments unorderd in BambuStudio.conf
Change-Id: I3a286c356cc23f970462e6f24d99b4b038e321e7
This commit is contained in:
		
							parent
							
								
									881e25e2a2
								
							
						
					
					
						commit
						d0f2f0b28d
					
				
					 2 changed files with 7 additions and 4 deletions
				
			
		|  | @ -462,8 +462,11 @@ std::string AppConfig::load() | |||
|                         for(auto& element: iter.value()) { | ||||
|                             if (idx == 0) | ||||
|                                 m_storage[it.key()]["filament"] = element; | ||||
|                             else | ||||
|                                 m_storage[it.key()]["filament_" + std::to_string(idx)] = element; | ||||
|                             else { | ||||
|                                 auto n = std::to_string(idx); | ||||
|                                 if (n.length() == 1) n = "0" + n; | ||||
|                                 m_storage[it.key()]["filament_" + n] = element; | ||||
|                             } | ||||
|                             idx++; | ||||
|                         } | ||||
|                     } else { | ||||
|  |  | |||
|  | @ -1293,7 +1293,7 @@ void PresetBundle::load_selections(AppConfig &config, const PresetPreferences& p | |||
|     this->filament_presets = { filaments.get_selected_preset_name() }; | ||||
|     for (unsigned int i = 1; i < 1000; ++ i) { | ||||
|         char name[64]; | ||||
|         sprintf(name, "filament_%u", i); | ||||
|         sprintf(name, "filament_%02u", i); | ||||
|         if (! config.has("presets", name)) | ||||
|             break; | ||||
|         this->filament_presets.emplace_back(remove_ini_suffix(config.get("presets", name))); | ||||
|  | @ -1371,7 +1371,7 @@ void PresetBundle::export_selections(AppConfig &config) | |||
|     config.set("presets", PRESET_FILAMENT_NAME,     filament_presets.front()); | ||||
|     for (unsigned i = 1; i < filament_presets.size(); ++i) { | ||||
|         char name[64]; | ||||
|         sprintf(name, "filament_%u", i); | ||||
|         sprintf(name, "filament_%02u", i); | ||||
|         config.set("presets", name, filament_presets[i]); | ||||
|     } | ||||
|     CNumericLocalesSetter locales_setter; | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 chunmao.guo
						chunmao.guo