Commit Graph

18 Commits

Author SHA1 Message Date
Mike Fleetwood acd5d7e580 Store pointers to partition objects in TreeView_Details (#750168)
This stops copying of each displayed partition object into the
TreeView_Details class.

It also stops copy constructing lots of partition objects when just
clicking on a partition in the disk graphic.  The disk graphic needs to
inform the main GUI and then the partition list which partition has been
selected.  The call sequence goes like:

    DrawingAreaVisualDisk::on_button_press_event(event)
      Win_GParted::on_partition_selected(partition_ptr, src_is_treeview)
        TreeView_Detail::set_selected(partition_ptr)
          TreeView_Detail::set_selected(rows, partition_ptr,
                                        inside_extended)

Relevant source and highlighted comparison line:

   140  bool TreeView_Detail::set_selected( Gtk::TreeModel::Children rows,
   141                                      const Partition * partition_ptr, bool inside_extended )
   142  {
   143          for ( unsigned int t = 0 ; t < rows .size() ; t++ )
   144          {
>> 145                  if ( static_cast<Partition>( rows[t][treeview_detail_columns.partition] ) == *partition_ptr )
   146                  {
   147                          if ( inside_extended )
   148                                  expand_all() ;
   149
   150                          set_cursor( static_cast<Gtk::TreePath>( rows[ t ] ) ) ;
   151                          return true ;
   152                  }
   153
   154                  if ( set_selected( rows[t].children(), partition_ptr, true ) )
   155                          return true ;
   156          }
   157
   158          return false ;
   159  }

Then in this function the partition selected in the disk graphic
(partition_ptr parameter) is compared in turn with each partition object
stored in the Gtk::TreeView model to find the matching one to mark it as
selected.  This mere act of accessing the partition object stored in a
row of the Gtk::TreeView model causes it to be copy constructed.  So
clicking on the 5th partition in the disk graphic will copy construct
the first 5 partition objects just to do a compare to find the matching
one.

This is because it is not possible to get a reference from a
Gtk:TreeViewProxy in gtkmm.  Merely accessing a value in a Gtk::TreeView
model takes a copy of that value.

    Subject: get a reference from a Gtk::TreeValueProxy
    http://comments.gmane.org/gmane.comp.gnome.gtkmm/2217
    http://marc.info/?t=104400417500001&r=1&w=4

Bug 750168 - Reduce the amount of copying of partition objects
2015-06-10 10:43:14 -06:00
Mike Fleetwood c430acf52a Pass by pointer in the signal_partition_selected callbacks (#750168)
Change from passing a reference to the selected partition, to passing a
pointer to the selected partition in the signal_partition_selected
callbacks between the disk graphic, partition list and core GUI modules.

This is an enabler for the following patches.

Bug 750168 - Reduce the amount of copying of partition objects
2015-06-10 10:43:14 -06:00
Michael Zimmermann 1f5841b4ad Add support for GPT partition names (#741424)
Embedded devices (Android) use GPT partition names to identify
partitions, instead of file system labels.  Add support for viewing and
changing them.

As partition names are used to provide unique identification they are
never copied when copying the contents of one partition to another.

Note that GNU/Linux uses file system labels, UUIDs or device names for
identification during the boot process and afterwards so while partition
names can be used, they are optional and purely for user information.

Bug 741424 - Add support for GPT partition names
2015-02-01 10:08:23 -07:00
Daniel Mustieles 3861b9257b Replace obsolete FSF postal address in copyright notices (#721565)
This is part of parent bug:
    Bug #721455 - Obsolete info in license text on multiple modules

and GNOME Goal:
    https://wiki.gnome.org/Initiatives/GnomeGoals/Proposals

    * verify all source files to make sure they have a license and a
      copyright, and that both are up-to-date

Bug #721565 -  License text contains obsolete FSF postal address
2014-01-26 10:53:23 +00:00
Mike Fleetwood 2b51d87147 Make include guards unique (#539297)
Include guards need to be unique within GParted code and all included
library header files.
    http://en.wikipedia.org/wiki/Include_guard#Difficulties

Use this model for all include guards:
    #ifndef GPARTED_FILE_NAME_H
    #define GPARTED_FILE_NAME_H
    ...
    #endif /* GPARTED_FILE_NAME_H */

Closes Bug #539297 - Make include guards unique
2013-06-05 10:57:39 -06:00
Bart Hakvoort 600e990a6e trivial cleanups
* include/TreeView_Detail.h,
  src/TreeView_Detail.cc: trivial cleanups
2006-09-16 15:00:25 +00:00
Bart Hakvoort e3b4a7316b added support for reading volumelabels. Atm we only read ext2/3, but the
* added support for reading volumelabels. Atm we only read ext2/3, but
  the infrastructure for adding the other filesystems is in place.
  It's simply a matter of finding the right commands and parsing the
  output. (see #338528 for more info)
2006-09-12 20:34:33 +00:00
Bart Hakvoort 9ccc70cb59 made icon behaviour more intelligent small improvement in
* include/TreeView_Detail.h,
  src/TreeView_Detail.cc: made icon behaviour more intelligent
* src/GParted_Core.cc: small improvement in open_device_and_disk()
2006-03-27 19:21:37 +00:00
Bart Hakvoort b179990dc9 show greyed-out mountpoint of unmounted partitions in the treeview as an
* include/GParted_Core.h,
  include/TreeView_Detail.h,
  src/GParted_Core.cc,
  src/TreeView_Detail.cc: show greyed-out mountpoint of unmounted
  partitions in the treeview as an improved way to identify
  partitions. (#333027)
* src/Win_GParted.cc: cleanups
2006-03-07 11:55:27 +00:00
Bart Hakvoort 0fd04602c1 support showing of warning icon even when a partition is mounted.
* include/TreeView_Detail.h,
  src/TreeView_Detail.cc: support showing of warning icon even when a
  partition is mounted.
2006-03-06 13:39:21 +00:00
Bart Hakvoort 35593e5747 added mountpointcolumn (#304688) added submenu 'Devices' which allows one
* include/TreeView_Detail.h,
  src/TreeView_Detail.cc: added mountpointcolumn (#304688)
* include/Win_GParted.h,
  src/Win_GParted.cc: added submenu 'Devices' which allows one to
  select devices from the menu (#329415)
2006-02-02 10:59:44 +00:00
Bart Hakvoort 7ef6e3e5c8 emit proper signals for several events. cleanups..
* include/TreeView_Detail.h,
  src/TreeView_Detail.cc,
  include/VBox_VisualDisk.h,
  src/VBox_VisualDisk.cc,
  include/Win_GParted.h,
  src/Win_GParted.cc: emit proper signals for several events.
* include/Partition.h,
  src/Partition.cc: cleanups..
2005-12-24 00:06:05 +00:00
Bart Hakvoort 9564cf841b added get_color_as_pixbuf() to create colored squares of custom sizes.
* include/Utils.h,
  src/Utils.cc: added get_color_as_pixbuf() to create colored squares
  of custom sizes. These can be use troughout the app to represent
  filesystems. e.g. in the treeview and convertmenu.
* include/TreeView_Detail.h,
  src/TreeView_Detail.cc,
  include/VBox_VisualDisk.h,
  src/VBox_VisualDisk.cc,
  include/Win_GParted.h,
  src/Win_GParted.cc: use Utils::get_color_as_pixbuf() instead of
  custom drawn widgets.
2005-12-15 15:10:34 +00:00
Bart Hakvoort 758f5e63a8 Fixed a bunch of bugs (some of them crashers) which showed up if no
* Fixed a bunch of bugs (some of them crashers) which showed up if no devices were detected.
2005-02-01 17:04:03 +00:00
Bart Hakvoort bd02bca613 P ). Resizing of ext2/3 works perfect now. I've even tested it on the
* Again way too many chances to create a detailed entry (i'm glad i'm the only dev atm :P ).
  Resizing of ext2/3 works perfect now. I've even tested it on the partition holding my SG seasons =)
  Implemented checking of filesystems (only internally used atm).
  Done some overall tweaking, finetuning etc.. release 0.0.7 is getting shape.
2004-11-21 21:49:38 +00:00
Bart Hakvoort d57a8eced7 removed unnecessary headerfiles 2004-10-02 13:18:25 +00:00
Bart Hakvoort 0d2ee545a7 added colored squares to the tree to highlight filesystems. 2004-09-30 18:26:34 +00:00
Bart Hakvoort 26d433260d Initial revision 2004-09-19 20:24:53 +00:00