From 655a83d4c1317467aa986754194846dd2769d2fe Mon Sep 17 00:00:00 2001 From: Bart Hakvoort Date: Wed, 5 Apr 2006 14:26:30 +0000 Subject: [PATCH] modified warning added support for shrinking and copying hfs+ filesystems * src/GParted_Core.cc: modified warning * src/hfsplus.cc: added support for shrinking and copying hfs+ filesystems --- ChangeLog | 6 ++++++ src/GParted_Core.cc | 2 +- src/hfsplus.cc | 21 +++++++++++++++++++-- 3 files changed, 26 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 66a9075a..7ae59477 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2006-04-05 Bart Hakvoort + + * src/GParted_Core.cc: modified warning + * src/hfsplus.cc: added support for shrinking and copying hfs+ + filesystems + 2006-04-05 Bart Hakvoort * src/Dialog_Partition_Resize_Move.cc, diff --git a/src/GParted_Core.cc b/src/GParted_Core.cc index 94404359..6baf2ed2 100644 --- a/src/GParted_Core.cc +++ b/src/GParted_Core.cc @@ -358,7 +358,7 @@ GParted::FILESYSTEM GParted_Core::get_filesystem() partition_temp .error += "\n-"; partition_temp .error += _( "The filesystem is damaged" ) ; partition_temp .error += "\n-" ; - partition_temp .error += _( "The filesystem is unknown to libparted" ) ; + partition_temp .error += _( "The filesystem is unknown to GParted" ) ; partition_temp .error += "\n-"; partition_temp .error += _( "There is no filesystem available (unformatted)" ) ; diff --git a/src/hfsplus.cc b/src/hfsplus.cc index 9681d7fd..0ee77f1b 100644 --- a/src/hfsplus.cc +++ b/src/hfsplus.cc @@ -27,7 +27,11 @@ FS hfsplus::get_filesystem_support( ) fs .filesystem = GParted::FS_HFSPLUS ; - fs .read = GParted::FS::LIBPARTED ; //provided by libparted + fs .read = GParted::FS::LIBPARTED ; + fs .shrink = GParted::FS::LIBPARTED ; + + if ( ! Glib::find_program_in_path( "dd" ) .empty() ) + fs .copy = GParted::FS::EXTERNAL ; return fs ; } @@ -52,7 +56,20 @@ bool hfsplus::Copy( const Glib::ustring & src_part_path, const Glib::ustring & dest_part_path, std::vector & operation_details ) { - return true ; + operation_details .push_back( OperationDetails( + String::ucompose( _("copy contents of %1 to %2"), src_part_path, dest_part_path ) ) ) ; + + if ( ! execute_command( "dd bs=8192 if=" + src_part_path + " of=" + dest_part_path, + operation_details .back() .sub_details ) ) + { + operation_details .back() .status = OperationDetails::SUCCES ; + return true ; + } + else + { + operation_details .back() .status = OperationDetails::ERROR ; + return false ; + } } bool hfsplus::Check_Repair( const Partition & partition, std::vector & operation_details )