Merge lp:~stolowski/unity-lens-applications/show-more-apps-on-no-query into lp:unity-lens-applications

Proposed by Paweł Stołowski
Status: Merged
Approved by: Neil J. Patel
Approved revision: 302
Merged at revision: 302
Proposed branch: lp:~stolowski/unity-lens-applications/show-more-apps-on-no-query
Merge into: lp:unity-lens-applications
Diff against target: 508 lines (+275/-24)
8 files modified
src/Makefile.am (+1/-0)
src/daemon.vala (+108/-23)
src/runner.vala (+1/-1)
src/software-center-data-cache.vala (+71/-0)
src/software-center-data-provider.vala (+20/-0)
src/unity-package-search.cc (+62/-0)
src/unity-package-search.h (+9/-0)
vapi/unity-package-search.vapi (+3/-0)
To merge this branch: bzr merge lp:~stolowski/unity-lens-applications/show-more-apps-on-no-query
Reviewer Review Type Date Requested Status
Neil J. Patel (community) Approve
Review via email: mp+123983@code.launchpad.net

Commit message

List 10 'What's new' apps and the 12 'Top Rated' apps from Software Center in 'Apps Available for Download' before user performs any search if no filters are active.

List 100 top rated apps according to active filters if search string is empty.

Description of the change

List 10 'What's new' apps and the 12 'Top Rated' apps from Software Center in 'Apps Available for Download' before user performs any search if no filters are active.

List 100 top rated apps according to active filters if search string is empty.

WARNING! Don't approve until Software Center changes are merged.

To post a comment you must log in.
300. By Paweł Stołowski

Updated comment.

Revision history for this message
Michal Hruby (mhr3) wrote :

93 + var whats_new = sc_data_provider.get_items_for_category ("What’s New"); //make sure there is unicode char U+2019 (right quotation mark)

Very nasty that we need to pass an exact unicode string, imo the service should be fixed.

Revision history for this message
Michal Hruby (mhr3) wrote :

465 +typedef int (*AppFilterCallback)(UnityPackageInfo *, void *);

Shouldn't this return a gboolean instead? Or an enum perhaps? It's not obvious what the callback should be returning.

301. By Paweł Stołowski

Make filtering callback use bool return value.

302. By Paweł Stołowski

Use 'unity-whats-new' and 'unity-top-rated' categories instead of 'What's new' (requiring utf)
and 'Top Rated'. Requires lp:~mvo/software-center/extra-unity-categories.

Revision history for this message
Paweł Stołowski (stolowski) wrote :

Software Center has been fixed to provide unity-whats-new and unity-top-rated categories instead. Updated the code. Ready for re-review.

Revision history for this message
Neil J. Patel (njpatel) wrote :

Hi, this is approved pending that we can get the Software Centre bits landed for b2.

