~stolowski/unity-lens-applications/no-uninstall-for-ubuntu-desktop

« back to all changes in this revision

Viewing changes to src/daemon.vala

  • Committer: Pawel Stolowski
  • Date: 2012-08-30 11:23:14 UTC
  • mto: This revision was merged to the branch mainline in revision 294.
  • Revision ID: pawel.stolowski@canonical.com-20120830112314-3xlhipvepxrdby0j
Provide binary name as comment in the results model - needed by Home Lens.

Show diffs side-by-side

added added

removed removed

Lines of Context:
879
879
      });
880
880
    }
881
881
 
 
882
    /**
 
883
     * Sanitize executable name -- make it suitable for Home Lens. 
 
884
     */
 
885
    private static string sanitize_binary_name (string name)
 
886
    {
 
887
      return GLib.Path.get_basename (name);
 
888
    }
 
889
 
882
890
    private void add_pkg_search_result (Unity.Package.SearchResult results,
883
891
                                        Set<string> installed_uris,
884
892
                                        Set<string> available_uris,
918
926
          case Category.APPLICATIONS:
919
927
            installed_uris.add (uri);
920
928
            display_name = app.get_display_name ();
921
 
            comment = app.get_description ();
 
929
            comment = sanitize_binary_name (app.get_executable ());
922
930
            break;
923
931
          case Category.AVAILABLE:
924
932
            available_uris.add (uri);
1433
1441
 
1434
1442
        results.append (app_uri, app.get_icon().to_string(), category_id,
1435
1443
                        "application/x-desktop", app.get_display_name (),
1436
 
                        app.get_description (), full_uri);
 
1444
                        sanitize_binary_name (app.get_executable ()), full_uri);
1437
1445
      }
1438
1446
    }
1439
1447