From 55e42373066ade9ad2e1a51adf27a0a28cb0d02a Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Sat, 5 Sep 2020 13:30:04 +0200 Subject: cleanup: copy string in taxonomy_set_[country|category] These functions were taking a const char *, yet taking ownership of the value. Moreover, taking ownership of strings is rather unusual in C-style APIs. Let's copy the string instead. Signed-off-by: Berthold Stoeger --- commands/command_divesite.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'commands') diff --git a/commands/command_divesite.cpp b/commands/command_divesite.cpp index 6f558d408..39e10e840 100644 --- a/commands/command_divesite.cpp +++ b/commands/command_divesite.cpp @@ -268,7 +268,7 @@ bool EditDiveSiteCountry::workToBeDone() void EditDiveSiteCountry::redo() { QString old = taxonomy_get_country(&ds->taxonomy); - taxonomy_set_country(&ds->taxonomy, copy_qstring(value), taxonomy_origin::GEOMANUAL); + taxonomy_set_country(&ds->taxonomy, qPrintable(value), taxonomy_origin::GEOMANUAL); value = old; emit diveListNotifier.diveSiteChanged(ds, LocationInformationModel::TAXONOMY); // Inform frontend of changed dive site. } -- cgit v1.2.3-70-g09d2