Skip to content

Commit

Permalink
Fixed duplicate dropdown items when loading history.
Browse files Browse the repository at this point in the history
  • Loading branch information
mousebyte committed Dec 23, 2018
1 parent 4b2d923 commit 0190459
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 6 deletions.
4 changes: 4 additions & 0 deletions Logophi.sln
Original file line number Diff line number Diff line change
Expand Up @@ -36,19 +36,23 @@ Global
{47748A5F-CB22-4547-8C64-DA549F31D6B9}.All|x86.ActiveCfg = Release|x86
{47748A5F-CB22-4547-8C64-DA549F31D6B9}.All|x86.Build.0 = Release|x86
{47748A5F-CB22-4547-8C64-DA549F31D6B9}.Debug|Any CPU.ActiveCfg = Debug|x86
{47748A5F-CB22-4547-8C64-DA549F31D6B9}.Debug|Any CPU.Build.0 = Debug|x86
{47748A5F-CB22-4547-8C64-DA549F31D6B9}.Debug|x86.ActiveCfg = Debug|x86
{47748A5F-CB22-4547-8C64-DA549F31D6B9}.Debug|x86.Build.0 = Debug|x86
{47748A5F-CB22-4547-8C64-DA549F31D6B9}.Release|Any CPU.ActiveCfg = Release|x86
{47748A5F-CB22-4547-8C64-DA549F31D6B9}.Release|Any CPU.Build.0 = Release|x86
{47748A5F-CB22-4547-8C64-DA549F31D6B9}.Release|x86.ActiveCfg = Release|x86
{47748A5F-CB22-4547-8C64-DA549F31D6B9}.Release|x86.Build.0 = Release|x86
{80D411D2-4531-46BE-ABA9-DE533FF9E5DC}.All|Any CPU.ActiveCfg = Release|x86
{80D411D2-4531-46BE-ABA9-DE533FF9E5DC}.All|Any CPU.Build.0 = Release|x86
{80D411D2-4531-46BE-ABA9-DE533FF9E5DC}.All|x86.ActiveCfg = Release|x86
{80D411D2-4531-46BE-ABA9-DE533FF9E5DC}.All|x86.Build.0 = Release|x86
{80D411D2-4531-46BE-ABA9-DE533FF9E5DC}.Debug|Any CPU.ActiveCfg = Debug|x86
{80D411D2-4531-46BE-ABA9-DE533FF9E5DC}.Debug|Any CPU.Build.0 = Debug|x86
{80D411D2-4531-46BE-ABA9-DE533FF9E5DC}.Debug|x86.ActiveCfg = Debug|x86
{80D411D2-4531-46BE-ABA9-DE533FF9E5DC}.Debug|x86.Build.0 = Debug|x86
{80D411D2-4531-46BE-ABA9-DE533FF9E5DC}.Release|Any CPU.ActiveCfg = Release|x86
{80D411D2-4531-46BE-ABA9-DE533FF9E5DC}.Release|Any CPU.Build.0 = Release|x86
{80D411D2-4531-46BE-ABA9-DE533FF9E5DC}.Release|x86.ActiveCfg = Release|x86
{80D411D2-4531-46BE-ABA9-DE533FF9E5DC}.Release|x86.Build.0 = Release|x86
EndGlobalSection
Expand Down
6 changes: 3 additions & 3 deletions Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("0.2.19.6931")]
[assembly: AssemblyFileVersion("0.2.19.0")]
[assembly: AssemblyInformationalVersion("0.2.0-alpha-19")]
[assembly: AssemblyVersion("0.2.22.6931")]
[assembly: AssemblyFileVersion("0.2.22.0")]
[assembly: AssemblyInformationalVersion("0.2.0-alpha-22")]
1 change: 1 addition & 0 deletions SearchHistory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ public bool PersistentHistory {
private void WriteHistory()
{
var formatter = new BinaryFormatter();
File.Delete(_filePath);
using (var strm = File.OpenWrite(_filePath))
formatter.Serialize(strm, _data);
}
Expand Down
7 changes: 4 additions & 3 deletions Views/Presentation/MainFormPresenter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,11 @@ public void Present
(IMainFormView view)
{
View = view;
_history.MaxItems = (int)Settings.Default.MaxHistory;
if(_history.Count > 0)
_history.MaxItems = (int) Settings.Default.MaxHistory;
if (_history.Count > 0)
foreach (var i in _history)
view.DropDownItems.Add(i);
if (!view.DropDownItems.Contains(i))
view.DropDownItems.Add(i);
View.Search += OnSearch;
View.SelectedDefinitionChanged +=
OnSelectedDefinitionChanged;
Expand Down

0 comments on commit 0190459

Please sign in to comment.