Fix "File name case mismatch" error when debugging QML apps (Win)

Work around QTBUG-17529 by normalizing the capitalization of the
working directory (which we do already for launching apps without
debugging).

Task-number: QTCREATORBUG-4592
Reviewed-by: Friedemann Kleint
This commit is contained in:
Kai Koehne
2011-04-19 11:07:34 +02:00
committed by con
parent 3f6e418b68
commit c3e2fd9ed7
5 changed files with 28 additions and 15 deletions

View File

@@ -45,7 +45,7 @@
#include <qt4projectmanager/qtoutputformatter.h>
#include <qt4projectmanager/qt4projectmanagerconstants.h>
#ifdef Q_OS_WIN32
#ifdef Q_OS_WIN
#include <utils/winutils.h>
#endif
@@ -180,20 +180,13 @@ void QmlProjectRunConfiguration::setQtVersionId(int id)
}
/* QtDeclarative checks explicitly that the capitalization for any URL / path
is exactly like the capitalization on disk. This method is uses the same
native Windows API's to get the exact canonical path. */
is exactly like the capitalization on disk.*/
QString QmlProjectRunConfiguration::canonicalCapsPath(const QString &fileName)
{
QString canonicalPath = QFileInfo(fileName).canonicalFilePath();
#if defined(Q_OS_WIN32)
// don't know whether the shortpath step is really needed,
// but we do this in QtDeclarative too.
QString path = Utils::getShortPathName(canonicalPath);
if (!path.isEmpty())
path = Utils::getLongPathName(canonicalPath);
if (!path.isEmpty())
canonicalPath = path;
#if defined(Q_OS_WIN)
canonicalPath = Utils::normalizePathName(canonicalPath);
#endif
return canonicalPath;