mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-05 10:46:33 +02:00
[Peek]Upgrade SharpCompress and minor ArchivePreviewer changes (#32637)
This commit is contained in:
committed by
GitHub
parent
77d3071fb3
commit
3046d1e3e1
@@ -5,7 +5,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Data;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
@@ -28,6 +27,8 @@ namespace Peek.FilePreviewer.Previewers.Archives
|
||||
{
|
||||
public partial class ArchivePreviewer : ObservableObject, IArchivePreviewer
|
||||
{
|
||||
private static readonly char[] _keySeparators = { '/', '\\' };
|
||||
|
||||
private readonly IconCache _iconCache = new();
|
||||
private int _directoryCount;
|
||||
private int _fileCount;
|
||||
@@ -125,10 +126,12 @@ namespace Peek.FilePreviewer.Previewers.Archives
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(entry, nameof(entry));
|
||||
|
||||
var levels = entry!.Key
|
||||
.Split('/', '\\')
|
||||
.Where(l => !string.IsNullOrWhiteSpace(l))
|
||||
.ToArray();
|
||||
if (entry.Key == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var levels = entry.Key.Split(_keySeparators, StringSplitOptions.RemoveEmptyEntries);
|
||||
|
||||
ArchiveItem? parent = null;
|
||||
for (var i = 0; i < levels.Length; i++)
|
||||
@@ -209,7 +212,7 @@ namespace Peek.FilePreviewer.Previewers.Archives
|
||||
|
||||
private static readonly HashSet<string> _supportedFileTypes = new()
|
||||
{
|
||||
".zip", ".rar", ".7z", ".tar", ".nupkg", ".jar", ".gz", ".tar", ".tar.gz", ".tgz",
|
||||
".zip", ".rar", ".7z", ".tar", ".nupkg", ".jar", ".gz", ".tar.gz", ".tgz",
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user