diff --git a/DisplayMagician/IconFromFile.cs b/DisplayMagician/IconFromFile.cs index 1670579..d5a8f69 100644 --- a/DisplayMagician/IconFromFile.cs +++ b/DisplayMagician/IconFromFile.cs @@ -52,6 +52,7 @@ namespace DisplayMagician [System.Runtime.InteropServices.DllImport("Kernel32.dll")] public static extern Boolean CloseHandle(IntPtr handle); +#pragma warning disable 0649 private struct IMAGELISTDRAWPARAMS { public int cbSize; @@ -72,6 +73,7 @@ namespace DisplayMagician public int Frame; public int crEffect; } +#pragma warning restore 0649 [StructLayout(LayoutKind.Sequential)] private struct IMAGEINFO @@ -125,7 +127,7 @@ namespace DisplayMagician [PreserveSig] int Remove( - int i); + int i); [PreserveSig] int GetIcon( diff --git a/DisplayMagician/UIForms/DisplayProfileForm.cs b/DisplayMagician/UIForms/DisplayProfileForm.cs index 05bff8c..e9fa68e 100644 --- a/DisplayMagician/UIForms/DisplayProfileForm.cs +++ b/DisplayMagician/UIForms/DisplayProfileForm.cs @@ -94,7 +94,7 @@ namespace DisplayMagician.UIForms // select the foreach (ProfileItem newSelectedProfile in ProfileRepository.AllProfiles) { - if (newSelectedProfile.Name.Equals(ilv_saved_profiles.Items[ilvItemToSelect].Text)) + if (newSelectedProfile.UUID.Equals(ilv_saved_profiles.Items[ilvItemToSelect].EquipmentModel)) { ChangeSelectedProfile(newSelectedProfile); } diff --git a/DisplayMagician/UIForms/ImageListViewRenderers.cs b/DisplayMagician/UIForms/ImageListViewRenderers.cs index e0626f2..821875d 100644 --- a/DisplayMagician/UIForms/ImageListViewRenderers.cs +++ b/DisplayMagician/UIForms/ImageListViewRenderers.cs @@ -267,7 +267,7 @@ namespace DisplayMagician.UIForms { Rectangle pos = Utility.GetSizedImageBounds(img, new Rectangle(bounds.Location + itemPadding, ImageListView.ThumbnailSize)); - ProfileItem profileToRender = ProfileRepository.GetProfile(item.Text); + ProfileItem profileToRender = ProfileRepository.GetProfile(item.EquipmentModel); if (profileToRender.IsPossible) { // Draw the full color image as the shortcuts is not invalid diff --git a/DisplayMagician/UIForms/ProfileAdaptor.cs b/DisplayMagician/UIForms/ProfileAdaptor.cs index 8a7b277..f3b8c1b 100644 --- a/DisplayMagician/UIForms/ProfileAdaptor.cs +++ b/DisplayMagician/UIForms/ProfileAdaptor.cs @@ -98,7 +98,7 @@ namespace DisplayMagician.UIForms profileToUse = ProfileRepository.CurrentProfile; } - return profileToUse.Name; + return profileToUse.UUID; } catch (Exception ex) { @@ -205,7 +205,7 @@ namespace DisplayMagician.UIForms details.Add(new Utility.Tuple(ColumnType.Dimensions, string.Empty, mySize)); details.Add(new Utility.Tuple(ColumnType.Resolution, string.Empty, mySizeF)); details.Add(new Utility.Tuple(ColumnType.ImageDescription, string.Empty, name ?? "")); - details.Add(new Utility.Tuple(ColumnType.EquipmentModel, string.Empty, "")); + details.Add(new Utility.Tuple(ColumnType.EquipmentModel, string.Empty, profileToUse.UUID)); details.Add(new Utility.Tuple(ColumnType.DateTaken, string.Empty, now)); details.Add(new Utility.Tuple(ColumnType.Artist, string.Empty, "")); details.Add(new Utility.Tuple(ColumnType.Copyright, string.Empty, "")); diff --git a/DisplayMagicianShared/ProfileItem.cs b/DisplayMagicianShared/ProfileItem.cs index 5b15ba4..c452c04 100644 --- a/DisplayMagicianShared/ProfileItem.cs +++ b/DisplayMagicianShared/ProfileItem.cs @@ -326,13 +326,16 @@ namespace DisplayMagicianShared // If run-time types are not exactly the same, return false. if (this.GetType() != other.GetType()) return false; - + + // Check if the profile identifiers are not the same, then return false + if (!ProfileDisplayIdentifiers.SequenceEqual(other.ProfileDisplayIdentifiers)) + return false; + // Check whether the profiles' properties are equal // We need to exclude the name as the name is solely for saving to disk // and displaying to the user. // Two profiles are equal only when they have the same viewport data - //if (Paths.SequenceEqual(other.Paths)) - if (ProfileDisplayIdentifiers.SequenceEqual(other.ProfileDisplayIdentifiers)) + if (Paths.SequenceEqual(other.Paths)) return true; else return false;