From 1e4dfd2417ce233d046fba223f42673c96e639b2 Mon Sep 17 00:00:00 2001 From: morkt Date: Fri, 18 Dec 2015 13:22:49 +0400 Subject: [PATCH] (OpenDirectoryEntry): create empty view if TryCreateViewModel failed. --- MainWindow.xaml.cs | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/MainWindow.xaml.cs b/MainWindow.xaml.cs index e090956c..134b0650 100644 --- a/MainWindow.xaml.cs +++ b/MainWindow.xaml.cs @@ -830,14 +830,20 @@ namespace GARbro.GUI int old_fs_count = VFS.Count; vm = TryCreateViewModel (new_dir); if (null == vm) - return; - - PushViewModel (vm); - if (VFS.Count > old_fs_count && null != VFS.CurrentArchive) - SetStatusText (string.Format ("{0}: {1}", VFS.CurrentArchive.Description, - Localization.Format ("MsgFiles", VFS.CurrentArchive.Dir.Count()))); + { + if (VFS.Count == old_fs_count) + return; + vm = new DirectoryViewModel (VFS.FullPath, new Entry[0], VFS.IsVirtual); + } else - SetStatusText (""); + { + if (VFS.Count > old_fs_count && null != VFS.CurrentArchive) + SetStatusText (string.Format ("{0}: {1}", VFS.CurrentArchive.Description, + Localization.Format ("MsgFiles", VFS.CurrentArchive.Dir.Count()))); + else + SetStatusText (""); + } + PushViewModel (vm); if (".." == entry.Name) lv_SelectItem (Path.GetFileName (old_dir));