Enhance to work with mount points defined by uuid or label

This commit is contained in:
Curtis Gedak 2010-12-09 14:58:03 -07:00
parent 128b1439a1
commit b176a96e28
1 changed files with 10 additions and 0 deletions

View File

@ -749,6 +749,8 @@ void GParted_Core::read_mountpoints_from_file(
const Glib::ustring & filename,
std::map< Glib::ustring, std::vector<Glib::ustring> > & map )
{
FS_Info fs_info ; //Use cache of file system information
FILE* fp = setmntent( filename .c_str(), "r" ) ;
if ( fp == NULL )
@ -760,6 +762,14 @@ void GParted_Core::read_mountpoints_from_file(
{
Glib::ustring node = p->mnt_fsname ;
Glib::ustring uuid = Utils::regexp_label( node, "^UUID=(.*)" ) ;
if ( ! uuid .empty() )
node = fs_info .get_path_by_uuid( uuid ) ;
Glib::ustring label = Utils::regexp_label( node, "^LABEL=(.*)" ) ;
if ( ! label .empty() )
node = fs_info .get_path_by_label( label ) ;
if ( ! node .empty() )
{
Glib::ustring mountpoint = p->mnt_dir ;