From c07c4e9ddf5cc503d95ef7331b3f622a39f2fed9 Mon Sep 17 00:00:00 2001 From: Murray Cumming Date: Tue, 6 Sep 2011 09:37:03 +0200 Subject: 2.29.13 --- ChangeLog | 2 ++ NEWS | 10 ++++++++++ configure.ac | 2 +- glib/src/variant.ccg | 27 ++++++++++++--------------- 4 files changed, 25 insertions(+), 16 deletions(-) diff --git a/ChangeLog b/ChangeLog index f35cfb0a..7e764aea 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,5 @@ +2.29.13: + 2011-09-06 José Alburquerque Variant< std::vector >: Ensure correct creation. diff --git a/NEWS b/NEWS index 095f938c..aca690d7 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,13 @@ +2.29.13: + +giomm: +* Variant< std::vector >: Ensure correct creation. + (José Alburquerque) Bug #657030 (Aurimas Černius) +gmmproc +* Correct handling of constversion etc. in _WRAP_METHOD, avoiding side-effects + on other _WRAP_METHOD() calls in the same .hg file. + (Kjell Ahlstedt) Bug #657751, + 2.29.12: 2011-08-03 Murray Cumming diff --git a/configure.ac b/configure.ac index ef115f44..e006e1b8 100644 --- a/configure.ac +++ b/configure.ac @@ -15,7 +15,7 @@ ## You should have received a copy of the GNU Lesser General Public License ## along with this library. If not, see . -AC_INIT([glibmm], [2.29.12], +AC_INIT([glibmm], [2.29.13], [http://bugzilla.gnome.org/enter_bug.cgi?product=glibmm], [glibmm], [http://www.gtkmm.org/]) AC_PREREQ([2.59]) diff --git a/glib/src/variant.ccg b/glib/src/variant.ccg index 3c14cd91..c54b6780 100644 --- a/glib/src/variant.ccg +++ b/glib/src/variant.ccg @@ -441,27 +441,24 @@ const VariantType& Variant::variant_type() Variant Variant::create(const type_vec_string& data) { - // Get the variant type of the elements. - const VariantType element_variant_type = Variant::variant_type(); + // Create a string array to add the strings of the vector to. + char** str_array = g_new(char*, data.size() + 1); - // Get the variant type of the array. - const VariantType array_variant_type = Variant::variant_type(); - - // Create a GVariantBuilder to build the array. - GVariantBuilder* builder = g_variant_builder_new(array_variant_type.gobj()); - - // Add the elements of the vector into the builder. - for(type_vec_string::const_iterator iter = data.begin(); - iter < data.end(); iter++) + // Add the elements of the vector into the string array. + for(type_vec_string::size_type i = 0; i < data.size(); i++) { - g_variant_builder_add(builder, - element_variant_type.get_string().c_str(), iter->c_str()); + str_array[i] = g_strdup(data[i].c_str()); } + // Terminate the string array. + str_array[data.size()] = NULL; + // Create the variant using the builder. Variant result = - Variant(g_variant_new( - array_variant_type.get_string().c_str(), builder)); + Variant(g_variant_new_bytestring_array(str_array, + data.size())); + + g_strfreev(str_array); // Remove the floating reference (since it is newly created). g_variant_ref_sink(result.gobj()); -- cgit v1.2.1