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

From: subversion at stage.maemo.org subversion at stage.maemo.org
Date: Wed Jun 27 11:24:38 EEST 2007
Author: lucasr
Date: 2007-06-27 11:24:27 +0300 (Wed, 27 Jun 2007)
New Revision: 12498

Modified:
   projects/haf/trunk/hildon-desktop/ChangeLog
   projects/haf/trunk/hildon-desktop/libhildonwm/hd-wm.c
Log:
2007-06-27  Lucas Rocha  <lucas.rocha at nokia.com>

	* libhildonwm/hd-wm.c (hd_wm_init): read the standard applications 
	directory and the hildon-specific application directory (if available) 
	in order to keep backwards compatibility.


Modified: projects/haf/trunk/hildon-desktop/ChangeLog
===================================================================
--- projects/haf/trunk/hildon-desktop/ChangeLog	2007-06-27 08:13:45 UTC (rev 12497)
+++ projects/haf/trunk/hildon-desktop/ChangeLog	2007-06-27 08:24:27 UTC (rev 12498)
@@ -1,3 +1,9 @@
+2007-06-27  Lucas Rocha  <lucas.rocha at nokia.com>
+
+	* libhildonwm/hd-wm.c (hd_wm_init): read the standard applications 
+	directory and the hildon-specific application directory (if available) 
+	in order to keep backwards compatibility.
+
 2007-06-26  Johan Bilien  <johan.bilien at nokia.com>
 
 	* src/hd-home-window.c:

Modified: projects/haf/trunk/hildon-desktop/libhildonwm/hd-wm.c
===================================================================
--- projects/haf/trunk/hildon-desktop/libhildonwm/hd-wm.c	2007-06-27 08:13:45 UTC (rev 12497)
+++ projects/haf/trunk/hildon-desktop/libhildonwm/hd-wm.c	2007-06-27 08:24:27 UTC (rev 12498)
@@ -2871,7 +2871,7 @@
 
   while ((entry = readdir(directory)) != NULL)
   {
-    gchar        *path;
+    gchar *path;
 
     if (!g_str_has_suffix(entry->d_name, DESKTOP_SUFFIX))
 	continue;
@@ -2894,6 +2894,35 @@
 
   closedir (directory);
 
+  /* Read hildon specific directory for backwards compatibility */
+  if ((directory = opendir(DESKTOPENTRYDIR "/hildon")) != NULL)
+  {
+    while ((entry = readdir(directory)) != NULL)
+    {
+      gchar *path;
+
+      if (!g_str_has_suffix(entry->d_name, DESKTOP_SUFFIX))
+          continue;
+
+      path = g_build_filename (DESKTOPENTRYDIR "/hildon", entry->d_name, NULL);
+
+      g_debug ("Attempting to open desktop file [%s] ...", path);
+
+      app = hd_wm_application_new (path);
+
+      if (app)
+      {
+        g_hash_table_insert (applications,
+                             g_strdup(hd_wm_application_get_class_name (app)),
+                             (gpointer)app);
+      }
+
+      g_free (path);
+    }
+
+    closedir (directory);
+  }
+
   return applications;
 }
 


More information about the maemo-commits mailing list