mirror of
				https://github.com/ciphervance/supercell-wx.git
				synced 2025-10-31 00:30:05 +00:00 
			
		
		
		
	Don't add duplicate entries to the resource explorer
This commit is contained in:
		
							parent
							
								
									df2474c383
								
							
						
					
					
						commit
						0c8047b1f4
					
				
					 1 changed files with 10 additions and 4 deletions
				
			
		|  | @ -105,10 +105,16 @@ RadarProductModelImpl::RadarProductModelImpl(RadarProductModel* self) : | |||
|                   } | ||||
|                } | ||||
| 
 | ||||
|                // Create leaf item for product time
 | ||||
|                model_->AppendRow(productItem, | ||||
|                                  new TreeItem {QString::fromStdString( | ||||
|                                     util::TimeString(latestTime))}); | ||||
|                // Find existing time item (e.g., 2023-04-10 10:11:12)
 | ||||
|                const QString timeString = | ||||
|                   QString::fromStdString(util::TimeString(latestTime)); | ||||
|                TreeItem* timeItem = productItem->FindChild(0, timeString); | ||||
| 
 | ||||
|                if (timeItem == nullptr) | ||||
|                { | ||||
|                   // Create leaf item for product time
 | ||||
|                   model_->AppendRow(productItem, new TreeItem {timeString}); | ||||
|                } | ||||
|             }, | ||||
|             Qt::QueuedConnection); | ||||
|       }); | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Dan Paulat
						Dan Paulat