Skip to content

Commit 19805f0

Browse files
committed
Move archive viewer files to ArchiveFile namespace
Renamed and reorganized ArchiveViewer files into a new ArchiveFile subfolder and namespace for better code structure. Updated all relevant namespaces and references accordingly. Minor code cleanups were also applied, such as using collection initializers and default keyword.
1 parent 7073b13 commit 19805f0

File tree

10 files changed

+19
-17
lines changed

10 files changed

+19
-17
lines changed

QuickLook.Plugin/QuickLook.Plugin.ArchiveViewer/ArchiveFileEntry.cs renamed to QuickLook.Plugin/QuickLook.Plugin.ArchiveViewer/ArchiveFile/ArchiveFileEntry.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
using System.Collections.Generic;
2020
using System.Linq;
2121

22-
namespace QuickLook.Plugin.ArchiveViewer;
22+
namespace QuickLook.Plugin.ArchiveViewer.ArchiveFile;
2323

2424
public class ArchiveFileEntry : IComparable<ArchiveFileEntry>
2525
{
@@ -36,7 +36,7 @@ public ArchiveFileEntry(string name, bool isFolder, ArchiveFileEntry parent = nu
3636
_parent?.Children.Add(this, false);
3737
}
3838

39-
public SortedList<ArchiveFileEntry, bool> Children { get; set; } = new SortedList<ArchiveFileEntry, bool>();
39+
public SortedList<ArchiveFileEntry, bool> Children { get; set; } = [];
4040

4141
public string Name { get; set; }
4242
public bool Encrypted { get; set; }

QuickLook.Plugin/QuickLook.Plugin.ArchiveViewer/ArchiveFileListView.xaml renamed to QuickLook.Plugin/QuickLook.Plugin.ArchiveViewer/ArchiveFile/ArchiveFileListView.xaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
<UserControl x:Class="QuickLook.Plugin.ArchiveViewer.ArchiveFileListView"
1+
<UserControl x:Class="QuickLook.Plugin.ArchiveViewer.ArchiveFile.ArchiveFileListView"
22
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
33
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
44
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
5-
xmlns:local="clr-namespace:QuickLook.Plugin.ArchiveViewer"
5+
xmlns:local="clr-namespace:QuickLook.Plugin.ArchiveViewer.ArchiveFile"
66
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
77
d:DesignHeight="300"
88
d:DesignWidth="300"

QuickLook.Plugin/QuickLook.Plugin.ArchiveViewer/ArchiveFileListView.xaml.cs renamed to QuickLook.Plugin/QuickLook.Plugin.ArchiveViewer/ArchiveFile/ArchiveFileListView.xaml.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,11 @@
1515
// You should have received a copy of the GNU General Public License
1616
// along with this program. If not, see <http://www.gnu.org/licenses/>.
1717

18+
using QuickLook.Plugin.ArchiveViewer.ArchiveFile;
1819
using System;
1920
using System.Windows.Controls;
2021

21-
namespace QuickLook.Plugin.ArchiveViewer;
22+
namespace QuickLook.Plugin.ArchiveViewer.ArchiveFile;
2223

2324
public partial class ArchiveFileListView : UserControl, IDisposable
2425
{

QuickLook.Plugin/QuickLook.Plugin.ArchiveViewer/ArchiveInfoPanel.xaml renamed to QuickLook.Plugin/QuickLook.Plugin.ArchiveViewer/ArchiveFile/ArchiveInfoPanel.xaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
<UserControl x:Class="QuickLook.Plugin.ArchiveViewer.ArchiveInfoPanel"
1+
<UserControl x:Class="QuickLook.Plugin.ArchiveViewer.ArchiveFile.ArchiveInfoPanel"
22
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
33
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
44
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
5-
xmlns:local="clr-namespace:QuickLook.Plugin.ArchiveViewer"
5+
xmlns:local="clr-namespace:QuickLook.Plugin.ArchiveViewer.ArchiveFile"
66
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
77
x:Name="infoPanel"
88
d:DesignHeight="600"

QuickLook.Plugin/QuickLook.Plugin.ArchiveViewer/ArchiveInfoPanel.xaml.cs renamed to QuickLook.Plugin/QuickLook.Plugin.ArchiveViewer/ArchiveFile/ArchiveInfoPanel.xaml.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@
1515
// You should have received a copy of the GNU General Public License
1616
// along with this program. If not, see <http://www.gnu.org/licenses/>.
1717

18-
using QuickLook.Common.Annotations;
19-
using QuickLook.Common.ExtensionMethods;
20-
using QuickLook.Common.Helpers;
2118
using PureSharpCompress.Archives;
2219
using PureSharpCompress.Common;
2320
using PureSharpCompress.Readers;
21+
using QuickLook.Common.Annotations;
22+
using QuickLook.Common.ExtensionMethods;
23+
using QuickLook.Common.Helpers;
2424
using System;
2525
using System.Collections.Generic;
2626
using System.ComponentModel;
@@ -30,7 +30,7 @@
3030
using System.Threading.Tasks;
3131
using System.Windows.Controls;
3232

33-
namespace QuickLook.Plugin.ArchiveViewer;
33+
namespace QuickLook.Plugin.ArchiveViewer.ArchiveFile;
3434

3535
public partial class ArchiveInfoPanel : UserControl, IDisposable, INotifyPropertyChanged
3636
{

QuickLook.Plugin/QuickLook.Plugin.ArchiveViewer/ChardetReaderOptions.cs renamed to QuickLook.Plugin/QuickLook.Plugin.ArchiveViewer/ArchiveFile/ChardetReaderOptions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
using System.Text;
2222
using UtfUnknown;
2323

24-
namespace QuickLook.Plugin.ArchiveViewer;
24+
namespace QuickLook.Plugin.ArchiveViewer.ArchiveFile;
2525

2626
internal class ChardetReaderOptions : ReaderOptions
2727
{

QuickLook.Plugin/QuickLook.Plugin.ArchiveViewer/Converters.cs renamed to QuickLook.Plugin/QuickLook.Plugin.ArchiveViewer/ArchiveFile/Converters.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
using System.Windows;
2222
using System.Windows.Data;
2323

24-
namespace QuickLook.Plugin.ArchiveViewer;
24+
namespace QuickLook.Plugin.ArchiveViewer.ArchiveFile;
2525

2626
public sealed class Percent100ToVisibilityVisibleConverter : DependencyObject, IValueConverter
2727
{

QuickLook.Plugin/QuickLook.Plugin.ArchiveViewer/Extensions.cs renamed to QuickLook.Plugin/QuickLook.Plugin.ArchiveViewer/ArchiveFile/Extensions.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
using System.Windows;
2121
using System.Windows.Media;
2222

23-
namespace QuickLook.Plugin.ArchiveViewer;
23+
namespace QuickLook.Plugin.ArchiveViewer.ArchiveFile;
2424

2525
public static class Extensions
2626
{
@@ -33,7 +33,7 @@ public static void ForEach<T>(this IEnumerable<T> enumeration, Action<T> action)
3333
public static T GetDescendantByType<T>(this Visual element) where T : class
3434
{
3535
if (element == null)
36-
return default(T);
36+
return default;
3737
if (element.GetType() == typeof(T))
3838
return element as T;
3939

QuickLook.Plugin/QuickLook.Plugin.ArchiveViewer/IconManager.cs renamed to QuickLook.Plugin/QuickLook.Plugin.ArchiveViewer/ArchiveFile/IconManager.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
using System.Windows.Media;
2626
using System.Windows.Media.Imaging;
2727

28-
namespace QuickLook.Plugin.ArchiveViewer;
28+
namespace QuickLook.Plugin.ArchiveViewer.ArchiveFile;
2929

3030
/// <summary>
3131
/// Internals are mostly from here:

QuickLook.Plugin/QuickLook.Plugin.ArchiveViewer/Plugin.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
// along with this program. If not, see <http://www.gnu.org/licenses/>.
1717

1818
using QuickLook.Common.Plugin;
19+
using QuickLook.Plugin.ArchiveViewer.ArchiveFile;
1920
using System;
2021
using System.IO;
2122
using System.Linq;
@@ -53,7 +54,7 @@ public class Plugin : IViewer
5354
//".eif", // QQ emoji file (Compound File Binary format)
5455
];
5556

56-
private ArchiveInfoPanel _panel;
57+
private IDisposable _panel;
5758

5859
public int Priority => -5;
5960

0 commit comments

Comments
 (0)