X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=synfig-studio%2Ftrunk%2Fsrc%2Fgtkmm%2Fdockdialog.cpp;h=348224909cc1ff0d67ad49b58ceea73c5d3d5701;hb=4f7ed97f65e0e42ebec5fa0abe76bc2c9bd6c280;hp=312dfa456dfecc77692051acc8e367056c32055a;hpb=8970a697a18b4d9a1f0784681cc1d8c512ec1e71;p=synfig.git diff --git a/synfig-studio/trunk/src/gtkmm/dockdialog.cpp b/synfig-studio/trunk/src/gtkmm/dockdialog.cpp index 312dfa4..3482249 100644 --- a/synfig-studio/trunk/src/gtkmm/dockdialog.cpp +++ b/synfig-studio/trunk/src/gtkmm/dockdialog.cpp @@ -6,6 +6,7 @@ ** ** \legal ** Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley +** Copyright (c) 2007 Chris Moore ** ** This package is free software; you can redistribute it and/or ** modify it under the terms of the GNU General Public License as @@ -149,7 +150,7 @@ DockDialog::~DockDialog() { dock_book_list.front()->clear(); - // UGLY HACK + //! \fixme: UGLY HACK // The following line really should be uncommented, // but it causes crashes. Without it, a small // memory hole is created--but at least it doesn't crash @@ -158,8 +159,14 @@ DockDialog::~DockDialog() // Oddly enough, the following line should // theoreticly do the same thing after this // class is destroyed, but it doesn't seem to - // caues a crash. - manage(dock_book_list.front()); + // cause a crash. It does, however, trigger this warning: + // + // A floating object was finalized. This means that someone + // called g_object_unref() on an object that had only a + // floating reference; the initial floating reference is not + // owned by anyone and must be removed with g_object_ref_sink(). + // + // manage(dock_book_list.front()); } // Remove us from the dock manager @@ -329,7 +336,7 @@ DockDialog::refresh() //prepend_button->show(); //append_button->show(); - pannels_.clear(); + panels_.clear(); if(dock_book_list.size()==1) { @@ -339,11 +346,11 @@ DockDialog::refresh() { Gtk::Paned* parent(manage(is_horizontal?(Gtk::Paned*)new Gtk::HPaned:(Gtk::Paned*)new Gtk::VPaned)); - pannels_.push_back(parent); + panels_.push_back(parent); - if(pannels_.size()<=dock_book_sizes_.size()) - pannels_.back()->set_position(dock_book_sizes_[pannels_.size()-1]); - pannels_.back()->property_position().signal_changed().connect( + if(panels_.size()<=dock_book_sizes_.size()) + panels_.back()->set_position(dock_book_sizes_[panels_.size()-1]); + panels_.back()->property_position().signal_changed().connect( sigc::mem_fun(*this,&DockDialog::rebuild_sizes) ); //parent->show(); @@ -356,11 +363,11 @@ DockDialog::refresh() for(next=dock_book_list.begin(),next++,iter=next++;next!=dock_book_list.end();iter=next++) { Gtk::Paned* current(manage(is_horizontal?(Gtk::Paned*)new Gtk::HPaned:(Gtk::Paned*)new Gtk::VPaned)); - pannels_.push_back(current); + panels_.push_back(current); - if(pannels_.size()<=dock_book_sizes_.size()) - pannels_.back()->set_position(dock_book_sizes_[pannels_.size()-1]); - pannels_.back()->property_position().signal_changed().connect( + if(panels_.size()<=dock_book_sizes_.size()) + panels_.back()->set_position(dock_book_sizes_[panels_.size()-1]); + panels_.back()->property_position().signal_changed().connect( sigc::mem_fun(*this,&DockDialog::rebuild_sizes) ); @@ -388,9 +395,9 @@ DockDialog::rebuild_sizes() { unsigned int i=0; dock_book_sizes_.clear(); - for(i=0;iget_position()); + dock_book_sizes_.push_back(panels_[i]->get_position()); } } @@ -398,9 +405,9 @@ void DockDialog::set_dock_book_sizes(const std::vector& new_sizes) { unsigned int i=0; - for(i=0;iset_position(new_sizes[i]); + panels_[i]->set_position(new_sizes[i]); } dock_book_sizes_=new_sizes; //rebuild_sizes();