gparted r1005 - in trunk: . include src



Author: gedakc
Date: Thu Dec 18 22:13:43 2008
New Revision: 1005
URL: http://svn.gnome.org/viewvc/gparted?rev=1005&view=rev

Log:
Added support for ext4 file systems

Modified:
   trunk/ChangeLog
   trunk/include/Utils.h
   trunk/src/GParted_Core.cc
   trunk/src/Utils.cc

Modified: trunk/include/Utils.h
==============================================================================
--- trunk/include/Utils.h	(original)
+++ trunk/include/Utils.h	Thu Dec 18 22:13:43 2008
@@ -52,22 +52,23 @@
 	
 	FS_EXT2		= 4,
 	FS_EXT3		= 5,
-	FS_LINUX_SWAP	= 6,
-	FS_FAT16	= 7,
-	FS_FAT32	= 8,
-	FS_NTFS		= 9,
-	FS_REISERFS	= 10,
-	FS_REISER4	= 11,
-	FS_XFS		= 12,
-	FS_JFS		= 13,
-	FS_HFS		= 14,
-	FS_HFSPLUS	= 15,
-	FS_UFS		= 16,
+	FS_EXT4		= 6,
+	FS_LINUX_SWAP	= 7,
+	FS_FAT16	= 8,
+	FS_FAT32	= 9,
+	FS_NTFS		= 10,
+	FS_REISERFS	= 11,
+	FS_REISER4	= 12,
+	FS_XFS		= 13,
+	FS_JFS		= 14,
+	FS_HFS		= 15,
+	FS_HFSPLUS	= 16,
+	FS_UFS		= 17,
 
-	FS_USED		= 17,
-	FS_UNUSED	= 18,
+	FS_USED		= 18,
+	FS_UNUSED	= 19,
 
-	FS_LVM2		= 19   
+	FS_LVM2		= 20   
 } ;
 
 enum SIZE_UNIT

Modified: trunk/src/GParted_Core.cc
==============================================================================
--- trunk/src/GParted_Core.cc	(original)
+++ trunk/src/GParted_Core.cc	Thu Dec 18 22:13:43 2008
@@ -27,6 +27,7 @@
 
 #include "../include/ext2.h"
 #include "../include/ext3.h"
+#include "../include/ext4.h"
 #include "../include/fat16.h"
 #include "../include/fat32.h"
 #include "../include/linux_swap.h"
@@ -87,7 +88,10 @@
 	
 	ext3 fs_ext3;
 	FILESYSTEMS .push_back( fs_ext3 .get_filesystem_support() ) ;
-	
+
+	ext4 fs_ext4;
+	FILESYSTEMS .push_back( fs_ext4 .get_filesystem_support() ) ;
+
 	fat16 fs_fat16;
 	FILESYSTEMS .push_back( fs_fat16 .get_filesystem_support() ) ;
 	
@@ -740,7 +744,19 @@
 		else if ( Glib::ustring( lp_partition ->fs_type ->name ) == "ext2" )
 			return GParted::FS_EXT2 ;
 		else if ( Glib::ustring( lp_partition ->fs_type ->name ) == "ext3" )
-			return GParted::FS_EXT3 ;
+		{
+			//FIXME:  Temporary code to detect ext4.
+			//        Replace when libparted bug #188 "ext4 detected as ext3" is fixed.
+			//        http://parted.alioth.debian.org/cgi-bin/trac.cgi/ticket/188
+			FS_Info fs_info ;
+			temp = fs_info .get_fs_type( Glib::ustring( ped_partition_get_path( lp_partition ) ) ) ; 
+			if ( temp == "ext4" || temp == "ext4dev" )
+				return GParted::FS_EXT4 ;
+			else
+				return GParted::FS_EXT3 ;
+		}
+		else if ( Glib::ustring( lp_partition ->fs_type ->name ) == "ext4" )
+			return GParted::FS_EXT4 ;
 		else if ( Glib::ustring( lp_partition ->fs_type ->name ) == "linux-swap" )
 			return GParted::FS_LINUX_SWAP ;
 		else if ( Glib::ustring( lp_partition ->fs_type ->name ) == "fat16" )
@@ -2272,6 +2288,7 @@
 	{
 		case FS_EXT2		: p_filesystem = new ext2() ;	 	break ;
 		case FS_EXT3		: p_filesystem = new ext3() ; 		break ;
+		case FS_EXT4		: p_filesystem = new ext4() ; 		break ;
 		case FS_LINUX_SWAP	: p_filesystem = new linux_swap() ; 	break ;
 		case FS_FAT16		: p_filesystem = new fat16() ; 		break ;
 		case FS_FAT32		: p_filesystem = new fat32() ; 		break ;

Modified: trunk/src/Utils.cc
==============================================================================
--- trunk/src/Utils.cc	(original)
+++ trunk/src/Utils.cc	Thu Dec 18 22:13:43 2008
@@ -73,6 +73,7 @@
 		case FS_EXTENDED	: return "#7DFCFE" ;	// ~ light blue
 		case FS_EXT2		: return "#9DB8D2" ;	//blue hilight
 		case FS_EXT3		: return "#7590AE" ;	//blue medium
+		case FS_EXT4		: return "#4B6983" ;	//blue dark
 		case FS_LINUX_SWAP	: return "#C1665A" ;	//red medium
 		case FS_FAT16		: return "#00FF00" ;	//green
 		case FS_FAT32		: return "#18D918" ;	// ~ medium green
@@ -118,6 +119,7 @@
 		case FS_EXTENDED	: return "extended" ;
 		case FS_EXT2		: return "ext2" ;
 		case FS_EXT3		: return "ext3" ;
+		case FS_EXT4		: return "ext4" ;
 		case FS_LINUX_SWAP	: return "linux-swap" ;
 		case FS_FAT16		: return "fat16" ;
 		case FS_FAT32		: return "fat32" ;
@@ -143,6 +145,7 @@
 	{
 		case FS_EXT2        : return "e2fsprogs" ;
 		case FS_EXT3        : return "e2fsprogs" ;
+		case FS_EXT4        : return "e2fsprogs" ;
 		case FS_FAT16       : return "dosfstools, mtools" ;
 		case FS_FAT32       : return "dosfstools, mtools" ;
 		case FS_HFS         : return "hfsutils" ;



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