]> git.lyx.org Git - lyx.git/blobdiff - src/support/filetools.cpp
cosmetics
[lyx.git] / src / support / filetools.cpp
index 8b9258cfe15f8d48e78419aa618e9572df161c25..65cc5ef29234e6e3f8e496e9734f0e69885531e0 100644 (file)
@@ -33,6 +33,9 @@
 #include "support/Package.h"
 #include "support/Path.h"
 #include "support/Systemcall.h"
+#include "support/qstring_helpers.h"
+
+#include <QDir>
 
 #include <boost/assert.hpp>
 #include <boost/regex.hpp>
 #include <fstream>
 #include <sstream>
 
-using std::endl;
-using std::getline;
-using std::make_pair;
-using std::string;
-using std::ifstream;
-using std::ostringstream;
-using std::vector;
-using std::pair;
+using namespace std;
 
 namespace lyx {
 namespace support {
@@ -891,7 +887,7 @@ string const readBB_from_PSFile(FileName const & file)
 
        static boost::regex bbox_re(
                "^%%BoundingBox:\\s*([[:digit:]]+)\\s+([[:digit:]]+)\\s+([[:digit:]]+)\\s+([[:digit:]]+)");
-       std::ifstream is(file_.toFilesystemEncoding().c_str());
+       ifstream is(file_.toFilesystemEncoding().c_str());
        while (is) {
                string s;
                getline(is,s);
@@ -935,38 +931,5 @@ int compare_timestamps(FileName const & file1, FileName const & file2)
 }
 
 
-std::vector<FileName> dirList(FileName const & filename, std::string const & ext)
-{
-       std::vector<FileName> dirlist;
-       if (!filename.isDirectory()) {
-               LYXERR0("Directory '" << filename << "' does not exist!");
-               return dirlist;
-       }
-
-       QDir dir(toqstr(filename.absoluteFilePath()));
-
-       if (!ext.empty()) {
-               QString filter;
-               switch (ext[0]) {
-               case '.': filter = "*" + toqstr(ext); break;
-               case '*': filter = toqstr(ext); break;
-               default: filter = "*." + toqstr(ext);
-               }
-               dir.setNameFilters(QStringList(filter));
-               LYXERR(Debug::FILES, "filtering on extension "
-                       << fromqstr(filter) << " is requested.");
-       }
-
-       QFileInfoList list = dir.entryInfoList();
-       for (int i = 0; i != list.size(); ++i) {
-               FileName fi(fromqstr(list.at(i).absoluteFilePath()));
-               dirlist.push_back(fi);
-               LYXERR(Debug::FILES, "found file " << fi);
-       }
-
-       return dirlist;
-}
-
-
 } //namespace support
 } // namespace lyx