mirror of
https://github.com/GoldenCheetah/GoldenCheetah.git
synced 2026-02-13 08:08:42 +00:00
WebPage add http:// if no scheme present
.. so users can set a url to news.bbc.co.uk without having to type out http:// first.
This commit is contained in:
@@ -222,10 +222,14 @@ WebPageWindow::forceReplot()
|
||||
void
|
||||
WebPageWindow::userUrl()
|
||||
{
|
||||
// add http:// if scheme is missing
|
||||
QRegExp hasscheme("^[^:]*://.*");
|
||||
QString url = rCustomUrl->text();
|
||||
if (!hasscheme.exactMatch(url)) url = "http://" + url;
|
||||
#ifdef NOWEBKIT
|
||||
view->setUrl(QUrl(rCustomUrl->text()));
|
||||
view->setUrl(QUrl(url));
|
||||
#else
|
||||
view->page()->mainFrame()->load(QUrl(rCustomUrl->text()));
|
||||
view->page()->mainFrame()->load(QUrl(url));
|
||||
//qDebug()<<"load page"<<rCustomUrl->text();
|
||||
#endif
|
||||
}
|
||||
@@ -278,7 +282,7 @@ WebPageWindow::event(QEvent *event)
|
||||
void
|
||||
WebPageWindow::downloadRequested(QWebEngineDownloadItem *item)
|
||||
{
|
||||
qDebug()<<"Download Requested:"<<item->url().toString();
|
||||
//qDebug()<<"Download Requested:"<<item->url().toString();
|
||||
}
|
||||
void
|
||||
WebPageWindow::linkHovered(QString link)
|
||||
|
||||
Reference in New Issue
Block a user