Solving issue 2046: "RT crash on First run"
This commit is contained in:
@@ -340,6 +340,7 @@ void DirBrowser::open (const Glib::ustring& dirname, const Glib::ustring& fileNa
|
|||||||
|
|
||||||
dirtree->collapse_all ();
|
dirtree->collapse_all ();
|
||||||
|
|
||||||
|
// WARNING & TODO: One should test here if the directory/file has R/W access permission to avoid crash
|
||||||
|
|
||||||
Glib::RefPtr<Gio::File> dir = Gio::File::create_for_path(dirname);
|
Glib::RefPtr<Gio::File> dir = Gio::File::create_for_path(dirname);
|
||||||
if( !dir->query_exists())
|
if( !dir->query_exists())
|
||||||
@@ -348,8 +349,12 @@ void DirBrowser::open (const Glib::ustring& dirname, const Glib::ustring& fileNa
|
|||||||
Gtk::TreePath path = expandToDir (absDirPath);
|
Gtk::TreePath path = expandToDir (absDirPath);
|
||||||
dirtree->scroll_to_row (path);
|
dirtree->scroll_to_row (path);
|
||||||
dirtree->get_selection()->select (path);
|
dirtree->get_selection()->select (path);
|
||||||
for (size_t i=0; i<dllisteners.size(); i++)
|
Glib::ustring absFilePath;
|
||||||
dllisteners[i]->dirSelected (absDirPath, Glib::build_filename (absDirPath, fileName));
|
if (!fileName.empty())
|
||||||
|
absFilePath = Glib::build_filename (absDirPath, fileName);
|
||||||
|
for (size_t i=0; i<dllisteners.size(); i++) {
|
||||||
|
dllisteners[i]->dirSelected (absDirPath, absFilePath);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void DirBrowser::file_changed (const Glib::RefPtr<Gio::File>& file, const Glib::RefPtr<Gio::File>& other_file, Gio::FileMonitorEvent event_type, const Gtk::TreeModel::iterator& iter, const Glib::ustring& dirName) {
|
void DirBrowser::file_changed (const Glib::RefPtr<Gio::File>& file, const Glib::RefPtr<Gio::File>& other_file, Gio::FileMonitorEvent event_type, const Gtk::TreeModel::iterator& iter, const Glib::ustring& dirName) {
|
||||||
|
@@ -144,7 +144,7 @@ void FilePanel::init () {
|
|||||||
dirBrowser->open (argv1);
|
dirBrowser->open (argv1);
|
||||||
else {
|
else {
|
||||||
if (options.startupDir==STARTUPDIR_HOME)
|
if (options.startupDir==STARTUPDIR_HOME)
|
||||||
dirBrowser->open (Glib::get_home_dir());
|
dirBrowser->open (safe_get_user_picture_dir());
|
||||||
else if (options.startupDir==STARTUPDIR_CURRENT)
|
else if (options.startupDir==STARTUPDIR_CURRENT)
|
||||||
dirBrowser->open (argv0);
|
dirBrowser->open (argv0);
|
||||||
else if (options.startupDir==STARTUPDIR_CUSTOM || options.startupDir==STARTUPDIR_LAST) {
|
else if (options.startupDir==STARTUPDIR_CUSTOM || options.startupDir==STARTUPDIR_LAST) {
|
||||||
@@ -152,7 +152,7 @@ void FilePanel::init () {
|
|||||||
dirBrowser->open (options.startupPath);
|
dirBrowser->open (options.startupPath);
|
||||||
else {
|
else {
|
||||||
// Fallback option if the path is empty or the folder doesn't exist
|
// Fallback option if the path is empty or the folder doesn't exist
|
||||||
dirBrowser->open (Glib::get_home_dir());
|
dirBrowser->open (safe_get_user_picture_dir());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -87,7 +87,7 @@ 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 (safe_get_user_home_dir()); // Will send back "My documents" on Windows now, which has no restricted access
|
||||||
if (hfile && hfile->query_exists()) {
|
if (hfile && hfile->query_exists()) {
|
||||||
try {
|
try {
|
||||||
Glib::RefPtr<Gio::FileInfo> info = safe_query_file_info (hfile);
|
Glib::RefPtr<Gio::FileInfo> info = safe_query_file_info (hfile);
|
||||||
|
Reference in New Issue
Block a user