[gnome-packagekit] Remove status icon use in GpkWatch
- From: Richard Hughes <rhughes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-packagekit] Remove status icon use in GpkWatch
- Date: Mon, 18 Oct 2010 16:03:05 +0000 (UTC)
commit cca6b0e16ed863cec294e2e7ecdb0904b27dc6d9
Author: William Jon McCann <jmccann redhat com>
Date: Mon Oct 18 17:02:34 2010 +0100
Remove status icon use in GpkWatch
Signed-off-by: Richard Hughes <richard hughsie com>
src/gpk-check-update.c | 31 +++++++++++--------------------
src/gpk-check-update.h | 2 --
src/gpk-update-icon.c | 7 -------
src/gpk-watch.c | 13 -------------
src/gpk-watch.h | 2 --
5 files changed, 11 insertions(+), 44 deletions(-)
---
diff --git a/src/gpk-check-update.c b/src/gpk-check-update.c
index 1322c04..c2076e2 100644
--- a/src/gpk-check-update.c
+++ b/src/gpk-check-update.c
@@ -1462,26 +1462,6 @@ out:
}
/**
- * gpk_check_update_set_status_icon:
- **/
-void
-gpk_check_update_set_status_icon (GpkCheckUpdate *cupdate, GtkStatusIcon *status_icon)
-{
- g_assert (cupdate->priv->status_icon == NULL);
- cupdate->priv->status_icon = g_object_ref (status_icon);
-
- /* right click actions are common */
- g_signal_connect_object (G_OBJECT (cupdate->priv->status_icon),
- "popup_menu",
- G_CALLBACK (gpk_check_update_popup_menu_cb),
- cupdate, 0);
- g_signal_connect_object (G_OBJECT (cupdate->priv->status_icon),
- "activate",
- G_CALLBACK (gpk_check_update_activate_update_cb),
- cupdate, 0);
-}
-
-/**
* gpk_check_update_init:
* @cupdate: This class instance
**/
@@ -1502,6 +1482,17 @@ gpk_check_update_init (GpkCheckUpdate *cupdate)
cupdate->priv->error_code = NULL;
cupdate->priv->settings = g_settings_new (GPK_SETTINGS_SCHEMA);
+ /* right click actions are common */
+ cupdate->priv->status_icon = gtk_status_icon_new ();
+ g_signal_connect_object (G_OBJECT (cupdate->priv->status_icon),
+ "popup_menu",
+ G_CALLBACK (gpk_check_update_popup_menu_cb),
+ cupdate, 0);
+ g_signal_connect_object (G_OBJECT (cupdate->priv->status_icon),
+ "activate",
+ G_CALLBACK (gpk_check_update_activate_update_cb),
+ cupdate, 0);
+
cupdate->priv->arefresh = gpk_auto_refresh_new ();
g_signal_connect (cupdate->priv->arefresh, "refresh-cache",
G_CALLBACK (gpk_check_update_auto_refresh_cache_cb), cupdate);
diff --git a/src/gpk-check-update.h b/src/gpk-check-update.h
index a7b278a..e813979 100644
--- a/src/gpk-check-update.h
+++ b/src/gpk-check-update.h
@@ -50,8 +50,6 @@ typedef struct
GType gpk_check_update_get_type (void);
GpkCheckUpdate *gpk_check_update_new (void);
-void gpk_check_update_set_status_icon (GpkCheckUpdate *check_update,
- GtkStatusIcon *status_icon);
G_END_DECLS
diff --git a/src/gpk-update-icon.c b/src/gpk-update-icon.c
index 6e025ff..0dce1f9 100644
--- a/src/gpk-update-icon.c
+++ b/src/gpk-update-icon.c
@@ -64,7 +64,6 @@ main (int argc, char *argv[])
GpkWatch *watch = NULL;
GpkFirmware *firmware = NULL;
GpkHardware *hardware = NULL;
- GtkStatusIcon *status_icon;
GOptionContext *context;
GtkApplication *application;
gboolean ret;
@@ -126,11 +125,6 @@ main (int argc, char *argv[])
firmware = gpk_firmware_new ();
hardware = gpk_hardware_new ();
- /* assign status area notification */
- status_icon = gtk_status_icon_new ();
- gpk_watch_set_status_icon (watch, status_icon);
- gpk_check_update_set_status_icon (cupdate, status_icon);
-
/* Only timeout if we have specified iton the command line */
if (timed_exit) {
timer_id = g_timeout_add_seconds (120, (GSourceFunc) gpk_icon_timed_exit_cb, application);
@@ -142,7 +136,6 @@ main (int argc, char *argv[])
/* run */
gtk_application_run (application);
- g_object_unref (status_icon);
g_object_unref (cupdate);
g_object_unref (watch);
g_object_unref (firmware);
diff --git a/src/gpk-watch.c b/src/gpk-watch.c
index 977282b..43b6227 100644
--- a/src/gpk-watch.c
+++ b/src/gpk-watch.c
@@ -59,7 +59,6 @@ static void gpk_watch_finalize (GObject *object);
struct GpkWatchPrivate
{
PkControl *control;
- GtkStatusIcon *status_icon;
GPtrArray *restart_package_names;
NotifyNotification *notification_message;
NotifyNotification *notification_restart;
@@ -610,16 +609,6 @@ out:
}
/**
- * gpk_watch_set_status_icon:
- **/
-void
-gpk_watch_set_status_icon (GpkWatch *watch, GtkStatusIcon *status_icon)
-{
- g_assert (watch->priv->status_icon == NULL);
- watch->priv->status_icon = g_object_ref (status_icon);
-}
-
-/**
* gpk_watch_process_require_restart_cb:
**/
static void
@@ -996,8 +985,6 @@ gpk_watch_finalize (GObject *object)
/* we might we waiting for a proxy update */
if (watch->priv->set_proxy_id != 0)
g_source_remove (watch->priv->set_proxy_id);
- if (watch->priv->status_icon != NULL)
- g_object_unref (watch->priv->status_icon);
g_free (watch->priv->error_details);
g_object_unref (watch->priv->cancellable);
g_object_unref (watch->priv->task);
diff --git a/src/gpk-watch.h b/src/gpk-watch.h
index a16508d..528b020 100644
--- a/src/gpk-watch.h
+++ b/src/gpk-watch.h
@@ -50,8 +50,6 @@ typedef struct
GType gpk_watch_get_type (void);
GpkWatch *gpk_watch_new (void);
-void gpk_watch_set_status_icon (GpkWatch *watch,
- GtkStatusIcon *status_icon);
G_END_DECLS
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]