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) public static string GetBackend (string address)
{ {
Uri uri = new Uri (address); if (address.StartsWith ("ssh+")) {
int index_of_plus = uri.Scheme.IndexOf ("+"); 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); return char.ToUpper (backend [0]) + backend.Substring (1);
} else { } else {

View file

@ -347,7 +347,8 @@ namespace SparkleShare {
if (remote_path.EndsWith (".git")) if (remote_path.EndsWith (".git"))
SyncingFolder = remote_path.Substring (0, remote_path.Length - 4); SyncingFolder = remote_path.Substring (0, remote_path.Length - 4);
SyncingFolder = SyncingFolder.Replace ("-crypto", ""); SyncingFolder = SyncingFolder.Replace ("-crypto", "");
SyncingFolder = SyncingFolder.Replace ("_", " ");
ProgressBarPercentage = 1.0; ProgressBarPercentage = 1.0;
ChangePageEvent (PageType.Syncing, null); ChangePageEvent (PageType.Syncing, null);
@ -434,7 +435,8 @@ namespace SparkleShare {
if (PendingInvite.RemotePath.EndsWith (".git")) if (PendingInvite.RemotePath.EndsWith (".git"))
SyncingFolder = PendingInvite.RemotePath.Substring (0, PendingInvite.RemotePath.Length - 4); SyncingFolder = PendingInvite.RemotePath.Substring (0, PendingInvite.RemotePath.Length - 4);
SyncingFolder = SyncingFolder.Replace ("-crypto", ""); SyncingFolder = SyncingFolder.Replace ("-crypto", "");
SyncingFolder = SyncingFolder.Replace ("_", " ");
PreviousAddress = PendingInvite.Address; PreviousAddress = PendingInvite.Address;
PreviousPath = PendingInvite.RemotePath; PreviousPath = PendingInvite.RemotePath;