From fee24420c748982697bc39f2b0d7f4be68899ebc Mon Sep 17 00:00:00 2001 From: Hylke Bons Date: Sat, 23 Mar 2013 18:48:47 +0100 Subject: [PATCH] plugins: respect the Backend element. closes #1224 --- SparkleLib/SparkleFetcherBase.cs | 3 ++- SparkleShare/SparkleControllerBase.cs | 6 +++++- SparkleShare/SparklePlugin.cs | 2 +- SparkleShare/SparkleSetupController.cs | 3 ++- 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/SparkleLib/SparkleFetcherBase.cs b/SparkleLib/SparkleFetcherBase.cs index 60919134..15deb390 100755 --- a/SparkleLib/SparkleFetcherBase.cs +++ b/SparkleLib/SparkleFetcherBase.cs @@ -26,8 +26,9 @@ namespace SparkleLib { public class SparkleFetcherInfo { public string Address; - public string Fingerprint; public string RemotePath; + public string Backend; + public string Fingerprint; public string TargetDirectory; public string AnnouncementsUrl; public bool FetchPriorHistory; diff --git a/SparkleShare/SparkleControllerBase.cs b/SparkleShare/SparkleControllerBase.cs index 8ea3de68..9a26682f 100644 --- a/SparkleShare/SparkleControllerBase.cs +++ b/SparkleShare/SparkleControllerBase.cs @@ -542,7 +542,11 @@ namespace SparkleShare { } string canonical_name = Path.GetFileName (info.RemotePath); - string backend = SparkleFetcherBase.GetBackend (info.Address); + string backend = info.Backend; + + if (string.IsNullOrEmpty (backend)) + backend = SparkleFetcherBase.GetBackend (info.Address); + info.TargetDirectory = Path.Combine (tmp_path, canonical_name); try { diff --git a/SparkleShare/SparklePlugin.cs b/SparkleShare/SparklePlugin.cs index 07a6548a..c80d2d8a 100644 --- a/SparkleShare/SparklePlugin.cs +++ b/SparkleShare/SparklePlugin.cs @@ -43,7 +43,7 @@ namespace SparkleShare { get { string image_file_name = GetValue ("info", "icon"); string image_path = IO.Path.Combine (this.plugin_directory, image_file_name); - + if (IO.File.Exists (image_path)) return image_path; else diff --git a/SparkleShare/SparkleSetupController.cs b/SparkleShare/SparkleSetupController.cs index e5391f1c..79cef7ec 100755 --- a/SparkleShare/SparkleSetupController.cs +++ b/SparkleShare/SparkleSetupController.cs @@ -376,7 +376,8 @@ namespace SparkleShare { Fingerprint = SelectedPlugin.Fingerprint, RemotePath = remote_path, FetchPriorHistory = this.fetch_prior_history, - AnnouncementsUrl = SelectedPlugin.AnnouncementsUrl + AnnouncementsUrl = SelectedPlugin.AnnouncementsUrl, + Backend = SelectedPlugin.Backend }; new Thread (() => { Program.Controller.StartFetcher (info); }).Start ();