- Correctly interpret whether a file description is available.
This description is later displayed in the file filters in the
import dialog (and other dialogs using this qt helper).
- Fix the regex so that "LaTeX (plain) (*.tex)" is correctly parsed
into a description "LaTeX (plain) " and its corresponding filter.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@39672
a592a061-630c-0410-9148-
cb99ea01b6c8
{
QString s;
- bool const has_description = desc_.empty();
+ bool const has_description = !desc_.empty();
if (has_description) {
s += toqstr(desc_);
void FileFilterList::parse_filter(string const & filter)
{
- // Matches "TeX documents (*.tex)",
- // storing "TeX documents " as group 1 and "*.tex" as group 2.
- static lyx::regex const filter_re("([^(]*)\\(([^)]+)\\) *$");
+ // Matches "TeX documents (plain) (*.tex)",
+ // storing "TeX documents (plain) " as group 1 and "*.tex" as group 2.
+ static lyx::regex const filter_re("(.*)\\(([^()]+)\\) *$");
match_results<string::const_iterator> what;
if (!lyx::regex_search(filter, what, filter_re)) {