diff options
Diffstat (limited to 'src/plugins/debugger/watchhandler.cpp')
-rw-r--r-- | src/plugins/debugger/watchhandler.cpp | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/src/plugins/debugger/watchhandler.cpp b/src/plugins/debugger/watchhandler.cpp index 053fcadcd1..47f1593db3 100644 --- a/src/plugins/debugger/watchhandler.cpp +++ b/src/plugins/debugger/watchhandler.cpp @@ -402,18 +402,30 @@ bool WatchHandler::setData(const QModelIndex &idx, static QString niceType(QString type) { if (type.contains("std::")) { - static QRegExp re("std::vector<(.*)\\s*,std::allocator<(.*)>\\s*>"); - re.setMinimal(true); - + // std::string type.replace("std::basic_string<char, std::char_traits<char>, " "std::allocator<char> >", "std::string"); + + // std::wstring type.replace("std::basic_string<wchar_t, std::char_traits<wchar_t>, " "std::allocator<wchar_t> >", "std::wstring"); + // std::vector + static QRegExp re1("std::vector<(.*)\\s*,std::allocator<(.*)>\\s*>"); + re1.setMinimal(true); + for (int i = 0; i != 10; ++i) { + if (re1.indexIn(type) == -1 || re1.cap(1) != re1.cap(2)) + break; + type.replace(re1.cap(0), "std::vector<" + re1.cap(1) + ">"); + } + + // std::list + static QRegExp re2("std::list<(.*)\\s*,std::allocator<(.*)>\\s*>"); + re2.setMinimal(true); for (int i = 0; i != 10; ++i) { - if (re.indexIn(type) == -1 || re.cap(1) != re.cap(2)) + if (re2.indexIn(type) == -1 || re2.cap(1) != re2.cap(2)) break; - type.replace(re.cap(0), "std::vector<" + re.cap(1) + ">"); + type.replace(re2.cap(0), "std::list<" + re2.cap(1) + ">"); } type.replace(" >", ">"); |