예제 #1
0
gboolean
soup_connection_start_ssl_finish (SoupConnection  *conn,
				  GAsyncResult    *result,
				  GError         **error)
{
	return g_task_propagate_boolean (G_TASK (result), error);
}
예제 #2
0
gboolean ovirt_foreign_menu_set_current_iso_name_finish(OvirtForeignMenu *foreign_menu,
                                                        GAsyncResult *result,
                                                        GError **error)
{
    g_return_val_if_fail(OVIRT_IS_FOREIGN_MENU(foreign_menu), FALSE);
    return g_task_propagate_boolean(G_TASK(result), error);
}
예제 #3
0
gboolean
um_realm_login_finish (UmRealmObject *realm,
                       GAsyncResult *result,
                       GBytes **credentials,
                       GError **error)
{
        GTask *task;
        LoginClosure *login;

        g_return_val_if_fail (g_task_is_valid (result, realm), FALSE);
        g_return_val_if_fail (error == NULL || *error == NULL, FALSE);

        task = G_TASK (result);
        if (!g_task_propagate_boolean (task, error))
                return FALSE;

        login = g_task_get_task_data (task);
        if (credentials) {
                if (login->credentials)
                        *credentials = g_bytes_ref (login->credentials);
                else
                        *credentials = NULL;
        }

        return TRUE;
}
예제 #4
0
static void
ide_async_helper_cb (GObject      *object,
                     GAsyncResult *result,
                     gpointer      user_data)
{
  g_autoptr(GTask) task = user_data;
  GPtrArray *funcs;
  GError *error = NULL;

  g_return_if_fail (G_IS_TASK (task));
  g_return_if_fail (G_IS_TASK (result));

  funcs = g_task_get_task_data (task);

  if (!g_task_propagate_boolean (G_TASK (result), &error))
    {
      g_task_return_error (task, error);
      return;
    }

  g_ptr_array_remove_index (funcs, 0);

  if (funcs->len)
    {
      IdeAsyncStep step;

      step = g_ptr_array_index (funcs, 0);
      step (g_task_get_source_object (task),
            g_task_get_cancellable (task),
            ide_async_helper_cb,
            g_object_ref (task));
    }
  else
    g_task_return_boolean (task, TRUE);
}
예제 #5
0
static gboolean
gclue_client_info_init_finish (GAsyncInitable *initable,
                               GAsyncResult   *result,
                               GError        **error)
{
        return g_task_propagate_boolean (G_TASK (result), error);
}
예제 #6
0
static gboolean
ide_device_provider_real_load_finish (IdeDeviceProvider  *self,
                                      GAsyncResult       *result,
                                      GError            **error)
{
  return g_task_propagate_boolean (G_TASK (result), error);
}
static gboolean
register_driver_finish (GsdSmartcardManager  *self,
                        GAsyncResult         *result,
                        GError              **error)
{
        return g_task_propagate_boolean (G_TASK (result), error);
}
/**
 * tracker_miner_manager_index_file_finish:
 * @manager: a #TrackerMinerManager
 * @result: a #GAsyncResult
 * @error: (out callee-allocates) (transfer full) (allow-none): return location for errors
 *
 * Finishes a request to index a file. See tracker_miner_manager_index_file_async()
 *
 * On failure @error will be set.
 *
 * Returns: %TRUE on success, otherwise %FALSE.
 *
 * Since: 0.16
 **/
gboolean
tracker_miner_manager_index_file_finish (TrackerMinerManager *manager,
                                         GAsyncResult        *result,
                                         GError             **error)
{
	return g_task_propagate_boolean (G_TASK (result), error);
}
예제 #9
0
/**
 * json_parser_load_from_stream_finish:
 * @parser: a #JsonParser
 * @result: a #GAsyncResult
 * @error: the return location for a #GError or %NULL
 *
 * Finishes an asynchronous stream loading started with
 * json_parser_load_from_stream_async().
 *
 * Return value: %TRUE if the content of the stream was successfully retrieves
 *   and parsed, and %FALSE otherwise. In case of error, the #GError will be
 *   filled accordingly.
 *
 * Since: 0.12
 */
gboolean
json_parser_load_from_stream_finish (JsonParser    *parser,
                                     GAsyncResult  *result,
                                     GError       **error)
{
  gboolean res;

  g_return_val_if_fail (JSON_IS_PARSER (parser), FALSE);
  g_return_val_if_fail (g_task_is_valid (result, parser), FALSE);

  res = g_task_propagate_boolean (G_TASK (result), error);
  if (res)
    {
      LoadData *data = g_task_get_task_data (G_TASK (result));
      GError *internal_error = NULL;

      /* We need to do this inside the finis() function because JsonParser will emit
       * signals, and we need to ensure that the signals are emitted in the right
       * context; it's easier to do that if we just rely on the async callback being
       * called in the right context, even if it means making the finish() function
       * necessary to complete the async operation.
       */
      res = json_parser_load (parser, (const gchar *) data->content->data, data->pos, &internal_error);
      if (internal_error != NULL)
        g_propagate_error (error, internal_error);
    }

  return res;
}
예제 #10
0
static gboolean
enable_pin_finish (MMBaseSim *self,
                   GAsyncResult *res,
                   GError **error)
{
    return g_task_propagate_boolean (G_TASK (res), error);
}
예제 #11
0
/**
 * ide_compile_commands_load:
 * @self: An #IdeCompileCommands
 * @file: a #GFile
 * @cancellable: (nullable): a #GCancellable, or %NULL
 * @error: A location for a #GError, or %NULL
 *
 * Synchronously loads the contents of the requested @file and parses
 * the JSON command database contained within.
 *
 * You may only call this function once on an #IdeCompileCommands object.
 * If there is a failure, you must create a new #IdeCompileCommands instance
 * instead of calling this function again.
 *
 * See also: ide_compile_commands_load_async()
 *
 * Returns: %TRUE if successful; otherwise %FALSE and @error is set.
 *
 * Since: 3.28
 */
gboolean
ide_compile_commands_load (IdeCompileCommands  *self,
                           GFile               *file,
                           GCancellable        *cancellable,
                           GError             **error)
{
  g_autoptr(GTask) task = NULL;
  gboolean ret;

  IDE_ENTRY;

  g_return_val_if_fail (IDE_IS_COMPILE_COMMANDS (self), FALSE);
  g_return_val_if_fail (self->has_loaded == FALSE, FALSE);
  g_return_val_if_fail (G_IS_FILE (file), FALSE);
  g_return_val_if_fail (!cancellable || G_IS_CANCELLABLE (cancellable), FALSE);

  self->has_loaded = TRUE;

  task = g_task_new (self, cancellable, NULL, NULL);
  g_task_set_priority (task, G_PRIORITY_LOW);
  g_task_set_source_tag (task, ide_compile_commands_load);
  g_task_set_task_data (task, g_object_ref (file), g_object_unref);
  g_task_run_in_thread_sync (task, ide_compile_commands_load_worker);

  ret = g_task_propagate_boolean (task, error);

  IDE_RETURN (ret);
}
static gboolean
watch_smartcards_async_finish (GsdSmartcardManager  *self,
                               GAsyncResult         *result,
                               GError              **error)
{
        return g_task_propagate_boolean (G_TASK (result), error);
}
예제 #13
0
gboolean
gdav_options_finish (SoupSession *session,
                     GAsyncResult *result,
                     GDavAllow *out_allow,
                     GDavOptions *out_options,
                     SoupMessage **out_message,
                     GError **error)
{
	AsyncContext *async_context;

	g_return_val_if_fail (
		g_task_is_valid (result, session), FALSE);
	g_return_val_if_fail (
		g_async_result_is_tagged (result, gdav_options), FALSE);

	async_context = g_task_get_task_data (G_TASK (result));

	if (!g_task_had_error (G_TASK (result))) {
		if (out_allow != NULL)
			*out_allow = async_context->allow;
		if (out_options != NULL)
			*out_options = async_context->options;
	}

	/* SoupMessage is set even in case of error for uses
	 * like calling soup_message_get_https_status() when
	 * SSL/TLS negotiation fails, though SoupMessage may
	 * be NULL if the Request-URI was invalid. */
	if (out_message != NULL) {
		*out_message = async_context->message;
		async_context->message = NULL;
	}

	return g_task_propagate_boolean (G_TASK (result), error);
}
예제 #14
0
/**
 * e_trust_prompt_run_for_source_finish:
 * @source: an #ESource which was used with e_trust_prompt_run_for_source()
 * @result: a #GAsyncResult
 * @response: an output argument, user's response to the trust prompt
 * @error: return location for a #GError, or %NULL
 *
 * Finishes the operation started with e_trust_prompt_run_for_source().
 * The @response will contain a code of the user's choice.
 * The #E_TRUST_PROMPT_RESPONSE_UNKNOWN is used, when the user cancelled the trust
 * prompt dialog and no changes are made with the @source.
 *
 * If an error occurs, the function sets @error and returns %FALSE.
 *
 * Returns: %TRUE on success, %FALSE on error
 *
 * Since: 3.16
 **/
