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