Crash when launching RT after last directory selected has been deleted. Issue #131

For some strange reason Gio exceptions are not catched well: inserted a test to verify file existence before accessing it.
This commit is contained in:
ffsup2
2010-07-06 21:37:52 +02:00
parent 6885b6f76a
commit c6a774f821
4 changed files with 16 additions and 9 deletions

View File

@@ -214,7 +214,7 @@ void CacheManager::deleteDir (const Glib::ustring& dirName) {
std::string CacheManager::getMD5 (const Glib::ustring& fname) {
Glib::RefPtr<Gio::File> file = Gio::File::create_for_path (fname);
if (file) {
if (file && file->query_exists()) {
Glib::RefPtr<Gio::FileInfo> info = safe_query_file_info (file);
if (info)
return Glib::Checksum::compute_checksum (Glib::Checksum::CHECKSUM_MD5, Glib::ustring::compose ("%1%2", fname, info->get_size()));