gboolean
e_trust_prompt_run_for_source_finish (ESource *source,
				      GAsyncResult *result,
				      ETrustPromptResponse *response,
				      GError **error)
{
	gboolean success;

	g_return_val_if_fail (E_IS_SOURCE (source), FALSE);
	g_return_val_if_fail (g_task_is_valid (result, source), FALSE);
	g_return_val_if_fail (response != NULL, FALSE);

	g_return_val_if_fail (
		g_async_result_is_tagged (
		result, e_trust_prompt_run_for_source), FALSE);

	success = g_task_propagate_boolean (G_TASK (result), error);

	if (success) {
		SaveSourceData *save_data;

		save_data = g_task_get_task_data (G_TASK (result));
		g_return_val_if_fail (save_data != NULL, FALSE);

		*response = save_data->response;
	}

	return success;
}
예제 #15
0
static gboolean
ide_context_addin_real_load_project_finish (IdeContextAddin  *addin,
                                            GAsyncResult     *result,
                                            GError          **error)
{
  return g_task_propagate_boolean (G_TASK (result), error);
}
예제 #16
0
/**
 * ostree_sysroot_lock_finish:
 * @self: Self
 * @result: Result
 * @error: Error
 * 
 * Call when ostree_sysroot_lock_async() is ready.
 */
gboolean
ostree_sysroot_lock_finish (OstreeSysroot         *self,
                            GAsyncResult          *result,
                            GError               **error)
{
  g_return_val_if_fail (g_task_is_valid (result, self), FALSE);
  return g_task_propagate_boolean ((GTask*)result, error);
}
예제 #17
0
static gboolean
ide_application_task_completion (GAsyncResult  *result,
                                 GError       **error)
{
  g_assert (G_IS_TASK (result));

  return g_task_propagate_boolean (G_TASK (result), error);
}
예제 #18
0
/**
 * cd_profile_install_system_wide_finish:
 * @profile: a #CdProfile instance.
 * @res: the #GAsyncResult
 * @error: A #GError or %NULL
 *
 * Gets the result from the asynchronous function.
 *
 * Return value: success
 *
 * Since: 0.1.8
 **/
