Remove Partition::color member (#760080)

Partition object represents a region of a disk and the file system
within.  GParted always displays the colour base of the type of the file
system.  Therefore remove the color member and always look it up from
the type of the file system as needed.

This makes one less member that will need virtual accessor methods with
different handling in the derived PartitionLUKS class.

Bug 760080 - Implement read-only LUKS support
This commit is contained in:
Mike Fleetwood 2015-11-19 16:22:23 +00:00 committed by Curtis Gedak
parent c9a2986fb9
commit 6e294dda05
7 changed files with 13 additions and 12 deletions

View File

@ -135,7 +135,6 @@ public:
Sector sectors_unused;
Sector sectors_unallocated; //Difference between the size of the partition and the file system
Sector significant_threshold; //Threshold from intrinsic to significant unallocated sectors
Gdk::Color color;
bool inside_extended;
bool busy;
std::vector<Glib::ustring> messages ;

View File

@ -18,6 +18,7 @@
#include "../include/Dialog_Partition_Copy.h"
#include "../include/GParted_Core.h"
#include "../include/Partition.h"
#include "../include/Utils.h"
namespace GParted
{
@ -44,8 +45,9 @@ void Dialog_Partition_Copy::set_data( const Partition & selected_partition, cons
this ->set_title( String::ucompose( _("Paste %1"), copied_partition .get_path() ) ) ;
//set partition color
frame_resizer_base ->set_rgb_partition_color( copied_partition .color ) ;
Gdk::Color partition_color( Utils::get_color( copied_partition.filesystem ) );
frame_resizer_base->set_rgb_partition_color( partition_color );
//set some widely used values...
MIN_SPACE_BEFORE_MB = Dialog_Base_Partition::MB_Needed_for_Boot_Record( selected_partition ) ;
START = selected_partition .sector_start ;

View File

@ -18,6 +18,7 @@
#include "../include/Dialog_Partition_Info.h"
#include "../include/LVM2_PV_Info.h"
#include "../include/Partition.h"
#include "../include/Utils.h"
#include "../include/btrfs.h"
#include <gtk/gtk.h>
@ -193,8 +194,8 @@ void Dialog_Partition_Info::init_drawingarea()
color_text .set( "black" );
this ->get_colormap() ->alloc_color( color_text ) ;
color_partition = partition .color ;
color_partition.set( Utils::get_color( partition.filesystem ) );
this ->get_colormap() ->alloc_color( color_partition ) ;
//set text of pangolayout

View File

@ -19,6 +19,7 @@
#include "../include/GParted_Core.h"
#include "../include/Partition.h"
#include "../include/PartitionVector.h"
#include "../include/Utils.h"
namespace GParted
{
@ -55,8 +56,9 @@ void Dialog_Partition_Resize_Move::set_data( const Partition & selected_partitio
}
//set partition color
frame_resizer_base ->set_rgb_partition_color( selected_partition .color ) ;
Gdk::Color partition_color( Utils::get_color( selected_partition.filesystem ) );
frame_resizer_base->set_rgb_partition_color( partition_color );
//store the original values
ORIG_BEFORE = spinbutton_before .get_value_as_int() ;
ORIG_SIZE = spinbutton_size .get_value_as_int() ;

View File

@ -18,6 +18,7 @@
#include "../include/DrawingAreaVisualDisk.h"
#include "../include/Partition.h"
#include "../include/PartitionVector.h"
#include "../include/Utils.h"
#define MAIN_BORDER 5
#define BORDER 4
@ -98,7 +99,7 @@ void DrawingAreaVisualDisk::set_static_data( const PartitionVector & partitions,
Sector partition_length = partitions[ t ] .get_sector_length() ;
visual_partitions .back() .fraction = partition_length / static_cast<double>( length ) ;
visual_partitions .back() .color = partitions[ t ] .color;
visual_partitions.back().color.set( Utils::get_color( partitions[t].filesystem ) );
get_colormap() ->alloc_color( visual_partitions .back() .color );
if ( partitions[ t ] .type == GParted::TYPE_EXTENDED )

View File

@ -51,7 +51,6 @@ void Partition::Reset()
significant_threshold = 1 ;
free_space_before = -1 ;
sector_size = 0 ;
color .set( "black" ) ;
inside_extended = busy = strict_start = false ;
logicals .clear() ;
flags .clear() ;
@ -83,8 +82,6 @@ void Partition::Set( const Glib::ustring & device_path,
this ->sector_size = sector_size;
this ->inside_extended = inside_extended;
this ->busy = busy;
this ->color .set( Utils::get_color( filesystem ) );
}
//Set file system size and free space, which also calculates unallocated

View File

@ -1878,7 +1878,6 @@ void Win_GParted::activate_paste()
partition_new->filesystem = copied_partition->filesystem;
partition_new->set_filesystem_label( copied_partition->get_filesystem_label() );
partition_new->uuid = copied_partition->uuid;
partition_new->color = copied_partition->color;
Sector new_size = partition_new->get_sector_length();
if ( copied_partition->get_sector_length() == new_size )
{