Stop copying selected partition object in Manage Flags dialog (#750168)

When opening the Manage Flags dialog, creation of the dialog object was
creating a copy of the selected partition object.  If this was an
extended partition it also included recursively constructing the
contained logical partitions too.

Instead, replace the partition object in the DialogManageFlags class
with a reference to it.

Bug 750168 - Reduce the amount of copying of partition objects
This commit is contained in:
Mike Fleetwood 2015-05-24 12:33:34 +01:00 committed by Curtis Gedak
parent efaea94301
commit ece945685c
2 changed files with 3 additions and 3 deletions

View File

@ -60,7 +60,7 @@ private:
} ;
treeview_flags_Columns treeview_flags_columns ;
Partition partition ;
const Partition & partition; // (Alias to element in Win_GParted::display_partitions[] vector).
std::map<Glib::ustring, bool> flag_info ;
};

View File

@ -23,7 +23,8 @@
namespace GParted
{
DialogManageFlags::DialogManageFlags( const Partition & partition, std::map<Glib::ustring, bool> flag_info )
DialogManageFlags::DialogManageFlags( const Partition & partition, std::map<Glib::ustring, bool> flag_info ) :
partition( partition )
{
any_change = false ;
@ -51,7 +52,6 @@ DialogManageFlags::DialogManageFlags( const Partition & partition, std::map<Glib
treeview_flags .set_size_request( 300, -1 ) ;
get_vbox() ->pack_start( treeview_flags, Gtk::PACK_SHRINK ) ;
this ->partition = partition ;
this ->flag_info = flag_info ;
load_treeview() ;