gboolean
cd_profile_install_system_wide_finish (CdProfile *profile,
				       GAsyncResult *res,
				       GError **error)
{
	g_return_val_if_fail (g_task_is_valid (res, profile), FALSE);
	return g_task_propagate_boolean (G_TASK (res), error);
}
예제 #19
0
gboolean
pp_cups_cancel_subscription_finish (PpCups       *cups,
                                    GAsyncResult *result)
{
  g_return_val_if_fail (g_task_is_valid (result, cups), FALSE);

  return g_task_propagate_boolean (G_TASK (result), NULL);
}
예제 #20
0
static void
cleaner_task_ready_handler (GObject *source_object,
			GAsyncResult *res, gpointer user_data)
{
    g_debug ("%s:%d[%s]", __FILE__, __LINE__, __FUNCTION__);

	g_return_val_if_fail (g_task_is_valid (res, source_object), NULL);
	g_task_propagate_boolean (G_TASK (res), NULL);
}
예제 #21
0
static gboolean
g_tls_connection_base_handshake_finish (GTlsConnection       *conn,
					GAsyncResult         *result,
					GError              **error)
{
  g_return_val_if_fail (g_task_is_valid (result, conn), FALSE);

  return g_task_propagate_boolean (G_TASK (result), error);
}
예제 #22
0
gboolean
cb_media_downloader_load_finish (CbMediaDownloader  *downloader,
                                 GAsyncResult       *result,
                                 GError            **error)
{
  g_return_val_if_fail (g_task_is_valid (result, downloader), FALSE);

  return g_task_propagate_boolean (G_TASK (result), error);
}
예제 #23
0
static gboolean
gdav_request_send_finish (SoupRequestHTTP *request,
                          GAsyncResult *result,
                          GError **error)
{
	g_return_val_if_fail (g_task_is_valid (result, request), FALSE);

	return g_task_propagate_boolean (G_TASK (result), error);
}
예제 #24
0
gboolean
ide_application_open_finish (IdeApplication  *self,
                             GAsyncResult    *result,
                             GError         **error)
{
  g_return_val_if_fail (IDE_IS_APPLICATION (self), FALSE);

  return g_task_propagate_boolean (G_TASK (result), error);
}
gboolean
pp_maintenance_command_is_supported_finish (PpMaintenanceCommand  *command,
                                            GAsyncResult          *result,
                                            GError               **error)
{
  g_return_val_if_fail (g_task_is_valid (result, command), FALSE);

  return g_task_propagate_boolean (G_TASK (result), error);
}
예제 #26
0
static gboolean
g_tls_connection_base_close_finish (GIOStream           *stream,
				    GAsyncResult        *result,
				    GError             **error)
{
  g_return_val_if_fail (g_task_is_valid (result, stream), FALSE);

  return g_task_propagate_boolean (G_TASK (result), error);
}
예제 #27
0
static gboolean
g_unix_input_stream_close_finish (GInputStream  *stream,
				  GAsyncResult  *result,
				  GError       **error)
{
  g_return_val_if_fail (g_task_is_valid (result, stream), FALSE);

  return g_task_propagate_boolean (G_TASK (result), error);
}
예제 #28
0
파일: cache.c 프로젝트: GNOME/libmediaart
/**
 * media_art_remove_finish:
 * @source_object: (allow-none): the #GObject this task belongs to,
 * can be %NULL.
 * @result: a #GAsyncResult.
 * @error: a #GError location to store the error occurring, or %NULL
 * to ignore.
 *
 * Finishes the asynchronous operation started with
 * media_art_remove_async().
 *
 * Returns: %TRUE on success, otherwise %FALSE when @error will be set.
 *
 * Since: 0.7.0
 **/
gboolean
media_art_remove_finish (GObject       *source_object,
                         GAsyncResult  *result,
                         GError       **error)
{
	g_return_val_if_fail (g_task_is_valid (result, source_object), FALSE);

	return g_task_propagate_boolean (G_TASK (result), error);
}
예제 #29
0
static gboolean
ide_git_vcs_initializer_initialize_finish (IdeVcsInitializer  *initializer,
                                           GAsyncResult       *result,
                                           GError            **error)
{
  g_return_val_if_fail (IDE_IS_GIT_VCS_INITIALIZER (initializer), FALSE);
  g_return_val_if_fail (G_IS_TASK (result), FALSE);

  return g_task_propagate_boolean (G_TASK (result), error);
}
예제 #30
0
static gboolean
dummy_finish (IdeRunnerAddin  *self,
              GAsyncResult    *result,
              GError         **error)
{
  g_assert (IDE_IS_RUNNER_ADDIN (self));
  g_assert (G_IS_TASK (result));

  return g_task_propagate_boolean (G_TASK (result), error);
}