1
mirror of https://invent.kde.org/network/falkon.git synced 2024-12-20 02:36:34 +01:00

[SpeedDial] Fixed fetching title of page when title is empty.

When user checks "Fetch title from page" and resulting title is empty,
let's just show url of the site.
This commit is contained in:
nowrep 2013-02-09 20:52:25 +01:00
parent 6986473cc3
commit d81b77a004
3 changed files with 32 additions and 34 deletions

View File

@ -10,9 +10,6 @@
<height>54</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<property name="margin">
<number>0</number>

View File

@ -1,6 +1,6 @@
/* ============================================================
* QupZilla - WebKit based browser
* Copyright (C) 2010-2012 David Rosca <nowrep@gmail.com>
* Copyright (C) 2010-2013 David Rosca <nowrep@gmail.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -92,7 +92,12 @@ void PageThumbnailer::setLoadTitle(bool load)
QString PageThumbnailer::title()
{
return m_title;
QString title = m_title.isEmpty() ? m_url.host() : m_title;
if (title.isEmpty()) {
title = m_url.toString();
}
return title;
}
void PageThumbnailer::setEnableFlash(bool enable)
@ -116,7 +121,7 @@ void PageThumbnailer::createThumbnail(bool status)
return;
}
m_title = m_page->mainFrame()->title();
m_title = m_page->mainFrame()->title().trimmed();
QPixmap pixmap(2 * m_size);

View File

@ -394,10 +394,6 @@
</context>
<context>
<name>AutoFillWidget</name>
<message>
<source>Form</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Choose username to login</source>
<translation type="unfinished"></translation>
@ -1462,10 +1458,6 @@
<source>Site</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Behavior</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Remove</source>
<translation type="unfinished"></translation>
@ -1482,6 +1474,10 @@
<source>Deny</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Behaviour</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>HTML5PermissionsNotification</name>
@ -1853,10 +1849,6 @@
<source>Would you like to make an exception for this certificate?</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Authorization required</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Username: </source>
<translation type="unfinished"></translation>
@ -1873,18 +1865,10 @@
<source>A username and password are being requested by %1. The site says: &quot;%2&quot;</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Proxy authorization required</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>A username and password are being requested by proxy %1. </source>
<translation type="unfinished"></translation>
</message>
<message>
<source>FTP authorization required</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Login anonymously</source>
<translation type="unfinished"></translation>
@ -1893,6 +1877,18 @@
<source>A username and password are being requested by %1:%2.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Authorisation required</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>FTP authorisation required</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Proxy authorisation required</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>PageScreen</name>
@ -2711,14 +2707,6 @@
<source>User Agent Manager</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Tabs behavior</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Address Bar behavior</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Show loading progress in address bar</source>
<translation type="unfinished"></translation>
@ -2839,6 +2827,14 @@
<source>HTML5 Permissions</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Tabs behaviour</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Address Bar behaviour</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>QObject</name>