Fixed crash on startup with Russian language

svn path=/trunk/; revision=1061
This commit is contained in:
Curtis Gedak 2009-02-09 17:58:42 +00:00
parent 4d80ef7f0e
commit a1f9a0c191
2 changed files with 12 additions and 3 deletions

View File

@ -1,6 +1,12 @@
2009-02-09 Curtis Gedak <gedakc@gmail.com> 2009-02-09 Curtis Gedak <gedakc@gmail.com>
* README: Added -02-06 Curtis Gedak <gedakc@gmail.com> * src/Win_GParted.cc: Fixed crash on startup with Russian language.
- Thanks to Dmitriy Motitskiy for small patch.
- Closes GParted bug #570855
* README: Added note blkid is used for ext4 detection.
2009-02-06 Curtis Gedak <gedakc@gmail.com>
* configure.in: Append -svn to version for continuing development * configure.in: Append -svn to version for continuing development

View File

@ -229,9 +229,12 @@ void Win_GParted::init_toolbar()
// FIXME: Is there a better way to do this, perhaps without the conditional? At the moment this seems to be the best compromise. // FIXME: Is there a better way to do this, perhaps without the conditional? At the moment this seems to be the best compromise.
bool display_undo = true ; bool display_undo = true ;
if( str_temp .length() > 14 ) { if( str_temp .length() > 14 ) {
str_temp .replace( str_temp .find( "/" ), 1, "\n/" ) ; size_t index = str_temp .find( "/" ) ;
if ( index != Glib::ustring::npos ) {
str_temp .replace( index, 1, "\n/" ) ;
display_undo = false ; display_undo = false ;
} }
}
toolbutton = Gtk::manage(new Gtk::ToolButton( *image, str_temp )); toolbutton = Gtk::manage(new Gtk::ToolButton( *image, str_temp ));
toolbutton ->signal_clicked().connect( sigc::mem_fun(*this, &Win_GParted::activate_resize) ); toolbutton ->signal_clicked().connect( sigc::mem_fun(*this, &Win_GParted::activate_resize) );
toolbar_main.append(*toolbutton); toolbar_main.append(*toolbutton);