Index: glib/glibmm/containerhandle_shared.h
===================================================================
--- glib/glibmm/containerhandle_shared.h	(Revision 381)
+++ glib/glibmm/containerhandle_shared.h	(Arbeitskopie)
@@ -314,40 +314,22 @@ struct TypeTraits<std::string>
     { g_free(const_cast<CTypeNonConst>(str)); }
 };
 
-/** Specialization for bool
+/** Specialization for bool.
  * @ingroup ContHelpers
  */
 template <>
 struct TypeTraits<bool>
 {
-  typedef bool          CppType;
-  typedef gboolean*     CType;
-  typedef gboolean*     CTypeNonConst;
-
-  static CType to_c_type (CppType val) { return (int*)GINT_TO_POINTER(val); }
-  static CType to_c_type (CType ptr)   { return ptr;                        }  
-
-  static CppType to_cpp_type(CType ptr)
-  { 
-    if(ptr)
-    {
-	  //We use this for gboolean too, because it is actually an int.
-	  return GPOINTER_TO_INT(ptr);
-	}
-	else
-	  return CppType();
-  }
-
-  static void release_c_type(CType /* ptr */)
-  {
-
-  }
+  typedef bool     CppType;
+  typedef gboolean CType;
+  typedef gboolean CTypeNonConst;
+
+  static CType   to_c_type      (CppType item) { return static_cast<CType>(item); }
+  static CType   to_c_type      (CType   item) { return item; }
+  static CppType to_cpp_type    (CType   item) { return (item != 0); }
+  static void    release_c_type (CType) {}
 };
 
-#endif /* DOXYGEN_SHOULD_SKIP_THIS */
-
-
-#ifndef DOXYGEN_SHOULD_SKIP_THIS
 #ifndef GLIBMM_HAVE_TEMPLATE_SEQUENCE_CTORS
 
 /* The STL containers in Sun's libCstd don't support templated sequence
@@ -368,6 +350,4 @@ void fill_container(Cont& container, In 
 
 } // namespace Glib
 
-
 #endif /* _GLIBMM_CONTAINERHANDLE_SHARED_H */
