~3v1n0/unity-lens-applications/use-gee-0.8

« back to all changes in this revision

Viewing changes to src/xapian-utils.vala

  • Committer: Tarmac
  • Author(s): Pawel Stolowski
  • Date: 2013-05-16 23:32:08 UTC
  • mfrom: (337.1.6 merge-smartscopes2)
  • Revision ID: tarmac-20130516233208-px6irq6har6c12zw
Merge new scope API changes (100 scopes feature).

Approved by Łukasz Zemczak, PS Jenkins bot.

Show diffs side-by-side

added added

removed removed

Lines of Context:
31
31
    "accessibility",
32
32
    "developer",
33
33
    "science-and-engineering",
 
34
    "scopes",
34
35
    "system"
35
36
  };
36
37
 
58
59
      type_queries.insert ("accessibility", "(category:Accessibility AND NOT category:Settings)");
59
60
      type_queries.insert ("developer", "category:Development"); // FIXME emacs.desktop should be added
60
61
      type_queries.insert ("science-and-engineering", "(category:Science OR category:Engineering)");
 
62
      type_queries.insert ("scopes", "(pkg_wildcard:unity_scope_* OR pkg_wildcard:unity_lens_*)");
61
63
      type_queries.insert ("system", "(category:System OR category:Security)");
62
64
    }
63
65
  }
107
109
    if (Utils.is_search_empty (search_string))
108
110
    {
109
111
      if (options == null || !options.filtering)
110
 
        return "type:Application";
 
112
        return "(type:Application OR type:Scope)";
111
113
      else
112
 
        return "type:Application AND " + extract_type_query (options);
 
114
        return "(type:Application OR type:Scope) AND " + extract_type_query (options);
113
115
    }
114
116
    else
115
117
    {
125
127
      s = s.delimit ("-", ' ');
126
128
      
127
129
      if (options == null || !options.filtering)
128
 
        return "type:Application AND " + s;
 
130
        return "(type:Application OR type:Scope) AND " + s;
129
131
      else
130
 
        return "type:Application AND %s AND %s".printf (extract_type_query (options), s);
 
132
        return "(type:Application OR type:Scope) AND %s AND %s".printf (extract_type_query (options), s);
131
133
    }
132
134
  }
133
 
}
 
 
b'\\ No newline at end of file'
 
135
}