]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/qt_helpers.cpp
do what the FIXME suggested
[lyx.git] / src / frontends / qt4 / qt_helpers.cpp
index aad055d2f0fe36ba0634ba67e4cbe4da1f8f0d5d..02f34068d7b1c3c6031f4a544abb7a1f0548f004 100644 (file)
 
 #include "qt_helpers.h"
 
+#include "FileDialog.h"
 #include "LengthCombo.h"
 
-#include "support/debug.h"
-#include "support/gettext.h"
+#include "frontends/alert.h"
+
 #include "Language.h"
 #include "Length.h"
 
-#include "frontends/FileDialog.h"
-#include "frontends/alert.h"
-
+#include "support/debug.h"
 #include "support/filetools.h"
+#include "support/gettext.h"
 #include "support/lstrings.h"
 #include "support/lyxalgo.h"
 #include "support/os.h"
 #include <locale>
 
 using namespace std;
+using namespace lyx::support;
 
 namespace lyx {
-
-using support::addName;
-using support::bformat;
-using support::FileFilterList;
-using support::FileName;
-using support::getExtension;
-using support::getVectorFromString;
-using support::libFileSearch;
-using support::makeAbsPath;
-using support::makeRelPath;
-using support::onlyFilename;
-using support::onlyPath;
-using support::package;
-using support::prefixIs;
-using support::quoteName;
-using support::removeExtension;
-using support::Systemcall;
-using support::token;
-using support::isStrDbl;
-
 namespace frontend {
 
 string widgetsToLength(QLineEdit const * input, LengthCombo const * combo)
@@ -172,7 +153,7 @@ public:
        Sorter() : loc_ok(true)
        {
                try {
-                       loc_ = std::locale("");
+                       loc_ = locale("");
                } catch (...) {
                        loc_ok = false;
                }
@@ -186,7 +167,7 @@ public:
                        return lhs.first < rhs.first;
        }
 private:
-       std::locale loc_;
+       locale loc_;
        bool loc_ok;
 #endif
 };
@@ -220,7 +201,7 @@ vector<LanguagePair> const getLanguageData(bool character_dlg)
        vector<LanguagePair>::iterator begin = character_dlg ?
                langs.begin() + 2 : langs.begin();
 
-       std::sort(begin, langs.end(), Sorter());
+       sort(begin, langs.end(), Sorter());
 
        return langs;
 }
@@ -325,11 +306,11 @@ docstring browseDir(docstring const & pathname, docstring const & title,
 void rescanTexStyles()
 {
        // Run rescan in user lyx directory
-       support::PathChanger p(package().user_support());
+       PathChanger p(package().user_support());
        FileName const command = libFileSearch("scripts", "TeXFiles.py");
        Systemcall one;
        int const status = one.startscript(Systemcall::Wait,
-                       support::os::python() + ' ' +
+                       os::python() + ' ' +
                        quoteName(command.toFilesystemEncoding()));
        if (status == 0)
                return;
@@ -339,7 +320,7 @@ void rescanTexStyles()
 }
 
 
-void getTexFileList(string const & filename, std::vector<string> & list)
+void getTexFileList(string const & filename, vector<string> & list)
 {
        list.clear();
        FileName const file = libFileSearch("", filename);
@@ -347,18 +328,18 @@ void getTexFileList(string const & filename, std::vector<string> & list)
                return;
 
        // FIXME Unicode.
-       std::vector<docstring> doclist = 
+       vector<docstring> doclist = 
                getVectorFromString(file.fileContents("UTF-8"), from_ascii("\n"));
 
        // Normalise paths like /foo//bar ==> /foo/bar
        boost::RegEx regex("/{2,}");
-       std::vector<docstring>::iterator it  = doclist.begin();
-       std::vector<docstring>::iterator end = doclist.end();
+       vector<docstring>::iterator it  = doclist.begin();
+       vector<docstring>::iterator end = doclist.end();
        for (; it != end; ++it)
                list.push_back(regex.Merge(to_utf8(*it), "/"));
 
        // remove empty items and duplicates
-       list.erase(std::remove(list.begin(), list.end(), ""), list.end());
+       list.erase(remove(list.begin(), list.end(), ""), list.end());
        eliminate_duplicates(list);
 }