~bratsche/ubuntu/maverick/monodevelop/disable-appmenu

« back to all changes in this revision

Viewing changes to src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Search/CurrentProjectDocumentIterator.cs

  • Committer: Bazaar Package Importer
  • Author(s): Stefan Ebner
  • Date: 2009-03-17 17:55:55 UTC
  • mfrom: (1.1.13 sid)
  • Revision ID: james.westby@ubuntu.com-20090317175555-2w5qbmu0l5maq6fq
Tags: 1.9.3+dfsg-1ubuntu1
* FFe for Monodevelop 2 granted by motu-release team :)
* Merge from Debian Unstable , remaining Ubuntu changes:
  + debian/control:
    - Update for Gnome# 2.24

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
// 
25
25
 
26
26
using System;
27
 
using System.Collections;
 
27
using System.Collections.Generic;
28
28
 
29
29
using MonoDevelop.Projects;
30
30
using MonoDevelop.Core;
49
49
                        return GettextCatalog.GetString ("Replacing '{0}' in project '{1}'", pattern, projectName);
50
50
                }
51
51
                
52
 
                public override void Reset() 
 
52
                public override void Reset () 
53
53
                {
54
 
                        files.Clear();
55
 
                        Document document;
56
 
                        if (IdeApp.Workspace.IsOpen && 
57
 
                           ((document = IdeApp.Workbench.ActiveDocument) != null) &&
58
 
                           //FIXME: when document.FileName == null, maybe it's interesting to pick the file selected on the project pad...
59
 
                           (document.FileName != null)) {
60
 
                                Project theProject = IdeApp.Workspace.GetProjectContainingFile (document.FileName);
61
 
                                projectName = theProject.Name;
62
 
                                foreach (ProjectFile file in theProject.Files)
63
 
                                        if (file.Subtype == Subtype.Code)
64
 
                                                files.Add(file.Name);
65
 
                        } else {
 
54
                        files.Clear ();
 
55
                        curIndex = -1;
 
56
                        
 
57
                        Project proj;
 
58
                        if (!IdeApp.Workspace.IsOpen ||
 
59
                                        ((proj = IdeApp.ProjectOperations.CurrentSelectedProject) == null &&
 
60
                                        (IdeApp.Workbench.ActiveDocument == null || (proj = IdeApp.Workbench.ActiveDocument.Project) == null)))
 
61
                        {
66
62
                                //FIXME: it may be interesting to show a warning dialog/message to the user in this case
67
63
                                projectName = GettextCatalog.GetString ("(none selected)");
68
 
                        }
69
 
                        
70
 
                        curIndex = -1;
 
64
                                return;
 
65
                        }
 
66
                        
 
67
                        HashSet<string> added = new HashSet<string> ();
 
68
                        foreach (ProjectFile file in proj.Files)
 
69
                                if (file.Subtype == Subtype.Code && added.Add (file.Name))
 
70
                                        files.Add (file.Name);
71
71
                }
72
72
        }
73
73
}