DO NOT APPROVE THIS UNTIL THEN.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/Makefile.am'
--- src/Makefile.am 2012-08-08 16:30:35 +0000
+++ src/Makefile.am 2012-09-17 15:59:25 +0000
@@ -61,6 +61,7 @@
61 utils.vala \61 utils.vala \
62 aptd-client.vala \62 aptd-client.vala \
63 software-center-data-provider.vala \63 software-center-data-provider.vala \
64 software-center-data-cache.vala \
64 $(NULL)65 $(NULL)
6566
66unity-package-search.o : $(srcdir)/unity-package-search.cc $(srcdir)/unity-package-search.h67unity-package-search.o : $(srcdir)/unity-package-search.cc $(srcdir)/unity-package-search.h
6768
=== modified file 'src/daemon.vala'
--- src/daemon.vala 2012-09-13 17:12:02 +0000
+++ src/daemon.vala 2012-09-17 15:59:25 +0000
@@ -26,6 +26,20 @@
2626
27namespace Unity.ApplicationsLens {27namespace Unity.ApplicationsLens {
2828
29 /* Number of 'Apps available for download' to show if no search query is provided AND a filter is active.
30 It shouldn't be too high as this may impact lens performance.
31 */
32 const uint MAX_APP_FOR_DOWNLOAD_FOR_EMPTY_QUERY = 100;
33
34 /* Number of top rated apps to show in 'Apps available for download' if no search query is provided AND NO filter is active. */
35 const uint MAX_TOP_RATED_APPS_FOR_EMPTY_QUERY = 12;
36
37 /* Number of "What's new" apps to show in 'Apps available for download' if no search query is provided AND NO filter is active. */
38 const uint MAX_WHATS_NEW_APPS_FOR_EMPTY_QUERY = 10;
39
40 /* Time between queries to SoftwareCenterDataProvider */
41 const int64 TOP_RATED_ITEMS_CACHE_LIFETIME = 24*3600; // 24 hours
42
29 const string ICON_PATH = Config.DATADIR + "/icons/unity-icon-theme/places/svg/";43 const string ICON_PATH = Config.DATADIR + "/icons/unity-icon-theme/places/svg/";
30 const string ICON_APP_INSTALL_PATH = Config.DATADIR + "/app-install/icons";44 const string ICON_APP_INSTALL_PATH = Config.DATADIR + "/app-install/icons";
3145
@@ -462,6 +476,14 @@
462 }476 }
463 }477 }
464478
479 /* Returns TRUE if application is NOT installed */
480 public bool filter_cb (Unity.Package.PackageInfo pkginfo)
481 {
482 var appmanager = AppInfoManager.get_default();
483 AppInfo? app = appmanager.lookup (pkginfo.desktop_file);
484 return app == null;
485 }
486
465 private async void update_scope_search (Unity.LensSearch search,487 private async void update_scope_search (Unity.LensSearch search,
466 Cancellable cancellable)488 Cancellable cancellable)
467 {489 {
@@ -475,6 +497,7 @@
475497
476 string pkg_search_string = prepare_pkg_search_string (search, filter);498 string pkg_search_string = prepare_pkg_search_string (search, filter);
477499
500 bool has_filter = (filter != null && filter.filtering);
478 bool has_search = !Utils.is_search_empty (search);501 bool has_search = !Utils.is_search_empty (search);
479502
480 Timer timer = new Timer ();503 Timer timer = new Timer ();
@@ -556,16 +579,43 @@
556 debug ("Entry search listed %i Available apps in %fms for query: %s",579 debug ("Entry search listed %i Available apps in %fms for query: %s",
557 pkgresults.num_hits, timer.elapsed ()*1000, pkg_search_string);580 pkgresults.num_hits, timer.elapsed ()*1000, pkg_search_string);
558 }581 }
559 else582 else if (has_filter) /* Empty search string + active filters should get lots of results from selected categories */
560 {583 {
561 timer.start ();584 timer.start ();
562 string? filter_query = prepare_pkg_search_string (search, filter);585 string? filter_query = prepare_pkg_search_string (search, filter);
563 var random_pkgresults = pkgsearcher.get_random_apps (filter_query, 12);586
564 add_pkg_search_result (random_pkgresults, installed_uris, available_uris,587 var pkgresults = pkgsearcher.get_apps (filter_query, MAX_APP_FOR_DOWNLOAD_FOR_EMPTY_QUERY, filter_cb);
565 model, Category.AVAILABLE, 6);588 add_pkg_search_result (pkgresults, installed_uris, available_uris, model, Category.AVAILABLE, MAX_APP_FOR_DOWNLOAD_FOR_EMPTY_QUERY);
566 timer.stop ();589 timer.stop ();
567 debug ("Entry search listed %i random Available apps in %fms",590 debug ("Entry search listed %i Available apps in %fms",
568 random_pkgresults.num_hits, timer.elapsed ()*1000);591 pkgresults.num_hits, timer.elapsed ()*1000);
592 }
593 else
594 {
595 timer.start ();
596
597 uint hits = 0;
598 try
599 {
600 Set<string> duplicates_lookup = new HashSet<string> ();
601
602 if (sc_data_provider == null)
603 sc_data_provider = new SoftwareCenterDataCache (TOP_RATED_ITEMS_CACHE_LIFETIME);
604
605 var whats_new = sc_data_provider.get_items_for_category ("unity-whats-new");
606 hits = add_sc_category_results (whats_new, model, Category.AVAILABLE, ref duplicates_lookup, MAX_WHATS_NEW_APPS_FOR_EMPTY_QUERY);
607
608 var top_rated = sc_data_provider.get_items_for_category ("unity-top-rated");
609 hits += add_sc_category_results (top_rated, model, Category.AVAILABLE, ref duplicates_lookup, MAX_TOP_RATED_APPS_FOR_EMPTY_QUERY);
610 }
611 catch (GLib.Error e)
612 {
613 warning ("Failed to get top rated apps: %s", e.message);
614 }
615
616 timer.stop ();
617 debug ("Entry search listed %u top rated/new available apps in %fms",
618 hits, timer.elapsed ()*1000);
569 }619 }
570 }620 }
571621
@@ -749,25 +799,25 @@
749 return default_icon.to_string ();799 return default_icon.to_string ();
750 }800 }
751801
752 public Icon find_pkg_icon (Unity.Package.PackageInfo pkginfo)802 public Icon find_pkg_icon (string desktop_file, string icon_name)
753 {803 {
754 string desktop_id = Path.get_basename (pkginfo.desktop_file);804 string desktop_id = Path.get_basename (desktop_file);
755 bool installed = AppInfoManager.get_default().lookup (desktop_id) != null;805 bool installed = AppInfoManager.get_default().lookup (desktop_id) != null;
756806
757 /* If the app is already installed we should be able to pull the807 /* If the app is already installed we should be able to pull the
758 * icon from the theme */808 * icon from the theme */
759 if (installed)809 if (installed)
760 return new ThemedIcon (pkginfo.icon);810 return new ThemedIcon (icon_name);
761811
762 /* App is not installed - we need to find the right icon in the bowels812 /* App is not installed - we need to find the right icon in the bowels
763 * of the software center */813 * of the software center */
764 if (pkginfo.icon.has_prefix ("/"))814 if (icon_name.has_prefix ("/"))
765 {815 {
766 return new FileIcon (File.new_for_path (pkginfo.icon));816 return new FileIcon (File.new_for_path (icon_name));
767 }817 }
768 else818 else
769 {819 {
770 Icon icon = file_icon_cache.lookup (pkginfo.icon);820 Icon icon = file_icon_cache.lookup (icon_name);
771821
772 if (icon != null)822 if (icon != null)
773 return icon;823 return icon;
@@ -775,24 +825,24 @@
775 /* If the icon name contains a . it probably already have a825 /* If the icon name contains a . it probably already have a
776 * type postfix - so test icon name directly */826 * type postfix - so test icon name directly */
777 string path;827 string path;
778 if ("." in pkginfo.icon)828 if ("." in icon_name)
779 {829 {
780 path = @"$(Config.DATADIR)/app-install/icons/$(pkginfo.icon)";830 path = @"$(Config.DATADIR)/app-install/icons/$(icon_name)";
781 if (FileUtils.test (path, FileTest.EXISTS))831 if (FileUtils.test (path, FileTest.EXISTS))
782 {832 {
783 icon = new FileIcon (File.new_for_path (path));833 icon = new FileIcon (File.new_for_path (path));
784 file_icon_cache.insert (pkginfo.icon, icon);834 file_icon_cache.insert (icon_name, icon);
785 return icon;835 return icon;
786 }836 }
787 /* Try also software center cache dir */837 /* Try also software center cache dir */
788 path = Path.build_filename (Environment.get_user_cache_dir (),838 path = Path.build_filename (Environment.get_user_cache_dir (),
789 "software-center",839 "software-center",
790 "icons",840 "icons",
791 pkginfo.icon);841 icon_name);
792 if (FileUtils.test (path, FileTest.EXISTS))842 if (FileUtils.test (path, FileTest.EXISTS))
793 {843 {
794 icon = new FileIcon (File.new_for_path (path));844 icon = new FileIcon (File.new_for_path (path));
795 file_icon_cache.insert (pkginfo.icon, icon);845 file_icon_cache.insert (icon_name, icon);
796 return icon;846 return icon;
797 }847 }
798 }848 }
@@ -800,12 +850,12 @@
800 /* Now try appending all the image extensions we know */850 /* Now try appending all the image extensions we know */
801 foreach (var ext in image_extensions)851 foreach (var ext in image_extensions)
802 {852 {
803 path = @"$(Config.DATADIR)/app-install/icons/$(pkginfo.icon).$(ext)";853 path = @"$(Config.DATADIR)/app-install/icons/$(icon_name).$(ext)";
804 if (FileUtils.test (path, FileTest.EXISTS))854 if (FileUtils.test (path, FileTest.EXISTS))
805 {855 {
806 /* Got it! Cache the icon path and return the icon */856 /* Got it! Cache the icon path and return the icon */
807 icon = new FileIcon (File.new_for_path (path));857 icon = new FileIcon (File.new_for_path (path));
808 file_icon_cache.insert (pkginfo.icon, icon);858 file_icon_cache.insert (icon_name, icon);
809 return icon;859 return icon;
810 }860 }
811 }861 }
@@ -813,7 +863,7 @@
813863
814 /* Cache the fact that we couldn't find this icon */864 /* Cache the fact that we couldn't find this icon */
815 var icon = new ThemedIcon ("applications-other");865 var icon = new ThemedIcon ("applications-other");
816 file_icon_cache.insert (pkginfo.icon, icon);866 file_icon_cache.insert (icon_name, icon);
817867
818 return icon;868 return icon;
819 }869 }
@@ -880,6 +930,41 @@
880 return GLib.Path.get_basename (name);930 return GLib.Path.get_basename (name);
881 }931 }
882932
933 /**
934 * Add all results obtained from SoftwareCenterDataProvider
935 */
936 private uint add_sc_category_results (SoftwareCenterDataProviderService.AppInfo?[] results,
937 Dee.Model model,
938 Category category,
939 ref Set<string> duplicates_lookup,
940 uint max_results)
941 {
942 uint i = 0;
943 foreach (SoftwareCenterDataProviderService.AppInfo app in results)
944 {
945 string uri = @"unity-install://$(app.package_name)/$(app.application_name)";
946
947 if (uri in duplicates_lookup)
948 {
949 continue;
950 }
951
952 Icon icon = find_pkg_icon (app.desktop_file, app.icon);
953
954 model.append (uri, icon.to_string (),
955 category,
956 "application/x-desktop",
957 app.application_name,
958 "", //comment
959 "file://" + app.desktop_file);
960 duplicates_lookup.add (uri);
961 i++;
962 if (i == max_results)
963 break;
964 }
965 return i;
966 }
967
883 private void add_pkg_search_result (Unity.Package.SearchResult results,968 private void add_pkg_search_result (Unity.Package.SearchResult results,
884 Set<string> installed_uris,969 Set<string> installed_uris,
885 Set<string> available_uris,970 Set<string> available_uris,
@@ -953,7 +1038,7 @@
953 available_uris.add (uri); 1038 available_uris.add (uri);
954 }1039 }
9551040
956 Icon icon = find_pkg_icon (pkginfo);1041 Icon icon = find_pkg_icon (pkginfo.desktop_file, pkginfo.icon);
9571042
958 model.append (uri, icon.to_string (),1043 model.append (uri, icon.to_string (),
959 category,"application/x-desktop",1044 category,"application/x-desktop",
@@ -1159,7 +1244,7 @@
1159 try {1244 try {
1160 if (sc_data_provider == null)1245 if (sc_data_provider == null)
1161 {1246 {
1162 sc_data_provider = new SoftwareCenterDataProviderProxy ();1247 sc_data_provider = new SoftwareCenterDataCache (TOP_RATED_ITEMS_CACHE_LIFETIME);
1163 sc_data_provider.connect_to ();1248 sc_data_provider.connect_to ();
1164 }1249 }
11651250
11661251
=== modified file 'src/runner.vala'
--- src/runner.vala 2012-08-14 14:32:55 +0000
+++ src/runner.vala 2012-09-17 15:59:25 +0000
@@ -415,7 +415,7 @@
415 continue;415 continue;
416 416
417 // pick the first one417 // pick the first one
418 icon = this.daemon.find_pkg_icon (pkginfo);418 icon = this.daemon.find_pkg_icon (pkginfo.desktop_file, pkginfo.icon);
419 return exec_string;419 return exec_string;
420 420
421 }421 }
422422
=== added file 'src/software-center-data-cache.vala'
--- src/software-center-data-cache.vala 1970-01-01 00:00:00 +0000
+++ src/software-center-data-cache.vala 2012-09-17 15:59:25 +0000
@@ -0,0 +1,71 @@
1/*
2 * Copyright (C) 2012 Canonical Ltd
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 3 as
6 * published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Authored by Pawel Stolowski <pawel.stolowski@canonical.com>
17 */
18
19namespace Unity.ApplicationsLens {
20
21public class SoftwareCenterDataCache: SoftwareCenterDataProviderProxy
22{
23 public int64 category_items_lifetime { get; set; }
24 private HashTable<string, int64?> category_items_last_update;
25 private HashTable<string, Gee.ArrayList<SoftwareCenterDataProviderService.AppInfo?>> category_items_cached;
26
27 public SoftwareCenterDataCache (int64 category_items_lifetime)
28 {
29 category_items_last_update = new HashTable<string, int64?> (str_hash, str_equal);
30 category_items_cached = new HashTable<string, Gee.ArrayList<SoftwareCenterDataProviderService.AppInfo?>> (str_hash, str_equal);
31 this.category_items_lifetime = category_items_lifetime;
32 }
33
34 internal static bool outdated (ref int64 last_update, int64 lifetime)
35 {
36 var current_time = new GLib.DateTime.now_utc ();
37 int64 current_unix_time = current_time.to_unix ();
38 if (current_unix_time > last_update + lifetime)
39 {
40 last_update = current_unix_time;
41 return true;
42 }
43 return false;
44 }
45
46 public override SoftwareCenterDataProviderService.AppInfo?[] get_items_for_category (string category_name) throws Error
47 {
48 int64 last_update = 0;
49 if (category_items_last_update.contains (category_name))
50 {
51 last_update = category_items_last_update[category_name];
52 }
53
54 if (outdated (ref last_update, category_items_lifetime))
55 {
56 category_items_last_update[category_name] = last_update;
57
58 var data = base.get_items_for_category (category_name);
59 var results = new Gee.ArrayList<SoftwareCenterDataProviderService.AppInfo?> ();
60 foreach (var item in data)
61 {
62 results.add (item);
63 }
64 category_items_cached[category_name] = results;
65 return data;
66 }
67 return category_items_cached[category_name].to_array ();
68 }
69}
70
71}
0\ No newline at end of file72\ No newline at end of file
173
=== modified file 'src/software-center-data-provider.vala'
--- src/software-center-data-provider.vala 2012-09-06 08:11:17 +0000
+++ src/software-center-data-provider.vala 2012-09-17 15:59:25 +0000
@@ -24,7 +24,18 @@
24 [DBus (name = "com.ubuntu.SoftwareCenterDataProvider")]24 [DBus (name = "com.ubuntu.SoftwareCenterDataProvider")]
25 public interface SoftwareCenterDataProviderService: GLib.Object25 public interface SoftwareCenterDataProviderService: GLib.Object
26 {26 {
27 public struct AppInfo
28 {
29 string application_name;
30 string package_name;
31 string icon;
32 string desktop_file;
33 }
34
27 public abstract HashTable<string, Variant> get_app_details (string appname, string pkgname) throws Error;35 public abstract HashTable<string, Variant> get_app_details (string appname, string pkgname) throws Error;
36 public abstract string[] get_available_categories () throws Error;
37 public abstract string[] get_available_subcategories () throws Error;
38 public abstract AppInfo?[] get_items_for_category (string category_name) throws Error;
28 }39 }
29 40
30 public class SoftwareCenterDataProviderProxy: GLib.Object41 public class SoftwareCenterDataProviderProxy: GLib.Object
@@ -125,6 +136,15 @@
125 return data;136 return data;
126 }137 }
127138
139 public virtual SoftwareCenterDataProviderService.AppInfo?[] get_items_for_category (string category_name) throws Error
140 {
141 if (_service == null)
142 connect_to ();
143
144 SoftwareCenterDataProviderService.AppInfo?[] data = _service.get_items_for_category (category_name);
145 return data;
146 }
147
128 private SoftwareCenterDataProviderService _service;148 private SoftwareCenterDataProviderService _service;
129 }149 }
130}150}
131151
=== modified file 'src/unity-package-search.cc'
--- src/unity-package-search.cc 2012-08-08 16:57:47 +0000
+++ src/unity-package-search.cc 2012-09-17 15:59:25 +0000
@@ -475,6 +475,68 @@
475 return result;475 return result;
476}476}
477477
478/**
479 * Get applications matching given xapian filter query and additionally filter results out
480 * using AppFilterCallback, until n_apps matching apps are found.
481 * Results are filtered out if AppFilterCallback returns FALSE.
482 */
483UnityPackageSearchResult* unity_package_searcher_get_apps (UnityPackageSearcher *searcher,
484 const gchar *filter_query,
485 guint n_apps,
486 AppFilterCallback cb,
487 gpointer data)
488{
489 UnityPackageSearchResult *result;
490 GHashTable *unique;
491 guint num_matches = 0;
492
493 g_return_val_if_fail (searcher != NULL, NULL);
494
495 unique = g_hash_table_new (g_str_hash, g_str_equal);
496
497 result = g_slice_new0 (UnityPackageSearchResult);
498
499 g_debug ("FILTER %s", filter_query);
500
501 Xapian::Query query;
502 try
503 {
504 query = searcher->query_parser->parse_query (filter_query, QUERY_PARSER_FILTER_FLAGS);
505 searcher->enquire->set_sort_by_relevance ();
506 searcher->enquire->set_query(query);
507
508 Xapian::MSet matches = searcher->enquire->get_mset(0, searcher->db->get_doccount ());
509 Xapian::MSetIterator iter = matches.begin();
510 while (num_matches < n_apps && iter != matches.end())
511 {
512 Xapian::Document doc = iter.get_document ();
513 UnityPackageInfo *pkginfo = _pkginfo_from_document (doc);
514
515 if (g_hash_table_lookup_extended (unique, pkginfo->package_name, NULL, NULL) || cb(pkginfo, data) == FALSE)
516 {
517 _free_package_info (pkginfo);
518 }
519 else
520 {
521 g_hash_table_insert (unique, pkginfo->package_name, NULL);
522 result->results = g_slist_prepend (result->results, pkginfo);
523 num_matches++;
524 }
525 ++iter;
526 }
527 }
528 catch (Xapian::Error e)
529 {
530 g_debug ("Error getting apps for query '%s': %s", filter_query, e.get_msg().c_str());
531 return g_slice_new0 (UnityPackageSearchResult);
532 }
533
534 g_hash_table_unref (unique);
535
536 result->num_hits = num_matches;
537 return result;
538}
539
478UnityPackageSearchResult*540UnityPackageSearchResult*
479unity_package_searcher_get_random_apps (UnityPackageSearcher *searcher,541unity_package_searcher_get_random_apps (UnityPackageSearcher *searcher,
480 const gchar *filter_query,542 const gchar *filter_query,
481543
=== modified file 'src/unity-package-search.h'
--- src/unity-package-search.h 2012-07-26 14:07:49 +0000
+++ src/unity-package-search.h 2012-09-17 15:59:25 +0000
@@ -49,9 +49,12 @@
49 gint relevancy;49 gint relevancy;
50} UnityPackageInfo;50} UnityPackageInfo;
5151
52typedef gboolean (*AppFilterCallback)(UnityPackageInfo *, void *);
53
52#ifdef __cplusplus54#ifdef __cplusplus
53extern "C" {55extern "C" {
54#endif56#endif
57
5558
56UnityPackageSearcher* unity_package_searcher_new ();59UnityPackageSearcher* unity_package_searcher_new ();
5760
@@ -69,6 +72,12 @@
69 const gchar *filter_query,72 const gchar *filter_query,
70 guint n_apps);73 guint n_apps);
7174
75UnityPackageSearchResult* unity_package_searcher_get_apps (UnityPackageSearcher *searcher,
76 const gchar *filter_query,
77 guint n_apps,
78 AppFilterCallback cb,
79 gpointer data);
80
72void unity_package_search_result_free (UnityPackageSearchResult *result);81void unity_package_search_result_free (UnityPackageSearchResult *result);
7382
74void unity_package_package_info_free (UnityPackageInfo *pkginfo);83void unity_package_package_info_free (UnityPackageInfo *pkginfo);
7584
=== modified file 'vapi/unity-package-search.vapi'
--- vapi/unity-package-search.vapi 2012-08-08 13:52:11 +0000
+++ vapi/unity-package-search.vapi 2012-09-17 15:59:25 +0000
@@ -18,6 +18,8 @@
18 BY_RELEVANCY18 BY_RELEVANCY
19 }19 }
20 20
21 public delegate bool AppFilterCallback (PackageInfo pkginfo);
22
21 [Compact]23 [Compact]
22 [CCode (free_function = "unity_package_searcher_free", cheader_filename = "unity-package-search.h")]24 [CCode (free_function = "unity_package_searcher_free", cheader_filename = "unity-package-search.h")]
23 public class Searcher {25 public class Searcher {
@@ -27,6 +29,7 @@
27 public Searcher.for_menu(GMenu.Tree menu);29 public Searcher.for_menu(GMenu.Tree menu);
28 public SearchResult search (string search_string, uint max_hits, Unity.Package.SearchType search_type, Unity.Package.Sort sort);30 public SearchResult search (string search_string, uint max_hits, Unity.Package.SearchType search_type, Unity.Package.Sort sort);
29 public SearchResult get_random_apps (string? filter_query, uint n_apps);31 public SearchResult get_random_apps (string? filter_query, uint n_apps);
32 public SearchResult get_apps (string? filter_query, uint n_apps, AppFilterCallback cb);
30 public PackageInfo? get_by_desktop_file (string desktop_file);33 public PackageInfo? get_by_desktop_file (string desktop_file);
31 }34 }
32 35

Subscribers

People subscribed via source and target branches