[gconfmm] Entry: Use gconf_entry_copy() instead of implementing our own.



commit 51fb6b5ee97900af5906a898b592686cad242116
Author: Murray Cumming <murrayc murrayc com>
Date:   Fri Jun 4 09:11:02 2010 +0200

    Entry: Use gconf_entry_copy() instead of implementing our own.
    
    * gconf/src/entry.[hg|ccg]: Update the code now (well, since 2003, but
        I just noticed) that gconf_entry_copy() is available.

 ChangeLog           |  143 +++++++++++++++++++++++++++------------------------
 gconf/src/entry.ccg |   21 +------
 gconf/src/entry.hg  |   16 +++---
 3 files changed, 86 insertions(+), 94 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 67c82af..6dd4766 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2010-06-04  Murray Cumming  <murrayc murrayc com>
+
+	Entry: Use gconf_entry_copy() instead of implementing our own.
+
+	* gconf/src/entry.[hg|ccg]: Update the code now (well, since 2003, but
+    I just noticed) that gconf_entry_copy() is available.
+
 2.28.1:
 
 2010-06-03  Murray Cumming  <murrayc murrayc com>
@@ -6,15 +13,15 @@
 
 	* gconf/gconfmm/callback.cc:
 	* gconf/src/changeset.ccg: Comment out unused method parameters.
-	* gconf/src/entry.hg: Use gconf_entry_unref() instead of gconf_entry_free(), 
-	which is deprecated, though one just calls the other, and neither are really 
+	* gconf/src/entry.hg: Use gconf_entry_unref() instead of gconf_entry_free(),
+	which is deprecated, though one just calls the other, and neither are really
 	documented. It's still not a registered boxed type.
 
 2010-06-03  Murray Cumming  <murrayc murrayc com>
 
 	Build the documentation.
 
-	* docs/Makefile.am: Make this like the other mm-common-using modules 
+	* docs/Makefile.am: Make this like the other mm-common-using modules
 	too.
 
 2010-06-03  Murray Cumming  <murrayc murrayc com>
@@ -25,7 +32,7 @@
 
 	Added doxygen main page, though it is not used yet.
 
-	* gconf/gconfmm.h: Added a main page, though this does not seem to be 
+	* gconf/gconfmm.h: Added a main page, though this does not seem to be
 	used yet, probably because gconfmm does not use mm-common yet.
 
 2.28.0:
@@ -33,8 +40,8 @@
 2009-03-27  Murray Cumming  <murrayc murrayc com>
 
 	* gconf/src/client.ccg:
-	* gconf/src/value.ccg: Add some static g_conf_*_get_type() functions that 
-	call gconf_*_get_type() to fix the build because gmmproc now guesses the 
+	* gconf/src/value.ccg: Add some static g_conf_*_get_type() functions that
+	call gconf_*_get_type() to fix the build because gmmproc now guesses the
 	prefix wrong, because we made it guess other prefixes better.
 
 2.26.0:
@@ -42,7 +49,7 @@
 2009-03-16  Murray Cumming  <murrayc murrayc com>
 
 	* configure.in: Increased version number to match GNOME 2.26.
-	
+
 2009-01-24  Deng Xiyue  <manphiz gmail com>
 
 	* Change license header to mention Lesser General Public License
@@ -65,12 +72,12 @@
 
 2008-08-25  Murray Cumming  <murrayc murrayc com>
 
-	* docs/reference/Doxyfile.in: Added newin2p* ALIASES, as in 
+	* docs/reference/Doxyfile.in: Added newin2p* ALIASES, as in
 	gtkmm, to mark new API.
-	* gconf/src/client.hg: recursive_unset(): Added a suitable 
+	* gconf/src/client.hg: recursive_unset(): Added a suitable
 	default value for the flags parameter.
 	Added notify().
-	Used @newin2p24 in the documentation. 
+	Used @newin2p24 in the documentation.
 
 2008-08-14  Josephine Hsu  <w30372 motorola com>
 
@@ -83,7 +90,7 @@
 
 2008-01-28  Murray Cumming  <murrayc murrayc com>
 
-	* gconf/src/client.hg: Added a string conversion for the signal, 
+	* gconf/src/client.hg: Added a string conversion for the signal,
 	because this is no longer in the .m4 file installed by glibmm.
 
 2.22.0:
@@ -101,18 +108,18 @@
 
 2007-09-09  Jonathon Jongsma  <jjongsma gnome org>
 
-	* docs/reference/Doxyfile.in: Add defines to PREDEFINED so that documentation 
-	is built wihout hiding optional API, such as use of exceptions. 
+	* docs/reference/Doxyfile.in: Add defines to PREDEFINED so that documentation
+	is built wihout hiding optional API, such as use of exceptions.
 
 2.18.1:
 
 2007-09-10  Martin Ejdestig  <marejde gmail com>
 
-	* gconf/gconfmm/setinterface.h: Use 
+	* gconf/gconfmm/setinterface.h: Use
 	#pragma GCC system_header
 	to supress warnings about the lack of a virtual destructor.
-	We cannot add the virtual destructor (not a big problem in this 
-	case anyway) without breaking ABI, and we do not want to stop 
+	We cannot add the virtual destructor (not a big problem in this
+	case anyway) without breaking ABI, and we do not want to stop
 	applications from building while -Werror is enabled.
 	Bug #460969
 
@@ -144,8 +151,8 @@
 	* gconf/gconfmm/setinterface.cc:
 	* gconf/gconfmm/setinterface.h:
 	* gconf/src/changeset.ccg:
-	* gconf/src/changeset.hg: Add #ifdefed versions of the API 
-	for when --enable-api-exceptions=no was used with glibmm, 
+	* gconf/src/changeset.hg: Add #ifdefed versions of the API
+	for when --enable-api-exceptions=no was used with glibmm,
 	adding the Glib::Error parameter to methods.
 	* examples/client/main.cc:
 	* examples/client/window_test.cc: Added #ifdefed alternative code.
@@ -159,15 +166,15 @@
 
 2005-12-06   Jonathon Jongsma <jonathon jongsma gmail com>
 
-	* configure.in: Look for gmmproc in generic libdir 
-	directory, because that is not always lib/. This 
+	* configure.in: Look for gmmproc in generic libdir
+	directory, because that is not always lib/. This
 	fixes the build on some 64-bit systems.
 
 2005-11-28  Murray Cumming  <murrayc murrayc com>
 
-	* gconf/gconfmm/value_listhelpers.h: Remove extra 
-	template<> to allow compilation on IBM (AIX), Tru64, and 
-	SGI C++ compilers. Bug #321967 with patch by 
+	* gconf/gconfmm/value_listhelpers.h: Remove extra
+	template<> to allow compilation on IBM (AIX), Tru64, and
+	SGI C++ compilers. Bug #321967 with patch by
 	The Written Word.
 
 2.12.0:
@@ -179,45 +186,45 @@
 
 2005-04-24  Murray Cumming <murrayc murrayc com>
 
-	* gconf/src/client.ccg: Added casts for gcc 4.0 on AMD64, with 
+	* gconf/src/client.ccg: Added casts for gcc 4.0 on AMD64, with
 	comments. Bug #172387 and patch from Bradley Bell.
 
 2.10.0:
 
 2005-03-03  Murray Cumming  <murrayc murrayc com>
 
-	* gconf/src/client.hg: BasicTypeTraits: Allocate a new pointer to the 
+	* gconf/src/client.hg: BasicTypeTraits: Allocate a new pointer to the
 	type. This will be used by float lists.
-	set_float_list, get_float_list: Use doubles, not floats, because 
+	set_float_list, get_float_list: Use doubles, not floats, because
 	that is what we use elsewhere, and they are theoretically equivalent.
 
 2005-02-15  Murray Cumming  <murrayc murrayc com>
 
-	* gconf/src/client.hg: BasicTypeTraits: Remove extra prefix, to avoid 
+	* gconf/src/client.hg: BasicTypeTraits: Remove extra prefix, to avoid
 	warning. Do not delete anything in the int and bool specializations.
 
 2005-02-14  Murray Cumming  <murrayc murrayc com>
 
-	* gconf/src/client.hg: Added int and bool template specializations of 
-	BasicTypes<> because gconf needs us to use GPOINTER_TO_INT and 
-	GINT_TO_POINTER with gconf_client_set_list() when using 
+	* gconf/src/client.hg: Added int and bool template specializations of
+	BasicTypes<> because gconf needs us to use GPOINTER_TO_INT and
+	GINT_TO_POINTER with gconf_client_set_list() when using
 	GCONF_VALUE_INT and GCONF_VALUE_BOOL. Bug #63585 from Bryan Forbes.
 	We are still not sure what to do for GCONF_VALUE_FLOAT.
 
 2005-02-03  Murray Cumming  <murrayc murrayc com>
 
-	* gconf/src/client.hg: BasicTypeTraits::release_c_type(): Remove 
+	* gconf/src/client.hg: BasicTypeTraits::release_c_type(): Remove
 	unnecessary prefix, to fix warning.
 
 2.9.1:
 
 2005-01-10  Murray Cumming  <murrayc murrayc com>
 
-	* gconf/src/client.[hg|ccg]: set_int_list(), set_bool_list(), 
-	set_float_list(): Use a SListHandle_Value with a special Traits, 
-	because the default Traits for basic types seem to be for 
-	ArrayHandles, rather than GLists which store pointers rather than 
-	values. However, this does not work yet - the values in the GList are 
+	* gconf/src/client.[hg|ccg]: set_int_list(), set_bool_list(),
+	set_float_list(): Use a SListHandle_Value with a special Traits,
+	because the default Traits for basic types seem to be for
+	ArrayHandles, rather than GLists which store pointers rather than
+	values. However, this does not work yet - the values in the GList are
 	nonsense.
 
 2005-01-10  Bryan Forbes  <bryan reigndropsfall net>
@@ -246,7 +253,7 @@ This is the HEAD branch, for gconfmm 2.9/2.10.
 
 2004-11-28  Murray Cumming  <murrayc murrayc com>
 
-	* gconf/src/src/value.hg, client.hg: Removed extra ;s which cause 
+	* gconf/src/src/value.hg, client.hg: Removed extra ;s which cause
 	warnings with g++ 3.4.
 
 2.8.0:
@@ -273,7 +280,7 @@ This is the HEAD branch, for gconfmm 2.9/2.10.
 	* Fixed installation directory messed up after 2.0 -> 2.6 change.
 
 2.5.1:
-	
+
 2004-02-13  Murray Cumming  <murrayc murrayc com>
 
 	* Updated for latest libsigc++ 2 API.
@@ -287,7 +294,7 @@ This is the HEAD branch, for gconfmm 2.9/2.10.
 
 2003-11-02  Murray Cumming  <murrayc usa net>
 
-	* This is now gconfmm 2.5, which will become gconfmm 2.6. It uses 
+	* This is now gconfmm 2.5, which will become gconfmm 2.6. It uses
 	glibmm 2.4 and is parallel-installable.
 
 Branched for HEAD (gconfmm 2.5/2.6) and gnome-2-4.
@@ -314,13 +321,13 @@ Branched for HEAD (gconfmm 2.5/2.6) and gnome-2-4.
 
  	* gconf/src/client.[ccg|hg]: added get_entry() method that uses
  	the default locale.
-	
+
 2002-12-10  Andreas Holzmann  <Andreas Holzmann epost de>
 
 	* gconf/src/changeset.[ccg|hg]: made some get methods const.
 	* gconf/src/client.[ccg|hg]: dito.
 	* gconf/src/schema.hg: dito.
-	
+
 2002-12-09  Murray Cumming  <murrayc usa net>
 
 	* Increased version number to 2.0.0 and renamed library from 1.3
@@ -336,37 +343,37 @@ Branched for HEAD (gconfmm 2.5/2.6) and gnome-2-4.
 2002-11-21  Bassoukos Tassos  <abas aix meng auth gr>
 
 	* gconf/src/value.hg, gconf/src/value.ccg: moved here from
-	gconf/gconfmm/value.cc and value.h. Updated to use the new 
+	gconf/gconfmm/value.cc and value.h. Updated to use the new
 	SListHandle for lists and _WRAP_METHOD. Documented.
-	* gconf/src/client.hg, gconf/src/client.ccg: updated to use 
+	* gconf/src/client.hg, gconf/src/client.ccg: updated to use
 	_WRAP_METHOD with error throw, Documented.
 	* gconf/gconfmm/list_conversion.h: removed file.
 	* gconf/src/Makefile_list_of_hg.am_fragment: added new files here.
 	* gconf/gconfmm/value_listhelpers.h: new file, from list_helpers.h.
 	Modified to use the SListHandle templates. Contains specializations
 	needed for correct interface with GConfValues.
-	* gconf/gconfmm/setinterface.h, gconf/gconfmm/setinterface.cc: 
-	new files, common setter interface for Gnome::Conf::Client and 
+	* gconf/gconfmm/setinterface.h, gconf/gconfmm/setinterface.cc:
+	new files, common setter interface for Gnome::Conf::Client and
 	Gnome::Conf::ChangeSet.
-	* gconf/src/changeset.hg, gconf/src/changeset.ccg: new files, 
+	* gconf/src/changeset.hg, gconf/src/changeset.ccg: new files,
 	wrappers for GConfChangeSet.
 	* gconf/gconfmm/Makefile.am: removed generated files from sources.
 
 2002-11-20  Bassoukos Tassos  <abas aix meng auth gr>
 
