From 6df27ccbe7a1baa8c0adf6cfb4b7079c22c8ed82 Mon Sep 17 00:00:00 2001 From: hjk Date: Tue, 2 Mar 2021 07:22:38 +0100 Subject: [PATCH] Debugger: Mark elision of long QUrls in Locals and Expressions Fixes: QTCREATORBUG-25404 Change-Id: Ieee42f9239c9ffe88da03765678e1d2c4b6bb11d Reviewed-by: David Schulz --- share/qtcreator/debugger/qttypes.py | 4 ++-- tests/manual/debugger/simple/simple_test_app.cpp | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/share/qtcreator/debugger/qttypes.py b/share/qtcreator/debugger/qttypes.py index 041a9232555..6b704a9642d 100644 --- a/share/qtcreator/debugger/qttypes.py +++ b/share/qtcreator/debugger/qttypes.py @@ -1854,7 +1854,7 @@ def qdump__QUrl(d, value): userNameEnc = d.encodeString(userName) hostEnc = d.encodeString(host) - pathEnc = d.encodeString(path) + elided, pathEnc = d.encodeStringHelper(path, d.displayStringLimit) url = d.encodeString(scheme) url += '3a002f002f00' # '://' if len(userNameEnc): @@ -1863,7 +1863,7 @@ def qdump__QUrl(d, value): if port >= 0: url += '3a00' + ''.join(['%02x00' % ord(c) for c in str(port)]) url += pathEnc - d.putValue(url, 'utf16') + d.putValue(url, 'utf16', elided=elided) displayFormat = d.currentItemFormat() if displayFormat == DisplayFormat.Separate: diff --git a/tests/manual/debugger/simple/simple_test_app.cpp b/tests/manual/debugger/simple/simple_test_app.cpp index 5d782d4190e..cbe4294389d 100644 --- a/tests/manual/debugger/simple/simple_test_app.cpp +++ b/tests/manual/debugger/simple/simple_test_app.cpp @@ -3919,11 +3919,13 @@ namespace qurl { 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")); BREAK_HERE; // Check url "http://qt-project.org" QUrl. // Continue. - dummyStatement(&url); + dummyStatement(&url, &u); } } // namespace qurl