Closed Katarn closed 9 years ago
Your imagehost is broken. I recommend hosting your screenshots on http://pomf.se/
@Decme, this is not screenshot, it example link when bug is reproduced. @Emdek, thank you! I'm testing it on this weekend.
@Emdek, this patch does not works, please test it with url from the first post.
@Katarn, it's not saved or not restored? Works for me.
@Emdek, not saved. In default.ini file param title have "" value:
[1/11/History/1]
url="http://www.timeout.ru/msk/feature/35923/pic-423730"
title=""
position=0,0
zoom=100
@Katarn, is it saved if another tab was opened before closing window?
@Emdek, this record appearance in session file immediately after I click middle button on link in the first post. After that, it does not change. Not in the case of activation of the tab and not in the case if I close browser.
@Katarn, text in the tab bar is correct? Both tab bar and session get it from the same source.
@Emdek, no, after browser start title in tab bar is "(Untitled)". I remind you that only in the case if you start browser with active another tab.
@Katarn, but I'm asking if it is correct before closing. ;-)
@Emdek, yes, before browser closing title in tab bar is correct.
@Katarn, is it still present with current master?
@Emdek, yes, the problem is still reproduced.
I debug this problem some time ago. It is very likely that this is a upstream issue.
@Katarn, upstream in QtWebKit or elsewhere?
@Emdek, now I do not remember, I will look later. :)
@Katarn, upstream in QtWebKit or elsewhere?
In QtWebKitWebWidget::getHistory()
method line entry.title = item.title();
returns ""
value when the page opens. Do I understand correctly place in the code where occurs the error?
@Katarn, it could be that one, if it insists that title is empty even if it is not.
It could be also saved incorrectly, read back incorrectly or incorrectly restored in QtWebKitWebWidget::setHistory()
.
You could try to print it with qDebug() << item.title();
and add similar output in other places to track current values when storing and restoring.
I now have little time to research this bug, but I can say that QtWebEngine not have this issue. When I have more time, I'll see where the error lies in QtWebKit.
@Katarn, any progress on this issue?
@Emdek,
I append next qDebug()
lines to setHistory()
method (lines 1830, 1831):
for (int i = 0; i < history.entries.count(); ++i)
{
QVariantList data;
data.append(-1);
data.append(history.entries.at(i).zoom);
data.append(history.entries.at(i).position);
qDebug() << "Title: ";
qDebug() << history.entries.at(i).title;
m_webView->page()->history()->itemAt(i).setUserData(data);
}
and in console I see next output when I first load of tab with problem page:
Debug: Title: (../otter-debug/src/modules/backends/web/qtwebkit/QtWebKitWebWidget.cpp:1830, virtual void Otter::QtWebKitWebWidget::setHistory(const Otter::WindowHistoryInformation&))
Debug: "" (../otter-debug/src/modules/backends/web/qtwebkit/QtWebKitWebWidget.cpp:1831, virtual void Otter::QtWebKitWebWidget::setHistory(const Otter::WindowHistoryInformation&))
@Katarn, so it reads it back as an empty string.
Try to catch item.title()
in QtWebKitWebWidget::getHistory()
, in loop.
for (int i = 0; i < historyCount; ++i)
{
const QWebHistoryItem item = history->itemAt(i);
WindowHistoryEntry entry;
entry.url = item.url().toString();
entry.title = item.title();
entry.position = item.userData().toList().value(PositionEntryData, QPoint(0, 0)).toPoint();
entry.zoom = item.userData().toList().value(ZoomEntryData).toInt();
qDebug() << "getHistoryTitle";
qDebug() << item.title();
information.entries.append(entry);
}
Debug: setHistoryTitle: (../otter-debug/src/modules/backends/web/qtwebkit/QtWebKitWebWidget.cpp:1830, virtual void Otter::QtWebKitWebWidget::setHistory(const Otter::WindowHistoryInformation&))
Debug: "" (../otter-debug/src/modules/backends/web/qtwebkit/QtWebKitWebWidget.cpp:1831, virtual void Otter::QtWebKitWebWidget::setHistory(const Otter::WindowHistoryInformation&))
Debug: getHistoryTitle (../otter-debug/src/modules/backends/web/qtwebkit/QtWebKitWebWidget.cpp:2335, virtual Otter::WindowHistoryInformation Otter::QtWebKitWebWidget::getHistory() const)
Debug: "GitHub" (../otter-debug/src/modules/backends/web/qtwebkit/QtWebKitWebWidget.cpp:2336, virtual Otter::WindowHistoryInformation Otter::QtWebKitWebWidget::getHistory() const)
Debug: getHistoryTitle (../otter-debug/src/modules/backends/web/qtwebkit/QtWebKitWebWidget.cpp:2335, virtual Otter::WindowHistoryInformation Otter::QtWebKitWebWidget::getHistory() const)
Debug: "" (../otter-debug/src/modules/backends/web/qtwebkit/QtWebKitWebWidget.cpp:2336, virtual Otter::WindowHistoryInformation Otter::QtWebKitWebWidget::getHistory() const)
Debug: getHistoryTitle (../otter-debug/src/modules/backends/web/qtwebkit/QtWebKitWebWidget.cpp:2335, virtual Otter::WindowHistoryInformation Otter::QtWebKitWebWidget::getHistory() const)
Debug: "GitHub" (../otter-debug/src/modules/backends/web/qtwebkit/QtWebKitWebWidget.cpp:2336, virtual Otter::WindowHistoryInformation Otter::QtWebKitWebWidget::getHistory() const)
Debug: getHistoryTitle (../otter-debug/src/modules/backends/web/qtwebkit/QtWebKitWebWidget.cpp:2335, virtual Otter::WindowHistoryInformation Otter::QtWebKitWebWidget::getHistory() const)
Debug: "" (../otter-debug/src/modules/backends/web/qtwebkit/QtWebKitWebWidget.cpp:2336, virtual Otter::WindowHistoryInformation Otter::QtWebKitWebWidget::getHistory() const)
By the way, I use lazy loading tabs. When starting the browser was open tab with Github, then I switched to the problematic tab.
@Katarn, if item.title()
is empty then it's something wrong with QtWebKit.
On this page, when I launch the browser and this tab is not active, the title of the tab is loaded with the value of "(Untitled)", perhaps because the title is sets dynamically through JavaScript.
http://www.timeout.ru/msk/feature/35923/pic-423730