当前位置: 首页>>代码示例>>C++>>正文


C++ G_IS_SIMPLE_ASYNC_RESULT函数代码示例

本文整理汇总了C++中G_IS_SIMPLE_ASYNC_RESULT函数的典型用法代码示例。如果您正苦于以下问题:C++ G_IS_SIMPLE_ASYNC_RESULT函数的具体用法?C++ G_IS_SIMPLE_ASYNC_RESULT怎么用?C++ G_IS_SIMPLE_ASYNC_RESULT使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了G_IS_SIMPLE_ASYNC_RESULT函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: catch_resource_group_fetch_cb

static void
catch_resource_group_fetch_cb (GObject      *object,
                               GAsyncResult *result,
                               gpointer      user_data)
{
   CatchResourceGroupPrivate *priv;
   CatchResourceGroup *group;
   GSimpleAsyncResult *simple = user_data;
   gboolean ret = FALSE;
   GError *error = NULL;

   ENTRY;

   g_return_if_fail(G_IS_SIMPLE_ASYNC_RESULT(simple));
   group = CATCH_RESOURCE_GROUP(g_async_result_get_source_object(user_data));
   g_return_if_fail(CATCH_IS_RESOURCE_GROUP(group));

   priv = group->priv;

   if (priv->group) {
      ret = gom_resource_group_fetch_finish(GOM_RESOURCE_GROUP(object), result, &error);
   } else {
      g_assert_not_reached();
   }

   if (!ret) {
      g_simple_async_result_take_error(simple, error);
   }

   g_simple_async_result_set_op_res_gboolean(simple, ret);
   g_simple_async_result_complete_in_idle(simple);
   g_object_unref(simple);

   EXIT;
}
开发者ID:chergert,项目名称:catch-glib,代码行数:35,代码来源:catch-resource-group.c

示例2: news_parser_parse_finish

/**
 * news_parser_parse_finish:
 * @parser: (in): A #NewsParser.
 *
 * Completes an asynchronous request to parse a #NewsFeed from a
 * #GInputStream. If the feed was successfully parsed, then a
 * #NewsFeed will be returned; othrewise %NULL and @error is set.
 *
 * Returns: None.
 */
NewsFeed *
news_parser_parse_finish (NewsParser    *parser,
                          GAsyncResult  *result,
                          GError       **error)
{
   NewsParserPrivate *priv;
   NewsFeed *feed = NULL;

   ENTRY;

   g_return_val_if_fail(NEWS_IS_PARSER(parser), NULL);
   g_return_val_if_fail(G_IS_SIMPLE_ASYNC_RESULT(result), NULL);

   priv = parser->priv;

   if (!priv->feed) {
      g_simple_async_result_propagate_error(priv->simple, error);
   } else {
      feed = g_object_ref(priv->feed);
   }

   g_clear_object(&priv->simple);

   RETURN(feed);
}
开发者ID:chergert,项目名称:simply-news,代码行数:35,代码来源:news-parser.c

示例3: mongo_cursor_foreach_query_cb

static void
mongo_cursor_foreach_query_cb (GObject      *object,
                               GAsyncResult *result,
                               gpointer      user_data)
{
   GSimpleAsyncResult *simple = user_data;
   MongoConnection *connection = (MongoConnection *)object;
   MongoMessageReply *reply;
   GError *error = NULL;

   ENTRY;

   g_assert(MONGO_IS_CONNECTION(connection));
   g_assert(G_IS_SIMPLE_ASYNC_RESULT(simple));

   if (!(reply = mongo_connection_query_finish(connection, result, &error))) {
      g_simple_async_result_take_error(simple, error);
      mongo_simple_async_result_complete_in_idle(simple);
      g_object_unref(simple);
      EXIT;
   }

   mongo_cursor_foreach_dispatch(connection, reply, simple);
   g_object_unref(reply);

   EXIT;
}
开发者ID:Acidburn0zzz,项目名称:mongo-glib,代码行数:27,代码来源:mongo-cursor.c

示例4: empathy_pixbuf_avatar_from_individual_scaled_finish

/* Return a ref on the GdkPixbuf */
GdkPixbuf *
empathy_pixbuf_avatar_from_individual_scaled_finish (
    FolksIndividual *individual,
    GAsyncResult *result,
    GError **error)
{
  GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (result);
  gboolean result_valid;
  GdkPixbuf *pixbuf;

  g_return_val_if_fail (FOLKS_IS_INDIVIDUAL (individual), NULL);
  g_return_val_if_fail (G_IS_SIMPLE_ASYNC_RESULT (simple), NULL);

  if (g_simple_async_result_propagate_error (simple, error))
    return NULL;

  result_valid = g_simple_async_result_is_valid (result,
      G_OBJECT (individual),
      empathy_pixbuf_avatar_from_individual_scaled_async);

  g_return_val_if_fail (result_valid, NULL);

  pixbuf = g_simple_async_result_get_op_res_gpointer (simple);
  return pixbuf != NULL ? g_object_ref (pixbuf) : NULL;
}
开发者ID:Dhinihan,项目名称:empathy,代码行数:26,代码来源:empathy-ui-utils.c

示例5: gom_repository_find_one_fetch_cb

static void
gom_repository_find_one_fetch_cb (GObject      *object,
                                  GAsyncResult *result,
                                  gpointer      user_data)
{
   GSimpleAsyncResult *simple = user_data;
   GomResourceGroup *group = (GomResourceGroup *)object;
   GomResource *resource;
   GError *error = NULL;

   g_return_if_fail(GOM_IS_RESOURCE_GROUP(group));
   g_return_if_fail(G_IS_SIMPLE_ASYNC_RESULT(simple));

   if (!gom_resource_group_fetch_finish(group, result, &error)) {
      g_simple_async_result_take_error(simple, error);
      g_simple_async_result_complete_in_idle(simple);
      g_object_unref(simple);
      return;
   }

   resource = gom_resource_group_get_index(group, 0);
   g_simple_async_result_set_op_res_gpointer(simple,
                                             g_object_ref(resource),
                                             g_object_unref);
   g_simple_async_result_complete_in_idle(simple);
   g_object_unref(simple);
}
开发者ID:zyh329,项目名称:ipcam_thirdparties,代码行数:27,代码来源:gom-repository.c

示例6: gom_resource_save_cb

static void
gom_resource_save_cb (GomAdapter *adapter,
                      gpointer    user_data)
{
   GSimpleAsyncResult *simple = user_data;
   GomResource *resource;
   gboolean ret;
   GError *error = NULL;
   GAsyncQueue *queue;

   g_return_if_fail(GOM_IS_ADAPTER(adapter));
   g_return_if_fail(G_IS_SIMPLE_ASYNC_RESULT(simple));

   resource = GOM_RESOURCE(g_async_result_get_source_object(G_ASYNC_RESULT(simple)));
   g_assert(GOM_IS_RESOURCE(resource));

   queue = g_object_get_data(G_OBJECT(simple), "queue");

   if (!(ret = gom_resource_do_save(resource, adapter, &error))) {
      g_simple_async_result_take_error(simple, error);
   }

   g_simple_async_result_set_op_res_gboolean(simple, ret);
   if (!queue)
      g_simple_async_result_complete_in_idle(simple);
   else
      g_async_queue_push(queue, GINT_TO_POINTER(TRUE));
   g_object_unref(resource);
}
开发者ID:chergert,项目名称:gom,代码行数:29,代码来源:gom-resource.c

示例7: news_sync_task_save_cb

static void
news_sync_task_save_cb (GObject      *object,
                        GAsyncResult *result,
                        gpointer      user_data)
{
   NewsSyncTaskPrivate *priv;
   GSimpleAsyncResult *simple = user_data;
   NewsSyncTask *task;
   GomResource *resource = (GomResource *)object;
   GError *error = NULL;

   g_assert(NEWS_IS_FEED(resource));
   g_assert(G_IS_SIMPLE_ASYNC_RESULT(simple));
   task = (NewsSyncTask *)g_async_result_get_source_object(G_ASYNC_RESULT(simple));
   g_assert(NEWS_IS_SYNC_TASK(task));

   priv = task->priv;

   if (!gom_resource_save_finish(resource, result, &error)) {
      g_simple_async_result_take_error(simple, error);
      gom_adapter_sqlite_rollback(GOM_ADAPTER_SQLITE(priv->adapter));
   } else if (!gom_adapter_sqlite_commit(GOM_ADAPTER_SQLITE(priv->adapter),
                                         &error)) {
      g_simple_async_result_take_error(simple, error);
      gom_adapter_sqlite_rollback(GOM_ADAPTER_SQLITE(priv->adapter));
   }

   g_simple_async_result_complete_in_idle(simple);
   g_object_unref(simple);
}
开发者ID:chergert,项目名称:simply-news,代码行数:30,代码来源:news-sync-task.c

示例8: gom_repository_find_one_cb

