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
|
@ -41,13 +41,12 @@ void EditTripBase::redo()
|
|||
// ***** Location *****
|
||||
void EditTripLocation::set(dive_trip *t, const QString &s) const
|
||||
{
|
||||
free(t->location);
|
||||
t->location = copy_qstring(s);
|
||||
t->location = s.toStdString();
|
||||
}
|
||||
|
||||
QString EditTripLocation::data(dive_trip *t) const
|
||||
{
|
||||
return QString(t->location);
|
||||
return QString::fromStdString(t->location);
|
||||
}
|
||||
|
||||
QString EditTripLocation::fieldName() const
|
||||
|
@ -63,13 +62,12 @@ TripField EditTripLocation::fieldId() const
|
|||
// ***** Notes *****
|
||||
void EditTripNotes::set(dive_trip *t, const QString &s) const
|
||||
{
|
||||
free(t->notes);
|
||||
t->notes = copy_qstring(s);
|
||||
t->notes = s.toStdString();
|
||||
}
|
||||
|
||||
QString EditTripNotes::data(dive_trip *t) const
|
||||
{
|
||||
return QString(t->notes);
|
||||
return QString::fromStdString(t->notes);
|
||||
}
|
||||
|
||||
QString EditTripNotes::fieldName() const
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue