func getPossibleOpenProgramming(uris []string) []*gio.AppInfo { openProgrammings := make([][]*gio.AppInfo, len(uris)) for i, uri := range uris { job := operations.NewGetRecommendedLaunchAppsJob(uri) job.Execute() if job.HasError() { break } openProgrammings[i] = job.Result().([]*gio.AppInfo) } intersection := openProgrammings[0] for i, l := 1, len(openProgrammings); len(intersection) > 0 && i < l; i++ { intersection = getIntersection(intersection, openProgrammings[i]) } possibleOpenProgrammings := make([]*gio.AppInfo, len(intersection)) for i, app := range intersection { possibleOpenProgrammings[i] = app.Dup() } // destroy all apps. for _, apps := range openProgrammings { for _, app := range apps { app.Unref() } } sort.Sort(byDisplayName(possibleOpenProgrammings)) return possibleOpenProgrammings }
func NewGetRecommendedLaunchAppsJob(uri string) *GetRecommendedLaunchAppsJob { return &GetRecommendedLaunchAppsJob{ dbusInfo: genDBusInfo("GetRecommendedLaunchAppsJob", &_GetRecommendedLaunchAppJobCount), op: operations.NewGetRecommendedLaunchAppsJob(uri), } }