From 49e2ab6e8621813bc938091482cdf78dff7948fc Mon Sep 17 00:00:00 2001 From: Hylke Bons Date: Thu, 3 Mar 2011 15:36:50 +0000 Subject: [PATCH] Fix OS detection for controller --- SparkleShare/SparkleShare.cs | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/SparkleShare/SparkleShare.cs b/SparkleShare/SparkleShare.cs index 6549bf09..bd4b34e3 100644 --- a/SparkleShare/SparkleShare.cs +++ b/SparkleShare/SparkleShare.cs @@ -83,27 +83,36 @@ namespace SparkleShare { if (show_help) ShowHelp (p); + - + string controller_name; switch (SparkleShare.Platform) { case PlatformID.Unix: SetProcessName ("sparkleshare"); - //Controller = new SparkleLinController (); + controller_name = "Lin"; break; case PlatformID.MacOSX: - Controller = new SparkleMacController (); + controller_name = "Mac"; + break; case PlatformID.Win32NT: - //Controller = new SparkleWinController (); + controller_name = "Win"; + break; + + default: + controller_name = "Lin"; break; } - if (Controller != null) { + Controller = (SparkleController) Activator.CreateInstance ( + Type.GetType ("SparkleShare.Sparkle" + controller_name + "Controller")); + + if (Controller != null && !hide_ui) { UI = new SparkleUI (); UI.Run ();