Merge remote-tracking branch 'origin/3.4'

This commit is contained in:
Eike Ziller
2015-03-24 07:40:21 +01:00
103 changed files with 1018 additions and 1167 deletions
+15 -2
View File
@@ -199,8 +199,9 @@
\row
\li Type
\li String
\li Optional. Value \c Required or \c Optional. Defines if the dependency is
a hard requirement or optional. Defaults to \c{Required}.
\li Optional. Value \c Required, \c Optional, or \c Test. Defines if the dependency is
a hard requirement, optional, or required for running the plugin's tests.
Defaults to \c{Required}.
\endtable
\section3 Optional Dependencies
@@ -223,6 +224,18 @@
ExtensionSystem::PluginManager::getObjectByClassName(), and use QMetaObject functions to call
functions on it.
\section3 Test Dependencies
When the user runs the application with the \c{-test} command line argument, only
the specified plugins and their dependencies are loaded. This is done in order to
speed up the execution of tests by avoiding the loading of unneeded plugins.
A plugin can specify additional dependencies that are required for running its
tests, but not for its normal execution, by declaring dependencies with
\c {"Type" : "Test"}. Test dependencies are force loaded, and do not affect load order.
This type of dependency is not transitive.
\section2 Command Line Arguments
Plugins can register command line arguments that the user can give
+8
View File
@@ -51,6 +51,10 @@
indicates lines that contain added text (painted a darker green) in the
right pane.
To revert the changes, right-click added text and then select
\uicontrol {Revert Chunk} in the context menu. To apply the changes, select
removed text and then select \uicontrol {Apply Chunk}.
To view the differences in a unified view where changed rows are placed
below each other, select
\inlineimage qtcreator-switchto-unified-diffeditor.png
@@ -99,4 +103,8 @@
If the files change outside \QC, select
\inlineimage qtcreator-regenerate-index.png
(\uicontrol {Reload Editor}) to compare them again and to show the results.
To send a chunk of changes to a \l{Pasting and Fetching Code Snippets}
{code pasting service}, select \uicontrol {Send Chunk to CodePaster} in the
context menu.
*/
+3
View File
@@ -1029,6 +1029,9 @@
To paste any content that you copied to the clipboard, select \uicontrol Tools >
\uicontrol {Code Pasting} > \uicontrol {Paste Snippet}.
To paste content from the \l{Comparing Files}{diff editor}, right-click a
chunk and select \uicontrol {Send Chunk to CodePaster} in the context menu.
To fetch a snippet of code from the server, select \uicontrol{Tools} >
\uicontrol{Code Pasting} > \uicontrol{Fetch Snippet} or press \key{Alt+C,Alt+F}. Select
the snippet to fetch from the list.
+1 -1
View File
@@ -202,7 +202,7 @@
\image qtcreator-vcs-diff.png
With Git, the diff is displayed side-by-side in a \l{Comparing Files}
With Git and Subversion, the diff is displayed side-by-side in a \l{Comparing Files}
{diff editor} by default. To use the inline diff view instead, select the
\uicontrol {Switch to Text Diff Editor} option from the toolbar. In the inline
diff view, you can use context menu commands to apply, revert, stage, and
+1 -1
View File
@@ -290,7 +290,7 @@
If it is a scheduled feature, you can see this in the task tracker. If a
feature already has been implemented, it is mentioned in the
\l{http://qt.gitorious.org/qt-creator/qt-creator/trees/master/dist}{changes file}
\l{https://code.qt.io/cgit/qt-creator/qt-creator.git/tree/dist}{changes file}
for the upcoming release.
\b {Why does \QC not use tabs for editors?}
@@ -90,7 +90,7 @@
here:
\list
\li QtCreator/src/libs/3rdparty
\li \l{http://qt.gitorious.org/qt-creator/qt-creator/trees/master/src/libs/3rdparty}
\li \l{https://code.qt.io/cgit/qt-creator/qt-creator.git/tree/src/libs/3rdparty}
\endlist
\li \b{ANGLE (Windows)}
+4 -4
View File
@@ -115,8 +115,8 @@
\list 1
\li Download the export script, \e{Export QML.jx}, from
\l{http://qt.gitorious.org/qt-labs/photoshop-qmlexporter/trees/master}
{Gitorious}.
\l{https://code.qt.io/cgit/qt-labs/photoshop-qmlexporter.git/}
{code.qt.io}.
\note Read the README.txt file in the repository for latest
information about the script.
@@ -173,8 +173,8 @@
{Tutorial: Installing Python for GIMP 2.6 (Windows)}.
\li Download the export script, \e qmlexporter.py, from
\l{http://qt.gitorious.org/qt-labs/gimp-qmlexporter/trees/master}
{Gitorious}.
\l{https://code.qt.io/cgit/qt-labs/gimp-qmlexporter.git/}
{code.qt.io}.
\note Read the INSTALL.txt in the repository for latest information
about the script.
+1
View File
@@ -8,6 +8,7 @@ QtcProduct {
property var pluginJsonReplacements
property var pluginRecommends: []
property var pluginTestDepends: []
property string minimumQtVersion: "5.3.1"
condition: QtcFunctions.versionIsAtLeast(Qt.core.version, minimumQtVersion)
+4
View File
@@ -36,6 +36,7 @@ Module {
}
}
cmd.plugin_recommends = product.pluginRecommends
cmd.plugin_test_depends = product.pluginTestDepends
cmd.sourceCode = function() {
var i;
@@ -57,6 +58,9 @@ Module {
for (i in plugin_recommends) {
deplist.push(" { \"Name\" : \"" + plugin_recommends[i] + "\", \"Version\" : \"" + project.qtcreator_version + "\", \"Type\" : \"optional\" }");
}
for (i in plugin_test_depends) {
deplist.push(" { \"Name\" : \"" + plugin_test_depends[i] + "\", \"Version\" : \"" + project.qtcreator_version + "\", \"Type\" : \"test\" }");
}
deplist = deplist.join(",\n")
vars['dependencyList'] = "\"Dependencies\" : [\n" + deplist + "\n ]";
for (i in vars) {
+1 -1
View File
@@ -67,7 +67,7 @@ def qdump__Debugger__Internal__WatchData(d, value):
d.putPlainChildren(value)
def qdump__Debugger__Internal__WatchItem(d, value):
d.putByteArrayValue(value["d"]["iname"])
d.putByteArrayValue(value["iname"])
d.putPlainChildren(value)
def qdump__Debugger__Internal__BreakpointModelId(d, value):
+85 -63
View File
@@ -67,9 +67,15 @@ StartRemoteProcess, \
# Known special formats. Keep in sync with DisplayFormat in watchhandler.h
KnownDumperFormatBase, \
AutomaticFormat, \
RawFormat, \
SimpleFormat, \
EnhancedFormat, \
SeparateFormat, \
Latin1StringFormat, \
SeparateLatin1StringFormat, \
Utf8StringFormat, \
SeparateUtf8StringFormat, \
Local8BitStringFormat, \
Utf16StringFormat, \
Ucs4StringFormat, \
@@ -77,9 +83,11 @@ Array10Format, \
Array100Format, \
Array1000Format, \
Array10000Format, \
SeparateLatin1StringFormat, \
SeparateUtf8StringFormat \
= range(100, 112)
ArrayPlotFormat, \
CompactMapFormat, \
DirectQListStorageFormat, \
IndirectQListStorageFormat, \
= range(0, 20)
# Breakpoints. Keep synchronized with BreakpointType in breakpoint.h
UnknownType, \
@@ -171,10 +179,10 @@ if hasSubprocess and hasPlot:
def arrayForms():
global hasPlot
return "Normal,Plot" if hasPlot else "Normal"
return [ArrayPlotFormat] if hasPlot else []
def mapForms():
return "Normal,Compact"
return [CompactMapFormat]
class ReportItem:
@@ -583,12 +591,13 @@ class DumperBase:
elided, shown = self.computeLimit(size, limit)
return elided, self.readMemory(data, shown)
def putStdStringHelper(self, data, size, charSize, format = None):
def putStdStringHelper(self, data, size, charSize, displayFormat = AutomaticFormat):
bytelen = size * charSize
elided, shown = self.computeLimit(bytelen, self.displayStringLimit)
mem = self.readMemory(data, shown)
if charSize == 1:
if format == 1 or format == 2:
if displayFormat == Latin1StringFormat \
or displayFormat == SeparateLatin1StringFormat:
encodingType = Hex2EncodedLatin1
else:
encodingType = Hex2EncodedUtf8
@@ -603,9 +612,11 @@ class DumperBase:
self.putNumChild(0)
self.putValue(mem, encodingType, elided=elided)
if format == 1 or format == 3:
if displayFormat == Latin1StringFormat \
or displayFormat == Utf8StringFormat:
self.putDisplay(StopDisplay)
elif format == 2 or format == 4:
elif displayFormat == SeparateLatin1StringFormat \
or displayFormat == SeparateUtf8StringFormat:
self.putField("editformat", displayType)
elided, shown = self.computeLimit(bytelen, 100000)
self.putField("editvalue", self.readMemory(data, shown))
@@ -801,9 +812,8 @@ class DumperBase:
self.putFields(value, dumpBase)
def isMapCompact(self, keyType, valueType):
format = self.currentItemFormat()
if format == 2:
return True # Compact.
if self.currentItemFormat() == CompactMapFormat:
return True
return self.isSimpleType(keyType) and self.isSimpleType(valueType)
@@ -920,13 +930,13 @@ class DumperBase:
except:
p = None
itemFormat = self.currentItemFormat()
displayFormat = self.currentItemFormat()
n = int(arrayType.sizeof / ts)
if p and self.tryPutSimpleFormattedPointer(p, str(arrayType), itemFormat, arrayType.sizeof):
if p and self.tryPutSimpleFormattedPointer(p, str(arrayType), displayFormat, arrayType.sizeof):
self.putNumChild(n)
pass
elif itemFormat is None:
elif displayFormat is None:
innerTypeName = str(innerType.unqualified())
blob = self.readMemory(self.addressOf(value), arrayType.sizeof)
if innerTypeName == "char":
@@ -969,6 +979,31 @@ class DumperBase:
pass
return str(addr)
def tryPutPrettyItem(self, typeName, value):
if self.useFancy and self.currentItemFormat() != RawFormat:
self.putType(typeName)
nsStrippedType = self.stripNamespaceFromType(typeName)\
.replace("::", "__")
# The following block is only needed for D.
if nsStrippedType.startswith("_A"):
# DMD v2.058 encodes string[] as _Array_uns long long.
# With spaces.
if nsStrippedType.startswith("_Array_"):
qdump_Array(self, value)
return True
if nsStrippedType.startswith("_AArray_"):
qdump_AArray(self, value)
return True
dumper = self.qqDumpers.get(nsStrippedType)
if not dumper is None:
dumper(self, value)
return True
return False
def tryPutArrayContents(self, base, n, innerType):
enc = self.simpleEncoding(innerType)
if not enc:
@@ -991,8 +1026,8 @@ class DumperBase:
data = self.readMemory(base, shown)
self.putValue(data, Hex2EncodedLatin1, elided=elided)
def putDisplay(self, format, value = None, cmd = None):
self.put('editformat="%s",' % format)
def putDisplay(self, editFormat, value = None, cmd = None):
self.put('editformat="%s",' % editFormat)
if cmd is None:
if not value is None:
self.put('editvalue="%s",' % value)
@@ -1000,8 +1035,8 @@ class DumperBase:
self.put('editvalue="%s|%s",' % (cmd, value))
# This is shared by pointer and array formatting.
def tryPutSimpleFormattedPointer(self, value, typeName, itemFormat, limit):
if itemFormat == None and typeName == "char":
def tryPutSimpleFormattedPointer(self, value, typeName, displayFormat, limit):
if displayFormat == AutomaticFormat and typeName == "char":
# Use Latin1 as default for char *.
self.putType(typeName)
(elided, data) = self.encodeCArray(value, 1, limit)
@@ -1009,56 +1044,49 @@ class DumperBase:
self.putDisplay(StopDisplay)
return True
if itemFormat == Latin1StringFormat:
# Explicitly requested Latin1 formatting.
if displayFormat == Latin1StringFormat:
self.putType(typeName)
(elided, data) = self.encodeCArray(value, 1, limit)
self.putValue(data, Hex2EncodedLatin1, elided=elided)
self.putDisplay(StopDisplay)
return True
if itemFormat == SeparateLatin1StringFormat:
# Explicitly requested Latin1 formatting in separate window.
if displayFormat == SeparateLatin1StringFormat:
self.putType(typeName)
(elided, data) = self.encodeCArray(value, 1, limit)
self.putValue(data, Hex2EncodedLatin1, elided=elided)
self.putDisplay(DisplayLatin1String, data)
return True
if itemFormat == Utf8StringFormat:
# Explicitly requested UTF-8 formatting.
if displayFormat == Utf8StringFormat:
self.putType(typeName)
(elided, data) = self.encodeCArray(value, 1, limit)
self.putValue(data, Hex2EncodedUtf8, elided=elided)
self.putDisplay(StopDisplay)
return True
if itemFormat == SeparateUtf8StringFormat:
# Explicitly requested UTF-8 formatting in separate window.
if displayFormat == SeparateUtf8StringFormat:
self.putType(typeName)
(elided, data) = self.encodeCArray(value, 1, limit)
self.putValue(data, Hex2EncodedUtf8, elided=elided)
self.putDisplay(DisplayUtf8String, data)
return True
if itemFormat == Local8BitStringFormat:
# Explicitly requested local 8 bit formatting.
if displayFormat == Local8BitStringFormat:
self.putType(typeName)
(elided, data) = self.encodeCArray(value, 1, limit)
self.putValue(data, Hex2EncodedLocal8Bit, elided=elided)
self.putDisplay(StopDisplay)
return True
if itemFormat == Utf16StringFormat:
# Explicitly requested UTF-16 formatting.
if displayFormat == Utf16StringFormat:
self.putType(typeName)
(elided, data) = self.encodeCArray(value, 2, limit)
self.putValue(data, Hex4EncodedLittleEndian, elided=elided)
self.putDisplay(StopDisplay)
return True
if itemFormat == Ucs4StringFormat:
# Explicitly requested UCS-4 formatting.
if displayFormat == Ucs4StringFormat:
self.putType(typeName)
(elided, data) = self.encodeCArray(value, 4, limit)
self.putValue(data, Hex8EncodedLittleEndian, elided=elided)
@@ -1091,16 +1119,16 @@ class DumperBase:
self.putNumChild(0)
return
format = self.currentItemFormat(value.type)
displayFormat = self.currentItemFormat(value.type)
if innerTypeName == "void":
#warn("VOID POINTER: %s" % format)
#warn("VOID POINTER: %s" % displayFormat)
self.putType(typeName)
self.putValue(str(value))
self.putNumChild(0)
return
if format == 0:
if displayFormat == RawFormat:
# Explicitly requested bald pointer.
self.putType(typeName)
self.putValue(self.hexencode(str(value)), Hex2EncodedUtf8WithoutQuotes)
@@ -1112,16 +1140,15 @@ class DumperBase:
return
limit = self.displayStringLimit
if format == DisplayLatin1String or format == DisplayUtf8String:
if displayFormat == SeparateLatin1StringFormat \
or displayFormat == SeparateUtf8StringFormat:
limit = 1000000
if self.tryPutSimpleFormattedPointer(value, typeName, format, limit):
if self.tryPutSimpleFormattedPointer(value, typeName, displayFormat, limit):
self.putNumChild(0)
return
if not format is None \
and format >= Array10Format and format <= Array1000Format:
# Explicitly requested formatting as array of n items.
n = (10, 100, 1000, 10000)[format - Array10Format]
if Array10Format <= displayFormat and displayFormat <= Array1000Format:
n = (10, 100, 1000, 10000)[displayFormat - Array10Format]
self.putType(typeName)
self.putItemCount(n)
self.putArrayData(value, n, innerType)
@@ -1141,9 +1168,7 @@ class DumperBase:
#warn("AUTODEREF: %s" % self.autoDerefPointers)
#warn("INAME: %s" % self.currentIName)
if self.autoDerefPointers or self.currentIName.endswith('.this'):
## Generic pointer type with format None
#warn("GENERIC AUTODEREF POINTER: %s AT %s TO %s"
# % (type, value.address, innerTypeName))
# Generic pointer type with AutomaticFormat.
# Never dereference char types.
if innerTypeName != "char" \
and innerTypeName != "signed char" \
@@ -1491,13 +1516,13 @@ class DumperBase:
return typeName == "QStringList" and self.qtVersion() >= 0x050000
def currentItemFormat(self, type = None):
format = self.formats.get(self.currentIName)
if format is None:
displayFormat = self.formats.get(self.currentIName, AutomaticFormat)
if displayFormat == AutomaticFormat:
if type is None:
type = self.currentType.value
needle = self.stripForFormat(str(type))
format = self.typeformats.get(needle)
return format
displayFormat = self.typeformats.get(needle, AutomaticFormat)
return displayFormat
def putArrayData(self, base, n, innerType = None,
childNumChild = None, maxNumChild = 10000):
@@ -1511,19 +1536,19 @@ class DumperBase:
i = toInteger(i)
self.putSubItem(i, (base + i).dereference())
def putArrayItem(self, name, addr, n, typeName, plotFormat = 2):
def putArrayItem(self, name, addr, n, typeName):
with SubItem(self, name):
self.putEmptyValue()
self.putType("%s [%d]" % (typeName, n))
self.putArrayData(addr, n, self.lookupType(typeName))
self.putAddress(addr)
def putPlotData(self, base, n, typeobj, plotFormat = 2):
def putPlotData(self, base, n, typeobj):
if self.isExpanded():
self.putArrayData(base, n, typeobj)
if hasPlot:
if self.isSimpleType(typeobj):
show = self.currentItemFormat() == plotFormat
show = self.currentItemFormat() == ArrayPlotFormat
iname = self.currentIName
data = []
if show:
@@ -1688,15 +1713,13 @@ class DumperBase:
if funcname.startswith("qdump__"):
typename = funcname[7:]
self.qqDumpers[typename] = function
self.qqFormats[typename] = self.qqFormats.get(typename, "")
self.qqFormats[typename] = self.qqFormats.get(typename, [])
elif funcname.startswith("qform__"):
typename = funcname[7:]
formats = ""
try:
formats = function()
self.qqFormats[typename] = function()
except:
pass
self.qqFormats[typename] = formats
self.qqFormats[typename] = []
elif funcname.startswith("qedit__"):
typename = funcname[7:]
try:
@@ -1721,15 +1744,14 @@ class DumperBase:
msg = "dumpers=["
for key, value in self.qqFormats.items():
if key in self.qqEditable:
msg += '{type="%s",formats="%s",editable="true"},' % (key, value)
else:
msg += '{type="%s",formats="%s"},' % (key, value)
editable = ',editable="true"' if key in self.qqEditable else ''
formats = (',formats=\"%s\"' % str(value)[1:-1]) if len(value) else ''
msg += '{type="%s"%s%s},' % (key, editable, formats)
msg += ']'
self.reportDumpers(msg)
def reportDumpers(self, msg):
raise NotImplementedError # Pure
raise NotImplementedError
def reloadDumpers(self, args):
for mod in self.dumpermodules:
+2 -29
View File
@@ -1075,35 +1075,8 @@ class Dumper(DumperBase):
self.putItem(self.expensiveDowncast(value), False)
return
format = self.currentItemFormat(typeName)
if self.useFancy and (format is None or format >= 1):
self.putType(typeName)
nsStrippedType = self.stripNamespaceFromType(typeName)\
.replace("::", "__")
# The following block is only needed for D.
if nsStrippedType.startswith("_A"):
# DMD v2.058 encodes string[] as _Array_uns long long.
# With spaces.
if nsStrippedType.startswith("_Array_"):
qdump_Array(self, value)
return
if nsStrippedType.startswith("_AArray_"):
qdump_AArray(self, value)
return
#warn(" STRIPPED: %s" % nsStrippedType)
#warn(" DUMPERS: %s" % self.qqDumpers)
#warn(" DUMPERS: %s" % (nsStrippedType in self.qqDumpers))
dumper = self.qqDumpers.get(nsStrippedType, None)
if not dumper is None:
if tryDynamic:
dumper(self, self.expensiveDowncast(value))
else:
dumper(self, value)
return
if self.tryPutPrettyItem(typeName, value):
return
# D arrays, gdc compiled.
if typeName.endswith("[]"):
+2 -9
View File
@@ -1063,15 +1063,8 @@ class Dumper(DumperBase):
#warn("VALUE: %s" % value)
#warn("FANCY: %s" % self.useFancy)
if self.useFancy:
stripped = self.stripNamespaceFromType(typeName).replace("::", "__")
#warn("STRIPPED: %s" % stripped)
#warn("DUMPABLE: %s" % (stripped in self.qqDumpers))
if stripped in self.qqDumpers:
self.putType(typeName)
self.context = value
self.qqDumpers[stripped](self, value)
return
if self.tryPutPrettyItem(typeName, value):
return
# Normal value
#numchild = 1 if value.MightHaveChildren() else 0
+30 -29
View File
@@ -53,24 +53,25 @@ def qdump__QAtomicPointer(d, value):
d.putSubItem("_q_value", q.dereference())
def qform__QByteArray():
return "Latin1 String,Latin1 String in Separate Window,UTF-8 String,UTF-8 String in Separate Window"
return [Latin1StringFormat, SeparateLatin1StringFormat,
Utf8StringFormat, SeparateUtf8StringFormat ]
def qdump__QByteArray(d, value):
data, size, alloc = d.byteArrayData(value)
d.putNumChild(size)
elided, p = d.encodeByteArrayHelper(d.extractPointer(value), d.displayStringLimit)
format = d.currentItemFormat()
if format == 1 or format is None:
displayFormat = d.currentItemFormat()
if displayFormat == AutomaticFormat or displayFormat == Latin1StringFormat:
d.putDisplay(StopDisplay)
d.putValue(p, Hex2EncodedLatin1, elided=elided)
elif format == 2:
elif displayFormat == SeparateLatin1StringFormat:
d.putValue(p, Hex2EncodedLatin1, elided=elided)
d.putField("editformat", DisplayLatin1String)
d.putField("editvalue", d.encodeByteArray(value, limit=100000))
elif format == 3:
elif displayFormat == Utf8StringFormat:
d.putDisplay(StopDisplay)
d.putValue(p, Hex2EncodedUtf8, elided=elided)
elif format == 4:
elif displayFormat == SeparateUtf8StringFormat:
d.putValue(p, Hex2EncodedUtf8, elided=elided)
d.putField("editformat", DisplayUtf8String)
d.putField("editvalue", d.encodeByteArray(value, limit=100000))
@@ -92,14 +93,14 @@ def qdump__QChar(d, value):
def qform__QAbstractItemModel():
return "Normal,Enhanced"
return [SimpleFormat, EnhancedFormat]
def qdump__QAbstractItemModel(d, value):
format = d.currentItemFormat()
if format == 1:
displayFormat = d.currentItemFormat()
if displayFormat == SimpleFormat:
d.putPlainChildren(value)
return
#format == 2:
#displayFormat == EnhancedFormat:
# Create a default-constructed QModelIndex on the stack.
try:
ri = d.makeValue(d.qtNamespace() + "QModelIndex", "-1, -1, 0, 0")
@@ -134,11 +135,11 @@ def qdump__QAbstractItemModel(d, value):
#gdb.execute("call free($ri)")
def qform__QModelIndex():
return "Normal,Enhanced"
return [SimpleFormat, EnhancedFormat]
def qdump__QModelIndex(d, value):
format = d.currentItemFormat()
if format == 1:
displayFormat = d.currentItemFormat()
if displayFormat == SimpleFormat:
d.putPlainChildren(value)
return
r = value["r"]
@@ -768,7 +769,7 @@ def qdump__QIPv6Address(d, value):
d.putPlainChildren(c)
def qform__QList():
return "Assume Direct Storage,Assume Indirect Storage"
return [DirectQListStorageFormat, IndirectQListStorageFormat]
def qdump__QList(d, value):
base = d.extractPointer(value)
@@ -794,10 +795,10 @@ def qdump__QList(d, value):
# but this data is available neither in the compiled binary nor
# in the frontend.
# So as first approximation only do the 'isLarge' check:
format = d.currentItemFormat()
if format == 1:
displayFormat = d.currentItemFormat()
if displayFormat == DirectQListStorageFormat:
isInternal = True
elif format == 2:
elif displayFormat == IndirectQListStorageFormat:
isInternal = False
else:
isInternal = innerSize <= stepSize and d.isMovableType(innerType)
@@ -818,7 +819,7 @@ def qdump__QList(d, value):
d.putSubItem(i, x)
def qform__QImage():
return "Normal,Displayed"
return [SimpleFormat, SeparateFormat]
def qdump__QImage(d, value):
# This relies on current QImage layout:
@@ -861,10 +862,10 @@ def qdump__QImage(d, value):
d.putNumChild(0)
d.putType("void *")
format = d.currentItemFormat()
if format == 1:
displayFormat = d.currentItemFormat()
if displayFormat == SimpleFormat:
d.putDisplay(StopDisplay)
elif format == 2:
elif displayFormat == SeparateFormat:
# This is critical for performance. Writing to an external
# file using the following is faster when using GDB.
# file = tempfile.mkstemp(prefix="gdbpy_")
@@ -1751,16 +1752,16 @@ def qedit__QString(d, value, data):
d.setValues(base, "short", [ord(c) for c in data])
def qform__QString():
return "Inline,Separate Window"
return [SimpleFormat, SeparateFormat]
def qdump__QString(d, value):
d.putStringValue(value)
data, size, alloc = d.stringData(value)
d.putNumChild(size)
format = d.currentItemFormat()
if format == 1:
displayFormat = d.currentItemFormat()
if displayFormat == SimpleFormat:
d.putDisplay(StopDisplay)
elif format == 2:
elif displayFormat == SeparateFormat:
d.putField("editformat", DisplayUtf16String)
d.putField("editvalue", d.encodeString(value, limit=100000))
if d.isExpanded():
@@ -1847,7 +1848,7 @@ def qdump__QTextDocument(d, value):
def qform__QUrl():
return "Inline,Separate Window"
return [SimpleFormat, SeparateFormat]
def qdump__QUrl(d, value):
if d.qtVersion() < 0x050000:
@@ -1911,10 +1912,10 @@ def qdump__QUrl(d, value):
url += path
d.putValue(url, Hex4EncodedLittleEndian)
format = d.currentItemFormat()
if format == 1:
displayFormat = d.currentItemFormat()
if displayFormat == SimpleFormat:
d.putDisplay(StopDisplay)
elif format == 2:
elif displayFormat == SeparateFormat:
d.putField("editformat", DisplayUtf16String)
d.putField("editvalue", url)
+3 -2
View File
@@ -398,7 +398,8 @@ def qdump__std____debug__stack(d, value):
qdump__std__stack(d, value)
def qform__std__string():
return "Latin1 String,Latin1 String in Separate Window,UTF-8 String,UTF-8 String in Separate Window"
return [Latin1StringFormat, SeparateLatin1StringFormat,
Utf8StringFormat, SeparateUtf8StringFormat ]
def qdump__std__string(d, value):
qdump__std__stringHelper1(d, value, 1, d.currentItemFormat())
@@ -787,7 +788,7 @@ def qdump__string(d, value):
qdump__std__string(d, value)
def qform__std__wstring():
return "Inline String,String in Separate Window"
return [SimpleFormat, SeparateFormat]
def qdump__std__wstring(d, value):
charSize = d.lookupType('wchar_t').sizeof
+4
View File
@@ -87,6 +87,10 @@ OutputPaneToggleButtonTextColorChecked=text
OutputPaneToggleButtonTextColorUnchecked=text
QtOutputFormatter_LinkTextColor=ff0000ff
CompileOutput_ErrorOutput=ffff6c6c
CompileOutput_MessageOutput=ff008787
CompileOutput_ErrorMessageOutput=ffff6c6c
Welcome_BackgroundColorNormal=normalBackground
Welcome_Button_BorderColorNormal=0
Welcome_Button_BorderColorPressed=0
@@ -81,6 +81,10 @@ OutputPaneToggleButtonTextColorChecked=ffffffff
OutputPaneToggleButtonTextColorUnchecked=ff000000
QtOutputFormatter_LinkTextColor=ff0000aa
CompileOutput_ErrorOutput=ffaa0000
CompileOutput_MessageOutput=ff0000aa
CompileOutput_ErrorMessageOutput=ffaa0000
Welcome_BackgroundColorNormal=ffffffff
Welcome_Button_BorderColorNormal=ff737373
Welcome_Button_BorderColorPressed=ff333333
+6 -4
View File
@@ -63,8 +63,10 @@ public:
{
TypeVisitor::accept(ty.type());
unsigned flags = ty.flags();
flags |= temps.back().flags();
temps.back().setFlags(flags);
if (!temps.isEmpty()) {
flags |= temps.back().flags();
temps.back().setFlags(flags);
}
}
public:
@@ -73,7 +75,7 @@ public:
FullySpecifiedType operator()(const FullySpecifiedType &ty)
{
accept(ty);
return temps.takeLast();
return (!temps.isEmpty()) ? temps.takeLast() : ty;
}
virtual void visit(UndefinedType *)
@@ -241,7 +243,7 @@ public:
return 0;
accept(name);
return temps.takeLast();
return (!temps.isEmpty()) ? temps.takeLast() : name;
}
virtual void visit(const QualifiedNameId *name)
@@ -91,6 +91,7 @@ bool OptionsParser::parse()
}
if (m_isDependencyRefreshNeeded)
m_pmPrivate->resolveDependencies();
m_pmPrivate->enableOnlyTestedSpecs();
return !m_hasError;
}
@@ -98,8 +98,16 @@ void PluginDetailsView::update(PluginSpec *spec)
QString depString = dep.name;
depString += QLatin1String(" (");
depString += dep.version;
if (dep.type == PluginDependency::Optional)
switch (dep.type) {
case PluginDependency::Required:
break;
case PluginDependency::Optional:
depString += QLatin1String(", optional");
break;
case PluginDependency::Test:
depString += QLatin1String(", test");
break;
}
depString += QLatin1Char(')');
depStrings.append(depString);
}
+38 -2
View File
@@ -1255,7 +1255,14 @@ bool PluginManagerPrivate::loadQueue(PluginSpec *spec, QList<PluginSpec *> &queu
}
// add dependencies
foreach (PluginSpec *depSpec, spec->dependencySpecs()) {
QHashIterator<PluginDependency, PluginSpec *> it(spec->dependencySpecs());
while (it.hasNext()) {
it.next();
// Skip test dependencies since they are not real dependencies but just force-loaded
// plugins when running tests
if (it.key().type == PluginDependency::Test)
continue;
PluginSpec *depSpec = it.value();
if (!loadQueue(depSpec, queue, circularityCheckQueue)) {
spec->d->hasError = true;
spec->d->errorString =
@@ -1299,7 +1306,7 @@ void PluginManagerPrivate::loadPlugin(PluginSpec *spec, PluginSpec::State destSt
QHashIterator<PluginDependency, PluginSpec *> it(spec->dependencySpecs());
while (it.hasNext()) {
it.next();
if (it.key().type == PluginDependency::Optional)
if (it.key().type != PluginDependency::Required)
continue;
PluginSpec *depSpec = it.value();
if (depSpec->state() != destState) {
@@ -1423,6 +1430,35 @@ void PluginManagerPrivate::resolveDependencies()
}
}
void PluginManagerPrivate::enableOnlyTestedSpecs()
{
if (testSpecs.isEmpty())
return;
QList<PluginSpec *> specsForTests;
foreach (const TestSpec &testSpec, testSpecs) {
QList<PluginSpec *> circularityCheckQueue;
loadQueue(testSpec.pluginSpec, specsForTests, circularityCheckQueue);
// add plugins that must be force loaded when running tests for the plugin
// (aka "test dependencies")
QHashIterator<PluginDependency, PluginSpec *> it(testSpec.pluginSpec->dependencySpecs());
while (it.hasNext()) {
it.next();
if (it.key().type != PluginDependency::Test)
continue;
PluginSpec *depSpec = it.value();
circularityCheckQueue.clear();
loadQueue(depSpec, specsForTests, circularityCheckQueue);
}
}
foreach (PluginSpec *spec, pluginSpecs)
spec->setForceDisabled(true);
foreach (PluginSpec *spec, specsForTests) {
spec->setForceDisabled(false);
spec->setForceEnabled(true);
}
}
// Look in argument descriptions of the specs for the option.
PluginSpec *PluginManagerPrivate::pluginForOption(const QString &option, bool *requiresArgument) const
{
@@ -73,6 +73,7 @@ public:
QList<PluginSpec *> loadQueue();
void loadPlugin(PluginSpec *spec, PluginSpec::State destState);
void resolveDependencies();
void enableOnlyTestedSpecs();
void initProfiling();
void profilingSummary() const;
void profilingReport(const char *what, const PluginSpec *spec = 0);
+6 -1
View File
@@ -86,6 +86,8 @@
Dependency is not necessarily needed. You need to make sure that
the plugin is able to load without this dependency installed, so
for example you may not link to the dependency's library.
\value Test
Dependency needs to be force-loaded for running tests of the plugin.
*/
/*!
@@ -471,6 +473,7 @@ namespace {
const char DEPENDENCY_TYPE[] = "Type";
const char DEPENDENCY_TYPE_SOFT[] = "optional";
const char DEPENDENCY_TYPE_HARD[] = "required";
const char DEPENDENCY_TYPE_TEST[] = "test";
const char ARGUMENTS[] = "Arguments";
const char ARGUMENT_NAME[] = "Name";
const char ARGUMENT_PARAMETER[] = "Parameter";
@@ -763,6 +766,8 @@ bool PluginSpecPrivate::readMetaData(const QJsonObject &metaData)
dep.type = PluginDependency::Required;
} else if (typeValue.toLower() == QLatin1String(DEPENDENCY_TYPE_SOFT)) {
dep.type = PluginDependency::Optional;
} else if (typeValue.toLower() == QLatin1String(DEPENDENCY_TYPE_TEST)) {
dep.type = PluginDependency::Test;
} else {
return reportError(tr("Dependency: \"%1\" must be \"%2\" or \"%3\" (is \"%4\")")
.arg(QLatin1String(DEPENDENCY_TYPE),
@@ -917,7 +922,7 @@ void PluginSpecPrivate::disableIndirectlyIfDependencyDisabled()
QHashIterator<PluginDependency, PluginSpec *> it(dependencySpecs);
while (it.hasNext()) {
it.next();
if (it.key().type == PluginDependency::Optional)
if (it.key().type != PluginDependency::Required)
continue;
PluginSpec *dependencySpec = it.value();
if (!dependencySpec->isEffectivelyEnabled()) {
+2 -1
View File
@@ -55,7 +55,8 @@ struct EXTENSIONSYSTEM_EXPORT PluginDependency
{
enum Type {
Required,
Optional
Optional,
Test
};
PluginDependency() : type(Required) {}
@@ -1731,7 +1731,8 @@ static inline bool dumpQByteArray(const SymbolGroupValue &v, std::wostream &str,
char *memory;
unsigned fullSize;
unsigned size;
if (!readQt5StringData(dV, qtInfo, false, 0, 10240, &fullSize, &size, &memory))
const unsigned &maxStringSize = ExtensionContext::instance().parameters().maxStringLength;
if (!readQt5StringData(dV, qtInfo, false, 0, maxStringSize, &fullSize, &size, &memory))
return false;
if (size) {
// Emulate CDB's behavior of replacing unprintable characters
+2 -2
View File
@@ -28,8 +28,8 @@
**
****************************************************************************/
vec4 orange = vec4(1.0, 165.0 / 255.0, 0.0, 1.0);
varying float d;
lowp vec4 orange = vec4(1.0, 165.0 / 255.0, 0.0, 1.0);
varying lowp float d;
void main()
{
+9 -4
View File
@@ -28,17 +28,22 @@
**
****************************************************************************/
#ifdef GL_OES_standard_derivatives
#extension GL_OES_standard_derivatives : enable
// else we probably have fwidth() in core
#endif
varying lowp vec3 edgeColor;
varying lowp vec3 color;
varying lowp vec2 barycentric;
vec4 zero = vec4(0.0);
lowp vec4 zero = vec4(0.0);
void main()
{
vec2 d = fwidth(barycentric) * 5.0;
vec4 edge_closeness = smoothstep(zero, vec4(d.x, d.y, d.x, d.y),
lowp vec2 d = fwidth(barycentric) * 5.0;
lowp vec4 edge_closeness = smoothstep(zero, vec4(d.x, d.y, d.x, d.y),
vec4(barycentric.x, barycentric.y, 1.0 - barycentric.x, 1.0 - barycentric.y));
float total = min(min(edge_closeness[0], edge_closeness[1]),
lowp float total = min(min(edge_closeness[0], edge_closeness[1]),
min(edge_closeness[2], edge_closeness[3]));
// square to make lines sharper
total = total > 0.5 ? (1.0 - (1.0 - total) * (1.0 - total) * 2.0) : total * total * 2.0;
+4 -4
View File
@@ -47,13 +47,13 @@ void main()
gl_Position = matrix * vertexCoord;
// Make very narrow events somewhat wider so that they don't collapse into 0 pixels
highp float scaledWidth = scale.x * rectSize.x;
highp float shift = sign(scaledWidth) * max(0, 3.0 - abs(scaledWidth)) * 0.0005;
float scaledWidth = scale.x * rectSize.x;
float shift = sign(scaledWidth) * max(0.0, 3.0 - abs(scaledWidth)) * 0.0005;
gl_Position.x += shift;
// Ditto for events with very small height
highp float scaledHeight = scale.y * rectSize.y;
gl_Position.y += float(rectSize.y > 0.0) * max(0, 3.0 - scaledHeight) * 0.003;
float scaledHeight = scale.y * rectSize.y;
gl_Position.y += float(rectSize.y > 0.0) * max(0.0, 3.0 - scaledHeight) * 0.003;
barycentric = vec2(rectSize.x > 0.0 ? 1.0 : 0.0, rectSize.y > 0.0 ? 1.0 : 0.0);
color = vertexColor.rgb;
+6
View File
@@ -133,6 +133,12 @@ public:
QtOutputFormatter_LinkTextColor,
/* Compile Output Pane */
CompileOutput_ErrorOutput,
CompileOutput_MessageOutput,
CompileOutput_ErrorMessageOutput,
/* Welcome Plugin */
Welcome_TextColorNormal,
+11
View File
@@ -725,6 +725,17 @@ void TreeItem::removeChildren()
}
}
void TreeItem::sortChildren(const std::function<bool(const TreeItem *, const TreeItem *)> &cmp)
{
if (m_model) {
m_model->layoutAboutToBeChanged();
std::sort(m_children.begin(), m_children.end(), cmp);
m_model->layoutChanged();
} else {
std::sort(m_children.begin(), m_children.end(), cmp);
}
}
void TreeItem::update()
{
if (m_model) {
+1
View File
@@ -88,6 +88,7 @@ public:
void appendChild(TreeItem *item);
void insertChild(int pos, TreeItem *item);
void removeChildren();
void sortChildren(const std::function<bool(const TreeItem *, const TreeItem *)> &cmp);
void update();
void updateColumn(int column);
void expand();
@@ -41,7 +41,6 @@
#include <cplusplus/ExpressionUnderCursor.h>
#include <cplusplus/TypeOfExpression.h>
#include <cpptools/cppmodelmanager.h>
#include <QTextCursor>
@@ -45,8 +45,6 @@
#include <qtsupport/qtkitinformation.h>
#include <qtsupport/qtversionmanager.h>
#include <utils/pathchooser.h>
#include <QFile>
#include <QTextStream>
#include <QProcess>
-1
View File
@@ -31,7 +31,6 @@
#ifndef CONSTANTS_H
#define CONSTANTS_H
#include <QtCore/QLatin1Char>
#include <QtCore/QLatin1Char>
namespace ClangCodeModel {
@@ -397,8 +397,8 @@ void SettingsDialog::showPage(const Id pageId)
}
}
QTC_ASSERT(!initialPageId.isValid() || initialPageIndex != -1,
qDebug("Unknown page: %s", initialPageId.name().constData()));
if (initialPageId.isValid() && initialPageIndex == -1)
return; // Unknown settings page, probably due to missing plugin.
if (initialCategoryIndex != -1) {
const QModelIndex modelIndex = m_proxyModel->mapFromSource(m_model->index(initialCategoryIndex));
@@ -127,8 +127,6 @@ QString IVersionControl::TopicCache::topic(const QString &topLevel)
#if defined(WITH_TESTS)
#include "vcsmanager.h"
#include <QFileInfo>
namespace Core {
+3 -2
View File
@@ -494,8 +494,9 @@ void OutputPaneManager::showPage(int idx, int flags)
ensurePageVisible(idx);
IOutputPane *out = m_panes.at(idx);
out->visibilityChanged(true);
if (flags & IOutputPane::WithFocus && out->canFocus()) {
out->setFocus();
if (flags & IOutputPane::WithFocus) {
if (out->canFocus())
out->setFocus();
ICore::raiseWindow(m_outputWidgetPane);
}
-1
View File
@@ -491,7 +491,6 @@ void VcsManager::handleConfigurationChanges()
#include <QtTest>
#include "coreplugin.h"
#include "iversioncontrol.h"
#include <extensionsystem/pluginmanager.h>
-1
View File
@@ -48,7 +48,6 @@
#include <coreplugin/editormanager/editormanager.h>
#include <coreplugin/editormanager/documentmodel.h>
#include <cpptools/cppchecksymbols.h>
#include <cpptools/cppchecksymbols.h>
#include <cpptools/cppcodeformatter.h>
#include <cpptools/cppcompletionassistprovider.h>
+4
View File
@@ -15,6 +15,10 @@ QtcPlugin {
Depends { name: "app_version_header" }
pluginTestDepends: [
"QmakeProjectManager",
]
files: [
"cppautocompleter.cpp", "cppautocompleter.h",
"cppcanonicalsymbol.cpp", "cppcanonicalsymbol.h",
@@ -8,3 +8,5 @@ QTC_PLUGIN_DEPENDS += \
coreplugin \
cpptools \
projectexplorer
QTC_TEST_DEPENDS += \
qmakeprojectmanager
@@ -33,7 +33,6 @@
#include "builtineditordocumentparser.h"
#include "cppdoxygen.h"
#include "cppmodelmanager.h"
#include "cppmodelmanager.h"
#include "cpptoolsconstants.h"
#include "cpptoolsreuse.h"
#include "editordocumenthandle.h"
@@ -30,7 +30,6 @@
#include "cpppointerdeclarationformatter.h"
#include "cpptoolsplugin.h"
#include "cpptoolsplugin.h"
#include "cpptoolstestcase.h"
#include <coreplugin/coreconstants.h>
+5
View File
@@ -13,6 +13,11 @@ QtcPlugin {
Depends { name: "ProjectExplorer" }
Depends { name: "app_version_header" }
pluginTestDepends: [
"CppEditor",
"QmakeProjectManager",
]
cpp.defines: base
Properties {
condition: qbs.toolchain.contains("msvc")
@@ -7,3 +7,6 @@ QTC_PLUGIN_DEPENDS += \
coreplugin \
projectexplorer \
texteditor
QTC_TEST_DEPENDS += \
cppeditor \
qmakeprojectmanager
+38 -33
View File
@@ -480,12 +480,12 @@ bool CdbEngine::startConsole(const DebuggerStartParameters &sp, QString *errorMe
qDebug("startConsole %s", qPrintable(sp.executable));
m_consoleStub.reset(new ConsoleProcess);
m_consoleStub->setMode(ConsoleProcess::Suspend);
connect(m_consoleStub.data(), SIGNAL(processError(QString)),
SLOT(consoleStubError(QString)));
connect(m_consoleStub.data(), SIGNAL(processStarted()),
SLOT(consoleStubProcessStarted()));
connect(m_consoleStub.data(), SIGNAL(stubStopped()),
SLOT(consoleStubExited()));
connect(m_consoleStub.data(), &ConsoleProcess::processError,
this, &CdbEngine::consoleStubError);
connect(m_consoleStub.data(), &ConsoleProcess::processStarted,
this, &CdbEngine::consoleStubProcessStarted);
connect(m_consoleStub.data(), &ConsoleProcess::stubStopped,
this, &CdbEngine::consoleStubExited);
m_consoleStub->setWorkingDirectory(sp.workingDirectory);
if (sp.environment.size())
m_consoleStub->setEnvironment(sp.environment);
@@ -576,17 +576,21 @@ void CdbEngine::setupEngine()
STATE_DEBUG(state(), Q_FUNC_INFO, __LINE__, "notifyEngineSetupFailed")
notifyEngineSetupFailed();
}
const QString normalFormat = tr("Normal");
const QStringList stringFormats = QStringList()
<< normalFormat << tr("Separate Window");
DisplayFormats stringFormats;
stringFormats.append(SimpleFormat);
stringFormats.append(SeparateFormat);
WatchHandler *wh = watchHandler();
wh->addTypeFormats("QString", stringFormats);
wh->addTypeFormats("QString *", stringFormats);
wh->addTypeFormats("QByteArray", stringFormats);
wh->addTypeFormats("QByteArray *", stringFormats);
wh->addTypeFormats("std__basic_string", stringFormats); // Python dumper naming convention for std::[w]string
const QStringList imageFormats = QStringList()
<< normalFormat << tr("Image");
DisplayFormats imageFormats;
imageFormats.append(SimpleFormat);
imageFormats.append(EnhancedFormat);
wh->addTypeFormats("QImage", imageFormats);
wh->addTypeFormats("QImage *", imageFormats);
}
@@ -974,46 +978,47 @@ static inline bool isWatchIName(const QByteArray &iname)
return iname.startsWith("watch");
}
void CdbEngine::updateWatchData(const WatchData &dataIn)
void CdbEngine::updateWatchItem(WatchItem *item)
{
if (debug || debugLocals || debugWatches)
qDebug("CdbEngine::updateWatchData() %dms accessible=%d %s: %s",
elapsedLogTime(), m_accessible, stateName(state()),
qPrintable(dataIn.toString()));
qPrintable(item->toString()));
if (!m_accessible) // Add watch data while running?
return;
// New watch item?
if (dataIn.isWatcher() && dataIn.isValueNeeded()) {
if (item->isWatcher() && item->isValueNeeded()) {
QByteArray args;
ByteArrayInputStream str(args);
str << dataIn.iname << " \"" << dataIn.exp << '"';
WatchData data = *item; // Don't pass pointers to async functions.
str << data.iname << " \"" << data.exp << '"';
postExtensionCommand("addwatch", args, 0,
[this, dataIn](const CdbResponse &r) { handleAddWatch(r, dataIn); });
[this, data](const CdbResponse &r) { handleAddWatch(r, data); });
return;
}
if (!dataIn.hasChildren && !dataIn.isValueNeeded()) {
WatchData data = dataIn;
data.setAllUnneeded();
watchHandler()->insertData(data);
return;
if (item->wantsChildren || item->isValueNeeded()) {
updateLocalVariable(item->iname);
} else {
item->setAllUnneeded();
item->update();
}
updateLocalVariable(dataIn.iname);
}
void CdbEngine::handleAddWatch(const CdbResponse &response, WatchData item)
void CdbEngine::handleAddWatch(const CdbResponse &response, WatchData data)
{
if (debugWatches)
qDebug() << "handleAddWatch ok=" << response.success << item.iname;
qDebug() << "handleAddWatch ok=" << response.success << data.iname;
if (response.success) {
updateLocalVariable(item.iname);
updateLocalVariable(data.iname);
} else {
item.setError(tr("Unable to add expression"));
watchHandler()->insertData(item);
auto item = new WatchItem(data);
item->setError(tr("Unable to add expression"));
watchHandler()->insertItem(item);
showMessage(QString::fromLatin1("Unable to add watch item \"%1\"/\"%2\": %3").
arg(QString::fromLatin1(item.iname), QString::fromLatin1(item.exp),
arg(QString::fromLatin1(data.iname), QString::fromLatin1(data.exp),
QString::fromLocal8Bit(response.errorMessage)), LogError);
}
}
@@ -1165,8 +1170,8 @@ void CdbEngine::doInterruptInferior(SpecialStopMode sm)
m_signalOperation = startParameters().device->signalOperation();
m_specialStopMode = sm;
QTC_ASSERT(m_signalOperation, notifyInferiorStopFailed(); return;);
connect(m_signalOperation.data(), SIGNAL(finished(QString)),
SLOT(handleDoInterruptInferior(QString)));
connect(m_signalOperation.data(), &DeviceProcessSignalOperation::finished,
this, &CdbEngine::handleDoInterruptInferior);
m_signalOperation->setDebuggerCommand(startParameters().debuggerCommand);
m_signalOperation->interruptProcess(inferiorPid());
@@ -1269,7 +1274,7 @@ static inline bool isAsciiWord(const QString &s)
return true;
}
void CdbEngine::assignValueInDebugger(const WatchData *w, const QString &expr, const QVariant &value)
void CdbEngine::assignValueInDebugger(WatchItem *w, const QString &expr, const QVariant &value)
{
if (debug)
qDebug() << "CdbEngine::assignValueInDebugger" << w->iname << expr << value;
@@ -1871,13 +1876,13 @@ void CdbEngine::handleLocals(const CdbResponse &response, bool newFrame)
QSet<QByteArray> toDelete;
if (newFrame) {
foreach (WatchItem *item, handler->model()->treeLevelItems<WatchItem *>(2))
toDelete.insert(item->d.iname);
toDelete.insert(item->iname);
}
foreach (const GdbMi &child, all.children()) {
WatchItem *item = new WatchItem(child);
handler->insertItem(item);
toDelete.remove(item->d.iname);
toDelete.remove(item->iname);
}
handler->purgeOutdatedItems(toDelete);
+2 -2
View File
@@ -89,7 +89,7 @@ public:
virtual void shutdownEngine();
virtual void abortDebugger();
virtual void detachDebugger();
virtual void updateWatchData(const WatchData &data);
virtual void updateWatchItem(WatchItem *item);
virtual bool hasCapability(unsigned cap) const;
virtual void watchPoint(const QPoint &);
virtual void setRegisterValue(const QByteArray &name, const QString &value);
@@ -106,7 +106,7 @@ public:
virtual void executeRunToLine(const ContextData &data);
virtual void executeRunToFunction(const QString &functionName);
virtual void executeJumpToLine(const ContextData &data);
virtual void assignValueInDebugger(const WatchData *w, const QString &expr, const QVariant &value);
virtual void assignValueInDebugger(WatchItem *w, const QString &expr, const QVariant &value);
virtual void executeDebuggerCommand(const QString &command, DebuggerLanguages languages);
virtual void activateFrame(int index);
+4 -9
View File
@@ -807,7 +807,7 @@ public:
}
void addTypeFormats(const QString &type,
const QStringList &typeFormats, int current)
const DisplayFormats &typeFormats, int current)
{
const int row = m_layout->rowCount();
int column = 0;
@@ -815,7 +815,8 @@ public:
m_layout->addWidget(new QLabel(type), row, column++);
for (int i = -1; i != typeFormats.size(); ++i) {
QRadioButton *choice = new QRadioButton(this);
choice->setText(i == -1 ? TypeFormatsDialog::tr("Reset") : typeFormats.at(i));
choice->setText(i == -1 ? TypeFormatsDialog::tr("Reset")
: WatchHandler::nameForFormat(typeFormats.at(i)));
m_layout->addWidget(choice, row, column++);
if (i == current)
choice->setChecked(true);
@@ -868,7 +869,6 @@ private:
//
///////////////////////////////////////////////////////////////////////
TypeFormatsDialog::TypeFormatsDialog(QWidget *parent)
: QDialog(parent), m_ui(new TypeFormatsDialogUi(this))
{
@@ -888,7 +888,7 @@ TypeFormatsDialog::~TypeFormatsDialog()
}
void TypeFormatsDialog::addTypeFormats(const QString &type0,
const QStringList &typeFormats, int current)
const DisplayFormats &typeFormats, int current)
{
QString type = type0;
type.replace(QLatin1String("__"), QLatin1String("::"));
@@ -900,10 +900,5 @@ void TypeFormatsDialog::addTypeFormats(const QString &type0,
m_ui->pages[pos]->addTypeFormats(type, typeFormats, current);
}
DumperTypeFormats TypeFormatsDialog::typeFormats() const
{
return DumperTypeFormats();
}
} // namespace Internal
} // namespace Debugger
+3 -4
View File
@@ -31,6 +31,8 @@
#ifndef DEBUGGER_DIALOGS_H
#define DEBUGGER_DIALOGS_H
#include "watchhandler.h"
#include <projectexplorer/kitchooser.h>
#include <projectexplorer/abi.h>
@@ -162,8 +164,6 @@ private:
QDialogButtonBox *m_box;
};
typedef QHash<QString, QStringList> DumperTypeFormats;
class StartRemoteEngineDialog : public QDialog
{
Q_OBJECT
@@ -191,9 +191,8 @@ public:
explicit TypeFormatsDialog(QWidget *parent);
~TypeFormatsDialog();
void addTypeFormats(const QString &type, const QStringList &formats,
void addTypeFormats(const QString &type, const DisplayFormats &formats,
int currentFormat);
DumperTypeFormats typeFormats() const;
private:
TypeFormatsDialogUi *m_ui;
+1 -5
View File
@@ -1439,10 +1439,6 @@ bool DebuggerEngine::setToolTipExpression(const DebuggerToolTipContext &)
return false;
}
void DebuggerEngine::updateWatchData(const WatchData &)
{
}
void DebuggerEngine::watchDataSelected(const QByteArray &)
{
}
@@ -1635,7 +1631,7 @@ void DebuggerEngine::changeBreakpoint(Breakpoint bp)
QTC_CHECK(false);
}
void DebuggerEngine::assignValueInDebugger(const WatchData *,
void DebuggerEngine::assignValueInDebugger(WatchItem *,
const QString &, const QVariant &)
{
}
+3 -2
View File
@@ -62,6 +62,7 @@ class DebuggerPluginPrivate;
class DisassemblerAgent;
class MemoryAgent;
class WatchData;
class WatchItem;
class BreakHandler;
class ModulesHandler;
class RegisterHandler;
@@ -139,7 +140,7 @@ public:
virtual bool setToolTipExpression(const Internal::DebuggerToolTipContext &);
virtual void updateWatchData(const Internal::WatchData &data);
virtual void updateWatchItem(WatchItem *) {}
virtual void watchDataSelected(const QByteArray &iname);
virtual void startDebugger(DebuggerRunControl *runControl);
@@ -198,7 +199,7 @@ public:
virtual bool acceptsDebuggerCommands() const { return true; }
virtual void executeDebuggerCommand(const QString &command, DebuggerLanguages languages);
virtual void assignValueInDebugger(const Internal::WatchData *data,
virtual void assignValueInDebugger(WatchItem *item,
const QString &expr, const QVariant &value);
virtual void selectThread(Internal::ThreadId threadId) = 0;
+6 -12
View File
@@ -727,14 +727,6 @@ public:
void enableReverseDebuggingTriggered(const QVariant &value);
void showStatusMessage(const QString &msg, int timeout = -1);
DebuggerMainWindow *mainWindow() const { return m_mainWindow; }
bool isDockVisible(const QString &objectName) const
{
QDockWidget *dock = mainWindow()->findChild<QDockWidget *>(objectName);
return dock && dock->toggleViewAction()->isChecked();
}
void runControlStarted(DebuggerEngine *engine);
void runControlFinished(DebuggerEngine *engine);
void remoteCommand(const QStringList &options);
@@ -919,6 +911,7 @@ public slots:
exp = removeObviousSideEffects(exp);
else
exp = fixCppExpression(exp);
exp = exp.trimmed();
if (exp.isEmpty())
return;
currentEngine()->watchHandler()->watchVariable(exp);
@@ -1822,7 +1815,7 @@ void DebuggerPluginPrivate::connectEngine(DebuggerEngine *engine)
engine->watchHandler()->resetWatchers();
mainWindow()->setEngineDebugLanguages(engine->startParameters().languages);
m_mainWindow->setEngineDebugLanguages(engine->startParameters().languages);
}
static void changeFontSize(QWidget *widget, qreal size)
@@ -2048,7 +2041,7 @@ void DebuggerPluginPrivate::updateState(DebuggerEngine *engine)
m_detachAction->setEnabled(detachable);
if (stopped)
QApplication::alert(mainWindow(), 3000);
QApplication::alert(m_mainWindow, 3000);
const bool canReverse = engine->hasCapability(ReverseSteppingCapability)
&& boolSetting(EnableReverseDebugging);
@@ -3196,12 +3189,13 @@ void synchronizeBreakpoints()
QWidget *mainWindow()
{
return dd->mainWindow();
return dd->m_mainWindow;
}
bool isDockVisible(const QString &objectName)
{
return dd->isDockVisible(objectName);
QDockWidget *dock = dd->m_mainWindow->findChild<QDockWidget *>(objectName);
return dock && dock->toggleViewAction()->isChecked();
}
void openMemoryEditor()
@@ -218,9 +218,9 @@ ToolTipWatchItem::ToolTipWatchItem(WatchItem *item)
name = item->displayName();
value = item->displayValue();
type = item->displayType();
iname = item->d.iname;
iname = item->iname;
valueColor = item->valueColor();
expandable = item->d.hasChildren;
expandable = item->hasChildren();
expression = item->expression();
foreach (TreeItem *child, item->children())
appendChild(new ToolTipWatchItem(static_cast<WatchItem *>(child)));
@@ -831,8 +831,9 @@ void DebuggerToolTipHolder::setState(DebuggerTooltipState newState)
bool ok = (state == New && newState == PendingUnshown)
|| (state == PendingUnshown && newState == PendingShown)
|| (state == PendingShown && newState == Acquired)
|| (state == Acquired && (newState == Released))
|| (state == Released && (newState == Acquired));
|| (state == Acquired && newState == Released)
|| (state == Acquired && newState == Acquired)
|| (state == Released && newState == Acquired);
// FIXME: These happen when a tooltip is re-used in findOrCreate.
ok = ok
@@ -856,9 +857,22 @@ void DebuggerToolTipHolder::destroy()
void DebuggerToolTipHolder::releaseEngine()
{
DEBUG("RELEASE ENGINE: STATE " << state);
if (state == Released)
return;
DEBUG("RELEASE ENGINE: STATE " << state);
if (state == PendingShown) {
// This happens after hovering over something that looks roughly like
// a valid expression but can't be resolved by the debugger backend.
// (Out of scope items, keywords, ...)
ToolTip::show(context.mousePosition,
DebuggerToolTipManager::tr("No valid expression"),
Internal::mainWindow());
QTC_ASSERT(widget, return);
widget->deleteLater();
return;
}
setState(Released);
QTC_ASSERT(widget, return);
+18 -33
View File
@@ -3724,27 +3724,14 @@ void GdbEngine::reloadLocals()
updateLocals();
}
void GdbEngine::updateWatchData(const WatchData &data)
void GdbEngine::updateWatchItem(WatchItem *item)
{
UpdateParameters params;
params.tryPartial = m_pendingBreakpointRequests == 0;
params.varList = data.iname;
params.varList = item->iname;
updateLocalsPython(params);
}
void GdbEngine::rebuildWatchModel()
{
static int count = 0;
++count;
PENDING_DEBUG("REBUILDING MODEL" << count);
if (boolSetting(LogTimeStamps))
showMessage(LogWindow::logTimeStamp(), LogMiscInput);
showMessage(_("<Rebuild Watchmodel %1>").arg(count), LogMiscInput);
showStatusMessage(tr("Finished retrieving data"), 400);
DebuggerToolTipManager::updateEngine(this);
}
void GdbEngine::handleVarAssign(const DebuggerResponse &)
{
// Everything might have changed, force re-evaluation.
@@ -3759,14 +3746,14 @@ void GdbEngine::updateLocals()
updateLocalsPython(UpdateParameters());
}
void GdbEngine::assignValueInDebugger(const WatchData *data,
void GdbEngine::assignValueInDebugger(WatchItem *item,
const QString &expression, const QVariant &value)
{
DebuggerCommand cmd("assignValue");
cmd.arg("type", data->type.toHex());
cmd.arg("type", item->type.toHex());
cmd.arg("expr", expression.toLatin1().toHex());
cmd.arg("value", value.toString().toLatin1().toHex());
cmd.arg("simpleType", isIntOrFloatType(data->type));
cmd.arg("simpleType", isIntOrFloatType(item->type));
cmd.callback = CB(handleVarAssign);
runCommand(cmd);
}
@@ -4711,7 +4698,6 @@ void addGdbOptionPages(QList<IOptionsPage *> *opts)
void GdbEngine::updateLocalsPython(const UpdateParameters &params)
{
//m_pendingWatchRequests = 0;
m_pendingBreakpointRequests = 0;
DebuggerCommand cmd("showData");
@@ -4805,32 +4791,31 @@ void GdbEngine::handleStackFramePython(const DebuggerResponse &response, bool pa
QSet<QByteArray> toDelete;
if (!partial) {
foreach (WatchItem *item, handler->model()->treeLevelItems<WatchItem *>(2))
toDelete.insert(item->d.iname);
toDelete.insert(item->iname);
}
foreach (const GdbMi &child, data.children()) {
WatchItem *item = new WatchItem(child);
const TypeInfo ti = m_typeInfoCache.value(item->d.type);
const TypeInfo ti = m_typeInfoCache.value(item->type);
if (ti.size)
item->d.size = ti.size;
item->size = ti.size;
handler->insertItem(item);
toDelete.remove(item->d.iname);
toDelete.remove(item->iname);
}
handler->purgeOutdatedItems(toDelete);
//PENDING_DEBUG("AFTER handleStackFrame()");
// FIXME: This should only be used when updateLocals() was
// triggered by expanding an item in the view.
//if (m_pendingWatchRequests <= 0) {
//PENDING_DEBUG("\n\n .... AND TRIGGERS MODEL UPDATE\n");
rebuildWatchModel();
//}
if (!partial) {
static int count = 0;
showMessage(_("<Rebuild Watchmodel %1 @ %2 >")
.arg(++count).arg(LogWindow::logTimeStamp()), LogMiscInput);
showStatusMessage(tr("Finished retrieving data"), 400);
DebuggerToolTipManager::updateEngine(this);
if (!partial)
emit stackFrameCompleted();
DebuggerToolTipManager::updateEngine(this);
}
} else {
showMessage(_("DUMPER FAILED: " + response.toString()));
}
+2 -4
View File
@@ -59,7 +59,6 @@ class MemoryAgentCookie;
class BreakpointParameters;
class BreakpointResponse;
class WatchData;
class DisassemblerAgentCookie;
class DisassemblerLines;
@@ -384,7 +383,7 @@ protected:
// Watch specific stuff
//
virtual bool setToolTipExpression(const DebuggerToolTipContext &);
virtual void assignValueInDebugger(const WatchData *data,
virtual void assignValueInDebugger(WatchItem *item,
const QString &expr, const QVariant &value);
virtual void fetchMemory(MemoryAgent *agent, QObject *token,
@@ -398,8 +397,7 @@ protected:
virtual void watchPoint(const QPoint &);
void handleWatchPoint(const DebuggerResponse &response);
void updateWatchData(const WatchData &data);
void rebuildWatchModel();
void updateWatchItem(WatchItem *item);
void showToolTip();
void handleVarAssign(const DebuggerResponse &response);
+4 -6
View File
@@ -844,19 +844,17 @@ void LldbEngine::reloadFullStack()
//
//////////////////////////////////////////////////////////////////////
void LldbEngine::assignValueInDebugger(const Internal::WatchData *data,
void LldbEngine::assignValueInDebugger(WatchItem *,
const QString &expression, const QVariant &value)
{
Q_UNUSED(data);
DebuggerCommand cmd("assignValue");
cmd.arg("exp", expression.toLatin1().toHex());
cmd.arg("value", value.toString().toLatin1().toHex());
runCommand(cmd);
}
void LldbEngine::updateWatchData(const WatchData &data)
void LldbEngine::updateWatchItem(WatchItem *)
{
Q_UNUSED(data);
updateLocals();
}
@@ -1001,12 +999,12 @@ void LldbEngine::refreshLocals(const GdbMi &vars)
QSet<QByteArray> toDelete;
foreach (WatchItem *item, handler->model()->treeLevelItems<WatchItem *>(2))
toDelete.insert(item->d.iname);
toDelete.insert(item->iname);
foreach (const GdbMi &child, vars.children()) {
WatchItem *item = new WatchItem(child);
handler->insertItem(item);
toDelete.remove(item->d.iname);
toDelete.remove(item->iname);
}
handler->purgeOutdatedItems(toDelete);
+2 -3
View File
@@ -105,8 +105,7 @@ private:
void removeBreakpoint(Breakpoint bp);
void changeBreakpoint(Breakpoint bp);
void assignValueInDebugger(const WatchData *data,
const QString &expr, const QVariant &value);
void assignValueInDebugger(WatchItem *item, const QString &expr, const QVariant &value);
void executeDebuggerCommand(const QString &command, DebuggerLanguages languages);
void loadSymbols(const QString &moduleName);
@@ -122,7 +121,7 @@ private:
bool supportsThreads() const { return true; }
bool isSynchronous() const { return true; }
void updateWatchData(const WatchData &data);
void updateWatchItem(WatchItem *item);
void setRegisterValue(const QByteArray &name, const QString &value);
void fetchMemory(Internal::MemoryAgent *, QObject *, quint64 addr, quint64 length);
+5 -5
View File
@@ -382,7 +382,7 @@ bool PdbEngine::setToolTipExpression(const DebuggerToolTipContext &ctx)
return true;
}
void PdbEngine::assignValueInDebugger(const WatchData *, const QString &expression, const QVariant &value)
void PdbEngine::assignValueInDebugger(WatchItem *, const QString &expression, const QVariant &value)
{
//DebuggerCommand cmd("assignValue");
//cmd.arg("expression", expression);
@@ -393,9 +393,9 @@ void PdbEngine::assignValueInDebugger(const WatchData *, const QString &expressi
updateLocals();
}
void PdbEngine::updateWatchData(const WatchData &data)
void PdbEngine::updateWatchItem(WatchItem *item)
{
Q_UNUSED(data);
Q_UNUSED(item);
updateAll();
}
@@ -573,12 +573,12 @@ void PdbEngine::refreshLocals(const GdbMi &vars)
QSet<QByteArray> toDelete;
foreach (WatchItem *item, handler->model()->treeLevelItems<WatchItem *>(2))
toDelete.insert(item->d.iname);
toDelete.insert(item->iname);
foreach (const GdbMi &child, vars.children()) {
WatchItem *item = new WatchItem(child);
handler->insertItem(item);
toDelete.remove(item->d.iname);
toDelete.remove(item->iname);
}
handler->purgeOutdatedItems(toDelete);
+2 -2
View File
@@ -82,7 +82,7 @@ private:
void insertBreakpoint(Breakpoint bp);
void removeBreakpoint(Breakpoint bp);
void assignValueInDebugger(const WatchData *data,
void assignValueInDebugger(WatchItem *item,
const QString &expr, const QVariant &value);
void executeDebuggerCommand(const QString &command, DebuggerLanguages languages);
@@ -96,7 +96,7 @@ private:
bool supportsThreads() const { return true; }
bool isSynchronous() const { return true; }
void updateWatchData(const WatchData &data);
void updateWatchItem(WatchItem *item);
QString mainPythonFile() const;
void runCommand(const DebuggerCommand &cmd);
@@ -38,6 +38,7 @@ namespace Debugger {
namespace Internal {
class WatchData;
class WatchItem;
class BreakHandler;
class BreakpointModelId;
class QmlEngine;
+10 -10
View File
@@ -112,18 +112,18 @@ bool QmlCppEngine::setToolTipExpression(const DebuggerToolTipContext &ctx)
return success;
}
void QmlCppEngine::updateWatchData(const WatchData &data)
void QmlCppEngine::updateWatchItem(WatchItem *item)
{
if (data.isInspect())
m_qmlEngine->updateWatchData(data);
if (item->isInspect())
m_qmlEngine->updateWatchItem(item);
else
m_activeEngine->updateWatchData(data);
m_activeEngine->updateWatchItem(item);
}
void QmlCppEngine::watchDataSelected(const QByteArray &iname)
{
const WatchData *wd = watchHandler()->findData(iname);
if (wd && wd->isInspect())
const WatchItem *item = watchHandler()->findItem(iname);
if (item && item->isInspect())
m_qmlEngine->watchDataSelected(iname);
}
@@ -264,13 +264,13 @@ void QmlCppEngine::selectThread(ThreadId threadId)
m_activeEngine->selectThread(threadId);
}
void QmlCppEngine::assignValueInDebugger(const WatchData *data,
void QmlCppEngine::assignValueInDebugger(WatchItem *item,
const QString &expr, const QVariant &value)
{
if (data->isInspect())
m_qmlEngine->assignValueInDebugger(data, expr, value);
if (item->isInspect())
m_qmlEngine->assignValueInDebugger(item, expr, value);
else
m_activeEngine->assignValueInDebugger(data, expr, value);
m_activeEngine->assignValueInDebugger(item, expr, value);
}
void QmlCppEngine::notifyInferiorIll()
+2 -2
View File
@@ -48,7 +48,7 @@ public:
bool canDisplayTooltip() const;
bool setToolTipExpression(const DebuggerToolTipContext &);
void updateWatchData(const WatchData &data);
void updateWatchItem(WatchItem *item);
void watchDataSelected(const QByteArray &iname);
void watchPoint(const QPoint &);
@@ -79,7 +79,7 @@ public:
bool acceptsBreakpoint(Breakpoint bp) const;
void selectThread(ThreadId threadId);
void assignValueInDebugger(const WatchData *data,
void assignValueInDebugger(WatchItem *item,
const QString &expr, const QVariant &value);
DebuggerEngine *cppEngine() { return m_cppEngine; }
+19 -23
View File
@@ -988,45 +988,41 @@ bool QmlEngine::setToolTipExpression(const DebuggerToolTipContext &context)
//
//////////////////////////////////////////////////////////////////////
void QmlEngine::assignValueInDebugger(const WatchData *data,
void QmlEngine::assignValueInDebugger(WatchItem *item,
const QString &expression, const QVariant &valueV)
{
if (!expression.isEmpty()) {
if (data->isInspect() && m_inspectorAdapter.agent())
m_inspectorAdapter.agent()->assignValue(data, expression, valueV);
if (item->isInspect() && m_inspectorAdapter.agent())
m_inspectorAdapter.agent()->assignValue(item, expression, valueV);
else if (m_adapter.activeDebuggerClient())
m_adapter.activeDebuggerClient()->assignValueInDebugger(data, expression, valueV);
m_adapter.activeDebuggerClient()->assignValueInDebugger(item, expression, valueV);
}
}
void QmlEngine::updateWatchData(const WatchData &data)
void QmlEngine::updateWatchItem(WatchItem *item)
{
// qDebug() << "UPDATE WATCH DATA" << data.toString();
//showStatusMessage(tr("Stopped."), 5000);
if (data.isInspect()) {
m_inspectorAdapter.agent()->updateWatchData(data);
if (item->isInspect()) {
m_inspectorAdapter.agent()->updateWatchData(*item);
} else {
if (!data.name.isEmpty() && m_adapter.activeDebuggerClient()) {
if (data.isValueNeeded())
m_adapter.activeDebuggerClient()->updateWatchData(data);
if (data.isChildrenNeeded()
&& watchHandler()->isExpandedIName(data.iname)) {
m_adapter.activeDebuggerClient()->expandObject(data.iname, data.id);
if (!item->name.isEmpty() && m_adapter.activeDebuggerClient()) {
if (item->isValueNeeded())
m_adapter.activeDebuggerClient()->updateWatchData(*item);
if (item->isChildrenNeeded() && watchHandler()->isExpandedIName(item->iname)) {
m_adapter.activeDebuggerClient()->expandObject(item->iname, item->id);
}
}
synchronizeWatchers();
}
if (!data.isSomethingNeeded())
watchHandler()->insertData(data);
}
void QmlEngine::watchDataSelected(const QByteArray &iname)
{
const WatchData *wd = watchHandler()->findData(iname);
if (wd && wd->isInspect())
m_inspectorAdapter.agent()->watchDataSelected(wd);
const WatchItem *item = watchHandler()->findItem(iname);
if (item && item->isInspect())
m_inspectorAdapter.agent()->watchDataSelected(item->id);
}
void QmlEngine::synchronizeWatchers()
@@ -1153,11 +1149,11 @@ void QmlEngine::updateCurrentContext()
context = stackHandler()->currentFrame().function;
} else {
QModelIndex currentIndex = inspectorTreeView()->currentIndex();
const WatchData *currentData = watchHandler()->watchData(currentIndex);
const WatchData *currentData = watchHandler()->watchItem(currentIndex);
if (!currentData)
return;
const WatchData *parentData = watchHandler()->watchData(currentIndex.parent());
const WatchData *grandParentData = watchHandler()->watchData(
const WatchData *parentData = watchHandler()->watchItem(currentIndex.parent());
const WatchData *grandParentData = watchHandler()->watchItem(
currentIndex.parent().parent());
if (currentData->id != parentData->id)
context = currentData->name;
@@ -1217,7 +1213,7 @@ bool QmlEngine::evaluateScript(const QString &expression)
if (state() != InferiorStopOk) {
QModelIndex currentIndex = inspectorTreeView()->currentIndex();
QmlInspectorAgent *agent = m_inspectorAdapter.agent();
quint32 queryId = agent->queryExpressionResult(watchHandler()->watchData(currentIndex)->id,
quint32 queryId = agent->queryExpressionResult(watchHandler()->watchItem(currentIndex)->id,
expression);
if (queryId) {
queryIds << queryId;
+2 -3
View File
@@ -145,10 +145,9 @@ private:
void changeBreakpoint(Breakpoint bp);
bool acceptsBreakpoint(Breakpoint bp) const;
void assignValueInDebugger(const WatchData *data,
void assignValueInDebugger(WatchItem *item,
const QString &expr, const QVariant &value);
void loadSymbols(const QString &moduleName);
void loadAllSymbols();
void requestModuleSymbols(const QString &moduleName);
@@ -158,7 +157,7 @@ private:
void reloadFullStack() {}
bool supportsThreads() const { return false; }
void updateWatchData(const WatchData &data);
void updateWatchItem(WatchItem *item);
void watchDataSelected(const QByteArray &iname);
void executeDebuggerCommand(const QString &command, DebuggerLanguages languages);
bool evaluateScript(const QString &expression);
+52 -69
View File
@@ -125,13 +125,13 @@ void QmlInspectorAgent::updateWatchData(const WatchData &data)
}
}
void QmlInspectorAgent::watchDataSelected(const WatchData *data)
void QmlInspectorAgent::watchDataSelected(quint64 id)
{
qCDebug(qmlInspectorLog) << __FUNCTION__ << '(' << data->id << ')';
qCDebug(qmlInspectorLog) << __FUNCTION__ << '(' << id << ')';
if (data->id) {
QTC_ASSERT(m_debugIdLocations.keys().contains(data->id), return);
emit jumpToObjectDefinition(m_debugIdLocations.value(data->id), data->id);
if (id) {
QTC_ASSERT(m_debugIdLocations.keys().contains(id), return);
emit jumpToObjectDefinition(m_debugIdLocations.value(id), id);
}
}
@@ -154,7 +154,7 @@ bool QmlInspectorAgent::selectObjectInTree(int debugId)
using namespace QmlDebug::Constants;
if (m_engineClient->objectName() == QLatin1String(QDECLARATIVE_ENGINE)) {
// reset current Selection
QByteArray root = m_debuggerEngine->watchHandler()->watchData(QModelIndex())->iname;
QByteArray root = m_debuggerEngine->watchHandler()->watchItem(QModelIndex())->iname;
m_debuggerEngine->watchHandler()->setCurrentItem(root);
} else {
fetchObject(debugId);
@@ -256,8 +256,8 @@ ObjectReference QmlInspectorAgent::objectForName(
const WatchHandler *watchHandler = m_debuggerEngine->watchHandler();
while (iter.hasNext()) {
iter.next();
const WatchData *wd = watchHandler->findData(iter.value());
if (wd && wd->name == objectId)
const WatchItem *item = watchHandler->findItem(iter.value());
if (item && item->name == objectId)
return ObjectReference(iter.key());
}
}
@@ -313,13 +313,11 @@ QHash<int,QString> QmlInspectorAgent::rootObjectIds() const
{
QHash<int,QString> rIds;
const WatchHandler *watchHandler = m_debuggerEngine->watchHandler();
foreach (const QByteArray &in, m_debugIdToIname) {
const WatchData *data = watchHandler->findData(in);
if (!data)
continue;
int debugId = data->id;
QString className = QLatin1String(data->type);
rIds.insert(debugId, className);
foreach (const QByteArray &iname, m_debugIdToIname) {
if (const WatchItem *item = watchHandler->findItem(iname)) {
int debugId = item->id;
rIds.insert(debugId, QLatin1String(item->type));
}
}
return rIds;
}
@@ -415,10 +413,10 @@ QString QmlInspectorAgent::displayName(int objectDebugId) const
return QString();
if (m_debugIdToIname.contains(objectDebugId)) {
const WatchData *data = m_debuggerEngine->watchHandler()->findData(
const WatchItem *item = m_debuggerEngine->watchHandler()->findItem(
m_debugIdToIname.value(objectDebugId));
QTC_ASSERT(data, return QString());
return data->name;
QTC_ASSERT(item, return QString());
return item->name;
}
return QString();
}
@@ -505,14 +503,12 @@ void QmlInspectorAgent::onValueChanged(int debugId, const QByteArray &propertyNa
const QByteArray iname = m_debugIdToIname.value(debugId) +
".[properties]." + propertyName;
WatchHandler *watchHandler = m_debuggerEngine->watchHandler();
const WatchData *data = watchHandler->findData(iname);
qCDebug(qmlInspectorLog)
<< __FUNCTION__ << '(' << debugId << ')' << iname
<< value.toString();
if (data) {
WatchData d(*data);
d.value = value.toString();
watchHandler->insertData(d);
if (WatchItem *item = watchHandler->findItem(iname)) {
item->value = value.toString();
item->update();
}
}
@@ -661,12 +657,11 @@ void QmlInspectorAgent::insertObjectInTree(const ObjectReference &object)
const int parentId = parentIdForIname(m_debugIdToIname.value(objectDebugId));
QElapsedTimer timeElapsed;
QList<WatchData> watchData;
bool printTime = qmlInspectorLog().isDebugEnabled();
if (printTime)
timeElapsed.start();
watchData.append(buildWatchData(object, m_debugIdToIname.value(parentId), true));
addWatchData(object, m_debugIdToIname.value(parentId), true);
qCDebug(qmlInspectorLog) << __FUNCTION__ << "Time: Build Watch Data took "
<< timeElapsed.elapsed() << " ms";
if (printTime)
@@ -675,10 +670,8 @@ void QmlInspectorAgent::insertObjectInTree(const ObjectReference &object)
qCDebug(qmlInspectorLog) << __FUNCTION__ << "Time: Build Debug Id Hash took "
<< timeElapsed.elapsed() << " ms";
WatchHandler *watchHandler = m_debuggerEngine->watchHandler();
if (printTime)
timeElapsed.start();
watchHandler->insertDataList(watchData);
qCDebug(qmlInspectorLog) << __FUNCTION__ << "Time: Insertion took "
<< timeElapsed.elapsed() << " ms";
@@ -689,7 +682,7 @@ void QmlInspectorAgent::insertObjectInTree(const ObjectReference &object)
// select item in view
QByteArray iname = m_debugIdToIname.value(m_objectToSelect);
qCDebug(qmlInspectorLog) << " selecting" << iname << "in tree";
watchHandler->setCurrentItem(iname);
m_debuggerEngine->watchHandler()->setCurrentItem(iname);
m_objectToSelect = -1;
}
}
@@ -738,38 +731,34 @@ static QByteArray buildIName(const QByteArray &parentIname, const QString &name)
return parentIname + "." + name.toLatin1();
}
QList<WatchData> QmlInspectorAgent::buildWatchData(const ObjectReference &obj,
const QByteArray &parentIname,
bool append)
void QmlInspectorAgent::addWatchData(const ObjectReference &obj,
const QByteArray &parentIname,
bool append)
{
qCDebug(qmlInspectorLog) << '(' << obj << parentIname << ')';
QList<WatchData> list;
int objDebugId = obj.debugId();
QByteArray objIname = buildIName(parentIname, objDebugId);
if (append) {
WatchData objWatch;
QString name = obj.idString();
if (name.isEmpty())
name = obj.className();
if (name.isEmpty())
return list;
return;
// object
objWatch.id = objDebugId;
objWatch.exp = name.toLatin1();
objWatch.name = name;
objWatch.iname = objIname;
objWatch.type = obj.className().toLatin1();
objWatch.value = _("object");
objWatch.setHasChildren(true);
objWatch.setAllUnneeded();
auto objWatch = new WatchItem(objIname, name);
objWatch->id = objDebugId;
objWatch->exp = name.toLatin1();
objWatch->type = obj.className().toLatin1();
objWatch->value = _("object");
objWatch->wantsChildren = true;
objWatch->setAllUnneeded();
list.append(objWatch);
addObjectWatch(objWatch.id);
m_debuggerEngine->watchHandler()->insertItem(objWatch);
addObjectWatch(objWatch->id);
if (m_debugIdToIname.contains(objDebugId)) {
// The data needs to be removed since we now know the parent and
// hence we can insert the data in the correct position
@@ -784,44 +773,38 @@ QList<WatchData> QmlInspectorAgent::buildWatchData(const ObjectReference &obj,
// we don't know the children yet. Not adding the 'properties'
// element makes sure we're queried on expansion.
if (obj.needsMoreData())
return list;
return;
}
// properties
if (append && obj.properties().count()) {
WatchData propertiesWatch;
propertiesWatch.id = objDebugId;
propertiesWatch.exp = "";
propertiesWatch.name = tr("Properties");
propertiesWatch.iname = objIname + ".[properties]";
propertiesWatch.type = "";
propertiesWatch.value = _("list");
propertiesWatch.setHasChildren(true);
propertiesWatch.setAllUnneeded();
list.append(propertiesWatch);
QByteArray iname = objIname + ".[properties]";
auto propertiesWatch = new WatchItem(iname, tr("Properties"));
propertiesWatch->id = objDebugId;
propertiesWatch->value = _("list");
propertiesWatch->wantsChildren = true;
propertiesWatch->setAllUnneeded();
foreach (const PropertyReference &property, obj.properties()) {
const QString propertyName = property.name();
if (propertyName.isEmpty())
continue;
WatchData propertyWatch;
propertyWatch.id = objDebugId;
propertyWatch.exp = propertyName.toLatin1();
propertyWatch.name = propertyName;
propertyWatch.iname = buildIName(propertiesWatch.iname, propertyName);
propertyWatch.type = property.valueTypeName().toLatin1();
propertyWatch.value = property.value().toString();
propertyWatch.setAllUnneeded();
propertyWatch.setHasChildren(false);
list.append(propertyWatch);
auto propertyWatch = new WatchItem(buildIName(iname, propertyName), propertyName);
propertyWatch->id = objDebugId;
propertyWatch->exp = propertyName.toLatin1();
propertyWatch->type = property.valueTypeName().toLatin1();
propertyWatch->value = property.value().toString();
propertyWatch->wantsChildren = false;
propertyWatch->setAllUnneeded();
propertiesWatch->appendChild(propertyWatch);
}
m_debuggerEngine->watchHandler()->insertItem(propertiesWatch);
}
// recurse
foreach (const ObjectReference &child, obj.children())
list.append(buildWatchData(child, objIname, append));
return list;
addWatchData(child, objIname, append);
}
void QmlInspectorAgent::log(QmlInspectorAgent::LogDirection direction,
+3 -3
View File
@@ -57,7 +57,7 @@ public:
void assignValue(const WatchData *data, const QString &expression, const QVariant &valueV);
void updateWatchData(const WatchData &data);
void watchDataSelected(const WatchData *data);
void watchDataSelected(quint64 id);
bool selectObjectInTree(int debugId);
quint32 setBindingForObject(int objectDebugId,
@@ -113,8 +113,8 @@ private:
void insertObjectInTree(const QmlDebug::ObjectReference &result);
void buildDebugIdHashRecursive(const QmlDebug::ObjectReference &ref);
QList<WatchData> buildWatchData(const QmlDebug::ObjectReference &obj,
const QByteArray &parentIname, bool append);
void addWatchData(const QmlDebug::ObjectReference &obj,
const QByteArray &parentIname, bool append);
enum LogDirection {
LogSend,
@@ -253,7 +253,7 @@ void QmlV8DebuggerClientPrivate::evaluate(const QString expr, bool global,
QScriptValue ctxtList = parser.call(QScriptValue(), QScriptValueList() << _(ARRAY ));
while (rowCount) {
QModelIndex index = watchModel->index(--rowCount, 0);
const WatchData *data = watchHandler->watchData(index);
const WatchData *data = watchHandler->watchItem(index);
QScriptValue ctxt = parser.call(QScriptValue(), QScriptValueList() << QScriptValue(_(OBJECT)));
ctxt.setProperty(_(NAME), QScriptValue(data->name));
ctxt.setProperty(_(HANDLE), QScriptValue(int(data->id)));
@@ -969,7 +969,7 @@ void QmlV8DebuggerClient::expandObject(const QByteArray &iname, quint64 objectId
{
if (objectId == 0) {
//We may have got the global object
const WatchData *watch = d->engine->watchHandler()->findData(iname);
const WatchItem *watch = d->engine->watchHandler()->findItem(iname);
if (watch->value == QLatin1String("global")) {
StackHandler *stackHandler = d->engine->stackHandler();
if (stackHandler->isContentsValid() && stackHandler->currentFrame().isUsable()) {
@@ -1469,10 +1469,9 @@ void QmlV8DebuggerClient::setCurrentFrameDetails(const QVariant &bodyVal, const
QHash<quint64, QByteArray> handlesToLookup;
// Store handles of all expanded watch data
foreach (const QByteArray &iname, expandedInames) {
const WatchData *wd = watchHandler->findData(iname);
if (!wd || !wd->isLocal())
continue;
handlesToLookup.insert(wd->id, iname);
const WatchItem *item = watchHandler->findItem(iname);
if (item && item->isLocal())
handlesToLookup.insert(item->id, iname);
}
watchHandler->removeAllData();
if (frameIndex < 0)
@@ -1483,22 +1482,19 @@ void QmlV8DebuggerClient::setCurrentFrameDetails(const QVariant &bodyVal, const
//Set "this" variable
{
WatchData data;
data.exp = QByteArray("this");
data.name = QLatin1String(data.exp);
data.iname = QByteArray("local.") + data.exp;
auto item = new WatchItem("local.this", QLatin1String("this"));
QmlV8ObjectData objectData = extractData(currentFrame.value(_("receiver")), refsVal);
data.id = objectData.handle;
data.type = objectData.type;
data.value = objectData.value.toString();
data.setHasChildren(objectData.properties.count());
item->id = objectData.handle;
item->type = objectData.type;
item->value = objectData.value.toString();
item->setHasChildren(objectData.properties.count());
//Incase of global object, we do not get children
//Set children nevertheless and query later
if (data.value == QLatin1String("global")) {
data.setHasChildren(true);
data.id = 0;
if (item->value == QLatin1String("global")) {
item->setHasChildren(true);
item->id = 0;
}
watchHandler->insertData(data);
watchHandler->insertItem(item);
}
const QVariantList currentFrameScopes = currentFrame.value(_("scopes")).toList();
@@ -1553,36 +1549,32 @@ void QmlV8DebuggerClient::updateScope(const QVariant &bodyVal, const QVariant &r
QmlV8ObjectData objectData = extractData(bodyMap.value(_("object")), refsVal);
QList<int> handlesToLookup;
QList<WatchData> locals;
foreach (const QVariant &property, objectData.properties) {
QmlV8ObjectData localData = extractData(property, refsVal);
WatchData data;
data.exp = localData.name;
auto item = new WatchItem;
item->exp = localData.name;
//Check for v8 specific local data
if (data.exp.startsWith('.') || data.exp.isEmpty())
if (item->exp.startsWith('.') || item->exp.isEmpty())
continue;
data.name = QLatin1String(data.exp);
data.iname = QByteArray("local.") + data.exp;
item->name = QLatin1String(item->exp);
item->iname = QByteArray("local.") + item->exp;
int handle = localData.handle;
if (localData.value.isValid()) {
data.id = handle;
data.type = localData.type;
data.value = localData.value.toString();
data.setHasChildren(localData.properties.count());
locals << data;
item->id = handle;
item->type = localData.type;
item->value = localData.value.toString();
item->setHasChildren(localData.properties.count());
d->engine->watchHandler()->insertItem(item);
} else {
handlesToLookup << handle;
d->localsAndWatchers.insertMulti(handle, data.exp);
d->localsAndWatchers.insertMulti(handle, item->exp);
}
}
if (!handlesToLookup.isEmpty())
d->lookup(handlesToLookup);
if (!locals.isEmpty())
d->engine->watchHandler()->insertDataList(locals);
}
QmlJS::ConsoleItem *constructLogItemTree(QmlJS::ConsoleItem *parent,
@@ -1640,7 +1632,7 @@ void QmlV8DebuggerClient::updateEvaluationResult(int sequence, bool success,
d->scope(index);
//Also update "this"
QByteArray iname("local.this");
const WatchData *parent = watchHandler->findData(iname);
const WatchItem *parent = watchHandler->findItem(iname);
d->localsAndWatchers.insertMulti(parent->id, iname);
d->lookup(QList<int>() << parent->id);
@@ -1662,32 +1654,29 @@ void QmlV8DebuggerClient::updateEvaluationResult(int sequence, bool success,
QmlV8ObjectData body = extractData(bodyVal, refsVal);
if (d->evaluatingExpression.contains(sequence)) {
QString exp = d->evaluatingExpression.take(sequence);
QList<WatchData> watchDataList;
WatchData data;
//Do we have request to evaluate a local?
if (exp.startsWith(QLatin1String("local."))) {
const WatchData *watch = watchHandler->findData(exp.toLatin1());
watchDataList << createWatchDataList(watch, body.properties, refsVal);
const WatchItem *item = watchHandler->findItem(exp.toLatin1());
createWatchDataList(item, body.properties, refsVal);
} else {
QByteArray iname = watchHandler->watcherName(exp.toLatin1());
SDEBUG(QString(iname));
data.exp = exp.toLatin1();
data.name = exp;
data.iname = iname;
data.id = body.handle;
auto item = new WatchItem(iname, exp);
item->exp = exp.toLatin1();
item->id = body.handle;
if (success) {
data.type = body.type;
data.value = body.value.toString();
data.hasChildren = body.properties.count();
item->type = body.type;
item->value = body.value.toString();
item->wantsChildren = body.properties.count();
} else {
//Do not set type since it is unknown
data.setError(body.value.toString());
item->setError(body.value.toString());
}
watchDataList << data << createWatchDataList(&data, body.properties, refsVal);
watchHandler->insertItem(item);
createWatchDataList(item, body.properties, refsVal);
}
//Insert the newly evaluated expression to the Watchers Window
watchHandler->insertDataList(watchDataList);
}
}
}
@@ -1704,7 +1693,6 @@ void QmlV8DebuggerClient::expandLocalsAndWatchers(const QVariant &bodyVal, const
// }
const QVariantMap body = bodyVal.toMap();
QList<WatchData> watchDataList;
QStringList handlesList = body.keys();
WatchHandler *watchHandler = d->engine->watchHandler();
foreach (const QString &handle, handlesList) {
@@ -1713,63 +1701,59 @@ void QmlV8DebuggerClient::expandLocalsAndWatchers(const QVariant &bodyVal, const
QByteArray prepend = d->localsAndWatchers.take(handle.toInt());
if (prepend.startsWith("local.") || prepend.startsWith("watch.")) {
//Data for expanded local/watch
//Could be an object or function
const WatchData *parent = watchHandler->findData(prepend);
watchDataList << createWatchDataList(parent, bodyObjectData.properties, refsVal);
// Data for expanded local/watch.
// Could be an object or function.
const WatchItem *parent = watchHandler->findItem(prepend);
createWatchDataList(parent, bodyObjectData.properties, refsVal);
} else {
//rest
WatchData data;
data.exp = prepend;
data.name = QLatin1String(data.exp);
data.iname = QByteArray("local.") + data.exp;
data.id = handle.toInt();
auto item = new WatchItem;
item->exp = prepend;
item->name = QLatin1String(item->exp);
item->iname = QByteArray("local.") + item->exp;
item->id = handle.toInt();
data.type = bodyObjectData.type;
data.value = bodyObjectData.value.toString();
item->type = bodyObjectData.type;
item->value = bodyObjectData.value.toString();
data.setHasChildren(bodyObjectData.properties.count());
item->setHasChildren(bodyObjectData.properties.count());
watchDataList << data;
d->engine->watchHandler()->insertItem(item);
}
}
watchHandler->insertDataList(watchDataList);
}
QList<WatchData> QmlV8DebuggerClient::createWatchDataList(const WatchData *parent,
void QmlV8DebuggerClient::createWatchDataList(const WatchItem *parent,
const QVariantList &properties,
const QVariant &refsVal)
{
QList<WatchData> watchDataList;
if (properties.count()) {
QTC_ASSERT(parent, return watchDataList);
QTC_ASSERT(parent, return);
foreach (const QVariant &property, properties) {
QmlV8ObjectData propertyData = extractData(property, refsVal);
WatchData data;
data.name = QString::fromUtf8(propertyData.name);
auto item = new WatchItem;
item->name = QString::fromUtf8(propertyData.name);
//Check for v8 specific local data
if (data.name.startsWith(QLatin1Char('.')) || data.name.isEmpty())
if (item->name.startsWith(QLatin1Char('.')) || item->name.isEmpty())
continue;
if (parent->type == "object") {
if (parent->value == _("Array"))
data.exp = parent->exp + '[' + data.name.toLatin1() + ']';
item->exp = parent->exp + '[' + item->name.toLatin1() + ']';
else if (parent->value == _("Object"))
data.exp = parent->exp + '.' + data.name.toLatin1();
item->exp = parent->exp + '.' + item->name.toLatin1();
} else {
data.exp = data.name.toLatin1();
item->exp = item->name.toLatin1();
}
data.iname = parent->iname + '.' + data.name.toLatin1();
data.id = propertyData.handle;
data.type = propertyData.type;
data.value = propertyData.value.toString();
data.setHasChildren(propertyData.properties.count());
watchDataList << data;
item->iname = parent->iname + '.' + item->name.toLatin1();
item->id = propertyData.handle;
item->type = propertyData.type;
item->value = propertyData.value.toString();
item->setHasChildren(propertyData.properties.count());
d->engine->watchHandler()->insertItem(item);
}
}
return watchDataList;
}
void QmlV8DebuggerClient::highlightExceptionCode(int lineNumber,
@@ -111,9 +111,9 @@ private:
void updateEvaluationResult(int sequence, bool success, const QVariant &bodyVal,
const QVariant &refsVal);
void expandLocalsAndWatchers(const QVariant &bodyVal, const QVariant &refsVal);
QList<WatchData> createWatchDataList(const WatchData *parent,
const QVariantList &properties,
const QVariant &refsVal);
void createWatchDataList(const WatchItem *parent,
const QVariantList &properties,
const QVariant &refsVal);
void highlightExceptionCode(int lineNumber, const QString &filePath,
const QString &errorMessage);
@@ -482,16 +482,18 @@ void QScriptDebuggerClient::messageReceived(const QByteArray &data)
d->logReceiveMessage(QLatin1String(command) + QLatin1Char(' ')
+ QLatin1String(iname) + QLatin1Char(' ') + data.value);
data.iname = iname;
auto item = new WatchItem(data);
item->iname = iname;
if (iname.startsWith("watch.")) {
watchHandler->insertData(data);
watchHandler->insertItem(item);
} else if (iname == "console") {
d->engine->showMessage(data.value, ConsoleOutput);
d->engine->showMessage(item->value, ConsoleOutput);
} else if (iname.startsWith("local.")) {
data.name = data.name.left(data.name.indexOf(QLatin1Char(' ')));
watchHandler->insertData(data);
item->name = item->name.left(item->name.indexOf(QLatin1Char(' ')));
watchHandler->insertItem(item);
} else {
qWarning() << "QmlEngine: Unexcpected result: " << iname << data.value;
qWarning() << "QmlEngine: Unexcpected result: " << iname << item->value;
}
} else if (command == "EXPANDED") {
QList<WatchData> result;
@@ -504,7 +506,7 @@ void QScriptDebuggerClient::messageReceived(const QByteArray &data)
foreach (WatchData data, result) {
data.iname = iname + '.' + data.exp;
watchHandler->insertData(data);
watchHandler->insertItem(new WatchItem(data));
if (watchHandler->isExpandedIName(data.iname) && qint64(data.id) != -1) {
needPing = true;
@@ -552,9 +554,10 @@ void QScriptDebuggerClient::insertLocalsAndWatches(QList<WatchData> &locals,
return;
bool needPing = false;
foreach (WatchData data, watches) {
data.iname = watchHandler->watcherName(data.exp);
watchHandler->insertData(data);
foreach (const WatchData &data, watches) {
auto item = new WatchItem(data);
item->iname = watchHandler->watcherName(data.exp);
watchHandler->insertItem(item);
if (watchHandler->isExpandedIName(data.iname) && qint64(data.id) != -1) {
needPing = true;
@@ -562,11 +565,12 @@ void QScriptDebuggerClient::insertLocalsAndWatches(QList<WatchData> &locals,
}
}
foreach (WatchData data, locals) {
if (data.name == QLatin1String("<no initialized data>"))
data.name = tr("No Local Variables");
data.iname = "local." + data.exp;
watchHandler->insertData(data);
foreach (const WatchData &data, locals) {
auto item = new WatchItem(data);
if (item->name == QLatin1String("<no initialized data>"))
item->name = tr("No Local Variables");
item->iname = "local." + item->exp;
watchHandler->insertItem(item);
if (watchHandler->isExpandedIName(data.iname) && qint64(data.id) != -1) {
needPing = true;
-1
View File
@@ -37,7 +37,6 @@
#include "debuggerengine.h"
#include "registerhandler.h"
#include "watchdelegatewidgets.h"
#include "memoryagent.h"
#include <utils/savedaction.h>
#include <utils/qtcassert.h>
+7 -20
View File
@@ -128,7 +128,7 @@ WatchData::WatchData() :
bitpos(0),
bitsize(0),
elided(0),
hasChildren(false),
wantsChildren(false),
valueEnabled(true),
valueEditable(true),
error(false),
@@ -150,7 +150,7 @@ bool WatchData::isEqual(const WatchData &other) const
&& address == other.address
&& size == other.size
&& elided == other.elided
&& hasChildren == other.hasChildren
&& wantsChildren == other.wantsChildren
&& valueEnabled == other.valueEnabled
&& valueEditable == other.valueEditable
&& error == other.error;
@@ -177,7 +177,7 @@ void WatchData::setError(const QString &msg)
{
setAllUnneeded();
value = msg;
setHasChildren(false);
wantsChildren = false;
valueEnabled = false;
valueEditable = false;
error = true;
@@ -188,7 +188,7 @@ void WatchData::setValue(const QString &value0)
value = value0;
if (value == QLatin1String("{...}")) {
value.clear();
hasChildren = true; // at least one...
wantsChildren = true; // at least one...
}
// strip off quoted characters for chars.
if (value.endsWith(QLatin1Char('\'')) && type.endsWith("char")) {
@@ -260,7 +260,6 @@ void WatchData::setType(const QByteArray &str, bool guessChildrenFromType)
else
changed = false;
}
setTypeUnneeded();
if (guessChildrenFromType) {
switch (guessChildren(type)) {
case HasChildren:
@@ -320,7 +319,7 @@ QString WatchData::toString() const
if (isValueNeeded())
str << "value=<needed>,";
if (isValueKnown() && !value.isEmpty())
if (!value.isEmpty())
str << "value=\"" << value << doubleQuoteComma;
if (elided)
@@ -333,15 +332,9 @@ QString WatchData::toString() const
if (!dumperFlags.isEmpty())
str << "dumperFlags=\"" << dumperFlags << doubleQuoteComma;
if (isTypeNeeded())
str << "type=<needed>,";
if (isTypeKnown() && !type.isEmpty())
str << "type=\"" << type << doubleQuoteComma;
str << "type=\"" << type << doubleQuoteComma;
if (isHasChildrenNeeded())
str << "hasChildren=<needed>,";
if (isHasChildrenKnown())
str << "hasChildren=\"" << (hasChildren ? "true" : "false") << doubleQuoteComma;
str << "wantsChildren=\"" << (wantsChildren ? "true" : "false") << doubleQuoteComma;
if (isChildrenNeeded())
str << "children=<needed>,";
@@ -511,8 +504,6 @@ void WatchData::updateType(const GdbMi &item)
{
if (item.isValid())
setType(item.data());
else if (type.isEmpty())
setTypeNeeded();
}
void WatchData::updateDisplayedType(const GdbMi &item)
@@ -613,10 +604,6 @@ void parseChildrenData(const WatchData &data0, const GdbMi &item,
mi = item["editformat"];
data.editformat = mi.toInt();
mi = item["typeformats"];
if (mi.isValid())
data.typeFormats = QString::fromUtf8(mi.data());
mi = item["valueelided"];
if (mi.isValid())
data.elided = mi.toInt();
+2 -20
View File
@@ -48,19 +48,15 @@ public:
enum State
{
Complete = 0,
HasChildrenNeeded = 1,
ValueNeeded = 2,
TypeNeeded = 4,
ChildrenNeeded = 8,
NeededMask = ValueNeeded
| TypeNeeded
| ChildrenNeeded
| HasChildrenNeeded,
InitialState = ValueNeeded
| TypeNeeded
| ChildrenNeeded
| HasChildrenNeeded
};
@@ -69,27 +65,14 @@ public:
void setAllNeeded() { state = NeededMask; }
void setAllUnneeded() { state = State(0); }
bool isTypeNeeded() const { return state & TypeNeeded; }
bool isTypeKnown() const { return !(state & TypeNeeded); }
void setTypeNeeded() { state = State(state | TypeNeeded); }
void setTypeUnneeded() { state = State(state & ~TypeNeeded); }
bool isValueNeeded() const { return state & ValueNeeded; }
bool isValueKnown() const { return !(state & ValueNeeded); }
void setValueNeeded() { state = State(state | ValueNeeded); }
void setValueUnneeded() { state = State(state & ~ValueNeeded); }
bool isChildrenNeeded() const { return state & ChildrenNeeded; }
bool isChildrenKnown() const { return !(state & ChildrenNeeded); }
void setChildrenNeeded() { state = State(state | ChildrenNeeded); }
void setChildrenUnneeded() { state = State(state & ~ChildrenNeeded); }
bool isHasChildrenNeeded() const { return state & HasChildrenNeeded; }
bool isHasChildrenKnown() const { return !(state & HasChildrenNeeded); }
void setHasChildrenNeeded() { state = State(state | HasChildrenNeeded); }
void setHasChildrenUnneeded() { state = State(state & ~HasChildrenNeeded); }
void setHasChildren(bool c) { hasChildren = c; setHasChildrenUnneeded();
if (!c) setChildrenUnneeded(); }
void setHasChildren(bool c) { wantsChildren = c; if (!c) setChildrenUnneeded(); }
bool isLocal() const { return iname.startsWith("local."); }
bool isWatcher() const { return iname.startsWith("watch."); }
@@ -130,7 +113,6 @@ public:
QString value; // Displayed value
QByteArray editvalue; // Displayed value
qint32 editformat; // Format of displayed value
QString typeFormats; // Selection of formats of displayed value
QByteArray type; // Type for further processing
QString displayedType;// Displayed type (optional)
quint64 address; // Displayed address of the actual object
@@ -139,7 +121,7 @@ public:
uint bitpos; // Position within bit fields
uint bitsize; // Size in case of bit fields
int elided; // Full size if value was cut off, -1 if cut on unknown size, 0 otherwise
bool hasChildren;
bool wantsChildren;
bool valueEnabled; // Value will be enabled or not
bool valueEditable; // Value will be editable
bool error;
File diff suppressed because it is too large Load Diff
+62 -113
View File
@@ -35,32 +35,66 @@
#include <utils/treemodel.h>
#include <QPointer>
#include <QVector>
namespace Debugger {
namespace Internal {
class DebuggerCommand;
class SeparatedView;
class DebuggerEngine;
class WatchModel;
class WatchItem : public Utils::TreeItem
// Special formats. Keep in sync with dumper.py.
enum DisplayFormat
{
AutomaticFormat, // Based on type for individuals, dumper default for types.
RawFormat,
SimpleFormat, // Typical simple format (e.g. for QModelIndex row/column)
EnhancedFormat, // Enhanced format (e.g. for QModelIndex with resolved display)
SeparateFormat, // Display in separate Window
Latin1StringFormat,
SeparateLatin1StringFormat,
Utf8StringFormat,
SeparateUtf8StringFormat,
Local8BitStringFormat,
Utf16StringFormat,
Ucs4StringFormat,
Array10Format,
Array100Format,
Array1000Format,
Array10000Format,
ArrayPlotFormat,
CompactMapFormat,
DirectQListStorageFormat,
IndirectQListStorageFormat,
// Not used in *.py.
BoolTextFormat,
BoolIntegerFormat,
DecimalIntegerFormat,
HexadecimalIntegerFormat,
BinaryIntegerFormat,
OctalIntegerFormat,
CompactFloatFormat,
ScientificFloatFormat,
};
typedef QVector<DisplayFormat> DisplayFormats;
class WatchItem : public Utils::TreeItem, public WatchData
{
public:
WatchItem();
WatchItem() {}
WatchItem(const QByteArray &i, const QString &n);
explicit WatchItem(const WatchData &data);
explicit WatchItem(const GdbMi &data);
WatchItem *parentItem() const;
const WatchModel *watchModel() const;
WatchModel *watchModel();
QVariant data(int column, int role) const;
Qt::ItemFlags flags(int column) const;
bool canFetchMore() const;
void fetchMore();
QString displayName() const;
@@ -76,84 +110,21 @@ public:
QColor valueColor() const;
int requestedFormat() const;
void showInEditorHelper(QString *contents, int depth) const;
WatchItem *findItem(const QByteArray &iname);
private:
WatchItem *parentItem() const;
const WatchModel *watchModel() const;
WatchModel *watchModel();
DisplayFormats typeFormatList() const;
bool canFetchMore() const;
QVariant data(int column, int role) const;
Qt::ItemFlags flags(int column) const;
void parseWatchData(const GdbMi &input);
public:
WatchData d;
bool fetchTriggered;
};
// Special formats. Keep in sync with dumper.py.
enum DisplayFormat
{
AutomaticFormat = -1, // Based on type for individuals, dumper default for types.
RawFormat = 0,
// Values between 1 and 99 refer to dumper provided custom formats.
// Values between 100 and 199 refer to well-known formats handled in dumpers.
KnownDumperFormatBase = 100,
Latin1StringFormat,
Utf8StringFormat,
Local8BitStringFormat,
Utf16StringFormat,
Ucs4StringFormat,
Array10Format,
Array100Format,
Array1000Format,
Array10000Format,
SeparateLatin1StringFormat,
SeparateUtf8StringFormat,
// Values above 200 refer to format solely handled in the WatchHandler code
ArtificialFormatBase = 200,
BoolTextFormat,
BoolIntegerFormat,
DecimalIntegerFormat,
HexadecimalIntegerFormat,
BinaryIntegerFormat,
OctalIntegerFormat,
CompactFloatFormat,
ScientificFloatFormat,
};
class TypeFormatItem
{
public:
TypeFormatItem() : format(-1) {}
TypeFormatItem(const QString &display, int format);
QString display;
int format;
};
class TypeFormatList : public QVector<TypeFormatItem>
{
public:
using QVector::append;
void append(int format);
TypeFormatItem find(int format) const;
};
} // namespace Internal
} // namespace Debugger
Q_DECLARE_METATYPE(Debugger::Internal::TypeFormatList)
namespace Debugger {
namespace Internal {
class DebuggerEngine;
class UpdateParameters
{
public:
@@ -163,8 +134,6 @@ public:
QByteArray varList;
};
typedef QHash<QString, QStringList> DumperTypeFormats; // Type name -> Dumper Formats
class WatchModelBase : public Utils::TreeModel
{
Q_OBJECT
@@ -196,14 +165,10 @@ public:
void watchVariable(const QString &exp);
Q_SLOT void clearWatches();
void showEditValue(const WatchData &data);
const WatchData *watchData(const QModelIndex &) const;
const WatchItem *watchItem(const QModelIndex &) const;
void fetchMore(const QByteArray &iname) const;
const WatchData *findData(const QByteArray &iname) const;
WatchItem *findItem(const QByteArray &iname) const;
const WatchData *findCppLocalVariable(const QString &name) const;
bool hasItem(const QByteArray &iname) const;
const WatchItem *findCppLocalVariable(const QString &name) const;
void loadSessionData();
void saveSessionData();
@@ -218,18 +183,16 @@ public:
QByteArray individualFormatRequests() const;
int format(const QByteArray &iname) const;
static QString nameForFormat(int format);
void addDumpers(const GdbMi &dumpers);
void addTypeFormats(const QByteArray &type, const QStringList &formats);
void setTypeFormats(const DumperTypeFormats &typeFormats);
DumperTypeFormats typeFormats() const;
void addTypeFormats(const QByteArray &type, const DisplayFormats &formats);
void setUnprintableBase(int base);
static int unprintableBase();
QByteArray watcherName(const QByteArray &exp);
QString editorContents();
void editTypeFormats(bool includeLocals, const QByteArray &iname);
void scheduleResetLocation();
void resetLocation();
@@ -238,8 +201,6 @@ public:
void updateWatchersWindow();
void appendFormatRequests(DebuggerCommand *cmd);
void insertData(const WatchData &data); // DEPRECATED
void insertDataList(const QList<WatchData> &list); // DEPRECATED
void insertItem(WatchItem *item); // Takes ownership.
void removeItemByIName(const QByteArray &iname);
void removeAllData(bool includeInspectData = false);
@@ -250,25 +211,13 @@ public:
void purgeOutdatedItems(const QSet<QByteArray> &inames);
private:
friend class WatchModel;
void saveWatchers();
static void loadFormats();
static void saveFormats();
void setFormat(const QByteArray &type, int format);
WatchModel *m_model; // Owned.
DebuggerEngine *m_engine; // Not owned.
SeparatedView *m_separatedView; // Owned.
bool m_contentsValid;
bool m_resetLocationScheduled;
};
} // namespace Internal
} // namespace Debugger
Q_DECLARE_METATYPE(Debugger::Internal::UpdateParameters)
Q_DECLARE_METATYPE(Debugger::Internal::DisplayFormats)
#endif // DEBUGGER_WATCHHANDLER_H
+10 -12
View File
@@ -554,12 +554,10 @@ void WatchTreeView::fillFormatMenu(QMenu *formatMenu, const QModelIndex &mi)
const QModelIndex mi2 = mi.sibling(mi.row(), 2);
const QString type = mi2.data().toString();
const TypeFormatList alternativeFormats =
mi.data(LocalsTypeFormatListRole).value<TypeFormatList>();
int typeFormat =
mi.data(LocalsTypeFormatRole).toInt();
const int individualFormat =
mi.data(LocalsIndividualFormatRole).toInt();
const DisplayFormats alternativeFormats =
mi.data(LocalsTypeFormatListRole).value<DisplayFormats>();
const int typeFormat = mi.data(LocalsTypeFormatRole).toInt();
const int individualFormat = mi.data(LocalsIndividualFormatRole).toInt();
const int unprintableBase = WatchHandler::unprintableBase();
QAction *showUnprintableUnicode = 0;
@@ -595,7 +593,7 @@ void WatchTreeView::fillFormatMenu(QMenu *formatMenu, const QModelIndex &mi)
dummy->setEnabled(false);
QString msg = (individualFormat == AutomaticFormat && typeFormat != AutomaticFormat)
? tr("Use Format for Type (Currently %1)")
.arg(alternativeFormats.find(typeFormat).display)
.arg(WatchHandler::nameForFormat(typeFormat))
: tr("Use Display Format Based on Type") + QLatin1Char(' ');
QAction *clearIndividualFormatAction = formatMenu->addAction(spacer + msg);
@@ -608,8 +606,8 @@ void WatchTreeView::fillFormatMenu(QMenu *formatMenu, const QModelIndex &mi)
});
for (int i = 0; i != alternativeFormats.size(); ++i) {
const QString display = spacer + alternativeFormats.at(i).display;
const int format = alternativeFormats.at(i).format;
const int format = alternativeFormats.at(i);
const QString display = spacer + WatchHandler::nameForFormat(format);
QAction *act = new QAction(display, formatMenu);
act->setCheckable(true);
act->setChecked(format == individualFormat);
@@ -633,9 +631,9 @@ void WatchTreeView::fillFormatMenu(QMenu *formatMenu, const QModelIndex &mi)
});
for (int i = 0; i != alternativeFormats.size(); ++i) {
const QString display = spacer + alternativeFormats.at(i).display;
const int format = alternativeFormats.at(i);
const QString display = spacer + WatchHandler::nameForFormat(format);
QAction *act = new QAction(display, formatMenu);
const int format = alternativeFormats.at(i).format;
act->setCheckable(true);
act->setChecked(format == typeFormat);
formatMenu->addAction(act);
@@ -1108,7 +1106,7 @@ void WatchTreeView::inputNewExpression()
"\">documentation</a>."));
dlg.setHistoryCompleter(QLatin1String("WatchItems"));
if (dlg.exec() == QDialog::Accepted) {
QString exp = dlg.text();
const QString exp = dlg.text().trimmed();
if (!exp.isEmpty())
watchExpression(exp, exp);
}
-1
View File
@@ -55,7 +55,6 @@
#include <QHBoxLayout>
#include <QToolBar>
#include <QComboBox>
#include <QAction>
#include <QDir>
#include <QTextCodec>
#include <QTextBlock>
@@ -30,7 +30,6 @@
#include "diffeditormanager.h"
#include "diffeditor.h"
#include "diffeditordocument.h"
#include "diffeditorconstants.h"
#include "diffeditordocument.h"
#include <coreplugin/editormanager/editormanager.h>
@@ -45,7 +45,6 @@
#include <texteditor/textdocument.h>
#include <texteditor/textdocumentlayout.h>
#include <texteditor/textdocument.h>
#include <texteditor/texteditorsettings.h>
#include <texteditor/fontsettings.h>
#include <texteditor/displaysettings.h>
+15 -6
View File
@@ -4566,7 +4566,7 @@ bool FakeVimHandler::Private::handleRegisterSubMode(const Input &input)
bool handled = false;
QChar reg = input.asChar();
if (QString::fromLatin1("*+.%#:-\"").contains(reg) || reg.isLetterOrNumber()) {
if (QString::fromLatin1("*+.%#:-\"_").contains(reg) || reg.isLetterOrNumber()) {
m_register = reg.unicode();
handled = true;
}
@@ -4914,6 +4914,15 @@ void FakeVimHandler::Private::handleInsertMode(const Input &input)
const int beginPos = position();
Range range(beginPos, endPos, RangeCharMode);
removeText(range);
} else if (input.isControl('u')) {
const int blockNumber = m_cursor.blockNumber();
const int endPos = position();
moveToStartOfLine();
if (blockNumber != m_cursor.blockNumber())
moveToEndOfLine();
const int beginPos = position();
Range range(beginPos, endPos, RangeCharMode);
removeText(range);
} else if (input.isKey(Key_Insert)) {
g.mode = ReplaceMode;
} else if (input.isKey(Key_Left)) {
@@ -6926,9 +6935,6 @@ void FakeVimHandler::Private::yankText(const Range &range, int reg)
// If register is not specified or " ...
if (m_register == '"') {
// copy to yank register 0 too
setRegister('0', text, range.rangemode);
// with delete and change commands set register 1 (if text contains more lines) or
// small delete register -
if (g.submode == DeleteSubMode || g.submode == ChangeSubMode) {
@@ -6936,9 +6942,12 @@ void FakeVimHandler::Private::yankText(const Range &range, int reg)
setRegister('1', text, range.rangemode);
else
setRegister('-', text, range.rangemode);
} else {
// copy to yank register 0 too
setRegister('0', text, range.rangemode);
}
} else {
// Always copy to " register too.
} else if (m_register != '_') {
// Always copy to " register too (except black hole register).
setRegister('"', text, range.rangemode);
}
-1
View File
@@ -41,7 +41,6 @@ namespace Git {
struct CloneWizardPagePrivate;
// Used by gitorious as well.
class CloneWizardPage : public VcsBase::BaseCheckoutWizardPage
{
Q_OBJECT
-1
View File
@@ -61,7 +61,6 @@
#include <coreplugin/editormanager/ieditor.h>
#include <coreplugin/locator/commandlocator.h>
#include <coreplugin/vcsmanager.h>
#include <coreplugin/coreconstants.h>
#include <coreplugin/messagebox.h>
#include <utils/mimetypes/mimedatabase.h>
-1
View File
@@ -48,7 +48,6 @@
#include <utils/stringutils.h>
#include <utils/qtcassert.h>
#include <utils/qtcprocess.h>
#include <utils/qtcassert.h>
using namespace Core;
using namespace ProjectExplorer;
+1 -1
View File
@@ -101,7 +101,7 @@ QList<Core::Id> IosRunConfigurationFactory::availableCreationIds(Target *parent,
QList<QmakeProFileNode *> nodes = project->allProFiles(QList<QmakeProjectType>()
<< ApplicationTemplate
<< LibraryTemplate
<< SharedLibraryTemplate
<< AuxTemplate);
if (mode == AutoCreate)
nodes = QmakeProject::nodesWithQtcRunnable(nodes);
@@ -42,6 +42,7 @@
#include <texteditor/texteditorsettings.h>
#include <texteditor/fontsettings.h>
#include <utils/ansiescapecodehandler.h>
#include <utils/theme/theme.h>
#include <QIcon>
#include <QTextCharFormat>
@@ -184,30 +185,26 @@ QList<QWidget *> CompileOutputWindow::toolBarWidgets() const
return QList<QWidget *>() << m_cancelBuildButton;
}
static QColor mix_colors(const QColor &a, const QColor &b)
{
return QColor((a.red() + 2 * b.red()) / 3, (a.green() + 2 * b.green()) / 3,
(a.blue() + 2* b.blue()) / 3, (a.alpha() + 2 * b.alpha()) / 3);
}
void CompileOutputWindow::appendText(const QString &text, BuildStep::OutputFormat format)
{
using Utils::Theme;
QPalette p = m_outputWindow->palette();
Theme *theme = Utils::creatorTheme();
QTextCharFormat textFormat;
switch (format) {
case BuildStep::NormalOutput:
textFormat.setForeground(p.color(QPalette::Text));
textFormat.setForeground(theme->color(Theme::TextColorNormal));
textFormat.setFontWeight(QFont::Normal);
break;
case BuildStep::ErrorOutput:
textFormat.setForeground(mix_colors(p.color(QPalette::Text), QColor(Qt::red)));
textFormat.setForeground(theme->color(Theme::CompileOutput_ErrorOutput));
textFormat.setFontWeight(QFont::Normal);
break;
case BuildStep::MessageOutput:
textFormat.setForeground(mix_colors(p.color(QPalette::Text), QColor(Qt::blue)));
textFormat.setForeground(theme->color(Theme::CompileOutput_MessageOutput));
break;
case BuildStep::ErrorMessageOutput:
textFormat.setForeground(mix_colors(p.color(QPalette::Text), QColor(Qt::red)));
textFormat.setForeground(theme->color(Theme::CompileOutput_ErrorMessageOutput));
textFormat.setFontWeight(QFont::Bold);
break;
@@ -37,7 +37,6 @@
#include <projectexplorer/project.h>
#include <projectexplorer/projectexplorerconstants.h>
#include <ssh/sshhostkeydatabase.h>
#include <utils/qtcassert.h>
#include <utils/fileutils.h>
#include <utils/persistentsettings.h>
#include <utils/qtcassert.h>
@@ -288,7 +288,6 @@ public:
void updateWelcomePage();
void handleRunControlFinished();
void runConfigurationConfigurationFinished();
public:
@@ -566,7 +565,9 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er
connect(dd->m_outputPane, &AppOutputPane::runControlStarted,
this, &ProjectExplorerPlugin::runControlStarted);
connect(dd->m_outputPane, &AppOutputPane::runControlFinished,
dd, &ProjectExplorerPluginPrivate::handleRunControlFinished);
this, &ProjectExplorerPlugin::runControlFinished);
connect(dd->m_outputPane, &AppOutputPane::runControlFinished,
this, &ProjectExplorerPlugin::updateRunActions);
addAutoReleasedObject(new AllProjectsFilter);
addAutoReleasedObject(new CurrentProjectFilter);
@@ -1964,11 +1965,6 @@ void ProjectExplorerPlugin::startRunControl(RunControl *runControl, RunMode runM
dd->startRunControl(runControl, runMode);
}
void ProjectExplorerPluginPrivate::handleRunControlFinished()
{
emit m_instance->updateRunActions();
}
void ProjectExplorerPluginPrivate::startRunControl(RunControl *runControl, RunMode runMode)
{
m_outputPane->createNewOutputWindow(runControl);
@@ -1978,8 +1974,6 @@ void ProjectExplorerPluginPrivate::startRunControl(RunControl *runControl, RunMo
|| ((runMode == DebugRunMode || runMode == DebugRunModeWithBreakOnMain)
&& m_projectExplorerSettings.showDebugOutput);
m_outputPane->setBehaviorOnOutput(runControl, popup ? AppOutputPane::Popup : AppOutputPane::Flash);
QObject::connect(runControl, &RunControl::finished,
this, &ProjectExplorerPluginPrivate::handleRunControlFinished);
runControl->start();
emit m_instance->updateRunActions();
}
-1
View File
@@ -48,7 +48,6 @@
#include <utils/algorithm.h>
#include <utils/stylehelper.h>
#include <utils/algorithm.h>
#include <QDebug>
#include <QDir>
+18 -6
View File
@@ -41,6 +41,7 @@
static const int TARGET_HEIGHT = 43;
static const int NAVBUTTON_WIDTH = 27;
static const int KITNAME_MARGINS = 6;
namespace ProjectExplorer {
namespace Internal {
@@ -86,7 +87,8 @@ TargetSelector::TargetSelector(QWidget *parent) :
m_currentTargetIndex(-1),
m_currentHoveredTargetIndex(-1),
m_startIndex(0),
m_menuShown(false)
m_menuShown(false),
m_targetWidthNeedsUpdate(true)
{
QFont f = font();
f.setPixelSize(10);
@@ -129,6 +131,7 @@ void TargetSelector::insertTarget(int index, int subIndex, const QString &name)
if (m_currentTargetIndex >= index)
setCurrentIndex(m_currentTargetIndex + 1);
m_targetWidthNeedsUpdate = true;
updateGeometry();
update();
}
@@ -136,6 +139,8 @@ void TargetSelector::insertTarget(int index, int subIndex, const QString &name)
void TargetSelector::renameTarget(int index, const QString &name)
{
m_targets[index].name = name;
m_targetWidthNeedsUpdate = true;
updateGeometry();
update();
}
@@ -150,6 +155,7 @@ void TargetSelector::removeTarget(int index)
// force a signal since the index has changed
emit currentChanged(m_currentTargetIndex, m_targets.at(m_currentTargetIndex).currentSubIndex);
}
m_targetWidthNeedsUpdate = true;
updateGeometry();
update();
}
@@ -212,10 +218,16 @@ void TargetSelector::setTargetMenu(QMenu *menu)
int TargetSelector::targetWidth() const
{
static int width = -1;
if (width < 0) {
if (width < 0 || m_targetWidthNeedsUpdate) {
m_targetWidthNeedsUpdate = false;
QFontMetrics fm = fontMetrics();
width = qMax(fm.width(runButtonString()), fm.width(buildButtonString()));
width = qMax(149, width * 2 + 31);
width = 149; // minimum
// let it grow for the kit names ...
foreach (const Target &target, m_targets)
width = qMax(width, fm.width(target.name) + KITNAME_MARGINS + 2/*safety measure*/);
width = qMin(width, 299); // ... but not too much
int buttonWidth = qMax(fm.width(runButtonString()), fm.width(buildButtonString()));
width = qMax(width, buttonWidth * 2 + 31); // run & build button strings must be fully visible
}
return width;
}
@@ -227,7 +239,7 @@ QSize TargetSelector::sizeHint() const
int TargetSelector::maxVisibleTargets() const
{
return (width() - ((NAVBUTTON_WIDTH + 1) * 2 + 3))/(targetWidth() + 1);
return qMax((width() - ((NAVBUTTON_WIDTH + 1) * 2 + 3))/(targetWidth() + 1), 1);
}
void TargetSelector::getControlAt(int x, int y, int *buttonIndex, int *targetIndex, int *targetSubIndex)
@@ -416,7 +428,7 @@ void TargetSelector::paintEvent(QPaintEvent *event)
QRect buttonRect(x, 1, targetWidth() , image.height());
Utils::StyleHelper::drawCornerImage(image, &p, buttonRect, 16, 0, 16, 0);
const QString nameText = QFontMetrics(font()).elidedText(target.name, Qt::ElideRight,
targetWidth() - 6);
targetWidth() - KITNAME_MARGINS);
p.drawText(x + (targetWidth()- fm.width(nameText))/2 + 1, 7 + fm.ascent(),
nameText);
@@ -116,6 +116,7 @@ private:
int m_currentHoveredTargetIndex;
int m_startIndex;
bool m_menuShown;
mutable bool m_targetWidthNeedsUpdate;
};
} // namespace Internal
@@ -92,7 +92,7 @@ QList<Core::Id> QmakeAndroidRunConfigurationFactory::availableCreationIds(Target
QmakeProject *project = static_cast<QmakeProject *>(parent->project());
QList<QmakeProFileNode *> nodes = project->allProFiles(QList<QmakeProjectType>()
<< ApplicationTemplate
<< LibraryTemplate);
<< SharedLibraryTemplate);
if (mode == AutoCreate)
nodes = QmakeProject::nodesWithQtcRunnable(nodes);
@@ -1048,7 +1048,7 @@ void InternalLibraryDetailsController::updateProFile()
QList<QmakeProFileNode *> proFiles = findQt4ProFiles(rootProject);
foreach (QmakeProFileNode *proFileNode, proFiles) {
const QString proFilePath = proFileNode->path().toString();
if (proFileNode->projectType() == LibraryTemplate) {
if (proFileNode->projectType() == SharedLibraryTemplate) {
const QStringList configVar = proFileNode->variableValue(ConfigVar);
if (!configVar.contains(QLatin1String("plugin"))) {
const QString relProFilePath = rootDir.relativeFilePath(proFilePath);
+10 -5
View File
@@ -917,7 +917,8 @@ QList<ProjectAction> QmakePriFileNode::supportedActions(Node *node) const
switch (proFileNode->projectType()) {
case ApplicationTemplate:
case LibraryTemplate:
case StaticLibraryTemplate:
case SharedLibraryTemplate:
case AuxTemplate: {
// TODO: Some of the file types don't make much sense for aux
// projects (e.g. cpp). It'd be nice if the "add" action could
@@ -1495,8 +1496,10 @@ static QmakeProjectType proFileTemplateTypeToProjectType(ProFileEvaluator::Templ
case ProFileEvaluator::TT_Unknown:
case ProFileEvaluator::TT_Application:
return ApplicationTemplate;
case ProFileEvaluator::TT_Library:
return LibraryTemplate;
case ProFileEvaluator::TT_StaticLibrary:
return StaticLibraryTemplate;
case ProFileEvaluator::TT_SharedLibrary:
return SharedLibraryTemplate;
case ProFileEvaluator::TT_Script:
return ScriptTemplate;
case ProFileEvaluator::TT_Aux:
@@ -1639,7 +1642,7 @@ FolderNode::AddNewInformation QmakeProFileNode::addNewInformation(const QStringL
bool QmakeProFileNode::showInSimpleTree(QmakeProjectType projectType) const
{
return (projectType == ApplicationTemplate || projectType == LibraryTemplate);
return (projectType == ApplicationTemplate || projectType == SharedLibraryTemplate || projectType == StaticLibraryTemplate);
}
bool QmakeProFileNode::isDebugAndRelease() const
@@ -2512,7 +2515,9 @@ void QmakeProFileNode::updateUiFiles(const QString &buildDir)
m_uiFiles.clear();
// Only those two project types can have ui files for us
if (m_projectType == ApplicationTemplate || m_projectType == LibraryTemplate) {
if (m_projectType == ApplicationTemplate ||
m_projectType == SharedLibraryTemplate ||
m_projectType == StaticLibraryTemplate) {
// Find all ui files
FindUiFileNodesVisitor uiFilesVisitor;
this->accept(&uiFilesVisitor);
+2 -1
View File
@@ -72,7 +72,8 @@ class QmakeProject;
enum QmakeProjectType {
InvalidProject = 0,
ApplicationTemplate,
LibraryTemplate,
StaticLibraryTemplate,
SharedLibraryTemplate,
ScriptTemplate,
AuxTemplate,
SubDirsTemplate
@@ -1492,7 +1492,8 @@ void QmakeProject::collectData(const QmakeProFileNode *node, DeploymentData &dep
if (!installsList.targetPath.isEmpty())
collectApplicationData(node, deploymentData);
break;
case LibraryTemplate:
case SharedLibraryTemplate:
case StaticLibraryTemplate:
collectLibraryData(node, deploymentData);
break;
case SubDirsTemplate:
+4 -2
View File
@@ -114,8 +114,10 @@ public:
inline bool operator ==(const QMakeStepConfig &a, const QMakeStepConfig &b) {
return std::tie(a.archConfig, a.osType, a.linkQmlDebuggingQQ1, a.linkQmlDebuggingQQ2, a.useQtQuickCompiler, a.separateDebugInfo)
== std::tie(b.archConfig, b.osType, b.linkQmlDebuggingQQ1, b.linkQmlDebuggingQQ2, b.useQtQuickCompiler, b.separateDebugInfo);
return std::tie(a.archConfig, a.osType, a.linkQmlDebuggingQQ1, a.linkQmlDebuggingQQ2)
== std::tie(b.archConfig, b.osType, b.linkQmlDebuggingQQ1, b.linkQmlDebuggingQQ2)
&& std::tie(a.useQtQuickCompiler, a.separateDebugInfo)
== std::tie(b.useQtQuickCompiler, b.separateDebugInfo);
}
inline bool operator !=(const QMakeStepConfig &a, const QMakeStepConfig &b) {
@@ -28,7 +28,7 @@
**
****************************************************************************/
vec4 orange = vec4(1.0, 165.0 / 255.0, 0.0, 1.0);
lowp vec4 orange = vec4(1.0, 165.0 / 255.0, 0.0, 1.0);
void main()
{
gl_FragColor = orange;
@@ -76,7 +76,6 @@ public:
QmlProfilerTraceViewPrivate(QmlProfilerTraceView *qq) : q(qq) {}
QmlProfilerTraceView *q;
QmlProfilerStateManager *m_profilerState;
QmlProfilerTool *m_profilerTool;
QmlProfilerViewManager *m_viewContainer;
@@ -90,7 +89,7 @@ public:
Timeline::TimelineZoomControl *m_zoomControl;
};
QmlProfilerTraceView::QmlProfilerTraceView(QWidget *parent, QmlProfilerTool *profilerTool, QmlProfilerViewManager *container, QmlProfilerModelManager *modelManager, QmlProfilerStateManager *profilerState)
QmlProfilerTraceView::QmlProfilerTraceView(QWidget *parent, QmlProfilerTool *profilerTool, QmlProfilerViewManager *container, QmlProfilerModelManager *modelManager)
: QWidget(parent), d(new QmlProfilerTraceViewPrivate(this))
{
setObjectName(QLatin1String("QML Profiler"));
@@ -141,9 +140,6 @@ QmlProfilerTraceView::QmlProfilerTraceView(QWidget *parent, QmlProfilerTool *pro
// Connect this last so that it's executed after the models have updated their data.
connect(modelManager->qmlModel(), SIGNAL(changed()), d->m_modelProxy, SIGNAL(stateChanged()));
connect(d->m_modelManager, SIGNAL(stateChanged()), this, SLOT(profilerDataModelStateChanged()));
d->m_profilerState = profilerState;
// Minimum height: 5 rows of 20 pixels + scrollbar of 50 pixels + 20 pixels margin
setMinimumHeight(170);
@@ -308,23 +304,6 @@ void QmlProfilerTraceView::showContextMenu(QPoint position)
}
////////////////////////////////////////////////////////////////
// Profiler State
void QmlProfilerTraceView::profilerDataModelStateChanged()
{
switch (d->m_modelManager->state()) {
case QmlProfilerDataState::Empty: break;
case QmlProfilerDataState::ClearingData:
d->m_mainView->hide();
break;
case QmlProfilerDataState::AcquiringData: break;
case QmlProfilerDataState::ProcessingData: break;
case QmlProfilerDataState::Done:
d->m_mainView->show();
break;
default:
break;
}
}
void QmlProfilerTraceView::changeEvent(QEvent *e)
{
@@ -51,8 +51,7 @@ class QmlProfilerTraceView : public QWidget
public:
explicit QmlProfilerTraceView(QWidget *parent, QmlProfilerTool *profilerTool,
QmlProfilerViewManager *container,
QmlProfilerModelManager *modelManager,
QmlProfilerStateManager *profilerState);
QmlProfilerModelManager *modelManager);
~QmlProfilerTraceView();
bool hasValidSelection() const;
@@ -68,7 +67,6 @@ public slots:
private slots:
void updateCursorPosition();
void profilerDataModelStateChanged();
protected:
void changeEvent(QEvent *e) Q_DECL_OVERRIDE;
@@ -95,8 +95,7 @@ void QmlProfilerViewManager::createViews()
d->traceView = new QmlProfilerTraceView(mw,
d->profilerTool,
this,
d->profilerModelManager,
d->profilerState);
d->profilerModelManager);
d->traceView->setWindowTitle(tr("Timeline"));
connect(d->traceView, SIGNAL(gotoSourceLocation(QString,int,int)),
this, SIGNAL(gotoSourceLocation(QString,int,int)));
+4
View File
@@ -10,6 +10,7 @@ exists($$depfile) {
TARGET = $$QTC_PLUGIN_NAME
plugin_deps = $$QTC_PLUGIN_DEPENDS
plugin_test_deps = $$QTC_TEST_DEPENDS
plugin_recmds = $$QTC_PLUGIN_RECOMMENDS
include(../qtcreator.pri)
@@ -36,6 +37,9 @@ for(dep, plugin_deps) {
for(dep, plugin_recmds) {
dependencyList += " { \"Name\" : \"$$dependencyName($$dep)\", \"Version\" : \"$$QTCREATOR_VERSION\", \"Type\" : \"optional\" }"
}
for(dep, plugin_test_deps) {
dependencyList += " { \"Name\" : \"$$dependencyName($$dep)\", \"Version\" : \"$$QTCREATOR_VERSION\", \"Type\" : \"test\" }"
}
dependencyList = $$join(dependencyList, ",$$escape_expand(\\n)")
dependencyList = "\"Dependencies\" : [$$escape_expand(\\n)$$dependencyList$$escape_expand(\\n) ]"

Some files were not shown because too many files have changed in this diff Show More