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 SparkleRepoGit (string path, SparkleBackend backend) :
base (path, backend) { }
public SparkleRepoGit (string path) : base (path)
{
}
private string identifier = null;

View file

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

View file

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