diff --git a/include/Partition.h b/include/Partition.h index 8078dd1d..1b49f6e2 100644 --- a/include/Partition.h +++ b/include/Partition.h @@ -135,6 +135,9 @@ public: // file system. Will be overridden in derived PartitionLUKS. virtual const Partition & get_filesystem_partition() const { return *this; }; + virtual const Glib::ustring get_filesystem_string() const + { return Utils::get_filesystem_string( filesystem ); }; + bool operator==( const Partition & partition ) const ; bool operator!=( const Partition & partition ) const ; diff --git a/include/PartitionLUKS.h b/include/PartitionLUKS.h index 65c4277c..3e2cf63a 100644 --- a/include/PartitionLUKS.h +++ b/include/PartitionLUKS.h @@ -54,6 +54,8 @@ public: virtual const Partition & get_filesystem_partition() const; + virtual const Glib::ustring get_filesystem_string() const; + private: Partition encrypted; Sector header_size; // Size of the LUKS header (everything up to the start of the mapping) diff --git a/src/PartitionLUKS.cc b/src/PartitionLUKS.cc index 72c45bb6..2038d5fb 100644 --- a/src/PartitionLUKS.cc +++ b/src/PartitionLUKS.cc @@ -200,4 +200,13 @@ const Partition & PartitionLUKS::get_filesystem_partition() const return *this; } +const Glib::ustring PartitionLUKS::get_filesystem_string() const +{ + /* TO TRANSLATORS: means that this is an encrypted file system */ + Glib::ustring fs_str = "[" + Glib::ustring( _("Encrypted") ) + "]"; + if ( busy ) + fs_str += " " + Utils::get_filesystem_string( encrypted.filesystem ); + return fs_str; +} + } //GParted diff --git a/src/TreeView_Detail.cc b/src/TreeView_Detail.cc index e71c8097..ffa96a1b 100644 --- a/src/TreeView_Detail.cc +++ b/src/TreeView_Detail.cc @@ -184,21 +184,7 @@ void TreeView_Detail::create_row( const Gtk::TreeRow & treerow, // file system treerow[treeview_detail_columns.color] = Utils::get_color_as_pixbuf( filesystem_ptn.filesystem, 16, 16 ); - if ( partition.filesystem == FS_LUKS && partition.busy ) - { - const Partition & encrypted = dynamic_cast( &partition )->get_encrypted(); - /* TO TRANSLATORS: means that this is an encrypted file system */ - treerow[treeview_detail_columns.filesystem] = "[" + Glib::ustring( _("Encrypted") ) + "] " + - Utils::get_filesystem_string( encrypted.filesystem ); - } - else if ( partition.filesystem == FS_LUKS && ! partition.busy ) - { - treerow[treeview_detail_columns.filesystem] = "[" + Glib::ustring( _("Encrypted") ) + "]"; - } - else - { - treerow[treeview_detail_columns.filesystem] = Utils::get_filesystem_string( partition.filesystem ); - } + treerow[treeview_detail_columns.filesystem] = partition.get_filesystem_string(); // mount point std::vector temp_mountpoints = filesystem_ptn.get_mountpoints();