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

Always encoding query when showing url in locationbar.

This commit is contained in:
nowrep 2012-02-21 21:28:19 +01:00
parent 38b5a32bb9
commit da3d929763
4 changed files with 14 additions and 4 deletions

View File

@ -36,6 +36,7 @@
#include "goicon.h"
#include "rssicon.h"
#include "downicon.h"
#include "globalfunctions.h"
LocationBar::LocationBar(QupZilla* mainClass)
: LineEdit()
@ -199,7 +200,7 @@ void LocationBar::showUrl(const QUrl &url)
return;
}
QString stringUrl = url.toString();
QString stringUrl = qz_urlEncodeQueryString(url);
if (stringUrl == "qupzilla:speeddial" || stringUrl == "about:blank") {
stringUrl = "";

View File

@ -18,8 +18,7 @@
#include "popuplocationbar.h"
#include "popupwebview.h"
#include "toolbutton.h"
#include <QDebug>
#include "globalfunctions.h"
class PopupSiteIcon : public QWidget
{
@ -62,7 +61,7 @@ void PopupLocationBar::setView(PopupWebView* view)
void PopupLocationBar::showUrl(const QUrl &url)
{
setText(url.toString());
setText(qz_urlEncodeQueryString(url));
setCursorPosition(0);
}

View File

@ -148,6 +148,15 @@ QUrl qz_makeRelativeUrl(const QUrl &baseUrl, const QUrl &rUrl)
return returnUrl;
}
QString qz_urlEncodeQueryString(const QUrl &url)
{
QString returnString = url.toString(QUrl::RemoveQuery | QUrl::RemoveFragment);
returnString.append(url.encodedQuery());
returnString.append(url.encodedFragment());
return returnString;
}
QString qz_ensureUniqueFilename(const QString &pathToFile)
{
if (!QFile::exists(pathToFile)) {

View File

@ -42,6 +42,7 @@ void qz_removeDir(const QString &d);
QString qz_samePartOfStrings(const QString &one, const QString &other);
QUrl qz_makeRelativeUrl(const QUrl &baseUrl, const QUrl &rUrl);
QString qz_urlEncodeQueryString(const QUrl &url);
QString qz_ensureUniqueFilename(const QString &name);
QString qz_getFileNameFromUrl(const QUrl &url);