/** * as_app_builder_search_kudos: * @app: an #AsApp * @prefix: a prefix to search, e.g. "/usr" * @flags: #AsAppBuilderFlags, e.g. %AS_APP_BUILDER_FLAG_USE_FALLBACKS * @error: a #GError or %NULL * * Searches a prefix for auto-detected kudos. * * Returns: %TRUE for success * * Since: 0.5.8 **/ gboolean as_app_builder_search_kudos (AsApp *app, const gchar *prefix, AsAppBuilderFlags flags, GError **error) { /* gnome-shell search provider */ if (!as_app_has_kudo_kind (app, AS_KUDO_KIND_SEARCH_PROVIDER) && as_app_builder_search_path (app, prefix, "share/gnome-shell/search-providers", flags)) { g_debug ("auto-adding SearchProvider kudo"); as_app_add_kudo_kind (AS_APP (app), AS_KUDO_KIND_SEARCH_PROVIDER); } /* hicolor icon */ if (!as_app_has_kudo_kind (app, AS_KUDO_KIND_HIGH_CONTRAST) && as_app_builder_search_path (app, prefix, "share/icons/hicolor/symbolic/apps", flags)) { g_debug ("auto-adding HighContrast kudo"); as_app_add_kudo_kind (AS_APP (app), AS_KUDO_KIND_HIGH_CONTRAST); } return TRUE; }
/** * asb_plugin_process_app: */ gboolean asb_plugin_process_app (AsbPlugin *plugin, AsbPackage *pkg, AsbApp *app, const gchar *tmpdir, GError **error) { gchar **filelist; guint i; /* already set */ if (as_app_has_kudo_kind (AS_APP (app), AS_KUDO_KIND_NOTIFICATIONS)) return TRUE; /* look for a shell search provider */ filelist = asb_package_get_filelist (pkg); for (i = 0; filelist[i] != NULL; i++) { if (!asb_plugin_match_glob ("/usr/share/kde4/apps/*/*.notifyrc", filelist[i])) continue; asb_package_log (pkg, ASB_PACKAGE_LOG_LEVEL_DEBUG, "Auto-adding kudo Notifications for %s", as_app_get_id (AS_APP (app))); as_app_add_kudo_kind (AS_APP (app), AS_KUDO_KIND_NOTIFICATIONS); break; } return TRUE; }
/** * asb_plugin_process_app: */ gboolean asb_plugin_process_app (AsbPlugin *plugin, AsbPackage *pkg, AsbApp *app, const gchar *tmpdir, GError **error) { gchar **filelist; guint i; filelist = asb_package_get_filelist (pkg); for (i = 0; filelist[i] != NULL; i++) { GError *error_local = NULL; g_autofree gchar *filename = NULL; if (!asb_plugin_match_glob ("/usr/bin/*", filelist[i])) continue; if (as_app_has_kudo_kind (AS_APP (app), AS_KUDO_KIND_APP_MENU)) break; filename = g_build_filename (tmpdir, filelist[i], NULL); if (!asb_plugin_gresource_app (app, filename, &error_local)) { asb_package_log (pkg, ASB_PACKAGE_LOG_LEVEL_WARNING, "Failed to get resources from %s: %s", filename, error_local->message); g_clear_error (&error_local); } } return TRUE; }
/** * asb_plugin_process_app: */ gboolean asb_plugin_process_app (AsbPlugin *plugin, AsbPackage *pkg, AsbApp *app, const gchar *tmpdir, GError **error) { gchar **filelist; guint i; /* already set */ if (as_app_has_kudo_kind (AS_APP (app), AS_KUDO_KIND_SEARCH_PROVIDER)) return TRUE; /* look for a krunner provider */ filelist = asb_package_get_filelist (pkg); for (i = 0; filelist[i] != NULL; i++) { g_autoptr(GError) error_local = NULL; g_autofree gchar *filename = NULL; if (!asb_plugin_match_glob ("/usr/share/kde4/services/*.desktop", filelist[i])) continue; filename = g_build_filename (tmpdir, filelist[i], NULL); if (!asb_plugin_process_filename (filename, app, tmpdir, &error_local)) { asb_package_log (pkg, ASB_PACKAGE_LOG_LEVEL_INFO, "Failed to read KDE service file %s: %s", filelist[i], error_local->message); g_clear_error (&error_local); } } return TRUE; }
/** * asb_plugin_process_app: */ gboolean asb_plugin_process_app (AsbPlugin *plugin, AsbPackage *pkg, AsbApp *app, const gchar *tmpdir, GError **error) { gchar **filelist; guint i; /* already set */ if (as_app_has_kudo_kind (AS_APP (app), AS_KUDO_KIND_MODERN_TOOLKIT)) return TRUE; /* look for any GIR files */ filelist = asb_package_get_filelist (pkg); for (i = 0; filelist[i] != NULL; i++) { if (!_asb_plugin_check_filename (filelist[i])) continue; if (!asb_plugin_process_gir (app, tmpdir, filelist[i], error)) return FALSE; } return TRUE; }