Merge remote-tracking branch 'origin/3.4'

Conflicts:
	src/libs/extensionsystem/pluginview.cpp

Change-Id: I410156c1003d5dc81e915110c6d432bcd71da010
This commit is contained in:
Eike Ziller
2015-05-07 14:42:46 +02:00
52 changed files with 3508 additions and 924 deletions

View File

@@ -5,7 +5,7 @@ staging=${broot}/staging
pyversion=2.7 pyversion=2.7
expatversion=2.1.0 expatversion=2.1.0
arch=`uname -sm | sed 's/ /-/g' | tr A-Z a-z` arch=`uname -sm | sed 's/ /-/g' | tr A-Z a-z`
version=7.8.2 version=7.9
targetdir=${broot}/qtcreator-gdb-${version} targetdir=${broot}/qtcreator-gdb-${version}
gdbtargets=$(addprefix ${targetdir}/gdb-, ${targets}) gdbtargets=$(addprefix ${targetdir}/gdb-, ${targets})
packagename=qtcreator-gdb-${version}-${arch}.tar.gz packagename=qtcreator-gdb-${version}-${arch}.tar.gz

View File

@@ -6,7 +6,7 @@ pyversion=2.7
pydir=${broot}/python pydir=${broot}/python
expatversion=2.1.0 expatversion=2.1.0
iconvversion=1.14 iconvversion=1.14
version=7.8.2 version=7.9
targetdir=${broot}/qtcreator-gdb-${version} targetdir=${broot}/qtcreator-gdb-${version}
gdbtargets=$(addprefix ${targetdir}/gdb-, ${targets}) gdbtargets=$(addprefix ${targetdir}/gdb-, ${targets})
packageparts=${targetdir}/lib ${targetdir}/data-directory ${targetdir}/libiconv-2.dll ${targetdir}/python27.dll ${targetdir}/libexpat-1.dll packageparts=${targetdir}/lib ${targetdir}/data-directory ${targetdir}/libiconv-2.dll ${targetdir}/python27.dll ${targetdir}/libexpat-1.dll

View File

@@ -5,7 +5,7 @@ staging=${broot}/staging
pyversion=2.7 pyversion=2.7
expatversion=2.1.0 expatversion=2.1.0
arch=`uname -sm | sed 's/ /-/g' | tr A-Z a-z` arch=`uname -sm | sed 's/ /-/g' | tr A-Z a-z`
version=7.8.2 version=7.9
targetdir=${broot}/qtcreator-gdb-${version} targetdir=${broot}/qtcreator-gdb-${version}
gdbtargets=$(addprefix ${targetdir}/gdb-, ${targets}) gdbtargets=$(addprefix ${targetdir}/gdb-, ${targets})
packagename=qtcreator-gdb-${version}-${arch}.tar.gz packagename=qtcreator-gdb-${version}-${arch}.tar.gz

View File

@@ -59,6 +59,12 @@
\li In the \uicontrol {Qt Quick component set} field, select \li In the \uicontrol {Qt Quick component set} field, select
\uicontrol {Qt Quick 2.1}. \uicontrol {Qt Quick 2.1}.
\note This selection determines the set of files that the wizard
generates and their contents. The instructions in this tutorial
might not apply if you select some other component set, such as Qt
Quick 2.4. The wizard indicates which Qt version each component set
requires at minimum.
\li Select \l{glossary-buildandrun-kit}{kits} for running and building your project, \li Select \l{glossary-buildandrun-kit}{kits} for running and building your project,
and then click \uicontrol{Next}. and then click \uicontrol{Next}.
@@ -90,8 +96,7 @@
To use the states.png image in your application, you must copy it to the To use the states.png image in your application, you must copy it to the
project directory (same subdirectory as the QML file) from the examples project directory (same subdirectory as the QML file) from the examples
directory in the Qt installation directory. For example: directory in the Qt installation directory. For example:
\c {C:\Qt\Qt5.3.0\5.3.0\msvc2010\examples\declarative\animation\states}. The \c {C:\Qt\Examples\Qt-5.4\declarative\animation\states}. The image appears
image appears
in \uicontrol Resources. You can also use any other image or a QML in \uicontrol Resources. You can also use any other image or a QML
type, instead. type, instead.
@@ -104,8 +109,8 @@
\image qmldesigner-tutorial-design-mode.png "Transitions project in Design Mode" \image qmldesigner-tutorial-design-mode.png "Transitions project in Design Mode"
\li In the \uicontrol Navigator, select \uicontrol Text and press \key Delete to \li In the \uicontrol Navigator, select \uicontrol MouseArea and
delete it. \uicontrol Text and press \key Delete to delete them.
\li Select \uicontrol Window to edit its properties. \li Select \uicontrol Window to edit its properties.
@@ -116,13 +121,8 @@
\li In the \uicontrol Id field, enter \e page, to be able to reference the \li In the \uicontrol Id field, enter \e page, to be able to reference the
window from other places. window from other places.
\li In the code editor, set the window background color to #343434: \li In the \uicontrol Color field, set the window background color
to #343434.
\quotefromfile transitions/main.qml
\skipto Window {
\printuntil color
\li Delete the \c {Qt.quit();} command.
\endlist \endlist
@@ -139,8 +139,9 @@
\endlist \endlist
\li Double-click the resource file, qml.qrc, in the \uicontrol Projects view \li Right-click the resource file, qml.qrc, in the \uicontrol Projects
to add states.png to the resource file for deployment. view, and select \uicontrol {Open in Editor} to add states.png to
the resource file for deployment.
\li Click \uicontrol Add and select states.png. \li Click \uicontrol Add and select states.png.
@@ -186,9 +187,8 @@
\endlist \endlist
\li In the \uicontrol Navigator, drag and drop the \uicontrol {Mouse Area} \li Drag and drop a \uicontrol {Mouse Area} type from the
from \e page to \e topLeftRect to make it apply only to the \uicontrol Library to \e topLeftRect in the \uicontrol Navigator.
rectangle and not to the whole page.
\li Edit the \uicontrol {Mouse Area} properties: \li Edit the \uicontrol {Mouse Area} properties:
@@ -217,9 +217,7 @@
\quotefromfile transitions/main.qml \quotefromfile transitions/main.qml
\skipto Window { \skipto Window {
\printuntil onClicked \printuntil mouseArea1
\printuntil }
\printuntil }
\printuntil } \printuntil }
\li In the \uicontrol Navigator, copy topLeftRect (by pressing \li In the \uicontrol Navigator, copy topLeftRect (by pressing
@@ -274,8 +272,7 @@
\quotefromfile transitions/main.qml \quotefromfile transitions/main.qml
\skipto Window { \skipto Window {
\printuntil State2 \printuntil mouseArea3
\printuntil }
\printuntil } \printuntil }
\printuntil } \printuntil }

View File

@@ -1040,21 +1040,8 @@ class DumperBase:
return return
typeName = str(value.type) typeName = str(value.type)
innerType = value.type.target().unqualified()
innerTypeName = str(innerType)
goodPointer = False if self.isBadPointer(value):
try:
target = value.dereference()
str(target) # Dummy access.
if self.isLldb and target.GetError().Fail():
pass
else:
goodPointer = True
except:
pass
if not goodPointer:
# Failure to dereference a pointer should at least # Failure to dereference a pointer should at least
# show the value of a pointer. # show the value of a pointer.
self.putValue(self.cleanAddress(value)) self.putValue(self.cleanAddress(value))
@@ -1063,6 +1050,8 @@ class DumperBase:
return return
displayFormat = self.currentItemFormat(value.type) displayFormat = self.currentItemFormat(value.type)
innerType = value.type.target().unqualified()
innerTypeName = str(innerType)
if innerTypeName == "void": if innerTypeName == "void":
#warn("VOID POINTER: %s" % displayFormat) #warn("VOID POINTER: %s" % displayFormat)

View File

@@ -522,6 +522,14 @@ class Dumper(DumperBase):
except: except:
return None return None
def isBadPointer(self, value):
try:
target = value.dereference()
target.is_optimized_out # Access test.
return False
except:
return True
def makeValue(self, typeobj, init): def makeValue(self, typeobj, init):
typename = "::" + self.stripClassTag(str(typeobj)); typename = "::" + self.stripClassTag(str(typeobj));
# Avoid malloc symbol clash with QVector. # Avoid malloc symbol clash with QVector.

View File

@@ -365,6 +365,10 @@ class Dumper(DumperBase):
#self.warn(" -> %s" % result) #self.warn(" -> %s" % result)
return result return result
def isBadPointer(self, value):
target = value.dereference()
return target.GetError().Fail()
def makeValue(self, type, *args): def makeValue(self, type, *args):
thread = self.currentThread() thread = self.currentThread()
frame = thread.GetFrameAtIndex(0) frame = thread.GetFrameAtIndex(0)

View File

@@ -1651,10 +1651,6 @@ def qdump__QSet(d, value):
it = node.dereference().cast(innerType) it = node.dereference().cast(innerType)
with SubItem(d, i): with SubItem(d, i):
key = it["key"] key = it["key"]
if not key:
# LLDB can't access directly since it's in anonymous union
# for Qt4 optimized int keytype
key = it[1]["key"]
d.putItem(key) d.putItem(key)

File diff suppressed because it is too large Load Diff

View File

