diff --git a/include/FileSystem.h b/include/FileSystem.h index acaa5246..4092ed89 100644 --- a/include/FileSystem.h +++ b/include/FileSystem.h @@ -52,8 +52,8 @@ public: , const Partition & partition_old , OperationDetail & operationdetail ) { return false; }; - virtual bool copy( const Glib::ustring & src_part_path, - const Glib::ustring & dest_part_path, + virtual bool copy( const Partition & src_part, + Partition & dest_part, OperationDetail & operationdetail ) { return false; }; virtual bool check_repair( const Partition & partition, OperationDetail & operationdetail ) { return false; }; virtual bool remove( const Partition & partition, OperationDetail & operationdetail ) { return true; }; diff --git a/include/linux_swap.h b/include/linux_swap.h index 0420f274..c4be64c7 100644 --- a/include/linux_swap.h +++ b/include/linux_swap.h @@ -41,8 +41,8 @@ public: , const Partition & partition_old , OperationDetail & operationdetail ) ; - bool copy( const Glib::ustring & src_part_path, - const Glib::ustring & dest_part_path, + bool copy( const Partition & src_part, + Partition & dest_part, OperationDetail & operationdetail ) ; }; diff --git a/include/ntfs.h b/include/ntfs.h index c34c24f1..367c4882 100644 --- a/include/ntfs.h +++ b/include/ntfs.h @@ -37,8 +37,8 @@ public: bool write_uuid( const Partition & partition, OperationDetail & operationdetail ) ; bool create( const Partition & new_partition, OperationDetail & operationdetail ) ; bool resize( const Partition & partition_new, OperationDetail & operationdetail, bool fill_partition = false ) ; - bool copy( const Glib::ustring & src_part_path, - const Glib::ustring & dest_part_path, + bool copy( const Partition & src_part, + Partition & dest_part, OperationDetail & operationdetail ) ; bool check_repair( const Partition & partition, OperationDetail & operationdetail ) ; diff --git a/include/xfs.h b/include/xfs.h index 4b9d51e7..faa68727 100644 --- a/include/xfs.h +++ b/include/xfs.h @@ -36,8 +36,8 @@ public: bool write_uuid( const Partition & partition, OperationDetail & operationdetail ) ; bool create( const Partition & new_partition, OperationDetail & operationdetail ) ; bool resize( const Partition & partition_new, OperationDetail & operationdetail, bool fill_partition = false ) ; - bool copy( const Glib::ustring & src_part_path, - const Glib::ustring & dest_part_path, + bool copy( const Partition & src_part, + Partition & dest_part, OperationDetail & operationdetail ) ; bool check_repair( const Partition & partition, OperationDetail & operationdetail ) ; }; diff --git a/src/GParted_Core.cc b/src/GParted_Core.cc index 53f880f3..d42f30ea 100644 --- a/src/GParted_Core.cc +++ b/src/GParted_Core.cc @@ -2616,8 +2616,8 @@ bool GParted_Core::copy( const Partition & partition_src, case GParted::FS::EXTERNAL : succes = ( p_filesystem = set_proper_filesystem( partition_dst .filesystem ) ) && - p_filesystem ->copy( partition_src .get_path(), - partition_dst .get_path(), + p_filesystem ->copy( partition_src, + partition_dst, operationdetail .get_last_child() ) ; break ; diff --git a/src/linux_swap.cc b/src/linux_swap.cc index 8374f01c..f9c08867 100644 --- a/src/linux_swap.cc +++ b/src/linux_swap.cc @@ -149,8 +149,8 @@ bool linux_swap::move( const Partition & partition_new return true ; } -bool linux_swap::copy( const Glib::ustring & src_part_path, - const Glib::ustring & dest_part_path, +bool linux_swap::copy( const Partition & src_part, + Partition & dest_part, OperationDetail & operationdetail ) { //Since linux-swap does not contain data, do not actually copy the partition diff --git a/src/ntfs.cc b/src/ntfs.cc index b46d343e..033eaf72 100644 --- a/src/ntfs.cc +++ b/src/ntfs.cc @@ -224,11 +224,11 @@ bool ntfs::resize( const Partition & partition_new, OperationDetail & operationd return return_value ; } -bool ntfs::copy( const Glib::ustring & src_part_path, - const Glib::ustring & dest_part_path, +bool ntfs::copy( const Partition & src_part, + Partition & dest_part, OperationDetail & operationdetail ) { - return ! execute_command( "ntfsclone -f --overwrite " + dest_part_path + " " + src_part_path, + return ! execute_command( "ntfsclone -f --overwrite " + dest_part.get_path() + " " + src_part.get_path(), operationdetail, false, true ); diff --git a/src/xfs.cc b/src/xfs.cc index 60d02738..53505c82 100644 --- a/src/xfs.cc +++ b/src/xfs.cc @@ -194,13 +194,13 @@ bool xfs::resize( const Partition & partition_new, OperationDetail & operationde return success ; } -bool xfs::copy( const Glib::ustring & src_part_path, - const Glib::ustring & dest_part_path, +bool xfs::copy( const Partition & src_part, + Partition & dest_part, OperationDetail & operationdetail ) { bool success = true ; - success &= ! execute_command( "mkfs.xfs -f " + dest_part_path, operationdetail, true, true ); + success &= ! execute_command( "mkfs.xfs -f " + dest_part.get_path(), operationdetail, true, true ); if ( ! success ) return false ; @@ -215,12 +215,12 @@ bool xfs::copy( const Glib::ustring & src_part_path, return false ; } - success &= ! execute_command( "mount -v -t xfs -o noatime,ro " + src_part_path + + success &= ! execute_command( "mount -v -t xfs -o noatime,ro " + src_part.get_path() + " " + src_mount_point, operationdetail, true ) ; if ( success ) { - success &= ! execute_command( "mount -v -t xfs " + dest_part_path + + success &= ! execute_command( "mount -v -t xfs " + dest_part.get_path() + " " + dest_mount_point, operationdetail, true ) ; if ( success ) @@ -229,10 +229,10 @@ bool xfs::copy( const Glib::ustring & src_part_path, " | xfsrestore -J - " + dest_mount_point + "'", operationdetail, true, true ); - success &= ! execute_command( "umount -v " + dest_part_path, operationdetail, true ) ; + success &= ! execute_command( "umount -v " + dest_part.get_path(), operationdetail, true ) ; } - success &= ! execute_command( "umount -v " + src_part_path, operationdetail, true ) ; + success &= ! execute_command( "umount -v " + src_part.get_path(), operationdetail, true ) ; } rm_temp_dir( dest_mount_point, operationdetail ) ;