f-spot r4064 - trunk/src
- From: sdelcroix svn gnome org
- To: svn-commits-list gnome org
- Subject: f-spot r4064 - trunk/src
- Date: Fri, 13 Jun 2008 12:38:17 +0000 (UTC)
Author: sdelcroix
Date: Fri Jun 13 12:38:17 2008
New Revision: 4064
URL: http://svn.gnome.org/viewvc/f-spot?rev=4064&view=rev
Log:
safer getter
Modified:
trunk/src/Preferences.cs
Modified: trunk/src/Preferences.cs
==============================================================================
--- trunk/src/Preferences.cs (original)
+++ trunk/src/Preferences.cs Fri Jun 13 12:38:17 2008
@@ -116,8 +116,6 @@
case MAIN_WINDOW_Y:
case MAIN_WINDOW_HEIGHT:
case MAIN_WINDOW_WIDTH:
- return null;
-
case IMPORT_WINDOW_HEIGHT:
case IMPORT_WINDOW_WIDTH:
case IMPORT_WINDOW_PANE_POSITION:
@@ -213,11 +211,15 @@
return (T)o;
try {
- val = (T) Backend.Get (key);
- } catch (NoSuchKeyException) {
- val = (T) GetDefault (key);
- } catch (InvalidCastException) {
- val = (T) GetDefault (key);
+ try {
+ val = (T) Backend.Get (key);
+ } catch (NoSuchKeyException) {
+ val = (T) GetDefault (key);
+ } catch (InvalidCastException) {
+ val = (T) GetDefault (key);
+ }
+ } catch {
+ val = default(T);
}
cache.Add (key, val);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]