Only peform partable re-read check if at least one partition on a device

* src/GParted_Core.cc: Only peform partable re-read check if at least one partition on a device is mounted.
This commit is contained in:
Bart Hakvoort 2004-12-17 15:56:03 +00:00
parent e3951754b9
commit 2ba3f8904b
2 changed files with 7 additions and 5 deletions

View File

@ -1,3 +1,7 @@
2004-12-17 Bart Hakvoort <gparted@users.sf.net>
* src/GParted_Core.cc: Only peform partable re-read check if at least one partition on a device is mounted.
2004-12-15 Bart Hakvoort <gparted@users.sf.net>
* some minor internal codechanges, which should save a few bytes of mem here and there.

View File

@ -80,7 +80,6 @@ void GParted_Core::get_devices( std::vector<Device> & devices, bool deep_scan )
break ;
}
device = ped_device_get_next( device ) ;
}
close_device_and_disk( device, disk ) ;
@ -88,7 +87,6 @@ void GParted_Core::get_devices( std::vector<Device> & devices, bool deep_scan )
//and sort the devices by name.. (this prevents some very weird errors ;) )
sort( device_paths .begin( ), device_paths .end( ) ) ;
for ( unsigned int t = 0 ; t < device_paths .size( ) ; t++ )
{
if ( open_device_and_disk( device_paths[ t ], device, disk, false ) )
@ -110,13 +108,13 @@ void GParted_Core::get_devices( std::vector<Device> & devices, bool deep_scan )
temp_device .disktype = disk ->type ->name ;
temp_device .max_prims = ped_disk_get_max_primary_partition_count( disk ) ;
if ( deep_scan )
set_device_partitions( temp_device, deep_scan ) ;
if ( deep_scan && temp_device .busy )
{
temp_device .readonly = ! ped_disk_commit_to_os( disk ) ;
sleep( 1 ) ;//this sucks, but it seems that after the commit test, the paths are removed and added again (which takes time..)
}
set_device_partitions( temp_device, deep_scan ) ;
}
//harddisk without disklabel
else