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
This commit is contained in:
Eike Ziller
2014-05-02 10:00:20 +02:00
64 changed files with 442 additions and 245 deletions

View File

@@ -79,6 +79,9 @@ ApplicationWindow {
var newX = (bubble.x + calcRoll(accel.reading.x, accel.reading.y, accel.reading.z) * 0.1) var newX = (bubble.x + calcRoll(accel.reading.x, accel.reading.y, accel.reading.z) * 0.1)
var newY = (bubble.y - calcPitch(accel.reading.x, accel.reading.y, accel.reading.z) * 0.1) var newY = (bubble.y - calcPitch(accel.reading.x, accel.reading.y, accel.reading.z) * 0.1)
if (isNaN(newX) || isNaN(newY))
return;
if (newX < 0) if (newX < 0)
newX = 0 newX = 0

View File

@@ -614,6 +614,12 @@
view, making it seem like the program was interrupted before entering the view, making it seem like the program was interrupted before entering the
function. function.
To find out which QML file is causing a Qt Quick 2 application to crash,
select \gui {Load QML Stack} in the context menu in the \gui{Stack} view.
The debugger tries to retrieve the JavaScript stack from the stopped
executable and prepends the frames to the C++ frames, should it find any.
You can click a frame in the QML stack to open the QML file in the editor.
\section1 Locals and Expressions \section1 Locals and Expressions
Whenever a program stops under the control of the debugger, it retrieves Whenever a program stops under the control of the debugger, it retrieves

View File

@@ -176,4 +176,18 @@
reparsed automatically. For all other files, you can use \gui{Tools} > reparsed automatically. For all other files, you can use \gui{Tools} >
\gui{C++} > \gui{Reparse Externally Changed Files} to update the code \gui{C++} > \gui{Reparse Externally Changed Files} to update the code
model. model.
\section1 Inspecting the Code Model
When you report a bug that is related to the C++ code model, the \QC
developers might ask you to write information about the internal state of
the code model into a log file and to deliver the file to them for
inspection.
To view information about the C++ code model in the
\gui {C++ Code Model Inspector} dialog and write it to a log file, select
\gui Tools > \gui C++ > \gui {Inspect C++ Code Model} or press
\key {Ctrl+Shift+F12}.
\QC generates the code model inspection log file in a temporary folder.
*/ */

View File

@@ -196,6 +196,9 @@
\skipto onReadingChanged \skipto onReadingChanged
\printuntil } \printuntil }
We want to ensure that the position of the bubble is always within
the bounds of the screen. If the Accelerometer returns not a number
(NaN), the value is ignored and the bubble position is not updated.
\li Add SmoothedAnimation behavior on the \a x and \a y properties of \li Add SmoothedAnimation behavior on the \a x and \a y properties of
the bubble to make its movement look smoother. the bubble to make its movement look smoother.

View File

