fixed crasher with busy partition without mountpoint (#332983) added FIXME

* src/Dialog_Partition_Info.cc,
  src/GParted_Core.cc: fixed crasher with busy partition without
  mountpoint (#332983)
* src/Win_GParted.cc: added FIXME
This commit is contained in:
Bart Hakvoort 2006-03-05 15:11:47 +00:00
parent e69118d0b3
commit 58eff60c68
4 changed files with 19 additions and 8 deletions

View File

@ -1,3 +1,10 @@
2006-03-05 Bart Hakvoort <hakvoort@cvs.gnome.org>
* src/Dialog_Partition_Info.cc,
src/GParted_Core.cc: fixed crasher with busy partition without
mountpoint (#332983)
* src/Win_GParted.cc: added FIXME
2006-03-05 Artur Flinta <aflinta@cvs.gnome.org>
* configure.in: Added "pl" to ALL_LINGUAS

View File

@ -195,8 +195,6 @@ void Dialog_Partition_Info::Display_Info( )
else if ( partition .mountpoints .size() )
str_temp = String::ucompose( _("Mounted on %1"),
Glib::build_path( ", ", partition .mountpoints ) ) ;
else
str_temp = _("Unable to find mountpoint") ;
}
else if ( partition.type == GParted::TYPE_EXTENDED )
str_temp = _("Not busy (There are no mounted logical partitions)" ) ;

View File

@ -389,6 +389,8 @@ void GParted_Core::set_mountpoints( std::vector<Partition> & partitions )
iter_mp = mount_info .find( partitions[ t ] .partition );
if ( iter_mp != mount_info .end() )
partitions[ t ] .mountpoints = iter_mp ->second ;
else
partitions[ t ] .error = _("Unable to find mountpoint") ;
}
else if ( partitions[ t ] .type == GParted::TYPE_EXTENDED )
set_mountpoints( partitions[ t ] .logicals ) ;
@ -436,11 +438,14 @@ void GParted_Core::set_used_sectors( std::vector<Partition> & partitions )
{
if ( partitions[ t ] .busy )
{
if ( statvfs( partitions[ t ] .mountpoints .back() .c_str(), &sfs ) == 0 )
partitions[ t ] .Set_Unused( sfs .f_bfree * (sfs .f_bsize / 512) ) ;
else
partitions[ t ] .error =
"statvfs (" + partitions[ t ] .mountpoints .back() + "): " + Glib::strerror( errno );
if ( partitions[ t ] .mountpoints .size() > 0 )
{
if ( statvfs( partitions[ t ] .mountpoints .back() .c_str(), &sfs ) == 0 )
partitions[ t ] .Set_Unused( sfs .f_bfree * (sfs .f_bsize / 512) ) ;
else
partitions[ t ] .error =
"statvfs (" + partitions[ t ] .mountpoints .back() + "): " + Glib::strerror( errno );
}
}
else
{

View File

@ -1069,7 +1069,8 @@ bool Win_GParted::max_amount_prim_reached()
{
//Display error if user tries to create more primary partitions than the partition table can hold.
if ( ! selected_partition .inside_extended && primary_count >= devices[ current_device ] .max_prims )
{
{//FIXME..maybe we should mention the fact the user needs to remove an primary before
//he can add an extended..
Gtk::MessageDialog dialog(
*this,
String::ucompose( _("It is not possible to create more than %1 primary partitions"),