plugin: fix crash when lower_case_path isn't set

This commit is contained in:
Hylke Bons 2012-03-25 18:00:54 +01:00
parent 53bc2ceb66
commit 6fdf040975
3 changed files with 7 additions and 5 deletions

View file

@ -95,10 +95,12 @@ namespace SparkleShare {
} }
} }
public Boolean LowerCasePath { public bool PathUsesLowerCase {
get { get {
if (GetValue ("info", "lower_case_path").Equals ("true")) string uses_lower_case = GetValue ("path", "uses_lower_case");
return true;
if (!string.IsNullOrEmpty (uses_lower_case))
return uses_lower_case.Equals (bool.TrueString);
else else
return false; return false;
} }

View file

@ -316,7 +316,7 @@ namespace SparkleShare {
remote_path = remote_path.Trim (); remote_path = remote_path.Trim ();
remote_path = remote_path.TrimEnd ("/".ToCharArray ()); remote_path = remote_path.TrimEnd ("/".ToCharArray ());
if (SelectedPlugin.LowerCasePath) if (SelectedPlugin.PathUsesLowerCase)
remote_path = remote_path.ToLower (); remote_path = remote_path.ToLower ();
SyncingFolder = Path.GetFileNameWithoutExtension (remote_path); SyncingFolder = Path.GetFileNameWithoutExtension (remote_path);

View file

@ -6,7 +6,6 @@
<_description>Free code hosting for Git and Mercurial</_description> <_description>Free code hosting for Git and Mercurial</_description>
<icon>bitbucket.png</icon> <icon>bitbucket.png</icon>
<backend>Git</backend> <backend>Git</backend>
<lower_case_path>true</lower_case_path>
</info> </info>
<address> <address>
<value>ssh://git@bitbucket.org/</value> <value>ssh://git@bitbucket.org/</value>
@ -15,6 +14,7 @@
<path> <path>
<value></value> <value></value>
<_example>/username/project</_example> <_example>/username/project</_example>
<uses_lower_case>True</uses_lower_case>
</path> </path>
</plugin> </plugin>
</sparkleshare> </sparkleshare>