static void
gom_repository_find_one_cb (GObject      *object,
                            GAsyncResult *result,
                            gpointer      user_data)
{
   GSimpleAsyncResult *simple = user_data;
   GomResourceGroup *group;
   GomRepository *repository = (GomRepository *)object;
   GError *error = NULL;

   g_return_if_fail(GOM_IS_REPOSITORY(repository));
   g_return_if_fail(G_IS_SIMPLE_ASYNC_RESULT(simple));

   if (!(group = gom_repository_find_finish(repository, result, &error))) {
      g_simple_async_result_take_error(simple, error);
      g_simple_async_result_complete_in_idle(simple);
      g_object_unref(simple);
      return;
   }

   if (!gom_resource_group_get_count(group)) {
      g_simple_async_result_set_error(simple, GOM_ERROR,
                                      GOM_ERROR_REPOSITORY_EMPTY_RESULT,
                                      _("No resources were found."));
      g_simple_async_result_complete_in_idle(simple);
      g_object_unref(simple);
      g_object_unref(group);
      return;
   }

   gom_resource_group_fetch_async(group, 0, 1,
                                  gom_repository_find_one_fetch_cb,
                                  simple);
   g_object_unref(group);
}
开发者ID:zyh329,项目名称:ipcam_thirdparties,代码行数:35,代码来源:gom-repository.c

示例9: catch_space_get_objects_cb

static void
catch_space_get_objects_cb (GObject      *object,
                             GAsyncResult *result,
                             gpointer      user_data)
{
   GomResource *resource = (GomResource *)object;
   GSimpleAsyncResult *simple = user_data;
   GomResourceGroup *group;
   GError *error = NULL;

   ENTRY;

   g_return_if_fail(GOM_IS_RESOURCE(resource));
   g_return_if_fail(G_IS_SIMPLE_ASYNC_RESULT(simple));

   if (!(group = gom_resource_fetch_m2m_finish(resource, result, &error))) {
      g_simple_async_result_take_error(simple, error);
   } else {
      g_simple_async_result_set_op_res_gpointer(simple, group, g_object_unref);
   }

   g_simple_async_result_complete_in_idle(simple);
   g_object_unref(simple);

   EXIT;
}
开发者ID:chergert,项目名称:catch-glib,代码行数:26,代码来源:catch-space.c

示例10: _client_create_tube_finish

GSocketConnection  *
_client_create_tube_finish (GAsyncResult *result,
    TpChannel **channel,
    GError **error)
{
  GSimpleAsyncResult *simple;
  CreateTubeData *data;

  g_return_val_if_fail (G_IS_SIMPLE_ASYNC_RESULT (result), NULL);

  simple = G_SIMPLE_ASYNC_RESULT (result);

  if (g_simple_async_result_propagate_error (simple, error))
    return NULL;

  g_return_val_if_fail (g_simple_async_result_is_valid (result, NULL,
      _client_create_tube_finish), NULL);

  data = g_simple_async_result_get_op_res_gpointer (
      G_SIMPLE_ASYNC_RESULT (result));

  if (channel != NULL)
    *channel = g_object_ref (data->channel);

  return g_object_ref (data->connection);
}
开发者ID:freedesktop-unofficial-mirror,项目名称:telepathy__telepathy-ssh-contact,代码行数:26,代码来源:client-helpers.c

示例11: gom_repository_automatic_migrate_finish

gboolean
gom_repository_automatic_migrate_finish (GomRepository  *repository,
                                         GAsyncResult   *result,
                                         GError        **error)
{
   g_return_val_if_fail(GOM_IS_REPOSITORY(repository), FALSE);
   g_return_val_if_fail(G_IS_SIMPLE_ASYNC_RESULT(result), FALSE);

   g_object_set_data(G_OBJECT(repository), "object-types", NULL);
   return gom_repository_migrate_finish(repository, result, error);
}
开发者ID:zyh329,项目名称:ipcam_thirdparties,代码行数:11,代码来源:gom-repository.c

示例12: soup_input_stream_read_finish

static gssize
soup_input_stream_read_finish (GInputStream  *stream,
			       GAsyncResult  *result,
			       GError       **error)
{
  GSimpleAsyncResult *simple;

  g_return_val_if_fail (G_IS_SIMPLE_ASYNC_RESULT (result), -1);
  simple = G_SIMPLE_ASYNC_RESULT (result);
  g_return_val_if_fail (g_simple_async_result_get_source_tag (simple) == soup_input_stream_read_async, -1);

  return g_simple_async_result_get_op_res_gssize (simple);
}
开发者ID:Andais,项目名称:gvfs,代码行数:13,代码来源:soup-input-stream.c

