From 8b9934b236650b92da8e78bb42deb1cb88996289 Mon Sep 17 00:00:00 2001 From: nowrep Date: Thu, 1 Mar 2012 18:32:53 +0100 Subject: [PATCH] Fixed focus handling when dropping urls in locationbar. --- src/lib/navigation/locationbar.cpp | 7 ++++++- src/lib/navigation/websearchbar.cpp | 4 +++- src/lib/webview/tabwidget.cpp | 2 +- src/main/main.cpp | 4 ---- translations/homepage/ka_GE.php | 2 +- translations/translations.pri | 1 + 6 files changed, 12 insertions(+), 8 deletions(-) diff --git a/src/lib/navigation/locationbar.cpp b/src/lib/navigation/locationbar.cpp index 674958970..f23dcc302 100644 --- a/src/lib/navigation/locationbar.cpp +++ b/src/lib/navigation/locationbar.cpp @@ -168,7 +168,8 @@ void LocationBar::showMostVisited() // Workaround: If we show popup when text in locationbar is empty and then // move up and down in completer and then we leave completer -> completer will // set text in locationbar back to last "real" completion - keyPressEvent(new QKeyEvent(QEvent::KeyPress, Qt::Key_unknown, Qt::NoModifier, QString(" "))); + QKeyEvent event(QEvent::KeyPress, Qt::Key_unknown, Qt::NoModifier, QString(" ")); + keyPressEvent(&event); } m_locationCompleter->showMostVisited(); } @@ -326,6 +327,8 @@ void LocationBar::dropEvent(QDropEvent* event) m_webView->setFocus(); emit loadUrl(dropUrl); + QFocusEvent event(QFocusEvent::FocusOut); + QLineEdit::focusOutEvent(&event); return; } } @@ -337,6 +340,8 @@ void LocationBar::dropEvent(QDropEvent* event) m_webView->setFocus(); emit loadUrl(dropUrl); + QFocusEvent event(QFocusEvent::FocusOut); + QLineEdit::focusOutEvent(&event); return; } diff --git a/src/lib/navigation/websearchbar.cpp b/src/lib/navigation/websearchbar.cpp index 17e805638..4a571903e 100644 --- a/src/lib/navigation/websearchbar.cpp +++ b/src/lib/navigation/websearchbar.cpp @@ -293,7 +293,9 @@ void WebSearchBar::dropEvent(QDropEvent* event) QString dropText = event->mimeData()->text(); setText(dropText); search(); - QLineEdit::focusOutEvent(new QFocusEvent(QFocusEvent::FocusOut)); + + QFocusEvent event(QFocusEvent::FocusOut); + QLineEdit::focusOutEvent(&event); return; } QLineEdit::dropEvent(event); diff --git a/src/lib/webview/tabwidget.cpp b/src/lib/webview/tabwidget.cpp index 738e39918..f89186505 100644 --- a/src/lib/webview/tabwidget.cpp +++ b/src/lib/webview/tabwidget.cpp @@ -289,7 +289,7 @@ int TabWidget::addView(QUrl url, const QString &title, const Qz::NewTabPositionF if (position == -1 && m_newTabAfterActive && !(openFlags & Qz::NT_TabAtTheEnd)) { // If we are opening newBgTab from pinned tab, make sure it won't be // opened between other pinned tabs - if (openFlags & Qz::NT_NotSelectedTab && m_lastBackgroundTabIndex != -1) { + if (openFlags &Qz::NT_NotSelectedTab && m_lastBackgroundTabIndex != -1) { position = m_lastBackgroundTabIndex + 1; } else { diff --git a/src/main/main.cpp b/src/main/main.cpp index 64e2a0c5e..c5a788ff9 100644 --- a/src/main/main.cpp +++ b/src/main/main.cpp @@ -40,10 +40,6 @@ void sigpipe_handler(int s) int main(int argc, char* argv[]) { - Q_INIT_RESOURCE(data); - Q_INIT_RESOURCE(icons); - Q_INIT_RESOURCE(html); - #ifdef Q_WS_X11 QApplication::setGraphicsSystem("raster"); // Better overall performance on X11 diff --git a/translations/homepage/ka_GE.php b/translations/homepage/ka_GE.php index 6d453f4c5..41174c901 100644 --- a/translations/homepage/ka_GE.php +++ b/translations/homepage/ka_GE.php @@ -1,4 +1,4 @@ -