subsurface/desktop-widgets/preferences
Berthold Stoeger 4fb01dd766 Fix ownership issues in preferences code
Each preferences object owns its string members. In three cases, pointers
were copied instead of strings, leading to (in the best case) dangling
pointers if the user edited values:
1) In the GET_TXT macro in core/prefs-macros.h
2) In the PreferencesDialog::defaultsRequested() method
3) In main() of the mobile version

This patch fixes these issues, by using copy_string() or copy_prefs()
as appropriate.

The only reason that the old code didn't crash regularly is that the
default_prefs object was only used at startup and defaultsRequested()
is (at the moment?) dead code.

This patch also aligns the backslashes in core/pref.h and fixes a typo.
The declaration of copy_prefs() is moved to the core/prefs.h header.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2017-11-25 07:41:09 -08:00
..
abstractpreferenceswidget.cpp Add SPDX header to desktop widgets 2017-04-29 13:32:55 -07:00
abstractpreferenceswidget.h Add SPDX header to desktop widgets 2017-04-29 13:32:55 -07:00
CMakeLists.txt Don't rely on CMAKE_AUTOUIC 2015-11-09 18:00:56 -08:00
preferences_defaults.cpp Correct, cleanup, translate and unify file filters 2017-11-04 14:27:00 +01:00
preferences_defaults.h Add SPDX header to desktop widgets 2017-04-29 13:32:55 -07:00
preferences_defaults.ui Restore proper spin-box/slider behavior for animation setting. 2015-11-15 22:22:34 -08:00
preferences_georeference.cpp Remove three obsolete preferences options for geocoding 2017-10-29 11:07:52 -07:00
preferences_georeference.h Add SPDX header to desktop widgets 2017-04-29 13:32:55 -07:00
preferences_graph.cpp Typo: modp02 -> modpO2 2017-11-12 15:11:30 +01:00
preferences_graph.h Add SPDX header to desktop widgets 2017-04-29 13:32:55 -07:00
preferences_graph.ui Planner and profile limit minimum GFlow to 10 and minimum GFhigh to 40 2017-11-13 11:53:55 +01:00
preferences_language.cpp preferences: support a pre-defined list of time formats 2017-11-10 09:21:47 -08:00
preferences_language.h preferences: support a pre-defined list of date formats 2017-11-10 09:21:47 -08:00
preferences_network.cpp Fix typo: successfull -> successful and succesfully -> successfully 2017-11-20 10:01:15 +01:00
preferences_network.h Fix typo: successfull -> successful and succesfully -> successfully 2017-11-20 10:01:15 +01:00
preferences_network.ui Re-add the signal connections 2015-11-04 17:24:31 -08:00
preferences_units.cpp Display units in dive list table based on prefs option 2017-10-09 11:49:29 +03:00
preferences_units.h Add SPDX header to desktop widgets 2017-04-29 13:32:55 -07:00
preferences_units.ui Preferences units dialog: Tab order and silence warnings 2017-10-09 11:49:29 +03:00
preferencesdialog.cpp Fix ownership issues in preferences code 2017-11-25 07:41:09 -08:00
preferencesdialog.h Add SPDX header to desktop widgets 2017-04-29 13:32:55 -07:00
prefs_georeference.ui Remove three obsolete preferences options for geocoding 2017-10-29 11:07:52 -07:00
prefs_language.ui preferences: support a pre-defined list of time formats 2017-11-10 09:21:47 -08:00