diff options
author | Andrea Diamantini <adjam7@gmail.com> | 2009-07-07 00:41:22 +0200 |
---|---|---|
committer | Andrea Diamantini <adjam7@gmail.com> | 2009-07-07 00:41:22 +0200 |
commit | 530fa0d6acad0587e24f29aa2147d1d9410aa396 (patch) | |
tree | 9cfc1be75c838107784309a64eeae1cfab89d78d | |
parent | Finally (and hopefully) fixed Google search url. Sorry for committing spam :) (diff) | |
parent | Merge branch 'master' of git@gitorious.org:~avaddon/rekonq/avaddon-clone.git (diff) | |
download | rekonq-530fa0d6acad0587e24f29aa2147d1d9410aa396.tar.xz |
Merge commit 'avaddon/master'
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | src/application.cpp | 2 | ||||
-rw-r--r-- | src/application.h | 2 | ||||
-rw-r--r-- | src/history.cpp | 2 | ||||
-rw-r--r-- | src/mainview.cpp | 9 | ||||
-rw-r--r-- | src/mainwindow.cpp | 59 | ||||
-rw-r--r-- | src/mainwindow.h | 2 | ||||
-rw-r--r-- | src/urlbar.cpp | 4 | ||||
-rw-r--r-- | src/urlbar.h | 1 |
9 files changed, 34 insertions, 48 deletions
@@ -5,5 +5,6 @@ src/.ctagsdb .directory *.tmp build/ +qtcreator-build/ CMakeLists.txt.user CMakeCache.txt diff --git a/src/application.cpp b/src/application.cpp index 5b458438..bc77f60a 100644 --- a/src/application.cpp +++ b/src/application.cpp @@ -185,7 +185,7 @@ BookmarkProvider *Application::bookmarkProvider() } -KIcon Application::icon(const KUrl &url) const +KIcon Application::icon(const KUrl &url) { KIcon icon = KIcon(QWebSettings::iconForUrl(url)); if (icon.isNull()) diff --git a/src/application.h b/src/application.h index d2e66d3f..46d013e3 100644 --- a/src/application.h +++ b/src/application.h @@ -90,7 +90,7 @@ public: MainWindow *mainWindow(); WebView *newWebView(Rekonq::OpenType type = Rekonq::Default); - KIcon icon(const KUrl &url) const; + static KIcon icon(const KUrl &url); static KUrl guessUrlFromString(const QString &url); diff --git a/src/history.cpp b/src/history.cpp index 11cd3653..d67e65d0 100644 --- a/src/history.cpp +++ b/src/history.cpp @@ -500,7 +500,7 @@ QVariant HistoryModel::data(const QModelIndex &index, int role) const case Qt::DecorationRole: if (index.column() == 0) { - return Application::instance()->icon(item.url); + return Application::icon(item.url); } } return QVariant(); diff --git a/src/mainview.cpp b/src/mainview.cpp index 17e248f1..a3c6e77e 100644 --- a/src/mainview.cpp +++ b/src/mainview.cpp @@ -502,11 +502,10 @@ void MainView::slotCloseTab(int index) { if (tab->isModified()) { - int risp = KMessageBox::questionYesNo(this , + int risp = KMessageBox::questionYesNo(this, i18n("You have modified this page and when closing it you would lose the modification.\n" - "Do you really want to close this page?\n"), - i18n("Do you really want to close this page?") - ); + "Do you really want to close this page?\n"), + i18n("Do you really want to close this page?")); if (risp == KMessageBox::No) return; } @@ -587,7 +586,7 @@ void MainView::webViewIconChanged() int index = webViewIndex(webView); if (-1 != index) { - QIcon icon = Application::instance()->icon(webView->url()); + QIcon icon = Application::icon(webView->url()); QLabel *label = animatedLoading(index, false); QMovie *movie = label->movie(); delete movie; diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 79a6db4b..44ca861c 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -295,7 +295,7 @@ void MainWindow::setupActions() a = new KAction(KIcon("view-media-artist"), i18n("Private &Browsing"), this); a->setCheckable(true); actionCollection()->addAction(QLatin1String("private_browsing"), a); - connect(a, SIGNAL(triggered(bool)) , this, SLOT(slotPrivateBrowsing(bool))); + connect(a, SIGNAL(triggered(bool)), this, SLOT(slotPrivateBrowsing(bool))); // ================ history related actions m_historyBackAction = new KAction(KIcon("go-previous"), i18n("Back"), this); @@ -483,10 +483,10 @@ void MainWindow::slotUpdateWindowTitle(const QString &title) void MainWindow::slotFileOpen() { QString filePath = KFileDialog::getOpenFileName(KUrl(), - i18n("Web Resources (*.html *.htm *.svg *.png *.gif *.svgz); All files (*.*)"), + i18n("*.html *.htm *.svg *.png *.gif *.svgz|Web Resources (*.html *.htm *.svg *.png *.gif *.svgz)\n" \ + "*.*|All files (*.*)"), this, - i18n("Open Web Resource") - ); + i18n("Open Web Resource")); if (filePath.isEmpty()) return; @@ -531,7 +531,7 @@ void MainWindow::printRequested(QWebFrame *frame) void MainWindow::slotPrivateBrowsing(bool enable) { QWebSettings *settings = QWebSettings::globalSettings(); - if (enable) + if (enable && !settings->testAttribute(QWebSettings::PrivateBrowsingEnabled)) { QString title = i18n("Are you sure you want to turn on private browsing?"); QString text = "<b>" + title + i18n("</b><br><br>When private browsing is turned on," @@ -542,8 +542,8 @@ void MainWindow::slotPrivateBrowsing(bool enable) " Until you close the window, you can still click the Back and Forward buttons" \ " to return to the web pages you have opened."); - int button = KMessageBox::questionYesNo(this, text, title); - if (button == KMessageBox::Ok) + int button = KMessageBox::questionYesNo(this, text, title); + if (button == KMessageBox::Yes) { settings->setAttribute(QWebSettings::PrivateBrowsingEnabled, true); } @@ -577,15 +577,9 @@ void MainWindow::slotFindNext() if (!currentTab() && m_lastSearch.isEmpty()) return; - QWebPage::FindFlags options; + QWebPage::FindFlags options = QWebPage::FindWrapsAroundDocument; if (m_findBar->matchCase()) - { - options = QWebPage::FindCaseSensitively | QWebPage::FindWrapsAroundDocument; - } - else - { - options = QWebPage::FindWrapsAroundDocument; - } + options |= QWebPage::FindCaseSensitively; if (!currentTab()->findText(m_lastSearch, options)) { @@ -599,15 +593,9 @@ void MainWindow::slotFindPrevious() if (!currentTab() && m_lastSearch.isEmpty()) return; - QWebPage::FindFlags options; + QWebPage::FindFlags options = QWebPage::FindBackward | QWebPage::FindWrapsAroundDocument; if (m_findBar->matchCase()) - { - options = QWebPage::FindCaseSensitively | QWebPage::FindBackward | QWebPage::FindWrapsAroundDocument; - } - else - { - options = QWebPage::FindBackward | QWebPage::FindWrapsAroundDocument; - } + options |= QWebPage::FindCaseSensitively; if (!currentTab()->findText(m_lastSearch, options)) { @@ -718,8 +706,8 @@ void MainWindow::slotToggleInspector(bool enable) if (enable) { int result = KMessageBox::questionYesNo(this, - i18n("The web inspector will only work correctly for pages that were loaded after enabling.\n" - "Do you want to reload all pages?"), + i18n("The web inspector will only work correctly for pages that were loaded after enabling.\n" \ + "Do you want to reload all pages?"), i18n("Web Inspector") ); @@ -810,17 +798,16 @@ bool MainWindow::queryClose() int answer = KMessageBox::questionYesNoCancel( this, - i18np( "Are you sure you want to close the window?\n" - "You have 1 tab open", - "Are you sure you want to close the window?\n" - "You have %1 tabs open", - m_view->count()), - i18n("Are you sure you want to close the window?"), - KStandardGuiItem::quit(), - KGuiItem(i18n("C&lose Current Tab"), KIcon("tab-close")), - KStandardGuiItem::cancel(), - "confirmClosingMultipleTabs" - ); + i18np("Are you sure you want to close the window?\n" \ + "You have 1 tab open", + "Are you sure you want to close the window?\n" \ + "You have %1 tabs open", + m_view->count()), + i18n("Are you sure you want to close the window?"), + KStandardGuiItem::quit(), + KGuiItem(i18n("C&lose Current Tab"), KIcon("tab-close")), + KStandardGuiItem::cancel(), + "confirmClosingMultipleTabs"); switch (answer) { diff --git a/src/mainwindow.h b/src/mainwindow.h index 4e32e215..b276a544 100644 --- a/src/mainwindow.h +++ b/src/mainwindow.h @@ -127,7 +127,6 @@ private slots: void slotFileOpen(); void slotFilePrintPreview(); void slotFilePrint(); - void slotPrivateBrowsing(bool); void slotFileSaveAs(); void printRequested(QWebFrame *frame); @@ -145,6 +144,7 @@ private slots: // Tools Menu slots void slotToggleInspector(bool enable); + void slotPrivateBrowsing(bool enable); // Settings Menu slots void slotShowMenubar(bool enable); diff --git a/src/urlbar.cpp b/src/urlbar.cpp index 0204d321..d107ba1a 100644 --- a/src/urlbar.cpp +++ b/src/urlbar.cpp @@ -137,11 +137,11 @@ void UrlBar::slotUpdateUrl() { if (count()) { - changeUrl(0, Application::instance()->icon(m_currentUrl), m_currentUrl); + changeUrl(0, Application::icon(m_currentUrl), m_currentUrl); } else { - insertUrl(0, Application::instance()->icon(m_currentUrl), m_currentUrl); + insertUrl(0, Application::icon(m_currentUrl), m_currentUrl); } setCurrentIndex(0); diff --git a/src/urlbar.h b/src/urlbar.h index 32d09af4..24fea38f 100644 --- a/src/urlbar.h +++ b/src/urlbar.h @@ -81,7 +81,6 @@ private: LineEdit *m_lineEdit; - QIcon m_currentIcon; KUrl m_currentUrl; int m_progress; }; |