示例13: pk_package_sack_merge_generic_finish

/**
 * pk_package_sack_merge_generic_finish:
 * @sack: a valid #PkPackageSack instance
 * @res: the #GAsyncResult
 * @error: A #GError or %NULL
 *
 * Gets the result from the asynchronous function.
 *
 * Return value: %TRUE for success
 *
 * Since: 0.5.2
 **/
gboolean
pk_package_sack_merge_generic_finish (PkPackageSack *sack, GAsyncResult *res, GError **error)
{
	GSimpleAsyncResult *simple;

	g_return_val_if_fail (PK_IS_PACKAGE_SACK (sack), FALSE);
	g_return_val_if_fail (G_IS_SIMPLE_ASYNC_RESULT (res), FALSE);
	g_return_val_if_fail (error == NULL || *error == NULL, FALSE);

	simple = G_SIMPLE_ASYNC_RESULT (res);

	if (g_simple_async_result_propagate_error (simple, error))
		return FALSE;

	return g_simple_async_result_get_op_res_gboolean (simple);
}
开发者ID:coolo,项目名称:packagekit,代码行数:28,代码来源:pk-package-sack.c

示例14: news_sync_task_fetch_cb

static void
news_sync_task_fetch_cb (GObject      *object,
                         GAsyncResult *result,
                         gpointer      user_data)
{
   NewsSyncTaskPrivate *priv;
   GSimpleAsyncResult *simple = (GSimpleAsyncResult *)user_data;
   GInputStream *stream;
   NewsSyncTask *task;
   NewsSource *source = (NewsSource *)object;
   NewsParser *parser;
   GError *error = NULL;

   g_assert(NEWS_IS_SOURCE(source));
   g_assert(G_IS_SIMPLE_ASYNC_RESULT(simple));
   task = (NewsSyncTask *)g_async_result_get_source_object(G_ASYNC_RESULT(simple));
   g_assert(NEWS_IS_SYNC_TASK(task));

   priv = task->priv;

   priv->fraction = 0.333;
   g_object_notify_by_pspec(G_OBJECT(task), gParamSpecs[PROP_FRACTION]);

   if (!(stream = news_source_fetch_finish(source, result, &error))) {
      g_simple_async_result_take_error(simple, error);
      g_simple_async_result_complete_in_idle(simple);
      g_object_unref(simple);
      return;
   }

   if (g_cancellable_is_cancelled(priv->cancellable)) {
      g_simple_async_result_set_error(simple, NEWS_SYNC_TASK_ERROR,
                                      NEWS_SYNC_TASK_ERROR_CANCELLED,
                                      _("The task was cancelled."));
      g_simple_async_result_complete_in_idle(simple);
      g_object_unref(simple);
      return;
   }

   parser = g_object_new(NEWS_TYPE_PARSER,
                         "adapter", priv->adapter,
                         "source", priv->source,
                         NULL);
   news_parser_parse_async(parser, stream, priv->cancellable,
                           news_sync_task_parse_cb, simple);
   g_object_unref(parser);
}
开发者ID:chergert,项目名称:simply-news,代码行数:47,代码来源:news-sync-task.c

示例15: gom_resource_fetch_m2m_finish

/**
 * gom_resource_fetch_m2m_finish:
 * @resource: (in): A #GomResource.
 * @result: (in): A #GAsyncResult.
 * @error: (out): A location for a #GError, or %NULL.
 *
 * Completes the asynchronous request to fetch a group of resources that
 * are related to the resource through a many-to-many table.
 *
 * Returns: (transfer full): A #GomResourceGroup.
 */
GomResourceGroup *
gom_resource_fetch_m2m_finish (GomResource   *resource,
                               GAsyncResult  *result,
                               GError       **error)
{
   GSimpleAsyncResult *simple = (GSimpleAsyncResult *)result;
   GomResourceGroup *group;

   g_return_val_if_fail(GOM_IS_RESOURCE(resource), NULL);
   g_return_val_if_fail(G_IS_SIMPLE_ASYNC_RESULT(result), NULL);

   if (!(group = g_simple_async_result_get_op_res_gpointer(simple))) {
      g_simple_async_result_propagate_error(simple, error);
   }

   return group ? g_object_ref(group) : NULL;
}
开发者ID:chergert,项目名称:gom,代码行数:28,代码来源:gom-resource.c


注:本文中的G_IS_SIMPLE_ASYNC_RESULT函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。