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

C++ G_IS_TASK函数代码示例

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

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



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

示例1: ide_async_helper_cb

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);
}
开发者ID:Dagal,项目名称:gnome-builder,代码行数:35,代码来源:ide-async-helper.c


示例2: egg_task_cache_get_finish

/**
 * egg_task_cache_get_finish:
 *
 * Finish a call to egg_task_cache_get_async().
 *
 * Returns: (transfer full): The result from the cache.
 */
gpointer
egg_task_cache_get_finish (EggTaskCache  *self,
                           GAsyncResult  *result,
                           GError       **error)
{
  GTask *task = (GTask *)result;

  g_return_val_if_fail (EGG_IS_TASK_CACHE (self), NULL);
  g_return_val_if_fail (G_IS_TASK (result), NULL);
  g_return_val_if_fail (G_IS_TASK (task), NULL);

  return g_task_propagate_pointer (task, error);
}
开发者ID:MaX121,项目名称:gnome-builder,代码行数:20,代码来源:egg-task-cache.c


示例3: ide_autotools_build_system_get_build_targets_cb

static void
ide_autotools_build_system_get_build_targets_cb (GObject      *object,
                                                 GAsyncResult *result,
                                                 gpointer      user_data)
{
  IdeAutotoolsBuildSystem *self = (IdeAutotoolsBuildSystem *)object;
  g_autoptr(IdeMakecache) makecache = NULL;
  g_autoptr(GTask) task = user_data;
  GError *error = NULL;

  g_assert (IDE_IS_AUTOTOOLS_BUILD_SYSTEM (self));
  g_assert (G_IS_TASK (task));

  makecache = ide_autotools_build_system_get_makecache_finish (self, result, &error);

  if (makecache == NULL)
    {
      g_task_return_error (task, error);
      return;
    }

  ide_makecache_get_build_targets_async (makecache,
                                         g_task_get_cancellable (task),
                                         ide_autotools_build_system_get_build_targets_cb2,
                                         g_object_ref (task));
}
开发者ID:badwolfie,项目名称:gnome-builder,代码行数:26,代码来源:ide-autotools-build-system.c


示例4: finish_animation_in_idle

static gboolean
finish_animation_in_idle (gpointer data)
{
  g_autoptr(GTask) task = data;
  IdeGitCloneWidget *self;

  IDE_ENTRY;

  g_assert (G_IS_TASK (task));
  self = g_task_get_source_object (task);
  g_assert (IDE_IS_GIT_CLONE_WIDGET (self));

  egg_object_animate_full (self->clone_progress,
                           EGG_ANIMATION_EASE_IN_OUT_QUAD,
                           ANIMATION_DURATION_MSEC,
                           NULL,
                           (GDestroyNotify)ide_widget_hide_with_fade,
                           self->clone_progress,
                           "fraction", 1.0,
                           NULL);

  /*
   * Wait for a second so animations can complete before opening
   * the project. Otherwise, it's pretty jarring to the user.
   */
  g_timeout_add (ANIMATION_DURATION_MSEC, open_after_timeout, g_object_ref (task));

  IDE_RETURN (G_SOURCE_REMOVE);
}
开发者ID:zlongshen,项目名称:gnome-builder,代码行数:29,代码来源:ide-git-clone-widget.c


示例5: populate_cache__get_local_makefile_cb

static void
populate_cache__get_local_makefile_cb (GObject      *object,
                                       GAsyncResult *result,
                                       gpointer      user_data)
{
  IdeAutotoolsBuildSystem *self = (IdeAutotoolsBuildSystem *)object;
  g_autoptr(GTask) task = user_data;
  g_autoptr(GFile) makefile = NULL;
  IdeContext *context;
  GError *error = NULL;

  IDE_ENTRY;

  g_assert (IDE_IS_AUTOTOOLS_BUILD_SYSTEM (self));
  g_assert (G_IS_TASK (task));

  makefile = ide_autotools_build_system_get_local_makefile_finish (self, result, &error);

  if (makefile == NULL)
    {
      g_task_return_error (task, error);
      IDE_EXIT;
    }

  context = ide_object_get_context (IDE_OBJECT (self));
  ide_makecache_new_for_makefile_async (context,
                                        makefile,
                                        g_task_get_cancellable (task),
                                        populate_cache__new_makecache_cb,
                                        g_object_ref (task));

  IDE_EXIT;
}
开发者ID:badwolfie,项目名称:gnome-builder,代码行数:33,代码来源:ide-autotools-build-system.c


示例6: egg_task_cache_fetch_cb

static void
egg_task_cache_fetch_cb (GObject      *object,
                         GAsyncResult *result,
                         gpointer      user_data)
{
  EggTaskCache *self = (EggTaskCache *)object;
  GTask *task = (GTask *)result;
  GError *error = NULL;
  gpointer key = user_data;
  gpointer ret;

  g_assert (EGG_IS_TASK_CACHE (self));
  g_assert (G_IS_TASK (task));

  g_hash_table_remove (self->in_flight, key);

  ret = g_task_propagate_pointer (task, &error);

  if (ret != NULL)
    {
      egg_task_cache_populate (self, key, ret);
      egg_task_cache_propagate_pointer (self, key, ret);
      self->value_destroy_func (ret);
    }
  else
    {
      egg_task_cache_propagate_error (self, key, error);
      g_clear_error (&error);
    }

  self->key_destroy_func (key);

  EGG_COUNTER_DEC (in_flight);
}
开发者ID:MaX121,项目名称:gnome-builder,代码行数:34,代码来源:egg-task-cache.c


示例7: aws_s3_client_read_got_chunk

static void
aws_s3_client_read_got_chunk (SoupMessage *message,
                              SoupBuffer  *buffer,
                              GTask       *task)
{
  AwsS3Client *client;
  ReadState *state;

  g_assert (SOUP_IS_MESSAGE (message));
  g_assert (buffer != NULL);
  g_assert (G_IS_TASK (task));

  client = g_task_get_source_object (task);
  g_assert (AWS_IS_S3_CLIENT (client));

  state = g_task_get_task_data (task);
  g_assert (state != NULL);
  g_assert (state->handler != NULL);

  if (!state->handler (client, message, buffer, state->handler_data))
    {
      g_task_return_new_error (task,
                               G_IO_ERROR,
                               G_IO_ERROR_CANCELLED,
                               "The request was cancelled");
      soup_session_cancel_message (SOUP_SESSION (client), message, SOUP_STATUS_CANCELLED);
   }
}
开发者ID:chergert,项目名称:aws-glib,代码行数:28,代码来源:aws-s3-client.c


示例8: discover_file_cb

static void
discover_file_cb (GObject      *object,
                  GAsyncResult *result,
                  gpointer      user_data)
{
  IdeAutotoolsBuildSystem *self;
  g_autoptr(GTask) task = user_data;
  g_autoptr(GFile) file = NULL;
  GError *error = NULL;

  g_return_if_fail (G_IS_TASK (task));

  self = g_task_get_source_object (task);
  file = ide_autotools_build_system_discover_file_finish (self, result, &error);

  if (!file)
    {
      g_task_return_error (task, error);
      return;
    }

  g_object_set (self, "project-file", file, NULL);

  ide_autotools_build_system_parse_async (self,
                                          file,
                                          g_task_get_cancellable (task),
                                          parse_cb,
                                          g_object_ref (task));
}
开发者ID:badwolfie,项目名称:gnome-builder,代码行数:29,代码来源:ide-autotools-build-system.c


示例9: ide_git_vcs_reload_worker

static void
ide_git_vcs_reload_worker (GTask        *task,
                           gpointer      source_object,
                           gpointer      task_data,
                           GCancellable *cancellable)
{
  IdeGitVcs *self = source_object;
  g_autoptr(GgitRepository) repository1 = NULL;
  g_autoptr(GgitRepository) repository2 = NULL;
  GError *error = NULL;

  g_assert (G_IS_TASK (task));
  g_assert (IDE_IS_GIT_VCS (self));
  g_assert (!cancellable || G_IS_CANCELLABLE (cancellable));

  if (!(repository1 = ide_git_vcs_load (self, &error)) ||
      !(repository2 = ide_git_vcs_load (self, &error)))
    {
      g_task_return_error (task, error);
      return;
    }

  g_set_object (&self->repository, repository1);
  g_set_object (&self->change_monitor_repository, repository2);

  if (!ide_git_vcs_load_monitor (self, &error))
    {
      g_task_return_error (task, error);
      return;
    }

  g_task_return_boolean (task, TRUE);
}
开发者ID:MaX121,项目名称:gnome-builder,代码行数:33,代码来源:ide-git-vcs.c


示例10: parse_xml_worker

static void
parse_xml_worker (GTask        *task,
                  gpointer      source_object,
                  gpointer      task_data,
                  GCancellable *cancellable)
{
  DspyIntrospectionModel *self = source_object;
  GBytes *bytes = task_data;
  g_autoptr(GError) error = NULL;
  DspyNodeInfo *info;
  const gchar *xml;

  g_assert (G_IS_TASK (task));
  g_assert (DSPY_IS_INTROSPECTION_MODEL (source_object));
  g_assert (bytes != NULL);
  g_assert (!cancellable || G_IS_CANCELLABLE (cancellable));

  xml = (const gchar *)g_bytes_get_data (bytes, NULL);

  g_mutex_lock (&self->chunks_mutex);
  info = _dspy_node_parse (xml, self->chunks, &error);
  g_mutex_unlock (&self->chunks_mutex);

  if (info != NULL)
    g_task_return_pointer (task, info, (GDestroyNotify) _dspy_node_free);
  else
    g_task_return_error (task, g_steal_pointer (&error));
}
开发者ID:GNOME,项目名称:gnome-builder,代码行数:28,代码来源:dspy-introspection-model.c


示例11: fetch_items

static void
fetch_items(GTask* task, gpointer source, gpointer task_data, GCancellable* cancel)
{
    g_assert(GT_IS_SEARCH_GAME_CONTAINER(source));

    GtSearchGameContainer* self = GT_SEARCH_GAME_CONTAINER(source);
    GtSearchGameContainerPrivate* priv = gt_search_game_container_get_instance_private(self);

    g_assert(G_IS_CANCELLABLE(cancel));
    g_assert(G_IS_TASK(task));

    if (g_task_return_error_if_cancelled(task))
        return;

    if (utils_str_empty(priv->query))
    {
        g_task_return_pointer(task, NULL, NULL);
        return;
    }

    g_assert_nonnull(task_data);

    FetchItemsData* data = task_data;

    g_mutex_lock(&priv->mutex);

    gint64 end_time = g_get_monotonic_time() + SEARCH_DELAY;

    g_cancellable_connect(cancel, G_CALLBACK(cancelled_cb), self, NULL);

    while (!g_cancellable_is_cancelled(cancel))
    {
        if (!g_cond_wait_until(&priv->cond, &priv->mutex, end_time))
        {
            /* We weren't cancelled */

            g_assert(!utils_str_empty(priv->query));

            GError* err = NULL;

            GList* items = data->offset == 0 ? gt_twitch_search_games(main_app->twitch,
                priv->query, data->amount, data->offset, &err) : NULL;

            if (err)
                g_task_return_error(task, err);
            else
                g_task_return_pointer(task, items, (GDestroyNotify) gt_game_list_free);

            g_mutex_unlock(&priv->mutex);

            return;
        }
    }

    /* We were cancelled */
    g_assert(g_task_return_error_if_cancelled(task));

    g_mutex_unlock(&priv->mutex);
}
开发者ID:Generator,项目名称:gnome-twitch,代码行数:59,代码来源:gt-search-game-container.c


示例12: ide_application_task_completion

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);
}
开发者ID:mariospr,项目名称:gnome-builder,代码行数:8,代码来源:ide-application-tests.c


示例13: ide_autotools_build_system_discover_file_worker

static void
ide_autotools_build_system_discover_file_worker (GTask        *task,
                                                 gpointer      source_object,
                                                 gpointer      task_data,
                                                 GCancellable *cancellable)
{
  GFile *file = task_data;
  GFile *parent;

  g_assert (G_IS_TASK (task));
  g_assert (G_IS_FILE (file));
  g_assert (!cancellable || G_IS_CANCELLABLE (cancellable));

  if (is_configure (file) && g_file_query_exists (file, cancellable))
    {
      g_task_return_pointer (task, g_object_ref (file), g_object_unref);
      return;
    }

  parent = g_object_ref (file);

  while (parent != NULL)
    {
      GFile *child;
      GFile *tmp;

      child = g_file_get_child (parent, "configure.ac");
      if (g_file_query_exists (child, cancellable))
        {
          g_task_return_pointer (task, g_object_ref (child), g_object_unref);
          g_clear_object (&child);
          g_clear_object (&parent);
          return;
        }

      child = g_file_get_child (parent, "configure.in");
      if (g_file_query_exists (child, cancellable))
        {
          g_task_return_pointer (task, g_object_ref (child), g_object_unref);
          g_clear_object (&child);
          g_clear_object (&parent);
          return;
        }

      g_clear_object (&child);

      tmp = parent;
      parent = g_file_get_parent (parent);
      g_clear_object (&tmp);
    }

  g_clear_object (&parent);

  g_task_return_new_error (task,
                           G_IO_ERROR,
                           G_IO_ERROR_NOT_FOUND,
                           _("Failed to locate configure.ac"));
}
开发者ID:badwolfie,项目名称:gnome-builder,代码行数:58,代码来源:ide-autotools-build-system.c


示例14: ide_clang_service_unit_completed_cb

static void
ide_clang_service_unit_completed_cb (GObject      *object,
                                     GAsyncResult *result,
                                     gpointer      user_data)
{
  g_autoptr(GTask) task = user_data;
  gpointer ret;
  GError *error = NULL;

  g_assert (IDE_IS_CLANG_SERVICE (object));
  g_assert (G_IS_TASK (result));
  g_assert (G_IS_TASK (task));

  if (!(ret = g_task_propagate_pointer (G_TASK (result), &error)))
    g_task_return_error (task, error);
  else
    g_task_return_pointer (task, ret, g_object_unref);
}
开发者ID:kirushyk,项目名称:gnome-builder,代码行数:18,代码来源:ide-clang-service.c


示例15: dummy_finish

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);
}
开发者ID:badwolfie,项目名称:gnome-builder,代码行数:10,代码来源:ide-runner-addin.c


示例16: _ide_back_forward_list_load_finish

gboolean
_ide_back_forward_list_load_finish (IdeBackForwardList  *self,
                                    GAsyncResult        *result,
                                    GError             **error)
{
  g_return_val_if_fail (IDE_IS_BACK_FORWARD_LIST (self), FALSE);
  g_return_val_if_fail (G_IS_TASK (result), FALSE);

  return g_task_propagate_boolean (G_TASK (result), error);
}
开发者ID:bhurtelashish,项目名称:gnome-builder,代码行数:10,代码来源:ide-back-forward-list-load.c


示例17: ide_builder_real_build_finish

static IdeBuildResult *
ide_builder_real_build_finish (IdeBuilder    *self,
                               GAsyncResult  *result,
                               GError       **error)
{
  g_assert (IDE_IS_BUILDER (self));
  g_assert (G_IS_TASK (result));

  return g_task_propagate_pointer (G_TASK (result), error);
}
开发者ID:bhurtelashish,项目名称:gnome-builder,代码行数:10,代码来源:ide-builder.c


示例18: ide_runtime_real_postbuild_finish

static gboolean
ide_runtime_real_postbuild_finish (IdeRuntime    *self,
                                   GAsyncResult  *result,
                                   GError       **error)
{
  g_assert (IDE_IS_RUNTIME (self));
  g_assert (G_IS_TASK (result));

  return g_task_propagate_boolean (G_TASK (result), error);
}
开发者ID:bhurtelashish,项目名称:gnome-builder,代码行数:10,代码来源:ide-runtime.c


示例19: aws_s3_client_write_finish

gboolean
aws_s3_client_write_finish (AwsS3Client   *client,
                            GAsyncResult  *result,
                            GError       **error)
{
  g_return_val_if_fail (AWS_IS_S3_CLIENT (client), FALSE);
  g_return_val_if_fail (G_IS_TASK (result), FALSE);

  return g_task_propagate_boolean (G_TASK (result), error);
}
开发者ID:chergert,项目名称:aws-glib,代码行数:10,代码来源:aws-s3-client.c


示例20: ide_file_find_other_finish

/**
 * ide_file_find_other_finish:
 *
 * Completes an asynchronous call to ide_file_find_other_async(). This function
 * will try to find a matching file for languages where this exists. Such cases
 * include C and C++ where a .c or .cpp file may have a .h or .hh header. Additional
 * suffixes are implemented including (.c, .cc, .cpp, .cxx, .h, .hh, .hpp, and .hxx).
 *
 * Returns an #IdeFile if successful, otherwise %NULL and @error is set.
 *
 * Returns: (transfer full) (nullable): An #IdeFIle or %NULL.
 */
IdeFile *
ide_file_find_other_finish (IdeFile       *self,
                            GAsyncResult  *result,
                            GError       **error)
{
  g_return_val_if_fail (IDE_IS_FILE (self), NULL);
  g_return_val_if_fail (G_IS_TASK (result), NULL);

  return g_task_propagate_pointer (G_TASK (result), error);
}
开发者ID:badwolfie,项目名称:gnome-builder,代码行数:22,代码来源:ide-file.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ G_IS_VALUE函数代码示例发布时间:2022-05-30
下一篇:
C++ G_IS_SIMPLE_ASYNC_RESULT函数代码示例发布时间: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