[gparted] Remove Partition::color member (#760080)
- From: Curtis Gedak <gedakc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gparted] Remove Partition::color member (#760080)
- Date: Sat, 30 Jan 2016 17:42:25 +0000 (UTC)
commit 6e294dda05cb6cfa4a69c6be6e71d758234d23a9
Author: Mike Fleetwood <mike fleetwood googlemail com>
Date: Thu Nov 19 16:22:23 2015 +0000
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
include/Partition.h | 1 -
src/Dialog_Partition_Copy.cc | 6 ++++--
src/Dialog_Partition_Info.cc | 5 +++--
src/Dialog_Partition_Resize_Move.cc | 6 ++++--
src/DrawingAreaVisualDisk.cc | 3 ++-
src/Partition.cc | 3 ---
src/Win_GParted.cc | 1 -
7 files changed, 13 insertions(+), 12 deletions(-)
---
diff --git a/include/Partition.h b/include/Partition.h
index 9e48b20..e8cd75f 100644
--- a/include/Partition.h
+++ b/include/Partition.h
@@ -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 ;
diff --git a/src/Dialog_Partition_Copy.cc b/src/Dialog_Partition_Copy.cc
index bef5bff..dd0579b 100644
--- a/src/Dialog_Partition_Copy.cc
+++ b/src/Dialog_Partition_Copy.cc
@@ -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 ;
diff --git a/src/Dialog_Partition_Info.cc b/src/Dialog_Partition_Info.cc
index 8dfe0d7..866df3e 100644
--- a/src/Dialog_Partition_Info.cc
+++ b/src/Dialog_Partition_Info.cc
@@ -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
diff --git a/src/Dialog_Partition_Resize_Move.cc b/src/Dialog_Partition_Resize_Move.cc
index b16b00d..382971a 100644
--- a/src/Dialog_Partition_Resize_Move.cc
+++ b/src/Dialog_Partition_Resize_Move.cc
@@ -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() ;
diff --git a/src/DrawingAreaVisualDisk.cc b/src/DrawingAreaVisualDisk.cc
index 8702032..839af7d 100644
--- a/src/DrawingAreaVisualDisk.cc
+++ b/src/DrawingAreaVisualDisk.cc
@@ -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 )
diff --git a/src/Partition.cc b/src/Partition.cc
index 3018dd3..b7ccfb4 100644
--- a/src/Partition.cc
+++ b/src/Partition.cc
@@ -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
diff --git a/src/Win_GParted.cc b/src/Win_GParted.cc
index c33cc78..2379792 100644
--- a/src/Win_GParted.cc
+++ b/src/Win_GParted.cc
@@ -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 )
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]