mirror of
https://invent.kde.org/network/falkon.git
synced 2024-11-11 01:22:10 +01:00
Fixed showing bad site icon on some pages
This commit is contained in:
parent
aedfdd3309
commit
fe1e3806e9
|
@ -573,7 +573,7 @@ bool MainApplication::checkProfileDir()
|
||||||
versionFile.write(QupZilla::VERSION.toAscii());
|
versionFile.write(QupZilla::VERSION.toAscii());
|
||||||
versionFile.close();
|
versionFile.close();
|
||||||
|
|
||||||
if (rData.contains("0.9.6") || rData.contains("0.9.7") || rData.contains("0.9.8")) // Data not changed from this version
|
if (rData.contains("0.9.") || rData.contains("0.9.7") || rData.contains("0.9.8")) // Data not changed from this version
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
dir.mkdir("profiles");
|
dir.mkdir("profiles");
|
||||||
|
|
|
@ -247,15 +247,17 @@ void LocationBar::showUrl(const QUrl &url, bool empty)
|
||||||
|
|
||||||
void LocationBar::siteIconChanged()
|
void LocationBar::siteIconChanged()
|
||||||
{
|
{
|
||||||
const QPixmap* icon_ = 0;
|
// const QPixmap* icon_ = 0;
|
||||||
if (!p_QupZilla->weView()->isLoading())
|
QIcon icon_;
|
||||||
icon_ = p_QupZilla->weView()->animationLoading( p_QupZilla->tabWidget()->currentIndex(), false)->pixmap();
|
// if (!p_QupZilla->weView()->isLoading())
|
||||||
|
// icon_ = p_QupZilla->weView()->animationLoading( p_QupZilla->tabWidget()->currentIndex(), false)->pixmap();
|
||||||
|
icon_ = p_QupZilla->weView()->siteIcon();
|
||||||
|
|
||||||
if (!icon_) {
|
if (icon_.isNull()) {
|
||||||
m_siteIcon->setIcon(QIcon(":icons/locationbar/unknownpage.png"));
|
m_siteIcon->setIcon(QIcon(":icons/locationbar/unknownpage.png"));
|
||||||
} else {
|
} else {
|
||||||
QIcon icon = *icon_;
|
// QIcon icon(*icon_);
|
||||||
m_siteIcon->setIcon(icon);
|
m_siteIcon->setIcon(icon_);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -32,7 +32,7 @@ WebPage::WebPage(WebView* parent, QupZilla* mainClass)
|
||||||
setForwardUnsupportedContent(true);
|
setForwardUnsupportedContent(true);
|
||||||
setPluginFactory(new WebPluginFactory(this));
|
setPluginFactory(new WebPluginFactory(this));
|
||||||
connect(this, SIGNAL(unsupportedContent(QNetworkReply*)), SLOT(handleUnsupportedContent(QNetworkReply*)));
|
connect(this, SIGNAL(unsupportedContent(QNetworkReply*)), SLOT(handleUnsupportedContent(QNetworkReply*)));
|
||||||
connect(this, SIGNAL(loadStarted()), this, SLOT(clearSSLCert()));
|
connect(this, SIGNAL(loadStarted()), this, SLOT(loadingStarted()));
|
||||||
}
|
}
|
||||||
|
|
||||||
void WebPage::handleUnsupportedContent(QNetworkReply* reply)
|
void WebPage::handleUnsupportedContent(QNetworkReply* reply)
|
||||||
|
@ -66,6 +66,18 @@ void WebPage::setSSLCertificate(QSslCertificate cert)
|
||||||
m_SslCert = cert;
|
m_SslCert = cert;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QSslCertificate WebPage::sslCertificate()
|
||||||
|
{
|
||||||
|
// QSslCertificate cert;
|
||||||
|
// foreach (QSslCertificate c, m_SslCerts) {
|
||||||
|
// qDebug() << c;
|
||||||
|
// if (c.subjectInfo(QSslCertificate::CommonName).contains(QRegExp(mainFrame()->url().host())))
|
||||||
|
// return c;
|
||||||
|
// }
|
||||||
|
// return cert;
|
||||||
|
return m_SslCert;
|
||||||
|
}
|
||||||
|
|
||||||
bool WebPage::acceptNavigationRequest(QWebFrame* frame, const QNetworkRequest &request, NavigationType type)
|
bool WebPage::acceptNavigationRequest(QWebFrame* frame, const QNetworkRequest &request, NavigationType type)
|
||||||
{
|
{
|
||||||
m_lastRequest = request;
|
m_lastRequest = request;
|
||||||
|
|
|
@ -46,7 +46,7 @@ public:
|
||||||
~WebPage();
|
~WebPage();
|
||||||
|
|
||||||
void setSSLCertificate(QSslCertificate cert);
|
void setSSLCertificate(QSslCertificate cert);
|
||||||
QSslCertificate sslCertificate() { return m_SslCert; }
|
QSslCertificate sslCertificate();
|
||||||
QString userAgentForUrl(const QUrl &url) const;
|
QString userAgentForUrl(const QUrl &url) const;
|
||||||
bool supportsExtension(Extension extension) const { return (extension == ErrorPageExtension); }
|
bool supportsExtension(Extension extension) const { return (extension == ErrorPageExtension); }
|
||||||
bool extension(Extension extension, const ExtensionOption* option, ExtensionReturn* output);
|
bool extension(Extension extension, const ExtensionOption* option, ExtensionReturn* output);
|
||||||
|
@ -57,7 +57,7 @@ public:
|
||||||
protected slots:
|
protected slots:
|
||||||
QWebPage* createWindow(QWebPage::WebWindowType type);
|
QWebPage* createWindow(QWebPage::WebWindowType type);
|
||||||
void handleUnsupportedContent(QNetworkReply* url);
|
void handleUnsupportedContent(QNetworkReply* url);
|
||||||
void clearSSLCert() { m_SslCert = 0; m_adBlockedEntries.clear(); }
|
void loadingStarted() { m_adBlockedEntries.clear(); /*m_SslCert.clear();*/ }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
bool acceptNavigationRequest(QWebFrame* frame, const QNetworkRequest &request, NavigationType type);
|
bool acceptNavigationRequest(QWebFrame* frame, const QNetworkRequest &request, NavigationType type);
|
||||||
|
@ -67,6 +67,7 @@ protected:
|
||||||
QWebPage::NavigationType m_lastRequestType;
|
QWebPage::NavigationType m_lastRequestType;
|
||||||
WebView* m_view;
|
WebView* m_view;
|
||||||
QSslCertificate m_SslCert;
|
QSslCertificate m_SslCert;
|
||||||
|
QList<QSslCertificate> m_SslCerts;
|
||||||
QList<AdBlockedEntry> m_adBlockedEntries;
|
QList<AdBlockedEntry> m_adBlockedEntries;
|
||||||
// bool m_isOpeningNextWindowAsNewTab;
|
// bool m_isOpeningNextWindowAsNewTab;
|
||||||
};
|
};
|
||||||
|
|
|
@ -76,8 +76,7 @@ WebView::WebView(QupZilla* mainClass, QWidget* parent)
|
||||||
|
|
||||||
void WebView::slotIconChanged()
|
void WebView::slotIconChanged()
|
||||||
{
|
{
|
||||||
if (!isLoading())
|
m_siteIcon = icon();
|
||||||
qDebug() << "icon changed";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
WebPage* WebView::webPage() const
|
WebPage* WebView::webPage() const
|
||||||
|
@ -233,7 +232,8 @@ void WebView::titleChanged()
|
||||||
|
|
||||||
void WebView::iconChanged()
|
void WebView::iconChanged()
|
||||||
{
|
{
|
||||||
QIcon icon_ = icon();
|
// QIcon icon_ = icon();
|
||||||
|
QIcon icon_ = siteIcon();
|
||||||
if (!icon_.isNull())
|
if (!icon_.isNull())
|
||||||
animationLoading(tabIndex(), false)->setPixmap(icon_.pixmap(16,16));
|
animationLoading(tabIndex(), false)->setPixmap(icon_.pixmap(16,16));
|
||||||
else
|
else
|
||||||
|
|
|
@ -53,6 +53,7 @@ public:
|
||||||
WebPage* webPage() const;
|
WebPage* webPage() const;
|
||||||
QString getIp() { return m_currentIp; }
|
QString getIp() { return m_currentIp; }
|
||||||
QLabel* animationLoading(int index, bool addMovie);
|
QLabel* animationLoading(int index, bool addMovie);
|
||||||
|
QIcon siteIcon() { return m_siteIcon; }
|
||||||
void addNotification(QWidget* notif);
|
void addNotification(QWidget* notif);
|
||||||
bool hasRss() { return !m_rss.isEmpty(); }
|
bool hasRss() { return !m_rss.isEmpty(); }
|
||||||
QList<QPair<QString,QString> > getRss() { return m_rss; }
|
QList<QPair<QString,QString> > getRss() { return m_rss; }
|
||||||
|
@ -122,6 +123,7 @@ private:
|
||||||
bool m_wantsClose;
|
bool m_wantsClose;
|
||||||
QString m_currentIp;
|
QString m_currentIp;
|
||||||
QList<QPair<QString,QString> > m_rss;
|
QList<QPair<QString,QString> > m_rss;
|
||||||
|
QIcon m_siteIcon;
|
||||||
|
|
||||||
WebPage* m_page;
|
WebPage* m_page;
|
||||||
NetworkManagerProxy* m_networkProxy;
|
NetworkManagerProxy* m_networkProxy;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user