Skip to content

Commit 156d5be

Browse files
committed
Better hack for replacing - dashes to comply with Save In bug.
1 parent 6ac4d2f commit 156d5be

2 files changed

Lines changed: 94 additions & 3 deletions

File tree

Save In Companion/MenuEntry.cs

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,21 @@ string GetRootFolder(string path)
5757

5858
public void BuildOutput(StringWriter stream, Settings settings)
5959
{
60+
//HACK: Replace - dashes with spaces to avoid a bug that occurs in Save In... with lines that have dashes after the path. Remove this if and when that bug is fixed.
61+
string hackName = "";
62+
63+
if (!string.IsNullOrEmpty(Name))
64+
{
65+
hackName = Name.Replace('-', ' ');
66+
}
67+
68+
string hackComment = "";
69+
70+
if (!string.IsNullOrEmpty(Comment))
71+
{
72+
hackComment = Comment.Replace('-', ' ');
73+
}
74+
6075
if (IsSeperator)
6176
{
6277
stream.WriteLine("---");
@@ -65,7 +80,7 @@ public void BuildOutput(StringWriter stream, Settings settings)
6580
{
6681
if (SubEntries.Count > 0)
6782
{
68-
stream.WriteLine(string.Format(". // (alias:{0})", Name));
83+
stream.WriteLine(string.Format(". // (alias:{0})", hackName));
6984
SubEntries.ForEach(x => x.BuildOutput(stream, settings));
7085
}
7186
}
@@ -77,7 +92,7 @@ public void BuildOutput(StringWriter stream, Settings settings)
7792
{
7893
if (FolderPath == settings.DownloadsFolderPath)
7994
{
80-
finalPath = string.Format(". //{0} (alias: {1})", Comment, Name);
95+
finalPath = string.Format(". //{0} (alias: {1})", hackComment, hackName);
8196
}
8297
else
8398
{
@@ -104,7 +119,7 @@ public void BuildOutput(StringWriter stream, Settings settings)
104119

105120
// create final written path
106121
finalPath = string.Format("{0}{1} //{2} (alias:{3})", new string('>', Deepness),
107-
Path.Combine(settings.SaveInLinksFolderName, driveLetter + relativePath), Comment, Name);
122+
Path.Combine(settings.SaveInLinksFolderName, driveLetter + relativePath), hackComment, hackName);
108123

109124
if (!settings.SkipLinkCreation)
110125
{

Save In Companion/app.manifest

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1">
3+
<assemblyIdentity version="1.0.0.0" name="MyApplication.app"/>
4+
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
5+
<security>
6+
<requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
7+
<!-- UAC Manifest Options
8+
If you want to change the Windows User Account Control level replace the
9+
requestedExecutionLevel node with one of the following.
10+
11+
<requestedExecutionLevel level="asInvoker" uiAccess="false" />
12+
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
13+
<requestedExecutionLevel level="highestAvailable" uiAccess="false" />
14+
15+
Specifying requestedExecutionLevel element will disable file and registry virtualization.
16+
Remove this element if your application requires this virtualization for backwards
17+
compatibility.
18+
-->
19+
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
20+
</requestedPrivileges>
21+
</security>
22+
</trustInfo>
23+
24+
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
25+
<application>
26+
<!-- A list of the Windows versions that this application has been tested on
27+
and is designed to work with. Uncomment the appropriate elements
28+
and Windows will automatically select the most compatible environment. -->
29+
30+
<!-- Windows Vista -->
31+
<!--<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}" />-->
32+
33+
<!-- Windows 7 -->
34+
<!--<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}" />-->
35+
36+
<!-- Windows 8 -->
37+
<!--<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}" />-->
38+
39+
<!-- Windows 8.1 -->
40+
<!--<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}" />-->
41+
42+
<!-- Windows 10 -->
43+
<!--<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}" />-->
44+
45+
</application>
46+
</compatibility>
47+
48+
<!-- Indicates that the application is DPI-aware and will not be automatically scaled by Windows at higher
49+
DPIs. Windows Presentation Foundation (WPF) applications are automatically DPI-aware and do not need
50+
to opt in. Windows Forms applications targeting .NET Framework 4.6 that opt into this setting, should
51+
also set the 'EnableWindowsFormsHighDpiAutoResizing' setting to 'true' in their app.config. -->
52+
<!--
53+
<application xmlns="urn:schemas-microsoft-com:asm.v3">
54+
<windowsSettings>
55+
<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true</dpiAware>
56+
</windowsSettings>
57+
</application>
58+
-->
59+
60+
<!-- Enable themes for Windows common controls and dialogs (Windows XP and later) -->
61+
<!--
62+
<dependency>
63+
<dependentAssembly>
64+
<assemblyIdentity
65+
type="win32"
66+
name="Microsoft.Windows.Common-Controls"
67+
version="6.0.0.0"
68+
processorArchitecture="*"
69+
publicKeyToken="6595b64144ccf1df"
70+
language="*"
71+
/>
72+
</dependentAssembly>
73+
</dependency>
74+
-->
75+
76+
</assembly>

0 commit comments

Comments
 (0)