]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/qt_helpers.cpp
Fix handling of the add branch textfield in GuiBranches
[lyx.git] / src / frontends / qt4 / qt_helpers.cpp
index 076681c3a693edf35c44e0c2285fbc64f236221c..59a3d67fd2e224aa0fe25cf5f4f0d5bdc72fc7fd 100644 (file)
@@ -347,10 +347,11 @@ QString makeAbsPath(QString const & relpath, QString const & base)
 static string const convert_brace_glob(string const & glob)
 {
        // Matches " *.{abc,def,ghi}", storing "*." as group 1 and
-       // "abc,def,ghi" as group 2.
-       static lyx::regex const glob_re(" *([^ {]*)\\{([^ }]+)\\}");
-       // Matches "abc" and "abc,", storing "abc" as group 1.
-       static lyx::regex const block_re("([^,}]+),?");
+       // "abc,def,ghi" as group 2, while allowing spaces in group 2.
+       static lyx::regex const glob_re(" *([^ {]*)\\{([^}]+)\\}");
+       // Matches "abc" and "abc,", storing "abc" as group 1,
+       // while ignoring surrounding spaces.
+       static lyx::regex const block_re(" *([^ ,}]+) *,? *");
 
        string pattern;
 
@@ -423,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_);
@@ -508,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<string::const_iterator> what;
        if (!lyx::regex_search(filter, what, filter_re)) {
@@ -560,7 +561,7 @@ QString guiName(string const & type, BufferParams const & bp)
        if (type == "listing")
                return qt_("List of Listings");
        if (type == "index")
-               return qt_("List of Indexes");
+               return qt_("List of Index Entries");
        if (type == "marginalnote")
                return qt_("List of Marginal notes");
        if (type == "note")