~c-franke/do/XesamSearch

« back to all changes in this revision

Viewing changes to DoXesamSearchAction.cs

  • Committer: Christof Franke
  • Date: 2008-03-03 16:36:15 UTC
  • Revision ID: kraut@workstation-20080303163615-eyutlmi093o42xwn
* GNU General Public License added.
* Error Massage if Desktop Searchengine is not running.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
// DoXesamSearchAction.cs 
2
2
// User: kraut (c.franke@muenchen-mail.de) at 22:23 21.02.2008
 
3
//
 
4
//  GNOME Do is the legal property of its developers, whose names are too numerous
 
5
//  to list here.  Please refer to the COPYRIGHT file distributed with this
 
6
//  source distribution.
 
7
//
 
8
//  This program is free software: you can redistribute it and/or modify
 
9
//  it under the terms of the GNU General Public License as published by
 
10
//  the Free Software Foundation, either version 3 of the License, or
 
11
//  (at your option) any later version.
 
12
//
 
13
//  This program is distributed in the hope that it will be useful,
 
14
//  but WITHOUT ANY WARRANTY; without even the implied warranty of
 
15
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
16
//  GNU General Public License for more details.
 
17
//
 
18
//  You should have received a copy of the GNU General Public License
 
19
//  along with this program.  If not, see <http://www.gnu.org/licenses/>.
3
20
 
4
21
 
5
22
using System;
46
63
                                List<IItem> attachment = new List<IItem>();
47
64
                                List<IItem> email = new List<IItem>();
48
65
                                List<IItem> imMsg = new List<IItem>();
49
 
                        
 
66
                                List<IItem> errors = new List<IItem>();
50
67
                                string searchstr = (item as ITextItem).Text;
51
68
                                List<Dictionary<string,string>> result=DoXesamDriver.GetSearchResults(searchstr,1000);
52
69
                                
53
70
                                
54
71
                                foreach(Dictionary<string,string> ss in result)
55
72
                                {       
 
73
                                        if(result.Count>1){  //dictionary.length                                                
56
74
                                        if((ss["xesam:url"]).StartsWith("file://")& ss["beagle:protocol"]=="")
57
75
                                        {       
58
76
                                                files.Add(new FileItem(""+ss["xesam:url"]));
77
95
                                                if(ss["xesam:url"].StartsWith("email://")){
78
96
                                                        email.Add(new XesamEmailItem(ss));
79
97
                                                }
 
98
                                        }
 
99
}
 
100
                                        
 
101
                                        if(ss["error"]!=""){
 
102
                                                errors.Add(new TextItem(ss["error"]));
80
103
                                        }                       
81
104
                                }       
82
105
                                //Add result groups
 
106
                                files.AddRange(errors);
83
107
                                files.AddRange(attachment);
84
108
                                files.AddRange(email);
85
109
                                files.AddRange(imMsg);
86
110
                                return files.ToArray();         
87
111
                }
88
112
        }
89
 
}
 
 
b'\\ No newline at end of file'
 
113
}