diff options
| author | Kris De Gussem <kris.degussem@gmail.com> | 2011-11-13 19:18:47 +0000 |
|---|---|---|
| committer | Kris <Kris.De.Gussem@hotmail.com> | 2011-11-13 19:18:47 +0000 |
| commit | 354f364c1ce5428453a8601b31c91b910b7b8ef3 (patch) | |
| tree | 0fedb85cf38f3fd0f41e15d66e2cb8266f5769c1 /src/ui/widget | |
| parent | cppcheck: initialization / warning cleanup (diff) | |
| download | inkscape-354f364c1ce5428453a8601b31c91b910b7b8ef3.tar.gz inkscape-354f364c1ce5428453a8601b31c91b910b7b8ef3.zip | |
various: warnings and initalization
(bzr r10737)
Diffstat (limited to 'src/ui/widget')
| -rw-r--r-- | src/ui/widget/icon-widget.cpp | 17 | ||||
| -rw-r--r-- | src/ui/widget/licensor.cpp | 9 | ||||
| -rw-r--r-- | src/ui/widget/tolerance-slider.cpp | 21 | ||||
| -rw-r--r-- | src/ui/widget/tolerance-slider.h | 14 |
4 files changed, 33 insertions, 28 deletions
diff --git a/src/ui/widget/icon-widget.cpp b/src/ui/widget/icon-widget.cpp index 1bc4ad308..b671e8812 100644 --- a/src/ui/widget/icon-widget.cpp +++ b/src/ui/widget/icon-widget.cpp @@ -19,13 +19,16 @@ namespace Inkscape { namespace UI { namespace Widget { -IconWidget::IconWidget() +IconWidget::IconWidget() : + _pb(0), + _size(0), + _do_bitmap_icons(false) { - _pb = NULL; - _size = 0; } -IconWidget::IconWidget(int unsigned size, int unsigned scale, gchar const *name) +IconWidget::IconWidget(int unsigned size, int unsigned scale, gchar const *name) : + _pb(0), + _do_bitmap_icons(false) { _size = std::max((int unsigned)128, std::min(size, (int unsigned)1)); @@ -35,7 +38,7 @@ IconWidget::IconWidget(int unsigned size, int unsigned scale, gchar const *name) if (pixels == NULL) { g_warning("Couldn't find matching icon for %s - has this application been installed?", name); - _pb = NULL; + //_pb = NULL; } else { /* TODO _pb = gdk_pixbuf_new_from_data(pixels, GDK_COLORSPACE_RGB, @@ -45,7 +48,9 @@ IconWidget::IconWidget(int unsigned size, int unsigned scale, gchar const *name) } } -IconWidget::IconWidget(int unsigned size, guchar const */*px*/) +IconWidget::IconWidget(int unsigned size, guchar const */*px*/) : + _pb(0), + _do_bitmap_icons(false) { _size = std::max((int unsigned)128, std::min(size, (int unsigned)1)); diff --git a/src/ui/widget/licensor.cpp b/src/ui/widget/licensor.cpp index 9cb904c9f..7caf732a4 100644 --- a/src/ui/widget/licensor.cpp +++ b/src/ui/widget/licensor.cpp @@ -57,8 +57,7 @@ LicenseItem::LicenseItem (struct rdf_license_t const* license, EntityEntry* enti } /// \pre it is assumed that the license URI entry is a Gtk::Entry -void -LicenseItem::on_toggled() +void LicenseItem::on_toggled() { if (_wr.isUpdating()) return; @@ -83,8 +82,7 @@ Licensor::~Licensor() if (_eentry) delete _eentry; } -void -Licensor::init (Gtk::Tooltips& tt, Registry& wr) +void Licensor::init (Gtk::Tooltips& tt, Registry& wr) { /* add license-specific metadata entry areas */ rdf_work_entity_t* entity = rdf_find_entity ( "license_uri" ); @@ -118,8 +116,7 @@ Licensor::init (Gtk::Tooltips& tt, Registry& wr) show_all_children(); } -void -Licensor::update (SPDocument *doc) +void Licensor::update (SPDocument *doc) { /* identify the license info */ struct rdf_license_t * license = rdf_get_license (doc); diff --git a/src/ui/widget/tolerance-slider.cpp b/src/ui/widget/tolerance-slider.cpp index 40f58f0ae..aa749fb39 100644 --- a/src/ui/widget/tolerance-slider.cpp +++ b/src/ui/widget/tolerance-slider.cpp @@ -40,9 +40,10 @@ namespace Widget { //==================================================== -ToleranceSlider::ToleranceSlider() +ToleranceSlider::ToleranceSlider(const Glib::ustring& label1, const Glib::ustring& label2, const Glib::ustring& label3, const Glib::ustring& tip1, const Glib::ustring& tip2, const Glib::ustring& tip3, const Glib::ustring& key, Registry& wr) : _vbox(0) { + init(label1, label2, label3, tip1, tip2, tip3, key, wr); } ToleranceSlider::~ToleranceSlider() @@ -51,8 +52,7 @@ ToleranceSlider::~ToleranceSlider() _scale_changed_connection.disconnect(); } -void -ToleranceSlider::init (const Glib::ustring& label1, const Glib::ustring& label2, const Glib::ustring& label3, const Glib::ustring& tip1, const Glib::ustring& tip2, const Glib::ustring& tip3, const Glib::ustring& key, Registry& wr) +void ToleranceSlider::init (const Glib::ustring& label1, const Glib::ustring& label2, const Glib::ustring& label3, const Glib::ustring& tip1, const Glib::ustring& tip2, const Glib::ustring& tip3, const Glib::ustring& key, Registry& wr) { // hbox = label + slider // @@ -109,8 +109,7 @@ ToleranceSlider::init (const Glib::ustring& label1, const Glib::ustring& label2, _vbox->show_all_children(); } -void -ToleranceSlider::setValue (double val) +void ToleranceSlider::setValue (double val) { Gtk::Adjustment *adj = _hscale->get_adjustment(); @@ -135,21 +134,18 @@ ToleranceSlider::setValue (double val) _hbox->show_all(); } -void -ToleranceSlider::setLimits (double theMin, double theMax) +void ToleranceSlider::setLimits (double theMin, double theMax) { _hscale->set_range (theMin, theMax); _hscale->get_adjustment()->set_step_increment (1); } -void -ToleranceSlider::on_scale_changed() +void ToleranceSlider::on_scale_changed() { update (_hscale->get_value()); } -void -ToleranceSlider::on_toggled() +void ToleranceSlider::on_toggled() { if (!_button2->get_active()) { @@ -168,8 +164,7 @@ ToleranceSlider::on_toggled() } } -void -ToleranceSlider::update (double val) +void ToleranceSlider::update (double val) { if (_wr->isUpdating()) return; diff --git a/src/ui/widget/tolerance-slider.h b/src/ui/widget/tolerance-slider.h index 0a9663bc3..6865ec769 100644 --- a/src/ui/widget/tolerance-slider.h +++ b/src/ui/widget/tolerance-slider.h @@ -28,9 +28,7 @@ class Registry; */ class ToleranceSlider { public: - ToleranceSlider(); - ~ToleranceSlider(); - void init (const Glib::ustring& label1, + ToleranceSlider(const Glib::ustring& label1, const Glib::ustring& label2, const Glib::ustring& label3, const Glib::ustring& tip1, @@ -38,9 +36,19 @@ public: const Glib::ustring& tip3, const Glib::ustring& key, Registry& wr); + ~ToleranceSlider(); void setValue (double); void setLimits (double, double); Gtk::VBox* _vbox; +private: + void init (const Glib::ustring& label1, + const Glib::ustring& label2, + const Glib::ustring& label3, + const Glib::ustring& tip1, + const Glib::ustring& tip2, + const Glib::ustring& tip3, + const Glib::ustring& key, + Registry& wr); protected: void on_scale_changed(); |