- 	* gconf/src/entry.hg, gconf/src/entry.ccg: moved here from 
- 	gconf/gconfmm/entry.cc, gconf/gconfmm/entry.h, updated to use the 
+ 	* gconf/src/entry.hg, gconf/src/entry.ccg: moved here from
+ 	gconf/gconfmm/entry.cc, gconf/gconfmm/entry.h, updated to use the
  	m4 code generation macros. TODO: docs.
- 	* gconf/src/schema.hg, gconf/src/schema.ccg: as above for 
+ 	* gconf/src/schema.hg, gconf/src/schema.ccg: as above for
  	gconf/gconfmm/schema.cc and schema.h
  	* tools/m4/convert_gconfmm.m4: added more conversion macros,
  	including conversions for enumerations.
  	* gconf/src/Makefile_list_of_hg.am_fragment,
-	
+
 2002-11-21  Murray Cumming  <murrayc usa net>
 
 	* gconf/gconfmm/Makefile: Distribute list_conversions.h
-	
+
 2002-11-19  Bassoukos Tassos  <abas aix meng auth gr>
 
 	* gconf/src/gconf_methods.defs: updated using CVS h2defs.py and
@@ -391,7 +398,7 @@ Branched for HEAD (gconfmm 2.5/2.6) and gnome-2-4.
 2002-11-04  Tasss Bassoukos <abas aix meng auth gr>
 
 	* gconf/gconfmm/value.cc Value::get_list_type() was missing.
-	
+
 2002-11-05  Murray Cumming  <murrayc usa net>
 
 	* gconf/gconfmm/value.cc: Value::Value(): don't call gconf_value_new()
@@ -402,22 +409,22 @@ Branched for HEAD (gconfmm 2.5/2.6) and gnome-2-4.
 	* Hid CallbackHolder from reference documentation.
 
 1.3.9:
-	
+
 	* Updated for gtkmm2.
 1.3.8:
-	
+
 2002-08-25  Murray Cummign  <murrayc usa net>
 
 	* configure.in: Generated -uninstalled.pc for use with gnomemm-all.
 
 1.3.7:
-	
+
 2002-07-19  Murray Cumming  <murrayc usa net>
 
 	* gconf/Makefile.am: Corrected installation of gconfmm.h header.
 
 1.3.6:
-	
+
 2002-07-09  Abel Cheung  <maddog linux org hk>
 
 	* tools/m4/Makefile.am: Corrected m4 install destination, was
@@ -426,18 +433,18 @@ Branched for HEAD (gconfmm 2.5/2.6) and gnome-2-4.
 	fragments too, automake will fail without them.
 
 1.3.5:
-	
+
 2002-06-23  Murray Cumming  <murrayc usa net>
 
 	* Rebuilt for latest gtkmm.
 
 1.3.4:
-	
+
 2002-06-16  Murray Cumming  <murrayc usa net>
 
 	* examples/client: Changed use of Box::pack_start() to use the new
 	enum parameter.
-	
+
 2002-05-14  Daniel Elstner  <daniel elstner gmx net>
 
 	* gconf/gconfmm/entry.cc, gconf/gconfmm/value.cc: Remove default
@@ -452,30 +459,30 @@ Branched for HEAD (gconfmm 2.5/2.6) and gnome-2-4.
 
 2002-04-23  Murray Cumming  <murrayc usa net>
 
-	* Generated sources are now distributed. build_shared/*.am_fragment 
-	files were copied from libgnomecanvasmm.	
+	* Generated sources are now distributed. build_shared/*.am_fragment
+	files were copied from libgnomecanvasmm.
 
 2002-04-21  Murray Cumming  <murrayc usa net>
 
-	* gconf/src/client.hg: Changed _CLASS_GERROR to _WRAP_GERROR, for 
+	* gconf/src/client.hg: Changed _CLASS_GERROR to _WRAP_GERROR, for
 	recent gtkmm change.
 
 1.3.2:
-	
+
 2002-04-01  Murray Cumming  <murrayc usa net>
 
 	* Use new _DEFS() format in .hg files.
 
 1.3.1:
-	
+
 2002-03-10  Murray Cumming  <murrayc usa net>
 
 	* Changed signal args to C++ types.
 
 cd 2002-03-06  Murray Cumming  <murrayc usa net>
 
-	* Gnome::Conf::Client methods can now throw Gnome::Conf::Error 
-	exceptions, using the glibmm Glib::Error system. Therefore the 
+	* Gnome::Conf::Client methods can now throw Gnome::Conf::Error
+	exceptions, using the glibmm Glib::Error system. Therefore the
 	get_last_error() method has now been removed.
 
 2002-02-24  Murray Cumming  <murrayc usa net>
@@ -484,11 +491,11 @@ cd 2002-03-06  Murray Cumming  <murrayc usa net>
 	(Rick L Vinyard Jr)
 
 gconfmm 1.3.0:
-	
+
 2002-02-17  Murray Cumming  <murrayc usa net>
 
 	* Changed namespace from GConf to Gnome::Conf, to make it more clearly
-	a part of gnomemm. GConf does not depend on much of GNOME, but it is 
+	a part of gnomemm. GConf does not depend on much of GNOME, but it is
 	part of GNOME.
 	* Added Gnome::Conf::init().
 	* Added the example from the old gconfmm, and updated it for gtkmm2
diff --git a/gconf/src/entry.ccg b/gconf/src/entry.ccg
index 4958b31..fe9fd1a 100644
--- a/gconf/src/entry.ccg
+++ b/gconf/src/entry.ccg
@@ -20,9 +20,9 @@
  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
-namespace Gnome 
+namespace Gnome
 {
-namespace Conf 
+namespace Conf
 {
 
 Entry::Entry(const Glib::ustring& key, const Value& val)
@@ -30,25 +30,10 @@ Entry::Entry(const Glib::ustring& key, const Value& val)
   gobject_ = gconf_entry_new(key.c_str(), const_cast<GConfValue*>(val.gobj()));
 }
 
-// There is no gconf_entry_copy, so we provide one...
-// TODO: There is now.
-GConfEntry* Entry::entry_copy(const GConfEntry* entry)
-{
-  if(entry == 0)
-    return 0;
-
-  GConfEntry* retval = gconf_entry_new(gconf_entry_get_key(entry), gconf_entry_get_value(entry) );
-
-  gconf_entry_set_schema_name(retval, gconf_entry_get_schema_name(entry) );
-  gconf_entry_set_is_default(retval, gconf_entry_get_is_default(entry) );
-  gconf_entry_set_is_writable(retval, gconf_entry_get_is_writable(entry) );
-  return retval;
-}
-
 Value Entry::get_value() const
 {
   return Value(gconf_entry_get_value(gobj()), true);
 }
-  
+
 } /* namespace Conf */
 } /* namespace Gnome */
diff --git a/gconf/src/entry.hg b/gconf/src/entry.hg
index d220526..b4f5f35 100644
--- a/gconf/src/entry.hg
+++ b/gconf/src/entry.hg
@@ -2,7 +2,7 @@
 /* $Id: entry.hg,v 1.4 2002/12/10 23:26:01 murrayc Exp $ */
 
 /* entry.hg
- * 
+ *
  * Copyright (C) 2000-2002 GConfmm Development Team
  *
  * This library is free software; you can redistribute it and/or
@@ -35,15 +35,15 @@ namespace Gnome
 namespace Conf
 {
 
-/** An Entry stores an entry from a GConf "directory", including a 
- * key-value pair, the name of the Schema applicable to this entry, 
- * whether the value is a default value, and whether GConf can write 
+/** An Entry stores an entry from a GConf "directory", including a
+ * key-value pair, the name of the Schema applicable to this entry,
+ * whether the value is a default value, and whether GConf can write
  * a new value at this key. The key should be an absolute key, not a relative key.
  */
 class Entry
 {
-  _CLASS_OPAQUE_COPYABLE(Entry,GConfEntry,NONE,entry_copy,gconf_entry_unref)
-  _IGNORE(gconf_entry_free, gconf_entry_unref, gconf_entry_new, gconf_entry_new_nocopy)
+  _CLASS_OPAQUE_COPYABLE(Entry,GConfEntry,NONE,gconf_entry_copy,gconf_entry_unref)
+  _IGNORE(gconf_entry_free, gconf_entry_copy, gconf_entry_ref, gconf_entry_unref, gconf_entry_new, gconf_entry_new_nocopy)
   _IGNORE(gconf_entry_equal, gconf_entry_set_value_nocopy)
   _IGNORE(gconf_entry_steal_value)
 
@@ -95,12 +95,12 @@ namespace Container_Helpers
 {
 
 template<>
-struct TypeTraits<Gnome::Conf::Entry> 
+struct TypeTraits<Gnome::Conf::Entry>
 {
     typedef Gnome::Conf::Entry CppType;
     typedef const GConfEntry* CType;
     typedef GConfEntry* CTypeNonConst;
-    
+
     static CType   to_c_type      (const CppType& item) { return item.gobj(); }
     static CType   to_c_type      (const CType&   item) { return item; }
     static CppType to_cpp_type    (const CType&   item) { return Gnome::Conf::Entry(const_cast<CTypeNonConst>(item)); }



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