diff options
-rw-r--r-- | src/plugins/git/mergetool.cpp | 54 | ||||
-rw-r--r-- | src/plugins/ios/iosconfigurations.cpp | 19 | ||||
-rw-r--r-- | src/plugins/qtsupport/uicodemodelsupport.cpp | 10 | ||||
m--------- | src/shared/qbs | 0 |
4 files changed, 52 insertions, 31 deletions
diff --git a/src/plugins/git/mergetool.cpp b/src/plugins/git/mergetool.cpp index cc58e6ff07..6bd665c9ed 100644 --- a/src/plugins/git/mergetool.cpp +++ b/src/plugins/git/mergetool.cpp @@ -119,31 +119,35 @@ bool MergeTool::start(const QString &workingDirectory, const QStringList &files) MergeTool::FileState MergeTool::waitAndReadStatus(QString &extraInfo) { QByteArray state; - if (m_process->canReadLine() || (m_process->waitForReadyRead(500) && m_process->canReadLine())) { - state = m_process->readLine().trimmed(); - // " {local}: modified file" - // " {remote}: deleted" - if (!state.isEmpty()) { - state = state.mid(state.indexOf(':') + 2); - if (state == "deleted") - return DeletedState; - if (state.startsWith("modified")) - return ModifiedState; - if (state.startsWith("created")) - return CreatedState; - QByteArray submodulePrefix("submodule commit "); - // " {local}: submodule commit <hash>" - if (state.startsWith(submodulePrefix)) { - extraInfo = QString::fromLocal8Bit(state.mid(submodulePrefix.size())); - return SubmoduleState; - } - // " {local}: a symbolic link -> 'foo.cpp'" - QByteArray symlinkPrefix("a symbolic link -> '"); - if (state.startsWith(symlinkPrefix)) { - extraInfo = QString::fromLocal8Bit(state.mid(symlinkPrefix.size())); - extraInfo.chop(1); // remove last quote - return SymbolicLinkState; - } + for (int i = 0; i < 5; ++i) { + if (m_process->canReadLine()) { + state = m_process->readLine().trimmed(); + break; + } + m_process->waitForReadyRead(500); + } + // " {local}: modified file" + // " {remote}: deleted" + if (!state.isEmpty()) { + state = state.mid(state.indexOf(':') + 2); + if (state == "deleted") + return DeletedState; + if (state.startsWith("modified")) + return ModifiedState; + if (state.startsWith("created")) + return CreatedState; + QByteArray submodulePrefix("submodule commit "); + // " {local}: submodule commit <hash>" + if (state.startsWith(submodulePrefix)) { + extraInfo = QString::fromLocal8Bit(state.mid(submodulePrefix.size())); + return SubmoduleState; + } + // " {local}: a symbolic link -> 'foo.cpp'" + QByteArray symlinkPrefix("a symbolic link -> '"); + if (state.startsWith(symlinkPrefix)) { + extraInfo = QString::fromLocal8Bit(state.mid(symlinkPrefix.size())); + extraInfo.chop(1); // remove last quote + return SymbolicLinkState; } } return UnknownState; diff --git a/src/plugins/ios/iosconfigurations.cpp b/src/plugins/ios/iosconfigurations.cpp index 99334e64eb..01ecfb5713 100644 --- a/src/plugins/ios/iosconfigurations.cpp +++ b/src/plugins/ios/iosconfigurations.cpp @@ -300,11 +300,28 @@ void IosConfigurations::updateAutomaticKitList() } if (kitExists) { kitAtt->blockNotification(); + // TODO: this is just to fix up broken display names from before + QString baseDisplayName = tr("%1 %2").arg(p.name, qt->unexpandedDisplayName()); + QString displayName = baseDisplayName; + for (int iVers = 1; iVers < 100; ++iVers) { + bool unique = true; + foreach (const Kit *k, existingKits) { + if (k == kitAtt) + continue; + if (k->displayName() == displayName) { + unique = false; + break; + } + } + if (unique) break; + displayName = baseDisplayName + QLatin1Char('-') + QString::number(iVers); + } + kitAtt->setUnexpandedDisplayName(displayName); } else { qCDebug(kitSetupLog) << "setting up new kit for " << p.name; kitAtt = new Kit; kitAtt->setAutoDetected(true); - QString baseDisplayName = tr("%1 %2").arg(p.name, qt->displayName()); + QString baseDisplayName = tr("%1 %2").arg(p.name, qt->unexpandedDisplayName()); QString displayName = baseDisplayName; for (int iVers = 1; iVers < 100; ++iVers) { bool unique = true; diff --git a/src/plugins/qtsupport/uicodemodelsupport.cpp b/src/plugins/qtsupport/uicodemodelsupport.cpp index 358784c1b9..590efafc56 100644 --- a/src/plugins/qtsupport/uicodemodelsupport.cpp +++ b/src/plugins/qtsupport/uicodemodelsupport.cpp @@ -251,12 +251,12 @@ void UiCodeModelSupport::updateFromBuild() QString UiCodeModelSupport::uicCommand() const { QtSupport::BaseQtVersion *version; - if (m_project->needsConfiguration()) { - version = QtSupport::QtKitInformation::qtVersion(ProjectExplorer::KitManager::defaultKit()); - } else { - ProjectExplorer::Target *target = m_project->activeTarget(); + ProjectExplorer::Target *target; + if (!m_project->needsConfiguration() + && (target = m_project->activeTarget())) version = QtSupport::QtKitInformation::qtVersion(target->kit()); - } + else + version = QtSupport::QtKitInformation::qtVersion(ProjectExplorer::KitManager::defaultKit()); return version ? version->uicCommand() : QString(); } diff --git a/src/shared/qbs b/src/shared/qbs -Subproject 31881df00d0321f54b8f0d1865d8b16847befde +Subproject 55ff3783ce27c87517ae4758fdaca0f16a86367 |