Commit 0f353387 authored by dt's avatar dt
Browse files

Fix a one off error in figuring out the cached generator.

Though there's still a bug in that canReadLine() returns false.
parent 261796c3
...@@ -354,16 +354,18 @@ void CMakeRunPage::initializePage() ...@@ -354,16 +354,18 @@ void CMakeRunPage::initializePage()
m_generatorComboBox->setVisible(true); m_generatorComboBox->setVisible(true);
QString cachedGenerator; QString cachedGenerator;
// Try to find out generator from CMakeCachhe file, if it exists // Try to find out generator from CMakeCachhe file, if it exists
QFile fi(m_buildDirectory + "/CMakeCache.txt"); QFile fi(m_buildDirectory + "/CMakeCache.txt");
if (fi.exists()) { if (fi.exists()) {
// Cache exists, then read it... // Cache exists, then read it...
if (fi.open(QIODevice::ReadOnly)) { if (fi.open(QIODevice::ReadOnly | QIODevice::Text)) {
while (fi.canReadLine()) { while (fi.canReadLine()) {
QString line = fi.readLine(); QString line = fi.readLine();
if (line.startsWith("CMAKE_GENERATOR:INTERNAL=")) { if (line.startsWith("CMAKE_GENERATOR:INTERNAL=")) {
int splitpos = line.indexOf('='); int splitpos = line.indexOf('=');
if (splitpos != -1) { if (splitpos != -1) {
cachedGenerator = line.mid(splitpos).trimmed(); cachedGenerator = line.mid(splitpos + 1).trimmed();
} }
break; break;
} }
......
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