diff options
author | Marius Kintel <marius@kintel.net> | 2012-01-09 02:29:24 (GMT) |
---|---|---|
committer | Marius Kintel <marius@kintel.net> | 2012-01-09 02:29:24 (GMT) |
commit | 23f6b0623c86eba96dfb1296b862522cf02b0734 (patch) | |
tree | 998500ef16763f6f08f9f7cb8917c98b1643af68 /src/handle_dep.cc | |
parent | 52dfffd97ba49b603b4814d843cd9be08d040364 (diff) | |
parent | 5044ea928d72da800d11b2b80f6148265c13d10f (diff) |
Merge branch 'master' into threading
Conflicts:
RELEASE_NOTES
Diffstat (limited to 'src/handle_dep.cc')
-rw-r--r-- | src/handle_dep.cc | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/handle_dep.cc b/src/handle_dep.cc index d4380f5..d642555 100644 --- a/src/handle_dep.cc +++ b/src/handle_dep.cc @@ -1,27 +1,28 @@ #include "handle_dep.h" #include <string> #include <sstream> -#include <QString> -#include <QDir> -#include <QSet> #include <stdlib.h> // for system() #include <boost/unordered_set.hpp> #include <boost/foreach.hpp> +#include <boost/regex.hpp> +#include <boost/filesystem.hpp> +using namespace boost::filesystem; boost::unordered_set<std::string> dependencies; const char *make_command = NULL; void handle_dep(const std::string &filename) { - if (filename[0] == '/') + path filepath(filename); + if (filepath.is_absolute()) { dependencies.insert(filename); + } else { - QString dep = QDir::currentPath() + QString("/") + QString::fromStdString(filename); - dependencies.insert(dep.toStdString()); + dependencies.insert((current_path() / filepath).string()); } - if (!QFile(QString::fromStdString(filename)).exists() && make_command) { + if (!exists(filepath) && make_command) { std::stringstream buf; - buf << make_command << " '" << QString::fromStdString(filename).replace("'", "'\\''").toUtf8().data() << "'"; + buf << make_command << " '" << boost::regex_replace(filename, boost::regex("'"), "'\\''") << "'"; system(buf.str().c_str()); // FIXME: Handle error } } |