List of recent updated posts was pointing to the old folder

The problem was that the list of files recently worked on was cached and
not based on the  new folder that was updated in option.

I was working on a more OO method but got tangled in a bunch of
reference issues.

I did find an existing  method for updating the list recent files it
does rely on the relationship between Forms, Controls and Parent
objects.
This commit is contained in:
Mark Downie 2016-01-31 15:40:01 -05:00
parent 4c12f672ee
commit 2fa7c67263
2 changed files with 7 additions and 2 deletions

View File

@ -1383,7 +1383,7 @@ namespace OpenLiveWriter.PostEditor
}
}
private void FirePostListChangedEvent()
public void FirePostListChangedEvent()
{
try
{

View File

@ -17,6 +17,7 @@ using OpenLiveWriter.ApplicationFramework;
using OpenLiveWriter.ApplicationFramework.Preferences;
using OpenLiveWriter.PostEditor.WordCount;
using System.IO;
using OpenLiveWriter.PostEditor.JumpList;
namespace OpenLiveWriter.PostEditor
{
@ -169,11 +170,15 @@ namespace OpenLiveWriter.PostEditor
result = MessageBox.Show(message, caption, buttons);
if (result == System.Windows.Forms.DialogResult.Yes)
if (result == DialogResult.Yes)
{
MovePosts(Path.Combine(_originalFolder + @"\\Recent Posts\\"), destinationRecentPosts);
MovePosts(Path.Combine(_originalFolder + @"\\Drafts\\"), destinationDrafts);
PostEditorForm frm = (PostEditorForm)Application.OpenForms?[0];
PostEditorMainControl ctrl = (PostEditorMainControl)frm?.Controls?[0];
ctrl?.FirePostListChangedEvent();
}
_postEditorPreferences.Changed();