Debugger: Mark elision of long QUrls in Locals and Expressions

Fixes: QTCREATORBUG-25404
Change-Id: Ieee42f9239c9ffe88da03765678e1d2c4b6bb11d
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
hjk
2021-03-02 07:22:38 +01:00
parent 9e4e44d180
commit 6df27ccbe7
2 changed files with 5 additions and 3 deletions

View File

@@ -1854,7 +1854,7 @@ def qdump__QUrl(d, value):
userNameEnc = d.encodeString(userName) userNameEnc = d.encodeString(userName)
hostEnc = d.encodeString(host) hostEnc = d.encodeString(host)
pathEnc = d.encodeString(path) elided, pathEnc = d.encodeStringHelper(path, d.displayStringLimit)
url = d.encodeString(scheme) url = d.encodeString(scheme)
url += '3a002f002f00' # '://' url += '3a002f002f00' # '://'
if len(userNameEnc): if len(userNameEnc):
@@ -1863,7 +1863,7 @@ def qdump__QUrl(d, value):
if port >= 0: if port >= 0:
url += '3a00' + ''.join(['%02x00' % ord(c) for c in str(port)]) url += '3a00' + ''.join(['%02x00' % ord(c) for c in str(port)])
url += pathEnc url += pathEnc
d.putValue(url, 'utf16') d.putValue(url, 'utf16', elided=elided)
displayFormat = d.currentItemFormat() displayFormat = d.currentItemFormat()
if displayFormat == DisplayFormat.Separate: if displayFormat == DisplayFormat.Separate:

View File

@@ -3919,11 +3919,13 @@ namespace qurl {
void testQUrl() void testQUrl()
{ {
QString s("123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_");
QUrl u(QString("123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_"));
QUrl url(QString("http://qt-project.org")); QUrl url(QString("http://qt-project.org"));
BREAK_HERE; BREAK_HERE;
// Check url "http://qt-project.org" QUrl. // Check url "http://qt-project.org" QUrl.
// Continue. // Continue.
dummyStatement(&url); dummyStatement(&url, &u);
} }
} // namespace qurl } // namespace qurl