reslist: fix webkit version which was broken by our now setting baseURL
This commit is contained in:
parent
4576cf7285
commit
99c5ee55aa
@ -145,17 +145,23 @@ public:
|
|||||||
virtual void suggest(const vector<string>uterms,
|
virtual void suggest(const vector<string>uterms,
|
||||||
map<string, vector<string> >& sugg);
|
map<string, vector<string> >& sugg);
|
||||||
virtual string absSep() {return (const char *)(prefs.abssep.toUtf8());}
|
virtual string absSep() {return (const char *)(prefs.abssep.toUtf8());}
|
||||||
#ifdef USING_WEBENGINE
|
|
||||||
|
#if defined(USING_WEBENGINE) || defined(USING_WEBKIT)
|
||||||
// We used to use http://localhost/. Now use file:/// as this is
|
// We used to use http://localhost/. Now use file:/// as this is
|
||||||
// what Webengine will prepend relative links with (as
|
// what Webengine will prepend relative links with (as
|
||||||
// baseURL). This is for the case where a user adds a link like
|
// baseURL). This is for the case where a user adds a link like
|
||||||
// P%N, which would not work if linkPrefix and baseURL were not
|
// P%N, which would not work if linkPrefix and baseURL were not
|
||||||
// the same.
|
// the same.
|
||||||
|
//
|
||||||
|
// Now also set for webkit because, as we set baseURL to file://,
|
||||||
|
// the relative links we set in the list will also be prefixed (by
|
||||||
|
// the HTML engine)
|
||||||
virtual string linkPrefix() override {return "file:///";}
|
virtual string linkPrefix() override {return "file:///";}
|
||||||
virtual string bodyAttrs() override {
|
virtual string bodyAttrs() override {
|
||||||
return "onload=\"addEventListener('contextmenu', saveLoc)\"";
|
return "onload=\"addEventListener('contextmenu', saveLoc)\"";
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
private:
|
private:
|
||||||
ResList *m_reslist;
|
ResList *m_reslist;
|
||||||
};
|
};
|
||||||
@ -959,8 +965,6 @@ void ResList::onLinkClicked(const QUrl &qurl)
|
|||||||
// baseUrl because we receive links like baseUrl+P1 instead.
|
// baseUrl because we receive links like baseUrl+P1 instead.
|
||||||
LOGDEB1("ResList::onLinkClicked: [" << strurl << "] prefix " <<
|
LOGDEB1("ResList::onLinkClicked: [" << strurl << "] prefix " <<
|
||||||
m_pager->linkPrefix() << "\n");
|
m_pager->linkPrefix() << "\n");
|
||||||
std::cerr << "ResList::onLinkClicked: [" << strurl << "] prefix " <<
|
|
||||||
m_pager->linkPrefix() << "\n";
|
|
||||||
if (m_pager->linkPrefix().size() > 0 &&
|
if (m_pager->linkPrefix().size() > 0 &&
|
||||||
(strurl.size() <= m_pager->linkPrefix().size() ||
|
(strurl.size() <= m_pager->linkPrefix().size() ||
|
||||||
!beginswith(strurl, m_pager->linkPrefix()))) {
|
!beginswith(strurl, m_pager->linkPrefix()))) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user