Details
Description
Looking at the code of QWebHitTestResult::linkTitle in qtwebkit/Source/WebKit/qt/WidgetApi/qwebframe.cpp, it does this:
QUrl QWebHitTestResult::linkTitle() const { if (!d) return QUrl(); return d->linkTitle; }
d->linkTitle is a QString, not a QUrl. I guess C++ will automatically call QUrl::QUrl(const QString & url), correct?
Why is that? If I'm not mistaken this would return an invalid QUrl in any case.
If this can't be changed because of ABI compatibility, I propose the following:
- Change the documentation to point this issue out, and how to get the title if it's still retrievable from the QUrl.
- Convert the QString to a QUrl explicitely and add a comment describing why this is the way this is.
If I get the time I can submit a contribution for these changes, but I'd like to be sure it can't be changed in some better way first.
Attachments
For Gerrit Dashboard: QTBUG-44052 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
104227,3 | Add QWebHitTestResult::linkTitleString(). | dev | qt/qtwebkit | Status: MERGED | +2 | 0 |
104228,3 | Convert to QUrl explicitly in QWebHitTestResult::linkTitle(). | dev | qt/qtwebkit | Status: ABANDONED | 0 | 0 |