[MonoDevelop] Sanity check for ~/.config not being a file.

Peter Johanson latexer at gentoo.org
Fri Aug 5 21:01:24 EDT 2005


Hot on the heels of the 'check hostname resolves' check going in, here's
a small patch to make sure ~/.config isn't a file when MD is starting.
Anybody who's backed up a kernel config to their homedir is apt to have
this problem, and get a stupid trace when MD tries to make the dir
~/.config/.

Thoughts?

-pete

-- 
Peter Johanson
<latexer at gentoo.org>
-------------- next part --------------
Index: Core/src/MonoDevelop.Startup/MonoDevelopMain.cs
===================================================================
--- Core/src/MonoDevelop.Startup/MonoDevelopMain.cs	(revision 2710)
+++ Core/src/MonoDevelop.Startup/MonoDevelopMain.cs	(working copy)
@@ -108,6 +108,17 @@
 				dialog.Run ();
 				return 1;
 			} 
+
+			// ~/.config being a file (kernel config file name) check
+			string configFile = Path.Combine (Environment.GetFolderPath (Environment.SpecialFolder.Personal), ".config");
+			if (File.Exists (configFile))
+			{
+				ErrorDialog dialog = new ErrorDialog (null);
+				dialog.Message = String.Format("MonoDevelop failed to start. {0} is a file.", configFile);
+				dialog.AddDetails (String.Format("{0} must be a directory for MonoDevelop to function, but is a file instead. Please move the file out of the way and restart MonoDevelop.", configFile), true);
+				dialog.Run ();
+				return 1;
+			}
 		
 			SplashScreenForm.SetCommandLineArgs(remainingArgs);
 			


More information about the Monodevelop-list mailing list