forked from qt-creator/qt-creator
Qt4ProjectManager: Do not loop endless if the defaöt mkspec is broken
Reported on irc.
This commit is contained in:
@@ -1381,11 +1381,7 @@ void QtVersion::updateToolChainAndMkspec() const
|
|||||||
mkspecFullPath = baseMkspecDir + "/macx-g++";
|
mkspecFullPath = baseMkspecDir + "/macx-g++";
|
||||||
}
|
}
|
||||||
//resolve mkspec link
|
//resolve mkspec link
|
||||||
QFileInfo f3(mkspecFullPath);
|
mkspecFullPath = resolveLink(mkspecFullPath);
|
||||||
while (f3.isSymLink()) {
|
|
||||||
mkspecFullPath = f3.symLinkTarget();
|
|
||||||
f3.setFile(mkspecFullPath);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -1393,11 +1389,7 @@ void QtVersion::updateToolChainAndMkspec() const
|
|||||||
f2.close();
|
f2.close();
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
QFileInfo f2(mkspecFullPath);
|
mkspecFullPath =resolveLink(mkspecFullPath);
|
||||||
while (f2.isSymLink()) {
|
|
||||||
mkspecFullPath = f2.symLinkTarget();
|
|
||||||
f2.setFile(mkspecFullPath);
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef Q_OS_WIN
|
#ifdef Q_OS_WIN
|
||||||
@@ -1526,6 +1518,17 @@ void QtVersion::updateToolChainAndMkspec() const
|
|||||||
m_toolChainUpToDate = true;
|
m_toolChainUpToDate = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QString QtVersion::resolveLink(const QString &path) const
|
||||||
|
{
|
||||||
|
QFileInfo f(path);
|
||||||
|
int links = 16;
|
||||||
|
while (links-- && f.isSymLink())
|
||||||
|
f.setFile(f.symLinkTarget());
|
||||||
|
if (links <= 0)
|
||||||
|
return QString();
|
||||||
|
return f.path();
|
||||||
|
}
|
||||||
|
|
||||||
QString QtVersion::mwcDirectory() const
|
QString QtVersion::mwcDirectory() const
|
||||||
{
|
{
|
||||||
return m_mwcDirectory;
|
return m_mwcDirectory;
|
||||||
@@ -1622,7 +1625,8 @@ bool QtVersion::isValid() const
|
|||||||
&& !qmakeCommand().isEmpty()
|
&& !qmakeCommand().isEmpty()
|
||||||
&& !displayName().isEmpty()
|
&& !displayName().isEmpty()
|
||||||
&& !m_notInstalled
|
&& !m_notInstalled
|
||||||
&& m_versionInfo.contains("QT_INSTALL_BINS");
|
&& m_versionInfo.contains("QT_INSTALL_BINS")
|
||||||
|
&& !m_mkspecFullPath.isEmpty();
|
||||||
}
|
}
|
||||||
|
|
||||||
QString QtVersion::invalidReason() const
|
QString QtVersion::invalidReason() const
|
||||||
@@ -1638,6 +1642,8 @@ QString QtVersion::invalidReason() const
|
|||||||
if (!m_versionInfo.contains("QT_INSTALL_BINS"))
|
if (!m_versionInfo.contains("QT_INSTALL_BINS"))
|
||||||
return QCoreApplication::translate("QtVersion",
|
return QCoreApplication::translate("QtVersion",
|
||||||
"Could not determine the path to the binaries of the Qt installation, maybe the qmake path is wrong?");
|
"Could not determine the path to the binaries of the Qt installation, maybe the qmake path is wrong?");
|
||||||
|
if (m_mkspecFullPath.isEmpty())
|
||||||
|
return QCoreApplication::translate("QtVersion", "The default mkspec symlink is broken.");
|
||||||
return QString();
|
return QString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -189,6 +189,7 @@ private:
|
|||||||
void updateVersionInfo() const;
|
void updateVersionInfo() const;
|
||||||
QString findQtBinary(const QStringList &possibleName) const;
|
QString findQtBinary(const QStringList &possibleName) const;
|
||||||
void updateToolChainAndMkspec() const;
|
void updateToolChainAndMkspec() const;
|
||||||
|
QString resolveLink(const QString &path) const;
|
||||||
QString m_displayName;
|
QString m_displayName;
|
||||||
QString m_sourcePath;
|
QString m_sourcePath;
|
||||||
QString m_mingwDirectory;
|
QString m_mingwDirectory;
|
||||||
|
|||||||
Reference in New Issue
Block a user