Skip to content

Commit 898b1db

Browse files
committed
Merge remote-tracking branch 'origin/dev' into add_filecontent_search
2 parents 4226b74 + 2df1075 commit 898b1db

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+123
-1314
lines changed

Flow.Launcher.Infrastructure/Constant.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ public static class Constant
2727
public static readonly string ErrorIcon = Path.Combine(ProgramDirectory, "Images", "app_error.png");
2828

2929
public static string PythonPath;
30-
public static string EverythingSDKPath;
3130

3231
public static readonly string QueryTextBoxIconImagePath = $"{ProgramDirectory}\\Images\\mainsearch.png";
3332

Flow.Launcher.Infrastructure/Exception/ExceptionFormatter.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ private static string CreateExceptionReport(System.Exception ex)
6767
sb.AppendLine($"* IntPtr Length: {IntPtr.Size}");
6868
sb.AppendLine($"* x64: {Environment.Is64BitOperatingSystem}");
6969
sb.AppendLine($"* Python Path: {Constant.PythonPath}");
70-
sb.AppendLine($"* Everything SDK Path: {Constant.EverythingSDKPath}");
7170
sb.AppendLine($"* CLR Version: {Environment.Version}");
7271
sb.AppendLine($"* Installed .NET Framework: ");
7372
foreach (var result in GetFrameworkVersionFromRegistry())

Flow.Launcher.Infrastructure/Flow.Launcher.Infrastructure.csproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838

3939
<ItemGroup>
4040
<Compile Include="..\SolutionAssemblyInfo.cs" Link="Properties\SolutionAssemblyInfo.cs" />
41+
<None Include="FodyWeavers.xml" />
4142
</ItemGroup>
4243

4344
<ItemGroup>
@@ -55,6 +56,7 @@
5556
<PackageReference Include="Pinyin4DotNet" Version="2016.4.23.4" />
5657
<PackageReference Include="System.Drawing.Common" Version="4.7.0" />
5758
<PackageReference Include="System.Runtime" Version="4.3.1" />
59+
<PackageReference Include="PropertyChanged.Fody" Version="2.5.13" />
5860
</ItemGroup>
5961

6062
<ItemGroup>
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd">
3+
<PropertyChanged />
4+
</Weavers>