-
Index: glib/src/keyfile.ccg
===================================================================
--- glib/src/keyfile.ccg	(Revision 381)
+++ glib/src/keyfile.ccg	(Arbeitskopie)
@@ -35,167 +35,244 @@ KeyFile::KeyFile(GKeyFile* castitem, boo
 KeyFile::~KeyFile()
 {
   if (owns_gobject_)
-  	g_key_file_free(gobject_);
+    g_key_file_free(gobject_);
 }
 
 bool KeyFile::load_from_data(const Glib::ustring& data, KeyFileFlags flags)
 {
-  GError *error = 0;
-  bool retvalue = g_key_file_load_from_data(gobj(), data.c_str(), data.bytes(), ((GKeyFileFlags)(flags)), &(error));
-  if(error) :: Glib::Error::throw_exception(error);
-  return retvalue;
+  GError* error = 0;
+
+  const gboolean result = g_key_file_load_from_data(
+      gobj(), data.c_str(), data.bytes(),
+      static_cast<GKeyFileFlags>(unsigned(flags)),
+      &error);
+
+  if(error)
+    Glib::Error::throw_exception(error);
+
+  return (result != 0);
 }
 
-bool KeyFile::load_from_data_dirs(const std::string& file, std::string& full_path, KeyFileFlags flags)
-{
-  GError *error = 0;
-  char *full_path_c;
-  bool retvalue = g_key_file_load_from_data_dirs(gobj(), file.c_str(), &full_path_c, ((GKeyFileFlags)(flags)), &(error));
-  full_path = Glib::convert_return_gchar_ptr_to_ustring(full_path_c);
-  if(error) :: Glib::Error::throw_exception(error);
-  return retvalue;
+bool KeyFile::load_from_data_dirs(const std::string& file, std::string& full_path,
+                                  KeyFileFlags flags)
+{
+  GError* error = 0;
+  char* full_path_c = 0;
+
+  const gboolean result = g_key_file_load_from_data_dirs(
+      gobj(), file.c_str(), &full_path_c,
+      static_cast<GKeyFileFlags>(unsigned(flags)),
+      &error);
+
+  if(error)
+    Glib::Error::throw_exception(error);
+
+  if(full_path_c)
+    full_path = Glib::ScopedPtr<char>(full_path_c).get();
+  else
+    full_path.erase();
+
+  return (result != 0);
 }
 
 Glib::ustring KeyFile::to_data()
 {
-  GError *error = 0;
-  gsize size;
-  Glib::ustring retvalue = Glib::convert_return_gchar_ptr_to_ustring(g_key_file_to_data(gobj(), &size, &error));
-  if(error) :: Glib::Error::throw_exception(error);
-  return retvalue;
+  GError* error = 0;
+  char *const str = g_key_file_to_data(gobj(), 0, &error);
+
+  if(error)
+    Glib::Error::throw_exception(error);
+
+  return Glib::convert_return_gchar_ptr_to_ustring(str);
 }
 
 Glib::ArrayHandle<Glib::ustring> KeyFile::get_groups() const
 {
-  gchar** group_names      = 0;
-  gsize   number_of_groups = 0;
-  group_names = g_key_file_get_groups(const_cast<GKeyFile*>(gobj()), &number_of_groups);
-  return Glib::ArrayHandle<Glib::ustring>(group_names, number_of_groups, Glib::OWNERSHIP_DEEP);
+  gsize length = 0;
+  char** const array = g_key_file_get_groups(const_cast<GKeyFile*>(gobj()), &length);
+
+  return Glib::ArrayHandle<Glib::ustring>(array, length, Glib::OWNERSHIP_DEEP);
 }
 
 Glib::ArrayHandle<Glib::ustring> KeyFile::get_keys(const Glib::ustring& group_name) const
 {
-  gchar** key_names      = 0;
-  gsize   number_of_keys = 0;
-  GError* error          = 0;
-  key_names = g_key_file_get_keys(const_cast<GKeyFile*>(gobj()), group_name.c_str(), &number_of_keys, &error);
+  gsize length  = 0;
+  GError* error = 0;
+
+  char** const array = g_key_file_get_keys(
+      const_cast<GKeyFile*>(gobj()),
+      (group_name.empty()) ? 0 : group_name.c_str(),
+      &length, &error);
+
   if(error)
     Glib::Error::throw_exception(error);
-  return Glib::ArrayHandle<Glib::ustring>(key_names, number_of_keys, Glib::OWNERSHIP_DEEP);
+
+  return Glib::ArrayHandle<Glib::ustring>(array, length, Glib::OWNERSHIP_DEEP);
 }
 
-Glib::ustring KeyFile::get_locale_string(const Glib::ustring& group_name, const Glib::ustring& key) const
+Glib::ustring KeyFile::get_locale_string(const Glib::ustring& group_name,
+                                         const Glib::ustring& key) const
 {
-  GError *error = 0;
-  Glib::ustring retvalue = Glib::convert_return_gchar_ptr_to_ustring(g_key_file_get_locale_string(const_cast<GKeyFile*>(gobj()), group_name.c_str(), key.c_str(), 0, &(error)));
-  if(error) ::Glib::Error::throw_exception(error);
-  return retvalue;
+  GError* error = 0;
+  char *const str = g_key_file_get_locale_string(
+      const_cast<GKeyFile*>(gobj()),
+      (group_name.empty()) ? 0 : group_name.c_str(),
+      key.c_str(), 0, &error);
+
+  if(error)
+    Glib::Error::throw_exception(error);
+
+  return Glib::convert_return_gchar_ptr_to_ustring(str);
 }
 
 int KeyFile::get_integer(const Glib::ustring& key) const
 {
-  GError *error = 0;
-  int retvalue = g_key_file_get_integer(const_cast<GKeyFile*>(gobj()), 0, key.c_str(), &(error));
-  if(error) ::Glib::Error::throw_exception(error);
-  return retvalue;
+  GError* error = 0;
+  const int value = g_key_file_get_integer(const_cast<GKeyFile*>(gobj()),
+                                           0, key.c_str(), &error);
+  if(error)
+    Glib::Error::throw_exception(error);
+
+  return value;
 }
 
-Glib::ArrayHandle<Glib::ustring> KeyFile::get_string_list(const Glib::ustring& group_name, const Glib::ustring& key) const
+Glib::ArrayHandle<Glib::ustring> KeyFile::get_string_list(const Glib::ustring& group_name,
+                                                          const Glib::ustring& key) const
 {
-  gchar** string_list  = 0;
-  gsize length_of_list = 0;
-  GError* error        = 0;
-  string_list = g_key_file_get_string_list(const_cast<GKeyFile*>(gobj()), group_name.c_str(), key.c_str(),  &length_of_list, &error);
+  gsize length  = 0;
+  GError* error = 0;
+
+  char** const array = g_key_file_get_string_list(
+      const_cast<GKeyFile*>(gobj()),
+      (group_name.empty()) ? 0 : group_name.c_str(),
+      key.c_str(), &length, &error);
+
   if(error)
     Glib::Error::throw_exception(error);
-  return Glib::ArrayHandle<Glib::ustring>(string_list, length_of_list, Glib::OWNERSHIP_DEEP);
+
+  return Glib::ArrayHandle<Glib::ustring>(array, length, Glib::OWNERSHIP_DEEP);
 }
 
-Glib::ArrayHandle<Glib::ustring> KeyFile::get_locale_string_list(const Glib::ustring& group_name, const Glib::ustring& key, const Glib::ustring& locale) const
+Glib::ArrayHandle<Glib::ustring> KeyFile::get_locale_string_list(const Glib::ustring& group_name,
+                                                                 const Glib::ustring& key,
+                                                                 const Glib::ustring& locale) const
 {
-  gchar** string_list  = 0;
-  gsize length_of_list = 0; 
-  GError* error        = 0;
-  string_list = g_key_file_get_locale_string_list(const_cast<GKeyFile*>(gobj()), group_name.c_str(), key.c_str(), locale.c_str(), &length_of_list, &error);
+  gsize length  = 0;
+  GError* error = 0;
+
+  char** const array = g_key_file_get_locale_string_list(
+      const_cast<GKeyFile*>(gobj()),
+      (group_name.empty()) ? 0 : group_name.c_str(),
+      key.c_str(), locale.c_str(), &length, &error);
+
   if(error)
     Glib::Error::throw_exception(error);
-  return Glib::ArrayHandle<Glib::ustring>(string_list, length_of_list, Glib::OWNERSHIP_DEEP);
+
+  return Glib::ArrayHandle<Glib::ustring>(array, length, Glib::OWNERSHIP_DEEP);
 }
 
-Glib::ArrayHandle<bool> KeyFile::get_boolean_list(const Glib::ustring& group_name, const Glib::ustring& key) const
+Glib::ArrayHandle<bool> KeyFile::get_boolean_list(const Glib::ustring& group_name,
+                                                  const Glib::ustring& key) const
 {
-  gboolean* bool_list  = 0;
-  gsize length_of_list = 0; 
-  GError* error        = 0;
-  bool_list = g_key_file_get_boolean_list(const_cast<GKeyFile*>(gobj()), group_name.c_str(), key.c_str(), &length_of_list, &error);
+  gsize length  = 0;
+  GError* error = 0;
+
+  gboolean *const array = g_key_file_get_boolean_list(
+      const_cast<GKeyFile*>(gobj()),
+      (group_name.empty()) ? 0 : group_name.c_str(),
+      key.c_str(), &length, &error);
+
   if(error)
     Glib::Error::throw_exception(error);
-  return Glib::ArrayHandle<bool>(&bool_list, length_of_list, Glib::OWNERSHIP_DEEP);
+
+  return Glib::ArrayHandle<bool>(array, length, Glib::OWNERSHIP_SHALLOW);
 }
 
-Glib::ArrayHandle<int> KeyFile::get_integer_list(const Glib::ustring& group_name, const Glib::ustring& key) const
+Glib::ArrayHandle<int> KeyFile::get_integer_list(const Glib::ustring& group_name,
+                                                 const Glib::ustring& key) const
 {
-  gint* integer_list   = 0;
-  gsize length_of_list = 0; 
-  GError* error        = 0;
-  integer_list = g_key_file_get_integer_list(const_cast<GKeyFile*>(gobj()), group_name.c_str(), key.c_str(), &length_of_list, &error);
+  gsize length  = 0;
+  GError* error = 0;
+
+  int *const array = g_key_file_get_integer_list(
+      const_cast<GKeyFile*>(gobj()),
+      (group_name.empty()) ? 0 : group_name.c_str(),
+      key.c_str(), &length, &error);
+
   if(error)
     Glib::Error::throw_exception(error);
-  return Glib::ArrayHandle<int>(integer_list, length_of_list, Glib::OWNERSHIP_DEEP);
+
+  return Glib::ArrayHandle<int>(array, length, Glib::OWNERSHIP_SHALLOW);
 }
 
-void KeyFile::set_string_list(const Glib::ustring& group_name, const Glib::ustring& key, const Glib::ArrayHandle<Glib::ustring>& list)
+void KeyFile::set_string_list(const Glib::ustring& group_name, const Glib::ustring& key,
+                              const Glib::ArrayHandle<Glib::ustring>& list)
 {
-  gsize length_of_list = list.size();
-  g_key_file_set_string_list(gobj(), group_name.c_str(), key.c_str(), list.data(), length_of_list);
+  g_key_file_set_string_list(gobj(), (group_name.empty()) ? 0 : group_name.c_str(),
+                             key.c_str(), list.data(), list.size());
 }
 
-void KeyFile::set_locale_string_list(const Glib::ustring& group_name, const Glib::ustring& key, const Glib::ustring& locale, const Glib::ArrayHandle<Glib::ustring>& list)
+void KeyFile::set_locale_string_list(const Glib::ustring& group_name,
+                                     const Glib::ustring& key, const Glib::ustring& locale,
+                                     const Glib::ArrayHandle<Glib::ustring>& list)
 {
-  gsize length_of_list = list.size();
-  g_key_file_set_locale_string_list(gobj(), group_name.c_str(), key.c_str(), locale.c_str(), list.data(), length_of_list);
+  g_key_file_set_locale_string_list(gobj(), (group_name.empty()) ? 0 : group_name.c_str(),
+                                    key.c_str(), locale.c_str(), list.data(), list.size());
 }
 
-void KeyFile::set_integer_list(const Glib::ustring& group_name, const Glib::ustring& key, Glib::ArrayHandle<int>& list)
+void KeyFile::set_integer_list(const Glib::ustring& group_name, const Glib::ustring& key,
+                               const Glib::ArrayHandle<int>& list)
 {
-  gsize length_of_list = list.size();
-  g_key_file_set_integer_list(gobj(), group_name.c_str(), key.c_str(), const_cast<int*>(list.data()), length_of_list);
+  g_key_file_set_integer_list(gobj(), (group_name.empty()) ? 0 : group_name.c_str(),
+                              key.c_str(), const_cast<int*>(list.data()), list.size());
 }
 
-void KeyFile::set_boolean_list(const Glib::ustring& group_name, const Glib::ustring& key, Glib::ArrayHandle<bool>& list)
+void KeyFile::set_boolean_list(const Glib::ustring& group_name, const Glib::ustring& key,
+                               const Glib::ArrayHandle<bool>& list)
 {
-  gsize length_of_list = list.size();
-  g_key_file_set_boolean_list(gobj(), group_name.c_str(), key.c_str(), *(list.data()), length_of_list);
+  g_key_file_set_boolean_list(gobj(), (group_name.empty()) ? 0 : group_name.c_str(),
+                              key.c_str(), const_cast<gboolean*>(list.data()), list.size());
 }
 
 Glib::ustring KeyFile::get_comment() const
 {
-  GError *error = 0;
-  Glib::ustring retvalue = Glib::convert_return_gchar_ptr_to_ustring(g_key_file_get_comment(const_cast<GKeyFile*>(gobj()), 0, 0, &(error)));
-  if(error) ::Glib::Error::throw_exception(error);
-  return retvalue;
+  GError* error = 0;
+  char *const str = g_key_file_get_comment(const_cast<GKeyFile*>(gobj()), 0, 0, &error);
+
+  if(error)
+    Glib::Error::throw_exception(error);
+
+  return Glib::convert_return_gchar_ptr_to_ustring(str);
 }
 
 Glib::ustring KeyFile::get_comment(const Glib::ustring& group_name) const
 {
-  GError *error = 0;
-  Glib::ustring retvalue = Glib::convert_return_gchar_ptr_to_ustring(g_key_file_get_comment(const_cast<GKeyFile*>(gobj()), group_name.c_str(), 0, &(error)));
-  if(error) ::Glib::Error::throw_exception(error);
-  return retvalue;
+  GError* error = 0;
+  char *const str = g_key_file_get_comment(const_cast<GKeyFile*>(gobj()),
+                                           (group_name.empty()) ? 0 : group_name.c_str(),
+                                           0, &error);
+  if(error)
+    Glib::Error::throw_exception(error);
+
+  return Glib::convert_return_gchar_ptr_to_ustring(str);
 }
 
 void KeyFile::set_comment(const Glib::ustring& comment)
 {
-  GError *error = 0;
-  g_key_file_set_comment(gobj(), 0, 0, comment.c_str(), &(error));
-  if(error) ::Glib::Error::throw_exception(error);
+  GError* error = 0;
+  g_key_file_set_comment(gobj(), 0, 0, comment.c_str(), &error);
+
+  if(error)
+    Glib::Error::throw_exception(error);
 }
 
 void KeyFile::set_comment(const Glib::ustring& group_name, const Glib::ustring& comment)
 {
-  GError *error = 0;
-  g_key_file_set_comment(gobj(), group_name.c_str(), 0, comment.c_str(), &(error));
-  if(error) ::Glib::Error::throw_exception(error);
+  GError* error = 0;
+  g_key_file_set_comment(gobj(), (group_name.empty()) ? 0 : group_name.c_str(),
+                         0, comment.c_str(), &error);
+  if(error)
+    Glib::Error::throw_exception(error);
 }
 
-}
+} // namespace Glib
Index: glib/src/keyfile.hg
===================================================================
--- glib/src/keyfile.hg	(Revision 381)
+++ glib/src/keyfile.hg	(Arbeitskopie)
@@ -227,16 +227,18 @@ public:
    * @param key The name of a key
    * @param list A list holding object of type bool
    */
-  void set_boolean_list(const Glib::ustring& group_name, const Glib::ustring& key, Glib::ArrayHandle<bool>& list);
+  void set_boolean_list(const Glib::ustring& group_name, const Glib::ustring& key,
+                        const Glib::ArrayHandle<bool>& list);
   _IGNORE(g_key_file_set_boolean_list)
-	
+
   /** Sets a list of integers for the @a key under @a group_name.
    * If either the @a key or @a group_name cannot be found they are created
    * @param group_name The name of a group
    * @param key The name of a key
    * @param list A list holding object of type int
    */
-  void set_integer_list(const Glib::ustring& group_name, const Glib::ustring& key, Glib::ArrayHandle<int>& list);
+  void set_integer_list(const Glib::ustring& group_name, const Glib::ustring& key,
+                        const Glib::ArrayHandle<int>& list);
   _IGNORE(g_key_file_set_integer_list)
 
   /** Places @a comment at the start of the file, before the first group.
@@ -275,4 +277,3 @@ private:
 };
 
 } // namespace Glib
-
