[vlc-devel] [PATCH 1/3] Re-implemented SoutMrl in a more object-oriented way

Rémi Denis-Courmont remi at remlab.net
Thu Oct 10 18:40:54 CEST 2019


Le torstaina 10. lokakuuta 2019, 17.32.58 EEST Jérôme Froissart a écrit :
> diff --git a/modules/gui/qt/util/soutmrl.cpp
> b/modules/gui/qt/util/soutmrl.cpp new file mode 100644
> index 0000000000..92aa10ae90
> --- /dev/null
> +++ b/modules/gui/qt/util/soutmrl.cpp
> @@ -0,0 +1,81 @@
> +#include "soutmrl.hpp"
> +
> +QString MrlModule::to_string() const
> +{
> +    QString s = moduleName;
> +
> +    if( options.size() > 0 )
> +    {
> +        s += "{";
> +    }
> +    OptionsType::const_iterator it;
> +    for( it=options.begin(); it!=options.end(); )
> +    {
> +        s += it->first;
> +        if( it->second.to_string().compare("") != 0 )
> +        {
> +            s += "=" + it->second.to_string();

This looks incorrect. Option values may contain white spaces or quotes, and 
need to be escaped properly.

> +        }
> +        ++it;
> +        if( it != options.end() )
> +        {
> +            s += ",";
> +        }
> +    }
> +    if( options.size() > 0 )
> +    {
> +        s += "}";
> +    }
> +    return s;
> +}

-- 
Rémi Denis-Courmont
http://www.remlab.net/





More information about the vlc-devel mailing list