gnome-packagekit r149 - in trunk: . data help/C src



Author: rhughes
Date: Wed Apr  2 19:41:59 2008
New Revision: 149
URL: http://svn.gnome.org/viewvc/gnome-packagekit?rev=149&view=rev

Log:
from git

Modified:
   trunk/configure.ac
   trunk/data/gnome-packagekit.schemas.in
   trunk/data/gpk-application.glade
   trunk/data/gpk-progress.glade
   trunk/help/C/gnome-packagekit.xml
   trunk/src/Makefile.am
   trunk/src/gpk-application.c
   trunk/src/gpk-application.h
   trunk/src/gpk-auto-refresh.c
   trunk/src/gpk-auto-refresh.h
   trunk/src/gpk-cell-renderer-uri.h
   trunk/src/gpk-common.c
   trunk/src/gpk-common.h
   trunk/src/gpk-inhibit.c
   trunk/src/gpk-inhibit.h
   trunk/src/gpk-install-file.c
   trunk/src/gpk-notify.c
   trunk/src/gpk-notify.h
   trunk/src/gpk-progress.c
   trunk/src/gpk-progress.h
   trunk/src/gpk-smart-icon.c
   trunk/src/gpk-smart-icon.h
   trunk/src/gpk-statusbar.c
   trunk/src/gpk-statusbar.h
   trunk/src/gpk-update-viewer.c
   trunk/src/gpk-watch.c
   trunk/src/gpk-watch.h

Modified: trunk/configure.ac
==============================================================================
--- trunk/configure.ac	(original)
+++ trunk/configure.ac	Wed Apr  2 19:41:59 2008
@@ -139,6 +139,40 @@
 AC_SUBST(DOCDIR)
 
 dnl ---------------------------------------------------------------------------
