Code

Added missing (and very important) file.
[inkscape.git] / src / extension / param / float.cpp
index 1225648d6ce9886e2d69801feebe53259002c1c3..11e3a8d97c51b69d9e89a5f355454ff83d95610a 100644 (file)
@@ -13,9 +13,9 @@
 #include <gtkmm/box.h>
 #include <gtkmm/spinbutton.h>
 
-#include <xml/node.h>
-
-#include <extension/extension.h>
+#include "xml/node.h"
+#include "extension/extension.h"
+#include "preferences.h"
 #include "float.h"
 
 namespace Inkscape {
@@ -53,7 +53,8 @@ ParamFloat::ParamFloat (const gchar * name, const gchar * guitext, const gchar *
     }
 
     gchar * pref_name = this->pref_name();
-    _value = prefs_get_double_attribute(PREF_DIR, pref_name, _value);
+    Inkscape::Preferences *prefs = Inkscape::Preferences::get();
+    _value = prefs->getDouble(extension_pref_root + pref_name, _value);
     g_free(pref_name);
 
     // std::cout << "New Float::  value: " << _value << "  max: " << _max << "  min: " << _min << std::endl;
@@ -81,7 +82,8 @@ ParamFloat::set (float in, SPDocument * /*doc*/, Inkscape::XML::Node * /*node*/)
     if (_value < _min) _value = _min;
 
     gchar * prefname = this->pref_name();
-    prefs_set_double_attribute(PREF_DIR, prefname, _value);
+    Inkscape::Preferences *prefs = Inkscape::Preferences::get();
+    prefs->setDouble(extension_pref_root + prefname, _value);
     g_free(prefname);
 
     return _value;
@@ -108,7 +110,7 @@ public:
     /** \brief  Make the adjustment using an extension and the string
                 describing the parameter. */
     ParamFloatAdjustment (ParamFloat * param, SPDocument * doc, Inkscape::XML::Node * node, sigc::signal<void> * changeSignal) :
-            Gtk::Adjustment(0.0, param->min(), param->max(), 0.1), _pref(param), _doc(doc), _node(node), _changeSignal(changeSignal) {
+            Gtk::Adjustment(0.0, param->min(), param->max(), 0.1, 0), _pref(param), _doc(doc), _node(node), _changeSignal(changeSignal) {
         this->set_value(_pref->get(NULL, NULL) /* \todo fix */);
         this->signal_value_changed().connect(sigc::mem_fun(this, &ParamFloatAdjustment::val_changed));
         return;