summaryrefslogtreecommitdiff
path: root/src/libs/utils/fileinprojectfinder.cpp
diff options
context:
space:
mode:
authorOrgad Shaneh <orgad.shaneh@audiocodes.com>2016-09-10 22:57:46 +0300
committerOrgad Shaneh <orgads@gmail.com>2016-09-21 11:35:14 +0000
commited68bda40da8a515a6f51ffdaf3ca4be82d699e1 (patch)
tree11e48a8ff609feefeb899e463ba6f2a6e729bccb /src/libs/utils/fileinprojectfinder.cpp
parent5305a58a51476c31ff626316325a30d573dc561f (diff)
downloadqt-creator-ed68bda40da8a515a6f51ffdaf3ca4be82d699e1.tar.gz
Utils: Replace macro usages with HostOsInfo
Change-Id: Iddec811b4b57a2a898ebdf319a3e2ec875febd6c Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Diffstat (limited to 'src/libs/utils/fileinprojectfinder.cpp')
-rw-r--r--src/libs/utils/fileinprojectfinder.cpp25
1 files changed, 12 insertions, 13 deletions
diff --git a/src/libs/utils/fileinprojectfinder.cpp b/src/libs/utils/fileinprojectfinder.cpp
index ff6a7c36cc..5729b03b8e 100644
--- a/src/libs/utils/fileinprojectfinder.cpp
+++ b/src/libs/utils/fileinprojectfinder.cpp
@@ -25,6 +25,7 @@
#include "fileinprojectfinder.h"
#include "fileutils.h"
+#include "hostosinfo.h"
#include "qtcassert.h"
#include <QDebug>
@@ -141,25 +142,23 @@ QString FileInProjectFinder::findFile(const QUrl &fileUrl, bool *success) const
int prefixToIgnore = -1;
const QChar separator = QLatin1Char('/');
if (originalPath.startsWith(m_projectDir + separator)) {
-
-#ifdef Q_OS_MAC
- // starting with the project path is not sufficient if the file was
- // copied in an insource build, e.g. into MyApp.app/Contents/Resources
- static const QString appResourcePath = QString::fromLatin1(".app/Contents/Resources");
- if (originalPath.contains(appResourcePath)) {
- // the path is inside the project, but most probably as a resource of an insource build
- // so ignore that path
- prefixToIgnore = originalPath.indexOf(appResourcePath) + appResourcePath.length();
- } else {
-#endif
+ if (Utils::HostOsInfo::isMacHost()) {
+ // starting with the project path is not sufficient if the file was
+ // copied in an insource build, e.g. into MyApp.app/Contents/Resources
+ static const QString appResourcePath = QString::fromLatin1(".app/Contents/Resources");
+ if (originalPath.contains(appResourcePath)) {
+ // the path is inside the project, but most probably as a resource of an insource build
+ // so ignore that path
+ prefixToIgnore = originalPath.indexOf(appResourcePath) + appResourcePath.length();
+ }
+ }
+ if (prefixToIgnore == -1) {
if (debug)
qDebug() << "FileInProjectFinder: found" << originalPath << "in project directory";
if (success)
*success = true;
return originalPath;
-#ifdef Q_OS_MAC
}
-#endif
}
if (m_cache.contains(originalPath)) {