Updated with upstream update
This commit is contained in:
@ -68,7 +68,7 @@ typedef struct
|
||||
/* forward declarations */
|
||||
|
||||
#define HELP_TYPE (help_get_type ())
|
||||
#define HELP (obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), HELP_TYPE, Help))
|
||||
#define HELP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), HELP_TYPE, Help))
|
||||
|
||||
GType help_get_type (void) G_GNUC_CONST;
|
||||
|
||||
@ -77,10 +77,10 @@ static PikaProcedure * help_create_procedure (PikaPlugIn *plug_in,
|
||||
const gchar *name);
|
||||
|
||||
static PikaValueArray * help_run (PikaProcedure *procedure,
|
||||
const PikaValueArray *args,
|
||||
PikaProcedureConfig *config,
|
||||
gpointer run_data);
|
||||
static PikaValueArray * help_temp_run (PikaProcedure *procedure,
|
||||
const PikaValueArray *args,
|
||||
PikaProcedureConfig *config,
|
||||
gpointer run_data);
|
||||
|
||||
static void help_temp_proc_install (PikaPlugIn *plug_in);
|
||||
@ -157,16 +157,23 @@ help_create_procedure (PikaPlugIn *plug_in,
|
||||
|
||||
static PikaValueArray *
|
||||
help_run (PikaProcedure *procedure,
|
||||
const PikaValueArray *args,
|
||||
PikaProcedureConfig *config,
|
||||
gpointer run_data)
|
||||
{
|
||||
PikaPDBStatusType status = PIKA_PDB_SUCCESS;
|
||||
PikaPDBStatusType status = PIKA_PDB_SUCCESS;
|
||||
gchar **domain_names = NULL;
|
||||
gchar **domain_uris = NULL;
|
||||
|
||||
if (! pika_help_init (PIKA_VALUES_GET_STRV (args, 0),
|
||||
PIKA_VALUES_GET_STRV (args, 1)))
|
||||
{
|
||||
status = PIKA_PDB_CALLING_ERROR;
|
||||
}
|
||||
g_object_get (config,
|
||||
"domain-names", &domain_names,
|
||||
"domain-uris", &domain_uris,
|
||||
NULL);
|
||||
if (! pika_help_init ((const gchar **) domain_names,
|
||||
(const gchar **) domain_uris))
|
||||
status = PIKA_PDB_CALLING_ERROR;
|
||||
|
||||
g_strfreev (domain_names);
|
||||
g_strfreev (domain_uris);
|
||||
|
||||
if (status == PIKA_PDB_SUCCESS)
|
||||
{
|
||||
@ -237,26 +244,27 @@ help_temp_proc_install (PikaPlugIn *plug_in)
|
||||
|
||||
static PikaValueArray *
|
||||
help_temp_run (PikaProcedure *procedure,
|
||||
const PikaValueArray *args,
|
||||
PikaProcedureConfig *config,
|
||||
gpointer run_data)
|
||||
{
|
||||
PikaPDBStatusType status = PIKA_PDB_SUCCESS;
|
||||
const gchar *help_proc = NULL;
|
||||
const gchar *help_domain = PIKA_HELP_DEFAULT_DOMAIN;
|
||||
const gchar *help_locales = NULL;
|
||||
const gchar *help_id = PIKA_HELP_DEFAULT_ID;
|
||||
gchar *help_proc = NULL;
|
||||
gchar *help_domain = NULL;
|
||||
gchar *help_locales = NULL;
|
||||
gchar *help_id = NULL;
|
||||
|
||||
if (PIKA_VALUES_GET_STRING (args, 0))
|
||||
help_proc = PIKA_VALUES_GET_STRING (args, 0);
|
||||
g_object_get (config,
|
||||
"help-proc", &help_proc,
|
||||
"help-domain", &help_domain,
|
||||
"help-locales", &help_locales,
|
||||
"help-id", &help_id,
|
||||
NULL);
|
||||
|
||||
if (PIKA_VALUES_GET_STRING (args, 1))
|
||||
help_domain = PIKA_VALUES_GET_STRING (args, 1);
|
||||
if (help_domain == NULL)
|
||||
help_domain = g_strdup (PIKA_HELP_DEFAULT_DOMAIN);
|
||||
|
||||
if (PIKA_VALUES_GET_STRING (args, 2))
|
||||
help_locales = PIKA_VALUES_GET_STRING (args, 2);
|
||||
|
||||
if (PIKA_VALUES_GET_STRING (args, 3))
|
||||
help_id = PIKA_VALUES_GET_STRING (args, 3);
|
||||
if (help_id == NULL)
|
||||
help_id = g_strdup (PIKA_HELP_DEFAULT_ID);
|
||||
|
||||
if (! help_proc)
|
||||
status = PIKA_PDB_CALLING_ERROR;
|
||||
@ -264,6 +272,11 @@ help_temp_run (PikaProcedure *procedure,
|
||||
if (status == PIKA_PDB_SUCCESS)
|
||||
help_load (help_proc, help_domain, help_locales, help_id);
|
||||
|
||||
g_free (help_proc);
|
||||
g_free (help_domain);
|
||||
g_free (help_locales);
|
||||
g_free (help_id);
|
||||
|
||||
return pika_procedure_new_return_values (procedure, status, NULL);
|
||||
}
|
||||
|
||||
@ -313,6 +326,7 @@ help_load_idle (gpointer data)
|
||||
|
||||
if (uri)
|
||||
{
|
||||
PikaProcedure *procedure;
|
||||
PikaValueArray *return_vals;
|
||||
|
||||
#ifdef PIKA_HELP_DEBUG
|
||||
@ -320,10 +334,9 @@ help_load_idle (gpointer data)
|
||||
idle_help->procedure, uri);
|
||||
#endif
|
||||
|
||||
return_vals = pika_pdb_run_procedure (pika_get_pdb (),
|
||||
idle_help->procedure,
|
||||
G_TYPE_STRING, uri,
|
||||
G_TYPE_NONE);
|
||||
procedure = pika_pdb_lookup_procedure (pika_get_pdb (),
|
||||
idle_help->procedure);
|
||||
return_vals = pika_procedure_run (procedure, "domain-names", uri, NULL);
|
||||
pika_value_array_unref (return_vals);
|
||||
|
||||
g_free (uri);
|
||||
|
Reference in New Issue
Block a user