diff options
author | Murray Cumming <murrayc@murrayc.com> | 2011-09-06 09:37:03 +0200 |
---|---|---|
committer | Murray Cumming <murrayc@murrayc.com> | 2011-09-06 09:37:03 +0200 |
commit | c07c4e9ddf5cc503d95ef7331b3f622a39f2fed9 (patch) | |
tree | 13c39bd12859e01bef1fafd99dab32dabf61e5e6 | |
parent | dc1990f9ff0cd2d69f88f3297629a97ee790f3cc (diff) | |
download | glibmm-c07c4e9ddf5cc503d95ef7331b3f622a39f2fed9.tar.gz |
2.29.132.29.13
-rw-r--r-- | ChangeLog | 2 | ||||
-rw-r--r-- | NEWS | 10 | ||||
-rw-r--r-- | configure.ac | 2 | ||||
-rw-r--r-- | glib/src/variant.ccg | 27 |
4 files changed, 25 insertions, 16 deletions
@@ -1,3 +1,5 @@ +2.29.13: + 2011-09-06 José Alburquerque <jaalburqu@svn.gnome.org> Variant< std::vector<std::string> >: Ensure correct creation. @@ -1,3 +1,13 @@ +2.29.13: + +giomm: +* Variant< std::vector<std::string> >: 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 <murrayc@murrayc.com> 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 <http://www.gnu.org/licenses/>. -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<type_vec_string>::variant_type() Variant<type_vec_string> Variant<type_vec_string>::create(const type_vec_string& data) { - // Get the variant type of the elements. - const VariantType element_variant_type = Variant<std::string>::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<type_vec_string>::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<type_vec_string> result = - Variant<type_vec_string>(g_variant_new( - array_variant_type.get_string().c_str(), builder)); + Variant<type_vec_string>(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()); |