fetcher: use different way to determine repo backend to fix a crash on windows

This commit is contained in:
Hylke Bons 2012-11-04 18:20:01 +00:00
parent e404d4cf88
commit 126aba422f
2 changed files with 7 additions and 6 deletions

View file

@ -343,11 +343,10 @@ namespace SparkleLib {
public static string GetBackend (string address)
{
Uri uri = new Uri (address);
int index_of_plus = uri.Scheme.IndexOf ("+");
if (address.StartsWith ("ssh+")) {
string backend = address.Substring (0, address.IndexOf ("://"));
backend = backend.Substring (4);
if (index_of_plus > -1) {
string backend = uri.Scheme.Substring (index_of_plus + 1);
return char.ToUpper (backend [0]) + backend.Substring (1);
} else {

View file

@ -348,6 +348,7 @@ namespace SparkleShare {
SyncingFolder = remote_path.Substring (0, remote_path.Length - 4);
SyncingFolder = SyncingFolder.Replace ("-crypto", "");
SyncingFolder = SyncingFolder.Replace ("_", " ");
ProgressBarPercentage = 1.0;
ChangePageEvent (PageType.Syncing, null);
@ -435,6 +436,7 @@ namespace SparkleShare {
SyncingFolder = PendingInvite.RemotePath.Substring (0, PendingInvite.RemotePath.Length - 4);
SyncingFolder = SyncingFolder.Replace ("-crypto", "");
SyncingFolder = SyncingFolder.Replace ("_", " ");
PreviousAddress = PendingInvite.Address;
PreviousPath = PendingInvite.RemotePath;