From a4fe05140a2b84f3c9c6f24a9b889cbb6af392e0 Mon Sep 17 00:00:00 2001 From: Hylke Bons Date: Sun, 2 Oct 2011 00:19:31 +0200 Subject: [PATCH] plugins: continue populating plugins when a directory wasn't found --- SparkleShare/SparkleSetupController.cs | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/SparkleShare/SparkleSetupController.cs b/SparkleShare/SparkleSetupController.cs index c2f7ff1f..4f1db890 100755 --- a/SparkleShare/SparkleSetupController.cs +++ b/SparkleShare/SparkleSetupController.cs @@ -113,16 +113,13 @@ namespace SparkleShare { string plugins_path = SparkleHelpers.CombineMore ( Defines.DATAROOTDIR, "sparkleshare", "plugins"); - try { + if (Directory.Exists (local_plugins_path)) foreach (string xml_file_path in Directory.GetFiles (local_plugins_path, "*.xml")) Plugins.Add (new SparklePlugin (xml_file_path)); - foreach (string xml_file_path in Directory.GetFiles (plugins_path, "*.xml")) - Plugins.Add (new SparklePlugin (xml_file_path)); - - } catch (DirectoryNotFoundException e) { - Console.WriteLine ("Could not find any plugins: " + e.Message); - } + if (Directory.Exists (plugins_path)) + foreach (string xml_file_path in Directory.GetFiles (plugins_path, "*.xml")) + Plugins.Add (new SparklePlugin (xml_file_path)); ChangePageEvent += delegate (PageType page) { this.previous_page = page;