diff options
author | Richard Hughes <richard@hughsie.com> | 2015-04-07 09:59:52 +0100 |
---|---|---|
committer | Richard Hughes <richard@hughsie.com> | 2015-04-07 10:00:18 +0100 |
commit | d8d007165a4c98f462785955b3c7a4bc4572cf8c (patch) | |
tree | ccc6d73d8714dc0c8a6398d06323ec867f9f54ed /libappstream-builder | |
parent | 067ea762046fd1045cd41794c553c468eb73a7d0 (diff) | |
download | appstream-glib-d8d007165a4c98f462785955b3c7a4bc4572cf8c.tar.gz |
Remove the batch output option from the builder
This removes the panel, which does not work well when the console is not a real
onsole, which is typical in most cases where the builder is being run.
Diffstat (limited to 'libappstream-builder')
-rw-r--r-- | libappstream-builder/Makefile.am | 2 | ||||
-rw-r--r-- | libappstream-builder/asb-context.c | 11 | ||||
-rw-r--r-- | libappstream-builder/asb-context.h | 2 | ||||
-rw-r--r-- | libappstream-builder/asb-panel.c | 450 | ||||
-rw-r--r-- | libappstream-builder/asb-panel.h | 77 | ||||
-rw-r--r-- | libappstream-builder/asb-self-test.c | 1 | ||||
-rw-r--r-- | libappstream-builder/asb-task.c | 56 | ||||
-rw-r--r-- | libappstream-builder/asb-task.h | 5 |
8 files changed, 7 insertions, 597 deletions
diff --git a/libappstream-builder/Makefile.am b/libappstream-builder/Makefile.am index f8ec8ab..82a8b6b 100644 --- a/libappstream-builder/Makefile.am +++ b/libappstream-builder/Makefile.am @@ -54,8 +54,6 @@ libappstream_builder_la_SOURCES = \ asb-package-deb.c \ asb-package-deb.h \ asb-package.h \ - asb-panel.c \ - asb-panel.h \ asb-task.c \ asb-task.h \ asb-utils.c \ diff --git a/libappstream-builder/asb-context.c b/libappstream-builder/asb-context.c index 4980c61..15e8f8f 100644 --- a/libappstream-builder/asb-context.c +++ b/libappstream-builder/asb-context.c @@ -36,7 +36,6 @@ #include "as-cleanup.h" #include "asb-context.h" #include "asb-context-private.h" -#include "asb-panel.h" #include "asb-plugin.h" #include "asb-plugin-loader.h" #include "asb-task.h" @@ -61,7 +60,6 @@ struct _AsbContextPrivate GMutex apps_mutex; /* for ->apps */ GPtrArray *file_globs; /* of AsbPackage */ GPtrArray *packages; /* of AsbPackage */ - AsbPanel *panel; AsbPluginLoader *plugin_loader; AsbContextFlags flags; guint max_threads; @@ -138,10 +136,6 @@ asb_context_set_flags (AsbContext *ctx, AsbContextFlags flags) as_store_add_metadata_index (priv->store_old, "X-CacheID"); } priv->flags = flags; - - /* only enable the fancy panel if not in batch mode */ - asb_panel_set_enabled (priv->panel, - (flags & ASB_CONTEXT_FLAG_BATCH_OUTPUT) == 0); } /** @@ -1231,7 +1225,6 @@ asb_context_process (AsbContext *ctx, GError **error) /* add each package */ g_print ("Processing packages...\n"); - asb_panel_set_job_total (priv->panel, priv->packages->len); tasks = g_ptr_array_new_with_free_func ((GDestroyNotify) g_object_unref); for (i = 0; i < priv->packages->len; i++) { pkg = g_ptr_array_index (priv->packages, i); @@ -1253,9 +1246,7 @@ asb_context_process (AsbContext *ctx, GError **error) /* create task */ task = asb_task_new (ctx); - asb_task_set_id (task, i); asb_task_set_package (task, pkg); - asb_task_set_panel (task, priv->panel); g_ptr_array_add (tasks, task); /* run the task */ @@ -1480,7 +1471,6 @@ asb_context_finalize (GObject *object) g_object_unref (priv->store_ignore); g_object_unref (priv->store_old); g_object_unref (priv->plugin_loader); - g_object_unref (priv->panel); g_ptr_array_unref (priv->packages); g_list_foreach (priv->apps, (GFunc) g_object_unref, NULL); g_list_free (priv->apps); @@ -1508,7 +1498,6 @@ asb_context_init (AsbContext *ctx) AsbContextPrivate *priv = GET_PRIVATE (ctx); priv->plugin_loader = asb_plugin_loader_new (ctx); - priv->panel = asb_panel_new (); priv->packages = g_ptr_array_new_with_free_func ((GDestroyNotify) g_object_unref); g_mutex_init (&priv->apps_mutex); priv->store_failed = as_store_new (); diff --git a/libappstream-builder/asb-context.h b/libappstream-builder/asb-context.h index 7d06f48..9e11811 100644 --- a/libappstream-builder/asb-context.h +++ b/libappstream-builder/asb-context.h @@ -69,7 +69,6 @@ struct _AsbContextClass * @ASB_CONTEXT_FLAG_NO_NETWORK: Do not download files * @ASB_CONTEXT_FLAG_INCLUDE_FAILED: Write the origin-ignore.xml file * @ASB_CONTEXT_FLAG_UNCOMPRESSED_ICONS: Do not pack icons into a tarball - * @ASB_CONTEXT_FLAG_BATCH_OUTPUT: Do not write escape sequences * * The flags to use when processing the context. **/ @@ -83,7 +82,6 @@ typedef enum { ASB_CONTEXT_FLAG_NO_NETWORK = 1 << 4, /* Since: 0.3.5 */ ASB_CONTEXT_FLAG_INCLUDE_FAILED = 1 << 5, /* Since: 0.3.5 */ ASB_CONTEXT_FLAG_UNCOMPRESSED_ICONS = 1 << 6, /* Since: 0.3.5 */ - ASB_CONTEXT_FLAG_BATCH_OUTPUT = 1 << 7, /* Since: 0.3.6 */ /*< private >*/ ASB_CONTEXT_FLAG_LAST, } AsbContextFlags; diff --git a/libappstream-builder/asb-panel.c b/libappstream-builder/asb-panel.c deleted file mode 100644 index 6b67a99..0000000 --- a/libappstream-builder/asb-panel.c +++ /dev/null @@ -1,450 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- - * - * Copyright (C) 2014 Richard Hughes <richard@hughsie.com> - * - * Licensed under the GNU Lesser General Public License Version 2.1 - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ - -/** - * SECTION:asb-panel - * @short_description: A panel for showing parallel tasks. - * @stability: Unstable - * - * This object provides a console panel showing tasks and thier statuses. - */ - -#include "config.h" - -#include <string.h> -#include <sys/types.h> -#include <sys/stat.h> -#include <fcntl.h> - -#include "as-cleanup.h" -#include "asb-panel.h" - -typedef struct _AsbPanelPrivate AsbPanelPrivate; -struct _AsbPanelPrivate -{ - GPtrArray *items; - GMutex mutex; - GTimer *timer; - gint tty_fd; - guint job_number_max; - guint job_total; - guint line_width_max; - guint number_cleared; - guint title_width; - guint title_width_max; - guint status_width_max; - guint time_secs_min; - gboolean enabled; -}; - -G_DEFINE_TYPE_WITH_PRIVATE (AsbPanel, asb_panel, G_TYPE_OBJECT) - -#define GET_PRIVATE(o) (asb_panel_get_instance_private (o)) - -typedef struct { - guint job_number; - gchar *title; - gchar *status; - GThread *thread; -} AsbPanelItem; - -/** - * asb_panel_item_free: - **/ -static void -asb_panel_item_free (AsbPanelItem *item) -{ - g_free (item->title); - g_free (item->status); - g_slice_free (AsbPanelItem, item); -} - -/** - * asb_panel_print_raw: - **/ -static gssize -asb_panel_print_raw (AsbPanel *panel, const gchar *tmp) -{ - AsbPanelPrivate *priv = GET_PRIVATE (panel); - gssize count; - gssize wrote; - - count = strlen (tmp) + 1; - wrote = write (priv->tty_fd, tmp, count); - if (wrote != count) { - g_warning ("Only wrote %" G_GSSIZE_FORMAT - " of %" G_GSSIZE_FORMAT " bytes", - wrote, count); - } - return count; -} - -/** - * asb_panel_print: - **/ -G_GNUC_PRINTF(2,3) static void -asb_panel_print (AsbPanel *panel, const gchar *fmt, ...) -{ - AsbPanelPrivate *priv = GET_PRIVATE (panel); - va_list args; - gsize len; - guint i; - _cleanup_free_ gchar *startline = NULL; - _cleanup_free_ gchar *tmp = NULL; - _cleanup_string_free_ GString *str = NULL; - - va_start (args, fmt); - tmp = g_strdup_vprintf (fmt, args); - va_end (args); - - /* pad out to the largest line we've seen */ - str = g_string_new (tmp); - for (i = str->len; i < priv->line_width_max; i++) - g_string_append (str, " "); - - /* don't do console cleverness in make check */ - if (!priv->enabled) { - g_debug ("%s", str->str); - priv->line_width_max = str->len - 1; - return; - } - - /* is this bigger than anything else we've seen? */ - len = asb_panel_print_raw (panel, str->str); - if (len - 1 > priv->line_width_max) - priv->line_width_max = len - 1; - - /* go back to the start of the line and drop down one line */ - startline = g_strdup_printf ("\033[%" G_GSIZE_FORMAT "D\033[1B", len); - asb_panel_print_raw (panel, startline); -} - -/** - * asb_panel_get_time_string: - **/ -static gchar * -asb_panel_get_time_string (AsbPanel *panel) -{ - AsbPanelPrivate *priv = GET_PRIVATE (panel); - guint seconds; - - /* not enough jobs to get an accurate time */ - if (priv->job_number_max < 20) - return g_strdup ("??"); - - /* calculate time */ - seconds = (g_timer_elapsed (priv->timer, NULL) / (gdouble) priv->job_number_max) * - (gdouble) (priv->job_total - priv->job_number_max); - if (seconds < priv->time_secs_min) - priv->time_secs_min = seconds; - if (priv->time_secs_min > 60) - return g_strdup_printf ("~%im", priv->time_secs_min / 60); - return g_strdup_printf ("~%is", priv->time_secs_min); -} - -/** - * asb_panel_refresh: - **/ -static void -asb_panel_refresh (AsbPanel *panel) -{ - AsbPanelItem *item = NULL; - AsbPanelPrivate *priv = GET_PRIVATE (panel); - guint i; - guint j; - - g_mutex_lock (&priv->mutex); - - /* clear four lines of blank */ - if (priv->enabled && priv->number_cleared < priv->items->len) { - for (i = 0; i < priv->items->len + 1; i++) - asb_panel_print_raw (panel, "\n"); - for (i = 0; i < priv->items->len + 1; i++) - asb_panel_print_raw (panel, "\033[1A"); - priv->number_cleared = priv->items->len; - } - - /* find existing and print status lines */ - for (i = 0; i < priv->items->len; i++) { - _cleanup_string_free_ GString *str = NULL; - item = g_ptr_array_index (priv->items, i); - str = g_string_new (item->title); - if (str->len > priv->title_width_max) - g_string_truncate (str, priv->title_width_max); - for (j = str->len; j < priv->title_width; j++) - g_string_append (str, " "); - if (priv->title_width < str->len) - priv->title_width = str->len; - if (item->status != NULL) { - g_string_append (str, " "); - g_string_append (str, item->status); - } - asb_panel_print (panel, "%s", str->str); - } - - /* any slots now unused */ - for (i = i; i < priv->number_cleared; i++) - asb_panel_print (panel, "Thread unused"); - - /* print percentage completion */ - if (item != NULL) { - _cleanup_free_ gchar *time_str = NULL; - time_str = asb_panel_get_time_string (panel); - asb_panel_print (panel, "Done: %.1f%% [%s]", - (gdouble) priv->job_number_max * 100.f / - (gdouble) priv->job_total, - time_str); - } else { - asb_panel_print (panel, "Done: 100.0%%"); - } - - /* go back up to the start */ - if (priv->enabled) { - for (i = 0; i < priv->number_cleared + 1; i++) - asb_panel_print_raw (panel, "\033[1A"); - } - - g_mutex_unlock (&priv->mutex); -} - -/** - * asb_panel_ensure_item: - **/ -static AsbPanelItem * -asb_panel_ensure_item (AsbPanel *panel) -{ - AsbPanelPrivate *priv = GET_PRIVATE (panel); - AsbPanelItem *item; - guint i; - - /* find existing */ - g_mutex_lock (&priv->mutex); - for (i = 0; i < priv->items->len; i++) { - item = g_ptr_array_index (priv->items, i); - if (item->thread == g_thread_self ()) - goto out; - } - - /* create */ - item = g_slice_new0 (AsbPanelItem); - item->thread = g_thread_self (); - g_ptr_array_add (priv->items, item); -out: - g_mutex_unlock (&priv->mutex); - return item; -} - -/** - * asb_panel_set_job_number: - * @panel: A #AsbPanel - * @job_number: numeric identifier - * - * Sets the job number for the task. - * - * Since: 0.2.3 - **/ -void -asb_panel_set_job_number (AsbPanel *panel, guint job_number) -{ - AsbPanelItem *item; - AsbPanelPrivate *priv = GET_PRIVATE (panel); - - /* record the highest seen job number for % calculations */ - if (job_number > priv->job_number_max) - priv->job_number_max = job_number; - - item = asb_panel_ensure_item (panel); - item->job_number = job_number; - asb_panel_refresh (panel); -} - -/** - * asb_panel_remove: - * @panel: A #AsbPanel - * - * Remove the currently running task. - * - * Since: 0.2.3 - **/ -void -asb_panel_remove (AsbPanel *panel) -{ - AsbPanelItem *item; - AsbPanelPrivate *priv = GET_PRIVATE (panel); - - item = asb_panel_ensure_item (panel); - g_mutex_lock (&priv->mutex); - g_ptr_array_remove (priv->items, item); - g_mutex_unlock (&priv->mutex); - asb_panel_refresh (panel); -} - -/** - * asb_panel_set_title: - * @panel: A #AsbPanel - * @title: text to display - * - * Sets the title for the currently running task. - * - * Since: 0.2.3 - **/ -void -asb_panel_set_title (AsbPanel *panel, const gchar *title) -{ - AsbPanelItem *item; - item = asb_panel_ensure_item (panel); - g_free (item->title); - item->title = g_strdup (title); - asb_panel_refresh (panel); -} - -/** - * asb_panel_set_status: - * @panel: A #AsbPanel - * @fmt: format string - * @...: varargs - * - * Sets the status for the currently running task. - * - * Since: 0.2.3 - **/ -void -asb_panel_set_status (AsbPanel *panel, const gchar *fmt, ...) -{ - AsbPanelItem *item; - AsbPanelPrivate *priv = GET_PRIVATE (panel); - va_list args; - - item = asb_panel_ensure_item (panel); - g_free (item->status); - - va_start (args, fmt); - item->status = g_strdup_vprintf (fmt, args); - va_end (args); - - /* truncate */ - if (strlen (item->status) > priv->status_width_max) - item->status[priv->status_width_max] = '\0'; - - asb_panel_refresh (panel); -} - -/** - * asb_panel_set_job_total: - * @panel: A #AsbPanel - * @job_number: numeric identifier - * - * Sets the largest job number for all of the tasks. - * - * Since: 0.2.3 - **/ -void -asb_panel_set_job_total (AsbPanel *panel, guint job_total) -{ - AsbPanelPrivate *priv = GET_PRIVATE (panel); - priv->job_total = job_total; -} - -/** - * asb_panel_set_enabled: - * @panel: A #AsbPanel - * @enabled: %TRUE for enabled - * - * Enables or disables the fancy progress panel. - * - * Since: 0.3.6 - **/ -void -asb_panel_set_enabled (AsbPanel *panel, gboolean enabled) -{ - AsbPanelPrivate *priv = GET_PRIVATE (panel); - priv->enabled = enabled; -} - -/** - * asb_panel_finalize: - **/ -static void -asb_panel_finalize (GObject *object) -{ - AsbPanel *panel = ASB_PANEL (object); - AsbPanelPrivate *priv = GET_PRIVATE (panel); - - g_ptr_array_unref (priv->items); - g_mutex_clear (&priv->mutex); - g_timer_destroy (priv->timer); - - G_OBJECT_CLASS (asb_panel_parent_class)->finalize (object); -} - -/** - * asb_panel_init: - **/ -static void -asb_panel_init (AsbPanel *panel) -{ - AsbPanelPrivate *priv = GET_PRIVATE (panel); - priv->items = g_ptr_array_new_with_free_func ((GDestroyNotify) asb_panel_item_free); - priv->title_width = 20; - priv->title_width_max = 50; - priv->status_width_max = 40; - priv->timer = g_timer_new (); - priv->time_secs_min = G_MAXUINT; - g_mutex_init (&priv->mutex); - - /* self test fix */ - priv->enabled = g_getenv ("ASB_IS_SELF_TEST") == NULL; - - /* find an actual TTY */ - priv->tty_fd = open ("/dev/tty", O_RDWR, 0); - if (priv->tty_fd < 0) - priv->tty_fd = open ("/dev/console", O_RDWR, 0); - if (priv->tty_fd < 0) - priv->tty_fd = open ("/dev/stdout", O_RDWR, 0); - g_assert (priv->tty_fd > 0); -} - -/** - * asb_panel_class_init: - **/ -static void -asb_panel_class_init (AsbPanelClass *klass) -{ - GObjectClass *object_class = G_OBJECT_CLASS (klass); - object_class->finalize = asb_panel_finalize; -} - -/** - * asb_panel_new: - * - * Creates a new panel. - * - * Returns: A #AsbPanel - * - * Since: 0.2.3 - **/ -AsbPanel * -asb_panel_new (void) -{ - AsbPanel *panel; - panel = g_object_new (ASB_TYPE_PANEL, NULL); - return ASB_PANEL (panel); -} diff --git a/libappstream-builder/asb-panel.h b/libappstream-builder/asb-panel.h deleted file mode 100644 index 9839a00..0000000 --- a/libappstream-builder/asb-panel.h +++ /dev/null @@ -1,77 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- - * - * Copyright (C) 2014 Richard Hughes <richard@hughsie.com> - * - * Licensed under the GNU Lesser General Public License Version 2.1 - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#ifndef ASB_PANEL_H -#define ASB_PANEL_H - -#include <glib-object.h> - -#define ASB_TYPE_PANEL (asb_panel_get_type()) -#define ASB_PANEL(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), ASB_TYPE_PANEL, AsbPanel)) -#define ASB_PANEL_CLASS(cls) (G_TYPE_CHECK_CLASS_CAST((cls), ASB_TYPE_PANEL, AsbPanelClass)) -#define ASB_IS_PANEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), ASB_TYPE_PANEL)) -#define ASB_IS_PANEL_CLASS(cls) (G_TYPE_CHECK_CLASS_TYPE((cls), ASB_TYPE_PANEL)) -#define ASB_PANEL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), ASB_TYPE_PANEL, AsbPanelClass)) - -G_BEGIN_DECLS - -typedef struct _AsbPanel AsbPanel; -typedef struct _AsbPanelClass AsbPanelClass; - -struct _AsbPanel -{ - GObject parent; -}; - -struct _AsbPanelClass -{ - GObjectClass parent_class; - /*< private >*/ - void (*_asb_reserved1) (void); - void (*_asb_reserved2) (void); - void (*_asb_reserved3) (void); - void (*_asb_reserved4) (void); - void (*_asb_reserved5) (void); - void (*_asb_reserved6) (void); - void (*_asb_reserved7) (void); - void (*_asb_reserved8) (void); -}; - -GType asb_panel_get_type (void); - -AsbPanel *asb_panel_new (void); -void asb_panel_remove (AsbPanel *panel); -void asb_panel_set_title (AsbPanel *panel, - const gchar *title); -void asb_panel_set_enabled (AsbPanel *panel, - gboolean enabled); -void asb_panel_set_status (AsbPanel *panel, - const gchar *fmt, - ...) - G_GNUC_PRINTF(2,3); -void asb_panel_set_job_number (AsbPanel *panel, - guint job_number); -void asb_panel_set_job_total (AsbPanel *panel, - guint job_total); - -G_END_DECLS - -#endif /* ASB_PANEL_H */ diff --git a/libappstream-builder/asb-self-test.c b/libappstream-builder/asb-self-test.c index 0881a5c..7246ff2 100644 --- a/libappstream-builder/asb-self-test.c +++ b/libappstream-builder/asb-self-test.c @@ -333,7 +333,6 @@ asb_test_context_test_func (AsbTestContextMode mode) asb_context_set_flags (ctx, ASB_CONTEXT_FLAG_ADD_CACHE_ID | ASB_CONTEXT_FLAG_NO_NETWORK | ASB_CONTEXT_FLAG_INCLUDE_FAILED | - ASB_CONTEXT_FLAG_BATCH_OUTPUT | ASB_CONTEXT_FLAG_HIDPI_ICONS); asb_context_set_basename (ctx, "appstream"); asb_context_set_origin (ctx, "asb-self-test"); diff --git a/libappstream-builder/asb-task.c b/libappstream-builder/asb-task.c index cc681e2..158cf76 100644 --- a/libappstream-builder/asb-task.c +++ b/libappstream-builder/asb-task.c @@ -43,11 +43,9 @@ struct _AsbTaskPrivate { AsbContext *ctx; AsbPackage *pkg; - AsbPanel *panel; GPtrArray *plugins_to_run; gchar *filename; gchar *tmpdir; - guint id; }; G_DEFINE_TYPE_WITH_PRIVATE (AsbTask, asb_task, G_TYPE_OBJECT) @@ -117,8 +115,7 @@ asb_task_explode_extra_package (AsbTask *task, (g_strcmp0 (asb_package_get_source (pkg_extra), asb_package_get_source (priv->pkg)) != 0)) return TRUE; - asb_panel_set_status (priv->panel, "Decompressing extra pkg %s", - asb_package_get_name (pkg_extra)); + g_debug ("decompressing extra pkg %s", asb_package_get_name (pkg_extra)); asb_package_log (priv->pkg, ASB_PACKAGE_LOG_LEVEL_DEBUG, "Adding extra package %s for %s", @@ -256,9 +253,7 @@ asb_task_process (AsbTask *task, GError **error_not_used) error_not_used)) return FALSE; - asb_panel_set_job_number (priv->panel, priv->id + 1); - asb_panel_set_title (priv->panel, asb_package_get_name (priv->pkg)); - asb_panel_set_status (priv->panel, "Starting"); + g_debug ("starting: %s", asb_package_get_name (priv->pkg)); /* ensure file list read */ if (!asb_package_ensure (priv->pkg, @@ -288,7 +283,7 @@ asb_task_process (AsbTask *task, GError **error_not_used) } /* explode tree */ - asb_panel_set_status (priv->panel, "Decompressing files"); + g_debug ("decompressing files: %s", asb_package_get_name (priv->pkg)); asb_package_log (priv->pkg, ASB_PACKAGE_LOG_LEVEL_DEBUG, "Exploding tree for %s", @@ -321,7 +316,7 @@ asb_task_process (AsbTask *task, GError **error_not_used) } /* run plugins */ - asb_panel_set_status (priv->panel, "Examining"); + g_debug ("examining: %s", asb_package_get_name (priv->pkg)); for (i = 0; i < priv->plugins_to_run->len; i++) { GList *apps_tmp = NULL; plugin = g_ptr_array_index (priv->plugins_to_run, i); @@ -348,7 +343,7 @@ asb_task_process (AsbTask *task, GError **error_not_used) goto skip; /* print */ - asb_panel_set_status (priv->panel, "Processing"); + g_debug ("processing: %s", asb_package_get_name (priv->pkg)); for (l = apps; l != NULL; l = l->next) { app = l->data; @@ -457,7 +452,7 @@ skip: asb_context_add_app_ignore (priv->ctx, priv->pkg); /* delete tree */ - asb_panel_set_status (priv->panel, "Deleting temp files"); + g_debug ("deleting temp files: %s", asb_package_get_name (priv->pkg)); if (!asb_utils_rmtree (priv->tmpdir, &error)) { asb_package_log (priv->pkg, ASB_PACKAGE_LOG_LEVEL_WARNING, @@ -467,7 +462,7 @@ skip: } /* write log */ - asb_panel_set_status (priv->panel, "Writing log"); + g_debug ("writing log: %s", asb_package_get_name (priv->pkg)); if (!asb_package_log_flush (priv->pkg, &error)) { asb_package_log (priv->pkg, ASB_PACKAGE_LOG_LEVEL_WARNING, @@ -475,9 +470,6 @@ skip: error->message); goto out; } - - /* update UI */ - asb_panel_remove (priv->panel); out: /* clear loaded resources */ asb_package_close (priv->pkg, NULL); @@ -501,8 +493,6 @@ asb_task_finalize (GObject *object) g_ptr_array_unref (priv->plugins_to_run); if (priv->pkg != NULL) g_object_unref (priv->pkg); - if (priv->panel != NULL) - g_object_unref (priv->panel); g_free (priv->filename); g_free (priv->tmpdir); @@ -529,38 +519,6 @@ asb_task_set_package (AsbTask *task, AsbPackage *pkg) } /** - * asb_task_set_panel: (skip): - * @task: A #AsbTask - * @panel: A #AsbPanel - * - * Sets the panel used for the task. - * - * Since: 0.2.3 - **/ -void -asb_task_set_panel (AsbTask *task, AsbPanel *panel) -{ - AsbTaskPrivate *priv = GET_PRIVATE (task); - priv->panel = g_object_ref (panel); -} - -/** - * asb_task_set_id: - * @task: A #AsbTask - * @id: numeric identifier - * - * Sets the ID to use for the task. - * - * Since: 0.1.0 - **/ -void -asb_task_set_id (AsbTask *task, guint id) -{ - AsbTaskPrivate *priv = GET_PRIVATE (task); - priv->id = id; -} - -/** * asb_task_init: **/ static void diff --git a/libappstream-builder/asb-task.h b/libappstream-builder/asb-task.h index 8b7aa2d..9c93c0c 100644 --- a/libappstream-builder/asb-task.h +++ b/libappstream-builder/asb-task.h @@ -25,7 +25,6 @@ #include <glib-object.h> #include "asb-package.h" -#include "asb-panel.h" #include "asb-context.h" #define ASB_TYPE_TASK (asb_task_get_type()) @@ -67,10 +66,6 @@ gboolean asb_task_process (AsbTask *task, GError **error_not_used); void asb_task_set_package (AsbTask *task, AsbPackage *pkg); -void asb_task_set_panel (AsbTask *task, - AsbPanel *panel); -void asb_task_set_id (AsbTask *task, - guint id); G_END_DECLS |