summaryrefslogtreecommitdiff
path: root/src/plugins
diff options
context:
space:
mode:
authorEike Ziller <eike.ziller@digia.com>2014-05-02 10:00:20 +0200
committerEike Ziller <eike.ziller@digia.com>2014-05-02 10:00:20 +0200
commit0fb641c90e64054a28a39e3f48d96f953399805a (patch)
tree504f097db01334a87316f8e825f1db0cba6bfba1 /src/plugins
parentf4520bafaccb0832266f8d88f254e910ed7a23f4 (diff)
parent4b2cc015f867941a7ae35a38d81ec9daa5616711 (diff)
downloadqt-creator-0fb641c90e64054a28a39e3f48d96f953399805a.tar.gz
Merge remote-tracking branch 'origin/3.1'
Conflicts: qtcreator.pri qtcreator.qbs src/libs/qmljs/qmljsmodelmanagerinterface.cpp src/plugins/qmldesigner/designercore/instances/nodeinstanceserverproxy.cpp Change-Id: Ie216b715d6f87a6d72d3b8fe3d4e777e561579f9
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/clangcodemodel/clangcodemodel.qbs4
-rw-r--r--src/plugins/cpptools/cpptoolseditorsupport.cpp173
-rw-r--r--src/plugins/cpptools/cpptoolseditorsupport.h11
-rw-r--r--src/plugins/debugger/debuggeritemmanager.cpp2
-rw-r--r--src/plugins/diffeditor/sidebysidediffeditorwidget.cpp5
-rw-r--r--src/plugins/fakevim/fakevimhandler.cpp2
-rw-r--r--src/plugins/git/gitclient.cpp45
-rw-r--r--src/plugins/git/gitclient.h3
-rw-r--r--src/plugins/projectexplorer/taskmodel.cpp3
-rw-r--r--src/plugins/qbsprojectmanager/defaultpropertyprovider.cpp26
-rw-r--r--src/plugins/qbsprojectmanager/qbsconstants.h3
-rw-r--r--src/plugins/qbsprojectmanager/qbsprojectmanager.cpp6
-rw-r--r--src/plugins/qmakeprojectmanager/qmakenodes.cpp80
-rw-r--r--src/plugins/qmakeprojectmanager/qmakenodes.h2
-rw-r--r--src/plugins/qmldesigner/designercore/metainfo/subcomponentmanager.cpp1
-rw-r--r--src/plugins/qmldesigner/qtquickplugin/source/listview.qml1
-rw-r--r--src/plugins/qmldesigner/qtquickplugin/source/listviewv2.qml1
-rw-r--r--src/plugins/valgrind/memcheckerrorview.cpp2
-rw-r--r--src/plugins/valgrind/memchecktool.cpp6
-rw-r--r--src/plugins/valgrind/valgrindprocess.cpp2
-rw-r--r--src/plugins/valgrind/xmlprotocol/errorlistmodel.cpp2
21 files changed, 216 insertions, 164 deletions
diff --git a/src/plugins/clangcodemodel/clangcodemodel.qbs b/src/plugins/clangcodemodel/clangcodemodel.qbs
index 170b720c4b..c2c8ed7034 100644
--- a/src/plugins/clangcodemodel/clangcodemodel.qbs
+++ b/src/plugins/clangcodemodel/clangcodemodel.qbs
@@ -11,7 +11,7 @@ QtcPlugin {
Depends { name: "TextEditor" }
Depends { name: "Utils" }
- property string llvmInstallDir: qbs.getenv("LLVM_INSTALL_DIR")
+ property string llvmInstallDir: qbs.getEnv("LLVM_INSTALL_DIR")
condition: llvmInstallDir && !llvmInstallDir.isEmpty
property bool clangCompletion: true
@@ -33,7 +33,7 @@ QtcPlugin {
}
// Find llvm-config* in PATH
- var pathListString = qbs.getenv("PATH");
+ var pathListString = qbs.getEnv("PATH");
var separator = qbs.hostOS.contains("windows") ? ";" : ":";
var pathList = pathListString.split(separator);
for (var i = 0; i < llvmConfigVariants.length; ++i) {
diff --git a/src/plugins/cpptools/cpptoolseditorsupport.cpp b/src/plugins/cpptools/cpptoolseditorsupport.cpp
index 01d05e143c..1f18b1db31 100644
--- a/src/plugins/cpptools/cpptoolseditorsupport.cpp
+++ b/src/plugins/cpptools/cpptoolseditorsupport.cpp
@@ -224,17 +224,12 @@ bool CppEditorSupport::initialized()
SemanticInfo CppEditorSupport::recalculateSemanticInfo()
{
m_futureSemanticInfo.cancel();
-
- SemanticInfo::Source source = currentSource(false);
- recalculateSemanticInfoNow(source, /*emitSignalWhenFinished=*/ false);
- return m_lastSemanticInfo;
+ return recalculateSemanticInfoNow(currentSource(false), /*emitSignalWhenFinished=*/ false);
}
Document::Ptr CppEditorSupport::lastSemanticInfoDocument() const
{
- QMutexLocker locker(&m_lastSemanticInfoLock);
-
- return m_lastSemanticInfo.doc;
+ return semanticInfo().doc;
}
void CppEditorSupport::recalculateSemanticInfoDetached(ForceReason forceReason)
@@ -348,17 +343,13 @@ void CppEditorSupport::onDocumentUpdated(Document::Ptr doc)
setExtraDiagnostics(key, doc->diagnosticMessages());
}
- // update semantic info in a future
- if (!m_initialized ||
- (m_textEditor->widget()->isVisible()
- && (m_lastSemanticInfo.doc.isNull()
- || m_lastSemanticInfo.doc->translationUnit()->ast() == 0
- || m_lastSemanticInfo.doc->fileName() != fileName()))) {
+ // Update semantic info if necessary
+ if (!m_initialized || (m_textEditor->widget()->isVisible() && !isSemanticInfoValid())) {
m_initialized = true;
- recalculateSemanticInfoDetached(ForceDueToMissingSemanticInfo);
+ recalculateSemanticInfoDetached(ForceDueToInvalidSemanticInfo);
}
- // notify the editor that the document is updated
+ // Notify the editor that the document is updated
emit documentUpdated();
}
@@ -368,34 +359,18 @@ void CppEditorSupport::startHighlighting(ForceReason forceReason)
return;
if (m_highlightingSupport->requiresSemanticInfo()) {
- Snapshot snapshot;
- Document::Ptr doc;
- unsigned revision;
- bool forced;
- bool complete;
-
- {
- QMutexLocker locker(&m_lastSemanticInfoLock);
- snapshot = m_lastSemanticInfo.snapshot;
- doc = m_lastSemanticInfo.doc;
- revision = m_lastSemanticInfo.revision;
- forced = m_lastSemanticInfo.forced;
- complete = m_lastSemanticInfo.complete;
- }
-
- if (doc.isNull())
+ const SemanticInfo info = semanticInfo();
+ if (info.doc.isNull())
return;
- if (!m_lastHighlightOnCompleteSemanticInfo)
- forced = true;
-
- if (!forced && m_lastHighlightRevision == revision)
+ const bool forced = info.forced || !m_lastHighlightOnCompleteSemanticInfo;
+ if (!forced && m_lastHighlightRevision == info.revision)
return;
m_highlighter.cancel();
- m_highlighter = m_highlightingSupport->highlightingFuture(doc, snapshot);
- m_lastHighlightRevision = revision;
- m_lastHighlightOnCompleteSemanticInfo = complete;
+ m_highlighter = m_highlightingSupport->highlightingFuture(info.doc, info.snapshot);
+ m_lastHighlightRevision = info.revision;
+ m_lastHighlightOnCompleteSemanticInfo = info.complete;
emit highlighterStarted(&m_highlighter, m_lastHighlightRevision);
} else {
const unsigned revision = editorRevision();
@@ -496,8 +471,7 @@ void CppEditorSupport::onCurrentEditorChanged()
m_editorVisible = editorVisible;
if (editorVisible) {
m_editorGCTimer->stop();
- QMutexLocker locker(&m_lastSemanticInfoLock);
- if (!m_lastSemanticInfo.doc)
+ if (!lastSemanticInfoDocument())
updateDocumentNow();
} else {
m_editorGCTimer->start(EditorHiddenGCTimeout);
@@ -510,8 +484,7 @@ void CppEditorSupport::releaseResources()
m_highlighter.cancel();
m_highlighter = QFuture<TextEditor::HighlightingResult>();
snapshotUpdater()->releaseSnapshot();
- QMutexLocker semanticLocker(&m_lastSemanticInfoLock);
- m_lastSemanticInfo = SemanticInfo();
+ setSemanticInfo(SemanticInfo(), /*emitSignal=*/ false);
m_lastHighlightOnCompleteSemanticInfo = true;
}
@@ -524,66 +497,54 @@ SemanticInfo::Source CppEditorSupport::currentSource(bool force)
force);
}
-void CppEditorSupport::recalculateSemanticInfoNow(const SemanticInfo::Source &source,
- bool emitSignalWhenFinished,
- FuturizedTopLevelDeclarationProcessor *processor)
+SemanticInfo CppEditorSupport::recalculateSemanticInfoNow(const SemanticInfo::Source &source,
+ bool emitSignalWhenFinished,
+ FuturizedTopLevelDeclarationProcessor *processor)
{
- SemanticInfo semanticInfo;
+ const SemanticInfo lastSemanticInfo = semanticInfo();
+ SemanticInfo newSemanticInfo;
- {
- QMutexLocker locker(&m_lastSemanticInfoLock);
- semanticInfo.revision = m_lastSemanticInfo.revision;
- semanticInfo.forced = source.force;
-
- if (!source.force
- && m_lastSemanticInfo.complete
- && m_lastSemanticInfo.revision == source.revision
- && m_lastSemanticInfo.doc
- && m_lastSemanticInfo.doc->translationUnit()->ast()
- && m_lastSemanticInfo.doc->fileName() == source.fileName) {
- semanticInfo.snapshot = m_lastSemanticInfo.snapshot; // ### TODO: use the new snapshot.
- semanticInfo.doc = m_lastSemanticInfo.doc;
- }
- }
+ newSemanticInfo.forced = source.force;
+ newSemanticInfo.revision = source.revision;
+
+ // Try to reuse as much as possible from the last semantic info
+ if (!source.force
+ && lastSemanticInfo.complete
+ && lastSemanticInfo.revision == source.revision
+ && lastSemanticInfo.doc
+ && lastSemanticInfo.doc->translationUnit()->ast()
+ && lastSemanticInfo.doc->fileName() == source.fileName) {
+ newSemanticInfo.snapshot = lastSemanticInfo.snapshot; // ### TODO: use the new snapshot.
+ newSemanticInfo.doc = lastSemanticInfo.doc;
- if (semanticInfo.doc.isNull()) {
+ // Otherwise reprocess document
+ } else {
const QSharedPointer<SnapshotUpdater> snapshotUpdater = snapshotUpdater_internal();
- QTC_ASSERT(snapshotUpdater, return);
- semanticInfo.snapshot = snapshotUpdater->snapshot();
-
- if (semanticInfo.snapshot.contains(source.fileName)) {
- Document::Ptr doc = semanticInfo.snapshot.preprocessedDocument(source.code,
- source.fileName);
- if (processor)
- doc->control()->setTopLevelDeclarationProcessor(processor);
- doc->check();
- if (processor && processor->isCanceled())
- semanticInfo.complete = false;
- semanticInfo.doc = doc;
- } else {
- return;
- }
+ QTC_ASSERT(snapshotUpdater, return newSemanticInfo);
+ newSemanticInfo.snapshot = snapshotUpdater->snapshot();
+ QTC_ASSERT(newSemanticInfo.snapshot.contains(source.fileName), return newSemanticInfo);
+ Document::Ptr doc = newSemanticInfo.snapshot.preprocessedDocument(source.code,
+ source.fileName);
+ if (processor)
+ doc->control()->setTopLevelDeclarationProcessor(processor);
+ doc->check();
+ if (processor && processor->isCanceled())
+ newSemanticInfo.complete = false;
+ newSemanticInfo.doc = doc;
}
- if (semanticInfo.doc) {
- TranslationUnit *translationUnit = semanticInfo.doc->translationUnit();
- AST * ast = translationUnit->ast();
-
- FunctionDefinitionUnderCursor functionDefinitionUnderCursor(semanticInfo.doc->translationUnit());
- DeclarationAST *currentFunctionDefinition = functionDefinitionUnderCursor(ast, source.line, source.column);
+ // Update local uses for the document
+ TranslationUnit *translationUnit = newSemanticInfo.doc->translationUnit();
+ AST *ast = translationUnit->ast();
+ FunctionDefinitionUnderCursor functionDefinitionUnderCursor(newSemanticInfo.doc->translationUnit());
+ const LocalSymbols useTable(newSemanticInfo.doc,
+ functionDefinitionUnderCursor(ast, source.line, source.column));
+ newSemanticInfo.localUses = useTable.uses;
- const LocalSymbols useTable(semanticInfo.doc, currentFunctionDefinition);
- semanticInfo.revision = source.revision;
- semanticInfo.localUses = useTable.uses;
- }
+ // Update semantic info
+ setSemanticInfo(newSemanticInfo, emitSignalWhenFinished);
- {
- QMutexLocker locker(&m_lastSemanticInfoLock);
- m_lastSemanticInfo = semanticInfo;
- }
-
- if (emitSignalWhenFinished)
- emit semanticInfoUpdated(semanticInfo);
+ return newSemanticInfo;
}
void CppEditorSupport::recalculateSemanticInfoDetached_helper(QFutureInterface<void> &future, SemanticInfo::Source source)
@@ -592,6 +553,30 @@ void CppEditorSupport::recalculateSemanticInfoDetached_helper(QFutureInterface<v
recalculateSemanticInfoNow(source, true, &processor);
}
+bool CppEditorSupport::isSemanticInfoValid() const
+{
+ const Document::Ptr document = lastSemanticInfoDocument();
+ return document
+ && document->translationUnit()->ast()
+ && document->fileName() == fileName();
+}
+
+SemanticInfo CppEditorSupport::semanticInfo() const
+{
+ QMutexLocker locker(&m_lastSemanticInfoLock);
+ return m_lastSemanticInfo;
+}
+
+void CppEditorSupport::setSemanticInfo(const SemanticInfo &semanticInfo, bool emitSignal)
+{
+ {
+ QMutexLocker locker(&m_lastSemanticInfoLock);
+ m_lastSemanticInfo = semanticInfo;
+ }
+ if (emitSignal)
+ emit semanticInfoUpdated(semanticInfo);
+}
+
QSharedPointer<SnapshotUpdater> CppEditorSupport::snapshotUpdater_internal() const
{
QMutexLocker locker(&m_snapshotUpdaterLock);
diff --git a/src/plugins/cpptools/cpptoolseditorsupport.h b/src/plugins/cpptools/cpptoolseditorsupport.h
index f452304bfb..e0b6f9dddc 100644
--- a/src/plugins/cpptools/cpptoolseditorsupport.h
+++ b/src/plugins/cpptools/cpptoolseditorsupport.h
@@ -121,7 +121,7 @@ public:
enum ForceReason {
NoForce,
- ForceDueToMissingSemanticInfo,
+ ForceDueToInvalidSemanticInfo,
ForceDueEditorRequest
};
@@ -192,11 +192,16 @@ private:
};
SemanticInfo::Source currentSource(bool force);
- void recalculateSemanticInfoNow(const SemanticInfo::Source &source, bool emitSignalWhenFinished,
- FuturizedTopLevelDeclarationProcessor *processor = 0);
+ SemanticInfo recalculateSemanticInfoNow(const SemanticInfo::Source &source,
+ bool emitSignalWhenFinished,
+ FuturizedTopLevelDeclarationProcessor *processor = 0);
void recalculateSemanticInfoDetached_helper(QFutureInterface<void> &future,
SemanticInfo::Source source);
+ bool isSemanticInfoValid() const;
+ SemanticInfo semanticInfo() const;
+ void setSemanticInfo(const SemanticInfo &semanticInfo, bool emitSignal = true);
+
QSharedPointer<SnapshotUpdater> snapshotUpdater_internal() const;
void setSnapshotUpdater_internal(const QSharedPointer<SnapshotUpdater> &updater);
diff --git a/src/plugins/debugger/debuggeritemmanager.cpp b/src/plugins/debugger/debuggeritemmanager.cpp
index c1f2cc74b5..9fa40c2fa0 100644
--- a/src/plugins/debugger/debuggeritemmanager.cpp
+++ b/src/plugins/debugger/debuggeritemmanager.cpp
@@ -249,7 +249,7 @@ void DebuggerItemManager::autoDetectGdbOrLldbDebuggers()
}
foreach (const QFileInfo &fi, suspects) {
- if (fi.exists() && fi.isExecutable()) {
+ if (fi.exists() && fi.isExecutable() && !fi.isDir()) {
FileName command = FileName::fromString(fi.absoluteFilePath());
if (findByCommand(command))
continue;
diff --git a/src/plugins/diffeditor/sidebysidediffeditorwidget.cpp b/src/plugins/diffeditor/sidebysidediffeditorwidget.cpp
index 7e4e8ddf34..9f0c7e8604 100644
--- a/src/plugins/diffeditor/sidebysidediffeditorwidget.cpp
+++ b/src/plugins/diffeditor/sidebysidediffeditorwidget.cpp
@@ -287,6 +287,9 @@ void MultiHighlighter::highlightBlock(const QString &text)
QTextBlock documentBlock = currentDocument->findBlockByNumber(
block.blockNumber() - m_editor->blockNumberForFileIndex(fileIndex));
+ if (!documentBlock.isValid())
+ return;
+
QList<QTextLayout::FormatRange> formats = documentBlock.layout()->additionalFormats();
setExtraAdditionalFormats(block, formats);
}
@@ -960,6 +963,8 @@ void SideBySideDiffEditorWidget::showDiff()
blockNumber++;
}
}
+ leftText.replace(QLatin1Char('\r'), QLatin1Char(' '));
+ rightText.replace(QLatin1Char('\r'), QLatin1Char(' '));
leftTexts += leftText;
rightTexts += rightText;
leftDocs.append(qMakePair(contextFileData.leftFileInfo, leftText));
diff --git a/src/plugins/fakevim/fakevimhandler.cpp b/src/plugins/fakevim/fakevimhandler.cpp
index 8a042d77dd..aebf366fe1 100644
--- a/src/plugins/fakevim/fakevimhandler.cpp
+++ b/src/plugins/fakevim/fakevimhandler.cpp
@@ -6179,7 +6179,7 @@ bool FakeVimHandler::Private::handleExPluginCommand(const ExCommand &cmd)
commitCursor();
emit q->handleExCommandRequested(&handled, cmd);
//qDebug() << "HANDLER REQUEST: " << cmd.cmd << handled;
- if (handled) {
+ if (handled && (m_textedit || m_plaintextedit)) {
pullCursor();
if (m_cursor.position() != pos)
recordJump(pos);
diff --git a/src/plugins/git/gitclient.cpp b/src/plugins/git/gitclient.cpp
index 402b132b09..1f7864b544 100644
--- a/src/plugins/git/gitclient.cpp
+++ b/src/plugins/git/gitclient.cpp
@@ -2401,8 +2401,7 @@ SubmoduleDataMap GitClient::submoduleList(const QString &workingDirectory)
if (cachedSubmoduleData.contains(workingDirectory))
return cachedSubmoduleData.value(workingDirectory);
- QStringList allConfigs =
- commandOutputFromLocal8Bit(readConfig(workingDirectory, QLatin1String("-l")))
+ QStringList allConfigs = readConfigValue(workingDirectory, QLatin1String("-l"))
.split(QLatin1Char('\n'));
const QString submoduleLineStart = QLatin1String("submodule.");
foreach (const QString &configLine, allConfigs) {
@@ -3015,7 +3014,7 @@ QString GitClient::gitBinaryPath(bool *ok, QString *errorMessage) const
QTextCodec *GitClient::encoding(const QString &workingDirectory, const QByteArray &configVar) const
{
- QByteArray codecName = readConfig(workingDirectory, QLatin1String(configVar)).trimmed();
+ QByteArray codecName = readConfigBytes(workingDirectory, QLatin1String(configVar)).trimmed();
// Set default commit encoding to 'UTF-8', when it's not set,
// to solve displaying error of commit log with non-latin characters.
if (codecName.isEmpty())
@@ -3023,6 +3022,15 @@ QTextCodec *GitClient::encoding(const QString &workingDirectory, const QByteArra
return QTextCodec::codecForName(codecName);
}
+// returns first line from log and removes it
+static QByteArray shiftLogLine(QByteArray &logText)
+{
+ const int index = logText.indexOf('\n');
+ const QByteArray res = logText.left(index);
+ logText.remove(0, index + 1);
+ return res;
+}
+
bool GitClient::getCommitData(const QString &workingDirectory,
QString *commitTemplate,
CommitData &commitData,
@@ -3109,19 +3117,20 @@ bool GitClient::getCommitData(const QString &workingDirectory,
case AmendCommit: {
// Amend: get last commit data as "SHA1<tab>author<tab>email<tab>message".
QStringList args(QLatin1String("log"));
- args << QLatin1String("--max-count=1") << QLatin1String("--pretty=format:%h\t%an\t%ae\t%B");
- const Utils::SynchronousProcessResponse sp = synchronousGit(repoDirectory, args, 0,
- commitData.commitEncoding);
- if (sp.result != Utils::SynchronousProcessResponse::Finished) {
+ args << QLatin1String("--max-count=1") << QLatin1String("--pretty=format:%h\n%an\n%ae\n%B");
+ QByteArray outputText;
+ if (!fullySynchronousGit(repoDirectory, args, &outputText, 0,
+ VcsBasePlugin::SuppressCommandLogging)) {
*errorMessage = tr("Cannot retrieve last commit data of repository \"%1\".").arg(repoDirectory);
return false;
}
- QStringList values = sp.stdOut.split(QLatin1Char('\t'));
- QTC_ASSERT(values.size() >= 4, return false);
- commitData.amendSHA1 = values.takeFirst();
- commitData.panelData.author = values.takeFirst();
- commitData.panelData.email = values.takeFirst();
- *commitTemplate = values.join(QLatin1String("\t"));
+ QTextCodec *authorCodec = Utils::HostOsInfo::isWindowsHost()
+ ? QTextCodec::codecForName("UTF-8")
+ : commitData.commitEncoding;
+ commitData.amendSHA1 = QString::fromLatin1(shiftLogLine(outputText));
+ commitData.panelData.author = authorCodec->toUnicode(shiftLogLine(outputText));
+ commitData.panelData.email = authorCodec->toUnicode(shiftLogLine(outputText));
+ *commitTemplate = commitData.commitEncoding->toUnicode(outputText);
break;
}
case SimpleCommit: {
@@ -3739,7 +3748,7 @@ bool GitClient::synchronousStashList(const QString &workingDirectory,
return true;
}
-QByteArray GitClient::readConfig(const QString &workingDirectory, const QString &configVar) const
+QByteArray GitClient::readConfigBytes(const QString &workingDirectory, const QString &configVar) const
{
QStringList arguments;
arguments << QLatin1String("config") << configVar;
@@ -3757,7 +3766,13 @@ QByteArray GitClient::readConfig(const QString &workingDirectory, const QString
// Read a single-line config value, return trimmed
QString GitClient::readConfigValue(const QString &workingDirectory, const QString &configVar) const
{
- return commandOutputFromLocal8Bit(readConfig(workingDirectory, configVar).trimmed());
+ // msysGit always uses UTF-8 for configuration:
+ // https://github.com/msysgit/msysgit/wiki/Git-for-Windows-Unicode-Support#convert-config-files
+ static QTextCodec *codec = Utils::HostOsInfo::isWindowsHost()
+ ? QTextCodec::codecForName("UTF-8")
+ : QTextCodec::codecForLocale();
+ const QByteArray value = readConfigBytes(workingDirectory, configVar).trimmed();
+ return Utils::SynchronousProcess::normalizeNewlines(codec->toUnicode(value));
}
bool GitClient::cloneRepository(const QString &directory,const QByteArray &url)
diff --git a/src/plugins/git/gitclient.h b/src/plugins/git/gitclient.h
index ac964380f0..c95e7fef18 100644
--- a/src/plugins/git/gitclient.h
+++ b/src/plugins/git/gitclient.h
@@ -281,8 +281,6 @@ public:
const QString &messge, QString *name,
QString *errorMessage = 0);
- QByteArray readConfig(const QString &workingDirectory, const QString &configVar) const;
-
QString readConfigValue(const QString &workingDirectory, const QString &configVar) const;
QTextCodec *encoding(const QString &workingDirectory, const QByteArray &configVar) const;
@@ -345,6 +343,7 @@ private slots:
void fetchFinished(const QVariant &cookie);
private:
+ QByteArray readConfigBytes(const QString &workingDirectory, const QString &configVar) const;
QTextCodec *getSourceCodec(const QString &file) const;
VcsBase::VcsBaseEditorWidget *findExistingVCSEditor(const char *registerDynamicProperty,
const QString &dynamicPropertyValue) const;
diff --git a/src/plugins/projectexplorer/taskmodel.cpp b/src/plugins/projectexplorer/taskmodel.cpp
index 5c8a67cf47..75fb54eb34 100644
--- a/src/plugins/projectexplorer/taskmodel.cpp
+++ b/src/plugins/projectexplorer/taskmodel.cpp
@@ -362,7 +362,6 @@ int TaskFilterModel::rowCount(const QModelIndex &parent) const
if (parent.isValid())
return 0;
- updateMapping();
return m_mapping.count();
}
@@ -455,7 +454,6 @@ void TaskFilterModel::handleReset()
QModelIndex TaskFilterModel::mapFromSource(const QModelIndex &idx) const
{
- updateMapping();
QList<int>::const_iterator it = qBinaryFind(m_mapping.constBegin(), m_mapping.constEnd(), idx.row());
if (it == m_mapping.constEnd())
return QModelIndex();
@@ -464,7 +462,6 @@ QModelIndex TaskFilterModel::mapFromSource(const QModelIndex &idx) const
QModelIndex TaskFilterModel::mapToSource(const QModelIndex &index) const
{
- updateMapping();
int row = index.row();
if (row >= m_mapping.count())
return QModelIndex();
diff --git a/src/plugins/qbsprojectmanager/defaultpropertyprovider.cpp b/src/plugins/qbsprojectmanager/defaultpropertyprovider.cpp
index 28b0ad3158..735ce897f7 100644
--- a/src/plugins/qbsprojectmanager/defaultpropertyprovider.cpp
+++ b/src/plugins/qbsprojectmanager/defaultpropertyprovider.cpp
@@ -42,6 +42,18 @@
namespace QbsProjectManager {
using namespace Constants;
+static QString extractToolchainPrefix(QString *compilerName)
+{
+ QString prefix;
+ if (compilerName->endsWith(QLatin1String("-g++"))
+ || compilerName->endsWith(QLatin1String("-clang++"))) {
+ const int idx = compilerName->lastIndexOf(QLatin1Char('-')) + 1;
+ prefix = compilerName->left(idx);
+ compilerName->remove(0, idx);
+ }
+ return prefix;
+}
+
QVariantMap DefaultPropertyProvider::properties(const ProjectExplorer::Kit *k, const QVariantMap &defaultData) const
{
QTC_ASSERT(k, return defaultData);
@@ -116,8 +128,18 @@ QVariantMap DefaultPropertyProvider::properties(const ProjectExplorer::Kit *k, c
}
}
Utils::FileName cxx = tc->compilerCommand();
- data.insert(QLatin1String(CPP_TOOLCHAINPATH), cxx.toFileInfo().absolutePath());
- data.insert(QLatin1String(CPP_COMPILERNAME), cxx.toFileInfo().fileName());
+ const QFileInfo cxxFileInfo = cxx.toFileInfo();
+ QString compilerName = cxxFileInfo.fileName();
+ const QString toolchainPrefix = extractToolchainPrefix(&compilerName);
+ if (!toolchainPrefix.isEmpty())
+ data.insert(QLatin1String(CPP_TOOLCHAINPREFIX), toolchainPrefix);
+ data.insert(QLatin1String(CPP_COMPILERNAME), compilerName);
+ data.insert(QLatin1String(CPP_TOOLCHAINPATH), cxxFileInfo.absolutePath());
+ if (targetAbi.osFlavor() == ProjectExplorer::Abi::WindowsMsvc2013Flavor) {
+ const QLatin1String flags("/FS");
+ data.insert(QLatin1String(CPP_PLATFORMCFLAGS), flags);
+ data.insert(QLatin1String(CPP_PLATFORMCXXFLAGS), flags);
+ }
}
return data;
}
diff --git a/src/plugins/qbsprojectmanager/qbsconstants.h b/src/plugins/qbsprojectmanager/qbsconstants.h
index 40f8f4767d..82d070abd5 100644
--- a/src/plugins/qbsprojectmanager/qbsconstants.h
+++ b/src/plugins/qbsprojectmanager/qbsconstants.h
@@ -40,7 +40,10 @@ const char QBS_ARCHITECTURE[] = "qbs.architecture";
const char QBS_ENDIANNESS[] = "qbs.endianness";
const char QBS_TOOLCHAIN[] = "qbs.toolchain";
const char CPP_TOOLCHAINPATH[] = "cpp.toolchainInstallPath";
+const char CPP_TOOLCHAINPREFIX[] = "cpp.toolchainPrefix";
const char CPP_COMPILERNAME[] = "cpp.compilerName";
+const char CPP_PLATFORMCFLAGS[] = "cpp.platformCFlags";
+const char CPP_PLATFORMCXXFLAGS[] = "cpp.platformCxxFlags";
} // namespace Constants
} // namespace QbsProjectManager
diff --git a/src/plugins/qbsprojectmanager/qbsprojectmanager.cpp b/src/plugins/qbsprojectmanager/qbsprojectmanager.cpp
index 9d768db741..abeed42ccc 100644
--- a/src/plugins/qbsprojectmanager/qbsprojectmanager.cpp
+++ b/src/plugins/qbsprojectmanager/qbsprojectmanager.cpp
@@ -150,6 +150,12 @@ void QbsManager::addQtProfileFromKit(const QString &profileName, const ProjectEx
return;
qbs::QtEnvironment qtEnv;
+ const QList<ProjectExplorer::Abi> abi = qt->qtAbis();
+ if (!abi.empty()) {
+ qtEnv.architecture = ProjectExplorer::Abi::toString(abi.first().architecture());
+ if (abi.first().wordWidth() == 64)
+ qtEnv.architecture.append(QLatin1String("_64"));
+ }
qtEnv.binaryPath = qt->binPath().toString();
if (qt->hasDebugBuild())
qtEnv.buildVariant << QLatin1String("debug");
diff --git a/src/plugins/qmakeprojectmanager/qmakenodes.cpp b/src/plugins/qmakeprojectmanager/qmakenodes.cpp
index 9152e85250..606c474450 100644
--- a/src/plugins/qmakeprojectmanager/qmakenodes.cpp
+++ b/src/plugins/qmakeprojectmanager/qmakenodes.cpp
@@ -1990,13 +1990,46 @@ void QmakeProFileNode::applyEvaluate(EvalResult evalResult, bool async)
m_validParse = (evalResult == EvalOk);
if (m_validParse) {
+ // create build_pass reader
+ QtSupport::ProFileReader *readerBuildPass = 0;
+ QStringList builds = m_readerExact->values(QLatin1String("BUILDS"));
+ if (builds.isEmpty()) {
+ readerBuildPass = m_readerExact;
+ } else {
+ QString build = builds.first();
+ QHash<QString, QStringList> basevars;
+ QStringList basecfgs = m_readerExact->values(build + QLatin1String(".CONFIG"));
+ basecfgs += build;
+ basecfgs += QLatin1String("build_pass");
+ basevars[QLatin1String("BUILD_PASS")] = QStringList(build);
+ QStringList buildname = m_readerExact->values(build + QLatin1String(".name"));
+ basevars[QLatin1String("BUILD_NAME")] = (buildname.isEmpty() ? QStringList(build) : buildname);
+
+ readerBuildPass = m_project->createProFileReader(this);
+ readerBuildPass->setExtraVars(basevars);
+ readerBuildPass->setExtraConfigs(basecfgs);
+
+ EvalResult evalResult = EvalOk;
+ if (ProFile *pro = readerBuildPass->parsedProFile(m_projectFilePath)) {
+ if (!readerBuildPass->accept(pro, QMakeEvaluator::LoadAll))
+ evalResult = EvalPartial;
+ pro->deref();
+ } else {
+ evalResult = EvalFail;
+ }
+
+ if (evalResult != EvalOk) {
+ m_project->destroyProFileReader(readerBuildPass);
+ readerBuildPass = 0;
+ }
+ }
// update TargetInformation
- m_qmakeTargetInformation = targetInformation(m_readerExact);
+ m_qmakeTargetInformation = targetInformation(m_readerExact, readerBuildPass);
m_resolvedMkspecPath = m_readerExact->resolvedMkSpec();
m_subProjectsNotToDeploy = subProjectsNotToDeploy;
- setupInstallsList(m_readerExact);
+ setupInstallsList(readerBuildPass);
QString buildDirectory = buildDir();
// update other variables
@@ -2056,6 +2089,9 @@ void QmakeProFileNode::applyEvaluate(EvalResult evalResult, bool async)
}
}
+ if (readerBuildPass && readerBuildPass != m_readerExact)
+ m_project->destroyProFileReader(readerBuildPass);
+
if (m_varValues != newVarValues) {
QmakeVariablesHash oldValues = m_varValues;
m_varValues = newVarValues;
@@ -2200,61 +2236,31 @@ QStringList QmakeProFileNode::subDirsPaths(QtSupport::ProFileReader *reader, QSt
return subProjectPaths;
}
-TargetInformation QmakeProFileNode::targetInformation(QtSupport::ProFileReader *reader) const
+TargetInformation QmakeProFileNode::targetInformation(QtSupport::ProFileReader *reader, QtSupport::ProFileReader *readerBuildPass) const
{
TargetInformation result;
- if (!reader)
+ if (!reader || !readerBuildPass)
return result;
- QtSupport::ProFileReader *readerBP = 0;
QStringList builds = reader->values(QLatin1String("BUILDS"));
if (!builds.isEmpty()) {
QString build = builds.first();
result.buildTarget = reader->value(build + QLatin1String(".target"));
-
- QHash<QString, QStringList> basevars;
- QStringList basecfgs = reader->values(build + QLatin1String(".CONFIG"));
- basecfgs += build;
- basecfgs += QLatin1String("build_pass");
- basevars[QLatin1String("BUILD_PASS")] = QStringList(build);
- QStringList buildname = reader->values(build + QLatin1String(".name"));
- basevars[QLatin1String("BUILD_NAME")] = (buildname.isEmpty() ? QStringList(build) : buildname);
-
- readerBP = m_project->createProFileReader(this);
- readerBP->setExtraVars(basevars);
- readerBP->setExtraConfigs(basecfgs);
-
- EvalResult evalResult = EvalOk;
- if (ProFile *pro = readerBP->parsedProFile(m_projectFilePath)) {
- if (!readerBP->accept(pro, QMakeEvaluator::LoadAll))
- evalResult = EvalPartial;
- pro->deref();
- } else {
- evalResult = EvalFail;
- }
-
- if (evalResult != EvalOk)
- return result;
-
- reader = readerBP;
}
// BUILD DIR
result.buildDir = buildDir();
- if (reader->contains(QLatin1String("DESTDIR")))
- result.destDir = reader->value(QLatin1String("DESTDIR"));
+ if (readerBuildPass->contains(QLatin1String("DESTDIR")))
+ result.destDir = readerBuildPass->value(QLatin1String("DESTDIR"));
// Target
- result.target = reader->value(QLatin1String("TARGET"));
+ result.target = readerBuildPass->value(QLatin1String("TARGET"));
if (result.target.isEmpty())
result.target = QFileInfo(m_projectFilePath).baseName();
result.valid = true;
- if (readerBP)
- m_project->destroyProFileReader(readerBP);
-
return result;
}
diff --git a/src/plugins/qmakeprojectmanager/qmakenodes.h b/src/plugins/qmakeprojectmanager/qmakenodes.h
index 7e5c3aa6dd..d179b001f3 100644
--- a/src/plugins/qmakeprojectmanager/qmakenodes.h
+++ b/src/plugins/qmakeprojectmanager/qmakenodes.h
@@ -442,7 +442,7 @@ private:
QStringList libDirectories(QtSupport::ProFileReader *reader) const;
QStringList subDirsPaths(QtSupport::ProFileReader *reader, QStringList *subProjectsNotToDeploy, bool silent) const;
- TargetInformation targetInformation(QtSupport::ProFileReader *reader) const;
+ TargetInformation targetInformation(QtSupport::ProFileReader *reader, QtSupport::ProFileReader *readerBuildPass) const;
void setupInstallsList(const QtSupport::ProFileReader *reader);
bool m_isDeployable;
diff --git a/src/plugins/qmldesigner/designercore/metainfo/subcomponentmanager.cpp b/src/plugins/qmldesigner/designercore/metainfo/subcomponentmanager.cpp
index ece9ad259a..2b1723f164 100644
--- a/src/plugins/qmldesigner/designercore/metainfo/subcomponentmanager.cpp
+++ b/src/plugins/qmldesigner/designercore/metainfo/subcomponentmanager.cpp
@@ -395,7 +395,6 @@ void SubComponentManager::registerQmlFile(const QFileInfo &fileInfo, const QStri
itemLibraryEntry.setName(baseComponentName);
itemLibraryEntry.setCategory("QML Components");
if (!qualifier.isEmpty()) {
- itemLibraryEntry.setForceImport(true);
itemLibraryEntry.setRequiredImport(fixedQualifier);
}
diff --git a/src/plugins/qmldesigner/qtquickplugin/source/listview.qml b/src/plugins/qmldesigner/qtquickplugin/source/listview.qml
index 6c70227a7d..b270c047ab 100644
--- a/src/plugins/qmldesigner/qtquickplugin/source/listview.qml
+++ b/src/plugins/qmldesigner/qtquickplugin/source/listview.qml
@@ -52,6 +52,7 @@ ListView {
}
delegate: Item {
+ width: 80
height: 40
x: 5
Row {
diff --git a/src/plugins/qmldesigner/qtquickplugin/source/listviewv2.qml b/src/plugins/qmldesigner/qtquickplugin/source/listviewv2.qml
index b3e8c93d2d..013bfa6983 100644
--- a/src/plugins/qmldesigner/qtquickplugin/source/listviewv2.qml
+++ b/src/plugins/qmldesigner/qtquickplugin/source/listviewv2.qml
@@ -52,6 +52,7 @@ ListView {
}
delegate: Item {
+ width: 80
height: 40
x: 5
Row {
diff --git a/src/plugins/valgrind/memcheckerrorview.cpp b/src/plugins/valgrind/memcheckerrorview.cpp
index db305eaea3..6f3318b1a6 100644
--- a/src/plugins/valgrind/memcheckerrorview.cpp
+++ b/src/plugins/valgrind/memcheckerrorview.cpp
@@ -198,6 +198,8 @@ static QString relativeToPath()
static QString errorLocation(const QModelIndex &index, const Error &error,
bool link = false, const QString &linkAttr = QString())
{
+ if (!index.isValid())
+ return QString();
const ErrorListModel *model = 0;
const QAbstractProxyModel *proxy = qobject_cast<const QAbstractProxyModel *>(index.model());
while (!model && proxy) {
diff --git a/src/plugins/valgrind/memchecktool.cpp b/src/plugins/valgrind/memchecktool.cpp
index 292157a129..e1173a6b99 100644
--- a/src/plugins/valgrind/memchecktool.cpp
+++ b/src/plugins/valgrind/memchecktool.cpp
@@ -48,6 +48,7 @@
#include <extensionsystem/iplugin.h>
#include <extensionsystem/pluginmanager.h>
+#include <projectexplorer/deploymentdata.h>
#include <projectexplorer/projectexplorer.h>
#include <projectexplorer/project.h>
#include <projectexplorer/runconfiguration.h>
@@ -144,6 +145,11 @@ bool MemcheckErrorFilterProxyModel::filterAcceptsRow(int sourceRow, const QModel
foreach (Project *project, SessionManager::projects()) {
validFolders << project->projectDirectory();
foreach (Target *target, project->targets()) {
+ foreach (const ProjectExplorer::DeployableFile &file,
+ target->deploymentData().allFiles()) {
+ if (file.isExecutable())
+ validFolders << file.remoteDirectory();
+ }
foreach (BuildConfiguration *config, target->buildConfigurations())
validFolders << config->buildDirectory().toString();
}
diff --git a/src/plugins/valgrind/valgrindprocess.cpp b/src/plugins/valgrind/valgrindprocess.cpp
index de74632441..a5d62a64de 100644
--- a/src/plugins/valgrind/valgrindprocess.cpp
+++ b/src/plugins/valgrind/valgrindprocess.cpp
@@ -142,7 +142,7 @@ void ValgrindProcess::run(const QString &valgrindExecutable, const QStringList &
if (m_remote.m_connection->state() != QSsh::SshConnection::Connected) {
connect(m_remote.m_connection, SIGNAL(connected()), this, SLOT(connected()));
connect(m_remote.m_connection, SIGNAL(error(QSsh::SshError)),
- this, SLOT(handelError(QSsh::SshError)));
+ this, SLOT(handleError(QSsh::SshError)));
if (m_remote.m_connection->state() == QSsh::SshConnection::Unconnected)
m_remote.m_connection->connectToHost();
} else {
diff --git a/src/plugins/valgrind/xmlprotocol/errorlistmodel.cpp b/src/plugins/valgrind/xmlprotocol/errorlistmodel.cpp
index 280b2aec49..f5ac682c78 100644
--- a/src/plugins/valgrind/xmlprotocol/errorlistmodel.cpp
+++ b/src/plugins/valgrind/xmlprotocol/errorlistmodel.cpp
@@ -239,7 +239,7 @@ int ErrorListModel::rowCount(const QModelIndex &parent) const
{
if (parent.isValid())
return 0;
- return qMax(1, d->errors.count());
+ return d->errors.count();
}
int ErrorListModel::columnCount(const QModelIndex &parent) const