Commit 44a8e937 authored by Eike Ziller's avatar Eike Ziller

Provide a way to override file name case sensitivity.

Change-Id: I47ed4f590e5f25380c2052fa77eae3f0d315c5d3
Task-number: QTCREATORBUG-13507
Reviewed-by: default avatarDaniel Teske <daniel.teske@theqtcompany.com>
parent 701f9390
......@@ -38,6 +38,9 @@
using namespace Utils;
Qt::CaseSensitivity HostOsInfo::m_overrideFileNameCaseSensitivity = Qt::CaseSensitive;
bool HostOsInfo::m_useOverrideFileNameCaseSensitivity = false;
#ifdef Q_OS_WIN
static WORD hostProcessorArchitecture()
{
......@@ -67,3 +70,14 @@ HostOsInfo::HostArchitecture HostOsInfo::hostArchitecture()
return HostOsInfo::HostArchitectureUnknown;
#endif
}
void HostOsInfo::setOverrideFileNameCaseSensitivity(Qt::CaseSensitivity sensitivity)
{
m_useOverrideFileNameCaseSensitivity = true;
m_overrideFileNameCaseSensitivity = sensitivity;
}
void HostOsInfo::unsetOverrideFileNameCaseSensitivity()
{
m_useOverrideFileNameCaseSensitivity = false;
}
......@@ -64,9 +64,14 @@ public:
return hostOsAspects().withExecutableSuffix(executable);
}
static void setOverrideFileNameCaseSensitivity(Qt::CaseSensitivity sensitivity);
static void unsetOverrideFileNameCaseSensitivity();
static Qt::CaseSensitivity fileNameCaseSensitivity()
{
return hostOsAspects().fileNameCaseSensitivity();
return m_useOverrideFileNameCaseSensitivity
? m_overrideFileNameCaseSensitivity
: hostOsAspects().fileNameCaseSensitivity();
}
static QChar pathListSeparator()
......@@ -81,6 +86,9 @@ public:
private:
static OsSpecificAspects hostOsAspects() { return OsSpecificAspects(hostOs()); }
static Qt::CaseSensitivity m_overrideFileNameCaseSensitivity;
static bool m_useOverrideFileNameCaseSensitivity;
};
......
......@@ -12,6 +12,7 @@ SOURCES += \
../../libs/utils/checkablemessagebox.cpp \
../../libs/utils/environment.cpp \
../../libs/utils/fileutils.cpp \
../../libs/utils/hostosinfo.cpp \
../../libs/utils/savefile.cpp
......@@ -24,6 +25,7 @@ HEADERS += \
../../libs/utils/checkablemessagebox.h \
../../libs/utils/environment.h \
../../libs/utils/fileutils.h \
../../libs/utils/hostosinfo.h \
../../libs/utils/savefile.h
FORMS += \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment