]> git.lyx.org Git - lyx.git/blobdiff - src/support/FileFilterList.cpp
Now that exceptions are allowed, handle gracefully the case where a Buffer temp direc...
[lyx.git] / src / support / FileFilterList.cpp
index abe7813808f92705afc36990be5f7d5814c08863..e960502a170dc7df9aba410a1e7d512b8c7ae7b5 100644 (file)
 #include <config.h>
 
 #include "support/FileFilterList.h"
-#include "support/lstrings.h"
 
-// FIXME Interface violation
-#include "gettext.h"
+#include "support/lstrings.h"
+#include "support/gettext.h"
 
 #include <boost/regex.hpp>
 #include <boost/tokenizer.hpp>
 
 #include <sstream>
 
-using lyx::docstring;
-
-using std::distance;
-using std::ostringstream;
-using std::string;
-using std::vector;
-
+using namespace std;
 
 namespace {
 
@@ -83,8 +76,8 @@ string const convert_brace_glob(string const & glob)
 namespace lyx {
 namespace support {
 
-FileFilterList::Filter::Filter(lyx::docstring const & description,
-                              std::string const & globs)
+FileFilterList::Filter::Filter(docstring const & description,
+                              string const & globs)
        : desc_(description)
 {
        typedef boost::tokenizer<boost::char_separator<char> > Tokenizer;
@@ -104,9 +97,9 @@ FileFilterList::Filter::Filter(lyx::docstring const & description,
 FileFilterList::FileFilterList(docstring const & qt_style_filter)
 {
        // FIXME UNICODE
-       string const filter = lyx::to_utf8(qt_style_filter)
+       string const filter = to_utf8(qt_style_filter)
                + (qt_style_filter.empty() ? string() : ";;")
-               + lyx::to_utf8(_("All files (*)"));
+               + to_utf8(_("All files (*)"));
 
        // Split data such as "TeX documents (*.tex);;LyX Documents (*.lyx)"
        // into individual filters.
@@ -144,7 +137,7 @@ void FileFilterList::parse_filter(string const & filter)
                filters_.push_back(Filter(docstring(), trim(filter)));
        } else {
                // FIXME UNICODE
-               docstring const desc = lyx::from_utf8(string(what[1].first, what[1].second));
+               docstring const desc = from_utf8(string(what[1].first, what[1].second));
                string const globs = string(what[2].first, what[2].second);
                filters_.push_back(Filter(trim(desc), trim(globs)));
        }
@@ -169,7 +162,7 @@ docstring const FileFilterList::as_string() const
 
                bool const has_description = !fit->description().empty();
                if (has_description)
-                       ss << lyx::to_utf8(fit->description()) << " (";
+                       ss << to_utf8(fit->description()) << " (";
 
                for (Filter::glob_iterator git = gbegin; git != gend; ++git) {
                        if (git != gbegin)
@@ -181,7 +174,7 @@ docstring const FileFilterList::as_string() const
                        ss << ')';
        }
 
-       return lyx::from_utf8(ss.str());
+       return from_utf8(ss.str());
 }
 
 } // namespace support