diff options
author | Anne Jan Brouwer <brouwer@annejan.com> | 2015-06-09 23:58:45 +0200 |
---|---|---|
committer | Anne Jan Brouwer <brouwer@annejan.com> | 2015-06-09 23:58:45 +0200 |
commit | 208171fd09c55ad765fdf4fa1de9a7f0757fa72d (patch) | |
tree | d6e2ea1275e720531af08d840d7f50ee03a41c94 | |
parent | fec7551df59d4ab72cb18a9d6c70ced8505b23d2 (diff) |
cleanup and correct use of \and/
-rw-r--r-- | util.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
@@ -53,8 +53,8 @@ QString Util::findPasswordStore() * @return */ QString Util::normalizeFolderPath(QString path) { - if (!path.endsWith("/") && !path.endsWith(QDir::separator())) { - path += '/'; + if (!path.endsWith(QDir::separator())) { + path += QDir::separator(); } return path; } @@ -66,7 +66,7 @@ QString Util::findBinaryInPath(QString binary) QString ret = ""; - binary.prepend("/"); + binary.prepend(QDir::separator()); if (_env.contains("PATH")) { QString path = _env.value("PATH"); @@ -83,13 +83,12 @@ QString Util::findBinaryInPath(QString binary) foreach(QString entry, entries) { QScopedPointer<QFileInfo> qfi(new QFileInfo(entry.append(binary))); - qDebug() << entry; - #ifdef Q_OS_WIN if (!qfi->exists()) { qfi.reset(new QFileInfo(entry.append(".exe"))); } #endif + qDebug() << entry; if (!qfi->isExecutable()) { continue; } |