From b9cb4586dcaf693272b8bd895fc19783421262cc Mon Sep 17 00:00:00 2001 From: Clint Rutkas Date: Tue, 25 Jan 2022 16:31:55 -0800 Subject: [PATCH] getting 6.0 stuff up and going. Terminal Unit tests have file max length issue .... --- PowerToys.sln | 14 +--- .../Helper/DataWebRequestFactory.cs | 82 ------------------- .../PowerLauncher/PublicAPIInstance.cs | 1 - 3 files changed, 2 insertions(+), 95 deletions(-) delete mode 100644 src/modules/launcher/PowerLauncher/Helper/DataWebRequestFactory.cs diff --git a/PowerToys.sln b/PowerToys.sln index 2e80669738..ba993de122 100644 --- a/PowerToys.sln +++ b/PowerToys.sln @@ -1,6 +1,6 @@ Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 16 -VisualStudioVersion = 16.0.28803.452 +# Visual Studio Version 17 +VisualStudioVersion = 17.0.32014.148 MinimumVisualStudioVersion = 10.0.40219.1 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "runner", "src\runner\runner.vcxproj", "{9412D5C6-2CF2-4FC2-A601-B55508EA9B27}" ProjectSection(ProjectDependencies) = postProject @@ -357,8 +357,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "UnitTests-PdfThumbnailProvi EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.PowerToys.Run.Plugin.WindowsTerminal", "src\modules\launcher\Plugins\Microsoft.PowerToys.Run.Plugin.WindowsTerminal\Microsoft.PowerToys.Run.Plugin.WindowsTerminal.csproj", "{A2D583F0-B70C-4462-B1F0-8E81AFB7BA85}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.PowerToys.Run.Plugin.WindowsTerminal.UnitTests", "src\modules\launcher\Plugins\Microsoft.PowerToys.Run.Plugin.WindowsTerminal.UnitTests\Microsoft.PowerToys.Run.Plugin.WindowsTerminal.UnitTests.csproj", "{4ED320BC-BA04-4D42-8D15-CBE62151F08B}" -EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "PowerRenameUIHost", "src\modules\powerrename\PowerRenameUIHost\PowerRenameUIHost.vcxproj", "{F7EC4E6C-19CA-4FBD-9918-B8AC5FEF4F63}" ProjectSection(ProjectDependencies) = postProject {4642D596-723F-4BFC-894C-46811219AC4A} = {4642D596-723F-4BFC-894C-46811219AC4A} @@ -974,13 +972,6 @@ Global {A2D583F0-B70C-4462-B1F0-8E81AFB7BA85}.Release|x64.ActiveCfg = Release|x64 {A2D583F0-B70C-4462-B1F0-8E81AFB7BA85}.Release|x64.Build.0 = Release|x64 {A2D583F0-B70C-4462-B1F0-8E81AFB7BA85}.Release|x86.ActiveCfg = Release|x64 - {4ED320BC-BA04-4D42-8D15-CBE62151F08B}.Debug|x64.ActiveCfg = Debug|x64 - {4ED320BC-BA04-4D42-8D15-CBE62151F08B}.Debug|x64.Build.0 = Debug|x64 - {4ED320BC-BA04-4D42-8D15-CBE62151F08B}.Debug|x86.ActiveCfg = Debug|x64 - {4ED320BC-BA04-4D42-8D15-CBE62151F08B}.Release|x64.ActiveCfg = Release|x64 - {4ED320BC-BA04-4D42-8D15-CBE62151F08B}.Release|x64.Build.0 = Release|x64 - {4ED320BC-BA04-4D42-8D15-CBE62151F08B}.Release|x86.ActiveCfg = Release|Any CPU - {4ED320BC-BA04-4D42-8D15-CBE62151F08B}.Release|x86.Build.0 = Release|Any CPU {F7EC4E6C-19CA-4FBD-9918-B8AC5FEF4F63}.Debug|x64.ActiveCfg = Debug|x64 {F7EC4E6C-19CA-4FBD-9918-B8AC5FEF4F63}.Debug|x64.Build.0 = Debug|x64 {F7EC4E6C-19CA-4FBD-9918-B8AC5FEF4F63}.Debug|x86.ActiveCfg = Debug|x64 @@ -1166,7 +1157,6 @@ Global {11491FD8-F921-48BF-880C-7FEA185B80A1} = {2F305555-C296-497E-AC20-5FA1B237996A} {F40C3397-1834-4530-B2D9-8F8B8456BCDF} = {2F305555-C296-497E-AC20-5FA1B237996A} {A2D583F0-B70C-4462-B1F0-8E81AFB7BA85} = {4AFC9975-2456-4C70-94A4-84073C1CED93} - {4ED320BC-BA04-4D42-8D15-CBE62151F08B} = {4AFC9975-2456-4C70-94A4-84073C1CED93} {F7EC4E6C-19CA-4FBD-9918-B8AC5FEF4F63} = {89E20BCE-EB9C-46C8-8B50-E01A82E6FDC3} {4642D596-723F-4BFC-894C-46811219AC4A} = {89E20BCE-EB9C-46C8-8B50-E01A82E6FDC3} {322566EF-20DC-43A6-B9F8-616AF942579A} = {4574FDD0-F61D-4376-98BF-E5A1262C11EC} diff --git a/src/modules/launcher/PowerLauncher/Helper/DataWebRequestFactory.cs b/src/modules/launcher/PowerLauncher/Helper/DataWebRequestFactory.cs deleted file mode 100644 index a627803742..0000000000 --- a/src/modules/launcher/PowerLauncher/Helper/DataWebRequestFactory.cs +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright (c) Microsoft Corporation -// The Microsoft Corporation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using System; -using System.IO; -using System.Net; - -namespace PowerLauncher.Helper -{ - public class DataWebRequestFactory : IWebRequestCreate - { - private class DataWebRequest : WebRequest - { - private readonly Uri _uri; - - public DataWebRequest(Uri uri) - { - _uri = uri; - } - - public override WebResponse GetResponse() - { - return new DataWebResponse(_uri); - } - } - - private class DataWebResponse : WebResponse - { - private readonly string _contentType; - private readonly byte[] _data; - - public DataWebResponse(Uri uri) - { - string uriString = uri.AbsoluteUri; - - // Using Ordinal since this is internal and used with a symbol - int commaIndex = uriString.IndexOf(',', StringComparison.Ordinal); - var headers = uriString.Substring(0, commaIndex).Split(';'); - _contentType = headers[0]; - string dataString = uriString.Substring(commaIndex + 1); - _data = Convert.FromBase64String(dataString); - } - - public override string ContentType - { - get - { - return _contentType; - } - - set - { - throw new NotSupportedException(); - } - } - - public override long ContentLength - { - get - { - return _data.Length; - } - - set - { - throw new NotSupportedException(); - } - } - - public override Stream GetResponseStream() - { - return new MemoryStream(_data); - } - } - - public WebRequest Create(Uri uri) - { - return new DataWebRequest(uri); - } - } -} diff --git a/src/modules/launcher/PowerLauncher/PublicAPIInstance.cs b/src/modules/launcher/PowerLauncher/PublicAPIInstance.cs index 5641713bd3..a6b654d84e 100644 --- a/src/modules/launcher/PowerLauncher/PublicAPIInstance.cs +++ b/src/modules/launcher/PowerLauncher/PublicAPIInstance.cs @@ -36,7 +36,6 @@ namespace Wox _mainVM = mainVM ?? throw new ArgumentNullException(nameof(mainVM)); _themeManager = themeManager ?? throw new ArgumentNullException(nameof(themeManager)); _themeManager.ThemeChanged += OnThemeChanged; - WebRequest.RegisterPrefix("data", new DataWebRequestFactory()); ToastNotificationManagerCompat.OnActivated += args => {