plugins: continue populating plugins when a directory wasn't found
This commit is contained in:
parent
528293e39d
commit
e0f7ea5d08
|
@ -113,17 +113,14 @@ namespace SparkleShare {
|
||||||
string plugins_path = SparkleHelpers.CombineMore (
|
string plugins_path = SparkleHelpers.CombineMore (
|
||||||
Defines.DATAROOTDIR, "sparkleshare", "plugins");
|
Defines.DATAROOTDIR, "sparkleshare", "plugins");
|
||||||
|
|
||||||
try {
|
if (Directory.Exists (local_plugins_path))
|
||||||
foreach (string xml_file_path in Directory.GetFiles (local_plugins_path, "*.xml"))
|
foreach (string xml_file_path in Directory.GetFiles (local_plugins_path, "*.xml"))
|
||||||
Plugins.Add (new SparklePlugin (xml_file_path));
|
Plugins.Add (new SparklePlugin (xml_file_path));
|
||||||
|
|
||||||
|
if (Directory.Exists (plugins_path))
|
||||||
foreach (string xml_file_path in Directory.GetFiles (plugins_path, "*.xml"))
|
foreach (string xml_file_path in Directory.GetFiles (plugins_path, "*.xml"))
|
||||||
Plugins.Add (new SparklePlugin (xml_file_path));
|
Plugins.Add (new SparklePlugin (xml_file_path));
|
||||||
|
|
||||||
} catch (DirectoryNotFoundException e) {
|
|
||||||
Console.WriteLine ("Could not find any plugins: " + e.Message);
|
|
||||||
}
|
|
||||||
|
|
||||||
ChangePageEvent += delegate (PageType page) {
|
ChangePageEvent += delegate (PageType page) {
|
||||||
this.previous_page = page;
|
this.previous_page = page;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue