mirror of
				https://github.com/subsurface/subsurface.git
				synced 2025-02-19 22:16:15 +00:00 
			
		
		
		
	desktop: use getDiveSelection to access selected dives
In the list view two functions were still manually collecting the selected dives. Use getDiveSelection() there as well. Careful: that means that the check for dives that are already outside of a trip now has to be done in the RemoveDivesFromTrip command. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
		
							parent
							
								
									369c5b0dc6
								
							
						
					
					
						commit
						16f86f2f65
					
				
					 2 changed files with 9 additions and 18 deletions
				
			
		|  | @ -740,8 +740,14 @@ void TripBase::undoit() | |||
| 	redoit(); | ||||
| } | ||||
| 
 | ||||
| RemoveDivesFromTrip::RemoveDivesFromTrip(const QVector<dive *> &divesToRemove) | ||||
| RemoveDivesFromTrip::RemoveDivesFromTrip(const QVector<dive *> &divesToRemoveIn) | ||||
| { | ||||
| 	// Filter out dives outside of trip. Note: This is in a separate loop to get the command-description right.
 | ||||
| 	QVector<dive *> divesToRemove; | ||||
| 	for (dive *d: divesToRemoveIn) { | ||||
| 		if (d->divetrip) | ||||
| 			divesToRemove.push_back(d); | ||||
| 	} | ||||
| 	setText(QStringLiteral("%1 [%2]").arg(Command::Base::tr("remove %n dive(s) from trip", "", divesToRemove.size())).arg(getListOfDives(divesToRemove))); | ||||
| 	divesToMove.divesToMove.reserve(divesToRemove.size()); | ||||
| 	for (dive *d: divesToRemove) { | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue