mirror of
https://gitlab.gnome.org/GNOME/gparted
synced 2024-08-28 12:10:01 +00:00
Moved common code into new get_device_entry() method
svn path=/trunk/; revision=988
This commit is contained in:
parent
ffd362cb42
commit
ab50d0254f
|
@ -1,5 +1,8 @@
|
|||
2008-11-29 Curtis Gedak <gedakc@gmail.com>
|
||||
|
||||
* include/FS_Info.h,
|
||||
src/FS_Info.cc: Moved common code into new get_device_entry() method.
|
||||
|
||||
* configure.in: Append -svn to version for continuing development
|
||||
|
||||
2008-11-28 Curtis Gedak <gedakc@gmail.com>
|
||||
|
|
|
@ -32,6 +32,7 @@ public:
|
|||
Glib::ustring get_uuid( const Glib::ustring & path ) ;
|
||||
private:
|
||||
void load_fs_info_cache() ;
|
||||
Glib::ustring get_device_entry( const Glib::ustring & path ) ;
|
||||
Glib::ustring fs_info_cache ;
|
||||
};
|
||||
|
||||
|
|
|
@ -41,14 +41,21 @@ void FS_Info::load_fs_info_cache()
|
|||
}
|
||||
}
|
||||
|
||||
Glib::ustring FS_Info::get_device_entry( const Glib::ustring & path )
|
||||
{
|
||||
//Retrieve the line containing the device path
|
||||
Glib::ustring regexp = "^" + path + ":([^\n]*)$" ;
|
||||
Glib::ustring entry = Utils::regexp_label( fs_info_cache, regexp ) ;
|
||||
return entry;
|
||||
}
|
||||
|
||||
Glib::ustring FS_Info::get_label( const Glib::ustring & path, bool & found )
|
||||
{
|
||||
Glib::ustring label = "" ;
|
||||
found = false ;
|
||||
|
||||
//Retrieve the line containing the device path
|
||||
Glib::ustring regexp = "^" + path + ":([^\n]*)$" ;
|
||||
Glib::ustring temp = Utils::regexp_label( fs_info_cache, regexp ) ;
|
||||
Glib::ustring temp = get_device_entry( path ) ;
|
||||
|
||||
//Set indicator if LABEL found
|
||||
if ( Utils::regexp_label( temp, "(LABEL=\")") != "" )
|
||||
|
@ -62,8 +69,7 @@ Glib::ustring FS_Info::get_label( const Glib::ustring & path, bool & found )
|
|||
Glib::ustring FS_Info::get_uuid( const Glib::ustring & path )
|
||||
{
|
||||
//Retrieve the line containing the device path
|
||||
Glib::ustring regexp = "^" + path + ":([^\n]*)$" ;
|
||||
Glib::ustring temp = Utils::regexp_label( fs_info_cache, regexp ) ;
|
||||
Glib::ustring temp = get_device_entry( path ) ;
|
||||
|
||||
//Retrieve the UUID
|
||||
Glib::ustring uuid = Utils::regexp_label( temp, "UUID=\"([^\"]*)\"" ) ;
|
||||
|
|
Loading…
Reference in a new issue