mirror of
				https://github.com/ciphervance/supercell-wx.git
				synced 2025-10-31 06:40:05 +00:00 
			
		
		
		
	Add checks to prevent files being saved before being fully read.
This commit is contained in:
		
							parent
							
								
									f3c846f0b1
								
							
						
					
					
						commit
						bc79ed11a3
					
				
					 5 changed files with 31 additions and 1 deletions
				
			
		|  | @ -68,6 +68,8 @@ public: | |||
|    scwx::common::Coordinate                previousPosition_; | ||||
| 
 | ||||
|    QIcon starIcon_ {":/res/icons/font-awesome-6/star-solid.svg"}; | ||||
| 
 | ||||
|    bool presetsRead_ {false}; | ||||
| }; | ||||
| 
 | ||||
| RadarSiteModel::RadarSiteModel(QObject* parent) : | ||||
|  | @ -146,10 +148,15 @@ void RadarSiteModelImpl::ReadPresets() | |||
|          } | ||||
|       } | ||||
|    } | ||||
|    presetsRead_ = true; | ||||
| } | ||||
| 
 | ||||
| void RadarSiteModelImpl::WritePresets() | ||||
| { | ||||
|    if (!presetsRead_) | ||||
|    { | ||||
|       return; | ||||
|    } | ||||
|    logger_->info("Saving presets"); | ||||
| 
 | ||||
|    auto presetsJson = boost::json::value_from(presets_); | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 AdenKoperczak
						AdenKoperczak