forked from qt-creator/qt-creator
Merge remote-tracking branch 'origin/2.8' into HEAD
Conflicts: qbs/pluginspec/pluginspec.qbs Change-Id: Ic8e992623b9eda8913ee473c779a8df27643ccc9
This commit is contained in:
@@ -18,11 +18,6 @@ Module {
|
||||
var cmd = new JavaScriptCommand();
|
||||
cmd.description = "prepare " + FileInfo.fileName(output.fileName);
|
||||
cmd.highlight = "codegen";
|
||||
cmd.ide_version_major = project.ide_version_major;
|
||||
cmd.ide_version_minor = project.ide_version_minor;
|
||||
cmd.ide_version_release = project.ide_version_release;
|
||||
cmd.qtcreator_version = cmd.ide_version_major + '.' + cmd.ide_version_minor + '.' + cmd.ide_version_release;
|
||||
|
||||
cmd.pluginspecreplacements = product.pluginspecreplacements;
|
||||
cmd.plugin_depends = [];
|
||||
var deps = product.dependencies;
|
||||
@@ -45,16 +40,16 @@ Module {
|
||||
// replace quoted quotes
|
||||
all = all.replace(/\\\"/g, '"');
|
||||
// replace config vars
|
||||
vars['QTCREATOR_VERSION'] = qtcreator_version;
|
||||
vars['IDE_VERSION_MAJOR'] = ide_version_major;
|
||||
vars['IDE_VERSION_MINOR'] = ide_version_minor;
|
||||
vars['IDE_VERSION_RELEASE'] = ide_version_release;
|
||||
vars['QTCREATOR_VERSION'] = project.qtcreator_version;
|
||||
vars['IDE_VERSION_MAJOR'] = project.ide_version_major;
|
||||
vars['IDE_VERSION_MINOR'] = project.ide_version_minor;
|
||||
vars['IDE_VERSION_RELEASE'] = project.ide_version_release;
|
||||
var deplist = ["<dependencyList>"];
|
||||
for (i in plugin_depends) {
|
||||
deplist.push(" <dependency name=\"" + plugin_depends[i] + "\" version=\"" + qtcreator_version + "\"/>");
|
||||
deplist.push(" <dependency name=\"" + plugin_depends[i] + "\" version=\"" + project.qtcreator_version + "\"/>");
|
||||
}
|
||||
for (i in plugin_recommends) {
|
||||
deplist.push(" <dependency name=\"" + plugin_recommends[i] + "\" version=\"" + qtcreator_version + "\" type=\"optional\"/>");
|
||||
deplist.push(" <dependency name=\"" + plugin_recommends[i] + "\" version=\"" + project.qtcreator_version + "\" type=\"optional\"/>");
|
||||
}
|
||||
deplist.push(" </dependencyList>");
|
||||
vars['dependencyList'] = deplist.join("\n");
|
||||
|
||||
@@ -1777,6 +1777,12 @@ class Dumper:
|
||||
self.put('",')
|
||||
return True
|
||||
|
||||
def isReferenceType(self, typeobj):
|
||||
return typeobj.code == gdb.TYPE_CODE_REF
|
||||
|
||||
def isStructType(self, typeobj):
|
||||
return typeobj.code == gdb.TYPE_CODE_STRUCT
|
||||
|
||||
def putPlotData(self, type, base, n, plotFormat):
|
||||
if self.isExpanded():
|
||||
self.putArrayData(type, base, n)
|
||||
|
||||
@@ -73,9 +73,6 @@ DisplayLatin1String, \
|
||||
DisplayUtf8String \
|
||||
= range(7)
|
||||
|
||||
def lookupType(name):
|
||||
return None
|
||||
|
||||
def isSimpleType(typeobj):
|
||||
typeClass = typeobj.GetTypeClass()
|
||||
#warn("TYPECLASS: %s" % typeClass)
|
||||
@@ -179,36 +176,7 @@ def fileName(file):
|
||||
return str(file) if file.IsValid() else ''
|
||||
|
||||
|
||||
PointerCode = None
|
||||
ArrayCode = None
|
||||
StructCode = None
|
||||
UnionCode = None
|
||||
EnumCode = None
|
||||
FlagsCode = None
|
||||
FunctionCode = None
|
||||
IntCode = None
|
||||
FloatCode = None
|
||||
VoidCode = None
|
||||
SetCode = None
|
||||
RangeCode = None
|
||||
StringCode = None
|
||||
BitStringCode = None
|
||||
ErrorTypeCode = None
|
||||
MethodCode = None
|
||||
MethodPointerCode = None
|
||||
MemberPointerCode = None
|
||||
ReferenceCode = None
|
||||
CharCode = None
|
||||
BoolCode = None
|
||||
ComplexCode = None
|
||||
TypedefCode = None
|
||||
NamespaceCode = None
|
||||
SimpleValueCode = None # LLDB only
|
||||
|
||||
|
||||
# Data members
|
||||
SimpleValueCode = 100
|
||||
StructCode = 101
|
||||
PointerCode = 102
|
||||
|
||||
# Breakpoints. Keep synchronized with BreakpointType in breakpoint.h
|
||||
@@ -245,7 +213,7 @@ def checkPointer(p, align = 1):
|
||||
p.Dereference()
|
||||
|
||||
def isNull(p):
|
||||
return long(p) == 0
|
||||
return p.GetValueAsUnsigned() == 0
|
||||
|
||||
Value = lldb.SBValue
|
||||
|
||||
@@ -290,7 +258,16 @@ def impl_SBValue__le__(self, other):
|
||||
|
||||
def impl_SBValue__int__(self):
|
||||
return self.GetValueAsSigned()
|
||||
#return int(self.GetValue(), 0)
|
||||
|
||||
def impl_SBValue__float__(self):
|
||||
error = lldb.SBError()
|
||||
if self.GetType().GetByteSize() == 4:
|
||||
result = self.GetData().GetFloat(error, 0)
|
||||
else:
|
||||
result = self.GetData().GetDouble(error, 0)
|
||||
if error.Success():
|
||||
return result
|
||||
return NotImplemented
|
||||
|
||||
def impl_SBValue__long__(self):
|
||||
return int(self.GetValue(), 0)
|
||||
@@ -318,6 +295,7 @@ lldb.SBValue.__le__ = impl_SBValue__le__
|
||||
|
||||
lldb.SBValue.__getitem__ = impl_SBValue__getitem__
|
||||
lldb.SBValue.__int__ = impl_SBValue__int__
|
||||
lldb.SBValue.__float__ = impl_SBValue__float__
|
||||
lldb.SBValue.__long__ = lambda self: long(self.GetValue(), 0)
|
||||
|
||||
lldb.SBValue.code = lambda self: self.GetTypeClass()
|
||||
@@ -325,12 +303,13 @@ lldb.SBValue.cast = lambda self, typeObj: self.Cast(typeObj)
|
||||
lldb.SBValue.dereference = lambda self: self.Dereference()
|
||||
lldb.SBValue.address = property(lambda self: self.GetAddress())
|
||||
|
||||
lldb.SBType.unqualified = lambda self: self.GetUnqualifiedType()
|
||||
lldb.SBType.pointer = lambda self: self.GetPointerType()
|
||||
lldb.SBType.code = lambda self: self.GetTypeClass()
|
||||
lldb.SBType.sizeof = property(lambda self: self.GetByteSize())
|
||||
|
||||
|
||||
lldb.SBType.unqualified = \
|
||||
lambda self: self.GetUnqualifiedType() if hasattr(self, 'GetUnqualifiedType') else self
|
||||
lldb.SBType.strip_typedefs = \
|
||||
lambda self: self.GetCanonicalType() if hasattr(self, 'GetCanonicalType') else self
|
||||
|
||||
@@ -340,9 +319,6 @@ lldb.SBType.__str__ = lldb.SBType.GetName
|
||||
def simpleEncoding(typeobj):
|
||||
code = typeobj.GetTypeClass()
|
||||
size = typeobj.sizeof
|
||||
#if code == BoolCode or code == CharCode:
|
||||
# return Hex2EncodedInt1
|
||||
#if code == IntCode:
|
||||
if code == lldb.eTypeClassBuiltin:
|
||||
name = str(typeobj)
|
||||
if name == "float":
|
||||
@@ -390,7 +366,7 @@ class Children:
|
||||
#if isSimpleType(childType):
|
||||
# self.d.put('childnumchild="0",')
|
||||
# self.childNumChild = 0
|
||||
#elif childType.code == PointerCode:
|
||||
#elif childType.code == lldb.eTypeClassPointer:
|
||||
# self.d.put('childnumchild="1",')
|
||||
# self.childNumChild = 1
|
||||
else:
|
||||
@@ -469,6 +445,8 @@ class SubItem:
|
||||
self.d.put('{')
|
||||
#if not self.name is None:
|
||||
if isinstance(self.name, str):
|
||||
if self.name == '**&':
|
||||
self.name = '*'
|
||||
self.d.put('name="%s",' % self.name)
|
||||
self.savedIName = self.d.currentIName
|
||||
self.savedCurrentAddress = self.d.currentAddress
|
||||
@@ -597,7 +575,7 @@ class Dumper:
|
||||
|
||||
def templateArgument(self, typeobj, index):
|
||||
type = typeobj.GetTemplateArgumentType(index)
|
||||
if len(type.GetName()):
|
||||
if type.IsValid():
|
||||
return type
|
||||
inner = self.extractTemplateArgument(typeobj.GetName(), index)
|
||||
return self.lookupType(inner)
|
||||
@@ -606,6 +584,12 @@ class Dumper:
|
||||
inner = self.extractTemplateArgument(typeobj.GetName(), index)
|
||||
return int(inner)
|
||||
|
||||
def isReferenceType(self, typeobj):
|
||||
return typeobj.IsReferenceType()
|
||||
|
||||
def isStructType(self, typeobj):
|
||||
return typeobj.GetTypeClass() in (lldb.eTypeClassStruct, lldb.eTypeClassClass)
|
||||
|
||||
def qtVersion(self):
|
||||
return 0x050000
|
||||
|
||||
@@ -678,9 +662,8 @@ class Dumper:
|
||||
return format
|
||||
|
||||
def isMovableType(self, type):
|
||||
if type.code == PointerCode:
|
||||
return True
|
||||
if isSimpleType(type):
|
||||
if type.GetTypeClass() in (lldb.eTypeClassBuiltin,
|
||||
lldb.eTypeClassPointer):
|
||||
return True
|
||||
return self.stripNamespaceFromType(type.GetName()) in movableTypes
|
||||
|
||||
@@ -745,7 +728,7 @@ class Dumper:
|
||||
return True
|
||||
|
||||
def putPlotData(self, type, base, n, plotFormat):
|
||||
warn("PLOTDATA: %s %s" % (type, n))
|
||||
#warn("PLOTDATA: %s %s" % (type, n))
|
||||
if self.isExpanded():
|
||||
self.putArrayData(type, base, n)
|
||||
self.putValue(self.currentValue)
|
||||
@@ -754,7 +737,7 @@ class Dumper:
|
||||
def putArrayData(self, type, base, n,
|
||||
childNumChild = None, maxNumChild = 10000):
|
||||
if not self.tryPutArrayContents(type, base, n):
|
||||
base = base.cast(type.pointer())
|
||||
base = self.createPointerValue(base, type)
|
||||
with Children(self, n, type, childNumChild, maxNumChild,
|
||||
base, type.GetByteSize()):
|
||||
for i in self.childRange():
|
||||
@@ -789,9 +772,14 @@ class Dumper:
|
||||
self.putFields(value)
|
||||
|
||||
def lookupType(self, name):
|
||||
if name.endswith('*'):
|
||||
type = self.lookupType(name[:-1].strip())
|
||||
return type.GetPointerType() if type.IsValid() else None
|
||||
#warn("LOOKUP TYPE NAME: %s" % name)
|
||||
#warn("LOOKUP RESULT: %s" % self.target.FindFirstType(name))
|
||||
return self.target.FindFirstType(name)
|
||||
#warn("LOOKUP RESULT: %s" % self.target.FindFirstType(name))
|
||||
type = self.target.FindFirstType(name)
|
||||
return type if type.IsValid() else None
|
||||
|
||||
def setupInferior(self, args):
|
||||
executable = args['executable']
|
||||
@@ -942,6 +930,17 @@ class Dumper:
|
||||
contents = self.process.ReadMemory(base, size, error)
|
||||
return binascii.hexlify(contents)
|
||||
|
||||
def isQObject(self, value):
|
||||
try:
|
||||
vtable = value.Cast(self.voidPtrType().GetPointerType())
|
||||
metaObjectEntry = vtable.Dereference()
|
||||
addr = lldb.SBAddress(long(metaObjectEntry), self.target)
|
||||
symbol = addr.GetSymbol()
|
||||
name = symbol.GetMangledName()
|
||||
return name.find("10metaObjectEv") > 0
|
||||
except:
|
||||
return False
|
||||
|
||||
def computeLimit(self, size, limit):
|
||||
if limit is None:
|
||||
return size
|
||||
@@ -967,6 +966,10 @@ class Dumper:
|
||||
pos1 = type.rfind(">", pos)
|
||||
type = type[0:pos] + type[pos1+1:]
|
||||
pos = type.find("<")
|
||||
if type.startswith("const "):
|
||||
type = type[6:]
|
||||
if type.startswith("volatile "):
|
||||
type = type[9:]
|
||||
return type
|
||||
|
||||
def putSubItem(self, component, value, tryDynamic=True):
|
||||
@@ -987,6 +990,7 @@ class Dumper:
|
||||
#value = value.GetDynamicValue(lldb.eDynamicCanRunTarget)
|
||||
typeName = value.GetTypeName()
|
||||
value.SetPreferDynamicValue(tryDynamic)
|
||||
typeClass = value.GetType().GetTypeClass()
|
||||
|
||||
if tryDynamic:
|
||||
self.putAddress(value.address)
|
||||
@@ -1016,33 +1020,49 @@ class Dumper:
|
||||
self.putItem(child)
|
||||
return
|
||||
|
||||
# Typedefs
|
||||
if typeClass == lldb.eTypeClassTypedef:
|
||||
if typeName in qqDumpers:
|
||||
self.putType(typeName)
|
||||
self.context = value
|
||||
qqDumpers[typeName](self, value)
|
||||
return
|
||||
realType = value.GetType()
|
||||
if hasattr(realType, 'GetCanonicalType'):
|
||||
realType = realType.GetCanonicalType()
|
||||
value = value.Cast(realType.unqualified())
|
||||
self.putItem(value)
|
||||
self.putBetterType(typeName)
|
||||
return
|
||||
|
||||
# Our turf now.
|
||||
value.SetPreferSyntheticValue(False)
|
||||
|
||||
# Arrays
|
||||
if value.GetType().GetTypeClass() == lldb.eTypeClassArray:
|
||||
if typeClass == lldb.eTypeClassArray:
|
||||
qdump____c_style_array__(self, value)
|
||||
return
|
||||
|
||||
# References
|
||||
if value.GetType().IsReferenceType():
|
||||
origType = value.GetTypeName();
|
||||
type = value.GetType().GetDereferencedType()
|
||||
addr = int(value.GetAddress()) & 0xFFFFFFFFFFFFFFFF
|
||||
type = value.GetType().GetDereferencedType().unqualified()
|
||||
addr = int(value) & 0xFFFFFFFFFFFFFFFF
|
||||
self.putItem(value.CreateValueFromAddress(None, addr, type))
|
||||
#self.putItem(value.CreateValueFromData(None, value.GetData(), type))
|
||||
self.putBetterType(origType)
|
||||
return
|
||||
|
||||
# Pointers
|
||||
if value.GetType().IsPointerType() and self.autoDerefPointers:
|
||||
|
||||
if value.GetType().IsPointerType():
|
||||
if isNull(value):
|
||||
self.putType(typeName)
|
||||
self.putValue("0x0")
|
||||
self.putNumChild(0)
|
||||
return
|
||||
|
||||
innerType = value.GetType().GetPointeeType()
|
||||
if self.autoDerefPointers:
|
||||
innerType = value.GetType().GetPointeeType().unqualified()
|
||||
self.putType(innerType)
|
||||
savedCurrentChildType = self.currentChildType
|
||||
self.currentChildType = str(innerType)
|
||||
@@ -1053,6 +1073,20 @@ class Dumper:
|
||||
self.put('origaddr="%s",' % value.address)
|
||||
return
|
||||
|
||||
else:
|
||||
numchild = value.GetNumChildren()
|
||||
self.put('iname="%s",' % self.currentIName)
|
||||
self.putType(typeName)
|
||||
self.putValue('0x%x' % value.GetValueAsUnsigned())
|
||||
self.put('numchild="1",')
|
||||
self.put('addr="0x%x",' % value.GetLoadAddress())
|
||||
if self.currentIName in self.expandedINames:
|
||||
with Children(self):
|
||||
child = value.Dereference()
|
||||
with SubItem(self, child):
|
||||
self.putItem(child)
|
||||
|
||||
|
||||
#warn("VALUE: %s" % value)
|
||||
#warn("FANCY: %s" % self.useFancy)
|
||||
if self.useFancy:
|
||||
@@ -1066,12 +1100,24 @@ class Dumper:
|
||||
return
|
||||
|
||||
# Normal value
|
||||
v = value.GetValue()
|
||||
#numchild = 1 if value.MightHaveChildren() else 0
|
||||
numchild = value.GetNumChildren()
|
||||
self.put('iname="%s",' % self.currentIName)
|
||||
self.putType(typeName)
|
||||
self.putValue('' if v is None else v)
|
||||
if typeClass == lldb.eTypeClassStruct or typeClass == lldb.eTypeClassClass:
|
||||
if self.isQObject(value):
|
||||
self.context = value
|
||||
if not self.putQObjectNameValue(value): # Is this too expensive?
|
||||
self.putEmptyValue()
|
||||
else:
|
||||
self.putEmptyValue()
|
||||
else:
|
||||
v = value.GetValue()
|
||||
if v:
|
||||
self.putValue(v)
|
||||
else:
|
||||
self.putEmptyValue()
|
||||
|
||||
self.put('numchild="%s",' % numchild)
|
||||
self.put('addr="0x%x",' % value.GetLoadAddress())
|
||||
if self.currentIName in self.expandedINames:
|
||||
@@ -1079,6 +1125,14 @@ class Dumper:
|
||||
self.putFields(value)
|
||||
|
||||
def putFields(self, value):
|
||||
# Suppress printing of 'name' field for arrays.
|
||||
if value.GetType().GetTypeClass() == lldb.eTypeClassArray:
|
||||
for i in xrange(value.GetNumChildren()):
|
||||
child = value.GetChildAtIndex(i)
|
||||
with UnnamedSubItem(self, "%d" % (i + 1)):
|
||||
self.putItem(child)
|
||||
return
|
||||
|
||||
n = value.GetNumChildren()
|
||||
m = value.GetType().GetNumberOfDirectBaseClasses()
|
||||
if n > 10000:
|
||||
@@ -1094,6 +1148,7 @@ class Dumper:
|
||||
self.putItem(child)
|
||||
for i in xrange(m, n):
|
||||
child = value.GetChildAtIndex(i)
|
||||
if child.IsValid(): # FIXME: Anon members?
|
||||
with SubItem(self, child):
|
||||
self.putItem(child)
|
||||
|
||||
|
||||
+172
-136
@@ -161,7 +161,7 @@ def qPutQObjectNameValue(d, value):
|
||||
# - QDynamicMetaObjectData *metaObject;
|
||||
extra = d.dereference(dd + 5 * ptrSize + 2 * intSize)
|
||||
if extra == 0:
|
||||
return
|
||||
return False
|
||||
|
||||
# Offset of objectName in ExtraData: 6 pointer
|
||||
# - QVector<QObjectUserData *> userData; only #ifndef QT_NO_USERDATA
|
||||
@@ -174,9 +174,12 @@ def qPutQObjectNameValue(d, value):
|
||||
|
||||
data, size, alloc = qByteArrayData(d, objectName)
|
||||
|
||||
if size > 0:
|
||||
if size == 0:
|
||||
return False
|
||||
|
||||
str = d.readRawMemory(data, 2 * size)
|
||||
d.putValue(str, Hex4EncodedLittleEndian, 1)
|
||||
return True
|
||||
|
||||
except:
|
||||
pass
|
||||
@@ -187,24 +190,24 @@ Dumper.putQObjectNameValue = qPutQObjectNameValue
|
||||
|
||||
|
||||
def qdump__QAtomicInt(d, value):
|
||||
d.putValue(value["_q_value"])
|
||||
d.putValue(int(value["_q_value"]))
|
||||
d.putNumChild(0)
|
||||
|
||||
|
||||
def qdump__QBasicAtomicInt(d, value):
|
||||
d.putValue(value["_q_value"])
|
||||
d.putValue(int(value["_q_value"]))
|
||||
d.putNumChild(0)
|
||||
|
||||
|
||||
def qdump__QBasicAtomicPointer(d, value):
|
||||
def qdump__QAtomicPointer(d, value):
|
||||
d.putType(value.type)
|
||||
p = cleanAddress(value["_q_value"])
|
||||
d.putValue(p)
|
||||
d.putPointerValue(value.address)
|
||||
d.putNumChild(p)
|
||||
q = value["_q_value"]
|
||||
p = int(q)
|
||||
d.putValue("@0x%x" % p)
|
||||
d.putNumChild(1 if p else 0)
|
||||
if d.isExpanded():
|
||||
with Children(d):
|
||||
d.putItem(value["_q_value"])
|
||||
d.putSubItem("_q_value", q.dereference())
|
||||
|
||||
def qform__QByteArray():
|
||||
return "Inline,As Latin1 in Separate Window,As UTF-8 in Separate Window"
|
||||
@@ -370,16 +373,15 @@ def qdump__QDate(d, value):
|
||||
|
||||
|
||||
def qdump__QTime(d, value):
|
||||
mds = value["mds"]
|
||||
if int(mds) >= 0:
|
||||
d.putValue(value["mds"], MillisecondsSinceMidnight)
|
||||
mds = int(value["mds"])
|
||||
if mds >= 0:
|
||||
d.putValue(mds, MillisecondsSinceMidnight)
|
||||
d.putNumChild(1)
|
||||
if d.isExpanded():
|
||||
qtdate = d.ns + "Qt::"
|
||||
qttime = d.ns + "Qt::"
|
||||
if lldbLoaded:
|
||||
qtdate += "DateFormat::" # FIXME: Bug?...
|
||||
qttime += "TimeSpec::"
|
||||
# FIXME: This improperly uses complex return values.
|
||||
with Children(d):
|
||||
d.putCallItem("toString", value, "toString", qtdate + "TextDate")
|
||||
@@ -387,7 +389,6 @@ def qdump__QTime(d, value):
|
||||
d.putCallItem("(SystemLocale)", value, "toString",
|
||||
qtdate + "SystemLocaleDate")
|
||||
d.putCallItem("(Locale)", value, "toString", qtdate + "LocaleDate")
|
||||
d.putCallItem("toUTC", value, "toTimeSpec", qttime + "UTC")
|
||||
else:
|
||||
d.putValue("(invalid)")
|
||||
d.putNumChild(0)
|
||||
@@ -621,42 +622,41 @@ def qform__QHash():
|
||||
|
||||
def qdump__QHash(d, value):
|
||||
|
||||
def hashDataFirstNode(value):
|
||||
val = value.cast(hashDataType)
|
||||
bucket = val["buckets"]
|
||||
e = val.cast(hashNodeType)
|
||||
for n in xrange(int(val["numBuckets"]) - 1, -1, -1):
|
||||
def hashDataFirstNode(dPtr, numBuckets):
|
||||
ePtr = dPtr.cast(nodeTypePtr)
|
||||
bucket = dPtr.dereference()["buckets"]
|
||||
for n in xrange(numBuckets - 1, -1, -1):
|
||||
n = n - 1
|
||||
if n < 0:
|
||||
break
|
||||
if bucket.dereference() != e:
|
||||
if pointerValue(bucket.dereference()) != pointerValue(ePtr):
|
||||
return bucket.dereference()
|
||||
bucket = bucket + 1
|
||||
return e;
|
||||
return ePtr;
|
||||
|
||||
def hashDataNextNode(node):
|
||||
next = node["next"]
|
||||
if next["next"]:
|
||||
return next
|
||||
d = node.cast(hashDataType.pointer()).dereference()
|
||||
numBuckets = int(d["numBuckets"])
|
||||
start = (int(node["h"]) % numBuckets) + 1
|
||||
bucket = d["buckets"] + start
|
||||
def hashDataNextNode(nodePtr, numBuckets):
|
||||
nextPtr = nodePtr.dereference()["next"]
|
||||
if pointerValue(nextPtr.dereference()["next"]):
|
||||
return nextPtr
|
||||
start = (int(nodePtr.dereference()["h"]) % numBuckets) + 1
|
||||
dPtr = nextPtr.cast(dataTypePtr)
|
||||
bucket = dPtr.dereference()["buckets"] + start
|
||||
for n in xrange(numBuckets - start):
|
||||
if bucket.dereference() != next:
|
||||
if pointerValue(bucket.dereference()) != pointerValue(nextPtr):
|
||||
return bucket.dereference()
|
||||
bucket += 1
|
||||
return node
|
||||
return nextPtr
|
||||
|
||||
keyType = d.templateArgument(value.type, 0)
|
||||
valueType = d.templateArgument(value.type, 1)
|
||||
|
||||
d_ptr = value["d"]
|
||||
e_ptr = value["e"]
|
||||
anon = childAt(value, 0)
|
||||
d_ptr = anon["d"]
|
||||
e_ptr = anon["e"]
|
||||
size = int(d_ptr["size"])
|
||||
|
||||
hashDataType = d_ptr.type
|
||||
hashNodeType = e_ptr.type
|
||||
dataTypePtr = d_ptr.type # QHashData * = { Node *fakeNext, Node *buckets }
|
||||
nodeTypePtr = d_ptr.dereference()["fakeNext"].type # QHashData::Node
|
||||
|
||||
check(0 <= size and size <= 100 * 1000 * 1000)
|
||||
checkRef(d_ptr["ref"])
|
||||
@@ -664,15 +664,14 @@ def qdump__QHash(d, value):
|
||||
d.putItemCount(size)
|
||||
d.putNumChild(size)
|
||||
if d.isExpanded():
|
||||
isCompact = d.isMapCompact(keyType, valueType)
|
||||
node = hashDataFirstNode(value)
|
||||
numBuckets = int(d_ptr.dereference()["numBuckets"])
|
||||
nodePtr = hashDataFirstNode(d_ptr, numBuckets)
|
||||
innerType = e_ptr.dereference().type
|
||||
childType = innerType
|
||||
if isCompact:
|
||||
childType = valueType
|
||||
isCompact = d.isMapCompact(keyType, valueType)
|
||||
childType = valueType if isCompact else innerType
|
||||
with Children(d, size, maxNumChild=1000, childType=childType):
|
||||
for i in d.childRange():
|
||||
it = node.dereference().cast(innerType)
|
||||
it = nodePtr.dereference().cast(innerType)
|
||||
with SubItem(d, i):
|
||||
if isCompact:
|
||||
d.putMapName(it["key"])
|
||||
@@ -680,7 +679,7 @@ def qdump__QHash(d, value):
|
||||
d.putType(valueType)
|
||||
else:
|
||||
d.putItem(it)
|
||||
node = hashDataNextNode(node)
|
||||
nodePtr = hashDataNextNode(nodePtr, numBuckets)
|
||||
|
||||
|
||||
def qdump__QHashNode(d, value):
|
||||
@@ -844,20 +843,21 @@ def qdump__QImage(d, value):
|
||||
|
||||
|
||||
def qdump__QLinkedList(d, value):
|
||||
d_ptr = value["d"]
|
||||
e_ptr = value["e"]
|
||||
n = int(d_ptr["size"])
|
||||
dd = d.dereferenceValue(value)
|
||||
ptrSize = d.ptrSize()
|
||||
n = d.extractInt(dd + 4 + 2 * ptrSize);
|
||||
ref = d.extractInt(dd + 2 * ptrSize);
|
||||
check(0 <= n and n <= 100*1000*1000)
|
||||
checkRef(d_ptr["ref"])
|
||||
check(-1 <= ref and ref <= 1000)
|
||||
d.putItemCount(n)
|
||||
d.putNumChild(n)
|
||||
if d.isExpanded():
|
||||
innerType = d.templateArgument(value.type, 0)
|
||||
with Children(d, n, maxNumChild=1000, childType=innerType):
|
||||
p = e_ptr["n"]
|
||||
pp = d.dereference(dd)
|
||||
for i in d.childRange():
|
||||
d.putSubItem(i, p["t"])
|
||||
p = p["n"]
|
||||
d.putSubItem(i, d.createValue(pp + 2 * ptrSize, innerType))
|
||||
pp = d.dereference(pp)
|
||||
|
||||
qqLocalesCount = None
|
||||
|
||||
@@ -976,6 +976,8 @@ def qdumpHelper__Qt5_QMap(d, value, forceLong):
|
||||
keyType = d.templateArgument(value.type, 0)
|
||||
valueType = d.templateArgument(value.type, 1)
|
||||
isCompact = d.isMapCompact(keyType, valueType)
|
||||
# Note: The space in the QMapNode lookup below is
|
||||
# important for LLDB.
|
||||
nodeType = d.lookupType(d.ns + "QMapNode<%s, %s>" % (keyType, valueType))
|
||||
if isCompact:
|
||||
innerType = valueType
|
||||
@@ -1479,8 +1481,8 @@ def qdump__QObject(d, value):
|
||||
def qdump__QPixmap(d, value):
|
||||
offset = (3 if d.qtVersion() >= 0x050000 else 2) * d.ptrSize()
|
||||
base = d.dereference(d.addressOf(value) + offset)
|
||||
width = d.extractInt(base + 4)
|
||||
height = d.extractInt(base + 8)
|
||||
width = d.extractInt(base + d.ptrSize())
|
||||
height = d.extractInt(base + d.ptrSize() + 4)
|
||||
d.putValue("(%dx%d)" % (width, height))
|
||||
d.putNumChild(0)
|
||||
|
||||
@@ -1509,10 +1511,10 @@ def qdump__QRect(d, value):
|
||||
def pp(l):
|
||||
if l >= 0: return "+%s" % l
|
||||
return l
|
||||
x1 = value["x1"]
|
||||
y1 = value["y1"]
|
||||
x2 = value["x2"]
|
||||
y2 = value["y2"]
|
||||
x1 = int(value["x1"])
|
||||
y1 = int(value["y1"])
|
||||
x2 = int(value["x2"])
|
||||
y2 = int(value["y2"])
|
||||
w = x2 - x1 + 1
|
||||
h = y2 - y1 + 1
|
||||
d.putValue("%sx%s%s%s" % (w, h, pp(x1), pp(y1)))
|
||||
@@ -1526,15 +1528,10 @@ def qdump__QRectF(d, value):
|
||||
def pp(l):
|
||||
if l >= 0: return "+%s" % l
|
||||
return l
|
||||
x = value["xp"]
|
||||
y = value["yp"]
|
||||
w = value["w"]
|
||||
h = value["h"]
|
||||
# FIXME: workaround, see QPoint
|
||||
x = x.cast(x.type.strip_typedefs())
|
||||
y = y.cast(y.type.strip_typedefs())
|
||||
w = w.cast(w.type.strip_typedefs())
|
||||
h = h.cast(h.type.strip_typedefs())
|
||||
x = float(value["xp"])
|
||||
y = float(value["yp"])
|
||||
w = float(value["w"])
|
||||
h = float(value["h"])
|
||||
d.putValue("%sx%s%s%s" % (w, h, pp(x), pp(y)))
|
||||
d.putNumChild(4)
|
||||
if d.isExpanded():
|
||||
@@ -1603,41 +1600,37 @@ def qdump__QScopedPointer(d, value):
|
||||
|
||||
def qdump__QSet(d, value):
|
||||
|
||||
def hashDataFirstNode(value):
|
||||
val = value.cast(hashDataType)
|
||||
bucket = val["buckets"]
|
||||
e = value.cast(hashNodeType)
|
||||
for n in xrange(val["numBuckets"] - 1, -1, -1):
|
||||
def hashDataFirstNode(dPtr, numBuckets):
|
||||
ePtr = dPtr.cast(nodeTypePtr)
|
||||
bucket = dPtr["buckets"]
|
||||
for n in xrange(numBuckets - 1, -1, -1):
|
||||
n = n - 1
|
||||
if n < 0:
|
||||
break
|
||||
if bucket.dereference() != e:
|
||||
if pointerValue(bucket.dereference()) != pointerValue(ePtr):
|
||||
return bucket.dereference()
|
||||
bucket = bucket + 1
|
||||
return e
|
||||
return ePtr
|
||||
|
||||
def hashDataNextNode(node):
|
||||
next = node["next"]
|
||||
if next["next"]:
|
||||
return next
|
||||
d = node.cast(hashDataType.pointer()).dereference()
|
||||
numBuckets = d["numBuckets"]
|
||||
start = (node["h"] % numBuckets) + 1
|
||||
bucket = d["buckets"] + start
|
||||
def hashDataNextNode(nodePtr, numBuckets):
|
||||
nextPtr = nodePtr.dereference()["next"]
|
||||
if pointerValue(nextPtr.dereference()["next"]):
|
||||
return nextPtr
|
||||
dPtr = nodePtr.cast(hashDataType.pointer()).dereference()
|
||||
start = (int(nodePtr.dereference()["h"]) % numBuckets) + 1
|
||||
bucket = dPtr.dereference()["buckets"] + start
|
||||
for n in xrange(numBuckets - start):
|
||||
if bucket.dereference() != next:
|
||||
if pointerValue(bucket.dereference()) != pointerValue(nextPtr):
|
||||
return bucket.dereference()
|
||||
bucket += 1
|
||||
return node
|
||||
return nodePtr
|
||||
|
||||
keyType = d.templateArgument(value.type, 0)
|
||||
|
||||
d_ptr = value["q_hash"]["d"]
|
||||
e_ptr = value["q_hash"]["e"]
|
||||
size = int(d_ptr["size"])
|
||||
|
||||
hashDataType = d_ptr.type
|
||||
hashNodeType = e_ptr.type
|
||||
anon = childAt(value, 0)
|
||||
if lldbLoaded: # Skip the inheritance level.
|
||||
anon = childAt(anon, 0)
|
||||
d_ptr = anon["d"]
|
||||
e_ptr = anon["e"]
|
||||
size = int(d_ptr.dereference()["size"])
|
||||
|
||||
check(0 <= size and size <= 100 * 1000 * 1000)
|
||||
checkRef(d_ptr["ref"])
|
||||
@@ -1645,21 +1638,17 @@ def qdump__QSet(d, value):
|
||||
d.putItemCount(size)
|
||||
d.putNumChild(size)
|
||||
if d.isExpanded():
|
||||
isSimpleKey = isSimpleType(keyType)
|
||||
node = hashDataFirstNode(value)
|
||||
hashDataType = d_ptr.type
|
||||
nodeTypePtr = d_ptr.dereference()["fakeNext"].type
|
||||
numBuckets = int(d_ptr.dereference()["numBuckets"])
|
||||
node = hashDataFirstNode(d_ptr, numBuckets)
|
||||
innerType = e_ptr.dereference().type
|
||||
with Children(d, size, maxNumChild=1000, childType=innerType):
|
||||
for i in xrange(size):
|
||||
for i in d.childRange():
|
||||
it = node.dereference().cast(innerType)
|
||||
with SubItem(d, i):
|
||||
key = it["key"]
|
||||
if isSimpleKey:
|
||||
d.putType(keyType)
|
||||
d.putItem(key)
|
||||
d.putName(key)
|
||||
else:
|
||||
d.putItem(key)
|
||||
node = hashDataNextNode(node)
|
||||
d.putItem(it["key"])
|
||||
node = hashDataNextNode(node, numBuckets)
|
||||
|
||||
|
||||
def qdump__QSharedData(d, value):
|
||||
@@ -1691,8 +1680,8 @@ def qdump__QSharedPointer(d, value):
|
||||
|
||||
|
||||
def qdump__QSize(d, value):
|
||||
w = value["wd"]
|
||||
h = value["ht"]
|
||||
w = int(value["wd"])
|
||||
h = int(value["ht"])
|
||||
d.putValue("(%s, %s)" % (w, h))
|
||||
d.putNumChild(2)
|
||||
if d.isExpanded():
|
||||
@@ -1701,7 +1690,13 @@ def qdump__QSize(d, value):
|
||||
|
||||
|
||||
def qdump__QSizeF(d, value):
|
||||
qdump__QSize(d, value)
|
||||
w = float(value["wd"])
|
||||
h = float(value["ht"])
|
||||
d.putValue("(%s, %s)" % (w, h))
|
||||
d.putNumChild(2)
|
||||
if d.isExpanded():
|
||||
with Children(d):
|
||||
d.putFields(value)
|
||||
|
||||
|
||||
def qdump__QStack(d, value):
|
||||
@@ -1852,27 +1847,27 @@ def qdumpHelper_QVariant_1(d, data):
|
||||
def qdumpHelper_QVariant_2(d, data):
|
||||
# QVariant::Int
|
||||
d.putBetterType("%sQVariant (int)" % d.ns)
|
||||
d.putValue(data["i"])
|
||||
d.putValue(int(data["i"]))
|
||||
|
||||
def qdumpHelper_QVariant_3(d, data):
|
||||
# uint
|
||||
d.putBetterType("%sQVariant (uint)" % d.ns)
|
||||
d.putValue(data["u"])
|
||||
d.putValue(int(data["u"]))
|
||||
|
||||
def qdumpHelper_QVariant_4(d, data):
|
||||
# qlonglong
|
||||
d.putBetterType("%sQVariant (qlonglong)" % d.ns)
|
||||
d.putValue(data["ll"])
|
||||
d.putValue(int(data["ll"]))
|
||||
|
||||
def qdumpHelper_QVariant_5(d, data):
|
||||
# qulonglong
|
||||
d.putBetterType("%sQVariant (qulonglong)" % d.ns)
|
||||
d.putValue(data["ull"])
|
||||
d.putValue(int(data["ull"]))
|
||||
|
||||
def qdumpHelper_QVariant_6(d, data):
|
||||
# QVariant::Double
|
||||
d.putBetterType("%sQVariant (double)" % d.ns)
|
||||
d.putValue(data["d"])
|
||||
d.putValue(float(data["d"]))
|
||||
|
||||
qdumpHelper_QVariants_A = [
|
||||
qdumpHelper_QVariant_0,
|
||||
@@ -1970,10 +1965,10 @@ def qdumpHelper__QVariant(d, value):
|
||||
|
||||
if len(inner):
|
||||
innerType = d.lookupType(inner)
|
||||
sizePD = d.lookupType(d.ns + 'QVariant::Private::Data').sizeof
|
||||
sizePD = 8 # sizeof(QVariant::Private::Data)
|
||||
if innerType.sizeof > sizePD:
|
||||
sizePS = d.lookupType(d.ns + 'QVariant::PrivateShared').sizeof
|
||||
val = (sizePS + data.cast(d.charPtrType())) \
|
||||
sizePS = 2 * d.ptrSize() # sizeof(QVariant::PrivateShared)
|
||||
val = (data.cast(d.charPtrType()) + sizePS) \
|
||||
.cast(innerType.pointer()).dereference()
|
||||
else:
|
||||
val = data.cast(innerType)
|
||||
@@ -1992,9 +1987,14 @@ def qdump__QVariant(d, value):
|
||||
|
||||
if len(inner):
|
||||
innerType = d.lookupType(inner)
|
||||
# FIXME: Why "shared"?
|
||||
if innerType.sizeof > d_data.type.sizeof:
|
||||
v = d_data["shared"]["ptr"].cast(innerType.pointer()).dereference()
|
||||
# FIXME:
|
||||
#if int(d_ptr["is_shared"]):
|
||||
# v = d_data["ptr"].cast(innerType.pointer().pointer().pointer()) \
|
||||
# .dereference().dereference().dereference()
|
||||
#else:
|
||||
v = d_data["ptr"].cast(innerType.pointer().pointer()) \
|
||||
.dereference().dereference()
|
||||
else:
|
||||
v = d_data.cast(innerType)
|
||||
d.putEmptyValue(-99)
|
||||
@@ -2003,12 +2003,13 @@ def qdump__QVariant(d, value):
|
||||
return innert
|
||||
|
||||
# User types.
|
||||
typeCode = int(d_ptr["type"])
|
||||
if gdbLoaded:
|
||||
type = str(call(value, "typeToName",
|
||||
"('%sQVariant::Type')%d" % (d.ns, d_ptr["type"])))
|
||||
"('%sQVariant::Type')%d" % (d.ns, typeCode)))
|
||||
if lldbLoaded:
|
||||
type = str(call(value, "typeToName",
|
||||
"(%sQVariant::Type)%d" % (d.ns, d_ptr["type"])))
|
||||
"(%sQVariant::Type)%d" % (d.ns, typeCode)))
|
||||
type = type[type.find('"') + 1 : type.rfind('"')]
|
||||
type = type.replace("Q", d.ns + "Q") # HACK!
|
||||
type = type.replace("uint", "unsigned int") # HACK!
|
||||
@@ -2147,7 +2148,11 @@ def qdump__std__array(d, value):
|
||||
d.putNumChild(size)
|
||||
if d.isExpanded():
|
||||
innerType = d.templateArgument(value.type, 0)
|
||||
d.putArrayData(innerType, value.address, size)
|
||||
d.putArrayData(innerType, d.addressOf(value), size)
|
||||
|
||||
|
||||
def qdump__std____1__array(d, value):
|
||||
qdump__std__array(d, value)
|
||||
|
||||
|
||||
def qdump__std__complex(d, value):
|
||||
@@ -2201,14 +2206,14 @@ def qdump__std____debug__deque(d, value):
|
||||
|
||||
|
||||
def qdump__std__list(d, value):
|
||||
head = d.dereferenceValue(value)
|
||||
impl = value["_M_impl"]
|
||||
node = impl["_M_node"]
|
||||
head = node.address
|
||||
size = 0
|
||||
p = node["_M_next"]
|
||||
while p != head and size <= 1001:
|
||||
pp = d.dereference(head)
|
||||
while head != pp and size <= 1001:
|
||||
size += 1
|
||||
p = p["_M_next"]
|
||||
pp = d.dereference(pp)
|
||||
|
||||
d.putItemCount(size, 1000)
|
||||
d.putNumChild(size)
|
||||
@@ -2381,9 +2386,11 @@ def qdump__std__string(d, value):
|
||||
refcount = int(sizePtr[-1])
|
||||
check(refcount >= -1) # Can be -1 accoring to docs.
|
||||
check(0 <= size and size <= alloc and alloc <= 100*1000*1000)
|
||||
qdump_stringHelper(d, sizePtr, size * charSize, charSize)
|
||||
|
||||
n = min(size, qqStringCutOff)
|
||||
mem = d.readRawMemory(data, n * charSize)
|
||||
def qdump_stringHelper(d, data, size, charSize):
|
||||
cutoff = min(size, qqStringCutOff)
|
||||
mem = d.readRawMemory(data, cutoff)
|
||||
if charSize == 1:
|
||||
encodingType = Hex2EncodedLatin1
|
||||
displayType = DisplayLatin1String
|
||||
@@ -2403,15 +2410,26 @@ def qdump__std__string(d, value):
|
||||
elif format == 2:
|
||||
d.putField("editformat", displayType)
|
||||
if n != size:
|
||||
mem = d.readRawMemory(p, size * charType.sizeof)
|
||||
mem = d.readRawMemory(p, size)
|
||||
d.putField("editvalue", mem)
|
||||
|
||||
#def qdump__std__string(d, value):
|
||||
# data = value["__r_"]
|
||||
# d.putValue("SSSS")
|
||||
# d.putType("std::string")
|
||||
# d.putNumChild(1)
|
||||
# d.putPlainChildren(value)
|
||||
|
||||
def qdump__std____1__string(d, value):
|
||||
inner = childAt(childAt(value["__r_"]["__first_"], 0), 0)
|
||||
size = int(inner["__size_"])
|
||||
alloc = int(inner["__cap_"])
|
||||
data = pointerValue(inner["__data_"])
|
||||
qdump_stringHelper(d, data, size, 1)
|
||||
d.putType("std::string")
|
||||
|
||||
|
||||
def qdump__std____1__wstring(d, value):
|
||||
inner = childAt(childAt(value["__r_"]["__first_"], 0), 0)
|
||||
size = int(inner["__size_"]) * 4
|
||||
alloc = int(inner["__cap_"])
|
||||
data = pointerValue(inner["__data_"])
|
||||
qdump_stringHelper(d, data, size, 4)
|
||||
d.putType("std::wstring")
|
||||
|
||||
|
||||
def qdump__std__shared_ptr(d, value):
|
||||
@@ -2501,6 +2519,24 @@ def qdump__std__vector(d, value):
|
||||
else:
|
||||
d.putArrayData(type, start, size)
|
||||
|
||||
def qdump__std____1__vector(d, value):
|
||||
innerType = d.templateArgument(value.type, 0)
|
||||
if lldbLoaded and childAt(value, 0).type == innerType:
|
||||
# That's old lldb automatically formatting
|
||||
begin = d.dereferenceValue(value)
|
||||
size = value.GetNumChildren()
|
||||
else:
|
||||
# Normal case
|
||||
begin = pointerValue(value['__begin_'])
|
||||
end = pointerValue(value['__end_'])
|
||||
size = (end - begin) / innerType.sizeof
|
||||
|
||||
d.putItemCount(size)
|
||||
d.putNumChild(size)
|
||||
if d.isExpanded():
|
||||
d.putArrayData(innerType, begin, size)
|
||||
|
||||
|
||||
def qdump__std____debug__vector(d, value):
|
||||
qdump__std__vector(d, value)
|
||||
|
||||
@@ -2557,12 +2593,12 @@ def qdump____gnu_cxx__hash_set(d, value):
|
||||
#######################################################################
|
||||
|
||||
def qdump__boost__bimaps__bimap(d, value):
|
||||
leftType = d.templateArgument(value.type, 0)
|
||||
rightType = d.templateArgument(value.type, 1)
|
||||
size = value["core"]["node_count"]
|
||||
#leftType = d.templateArgument(value.type, 0)
|
||||
#rightType = d.templateArgument(value.type, 1)
|
||||
size = int(value["core"]["node_count"])
|
||||
d.putItemCount(size)
|
||||
d.putNumChild(size)
|
||||
#if d.isExpanded():
|
||||
if d.isExpanded():
|
||||
d.putPlainChildren(value)
|
||||
|
||||
|
||||
@@ -2573,7 +2609,7 @@ def qdump__boost__optional(d, value):
|
||||
else:
|
||||
type = d.templateArgument(value.type, 0)
|
||||
storage = value["m_storage"]
|
||||
if type.code == ReferenceCode:
|
||||
if d.isReferenceType(type):
|
||||
d.putItem(storage.cast(type.target().pointer()).dereference())
|
||||
else:
|
||||
d.putItem(storage.cast(type))
|
||||
@@ -2925,7 +2961,7 @@ def qdump__Eigen__Matrix(d, value):
|
||||
nrows = value["m_storage"]["m_rows"] if argRow == -1 else int(argRow)
|
||||
ncols = value["m_storage"]["m_cols"] if argCol == -1 else int(argCol)
|
||||
p = storage["m_data"]
|
||||
if p.type.code == StructCode: # Static
|
||||
if d.isStructType(p.type): # Static
|
||||
p = p["array"].cast(innerType.pointer())
|
||||
d.putValue("(%s x %s), %s" % (nrows, ncols, ["ColumnMajor", "RowMajor"][rowMajor]))
|
||||
d.putField("keeporder", "1")
|
||||
|
||||
@@ -50,6 +50,9 @@ int main(int argc, char *argv[])
|
||||
// Since we always render text into an FBO, we need to globally disable
|
||||
// subpixel antialiasing and instead use gray.
|
||||
qputenv("QSG_DISTANCEFIELD_ANTIALIASING", "gray");
|
||||
#ifdef Q_OS_MAC //This keeps qml2puppet from stealing focus
|
||||
qputenv("QT_MAC_DISABLE_FOREGROUND_APPLICATION_TRANSFORM", "true");
|
||||
#endif
|
||||
|
||||
QApplication application(argc, argv);
|
||||
|
||||
|
||||
@@ -51,6 +51,10 @@ int main(int argc, char *argv[])
|
||||
QtSimulatorPrivate::SimulatorConnection::createStubInstance();
|
||||
#endif
|
||||
|
||||
#ifdef Q_OS_MAC //This keeps qml2puppet from stealing focus
|
||||
qputenv("QT_MAC_DISABLE_FOREGROUND_APPLICATION_TRANSFORM", "true");
|
||||
#endif
|
||||
|
||||
QApplication application(argc, argv);
|
||||
|
||||
QCoreApplication::setOrganizationName("QtProject");
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -527,6 +527,7 @@ CPLUSPLUS_EXPORT QString simplifySTLType(const QString &typeIn)
|
||||
if (type.startsWith(QLatin1String("struct ")))
|
||||
type.remove(0, 7);
|
||||
|
||||
type.replace(QLatin1String("std::__1::"), QLatin1String("std::"));
|
||||
type.replace(QLatin1Char('*'), QLatin1Char('@'));
|
||||
|
||||
for (int i = 0; i < 10; ++i) {
|
||||
|
||||
@@ -151,6 +151,10 @@ void SshKeyGenerator::generateOpenSslPrivateKeyString(const KeyPtr &key)
|
||||
= key.dynamicCast<RSA_PrivateKey>();
|
||||
params << rsaKey->get_n() << rsaKey->get_e() << rsaKey->get_d() << rsaKey->get_p()
|
||||
<< rsaKey->get_q();
|
||||
const BigInt dmp1 = rsaKey->get_d() % (rsaKey->get_p() - 1);
|
||||
const BigInt dmq1 = rsaKey->get_d() % (rsaKey->get_q() - 1);
|
||||
const BigInt iqmp = inverse_mod(rsaKey->get_q(), rsaKey->get_p());
|
||||
params << dmp1 << dmq1 << iqmp;
|
||||
keyId = SshCapabilities::PubKeyRsa;
|
||||
label = "RSA PRIVATE KEY";
|
||||
} else {
|
||||
|
||||
@@ -36,9 +36,29 @@
|
||||
#include <QXmlStreamReader>
|
||||
#include <QXmlStreamWriter>
|
||||
#include <QDateTime>
|
||||
#include <QTextStream>
|
||||
#include <QRegExp>
|
||||
#include <QRect>
|
||||
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
// Read and write rectangle in X11 resource syntax "12x12+4+3"
|
||||
static QString rectangleToString(const QRect &r)
|
||||
{
|
||||
QString result;
|
||||
QTextStream(&result) << r.width() << 'x' << r.height() << forcesign << r.x() << r.y();
|
||||
return result;
|
||||
}
|
||||
|
||||
static QRect stringToRectangle(const QString &v)
|
||||
{
|
||||
static QRegExp pattern(QLatin1String("(\\d+)x(\\d+)([-+]\\d+)([-+]\\d+)"));
|
||||
Q_ASSERT(pattern.isValid());
|
||||
return pattern.exactMatch(v) ?
|
||||
QRect(QPoint(pattern.cap(3).toInt(), pattern.cap(4).toInt()),
|
||||
QSize(pattern.cap(1).toInt(), pattern.cap(2).toInt())) :
|
||||
QRect();
|
||||
}
|
||||
|
||||
/*!
|
||||
\class Utils::PersistentSettingsReader
|
||||
@@ -174,6 +194,8 @@ private:
|
||||
bool handleStartElement(QXmlStreamReader &r);
|
||||
bool handleEndElement(const QStringRef &name);
|
||||
|
||||
static QString formatWarning(const QXmlStreamReader &r, const QString &message);
|
||||
|
||||
QStack<ParseValueStackEntry> m_valueStack;
|
||||
QVariantMap m_result;
|
||||
QString m_currentVariableName;
|
||||
@@ -223,10 +245,16 @@ bool ParseContext::handleStartElement(QXmlStreamReader &r)
|
||||
const QString key = attributes.hasAttribute(keyAttribute) ?
|
||||
attributes.value(keyAttribute).toString() : QString();
|
||||
switch (e) {
|
||||
case SimpleValueElement:
|
||||
case SimpleValueElement: {
|
||||
// This reads away the end element, so, handle end element right here.
|
||||
m_valueStack.push_back(ParseValueStackEntry(readSimpleValue(r, attributes), key));
|
||||
const QVariant v = readSimpleValue(r, attributes);
|
||||
if (!v.isValid()) {
|
||||
qWarning() << ParseContext::formatWarning(r, QString::fromLatin1("Failed to read element \"%1\".").arg(name.toString()));
|
||||
return false;
|
||||
}
|
||||
m_valueStack.push_back(ParseValueStackEntry(v, key));
|
||||
return handleEndElement(name);
|
||||
}
|
||||
case ListValueElement:
|
||||
m_valueStack.push_back(ParseValueStackEntry(QVariant::List, key));
|
||||
break;
|
||||
@@ -256,6 +284,18 @@ bool ParseContext::handleEndElement(const QStringRef &name)
|
||||
return e == QtCreatorElement;
|
||||
}
|
||||
|
||||
QString ParseContext::formatWarning(const QXmlStreamReader &r, const QString &message)
|
||||
{
|
||||
QString result = QLatin1String("Warning reading ");
|
||||
if (const QIODevice *device = r.device())
|
||||
if (const QFile *file = qobject_cast<const QFile *>(device))
|
||||
result += QDir::toNativeSeparators(file->fileName()) + QLatin1Char(':');
|
||||
result += QString::number(r.lineNumber());
|
||||
result += QLatin1String(": ");
|
||||
result += message;
|
||||
return result;
|
||||
}
|
||||
|
||||
ParseContext::Element ParseContext::element(const QStringRef &r) const
|
||||
{
|
||||
if (r == valueElement)
|
||||
@@ -282,6 +322,10 @@ QVariant ParseContext::readSimpleValue(QXmlStreamReader &r, const QXmlStreamAttr
|
||||
QTC_ASSERT(text.size() == 1, return QVariant());
|
||||
return QVariant(QChar(text.at(0)));
|
||||
}
|
||||
if (type == QLatin1String("QRect")) {
|
||||
const QRect rectangle = stringToRectangle(text);
|
||||
return rectangle.isValid() ? QVariant(rectangle) : QVariant();
|
||||
}
|
||||
QVariant value;
|
||||
value.setValue(text);
|
||||
value.convert(QVariant::nameToType(type.toLatin1().data()));
|
||||
@@ -361,7 +405,14 @@ static void writeVariantValue(QXmlStreamWriter &w, const Context &ctx,
|
||||
w.writeAttribute(ctx.typeAttribute, QLatin1String(variant.typeName()));
|
||||
if (!key.isEmpty())
|
||||
w.writeAttribute(ctx.keyAttribute, key);
|
||||
switch (variant.type()) {
|
||||
case QVariant::Rect:
|
||||
w.writeCharacters(rectangleToString(variant.toRect()));
|
||||
break;
|
||||
default:
|
||||
w.writeCharacters(variant.toString());
|
||||
break;
|
||||
}
|
||||
w.writeEndElement();
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -186,8 +186,13 @@ bool AndroidSettingsWidget::checkSDK(const Utils::FileName &location)
|
||||
|| (!androidExe.appendPath(QLatin1String("/tools/android" QTC_HOST_EXE_SUFFIX)).toFileInfo().exists()
|
||||
&& !androidBat.appendPath(QLatin1String("/tools/android" ANDROID_BAT_SUFFIX)).toFileInfo().exists())
|
||||
|| !emulator.appendPath(QLatin1String("/tools/emulator" QTC_HOST_EXE_SUFFIX)).toFileInfo().exists()) {
|
||||
QMessageBox::critical(this, tr("Android SDK Folder"), tr("\"%1\" does not seem to be an Android SDK top folder.").arg(location.toUserOutput()));
|
||||
m_ui->sdkWarningIconLabel->setVisible(true);
|
||||
m_ui->sdkWarningLabel->setVisible(true);
|
||||
m_ui->sdkWarningLabel->setText(tr("\"%1\" does not seem to be an Android SDK top folder.").arg(location.toUserOutput()));
|
||||
return false;
|
||||
} else {
|
||||
m_ui->sdkWarningIconLabel->setVisible(false);
|
||||
m_ui->sdkWarningLabel->setVisible(false);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -33,7 +33,11 @@
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QLineEdit" name="SDKLocationLineEdit"/>
|
||||
<widget class="QLineEdit" name="SDKLocationLineEdit">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="2">
|
||||
<widget class="QPushButton" name="SDKLocationPushButton">
|
||||
@@ -48,7 +52,43 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<item row="1" column="1">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_4">
|
||||
<item>
|
||||
<widget class="QLabel" name="sdkWarningIconLabel">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="pixmap">
|
||||
<pixmap resource="../projectexplorer/projectexplorer.qrc">:/projectexplorer/images/compile_warning.png</pixmap>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="sdkWarningLabel">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="NDKLocationLabel">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||
@@ -64,17 +104,17 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<item row="2" column="1">
|
||||
<widget class="QLineEdit" name="NDKLocationLineEdit"/>
|
||||
</item>
|
||||
<item row="1" column="2">
|
||||
<item row="2" column="2">
|
||||
<widget class="QPushButton" name="NDKLocationPushButton">
|
||||
<property name="text">
|
||||
<string>Browse</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<item row="3" column="1">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||
<property name="spacing">
|
||||
<number>2</number>
|
||||
@@ -110,7 +150,7 @@
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<item row="4" column="1">
|
||||
<widget class="QCheckBox" name="CreateKitCheckBox">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||
@@ -126,59 +166,7 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="0">
|
||||
<widget class="QLabel" name="AntLocationLabel">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Ant location:</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="1">
|
||||
<widget class="QLineEdit" name="AntLocationLineEdit"/>
|
||||
</item>
|
||||
<item row="5" column="2">
|
||||
<widget class="QPushButton" name="AntLocationPushButton">
|
||||
<property name="text">
|
||||
<string>Browse</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="0">
|
||||
<widget class="QLabel" name="OpenJDKLocationLabel">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>JDK location:</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="1">
|
||||
<widget class="QLineEdit" name="OpenJDKLocationLineEdit"/>
|
||||
</item>
|
||||
<item row="6" column="2">
|
||||
<widget class="QPushButton" name="OpenJDKLocationPushButton">
|
||||
<property name="text">
|
||||
<string>Browse</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="1">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<property name="spacing">
|
||||
<number>2</number>
|
||||
@@ -217,6 +205,58 @@
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="6" column="0">
|
||||
<widget class="QLabel" name="AntLocationLabel">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Ant location:</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="1">
|
||||
<widget class="QLineEdit" name="AntLocationLineEdit"/>
|
||||
</item>
|
||||
<item row="6" column="2">
|
||||
<widget class="QPushButton" name="AntLocationPushButton">
|
||||
<property name="text">
|
||||
<string>Browse</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="0">
|
||||
<widget class="QLabel" name="OpenJDKLocationLabel">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>JDK location:</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="1">
|
||||
<widget class="QLineEdit" name="OpenJDKLocationLineEdit"/>
|
||||
</item>
|
||||
<item row="7" column="2">
|
||||
<widget class="QPushButton" name="OpenJDKLocationPushButton">
|
||||
<property name="text">
|
||||
<string>Browse</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
|
||||
@@ -44,7 +44,8 @@ using namespace Core::Internal;
|
||||
#define CANCELBUTTON_SIZE 15
|
||||
|
||||
ProgressBar::ProgressBar(QWidget *parent)
|
||||
: QWidget(parent), m_titleVisible(true), m_separatorVisible(true), m_progressHeight(0),
|
||||
: QWidget(parent), m_titleVisible(true), m_separatorVisible(true), m_cancelEnabled(true),
|
||||
m_progressHeight(0),
|
||||
m_minimum(1), m_maximum(100), m_value(1), m_cancelButtonFader(0), m_finished(false),
|
||||
m_error(false)
|
||||
{
|
||||
|
||||
@@ -46,6 +46,7 @@
|
||||
#include <QAction>
|
||||
#include <QEvent>
|
||||
#include <QHBoxLayout>
|
||||
#include <QMouseEvent>
|
||||
#include <QPainter>
|
||||
#include <QPropertyAnimation>
|
||||
#include <QStyle>
|
||||
@@ -379,6 +380,19 @@ bool ProgressManagerPrivate::eventFilter(QObject *obj, QEvent *event)
|
||||
m_hovered = false;
|
||||
// give the progress view the chance to get the mouse enter event
|
||||
updateVisibilityWithDelay();
|
||||
} else if (obj == m_statusBarWidget && event->type() == QEvent::MouseButtonPress
|
||||
&& !m_taskList.isEmpty()) {
|
||||
QMouseEvent *me = static_cast<QMouseEvent *>(event);
|
||||
if (me->button() == Qt::LeftButton && !me->modifiers()) {
|
||||
FutureProgress *progress = m_currentStatusDetailsProgress;
|
||||
if (!progress)
|
||||
progress = m_taskList.last();
|
||||
// don't send signal directly from an event filter, event filters should
|
||||
// do as little a possible
|
||||
QTimer::singleShot(0, progress, SIGNAL(clicked()));
|
||||
event->accept();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@@ -643,9 +657,11 @@ void ProgressManagerPrivate::updateStatusDetailsWidget()
|
||||
while (i != m_taskList.begin()) {
|
||||
--i;
|
||||
candidateWidget = (*i)->statusBarWidget();
|
||||
if (candidateWidget)
|
||||
if (candidateWidget) {
|
||||
m_currentStatusDetailsProgress = *i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (candidateWidget == m_currentStatusDetailsWidget)
|
||||
return;
|
||||
|
||||
@@ -108,6 +108,7 @@ private:
|
||||
QWidget *m_summaryProgressWidget;
|
||||
QHBoxLayout *m_summaryProgressLayout;
|
||||
QWidget *m_currentStatusDetailsWidget;
|
||||
QPointer<FutureProgress> m_currentStatusDetailsProgress;
|
||||
ProgressBar *m_summaryProgressBar;
|
||||
QGraphicsOpacityEffect *m_opacityEffect;
|
||||
QPointer<QPropertyAnimation> m_opacityAnimation;
|
||||
|
||||
@@ -355,8 +355,16 @@ QString WatchData::toToolTip() const
|
||||
formatToolTipRow(str, tr("Name"), name);
|
||||
formatToolTipRow(str, tr("Expression"), QLatin1String(exp));
|
||||
formatToolTipRow(str, tr("Internal Type"), QLatin1String(type));
|
||||
if (!displayedType.isEmpty())
|
||||
formatToolTipRow(str, tr("Displayed Type"), displayedType);
|
||||
QString val = valuetooltip.isEmpty() ? valuetooltip : value;
|
||||
QString val = valuetooltip.isEmpty() ? value : valuetooltip;
|
||||
// Automatically display hex value for unsigned integers.
|
||||
if (!val.isEmpty() && val.at(0).isDigit() && isIntType(type)) {
|
||||
bool ok;
|
||||
const quint64 intValue = val.toULongLong(&ok);
|
||||
if (ok && intValue)
|
||||
val += QLatin1String(" (hex) ") + QString::number(intValue, 16);
|
||||
}
|
||||
if (val.size() > 1000) {
|
||||
val.truncate(1000);
|
||||
val += tr(" ... <cut off>");
|
||||
|
||||
@@ -139,7 +139,6 @@ public:
|
||||
QMap<int, int> skippedLines() const { return m_skippedLines; }
|
||||
QMap<int, DiffEditorWidget::DiffFileInfo> fileInfo() const { return m_fileInfo; }
|
||||
|
||||
void setWorkingDirectory(const QString &workingDirectory) { m_workingDirectory = workingDirectory; }
|
||||
void setLineNumber(int blockNumber, int lineNumber);
|
||||
void setFileInfo(int blockNumber, const DiffEditorWidget::DiffFileInfo &fileInfo) { m_fileInfo[blockNumber] = fileInfo; setSeparator(blockNumber, true); }
|
||||
void setSkippedLines(int blockNumber, int skippedLines) { m_skippedLines[blockNumber] = skippedLines; setSeparator(blockNumber, true); }
|
||||
@@ -157,6 +156,11 @@ public slots:
|
||||
void setDisplaySettings(const DisplaySettings &ds);
|
||||
void setFontSettings(const TextEditor::FontSettings &fs);
|
||||
|
||||
signals:
|
||||
void jumpToOriginalFileRequested(int diffFileIndex,
|
||||
int lineNumber,
|
||||
int columnNumber);
|
||||
|
||||
protected:
|
||||
virtual int extraAreaWidth(int *markWidthPtr = 0) const { return BaseTextEditorWidget::extraAreaWidth(markWidthPtr); }
|
||||
BaseTextEditor *createEditor() { return new DiffViewEditorEditable(this); }
|
||||
@@ -180,7 +184,6 @@ private:
|
||||
const QTextBlock &block, int top);
|
||||
void jumpToOriginalFile(const QTextCursor &cursor);
|
||||
|
||||
QString m_workingDirectory;
|
||||
QMap<int, int> m_lineNumbers;
|
||||
int m_lineNumberDigits;
|
||||
// block number, fileInfo
|
||||
@@ -430,20 +433,13 @@ void DiffViewEditorWidget::jumpToOriginalFile(const QTextCursor &cursor)
|
||||
return;
|
||||
|
||||
const int blockNumber = cursor.blockNumber();
|
||||
const int position = cursor.positionInBlock();
|
||||
const int columnNumber = cursor.positionInBlock();
|
||||
if (!m_lineNumbers.contains(blockNumber))
|
||||
return;
|
||||
|
||||
const int lineNr = m_lineNumbers.value(blockNumber);
|
||||
QMap<int, DiffEditorWidget::DiffFileInfo>::const_iterator it = m_fileInfo.upperBound(blockNumber);
|
||||
if (it != m_fileInfo.constBegin())
|
||||
--it;
|
||||
const QDir dir(m_workingDirectory);
|
||||
const QString fileName = dir.absoluteFilePath(it.value().fileName);
|
||||
const int lineNumber = m_lineNumbers.value(blockNumber);
|
||||
|
||||
Core::IEditor *ed = Core::EditorManager::openEditor(fileName);
|
||||
if (TextEditor::ITextEditor *editor = qobject_cast<TextEditor::ITextEditor *>(ed))
|
||||
editor->gotoLine(lineNr, position);
|
||||
emit jumpToOriginalFileRequested(fileIndexForBlockNumber(blockNumber), lineNumber, columnNumber);
|
||||
}
|
||||
|
||||
void DiffViewEditorWidget::paintEvent(QPaintEvent *e)
|
||||
@@ -609,6 +605,8 @@ DiffEditorWidget::DiffEditorWidget(QWidget *parent)
|
||||
m_leftEditor, SLOT(setDisplaySettings(TextEditor::DisplaySettings)));
|
||||
m_leftEditor->setDisplaySettings(settings->displaySettings());
|
||||
m_leftEditor->setCodeStyle(settings->codeStyle());
|
||||
connect(m_leftEditor, SIGNAL(jumpToOriginalFileRequested(int,int,int)),
|
||||
this, SLOT(slotLeftJumpToOriginalFileRequested(int,int,int)));
|
||||
|
||||
m_rightEditor = new DiffViewEditorWidget(this);
|
||||
m_rightEditor->setReadOnly(true);
|
||||
@@ -616,6 +614,8 @@ DiffEditorWidget::DiffEditorWidget(QWidget *parent)
|
||||
m_rightEditor, SLOT(setDisplaySettings(TextEditor::DisplaySettings)));
|
||||
m_rightEditor->setDisplaySettings(settings->displaySettings());
|
||||
m_rightEditor->setCodeStyle(settings->codeStyle());
|
||||
connect(m_rightEditor, SIGNAL(jumpToOriginalFileRequested(int,int,int)),
|
||||
this, SLOT(slotRightJumpToOriginalFileRequested(int,int,int)));
|
||||
|
||||
connect(settings, SIGNAL(fontSettingsChanged(TextEditor::FontSettings)),
|
||||
this, SLOT(setFontSettings(TextEditor::FontSettings)));
|
||||
@@ -680,8 +680,7 @@ void DiffEditorWidget::clear(const QString &message)
|
||||
|
||||
void DiffEditorWidget::setDiff(const QList<DiffFilesContents> &diffFileList, const QString &workingDirectory)
|
||||
{
|
||||
m_leftEditor->setWorkingDirectory(workingDirectory);
|
||||
m_rightEditor->setWorkingDirectory(workingDirectory);
|
||||
m_workingDirectory = workingDirectory;
|
||||
Differ differ;
|
||||
QList<DiffList> diffList;
|
||||
for (int i = 0; i < diffFileList.count(); i++) {
|
||||
@@ -1440,6 +1439,63 @@ void DiffEditorWidget::setFontSettings(const TextEditor::FontSettings &fontSetti
|
||||
colorDiff(m_contextFileData);
|
||||
}
|
||||
|
||||
void DiffEditorWidget::slotLeftJumpToOriginalFileRequested(int diffFileIndex,
|
||||
int lineNumber,
|
||||
int columnNumber)
|
||||
{
|
||||
if (diffFileIndex < 0 || diffFileIndex >= m_contextFileData.count())
|
||||
return;
|
||||
|
||||
const FileData fileData = m_contextFileData.at(diffFileIndex);
|
||||
const QString leftFileName = fileData.leftFileInfo.fileName;
|
||||
const QString rightFileName = fileData.rightFileInfo.fileName;
|
||||
if (leftFileName == rightFileName) {
|
||||
// The same file (e.g. in git diff), jump to the line number taken from the right editor.
|
||||
// Warning: git show SHA^ vs SHA or git diff HEAD vs Index
|
||||
// (when Working tree has changed in meantime) will not work properly.
|
||||
int leftLineNumber = 0;
|
||||
int rightLineNumber = 0;
|
||||
|
||||
for (int i = 0; i < fileData.chunks.count(); i++) {
|
||||
const ChunkData chunkData = fileData.chunks.at(i);
|
||||
for (int j = 0; j < chunkData.rows.count(); j++) {
|
||||
const RowData rowData = chunkData.rows.at(j);
|
||||
if (rowData.leftLine.textLineType == TextLineData::TextLine)
|
||||
leftLineNumber++;
|
||||
if (rowData.rightLine.textLineType == TextLineData::TextLine)
|
||||
rightLineNumber++;
|
||||
if (leftLineNumber == lineNumber) {
|
||||
int colNr = rowData.equal ? columnNumber : 0;
|
||||
jumpToOriginalFile(leftFileName, rightLineNumber, colNr);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// different file (e.g. in Tools | Diff...)
|
||||
jumpToOriginalFile(leftFileName, lineNumber, columnNumber);
|
||||
}
|
||||
}
|
||||
|
||||
void DiffEditorWidget::slotRightJumpToOriginalFileRequested(int diffFileIndex,
|
||||
int lineNumber, int columnNumber)
|
||||
{
|
||||
if (diffFileIndex < 0 || diffFileIndex >= m_contextFileData.count())
|
||||
return;
|
||||
|
||||
const FileData fileData = m_contextFileData.at(diffFileIndex);
|
||||
const QString fileName = fileData.rightFileInfo.fileName;
|
||||
jumpToOriginalFile(fileName, lineNumber, columnNumber);
|
||||
}
|
||||
|
||||
void DiffEditorWidget::jumpToOriginalFile(const QString &fileName,
|
||||
int lineNumber, int columnNumber)
|
||||
{
|
||||
const QDir dir(m_workingDirectory);
|
||||
const QString absoluteFileName = dir.absoluteFilePath(fileName);
|
||||
Core::EditorManager::openEditorAt(absoluteFileName, lineNumber, columnNumber);
|
||||
}
|
||||
|
||||
void DiffEditorWidget::leftVSliderChanged()
|
||||
{
|
||||
m_rightEditor->verticalScrollBar()->setValue(m_leftEditor->verticalScrollBar()->value());
|
||||
|
||||
@@ -103,6 +103,8 @@ protected:
|
||||
|
||||
private slots:
|
||||
void setFontSettings(const TextEditor::FontSettings &fontSettings);
|
||||
void slotLeftJumpToOriginalFileRequested(int diffFileIndex, int lineNumber, int columnNumber);
|
||||
void slotRightJumpToOriginalFileRequested(int diffFileIndex, int lineNumber, int columnNumber);
|
||||
void leftVSliderChanged();
|
||||
void rightVSliderChanged();
|
||||
void leftHSliderChanged();
|
||||
@@ -135,6 +137,7 @@ private:
|
||||
FileData calculateContextData(const ChunkData &originalData) const;
|
||||
void showDiff();
|
||||
void synchronizeFoldings(DiffViewEditorWidget *source, DiffViewEditorWidget *destination);
|
||||
void jumpToOriginalFile(const QString &fileName, int lineNumber, int columnNumber);
|
||||
|
||||
DiffViewEditorWidget *m_leftEditor;
|
||||
DiffViewEditorWidget *m_rightEditor;
|
||||
@@ -143,6 +146,7 @@ private:
|
||||
QList<DiffList> m_diffList; // list of original outputs from differ
|
||||
QList<ChunkData> m_originalChunkData; // one big chunk for every file, ignoreWhitespaces taken into account
|
||||
QList<FileData> m_contextFileData; // ultimate data to be shown, contextLinesNumber taken into account
|
||||
QString m_workingDirectory;
|
||||
int m_contextLinesNumber;
|
||||
bool m_ignoreWhitespaces;
|
||||
bool m_syncScrollBars;
|
||||
|
||||
@@ -97,6 +97,12 @@ void BranchDialog::refresh(const QString &repository, bool force)
|
||||
m_ui->branchView->expandAll();
|
||||
}
|
||||
|
||||
void BranchDialog::refreshIfSame(const QString &repository)
|
||||
{
|
||||
if (m_repository == repository)
|
||||
refresh();
|
||||
}
|
||||
|
||||
void BranchDialog::enableButtons()
|
||||
{
|
||||
QModelIndex idx = selectedIndex();
|
||||
@@ -306,7 +312,6 @@ void BranchDialog::log()
|
||||
void BranchDialog::merge()
|
||||
{
|
||||
QModelIndex idx = selectedIndex();
|
||||
QTC_CHECK(m_model->isLocal(m_model->currentBranch())); // otherwise the button would not be enabled!
|
||||
QTC_CHECK(idx != m_model->currentBranch()); // otherwise the button would not be enabled!
|
||||
|
||||
const QString branch = m_model->fullName(idx, true);
|
||||
@@ -318,7 +323,6 @@ void BranchDialog::merge()
|
||||
void BranchDialog::rebase()
|
||||
{
|
||||
QModelIndex idx = selectedIndex();
|
||||
QTC_CHECK(m_model->isLocal(m_model->currentBranch())); // otherwise the button would not be enabled!
|
||||
QTC_CHECK(idx != m_model->currentBranch()); // otherwise the button would not be enabled!
|
||||
|
||||
const QString baseBranch = m_model->fullName(idx, true);
|
||||
|
||||
@@ -61,6 +61,7 @@ public:
|
||||
|
||||
public slots:
|
||||
void refresh(const QString &repository, bool force);
|
||||
void refreshIfSame(const QString &repository);
|
||||
|
||||
private slots:
|
||||
void enableButtons();
|
||||
|
||||
@@ -80,7 +80,7 @@ public:
|
||||
|
||||
bool isLeaf() const
|
||||
{
|
||||
return children.isEmpty();
|
||||
return children.isEmpty() && parent && parent->parent;
|
||||
}
|
||||
|
||||
bool childOf(BranchNode *node) const
|
||||
@@ -339,8 +339,12 @@ void BranchModel::clear()
|
||||
|
||||
bool BranchModel::refresh(const QString &workingDirectory, QString *errorMessage)
|
||||
{
|
||||
if (workingDirectory.isEmpty())
|
||||
beginResetModel();
|
||||
clear();
|
||||
if (workingDirectory.isEmpty()) {
|
||||
endResetModel();
|
||||
return false;
|
||||
}
|
||||
|
||||
m_currentSha = m_client->synchronousTopRevision(workingDirectory);
|
||||
QStringList args;
|
||||
@@ -349,9 +353,6 @@ bool BranchModel::refresh(const QString &workingDirectory, QString *errorMessage
|
||||
if (!m_client->synchronousForEachRefCmd(workingDirectory, args, &output, errorMessage))
|
||||
VcsBase::VcsBaseOutputWindow::instance()->appendError(*errorMessage);
|
||||
|
||||
beginResetModel();
|
||||
clear();
|
||||
|
||||
m_workingDirectory = workingDirectory;
|
||||
const QStringList lines = output.split(QLatin1Char('\n'));
|
||||
foreach (const QString &l, lines)
|
||||
|
||||
@@ -2362,6 +2362,11 @@ void GitClient::finishSubmoduleUpdate()
|
||||
m_updatedSubmodules.clear();
|
||||
}
|
||||
|
||||
void GitClient::fetchFinished(const QVariant &cookie)
|
||||
{
|
||||
GitPlugin::instance()->updateBranches(cookie.toString());
|
||||
}
|
||||
|
||||
// Trim a git status file spec: "modified: foo .cpp" -> "modified: foo .cpp"
|
||||
static inline QString trimFileSpecification(QString fileSpec)
|
||||
{
|
||||
@@ -2974,7 +2979,9 @@ void GitClient::fetch(const QString &workingDirectory, const QString &remote)
|
||||
{
|
||||
QStringList arguments(QLatin1String("fetch"));
|
||||
arguments << (remote.isEmpty() ? QLatin1String("--all") : remote);
|
||||
executeGit(workingDirectory, arguments, 0, true);
|
||||
VcsBase::Command *command = executeGit(workingDirectory, arguments, 0, true);
|
||||
command->setCookie(workingDirectory);
|
||||
connect(command, SIGNAL(success(QVariant)), this, SLOT(fetchFinished(QVariant)));
|
||||
}
|
||||
|
||||
bool GitClient::executeAndHandleConflicts(const QString &workingDirectory,
|
||||
|
||||
@@ -327,6 +327,7 @@ private slots:
|
||||
void appendOutputData(const QByteArray &data) const;
|
||||
void appendOutputDataSilently(const QByteArray &data) const;
|
||||
void finishSubmoduleUpdate();
|
||||
void fetchFinished(const QVariant &cookie);
|
||||
|
||||
private:
|
||||
QTextCodec *getSourceCodec(const QString &file) const;
|
||||
|
||||
@@ -695,6 +695,8 @@ bool GitPlugin::initialize(const QStringList &arguments, QString *errorMessage)
|
||||
|
||||
connect(Core::ICore::vcsManager(), SIGNAL(repositoryChanged(QString)),
|
||||
this, SLOT(updateContinueAndAbortCommands()));
|
||||
connect(Core::ICore::vcsManager(), SIGNAL(repositoryChanged(QString)),
|
||||
this, SLOT(updateBranches(QString)), Qt::QueuedConnection);
|
||||
|
||||
if (!Core::ICore::mimeDatabase()->addMimeTypes(QLatin1String(RC_GIT_MIME_XML), errorMessage))
|
||||
return false;
|
||||
@@ -1435,6 +1437,12 @@ void GitPlugin::updateContinueAndAbortCommands()
|
||||
}
|
||||
}
|
||||
|
||||
void GitPlugin::updateBranches(const QString &repository)
|
||||
{
|
||||
if (m_branchDialog && m_branchDialog->isVisible())
|
||||
m_branchDialog->refreshIfSame(repository);
|
||||
}
|
||||
|
||||
void GitPlugin::updateRepositoryBrowserAction()
|
||||
{
|
||||
const bool repositoryEnabled = currentState().hasTopLevel();
|
||||
|
||||
@@ -102,6 +102,7 @@ public:
|
||||
|
||||
public slots:
|
||||
void startCommit();
|
||||
void updateBranches(const QString &repository);
|
||||
|
||||
private slots:
|
||||
void diffCurrentFile();
|
||||
|
||||
@@ -76,8 +76,6 @@ bool LogChangeWidget::init(const QString &repository, const QString &commit, boo
|
||||
GitPlugin::instance()->gitClient()->msgNoCommits(includeRemote));
|
||||
return false;
|
||||
}
|
||||
selectionModel()->select(m_model->index(0, 0),
|
||||
QItemSelectionModel::SelectCurrent | QItemSelectionModel::Rows);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -117,6 +115,8 @@ void LogChangeWidget::emitDoubleClicked(const QModelIndex &index)
|
||||
|
||||
bool LogChangeWidget::populateLog(const QString &repository, const QString &commit, bool includeRemote)
|
||||
{
|
||||
const QString currentCommit = this->commit();
|
||||
int selected = currentCommit.isEmpty() ? 0 : -1;
|
||||
if (const int rowCount = m_model->rowCount())
|
||||
m_model->removeRows(0, rowCount);
|
||||
|
||||
@@ -144,12 +144,15 @@ bool LogChangeWidget::populateLog(const QString &repository, const QString &comm
|
||||
}
|
||||
row.push_back(item);
|
||||
}
|
||||
row[Sha1Column]->setText(line.left(colonPos));
|
||||
const QString sha1 = line.left(colonPos);
|
||||
row[Sha1Column]->setText(sha1);
|
||||
row[SubjectColumn]->setText(line.right(line.size() - colonPos - 1));
|
||||
m_model->appendRow(row);
|
||||
if (selected == -1 && currentCommit == sha1)
|
||||
selected = m_model->rowCount() - 1;
|
||||
}
|
||||
}
|
||||
setCurrentIndex(m_model->index(0, 0));
|
||||
setCurrentIndex(m_model->index(selected, 0));
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -174,8 +177,8 @@ LogChangeDialog::LogChangeDialog(bool isReset, QWidget *parent) :
|
||||
if (isReset) {
|
||||
popUpLayout->addWidget(new QLabel(tr("Reset type:"), this));
|
||||
m_resetTypeComboBox = new QComboBox(this);
|
||||
m_resetTypeComboBox->addItem(tr("Mixed"), QLatin1String("--mixed"));
|
||||
m_resetTypeComboBox->addItem(tr("Hard"), QLatin1String("--hard"));
|
||||
m_resetTypeComboBox->addItem(tr("Mixed"), QLatin1String("--mixed"));
|
||||
m_resetTypeComboBox->addItem(tr("Soft"), QLatin1String("--soft"));
|
||||
popUpLayout->addWidget(m_resetTypeComboBox);
|
||||
popUpLayout->addItem(new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Ignored));
|
||||
|
||||
@@ -97,6 +97,8 @@ EnvironmentAspectWidget::EnvironmentAspectWidget(EnvironmentAspect *aspect, QWid
|
||||
connect(m_aspect, SIGNAL(baseEnvironmentChanged()), this, SLOT(changeBaseEnvironment()));
|
||||
connect(m_aspect, SIGNAL(userEnvironmentChangesChanged(QList<Utils::EnvironmentItem>)),
|
||||
this, SLOT(changeUserChanges(QList<Utils::EnvironmentItem>)));
|
||||
connect(m_aspect, SIGNAL(environmentChanged()),
|
||||
this, SLOT(environmentChanged()));
|
||||
}
|
||||
|
||||
QString EnvironmentAspectWidget::displayName() const
|
||||
@@ -118,6 +120,7 @@ void EnvironmentAspectWidget::baseEnvironmentSelected(int idx)
|
||||
{
|
||||
m_ignoreChange = true;
|
||||
m_aspect->setBaseEnvironmentBase(m_baseEnvironmentComboBox->itemData(idx).toInt());
|
||||
m_environmentWidget->setBaseEnvironment(m_aspect->baseEnvironment());
|
||||
m_ignoreChange = false;
|
||||
}
|
||||
|
||||
@@ -132,6 +135,7 @@ void EnvironmentAspectWidget::changeBaseEnvironment()
|
||||
m_baseEnvironmentComboBox->setCurrentIndex(i);
|
||||
}
|
||||
m_environmentWidget->setBaseEnvironmentText(m_aspect->baseEnvironmentDisplayName(base));
|
||||
m_environmentWidget->setBaseEnvironment(m_aspect->baseEnvironment());
|
||||
}
|
||||
|
||||
void EnvironmentAspectWidget::userChangesEdited()
|
||||
@@ -148,4 +152,11 @@ void EnvironmentAspectWidget::changeUserChanges(QList<Utils::EnvironmentItem> ch
|
||||
m_environmentWidget->setUserChanges(changes);
|
||||
}
|
||||
|
||||
void EnvironmentAspectWidget::environmentChanged()
|
||||
{
|
||||
if (m_ignoreChange)
|
||||
return;
|
||||
m_environmentWidget->setBaseEnvironment(m_aspect->baseEnvironment());
|
||||
}
|
||||
|
||||
} // namespace ProjectExplorer
|
||||
|
||||
@@ -67,6 +67,7 @@ private slots:
|
||||
void changeBaseEnvironment();
|
||||
void userChangesEdited();
|
||||
void changeUserChanges(QList<Utils::EnvironmentItem> changes);
|
||||
void environmentChanged();
|
||||
|
||||
private:
|
||||
EnvironmentAspect *m_aspect;
|
||||
|
||||
@@ -84,11 +84,9 @@ Utils::Environment LocalEnvironmentAspect::baseEnvironment() const
|
||||
|
||||
void LocalEnvironmentAspect::buildEnvironmentHasChanged()
|
||||
{
|
||||
if (baseEnvironmentBase() == static_cast<int>(BuildEnvironmentBase)) {
|
||||
emit baseEnvironmentChanged();
|
||||
if (baseEnvironmentBase() == static_cast<int>(BuildEnvironmentBase))
|
||||
emit environmentChanged();
|
||||
}
|
||||
}
|
||||
|
||||
LocalEnvironmentAspect::LocalEnvironmentAspect(RunConfiguration *rc) :
|
||||
EnvironmentAspect(rc)
|
||||
|
||||
@@ -87,13 +87,10 @@ void RemoteLinuxEnvironmentAspect::setRemoteEnvironment(const Utils::Environment
|
||||
{
|
||||
if (env != m_remoteEnvironment) {
|
||||
m_remoteEnvironment = env;
|
||||
emit remoteEnvironmentChanged();
|
||||
if (baseEnvironmentBase() == static_cast<int>(RemoteBaseEnvironment)) {
|
||||
emit baseEnvironmentChanged();
|
||||
if (baseEnvironmentBase() == static_cast<int>(RemoteBaseEnvironment))
|
||||
emit environmentChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
QString RemoteLinuxEnvironmentAspect::userEnvironmentChangesAsString() const
|
||||
{
|
||||
|
||||
@@ -60,9 +60,6 @@ public:
|
||||
|
||||
QString userEnvironmentChangesAsString() const;
|
||||
|
||||
signals:
|
||||
void remoteEnvironmentChanged();
|
||||
|
||||
private:
|
||||
enum BaseEnvironmentBase {
|
||||
CleanBaseEnvironment = 0,
|
||||
|
||||
@@ -64,7 +64,7 @@ QList<FilterEntry> LineNumberFilter::matchesFor(QFutureInterface<Locator::Filter
|
||||
int sectionCount = lineAndColumn.size();
|
||||
int line = 0;
|
||||
int column = 0;
|
||||
bool ok;
|
||||
bool ok = false;
|
||||
if (sectionCount > 0)
|
||||
line = lineAndColumn.at(0).toInt(&ok);
|
||||
if (ok && sectionCount > 1)
|
||||
|
||||
@@ -1037,7 +1037,12 @@ bool VcsBasePlugin::runFullySynchronous(const QString &workingDirectory,
|
||||
// if (flags & ExpectRepoChanges)
|
||||
// Core::DocumentManager::unexpectDirectoryChange(workingDirectory);
|
||||
|
||||
return process.exitStatus() == QProcess::NormalExit && process.exitCode() == 0;
|
||||
if (process.exitStatus() == QProcess::NormalExit && process.exitCode() == 0) {
|
||||
if (flags & ExpectRepoChanges)
|
||||
Core::ICore::vcsManager()->emitRepositoryChanged(workingDirectory);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool VcsBasePlugin::runPatch(const QByteArray &input, const QString &workingDirectory,
|
||||
|
||||
@@ -83,10 +83,10 @@ int AddKeysOperation::execute() const
|
||||
|
||||
QVariantMap result = addKeys(map, m_data);
|
||||
if (result.isEmpty() || map == result)
|
||||
return -4;
|
||||
return 4;
|
||||
|
||||
// Write data again:
|
||||
return save(result, m_file) ? 0 : -5;
|
||||
return save(result, m_file) ? 0 : 5;
|
||||
}
|
||||
|
||||
#ifdef WITH_TESTS
|
||||
|
||||
@@ -219,9 +219,9 @@ int AddKitOperation::execute() const
|
||||
m_deviceType.toUtf8(), m_sysRoot, m_tc, m_qt, m_mkspec, m_extra);
|
||||
|
||||
if (result.isEmpty() || map == result)
|
||||
return -2;
|
||||
return 2;
|
||||
|
||||
return save(result, QLatin1String("profiles")) ? 0 : -3;
|
||||
return save(result, QLatin1String("profiles")) ? 0 : 3;
|
||||
}
|
||||
|
||||
#ifdef WITH_TESTS
|
||||
|
||||
@@ -155,9 +155,9 @@ int AddQtOperation::execute() const
|
||||
QVariantMap result = addQt(map, m_id, m_displayName, m_type, m_qmake, m_extra);
|
||||
|
||||
if (result.isEmpty() || result == map)
|
||||
return -2;
|
||||
return 2;
|
||||
|
||||
return save(result, QLatin1String("qtversions")) ? 0 : -3;
|
||||
return save(result, QLatin1String("qtversions")) ? 0 : 3;
|
||||
}
|
||||
|
||||
#ifdef WITH_TESTS
|
||||
|
||||
@@ -151,9 +151,9 @@ int AddToolChainOperation::execute() const
|
||||
|
||||
QVariantMap result = addToolChain(map, m_id, m_displayName, m_path, m_targetAbi, m_supportedAbis, m_extra);
|
||||
if (result.isEmpty() || map == result)
|
||||
return -2;
|
||||
return 2;
|
||||
|
||||
return save(result, QLatin1String("toolchains")) ? 0 : -3;
|
||||
return save(result, QLatin1String("toolchains")) ? 0 : 3;
|
||||
}
|
||||
|
||||
#ifdef WITH_TESTS
|
||||
|
||||
@@ -70,7 +70,7 @@ int GetOperation::execute() const
|
||||
foreach (const QString &key, m_keys) {
|
||||
const QVariant result = get(map, key);
|
||||
if (result.isValid())
|
||||
return -2;
|
||||
return 2;
|
||||
std::cout << qPrintable(result.toString()) << std::endl;
|
||||
}
|
||||
|
||||
|
||||
@@ -111,7 +111,7 @@ int parseArguments(const QStringList &args, Settings *s, const QList<Operation *
|
||||
if (next.isNull()) {
|
||||
std::cerr << "Missing argument to '-s'." << std::endl << std::endl;
|
||||
printHelp(operations);
|
||||
return -1;
|
||||
return 1;
|
||||
}
|
||||
s->sdkPath = Utils::FileName::fromString(next);
|
||||
++i; // skip next;
|
||||
@@ -135,19 +135,19 @@ int parseArguments(const QStringList &args, Settings *s, const QList<Operation *
|
||||
|
||||
std::cerr << "Unknown parameter given." << std::endl << std::endl;
|
||||
printHelp(operations);
|
||||
return -1;
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (!s->operation) {
|
||||
std::cerr << "No operation requested." << std::endl << std::endl;
|
||||
printHelp(operations);
|
||||
return -1;
|
||||
return 1;
|
||||
}
|
||||
if (!s->operation->setArguments(opArgs)) {
|
||||
std::cerr << "Argument parsing failed." << std::endl << std::endl;
|
||||
printHelp(s->operation);
|
||||
s->operation = 0;
|
||||
return -1;
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
@@ -90,9 +90,9 @@ int RmKitOperation::execute() const
|
||||
QVariantMap result = rmKit(map, m_id);
|
||||
|
||||
if (result == map)
|
||||
return -2;
|
||||
return 2;
|
||||
|
||||
return save(result, QLatin1String("profiles")) ? 0 : -3;
|
||||
return save(result, QLatin1String("profiles")) ? 0 : 3;
|
||||
}
|
||||
|
||||
#ifdef WITH_TESTS
|
||||
|
||||
@@ -90,9 +90,9 @@ int RmQtOperation::execute() const
|
||||
|
||||
QVariantMap result = rmQt(map, m_id);
|
||||
if (result == map)
|
||||
return -2;
|
||||
return 2;
|
||||
|
||||
return save(result, QLatin1String("qtversion")) ? 0 : -3;
|
||||
return save(result, QLatin1String("qtversion")) ? 0 : 3;
|
||||
}
|
||||
|
||||
#ifdef WITH_TESTS
|
||||
|
||||
@@ -91,9 +91,9 @@ int RmToolChainOperation::execute() const
|
||||
|
||||
QVariantMap result = rmToolChain(map, m_id);
|
||||
if (result == map)
|
||||
return -2;
|
||||
return 2;
|
||||
|
||||
return save(result, QLatin1String("toolchains")) ? 0 : -3;
|
||||
return save(result, QLatin1String("toolchains")) ? 0 : 3;
|
||||
}
|
||||
|
||||
#ifdef WITH_TESTS
|
||||
|
||||
@@ -42,6 +42,7 @@ const char *description[] =
|
||||
"g++_stringset",
|
||||
"g++_stringvector",
|
||||
"g++_wstringvector",
|
||||
"libc++_stringvector",
|
||||
"msvc_stdstring",
|
||||
"msvc_stdwstring",
|
||||
"msvc_stringmap",
|
||||
@@ -63,6 +64,8 @@ const char *input[] =
|
||||
"std::set<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::less<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > >",
|
||||
"std::vector<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > >",
|
||||
"std::vector<std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >, std::allocator<std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > > >",
|
||||
// libc++
|
||||
"std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > >",
|
||||
// MSVC
|
||||
"class std::basic_string<char,std::char_traits<char>,std::allocator<char> >",
|
||||
"class std::basic_string<unsigned short,std::char_traits<unsigned short>,std::allocator<unsigned short> >",
|
||||
@@ -76,6 +79,7 @@ const char *input[] =
|
||||
|
||||
const char *output[] =
|
||||
{
|
||||
// Gcc
|
||||
"std::string",
|
||||
"std::wstring",
|
||||
"std::map<std::string, std::string>",
|
||||
@@ -84,6 +88,9 @@ const char *output[] =
|
||||
"std::set<std::string>",
|
||||
"std::vector<std::string>",
|
||||
"std::vector<std::wstring>",
|
||||
// libc++
|
||||
"std::vector<std::string>",
|
||||
// MSVC
|
||||
"std::string",
|
||||
"std::wstring",
|
||||
"std::map<std::string, std::string>",
|
||||
|
||||
@@ -268,8 +268,10 @@ struct Type
|
||||
QByteArray actualType =
|
||||
CPlusPlus::simplifySTLType(QString::fromLatin1(actualType0)).toLatin1();
|
||||
actualType.replace(' ', "");
|
||||
actualType.replace("const", "");
|
||||
QByteArray expectedType = type;
|
||||
expectedType.replace(' ', "");
|
||||
expectedType.replace("const", "");
|
||||
expectedType.replace('@', context.nameSpace);
|
||||
return actualType == expectedType;
|
||||
}
|
||||
@@ -328,8 +330,30 @@ struct Profile
|
||||
|
||||
struct Cxx11Profile : public Profile
|
||||
{
|
||||
//Cxx11Profile() : Profile("CONFIG += c++11") {}
|
||||
Cxx11Profile() : Profile("QMAKE_CXXFLAGS += -std=c++0x") {}
|
||||
Cxx11Profile()
|
||||
: Profile("greaterThan(QT_MAJOR_VERSION,4): CONFIG += c++11\n"
|
||||
"else: QMAKE_CXXFLAGS += -std=c++0x\n")
|
||||
{}
|
||||
};
|
||||
|
||||
struct MacLibStdCppProfile : public Profile
|
||||
{
|
||||
MacLibStdCppProfile()
|
||||
: Profile("macx {\n"
|
||||
"QMAKE_CXXFLAGS += -stdlib=libc++\n"
|
||||
"LIBS += -stdlib=libc++\n"
|
||||
"QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.7\n"
|
||||
"QMAKE_IOS_DEPLOYMENT_TARGET = 10.7\n"
|
||||
"QMAKE_CFLAGS -= -mmacosx-version-min=10.6\n"
|
||||
"QMAKE_CFLAGS += -mmacosx-version-min=10.7\n"
|
||||
"QMAKE_CXXFLAGS -= -mmacosx-version-min=10.6\n"
|
||||
"QMAKE_CXXFLAGS += -mmacosx-version-min=10.7\n"
|
||||
"QMAKE_OBJECTIVE_CFLAGS -= -mmacosx-version-min=10.6\n"
|
||||
"QMAKE_OBJECTIVE_CFLAGS += -mmacosx-version-min=10.7\n"
|
||||
"QMAKE_LFLAGS -= -mmacosx-version-min=10.6\n"
|
||||
"QMAKE_LFLAGS += -mmacosx-version-min=10.7\n"
|
||||
"}")
|
||||
{}
|
||||
};
|
||||
|
||||
struct GdbOnly {};
|
||||
@@ -957,6 +981,7 @@ void tst_Dumpers::dumper()
|
||||
qDebug() << "CONTENTS : " << contents;
|
||||
qDebug() << "Qt VERSION : "
|
||||
<< qPrintable(QString::number(context.qtVersion, 16));
|
||||
qDebug() << "BUILD DIR : " << qPrintable(t->buildPath);
|
||||
}
|
||||
QVERIFY(ok);
|
||||
t->buildTemp.setAutoRemove(m_keepTemp);
|
||||
@@ -2058,10 +2083,10 @@ void tst_Dumpers::dumper_data()
|
||||
"#include <QString> // Dummy for namespace\n",
|
||||
"QString dummy;\n"
|
||||
"QPointF s0, s;\n"
|
||||
"s = QPointF(100, 200);\n")
|
||||
"s = QPointF(100.5, 200.5);\n")
|
||||
% CoreProfile()
|
||||
% Check("s0", "(0.0, 0.0)", "@QPointF")
|
||||
% Check("s", "(100.0, 200.0)", "@QPointF");
|
||||
% Check("s", "(100.5, 200.5)", "@QPointF");
|
||||
|
||||
QTest::newRow("QRect")
|
||||
<< Data("#include <QRect>\n"
|
||||
@@ -2077,9 +2102,9 @@ void tst_Dumpers::dumper_data()
|
||||
"#include <QString> // Dummy for namespace\n",
|
||||
"QString dummy;\n"
|
||||
"QRectF rect0, rect;\n"
|
||||
"rect = QRectF(100, 100, 200, 200);\n")
|
||||
"rect = QRectF(100.25, 100.25, 200.5, 200.5);\n")
|
||||
% Check("rect", "0x0+0+0", "@QRectF")
|
||||
% Check("rect", "200x200+100+100", "@QRectF");
|
||||
% Check("rect", "200.5x200.5+100.25+100.25", "@QRectF");
|
||||
|
||||
QTest::newRow("QSize")
|
||||
<< Data("#include <QSize>\n"
|
||||
@@ -2096,10 +2121,10 @@ void tst_Dumpers::dumper_data()
|
||||
"#include <QString> // Dummy for namespace\n",
|
||||
"QString dummy;\n"
|
||||
"QSizeF s0, s;\n"
|
||||
"s = QSizeF(100, 200);\n")
|
||||
"s = QSizeF(100.5, 200.5);\n")
|
||||
% CoreProfile()
|
||||
% Check("s0", "(-1, -1)", "@QSizeF")
|
||||
% Check("s", "(100, 200)", "@QSizeF");
|
||||
% Check("s0", "(-1.0, -1.0)", "@QSizeF")
|
||||
% Check("s", "(100.5, 200.5)", "@QSizeF");
|
||||
|
||||
QTest::newRow("QRegion")
|
||||
<< Data("#include <QRegion>\n"
|
||||
@@ -2149,8 +2174,8 @@ void tst_Dumpers::dumper_data()
|
||||
"s.insert(22);\n")
|
||||
% CoreProfile()
|
||||
% Check("s", "<2 items>", "@QSet<int>")
|
||||
% Check("s.22", "[22]", "22", "int")
|
||||
% Check("s.11", "[11]", "11", "int");
|
||||
% Check("s.0", "[0]", "22", "int")
|
||||
% Check("s.1", "[1]", "11", "int");
|
||||
|
||||
QTest::newRow("QSet2")
|
||||
<< Data("#include <QSet>\n"
|
||||
@@ -2322,6 +2347,7 @@ void tst_Dumpers::dumper_data()
|
||||
"unused(&a, &b);\n")
|
||||
% CoreProfile()
|
||||
% Cxx11Profile()
|
||||
% MacLibStdCppProfile()
|
||||
% Check("a", "<4 items>", "std::array<int, 4u>")
|
||||
% Check("b", "<4 items>", "std::array<@QString, 4u>");
|
||||
|
||||
@@ -3145,6 +3171,17 @@ void tst_Dumpers::dumper_data()
|
||||
% Check("this.@1", "[@QThread]", "\"This is thread #3\"", "@QThread")
|
||||
% Check("this.@1.@1", "[@QObject]", "\"This is thread #3\"", "@QObject");
|
||||
|
||||
QTest::newRow("QVariant0")
|
||||
<< Data("#include <QVariant>\n",
|
||||
"QVariant value;\n"
|
||||
"QVariant::Type t = QVariant::String;\n"
|
||||
"value = QVariant(t, (void*)0);\n"
|
||||
"*(QString*)value.data() = QString(\"Some string\");\n")
|
||||
% CoreProfile()
|
||||
% GdbOnly()
|
||||
% Check("t", "@QVariant::String (10)", "@QVariant::Type")
|
||||
% Check("value", "\"Some string\"", "@QVariant (QString)");
|
||||
|
||||
QTest::newRow("QVariant1")
|
||||
<< Data("#include <QVariant>\n",
|
||||
"QVariant value;\n"
|
||||
@@ -3152,7 +3189,8 @@ void tst_Dumpers::dumper_data()
|
||||
"value = QVariant(t, (void*)0);\n"
|
||||
"*(QString*)value.data() = QString(\"Some string\");\n")
|
||||
% CoreProfile()
|
||||
% Check("t", "@QVariant::String (10)", "@QVariant::Type")
|
||||
% LldbOnly()
|
||||
% Check("t", "String", "@QVariant::Type")
|
||||
% Check("value", "\"Some string\"", "@QVariant (QString)");
|
||||
|
||||
QTest::newRow("QVariant2")
|
||||
@@ -3161,20 +3199,24 @@ void tst_Dumpers::dumper_data()
|
||||
"#include <QRectF>\n"
|
||||
"#include <QStringList>\n"
|
||||
"#include <QString>\n",
|
||||
"QRect r(100, 200, 300, 400);\n"
|
||||
"QRectF rf(100.5, 200.5, 300.5, 400.5);\n"
|
||||
"QVariant var; // Type 0, invalid\n"
|
||||
"QVariant var1(true); // 1, bool\n"
|
||||
"QVariant var2(2); // 2, int\n"
|
||||
"QVariant var3(3u); // 3, uint\n"
|
||||
"QVariant var4(qlonglong(4)); // 4, qlonglong\n"
|
||||
"QVariant var5(qulonglong(5)); // 5, qulonglong\n"
|
||||
"QVariant var6(double(6)); // 6, double\n"
|
||||
"QVariant var6(double(6.0)); // 6, double\n"
|
||||
"QVariant var7(QChar(7)); // 7, QChar\n"
|
||||
//None, # 8, QVariantMap
|
||||
// None, # 9, QVariantList
|
||||
"QVariant var10(QString(\"Hello 10\")); // 10, QString\n"
|
||||
"QVariant var11(QStringList() << \"Hello\" << \"World\"); // 11, QStringList\n"
|
||||
"QVariant var19(QRect(100, 200, 300, 400)); // 19 QRect\n"
|
||||
"QVariant var20(QRectF(100, 200, 300, 400)); // 20 QRectF\n"
|
||||
"QVariant var19(r); // 19 QRect\n"
|
||||
"QVariant var20(rf); // 20 QRectF\n"
|
||||
"unused(&var, &var1, &var2, &var3, &var4, &var5, &var6);\n"
|
||||
"unused(&var, &var7, &var10, &var11, &var19, &var20);\n"
|
||||
)
|
||||
% CoreProfile()
|
||||
% Check("var", "(invalid)", "@QVariant (invalid)")
|
||||
@@ -3183,13 +3225,13 @@ void tst_Dumpers::dumper_data()
|
||||
% Check("var3", "3", "@QVariant (uint)")
|
||||
% Check("var4", "4", "@QVariant (qlonglong)")
|
||||
% Check("var5", "5", "@QVariant (qulonglong)")
|
||||
% Check("var6", "6", "@QVariant (double)")
|
||||
% Check("var6", "6.0", "@QVariant (double)")
|
||||
% Check("var7", "'?' (7)", "@QVariant (QChar)")
|
||||
% Check("var10", "\"Hello 10\"", "@QVariant (QString)")
|
||||
% Check("var11", "<2 items>", "@QVariant (QStringList)")
|
||||
% Check("var11.1", "[1]", "\"World\"", "@QString")
|
||||
% Check("var19", "300x400+100+200", "@QVariant (QRect)")
|
||||
% Check("var20", "300x400+100+200", "@QVariant (QRectF)");
|
||||
% Check("var20", "300.5x400.5+100.5+200.5", "@QVariant (QRectF)");
|
||||
|
||||
/*
|
||||
"QByteArray", # 12
|
||||
|
||||
@@ -2772,7 +2772,7 @@ void tst_TestCore::testRewriterTransactionRewriter()
|
||||
|
||||
void tst_TestCore::testRewriterPropertyDeclarations()
|
||||
{
|
||||
// Work in progress. See task https://qtrequirements.europe.nokia.com/browse/BAUHAUS-170"
|
||||
// Work in progress.
|
||||
|
||||
//
|
||||
// test properties defined in qml
|
||||
|
||||
@@ -369,6 +369,11 @@ def __isWinFirewallRunning__():
|
||||
return __isWinFirewallRunning__.fireWallState
|
||||
return None
|
||||
|
||||
def __fixQuotes__(string):
|
||||
if platform.system() in ('Windows', 'Microsoft'):
|
||||
string = '"' + string + '"'
|
||||
return string
|
||||
|
||||
# this function adds the given executable as an attachable AUT
|
||||
# Bad: executable/port could be empty strings - you should be aware of this
|
||||
def addExecutableAsAttachableAUT(executable, port, host=None):
|
||||
@@ -379,7 +384,8 @@ def addExecutableAsAttachableAUT(executable, port, host=None):
|
||||
squishSrv = __getSquishServer__()
|
||||
if (squishSrv == None):
|
||||
return False
|
||||
result = subprocess.call('%s --config addAttachableAUT "%s" %s:%s' % (squishSrv, executable, host, port), shell=True)
|
||||
result = subprocess.call(__fixQuotes__('"%s" --config addAttachableAUT "%s" %s:%s')
|
||||
% (squishSrv, executable, host, port), shell=True)
|
||||
if result == 0:
|
||||
test.passes("Added %s as attachable AUT" % executable)
|
||||
else:
|
||||
@@ -396,7 +402,8 @@ def removeExecutableAsAttachableAUT(executable, port, host=None):
|
||||
squishSrv = __getSquishServer__()
|
||||
if (squishSrv == None):
|
||||
return False
|
||||
result = subprocess.call('%s --config removeAttachableAUT "%s" %s:%s' % (squishSrv, executable, host, port), shell=True)
|
||||
result = subprocess.call(__fixQuotes__('"%s" --config removeAttachableAUT "%s" %s:%s')
|
||||
% (squishSrv, executable, host, port), shell=True)
|
||||
if result == 0:
|
||||
test.passes("Removed %s as attachable AUT" % executable)
|
||||
else:
|
||||
|
||||
@@ -57,7 +57,6 @@ def main():
|
||||
# select "Create Project" and try to create a new project.
|
||||
# create Qt Quick application from "Welcome" page -> "Develop" tab
|
||||
createNewQtQuickApplication(tempDir(), "SampleApp", fromWelcome = True)
|
||||
progressBarWait(30000)
|
||||
test.verify(checkIfObjectExists("{column='0' container=':Qt Creator_Utils::NavigationTreeView'"
|
||||
" text~='SampleApp( \(.*\))?' type='QModelIndex'}"),
|
||||
"Verifying: The project is opened in 'Edit' mode after configuring.")
|
||||
|
||||
@@ -90,6 +90,9 @@ def main():
|
||||
"Internal::QmlProfilerEventsMainView").model()
|
||||
if qtVersion.startswith("5."):
|
||||
compareEventsTab(model, "events_qt50.tsv")
|
||||
else:
|
||||
if qtVersion.startswith("4.8"):
|
||||
compareEventsTab(model, "events_qt48.tsv")
|
||||
else:
|
||||
compareEventsTab(model, "events_qt47.tsv")
|
||||
test.verify(str(model.index(0, 8).data()).endswith(' ms'))
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
"0" "1" "4" "9"
|
||||
"<program>" "Binding" "1" "Main Program"
|
||||
"main.qml:14" "Signal" "2" "triggered(): { var i; for (i = 1; i < 2500; ++i) { var j = i * i; console.log(j); } }"
|
||||
"main.qml:1" "Create" "1" "main.qml"
|
||||
"main.qml:1" "Compile" "1" "main.qml"
|
||||
"main.qml:7" "Binding" "1" "text: qsTr(""Hello World"")"
|
||||
"<bytecode>" "Binding" "2" "Source code not available."
|
||||
|
Reference in New Issue
Block a user