Пример #1
0
static gboolean
get_all_func (EntryDirectory   *ed,
              DesktopEntry     *entry,
              const char       *file_id,
              DesktopEntrySet  *set,
              gpointer          user_data)
{
  entry = desktop_entry_ref (entry);

  desktop_entry_set_add_entry (set, entry, file_id);
  desktop_entry_unref (entry);

  return TRUE;
}
static DesktopEntry *
entry_directory_get_directory (EntryDirectory *ed,
                               const char     *relative_path)
{
  DesktopEntry *entry;

  if (ed->entry_type != DESKTOP_ENTRY_DIRECTORY)
    return NULL;

  entry = cached_dir_find_relative_path (ed->dir, relative_path);
  if (entry == NULL || desktop_entry_get_type (entry) != DESKTOP_ENTRY_DIRECTORY)
    return NULL;

  return desktop_entry_ref (entry);
}
Пример #3
0
void
desktop_entry_set_add_entry (DesktopEntrySet *set,
                             DesktopEntry    *entry,
                             const char      *file_id)
{
  menu_verbose (" Adding to set %p entry %s\n", set, file_id);

  if (set->hash == NULL)
    {
      set->hash = g_hash_table_new_full (g_str_hash,
                                         g_str_equal,
                                         g_free,
                                         (GDestroyNotify) desktop_entry_unref);
    }

  g_hash_table_replace (set->hash,
                        g_strdup (file_id),
                        desktop_entry_ref (entry));
}
static gboolean
get_all_func (EntryDirectory   *ed,
              DesktopEntry     *entry,
              const char       *file_id,
              DesktopEntrySet  *set,
              gpointer          user_data)
{
  if (ed->is_legacy && !desktop_entry_has_categories (entry))
    {
      entry = desktop_entry_copy (entry);
      desktop_entry_add_legacy_category (entry);
    }
  else
    {
      entry = desktop_entry_ref (entry);
    }

  desktop_entry_set_add_entry (set, entry, file_id);
  desktop_entry_unref (entry);

  return TRUE;
}