[Monodevelop-patches-list] r1883 - in trunk/MonoDevelop/Core/src: Libraries/MonoDevelop.Core Libraries/MonoDevelop.Core/Services Main/Base Main/Base/Commands Main/Base/Services/File
commit-watcher at mono-cvs.ximian.com
commit-watcher at mono-cvs.ximian.com
Fri Jul 2 04:03:08 EDT 2004
Author: tberman
Date: 2004-07-02 04:03:07 -0400 (Fri, 02 Jul 2004)
New Revision: 1883
Modified:
trunk/MonoDevelop/Core/src/Libraries/MonoDevelop.Core/ChangeLog
trunk/MonoDevelop/Core/src/Libraries/MonoDevelop.Core/Services/FileUtilityService.cs
trunk/MonoDevelop/Core/src/Main/Base/ChangeLog
trunk/MonoDevelop/Core/src/Main/Base/Commands/FileCommands.cs
trunk/MonoDevelop/Core/src/Main/Base/Services/File/DefaultFileService.cs
Log:
fix bug, clean up some code.
Modified: trunk/MonoDevelop/Core/src/Libraries/MonoDevelop.Core/ChangeLog
===================================================================
--- trunk/MonoDevelop/Core/src/Libraries/MonoDevelop.Core/ChangeLog 2004-07-02 04:30:49 UTC (rev 1882)
+++ trunk/MonoDevelop/Core/src/Libraries/MonoDevelop.Core/ChangeLog 2004-07-02 08:03:07 UTC (rev 1883)
@@ -1,3 +1,8 @@
+2004-07-02 Todd Berman <tberman at off.net>
+
+ * Services/FileUtilityService.cs: remove some unneeded code, and
+ fix a string.
+
2004-06-28 Todd Berman <tberman at off.net>
* AddIns/AddIn.cs: Add a C.WL so you dont get weird errors without
Modified: trunk/MonoDevelop/Core/src/Libraries/MonoDevelop.Core/Services/FileUtilityService.cs
===================================================================
--- trunk/MonoDevelop/Core/src/Libraries/MonoDevelop.Core/Services/FileUtilityService.cs 2004-07-02 04:30:49 UTC (rev 1882)
+++ trunk/MonoDevelop/Core/src/Libraries/MonoDevelop.Core/Services/FileUtilityService.cs 2004-07-02 08:03:07 UTC (rev 1883)
@@ -58,11 +58,6 @@
sharpDevelopRootPath = Path.GetDirectoryName(Assembly.GetEntryAssembly().Location) + Path.DirectorySeparatorChar + "..";
}
- public override void InitializeService()
- {
- base.InitializeService();
- }
-
public override void UnloadService()
{
base.UnloadService();
@@ -392,7 +387,7 @@
{
return ObservedLoad(saveFile,
fileName,
- GettextCatalog.GetString ("Unable to save file."),
+ GettextCatalog.GetString ("Unable to load file."),
policy);
}
Modified: trunk/MonoDevelop/Core/src/Main/Base/ChangeLog
===================================================================
--- trunk/MonoDevelop/Core/src/Main/Base/ChangeLog 2004-07-02 04:30:49 UTC (rev 1882)
+++ trunk/MonoDevelop/Core/src/Main/Base/ChangeLog 2004-07-02 08:03:07 UTC (rev 1883)
@@ -1,3 +1,10 @@
+2004-07-02 Todd Berman <tberman at off.net>
+
+ * Commands/FileCommands.cs: Dont use the FileFilters, as there are
+ not functional at the moment.
+ * Services/File/DefaultFileService.cs: don't attempt to load a
+ directory, as its never valid.
+
2004-07-01 John Luke <jluke at cfl.rr.com>
* Commands/AutoStartCommands.cs: remove old Code generation,
Modified: trunk/MonoDevelop/Core/src/Main/Base/Commands/FileCommands.cs
===================================================================
--- trunk/MonoDevelop/Core/src/Main/Base/Commands/FileCommands.cs 2004-07-02 04:30:49 UTC (rev 1882)
+++ trunk/MonoDevelop/Core/src/Main/Base/Commands/FileCommands.cs 2004-07-02 08:03:07 UTC (rev 1883)
@@ -259,43 +259,40 @@
public override void Run()
{
- string[] fileFilters = (string[])(AddInTreeSingleton.AddInTree.GetTreeNode("/SharpDevelop/Workbench/FileFilter").BuildChildItems(this)).ToArray(typeof(string));
- bool foundFilter = false;
- // search filter like in the current selected project
+ //string[] fileFilters = (string[])(AddInTreeSingleton.AddInTree.GetTreeNode("/SharpDevelop/Workbench/FileFilter").BuildChildItems(this)).ToArray(typeof(string));
+ //bool foundFilter = false;
+ // search filter like in the current selected project
+ /*
+ IProjectService projectService = (IProjectService)MonoDevelop.Core.Services.ServiceManager.GetService(typeof(IProjectService));
+
+ if (projectService.CurrentSelectedProject != null) {
+ LanguageBindingService languageBindingService = (LanguageBindingService)MonoDevelop.Core.Services.ServiceManager.GetService(typeof(LanguageBindingService));
- IProjectService projectService = (IProjectService)MonoDevelop.Core.Services.ServiceManager.GetService(typeof(IProjectService));
-
- if (projectService.CurrentSelectedProject != null) {
- LanguageBindingService languageBindingService = (LanguageBindingService)MonoDevelop.Core.Services.ServiceManager.GetService(typeof(LanguageBindingService));
-
- LanguageBindingCodon languageCodon = languageBindingService.GetCodonPerLanguageName(projectService.CurrentSelectedProject.ProjectType);
-
- for (int i = 0; !foundFilter && i < fileFilters.Length; ++i) {
- for (int j = 0; !foundFilter && j < languageCodon.Supportedextensions.Length; ++j) {
- if (fileFilters[i].IndexOf(languageCodon.Supportedextensions[j]) >= 0) {
- break;
- }
+ LanguageBindingCodon languageCodon = languageBindingService.GetCodonPerLanguageName(projectService.CurrentSelectedProject.ProjectType);
+ for (int i = 0; !foundFilter && i < fileFilters.Length; ++i) {
+ for (int j = 0; !foundFilter && j < languageCodon.Supportedextensions.Length; ++j) {
+ if (fileFilters[i].IndexOf(languageCodon.Supportedextensions[j]) >= 0) {
+ break;
}
}
}
-
- // search filter like in the current open file
- if (!foundFilter) {
- IWorkbenchWindow window = WorkbenchSingleton.Workbench.ActiveWorkbenchWindow;
- if (window != null) {
- for (int i = 0; i < fileFilters.Length; ++i) {
- if (fileFilters[i].IndexOf(Path.GetExtension(window.ViewContent.ContentName == null ? window.ViewContent.UntitledName : window.ViewContent.ContentName)) >= 0) {
- break;
- }
+ }
+
+ // search filter like in the current open file
+ if (!foundFilter) {
+ IWorkbenchWindow window = WorkbenchSingleton.Workbench.ActiveWorkbenchWindow;
+ if (window != null) {
+ for (int i = 0; i < fileFilters.Length; ++i) {
+ if (fileFilters[i].IndexOf(Path.GetExtension(window.ViewContent.ContentName == null ? window.ViewContent.UntitledName : window.ViewContent.ContentName)) >= 0) {
+ break;
}
}
}
-
- using (FileSelector fs = new FileSelector (GettextCatalog.GetString ("File to Open"))) {
- int response = fs.Run ();
- fs.Hide ();
- string name = fs.Filename;
-
+ }*/
+ using (FileSelector fs = new FileSelector (GettextCatalog.GetString ("File to Open"))) {
+ int response = fs.Run ();
+ fs.Hide ();
+ string name = fs.Filename;
if (response == (int)Gtk.ResponseType.Ok) {
IFileService fileService = (IFileService)MonoDevelop.Core.Services.ServiceManager.GetService(typeof(IFileService));
IProjectService proj = (IProjectService)ServiceManager.GetService (typeof (IProjectService));
@@ -308,7 +305,7 @@
fileService.OpenFile(name);
break;
}
- }
+ }
}
}
}
Modified: trunk/MonoDevelop/Core/src/Main/Base/Services/File/DefaultFileService.cs
===================================================================
--- trunk/MonoDevelop/Core/src/Main/Base/Services/File/DefaultFileService.cs 2004-07-02 04:30:49 UTC (rev 1882)
+++ trunk/MonoDevelop/Core/src/Main/Base/Services/File/DefaultFileService.cs 2004-07-02 08:03:07 UTC (rev 1883)
@@ -95,6 +95,9 @@
fileName = System.IO.Path.GetFullPath (fileName);
//Debug.Assert(fileUtilityService.IsValidFileName(fileName));
+ if (fileUtilityService.IsDirectory (fileName)) {
+ return;
+ }
// test, if file fileName exists
if (!fileName.StartsWith("http://")) {
// test, if an untitled file should be opened
More information about the Monodevelop-patches-list
mailing list