[pdfmod] If a file is not found, it is removed from the recent files list



commit 9983338705794c3e622ed459b253e9c6c62eff9c
Author: Robert Dyer <psybers gmail com>
Date:   Mon Aug 24 12:19:04 2009 -0700

    If a file is not found, it is removed from the recent files list
    
    Signed-off-by: Gabriel Burt <gabriel burt gmail com>

 src/PdfMod/Gui/Client.cs |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)
---
diff --git a/src/PdfMod/Gui/Client.cs b/src/PdfMod/Gui/Client.cs
index 217e84f..fa59b77 100644
--- a/src/PdfMod/Gui/Client.cs
+++ b/src/PdfMod/Gui/Client.cs
@@ -254,12 +254,18 @@ namespace PdfMod.Gui
                     Document = null;
                     ThreadAssist.ProxyToMain (delegate {
                         status_label.Text = "";
+                        if (e is System.IO.FileNotFoundException) {
+                            try {
+                                RecentManager.Default.RemoveItem (new Uri(path).AbsoluteUri);
+                            } catch {}
+                        }
                     });
+
                     Hyena.Log.Exception (e);
                     Hyena.Log.Error (
                         Catalog.GetString ("Error Loading Document"),
-                            String.Format (Catalog.GetString ("There was an error loading {0}"), GLib.Markup.EscapeText (path ?? "")), true
-                                );
+                        String.Format (Catalog.GetString ("There was an error loading {0}"), GLib.Markup.EscapeText (path ?? "")), true
+                    );
                 } finally {
                     lock (this) {
                         loading = false;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]