[maemo-commits] [maemo-commits] r14336 - in projects/haf/trunk/hildon-desktop: . libhildonwm src

From: subversion at stage.maemo.org subversion at stage.maemo.org
Date: Fri Oct 5 17:04:46 EEST 2007
Author: moimart
Date: 2007-10-05 17:04:44 +0300 (Fri, 05 Oct 2007)
New Revision: 14336

Modified:
   projects/haf/trunk/hildon-desktop/ChangeLog
   projects/haf/trunk/hildon-desktop/libhildonwm/hd-wm.c
   projects/haf/trunk/hildon-desktop/libhildonwm/hd-wm.h
   projects/haf/trunk/hildon-desktop/src/hn-app-switcher.c
Log:
2007-10-05  Moises Martinez  <moises.martinez at nokia.com>

        * libhildonwm/hd-wm.[ch]: (hd_wm_constructor), (hd_wm_init),
        (hd_wm_monitor_cb), (hd_wm_monitor_register):
        - Refresh list of applications when un/installing. Fixes: NB#72107
        * src/hn-app-switcher.c:
        (hn_app_switcher_close_application_dialog):
        - Use the proper hd_wm_entry_info
	* ChangeLog updated.



Modified: projects/haf/trunk/hildon-desktop/ChangeLog
===================================================================
--- projects/haf/trunk/hildon-desktop/ChangeLog	2007-10-05 13:40:41 UTC (rev 14335)
+++ projects/haf/trunk/hildon-desktop/ChangeLog	2007-10-05 14:04:44 UTC (rev 14336)
@@ -1,3 +1,12 @@
+2007-10-05  Moises Martinez  <moises.martinez at nokia.com>
+
+	* libhildonwm/hd-wm.[ch]: (hd_wm_constructor), (hd_wm_init),
+	(hd_wm_monitor_cb), (hd_wm_monitor_register):
+	- Refresh list of applications when un/installing. Fixes: NB#72107
+	* src/hn-app-switcher.c:
+	(hn_app_switcher_close_application_dialog):
+	- Use the proper hd_wm_entry_info
+
 2007-10-04  Lucas Rocha  <lucas.rocha at nokia.com>
 
 	* libhildondesktop/hildon-thumb-menu-item.c

Modified: projects/haf/trunk/hildon-desktop/libhildonwm/hd-wm.c
===================================================================
--- projects/haf/trunk/hildon-desktop/libhildonwm/hd-wm.c	2007-10-05 13:40:41 UTC (rev 14335)
+++ projects/haf/trunk/hildon-desktop/libhildonwm/hd-wm.c	2007-10-05 14:04:44 UTC (rev 14336)
@@ -154,6 +154,9 @@
 static gboolean
 hd_wm_relaunch_timeout (gpointer data);
 
+static void
+hd_wm_monitor_register (HDWM *hdwm);
+
 static void 
 hd_wm_register_object_path (HDWM *hdwm,
  			    DBusConnection *conn,
@@ -831,6 +834,8 @@
     dbus_connection_flush (connection);
   }
 
+  hd_wm_monitor_register (hdwm);
+
   if (!sys_connection)
   {
       hd_wm_debug ("Failed to connect to DBUS: %s!\n", sys_error.message );
@@ -1138,6 +1143,8 @@
   
   /* build our hash of watchable apps via .desktop key/values */
 
+  hdwm->priv->monitor_timeout_id = 0;
+  
   hdwm->priv->applications = NULL;
   
   hdwm->priv->watched_apps = hd_wm_applications_init ();
@@ -3154,30 +3161,25 @@
                   GnomeVFSMonitorEventType event_type,
                   gpointer user_data)
 {
-  HDWM *hdwm = hd_wm_get_singleton ();
-
+  HDWM *hdwm = HD_WM (user_data);
+  
   if (!hdwm->priv->monitor_timeout_id)
     {
       hdwm->priv->monitor_timeout_id =
-      g_timeout_add(1000,
-                    (GSourceFunc)hd_wm_monitor_process,
-                    NULL);
+      g_timeout_add (1000,
+                     (GSourceFunc)hd_wm_monitor_process,
+                     (gpointer) hdwm);
     }
 }
 
-/* Public function to register our monitor callback (called from
- * hildon-navigator-main.c)
- */
-void
-hd_wm_monitor_register ()
+static void
+hd_wm_monitor_register (HDWM *hdwm)
 {
-  HDWM *hdwm = hd_wm_get_singleton ();
-
   if (gnome_vfs_monitor_add (&hdwm->priv->monitor, 
                              DESKTOPENTRYDIR,
                              GNOME_VFS_MONITOR_DIRECTORY,
                              (GnomeVFSMonitorCallback) hd_wm_monitor_cb,
-                             NULL) != GNOME_VFS_OK)
+                             hdwm) != GNOME_VFS_OK)
   {
     g_warning("unable to register TN callback for %s", DESKTOPENTRYDIR);
   }

Modified: projects/haf/trunk/hildon-desktop/libhildonwm/hd-wm.h
===================================================================
--- projects/haf/trunk/hildon-desktop/libhildonwm/hd-wm.h	2007-10-05 13:40:41 UTC (rev 14335)
+++ projects/haf/trunk/hildon-desktop/libhildonwm/hd-wm.h	2007-10-05 14:04:44 UTC (rev 14336)
@@ -245,9 +245,6 @@
 hd_wm_compute_window_hibernation_key (Window xwin,
 				      HDWMApplication *app);
 
-void
-hd_wm_monitor_register (void);
-
 /* keyboard handling functions */
 
 void

Modified: projects/haf/trunk/hildon-desktop/src/hn-app-switcher.c
===================================================================
--- projects/haf/trunk/hildon-desktop/src/hn-app-switcher.c	2007-10-05 13:40:41 UTC (rev 14335)
+++ projects/haf/trunk/hildon-desktop/src/hn-app-switcher.c	2007-10-05 14:04:44 UTC (rev 14336)
@@ -1352,11 +1352,9 @@
   /* Collect open applications */
   for (l = items; l; l = l->next)
   {
-    const gchar *icon_name;
     GtkWidget *image;
     GtkWidget *label;
     GdkPixbuf *icon = NULL;
-    GtkIconTheme *icon_theme;
     HDWMApplication *app;
     HDWMCADItem *item = (HDWMCADItem *) l->data;
     
@@ -1369,24 +1367,9 @@
       continue;
       
     label = gtk_label_new (_(hd_wm_application_get_name (app)));
-    icon_name = hd_wm_application_get_icon_name(app);
-    icon_theme = gtk_icon_theme_get_default ();
+   
+    icon = hd_wm_entry_info_get_app_icon (HD_WM_ENTRY_INFO (app), ICON_SIZE, NULL);
     
-    if (icon_name)
-      icon = gtk_icon_theme_load_icon (icon_theme,
-                                       icon_name,
-                                       ICON_SIZE,
-                                       GTK_ICON_LOOKUP_NO_SVG,
-                                       NULL);
-
-    if (!icon)
-      icon = gtk_icon_theme_load_icon (icon_theme,
-                                       AS_MENU_DEFAULT_APP_ICON,
-                                       ICON_SIZE,
-                                       GTK_ICON_LOOKUP_NO_SVG,
-                                       NULL);
-      
-
     image = gtk_image_new_from_pixbuf (icon);
     if (icon)
       gdk_pixbuf_unref (icon);


More information about the maemo-commits mailing list