diff --git a/libs/ardour/playlist.cc b/libs/ardour/playlist.cc index 1aef4b8d92..6169df8f03 100644 --- a/libs/ardour/playlist.cc +++ b/libs/ardour/playlist.cc @@ -25,7 +25,6 @@ #include #include - #include "pbd/failed_constructor.h" #include "pbd/stl_delete.h" #include "pbd/xml++.h" @@ -2049,7 +2048,7 @@ Playlist::property_factory (const XMLNode& history_node) const /* XXX property name needs capitalizing */ - if ((*i)->name() == regions.property_name()) { + if ((*i)->name() == capitalize (regions.property_name())) { RegionListProperty* rlp = new RegionListProperty (*const_cast (this)); diff --git a/libs/pbd/convert.cc b/libs/pbd/convert.cc index 0610567102..bda0683910 100644 --- a/libs/pbd/convert.cc +++ b/libs/pbd/convert.cc @@ -21,6 +21,7 @@ #include #include #include +#include #ifndef __STDC_FORMAT_MACROS #define __STDC_FORMAT_MACROS #endif @@ -36,6 +37,17 @@ using Glib::ustring; namespace PBD { +string +capitalize (const string& str) +{ + string ret = str; + if (!str.empty()) { + /* XXX not unicode safe */ + ret[0] = toupper (str[0]); + } + return ret; +} + string short_version (string orig, string::size_type target_length) { diff --git a/libs/pbd/pbd/convert.h b/libs/pbd/pbd/convert.h index e6e063bf41..cbc898011d 100644 --- a/libs/pbd/pbd/convert.h +++ b/libs/pbd/pbd/convert.h @@ -38,6 +38,8 @@ double atof (const std::string&); void url_decode (std::string&); void url_decode (Glib::ustring&); +std::string capitalize (const std::string&); + // std::string length2string (const int32_t frames, const float sample_rate); std::string length2string (const int64_t frames, const double sample_rate); diff --git a/libs/pbd/pbd/sequence_property.h b/libs/pbd/pbd/sequence_property.h index 887250ab82..c2ad939b7c 100644 --- a/libs/pbd/pbd/sequence_property.h +++ b/libs/pbd/pbd/sequence_property.h @@ -8,6 +8,7 @@ #include +#include "pbd/convert.h" #include "pbd/id.h" #include "pbd/property_basics.h" @@ -44,8 +45,7 @@ class SequenceProperty : public PropertyBase void add_history_state (XMLNode* history_node) const { - /* XXX need to capitalize property name */ - XMLNode* child = new XMLNode (property_name()); + XMLNode* child = new XMLNode (PBD::capitalize (property_name())); history_node->add_child_nocopy (*child); /* record the change described in our change member */