From ec94e042d9684c8661a78ac5fb86a553f9b67319 Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Fri, 2 May 2014 14:47:39 +0200 Subject: [PATCH] Replace unneeded #ifdef. Change-Id: I2ff32f7013fc863d998a8317d4c409a9a2c295c1 Reviewed-by: Eike Ziller Reviewed-by: hjk --- src/libs/utils/fileutils.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/libs/utils/fileutils.cpp b/src/libs/utils/fileutils.cpp index a836ad27a30..86c196421a4 100644 --- a/src/libs/utils/fileutils.cpp +++ b/src/libs/utils/fileutils.cpp @@ -293,15 +293,15 @@ bool FileUtils::isRelativePath(const QString &path) { if (path.startsWith(QLatin1Char('/'))) return false; -#ifdef Q_OS_WIN - if (path.startsWith(QLatin1Char('\\'))) - return false; - // Unlike QFileInfo, this won't accept a relative path with a drive letter. - // Such paths result in a royal mess anyway ... - if (path.length() >= 3 && path.at(1) == QLatin1Char(':') && path.at(0).isLetter() - && (path.at(2) == QLatin1Char('/') || path.at(2) == QLatin1Char('\\'))) - return false; -#endif + if (HostOsInfo::isWindowsHost()) { + if (path.startsWith(QLatin1Char('\\'))) + return false; + // Unlike QFileInfo, this won't accept a relative path with a drive letter. + // Such paths result in a royal mess anyway ... + if (path.length() >= 3 && path.at(1) == QLatin1Char(':') && path.at(0).isLetter() + && (path.at(2) == QLatin1Char('/') || path.at(2) == QLatin1Char('\\'))) + return false; + } return true; }