forked from qt-creator/qt-creator
Fix MSVC64 warning about integer truncation in qtChooserToQmakePath().
Change-Id: Ic3a51fc94e4204c2b97936c0294b054a08fed72f Reviewed-by: Daniel Teske <daniel.teske@digia.com>
This commit is contained in:
@@ -44,6 +44,7 @@ bool BuildableHelperLibrary::isQtChooser(const QFileInfo &info)
|
|||||||
|
|
||||||
QString BuildableHelperLibrary::qtChooserToQmakePath(const QString &path)
|
QString BuildableHelperLibrary::qtChooserToQmakePath(const QString &path)
|
||||||
{
|
{
|
||||||
|
const char toolDir[] = "QTTOOLDIR=\"";
|
||||||
QProcess proc;
|
QProcess proc;
|
||||||
proc.start(path, QStringList(QLatin1String("-print-env")));
|
proc.start(path, QStringList(QLatin1String("-print-env")));
|
||||||
if (!proc.waitForStarted(1000))
|
if (!proc.waitForStarted(1000))
|
||||||
@@ -51,10 +52,10 @@ QString BuildableHelperLibrary::qtChooserToQmakePath(const QString &path)
|
|||||||
if (!proc.waitForFinished(1000))
|
if (!proc.waitForFinished(1000))
|
||||||
return QString();
|
return QString();
|
||||||
QByteArray output = proc.readAllStandardOutput();
|
QByteArray output = proc.readAllStandardOutput();
|
||||||
int pos = output.indexOf("QTTOOLDIR=");
|
int pos = output.indexOf(toolDir);
|
||||||
if (pos == -1)
|
if (pos == -1)
|
||||||
return QString();
|
return QString();
|
||||||
pos += strlen("QTTOOLDIR=\"");
|
pos += int(sizeof(toolDir)) - 1;
|
||||||
int end = output.indexOf('\"', pos);
|
int end = output.indexOf('\"', pos);
|
||||||
if (end == -1)
|
if (end == -1)
|
||||||
return QString();
|
return QString();
|
||||||
|
|||||||
Reference in New Issue
Block a user