diff --git a/include/GParted_Core.h b/include/GParted_Core.h index 52020552..0b5f8fb7 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 > & map ) ; std::vector 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 18d0048c..b0f04661 100644 --- a/src/GParted_Core.cc +++ b/src/GParted_Core.cc @@ -857,6 +857,18 @@ std::vector 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 ;