[gparted] Create new method get_partition_path



commit 9bd8b148710e6c498f008ea55fa8cef204c62fbb
Author: Curtis Gedak <gedakc gmail com>
Date:   Sun Aug 15 14:14:04 2010 -0600

    Create new method get_partition_path
    
    This method will be used as an entry point to the libparted
    function ped_partition_get_path

 include/GParted_Core.h |    1 +
 src/GParted_Core.cc    |   12 ++++++++++++
 2 files changed, 13 insertions(+), 0 deletions(-)
---
diff --git a/include/GParted_Core.h b/include/GParted_Core.h
index 5202055..0b5f8fb 100644
--- a/include/GParted_Core.h
+++ b/include/GParted_Core.h
@@ -66,6 +66,7 @@ private:
 		const Glib::ustring & filename,
 		std::map< Glib::ustring, std::vector<Glib::ustring> > & map ) ;
 	std::vector<Glib::ustring> get_alternate_paths( const Glib::ustring & path ) ;
+	Glib::ustring get_partition_path( PedPartition * lp_partition ) ;
 	void set_device_partitions( Device & device ) ;
 	GParted::FILESYSTEM get_filesystem() ; 
 	void read_label( Partition & partition ) ;
diff --git a/src/GParted_Core.cc b/src/GParted_Core.cc
index 18d0048..b0f0466 100644
--- a/src/GParted_Core.cc
+++ b/src/GParted_Core.cc
@@ -857,6 +857,18 @@ std::vector<Glib::ustring> GParted_Core::get_alternate_paths( const Glib::ustrin
 	return paths ;
 }
 
+Glib::ustring GParted_Core::get_partition_path( PedPartition * lp_partition )
+{
+	char * lp_path ;	//we have to free the result of ped_partition_get_path()
+	Glib::ustring partition_path ;
+	
+	lp_path = ped_partition_get_path( lp_partition ) ;
+	partition_path = lp_path ;
+	free( lp_path ) ;
+
+	return partition_path ;
+}
+
 void GParted_Core::set_device_partitions( Device & device ) 
 {
 	int EXT_INDEX = -1 ;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]