浏览代码

WinRT: fix MRU list lost

Lou Yihua 7 年之前
父节点
当前提交
21ce1709b6
共有 1 个文件被更改,包括 2 次插入4 次删除
  1. 2 4
      winrt/SDLPal.Common/MainPage.xaml.cpp

+ 2 - 4
winrt/SDLPal.Common/MainPage.xaml.cpp

@@ -107,6 +107,7 @@ void SDLPal::MainPage::LoadControlContents(bool loadDefault)
 			{
 				auto item = AWait(fal->GetItemAsync(entry.Token), g_eventHandle);
 				auto& ace = m_acl[PAL_ConfigIndex(ConvertString(entry.Token).c_str())];
+				StorageApplicationPermissions::MostRecentlyUsedList->AddOrReplace(entry.Token, item, entry.Metadata);
 				ace->text->Text = entry.Metadata;
 				if (ace->check)
 				{
@@ -232,7 +233,7 @@ void SDLPal::MainPage::btnFinish_Click(Platform::Object^ sender, Windows::UI::Xa
 		for (auto i = m_acl.begin(); i != m_acl.end(); i++)
 		{
 			auto entry = i->second;
-			try
+			if (mru->ContainsItem(entry->token))
 			{
 				auto item = AWait(mru->GetItemAsync(entry->token), g_eventHandle);
 				if ((!entry->check || entry->check->IsChecked->Value) && item)
@@ -240,9 +241,6 @@ void SDLPal::MainPage::btnFinish_Click(Platform::Object^ sender, Windows::UI::Xa
 					fal->AddOrReplace(entry->token, item, entry->text->Text);
 				}
 			}
-			catch (Exception ^)
-			{
-			}
 		}
 		mru->Clear();