Flow.Launcher.Infrastructure/Image/ImageLoader.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -156,9 +156,8 @@ private static ImageResult GetThumbnailResult(ref string path, bool loadFullImag
156156
if (Directory.Exists(path))
157157
{
158158
/* Directories can also have thumbnails instead of shell icons.
159-
* Generating thumbnails for a bunch of folders while scrolling through
160-
* results from Everything makes a big impact on performance and
161-
* Flow.Launcher responsibility.
159+
* Generating thumbnails for a bunch of folder results while scrolling
160+
* could have a big impact on performance and Flow.Launcher responsibility.
162161
* - Solution: just load the icon
163162
*/
164163
type = ImageType.Folder;

Flow.Launcher.sln

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Plugins", "Plugins", "{3A73
1313
EndProject
1414
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Flow.Launcher", "Flow.Launcher\Flow.Launcher.csproj", "{DB90F671-D861-46BB-93A3-F1304F5BA1C5}"
1515
ProjectSection(ProjectDependencies) = postProject
16-
{230AE83F-E92E-4E69-8355-426B305DA9C0} = {230AE83F-E92E-4E69-8355-426B305DA9C0}
1716
{1EE20B48-82FB-48A2-8086-675D6DDAB4F0} = {1EE20B48-82FB-48A2-8086-675D6DDAB4F0}
1817
{0B9DE348-9361-4940-ADB6-F5953BFFCCEC} = {0B9DE348-9361-4940-ADB6-F5953BFFCCEC}
1918
{FDB3555B-58EF-4AE6-B5F1-904719637AB4} = {FDB3555B-58EF-4AE6-B5F1-904719637AB4}
@@ -49,8 +48,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Flow.Launcher.Plugin.Url",
4948
EndProject
5049
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Flow.Launcher.Plugin.Color", "Plugins\Flow.Launcher.Plugin.Color\Flow.Launcher.Plugin.Color.csproj", "{F35190AA-4758-4D9E-A193-E3BDF6AD3567}"
5150
EndProject
52-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Flow.Launcher.Plugin.Everything", "Plugins\Flow.Launcher.Plugin.Everything\Flow.Launcher.Plugin.Everything.csproj", "{230AE83F-E92E-4E69-8355-426B305DA9C0}"
53-
EndProject
5451
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{FFD651C7-0546-441F-BC8C-D4EE8FD01EA7}"
5552
ProjectSection(SolutionItems) = preProject
5653
.gitattributes = .gitattributes
@@ -240,18 +237,6 @@ Global
240237
{F35190AA-4758-4D9E-A193-E3BDF6AD3567}.Release|x64.Build.0 = Release|Any CPU
241238
{F35190AA-4758-4D9E-A193-E3BDF6AD3567}.Release|x86.ActiveCfg = Release|Any CPU
242239
{F35190AA-4758-4D9E-A193-E3BDF6AD3567}.Release|x86.Build.0 = Release|Any CPU
243-
{230AE83F-E92E-4E69-8355-426B305DA9C0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
244-
{230AE83F-E92E-4E69-8355-426B305DA9C0}.Debug|Any CPU.Build.0 = Debug|Any CPU
245-
{230AE83F-E92E-4E69-8355-426B305DA9C0}.Debug|x64.ActiveCfg = Debug|Any CPU
246-
{230AE83F-E92E-4E69-8355-426B305DA9C0}.Debug|x64.Build.0 = Debug|Any CPU
247-
{230AE83F-E92E-4E69-8355-426B305DA9C0}.Debug|x86.ActiveCfg = Debug|Any CPU
248-
{230AE83F-E92E-4E69-8355-426B305DA9C0}.Debug|x86.Build.0 = Debug|Any CPU
249-
{230AE83F-E92E-4E69-8355-426B305DA9C0}.Release|Any CPU.ActiveCfg = Release|Any CPU
250-
{230AE83F-E92E-4E69-8355-426B305DA9C0}.Release|Any CPU.Build.0 = Release|Any CPU
251-
{230AE83F-E92E-4E69-8355-426B305DA9C0}.Release|x64.ActiveCfg = Release|Any CPU
252-
{230AE83F-E92E-4E69-8355-426B305DA9C0}.Release|x64.Build.0 = Release|Any CPU
253-
{230AE83F-E92E-4E69-8355-426B305DA9C0}.Release|x86.ActiveCfg = Release|Any CPU
254-
{230AE83F-E92E-4E69-8355-426B305DA9C0}.Release|x86.Build.0 = Release|Any CPU
255240
{C21BFF9C-2C99-4B5F-B7C9-A5E6DDDB37B0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
256241
{C21BFF9C-2C99-4B5F-B7C9-A5E6DDDB37B0}.Debug|Any CPU.Build.0 = Debug|Any CPU
257242
{C21BFF9C-2C99-4B5F-B7C9-A5E6DDDB37B0}.Debug|x64.ActiveCfg = Debug|Any CPU
@@ -325,7 +310,6 @@ Global
325310
{0B9DE348-9361-4940-ADB6-F5953BFFCCEC} = {3A73F5A7-0335-40D8-BF7C-F20BE5D0BA87}
326311
{A3DCCBCA-ACC1-421D-B16E-210896234C26} = {3A73F5A7-0335-40D8-BF7C-F20BE5D0BA87}
327312
{F35190AA-4758-4D9E-A193-E3BDF6AD3567} = {3A73F5A7-0335-40D8-BF7C-F20BE5D0BA87}
328-
{230AE83F-E92E-4E69-8355-426B305DA9C0} = {3A73F5A7-0335-40D8-BF7C-F20BE5D0BA87}
329313
{C21BFF9C-2C99-4B5F-B7C9-A5E6DDDB37B0} = {3A73F5A7-0335-40D8-BF7C-F20BE5D0BA87}
330314
{9B130CC5-14FB-41FF-B310-0A95B6894C37} = {3A73F5A7-0335-40D8-BF7C-F20BE5D0BA87}
331315
{59BD9891-3837-438A-958D-ADC7F91F6F7E} = {3A73F5A7-0335-40D8-BF7C-F20BE5D0BA87}

Flow.Launcher/CustomQueryHotkeySetting.xaml.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ private void btnAdd_OnClick(object sender, RoutedEventArgs e)
5757
App.API.ChangeQuery(pluginHotkey.ActionKeyword);
5858
Application.Current.MainWindow.Visibility = Visibility.Visible;
5959
});
60-
MessageBox.Show(InternationalizationManager.Instance.GetTranslation("success"));
6160
}
6261
else
6362
{
@@ -76,7 +75,6 @@ private void btnAdd_OnClick(object sender, RoutedEventArgs e)
7675
App.API.ChangeQuery(updateCustomHotkey.ActionKeyword);
7776
Application.Current.MainWindow.Visibility = Visibility.Visible;
7877
});
79-
MessageBox.Show(InternationalizationManager.Instance.GetTranslation("success"));
8078
}
8179

8280
Close();

Flow.Launcher/Helper/ErrorReporting.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,7 @@ public static string RuntimeInfo()
4141

