From 153b1cd2c9d90f58ff73c4c346f08de730df6043 Mon Sep 17 00:00:00 2001 From: RKrom Date: Thu, 2 Aug 2012 19:45:59 +0000 Subject: [PATCH] Fixed Bug #3553527, had changed a bit of logic for creating the ini-values to work as it supposed to but only changed the dictionary.add and forgot to change the dictionary.contains. This caused a key to be added twice. git-svn-id: http://svn.code.sf.net/p/greenshot/code/trunk@1972 7dccd23d-a4a3-4e1f-8c07-b4c1b4018ab4 --- GreenshotPlugin/IniFile/IniConfig.cs | 1 + GreenshotPlugin/IniFile/IniSection.cs | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/GreenshotPlugin/IniFile/IniConfig.cs b/GreenshotPlugin/IniFile/IniConfig.cs index ba648bda3..a4ed1da22 100644 --- a/GreenshotPlugin/IniFile/IniConfig.cs +++ b/GreenshotPlugin/IniFile/IniConfig.cs @@ -40,6 +40,7 @@ namespace Greenshot.IniFile { private static Dictionary sectionMap = new Dictionary(); private static Dictionary> sections = new Dictionary>(); private static Dictionary> fixedProperties = null; + public static event FileSystemEventHandler IniChanged; private static bool portableCheckMade = false; diff --git a/GreenshotPlugin/IniFile/IniSection.cs b/GreenshotPlugin/IniFile/IniSection.cs index 91082a578..19eea9a0e 100644 --- a/GreenshotPlugin/IniFile/IniSection.cs +++ b/GreenshotPlugin/IniFile/IniSection.cs @@ -121,8 +121,8 @@ namespace Greenshot.IniFile { // Iterate over the members and create IniValueContainers foreach (FieldInfo fieldInfo in iniSectionType.GetFields()) { if (Attribute.IsDefined(fieldInfo, typeof(IniPropertyAttribute))) { - if (!Values.ContainsKey(fieldInfo.Name)) { - IniPropertyAttribute iniPropertyAttribute = (IniPropertyAttribute)fieldInfo.GetCustomAttributes(typeof(IniPropertyAttribute), false)[0]; + IniPropertyAttribute iniPropertyAttribute = (IniPropertyAttribute)fieldInfo.GetCustomAttributes(typeof(IniPropertyAttribute), false)[0]; + if (!Values.ContainsKey(iniPropertyAttribute.Name)) { Values.Add(iniPropertyAttribute.Name, new IniValue(this, fieldInfo, iniPropertyAttribute)); } }