diff --git a/rtgui/placesbrowser.cc b/rtgui/placesbrowser.cc index 45332a734..8e6eebec7 100644 --- a/rtgui/placesbrowser.cc +++ b/rtgui/placesbrowser.cc @@ -76,6 +76,11 @@ PlacesBrowser::PlacesBrowser () : listener (NULL) { show_all (); } +// For drive letter comparison +bool compareMountByRoot (Glib::RefPtr a,Glib::RefPtr b) { + return a->get_root()->get_parse_name() < b->get_root()->get_parse_name(); +} + void PlacesBrowser::refreshPlacesList () { placesModel->clear (); @@ -173,8 +178,16 @@ void PlacesBrowser::refreshPlacesList () { } } } - // placess not belonging to volumes + + // places not belonging to volumes + // (Drives in Windows) std::vector > mounts = vm->get_mounts (); + +#ifdef WIN32 + // on Windows, it's usual to sort by drive letter, not by name + std::sort (mounts.begin(), mounts.end(), compareMountByRoot); +#endif + for (int i=0; iget_volume ()) { Gtk::TreeModel::Row newrow = *(placesModel->append());