diff options
author | Anne Jan Brouwer <brouwer@annejan.com> | 2015-06-10 00:02:11 +0200 |
---|---|---|
committer | Anne Jan Brouwer <brouwer@annejan.com> | 2015-06-10 00:02:11 +0200 |
commit | ca2886d6a84529f7f0d801e4104c77f5e62b5fb3 (patch) | |
tree | 02f27f7ba8cc33b7a1d1af8e95bb37ad720cde91 | |
parent | 830fed8fbd762be37c186bfa4733696b7da3d11e (diff) | |
parent | 208171fd09c55ad765fdf4fa1de9a7f0757fa72d (diff) |
Merge branch 'develop' into feature/trayicon
-rw-r--r-- | util.cpp | 16 |
1 files changed, 10 insertions, 6 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,25 +66,29 @@ QString Util::findBinaryInPath(QString binary) QString ret = ""; - binary.prepend("/"); + binary.prepend(QDir::separator()); if (_env.contains("PATH")) { QString path = _env.value("PATH"); - QStringList entries = path.split(':'); + QStringList entries; +#ifndef Q_OS_WIN + entries = path.split(':'); if (entries.length() < 2) { +#endif entries = path.split(';'); +#ifndef Q_OS_WIN } +#endif 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; } |