controller: fix repo loading

This commit is contained in:
Hylke Bons 2012-01-29 20:33:12 +00:00
parent b99b4ac1a3
commit 8cc50596e9
3 changed files with 9 additions and 9 deletions

View file

@ -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;

View file

@ -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) {

View file

@ -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;
} }