Commit 9f66e3d2 authored by Dawit Alemayehu's avatar Dawit Alemayehu
Browse files

Include the port number in the favicon URL name.

BUG: 124482
FIXED-IN: 4.6.5
REVIEW: 101577

(cherry picked from commit aaa3b61e)
parent 7c85b620
......@@ -44,10 +44,18 @@ K_PLUGIN_FACTORY(FavIconsFactory,
)
K_EXPORT_PLUGIN(FavIconsFactory("favicons"))
static QString portForUrl(const KUrl& url)
{
if (url.port() > 0) {
return (QString(QLatin1Char('_')) + QString::number(url.port()));
}
return QString();
}
static QString simplifyURL(const KUrl &url)
{
// splat any = in the URL so it can be safely used as a config key
QString result = url.host() + url.path();
QString result = url.host() + portForUrl(url) + url.path();
for (int i = 0; i < result.length(); ++i)
if (result[i] == '=')
result[i] = '_';
......@@ -57,7 +65,7 @@ static QString simplifyURL(const KUrl &url)
static QString iconNameFromURL(const KUrl &iconURL)
{
if (iconURL.path() == "/favicon.ico")
return iconURL.host();
return iconURL.host() + portForUrl(iconURL);
QString result = simplifyURL(iconURL);
// splat / so it can be safely used as a file name
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment