[gparted] Reorder and rename params to TreeView_Detail::load_partitions()
- From: Curtis Gedak <gedakc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gparted] Reorder and rename params to TreeView_Detail::load_partitions()
- Date: Sat, 3 Dec 2016 22:50:04 +0000 (UTC)
commit 43f2a4bd0876debf82d2223ba065379117505797
Author: Mike Fleetwood <mike fleetwood googlemail com>
Date: Thu Dec 1 14:05:57 2016 +0000
Reorder and rename params to TreeView_Detail::load_partitions()
Reorder the parameters into the same order in which they occur in the
row, i.e. Name first, then Mount Point and finally Label. Rename local
variables in load_partitions(1 param) and parameters of
load_partitions(5 params) prefixing with "show_" to make it clearer the
variables track if that column will be displayed or not.
include/TreeView_Detail.h | 6 +++---
src/TreeView_Detail.cc | 23 +++++++++++++----------
2 files changed, 16 insertions(+), 13 deletions(-)
---
diff --git a/include/TreeView_Detail.h b/include/TreeView_Detail.h
index 592876f..fb52fc5 100644
--- a/include/TreeView_Detail.h
+++ b/include/TreeView_Detail.h
@@ -47,9 +47,9 @@ public:
private:
void load_partitions( const PartitionVector & partitions,
- bool & mountpoints,
- bool & labels,
- bool & names,
+ bool & show_names,
+ bool & show_mountpoints,
+ bool & show_labels,
const Gtk::TreeRow & parent_row = Gtk::TreeRow() );
bool set_selected( Gtk::TreeModel::Children rows,
const Partition * partition_ptr, bool inside_extended = false );
diff --git a/src/TreeView_Detail.cc b/src/TreeView_Detail.cc
index 563dc85..9f045c1 100644
--- a/src/TreeView_Detail.cc
+++ b/src/TreeView_Detail.cc
@@ -82,14 +82,17 @@ TreeView_Detail::TreeView_Detail()
void TreeView_Detail::load_partitions( const PartitionVector & partitions )
{
- bool mountpoints = false, labels = false, names = false;
+ bool show_names = false;
+ bool show_mountpoints = false;
+ bool show_labels = false;
+
treestore_detail ->clear() ;
- load_partitions( partitions, mountpoints, labels, names );
+ load_partitions( partitions, show_names, show_mountpoints, show_labels );
- get_column( 1 )->set_visible( names );
- get_column( 3 )->set_visible( mountpoints );
- get_column( 4 )->set_visible( labels );
+ get_column( 1 )->set_visible( show_names );
+ get_column( 3 )->set_visible( show_mountpoints );
+ get_column( 4 )->set_visible( show_labels );
columns_autosize();
expand_all() ;
@@ -108,19 +111,19 @@ void TreeView_Detail::clear()
}
void TreeView_Detail::load_partitions( const PartitionVector & partitions,
- bool & mountpoints,
- bool & labels,
- bool & names,
+ bool & show_names,
+ bool & show_mountpoints,
+ bool & show_labels,
const Gtk::TreeRow & parent_row )
{
Gtk::TreeRow row ;
for ( unsigned int i = 0 ; i < partitions .size() ; i++ )
{
row = parent_row ? *( treestore_detail ->append( parent_row .children() ) ) : *(
treestore_detail ->append() ) ;
- create_row( row, partitions[i], names, mountpoints, labels );
+ create_row( row, partitions[i], show_names, show_mountpoints, show_labels );
if ( partitions[ i ] .type == GParted::TYPE_EXTENDED )
- load_partitions( partitions[i].logicals, mountpoints, labels, names, row );
+ load_partitions( partitions[i].logicals, show_names, show_mountpoints, show_labels,
row );
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]