1
mirror of https://invent.kde.org/network/falkon.git synced 2024-11-11 09:32:12 +01:00

[Fix] Loading incomplete urls in Speed Dial.

This commit is contained in:
nowrep 2012-01-29 14:38:59 +01:00
parent 0703789aa3
commit f9873c28df
3 changed files with 8 additions and 2 deletions

View File

@ -129,7 +129,7 @@ function boxEdited() {
var box = document.getElementById('quickdial').getElementsByTagName('div')[editingId]; var box = document.getElementById('quickdial').getElementsByTagName('div')[editingId];
var a = box.getElementsByTagName('a')[0]; var a = box.getElementsByTagName('a')[0];
var originalUrl = a.getAttribute('href'); var originalUrl = a.getAttribute('href');
setBoxUrl(editingId, $('#formUrl').attr("value")); setBoxUrl(editingId, speeddial.urlFromUserInput($('#formUrl').attr("value")));
setBoxTitle(editingId, $('#formTitle').attr("value")); setBoxTitle(editingId, $('#formTitle').attr("value"));
var changedUrl = a.getAttribute('href'); var changedUrl = a.getAttribute('href');
var fetchTitleChecked = document.getElementById('fetchTitle').checked; var fetchTitleChecked = document.getElementById('fetchTitle').checked;

View File

@ -204,7 +204,7 @@ void SpeedDial::loadThumbnail(const QString &url, bool loadTitle)
} }
PageThumbnailer* thumbnailer = new PageThumbnailer(this); PageThumbnailer* thumbnailer = new PageThumbnailer(this);
thumbnailer->setUrl(QUrl::fromUserInput(url)); thumbnailer->setUrl(url);
thumbnailer->setLoadTitle(loadTitle); thumbnailer->setLoadTitle(loadTitle);
connect(thumbnailer, SIGNAL(thumbnailCreated(QPixmap)), this, SLOT(thumbnailCreated(QPixmap))); connect(thumbnailer, SIGNAL(thumbnailCreated(QPixmap)), this, SLOT(thumbnailCreated(QPixmap)));
@ -225,6 +225,11 @@ QString SpeedDial::getOpenFileName()
return QFileDialog::getOpenFileName(0, tr("Select image..."), QDir::homePath(), "(*.png *.jpg *.jpeg *.bmp *.gif *.tiff)"); return QFileDialog::getOpenFileName(0, tr("Select image..."), QDir::homePath(), "(*.png *.jpg *.jpeg *.bmp *.gif *.tiff)");
} }
QString SpeedDial::urlFromUserInput(const QString &url)
{
return QUrl::fromUserInput(url).toString();
}
void SpeedDial::setBackgroundImage(const QString &image) void SpeedDial::setBackgroundImage(const QString &image)
{ {
m_backgroundImage = image; m_backgroundImage = image;

View File

@ -53,6 +53,7 @@ public slots:
Q_INVOKABLE void removeImageForUrl(const QString &url); Q_INVOKABLE void removeImageForUrl(const QString &url);
Q_INVOKABLE QString getOpenFileName(); Q_INVOKABLE QString getOpenFileName();
Q_INVOKABLE QString urlFromUserInput(const QString &url);
Q_INVOKABLE void setBackgroundImage(const QString &image); Q_INVOKABLE void setBackgroundImage(const QString &image);
Q_INVOKABLE void setBackgroundImageSize(const QString &size); Q_INVOKABLE void setBackgroundImageSize(const QString &size);
Q_INVOKABLE void setPagesInRow(int count); Q_INVOKABLE void setPagesInRow(int count);