controller: fix repo loading
This commit is contained in:
parent
b8cf26d94a
commit
2fdad29e0e
|
@ -26,8 +26,9 @@ namespace SparkleLib {
|
|||
|
||||
public class SparkleRepoGit : SparkleRepoBase {
|
||||
|
||||
public SparkleRepoGit (string path, SparkleBackend backend) :
|
||||
base (path, backend) { }
|
||||
public SparkleRepoGit (string path) : base (path)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
private string identifier = null;
|
||||
|
|
|
@ -57,7 +57,6 @@ namespace SparkleLib {
|
|||
protected bool is_buffering = false;
|
||||
protected bool server_online = true;
|
||||
|
||||
public readonly SparkleBackend Backend;
|
||||
public readonly string LocalPath;
|
||||
public readonly string Name;
|
||||
public readonly Uri Url;
|
||||
|
@ -93,13 +92,12 @@ namespace SparkleLib {
|
|||
public event ChangesDetectedEventHandler ChangesDetected;
|
||||
|
||||
|
||||
public SparkleRepoBase (string path, SparkleBackend backend)
|
||||
public SparkleRepoBase (string path)
|
||||
{
|
||||
LocalPath = path;
|
||||
Name = Path.GetFileName (LocalPath);
|
||||
Url = new Uri (SparkleConfig.DefaultConfig.GetUrlForFolder (Name));
|
||||
|
||||
Backend = backend;
|
||||
this.poll_interval = this.short_interval;
|
||||
|
||||
SyncStatusChanged += delegate (SyncStatus status) {
|
||||
|
|
|
@ -574,13 +574,14 @@ namespace SparkleShare {
|
|||
|
||||
try {
|
||||
repo = (SparkleRepoBase) Activator.CreateInstance (
|
||||
Type.GetType ("SparkleLib.SparkleRepo" + backend),
|
||||
folder_path,
|
||||
SparkleBackend.DefaultBackend
|
||||
Type.GetType ("SparkleLib.SparkleRepo" + backend + ", SparkleLib"),
|
||||
folder_path
|
||||
);
|
||||
|
||||
} catch {
|
||||
SparkleHelpers.DebugInfo ("Controller", "Failed to load backend for " + folder_name);
|
||||
SparkleHelpers.DebugInfo ("Controller",
|
||||
"Failed to load \"" + backend + "\" backend for \"" + folder_name + "\"");
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue