diff --git a/include/GParted_Core.h b/include/GParted_Core.h index d8ec5072..e7e84f96 100644 --- a/include/GParted_Core.h +++ b/include/GParted_Core.h @@ -35,6 +35,7 @@ public: GParted_Core() ; ~GParted_Core() ; + static void find_supported_core(); void find_supported_filesystems() ; void set_user_devices( const std::vector & user_devices ) ; void set_devices( std::vector & devices ) ; diff --git a/src/GParted_Core.cc b/src/GParted_Core.cc index 2f8398f4..a1c04566 100644 --- a/src/GParted_Core.cc +++ b/src/GParted_Core.cc @@ -75,6 +75,8 @@ namespace GParted static std::map< Glib::ustring, std::vector > mount_info ; static std::map< Glib::ustring, std::vector > fstab_info ; +static bool hdparm_found = false; + GParted_Core::GParted_Core() { thread_status_message = "" ; @@ -92,6 +94,8 @@ GParted_Core::GParted_Core() std::cout << "libparted : " << ped_get_version() << std::endl ; std::cout << "======================" << std::endl ; + find_supported_core(); + //initialize file system list init_filesystems() ; @@ -99,6 +103,11 @@ GParted_Core::GParted_Core() find_supported_filesystems() ; } +void GParted_Core::find_supported_core() +{ + hdparm_found = ! Glib::find_program_in_path( "hdparm" ).empty(); +} + void GParted_Core::find_supported_filesystems() { std::map< FILESYSTEM, FileSystem * >::iterator f ; @@ -1182,7 +1191,7 @@ Glib::ustring GParted_Core::get_partition_path( PedPartition * lp_partition ) void GParted_Core::set_device_serial_number( Device & device ) { - if ( Glib::find_program_in_path( "hdparm" ).empty() ) + if ( ! hdparm_found ) // Serial number left blank when the hdparm command is not installed. return; diff --git a/src/Win_GParted.cc b/src/Win_GParted.cc index b2a75382..18391790 100644 --- a/src/Win_GParted.cc +++ b/src/Win_GParted.cc @@ -1474,6 +1474,10 @@ void Win_GParted::menu_gparted_features() dialog .load_filesystems( gparted_core .get_filesystems() ) ; while ( dialog .run() == Gtk::RESPONSE_OK ) { + // Button [Rescan For Supported Actions] pressed in the dialog. Rescan + // for available core and file system specific commands and update the + // view accordingly in the dialog. + GParted_Core::find_supported_core(); gparted_core .find_supported_filesystems() ; dialog .load_filesystems( gparted_core .get_filesystems() ) ;