This commit is contained in:
ghorvath
2010-04-16 10:29:18 +00:00
parent 71b74bbfd2
commit 68c4f03a59
205 changed files with 7112 additions and 15069 deletions

View File

@@ -19,6 +19,7 @@
#include <placesbrowser.h>
#include <options.h>
#include <algorithm>
#include <safegtk.h>
PlacesBrowser::PlacesBrowser () : listener (NULL) {
@@ -81,7 +82,7 @@ void PlacesBrowser::refreshPlacesList () {
// append home directory
Glib::RefPtr<Gio::File> hfile = Gio::File::create_for_path (Glib::get_home_dir ());
if (hfile) {
Glib::RefPtr<Gio::FileInfo> info = hfile->query_info ();
Glib::RefPtr<Gio::FileInfo> info = safe_query_file_info (hfile);
if (info) {
Gtk::TreeModel::Row newrow = *(placesModel->append());
newrow[placesColumns.label] = info->get_display_name ();
@@ -94,7 +95,7 @@ void PlacesBrowser::refreshPlacesList () {
// append pictures directory
hfile = Gio::File::create_for_path (Glib::get_user_special_dir (G_USER_DIRECTORY_PICTURES));
if (hfile) {
Glib::RefPtr<Gio::FileInfo> info = hfile->query_info ();
Glib::RefPtr<Gio::FileInfo> info = safe_query_file_info (hfile);
if (info) {
Gtk::TreeModel::Row newrow = *(placesModel->append());
newrow[placesColumns.label] = info->get_display_name ();
@@ -186,7 +187,7 @@ void PlacesBrowser::refreshPlacesList () {
for (int i=0; i<options.favoriteDirs.size(); i++) {
Glib::RefPtr<Gio::File> hfile = Gio::File::create_for_path (options.favoriteDirs[i]);
if (hfile) {
Glib::RefPtr<Gio::FileInfo> info = hfile->query_info ();
Glib::RefPtr<Gio::FileInfo> info = safe_query_file_info (hfile);
if (info) {
Gtk::TreeModel::Row newrow = *(placesModel->append());
newrow[placesColumns.label] = info->get_display_name ();
@@ -269,7 +270,7 @@ void PlacesBrowser::addPressed () {
// append
Glib::RefPtr<Gio::File> hfile = Gio::File::create_for_path (lastSelectedDir);
if (hfile) {
Glib::RefPtr<Gio::FileInfo> info = hfile->query_info ();
Glib::RefPtr<Gio::FileInfo> info = safe_query_file_info (hfile);
if (info) {
options.favoriteDirs.push_back (hfile->get_parse_name ());
refreshPlacesList ();