gparted r988 - in trunk: . include src
- From: gedakc svn gnome org
- To: svn-commits-list gnome org
- Subject: gparted r988 - in trunk: . include src
- Date: Sat, 29 Nov 2008 16:22:48 +0000 (UTC)
Author: gedakc
Date: Sat Nov 29 16:22:48 2008
New Revision: 988
URL: http://svn.gnome.org/viewvc/gparted?rev=988&view=rev
Log:
Moved common code into new get_device_entry() method
Modified:
trunk/ChangeLog
trunk/include/FS_Info.h
trunk/src/FS_Info.cc
Modified: trunk/include/FS_Info.h
==============================================================================
--- trunk/include/FS_Info.h (original)
+++ trunk/include/FS_Info.h Sat Nov 29 16:22:48 2008
@@ -32,6 +32,7 @@
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 ;
};
Modified: trunk/src/FS_Info.cc
==============================================================================
--- trunk/src/FS_Info.cc (original)
+++ trunk/src/FS_Info.cc Sat Nov 29 16:22:48 2008
@@ -41,14 +41,21 @@
}
}
+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_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=\"([^\"]*)\"" ) ;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]