Skip to content
代码片段 群组 项目
提交 f9802240 编辑于 作者: Paddy Xu's avatar Paddy Xu
浏览文件

Fix #327: archive failed.

上级 eae3e300
No related branches found
No related tags found
无相关合并请求
......@@ -21,7 +21,7 @@
<Grid ZIndex="9999"
Visibility="{Binding ElementName=infoPanel, Path=LoadPercent, Mode=OneWay, Converter={StaticResource Percent100ToVisibilityCollapsedConverter}}">
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
<Label FontSize="14" HorizontalAlignment="Center" Foreground="{DynamicResource WindowTextForeground}">Loading archive ...</Label>
<Label x:Name="lblLoading" FontSize="14" HorizontalAlignment="Center" Foreground="{DynamicResource WindowTextForeground}">Loading archive ...</Label>
<ProgressBar Height="13" Width="150"
Value="{Binding ElementName=infoPanel, Path=LoadPercent, Mode=OneWay}" />
</StackPanel>
......
......@@ -25,6 +25,7 @@ using System.Threading.Tasks;
using System.Windows.Controls;
using QuickLook.Common.Annotations;
using QuickLook.Common.ExtensionMethods;
using QuickLook.Common.Helpers;
using SharpCompress.Archives;
using SharpCompress.Common;
using SharpCompress.Readers;
......@@ -83,7 +84,16 @@ namespace QuickLook.Plugin.ArchiveViewer
var root = new ArchiveFileEntry(Path.GetFileName(path), true);
_fileEntries.Add("", root);
LoadItemsFromArchive(path);
try
{
LoadItemsFromArchive(path);
}
catch (Exception e)
{
ProcessHelper.WriteLog(e.ToString());
Dispatcher.Invoke(() => { lblLoading.Content = "Preview failed. See log for more details."; });
return;
}
var folders = -1; // do not count root node
var files = 0;
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册