@@ -27,7 +27,7 @@ DynamicLibrary {
: ["$ORIGIN", "$ORIGIN/.."] : ["$ORIGIN", "$ORIGIN/.."]
property string libIncludeBase: ".." // #include <lib/header.h> property string libIncludeBase: ".." // #include <lib/header.h>
cpp.includePaths: [libIncludeBase] cpp.includePaths: [libIncludeBase]
cpp.minimumWindowsVersion: "5.1" cpp.minimumWindowsVersion: qbs.architecture === "x86" ? "5.1" : "5.2"
Export { Export {
Depends { name: "cpp" } Depends { name: "cpp" }

View File

@@ -39,7 +39,7 @@ Product {
property string pluginIncludeBase: ".." // #include <plugin/header.h> property string pluginIncludeBase: ".." // #include <plugin/header.h>
cpp.includePaths: [pluginIncludeBase] cpp.includePaths: [pluginIncludeBase]
cpp.minimumWindowsVersion: "5.1" cpp.minimumWindowsVersion: qbs.architecture === "x86" ? "5.1" : "5.2"
Group { Group {
name: "PluginSpec" name: "PluginSpec"

View File

@@ -18,7 +18,7 @@ Application {
cpp.rpaths: qbs.targetOS.contains("osx") cpp.rpaths: qbs.targetOS.contains("osx")
? ["@executable_path/../" + project.ide_library_path] ? ["@executable_path/../" + project.ide_library_path]
: ["$ORIGIN/../" + project.ide_library_path] : ["$ORIGIN/../" + project.ide_library_path]
cpp.minimumWindowsVersion: "5.1" cpp.minimumWindowsVersion: qbs.architecture === "x86" ? "5.1" : "5.2"
Group { Group {
fileTagsFilter: product.type fileTagsFilter: product.type

View File

@@ -45,7 +45,7 @@ Project {
property string ide_bin_path: qbs.targetOS.contains("osx") property string ide_bin_path: qbs.targetOS.contains("osx")
? ide_app_target + ".app/Contents/MacOS" ? ide_app_target + ".app/Contents/MacOS"
: ide_app_path : ide_app_path
property bool testsEnabled: qbs.getenv("TEST") || qbs.buildVariant === "debug" property bool testsEnabled: qbs.getEnv("TEST") || qbs.buildVariant === "debug"
property stringList generalDefines: [ property stringList generalDefines: [
"QT_CREATOR", "QT_CREATOR",
'IDE_LIBRARY_BASENAME="' + libDirName + '"', 'IDE_LIBRARY_BASENAME="' + libDirName + '"',

View File

@@ -156,8 +156,6 @@ ButtonRow {
onClicked: { onClicked: {
if (checked) { if (checked) {
anchorBackend.leftAnchored = false;
anchorBackend.rightAnchored = false;
anchorBackend.topAnchored = false; anchorBackend.topAnchored = false;
anchorBackend.bottomAnchored = false; anchorBackend.bottomAnchored = false;
anchorBackend.verticalCentered = true; anchorBackend.verticalCentered = true;

View File

@@ -30,6 +30,7 @@
import QtQuick 2.1 import QtQuick 2.1
import QtQuick.Controls 1.0 as Controls import QtQuick.Controls 1.0 as Controls
import QtQuick.Layouts 1.0 import QtQuick.Layouts 1.0
import QtQuick.Controls.Private 1.0
Item { Item {
id: buttonRowButton id: buttonRowButton
@@ -41,6 +42,8 @@ Item {
signal clicked() signal clicked()
property string tooltip: ""
width: 24 + leftPadding width: 24 + leftPadding
height: 24 height: 24
@@ -94,6 +97,7 @@ Item {
} }
MouseArea { MouseArea {
id: mouseArea
anchors.fill: parent anchors.fill: parent
anchors.leftMargin: leftPadding anchors.leftMargin: leftPadding
onClicked: { onClicked: {
@@ -104,5 +108,16 @@ Item {
} }
buttonRowButton.clicked() buttonRowButton.clicked()
} }
onExited: Tooltip.hideText()
onCanceled: Tooltip.hideText()
hoverEnabled: true
Timer {
interval: 1000
running: mouseArea.containsMouse && tooltip.length
onTriggered: Tooltip.showText(mouseArea, Qt.point(mouseArea.mouseX, mouseArea.mouseY), tooltip)
}
} }
} }

View File

@@ -142,7 +142,7 @@ Column {
} }
ColorCheckButton { ColorCheckButton {
id: checkButton id: checkButton
color: colorButton.color color: backendendValue.value
} }
ButtonRow { ButtonRow {

View File

@@ -158,6 +158,15 @@ Rectangle {
anchors.right: parent.right anchors.right: parent.right
frameVisible: false frameVisible: false
id: tabView
height: Math.max(layoutSectionHeight, specficsHeight)
property int layoutSectionHeight
property int specficsOneHeight: 0
property int specficsTwoHeight: 0
property int specficsHeight: Math.max(specficsOneHeight, specficsTwoHeight)
Tab { Tab {
title: backendValues.className.value title: backendValues.className.value
@@ -178,6 +187,10 @@ Rectangle {
active = false active = false
active = true active = true
} }
onLoaded: {
tabView.specficsTwoHeight = specificsTwo.item.height + 40
}
} }
Loader { Loader {
@@ -186,6 +199,10 @@ Rectangle {
id: specificsOne; id: specificsOne;
source: specificsUrl; source: specificsUrl;
onLoaded: {
tabView.specficsOneHeight = specificsOne.item.height + 40
}
} }
} }
} }
@@ -197,6 +214,10 @@ Rectangle {
anchors.right: parent.right anchors.right: parent.right
LayoutSection { LayoutSection {
Component.onCompleted: {
tabView.layoutSectionHeight = childrenRect.height
}
} }
} }
} }

View File

@@ -84,6 +84,5 @@ Column {
} }
TextInputSection { TextInputSection {
showEchoMode: false
} }
} }

View File

@@ -37,7 +37,7 @@ Section {
anchors.right: parent.right anchors.right: parent.right
caption: qsTr("Text Input") caption: qsTr("Text Input")
property bool showEchoMode: false property bool isTextInput: false
id: textInputSection id: textInputSection
SectionLayout { SectionLayout {
@@ -46,21 +46,23 @@ Section {
Label { Label {
visible: textInputSection.isTextInput
text: qsTr("Input mask") text: qsTr("Input mask")
} }
LineEdit { LineEdit {
visible: textInputSection.isTextInput
backendValue: backendValues.inputMask backendValue: backendValues.inputMask
Layout.fillWidth: true Layout.fillWidth: true
} }
Label { Label {
visible: textInputSection.showEchoMode visible: textInputSection.isTextInput
text: qsTr("Echo mode") text: qsTr("Echo mode")
} }
ComboBox { ComboBox {
visible: textInputSection.showEchoMode visible: textInputSection.isTextInput
Layout.fillWidth: true Layout.fillWidth: true
backendValue: backendValues.echoMode backendValue: backendValues.echoMode
scope: "TextInput" scope: "TextInput"
@@ -68,11 +70,13 @@ Section {
} }
Label { Label {
visible: textInputSection.isTextInput
text: qsTr("Pass. char") text: qsTr("Pass. char")
toolTip: qsTr("Character displayed when users enter passwords.") toolTip: qsTr("Character displayed when users enter passwords.")
} }
LineEdit { LineEdit {
visible: textInputSection.isTextInput
backendValue: backendValues.passwordCharacter backendValue: backendValues.passwordCharacter
Layout.fillWidth: true Layout.fillWidth: true
} }

View File

@@ -70,7 +70,6 @@ Column {
} }
TextInputSection { TextInputSection {
showEchoMode: true isTextInput: true
} }
} }

View File

@@ -14902,7 +14902,7 @@ Would you like to overwrite them?</source>
</message> </message>
<message> <message>
<source>Find in This Directory...</source> <source>Find in This Directory...</source>
<translation>...</translation> <translation>...</translation>
</message> </message>
<message> <message>
<source>Show in Explorer</source> <source>Show in Explorer</source>

View File

@@ -963,6 +963,41 @@ QmlLanguageBundles ModelManagerInterface::extendedBundles() const
return m_extendedBundles; return m_extendedBundles;
} }
void ModelManagerInterface::maybeScan(const QStringList &importPaths,
Language::Enum defaultLanguage)
{
QStringList pathToScan;
{
QMutexLocker l(&m_mutex);
foreach (QString importPath, importPaths)
if (!m_scannedPaths.contains(importPath)) {
pathToScan.append(importPath);
}
}
if (pathToScan.count() > 1) {
QFuture<void> result = QtConcurrent::run(&ModelManagerInterface::importScan,
workingCopyInternal(), pathToScan,
this, defaultLanguage,
true);
if (m_synchronizer.futures().size() > 10) {
QList<QFuture<void> > futures = m_synchronizer.futures();
m_synchronizer.clearFutures();
foreach (const QFuture<void> &future, futures) {
if (! (future.isFinished() || future.isCanceled()))
m_synchronizer.addFuture(future);
}
}
m_synchronizer.addFuture(result);
addTaskInternal(result, tr("Scanning QML Imports"), Constants::TASK_IMPORT_SCAN);
}
}
void ModelManagerInterface::updateImportPaths() void ModelManagerInterface::updateImportPaths()
{ {
QStringList allImportPaths; QStringList allImportPaths;
@@ -1026,36 +1061,7 @@ void ModelManagerInterface::updateImportPaths()
if (!m_shouldScanImports) if (!m_shouldScanImports)
return; return;
QStringList pathToScan; maybeScan(allImportPaths, Language::Qml);
{
QMutexLocker l(&m_mutex);
foreach (QString importPath, allImportPaths)
if (!m_scannedPaths.contains(importPath)) {
pathToScan.append(importPath);
}
}
if (pathToScan.count() > 1) {
QFuture<void> result = QtConcurrent::run(&ModelManagerInterface::importScan,
workingCopyInternal(), pathToScan,
this, Language::Qml,
true);
if (m_synchronizer.futures().size() > 10) {
QList<QFuture<void> > futures = m_synchronizer.futures();
m_synchronizer.clearFutures();
foreach (const QFuture<void> &future, futures) {
if (! (future.isFinished() || future.isCanceled()))
m_synchronizer.addFuture(future);
}
}
m_synchronizer.addFuture(result);
addTaskInternal(result, tr("Scanning QML Imports"), Constants::TASK_IMPORT_SCAN);
}
} }
ModelManagerInterface::ProjectInfo ModelManagerInterface::defaultProjectInfo() const ModelManagerInterface::ProjectInfo ModelManagerInterface::defaultProjectInfo() const

View File

@@ -244,6 +244,7 @@ protected:
CPlusPlus::Snapshot snapshot, CPlusPlus::Snapshot snapshot,
QHash<QString, QPair<CPlusPlus::Document::Ptr, bool> > documents); QHash<QString, QPair<CPlusPlus::Document::Ptr, bool> > documents);
void maybeScan(const QStringList &importPaths, Language::Enum defaultLanguage);
void updateImportPaths(); void updateImportPaths();
void loadQmlTypeDescriptionsInternal(const QString &path); void loadQmlTypeDescriptionsInternal(const QString &path);

View File

@@ -44,7 +44,7 @@ QtcLibrary {
"sshsendfacility.cpp", "sshsendfacility_p.h", "sshsendfacility.cpp", "sshsendfacility_p.h",
].concat(botanFiles) ].concat(botanFiles)
property var useSystemBotan: qbs.getenv("USE_SYSTEM_BOTAN") === "1" property var useSystemBotan: qbs.getEnv("USE_SYSTEM_BOTAN") === "1"
property var botanIncludes: { property var botanIncludes: {
var result = ["../3rdparty"]; var result = ["../3rdparty"];
if (useSystemBotan) if (useSystemBotan)

View File

@@ -11,7 +11,7 @@ QtcPlugin {
Depends { name: "TextEditor" } Depends { name: "TextEditor" }
Depends { name: "Utils" } Depends { name: "Utils" }
property string llvmInstallDir: qbs.getenv("LLVM_INSTALL_DIR") property string llvmInstallDir: qbs.getEnv("LLVM_INSTALL_DIR")
condition: llvmInstallDir && !llvmInstallDir.isEmpty condition: llvmInstallDir && !llvmInstallDir.isEmpty
property bool clangCompletion: true property bool clangCompletion: true
@@ -33,7 +33,7 @@ QtcPlugin {
} }
// Find llvm-config* in PATH // Find llvm-config* in PATH
var pathListString = qbs.getenv("PATH"); var pathListString = qbs.getEnv("PATH");
var separator = qbs.hostOS.contains("windows") ? ";" : ":"; var separator = qbs.hostOS.contains("windows") ? ";" : ":";
var pathList = pathListString.split(separator); var pathList = pathListString.split(separator);
for (var i = 0; i < llvmConfigVariants.length; ++i) { for (var i = 0; i < llvmConfigVariants.length; ++i) {

View File

@@ -224,17 +224,12 @@ bool CppEditorSupport::initialized()
SemanticInfo CppEditorSupport::recalculateSemanticInfo() SemanticInfo CppEditorSupport::recalculateSemanticInfo()
{ {
m_futureSemanticInfo.cancel(); m_futureSemanticInfo.cancel();
return recalculateSemanticInfoNow(currentSource(false), /*emitSignalWhenFinished=*/ false);
SemanticInfo::Source source = currentSource(false);
recalculateSemanticInfoNow(source, /*emitSignalWhenFinished=*/ false);
return m_lastSemanticInfo;
} }
Document::Ptr CppEditorSupport::lastSemanticInfoDocument() const Document::Ptr CppEditorSupport::lastSemanticInfoDocument() const
{ {
QMutexLocker locker(&m_lastSemanticInfoLock); return semanticInfo().doc;
return m_lastSemanticInfo.doc;
} }
void CppEditorSupport::recalculateSemanticInfoDetached(ForceReason forceReason) void CppEditorSupport::recalculateSemanticInfoDetached(ForceReason forceReason)
@@ -348,17 +343,13 @@ void CppEditorSupport::onDocumentUpdated(Document::Ptr doc)
setExtraDiagnostics(key, doc->diagnosticMessages()); setExtraDiagnostics(key, doc->diagnosticMessages());
} }
// update semantic info in a future // Update semantic info if necessary
if (!m_initialized || if (!m_initialized || (m_textEditor->widget()->isVisible() && !isSemanticInfoValid())) {
(m_textEditor->widget()->isVisible()
&& (m_lastSemanticInfo.doc.isNull()
|| m_lastSemanticInfo.doc->translationUnit()->ast() == 0
|| m_lastSemanticInfo.doc->fileName() != fileName()))) {
m_initialized = true; 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(); emit documentUpdated();
} }
@@ -368,34 +359,18 @@ void CppEditorSupport::startHighlighting(ForceReason forceReason)
return; return;
if (m_highlightingSupport->requiresSemanticInfo()) { if (m_highlightingSupport->requiresSemanticInfo()) {
Snapshot snapshot; const SemanticInfo info = semanticInfo();
Document::Ptr doc; if (info.doc.isNull())
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())
return; return;
if (!m_lastHighlightOnCompleteSemanticInfo) const bool forced = info.forced || !m_lastHighlightOnCompleteSemanticInfo;
forced = true; if (!forced && m_lastHighlightRevision == info.revision)
if (!forced && m_lastHighlightRevision == revision)
return; return;
m_highlighter.cancel(); m_highlighter.cancel();
m_highlighter = m_highlightingSupport->highlightingFuture(doc, snapshot); m_highlighter = m_highlightingSupport->highlightingFuture(info.doc, info.snapshot);
m_lastHighlightRevision = revision; m_lastHighlightRevision = info.revision;
m_lastHighlightOnCompleteSemanticInfo = complete; m_lastHighlightOnCompleteSemanticInfo = info.complete;
emit highlighterStarted(&m_highlighter, m_lastHighlightRevision); emit highlighterStarted(&m_highlighter, m_lastHighlightRevision);
} else { } else {
const unsigned revision = editorRevision(); const unsigned revision = editorRevision();
@@ -496,8 +471,7 @@ void CppEditorSupport::onCurrentEditorChanged()
m_editorVisible = editorVisible; m_editorVisible = editorVisible;
if (editorVisible) { if (editorVisible) {
m_editorGCTimer->stop(); m_editorGCTimer->stop();
QMutexLocker locker(&m_lastSemanticInfoLock); if (!lastSemanticInfoDocument())
if (!m_lastSemanticInfo.doc)
updateDocumentNow(); updateDocumentNow();
} else { } else {
m_editorGCTimer->start(EditorHiddenGCTimeout); m_editorGCTimer->start(EditorHiddenGCTimeout);
@@ -510,8 +484,7 @@ void CppEditorSupport::releaseResources()
m_highlighter.cancel(); m_highlighter.cancel();
m_highlighter = QFuture<TextEditor::HighlightingResult>(); m_highlighter = QFuture<TextEditor::HighlightingResult>();
snapshotUpdater()->releaseSnapshot(); snapshotUpdater()->releaseSnapshot();
QMutexLocker semanticLocker(&m_lastSemanticInfoLock); setSemanticInfo(SemanticInfo(), /*emitSignal=*/ false);
m_lastSemanticInfo = SemanticInfo();
m_lastHighlightOnCompleteSemanticInfo = true; m_lastHighlightOnCompleteSemanticInfo = true;
} }
@@ -524,66 +497,54 @@ SemanticInfo::Source CppEditorSupport::currentSource(bool force)
force); force);
} }
void CppEditorSupport::recalculateSemanticInfoNow(const SemanticInfo::Source &source, SemanticInfo CppEditorSupport::recalculateSemanticInfoNow(const SemanticInfo::Source &source,
bool emitSignalWhenFinished, bool emitSignalWhenFinished,
FuturizedTopLevelDeclarationProcessor *processor) FuturizedTopLevelDeclarationProcessor *processor)
{ {
SemanticInfo semanticInfo; const SemanticInfo lastSemanticInfo = semanticInfo();
SemanticInfo newSemanticInfo;
{ newSemanticInfo.forced = source.force;
QMutexLocker locker(&m_lastSemanticInfoLock); newSemanticInfo.revision = source.revision;
semanticInfo.revision = m_lastSemanticInfo.revision;
semanticInfo.forced = source.force;
// Try to reuse as much as possible from the last semantic info
if (!source.force if (!source.force
&& m_lastSemanticInfo.complete && lastSemanticInfo.complete
&& m_lastSemanticInfo.revision == source.revision && lastSemanticInfo.revision == source.revision
&& m_lastSemanticInfo.doc && lastSemanticInfo.doc
&& m_lastSemanticInfo.doc->translationUnit()->ast() && lastSemanticInfo.doc->translationUnit()->ast()
&& m_lastSemanticInfo.doc->fileName() == source.fileName) { && lastSemanticInfo.doc->fileName() == source.fileName) {
semanticInfo.snapshot = m_lastSemanticInfo.snapshot; // ### TODO: use the new snapshot. newSemanticInfo.snapshot = lastSemanticInfo.snapshot; // ### TODO: use the new snapshot.
semanticInfo.doc = m_lastSemanticInfo.doc; newSemanticInfo.doc = lastSemanticInfo.doc;
}
}
if (semanticInfo.doc.isNull()) { // Otherwise reprocess document
} else {
const QSharedPointer<SnapshotUpdater> snapshotUpdater = snapshotUpdater_internal(); const QSharedPointer<SnapshotUpdater> snapshotUpdater = snapshotUpdater_internal();
QTC_ASSERT(snapshotUpdater, return); QTC_ASSERT(snapshotUpdater, return newSemanticInfo);
semanticInfo.snapshot = snapshotUpdater->snapshot(); newSemanticInfo.snapshot = snapshotUpdater->snapshot();
QTC_ASSERT(newSemanticInfo.snapshot.contains(source.fileName), return newSemanticInfo);
if (semanticInfo.snapshot.contains(source.fileName)) { Document::Ptr doc = newSemanticInfo.snapshot.preprocessedDocument(source.code,
Document::Ptr doc = semanticInfo.snapshot.preprocessedDocument(source.code,
source.fileName); source.fileName);
if (processor) if (processor)
doc->control()->setTopLevelDeclarationProcessor(processor); doc->control()->setTopLevelDeclarationProcessor(processor);
doc->check(); doc->check();
if (processor && processor->isCanceled()) if (processor && processor->isCanceled())
semanticInfo.complete = false; newSemanticInfo.complete = false;
semanticInfo.doc = doc; newSemanticInfo.doc = doc;
} else {
return;
}
} }
if (semanticInfo.doc) { // Update local uses for the document
TranslationUnit *translationUnit = semanticInfo.doc->translationUnit(); TranslationUnit *translationUnit = newSemanticInfo.doc->translationUnit();
AST * ast = translationUnit->ast(); AST *ast = translationUnit->ast();
FunctionDefinitionUnderCursor functionDefinitionUnderCursor(newSemanticInfo.doc->translationUnit());
const LocalSymbols useTable(newSemanticInfo.doc,
functionDefinitionUnderCursor(ast, source.line, source.column));
newSemanticInfo.localUses = useTable.uses;
FunctionDefinitionUnderCursor functionDefinitionUnderCursor(semanticInfo.doc->translationUnit()); // Update semantic info
DeclarationAST *currentFunctionDefinition = functionDefinitionUnderCursor(ast, source.line, source.column); setSemanticInfo(newSemanticInfo, emitSignalWhenFinished);
const LocalSymbols useTable(semanticInfo.doc, currentFunctionDefinition); return newSemanticInfo;
semanticInfo.revision = source.revision;
semanticInfo.localUses = useTable.uses;
}
{
QMutexLocker locker(&m_lastSemanticInfoLock);
m_lastSemanticInfo = semanticInfo;
}
if (emitSignalWhenFinished)
emit semanticInfoUpdated(semanticInfo);
} }
void CppEditorSupport::recalculateSemanticInfoDetached_helper(QFutureInterface<void> &future, SemanticInfo::Source source) void CppEditorSupport::recalculateSemanticInfoDetached_helper(QFutureInterface<void> &future, SemanticInfo::Source source)
@@ -592,6 +553,30 @@ void CppEditorSupport::recalculateSemanticInfoDetached_helper(QFutureInterface<v
recalculateSemanticInfoNow(source, true, &processor); 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 QSharedPointer<SnapshotUpdater> CppEditorSupport::snapshotUpdater_internal() const
{ {
QMutexLocker locker(&m_snapshotUpdaterLock); QMutexLocker locker(&m_snapshotUpdaterLock);

View File

@@ -121,7 +121,7 @@ public:
enum ForceReason { enum ForceReason {
NoForce, NoForce,
ForceDueToMissingSemanticInfo, ForceDueToInvalidSemanticInfo,
ForceDueEditorRequest ForceDueEditorRequest
}; };
@@ -192,11 +192,16 @@ private:
}; };
SemanticInfo::Source currentSource(bool force); SemanticInfo::Source currentSource(bool force);
void recalculateSemanticInfoNow(const SemanticInfo::Source &source, bool emitSignalWhenFinished, SemanticInfo recalculateSemanticInfoNow(const SemanticInfo::Source &source,
bool emitSignalWhenFinished,
FuturizedTopLevelDeclarationProcessor *processor = 0); FuturizedTopLevelDeclarationProcessor *processor = 0);
void recalculateSemanticInfoDetached_helper(QFutureInterface<void> &future, void recalculateSemanticInfoDetached_helper(QFutureInterface<void> &future,
SemanticInfo::Source source); SemanticInfo::Source source);
bool isSemanticInfoValid() const;
SemanticInfo semanticInfo() const;
void setSemanticInfo(const SemanticInfo &semanticInfo, bool emitSignal = true);
QSharedPointer<SnapshotUpdater> snapshotUpdater_internal() const; QSharedPointer<SnapshotUpdater> snapshotUpdater_internal() const;
void setSnapshotUpdater_internal(const QSharedPointer<SnapshotUpdater> &updater); void setSnapshotUpdater_internal(const QSharedPointer<SnapshotUpdater> &updater);

View File

@@ -249,7 +249,7 @@ void DebuggerItemManager::autoDetectGdbOrLldbDebuggers()
} }
foreach (const QFileInfo &fi, suspects) { foreach (const QFileInfo &fi, suspects) {
if (fi.exists() && fi.isExecutable()) { if (fi.exists() && fi.isExecutable() && !fi.isDir()) {
FileName command = FileName::fromString(fi.absoluteFilePath()); FileName command = FileName::fromString(fi.absoluteFilePath());
if (findByCommand(command)) if (findByCommand(command))
continue; continue;

View File

@@ -287,6 +287,9 @@ void MultiHighlighter::highlightBlock(const QString &text)
QTextBlock documentBlock = currentDocument->findBlockByNumber( QTextBlock documentBlock = currentDocument->findBlockByNumber(
block.blockNumber() - m_editor->blockNumberForFileIndex(fileIndex)); block.blockNumber() - m_editor->blockNumberForFileIndex(fileIndex));
if (!documentBlock.isValid())
return;
QList<QTextLayout::FormatRange> formats = documentBlock.layout()->additionalFormats(); QList<QTextLayout::FormatRange> formats = documentBlock.layout()->additionalFormats();
setExtraAdditionalFormats(block, formats); setExtraAdditionalFormats(block, formats);
} }
@@ -960,6 +963,8 @@ void SideBySideDiffEditorWidget::showDiff()
blockNumber++; blockNumber++;
} }
} }
leftText.replace(QLatin1Char('\r'), QLatin1Char(' '));
rightText.replace(QLatin1Char('\r'), QLatin1Char(' '));
leftTexts += leftText; leftTexts += leftText;
rightTexts += rightText; rightTexts += rightText;
leftDocs.append(qMakePair(contextFileData.leftFileInfo, leftText)); leftDocs.append(qMakePair(contextFileData.leftFileInfo, leftText));

View File

@@ -6179,7 +6179,7 @@ bool FakeVimHandler::Private::handleExPluginCommand(const ExCommand &cmd)
commitCursor(); commitCursor();
emit q->handleExCommandRequested(&handled, cmd); emit q->handleExCommandRequested(&handled, cmd);
//qDebug() << "HANDLER REQUEST: " << cmd.cmd << handled; //qDebug() << "HANDLER REQUEST: " << cmd.cmd << handled;
if (handled) { if (handled && (m_textedit || m_plaintextedit)) {
pullCursor(); pullCursor();
if (m_cursor.position() != pos) if (m_cursor.position() != pos)
recordJump(pos); recordJump(pos);

View File

@@ -2401,8 +2401,7 @@ SubmoduleDataMap GitClient::submoduleList(const QString &workingDirectory)
if (cachedSubmoduleData.contains(workingDirectory)) if (cachedSubmoduleData.contains(workingDirectory))
return cachedSubmoduleData.value(workingDirectory); return cachedSubmoduleData.value(workingDirectory);
QStringList allConfigs = QStringList allConfigs = readConfigValue(workingDirectory, QLatin1String("-l"))
commandOutputFromLocal8Bit(readConfig(workingDirectory, QLatin1String("-l")))
.split(QLatin1Char('\n')); .split(QLatin1Char('\n'));
const QString submoduleLineStart = QLatin1String("submodule."); const QString submoduleLineStart = QLatin1String("submodule.");
foreach (const QString &configLine, allConfigs) { 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 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, // Set default commit encoding to 'UTF-8', when it's not set,
// to solve displaying error of commit log with non-latin characters. // to solve displaying error of commit log with non-latin characters.
if (codecName.isEmpty()) if (codecName.isEmpty())
@@ -3023,6 +3022,15 @@ QTextCodec *GitClient::encoding(const QString &workingDirectory, const QByteArra
return QTextCodec::codecForName(codecName); 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, bool GitClient::getCommitData(const QString &workingDirectory,
QString *commitTemplate, QString *commitTemplate,
CommitData &commitData, CommitData &commitData,
@@ -3109,19 +3117,20 @@ bool GitClient::getCommitData(const QString &workingDirectory,
case AmendCommit: { case AmendCommit: {
// Amend: get last commit data as "SHA1<tab>author<tab>email<tab>message". // Amend: get last commit data as "SHA1<tab>author<tab>email<tab>message".
QStringList args(QLatin1String("log")); QStringList args(QLatin1String("log"));
args << QLatin1String("--max-count=1") << QLatin1String("--pretty=format:%h\t%an\t%ae\t%B"); args << QLatin1String("--max-count=1") << QLatin1String("--pretty=format:%h\n%an\n%ae\n%B");
const Utils::SynchronousProcessResponse sp = synchronousGit(repoDirectory, args, 0, QByteArray outputText;
commitData.commitEncoding); if (!fullySynchronousGit(repoDirectory, args, &outputText, 0,
if (sp.result != Utils::SynchronousProcessResponse::Finished) { VcsBasePlugin::SuppressCommandLogging)) {
*errorMessage = tr("Cannot retrieve last commit data of repository \"%1\".").arg(repoDirectory); *errorMessage = tr("Cannot retrieve last commit data of repository \"%1\".").arg(repoDirectory);
return false; return false;
} }
QStringList values = sp.stdOut.split(QLatin1Char('\t')); QTextCodec *authorCodec = Utils::HostOsInfo::isWindowsHost()
QTC_ASSERT(values.size() >= 4, return false); ? QTextCodec::codecForName("UTF-8")
commitData.amendSHA1 = values.takeFirst(); : commitData.commitEncoding;
commitData.panelData.author = values.takeFirst(); commitData.amendSHA1 = QString::fromLatin1(shiftLogLine(outputText));
commitData.panelData.email = values.takeFirst(); commitData.panelData.author = authorCodec->toUnicode(shiftLogLine(outputText));
*commitTemplate = values.join(QLatin1String("\t")); commitData.panelData.email = authorCodec->toUnicode(shiftLogLine(outputText));
*commitTemplate = commitData.commitEncoding->toUnicode(outputText);
break; break;
} }
case SimpleCommit: { case SimpleCommit: {
@@ -3739,7 +3748,7 @@ bool GitClient::synchronousStashList(const QString &workingDirectory,
return true; return true;
} }
QByteArray GitClient::readConfig(const QString &workingDirectory, const QString &configVar) const QByteArray GitClient::readConfigBytes(const QString &workingDirectory, const QString &configVar) const
{ {
QStringList arguments; QStringList arguments;
arguments << QLatin1String("config") << configVar; arguments << QLatin1String("config") << configVar;
@@ -3757,7 +3766,13 @@ QByteArray GitClient::readConfig(const QString &workingDirectory, const QString
// Read a single-line config value, return trimmed // Read a single-line config value, return trimmed
QString GitClient::readConfigValue(const QString &workingDirectory, const QString &configVar) const 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) bool GitClient::cloneRepository(const QString &directory,const QByteArray &url)

View File

@@ -281,8 +281,6 @@ public:
const QString &messge, QString *name, const QString &messge, QString *name,
QString *errorMessage = 0); QString *errorMessage = 0);
QByteArray readConfig(const QString &workingDirectory, const QString &configVar) const;
QString readConfigValue(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; QTextCodec *encoding(const QString &workingDirectory, const QByteArray &configVar) const;
@@ -345,6 +343,7 @@ private slots:
void fetchFinished(const QVariant &cookie); void fetchFinished(const QVariant &cookie);
private: private:
QByteArray readConfigBytes(const QString &workingDirectory, const QString &configVar) const;
QTextCodec *getSourceCodec(const QString &file) const; QTextCodec *getSourceCodec(const QString &file) const;
VcsBase::VcsBaseEditorWidget *findExistingVCSEditor(const char *registerDynamicProperty, VcsBase::VcsBaseEditorWidget *findExistingVCSEditor(const char *registerDynamicProperty,
const QString &dynamicPropertyValue) const; const QString &dynamicPropertyValue) const;

View File

@@ -362,7 +362,6 @@ int TaskFilterModel::rowCount(const QModelIndex &parent) const
if (parent.isValid()) if (parent.isValid())
return 0; return 0;
updateMapping();
return m_mapping.count(); return m_mapping.count();
} }
@@ -455,7 +454,6 @@ void TaskFilterModel::handleReset()
QModelIndex TaskFilterModel::mapFromSource(const QModelIndex &idx) const QModelIndex TaskFilterModel::mapFromSource(const QModelIndex &idx) const
{ {
updateMapping();
QList<int>::const_iterator it = qBinaryFind(m_mapping.constBegin(), m_mapping.constEnd(), idx.row()); QList<int>::const_iterator it = qBinaryFind(m_mapping.constBegin(), m_mapping.constEnd(), idx.row());
if (it == m_mapping.constEnd()) if (it == m_mapping.constEnd())
return QModelIndex(); return QModelIndex();
@@ -464,7 +462,6 @@ QModelIndex TaskFilterModel::mapFromSource(const QModelIndex &idx) const
QModelIndex TaskFilterModel::mapToSource(const QModelIndex &index) const QModelIndex TaskFilterModel::mapToSource(const QModelIndex &index) const
{ {
updateMapping();
int row = index.row(); int row = index.row();
if (row >= m_mapping.count()) if (row >= m_mapping.count())
return QModelIndex(); return QModelIndex();

View File

@@ -42,6 +42,18 @@
namespace QbsProjectManager { namespace QbsProjectManager {
using namespace Constants; 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 QVariantMap DefaultPropertyProvider::properties(const ProjectExplorer::Kit *k, const QVariantMap &defaultData) const
{ {
QTC_ASSERT(k, return defaultData); QTC_ASSERT(k, return defaultData);
@@ -116,8 +128,18 @@ QVariantMap DefaultPropertyProvider::properties(const ProjectExplorer::Kit *k, c
} }
} }
Utils::FileName cxx = tc->compilerCommand(); Utils::FileName cxx = tc->compilerCommand();
data.insert(QLatin1String(CPP_TOOLCHAINPATH), cxx.toFileInfo().absolutePath()); const QFileInfo cxxFileInfo = cxx.toFileInfo();
data.insert(QLatin1String(CPP_COMPILERNAME), cxx.toFileInfo().fileName()); 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; return data;
} }

View File

@@ -40,7 +40,10 @@ const char QBS_ARCHITECTURE[] = "qbs.architecture";
const char QBS_ENDIANNESS[] = "qbs.endianness"; const char QBS_ENDIANNESS[] = "qbs.endianness";
const char QBS_TOOLCHAIN[] = "qbs.toolchain"; const char QBS_TOOLCHAIN[] = "qbs.toolchain";
const char CPP_TOOLCHAINPATH[] = "cpp.toolchainInstallPath"; const char CPP_TOOLCHAINPATH[] = "cpp.toolchainInstallPath";
const char CPP_TOOLCHAINPREFIX[] = "cpp.toolchainPrefix";
const char CPP_COMPILERNAME[] = "cpp.compilerName"; const char CPP_COMPILERNAME[] = "cpp.compilerName";
const char CPP_PLATFORMCFLAGS[] = "cpp.platformCFlags";
const char CPP_PLATFORMCXXFLAGS[] = "cpp.platformCxxFlags";
} // namespace Constants } // namespace Constants
} // namespace QbsProjectManager } // namespace QbsProjectManager

View File

@@ -150,6 +150,12 @@ void QbsManager::addQtProfileFromKit(const QString &profileName, const ProjectEx
return; return;
qbs::QtEnvironment qtEnv; 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(); qtEnv.binaryPath = qt->binPath().toString();
if (qt->hasDebugBuild()) if (qt->hasDebugBuild())
qtEnv.buildVariant << QLatin1String("debug"); qtEnv.buildVariant << QLatin1String("debug");

View File

@@ -1990,13 +1990,46 @@ void QmakeProFileNode::applyEvaluate(EvalResult evalResult, bool async)
m_validParse = (evalResult == EvalOk); m_validParse = (evalResult == EvalOk);
if (m_validParse) { 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 // update TargetInformation
m_qmakeTargetInformation = targetInformation(m_readerExact); m_qmakeTargetInformation = targetInformation(m_readerExact, readerBuildPass);
m_resolvedMkspecPath = m_readerExact->resolvedMkSpec(); m_resolvedMkspecPath = m_readerExact->resolvedMkSpec();
m_subProjectsNotToDeploy = subProjectsNotToDeploy; m_subProjectsNotToDeploy = subProjectsNotToDeploy;
setupInstallsList(m_readerExact); setupInstallsList(readerBuildPass);
QString buildDirectory = buildDir(); QString buildDirectory = buildDir();
// update other variables // 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) { if (m_varValues != newVarValues) {
QmakeVariablesHash oldValues = m_varValues; QmakeVariablesHash oldValues = m_varValues;
m_varValues = newVarValues; m_varValues = newVarValues;
@@ -2200,61 +2236,31 @@ QStringList QmakeProFileNode::subDirsPaths(QtSupport::ProFileReader *reader, QSt
return subProjectPaths; return subProjectPaths;
} }
TargetInformation QmakeProFileNode::targetInformation(QtSupport::ProFileReader *reader) const TargetInformation QmakeProFileNode::targetInformation(QtSupport::ProFileReader *reader, QtSupport::ProFileReader *readerBuildPass) const
{ {
TargetInformation result; TargetInformation result;
if (!reader) if (!reader || !readerBuildPass)
return result; return result;
QtSupport::ProFileReader *readerBP = 0;
QStringList builds = reader->values(QLatin1String("BUILDS")); QStringList builds = reader->values(QLatin1String("BUILDS"));
if (!builds.isEmpty()) { if (!builds.isEmpty()) {
QString build = builds.first(); QString build = builds.first();
result.buildTarget = reader->value(build + QLatin1String(".target")); 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 // BUILD DIR
result.buildDir = buildDir(); result.buildDir = buildDir();
if (reader->contains(QLatin1String("DESTDIR"))) if (readerBuildPass->contains(QLatin1String("DESTDIR")))
result.destDir = reader->value(QLatin1String("DESTDIR")); result.destDir = readerBuildPass->value(QLatin1String("DESTDIR"));
// Target // Target
result.target = reader->value(QLatin1String("TARGET")); result.target = readerBuildPass->value(QLatin1String("TARGET"));
if (result.target.isEmpty()) if (result.target.isEmpty())
result.target = QFileInfo(m_projectFilePath).baseName(); result.target = QFileInfo(m_projectFilePath).baseName();
result.valid = true; result.valid = true;
if (readerBP)
m_project->destroyProFileReader(readerBP);
return result; return result;
} }

View File

@@ -442,7 +442,7 @@ private:
QStringList libDirectories(QtSupport::ProFileReader *reader) const; QStringList libDirectories(QtSupport::ProFileReader *reader) const;
QStringList subDirsPaths(QtSupport::ProFileReader *reader, QStringList *subProjectsNotToDeploy, bool silent) 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); void setupInstallsList(const QtSupport::ProFileReader *reader);
bool m_isDeployable; bool m_isDeployable;

View File

@@ -395,7 +395,6 @@ void SubComponentManager::registerQmlFile(const QFileInfo &fileInfo, const QStri
itemLibraryEntry.setName(baseComponentName); itemLibraryEntry.setName(baseComponentName);
itemLibraryEntry.setCategory("QML Components"); itemLibraryEntry.setCategory("QML Components");
if (!qualifier.isEmpty()) { if (!qualifier.isEmpty()) {
itemLibraryEntry.setForceImport(true);
itemLibraryEntry.setRequiredImport(fixedQualifier); itemLibraryEntry.setRequiredImport(fixedQualifier);
} }

View File

@@ -52,6 +52,7 @@ ListView {
} }
delegate: Item { delegate: Item {
width: 80
height: 40 height: 40
x: 5 x: 5
Row { Row {

View File

@@ -52,6 +52,7 @@ ListView {
} }
delegate: Item { delegate: Item {
width: 80
height: 40 height: 40
x: 5 x: 5
Row { Row {

View File

@@ -198,6 +198,8 @@ static QString relativeToPath()
static QString errorLocation(const QModelIndex &index, const Error &error, static QString errorLocation(const QModelIndex &index, const Error &error,
bool link = false, const QString &linkAttr = QString()) bool link = false, const QString &linkAttr = QString())
{ {
if (!index.isValid())
return QString();
const ErrorListModel *model = 0; const ErrorListModel *model = 0;
const QAbstractProxyModel *proxy = qobject_cast<const QAbstractProxyModel *>(index.model()); const QAbstractProxyModel *proxy = qobject_cast<const QAbstractProxyModel *>(index.model());
while (!model && proxy) { while (!model && proxy) {

View File

@@ -48,6 +48,7 @@
#include <extensionsystem/iplugin.h> #include <extensionsystem/iplugin.h>
#include <extensionsystem/pluginmanager.h> #include <extensionsystem/pluginmanager.h>
#include <projectexplorer/deploymentdata.h>
#include <projectexplorer/projectexplorer.h> #include <projectexplorer/projectexplorer.h>
#include <projectexplorer/project.h> #include <projectexplorer/project.h>
#include <projectexplorer/runconfiguration.h> #include <projectexplorer/runconfiguration.h>
@@ -144,6 +145,11 @@ bool MemcheckErrorFilterProxyModel::filterAcceptsRow(int sourceRow, const QModel
foreach (Project *project, SessionManager::projects()) { foreach (Project *project, SessionManager::projects()) {
validFolders << project->projectDirectory(); validFolders << project->projectDirectory();
foreach (Target *target, project->targets()) { foreach (Target *target, project->targets()) {
foreach (const ProjectExplorer::DeployableFile &file,
target->deploymentData().allFiles()) {
if (file.isExecutable())
validFolders << file.remoteDirectory();
}
foreach (BuildConfiguration *config, target->buildConfigurations()) foreach (BuildConfiguration *config, target->buildConfigurations())
validFolders << config->buildDirectory().toString(); validFolders << config->buildDirectory().toString();
} }

View File

@@ -142,7 +142,7 @@ void ValgrindProcess::run(const QString &valgrindExecutable, const QStringList &
if (m_remote.m_connection->state() != QSsh::SshConnection::Connected) { 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(connected()), this, SLOT(connected()));
connect(m_remote.m_connection, SIGNAL(error(QSsh::SshError)), 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) if (m_remote.m_connection->state() == QSsh::SshConnection::Unconnected)
m_remote.m_connection->connectToHost(); m_remote.m_connection->connectToHost();
} else { } else {

View File

@@ -239,7 +239,7 @@ int ErrorListModel::rowCount(const QModelIndex &parent) const
{ {
if (parent.isValid()) if (parent.isValid())
return 0; return 0;
return qMax(1, d->errors.count()); return d->errors.count();
} }
int ErrorListModel::columnCount(const QModelIndex &parent) const int ErrorListModel::columnCount(const QModelIndex &parent) const

View File

@@ -12,7 +12,7 @@ Project {
] ]
property bool qbsSubModuleExists: File.exists(qbsProject.qbsBaseDir + "/qbs.qbs") property bool qbsSubModuleExists: File.exists(qbsProject.qbsBaseDir + "/qbs.qbs")
property path qbs_install_dir: qbs.getenv("QBS_INSTALL_DIR") property path qbs_install_dir: qbs.getEnv("QBS_INSTALL_DIR")
property bool useExternalQbs: qbs_install_dir property bool useExternalQbs: qbs_install_dir
property bool buildQbsProjectManager: useExternalQbs || qbsSubModuleExists property bool buildQbsProjectManager: useExternalQbs || qbsSubModuleExists
Project { Project {

View File

@@ -35,6 +35,7 @@
:Behavior.Autocomplete common prefix_QCheckBox {container=':CppTools__Internal__CompletionSettingsPage.Behavior_QGroupBox' name='partiallyComplete' text='Autocomplete common prefix' type='QCheckBox' visible='1'} :Behavior.Autocomplete common prefix_QCheckBox {container=':CppTools__Internal__CompletionSettingsPage.Behavior_QGroupBox' name='partiallyComplete' text='Autocomplete common prefix' type='QCheckBox' visible='1'}
:Behavior.completionTrigger_QComboBox {container=':CppTools__Internal__CompletionSettingsPage.Behavior_QGroupBox' name='completionTrigger' type='QComboBox' visible='1'} :Behavior.completionTrigger_QComboBox {container=':CppTools__Internal__CompletionSettingsPage.Behavior_QGroupBox' name='completionTrigger' type='QComboBox' visible='1'}
:Breakpoints_Debugger::Internal::BreakTreeView {container=':DebugModeWidget.Breakpoints_QDockWidget' type='Debugger::Internal::BreakTreeView' unnamed='1' visible='1'} :Breakpoints_Debugger::Internal::BreakTreeView {container=':DebugModeWidget.Breakpoints_QDockWidget' type='Debugger::Internal::BreakTreeView' unnamed='1' visible='1'}
:Build and Run.Save all files before build_QCheckBox {name='saveAllFilesCheckBox' type='QCheckBox' visible='1'}
:BuildAndRun_QTreeView {container=':qt_tabwidget_stackedwidget_QWidget' type='QTreeView' unnamed='1' visible='1'} :BuildAndRun_QTreeView {container=':qt_tabwidget_stackedwidget_QWidget' type='QTreeView' unnamed='1' visible='1'}
:CMake Wizard.Cancel_QPushButton {text='Cancel' type='QPushButton' visible='1' window=':CMake Wizard_CMakeProjectManager::Internal::CMakeOpenProjectWizard'} :CMake Wizard.Cancel_QPushButton {text='Cancel' type='QPushButton' visible='1' window=':CMake Wizard_CMakeProjectManager::Internal::CMakeOpenProjectWizard'}
:CMake Wizard.Finish_QPushButton {text~='(Finish|Done)' type='QPushButton' visible='1' window=':CMake Wizard_CMakeProjectManager::Internal::CMakeOpenProjectWizard'} :CMake Wizard.Finish_QPushButton {text~='(Finish|Done)' type='QPushButton' visible='1' window=':CMake Wizard_CMakeProjectManager::Internal::CMakeOpenProjectWizard'}
@@ -148,7 +149,6 @@
:Qt Creator_Core::Internal::CommandComboBox {type='Core::Internal::CommandComboBox' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :Qt Creator_Core::Internal::CommandComboBox {type='Core::Internal::CommandComboBox' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:Qt Creator_Core::Internal::MainWindow {type='Core::Internal::MainWindow' visible='1' windowTitle?='*Qt Creator'} :Qt Creator_Core::Internal::MainWindow {type='Core::Internal::MainWindow' visible='1' windowTitle?='*Qt Creator'}
:Qt Creator_Core::Internal::NavComboBox {type='Core::Internal::NavComboBox' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :Qt Creator_Core::Internal::NavComboBox {type='Core::Internal::NavComboBox' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:Qt Creator_Core::Internal::OutputPaneManageButton {type='Core::Internal::OutputPaneManageButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:Qt Creator_Core::Internal::ProgressBar {type='Core::Internal::ProgressBar' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :Qt Creator_Core::Internal::ProgressBar {type='Core::Internal::ProgressBar' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:Qt Creator_Core::OutputWindow {type='Core::OutputWindow' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :Qt Creator_Core::OutputWindow {type='Core::OutputWindow' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:Qt Creator_CppEditor::Internal::CPPEditorWidget {type='CppEditor::Internal::CPPEditorWidget' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :Qt Creator_CppEditor::Internal::CPPEditorWidget {type='CppEditor::Internal::CPPEditorWidget' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
@@ -173,7 +173,6 @@
:Qt Creator_TextEditor::PlainTextEditorWidget {type='TextEditor::PlainTextEditorWidget' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :Qt Creator_TextEditor::PlainTextEditorWidget {type='TextEditor::PlainTextEditorWidget' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:Qt Creator_Utils::NavigationTreeView {type='Utils::NavigationTreeView' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :Qt Creator_Utils::NavigationTreeView {type='Utils::NavigationTreeView' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:Qt Creator_Utils::NavigationTreeView::QExpandingLineEdit {container=':Qt Creator_Utils::NavigationTreeView' type='QExpandingLineEdit' unnamed='1' visible='1'} :Qt Creator_Utils::NavigationTreeView::QExpandingLineEdit {container=':Qt Creator_Utils::NavigationTreeView' type='QExpandingLineEdit' unnamed='1' visible='1'}
:Qt Creator_VersionControl_Core::Internal::OutputPaneToggleButton {occurrence='6' type='Core::Internal::OutputPaneToggleButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:Qt Gui Application.Form file:_QLabel {name='formLabel' text='Form file:' type='QLabel' visible='1' window=':Qt Gui Application_QmakeProjectManager::Internal::GuiAppWizardDialog'} :Qt Gui Application.Form file:_QLabel {name='formLabel' text='Form file:' type='QLabel' visible='1' window=':Qt Gui Application_QmakeProjectManager::Internal::GuiAppWizardDialog'}
:Qt Gui Application.Header file:_QLabel {name='headerLabel' text='Header file:' type='QLabel' visible='1' window=':Qt Gui Application_QmakeProjectManager::Internal::GuiAppWizardDialog'} :Qt Gui Application.Header file:_QLabel {name='headerLabel' text='Header file:' type='QLabel' visible='1' window=':Qt Gui Application_QmakeProjectManager::Internal::GuiAppWizardDialog'}
:Qt Gui Application.Source file:_QLabel {name='sourceLabel' text='Source file:' type='QLabel' visible='1' window=':Qt Gui Application_QmakeProjectManager::Internal::GuiAppWizardDialog'} :Qt Gui Application.Source file:_QLabel {name='sourceLabel' text='Source file:' type='QLabel' visible='1' window=':Qt Gui Application_QmakeProjectManager::Internal::GuiAppWizardDialog'}
@@ -189,6 +188,9 @@
:Revert to Saved_QMessageBox {text?='You will lose your current changes if you proceed reverting*' type='QMessageBox' unnamed='1' visible='1'} :Revert to Saved_QMessageBox {text?='You will lose your current changes if you proceed reverting*' type='QMessageBox' unnamed='1' visible='1'}
:RunSettingsEnvironmentDetails_Utils::DetailsButton {leftWidget=':RunSettingsUseBuildEnvironment_QLabel' text='Details' type='Utils::DetailsButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :RunSettingsEnvironmentDetails_Utils::DetailsButton {leftWidget=':RunSettingsUseBuildEnvironment_QLabel' text='Details' type='Utils::DetailsButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:RunSettingsUseBuildEnvironment_QLabel {text~='Us(e|ing) <b>Build Environment</b>' type='QLabel' unnamed='1' visible='1'} :RunSettingsUseBuildEnvironment_QLabel {text~='Us(e|ing) <b>Build Environment</b>' type='QLabel' unnamed='1' visible='1'}
:Save Changes.Always save files before build_QCheckBox {name='saveBeforeBuildCheckBox' text='Always save files before build' type='QCheckBox' visible='1' window=':Save Changes_Core::Internal::SaveItemsDialog'}
:Save Changes.Save All_QPushButton {text='Save All' type='QPushButton' unnamed='1' visible='1' window=':Save Changes_Core::Internal::SaveItemsDialog'}
:Save Changes_Core::Internal::SaveItemsDialog {name='Core__Internal__SaveItemsDialog' type='Core::Internal::SaveItemsDialog' visible='1' windowTitle='Save Changes'}
:Select signal.signalList_QTreeWidget {container=':Go to slot.Select signal_QGroupBox' name='signalList' type='QTreeWidget' visible='1'} :Select signal.signalList_QTreeWidget {container=':Go to slot.Select signal_QGroupBox' name='signalList' type='QTreeWidget' visible='1'}
:Send to Codepaster.Cancel_QPushButton {text='Cancel' type='QPushButton' unnamed='1' visible='1' window=':Send to Codepaster_CodePaster::PasteView'} :Send to Codepaster.Cancel_QPushButton {text='Cancel' type='QPushButton' unnamed='1' visible='1' window=':Send to Codepaster_CodePaster::PasteView'}
:Send to Codepaster.Description:_QLabel {name='descriptionLabel' text='Description:' type='QLabel' visible='1' window=':Send to Codepaster_CodePaster::PasteView'} :Send to Codepaster.Description:_QLabel {name='descriptionLabel' text='Description:' type='QLabel' visible='1' window=':Send to Codepaster_CodePaster::PasteView'}

View File

@@ -81,7 +81,7 @@ def ensureChecked(objectName, shouldBeChecked = True, timeout=20000):
# param expectedState is the expected enable state of the object # param expectedState is the expected enable state of the object
def verifyEnabled(objectSpec, expectedState = True): def verifyEnabled(objectSpec, expectedState = True):
if isinstance(objectSpec, (str, unicode)): if isinstance(objectSpec, (str, unicode)):
waitFor("object.exists('" + objectSpec + "')", 20000) waitFor("object.exists('" + str(objectSpec).replace("'", "\\'") + "')", 20000)
foundObject = findObject(objectSpec) foundObject = findObject(objectSpec)
else: else:
foundObject = objectSpec foundObject = objectSpec
@@ -633,13 +633,17 @@ def verifyItemOrder(items, text):
lastIndex = index lastIndex = index
def openVcsLog(): def openVcsLog():
if not object.exists(":Qt Creator_VersionControl_Core::Internal::OutputPaneToggleButton"): try:
clickButton(waitForObject(":Qt Creator_Core::Internal::OutputPaneManageButton")) foundObj = waitForObject("{type='QPlainTextEdit' unnamed='1' visible='1' "
if platform.system() == 'Darwin': "window=':Qt Creator_Core::Internal::MainWindow'}", 2000)
waitFor('macHackActivateContextMenuItem("Version Control")', 6000) if className(foundObj) != 'QPlainTextEdit':
else: raise Exception("Found derived class, but not a pure QPlainTextEdit.")
activateItem(waitForObjectItem("{type='QMenu' unnamed='1' visible='1'}", "Version Control")) except:
ensureChecked(waitForObject(":Qt Creator_VersionControl_Core::Internal::OutputPaneToggleButton")) invokeMenuItem("Window", "Output Panes", "Version Control")
def openGeneralMessages():
if not object.exists(":Qt Creator_Core::OutputWindow"):
invokeMenuItem("Window", "Output Panes", "General Messages")
# function that retrieves a specific child object by its class # function that retrieves a specific child object by its class
# this is sometimes the best way to avoid using waitForObject() on objects that # this is sometimes the best way to avoid using waitForObject() on objects that

View File

@@ -28,7 +28,6 @@
############################################################################# #############################################################################
source("../../shared/qtcreator.py") source("../../shared/qtcreator.py")
source("../../shared/suites_qtta.py")
# test New Qt Gui Application build and run for release and debug option # test New Qt Gui Application build and run for release and debug option
def main(): def main():

View File

@@ -28,7 +28,6 @@
############################################################################# #############################################################################
source("../../shared/qtcreator.py") source("../../shared/qtcreator.py")
source("../../shared/suites_qtta.py")
# test New Qt Quick Application build and run for release and debug option # test New Qt Quick Application build and run for release and debug option
def main(): def main():

View File

@@ -27,7 +27,6 @@
## ##
############################################################################# #############################################################################
source("../../shared/suites_qtta.py")
source("../../shared/qtcreator.py") source("../../shared/qtcreator.py")
# entry of test # entry of test

View File

@@ -27,7 +27,6 @@
## ##
############################################################################# #############################################################################
source("../../shared/suites_qtta.py")
source("../../shared/qtcreator.py") source("../../shared/qtcreator.py")
# entry of test # entry of test

View File

@@ -27,7 +27,6 @@
## ##
############################################################################# #############################################################################
source("../../shared/suites_qtta.py")
source("../../shared/qtcreator.py") source("../../shared/qtcreator.py")
# entry of test # entry of test

View File

@@ -27,7 +27,6 @@
## ##
############################################################################# #############################################################################
source("../../shared/suites_qtta.py")
source("../../shared/qtcreator.py") source("../../shared/qtcreator.py")
# entry of test # entry of test

View File

@@ -28,7 +28,6 @@
############################################################################# #############################################################################
source("../../shared/qtcreator.py") source("../../shared/qtcreator.py")
source("../../shared/suites_qtta.py")
# test Qt Creator version information from file and dialog # test Qt Creator version information from file and dialog
def getQtCreatorVersionFromDialog(): def getQtCreatorVersionFromDialog():

View File

@@ -28,7 +28,6 @@
############################################################################# #############################################################################
source("../../shared/qtcreator.py") source("../../shared/qtcreator.py")
source("../../shared/suites_qtta.py")
import re import re
# test search in help mode and advanced search # test search in help mode and advanced search

View File

@@ -28,7 +28,6 @@
############################################################################# #############################################################################
source("../../shared/qtcreator.py") source("../../shared/qtcreator.py")
source("../../shared/suites_qtta.py")
# test context sensitive help in edit mode # test context sensitive help in edit mode
# place cursor to <lineText> keyword, in <editorArea>, and verify help to contain <helpText> # place cursor to <lineText> keyword, in <editorArea>, and verify help to contain <helpText>

View File

@@ -28,7 +28,6 @@
############################################################################# #############################################################################
source("../../shared/qtcreator.py") source("../../shared/qtcreator.py")
source("../../shared/suites_qtta.py")
# test bookmark functionality # test bookmark functionality
def renameBookmarkFolder(view, item, newName): def renameBookmarkFolder(view, item, newName):

View File

@@ -28,7 +28,6 @@
############################################################################# #############################################################################
source("../../shared/qtcreator.py") source("../../shared/qtcreator.py")
source("../../shared/suites_qtta.py")
def startQtCreatorWithNewAppAtQMLEditor(projectDir, projectName, line = None): def startQtCreatorWithNewAppAtQMLEditor(projectDir, projectName, line = None):
startApplication("qtcreator" + SettingsPath) startApplication("qtcreator" + SettingsPath)

View File

@@ -28,6 +28,7 @@
############################################################################# #############################################################################
source("../shared/qmls.py") source("../shared/qmls.py")
source("../../shared/suites_qtta.py")
# go to proper line, make backup, type needed text # go to proper line, make backup, type needed text
def __beginTestSuggestions__(editorArea, lineText, textToType): def __beginTestSuggestions__(editorArea, lineText, textToType):

View File

@@ -28,6 +28,7 @@
############################################################################# #############################################################################
source("../shared/qmls.py") source("../shared/qmls.py")
source("../../shared/suites_qtta.py")
def main(): def main():
editorArea = startQtCreatorWithNewAppAtQMLEditor(tempDir(), "SampleApp", "Text {") editorArea = startQtCreatorWithNewAppAtQMLEditor(tempDir(), "SampleApp", "Text {")

View File

@@ -28,7 +28,6 @@
############################################################################# #############################################################################
source("../../shared/qtcreator.py") source("../../shared/qtcreator.py")
source("../../shared/suites_qtta.py")
class ExpectedResult: class ExpectedResult:
def __init__(self, file, lineNumber, lineContent): def __init__(self, file, lineNumber, lineContent):

View File

@@ -28,7 +28,6 @@
############################################################################# #############################################################################
source("../../shared/qtcreator.py") source("../../shared/qtcreator.py")
source("../../shared/suites_qtta.py")
# entry of test # entry of test
def main(): def main():

View File

@@ -28,7 +28,6 @@
############################################################################# #############################################################################
source("../../shared/qtcreator.py") source("../../shared/qtcreator.py")
source("../../shared/suites_qtta.py")
def verifyChangeProject(projectName): def verifyChangeProject(projectName):
projItem = invokeContextMenuOnProject(projectName, 'Set "%s" as Active Project' % projectName) projItem = invokeContextMenuOnProject(projectName, 'Set "%s" as Active Project' % projectName)

View File

@@ -28,7 +28,6 @@
############################################################################# #############################################################################
source("../../shared/qtcreator.py") source("../../shared/qtcreator.py")
source("../../shared/suites_qtta.py")
global templateDir global templateDir

View File

@@ -7,6 +7,6 @@ HOOK_SUB_PROCESSES=false
IMPLICITAUTSTART=0 IMPLICITAUTSTART=0
LANGUAGE=Python LANGUAGE=Python
OBJECTMAP=../objects.map OBJECTMAP=../objects.map
TEST_CASES=tst_build_speedcrunch tst_cmake_speedcrunch tst_create_proj_wizard tst_default_settings tst_installed_languages tst_openqt_creator tst_rename_file tst_session_handling TEST_CASES=tst_build_speedcrunch tst_cmake_speedcrunch tst_create_proj_wizard tst_default_settings tst_installed_languages tst_openqt_creator tst_rename_file tst_save_before_build tst_session_handling
VERSION=2 VERSION=2
WRAPPERS=Qt WRAPPERS=Qt

View File

@@ -0,0 +1,73 @@
#############################################################################
##
## Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
## Contact: http://www.qt-project.org/legal
##
## This file is part of Qt Creator.
##
## Commercial License Usage
## Licensees holding valid commercial Qt licenses may use this file in
## accordance with the commercial license agreement provided with the
## Software or, alternatively, in accordance with the terms contained in
## a written agreement between you and Digia. For licensing terms and
## conditions see http://qt.digia.com/licensing. For further information
## use the contact form at http://qt.digia.com/contact-us.
##
## GNU Lesser General Public License Usage
## Alternatively, this file may be used under the terms of the GNU Lesser
## General Public License version 2.1 as published by the Free Software
## Foundation and appearing in the file LICENSE.LGPL included in the
## packaging of this file. Please review the following information to
## ensure the GNU Lesser General Public License version 2.1 requirements
## will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
##
## In addition, as a special exception, Digia gives you certain additional
## rights. These rights are described in the Digia Qt LGPL Exception
## version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
##
#############################################################################
source("../../shared/qtcreator.py")
def ensureSaveBeforeBuildChecked(shouldBeChecked):
invokeMenuItem("Tools", "Options...")
waitForObjectItem(":Options_QListView", "Build & Run")
clickItem(":Options_QListView", "Build & Run", 14, 15, 0, Qt.LeftButton)
clickOnTab(":Options.qt_tabwidget_tabbar_QTabBar", "General")
if test.compare(waitForObject(":Build and Run.Save all files before build_QCheckBox").checked,
shouldBeChecked, "'Save all files before build' should be %s" % str(shouldBeChecked)):
clickButton(waitForObject(":Options.Cancel_QPushButton"))
else:
ensureChecked(":Build and Run.Save all files before build_QCheckBox", shouldBeChecked)
clickButton(waitForObject(":Options.OK_QPushButton"))
def main():
startApplication("qtcreator" + SettingsPath)
if not startedWithoutPluginError():
return
ensureSaveBeforeBuildChecked(False)
# create qt quick application
createNewQtQuickApplication(tempDir(), "SampleApp", qtQuickVersion="2.2")
for expectDialog in [True, False]:
files = ["SampleApp.SampleApp\\.pro",
"SampleApp.deployment.deployment\\.pri",
"SampleApp.Sources.main\\.cpp",
"SampleApp.Resources.qml\.qrc./.main\\.qml"]
for i, file in enumerate(files):
if not openDocument(file):
test.fatal("Could not open file '%s'" % simpleFileName(file))
continue
test.log("Changing file '%s'" % simpleFileName(file))
typeLines(getEditorForFileSuffix(file), "")
# try to compile
clickButton(waitForObject(":*Qt Creator.Build Project_Core::Internal::FancyToolButton"))
try:
ensureChecked(":Save Changes.Always save files before build_QCheckBox",
i == len(files) - 1, 5000) # At the last iteration, check the box
clickButton(waitForObject(":Save Changes.Save All_QPushButton"))
test.verify(expectDialog, "The 'Save Changes' dialog was shown.")
except:
test.verify(not expectDialog, "The 'Save Changes' dialog was not shown.")
waitForCompile()
ensureSaveBeforeBuildChecked(True)
invokeMenuItem("File", "Exit")

View File

@@ -37,10 +37,11 @@ def main():
unsortedFile = os.path.join(os.getcwd(), "testdata", "unsorted.txt") unsortedFile = os.path.join(os.getcwd(), "testdata", "unsorted.txt")
sorted = getOutputFromCmdline("sort %s" % unsortedFile).replace("\r", "") sorted = getOutputFromCmdline("sort %s" % unsortedFile).replace("\r", "")
selectFromFileDialog(unsortedFile) selectFromFileDialog(unsortedFile)
invokeMenuItem("Edit", "Select All")
invokeMenuItem("Tools", "External", "Text", "Sort Selection")
editor = waitForObject("{type='TextEditor::PlainTextEditorWidget' unnamed='1' " editor = waitForObject("{type='TextEditor::PlainTextEditorWidget' unnamed='1' "
"visible='1' window=':Qt Creator_Core::Internal::MainWindow'}", 3000) "visible='1' window=':Qt Creator_Core::Internal::MainWindow'}", 3000)
placeCursorToLine(editor, "bbb")
invokeMenuItem("Edit", "Select All")
invokeMenuItem("Tools", "External", "Text", "Sort Selection")
test.verify(waitFor("str(editor.plainText) == sorted", 2000), test.verify(waitFor("str(editor.plainText) == sorted", 2000),
"Verify that sorted text\n%s\nmatches the expected text\n%s" % (editor.plainText, sorted)) "Verify that sorted text\n%s\nmatches the expected text\n%s" % (editor.plainText, sorted))
invokeMenuItem('File', 'Revert "unsorted.txt" to Saved') invokeMenuItem('File', 'Revert "unsorted.txt" to Saved')

View File

@@ -33,14 +33,14 @@ cloneUrl = "https://codereview.qt-project.org/p/qt-labs/jom"
cloneDir = "myCloneOfJom" cloneDir = "myCloneOfJom"
def verifyCloneLog(targetDir, canceled): def verifyCloneLog(targetDir, canceled):
finish = findObject(":Git Repository Clone.Finish_QPushButton")
waitFor("canceled or finish.enabled", 30000)
if canceled: if canceled:
summary = "Failed." summary = "Failed."
else: else:
finish = findObject(":Git Repository Clone.Finish_QPushButton")
waitFor("finish.enabled", 30000)
cloneLog = str(waitForObject(":Git Repository Clone.logPlainTextEdit_QPlainTextEdit").plainText) cloneLog = str(waitForObject(":Git Repository Clone.logPlainTextEdit_QPlainTextEdit").plainText)
if "fatal: The remote end hung up unexpectedly" in cloneLog: if "fatal: " in cloneLog:
test.warning("Remote end hung up unexpectedly.") test.warning("Cloning failed outside Creator.")
return False return False
# test for QTCREATORBUG-10112 # test for QTCREATORBUG-10112
test.compare(cloneLog.count("remote: Counting objects:"), 1) test.compare(cloneLog.count("remote: Counting objects:"), 1)
@@ -52,9 +52,17 @@ def verifyCloneLog(targetDir, canceled):
test.verify(("'" + cloneDir + "'..." in cloneLog), test.verify(("'" + cloneDir + "'..." in cloneLog),
"Searching for clone directory in clone log") "Searching for clone directory in clone log")
summary = "Succeeded." summary = "Succeeded."
try:
resultLabel = findObject(":Git Repository Clone.Result._QLabel") resultLabel = findObject(":Git Repository Clone.Result._QLabel")
test.verify(waitFor('str(resultLabel.text) == summary', 3000), test.verify(waitFor('str(resultLabel.text) == summary', 3000),
"Verifying expected result (%s)" % summary) "Verifying expected result (%s)" % summary)
except:
if canceled:
test.warning("Could not find resultLabel",
"Cloning might have failed before clicking 'Cancel'")
return object.exists(":Git Repository Clone_VcsBase::Internal::CheckoutWizardDialog")
else:
test.fail("Could not find resultLabel")
return True return True
def verifyVersionControlView(targetDir, canceled): def verifyVersionControlView(targetDir, canceled):
@@ -101,7 +109,8 @@ def main():
# wait for cloning to have started # wait for cloning to have started
waitFor('len(str(cloneLog.plainText)) > 20 + len(cloneDir)') waitFor('len(str(cloneLog.plainText)) > 20 + len(cloneDir)')
clickButton(":Git Repository Clone.Cancel_QPushButton") clickButton(":Git Repository Clone.Cancel_QPushButton")
verifyCloneLog(targetDir, True) if not verifyCloneLog(targetDir, True):
continue
clickButton(":Git Repository Clone.Cancel_QPushButton") clickButton(":Git Repository Clone.Cancel_QPushButton")
else: else:
if not verifyCloneLog(targetDir, False): if not verifyCloneLog(targetDir, False):