Added patch by Jan to address crash at startup on ArchLinux 64 bit
This commit is contained in:
@@ -78,37 +78,42 @@ PlacesBrowser::PlacesBrowser () : listener (NULL) {
|
|||||||
void PlacesBrowser::refreshPlacesList () {
|
void PlacesBrowser::refreshPlacesList () {
|
||||||
|
|
||||||
placesModel->clear ();
|
placesModel->clear ();
|
||||||
|
|
||||||
// append home directory
|
// append home directory
|
||||||
Glib::RefPtr<Gio::File> hfile = Gio::File::create_for_path (Glib::get_home_dir ());
|
Glib::RefPtr<Gio::File> hfile = Gio::File::create_for_path (Glib::get_home_dir ());
|
||||||
if (hfile) {
|
if (hfile) {
|
||||||
|
try {
|
||||||
Glib::RefPtr<Gio::FileInfo> info = safe_query_file_info (hfile);
|
Glib::RefPtr<Gio::FileInfo> info = safe_query_file_info (hfile);
|
||||||
if (info) {
|
if (info) {
|
||||||
Gtk::TreeModel::Row newrow = *(placesModel->append());
|
Gtk::TreeModel::Row newrow = *(placesModel->append());
|
||||||
newrow[placesColumns.label] = info->get_display_name ();
|
newrow[placesColumns.label] = info->get_display_name ();
|
||||||
newrow[placesColumns.icon] = info->get_icon ();
|
newrow[placesColumns.icon] = info->get_icon ();
|
||||||
newrow[placesColumns.root] = hfile->get_parse_name ();
|
newrow[placesColumns.root] = hfile->get_parse_name ();
|
||||||
newrow[placesColumns.type] = 4;
|
newrow[placesColumns.type] = 4;
|
||||||
newrow[placesColumns.rowSeparator] = false;
|
newrow[placesColumns.rowSeparator] = false;
|
||||||
}
|
}
|
||||||
|
} catch (Gio::Error&) { /* This will be thrown if the path doesn't exist */ }
|
||||||
}
|
}
|
||||||
|
|
||||||
// append pictures directory
|
// append pictures directory
|
||||||
hfile = Gio::File::create_for_path (Glib::get_user_special_dir (G_USER_DIRECTORY_PICTURES));
|
hfile = Gio::File::create_for_path (Glib::get_user_special_dir (G_USER_DIRECTORY_PICTURES));
|
||||||
if (hfile) {
|
if (hfile) {
|
||||||
|
try {
|
||||||
Glib::RefPtr<Gio::FileInfo> info = safe_query_file_info (hfile);
|
Glib::RefPtr<Gio::FileInfo> info = safe_query_file_info (hfile);
|
||||||
if (info) {
|
if (info) {
|
||||||
Gtk::TreeModel::Row newrow = *(placesModel->append());
|
Gtk::TreeModel::Row newrow = *(placesModel->append());
|
||||||
newrow[placesColumns.label] = info->get_display_name ();
|
newrow[placesColumns.label] = info->get_display_name ();
|
||||||
newrow[placesColumns.icon] = info->get_icon ();
|
newrow[placesColumns.icon] = info->get_icon ();
|
||||||
newrow[placesColumns.root] = hfile->get_parse_name ();
|
newrow[placesColumns.root] = hfile->get_parse_name ();
|
||||||
newrow[placesColumns.type] = 4;
|
newrow[placesColumns.type] = 4;
|
||||||
newrow[placesColumns.rowSeparator] = false;
|
newrow[placesColumns.rowSeparator] = false;
|
||||||
}
|
}
|
||||||
|
} catch (Gio::Error&) { /* This will be thrown if the path doesn't exist */ }
|
||||||
}
|
}
|
||||||
|
|
||||||
if (placesModel->children().size()>0) {
|
if (placesModel->children().size()>0) {
|
||||||
Gtk::TreeModel::Row newrow = *(placesModel->append());
|
Gtk::TreeModel::Row newrow = *(placesModel->append());
|
||||||
newrow[placesColumns.rowSeparator] = true;
|
newrow[placesColumns.rowSeparator] = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// scan all drives
|
// scan all drives
|
||||||
|
Reference in New Issue
Block a user