[f-spot/icon-view-cleanup: 18/24] Correctly decide when to make the library location sensitive



commit dbb8d5a4b76e04dd9d22c4fe2c9393cc3b3c00be
Author: Iain Lane <laney ubuntu com>
Date:   Sat Aug 14 22:45:47 2010 +0100

    Correctly decide when to make the library location sensitive
    
    When --photodir is passed, we should not allow the user to change the
    library location. The previous test was incorrect, resulting in the
    directory chooser being insensitive when it should not be, meaning
    that the user could not select a library location.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=626957

 .../MainApp/FSpot.UI.Dialog/PreferenceDialog.cs    |   12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)
---
diff --git a/src/Clients/MainApp/FSpot.UI.Dialog/PreferenceDialog.cs b/src/Clients/MainApp/FSpot.UI.Dialog/PreferenceDialog.cs
index f789947..2a12eb7 100644
--- a/src/Clients/MainApp/FSpot.UI.Dialog/PreferenceDialog.cs
+++ b/src/Clients/MainApp/FSpot.UI.Dialog/PreferenceDialog.cs
@@ -40,13 +40,15 @@ namespace FSpot.UI.Dialog {
 			TransientFor = parent;
 
 			//Photos Folder
-			if (FSpot.Core.Global.PhotoUri == new SafeUri (Preferences.Get<string> (Preferences.STORAGE_PATH))) {
-				photosdir_chooser.SetCurrentFolderUri (FSpot.Core.Global.PhotoUri);
+			photosdir_chooser.SetCurrentFolderUri (FSpot.Core.Global.PhotoUri);
+
+			SafeUri storage_path = new SafeUri (Preferences.Get<string> (Preferences.STORAGE_PATH));
+
+			//If the user has set a photo directory on the commandline then don't let it be changed in Preferences
+			if (storage_path.Equals(FSpot.Core.Global.PhotoUri))
 				photosdir_chooser.CurrentFolderChanged += HandlePhotosdirChanged;
-			} else {
-				photosdir_chooser.SetCurrentFolderUri (FSpot.Core.Global.PhotoUri);
+			else
 				photosdir_chooser.Sensitive = false;
-			}
 
 			//Write Metadata
 			LoadPreference (Preferences.METADATA_EMBED_IN_IMAGE);



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