From 37e5d6dc66d7b98ce6716398f81eb5b0a89bded2 Mon Sep 17 00:00:00 2001 From: Patrick Storz Date: Thu, 8 Aug 2019 00:50:41 +0200 Subject: Simplify pref_name() function --- src/extension/prefdialog/parameter-int.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'src/extension/prefdialog/parameter-int.cpp') diff --git a/src/extension/prefdialog/parameter-int.cpp b/src/extension/prefdialog/parameter-int.cpp index 2475a6785..1d768ca00 100644 --- a/src/extension/prefdialog/parameter-int.cpp +++ b/src/extension/prefdialog/parameter-int.cpp @@ -37,10 +37,8 @@ ParamInt::ParamInt(Inkscape::XML::Node *xml, Inkscape::Extension::Extension *ext } } - char *pref_name = this->pref_name(); Inkscape::Preferences *prefs = Inkscape::Preferences::get(); - _value = prefs->getInt(extension_pref_root + pref_name, _value); - g_free(pref_name); + _value = prefs->getInt(pref_name(), _value); // parse and apply limits const char *min = xml->attribute("min"); @@ -89,10 +87,8 @@ int ParamInt::set(int in) _value = _min; } - char *pref_name = this->pref_name(); Inkscape::Preferences *prefs = Inkscape::Preferences::get(); - prefs->setInt(extension_pref_root + pref_name, _value); - g_free(pref_name); + prefs->setInt(pref_name(), _value); return _value; } -- cgit v1.2.3