4242
public static string DependenciesInfo()
4343
{
44-
var info = $"\nPython Path: {Constant.PythonPath}" +
45-
$"\nEverything SDK Path: {Constant.EverythingSDKPath}";
44+
var info = $"\nPython Path: {Constant.PythonPath}";
4645
return info;
4746
}
4847
}

Plugins/Flow.Launcher.Plugin.BrowserBookmark/Commands/Bookmarks.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ internal static List<Bookmark> LoadAllBookmarks()
2121

2222
var chromeBookmarks = new ChromeBookmarks();
2323
var mozBookmarks = new FirefoxBookmarks();
24+
var edgeBookmarks = new EdgeBookmarks();
2425

2526
//TODO: Let the user select which browser's bookmarks are displayed
2627
// Add Firefox bookmarks
@@ -29,6 +30,9 @@ internal static List<Bookmark> LoadAllBookmarks()
2930
// Add Chrome bookmarks
3031
chromeBookmarks.GetBookmarks().ForEach(x => allbookmarks.Add(x));
3132

33+
// Add Edge (Chromium) bookmarks
34+
edgeBookmarks.GetBookmarks().ForEach(x => allbookmarks.Add(x));
35+
3236
return allbookmarks.Distinct().ToList();
3337
}
3438
}
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.IO;
4+
using System.Linq;
5+
using System.Text.RegularExpressions;
6+
7+
namespace Flow.Launcher.Plugin.BrowserBookmark
8+
{
9+
public class EdgeBookmarks
10+
{
11+
private List<Bookmark> bookmarks = new List<Bookmark>();
12+
13+
public List<Bookmark> GetBookmarks()
14+
{
15+
bookmarks.Clear();
16+
LoadEdgeBookmarks();
17+
18+
return bookmarks;
19+
}
20+
21+
private void ParseEdgeBookmarks(String path, string source)
22+
{
23+
if (!File.Exists(path)) return;
24+
25+
string all = File.ReadAllText(path);
26+
Regex nameRegex = new Regex("\"name\": \"(?<name>.*?)\"");
27+
MatchCollection nameCollection = nameRegex.Matches(all);
28+
Regex typeRegex = new Regex("\"type\": \"(?<type>.*?)\"");
29+
MatchCollection typeCollection = typeRegex.Matches(all);
30+
Regex urlRegex = new Regex("\"url\": \"(?<url>.*?)\"");
31+
MatchCollection urlCollection = urlRegex.Matches(all);
32+
33+
List<string> names = (from Match match in nameCollection select match.Groups["name"].Value).ToList();
34+
List<string> types = (from Match match in typeCollection select match.Groups["type"].Value).ToList();
35+
List<string> urls = (from Match match in urlCollection select match.Groups["url"].Value).ToList();
36+
37+
int urlIndex = 0;
38+
for (int i = 0; i < names.Count; i++)
39+
{
40+
string name = DecodeUnicode(names[i]);
41+
string type = types[i];
42+
if (type == "url")
43+
{
44+
string url = urls[urlIndex];
45+
urlIndex++;
46+
47+
if (url == null) continue;
48+
if (url.StartsWith("javascript:", StringComparison.OrdinalIgnoreCase)) continue;
49+
if (url.StartsWith("vbscript:", StringComparison.OrdinalIgnoreCase)) continue;
50+
51+
bookmarks.Add(new Bookmark()
52+
{
53+
Name = name,
54+
Url = url,
55+
Source = source
56+
});
57+
}
58+
}
59+
}
60+
61+
private void LoadEdgeBookmarks(string path, string name)
62+
{
63+
if (!Directory.Exists(path)) return;
64+
var paths = Directory.GetDirectories(path);
65+
66+
foreach (var profile in paths)
67+
{
68+
if (File.Exists(Path.Combine(profile, "Bookmarks")))
69+
ParseEdgeBookmarks(Path.Combine(profile, "Bookmarks"), name + (Path.GetFileName(profile) == "Default" ? "" : (" (" + Path.GetFileName(profile) + ")")));
70+
}
71+
}
72+
73+
private void LoadEdgeBookmarks()
74+
{
75+
String platformPath = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);
76+
LoadEdgeBookmarks(Path.Combine(platformPath, @"Microsoft\Edge\User Data"), "Microsoft Edge");
77+
LoadEdgeBookmarks(Path.Combine(platformPath, @"Microsoft\Edge SxS\User Data"), "Microsoft Edge Canary");
78+
}
79+
80+
private String DecodeUnicode(String dataStr)
81+
{
82+
Regex reg = new Regex(@"(?i)\\[uU]([0-9a-f]{4})");
83+
return reg.Replace(dataStr, m => ((char)Convert.ToInt32(m.Groups[1].Value, 16)).ToString());
84+
}
85+
}
86+
}

0 commit comments

Comments
 (0)