• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ G_IS_SIMPLE_ASYNC_RESULT函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了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函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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


示例16: g_tls_database_real_verify_chain_finish

static GTlsCertificateFlags
g_tls_database_real_verify_chain_finish (GTlsDatabase          *self,
                                         GAsyncResult          *result,
                                         GError               **error)
{
  AsyncVerifyChain *args;

  g_return_val_if_fail (G_IS_SIMPLE_ASYNC_RESULT (result), G_TLS_CERTIFICATE_GENERIC_ERROR);
  g_return_val_if_fail (g_simple_async_result_is_valid (result, G_OBJECT (self),
                        g_tls_database_real_verify_chain_async), FALSE);

  if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (result), error))
    return G_TLS_CERTIFICATE_GENERIC_ERROR;

  args = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (result));
  return args->verify_result;
}
开发者ID:01org,项目名称:android-bluez-glib,代码行数:17,代码来源:gtlsdatabase.c


示例17: gom_repository_find_one_finish

/**
 * gom_repository_find_one_finish:
 * @repository: (in): A #GomRepository.
 * @result: (in): A #GAsyncResult.
 * @error: (out): A location for a #GError, or %NULL.
 *
 * Completes an asynchronous request to find a single resource in the
 * repository. See gom_repository_find_one_async() for more info.
 *
 * Returns: (transfer full): A #GomResource if successful, otherwise %NULL.
 */
GomResource *
gom_repository_find_one_finish (GomRepository  *repository,
                                GAsyncResult   *result,
                                GError        **error)
{
   GSimpleAsyncResult *simple = (GSimpleAsyncResult *)result;
   GomResource *ret;

   g_return_val_if_fail(GOM_IS_REPOSITORY(repository), NULL);
   g_return_val_if_fail(G_IS_SIMPLE_ASYNC_RESULT(simple), NULL);

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

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


示例18: soup_input_stream_send_finish

/**
 * soup_input_stream_send_finish:
 * @stream: a #SoupInputStream
 * @result: a #GAsyncResult.
 * @error: a #GError location to store the error occuring, or %NULL to 
 * ignore.
 *
 * Finishes a soup_input_stream_send_async() operation.
 *
 * Return value: %TRUE if the message was sent successfully and
 * received a successful status code, %FALSE if not.
 **/
gboolean
soup_input_stream_send_finish (GInputStream  *stream,
			       GAsyncResult  *result,
			       GError       **error)
{
  GSimpleAsyncResult *simple;

  g_return_val_if_fail (G_IS_SIMPLE_ASYNC_RESULT (result), FALSE);
  simple = G_SIMPLE_ASYNC_RESULT (result);

  g_return_val_if_fail (g_simple_async_result_get_source_tag (simple) == soup_input_stream_send_async, FALSE);

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

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


示例19: _g_find_file_insensitive_finish

static GFile *
_g_find_file_insensitive_finish (GFile        *parent,
                                 GAsyncResult *result,
                                 GError      **error)
{
  GSimpleAsyncResult *simple;
  GFile *file;

  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;

  file = G_FILE (g_simple_async_result_get_op_res_gpointer (simple));
  return g_object_ref (file);
}
开发者ID:DarkProfit,项目名称:gvfs,代码行数:18,代码来源:gvfsmountinfo.c


示例20: gom_repository_migrate_finish

gboolean
gom_repository_migrate_finish (GomRepository  *repository,
                               GAsyncResult   *result,
                               GError        **error)
{
   GSimpleAsyncResult *simple = (GSimpleAsyncResult *)result;
   gboolean ret;

   g_return_val_if_fail(GOM_IS_REPOSITORY(repository), FALSE);
   g_return_val_if_fail(G_IS_SIMPLE_ASYNC_RESULT(result), FALSE);

   if (!(ret = g_simple_async_result_get_op_res_gboolean(simple))) {
      g_simple_async_result_propagate_error(simple, error);
   }
   g_object_unref(simple);

   return ret;
}
开发者ID:zyh329,项目名称:ipcam_thirdparties,代码行数:18,代码来源:gom-repository.c



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ G_IS_TASK函数代码示例发布时间:2022-05-30
下一篇:
C++ G_IS_OBJECT函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap