mirror of
https://gitlab.gnome.org/GNOME/gparted
synced 2024-11-05 20:46:55 +00:00
Clean up code for old bug #157871
Remove commented code and boolean use-C-lang parameter for Utils::num_to_str() method because this bug was fixed in gcc-4.0.3. The GNU gcc compiler versions 4 and up are now commonly in use. Also due to previous partial commenting and removal of the code, the code was non-functional Thanks goes to Jan Claeys for pointing out this clean up opportunity.
This commit is contained in:
parent
4cdc86b4bf
commit
20f5c6f83b
7 changed files with 14 additions and 16 deletions
|
@ -1,5 +1,5 @@
|
|||
/* Copyright (C) 2004 Bart
|
||||
* Copyright (C) 2008, 2009 Curtis Gedak
|
||||
* Copyright (C) 2008, 2009, 2010 Curtis Gedak
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -130,7 +130,7 @@ public:
|
|||
bool wrap = false,
|
||||
bool selectable = false,
|
||||
const Glib::ustring & text_color = "black" ) ;
|
||||
static Glib::ustring num_to_str( Sector number, bool use_C_locale = false ) ;
|
||||
static Glib::ustring num_to_str( Sector number ) ;
|
||||
static Glib::ustring get_color( FILESYSTEM filesystem ) ;
|
||||
static Glib::RefPtr<Gdk::Pixbuf> get_color_as_pixbuf( FILESYSTEM filesystem, int width, int height ) ;
|
||||
static Glib::ustring get_filesystem_string( FILESYSTEM filesystem ) ;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/* Copyright (C) 2004 Bart 'plors' Hakvoort
|
||||
* Copyright (C) 2008, 2009 Curtis Gedak
|
||||
* Copyright (C) 2008, 2009, 2010 Curtis Gedak
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -56,10 +56,9 @@ Gtk::Label * Utils::mk_label( const Glib::ustring & text,
|
|||
return label ;
|
||||
}
|
||||
|
||||
Glib::ustring Utils::num_to_str( Sector number, bool use_C_locale )
|
||||
Glib::ustring Utils::num_to_str( Sector number )
|
||||
{
|
||||
std::stringstream ss ;
|
||||
//ss.imbue( std::locale( use_C_locale ? "C" : "" ) ) ; see #157871
|
||||
ss << number ;
|
||||
return ss .str() ;
|
||||
}
|
||||
|
@ -171,7 +170,6 @@ Glib::ustring Utils::get_filesystem_software( FILESYSTEM filesystem )
|
|||
Glib::ustring Utils::format_size( Sector size )
|
||||
{
|
||||
std::stringstream ss ;
|
||||
//ss .imbue( std::locale( "" ) ) ; see #157871
|
||||
ss << std::setiosflags( std::ios::fixed ) << std::setprecision( 2 ) ;
|
||||
|
||||
if ( size < KIBIBYTE )
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/* Copyright (C) 2004 Bart
|
||||
* Copyright (C) 2008 Curtis Gedak
|
||||
* Copyright (C) 2008, 2009, 2010 Curtis Gedak
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -116,7 +116,7 @@ bool ext2::resize( const Partition & partition_new, OperationDetail & operationd
|
|||
|
||||
if ( ! fill_partition )
|
||||
str_temp += " " + Utils::num_to_str( Utils::round( Utils::sector_to_unit(
|
||||
partition_new .get_length(), UNIT_KIB ) ) -1, true ) + "K" ;
|
||||
partition_new .get_length(), UNIT_KIB ) ) -1 ) + "K" ;
|
||||
|
||||
return ! execute_command( str_temp, operationdetail ) ;
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/* Copyright (C) 2004 Bart
|
||||
* Copyright (C) 2008 Curtis Gedak
|
||||
* Copyright (C) 2008, 2009, 2010 Curtis Gedak
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -117,7 +117,7 @@ bool ext3::resize( const Partition & partition_new, OperationDetail & operationd
|
|||
|
||||
if ( ! fill_partition )
|
||||
str_temp += " " + Utils::num_to_str( Utils::round( Utils::sector_to_unit(
|
||||
partition_new .get_length(), GParted::UNIT_KIB ) ) -1, true ) + "K" ;
|
||||
partition_new .get_length(), GParted::UNIT_KIB ) ) -1 ) + "K" ;
|
||||
|
||||
return ! execute_command( str_temp, operationdetail ) ;
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (C) 2008 Curtis Gedak
|
||||
/* Copyright (C) 2008, 2009, 2010 Curtis Gedak
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -120,7 +120,7 @@ bool ext4::resize( const Partition & partition_new, OperationDetail & operationd
|
|||
|
||||
if ( ! fill_partition )
|
||||
str_temp += " " + Utils::num_to_str( Utils::round( Utils::sector_to_unit(
|
||||
partition_new .get_length(), GParted::UNIT_KIB ) ) -1, true ) + "K" ;
|
||||
partition_new .get_length(), GParted::UNIT_KIB ) ) -1 ) + "K" ;
|
||||
|
||||
return ! execute_command( str_temp, operationdetail ) ;
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/* Copyright (C) 2004 Bart
|
||||
* Copyright (C) 2008, 2009 Curtis Gedak
|
||||
* Copyright (C) 2008, 2009, 2010 Curtis Gedak
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -118,7 +118,7 @@ bool ntfs::resize( const Partition & partition_new, OperationDetail & operationd
|
|||
{
|
||||
str_temp += " -s " ;
|
||||
str_temp += Utils::num_to_str( Utils::round( Utils::sector_to_unit(
|
||||
partition_new .get_length(), GParted::UNIT_BYTE ) ) -1, true ) ;
|
||||
partition_new .get_length(), GParted::UNIT_BYTE ) ) -1 ) ;
|
||||
}
|
||||
|
||||
//simulation..
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/* Copyright (C) 2004 Bart
|
||||
* Copyright (C) 2008 Curtis Gedak
|
||||
* Copyright (C) 2008, 2009, 2010 Curtis Gedak
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -124,7 +124,7 @@ bool reiserfs::resize( const Partition & partition_new, OperationDetail & operat
|
|||
{
|
||||
str_temp += " -s " ;
|
||||
str_temp += Utils::num_to_str( Utils::round( Utils::sector_to_unit(
|
||||
partition_new .get_length(), GParted::UNIT_BYTE ) ) -1, true ) ;
|
||||
partition_new .get_length(), GParted::UNIT_BYTE ) ) -1 ) ;
|
||||
}
|
||||
|
||||
exit_status = execute_command( str_temp, operationdetail ) ;
|
||||
|
|
Loading…
Reference in a new issue