mirror of
				https://github.com/subsurface/subsurface.git
				synced 2025-02-19 22:16:15 +00:00 
			
		
		
		
	DiveComponentSelection: use current_dive instead of displayed_dive
This should have been converted a long time ago. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
		
							parent
							
								
									7a443423bc
								
							
						
					
					
						commit
						5febb534b8
					
				
					 1 changed files with 16 additions and 16 deletions
				
			
		|  | @ -440,7 +440,7 @@ DiveComponentSelection::DiveComponentSelection(QWidget *parent, struct dive *tar | ||||||
| 
 | 
 | ||||||
| void DiveComponentSelection::buttonClicked(QAbstractButton *button) | void DiveComponentSelection::buttonClicked(QAbstractButton *button) | ||||||
| { | { | ||||||
| 	if (ui.buttonBox->buttonRole(button) == QDialogButtonBox::AcceptRole) { | 	if (current_dive && ui.buttonBox->buttonRole(button) == QDialogButtonBox::AcceptRole) { | ||||||
| 		COMPONENT_FROM_UI(divesite); | 		COMPONENT_FROM_UI(divesite); | ||||||
| 		COMPONENT_FROM_UI(divemaster); | 		COMPONENT_FROM_UI(divemaster); | ||||||
| 		COMPONENT_FROM_UI(buddy); | 		COMPONENT_FROM_UI(buddy); | ||||||
|  | @ -451,28 +451,28 @@ void DiveComponentSelection::buttonClicked(QAbstractButton *button) | ||||||
| 		COMPONENT_FROM_UI(tags); | 		COMPONENT_FROM_UI(tags); | ||||||
| 		COMPONENT_FROM_UI(cylinders); | 		COMPONENT_FROM_UI(cylinders); | ||||||
| 		COMPONENT_FROM_UI(weights); | 		COMPONENT_FROM_UI(weights); | ||||||
| 		selective_copy_dive(&displayed_dive, targetDive, *what, true); | 		selective_copy_dive(current_dive, targetDive, *what, true); | ||||||
| 		QClipboard *clipboard = QApplication::clipboard(); | 		QClipboard *clipboard = QApplication::clipboard(); | ||||||
| 		QTextStream text; | 		QTextStream text; | ||||||
| 		QString cliptext; | 		QString cliptext; | ||||||
| 		text.setString(&cliptext); | 		text.setString(&cliptext); | ||||||
| 		if (what->divesite && displayed_dive.dive_site) | 		if (what->divesite && current_dive->dive_site) | ||||||
| 			text << tr("Dive site: ") << displayed_dive.dive_site->name << "\n"; | 			text << tr("Dive site: ") << current_dive->dive_site->name << "\n"; | ||||||
| 		if (what->divemaster) | 		if (what->divemaster) | ||||||
| 			text << tr("Dive master: ") << displayed_dive.divemaster << "\n"; | 			text << tr("Dive master: ") << current_dive->divemaster << "\n"; | ||||||
| 		if (what->buddy) | 		if (what->buddy) | ||||||
| 			text << tr("Buddy: ") << displayed_dive.buddy << "\n"; | 			text << tr("Buddy: ") << current_dive->buddy << "\n"; | ||||||
| 		if (what->rating) | 		if (what->rating) | ||||||
| 			text << tr("Rating: ") + QString("*").repeated(displayed_dive.rating) << "\n"; | 			text << tr("Rating: ") + QString("*").repeated(current_dive->rating) << "\n"; | ||||||
| 		if (what->visibility) | 		if (what->visibility) | ||||||
| 			text << tr("Visibility: ") + QString("*").repeated(displayed_dive.visibility) << "\n"; | 			text << tr("Visibility: ") + QString("*").repeated(current_dive->visibility) << "\n"; | ||||||
| 		if (what->notes) | 		if (what->notes) | ||||||
| 			text << tr("Notes:\n") << displayed_dive.notes << "\n"; | 			text << tr("Notes:\n") << current_dive->notes << "\n"; | ||||||
| 		if (what->suit) | 		if (what->suit) | ||||||
| 			text << tr("Suit: ") << displayed_dive.suit << "\n"; | 			text << tr("Suit: ") << current_dive->suit << "\n"; | ||||||
| 		if (what-> tags) { | 		if (what-> tags) { | ||||||
| 			text << tr("Tags: "); | 			text << tr("Tags: "); | ||||||
| 			tag_entry *entry = displayed_dive.tag_list; | 			tag_entry *entry = current_dive->tag_list; | ||||||
| 			while (entry) { | 			while (entry) { | ||||||
| 				text << entry->tag->name << " "; | 				text << entry->tag->name << " "; | ||||||
| 				entry = entry->next; | 				entry = entry->next; | ||||||
|  | @ -482,16 +482,16 @@ void DiveComponentSelection::buttonClicked(QAbstractButton *button) | ||||||
| 		if (what->cylinders) { | 		if (what->cylinders) { | ||||||
| 			int cyl; | 			int cyl; | ||||||
| 			text << tr("Cylinders:\n"); | 			text << tr("Cylinders:\n"); | ||||||
| 			for (cyl = 0; cyl < displayed_dive.cylinders.nr; cyl++) { | 			for (cyl = 0; cyl < current_dive->cylinders.nr; cyl++) { | ||||||
| 				if (is_cylinder_used(&displayed_dive, cyl)) | 				if (is_cylinder_used(current_dive, cyl)) | ||||||
| 					text << get_cylinder(&displayed_dive, cyl)->type.description << " " << gasname(get_cylinder(&displayed_dive, cyl)->gasmix) << "\n"; | 					text << get_cylinder(current_dive, cyl)->type.description << " " << gasname(get_cylinder(current_dive, cyl)->gasmix) << "\n"; | ||||||
| 			} | 			} | ||||||
| 		} | 		} | ||||||
| 		if (what->weights) { | 		if (what->weights) { | ||||||
| 			int w; | 			int w; | ||||||
| 			text << tr("Weights:\n"); | 			text << tr("Weights:\n"); | ||||||
| 			for (w = 0; w < displayed_dive.weightsystems.nr; w++) { | 			for (w = 0; w < current_dive->weightsystems.nr; w++) { | ||||||
| 				weightsystem_t ws = displayed_dive.weightsystems.weightsystems[w]; | 				weightsystem_t ws = current_dive->weightsystems.weightsystems[w]; | ||||||
| 				text << ws.description << ws.weight.grams / 1000 << "kg\n"; | 				text << ws.description << ws.weight.grams / 1000 << "kg\n"; | ||||||
| 			} | 			} | ||||||
| 		} | 		} | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue