From 52e0e206b5ae7bd55d97ca46afd21061f2bf75ad Mon Sep 17 00:00:00 2001 From: nowrep Date: Mon, 16 Jan 2012 16:28:41 +0100 Subject: [PATCH] Using "Intel Mac" in user agent when compiling on intel. Closes #148 --- src/webview/searchtoolbar.cpp | 7 ++++++- src/webview/searchtoolbar.h | 2 ++ src/webview/webpage.cpp | 5 +++++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/webview/searchtoolbar.cpp b/src/webview/searchtoolbar.cpp index 59cdc4dce..c8abdfe2a 100644 --- a/src/webview/searchtoolbar.cpp +++ b/src/webview/searchtoolbar.cpp @@ -59,6 +59,12 @@ QLineEdit* SearchToolBar::searchLine() return ui->lineEdit; } +void SearchToolBar::hide() +{ + p_QupZilla->weView()->setFocus(); + AnimatedWidget::hide(); +} + void SearchToolBar::findNext() { m_findFlags = QWebPage::FindWrapsAroundDocument; @@ -139,7 +145,6 @@ bool SearchToolBar::eventFilter(QObject* obj, QEvent* event) { if (event->type() == QEvent::KeyPress && static_cast(event)->key() == Qt::Key_Escape) { hide(); - p_QupZilla->weView()->setFocus(); return false; } diff --git a/src/webview/searchtoolbar.h b/src/webview/searchtoolbar.h index c7f421e51..faa3ab304 100644 --- a/src/webview/searchtoolbar.h +++ b/src/webview/searchtoolbar.h @@ -56,6 +56,8 @@ public slots: void findNext(); void findPrevious(); + void hide(); + private: Ui::SearchToolbar* ui; QupZilla* p_QupZilla; diff --git a/src/webview/webpage.cpp b/src/webview/webpage.cpp index 42a9ef09c..fdc3680cb 100644 --- a/src/webview/webpage.cpp +++ b/src/webview/webpage.cpp @@ -291,6 +291,11 @@ QString WebPage::userAgentForUrl(const QUrl &url) const { if (UserAgent.isEmpty()) { UserAgent = QWebPage::userAgentForUrl(url); +#ifdef Q_WS_MAC +#ifdef __i386__ || __x86_64__ + UserAgent.replace("PPC Mac OS X", "Intel Mac OS X"); +#endif +#endif } return UserAgent;