revert the change so you need declare an IGNORE_UWP in order to not use the windwos SDK

This commit is contained in:
Amir Tepper
2019-10-20 15:43:50 +03:00
parent 0e241a0fc5
commit aefc90dc19
2 changed files with 10 additions and 10 deletions

View File

@@ -17,7 +17,7 @@ namespace Wox.Plugin.Program
{ {
private static readonly object IndexLock = new object(); private static readonly object IndexLock = new object();
private static Win32[] _win32s; private static Win32[] _win32s;
#if SDK #if !IGNORE_UWP
private static UWP.Application[] _uwps; private static UWP.Application[] _uwps;
private static BinaryStorage<UWP.Application[]> _uwpStorage; private static BinaryStorage<UWP.Application[]> _uwpStorage;
#endif #endif
@@ -38,13 +38,13 @@ namespace Wox.Plugin.Program
{ {
_win32Storage = new BinaryStorage<Win32[]>("Win32"); _win32Storage = new BinaryStorage<Win32[]>("Win32");
_win32s = _win32Storage.TryLoad(new Win32[] { }); _win32s = _win32Storage.TryLoad(new Win32[] { });
#if SDK #if !IGNORE_UWP
_uwpStorage = new BinaryStorage<UWP.Application[]>("UWP"); _uwpStorage = new BinaryStorage<UWP.Application[]>("UWP");
_uwps = _uwpStorage.TryLoad(new UWP.Application[] { }); _uwps = _uwpStorage.TryLoad(new UWP.Application[] { });
#endif #endif
}); });
Log.Info($"|Wox.Plugin.Program.Main|Number of preload win32 programs <{_win32s.Length}>"); Log.Info($"|Wox.Plugin.Program.Main|Number of preload win32 programs <{_win32s.Length}>");
#if SDK #if !IGNORE_UWP
Log.Info($"|Wox.Plugin.Program.Main|Number of preload uwps <{_uwps.Length}>"); Log.Info($"|Wox.Plugin.Program.Main|Number of preload uwps <{_uwps.Length}>");
#endif #endif
Task.Run(() => Task.Run(() =>
@@ -57,7 +57,7 @@ namespace Wox.Plugin.Program
{ {
_settingsStorage.Save(); _settingsStorage.Save();
_win32Storage.Save(_win32s); _win32Storage.Save(_win32s);
#if SDK #if !IGNORE_UWP
_uwpStorage.Save(_uwps); _uwpStorage.Save(_uwps);
#endif #endif
} }
@@ -67,11 +67,11 @@ namespace Wox.Plugin.Program
lock (IndexLock) lock (IndexLock)
{ {
var results1 = _win32s.AsParallel().Select(p => p.Result(query.Search, _context.API)); var results1 = _win32s.AsParallel().Select(p => p.Result(query.Search, _context.API));
#if SDK #if !IGNORE_UWP
var results2 = _uwps.AsParallel().Select(p => p.Result(query.Search, _context.API)); var results2 = _uwps.AsParallel().Select(p => p.Result(query.Search, _context.API));
#endif #endif
var result = results1 var result = results1
#if SDK #if !IGNORE_UWP
.Concat(results2) .Concat(results2)
#endif #endif
.Where(r => r.Score > 0).ToList(); .Where(r => r.Score > 0).ToList();
@@ -87,13 +87,13 @@ namespace Wox.Plugin.Program
public static void IndexPrograms() public static void IndexPrograms()
{ {
Win32[] w = { }; Win32[] w = { };
#if SDK #if !IGNORE_UWP
UWP.Application[] u = { }; UWP.Application[] u = { };
var t1 = Task.Run(() => var t1 = Task.Run(() =>
{ {
#endif #endif
w = Win32.All(_settings); w = Win32.All(_settings);
#if SDK #if !IGNORE_UWP
}); });
var t2 = Task.Run(() => var t2 = Task.Run(() =>
{ {
@@ -113,7 +113,7 @@ namespace Wox.Plugin.Program
lock (IndexLock) lock (IndexLock)
{ {
_win32s = w; _win32s = w;
#if SDK #if !IGNORE_UWP
_uwps = u; _uwps = u;
#endif #endif
} }

View File

@@ -1,4 +1,4 @@
#if SDK #if !IGNORE_UWP
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Diagnostics; using System.Diagnostics;