--- glib2.0-2.19.8.orig/glib/gutils.c	2009-02-27 18:01:58.000000000 +0100
+++ glib2.0-2.19.8.new/glib/gutils.c	2009-02-27 18:10:44.000000000 +0100
@@ -2471,6 +2471,38 @@
 
 #endif /* G_OS_UNIX && !HAVE_CARBON */
 
+
+/**
+ * g_set_user_special_dir:
+ * @directory: the logical id of special directory
+ * @new_path: the new full path to the special directory
+ *
+ * When a special directory path is changed (renamed or moved)
+ * you can call this function to update the glib cache.
+ * Warning: this introduces a small memory leak, since the old
+ * string is not freed. We cannot free it because some app might
+ * still use the pointer.
+ *
+ */
+void
+g_set_user_special_dir (GUserDirectory directory, const gchar* new_path)
+{
+  g_return_val_if_fail (directory >= G_USER_DIRECTORY_DESKTOP &&
+                        directory < G_USER_N_DIRECTORIES, NULL);
+
+  const gchar *old_path = g_get_user_special_dir(directory);
+
+  if (g_strcmp0(old_path, new_path) != 0)
+  {
+    G_LOCK (g_utils_global);
+    
+    /* small memory leak here */
+    g_user_special_dirs[directory] = g_strdup(new_path);
+
+    G_UNLOCK (g_utils_global);
+  }
+}
+
 /**
  * g_get_user_special_dir:
  * @directory: the logical id of special directory
@@ -2484,7 +2516,8 @@
  *
  * Depending on the platform, the user might be able to change the path
  * of the special directory without requiring the session to restart; GLib
- * will not reflect any change once the special directories are loaded.
+ * will not reflect any change once the special directories are loaded
+ * unless g_set_user_special_dir() is called.
  *
  * Return value: the path to the specified special directory, or %NULL
  *   if the logical id was not found. The returned string is owned by
