diff options
| author | Kris De Gussem <kris.degussem@gmail.com> | 2011-12-15 23:39:15 +0000 |
|---|---|---|
| committer | Kris <Kris.De.Gussem@hotmail.com> | 2011-12-15 23:39:15 +0000 |
| commit | 75145ce1349a9508b1d3688b215ec334abaefdda (patch) | |
| tree | e6c31142d0318979d0c666a3a47adc7656c1f5ee /src/widgets | |
| parent | credits update (diff) | |
| download | inkscape-75145ce1349a9508b1d3688b215ec334abaefdda.tar.gz inkscape-75145ce1349a9508b1d3688b215ec334abaefdda.zip | |
- Dropped deprecated sp_window_new
- quick and dirty memory leak fix for item properties window
(bzr r10766.1.5)
Diffstat (limited to 'src/widgets')
| -rw-r--r-- | src/widgets/sp-attribute-widget.cpp | 49 | ||||
| -rw-r--r-- | src/widgets/sp-attribute-widget.h | 11 |
2 files changed, 23 insertions, 37 deletions
diff --git a/src/widgets/sp-attribute-widget.cpp b/src/widgets/sp-attribute-widget.cpp index 8cc521449..1943eef86 100644 --- a/src/widgets/sp-attribute-widget.cpp +++ b/src/widgets/sp-attribute-widget.cpp @@ -24,16 +24,16 @@ using Inkscape::DocumentUndo; static void sp_attribute_widget_object_modified ( SPObject *object, guint flags, SPAttributeWidget *spaw ); -static void sp_attribute_widget_object_release ( SPObject *object, - SPAttributeWidget *spaw ); +// static void sp_attribute_widget_object_release ( SPObject *object, + // SPAttributeWidget *spaw ); SPAttributeWidget::SPAttributeWidget () : blocked(0), hasobj(0), _attribute(), - modified_connection(), - release_connection() + modified_connection()//, + // release_connection() { src.object = NULL; } @@ -45,7 +45,7 @@ SPAttributeWidget::~SPAttributeWidget () if (src.object) { modified_connection.disconnect(); - release_connection.disconnect(); + // release_connection.disconnect(); src.object = NULL; } } @@ -63,7 +63,7 @@ void SPAttributeWidget::set_object(SPObject *object, const gchar *attribute) if (hasobj) { if (src.object) { modified_connection.disconnect(); - release_connection.disconnect(); + // release_connection.disconnect(); src.object = NULL; } } else { @@ -82,7 +82,7 @@ void SPAttributeWidget::set_object(SPObject *object, const gchar *attribute) src.object = object; modified_connection = object->connectModified(sigc::bind<2>(sigc::ptr_fun(&sp_attribute_widget_object_modified), this)); - release_connection = object->connectRelease(sigc::bind<1>(sigc::ptr_fun(&sp_attribute_widget_object_release), this)); + // release_connection = object->connectRelease(sigc::bind<1>(sigc::ptr_fun(&sp_attribute_widget_object_release), this)); _attribute = attribute; @@ -98,7 +98,7 @@ void SPAttributeWidget::set_repr(Inkscape::XML::Node *repr, const gchar *attribu if (hasobj) { if (src.object) { modified_connection.disconnect(); - release_connection.disconnect(); + // release_connection.disconnect(); src.object = NULL; } } else { @@ -177,17 +177,16 @@ static void sp_attribute_widget_object_modified ( SPObject */*object*/, } // end of sp_attribute_widget_object_modified() -static void sp_attribute_widget_object_release ( SPObject */*object*/, - SPAttributeWidget * spaw ) -{ - spaw->set_object (NULL, NULL); -} +//static void sp_attribute_widget_object_release ( SPObject */*object*/, +// SPAttributeWidget * spaw ) +//{ +// spaw->set_object (NULL, NULL); +//} /* SPAttributeTable */ static void sp_attribute_table_object_modified (SPObject *object, guint flags, SPAttributeTable *spaw); -//static void sp_attribute_table_object_release (SPObject *object, SPAttributeTable *spaw); static void sp_attribute_table_entry_changed (Gtk::Editable *editable, SPAttributeTable *spat); #define XPAD 4 @@ -199,21 +198,19 @@ SPAttributeTable::SPAttributeTable () : table(0), _attributes(), _entries(), - modified_connection()/*, - release_connection()*/ + modified_connection() { g_message("SPAttributeTable"); src.object = NULL; } -SPAttributeTable::SPAttributeTable (SPObject *object, std::vector<Glib::ustring> &labels, std::vector<Glib::ustring> &attributes, GtkContainer* parent) : +SPAttributeTable::SPAttributeTable (SPObject *object, std::vector<Glib::ustring> &labels, std::vector<Glib::ustring> &attributes, Gtk::Container *parent) : blocked(0), hasobj(0), table(0), _attributes(), _entries(), - modified_connection()/*, - release_connection()*/ + modified_connection() { g_message("SPAttributeTable"); src.object = NULL; @@ -268,7 +265,6 @@ g_message("destroy 3"); if (hasobj) { if (src.object) { modified_connection.disconnect(); - //release_connection.disconnect(); src.object = NULL; } } else { @@ -282,10 +278,10 @@ g_message("destroy 4"); void SPAttributeTable::set_object(SPObject *object, std::vector<Glib::ustring> &labels, std::vector<Glib::ustring> &attributes, - GtkContainer* parent) + Gtk::Container* parent) { g_message("set_object"); - g_return_if_fail (parent); + // g_return_if_fail (parent); g_return_if_fail (!object || SP_IS_OBJECT (object)); g_return_if_fail (!object || !labels.empty() || !attributes.empty()); g_return_if_fail (labels.size() == attributes.size()); @@ -302,13 +298,12 @@ g_message("2"); src.object = object; modified_connection = object->connectModified(sigc::bind<2>(sigc::ptr_fun(&sp_attribute_table_object_modified), this)); - //release_connection = object->connectRelease(sigc::bind<1>(sigc::ptr_fun(&sp_attribute_table_object_release), this)); /* Create table */ g_message("3a"); - table = new Gtk::Table (attributes.size(), 2, false); + table = Gtk::manage(new Gtk::Table (attributes.size(), 2, false)); g_message("3b"); - gtk_container_add (parent,(GtkWidget*)table->gobj()); + gtk_container_add (GTK_CONTAINER ((GtkWidget*) parent),(GtkWidget*)table->gobj());// g_message("3c"); /* Fill rows */ @@ -347,8 +342,6 @@ g_message("4b"); table->show (); blocked = false; } - - //set_sensitive ((src.object != NULL) ); g_message("5"); } @@ -410,8 +403,6 @@ g_message("set_repr"); table->show (); blocked = false; } - - //set_sensitive ((src.repr != NULL)); } diff --git a/src/widgets/sp-attribute-widget.h b/src/widgets/sp-attribute-widget.h index aac567987..d108aa827 100644 --- a/src/widgets/sp-attribute-widget.h +++ b/src/widgets/sp-attribute-widget.h @@ -17,8 +17,6 @@ #include <gtk/gtk.h> #include <gtkmm.h> -//#include <gtkmm/entry.h> -//#include <gtkmm/table.h> #include <glib.h> #include <stddef.h> #include <sigc++/connection.h> @@ -57,7 +55,7 @@ private: guint hasobj; Glib::ustring _attribute; sigc::connection modified_connection; - sigc::connection release_connection; + //sigc::connection release_connection; }; @@ -66,9 +64,9 @@ private: class SPAttributeTable : public Gtk::Widget { public: SPAttributeTable (); - SPAttributeTable (SPObject *object, std::vector<Glib::ustring> &labels, std::vector<Glib::ustring> &attributes, GtkContainer* parent); + SPAttributeTable (SPObject *object, std::vector<Glib::ustring> &labels, std::vector<Glib::ustring> &attributes, Gtk::Container* parent); ~SPAttributeTable (); - void set_object(SPObject *object, std::vector<Glib::ustring> &labels, std::vector<Glib::ustring> &attributes, GtkContainer* parent); + void set_object(SPObject *object, std::vector<Glib::ustring> &labels, std::vector<Glib::ustring> &attributes, Gtk::Container* parent); void set_repr(Inkscape::XML::Node *repr, std::vector<Glib::ustring> &labels, std::vector<Glib::ustring> &attributes, GtkContainer* parent); std::vector<Glib::ustring> get_attributes(void) {return _attributes;}; std::vector<Gtk::Widget *> get_entries(void) {return _entries;}; @@ -80,13 +78,10 @@ public: guint hasobj; private: -// GtkVBox vbox; Gtk::Table *table; -// Gtk::Container *_parent; std::vector<Glib::ustring> _attributes; std::vector<Gtk::Widget *> _entries; sigc::connection modified_connection; - //sigc::connection release_connection; void clear(void); }; |
