Logo Search packages:      
Sourcecode: libhildonmime version File versions  Download package

GSList* hildon_uri_get_actions ( const gchar *  scheme,
GError **  error 

hildon_uri_action_get_actions: : A const pointer to a scheme. : The address of a pointer to a structure. This is optional and can be NULL.

: Use () instead.

This returns a pointer to all actions associated with the . The can be obtained from a URI by calling hildon_uri_get_scheme_from_uri().

If NULL is returned and is NULL then there is no default for . If NULL is returned and is non-NULL, it will hold the error that occurred while trying to obtain a list of actions.

Return: A of actions associated with the . This list is freed using ().

Definition at line 1505 of file hildon-uri.c.

References hildon_uri_is_default_action().

      GSList *actions = NULL;
      GSList *desktop_files;
      GSList *l;
      gchar  *filename;

      g_return_val_if_fail (scheme != NULL && scheme[0] != '\0', NULL);

      desktop_files = uri_get_desktop_files_by_scheme (scheme);

      for (l = desktop_files; l; l = l->next) {
            GSList *actions_found;

            filename = l->data;

            actions_found = uri_get_desktop_file_actions (filename, scheme);
            if (actions_found) {
                  actions = g_slist_concat (actions, actions_found);

      /* Make sure the default action is the first item in the list */
      DEBUG_MSG (("URI: Making sure default action is the top of the list..."));

      if (actions && !hildon_uri_is_default_action (actions->data, NULL)) {
            HildonURIAction *default_action;

            for (l = actions->next; l; l = l->next) {
                  if (!hildon_uri_is_default_action (l->data, NULL)) {

                  DEBUG_MSG (("URI: Moving default action to the top of the list..."));

                  default_action = l->data;
                  actions = g_slist_remove_link (actions, l);
                  g_slist_free1 (l);
                  actions = g_slist_prepend (actions, default_action);

      g_slist_foreach (desktop_files, (GFunc) g_free, NULL);
      g_slist_free (desktop_files);
      return actions;

Generated by  Doxygen 1.6.0   Back to index