From 78c80996cddb5d0046020c97adfcab397ec034bc Mon Sep 17 00:00:00 2001 From: Julien Rioux Date: Tue, 13 Sep 2011 20:42:55 +0000 Subject: [PATCH] Fix the display of file filters in the import file dialog. - 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 --- src/frontends/qt4/qt_helpers.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/frontends/qt4/qt_helpers.cpp b/src/frontends/qt4/qt_helpers.cpp index 103e024b20..a89406ca2d 100644 --- a/src/frontends/qt4/qt_helpers.cpp +++ b/src/frontends/qt4/qt_helpers.cpp @@ -424,7 +424,7 @@ QString Filter::toString() const { QString s; - bool const has_description = desc_.empty(); + bool const has_description = !desc_.empty(); if (has_description) { s += toqstr(desc_); @@ -509,9 +509,9 @@ FileFilterList::FileFilterList(docstring const & qt_style_filter) 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 what; if (!lyx::regex_search(filter, what, filter_re)) { -- 2.39.2