[gnome-boxes] Handle stale file references from tracker
- From: Alexander Larsson <alexl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-boxes] Handle stale file references from tracker
- Date: Tue, 27 Nov 2012 09:47:47 +0000 (UTC)
commit 685894c563c977ceab2851f84dacae64afad2e6f
Author: Alexander Larsson <alexl redhat com>
Date: Tue Nov 27 10:45:54 2012 +0100
Handle stale file references from tracker
Tracker may give us old data, like if a file was moved/deleted and
not yet rescanned. Currently this makes us give some hard to understand
error when selecting the iso where the file doesn't exist. We now
ensure the file is availible, so such files will not be listed in
the new box wizard.
src/media-manager.vala | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
---
diff --git a/src/media-manager.vala b/src/media-manager.vala
index 536d198..bc4d67a 100644
--- a/src/media-manager.vala
+++ b/src/media-manager.vala
@@ -133,6 +133,9 @@ private class Boxes.MediaManager : Object {
string? label,
string? os_id,
string? media_id) throws GLib.Error {
+ if (!FileUtils.test (path, FileTest.EXISTS))
+ throw new Boxes.Error.INVALID (_("No such file %s").printf (path));
+
if (label == null || os_id == null || media_id == null)
return yield create_installer_media_for_path (path, null);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]