Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/monodevelop.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Hutchinson <m.j.hutchinson@gmail.com>2015-04-02 02:32:44 +0300
committerMichael Hutchinson <m.j.hutchinson@gmail.com>2015-04-02 02:32:44 +0300
commita717fd375b2bc66c50e01355a93673b1da19d273 (patch)
tree1f4524205c2ab8e8bf4ddd3a27aad5670761a3d1 /main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Tasks
parentd1da6f5c49ad93486719396a596413a68969677a (diff)
[Ide] Only jump to errors in text files
Prevents e.g. opening the Windows Photo Viewer when a build task has a problem with a PNG file.
Diffstat (limited to 'main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Tasks')
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Tasks/TaskStore.cs25
1 files changed, 22 insertions, 3 deletions
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Tasks/TaskStore.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Tasks/TaskStore.cs
index bb41f90835..dc2da230bc 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Tasks/TaskStore.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Tasks/TaskStore.cs
@@ -41,7 +41,8 @@ using MonoDevelop.Projects;
using MonoDevelop.Ide.Gui;
using MonoDevelop.Ide.Gui.Content;
using MonoDevelop.Ide.Navigation;
-using MonoDevelop.Ide.TextEditing;
+using MonoDevelop.Ide.TextEditing;
+using MonoDevelop.Ide.Desktop;
namespace MonoDevelop.Ide.Tasks
{
@@ -427,15 +428,33 @@ namespace MonoDevelop.Ide.Tasks
return null;
}
}
-
+
+ /// <summary>
+ /// Determines whether the task's file should be opened automatically when jumping to the next error.
+ /// </summary>
public static bool IsProjectTaskFile (Task t)
{
if (t.FileName.IsNullOrEmpty)
return false;
+
+ //only files that are part of project
Project p = t.WorkspaceObject as Project;
if (p == null)
return false;
- return p.GetProjectFile (t.FileName) != null;
+ if (p.GetProjectFile (t.FileName) == null)
+ return false;
+
+ //only text files
+ var mimeType = DesktopService.GetMimeTypeForUri (t.FileName);
+ if (!DesktopService.GetMimeTypeIsText (mimeType))
+ return false;
+
+ //only files for which we have a default internal display binding
+ var binding = DisplayBindingService.GetDefaultBinding (t.FileName, mimeType, p);
+ if (binding == null || !binding.CanUseAsDefault || binding is IExternalDisplayBinding)
+ return false;
+
+ return true;
}