Author: jpobst
Date: 2008-01-22 14:53:33 -0500 (Tue, 22 Jan 2008)
New Revision: 93567
Modified:
trunk/moma/ChangeLog
trunk/moma/DefinitionDownloader.cs
trunk/moma/MainForm.cs
Log:
01-22-2008 Jonathan Pobst <[EMAIL PROTECTED]>
* DefinitionDownloader.cs: Write downloaded definitions to the AppData
dir on Linux.
* MainForm.cs: On Linux, look for downloaded definitions in the AppData
dir, and write the reports to the AppData dir.
Modified: trunk/moma/ChangeLog
===================================================================
--- trunk/moma/ChangeLog 2008-01-22 19:45:13 UTC (rev 93566)
+++ trunk/moma/ChangeLog 2008-01-22 19:53:33 UTC (rev 93567)
@@ -1,5 +1,12 @@
01-22-2008 Jonathan Pobst <[EMAIL PROTECTED]>
+ * DefinitionDownloader.cs: Write downloaded definitions to the AppData
+ dir on Linux.
+ * MainForm.cs: On Linux, look for downloaded definitions in the AppData
+ dir, and write the reports to the AppData dir.
+
+01-22-2008 Jonathan Pobst <[EMAIL PROTECTED]>
+
* AssemblyAnalyzer.cs: Catch any exception returned by Cecil to we
will gracefully ignore any dll Cecil cannot read.
[Fixes bug #355360]
Modified: trunk/moma/DefinitionDownloader.cs
===================================================================
--- trunk/moma/DefinitionDownloader.cs 2008-01-22 19:45:13 UTC (rev 93566)
+++ trunk/moma/DefinitionDownloader.cs 2008-01-22 19:53:33 UTC (rev 93567)
@@ -44,8 +44,14 @@
Application.DoEvents ();
try {
- string definition_directory = Path.Combine
(Path.GetDirectoryName (Application.ExecutablePath), "Definitions");
+ string definition_directory;
+ // Unix-y people generally can't write to where
the executable is, so move it to their home
+ if (Environment.OSVersion.Platform ==
PlatformID.Unix)
+ definition_directory = Path.Combine
(Path.GetDirectoryName (Environment.GetFolderPath
(Environment.SpecialFolder.ApplicationData)), "Definitions");
+ else
+ definition_directory = Path.Combine
(Path.GetDirectoryName (Application.ExecutablePath), "Definitions");
+
if (!Directory.Exists (definition_directory))
Directory.CreateDirectory
(definition_directory);
Modified: trunk/moma/MainForm.cs
===================================================================
--- trunk/moma/MainForm.cs 2008-01-22 19:45:13 UTC (rev 93566)
+++ trunk/moma/MainForm.cs 2008-01-22 19:53:33 UTC (rev 93567)
@@ -418,7 +418,11 @@
private void SetupMonoVersion ()
{
MonoVersionCombo.Items.Clear ();
-
+
+ // Unix-y people may have downloaded definitions to
their user folder
+ if (Environment.OSVersion.Platform == PlatformID.Unix)
+ foreach (FileDefinition fd in
DefinitionHandler.FindAvailableVersions (Path.Combine (Path.GetDirectoryName
(Environment.GetFolderPath (Environment.SpecialFolder.ApplicationData)),
"Definitions")))
+ MonoVersionCombo.Items.Add (fd);
foreach (FileDefinition fd in
DefinitionHandler.FindAvailableVersions (Path.Combine (Path.GetDirectoryName
(Application.ExecutablePath), "Definitions")))
MonoVersionCombo.Items.Add (fd);
@@ -463,7 +467,11 @@
private static string GetDefaultReportFolder ()
{
- return Path.Combine (Path.GetDirectoryName
(Application.ExecutablePath), "Reports");
+ // Unix-y people generally can't write to where the
executable is
+ if (Environment.OSVersion.Platform == PlatformID.Unix)
+ return Path.Combine (Path.GetDirectoryName
(Environment.GetFolderPath (Environment.SpecialFolder.ApplicationData)),
"Reports");
+ else
+ return Path.Combine (Path.GetDirectoryName
(Application.ExecutablePath), "Reports");
}
}
}
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches