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

C++ pk_backend_job_finished函数代码示例

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

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



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

示例1: pk_backend_finish

gboolean
pk_backend_finish (PkBackend *self, GError *error)
{
	gboolean cancelled = FALSE;

	g_return_val_if_fail (self != NULL, FALSE);

	pk_backend_job_set_allow_cancel (self, FALSE);

	g_static_mutex_lock (&mutex);

	if (cancellable != NULL) {
		cancelled = g_cancellable_is_cancelled (cancellable);
		g_object_unref (cancellable);
		cancellable = NULL;
	}

	g_static_mutex_unlock (&mutex);

	if (error != NULL) {
		pk_backend_error (self, error);
		g_error_free (error);
	}

	if (cancelled) {
		pk_backend_job_set_status (self, PK_STATUS_ENUM_CANCEL);
	}

	pk_backend_job_finished (self);
	return (error == NULL);
}
开发者ID:kaltsi,项目名称:PackageKit,代码行数:31,代码来源:pk-backend-alpm.c


示例2: pk_backend_job_thread_setup

/**
 * pk_backend_job_thread_setup:
 **/
static gpointer
pk_backend_job_thread_setup (gpointer thread_data)
{
	PkBackendJobThreadHelper *helper = (PkBackendJobThreadHelper *) thread_data;

	/* run original function with automatic locking */
	pk_backend_thread_start (helper->backend, helper->job, helper->func);
	helper->func (helper->job, helper->job->priv->params, helper->user_data);
	pk_backend_job_finished (helper->job);
	pk_backend_thread_stop (helper->backend, helper->job, helper->func);

	/* set idle IO priority */
#ifdef PK_BUILD_DAEMON
	if (helper->job->priv->background == TRUE) {
		g_debug ("setting ioprio class to idle");
		pk_ioprio_set_idle (0);
	}
#endif

	/* unref the thread here as it holds a reference itself and we do
	 * not need to join() this at any stage */
	g_thread_unref (helper->job->priv->thread);

	/* destroy helper */
	g_object_unref (helper->job);
	if (helper->destroy_func != NULL)
		helper->destroy_func (helper->user_data);
	g_free (helper);

	/* no return value */
	return NULL;
}
开发者ID:dgikiller,项目名称:PackageKit,代码行数:35,代码来源:pk-backend-job.c


示例3: pk_backend_search_names

/**
 * pk_backend_search_names:
 */
void
pk_backend_search_names (PkBackend *backend, PkBackendJob *job, PkBitfield filters, gchar **values)
{
	pk_backend_job_error_code (job, PK_ERROR_ENUM_INTERNAL_ERROR,
			       "Error number 1");
	pk_backend_job_finished (job);
}
开发者ID:DimStar77,项目名称:PackageKit,代码行数:10,代码来源:pk-backend-test-fail.c


示例4: pk_backend_upgrade_system

/**
 * pk_backend_upgrade_system:
 */
void
pk_backend_upgrade_system (PkBackend *backend, PkBackendJob *job, PkBitfield transaction_flags, const gchar *distro_id, PkUpgradeKindEnum upgrade_kind)
{
	pk_backend_job_error_code (job, PK_ERROR_ENUM_INSTALL_ROOT_INVALID,
			       "Cannot find boot partition");
	pk_backend_job_finished (job);
}
开发者ID:DimStar77,项目名称:PackageKit,代码行数:10,代码来源:pk-backend-test-fail.c


示例5: pk_backend_search_name_timeout

/**
 * pk_backend_search_name_timeout:
 **/
static gboolean
pk_backend_search_name_timeout (gpointer data)
{
	PkBackendJob *job = (PkBackendJob *) data;
	pk_backend_job_finished (job);
	return FALSE;
}
开发者ID:DimStar77,项目名称:PackageKit,代码行数:10,代码来源:pk-backend-test-succeed.c


示例6: backend_install_packages_thread

static void
backend_install_packages_thread (PkBackendJob *job, GVariant *params, gpointer user_data)
{
	gint err, i;
	gchar **package_ids;
	gchar **parts;

	package_ids = pk_backend_get_strv (backend, "pkids");

	err = 0;

	for (i = 0; package_ids[i]; i++)
	{
		pk_backend_job_package (job, PK_INFO_ENUM_INSTALLING, package_ids[i], NULL);

		parts = pk_package_id_split (package_ids[i]);

		err = opkg_install_package (parts[PK_PACKAGE_ID_NAME], pk_opkg_progress_cb, backend);
		if (err)
			handle_install_error (backend, err);

		g_strfreev (parts);
		if (err != 0)
			break;
	}

	pk_backend_job_finished (job);
}
开发者ID:Distrotech,项目名称:packagekit,代码行数:28,代码来源:pk-backend-opkg.c


示例7: pk_backend_spawn_exit_cb

static void
pk_backend_spawn_exit_cb (PkSpawn *spawn, PkSpawnExitType exit_enum, PkBackendSpawn *backend_spawn)
{
	gboolean ret;
	g_return_if_fail (PK_IS_BACKEND_SPAWN (backend_spawn));

	/* reset the busy flag */
	backend_spawn->priv->is_busy = FALSE;

	/* if we force killed the process, set an error */
	if (exit_enum == PK_SPAWN_EXIT_TYPE_SIGKILL) {
		/* we just call this failed, and set an error */
		pk_backend_job_error_code (backend_spawn->priv->job, PK_ERROR_ENUM_PROCESS_KILL,
				       "Process had to be killed to be cancelled");
	}

	if (exit_enum == PK_SPAWN_EXIT_TYPE_DISPATCHER_EXIT ||
	    exit_enum == PK_SPAWN_EXIT_TYPE_DISPATCHER_CHANGED) {
		g_debug ("dispatcher exited, nothing to see here");
		return;
	}

	/* only emit if not finished */
	if (!backend_spawn->priv->finished) {
		g_debug ("script exited without doing finished, tidying up");
		ret = pk_backend_job_has_set_error_code (backend_spawn->priv->job);
		if (!ret) {
			pk_backend_job_error_code (backend_spawn->priv->job,
					       PK_ERROR_ENUM_INTERNAL_ERROR,
					       "The backend exited unexpectedly. "
					       "This is a serious error as the spawned backend did not complete the pending transaction.");
		}
		pk_backend_job_finished (backend_spawn->priv->job);
	}
}
开发者ID:EvaSDK,项目名称:PackageKit,代码行数:35,代码来源:pk-backend-spawn.c


示例8: pk_backend_get_update_detail_thread

static void pk_backend_get_update_detail_thread(PkBackendJob *job, GVariant *params, gpointer user_data) {
	guint i;
	gchar **pkg_ids;

	pk_backend_job_set_status(job, PK_STATUS_ENUM_QUERY);

	g_variant_get(params, "(^a&s)", &pkg_ids);

	for (i = 0; pkg_ids[i] != NULL; i++) {
		pk_backend_job_update_detail (job,
									  pkg_ids[i],
									  NULL,
									  NULL,
									  NULL,
									  NULL,
									  NULL,
									  PK_RESTART_ENUM_NONE,
									  NULL,
									  NULL,
									  PK_UPDATE_STATE_ENUM_STABLE,
									  NULL,
									  NULL);
	}

	pk_backend_job_finished (job);
}
开发者ID:Distrotech,项目名称:packagekit,代码行数:26,代码来源:pk-backend-katja.c


示例9: pk_backend_repo_enable_thread

static void
pk_backend_repo_enable_thread (PkBackendJob *job, GVariant *params, gpointer user_data)
{
	const gchar *repo;

	GError *error = NULL;

	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (disabled != NULL, FALSE);

	repo = pk_backend_get_string (self, "repo_id");

	if (g_hash_table_remove (disabled, repo)) {
		/* reload configuration to preserve ordering */
		if (disabled_repos_configure (disabled, &error)) {
			pk_backend_repo_list_changed (self);
		}
	} else {
		int code = PM_ERR_DB_NOT_NULL;
		g_set_error (&error, ALPM_ERROR, code, "[%s]: %s",
			     repo, alpm_strerror (code));
	}

	if (error != NULL) {
		pk_backend_error (self, error);
		g_error_free (error);
	}

	pk_backend_job_finished (self);
}
开发者ID:coolo,项目名称:packagekit,代码行数:30,代码来源:pk-backend-databases.c


示例10: backend_get_details_thread

/**
 * pk_backend_get_details:
 */
static void
backend_get_details_thread (PkBackendJob *job, GVariant *params, gpointer user_data)
{
	gchar **package_ids;
	gchar **parts;
	int group_index;
	PkGroupEnum group = 0;
	pkg_t *pkg;
	gchar *newid;

	package_ids = pk_backend_get_strv(backend, "package_ids");
	parts = pk_package_id_split (package_ids[0]);

	if (!parts)
	{
		pk_backend_job_error_code (job, PK_ERROR_ENUM_PACKAGE_ID_INVALID, "invalid package id");
		pk_backend_job_finished (job);
		return;
	}

	pkg = opkg_find_package (parts[PK_PACKAGE_ID_NAME], parts[PK_PACKAGE_ID_VERSION], parts[PK_PACKAGE_ID_ARCH], parts[PK_PACKAGE_ID_DATA]);
	g_strfreev (parts);

	if (!pkg)
	{
		pk_backend_job_error_code (job, PK_ERROR_ENUM_PACKAGE_NOT_FOUND, NULL);
		pk_backend_job_finished (job);
		return;
	}

	newid = g_strdup_printf ("%s;%s;%s;%s", pkg->name, pkg->version, pkg->architecture, pkg->src->name);

	if (pkg->tags) {
		for (group_index = 0; group < PK_GROUP_ENUM_LAST; group_index++) {
			group = 1 << group_index;
			if (!(group & pk_backend_get_groups(backend))) continue;
			if (opkg_check_tag(pkg, (const gchar *)pk_group_enum_to_string(group))) 
				break;
		}
	}

	pk_backend_job_details (job, newid, NULL, NULL, group, pkg->description, NULL, pkg->size);
	g_free (newid);
	pk_backend_job_finished (job);
}
开发者ID:Distrotech,项目名称:packagekit,代码行数:48,代码来源:pk-backend-opkg.c


示例11: pk_backend_remove_packages

/**
 * pk_backend_remove_packages:
 */
void
pk_backend_remove_packages (PkBackend *backend, PkBackendJob *job,
			    PkBitfield transaction_flags,
			    gchar **package_ids,
			    gboolean allow_deps,
			    gboolean autoremove)
{
	pk_backend_job_finished (job);
}
开发者ID:axaxs,项目名称:PackageKit-0.8.17,代码行数:12,代码来源:pk-backend-test-succeed.c


示例12: pk_backend_repo_enable

/**
 * pk_backend_repo_enable:
 */
static void
pk_backend_repo_enable (PkBackend *backend, PkBackendJob *job, const gchar *rid, gboolean enabled)
{
	pk_backend_job_set_status (job, PK_STATUS_ENUM_QUERY);

	box_repos_enable_repo(rid, enabled);

	pk_backend_job_finished (job);
}
开发者ID:coolo,项目名称:packagekit,代码行数:12,代码来源:pk-backend-box.c


示例13: pk_backend_update_packages

/**
 * pk_backend_update_packages:
 */
static void
pk_backend_update_packages (PkBackend *backend, PkBackendJob *job, gboolean only_trusted, gchar **package_ids)
{
	/* check network state */
	if (!pk_backend_is_online (backend)) {
		pk_backend_job_error_code (job, PK_ERROR_ENUM_NO_NETWORK, "Cannot update when offline");
		pk_backend_job_finished (job);
		return;
	}
	pk_backend_job_thread_create (job, backend_update_packages_thread, NULL, NULL);
}
开发者ID:coolo,项目名称:packagekit,代码行数:14,代码来源:pk-backend-box.c


示例14: pk_backend_repo_set_data

/**
 * pk_backend_repo_set_data:
 */
static void
pk_backend_repo_set_data (PkBackend *backend, PkBackendJob *job, const gchar *rid, const gchar *parameter, const gchar *value)
{
	pk_backend_job_set_status (job, PK_STATUS_ENUM_QUERY);

	if (!box_repos_set_param (rid, parameter, value)) {
		g_warning ("Cannot set PARAMETER '%s' TO '%s' for REPO '%s'", parameter, value, rid);
	}

	pk_backend_job_finished (job);
}
开发者ID:coolo,项目名称:packagekit,代码行数:14,代码来源:pk-backend-box.c


示例15: pk_backend_search_names_thread

/**
 * pk_backend_search_names_thread:
 */
static void
pk_backend_search_names_thread (PkBackendJob *job, GVariant *params, gpointer user_data)
{
	GTimer *timer;
	guint percentage;
	PkBitfield filters;
	gchar *filters_text;
	gchar **search;

	g_variant_get (params, "(t^a&s)",
		       &filters,
		       &search);

	filters_text = pk_filter_bitfield_to_string (filters);
	g_debug ("started task (%p) search=%s filters=%s", job, search[0], filters_text);
	g_free (filters_text);
	pk_backend_job_set_status (job, PK_STATUS_ENUM_QUERY);
	timer = g_timer_new ();
	percentage = 0;
	do {
		/* now is a good time to see if we should cancel the thread */
		if (is_cancelled) {
			pk_backend_job_error_code (job, PK_ERROR_ENUM_TRANSACTION_CANCELLED,
					       "The thread was stopped successfully");
			pk_backend_job_finished (job);
			return;
		}
		pk_backend_job_set_percentage (job, percentage);
		percentage += 10;
		g_usleep (1000*100);
	} while (percentage < 100);
	g_timer_destroy (timer);
	pk_backend_job_set_percentage (job, 100);
	g_debug ("exited task (%p)", job);

	pk_backend_job_package (job, PK_INFO_ENUM_INSTALLED,
			    "glib2;2.14.0;i386;fedora", "The GLib library");
	pk_backend_job_package (job, PK_INFO_ENUM_INSTALLED,
			    "gtk2;gtk2-2.11.6-6.fc8;i386;fedora", "GTK+ Libraries for GIMP");
	pk_backend_job_finished (job);
}
开发者ID:Distrotech,项目名称:packagekit,代码行数:44,代码来源:pk-backend-test-thread.c


示例16: pk_backend_update_packages_thread

static void pk_backend_update_packages_thread(PkBackendJob *job, GVariant *params, gpointer user_data) {
	gchar *dest_dir_name, *cmd_line, **pkg_tokens, **pkg_ids;
	guint i;
	GSList *repo;
    PkBitfield transaction_flags = 0;

	g_variant_get(params, "(t^a&s)", &transaction_flags, &pkg_ids);

	if (!pk_bitfield_contain(transaction_flags, PK_TRANSACTION_FLAG_ENUM_SIMULATE)) {
		pk_backend_job_set_status(job, PK_STATUS_ENUM_DOWNLOAD);

		/* Download the packages */
		dest_dir_name = g_build_filename(LOCALSTATEDIR, "cache", "PackageKit", "downloads", NULL);
		for (i = 0; pkg_ids[i]; i++) {
			pkg_tokens = pk_package_id_split(pkg_ids[i]);

			if (g_strcmp0(pkg_tokens[PK_PACKAGE_ID_DATA], "obsolete")) {
				repo = g_slist_find_custom(repos, pkg_tokens[PK_PACKAGE_ID_DATA], katja_cmp_repo);

				if (repo)
					katja_pkgtools_download(KATJA_PKGTOOLS(repo->data), job,
											dest_dir_name,
											pkg_tokens[PK_PACKAGE_ID_NAME]);
			}

			g_strfreev(pkg_tokens);
		}
		g_free(dest_dir_name);

		/* Install the packages */
		pk_backend_job_set_status(job, PK_STATUS_ENUM_UPDATE);
		for (i = 0; pkg_ids[i]; i++) {
			pkg_tokens = pk_package_id_split(pkg_ids[i]);

			if (g_strcmp0(pkg_tokens[PK_PACKAGE_ID_DATA], "obsolete")) {
				repo = g_slist_find_custom(repos, pkg_tokens[PK_PACKAGE_ID_DATA], katja_cmp_repo);

				if (repo)
					katja_pkgtools_install(KATJA_PKGTOOLS(repo->data), job, pkg_tokens[PK_PACKAGE_ID_NAME]);
			} else {
				/* Remove obsolete package
				 * TODO: Removing should be an independent operation (not during installing updates) */
				cmd_line = g_strconcat("/sbin/removepkg ", pkg_tokens[PK_PACKAGE_ID_NAME], NULL);
				g_spawn_command_line_sync(cmd_line, NULL, NULL, NULL, NULL);
				g_free(cmd_line);
			}

			g_strfreev(pkg_tokens);
		}
	}

	pk_backend_job_finished(job);
}
开发者ID:Distrotech,项目名称:packagekit,代码行数:53,代码来源:pk-backend-katja.c


示例17: pk_backend_refresh_cache

/**
 * pk_backend_refresh_cache:
 */
void
pk_backend_refresh_cache (PkBackend *backend, PkBackendJob *job, gboolean force)
{
	/* check network state */
	if (!pk_backend_is_online (backend)) {
		pk_backend_job_error_code (job, PK_ERROR_ENUM_NO_NETWORK, "Cannot refresh cache whilst offline");
		pk_backend_job_finished (job);
		return;
	}

	pk_backend_spawn_helper (spawn, job, BACKEND_FILE, "refresh-cache", pk_backend_bool_to_string (force), NULL);
}
开发者ID:Distrotech,项目名称:packagekit,代码行数:15,代码来源:pk-backend-smart.c


示例18: pk_backend_start_job

/**
 * pk_backend_start_job:
 */
void
pk_backend_start_job (PkBackend *backend, PkBackendJob *job)
{
	if (pk_backend_spawn_is_busy (priv->spawn)) {
		pk_backend_job_error_code (job,
					   PK_ERROR_ENUM_LOCK_REQUIRED,
					   "spawned backend requires lock");
		pk_backend_job_finished (job);
		return;
	}
	pk_backend_enable_media_repo (TRUE);
}
开发者ID:Conan-Kudo,项目名称:PackageKit,代码行数:15,代码来源:pk-backend-yum.c


示例19: pk_backend_search_groups_thread

/**
 * pk_backend_search_groups_thread:
 */
static void
pk_backend_search_groups_thread (PkBackendJob *job, GVariant *params, gpointer user_data)
{
	pk_backend_job_set_status (job, PK_STATUS_ENUM_QUERY);

	/* emit */
	pk_backend_job_package (job, PK_INFO_ENUM_INSTALLED,
			    "glib2;2.14.0;i386;fedora", "The GLib library");
	pk_backend_job_package (job, PK_INFO_ENUM_INSTALLED,
			    "gtk2;gtk2-2.11.6-6.fc8;i386;fedora", "GTK+ Libraries for GIMP");
	pk_backend_job_finished (job);
}
开发者ID:Distrotech,项目名称:packagekit,代码行数:15,代码来源:pk-backend-test-thread.c


示例20: pk_backend_refresh_cache

/**
 * pk_backend_refresh_cache:
 */
static void
pk_backend_refresh_cache (PkBackend *backend, PkBackendJob *job, gboolean force)
{
	/* check network state */
	if (!pk_backend_is_online (backend)) {
		pk_backend_job_error_code (job, PK_ERROR_ENUM_NO_NETWORK, "Cannot refresh cache whilst offline");
		pk_backend_job_finished (job);
		return;
	}
	/* FIXME: support force */
	pk_backend_job_thread_create (job, backend_refresh_cache_thread, NULL, NULL);
}
开发者ID:coolo,项目名称:packagekit,代码行数:15,代码来源:pk-backend-box.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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