mirror of
				https://github.com/subsurface/subsurface.git
				synced 2025-02-19 22:16:15 +00:00 
			
		
		
		
	core: turn dive-trip location and notes into std::string
Simpler memory management. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
		
							parent
							
								
									2fd226964c
								
							
						
					
					
						commit
						3ee41328f9
					
				
					 29 changed files with 157 additions and 179 deletions
				
			
		|  | @ -1369,17 +1369,17 @@ void QMLManager::commitChanges(QString diveId, QString number, QString date, QSt | |||
| void QMLManager::updateTripDetails(QString tripIdString, QString tripLocation, QString tripNotes) | ||||
| { | ||||
| 	int tripId = tripIdString.toInt(); | ||||
| 	dive_trip_t *trip = get_trip_by_uniq_id(tripId); | ||||
| 	dive_trip *trip = get_trip_by_uniq_id(tripId); | ||||
| 	if (!trip) { | ||||
| 		report_info("updateTripData: cannot find trip for tripId %s", qPrintable(tripIdString)); | ||||
| 		return; | ||||
| 	} | ||||
| 	bool changed = false; | ||||
| 	if (tripLocation != trip->location) { | ||||
| 	if (tripLocation != trip->location.c_str()) { | ||||
| 		changed = true; | ||||
| 		Command::editTripLocation(trip, tripLocation); | ||||
| 	} | ||||
| 	if (tripNotes != trip->notes) { | ||||
| 	if (tripNotes != trip->notes.c_str()) { | ||||
| 		changed = true; | ||||
| 		Command::editTripNotes(trip, tripNotes); | ||||
| 	} | ||||
|  | @ -1412,7 +1412,7 @@ void QMLManager::addTripForDive(int id) | |||
| 		return; | ||||
| 	} | ||||
| 	if (d->divetrip) { | ||||
| 		appendTextToLog(QString("Asked to create trip for dive %1 with id %2 but it's already part of a trip with location %3.").arg(d->number).arg(id).arg(d->divetrip->location)); | ||||
| 		appendTextToLog(QString("Asked to create trip for dive %1 with id %2 but it's already part of a trip with location %3.").arg(d->number).arg(id).arg(d->divetrip->location.c_str())); | ||||
| 		return; | ||||
| 	} | ||||
| 	QVector <dive *> dives; | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue