File prefdialog.patch of Package f-spot
From c8915bc9b92aa56a71117fe9fe41421c546865b3 Mon Sep 17 00:00:00 2001
From: sdelcroix <sdelcroix@772769d8-d925-0410-89eb-a6ffa0d40526>
Date: Tue, 18 Nov 2008 20:14:14 +0000
Subject: [PATCH] 2008-11-18 Stephane Delcroix <sdelcroix@novell.com>
* src/UI.Dialog/PreferenceDialog.cs: handle the case where the
screensaver_tag from gconf no longer exists. Fix bgo #560265.
git-svn-id: svn+ssh://svn.gnome.org/svn/f-spot/branches/FSPOT_0_5_0_STABLE@4599 772769d8-d925-0410-89eb-a6ffa0d40526
---
ChangeLog | 5 +++++
src/TagStore.cs | 1 -
src/UI.Dialog/PreferenceDialog.cs | 11 +++--------
3 files changed, 8 insertions(+), 9 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 951e9aa..1e62445 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2008-11-18 Stephane Delcroix <sdelcroix@novell.com>
+
+ * src/UI.Dialog/PreferenceDialog.cs: handle the case where the
+ screensaver_tag from gconf no longer exists. Fix bgo #560265.
+
2008-11-06 Stephane Delcroix <sdelcroix@novell.com>
* src/main.cs:
diff --git a/src/TagStore.cs b/src/TagStore.cs
index 8d570a5..b4e0e74 100644
--- a/src/TagStore.cs
+++ b/src/TagStore.cs
@@ -129,7 +129,6 @@ public class TagStore : DbStore {
foreach (Tag t in this.item_cache.Values)
if (t.Id == id)
return t;
-
return null;
}
diff --git a/src/UI.Dialog/PreferenceDialog.cs b/src/UI.Dialog/PreferenceDialog.cs
index a83056f..c1857b8 100644
--- a/src/UI.Dialog/PreferenceDialog.cs
+++ b/src/UI.Dialog/PreferenceDialog.cs
@@ -327,18 +327,13 @@ case Preferences.COLOR_MANAGEMENT_ENABLED:
use_x_profile_check.Active = active;
break;
case Preferences.SCREENSAVER_TAG:
- try {
- screensaver_tag = Preferences.Get<int> (key);
- } catch (System.Exception e) {
- Console.WriteLine (e);
- screensaver_tag = 0;
- }
- if (screensaver_tag == 0) {
+ screensaver_tag = Preferences.Get<int> (key);
+ Tag t = MainWindow.Toplevel.Database.Tags.GetTagById (screensaver_tag);
+ if (screensaver_tag == 0 || t == null) {
screensaverall_radio.Active = true;
tag_button.Sensitive = false;
} else {
screensavertagged_radio.Active = true;
- Tag t = MainWindow.Toplevel.Database.Tags.GetTagById (screensaver_tag);
tag_button.Label = t.Name;
}
break;
--
1.6.0.2