On 09/07/2011 09:56 AM, Julien Rioux wrote:
On 07/09/2011 3:37 PM, Richard Heck wrote:
On 09/07/2011 08:36 AM, Julien Rioux wrote:
On 07/09/2011 2:09 PM, Julien Rioux wrote:
On 06/09/2011 2:57 AM, Richard Heck wrote:
@@ -90,9 +90,13 @@ bool operator<(Format const& a, Format const& b)
Format::Format(string const& n, string const& e, string const& p,
string const& s, string const& v, string const& ed,
int flags)
- : name_(n), extension_(e), prettyname_(p), shortcut_(s), viewer_(v),
+ : name_(n), extensions_(e), prettyname_(p), shortcut_(s), viewer_(v),
editor_(ed), flags_(flags)
-{}
+{
+ extension_list_ = getVectorFromString(e, ",");
+ if (extension_list_.empty())
+ extension_list_.push_back("");
+}

I'd probably have to look more closely at the patch, but are we sure
this is needed? We can always check for empty()-ness when we need to do so.


I push an empty string to prevent extension_list_ from being empty, because in Format.h we have

-    std::string const & extension() const { return extension_; }
+    std::string const & extension() const { return extension_list_[0]; }

and extension_list_[0] would be an invalid address otherwise.

return extension_list_.empty() ? "" : extension_list_[0]?

rh

Reply via email to