@@ -203,12 +203,9 @@ std::string SymbolGroup::dump(const std::string &iname,
DebugPrint() << "SymbolGroup::dump(" << iname << '/' DebugPrint() << "SymbolGroup::dump(" << iname << '/'
<< aNode->absoluteFullIName() <<" resolves to " << node->absoluteFullIName() << aNode->absoluteFullIName() <<" resolves to " << node->absoluteFullIName()
<< " expanded=" << node->isExpanded(); << " expanded=" << node->isExpanded();
if (node->isExpanded()) { // Mark expand request by watch model if (!node->isExpanded() && node->canExpand() && !node->expand(errorMessage))
node->clearFlags(SymbolGroupNode::ExpandedByDumper); return std::string();
} else { node->addFlags(SymbolGroupNode::ExpandedByRequest);
if (node->canExpand() && !node->expand(errorMessage))
return std::string();
}
// After expansion, run the complex dumpers // After expansion, run the complex dumpers
if (p.dumpFlags & DumpParameters::DumpComplexDumpers) if (p.dumpFlags & DumpParameters::DumpComplexDumpers)
node->runComplexDumpers(ctx); node->runComplexDumpers(ctx);
@@ -378,8 +375,12 @@ static inline SymbolGroupNode *
bool SymbolGroup::expand(const std::string &nodeName, std::string *errorMessage) bool SymbolGroup::expand(const std::string &nodeName, std::string *errorMessage)
{ {
if (SymbolGroupNode *node = findNodeForExpansion(this, nodeName, errorMessage)) if (SymbolGroupNode *node = findNodeForExpansion(this, nodeName, errorMessage)) {
return node == m_root ? true : node->expand(errorMessage); if (node == m_root)
return true;
node->addFlags(SymbolGroupNode::ExpandedByRequest);
return node->expand(errorMessage);
}
return false; return false;
} }
@@ -393,8 +394,12 @@ bool SymbolGroup::collapse(const std::string &nodeName, std::string *errorMessag
bool SymbolGroup::expandRunComplexDumpers(const std::string &nodeName, const SymbolGroupValueContext &ctx, std::string *errorMessage) bool SymbolGroup::expandRunComplexDumpers(const std::string &nodeName, const SymbolGroupValueContext &ctx, std::string *errorMessage)
{ {
if (SymbolGroupNode *node = findNodeForExpansion(this, nodeName, errorMessage)) if (SymbolGroupNode *node = findNodeForExpansion(this, nodeName, errorMessage)) {
return node == m_root ? true : node->expandRunComplexDumpers(ctx, errorMessage); if (node == m_root)
return true;
node->addFlags(SymbolGroupNode::ExpandedByRequest);
return node->expandRunComplexDumpers(ctx, errorMessage);
}
return false; return false;
} }

View File

@@ -62,8 +62,8 @@ static inline void debugNodeFlags(std::ostream &str, unsigned f)
str << " DumperOk"; str << " DumperOk";
if (f & SymbolGroupNode::SimpleDumperFailed) if (f & SymbolGroupNode::SimpleDumperFailed)
str << " DumperFailed"; str << " DumperFailed";
if (f & SymbolGroupNode::ExpandedByDumper) if (f & SymbolGroupNode::ExpandedByRequest)
str << " ExpandedByDumper"; str << " ExpandedByRequest";
if (f & SymbolGroupNode::AdditionalSymbol) if (f & SymbolGroupNode::AdditionalSymbol)
str << " AdditionalSymbol"; str << " AdditionalSymbol";
if (f & SymbolGroupNode::Obscured) if (f & SymbolGroupNode::Obscured)
@@ -594,8 +594,8 @@ void ErrorSymbolGroupNode::debug(std::ostream &os, const std::string &visitingFu
\endlist \endlist
The dumping is mostly based on SymbolGroupValue expressions. The dumping is mostly based on SymbolGroupValue expressions.
in the debugger. Evaluating those dumpers might expand symbol nodes, which are in the debugger. Evaluating those dumpers might expand symbol nodes, but those
then marked as 'ExpandedByDumper'. This stops the dump recursion to prevent are not marked as 'ExpandedByRequest'. This stops the dump recursion to prevent
outputting data that were not explicitly expanded by the watch handler. outputting data that were not explicitly expanded by the watch handler.
\ingroup qtcreatorcdbext */ \ingroup qtcreatorcdbext */
@@ -1022,7 +1022,6 @@ void SymbolGroupNode::runComplexDumpers(const SymbolGroupValueContext &ctx)
if (ctChildren.empty()) if (ctChildren.empty())
return; return;
clearFlags(ExpandedByDumper);
// Mark current children as obscured. We cannot show both currently // Mark current children as obscured. We cannot show both currently
// as this would upset the numerical sorting of the watch model // as this would upset the numerical sorting of the watch model
AbstractSymbolGroupNodePtrVectorConstIterator cend = children().end(); AbstractSymbolGroupNodePtrVectorConstIterator cend = children().end();
@@ -1269,11 +1268,8 @@ bool SymbolGroupNode::expand(std::string *errorMessage)
DebugPrint() << "SymbolGroupNode::expand " << name() DebugPrint() << "SymbolGroupNode::expand " << name()
<<'/' << absoluteFullIName() << ' ' <<'/' << absoluteFullIName() << ' '
<< m_index << DebugNodeFlags(flags()); << m_index << DebugNodeFlags(flags());
if (isExpanded()) { if (isExpanded())
// Clear the flag indication dumper expansion on a second, explicit request
clearFlags(ExpandedByDumper);
return true; return true;
}
if (!canExpand()) { if (!canExpand()) {
*errorMessage = msgExpandFailed(name(), absoluteFullIName(), m_index, *errorMessage = msgExpandFailed(name(), absoluteFullIName(), m_index,
"No subelements to expand in node."); "No subelements to expand in node.");
@@ -1661,6 +1657,17 @@ SymbolGroupNodeVisitor::VisitResult
return VisitSkipChildren; return VisitSkipChildren;
if (node->testFlags(SymbolGroupNode::AdditionalSymbol) && !node->testFlags(SymbolGroupNode::WatchNode)) if (node->testFlags(SymbolGroupNode::AdditionalSymbol) && !node->testFlags(SymbolGroupNode::WatchNode))
return VisitSkipChildren; return VisitSkipChildren;
// Recurse to children only if expanded by explicit watchmodel request
// and initialized.
bool visitChildren = true; // Report only one level for Qt Creator.
// Visit children of a SymbolGroupNode only if not expanded by its dumpers.
if (const SymbolGroupNode *realNode = node->resolveReference()->asSymbolGroupNode()) {
if (!realNode->isExpanded()
|| realNode->testFlags(SymbolGroupNode::Uninitialized)
|| !realNode->testFlags(SymbolGroupNode::ExpandedByRequest)) {
visitChildren = false;
}
}
// Comma between same level children given obscured children // Comma between same level children given obscured children
if (depth == m_lastDepth) if (depth == m_lastDepth)
m_os << ','; m_os << ',';
@@ -1673,28 +1680,16 @@ SymbolGroupNodeVisitor::VisitResult
m_os << '{'; m_os << '{';
const int childCount = node->dump(m_os, fullIname, m_parameters, m_context); const int childCount = node->dump(m_os, fullIname, m_parameters, m_context);
m_os << ",numchild=\"" << childCount << '"'; m_os << ",numchild=\"" << childCount << '"';
if (!childCount)
if (childCount) { visitChildren = false;
// Recurse to children only if expanded by explicit watchmodel request if (visitChildren) { // open children array
// and initialized. m_os << ",children=[";
// Visit children of a SymbolGroupNode only if not expanded by its dumpers. } else { // No children, close array.
bool skipit = false; m_os << '}';
if (const SymbolGroupNode *realNode = node->resolveReference()->asSymbolGroupNode()) {
if (!realNode->isExpanded() || realNode->testFlags(SymbolGroupNode::Uninitialized | SymbolGroupNode::ExpandedByDumper))
skipit = true;
}
if (!skipit) {
m_os << ",children=[";
if (m_parameters.humanReadable())
m_os << '\n';
return VisitContinue;
}
} }
// No children, close array.
m_os << '}';
if (m_parameters.humanReadable()) if (m_parameters.humanReadable())
m_os << '\n'; m_os << '\n';
return VisitSkipChildren; return visitChildren ? VisitContinue : VisitSkipChildren;
} }
void DumpSymbolGroupNodeVisitor::childrenVisited(const AbstractSymbolGroupNode *n, unsigned) void DumpSymbolGroupNodeVisitor::childrenVisited(const AbstractSymbolGroupNode *n, unsigned)

View File

@@ -224,7 +224,7 @@ public:
SimpleDumperOk = 0x4, // Internal dumper ran, value set SimpleDumperOk = 0x4, // Internal dumper ran, value set
SimpleDumperFailed = 0x8, // Internal dumper failed SimpleDumperFailed = 0x8, // Internal dumper failed
SimpleDumperMask = SimpleDumperNotApplicable|SimpleDumperOk|SimpleDumperFailed, SimpleDumperMask = SimpleDumperNotApplicable|SimpleDumperOk|SimpleDumperFailed,
ExpandedByDumper = 0x10, ExpandedByRequest = 0x10,
AdditionalSymbol = 0x20, // Introduced by addSymbol, should not be visible AdditionalSymbol = 0x20, // Introduced by addSymbol, should not be visible
Obscured = 0x40, // Symbol is obscured by (for example) fake container children Obscured = 0x40, // Symbol is obscured by (for example) fake container children
ComplexDumperOk = 0x80, ComplexDumperOk = 0x80,

View File

@@ -160,10 +160,8 @@ bool SymbolGroupValue::ensureExpanded() const
// Set a flag indicating the node was expanded by SymbolGroupValue // Set a flag indicating the node was expanded by SymbolGroupValue
// and not by an explicit request from the watch model. // and not by an explicit request from the watch model.
if (m_node->expand(&m_errorMessage)) { if (m_node->expand(&m_errorMessage))
m_node->addFlags(SymbolGroupNode::ExpandedByDumper);
return true; return true;
}
if (SymbolGroupValue::verbose) if (SymbolGroupValue::verbose)
DebugPrint() << "Expand failure of '" << name() << "': " << m_errorMessage; DebugPrint() << "Expand failure of '" << name() << "': " << m_errorMessage;
return false; return false;

View File

@@ -52,6 +52,20 @@
This class has some validation logic for embedding into QWizardPage. This class has some validation logic for embedding into QWizardPage.
*/ */
static QString appBundleExpandedPath(const QString &path)
{
if (Utils::HostOsInfo::hostOs() == Utils::OsTypeMac && path.endsWith(QLatin1String(".app"))) {
// possibly expand to Foo.app/Contents/MacOS/Foo
QFileInfo info(path);
if (info.isDir()) {
QString exePath = path + QLatin1String("/Contents/MacOS/") + info.completeBaseName();
if (QFileInfo(exePath).exists())
return exePath;
}
}
return path;
}
namespace Utils { namespace Utils {
// ------------------ BinaryVersionToolTipEventFilter // ------------------ BinaryVersionToolTipEventFilter
@@ -362,20 +376,13 @@ void PathChooser::slotBrowse()
newPath = QFileDialog::getOpenFileName(this, newPath = QFileDialog::getOpenFileName(this,
makeDialogTitle(tr("Choose Executable")), predefined, makeDialogTitle(tr("Choose Executable")), predefined,
d->m_dialogFilter); d->m_dialogFilter);
if (HostOsInfo::hostOs() == OsTypeMac && newPath.endsWith(QLatin1String(".app"))) { newPath = appBundleExpandedPath(newPath);
// possibly expand to Foo.app/Contents/MacOS/Foo
QFileInfo info(newPath);
if (info.isDir()) {
QString exePath = newPath + QLatin1String("/Contents/MacOS/") + info.completeBaseName();
if (QFileInfo(exePath).isExecutable())
newPath = exePath;
}
}
break; break;
case PathChooser::File: // fall through case PathChooser::File: // fall through
newPath = QFileDialog::getOpenFileName(this, newPath = QFileDialog::getOpenFileName(this,
makeDialogTitle(tr("Choose File")), predefined, makeDialogTitle(tr("Choose File")), predefined,
d->m_dialogFilter); d->m_dialogFilter);
newPath = appBundleExpandedPath(newPath);
break; break;
case PathChooser::SaveFile: case PathChooser::SaveFile:
newPath = QFileDialog::getSaveFileName(this, newPath = QFileDialog::getSaveFileName(this,

View File

@@ -31,11 +31,15 @@
#include "baremetaldevice.h" #include "baremetaldevice.h"
#include "baremetaldeviceconfigurationwidget.h" #include "baremetaldeviceconfigurationwidget.h"
#include "defaultgdbserverprovider.h"
#include "gdbserverprovidermanager.h"
#include "gdbserverproviderprocess.h" #include "gdbserverproviderprocess.h"
#include <coreplugin/id.h> #include <coreplugin/id.h>
#include <ssh/sshconnection.h>
#include <utils/qtcassert.h> #include <utils/qtcassert.h>
#include <QCoreApplication> #include <QCoreApplication>
using namespace ProjectExplorer; using namespace ProjectExplorer;
@@ -73,7 +77,17 @@ void BareMetalDevice::setGdbServerProviderId(const QString &id)
void BareMetalDevice::fromMap(const QVariantMap &map) void BareMetalDevice::fromMap(const QVariantMap &map)
{ {
IDevice::fromMap(map); IDevice::fromMap(map);
setGdbServerProviderId(map.value(QLatin1String(gdbServerProviderIdKeyC)).toString()); QString gdbServerProvider = map.value(QLatin1String(gdbServerProviderIdKeyC)).toString();
if (gdbServerProvider.isEmpty()) {
const QSsh::SshConnectionParameters sshParams = sshParameters();
DefaultGdbServerProvider *newProvider = new DefaultGdbServerProvider;
newProvider->setDisplayName(displayName());
newProvider->m_host = sshParams.host;
newProvider->m_port = sshParams.port;
GdbServerProviderManager::instance()->registerProvider(newProvider);
gdbServerProvider = newProvider->id();
}
setGdbServerProviderId(gdbServerProvider);
} }
QVariantMap BareMetalDevice::toMap() const QVariantMap BareMetalDevice::toMap() const

View File

@@ -65,6 +65,7 @@ private:
friend class DefaultGdbServerProviderConfigWidget; friend class DefaultGdbServerProviderConfigWidget;
friend class DefaultGdbServerProviderFactory; friend class DefaultGdbServerProviderFactory;
friend class BareMetalDevice;
}; };
class DefaultGdbServerProviderFactory : public GdbServerProviderFactory class DefaultGdbServerProviderFactory : public GdbServerProviderFactory

View File

@@ -680,6 +680,7 @@ int ClangCompletionAssistProcessor::startCompletionHelper()
return startCompletionInternal(fileName, line, column, endOfOperator); return startCompletionInternal(fileName, line, column, endOfOperator);
} }
// TODO: Extract duplicated logic from InternalCppCompletionAssistProcessor::startOfOperator
int ClangCompletionAssistProcessor::startOfOperator(int pos, int ClangCompletionAssistProcessor::startOfOperator(int pos,
unsigned *kind, unsigned *kind,
bool wantFunctionCall) const bool wantFunctionCall) const
@@ -724,8 +725,9 @@ int ClangCompletionAssistProcessor::startOfOperator(int pos,
start = pos; start = pos;
} }
// Don't complete in comments or strings, but still check for include completion // Don't complete in comments or strings, but still check for include completion
else if (tk.is(T_COMMENT) || tk.is(T_CPP_COMMENT) || else if (tk.is(T_COMMENT) || tk.is(T_CPP_COMMENT)
(tk.isLiteral() && (*kind != T_STRING_LITERAL || tk.is(T_CPP_DOXY_COMMENT) || tk.is(T_DOXY_COMMENT)
|| (tk.isLiteral() && (*kind != T_STRING_LITERAL
&& *kind != T_ANGLE_STRING_LITERAL && *kind != T_ANGLE_STRING_LITERAL
&& *kind != T_SLASH))) { && *kind != T_SLASH))) {
*kind = T_EOF_SYMBOL; *kind = T_EOF_SYMBOL;

View File

@@ -205,21 +205,31 @@ QStringList CMakeProject::getCXXFlagsFor(const CMakeBuildTarget &buildTarget)
// Attempt to find build.ninja file and obtain FLAGS (CXX_FLAGS) from there if no suitable flags.make were // Attempt to find build.ninja file and obtain FLAGS (CXX_FLAGS) from there if no suitable flags.make were
// found // found
// Get "all" target's working directory // Get "all" target's working directory
QString buildNinjaFile = QDir::fromNativeSeparators(buildTarget.workingDirectory); if (!buildTargets().empty()) {
buildNinjaFile += QLatin1String("/build.ninja"); QString buildNinjaFile = QDir::fromNativeSeparators(buildTargets().at(0).workingDirectory);
QFile buildNinja(buildNinjaFile); buildNinjaFile += QLatin1String("/build.ninja");
if (buildNinja.exists()) { QFile buildNinja(buildNinjaFile);
buildNinja.open(QIODevice::ReadOnly | QIODevice::Text); if (buildNinja.exists()) {
QTextStream stream(&buildNinja); buildNinja.open(QIODevice::ReadOnly | QIODevice::Text);
bool cxxFound = false; QTextStream stream(&buildNinja);
while (!stream.atEnd()) { bool targetFound = false;
QString line = stream.readLine().trimmed(); bool cxxFound = false;
// Look for a build rule which invokes CXX_COMPILER QString targetSearchPattern = QString::fromLatin1("target %1").arg(buildTarget.title);
if (line.startsWith(QLatin1String("build"))) {
cxxFound = line.indexOf(QLatin1String("CXX_COMPILER")) != -1; while (!stream.atEnd()) {
} else if (cxxFound && line.startsWith(QLatin1String("FLAGS ="))) { // 1. Look for a block that refers to the current target
// Skip past = // 2. Look for a build rule which invokes CXX_COMPILER
return line.mid(7).trimmed().split(QLatin1Char(' '), QString::SkipEmptyParts); // 3. Return the FLAGS definition
QString line = stream.readLine().trimmed();
if (line.startsWith(QLatin1String("#"))) {
if (!line.startsWith(QLatin1String("# Object build statements for"))) continue;
targetFound = line.endsWith(targetSearchPattern);
} else if (targetFound && line.startsWith(QLatin1String("build"))) {
cxxFound = line.indexOf(QLatin1String("CXX_COMPILER")) != -1;
} else if (cxxFound && line.startsWith(QLatin1String("FLAGS ="))) {
// Skip past =
return line.mid(7).trimmed().split(QLatin1Char(' '), QString::SkipEmptyParts);
}
} }
} }
} }

View File

@@ -347,8 +347,7 @@ void OutputWindow::grayOutOldContent()
(bkgFactor * bkgColor.blue() + fgdFactor * fgdColor.blue()) )); (bkgFactor * bkgColor.blue() + fgdFactor * fgdColor.blue()) ));
d->cursor.mergeCharFormat(format); d->cursor.mergeCharFormat(format);
if (!d->cursor.atEnd()) d->cursor.movePosition(QTextCursor::End);
d->cursor.movePosition(QTextCursor::End);
d->cursor.setCharFormat(endFormat); d->cursor.setCharFormat(endFormat);
d->cursor.insertBlock(QTextBlockFormat()); d->cursor.insertBlock(QTextBlockFormat());
} }

View File

@@ -61,9 +61,6 @@ namespace {
class ParseParams class ParseParams
{ {
public: public:
ParseParams() : revision(0) {}
int revision;
ProjectPart::HeaderPaths headerPaths; ProjectPart::HeaderPaths headerPaths;
WorkingCopy workingCopy; WorkingCopy workingCopy;
QSet<QString> sourceFiles; QSet<QString> sourceFiles;
@@ -189,7 +186,6 @@ void indexFindErrors(QFutureInterface<void> &future, const ParseParams params)
void index(QFutureInterface<void> &future, const ParseParams params) void index(QFutureInterface<void> &future, const ParseParams params)
{ {
QScopedPointer<CppSourceProcessor> sourceProcessor(CppModelManager::createSourceProcessor()); QScopedPointer<CppSourceProcessor> sourceProcessor(CppModelManager::createSourceProcessor());
sourceProcessor->setRevision(params.revision);
sourceProcessor->setHeaderPaths(params.headerPaths); sourceProcessor->setHeaderPaths(params.headerPaths);
sourceProcessor->setWorkingCopy(params.workingCopy); sourceProcessor->setWorkingCopy(params.workingCopy);
@@ -347,7 +343,6 @@ private:
} // anonymous namespace } // anonymous namespace
BuiltinIndexingSupport::BuiltinIndexingSupport() BuiltinIndexingSupport::BuiltinIndexingSupport()
: m_revision(0)
{ {
m_synchronizer.setCancelOnWait(true); m_synchronizer.setCancelOnWait(true);
} }
@@ -361,7 +356,6 @@ QFuture<void> BuiltinIndexingSupport::refreshSourceFiles(const QSet<QString> &so
CppModelManager *mgr = CppModelManager::instance(); CppModelManager *mgr = CppModelManager::instance();
ParseParams params; ParseParams params;
params.revision = ++m_revision;
params.headerPaths = mgr->headerPaths(); params.headerPaths = mgr->headerPaths();
params.workingCopy = mgr->workingCopy(); params.workingCopy = mgr->workingCopy();
params.sourceFiles = sourceFiles; params.sourceFiles = sourceFiles;

View File

@@ -54,7 +54,6 @@ public:
private: private:
QFutureSynchronizer<void> m_synchronizer; QFutureSynchronizer<void> m_synchronizer;
unsigned m_revision;
}; };
} // namespace Internal } // namespace Internal

View File

@@ -168,6 +168,8 @@ bool isProbablyGlobalCompletion(const QStringList &list)
+ (T_FIRST_OBJC_AT_KEYWORD - T_FIRST_KEYWORD); + (T_FIRST_OBJC_AT_KEYWORD - T_FIRST_KEYWORD);
return list.size() >= numberOfPrimitivesAndBasicKeywords return list.size() >= numberOfPrimitivesAndBasicKeywords
&& list.contains(QLatin1String("override"))
&& list.contains(QLatin1String("final"))
&& list.contains(QLatin1String("if")) && list.contains(QLatin1String("if"))
&& list.contains(QLatin1String("bool")); && list.contains(QLatin1String("bool"));
} }
@@ -340,25 +342,48 @@ void CppToolsPlugin::test_global_completion_data()
{ {
QTest::addColumn<QByteArray>("code"); QTest::addColumn<QByteArray>("code");
QTest::addColumn<QByteArray>("prefix"); QTest::addColumn<QByteArray>("prefix");
QTest::addColumn<QStringList>("requiredCompletionItems");
// Check that special completion after '&' for Qt5 signal/slots does not // Check that special completion after '&' for Qt5 signal/slots does not
// interfere global completion after '&' // interfere global completion after '&'
QTest::newRow("global completion after & in return expression") QTest::newRow("global completion after & in return expression")
<< _("void f() { foo(myObject, @); }\n") << _("void f() { foo(myObject, @); }\n")
<< _("&"); << _("&")
<< QStringList();
QTest::newRow("global completion after & in function argument") QTest::newRow("global completion after & in function argument")
<< _("int f() { return @; }\n") << _("int f() { return @; }\n")
<< _("&"); << _("&")
<< QStringList();
// Check global completion after one line comments
const QByteArray codeTemplate = "int myGlobal;\n"
"<REPLACEMENT>\n"
"@\n";
const QStringList replacements = QStringList()
<< QLatin1String("// text")
<< QLatin1String("// text.")
<< QLatin1String("/// text")
<< QLatin1String("/// text.")
;
foreach (const QString &replacement, replacements) {
QByteArray code = codeTemplate;
code.replace("<REPLACEMENT>", replacement.toUtf8());
const QByteArray tag = _("completion after comment: ") + replacement.toUtf8();
QTest::newRow(tag) << code << QByteArray() << QStringList(QLatin1String("myGlobal"));
}
} }
void CppToolsPlugin::test_global_completion() void CppToolsPlugin::test_global_completion()
{ {
QFETCH(QByteArray, code); QFETCH(QByteArray, code);
QFETCH(QByteArray, prefix); QFETCH(QByteArray, prefix);
QFETCH(QStringList, requiredCompletionItems);
CompletionTestCase test(code, prefix); CompletionTestCase test(code, prefix);
QVERIFY(test.succeededSoFar()); QVERIFY(test.succeededSoFar());
QVERIFY(isProbablyGlobalCompletion(test.getCompletions())); const QStringList completions = test.getCompletions();
QVERIFY(isProbablyGlobalCompletion(completions));
QVERIFY(completions.toSet().contains(requiredCompletionItems.toSet()));
} }
static void enumTestCase(const QByteArray &tag, const QByteArray &source, static void enumTestCase(const QByteArray &tag, const QByteArray &source,

View File

@@ -974,8 +974,9 @@ int InternalCppCompletionAssistProcessor::startOfOperator(int pos,
start = pos; start = pos;
} }
// Don't complete in comments or strings, but still check for include completion // Don't complete in comments or strings, but still check for include completion
else if (tk.is(T_COMMENT) || tk.is(T_CPP_COMMENT) || else if (tk.is(T_COMMENT) || tk.is(T_CPP_COMMENT)
(tk.isLiteral() && (*kind != T_STRING_LITERAL || tk.is(T_CPP_DOXY_COMMENT) || tk.is(T_DOXY_COMMENT)
|| (tk.isLiteral() && (*kind != T_STRING_LITERAL
&& *kind != T_ANGLE_STRING_LITERAL && *kind != T_ANGLE_STRING_LITERAL
&& *kind != T_SLASH && *kind != T_SLASH
&& *kind != T_DOT))) { && *kind != T_DOT))) {
@@ -1936,6 +1937,12 @@ void InternalCppCompletionAssistProcessor::addKeywords()
// primitive type completion items. // primitive type completion items.
for (int i = T_FIRST_PRIMITIVE; i <= T_LAST_PRIMITIVE; ++i) for (int i = T_FIRST_PRIMITIVE; i <= T_LAST_PRIMITIVE; ++i)
addCompletionItem(QLatin1String(Token::name(i)), m_icons.keywordIcon(), KeywordsOrder); addCompletionItem(QLatin1String(Token::name(i)), m_icons.keywordIcon(), KeywordsOrder);
// "Identifiers with special meaning"
if (m_interface->languageFeatures().cxx11Enabled) {
addCompletionItem(QLatin1String("override"), m_icons.keywordIcon(), KeywordsOrder);
addCompletionItem(QLatin1String("final"), m_icons.keywordIcon(), KeywordsOrder);
}
} }
void InternalCppCompletionAssistProcessor::addMacros(const QString &fileName, void InternalCppCompletionAssistProcessor::addMacros(const QString &fileName,

View File

@@ -232,6 +232,11 @@ CppSourceProcessor *CppModelManager::createSourceProcessor()
{ {
CppModelManager *that = instance(); CppModelManager *that = instance();
return new CppSourceProcessor(that->snapshot(), [that](const Document::Ptr &doc) { return new CppSourceProcessor(that->snapshot(), [that](const Document::Ptr &doc) {
const Document::Ptr previousDocument = that->document(doc->fileName());
const unsigned newRevision = previousDocument.isNull()
? 1U
: previousDocument->revision() + 1;
doc->setRevision(newRevision);
that->emitDocumentUpdated(doc); that->emitDocumentUpdated(doc);
doc->releaseSourceAndAST(); doc->releaseSourceAndAST();
}); });

View File

@@ -48,6 +48,10 @@
#include <QDebug> #include <QDebug>
#include <QtTest> #include <QtTest>
#define VERIFY_DOCUMENT_REVISION(document, expectedRevision) \
QVERIFY(document); \
QCOMPARE(document->revision(), expectedRevision);
using namespace CppTools; using namespace CppTools;
using namespace CppTools::Internal; using namespace CppTools::Internal;
using namespace CppTools::Tests; using namespace CppTools::Tests;
@@ -172,6 +176,15 @@ static QSet<QString> updateProjectInfo(CppModelManager *modelManager, ModelManag
return helper->waitForRefreshedSourceFiles(); return helper->waitForRefreshedSourceFiles();
} }
void waitForProcessedEditorDocument(const QString &filePath)
{
CppEditorDocumentHandle *editorDocument
= CppModelManager::instance()->cppEditorDocument(filePath);
QVERIFY(editorDocument);
while (editorDocument->processor()->isParserRunning())
QCoreApplication::processEvents();
}
} // anonymous namespace } // anonymous namespace
/// Check: The preprocessor cleans include and framework paths. /// Check: The preprocessor cleans include and framework paths.
@@ -1107,3 +1120,45 @@ void CppToolsPlugin::test_modelmanager_renameIncludes()
foreach (const QString &sourceFile, sourceFiles) foreach (const QString &sourceFile, sourceFiles)
QCOMPARE(snapshot.allIncludesForDocument(sourceFile), QSet<QString>() << newHeader); QCOMPARE(snapshot.allIncludesForDocument(sourceFile), QSet<QString>() << newHeader);
} }
void CppToolsPlugin::test_modelmanager_documentsAndRevisions()
{
TestCase helper;
// Index two files
const MyTestDataDir testDir(_("testdata_project1"));
const QString filePath1 = testDir.file(QLatin1String("foo.h"));
const QString filePath2 = testDir.file(QLatin1String("foo.cpp"));
const QSet<QString> filesToIndex = QSet<QString>() << filePath1 << filePath2;
QVERIFY(TestCase::parseFiles(filesToIndex));
CppModelManager *modelManager = CppModelManager::instance();
VERIFY_DOCUMENT_REVISION(modelManager->document(filePath1), 1U);
VERIFY_DOCUMENT_REVISION(modelManager->document(filePath2), 1U);
// Open editor for file 1
TextEditor::BaseTextEditor *editor1;
QVERIFY(helper.openBaseTextEditor(filePath1, &editor1));
helper.closeEditorAtEndOfTestCase(editor1);
waitForProcessedEditorDocument(filePath1);
VERIFY_DOCUMENT_REVISION(modelManager->document(filePath1), 2U);
VERIFY_DOCUMENT_REVISION(modelManager->document(filePath2), 1U);
// Index again
QVERIFY(TestCase::parseFiles(filesToIndex));
VERIFY_DOCUMENT_REVISION(modelManager->document(filePath1), 3U);
VERIFY_DOCUMENT_REVISION(modelManager->document(filePath2), 2U);
// Open editor for file 2
TextEditor::BaseTextEditor *editor2;
QVERIFY(helper.openBaseTextEditor(filePath2, &editor2));
helper.closeEditorAtEndOfTestCase(editor2);
waitForProcessedEditorDocument(filePath2);
VERIFY_DOCUMENT_REVISION(modelManager->document(filePath1), 3U);
VERIFY_DOCUMENT_REVISION(modelManager->document(filePath2), 3U);
// Index again
QVERIFY(TestCase::parseFiles(filesToIndex));
VERIFY_DOCUMENT_REVISION(modelManager->document(filePath1), 4U);
VERIFY_DOCUMENT_REVISION(modelManager->document(filePath2), 4U);
}

View File

@@ -117,7 +117,6 @@ CppSourceProcessor::CppSourceProcessor(const Snapshot &snapshot, DocumentCallbac
m_documentFinished(documentFinished), m_documentFinished(documentFinished),
m_preprocess(this, &m_env), m_preprocess(this, &m_env),
m_languageFeatures(LanguageFeatures::defaultFeatures()), m_languageFeatures(LanguageFeatures::defaultFeatures()),
m_revision(0),
m_defaultCodec(Core::EditorManager::defaultTextCodec()) m_defaultCodec(Core::EditorManager::defaultTextCodec())
{ {
m_preprocess.setKeepComments(true); m_preprocess.setKeepComments(true);
@@ -126,9 +125,6 @@ CppSourceProcessor::CppSourceProcessor(const Snapshot &snapshot, DocumentCallbac
CppSourceProcessor::~CppSourceProcessor() CppSourceProcessor::~CppSourceProcessor()
{ } { }
void CppSourceProcessor::setRevision(unsigned revision)
{ m_revision = revision; }
void CppSourceProcessor::setWorkingCopy(const WorkingCopy &workingCopy) void CppSourceProcessor::setWorkingCopy(const WorkingCopy &workingCopy)
{ m_workingCopy = workingCopy; } { m_workingCopy = workingCopy; }
@@ -470,7 +466,6 @@ void CppSourceProcessor::sourceNeeded(unsigned line, const QString &fileName, In
qCDebug(log) << "Parsing:" << absoluteFileName << "contents:" << contents.size() << "bytes"; qCDebug(log) << "Parsing:" << absoluteFileName << "contents:" << contents.size() << "bytes";
Document::Ptr document = Document::create(absoluteFileName); Document::Ptr document = Document::create(absoluteFileName);
document->setRevision(m_revision);
document->setEditorRevision(editorRevision); document->setEditorRevision(editorRevision);
document->setLanguageFeatures(m_languageFeatures); document->setLanguageFeatures(m_languageFeatures);
foreach (const QString &include, initialIncludes) { foreach (const QString &include, initialIncludes) {

View File

@@ -65,7 +65,6 @@ public:
CppSourceProcessor(const CPlusPlus::Snapshot &snapshot, DocumentCallback documentFinished); CppSourceProcessor(const CPlusPlus::Snapshot &snapshot, DocumentCallback documentFinished);
~CppSourceProcessor(); ~CppSourceProcessor();
void setRevision(unsigned revision);
void setWorkingCopy(const CppTools::WorkingCopy &workingCopy); void setWorkingCopy(const CppTools::WorkingCopy &workingCopy);
void setHeaderPaths(const ProjectPart::HeaderPaths &headerPaths); void setHeaderPaths(const ProjectPart::HeaderPaths &headerPaths);
void setLanguageFeatures(CPlusPlus::LanguageFeatures languageFeatures); void setLanguageFeatures(CPlusPlus::LanguageFeatures languageFeatures);
@@ -124,7 +123,6 @@ private:
CPlusPlus::Document::Ptr m_currentDoc; CPlusPlus::Document::Ptr m_currentDoc;
QSet<QString> m_todo; QSet<QString> m_todo;
QSet<QString> m_processed; QSet<QString> m_processed;
unsigned m_revision;
QHash<QString, QString> m_fileNameCache; QHash<QString, QString> m_fileNameCache;
QTextCodec *m_defaultCodec; QTextCodec *m_defaultCodec;
}; };

View File

@@ -158,6 +158,7 @@ private slots:
void test_modelmanager_updateEditorsAfterProjectUpdate(); void test_modelmanager_updateEditorsAfterProjectUpdate();
void test_modelmanager_precompiled_headers(); void test_modelmanager_precompiled_headers();
void test_modelmanager_renameIncludes(); void test_modelmanager_renameIncludes();
void test_modelmanager_documentsAndRevisions();
void test_cpplocatorfilters_CppLocatorFilter(); void test_cpplocatorfilters_CppLocatorFilter();
void test_cpplocatorfilters_CppLocatorFilter_data(); void test_cpplocatorfilters_CppLocatorFilter_data();

View File

@@ -33,11 +33,18 @@
#include "debuggeractions.h" #include "debuggeractions.h"
#include "debuggercore.h" #include "debuggercore.h"
#include "debuggerengine.h" #include "debuggerengine.h"
#include "debuggerinternalconstants.h"
#include "debuggerstringutils.h" #include "debuggerstringutils.h"
#include "simplifytype.h" #include "simplifytype.h"
#include <coreplugin/coreconstants.h>
#include <coreplugin/coreplugin.h>
#include <coreplugin/editormanager/editormanager.h>
#include <coreplugin/idocument.h>
#include <extensionsystem/invoker.h> #include <extensionsystem/invoker.h>
#include <texteditor/textmark.h> #include <texteditor/textmark.h>
#include <texteditor/texteditor.h>
#include <utils/hostosinfo.h> #include <utils/hostosinfo.h>
#include <utils/qtcassert.h> #include <utils/qtcassert.h>
#include <utils/fileutils.h> #include <utils/fileutils.h>
@@ -50,6 +57,7 @@
#include <QDir> #include <QDir>
#include <QDebug> #include <QDebug>
using namespace Core;
using namespace Utils; using namespace Utils;
namespace Debugger { namespace Debugger {
@@ -1171,10 +1179,15 @@ void BreakHandler::timerEvent(QTimerEvent *event)
void Breakpoint::gotoLocation() const void Breakpoint::gotoLocation() const
{ {
if (DebuggerEngine *engine = currentEngine()) { if (DebuggerEngine *engine = currentEngine()) {
if (b->m_params.type == BreakpointByAddress) if (b->m_params.type == BreakpointByAddress) {
engine->gotoLocation(b->m_params.address); engine->gotoLocation(b->m_params.address);
else } else {
engine->gotoLocation(Location(b->markerFileName(), b->markerLineNumber(), false)); // Don't use gotoLocation as this ends up in disassembly
// if OperateByInstruction is on.
const QString file = QDir::cleanPath(b->markerFileName());
IEditor *editor = EditorManager::openEditor(file);
editor->gotoLine(b->markerLineNumber(), 0);
}
} }
} }

View File

@@ -302,7 +302,6 @@ CdbEngine::CdbEngine(const DebuggerStartParameters &sp) :
m_operateByInstruction(true), // Default CDB setting m_operateByInstruction(true), // Default CDB setting
m_verboseLogPending(true), m_verboseLogPending(true),
m_verboseLog(false), // Default CDB setting m_verboseLog(false), // Default CDB setting
m_notifyEngineShutdownOnTermination(false),
m_hasDebuggee(false), m_hasDebuggee(false),
m_wow64State(wow64Uninitialized), m_wow64State(wow64Uninitialized),
m_elapsedLogTime(0), m_elapsedLogTime(0),
@@ -341,7 +340,6 @@ void CdbEngine::init()
m_verboseLogPending = boolSetting(VerboseLog); m_verboseLogPending = boolSetting(VerboseLog);
m_operateByInstruction = true; // Default CDB setting m_operateByInstruction = true; // Default CDB setting
m_verboseLog = false; // Default CDB setting m_verboseLog = false; // Default CDB setting
m_notifyEngineShutdownOnTermination = false;
m_hasDebuggee = false; m_hasDebuggee = false;
m_sourceStepInto = false; m_sourceStepInto = false;
m_watchPointX = m_watchPointY = 0; m_watchPointX = m_watchPointY = 0;
@@ -903,20 +901,10 @@ void CdbEngine::shutdownEngine()
} else { } else {
postCommand("q", 0); postCommand("q", 0);
} }
m_notifyEngineShutdownOnTermination = true;
return;
} else { } else {
// Remote process. No can do, currently // Remote process. No can do, currently
m_notifyEngineShutdownOnTermination = true;
SynchronousProcess::stopProcess(m_process); SynchronousProcess::stopProcess(m_process);
return;
} }
// Lost debuggee, debugger should quit anytime now
if (!m_hasDebuggee) {
m_notifyEngineShutdownOnTermination = true;
return;
}
interruptInferior();
} }
void CdbEngine::abortDebugger() void CdbEngine::abortDebugger()
@@ -935,37 +923,12 @@ void CdbEngine::abortDebugger()
void CdbEngine::processFinished() void CdbEngine::processFinished()
{ {
if (debug) if (debug)
qDebug("CdbEngine::processFinished %dms '%s' notify=%d (exit state=%d, ex=%d)", qDebug("CdbEngine::processFinished %dms '%s' (exit state=%d, ex=%d)",
elapsedLogTime(), stateName(state()), m_notifyEngineShutdownOnTermination, elapsedLogTime(), stateName(state()), m_process.exitStatus(), m_process.exitCode());
m_process.exitStatus(), m_process.exitCode());
const bool crashed = m_process.exitStatus() == QProcess::CrashExit; notifyDebuggerProcessFinished(m_process.exitCode(),
if (crashed) m_process.exitStatus(),
showMessage(tr("CDB crashed"), LogError); // not in your life. QLatin1String("CDB"));
else
showMessage(tr("CDB exited (%1)").arg(m_process.exitCode()), LogMisc);
if (m_notifyEngineShutdownOnTermination) {
if (crashed) {
if (debug)
qDebug("notifyEngineIll");
STATE_DEBUG(state(), Q_FUNC_INFO, __LINE__, "notifyEngineIll")
notifyEngineIll();
} else {
STATE_DEBUG(state(), Q_FUNC_INFO, __LINE__, "notifyEngineShutdownOk")
notifyEngineShutdownOk();
}
} else {
// The QML/CPP engine relies on the standard sequence of InferiorShutDown,etc.
// Otherwise, we take a shortcut.
if (isSlaveEngine()) {
STATE_DEBUG(state(), Q_FUNC_INFO, __LINE__, "notifyInferiorExited")
notifyInferiorExited();
} else {
STATE_DEBUG(state(), Q_FUNC_INFO, __LINE__, "notifyEngineSpontaneousShutdown")
notifyEngineSpontaneousShutdown();
}
}
} }
void CdbEngine::detachDebugger() void CdbEngine::detachDebugger()
@@ -3004,6 +2967,11 @@ unsigned CdbEngine::parseStackTrace(const GdbMi &data, bool sourceStepInto)
} }
if (hasFile) { if (hasFile) {
const NormalizedSourceFileName fileName = sourceMapNormalizeFileNameFromDebugger(frames.at(i).file); const NormalizedSourceFileName fileName = sourceMapNormalizeFileNameFromDebugger(frames.at(i).file);
if (!fileName.exists && i == 0 && sourceStepInto) {
showMessage(QString::fromLatin1("Step into: Hit frame with no source, "
"step out..."), LogMisc);
return ParseStackStepOut;
}
frames[i].file = fileName.fileName; frames[i].file = fileName.fileName;
frames[i].usable = fileName.exists; frames[i].usable = fileName.exists;
if (current == -1 && frames[i].usable) if (current == -1 && frames[i].usable)

View File

@@ -273,7 +273,6 @@ private:
bool m_operateByInstruction; bool m_operateByInstruction;
bool m_verboseLogPending; //!< Creator verbose log action changed. bool m_verboseLogPending; //!< Creator verbose log action changed.
bool m_verboseLog; bool m_verboseLog;
bool m_notifyEngineShutdownOnTermination;
bool m_hasDebuggee; bool m_hasDebuggee;
enum Wow64State { enum Wow64State {
wow64Uninitialized, wow64Uninitialized,

View File

@@ -248,7 +248,7 @@ StartApplicationDialog::StartApplicationDialog(QWidget *parent)
d->serverAddressEdit = new QLineEdit(this); d->serverAddressEdit = new QLineEdit(this);
d->localExecutablePathChooser = new PathChooser(this); d->localExecutablePathChooser = new PathChooser(this);
d->localExecutablePathChooser->setExpectedKind(PathChooser::ExistingCommand); d->localExecutablePathChooser->setExpectedKind(PathChooser::File);
d->localExecutablePathChooser->setPromptDialogTitle(tr("Select Executable")); d->localExecutablePathChooser->setPromptDialogTitle(tr("Select Executable"));
d->localExecutablePathChooser->setHistoryCompleter(QLatin1String("LocalExecutable")); d->localExecutablePathChooser->setHistoryCompleter(QLatin1String("LocalExecutable"));

View File

@@ -147,17 +147,16 @@ bool GlslEditorPlugin::initialize(const QStringList & /*arguments*/, QString *er
errorMessage->clear(); errorMessage->clear();
FileIconProvider::registerIconOverlayForMimeType(":/glsleditor/images/glslfile.png", Constants::GLSL_MIMETYPE);
FileIconProvider::registerIconOverlayForMimeType(":/glsleditor/images/glslfile.png", Constants::GLSL_MIMETYPE_VERT);
FileIconProvider::registerIconOverlayForMimeType(":/glsleditor/images/glslfile.png", Constants::GLSL_MIMETYPE_FRAG);
FileIconProvider::registerIconOverlayForMimeType(":/glsleditor/images/glslfile.png", Constants::GLSL_MIMETYPE_VERT_ES);
FileIconProvider::registerIconOverlayForMimeType(":/glsleditor/images/glslfile.png", Constants::GLSL_MIMETYPE_FRAG_ES);
return true; return true;
} }
void GlslEditorPlugin::extensionsInitialized() void GlslEditorPlugin::extensionsInitialized()
{ {
FileIconProvider::registerIconOverlayForMimeType(":/glsleditor/images/glslfile.png", Constants::GLSL_MIMETYPE);
FileIconProvider::registerIconOverlayForMimeType(":/glsleditor/images/glslfile.png", Constants::GLSL_MIMETYPE_VERT);
FileIconProvider::registerIconOverlayForMimeType(":/glsleditor/images/glslfile.png", Constants::GLSL_MIMETYPE_FRAG);
FileIconProvider::registerIconOverlayForMimeType(":/glsleditor/images/glslfile.png", Constants::GLSL_MIMETYPE_VERT_ES);
FileIconProvider::registerIconOverlayForMimeType(":/glsleditor/images/glslfile.png", Constants::GLSL_MIMETYPE_FRAG_ES);
} }
ExtensionSystem::IPlugin::ShutdownFlag GlslEditorPlugin::aboutToShutdown() ExtensionSystem::IPlugin::ShutdownFlag GlslEditorPlugin::aboutToShutdown()

View File

@@ -329,8 +329,9 @@ void IDevice::fromMap(const QVariantMap &map)
d->sshParameters.timeout = map.value(QLatin1String(TimeoutKey), DefaultTimeout).toInt(); d->sshParameters.timeout = map.value(QLatin1String(TimeoutKey), DefaultTimeout).toInt();
d->sshParameters.hostKeyCheckingMode = static_cast<QSsh::SshHostKeyCheckingMode> d->sshParameters.hostKeyCheckingMode = static_cast<QSsh::SshHostKeyCheckingMode>
(map.value(QLatin1String(HostKeyCheckingKey), QSsh::SshHostKeyCheckingNone).toInt()); (map.value(QLatin1String(HostKeyCheckingKey), QSsh::SshHostKeyCheckingNone).toInt());
d->sshParameters.options const QVariant optionsVariant = map.value(QLatin1String(SshOptionsKey));
= QSsh::SshConnectionOptions(map.value(QLatin1String(SshOptionsKey)).toInt()); if (optionsVariant.isValid()) // false for QtC < 3.4
d->sshParameters.options = QSsh::SshConnectionOptions(optionsVariant.toInt());
d->freePorts = Utils::PortList::fromString(map.value(QLatin1String(PortsSpecKey), d->freePorts = Utils::PortList::fromString(map.value(QLatin1String(PortsSpecKey),
QLatin1String("10000-10100")).toString()); QLatin1String("10000-10100")).toString());

View File

@@ -1240,6 +1240,8 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er
connect(ICore::instance(), &ICore::coreOpened, connect(ICore::instance(), &ICore::coreOpened,
dd, &ProjectExplorerPluginPrivate::restoreSession); dd, &ProjectExplorerPluginPrivate::restoreSession);
connect(ICore::instance(), &ICore::newItemDialogRunningChanged, updateActions); connect(ICore::instance(), &ICore::newItemDialogRunningChanged, updateActions);
connect(ICore::instance(), &ICore::newItemDialogRunningChanged,
dd, &ProjectExplorerPluginPrivate::updateContextMenuActions);
dd->updateWelcomePage(); dd->updateWelcomePage();

View File

@@ -283,7 +283,7 @@ QString QbsBuildConfiguration::equivalentCommandLine(const BuildStep *buildStep)
const QString qbsFilePath = Utils::HostOsInfo::withExecutableSuffix(!qbsInstallDir.isEmpty() const QString qbsFilePath = Utils::HostOsInfo::withExecutableSuffix(!qbsInstallDir.isEmpty()
? qbsInstallDir + QLatin1String("/bin/qbs") ? qbsInstallDir + QLatin1String("/bin/qbs")
: QCoreApplication::applicationDirPath() + QLatin1String("/qbs")); : QCoreApplication::applicationDirPath() + QLatin1String("/qbs"));
Utils::QtcProcess::addArg(&commandLine, qbsFilePath); Utils::QtcProcess::addArg(&commandLine, QDir::toNativeSeparators(qbsFilePath));
const StepProxy stepProxy(buildStep); const StepProxy stepProxy(buildStep);
Utils::QtcProcess::addArg(&commandLine, stepProxy.command()); Utils::QtcProcess::addArg(&commandLine, stepProxy.command());
const QbsBuildConfiguration * const buildConfig = qobject_cast<QbsBuildConfiguration *>( const QbsBuildConfiguration * const buildConfig = qobject_cast<QbsBuildConfiguration *>(
@@ -301,7 +301,9 @@ QString QbsBuildConfiguration::equivalentCommandLine(const BuildStep *buildStep)
if (stepProxy.keepGoing()) if (stepProxy.keepGoing())
Utils::QtcProcess::addArg(&commandLine, QLatin1String("--keep-going")); Utils::QtcProcess::addArg(&commandLine, QLatin1String("--keep-going"));
if (stepProxy.showCommandLines()) if (stepProxy.showCommandLines())
Utils::QtcProcess::addArg(&commandLine, QLatin1String("--show-command-lines")); Utils::QtcProcess::addArgs(&commandLine, QStringList()
<< QLatin1String("--command-echo-mode")
<< QLatin1String("command-line"));
if (stepProxy.noInstall()) if (stepProxy.noInstall())
Utils::QtcProcess::addArg(&commandLine, QLatin1String("--no-install")); Utils::QtcProcess::addArg(&commandLine, QLatin1String("--no-install"));
if (stepProxy.cleanInstallRoot()) if (stepProxy.cleanInstallRoot())

View File

@@ -46,6 +46,7 @@
#include <qtsupport/baseqtversion.h> #include <qtsupport/baseqtversion.h>
#include <qtsupport/qtkitinformation.h> #include <qtsupport/qtkitinformation.h>
#include <QCryptographicHash>
#include <QVariantMap> #include <QVariantMap>
#include <qbs.h> #include <qbs.h>
@@ -194,7 +195,8 @@ void QbsManager::addQtProfileFromKit(const QString &profileName, const ProjectEx
void QbsManager::addProfileFromKit(const ProjectExplorer::Kit *k) void QbsManager::addProfileFromKit(const ProjectExplorer::Kit *k)
{ {
const QString name = QString::fromLatin1("qtc_%1_%2").arg(k->fileSystemFriendlyName().left(8), const QString name = QString::fromLatin1("qtc_%1_%2").arg(k->fileSystemFriendlyName().left(8),
QString::number(k->id().uniqueIdentifier(), 16)); QString::fromLatin1(QCryptographicHash::hash(k->id().name(),
QCryptographicHash::Sha1).toHex().left(8)));
qbs::Profile(name, settings()).removeProfile(); qbs::Profile(name, settings()).removeProfile();
setProfileForKit(name, k); setProfileForKit(name, k);
addQtProfileFromKit(name, k); addQtProfileFromKit(name, k);

View File

@@ -1048,7 +1048,8 @@ void InternalLibraryDetailsController::updateProFile()
QList<QmakeProFileNode *> proFiles = findQt4ProFiles(rootProject); QList<QmakeProFileNode *> proFiles = findQt4ProFiles(rootProject);
foreach (QmakeProFileNode *proFileNode, proFiles) { foreach (QmakeProFileNode *proFileNode, proFiles) {
const QString proFilePath = proFileNode->path().toString(); const QString proFilePath = proFileNode->path().toString();
if (proFileNode->projectType() == SharedLibraryTemplate) { QmakeProjectManager::QmakeProjectType type = proFileNode->projectType();
if (type == SharedLibraryTemplate || type == StaticLibraryTemplate) {
const QStringList configVar = proFileNode->variableValue(ConfigVar); const QStringList configVar = proFileNode->variableValue(ConfigVar);
if (!configVar.contains(QLatin1String("plugin"))) { if (!configVar.contains(QLatin1String("plugin"))) {
const QString relProFilePath = rootDir.relativeFilePath(proFilePath); const QString relProFilePath = rootDir.relativeFilePath(proFilePath);

View File

@@ -238,28 +238,77 @@ static const char *const variableKeywords[] = {
}; };
static const char *const functionKeywords[] = { static const char *const functionKeywords[] = {
"absolute_path",
"basename", "basename",
"cache",
"cat",
"clean_path",
"clear",
"CONFIG",
"contains", "contains",
"count", "count",
"debug",
"defined",
"dirname", "dirname",
"enumerate_vars",
"equals",
"error", "error",
"eval", "escape_expand",
"exists", "exists",
"export",
"eval",
"files",
"find", "find",
"first",
"for", "for",
"format_number",
"fromfile",
"getenv",
"greaterThan",
"if",
"include", "include",
"infile", "infile",
"isActiveConfig",
"isEmpty", "isEmpty",
"isEqual",
"lessThan",
"join", "join",
"last",
"list",
"load",
"log",
"lower",
"member", "member",
"message", "message",
"mkpath",
"packagesExist", "packagesExist",
"parseJson",
"prompt", "prompt",
"quote", "quote",
"relative_path",
"replace", "replace",
"requires",
"resolve_depends",
"reverse",
"re_escape",
"section",
"shadowed",
"shell_path",
"shell_quote",
"size",
"split",
"sprintf", "sprintf",
"sort_depends",
"system", "system",
"system_path",
"system_quote",
"title",
"touch",
"unique", "unique",
"unset",
"upper",
"val_escape",
"write_file",
"warning", "warning",
0 0
}; };

View File

@@ -74,7 +74,7 @@ public:
using namespace Internal; using namespace Internal;
AnalyzerStartParameters RemoteLinuxAnalyzeSupport::startParameters(const AbstractRemoteLinuxRunConfiguration *runConfig, AnalyzerStartParameters RemoteLinuxAnalyzeSupport::startParameters(const RunConfiguration *runConfig,
RunMode runMode) RunMode runMode)
{ {
AnalyzerStartParameters params; AnalyzerStartParameters params;
@@ -98,6 +98,8 @@ RemoteLinuxAnalyzeSupport::RemoteLinuxAnalyzeSupport(AbstractRemoteLinuxRunConfi
SLOT(handleRemoteSetupRequested())); SLOT(handleRemoteSetupRequested()));
connect(&d->outputParser, &QmlDebug::QmlOutputParser::waitingForConnectionOnPort, connect(&d->outputParser, &QmlDebug::QmlOutputParser::waitingForConnectionOnPort,
this, &RemoteLinuxAnalyzeSupport::remoteIsRunning); this, &RemoteLinuxAnalyzeSupport::remoteIsRunning);
connect(engine, &RunControl::finished,
this, &RemoteLinuxAnalyzeSupport::handleProfilingFinished);
} }
RemoteLinuxAnalyzeSupport::~RemoteLinuxAnalyzeSupport() RemoteLinuxAnalyzeSupport::~RemoteLinuxAnalyzeSupport()

View File

@@ -34,6 +34,8 @@
#include "abstractremotelinuxrunsupport.h" #include "abstractremotelinuxrunsupport.h"
#include <projectexplorer/projectexplorerconstants.h> #include <projectexplorer/projectexplorerconstants.h>
#include <projectexplorer/runconfiguration.h>
#include <utils/outputformat.h> #include <utils/outputformat.h>
namespace Analyzer { namespace Analyzer {
@@ -50,7 +52,7 @@ class REMOTELINUX_EXPORT RemoteLinuxAnalyzeSupport : public AbstractRemoteLinuxR
{ {
Q_OBJECT Q_OBJECT
public: public:
static Analyzer::AnalyzerStartParameters startParameters(const AbstractRemoteLinuxRunConfiguration *runConfig, static Analyzer::AnalyzerStartParameters startParameters(const ProjectExplorer::RunConfiguration *runConfig,
ProjectExplorer::RunMode runMode); ProjectExplorer::RunMode runMode);
RemoteLinuxAnalyzeSupport(AbstractRemoteLinuxRunConfiguration *runConfig, RemoteLinuxAnalyzeSupport(AbstractRemoteLinuxRunConfiguration *runConfig,

View File

@@ -81,18 +81,18 @@ RunControl *RemoteLinuxRunControlFactory::create(RunConfiguration *runConfig, Ru
{ {
QTC_ASSERT(canRun(runConfig, mode), return 0); QTC_ASSERT(canRun(runConfig, mode), return 0);
auto * const rc = qobject_cast<AbstractRemoteLinuxRunConfiguration *>(runConfig);
QTC_ASSERT(rc, return 0);
switch (mode) { switch (mode) {
case NormalRunMode: case NormalRunMode:
return new RemoteLinuxRunControl(rc); return new RemoteLinuxRunControl(runConfig);
case DebugRunMode: case DebugRunMode:
case DebugRunModeWithBreakOnMain: { case DebugRunModeWithBreakOnMain: {
IDevice::ConstPtr dev = DeviceKitInformation::device(rc->target()->kit()); IDevice::ConstPtr dev = DeviceKitInformation::device(runConfig->target()->kit());
if (!dev) { if (!dev) {
*errorMessage = tr("Cannot debug: Kit has no device."); *errorMessage = tr("Cannot debug: Kit has no device.");
return 0; return 0;
} }
auto * const rc = qobject_cast<AbstractRemoteLinuxRunConfiguration *>(runConfig);
QTC_ASSERT(rc, return 0);
if (rc->portsUsedByDebuggers() > dev->freePorts().count()) { if (rc->portsUsedByDebuggers() > dev->freePorts().count()) {
*errorMessage = tr("Cannot debug: Not enough free ports available."); *errorMessage = tr("Cannot debug: Not enough free ports available.");
return 0; return 0;
@@ -106,7 +106,7 @@ RunControl *RemoteLinuxRunControlFactory::create(RunConfiguration *runConfig, Ru
DebuggerStartParameters params = LinuxDeviceDebugSupport::startParameters(rc); DebuggerStartParameters params = LinuxDeviceDebugSupport::startParameters(rc);
if (mode == DebugRunModeWithBreakOnMain) if (mode == DebugRunModeWithBreakOnMain)
params.breakOnMain = true; params.breakOnMain = true;
params.runConfiguration = rc; params.runConfiguration = runConfig;
DebuggerRunControl * const runControl DebuggerRunControl * const runControl
= DebuggerRunControlFactory::doCreate(params, errorMessage); = DebuggerRunControlFactory::doCreate(params, errorMessage);
if (!runControl) if (!runControl)
@@ -117,11 +117,11 @@ RunControl *RemoteLinuxRunControlFactory::create(RunConfiguration *runConfig, Ru
return runControl; return runControl;
} }
case QmlProfilerRunMode: { case QmlProfilerRunMode: {
AnalyzerStartParameters params = RemoteLinuxAnalyzeSupport::startParameters(rc, mode); AnalyzerStartParameters params = RemoteLinuxAnalyzeSupport::startParameters(runConfig, mode);
auto * const rc = qobject_cast<AbstractRemoteLinuxRunConfiguration *>(runConfig);
QTC_ASSERT(rc, return 0);
AnalyzerRunControl *runControl = AnalyzerManager::createRunControl(params, runConfig); AnalyzerRunControl *runControl = AnalyzerManager::createRunControl(params, runConfig);
RemoteLinuxAnalyzeSupport * const analyzeSupport = (void) new RemoteLinuxAnalyzeSupport(rc, runControl, mode);
new RemoteLinuxAnalyzeSupport(rc, runControl, mode);
connect(runControl, SIGNAL(finished()), analyzeSupport, SLOT(handleProfilingFinished()));
return runControl; return runControl;
} }
case PerfProfilerRunMode: case PerfProfilerRunMode:

View File

@@ -531,10 +531,10 @@ void GenericProposalWidget::updatePositionAndSize()
QPoint pos = d->m_displayRect.bottomLeft(); QPoint pos = d->m_displayRect.bottomLeft();
pos.rx() -= 16 + fw; // Space for the icons pos.rx() -= 16 + fw; // Space for the icons
if (pos.y() + height > screen.bottom()) if (pos.y() + height > screen.bottom())
pos.setY(d->m_displayRect.top() - height); pos.setY(qMax(0, d->m_displayRect.top() - height));
if (pos.x() + width > screen.right()) if (pos.x() + width > screen.right())
pos.setX(screen.right() - width); pos.setX(qMax(0, screen.right() - width));
setGeometry(pos.x(), pos.y(), width, height); setGeometry(pos.x(), pos.y(), qMin(width, screen.width()), qMin(height, screen.height()));
} }
void GenericProposalWidget::turnOffAutoWidth() void GenericProposalWidget::turnOffAutoWidth()

View File

@@ -64,6 +64,7 @@ PlainTextEditorFactory::PlainTextEditorFactory()
setId(Core::Constants::K_DEFAULT_TEXT_EDITOR_ID); setId(Core::Constants::K_DEFAULT_TEXT_EDITOR_ID);
setDisplayName(qApp->translate("OpenWith::Editors", Core::Constants::K_DEFAULT_TEXT_EDITOR_DISPLAY_NAME)); setDisplayName(qApp->translate("OpenWith::Editors", Core::Constants::K_DEFAULT_TEXT_EDITOR_DISPLAY_NAME));
addMimeType(QLatin1String(TextEditor::Constants::C_TEXTEDITOR_MIMETYPE_TEXT)); addMimeType(QLatin1String(TextEditor::Constants::C_TEXTEDITOR_MIMETYPE_TEXT));
addMimeType(QLatin1String("text/css")); // for some reason freedesktop thinks css is text/x-csrc
setDocumentCreator([]() { return new TextDocument(Core::Constants::K_DEFAULT_TEXT_EDITOR_ID); }); setDocumentCreator([]() { return new TextDocument(Core::Constants::K_DEFAULT_TEXT_EDITOR_ID); });
setEditorWidgetCreator([]() { return new PlainTextEditorWidget; }); setEditorWidgetCreator([]() { return new PlainTextEditorWidget; });

View File

@@ -57,6 +57,7 @@ const char DISPLAYNAME[] = "PE.Profile.Name";
const char ICON[] = "PE.Profile.Icon"; const char ICON[] = "PE.Profile.Icon";
const char AUTODETECTED[] = "PE.Profile.AutoDetected"; const char AUTODETECTED[] = "PE.Profile.AutoDetected";
const char SDK[] = "PE.Profile.SDK"; const char SDK[] = "PE.Profile.SDK";
const char ENV[] = "PE.Profile.Environment";
const char DATA[] = "PE.Profile.Data"; const char DATA[] = "PE.Profile.Data";
// Standard KitInformation: // Standard KitInformation:
@@ -100,6 +101,7 @@ QString AddKitOperation::argumentsHelpText() const
" --toolchain <ID> tool chain of the new kit.\n" " --toolchain <ID> tool chain of the new kit.\n"
" --qt <ID> Qt of the new kit.\n" " --qt <ID> Qt of the new kit.\n"
" --mkspec <PATH> mkspec of the new kit.\n" " --mkspec <PATH> mkspec of the new kit.\n"
" --env <VALUE> add a custom environment setting. [may be repeated]\n"
" <KEY> <TYPE:VALUE> extra key value pairs\n"); " <KEY> <TYPE:VALUE> extra key value pairs\n");
} }
@@ -212,6 +214,14 @@ bool AddKitOperation::setArguments(const QStringList &args)
continue; continue;
} }
if (current == QLatin1String("--env")) {
if (next.isNull())
return false;
++i; // skip next;
m_env.append(next);
continue;
}
if (next.isNull()) if (next.isNull())
return false; return false;
++i; // skip next; ++i; // skip next;
@@ -249,7 +259,7 @@ int AddKitOperation::execute() const
QVariantMap result = addKit(map, m_id, m_displayName, m_icon, m_debuggerId, m_debuggerEngine, QVariantMap result = addKit(map, m_id, m_displayName, m_icon, m_debuggerId, m_debuggerEngine,
m_debugger, m_deviceType, m_device, m_sysRoot, m_tc, m_qt, m_debugger, m_deviceType, m_device, m_sysRoot, m_tc, m_qt,
m_mkspec, m_extra); m_mkspec, m_env, m_extra);
if (result.isEmpty() || map == result) if (result.isEmpty() || map == result)
return 2; return 2;
@@ -283,13 +293,16 @@ bool AddKitOperation::test() const
QLatin1String("uname"), 1, QLatin1String("uname"), 1,
KeyValuePairList()); KeyValuePairList());
QStringList env;
env << QLatin1String("TEST=1") << QLatin1String("PATH");
if (map.count() != 3 if (map.count() != 3
|| !map.contains(QLatin1String(VERSION)) || !map.contains(QLatin1String(VERSION))
|| map.value(QLatin1String(VERSION)).toInt() != 1 || map.value(QLatin1String(VERSION)).toInt() != 1
|| !map.contains(QLatin1String(COUNT)) || !map.contains(QLatin1String(COUNT))
|| map.value(QLatin1String(COUNT)).toInt() != 0 || map.value(QLatin1String(COUNT)).toInt() != 0
|| !map.contains(QLatin1String(DEFAULT)) || !map.contains(QLatin1String(DEFAULT))
|| map.value(QLatin1String(DEFAULT)).toInt() != -1) || !map.value(QLatin1String(DEFAULT)).toString().isEmpty())
return false; return false;
// Fail if TC is not there: // Fail if TC is not there:
@@ -298,6 +311,7 @@ bool AddKitOperation::test() const
QString(), 1, QLatin1String("/usr/bin/gdb-test"), QString(), 1, QLatin1String("/usr/bin/gdb-test"),
QLatin1String("Desktop"), QLatin1String("{dev-id}"), QString(), QLatin1String("Desktop"), QLatin1String("{dev-id}"), QString(),
QLatin1String("{tcXX-id}"), QLatin1String("{qt-id}"), QLatin1String("unsupported/mkspec"), QLatin1String("{tcXX-id}"), QLatin1String("{qt-id}"), QLatin1String("unsupported/mkspec"),
QStringList(),
KeyValuePairList() << KeyValuePair(QLatin1String("PE.Profile.Data/extraData"), QVariant(QLatin1String("extraValue")))); KeyValuePairList() << KeyValuePair(QLatin1String("PE.Profile.Data/extraData"), QVariant(QLatin1String("extraValue"))));
if (!empty.isEmpty()) if (!empty.isEmpty())
return false; return false;
@@ -307,6 +321,7 @@ bool AddKitOperation::test() const
QString(), 1, QLatin1String("/usr/bin/gdb-test"), QString(), 1, QLatin1String("/usr/bin/gdb-test"),
QLatin1String("Desktop"), QLatin1String("{dev-id}"), QString(), QLatin1String("Desktop"), QLatin1String("{dev-id}"), QString(),
QLatin1String("x86-linux-generic-elf-64bit"), QLatin1String("{qt-id}"), QLatin1String("unsupported/mkspec"), QLatin1String("x86-linux-generic-elf-64bit"), QLatin1String("{qt-id}"), QLatin1String("unsupported/mkspec"),
env,
KeyValuePairList() << KeyValuePair(QLatin1String("PE.Profile.Data/extraData"), QVariant(QLatin1String("extraValue")))); KeyValuePairList() << KeyValuePair(QLatin1String("PE.Profile.Data/extraData"), QVariant(QLatin1String("extraValue"))));
if (empty.isEmpty()) if (empty.isEmpty())
return false; return false;
@@ -316,6 +331,7 @@ bool AddKitOperation::test() const
QString(), 1, QLatin1String("/usr/bin/gdb-test"), QString(), 1, QLatin1String("/usr/bin/gdb-test"),
QLatin1String("Desktop"), QLatin1String("{dev-id}"), QString(), QLatin1String("Desktop"), QLatin1String("{dev-id}"), QString(),
QLatin1String("x86-macos-generic-mach_o-64bit"), QLatin1String("{qt-id}"), QLatin1String("unsupported/mkspec"), QLatin1String("x86-macos-generic-mach_o-64bit"), QLatin1String("{qt-id}"), QLatin1String("unsupported/mkspec"),
env,
KeyValuePairList() << KeyValuePair(QLatin1String("PE.Profile.Data/extraData"), QVariant(QLatin1String("extraValue")))); KeyValuePairList() << KeyValuePair(QLatin1String("PE.Profile.Data/extraData"), QVariant(QLatin1String("extraValue"))));
if (empty.isEmpty()) if (empty.isEmpty())
return false; return false;
@@ -326,6 +342,7 @@ bool AddKitOperation::test() const
QString(), 1, QLatin1String("/usr/bin/gdb-test"), QString(), 1, QLatin1String("/usr/bin/gdb-test"),
QLatin1String("Desktop"), QLatin1String("{dev-id}"), QString(), QLatin1String("Desktop"), QLatin1String("{dev-id}"), QString(),
QLatin1String("{tc-id}"), QLatin1String("{qtXX-id}"), QLatin1String("unsupported/mkspec"), QLatin1String("{tc-id}"), QLatin1String("{qtXX-id}"), QLatin1String("unsupported/mkspec"),
env,
KeyValuePairList() << KeyValuePair(QLatin1String("PE.Profile.Data/extraData"), QVariant(QLatin1String("extraValue")))); KeyValuePairList() << KeyValuePair(QLatin1String("PE.Profile.Data/extraData"), QVariant(QLatin1String("extraValue"))));
if (!empty.isEmpty()) if (!empty.isEmpty())
return false; return false;
@@ -335,15 +352,18 @@ bool AddKitOperation::test() const
QString(), 1, QLatin1String("/usr/bin/gdb-test"), QString(), 1, QLatin1String("/usr/bin/gdb-test"),
QLatin1String("Desktop"), QLatin1String("{devXX-id}"), QString(), QLatin1String("Desktop"), QLatin1String("{devXX-id}"), QString(),
QLatin1String("{tc-id}"), QLatin1String("{qt-id}"), QLatin1String("unsupported/mkspec"), QLatin1String("{tc-id}"), QLatin1String("{qt-id}"), QLatin1String("unsupported/mkspec"),
env,
KeyValuePairList() << KeyValuePair(QLatin1String("PE.Profile.Data/extraData"), QVariant(QLatin1String("extraValue")))); KeyValuePairList() << KeyValuePair(QLatin1String("PE.Profile.Data/extraData"), QVariant(QLatin1String("extraValue"))));
if (!empty.isEmpty()) if (!empty.isEmpty())
return false; return false;
// Profile 0:
map = addKit(map, tcMap, qtMap, devMap, map = addKit(map, tcMap, qtMap, devMap,
QLatin1String("testId"), QLatin1String("Test Kit"), QLatin1String("/tmp/icon.png"), QLatin1String("testId"), QLatin1String("Test Kit"), QLatin1String("/tmp/icon.png"),
QString(), 1, QLatin1String("/usr/bin/gdb-test"), QString(), 1, QLatin1String("/usr/bin/gdb-test"),
QLatin1String("Desktop"), QString(), QString(), QLatin1String("Desktop"), QString(), QString(),
QLatin1String("{tc-id}"), QLatin1String("{qt-id}"), QLatin1String("unsupported/mkspec"), QLatin1String("{tc-id}"), QLatin1String("{qt-id}"), QLatin1String("unsupported/mkspec"),
env,
KeyValuePairList() << KeyValuePair(QLatin1String("PE.Profile.Data/extraData"), QVariant(QLatin1String("extraValue")))); KeyValuePairList() << KeyValuePair(QLatin1String("PE.Profile.Data/extraData"), QVariant(QLatin1String("extraValue"))));
if (map.count() != 4 if (map.count() != 4
@@ -352,7 +372,7 @@ bool AddKitOperation::test() const
|| !map.contains(QLatin1String(COUNT)) || !map.contains(QLatin1String(COUNT))
|| map.value(QLatin1String(COUNT)).toInt() != 1 || map.value(QLatin1String(COUNT)).toInt() != 1
|| !map.contains(QLatin1String(DEFAULT)) || !map.contains(QLatin1String(DEFAULT))
|| map.value(QLatin1String(DEFAULT)).toInt() != 0 || map.value(QLatin1String(DEFAULT)).toString() != QLatin1String("testId")
|| !map.contains(QLatin1String("Profile.0"))) || !map.contains(QLatin1String("Profile.0")))
return false; return false;
@@ -373,7 +393,7 @@ bool AddKitOperation::test() const
return false; return false;
QVariantMap data = profile0.value(QLatin1String(DATA)).toMap(); QVariantMap data = profile0.value(QLatin1String(DATA)).toMap();
if (data.count() != 6 if (data.count() != 7
|| !data.contains(QLatin1String(DEBUGGER)) || !data.contains(QLatin1String(DEBUGGER))
|| data.value(QLatin1String(DEBUGGER)).type() != QVariant::Map || data.value(QLatin1String(DEBUGGER)).type() != QVariant::Map
|| !data.contains(QLatin1String(DEVICE_TYPE)) || !data.contains(QLatin1String(DEVICE_TYPE))
@@ -394,16 +414,18 @@ bool AddKitOperation::test() const
QString(), 1, QLatin1String("/usr/bin/gdb-test3"), QString(), 1, QLatin1String("/usr/bin/gdb-test3"),
QLatin1String("Desktop"), QString(), QString(), QLatin1String("Desktop"), QString(), QString(),
QLatin1String("{tc-id}"), QLatin1String("{qt-id}"), QLatin1String("unsupported/mkspec"), QLatin1String("{tc-id}"), QLatin1String("{qt-id}"), QLatin1String("unsupported/mkspec"),
env,
KeyValuePairList() << KeyValuePair(QLatin1String("PE.Profile.Data/extraData"), QVariant(QLatin1String("extraValue")))); KeyValuePairList() << KeyValuePair(QLatin1String("PE.Profile.Data/extraData"), QVariant(QLatin1String("extraValue"))));
if (!result.isEmpty()) if (!result.isEmpty())
return false; return false;
// Make sure name is unique: // Profile 1: Make sure name is unique:
map = addKit(map, tcMap, qtMap, devMap, map = addKit(map, tcMap, qtMap, devMap,
QLatin1String("testId2"), QLatin1String("Test Kit2"), QLatin1String("/tmp/icon2.png"), QLatin1String("testId2"), QLatin1String("Test Kit2"), QLatin1String("/tmp/icon2.png"),
QString(), 1, QLatin1String("/usr/bin/gdb-test2"), QString(), 1, QLatin1String("/usr/bin/gdb-test2"),
QLatin1String("Desktop"), QLatin1String("{dev-id}"), QLatin1String("/sys/root\\\\"), QLatin1String("Desktop"), QLatin1String("{dev-id}"), QLatin1String("/sys/root\\\\"),
QLatin1String("{tc-id}"), QLatin1String("{qt-id}"), QLatin1String("unsupported/mkspec"), QLatin1String("{tc-id}"), QLatin1String("{qt-id}"), QLatin1String("unsupported/mkspec"),
env,
KeyValuePairList() << KeyValuePair(QLatin1String("PE.Profile.Data/extraData"), QVariant(QLatin1String("extraValue")))); KeyValuePairList() << KeyValuePair(QLatin1String("PE.Profile.Data/extraData"), QVariant(QLatin1String("extraValue"))));
if (map.count() != 5 if (map.count() != 5
|| !map.contains(QLatin1String(VERSION)) || !map.contains(QLatin1String(VERSION))
@@ -435,7 +457,7 @@ bool AddKitOperation::test() const
return false; return false;
data = profile1.value(QLatin1String(DATA)).toMap(); data = profile1.value(QLatin1String(DATA)).toMap();
if (data.count() != 8 if (data.count() != 9
|| !data.contains(QLatin1String(DEBUGGER)) || !data.contains(QLatin1String(DEBUGGER))
|| data.value(QLatin1String(DEBUGGER)).type() != QVariant::Map || data.value(QLatin1String(DEBUGGER)).type() != QVariant::Map
|| !data.contains(QLatin1String(DEVICE_TYPE)) || !data.contains(QLatin1String(DEVICE_TYPE))
@@ -450,16 +472,19 @@ bool AddKitOperation::test() const
|| data.value(QLatin1String(QT)).toString() != QLatin1String("SDK.{qt-id}") || data.value(QLatin1String(QT)).toString() != QLatin1String("SDK.{qt-id}")
|| !data.contains(QLatin1String(MKSPEC)) || !data.contains(QLatin1String(MKSPEC))
|| data.value(QLatin1String(MKSPEC)).toString() != QLatin1String("unsupported/mkspec") || data.value(QLatin1String(MKSPEC)).toString() != QLatin1String("unsupported/mkspec")
|| !data.contains(QLatin1String(ENV))
|| data.value(QLatin1String(ENV)).toStringList() != env
|| !data.contains(QLatin1String("extraData")) || !data.contains(QLatin1String("extraData"))
|| data.value(QLatin1String("extraData")).toString() != QLatin1String("extraValue")) || data.value(QLatin1String("extraData")).toString() != QLatin1String("extraValue"))
return false; return false;
// Test debugger id: // Profile 2: Test debugger id:
map = addKit(map, tcMap, qtMap, devMap, map = addKit(map, tcMap, qtMap, devMap,
QLatin1String("test with debugger Id"), QLatin1String("Test debugger Id"), QLatin1String("/tmp/icon2.png"), QLatin1String("test with debugger Id"), QLatin1String("Test debugger Id"), QLatin1String("/tmp/icon2.png"),
QString::fromLatin1("debugger Id"), 0, QString(), QString::fromLatin1("debugger Id"), 0, QString(),
QLatin1String("Desktop"), QString(), QString(), QLatin1String("Desktop"), QString(), QString(),
QLatin1String("{tc-id}"), QLatin1String("{qt-id}"), QLatin1String("unsupported/mkspec"), QLatin1String("{tc-id}"), QLatin1String("{qt-id}"), QLatin1String("unsupported/mkspec"),
env,
KeyValuePairList() << KeyValuePair(QLatin1String("PE.Profile.Data/extraData"), QVariant(QLatin1String("extraValue")))); KeyValuePairList() << KeyValuePair(QLatin1String("PE.Profile.Data/extraData"), QVariant(QLatin1String("extraValue"))));
if (map.count() != 6 if (map.count() != 6
|| !map.contains(QLatin1String(VERSION)) || !map.contains(QLatin1String(VERSION))
@@ -494,7 +519,7 @@ bool AddKitOperation::test() const
return false; return false;
data = profile2.value(QLatin1String(DATA)).toMap(); data = profile2.value(QLatin1String(DATA)).toMap();
if (data.count() != 6 if (data.count() != 7
|| !data.contains(QLatin1String(DEBUGGER)) || !data.contains(QLatin1String(DEBUGGER))
|| data.value(QLatin1String(DEBUGGER)).toString() != QLatin1String("debugger Id")) || data.value(QLatin1String(DEBUGGER)).toString() != QLatin1String("debugger Id"))
return false; return false;
@@ -509,14 +534,15 @@ QVariantMap AddKitOperation::addKit(const QVariantMap &map,
const quint32 &debuggerType, const QString &debugger, const quint32 &debuggerType, const QString &debugger,
const QString &deviceType, const QString &device, const QString &deviceType, const QString &device,
const QString &sysRoot, const QString &tc, const QString &qt, const QString &sysRoot, const QString &tc, const QString &qt,
const QString &mkspec, const KeyValuePairList &extra) const QString &mkspec, const QStringList &env,
const KeyValuePairList &extra)
{ {
QVariantMap tcMap = load(QLatin1String("ToolChains")); QVariantMap tcMap = load(QLatin1String("ToolChains"));
QVariantMap qtMap = load(QLatin1String("QtVersions")); QVariantMap qtMap = load(QLatin1String("QtVersions"));
QVariantMap devMap = load(QLatin1String("Devices")); QVariantMap devMap = load(QLatin1String("Devices"));
return addKit(map, tcMap, qtMap, devMap, id, displayName, icon, debuggerId, debuggerType, return addKit(map, tcMap, qtMap, devMap, id, displayName, icon, debuggerId, debuggerType,
debugger, deviceType, device, sysRoot, tc, qt, mkspec, extra); debugger, deviceType, device, sysRoot, tc, qt, mkspec, env, extra);
} }
QVariantMap AddKitOperation::addKit(const QVariantMap &map, const QVariantMap &tcMap, QVariantMap AddKitOperation::addKit(const QVariantMap &map, const QVariantMap &tcMap,
@@ -526,7 +552,8 @@ QVariantMap AddKitOperation::addKit(const QVariantMap &map, const QVariantMap &t
const quint32 &debuggerType, const QString &debugger, const quint32 &debuggerType, const QString &debugger,
const QString &deviceType, const QString &device, const QString &deviceType, const QString &device,
const QString &sysRoot, const QString &tc, const QString &qt, const QString &sysRoot, const QString &tc, const QString &qt,
const QString &mkspec, const KeyValuePairList &extra) const QString &mkspec, const QStringList &env,
const KeyValuePairList &extra)
{ {
// Sanity check: Make sure autodetection source is not in use already: // Sanity check: Make sure autodetection source is not in use already:
QStringList valueKeys = FindValueOperation::findValue(map, QVariant(id)); QStringList valueKeys = FindValueOperation::findValue(map, QVariant(id));
@@ -571,14 +598,9 @@ QVariantMap AddKitOperation::addKit(const QVariantMap &map, const QVariantMap &t
} }
const QString kit = QString::fromLatin1(PREFIX) + QString::number(count); const QString kit = QString::fromLatin1(PREFIX) + QString::number(count);
int defaultKit = GetOperation::get(map, QLatin1String(DEFAULT)).toInt(&ok); QString defaultKit = GetOperation::get(map, QLatin1String(DEFAULT)).toString();
if (!ok) { if (defaultKit.isEmpty())
std::cerr << "Error: Default kit seems wrong." << std::endl; defaultKit = id;
return QVariantMap();
}
if (defaultKit < 0)
defaultKit = 0;
// remove data: // remove data:
QStringList toRemove; QStringList toRemove;
@@ -629,6 +651,9 @@ QVariantMap AddKitOperation::addKit(const QVariantMap &map, const QVariantMap &t
if (!mkspec.isNull()) if (!mkspec.isNull())
data << KeyValuePair(QStringList() << kit << QLatin1String(DATA) data << KeyValuePair(QStringList() << kit << QLatin1String(DATA)
<< QLatin1String(MKSPEC), QVariant(mkspec)); << QLatin1String(MKSPEC), QVariant(mkspec));
if (!env.isEmpty())
data << KeyValuePair(QStringList() << kit << QLatin1String(DATA)
<< QLatin1String(ENV), QVariant(env));
data << KeyValuePair(QStringList() << QLatin1String(DEFAULT), QVariant(defaultKit)); data << KeyValuePair(QStringList() << QLatin1String(DEFAULT), QVariant(defaultKit));
data << KeyValuePair(QStringList() << QLatin1String(COUNT), QVariant(count + 1)); data << KeyValuePair(QStringList() << QLatin1String(COUNT), QVariant(count + 1));
@@ -645,7 +670,7 @@ QVariantMap AddKitOperation::initializeKits()
{ {
QVariantMap map; QVariantMap map;
map.insert(QLatin1String(VERSION), 1); map.insert(QLatin1String(VERSION), 1);
map.insert(QLatin1String(DEFAULT), -1); map.insert(QLatin1String(DEFAULT), QString());
map.insert(QLatin1String(COUNT), 0); map.insert(QLatin1String(COUNT), 0);
return map; return map;
} }

View File

@@ -57,7 +57,7 @@ public:
const quint32 &debuggerType, const QString &debugger, const quint32 &debuggerType, const QString &debugger,
const QString &deviceType, const QString &device, const QString &deviceType, const QString &device,
const QString &sysRoot, const QString &tc, const QString &qt, const QString &sysRoot, const QString &tc, const QString &qt,
const QString &mkspec, const KeyValuePairList &extra); const QString &mkspec, const QStringList &env, const KeyValuePairList &extra);
static QVariantMap initializeKits(); static QVariantMap initializeKits();
@@ -69,7 +69,7 @@ public:
const quint32 &debuggerType, const QString &debugger, const quint32 &debuggerType, const QString &debugger,
const QString &deviceType, const QString &device, const QString &deviceType, const QString &device,
const QString &sysRoot, const QString &tc, const QString &qt, const QString &sysRoot, const QString &tc, const QString &qt,
const QString &mkspec, const KeyValuePairList &extra); const QString &mkspec, const QStringList &env, const KeyValuePairList &extra);
private: private:
QString m_id; QString m_id;
@@ -84,6 +84,7 @@ private:
QString m_tc; QString m_tc;
QString m_qt; QString m_qt;
QString m_mkspec; QString m_mkspec;
QStringList m_env;
KeyValuePairList m_extra; KeyValuePairList m_extra;
}; };

View File

@@ -251,7 +251,7 @@ QVariantMap AddToolChainOperation::addToolChain(const QVariantMap &map,
const QString tc = QString::fromLatin1(PREFIX) + QString::number(count); const QString tc = QString::fromLatin1(PREFIX) + QString::number(count);
KeyValuePairList data; KeyValuePairList data;
data << KeyValuePair(QStringList() << tc << QLatin1String(ID), QVariant(id.toUtf8())); data << KeyValuePair(QStringList() << tc << QLatin1String(ID), QVariant(id));
data << KeyValuePair(QStringList() << tc << QLatin1String(DISPLAYNAME), QVariant(uniqueName)); data << KeyValuePair(QStringList() << tc << QLatin1String(DISPLAYNAME), QVariant(uniqueName));
data << KeyValuePair(QStringList() << tc << QLatin1String(AUTODETECTED), QVariant(true)); data << KeyValuePair(QStringList() << tc << QLatin1String(AUTODETECTED), QVariant(true));
data << KeyValuePair(QStringList() << tc << QLatin1String(PATH), QVariant(path)); data << KeyValuePair(QStringList() << tc << QLatin1String(PATH), QVariant(path));
@@ -280,7 +280,7 @@ QVariantMap AddToolChainOperation::initializeToolChains()
bool AddToolChainOperation::exists(const QVariantMap &map, const QString &id) bool AddToolChainOperation::exists(const QVariantMap &map, const QString &id)
{ {
QStringList valueKeys = FindValueOperation::findValue(map, id.toUtf8()); QStringList valueKeys = FindValueOperation::findValue(map, id);
foreach (const QString &k, valueKeys) { foreach (const QString &k, valueKeys) {
if (k.endsWith(QString(QLatin1Char('/')) + QLatin1String(ID))) { if (k.endsWith(QString(QLatin1Char('/')) + QLatin1String(ID))) {

View File

@@ -131,6 +131,7 @@ bool RmKitOperation::test() const
QLatin1String("Desktop"), QString(), QString(), QLatin1String("Desktop"), QString(), QString(),
QLatin1String("{tc-id}"), QLatin1String("{qt-id}"), QLatin1String("{tc-id}"), QLatin1String("{qt-id}"),
QLatin1String("unsupported/mkspec"), QLatin1String("unsupported/mkspec"),
QStringList(),
KeyValuePairList() << KeyValuePair(QLatin1String("PE.Profile.Data/extraData"), QVariant(QLatin1String("extraValue")))); KeyValuePairList() << KeyValuePair(QLatin1String("PE.Profile.Data/extraData"), QVariant(QLatin1String("extraValue"))));
map = map =
AddKitOperation::addKit(map, tcMap, qtMap, devMap, AddKitOperation::addKit(map, tcMap, qtMap, devMap,
@@ -140,6 +141,7 @@ bool RmKitOperation::test() const
QLatin1String("Desktop"), QString(), QString(), QLatin1String("Desktop"), QString(), QString(),
QLatin1String("{tc-id}"), QLatin1String("{qt-id}"), QLatin1String("{tc-id}"), QLatin1String("{qt-id}"),
QLatin1String("unsupported/mkspec2"), QLatin1String("unsupported/mkspec2"),
QStringList(),
KeyValuePairList() << KeyValuePair(QLatin1String("PE.Profile.Data/extraData"), QVariant(QLatin1String("extraValue2")))); KeyValuePairList() << KeyValuePair(QLatin1String("PE.Profile.Data/extraData"), QVariant(QLatin1String("extraValue2"))));
QVariantMap result = rmKit(map, QLatin1String("testId")); QVariantMap result = rmKit(map, QLatin1String("testId"));

View File

@@ -195,6 +195,11 @@
:Save Changes.Do not Save_QPushButton {text='Do not Save' type='QPushButton' unnamed='1' visible='1' window=':Save Changes_Core::Internal::SaveItemsDialog'} :Save Changes.Do not Save_QPushButton {text='Do not Save' type='QPushButton' unnamed='1' 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.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'} :Save Changes_Core::Internal::SaveItemsDialog {name='Core__Internal__SaveItemsDialog' type='Core::Internal::SaveItemsDialog' visible='1' windowTitle='Save Changes'}
:Select a Git Commit.Show_QPushButton {name='showButton' text='Show' type='QPushButton' visible='1' window=':Select a Git Commit_Git::Internal::ChangeSelectionDialog'}
:Select a Git Commit.changeNumberEdit_Utils::CompletingLineEdit {name='changeNumberEdit' type='Utils::CompletingLineEdit' visible='1' window=':Select a Git Commit_Git::Internal::ChangeSelectionDialog'}
:Select a Git Commit.detailsText_QPlainTextEdit {name='detailsText' type='QPlainTextEdit' visible='1' window=':Select a Git Commit_Git::Internal::ChangeSelectionDialog'}
:Select a Git Commit.workingDirectoryEdit_QLineEdit {name='workingDirectoryEdit' type='QLineEdit' visible='1' window=':Select a Git Commit_Git::Internal::ChangeSelectionDialog'}
:Select a Git Commit_Git::Internal::ChangeSelectionDialog {name='Git__Internal__ChangeSelectionDialog' type='Git::Internal::ChangeSelectionDialog' visible='1' windowTitle='Select a Git Commit'}
: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

@@ -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_codepasting tst_designer_autocomplete tst_designer_edit tst_designer_goto_slot tst_external_sort tst_git_clone tst_git_local TEST_CASES=tst_codepasting tst_designer_autocomplete tst_designer_edit tst_designer_goto_slot tst_external_sort tst_git_clone tst_git_first_commit tst_git_local
VERSION=2 VERSION=2
WRAPPERS=Qt WRAPPERS=Qt

View File

@@ -0,0 +1,69 @@
#############################################################################
##
## Copyright (C) 2015 The Qt Company Ltd.
## Contact: http://www.qt.io/licensing
##
## 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 The Qt Company. For licensing terms and
## conditions see http://www.qt.io/terms-conditions. For further information
## use the contact form at http://www.qt.io/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 or version 3 as published by the Free
## Software Foundation and appearing in the file LICENSE.LGPLv21 and
## LICENSE.LGPLv3 included in the packaging of this file. Please review the
## following information to ensure the GNU Lesser General Public License
## requirements will be met: https://www.gnu.org/licenses/lgpl.html and
## http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
##
## In addition, as a special exception, The Qt Company gives you certain additional
## rights. These rights are described in The Qt Company LGPL Exception
## version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
##
#############################################################################
source("../../shared/qtcreator.py")
def main():
pathReadme = srcPath + "/creator/README"
if not neededFilePresent(pathReadme):
return
startApplication("qtcreator" + SettingsPath)
if not startedWithoutPluginError():
return
invokeMenuItem("File", "Open File or Project...")
selectFromFileDialog(pathReadme)
invokeMenuItem("Tools", "Git", "Actions on Commits...")
pathEdit = waitForObject(":Select a Git Commit.workingDirectoryEdit_QLineEdit")
revEdit = waitForObject(":Select a Git Commit.changeNumberEdit_Utils::CompletingLineEdit")
test.compare(str(pathEdit.displayText), os.path.join(srcPath, "creator").replace("\\", "/"))
test.compare(str(revEdit.displayText), "HEAD")
replaceEditorContent(revEdit, "05c35356abc31549c5db6eba31fb608c0365c2a0") # Initial import
detailsEdit = waitForObject(":Select a Git Commit.detailsText_QPlainTextEdit")
test.verify(detailsEdit.readOnly, "Details view is read only?")
waitFor("str(detailsEdit.plainText) != 'Fetching commit data...'")
commitDetails = str(detailsEdit.plainText)
test.verify("commit 05c35356abc31549c5db6eba31fb608c0365c2a0\n" \
"Author: con <qtc-commiter@nokia.com>" in commitDetails,
"Information header in details view?")
test.verify("Initial import" in commitDetails, "Commit message in details view?")
test.verify("src/plugins/debugger/gdbengine.cpp | 4035 ++++++++++++++++++++"
in commitDetails, "Text file in details view?")
test.verify("src/plugins/find/images/expand.png | Bin 0 -> 931 bytes"
in commitDetails, "Binary file in details view?")
test.verify("1675 files changed, 229938 insertions(+)" in commitDetails,
"Summary in details view?")
clickButton(waitForObject(":Select a Git Commit.Show_QPushButton"))
changedEdit = waitForObject(":Qt Creator_DiffEditor::SideDiffEditorWidget")
waitFor("len(str(changedEdit.plainText)) > 0 and "
"str(changedEdit.plainText) != 'Waiting for data...'", 20000)
test.xverify(str(changedEdit.plainText) != "No difference", "Does Creator show actual changes?")
invokeMenuItem("File", "Exit")