From 389006e14e3e94d3def2002410f91ec415a4be14 Mon Sep 17 00:00:00 2001 From: alpinechough Date: Sat, 15 Jan 2011 23:24:13 +0100 Subject: [PATCH] If assembly could not be found, search in datafile-directory. --- ChangeLog | 1 + CoverageModel.cs | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/ChangeLog b/ChangeLog index 99b7f24..41e1830 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,7 @@ 2011-01-15 Andreas Windischer * gui/gtk/CoverageView.cs: Expand on double click fix. + * CoverageModel.cs: If assembly could not be found, search in datafile-directory. 2011-01-12 Andreas Windischer diff --git a/CoverageModel.cs b/CoverageModel.cs index 6fcc3f4..0556556 100644 --- a/CoverageModel.cs +++ b/CoverageModel.cs @@ -16,6 +16,7 @@ public delegate void CoverageProgress (string item, double percent); public class CoverageModel : CoverageItem { + private string dataFileName; private Hashtable namespaces; private Hashtable classes; private Hashtable sources; @@ -32,6 +33,7 @@ public class CoverageModel : CoverageItem { public CoverageModel () { + dataFileName = string.Empty; namespaces = new Hashtable (); classes = new Hashtable (); sources = new Hashtable (); @@ -94,6 +96,12 @@ public class CoverageModel : CoverageItem { string filename = n.Attributes ["filename"].Value; MonoSymbolFile symbolFile; + if (!File.Exists (filename)) { + string newFilename = Path.Combine(Path.GetDirectoryName (dataFileName), Path.GetFileName (filename)); + if (File.Exists (newFilename)) + filename = newFilename; + } + #if USE_REFLECTION Assembly assembly = Assembly.Load (assemblyName); @@ -190,6 +198,7 @@ public class CoverageModel : CoverageItem { public void ReadFromFile (string fileName) { + dataFileName = fileName; namespaces = new Hashtable (); classes = new Hashtable ();