+dnl - Other tests
+dnl ---------------------------------------------------------------------------
+AC_ARG_ENABLE(gcov, AS_HELP_STRING([--enable-gcov],[compile with coverage profiling instrumentation (gcc only)]),
+	      enable_gcov=$enableval,enable_gcov=no)
+AC_ARG_ENABLE(gprof, AS_HELP_STRING([--enable-gprof],[compile with gprof support (gcc only)]),
+	      enable_gprof=$enableval,enable_gprof=no)
+
+if test x$enable_gcov = xyes; then
+	## so that config.h changes when you toggle gcov support
+	AC_DEFINE_UNQUOTED(PK_BUILD_GCOV, 1, [Defined if gcov is enabled to force a rebuild due to config.h changing])
+
+	AC_MSG_CHECKING([for gcc 3.3 version of gcov file format])
+	have_gcc33_gcov=no
+	AC_RUN_IFELSE( [AC_LANG_PROGRAM( , [[ if (__GNUC__ >=3 && __GNUC_MINOR__ >= 3) exit (0); else exit (1); ]])],
+			have_gcc33_gcov=yes)
+	if test x$have_gcc33_gcov = xyes ; then
+		AC_DEFINE_UNQUOTED(PK_HAVE_GCC33_GCOV, 1, [Defined if we have gcc 3.3 and thus the new gcov format])
+	fi
+	CFLAGS="$CFLAGS -fprofile-arcs -ftest-coverage"
+	AC_MSG_RESULT($have_gcc33_gcov)
+fi
+AM_CONDITIONAL(PK_BUILD_GCOV, test x$enable_gcov = xyes)
+
+if test x$enable_gprof = xyes; then
+	## so that config.h changes when you toggle gprof support
+	AC_DEFINE_UNQUOTED(PK_BUILD_GPROF, 1, [Defined if gprof is enabled to force a rebuild due to config.h changing])
+	CPPFLAGS="$CPPFLAGS -pg"
+	LDFLAGS="$LDFLAGS -pg"
+	CFLAGS="$CFLAGS -fprofile-arcs -ftest-coverage"
+	AC_MSG_RESULT($enable_gprof)
+fi
+AM_CONDITIONAL(PK_BUILD_GPROF, test x$enable_gprof = xyes)
+
+dnl ---------------------------------------------------------------------------
 dnl - Makefiles, etc.
 dnl ---------------------------------------------------------------------------
 AC_OUTPUT([
@@ -172,6 +206,8 @@
                     gnome-packagekit $VERSION
                   =============================
 
+        GCC coverage profiling:    ${enable_gcov}
+        GCC time profiling:        ${enable_gprof}
         prefix:                    ${prefix}
         datadir:                   ${datadir}
         compiler:                  ${CC}

Modified: trunk/data/gnome-packagekit.schemas.in
==============================================================================
--- trunk/data/gnome-packagekit.schemas.in	(original)
+++ trunk/data/gnome-packagekit.schemas.in	Wed Apr  2 19:41:59 2008
@@ -174,7 +174,7 @@
       <applyto>/apps/gnome-packagekit/application/filter_basename</applyto>
       <owner>gnome-packagekit</owner>
       <type>bool</type>
-      <default>true</default>
+      <default>false</default>
       <locale name="C">
         <short>If we should filter using basename in gpk-application</short>
         <long>If we should filter package lists using basename in gpk-application</long>

Modified: trunk/data/gpk-application.glade
==============================================================================
--- trunk/data/gpk-application.glade	(original)
+++ trunk/data/gpk-application.glade	Wed Apr  2 19:41:59 2008
@@ -251,7 +251,7 @@
                         <property name="visible">True</property>
                         <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
                         <property name="tooltip" translatable="yes">Only show one package, not subpackages</property>
-                        <property name="label" translatable="yes">_Package groups</property>
+                        <property name="label" translatable="yes">_Hide subpackages</property>
                         <property name="use_underline">True</property>
                         <property name="active">True</property>
                       </widget>
@@ -261,7 +261,7 @@
                         <property name="visible">True</property>
                         <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
                         <property name="tooltip" translatable="yes">Only show the newest available package</property>
-                        <property name="label" translatable="yes">_Newest packages</property>
+                        <property name="label" translatable="yes">Only _newest packages</property>
                         <property name="use_underline">True</property>
                         <property name="active">True</property>
                       </widget>

Modified: trunk/data/gpk-progress.glade
==============================================================================
--- trunk/data/gpk-progress.glade	(original)
+++ trunk/data/gpk-progress.glade	Wed Apr  2 19:41:59 2008
@@ -6,7 +6,6 @@
     <property name="visible">True</property>
     <property name="title" translatable="yes">PackageKit Progress</property>
     <property name="resizable">False</property>
-    <property name="modal">True</property>
     <property name="window_position">GTK_WIN_POS_CENTER</property>
     <property name="icon_name">gtk-info</property>
     <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
@@ -147,15 +146,18 @@
           <widget class="GtkHButtonBox" id="hbuttonbox1">
             <property name="visible">True</property>
             <property name="spacing">5</property>
+            <property name="layout_style">GTK_BUTTONBOX_END</property>
             <child>
               <widget class="GtkButton" id="button_help">
-                <property name="visible">True</property>
                 <property name="can_focus">True</property>
                 <property name="can_default">True</property>
                 <property name="label">gtk-help</property>
                 <property name="use_stock">True</property>
                 <property name="response_id">0</property>
               </widget>
+              <packing>
+                <property name="secondary">True</property>
+              </packing>
             </child>
             <child>
               <widget class="GtkButton" id="button_cancel">

Modified: trunk/help/C/gnome-packagekit.xml
==============================================================================
--- trunk/help/C/gnome-packagekit.xml	(original)
+++ trunk/help/C/gnome-packagekit.xml	Wed Apr  2 19:41:59 2008
@@ -241,7 +241,7 @@
   <section id="filters">
     <title>Filters</title>
     <para>
-      You can limit the amount of packages that is shown by serveral criteria.
+      You can limit the amount of packages that is shown by several criteria.
     </para>
     <para>
       To see only installed or only uninstalled packages, choose the
@@ -260,6 +260,10 @@
       filter from the <menuchoice><guimenu>Filters</guimenu><guisubmenu>Graphical</guisubmenu></menuchoice>
       menu.
     </para>
+    <note><para>
+      Note that PackageKit uses a heuristic to determine if a package is a 'graphical'
+      application and can get this wrong when a package has dependencies like gtk2+.
+    </para></note>
     <para>
       To see only packages that qualify as free software, choose the
       corresponding menuitem from the <menuchoice><guimenu>Filters</guimenu><guisubmenu>Free</guisubmenu></menuchoice>
@@ -275,7 +279,7 @@
       The search entry and <guibutton>Find</guibutton> button let you search
       for software packages. The icon inside the entry indicates what kind
       of search is performed. By clicking on it, you can select to search for
-      a string thats contained in package name, the package description, or
+      a string that is contained in package name, the package description, or
       search for the name of a file contained in the package.
     </para>
   </section>
@@ -384,7 +388,7 @@
      When PackageKit is installed, it starts the <command>gpk-update-icon</command>
      command when you log in. This application displays an icon in the
      notification area of your panel when software updates are available,
-     and is reponsible for showing notifications about PackageKit operations
+     and is responsible for showing notifications about PackageKit operations
      and events.
   </para>
   <para>

Modified: trunk/src/Makefile.am
==============================================================================
--- trunk/src/Makefile.am	(original)
+++ trunk/src/Makefile.am	Wed Apr  2 19:41:59 2008
@@ -258,6 +258,20 @@
 		--output=gpk-interface.h		\
 		$(srcdir)/gpk-interface.xml
 
+if PK_BUILD_GCOV
+clean-gcov:
+	rm -f *.gcov *.gcda
+gcov: clean-gcov all check
+	$(top_srcdir)/tools/create-coverage-report.sh packagekit $(filter %.c,$(packagekitd_SOURCES)) > gcov.txt
+endif
+
+if PK_BUILD_GPROF
+clean-gprof:
+	rm -f *.out
+gprof: clean-gprof all check
+	gprof ./gpk-self-test > gprof.txt
+endif
+
 EXTRA_DIST =						\
 	gpk-marshal.list				\
 	gpk-interface.xml				\
@@ -265,6 +279,11 @@
 
 clean-local:
 	rm -f *~
+	rm -f *.out
+	rm -f *.gcda
+	rm -f *.gcno
+	rm -f gcov.txt
+	rm -f gprof.txt
 	rm -f gpk-marshal.c gpk-marshal.h
 
 MAINTAINERCLEANFILES =					\

Modified: trunk/src/gpk-application.c
==============================================================================
--- trunk/src/gpk-application.c	(original)
+++ trunk/src/gpk-application.c	Wed Apr  2 19:41:59 2008
@@ -145,7 +145,6 @@
 	GtkWidget *dialog;
 	gchar *escaped_details = NULL;
 
-	g_return_if_fail (application != NULL);
 	g_return_if_fail (PK_IS_APPLICATION (application));
 
 	pk_warning ("error %s:%s", title, details);
@@ -173,7 +172,6 @@
 	gboolean ret;
 	GError *error = NULL;
 
-	g_return_val_if_fail (application != NULL, FALSE);
 	g_return_val_if_fail (PK_IS_APPLICATION (application), FALSE);
 	g_return_val_if_fail (package_id != NULL, FALSE);
 
@@ -206,7 +204,6 @@
 {
 	GtkWidget *widget;
 
-	g_return_if_fail (application != NULL);
 	g_return_if_fail (PK_IS_APPLICATION (application));
 
 	/* hide and show the right things */
@@ -224,7 +221,6 @@
 gpk_application_homepage_cb (GtkWidget      *widget,
 		            GpkApplication  *application)
 {
-	g_return_if_fail (application != NULL);
 	g_return_if_fail (PK_IS_APPLICATION (application));
 	gpk_execute_url (application->priv->url);
 }
@@ -239,7 +235,6 @@
 	GError *error = NULL;
 	GtkWidget *widget;
 
-	g_return_val_if_fail (application != NULL, FALSE);
 	g_return_val_if_fail (PK_IS_APPLICATION (application), FALSE);
 
 	pk_debug ("remove %s", application->priv->package);
@@ -275,7 +270,6 @@
 static void
 gpk_application_requires_dialog_cb (GtkDialog *dialog, gint id, GpkApplication *application)
 {
-	g_return_if_fail (application != NULL);
 	g_return_if_fail (PK_IS_APPLICATION (application));
 
 	if (id == -9) {
@@ -304,7 +298,6 @@
 	GtkWidget *dialog;
 	guint i;
 
-	g_return_if_fail (application != NULL);
 	g_return_if_fail (PK_IS_APPLICATION (application));
 
 	/* see how many packages there are */
@@ -360,7 +353,6 @@
 	PkClient *client;
 	GError *error = NULL;
 
-	g_return_if_fail (application != NULL);
 	g_return_if_fail (PK_IS_APPLICATION (application));
 
 	/* are we dumb and can't check for requires? */
@@ -415,7 +407,6 @@
 	GtkWidget *widget;
 	gchar *text;
 
-	g_return_if_fail (application != NULL);
 	g_return_if_fail (PK_IS_APPLICATION (application));
 
 	pk_debug ("description = %s:%i:%s:%s", package_id, group, detail, url);
@@ -463,7 +454,6 @@
 {
 	GtkWidget *widget;
 
-	g_return_if_fail (application != NULL);
 	g_return_if_fail (PK_IS_APPLICATION (application));
 
 	widget = glade_xml_get_widget (application->priv->glade_xml, "vbox_description_pane");
@@ -501,7 +491,6 @@
 	gboolean valid = FALSE;
 	gchar *text;
 
-	g_return_if_fail (application != NULL);
 	g_return_if_fail (PK_IS_APPLICATION (application));
 
 	pk_debug ("package = %s:%s:%s", pk_info_enum_to_text (info), package_id, summary);
@@ -547,7 +536,6 @@
 static void
 gpk_application_error_code_cb (PkClient *client, PkErrorCodeEnum code, const gchar *details, GpkApplication *application)
 {
-	g_return_if_fail (application != NULL);
 	g_return_if_fail (PK_IS_APPLICATION (application));
 
 	/* obvious message, don't tell the user */
@@ -630,7 +618,6 @@
 	PkRoleEnum role;
 	gchar *text;
 
-	g_return_if_fail (application != NULL);
 	g_return_if_fail (PK_IS_APPLICATION (application));
 
 	/* get role */
@@ -690,7 +677,6 @@
 gpk_application_progress_changed_cb (PkClient *client, guint percentage, guint subpercentage,
 				    guint elapsed, guint remaining, GpkApplication *application)
 {
-	g_return_if_fail (application != NULL);
 	g_return_if_fail (PK_IS_APPLICATION (application));
 
 	gpk_statusbar_set_percentage (application->priv->statusbar, percentage);
@@ -706,7 +692,6 @@
 	GtkWidget *widget;
 	gboolean ret;
 
-	g_return_if_fail (application != NULL);
 	g_return_if_fail (PK_IS_APPLICATION (application));
 
 	ret = pk_client_cancel (application->priv->client_search, NULL);
@@ -809,7 +794,6 @@
 static void
 gpk_application_find_cb (GtkWidget *button_widget, GpkApplication *application)
 {
-	g_return_if_fail (application != NULL);
 	g_return_if_fail (PK_IS_APPLICATION (application));
 
 	gpk_application_perform_search (application);
@@ -825,7 +809,6 @@
 	gboolean ret;
 	GError *error = NULL;
 
-	g_return_val_if_fail (application != NULL, FALSE);
 	g_return_val_if_fail (PK_IS_APPLICATION (application), FALSE);
 
 	/* we might have visual stuff running, close them down */
@@ -862,7 +845,6 @@
 				GdkEvent	*event,
 				GpkApplication	*application)
 {
-	g_return_val_if_fail (application != NULL, FALSE);
 	g_return_val_if_fail (PK_IS_APPLICATION (application), FALSE);
 
 	gpk_application_quit (application);
@@ -877,7 +859,6 @@
 	const gchar *package;
 	GtkTreeSelection *selection;
 
-	g_return_val_if_fail (application != NULL, FALSE);
 	g_return_val_if_fail (PK_IS_APPLICATION (application), FALSE);
 
 	widget = glade_xml_get_widget (application->priv->glade_xml, "entry_text");
@@ -903,7 +884,7 @@
 }
 
 static void
-pk_packages_add_columns (GtkTreeView *treeview)
+gpk_application_packages_add_columns (GtkTreeView *treeview)
 {
 	GtkCellRenderer *renderer;
 	GtkTreeViewColumn *column;
@@ -925,7 +906,7 @@
 }
 
 static void
-pk_groups_add_columns (GtkTreeView *treeview)
+gpk_application_groups_add_columns (GtkTreeView *treeview)
 {
 	GtkCellRenderer *renderer;
 	GtkTreeViewColumn *column;
@@ -947,11 +928,10 @@
 }
 
 /**
- * pk_groups_treeview_clicked_cb:
+ * gpk_application_groups_treeview_clicked_cb:
  **/
 static void
-pk_groups_treeview_clicked_cb (GtkTreeSelection *selection,
-			       GpkApplication *application)
+gpk_application_groups_treeview_clicked_cb (GtkTreeSelection *selection, GpkApplication *application)
 {
 	GtkTreeModel *model;
 	GtkTreeIter iter;
@@ -961,7 +941,6 @@
 	gchar *id;
 	GError *error = NULL;
 
-	g_return_if_fail (application != NULL);
 	g_return_if_fail (PK_IS_APPLICATION (application));
 
 	/* hide the details */
@@ -1012,10 +991,10 @@
 }
 
 /**
- * pk_notebook_populate:
+ * gpk_application_notebook_populate:
  **/
 static gboolean
-pk_notebook_populate (GpkApplication *application, gint page)
+gpk_application_notebook_populate (GpkApplication *application, gint page)
 {
 	gboolean ret;
 	GtkWidget *widget;
@@ -1023,7 +1002,6 @@
 	gint potential;
 	GError *error = NULL;
 
-	g_return_val_if_fail (application != NULL, FALSE);
 	g_return_val_if_fail (PK_IS_APPLICATION (application), FALSE);
 
 	/* are we just removing tabs? */
@@ -1160,17 +1138,16 @@
 gpk_application_notebook_changed_cb (GtkWidget *widget, gboolean arg1,
 				    gint page, GpkApplication *application)
 {
-	g_return_if_fail (application != NULL);
 	g_return_if_fail (PK_IS_APPLICATION (application));
 
-	pk_notebook_populate (application, page);
+	gpk_application_notebook_populate (application, page);
 }
 
 /**
- * pk_packages_treeview_clicked_cb:
+ * gpk_application_packages_treeview_clicked_cb:
  **/
 static void
-pk_packages_treeview_clicked_cb (GtkTreeSelection *selection,
+gpk_application_packages_treeview_clicked_cb (GtkTreeSelection *selection,
 				 GpkApplication *application)
 {
 	GtkWidget *widget;
@@ -1180,7 +1157,6 @@
 	gchar *package_id;
 	guint page;
 
-	g_return_if_fail (application != NULL);
 	g_return_if_fail (PK_IS_APPLICATION (application));
 
 	/* This will only work in single or browse selection mode! */
@@ -1211,7 +1187,7 @@
 		/* refresh */
 		widget = glade_xml_get_widget (application->priv->glade_xml, "notebook_description");
 		page = gtk_notebook_get_current_page (GTK_NOTEBOOK (widget));
-		pk_notebook_populate (application, page);
+		gpk_application_notebook_populate (application, page);
 
 	} else {
 		pk_debug ("no row selected");
@@ -1225,22 +1201,21 @@
 }
 
 /**
- * pk_connection_changed_cb:
+ * gpk_application_connection_changed_cb:
  **/
 static void
-pk_connection_changed_cb (PkConnection *pconnection, gboolean connected, GpkApplication *application)
+gpk_application_connection_changed_cb (PkConnection *pconnection, gboolean connected, GpkApplication *application)
 {
-	g_return_if_fail (application != NULL);
 	g_return_if_fail (PK_IS_APPLICATION (application));
 
 	pk_debug ("connected=%i", connected);
 }
 
 /**
- * pk_group_add_data:
+ * gpk_application_group_add_data:
  **/
 static void
-pk_group_add_data (GpkApplication *application, PkGroupEnum group)
+gpk_application_group_add_data (GpkApplication *application, PkGroupEnum group)
 {
 	GtkTreeIter iter;
 	const gchar *icon_name;
@@ -1370,7 +1345,6 @@
 	GtkWidget *image;
 	GpkApplication *application = GPK_APPLICATION (data);
 
-	g_return_if_fail (application != NULL);
 	g_return_if_fail (PK_IS_APPLICATION (application));
 
 	/* only respond to left button */
@@ -1580,7 +1554,6 @@
 	gboolean ret;
 	GError *error = NULL;
 
-	g_return_if_fail (application != NULL);
 	g_return_if_fail (PK_IS_APPLICATION (application));
 
 	/* can we cancel what we are doing? */
@@ -1609,7 +1582,6 @@
 {
 	gboolean ret;
 
-	g_return_if_fail (application != NULL);
 	g_return_if_fail (PK_IS_APPLICATION (application));
 
 	ret = g_spawn_command_line_async ("gpk-repo", NULL);
@@ -1624,7 +1596,6 @@
 static void
 gpk_application_menu_quit_cb (GtkAction *action, GpkApplication *application)
 {
-	g_return_if_fail (application != NULL);
 	g_return_if_fail (PK_IS_APPLICATION (application));
 
 	gpk_application_quit (application);
@@ -1639,7 +1610,6 @@
 {
 	const gchar *name;
 
-	g_return_if_fail (application != NULL);
 	g_return_if_fail (PK_IS_APPLICATION (application));
 
 	name = gtk_widget_get_name (widget);
@@ -1674,7 +1644,6 @@
 {
 	const gchar *name;
 
-	g_return_if_fail (application != NULL);
 	g_return_if_fail (PK_IS_APPLICATION (application));
 
 	name = gtk_widget_get_name (widget);
@@ -1709,7 +1678,6 @@
 {
 	const gchar *name;
 
-	g_return_if_fail (application != NULL);
 	g_return_if_fail (PK_IS_APPLICATION (application));
 
 	name = gtk_widget_get_name (widget);
@@ -1744,7 +1712,6 @@
 {
 	const gchar *name;
 
-	g_return_if_fail (application != NULL);
 	g_return_if_fail (PK_IS_APPLICATION (application));
 
 	name = gtk_widget_get_name (widget);
@@ -1780,7 +1747,6 @@
 	gboolean enabled;
 	gchar *filter;
 
-	g_return_if_fail (application != NULL);
 	g_return_if_fail (PK_IS_APPLICATION (application));
 
 	/* save users preference to gconf */
@@ -1813,7 +1779,6 @@
 	gboolean enabled;
 	gchar *filter;
 
-	g_return_if_fail (application != NULL);
 	g_return_if_fail (PK_IS_APPLICATION (application));
 
 	/* save users preference to gconf */
@@ -1842,7 +1807,6 @@
 static void
 gpk_application_status_changed_cb (PkClient *client, PkStatusEnum status, GpkApplication *application)
 {
-	g_return_if_fail (application != NULL);
 	g_return_if_fail (PK_IS_APPLICATION (application));
 	gpk_statusbar_set_status (application->priv->statusbar, status);
 }
@@ -1855,7 +1819,6 @@
 {
 	GtkWidget *widget;
 
-	g_return_if_fail (application != NULL);
 	g_return_if_fail (PK_IS_APPLICATION (application));
 
 	widget = glade_xml_get_widget (application->priv->glade_xml, "button_cancel");
@@ -1877,7 +1840,6 @@
 	gboolean installed;
 	gboolean ret;
 
-	g_return_if_fail (application != NULL);
 	g_return_if_fail (PK_IS_APPLICATION (application));
 
 	/* get selection */
@@ -2011,7 +1973,7 @@
 
 	application->priv->pconnection = pk_connection_new ();
 	g_signal_connect (application->priv->pconnection, "connection-changed",
-			  G_CALLBACK (pk_connection_changed_cb), application);
+			  G_CALLBACK (gpk_application_connection_changed_cb), application);
 
 	/* single instance, so this is valid */
 	application->priv->extra = pk_extra_new ();
@@ -2362,10 +2324,10 @@
 
 	selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (widget));
 	g_signal_connect (selection, "changed",
-			  G_CALLBACK (pk_packages_treeview_clicked_cb), application);
+			  G_CALLBACK (gpk_application_packages_treeview_clicked_cb), application);
 
 	/* add columns to the tree view */
-	pk_packages_add_columns (GTK_TREE_VIEW (widget));
+	gpk_application_packages_add_columns (GTK_TREE_VIEW (widget));
 
 	/* create group tree view if we can search by group */
 	if (pk_enum_list_contains (application->priv->role_list, PK_ROLE_ENUM_SEARCH_GROUP)) {
@@ -2375,17 +2337,17 @@
 
 		selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (widget));
 		g_signal_connect (selection, "changed",
-				  G_CALLBACK (pk_groups_treeview_clicked_cb), application);
+				  G_CALLBACK (gpk_application_groups_treeview_clicked_cb), application);
 
 		/* add columns to the tree view */
-		pk_groups_add_columns (GTK_TREE_VIEW (widget));
+		gpk_application_groups_add_columns (GTK_TREE_VIEW (widget));
 
 		/* add all the groups supported */
 		length = pk_enum_list_size (application->priv->group_list);
 		for (i=0; i<length; i++) {
 			group = pk_enum_list_get_item (application->priv->group_list, i);
 			if (group != PK_GROUP_ENUM_UNKNOWN) {
-				pk_group_add_data (application, group);
+				gpk_application_group_add_data (application, group);
 			}
 		}
 	}
@@ -2399,7 +2361,6 @@
 gpk_application_finalize (GObject *object)
 {
 	GpkApplication *application;
-	g_return_if_fail (object != NULL);
 	g_return_if_fail (PK_IS_APPLICATION (object));
 
 	application = GPK_APPLICATION (object);

Modified: trunk/src/gpk-application.h
==============================================================================
--- trunk/src/gpk-application.h	(original)
+++ trunk/src/gpk-application.h	Wed Apr  2 19:41:59 2008
@@ -48,7 +48,7 @@
 	void		(* action_close)		(GpkApplication	*application);
 } GpkApplicationClass;
 
-GType		 gpk_application_get_type		(void);
+GType		 gpk_application_get_type		(void) G_GNUC_CONST;
 GpkApplication	*gpk_application_new			(void);
 
 G_END_DECLS

Modified: trunk/src/gpk-auto-refresh.c
==============================================================================
--- trunk/src/gpk-auto-refresh.c	(original)
+++ trunk/src/gpk-auto-refresh.c	Wed Apr  2 19:41:59 2008
@@ -112,7 +112,6 @@
 static gboolean
 gpk_auto_refresh_signal_refresh_cache (GpkAutoRefresh *arefresh)
 {
-	g_return_val_if_fail (arefresh != NULL, FALSE);
 	g_return_val_if_fail (PK_IS_AUTO_REFRESH (arefresh), FALSE);
 
 	pk_debug ("emitting refresh-cache");
@@ -126,7 +125,6 @@
 static gboolean
 gpk_auto_refresh_signal_get_updates (GpkAutoRefresh *arefresh)
 {
-	g_return_val_if_fail (arefresh != NULL, FALSE);
 	g_return_val_if_fail (PK_IS_AUTO_REFRESH (arefresh), FALSE);
 
 	pk_debug ("emitting get-updates");
@@ -171,7 +169,6 @@
 	const gchar *freq_text;
 	PkFreqEnum freq;
 
-	g_return_val_if_fail (arefresh != NULL, 0);
 	g_return_val_if_fail (PK_IS_AUTO_REFRESH (arefresh), 0);
 
 	/* get from gconf */
@@ -196,7 +193,6 @@
 	guint thresh;
 	gboolean ret;
 
-	g_return_val_if_fail (arefresh != NULL, FALSE);
 	g_return_val_if_fail (PK_IS_AUTO_REFRESH (arefresh), FALSE);
 
 	/* not on battery */
@@ -241,7 +237,6 @@
 	guint thresh;
 	gboolean ret;
 
-	g_return_val_if_fail (arefresh != NULL, FALSE);
 	g_return_val_if_fail (PK_IS_AUTO_REFRESH (arefresh), FALSE);
 
 	/* get the time since the last refresh */
@@ -270,7 +265,6 @@
 static gboolean
 gpk_auto_refresh_change_state (GpkAutoRefresh *arefresh)
 {
-	g_return_val_if_fail (arefresh != NULL, FALSE);
 	g_return_val_if_fail (PK_IS_AUTO_REFRESH (arefresh), FALSE);
 
 	/* we shouldn't do this early in the session startup */
@@ -305,7 +299,6 @@
 static void
 gpk_auto_refresh_idle_cb (DBusGProxy *proxy, gboolean is_idle, GpkAutoRefresh *arefresh)
 {
-	g_return_if_fail (arefresh != NULL);
 	g_return_if_fail (PK_IS_AUTO_REFRESH (arefresh));
 
 	pk_debug ("setting is_idle %i", is_idle);
@@ -319,7 +312,6 @@
 static void
 gpk_auto_refresh_on_battery_cb (DBusGProxy *proxy, gboolean on_battery, GpkAutoRefresh *arefresh)
 {
-	g_return_if_fail (arefresh != NULL);
 	g_return_if_fail (PK_IS_AUTO_REFRESH (arefresh));
 
 	pk_debug ("setting on_battery %i", on_battery);
@@ -333,7 +325,6 @@
 gboolean
 gpk_auto_refresh_get_on_battery (GpkAutoRefresh *arefresh)
 {
-	g_return_val_if_fail (arefresh != NULL, FALSE);
 	g_return_val_if_fail (PK_IS_AUTO_REFRESH (arefresh), FALSE);
 	return arefresh->priv->on_battery;
 }
@@ -344,7 +335,6 @@
 static void
 gpk_auto_refresh_network_changed_cb (PkNetwork *network, gboolean online, GpkAutoRefresh *arefresh)
 {
-	g_return_if_fail (arefresh != NULL);
 	g_return_if_fail (PK_IS_AUTO_REFRESH (arefresh));
 
 	pk_debug ("setting online %i", online);
@@ -360,7 +350,6 @@
 {
 	GpkAutoRefresh *arefresh = GPK_AUTO_REFRESH (user_data);
 
-	g_return_val_if_fail (arefresh != NULL, FALSE);
 	g_return_val_if_fail (PK_IS_AUTO_REFRESH (arefresh), FALSE);
 
 	/* triggered once an hour */
@@ -378,7 +367,6 @@
 {
 	GpkAutoRefresh *arefresh = GPK_AUTO_REFRESH (user_data);
 
-	g_return_val_if_fail (arefresh != NULL, FALSE);
 	g_return_val_if_fail (PK_IS_AUTO_REFRESH (arefresh), FALSE);
 
 	/* we have waited enough */
@@ -404,7 +392,6 @@
 	gboolean on_battery;
 	gboolean ret;
 
-	g_return_if_fail (arefresh != NULL);
 	g_return_if_fail (PK_IS_AUTO_REFRESH (arefresh));
 
 	pk_debug ("gnome-power-manager connection-changed: %i", connected);
@@ -456,7 +443,6 @@
 {
 	GError *error = NULL;
 
-	g_return_if_fail (arefresh != NULL);
 	g_return_if_fail (PK_IS_AUTO_REFRESH (arefresh));
 
 	pk_debug ("gnome-screensaver connection-changed: %i", connected);
@@ -559,7 +545,6 @@
 {
 	GpkAutoRefresh *arefresh;
 
-	g_return_if_fail (object != NULL);
 	g_return_if_fail (PK_IS_AUTO_REFRESH (object));
 
 	arefresh = GPK_AUTO_REFRESH (object);

Modified: trunk/src/gpk-auto-refresh.h
==============================================================================
--- trunk/src/gpk-auto-refresh.h	(original)
+++ trunk/src/gpk-auto-refresh.h	Wed Apr  2 19:41:59 2008
@@ -48,7 +48,7 @@
 	GObjectClass	parent_class;
 } GpkAutoRefreshClass;
 
-GType		 gpk_auto_refresh_get_type		(void);
+GType		 gpk_auto_refresh_get_type		(void) G_GNUC_CONST;
 GpkAutoRefresh	*gpk_auto_refresh_new			(void);
 gboolean	 gpk_auto_refresh_get_on_battery	(GpkAutoRefresh *arefresh);
 

Modified: trunk/src/gpk-cell-renderer-uri.h
==============================================================================
--- trunk/src/gpk-cell-renderer-uri.h	(original)
+++ trunk/src/gpk-cell-renderer-uri.h	Wed Apr  2 19:41:59 2008
@@ -51,7 +51,7 @@
 				 const gchar		*uri);
 };
 
-GType		 gpk_cell_renderer_uri_get_type		(void);
+GType		 gpk_cell_renderer_uri_get_type		(void) G_GNUC_CONST;
 GtkCellRenderer	*gpk_cell_renderer_uri_new		(void);
 
 G_END_DECLS

Modified: trunk/src/gpk-common.c
==============================================================================
--- trunk/src/gpk-common.c	(original)
+++ trunk/src/gpk-common.c	Wed Apr  2 19:41:59 2008
@@ -500,7 +500,7 @@
 gpk_icon_valid (const gchar *icon)
 {
 	GtkIconInfo *icon_info;
-	GtkIconTheme *icon_theme;
+	static GtkIconTheme *icon_theme = NULL;
 	gboolean ret = TRUE;
 
 	/* trivial case */
@@ -508,8 +508,10 @@
 		return FALSE;
 	}
 
-	/* no unref */
-	icon_theme = gtk_icon_theme_get_default ();
+	/* no unref required */
+	if (icon_theme == NULL) {
+		icon_theme = gtk_icon_theme_get_default ();
+	}
 
 	/* default to 32x32 */
 	icon_info = gtk_icon_theme_lookup_icon (icon_theme, icon, 32, GTK_ICON_LOOKUP_USE_BUILTIN);

Modified: trunk/src/gpk-common.h
==============================================================================
--- trunk/src/gpk-common.h	(original)
+++ trunk/src/gpk-common.h	Wed Apr  2 19:41:59 2008
@@ -70,25 +70,35 @@
 gboolean	 gpk_execute_url			(const gchar	*url);
 gboolean	 gpk_show_help				(const gchar	*link_id);
 gboolean	 gpk_restart_system			(void);
-const gchar	*gpk_role_enum_to_localised_past	(PkRoleEnum	 role);
-const gchar	*gpk_role_enum_to_localised_present	(PkRoleEnum	 role);
+const gchar	*gpk_role_enum_to_localised_past	(PkRoleEnum	 role)
+							 G_GNUC_CONST;
+const gchar	*gpk_role_enum_to_localised_present	(PkRoleEnum	 role)
+							 G_GNUC_CONST;
 const gchar	*gpk_role_enum_to_icon_name		(PkRoleEnum	 role);
-const gchar	*gpk_info_enum_to_localised_text	(PkInfoEnum	 info);
+const gchar	*gpk_info_enum_to_localised_text	(PkInfoEnum	 info)
+							 G_GNUC_CONST;
 const gchar	*gpk_info_enum_to_icon_name		(PkInfoEnum	 info);
-const gchar	*gpk_status_enum_to_localised_text	(PkStatusEnum	 status);
+const gchar	*gpk_status_enum_to_localised_text	(PkStatusEnum	 status)
+							 G_GNUC_CONST;
 const gchar	*gpk_status_enum_to_icon_name		(PkStatusEnum	 status);
 const gchar	*gpk_restart_enum_to_icon_name		(PkRestartEnum	 restart);
-const gchar	*gpk_error_enum_to_localised_text	(PkErrorCodeEnum code);
+const gchar	*gpk_error_enum_to_localised_text	(PkErrorCodeEnum code)
+							 G_GNUC_CONST;
 const gchar	*gpk_error_enum_to_localised_message	(PkErrorCodeEnum code);
-const gchar	*gpk_restart_enum_to_localised_text	(PkRestartEnum	 restart);
+const gchar	*gpk_restart_enum_to_localised_text	(PkRestartEnum	 restart)
+							 G_GNUC_CONST;
 const gchar	*gpk_message_enum_to_icon_name		(PkMessageEnum	 message);
-const gchar	*gpk_message_enum_to_localised_text	(PkMessageEnum	 message);
-const gchar	*gpk_restart_enum_to_localised_text_future(PkRestartEnum	 restart);
-const gchar	*gpk_group_enum_to_localised_text	(PkGroupEnum	 group);
+const gchar	*gpk_message_enum_to_localised_text	(PkMessageEnum	 message)
+							 G_GNUC_CONST;
+const gchar	*gpk_restart_enum_to_localised_text_future(PkRestartEnum	 restart)
+							 G_GNUC_CONST;
+const gchar	*gpk_group_enum_to_localised_text	(PkGroupEnum	 group)
+							 G_GNUC_CONST;
 const gchar	*gpk_group_enum_to_icon_name		(PkGroupEnum	 group);
 gchar		*gpk_size_to_si_size_text		(guint64	 size);
 gchar		*gpk_update_enum_to_localised_text	(PkInfoEnum	 info,
-							 guint		 number);
+							 guint		 number)
+							 G_GNUC_CONST;
 gchar		*gpk_time_to_localised_string		(guint		 time_secs);
 
 G_END_DECLS

Modified: trunk/src/gpk-inhibit.c
==============================================================================
--- trunk/src/gpk-inhibit.c	(original)
+++ trunk/src/gpk-inhibit.c	Wed Apr  2 19:41:59 2008
@@ -76,7 +76,6 @@
 	gboolean ret;
 	GError *error = NULL;
 
-	g_return_val_if_fail (inhibit != NULL, FALSE);
 	g_return_val_if_fail (PK_IS_INHIBIT (inhibit), FALSE);
 
 	if (inhibit->priv->proxy_gpm == NULL) {
@@ -113,7 +112,6 @@
 	gboolean ret;
 	GError *error = NULL;
 
-	g_return_val_if_fail (inhibit != NULL, FALSE);
 	g_return_val_if_fail (PK_IS_INHIBIT (inhibit), FALSE);
 
 	if (inhibit->priv->proxy_gpm == NULL) {
@@ -179,7 +177,6 @@
 {
 	GpkInhibit *inhibit;
 
-	g_return_if_fail (object != NULL);
 	g_return_if_fail (PK_IS_INHIBIT (object));
 
 	inhibit = GPK_INHIBIT (object);

Modified: trunk/src/gpk-inhibit.h
==============================================================================
--- trunk/src/gpk-inhibit.h	(original)
+++ trunk/src/gpk-inhibit.h	Wed Apr  2 19:41:59 2008
@@ -48,8 +48,8 @@
 	GObjectClass	parent_class;
 } GpkInhibitClass;
 
-GType		 gpk_inhibit_get_type			(void);
-GpkInhibit	*gpk_inhibit_new				(void);
+GType		 gpk_inhibit_get_type			(void) G_GNUC_CONST;
+GpkInhibit	*gpk_inhibit_new			(void);
 gboolean	 gpk_inhibit_create			(GpkInhibit	*inhibit);
 gboolean	 gpk_inhibit_remove			(GpkInhibit	*inhibit);
 

Modified: trunk/src/gpk-install-file.c
==============================================================================
--- trunk/src/gpk-install-file.c	(original)
+++ trunk/src/gpk-install-file.c	Wed Apr  2 19:41:59 2008
@@ -75,10 +75,8 @@
 }
 
 static void
-gpk_install_file_finished_cb (PkClient   *client,
-			     PkExitEnum  exit,
-			     guint       runtime,
-			     gpointer    data)
+gpk_install_file_finished_cb (PkClient *client, PkExitEnum exit,
+			      guint runtime, gpointer data)
 {
 	if (exit == PK_EXIT_ENUM_SUCCESS) {
                 gpk_install_file_set_page (PAGE_CONFIRM);
@@ -92,11 +90,11 @@
 
 static void
 gpk_install_file_progress_changed_cb (PkClient *client,
-				     guint     percentage,
-				     guint     subpercentage,
-				     guint     elapsed,
-				     guint     remaining,
-				     gpointer  data)
+				      guint     percentage,
+				      guint     subpercentage,
+				      guint     elapsed,
+				      guint     remaining,
+				      gpointer  data)
 {
         GtkWidget *widget;
 
@@ -173,6 +171,7 @@
         widget = glade_xml_get_widget (glade_xml, "label_error_details");
         details_safe = g_markup_escape_text (details, -1);
         gtk_label_set_label (GTK_LABEL (widget), details_safe);
+	g_free (details_safe);
 }
 
 static gboolean
@@ -204,6 +203,7 @@
 	GError *error;
 	GtkWidget *main_window;
 	GtkWidget *widget;
+	char *text;
 
 	const GOptionEntry options[] = {
 		{ "verbose", 'v', 0, G_OPTION_ARG_NONE, &verbose,
@@ -296,9 +296,12 @@
 					       _("You don't have the necessary privileges to install local packages"));
 		}
 		else {
+			text = g_markup_escape_text (error->message, -1);
 			gpk_error_modal_dialog (_("Failed to install"),
-					       error->message);
+					        text);
+			g_free (text);
 		}
+		g_error_free (error);
 	} else {
 		gtk_main ();
 	}

Modified: trunk/src/gpk-notify.c
==============================================================================
--- trunk/src/gpk-notify.c	(original)
+++ trunk/src/gpk-notify.c	Wed Apr  2 19:41:59 2008
@@ -94,7 +94,6 @@
 static void
 gpk_notify_show_help_cb (GtkMenuItem *item, GpkNotify *notify)
 {
-	g_return_if_fail (notify != NULL);
 	g_return_if_fail (GPK_IS_NOTIFY (notify));
 	gpk_show_help ("update-icon");
 }
@@ -300,7 +299,6 @@
 	const gchar *message;
 	gboolean value;
 
-	g_return_if_fail (notify != NULL);
 	g_return_if_fail (GPK_IS_NOTIFY (notify));
 
 	/* we failed, show the icon */
@@ -392,7 +390,6 @@
 	GError *error = NULL;
 	gchar *message;
 
-	g_return_val_if_fail (notify != NULL, FALSE);
 	g_return_val_if_fail (GPK_IS_NOTIFY (notify), FALSE);
 
 	pk_debug ("install updates");
@@ -425,7 +422,6 @@
 gpk_notify_menuitem_update_system_cb (GtkMenuItem *item, gpointer data)
 {
 	GpkNotify *notify = GPK_NOTIFY (data);
-	g_return_if_fail (notify != NULL);
 	g_return_if_fail (GPK_IS_NOTIFY (notify));
 	gpk_notify_update_system (notify);
 }
@@ -487,7 +483,6 @@
 static void
 pk_connection_changed_cb (PkConnection *pconnection, gboolean connected, GpkNotify *notify)
 {
-	g_return_if_fail (notify != NULL);
 	g_return_if_fail (GPK_IS_NOTIFY (notify));
 	pk_debug ("connected=%i", connected);
 }
@@ -503,7 +498,6 @@
 	gboolean value;
 	GString *string;
 
-	g_return_if_fail (notify != NULL);
 	g_return_if_fail (GPK_IS_NOTIFY (notify));
 
         /* are we accepting notifications */
@@ -542,7 +536,6 @@
 {
 	gboolean value;
 
-	g_return_if_fail (notify != NULL);
 	g_return_if_fail (GPK_IS_NOTIFY (notify));
 
 	/* are we accepting notifications */
@@ -572,7 +565,6 @@
 	PkEnumList *elist;
 	PkPackageItem *item;
 
-	g_return_val_if_fail (notify != NULL, NULL);
 	g_return_val_if_fail (GPK_IS_NOTIFY (notify), NULL);
 
 	/* shortcut */
@@ -607,7 +599,6 @@
 	PkEnumList *elist;
 	const gchar *icon;
 
-	g_return_val_if_fail (notify != NULL, NULL);
 	g_return_val_if_fail (GPK_IS_NOTIFY (notify), NULL);
 
 	/* get an enumerated list with all the update types */
@@ -643,7 +634,6 @@
 	gboolean conf_update_battery;
 	gboolean value;
 
-	g_return_val_if_fail (notify != NULL, FALSE);
 	g_return_val_if_fail (GPK_IS_NOTIFY (notify), FALSE);
 
 	on_battery = gpk_auto_refresh_get_on_battery (notify->priv->arefresh);
@@ -675,7 +665,6 @@
 	PkUpdateEnum update;
 	gchar *updates;
 
-	g_return_val_if_fail (notify != NULL, FALSE);
 	g_return_val_if_fail (GPK_IS_NOTIFY (notify), FALSE);
 
 	updates = gconf_client_get_string (notify->priv->gconf_client, GPK_CONF_AUTO_UPDATE, NULL);
@@ -704,7 +693,6 @@
 	PkPackageId *ident;
 	GPtrArray *security_array;
 
-	g_return_if_fail (notify != NULL);
 	g_return_if_fail (GPK_IS_NOTIFY (notify));
 
 	status_security = g_string_new ("");
@@ -842,7 +830,6 @@
 	const gchar *title;
 	gboolean value;
 
-	g_return_if_fail (notify != NULL);
 	g_return_if_fail (GPK_IS_NOTIFY (notify));
 
 	title = gpk_error_enum_to_localised_text (error_code);
@@ -877,7 +864,6 @@
 	GError *error = NULL;
 	PkClient *client;
 
-	g_return_val_if_fail (notify != NULL, FALSE);
 	g_return_val_if_fail (GPK_IS_NOTIFY (notify), FALSE);
 
 	if (pk_task_list_contains_role (notify->priv->tlist, PK_ROLE_ENUM_UPDATE_SYSTEM)) {
@@ -907,7 +893,6 @@
 static void
 gpk_notify_refresh_cache_finished_cb (PkClient *client, PkExitEnum exit_code, guint runtime, GpkNotify *notify)
 {
-	g_return_if_fail (notify != NULL);
 	g_return_if_fail (GPK_IS_NOTIFY (notify));
 
 	pk_debug ("finished refreshing cache :%s", pk_exit_enum_to_text (exit_code));
@@ -936,7 +921,6 @@
 	PkClient *client;
 	pk_debug ("refresh cache");
 
-	g_return_val_if_fail (notify != NULL, FALSE);
 	g_return_val_if_fail (GPK_IS_NOTIFY (notify), FALSE);
 
 	/* got a cache, no need to poll */
@@ -971,7 +955,6 @@
 static void
 gpk_notify_updates_changed_cb (PkClient *client, GpkNotify *notify)
 {
-	g_return_if_fail (notify != NULL);
 	g_return_if_fail (GPK_IS_NOTIFY (notify));
 
 	/* now try to get newest update list */
@@ -989,7 +972,6 @@
 	GError *error = NULL;
 	const gchar *file;
 
-	g_return_if_fail (notify != NULL);
 	g_return_if_fail (GPK_IS_NOTIFY (notify));
 
 	/* wait for the daemon to quit */
@@ -1010,7 +992,6 @@
 static void
 gpk_notify_task_list_changed_cb (PkTaskList *tlist, GpkNotify *notify)
 {
-	g_return_if_fail (notify != NULL);
 	g_return_if_fail (GPK_IS_NOTIFY (notify));
 	/* hide icon if we are updating */
 	if (pk_task_list_contains_role (tlist, PK_ROLE_ENUM_UPDATE_SYSTEM)) {
@@ -1024,7 +1005,6 @@
 static void
 gpk_notify_auto_refresh_cache_cb (GpkAutoRefresh *arefresh, GpkNotify *notify)
 {
-	g_return_if_fail (notify != NULL);
 	g_return_if_fail (GPK_IS_NOTIFY (notify));
 
 	/* schedule another update */
@@ -1037,7 +1017,6 @@
 static void
 gpk_notify_auto_get_updates_cb (GpkAutoRefresh *arefresh, GpkNotify *notify)
 {
-	g_return_if_fail (notify != NULL);
 	g_return_if_fail (GPK_IS_NOTIFY (notify));
 
 	/* show the icon at login time
@@ -1055,7 +1034,6 @@
 {
 	gboolean ret;
 
-	g_return_if_fail (notify != NULL);
 	g_return_if_fail (GPK_IS_NOTIFY (notify));
 
 	pk_debug ("got: %i with data %s", button, data);
@@ -1161,7 +1139,6 @@
 {
 	GpkNotify *notify;
 
-	g_return_if_fail (object != NULL);
 	g_return_if_fail (GPK_IS_NOTIFY (object));
 
 	notify = GPK_NOTIFY (object);

Modified: trunk/src/gpk-notify.h
==============================================================================
--- trunk/src/gpk-notify.h	(original)
+++ trunk/src/gpk-notify.h	Wed Apr  2 19:41:59 2008
@@ -48,7 +48,7 @@
 	GObjectClass	parent_class;
 } GpkNotifyClass;
 
-GType		 gpk_notify_get_type		  	(void);
+GType		 gpk_notify_get_type		  	(void) G_GNUC_CONST;
 GpkNotify	*gpk_notify_new				(void);
 
 G_END_DECLS

Modified: trunk/src/gpk-progress.c
==============================================================================
--- trunk/src/gpk-progress.c	(original)
+++ trunk/src/gpk-progress.c	Wed Apr  2 19:41:59 2008
@@ -513,6 +513,8 @@
 	guint elapsed;
 	guint remaining;
 
+	g_return_val_if_fail (PK_IS_PROGRESS (progress), FALSE);
+
 	pk_client_set_tid (progress->priv->client, tid, NULL);
 
 	/* fill in role */
@@ -649,7 +651,6 @@
 	GpkProgress *progress;
 	GtkWidget *widget;
 
-	g_return_if_fail (object != NULL);
 	g_return_if_fail (PK_IS_PROGRESS (object));
 
 	progress = GPK_PROGRESS (object);

Modified: trunk/src/gpk-progress.h
==============================================================================
--- trunk/src/gpk-progress.h	(original)
+++ trunk/src/gpk-progress.h	Wed Apr  2 19:41:59 2008
@@ -46,7 +46,7 @@
 	GObjectClass	parent_class;
 } GpkProgressClass;
 
-GType		 gpk_progress_get_type			(void);
+GType		 gpk_progress_get_type			(void) G_GNUC_CONST;
 GpkProgress	*gpk_progress_new			(void);
 gboolean	 gpk_progress_monitor_tid		(GpkProgress	*progress,
 							 const gchar	*tid);

Modified: trunk/src/gpk-smart-icon.c
==============================================================================
--- trunk/src/gpk-smart-icon.c	(original)
+++ trunk/src/gpk-smart-icon.c	Wed Apr  2 19:41:59 2008
@@ -134,7 +134,6 @@
 gboolean
 gpk_smart_icon_set_icon_name (GpkSmartIcon *sicon, const gchar *icon_name)
 {
-	g_return_val_if_fail (sicon != NULL, FALSE);
 	g_return_val_if_fail (PK_IS_SMART_ICON (sicon), FALSE);
 
 	/* if we have a request pending, then cancel it in preference to this one */
@@ -158,7 +157,6 @@
 gboolean
 gpk_smart_icon_sync (GpkSmartIcon *sicon)
 {
-	g_return_val_if_fail (sicon != NULL, FALSE);
 	g_return_val_if_fail (PK_IS_SMART_ICON (sicon), FALSE);
 
 	/* if we have a request pending, then cancel it in preference to this one */
@@ -183,7 +181,6 @@
 GtkStatusIcon *
 gpk_smart_icon_get_status_icon (GpkSmartIcon *sicon)
 {
-	g_return_val_if_fail (sicon != NULL, NULL);
 	g_return_val_if_fail (PK_IS_SMART_ICON (sicon), NULL);
 	return sicon->priv->status_icon;
 }
@@ -194,7 +191,6 @@
 gboolean
 gpk_smart_icon_set_tooltip (GpkSmartIcon *sicon, const gchar *tooltip)
 {
-	g_return_val_if_fail (sicon != NULL, FALSE);
 	g_return_val_if_fail (PK_IS_SMART_ICON (sicon), FALSE);
 	gtk_status_icon_set_tooltip (GTK_STATUS_ICON (sicon->priv->status_icon), tooltip);
 	return TRUE;
@@ -209,7 +205,6 @@
 {
 	guint timeout_val = 0;
 
-	g_return_val_if_fail (sicon != NULL, FALSE);
 	g_return_val_if_fail (PK_IS_SMART_ICON (sicon), FALSE);
 
 	/* default values */
@@ -237,7 +232,6 @@
 {
 	GpkNotifyButton button;
 
-	g_return_if_fail (sicon != NULL);
 	g_return_if_fail (PK_IS_SMART_ICON (sicon));
 
 	/* get the value */
@@ -257,7 +251,6 @@
 	const gchar *text = NULL;
 	const gchar *id = NULL;
 
-	g_return_val_if_fail (sicon != NULL, FALSE);
 	g_return_val_if_fail (PK_IS_SMART_ICON (sicon), FALSE);
 
 	/* get the id */
@@ -292,7 +285,6 @@
 {
 	GError *error = NULL;
 
-	g_return_val_if_fail (sicon != NULL, FALSE);
 	g_return_val_if_fail (PK_IS_SMART_ICON (sicon), FALSE);
 	g_return_val_if_fail (sicon->priv->dialog != NULL, FALSE);
 
@@ -312,7 +304,6 @@
 gboolean
 gpk_smart_icon_notify_close (GpkSmartIcon *sicon)
 {
-	g_return_val_if_fail (sicon != NULL, FALSE);
 	g_return_val_if_fail (PK_IS_SMART_ICON (sicon), FALSE);
 	notify_notification_close (sicon->priv->dialog, NULL);
 	return TRUE;
@@ -348,7 +339,6 @@
 {
 	GpkSmartIcon *sicon;
 
-	g_return_if_fail (object != NULL);
 	g_return_if_fail (PK_IS_SMART_ICON (object));
 
 	sicon = PK_SMART_ICON (object);

Modified: trunk/src/gpk-smart-icon.h
==============================================================================
--- trunk/src/gpk-smart-icon.h	(original)
+++ trunk/src/gpk-smart-icon.h	Wed Apr  2 19:41:59 2008
@@ -72,7 +72,7 @@
 	GPK_NOTIFY_BUTTON_UNKNOWN
 } GpkNotifyButton;
 
-GType		 gpk_smart_icon_get_type		(void);
+GType		 gpk_smart_icon_get_type		(void) G_GNUC_CONST;
 GpkSmartIcon	*gpk_smart_icon_new			(void);
 GtkStatusIcon	*gpk_smart_icon_get_status_icon		(GpkSmartIcon	*sicon);
 gboolean	 gpk_smart_icon_sync			(GpkSmartIcon	*sicon);

Modified: trunk/src/gpk-statusbar.c
==============================================================================
--- trunk/src/gpk-statusbar.c	(original)
+++ trunk/src/gpk-statusbar.c	Wed Apr  2 19:41:59 2008
@@ -78,7 +78,6 @@
 	GtkWidget *hbox;
 	GtkWidget *icon_container;
 
-	g_return_val_if_fail (sbar != NULL, FALSE);
 	g_return_val_if_fail (PK_IS_STATUSBAR (sbar), FALSE);
 	g_return_val_if_fail (sbar->priv->statusbar == NULL, FALSE);
 
@@ -126,7 +125,6 @@
 gboolean
 gpk_statusbar_set_percentage (GpkStatusbar *sbar, guint percentage)
 {
-	g_return_val_if_fail (sbar != NULL, FALSE);
 	g_return_val_if_fail (PK_IS_STATUSBAR (sbar), FALSE);
 	g_return_val_if_fail (sbar->priv->statusbar != NULL, FALSE);
 
@@ -169,7 +167,6 @@
 {
 	const gchar *text;
 
-	g_return_val_if_fail (sbar != NULL, FALSE);
 	g_return_val_if_fail (PK_IS_STATUSBAR (sbar), FALSE);
 	g_return_val_if_fail (sbar->priv->statusbar != NULL, FALSE);
 
@@ -189,7 +186,6 @@
 	gchar *time;
 	gchar *text;
 
-	g_return_val_if_fail (sbar != NULL, FALSE);
 	g_return_val_if_fail (PK_IS_STATUSBAR (sbar), FALSE);
 	g_return_val_if_fail (sbar->priv->statusbar != NULL, FALSE);
 
@@ -224,7 +220,6 @@
 gboolean
 gpk_statusbar_hide (GpkStatusbar *sbar)
 {
-	g_return_val_if_fail (sbar != NULL, FALSE);
 	g_return_val_if_fail (PK_IS_STATUSBAR (sbar), FALSE);
 	g_return_val_if_fail (sbar->priv->statusbar != NULL, FALSE);
 
@@ -263,7 +258,6 @@
 {
 	GpkStatusbar *sbar;
 
-	g_return_if_fail (object != NULL);
 	g_return_if_fail (PK_IS_STATUSBAR (object));
 
 	sbar = GPK_STATUSBAR (object);

Modified: trunk/src/gpk-statusbar.h
==============================================================================
--- trunk/src/gpk-statusbar.h	(original)
+++ trunk/src/gpk-statusbar.h	Wed Apr  2 19:41:59 2008
@@ -49,7 +49,7 @@
 	GObjectClass	parent_class;
 } GpkStatusbarClass;
 
-GType		 gpk_statusbar_get_type			(void);
+GType		 gpk_statusbar_get_type			(void) G_GNUC_CONST;
 GpkStatusbar	*gpk_statusbar_new			(void);
 gboolean	 gpk_statusbar_set_widget		(GpkStatusbar	*arefresh,
 							 GtkWidget	*widget);

Modified: trunk/src/gpk-update-viewer.c
==============================================================================
--- trunk/src/gpk-update-viewer.c	(original)
+++ trunk/src/gpk-update-viewer.c	Wed Apr  2 19:41:59 2008
@@ -205,6 +205,7 @@
 	gchar **package_ids;
 	gboolean ret;
 	GError *error = NULL;
+	gchar *text;
 
 	pk_debug ("Doing the package updates");
 	array = g_ptr_array_new ();
@@ -252,25 +253,39 @@
 
 	/* set correct view */
 	pk_updates_set_page (PAGE_PROGRESS);
-	package_ids = pk_package_ids_from_array (array);
 
 	/* reset */
 	ret = pk_client_reset (client_action, &error);
 	if (!ret) {
 		pk_warning ("failed to reset client: %s", error->message);
 		g_error_free (error);
-		return;
+		goto out;
+	}
+
+	/* update all of them */
+	if (selected_all) {
+		ret = pk_client_update_system (client_action, &error);
+		if (!ret) {
+			text = g_markup_escape_text (error->message, -1);
+			gpk_error_modal_dialog (_("Updating all packages failed"), text);
+			g_free (text);
+			g_error_free (error);
+		}
+		goto out;
 	}
 
 	/* update a list */
+	package_ids = pk_package_ids_from_array (array);
 	ret = pk_client_update_packages_strv (client_action, package_ids, &error);
 	if (!ret) {
-		gpk_error_modal_dialog ("Individual updates failed", error->message);
+		text = g_markup_escape_text (error->message, -1);
+		gpk_error_modal_dialog (_("Updating individual packages failed"), text);
+		g_free (text);
 		g_error_free (error);
 	}
 	g_strfreev (package_ids);
 
-	/* get rid of the array, and free the contents */
+out:
 	g_ptr_array_free (array, TRUE);
 }
 
@@ -490,6 +505,7 @@
 	gboolean ret;
 	GError *error = NULL;
 	GtkWidget *widget;
+	gchar *text;
 
 	/* we can't click this if we havn't finished */
 	ret = pk_client_reset (client_action, &error);
@@ -500,7 +516,9 @@
 	}
 	ret = pk_client_refresh_cache (client_action, TRUE, &error);
 	if (ret == FALSE) {
-		gpk_error_modal_dialog (_("Failed to refresh"), error->message);
+		text = g_markup_escape_text (error->message, -1);
+		gpk_error_modal_dialog (_("Failed to refresh"), text);
+		g_free (text);
 		g_error_free (error);
 		return;
 	}
@@ -523,11 +541,13 @@
 pk_updates_history_cb (GtkWidget *widget, gpointer data)
 {
 	GError *error = NULL;
+	gchar *text;
 
 	/* FIXME: do this in process */
 	if (!g_spawn_command_line_async ("gpk-log", &error)) {
-		gpk_error_modal_dialog (_("Failed to launch gpk-log"),
-				       error->message);
+		text = g_markup_escape_text (error->message, -1);
+		gpk_error_modal_dialog (_("Failed to launch gpk-log"), text);
+		g_free (text);
 		g_error_free (error);			
 	}
 }
@@ -1510,6 +1530,7 @@
 	widget = glade_xml_get_widget (glade_xml, "label_error_details");
 	details_safe = g_markup_escape_text (details, -1);
 	gtk_label_set_label (GTK_LABEL (widget), details_safe);
+	g_free (details_safe);
 }
 
 /**

Modified: trunk/src/gpk-watch.c
==============================================================================
--- trunk/src/gpk-watch.c	(original)
+++ trunk/src/gpk-watch.c	Wed Apr  2 19:41:59 2008
@@ -100,7 +100,6 @@
 	gchar *text;
 	const gchar *localised_status;
 
-	g_return_val_if_fail (watch != NULL, FALSE);
 	g_return_val_if_fail (GPK_IS_WATCH (watch), FALSE);
 
 	length = pk_task_list_get_size (watch->priv->tlist);
@@ -157,7 +156,6 @@
 	PkEnumList *elist;
 	PkTaskListItem *item;
 
-	g_return_val_if_fail (watch != NULL, NULL);
 	g_return_val_if_fail (GPK_IS_WATCH (watch), NULL);
 
 	/* shortcut */
@@ -193,7 +191,6 @@
 	PkEnumList *elist;
 	gint value;
 
-	g_return_val_if_fail (watch != NULL, FALSE);
 	g_return_val_if_fail (GPK_IS_WATCH (watch), FALSE);
 
 	pk_debug ("rescan");
@@ -242,7 +239,6 @@
 static void
 gpk_watch_task_list_changed_cb (PkTaskList *tlist, GpkWatch *watch)
 {
-	g_return_if_fail (watch != NULL);
 	g_return_if_fail (GPK_IS_WATCH (watch));
 
 	if (pk_task_list_contains_role (tlist, PK_ROLE_ENUM_REFRESH_CACHE) ||
@@ -273,7 +269,6 @@
 	const gchar *restart_message;
 	const gchar *icon_name;
 
-	g_return_if_fail (watch != NULL);
 	g_return_if_fail (GPK_IS_WATCH (watch));
 
 	/* get the role */
@@ -366,7 +361,6 @@
 	gboolean is_active;
 	gboolean value;
 
-	g_return_if_fail (watch != NULL);
 	g_return_if_fail (GPK_IS_WATCH (watch));
 
 	title = gpk_error_enum_to_localised_text (error_code);
@@ -417,7 +411,6 @@
 	gchar *escaped_details;
 	gboolean value;
 
-	g_return_if_fail (watch != NULL);
 	g_return_if_fail (GPK_IS_WATCH (watch));
 
         /* are we accepting notifications */
@@ -563,7 +556,6 @@
 	GtkWidget *item;
 	GtkWidget *image;
 
-	g_return_if_fail (watch != NULL);
 	g_return_if_fail (GPK_IS_WATCH (watch));
 	pk_debug ("icon right clicked");
 
@@ -591,7 +583,6 @@
 static void
 gpk_watch_refresh_cache_finished_cb (PkClient *client, PkExitEnum exit_code, guint runtime, GpkWatch *watch)
 {
-	g_return_if_fail (watch != NULL);
 	g_return_if_fail (GPK_IS_WATCH (watch));
 	pk_debug ("unreffing client %p", client);
 	g_object_unref (client);
@@ -618,7 +609,6 @@
 	GError *error = NULL;
 	gchar *message;
 
-	g_return_if_fail (watch != NULL);
 	g_return_if_fail (GPK_IS_WATCH (watch));
 
 	pk_debug ("refresh cache");
@@ -645,7 +635,6 @@
 static void
 pk_monitor_action_unref_cb (GpkProgress *progress, GpkWatch *watch)
 {
-	g_return_if_fail (watch != NULL);
 	g_return_if_fail (GPK_IS_WATCH (watch));
 
 	g_object_unref (progress);
@@ -660,7 +649,6 @@
 	gchar *tid;
 	GpkProgress *progress = NULL;
 
-	g_return_if_fail (watch != NULL);
 	g_return_if_fail (GPK_IS_WATCH (watch));
 
 	/* find the job we should bind to */
@@ -690,7 +678,6 @@
 	gchar *text;
 	guint length;
 
-	g_return_if_fail (watch != NULL);
 	g_return_if_fail (GPK_IS_WATCH (watch));
 
 	length = pk_task_list_get_size (watch->priv->tlist);
@@ -746,7 +733,6 @@
 	GtkWidget *widget;
 	GtkWidget *image;
 
-	g_return_if_fail (watch != NULL);
 	g_return_if_fail (GPK_IS_WATCH (watch));
 
 	pk_debug ("icon left clicked");
@@ -785,7 +771,6 @@
 {
 	GpkWatch *watch = GPK_WATCH (data);
 
-	g_return_if_fail (watch != NULL);
 	g_return_if_fail (GPK_IS_WATCH (watch));
 
 	/* just hide it */
@@ -805,7 +790,6 @@
 	GtkWidget *widget;
 	GtkWidget *image;
 
-	g_return_if_fail (watch != NULL);
 	g_return_if_fail (GPK_IS_WATCH (watch));
 
 	pk_debug ("icon left clicked");
@@ -835,7 +819,6 @@
 static void
 pk_connection_changed_cb (PkConnection *pconnection, gboolean connected, GpkWatch *watch)
 {
-	g_return_if_fail (watch != NULL);
 	g_return_if_fail (GPK_IS_WATCH (watch));
 	pk_debug ("connected=%i", connected);
 	if (connected) {
@@ -852,7 +835,6 @@
 static void
 gpk_watch_locked_cb (PkClient *client, gboolean is_locked, GpkWatch *watch)
 {
-	g_return_if_fail (watch != NULL);
 	g_return_if_fail (GPK_IS_WATCH (watch));
 
 	pk_debug ("setting locked %i, doing g-p-m (un)inhibit", is_locked);
@@ -947,7 +929,6 @@
 {
 	GpkWatch *watch;
 
-	g_return_if_fail (object != NULL);
 	g_return_if_fail (GPK_IS_WATCH (object));
 
 	watch = GPK_WATCH (object);

Modified: trunk/src/gpk-watch.h
==============================================================================
--- trunk/src/gpk-watch.h	(original)
+++ trunk/src/gpk-watch.h	Wed Apr  2 19:41:59 2008
@@ -48,7 +48,7 @@
 	GObjectClass	parent_class;
 } GpkWatchClass;
 
-GType		 gpk_watch_get_type		  	(void);
+GType		 gpk_watch_get_type		  	(void) G_GNUC_CONST;
 GpkWatch	*gpk_watch_new				(void);
 
 G_END_DECLS



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]