Lines 1604-1610
bool GParted_Core::copy_filesystem( cons
Link Here
|
1604 |
|
1604 |
|
1605 |
while ( succes && |
1605 |
while ( succes && |
1606 |
timer .elapsed() <= smallest_time && |
1606 |
timer .elapsed() <= smallest_time && |
1607 |
std::abs( done ) + N <= length && |
1607 |
llabs( done ) + N <= length && |
1608 |
optimal_blocksize * 2 < N ) |
1608 |
optimal_blocksize * 2 < N ) |
1609 |
{ |
1609 |
{ |
1610 |
if ( done != 0 ) |
1610 |
if ( done != 0 ) |
Lines 1648-1654
bool GParted_Core::copy_filesystem( cons
Link Here
|
1648 |
dst_device, |
1648 |
dst_device, |
1649 |
src_start + ( dst_start > src_start ? 0 : done ), |
1649 |
src_start + ( dst_start > src_start ? 0 : done ), |
1650 |
dst_start + ( dst_start > src_start ? 0 : done ), |
1650 |
dst_start + ( dst_start > src_start ? 0 : done ), |
1651 |
length - std::abs( done ), |
1651 |
length - llabs( done ), |
1652 |
optimal_blocksize, |
1652 |
optimal_blocksize, |
1653 |
operationdetail, |
1653 |
operationdetail, |
1654 |
readonly, |
1654 |
readonly, |
Lines 1822-1828
bool GParted_Core::copy_blocks( const Gl
Link Here
|
1822 |
if ( lp_device_src && lp_device_dst && ped_device_open( lp_device_src ) && ped_device_open( lp_device_dst ) ) |
1822 |
if ( lp_device_src && lp_device_dst && ped_device_open( lp_device_src ) && ped_device_open( lp_device_dst ) ) |
1823 |
{ |
1823 |
{ |
1824 |
Glib::ustring error_message ; |
1824 |
Glib::ustring error_message ; |
1825 |
buf = static_cast<char *>( malloc( std::abs( blocksize ) * 512 ) ) ; |
1825 |
buf = static_cast<char *>( malloc( llabs( blocksize ) * 512 ) ) ; |
1826 |
if ( buf ) |
1826 |
if ( buf ) |
1827 |
{ |
1827 |
{ |
1828 |
ped_device_sync( lp_device_dst ) ; |
1828 |
ped_device_sync( lp_device_dst ) ; |
Lines 1843-1849
bool GParted_Core::copy_blocks( const Gl
Link Here
|
1843 |
operationdetail .get_last_child() .add_child( OperationDetail( "", STATUS_NONE ) ) ; |
1843 |
operationdetail .get_last_child() .add_child( OperationDetail( "", STATUS_NONE ) ) ; |
1844 |
|
1844 |
|
1845 |
Glib::Timer timer_progress_timeout, timer_total ; |
1845 |
Glib::Timer timer_progress_timeout, timer_total ; |
1846 |
while( succes && std::abs( done ) < length ) |
1846 |
while( succes && llabs( done ) < length ) |
1847 |
{ |
1847 |
{ |
1848 |
succes = copy_block( lp_device_src, |
1848 |
succes = copy_block( lp_device_src, |
1849 |
lp_device_dst, |
1849 |
lp_device_dst, |
Lines 1858-1864
bool GParted_Core::copy_blocks( const Gl
Link Here
|
1858 |
if ( timer_progress_timeout .elapsed() >= 0.5 ) |
1858 |
if ( timer_progress_timeout .elapsed() >= 0.5 ) |
1859 |
{ |
1859 |
{ |
1860 |
set_progress_info( length, |
1860 |
set_progress_info( length, |
1861 |
std::abs( done + blocksize ), |
1861 |
llabs( done + blocksize ), |
1862 |
timer_total, |
1862 |
timer_total, |
1863 |
operationdetail .get_last_child() .get_last_child(), |
1863 |
operationdetail .get_last_child() .get_last_child(), |
1864 |
readonly ) ; |
1864 |
readonly ) ; |
Lines 1877-1889
bool GParted_Core::copy_blocks( const Gl
Link Here
|
1877 |
|
1877 |
|
1878 |
//final description |
1878 |
//final description |
1879 |
operationdetail .get_last_child() .get_last_child() .set_description( |
1879 |
operationdetail .get_last_child() .get_last_child() .set_description( |
1880 |
String::ucompose( readonly ? _("%1 of %2 read") : _("%1 of %2 copied"), std::abs( done ), length ), FONT_ITALIC ) ; |
1880 |
String::ucompose( readonly ? _("%1 of %2 read") : _("%1 of %2 copied"), llabs( done ), length ), FONT_ITALIC ) ; |
1881 |
|
1881 |
|
1882 |
if ( ! succes && ! error_message .empty() ) |
1882 |
if ( ! succes && ! error_message .empty() ) |
1883 |
operationdetail .get_last_child() .add_child( |
1883 |
operationdetail .get_last_child() .add_child( |
1884 |
OperationDetail( error_message, STATUS_NONE, FONT_ITALIC ) ) ; |
1884 |
OperationDetail( error_message, STATUS_NONE, FONT_ITALIC ) ) ; |
1885 |
|
1885 |
|
1886 |
total_done += std::abs( done ) ; |
1886 |
total_done += llabs( done ) ; |
1887 |
|
1887 |
|
1888 |
//close and destroy the devices.. |
1888 |
//close and destroy the devices.. |
1889 |
ped_device_close( lp_device_src ) ; |
1889 |
ped_device_close( lp_device_src ) ; |
Lines 1912-1918
bool GParted_Core::copy_block( PedDevice
Link Here
|
1912 |
|
1912 |
|
1913 |
if ( blocksize < 0 ) |
1913 |
if ( blocksize < 0 ) |
1914 |
{ |
1914 |
{ |
1915 |
blocksize = std::abs( blocksize ) ; |
1915 |
blocksize = llabs( blocksize ) ; |
1916 |
offset_src -= ( blocksize -1 ) ; |
1916 |
offset_src -= ( blocksize -1 ) ; |
1917 |
offset_dst -= ( blocksize -1 ) ; |
1917 |
offset_dst -= ( blocksize -1 ) ; |
1918 |
} |
1918 |
} |