forked from qt-creator/qt-creator
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:
@@ -79,6 +79,9 @@ ApplicationWindow {
|
||||
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)
|
||||
|
||||
if (isNaN(newX) || isNaN(newY))
|
||||
return;
|
||||
|
||||
if (newX < 0)
|
||||
newX = 0
|
||||
|
||||
|
||||
@@ -614,6 +614,12 @@
|
||||
view, making it seem like the program was interrupted before entering the
|
||||
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
|
||||
|
||||
Whenever a program stops under the control of the debugger, it retrieves
|
||||
|
||||
@@ -176,4 +176,18 @@
|
||||
reparsed automatically. For all other files, you can use \gui{Tools} >
|
||||
\gui{C++} > \gui{Reparse Externally Changed Files} to update the code
|
||||
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.
|
||||
*/
|
||||
|
||||
@@ -196,6 +196,9 @@
|
||||
\skipto onReadingChanged
|
||||
\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
|
||||
the bubble to make its movement look smoother.
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ DynamicLibrary {
|
||||
: ["$ORIGIN", "$ORIGIN/.."]
|
||||
property string libIncludeBase: ".." // #include <lib/header.h>
|
||||
cpp.includePaths: [libIncludeBase]
|
||||
cpp.minimumWindowsVersion: "5.1"
|
||||
cpp.minimumWindowsVersion: qbs.architecture === "x86" ? "5.1" : "5.2"
|
||||
|
||||
Export {
|
||||
Depends { name: "cpp" }
|
||||
|
||||
@@ -39,7 +39,7 @@ Product {
|
||||
|
||||
property string pluginIncludeBase: ".." // #include <plugin/header.h>
|
||||
cpp.includePaths: [pluginIncludeBase]
|
||||
cpp.minimumWindowsVersion: "5.1"
|
||||
cpp.minimumWindowsVersion: qbs.architecture === "x86" ? "5.1" : "5.2"
|
||||
|
||||
Group {
|
||||
name: "PluginSpec"
|
||||
|
||||
@@ -18,7 +18,7 @@ Application {
|
||||
cpp.rpaths: qbs.targetOS.contains("osx")
|
||||
? ["@executable_path/../" + project.ide_library_path]
|
||||
: ["$ORIGIN/../" + project.ide_library_path]
|
||||
cpp.minimumWindowsVersion: "5.1"
|
||||
cpp.minimumWindowsVersion: qbs.architecture === "x86" ? "5.1" : "5.2"
|
||||
|
||||
Group {
|
||||
fileTagsFilter: product.type
|
||||
|
||||
@@ -45,7 +45,7 @@ Project {
|
||||
property string ide_bin_path: qbs.targetOS.contains("osx")
|
||||
? ide_app_target + ".app/Contents/MacOS"
|
||||
: ide_app_path
|
||||
property bool testsEnabled: qbs.getenv("TEST") || qbs.buildVariant === "debug"
|
||||
property bool testsEnabled: qbs.getEnv("TEST") || qbs.buildVariant === "debug"
|
||||
property stringList generalDefines: [
|
||||
"QT_CREATOR",
|
||||
'IDE_LIBRARY_BASENAME="' + libDirName + '"',
|
||||
|
||||
@@ -156,8 +156,6 @@ ButtonRow {
|
||||
|
||||
onClicked: {
|
||||
if (checked) {
|
||||
anchorBackend.leftAnchored = false;
|
||||
anchorBackend.rightAnchored = false;
|
||||
anchorBackend.topAnchored = false;
|
||||
anchorBackend.bottomAnchored = false;
|
||||
anchorBackend.verticalCentered = true;
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
import QtQuick 2.1
|
||||
import QtQuick.Controls 1.0 as Controls
|
||||
import QtQuick.Layouts 1.0
|
||||
import QtQuick.Controls.Private 1.0
|
||||
|
||||
Item {
|
||||
id: buttonRowButton
|
||||
@@ -41,6 +42,8 @@ Item {
|
||||
|
||||
signal clicked()
|
||||
|
||||
property string tooltip: ""
|
||||
|
||||
width: 24 + leftPadding
|
||||
height: 24
|
||||
|
||||
@@ -94,6 +97,7 @@ Item {
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
id: mouseArea
|
||||
anchors.fill: parent
|
||||
anchors.leftMargin: leftPadding
|
||||
onClicked: {
|
||||
@@ -104,5 +108,16 @@ Item {
|
||||
}
|
||||
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)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -142,7 +142,7 @@ Column {
|
||||
}
|
||||
ColorCheckButton {
|
||||
id: checkButton
|
||||
color: colorButton.color
|
||||
color: backendendValue.value
|
||||
}
|
||||
|
||||
ButtonRow {
|
||||
|
||||
@@ -158,6 +158,15 @@ Rectangle {
|
||||
anchors.right: parent.right
|
||||
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 {
|
||||
title: backendValues.className.value
|
||||
|
||||
@@ -178,6 +187,10 @@ Rectangle {
|
||||
active = false
|
||||
active = true
|
||||
}
|
||||
|
||||
onLoaded: {
|
||||
tabView.specficsTwoHeight = specificsTwo.item.height + 40
|
||||
}
|
||||
}
|
||||
|
||||
Loader {
|
||||
@@ -186,6 +199,10 @@ Rectangle {
|
||||
|
||||
id: specificsOne;
|
||||
source: specificsUrl;
|
||||
|
||||
onLoaded: {
|
||||
tabView.specficsOneHeight = specificsOne.item.height + 40
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -197,6 +214,10 @@ Rectangle {
|
||||
anchors.right: parent.right
|
||||
|
||||
LayoutSection {
|
||||
|
||||
Component.onCompleted: {
|
||||
tabView.layoutSectionHeight = childrenRect.height
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -84,6 +84,5 @@ Column {
|
||||
}
|
||||
|
||||
TextInputSection {
|
||||
showEchoMode: false
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@ Section {
|
||||
anchors.right: parent.right
|
||||
caption: qsTr("Text Input")
|
||||
|
||||
property bool showEchoMode: false
|
||||
property bool isTextInput: false
|
||||
id: textInputSection
|
||||
|
||||
SectionLayout {
|
||||
@@ -46,21 +46,23 @@ Section {
|
||||
|
||||
|
||||
Label {
|
||||
visible: textInputSection.isTextInput
|
||||
text: qsTr("Input mask")
|
||||
}
|
||||
|
||||
LineEdit {
|
||||
visible: textInputSection.isTextInput
|
||||
backendValue: backendValues.inputMask
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
|
||||
Label {
|
||||
visible: textInputSection.showEchoMode
|
||||
visible: textInputSection.isTextInput
|
||||
text: qsTr("Echo mode")
|
||||
}
|
||||
|
||||
ComboBox {
|
||||
visible: textInputSection.showEchoMode
|
||||
visible: textInputSection.isTextInput
|
||||
Layout.fillWidth: true
|
||||
backendValue: backendValues.echoMode
|
||||
scope: "TextInput"
|
||||
@@ -68,11 +70,13 @@ Section {
|
||||
}
|
||||
|
||||
Label {
|
||||
visible: textInputSection.isTextInput
|
||||
text: qsTr("Pass. char")
|
||||
toolTip: qsTr("Character displayed when users enter passwords.")
|
||||
}
|
||||
|
||||
LineEdit {
|
||||
visible: textInputSection.isTextInput
|
||||
backendValue: backendValues.passwordCharacter
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
|
||||
@@ -70,7 +70,6 @@ Column {
|
||||
}
|
||||
|
||||
TextInputSection {
|
||||
showEchoMode: true
|
||||
|
||||
isTextInput: true
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14902,7 +14902,7 @@ Would you like to overwrite them?</source>
|
||||
</message>
|
||||
<message>
|
||||
<source>Find in This Directory...</source>
|
||||
<translation>このディレクトを検索...</translation>
|
||||
<translation>このディレクトリを検索...</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Show in Explorer</source>
|
||||
|
||||
@@ -963,6 +963,41 @@ QmlLanguageBundles ModelManagerInterface::extendedBundles() const
|
||||
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()
|
||||
{
|
||||
QStringList allImportPaths;
|
||||
@@ -1026,36 +1061,7 @@ void ModelManagerInterface::updateImportPaths()
|
||||
|
||||
if (!m_shouldScanImports)
|
||||
return;
|
||||
QStringList pathToScan;
|
||||
{
|
||||
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);
|
||||
}
|
||||
maybeScan(allImportPaths, Language::Qml);
|
||||
}
|
||||
|
||||
ModelManagerInterface::ProjectInfo ModelManagerInterface::defaultProjectInfo() const
|
||||
|
||||
@@ -244,6 +244,7 @@ protected:
|
||||
CPlusPlus::Snapshot snapshot,
|
||||
QHash<QString, QPair<CPlusPlus::Document::Ptr, bool> > documents);
|
||||
|
||||
void maybeScan(const QStringList &importPaths, Language::Enum defaultLanguage);
|
||||
void updateImportPaths();
|
||||
void loadQmlTypeDescriptionsInternal(const QString &path);
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ QtcLibrary {
|
||||
"sshsendfacility.cpp", "sshsendfacility_p.h",
|
||||
].concat(botanFiles)
|
||||
|
||||
property var useSystemBotan: qbs.getenv("USE_SYSTEM_BOTAN") === "1"
|
||||
property var useSystemBotan: qbs.getEnv("USE_SYSTEM_BOTAN") === "1"
|
||||
property var botanIncludes: {
|
||||
var result = ["../3rdparty"];
|
||||
if (useSystemBotan)
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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;
|
||||
newSemanticInfo.forced = source.force;
|
||||
newSemanticInfo.revision = source.revision;
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
// 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();
|
||||
// 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;
|
||||
|
||||
FunctionDefinitionUnderCursor functionDefinitionUnderCursor(semanticInfo.doc->translationUnit());
|
||||
DeclarationAST *currentFunctionDefinition = functionDefinitionUnderCursor(ast, source.line, source.column);
|
||||
// Update semantic info
|
||||
setSemanticInfo(newSemanticInfo, emitSignalWhenFinished);
|
||||
|
||||
const LocalSymbols useTable(semanticInfo.doc, currentFunctionDefinition);
|
||||
semanticInfo.revision = source.revision;
|
||||
semanticInfo.localUses = useTable.uses;
|
||||
}
|
||||
|
||||
{
|
||||
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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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));
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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");
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -52,6 +52,7 @@ ListView {
|
||||
}
|
||||
|
||||
delegate: Item {
|
||||
width: 80
|
||||
height: 40
|
||||
x: 5
|
||||
Row {
|
||||
|
||||
@@ -52,6 +52,7 @@ ListView {
|
||||
}
|
||||
|
||||
delegate: Item {
|
||||
width: 80
|
||||
height: 40
|
||||
x: 5
|
||||
Row {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -12,7 +12,7 @@ Project {
|
||||
]
|
||||
|
||||
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 buildQbsProjectManager: useExternalQbs || qbsSubModuleExists
|
||||
Project {
|
||||
|
||||
@@ -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.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'}
|
||||
: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'}
|
||||
: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'}
|
||||
@@ -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::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::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::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'}
|
||||
@@ -173,7 +173,6 @@
|
||||
: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::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.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'}
|
||||
@@ -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'}
|
||||
: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'}
|
||||
: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'}
|
||||
: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'}
|
||||
|
||||
@@ -81,7 +81,7 @@ def ensureChecked(objectName, shouldBeChecked = True, timeout=20000):
|
||||
# param expectedState is the expected enable state of the object
|
||||
def verifyEnabled(objectSpec, expectedState = True):
|
||||
if isinstance(objectSpec, (str, unicode)):
|
||||
waitFor("object.exists('" + objectSpec + "')", 20000)
|
||||
waitFor("object.exists('" + str(objectSpec).replace("'", "\\'") + "')", 20000)
|
||||
foundObject = findObject(objectSpec)
|
||||
else:
|
||||
foundObject = objectSpec
|
||||
@@ -633,13 +633,17 @@ def verifyItemOrder(items, text):
|
||||
lastIndex = index
|
||||
|
||||
def openVcsLog():
|
||||
if not object.exists(":Qt Creator_VersionControl_Core::Internal::OutputPaneToggleButton"):
|
||||
clickButton(waitForObject(":Qt Creator_Core::Internal::OutputPaneManageButton"))
|
||||
if platform.system() == 'Darwin':
|
||||
waitFor('macHackActivateContextMenuItem("Version Control")', 6000)
|
||||
else:
|
||||
activateItem(waitForObjectItem("{type='QMenu' unnamed='1' visible='1'}", "Version Control"))
|
||||
ensureChecked(waitForObject(":Qt Creator_VersionControl_Core::Internal::OutputPaneToggleButton"))
|
||||
try:
|
||||
foundObj = waitForObject("{type='QPlainTextEdit' unnamed='1' visible='1' "
|
||||
"window=':Qt Creator_Core::Internal::MainWindow'}", 2000)
|
||||
if className(foundObj) != 'QPlainTextEdit':
|
||||
raise Exception("Found derived class, but not a pure QPlainTextEdit.")
|
||||
except:
|
||||
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
|
||||
# this is sometimes the best way to avoid using waitForObject() on objects that
|
||||
|
||||
@@ -28,7 +28,6 @@
|
||||
#############################################################################
|
||||
|
||||
source("../../shared/qtcreator.py")
|
||||
source("../../shared/suites_qtta.py")
|
||||
|
||||
# test New Qt Gui Application build and run for release and debug option
|
||||
def main():
|
||||
|
||||
@@ -28,7 +28,6 @@
|
||||
#############################################################################
|
||||
|
||||
source("../../shared/qtcreator.py")
|
||||
source("../../shared/suites_qtta.py")
|
||||
|
||||
# test New Qt Quick Application build and run for release and debug option
|
||||
def main():
|
||||
|
||||
@@ -27,7 +27,6 @@
|
||||
##
|
||||
#############################################################################
|
||||
|
||||
source("../../shared/suites_qtta.py")
|
||||
source("../../shared/qtcreator.py")
|
||||
|
||||
# entry of test
|
||||
|
||||
@@ -27,7 +27,6 @@
|
||||
##
|
||||
#############################################################################
|
||||
|
||||
source("../../shared/suites_qtta.py")
|
||||
source("../../shared/qtcreator.py")
|
||||
|
||||
# entry of test
|
||||
|
||||
@@ -27,7 +27,6 @@
|
||||
##
|
||||
#############################################################################
|
||||
|
||||
source("../../shared/suites_qtta.py")
|
||||
source("../../shared/qtcreator.py")
|
||||
|
||||
# entry of test
|
||||
|
||||
@@ -27,7 +27,6 @@
|
||||
##
|
||||
#############################################################################
|
||||
|
||||
source("../../shared/suites_qtta.py")
|
||||
source("../../shared/qtcreator.py")
|
||||
|
||||
# entry of test
|
||||
|
||||
@@ -28,7 +28,6 @@
|
||||
#############################################################################
|
||||
|
||||
source("../../shared/qtcreator.py")
|
||||
source("../../shared/suites_qtta.py")
|
||||
|
||||
# test Qt Creator version information from file and dialog
|
||||
def getQtCreatorVersionFromDialog():
|
||||
|
||||
@@ -28,7 +28,6 @@
|
||||
#############################################################################
|
||||
|
||||
source("../../shared/qtcreator.py")
|
||||
source("../../shared/suites_qtta.py")
|
||||
import re
|
||||
|
||||
# test search in help mode and advanced search
|
||||
|
||||
@@ -28,7 +28,6 @@
|
||||
#############################################################################
|
||||
|
||||
source("../../shared/qtcreator.py")
|
||||
source("../../shared/suites_qtta.py")
|
||||
|
||||
# test context sensitive help in edit mode
|
||||
# place cursor to <lineText> keyword, in <editorArea>, and verify help to contain <helpText>
|
||||
|
||||
@@ -28,7 +28,6 @@
|
||||
#############################################################################
|
||||
|
||||
source("../../shared/qtcreator.py")
|
||||
source("../../shared/suites_qtta.py")
|
||||
|
||||
# test bookmark functionality
|
||||
def renameBookmarkFolder(view, item, newName):
|
||||
|
||||
@@ -28,7 +28,6 @@
|
||||
#############################################################################
|
||||
|
||||
source("../../shared/qtcreator.py")
|
||||
source("../../shared/suites_qtta.py")
|
||||
|
||||
def startQtCreatorWithNewAppAtQMLEditor(projectDir, projectName, line = None):
|
||||
startApplication("qtcreator" + SettingsPath)
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
#############################################################################
|
||||
|
||||
source("../shared/qmls.py")
|
||||
source("../../shared/suites_qtta.py")
|
||||
|
||||
# go to proper line, make backup, type needed text
|
||||
def __beginTestSuggestions__(editorArea, lineText, textToType):
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
#############################################################################
|
||||
|
||||
source("../shared/qmls.py")
|
||||
source("../../shared/suites_qtta.py")
|
||||
|
||||
def main():
|
||||
editorArea = startQtCreatorWithNewAppAtQMLEditor(tempDir(), "SampleApp", "Text {")
|
||||
|
||||
@@ -28,7 +28,6 @@
|
||||
#############################################################################
|
||||
|
||||
source("../../shared/qtcreator.py")
|
||||
source("../../shared/suites_qtta.py")
|
||||
|
||||
class ExpectedResult:
|
||||
def __init__(self, file, lineNumber, lineContent):
|
||||
|
||||
@@ -28,7 +28,6 @@
|
||||
#############################################################################
|
||||
|
||||
source("../../shared/qtcreator.py")
|
||||
source("../../shared/suites_qtta.py")
|
||||
|
||||
# entry of test
|
||||
def main():
|
||||
|
||||
@@ -28,7 +28,6 @@
|
||||
#############################################################################
|
||||
|
||||
source("../../shared/qtcreator.py")
|
||||
source("../../shared/suites_qtta.py")
|
||||
|
||||
def verifyChangeProject(projectName):
|
||||
projItem = invokeContextMenuOnProject(projectName, 'Set "%s" as Active Project' % projectName)
|
||||
|
||||
@@ -28,7 +28,6 @@
|
||||
#############################################################################
|
||||
|
||||
source("../../shared/qtcreator.py")
|
||||
source("../../shared/suites_qtta.py")
|
||||
|
||||
global templateDir
|
||||
|
||||
|
||||
@@ -7,6 +7,6 @@ HOOK_SUB_PROCESSES=false
|
||||
IMPLICITAUTSTART=0
|
||||
LANGUAGE=Python
|
||||
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
|
||||
WRAPPERS=Qt
|
||||
|
||||
73
tests/system/suite_general/tst_save_before_build/test.py
Normal file
73
tests/system/suite_general/tst_save_before_build/test.py
Normal 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")
|
||||
@@ -37,10 +37,11 @@ def main():
|
||||
unsortedFile = os.path.join(os.getcwd(), "testdata", "unsorted.txt")
|
||||
sorted = getOutputFromCmdline("sort %s" % unsortedFile).replace("\r", "")
|
||||
selectFromFileDialog(unsortedFile)
|
||||
invokeMenuItem("Edit", "Select All")
|
||||
invokeMenuItem("Tools", "External", "Text", "Sort Selection")
|
||||
editor = waitForObject("{type='TextEditor::PlainTextEditorWidget' unnamed='1' "
|
||||
"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),
|
||||
"Verify that sorted text\n%s\nmatches the expected text\n%s" % (editor.plainText, sorted))
|
||||
invokeMenuItem('File', 'Revert "unsorted.txt" to Saved')
|
||||
|
||||
@@ -33,14 +33,14 @@ cloneUrl = "https://codereview.qt-project.org/p/qt-labs/jom"
|
||||
cloneDir = "myCloneOfJom"
|
||||
|
||||
def verifyCloneLog(targetDir, canceled):
|
||||
finish = findObject(":Git Repository Clone.Finish_QPushButton")
|
||||
waitFor("canceled or finish.enabled", 30000)
|
||||
if canceled:
|
||||
summary = "Failed."
|
||||
else:
|
||||
finish = findObject(":Git Repository Clone.Finish_QPushButton")
|
||||
waitFor("finish.enabled", 30000)
|
||||
cloneLog = str(waitForObject(":Git Repository Clone.logPlainTextEdit_QPlainTextEdit").plainText)
|
||||
if "fatal: The remote end hung up unexpectedly" in cloneLog:
|
||||
test.warning("Remote end hung up unexpectedly.")
|
||||
if "fatal: " in cloneLog:
|
||||
test.warning("Cloning failed outside Creator.")
|
||||
return False
|
||||
# test for QTCREATORBUG-10112
|
||||
test.compare(cloneLog.count("remote: Counting objects:"), 1)
|
||||
@@ -52,9 +52,17 @@ def verifyCloneLog(targetDir, canceled):
|
||||
test.verify(("'" + cloneDir + "'..." in cloneLog),
|
||||
"Searching for clone directory in clone log")
|
||||
summary = "Succeeded."
|
||||
resultLabel = findObject(":Git Repository Clone.Result._QLabel")
|
||||
test.verify(waitFor('str(resultLabel.text) == summary', 3000),
|
||||
"Verifying expected result (%s)" % summary)
|
||||
try:
|
||||
resultLabel = findObject(":Git Repository Clone.Result._QLabel")
|
||||
test.verify(waitFor('str(resultLabel.text) == summary', 3000),
|
||||
"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
|
||||
|
||||
def verifyVersionControlView(targetDir, canceled):
|
||||
@@ -101,7 +109,8 @@ def main():
|
||||
# wait for cloning to have started
|
||||
waitFor('len(str(cloneLog.plainText)) > 20 + len(cloneDir)')
|
||||
clickButton(":Git Repository Clone.Cancel_QPushButton")
|
||||
verifyCloneLog(targetDir, True)
|
||||
if not verifyCloneLog(targetDir, True):
|
||||
continue
|
||||
clickButton(":Git Repository Clone.Cancel_QPushButton")
|
||||
else:
|
||||
if not verifyCloneLog(targetDir, False):
|
||||
|
||||
Reference in New Issue
Block a user