Allow using periods '.' and underscores '_' (will be replaced by spaces locally) in project names. fixes #1046
This commit is contained in:
parent
c647a9202d
commit
66b37c2270
|
@ -339,17 +339,15 @@ namespace SparkleLib {
|
|||
}
|
||||
|
||||
|
||||
public static string GetBackend (string path)
|
||||
public static string GetBackend (string address)
|
||||
{
|
||||
string extension = Path.GetExtension (path);
|
||||
|
||||
if (!string.IsNullOrEmpty (extension)) {
|
||||
extension = extension.Substring (1);
|
||||
char [] letters = extension.ToCharArray ();
|
||||
letters [0] = char.ToUpper (letters [0]);
|
||||
|
||||
return new string (letters);
|
||||
|
||||
Uri uri = new Uri (address);
|
||||
int index_of_plus = uri.Scheme.IndexOf ("+");
|
||||
|
||||
if (index_of_plus > -1) {
|
||||
string backend = uri.Scheme.Substring (index_of_plus + 1);
|
||||
return char.ToUpper (backend [0]) + backend.Substring (1);
|
||||
|
||||
} else {
|
||||
return "Git";
|
||||
}
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
</info>
|
||||
<address>
|
||||
<value/>
|
||||
<example>[user@]hostname[:port]</example>
|
||||
<example>ssh://[user@]hostname[:port]</example>
|
||||
</address>
|
||||
<path>
|
||||
<value/>
|
||||
|
|
|
@ -523,9 +523,12 @@ namespace SparkleShare {
|
|||
File.SetAttributes (tmp_path, File.GetAttributes (tmp_path) | FileAttributes.Hidden);
|
||||
}
|
||||
|
||||
string canonical_name = Path.GetFileNameWithoutExtension (remote_path);
|
||||
string canonical_name = Path.GetFileName (remote_path);
|
||||
string tmp_folder = Path.Combine (tmp_path, canonical_name);
|
||||
string backend = SparkleFetcherBase.GetBackend (remote_path);
|
||||
string backend = SparkleFetcherBase.GetBackend (address);
|
||||
|
||||
if (address.StartsWith ("ssh+"))
|
||||
address = "ssh" + address.Substring (address.IndexOf ("://"));
|
||||
|
||||
try {
|
||||
this.fetcher = (SparkleFetcherBase) Activator.CreateInstance (
|
||||
|
@ -603,7 +606,7 @@ namespace SparkleShare {
|
|||
this.watcher.EnableRaisingEvents = false;
|
||||
|
||||
this.fetcher.Complete ();
|
||||
string canonical_name = Path.GetFileNameWithoutExtension (this.fetcher.RemoteUrl.AbsolutePath);
|
||||
string canonical_name = Path.GetFileName (this.fetcher.RemoteUrl.AbsolutePath);
|
||||
|
||||
canonical_name = canonical_name.Replace ("-crypto", "");
|
||||
canonical_name = canonical_name.Replace ("_", " ");
|
||||
|
|
|
@ -136,7 +136,8 @@ namespace SparkleShare {
|
|||
Plugins.Insert (0, new SparklePlugin (xml_file_path));
|
||||
|
||||
} else if (xml_file_path.EndsWith ("ssnet.xml")) {
|
||||
// Plugins.Insert ((local_plugins_count + 1), new SparklePlugin (xml_file_path)); TODO: Skip this plugin for now
|
||||
// Plugins.Insert ((local_plugins_count + 1), new SparklePlugin (xml_file_path));
|
||||
// TODO: Skip this plugin for now
|
||||
|
||||
} else {
|
||||
Plugins.Add (new SparklePlugin (xml_file_path));
|
||||
|
@ -341,7 +342,11 @@ namespace SparkleShare {
|
|||
|
||||
public void AddPageCompleted (string address, string remote_path)
|
||||
{
|
||||
SyncingFolder = Path.GetFileNameWithoutExtension (remote_path);
|
||||
SyncingFolder = Path.GetFileName (remote_path);
|
||||
|
||||
if (remote_path.EndsWith (".git"))
|
||||
SyncingFolder = remote_path.Substring (0, remote_path.Length - 4);
|
||||
|
||||
SyncingFolder = SyncingFolder.Replace ("-crypto", "");
|
||||
ProgressBarPercentage = 1.0;
|
||||
|
||||
|
@ -424,7 +429,12 @@ namespace SparkleShare {
|
|||
|
||||
public void InvitePageCompleted ()
|
||||
{
|
||||
SyncingFolder = Path.GetFileNameWithoutExtension (PendingInvite.RemotePath);
|
||||
SyncingFolder = Path.GetFileName (PendingInvite.RemotePath);
|
||||
|
||||
if (PendingInvite.RemotePath.EndsWith (".git"))
|
||||
SyncingFolder = PendingInvite.RemotePath.Substring (0, PendingInvite.RemotePath.Length - 4);
|
||||
|
||||
SyncingFolder = SyncingFolder.Replace ("-crypto", "");
|
||||
PreviousAddress = PendingInvite.Address;
|
||||
PreviousPath = PendingInvite.RemotePath;
|
||||
|
||||
|
|
Loading…
Reference in a new issue