From b3e4495ce1355c70f1ab0f5be94b0bca8bba613b Mon Sep 17 00:00:00 2001 From: megabigbug Date: Sun, 17 Jan 2010 19:58:43 +0100 Subject: fix close tab when javascript:self.close() --- src/mainview.cpp | 2 +- src/mainview.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mainview.cpp b/src/mainview.cpp index 7dbe8b23..953f6f38 100644 --- a/src/mainview.cpp +++ b/src/mainview.cpp @@ -511,7 +511,7 @@ void MainView::closeTab(int index) removeTab(index); updateTabBar(); // UI operation: do it ASAP!! - delete tab; // webView is scheduled for deletion. + tab->deleteLater(); // webView is scheduled for deletion. emit tabsChanged(); diff --git a/src/mainview.h b/src/mainview.h index f8a8c283..908389b1 100644 --- a/src/mainview.h +++ b/src/mainview.h @@ -148,7 +148,7 @@ private slots: void postLaunch(); - + protected: virtual void resizeEvent(QResizeEvent *event); -- cgit v1.2.1 From 48d949fb77c1d932c93448f06d59ea70f852589b Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Wed, 20 Jan 2010 02:27:55 +0100 Subject: Some leaks fixed in new code --- src/application.cpp | 9 +++++---- src/webinspectordock.cpp | 3 +-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/application.cpp b/src/application.cpp index e06f6f15..98579cf0 100644 --- a/src/application.cpp +++ b/src/application.cpp @@ -68,7 +68,7 @@ QPointer Application::s_adblockManager; Application::Application() - : KUniqueApplication() + : KUniqueApplication() { } @@ -76,8 +76,11 @@ Application::Application() Application::~Application() { qDeleteAll(m_mainWindows); + delete s_bookmarkProvider; delete s_historyManager; + delete s_sessionManager; + delete s_adblockManager; } @@ -340,7 +343,7 @@ void Application::loadUrl(const QString& urlString, const Rekonq::OpenType& typ MainWindow *Application::newMainWindow() { MainWindow *w = new MainWindow(); - w->mainView()->newWebTab(); // remember using newWebView and NOT newTab here!! + w->mainView()->newWebTab(); // remember using newWebTab and NOT newTab here!! m_mainWindows.prepend(w); w->show(); @@ -361,7 +364,6 @@ MainWindowList Application::mainWindowList() } - AdBlockManager *Application::adblockManager() { if(!s_adblockManager) @@ -370,4 +372,3 @@ AdBlockManager *Application::adblockManager() } return s_adblockManager; } - diff --git a/src/webinspectordock.cpp b/src/webinspectordock.cpp index 2c17a607..55ae11cf 100644 --- a/src/webinspectordock.cpp +++ b/src/webinspectordock.cpp @@ -44,8 +44,7 @@ WebInspectorDock::WebInspectorDock(QString title, QWidget *parent) : QDockWidget(title, parent) { setObjectName("webInspectorDock"); - QWebInspector *inspector = new QWebInspector(this); - setWidget(inspector); + setWidget( new QWebInspector(this) ); } void WebInspectorDock::closeEvent(QCloseEvent *event) -- cgit v1.2.1 From 094258e7cb1cb06db105c5c8d067e58e4a40d22b Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Thu, 21 Jan 2010 00:44:26 +0100 Subject: Save memory! With this commit, we save (at least) 3 bytes for each AdBlockRule defined (and probably more than 3!). In my installation I have about 100 rules... :) --- src/adblock/adblockmanager.h | 2 +- src/adblock/adblockrule.cpp | 19 +++++++++++++------ src/adblock/adblockrule.h | 8 +++++--- 3 files changed, 19 insertions(+), 10 deletions(-) diff --git a/src/adblock/adblockmanager.h b/src/adblock/adblockmanager.h index c07a9492..f01aaca0 100644 --- a/src/adblock/adblockmanager.h +++ b/src/adblock/adblockmanager.h @@ -110,11 +110,11 @@ // Qt Includes #include #include +#include // Forward Includes class QNetworkRequest; class WebPage; -class QStringList; // Definitions typedef QList AdBlockRuleList; diff --git a/src/adblock/adblockrule.cpp b/src/adblock/adblockrule.cpp index c6fe47c9..9f86ffee 100644 --- a/src/adblock/adblockrule.cpp +++ b/src/adblock/adblockrule.cpp @@ -52,17 +52,22 @@ * ============================================================ */ +// Self Includes #include "adblockrule.h" +// Qt Includes +#include #include #include #include +// Defines #define QL1S(x) QLatin1String(x) #define QL1C(x) QLatin1Char(x) AdBlockRule::AdBlockRule(const QString &filter) + : m_optionMatchRule(false) { bool isRegExpRule = false; @@ -75,11 +80,13 @@ AdBlockRule::AdBlockRule(const QString &filter) isRegExpRule = true; } - int options = parsedLine.indexOf( QL1C('$'), 0); - if (options >= 0) + int optionsNumber = parsedLine.indexOf( QL1C('$'), 0); + QStringList options; + + if (optionsNumber >= 0) { - m_options = parsedLine.mid(options + 1).split(QL1C(',')); - parsedLine = parsedLine.left(options); + options = parsedLine.mid(optionsNumber + 1).split(QL1C(',')); + parsedLine = parsedLine.left(optionsNumber); } if(!isRegExpRule) @@ -87,10 +94,10 @@ AdBlockRule::AdBlockRule(const QString &filter) m_regExp = QRegExp(parsedLine, Qt::CaseInsensitive, QRegExp::RegExp2); - if (m_options.contains( QL1S("match-case") )) + if ( options.contains( QL1S("match-case") )) { m_regExp.setCaseSensitivity(Qt::CaseSensitive); - m_options.removeOne( QL1S("match-case") ); + m_optionMatchRule = true; } } diff --git a/src/adblock/adblockrule.h b/src/adblock/adblockrule.h index 7c4c4161..35715051 100644 --- a/src/adblock/adblockrule.h +++ b/src/adblock/adblockrule.h @@ -55,11 +55,11 @@ #define ADBLOCKRULE_H // Qt Includes -#include +#include +#include // Forward Includes class QUrl; -class QRegExp; class AdBlockRule @@ -73,7 +73,9 @@ private: QString convertPatternToRegExp(const QString &wildcardPattern); QRegExp m_regExp; - QStringList m_options; + + // Rule Options + bool m_optionMatchRule; }; -- cgit v1.2.1 From 01f663ff20f2c886d20e098ebe68d60d92c9e62c Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Thu, 21 Jan 2010 00:56:38 +0100 Subject: Spare fixes --- src/application.h | 1 + src/webview.cpp | 1 + 2 files changed, 2 insertions(+) diff --git a/src/application.h b/src/application.h index 12ff2e3b..a0cd6745 100644 --- a/src/application.h +++ b/src/application.h @@ -110,6 +110,7 @@ public: public slots: /** * Save application's configuration + * * @see ReKonfig::self()->writeConfig(); */ void saveConfiguration() const; diff --git a/src/webview.cpp b/src/webview.cpp index 292eb364..c2183749 100644 --- a/src/webview.cpp +++ b/src/webview.cpp @@ -60,6 +60,7 @@ #include #include + WebView::WebView(QWidget* parent) : KWebView(parent, false) , m_page( new WebPage(this) ) -- cgit v1.2.1 From 33e3dcf768d0e5f699fad119279e33714baaaac8 Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Thu, 21 Jan 2010 00:57:41 +0100 Subject: rekonq 0.3.31 Fixes Fixes Fixes --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8552a55b..6c5e642e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,7 +7,7 @@ PROJECT( rekonq ) # Informations to update before to release this package. # rekonq info -SET(REKONQ_VERSION "0.3.30" ) +SET(REKONQ_VERSION "0.3.31" ) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/version.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/version.h ) -- cgit v1.2.1 From 008b2bdf00c8309ade7e0fe4d75c94e7fe02dfbd Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Fri, 22 Jan 2010 17:14:26 +0100 Subject: no more need to inspect POST operations :) --- src/networkaccessmanager.cpp | 8 -------- 1 file changed, 8 deletions(-) diff --git a/src/networkaccessmanager.cpp b/src/networkaccessmanager.cpp index 7d6bf434..eadbfab3 100644 --- a/src/networkaccessmanager.cpp +++ b/src/networkaccessmanager.cpp @@ -41,14 +41,6 @@ NetworkAccessManager::NetworkAccessManager(QObject *parent) QNetworkReply *NetworkAccessManager::createRequest(Operation op, const QNetworkRequest &req, QIODevice *outgoingData) { - if (op == PostOperation && outgoingData) - { - QByteArray outgoingDataByteArray = outgoingData->peek(1024 * 1024); - kDebug() << "*************************************************************************"; - kDebug() << outgoingDataByteArray; - kDebug() << "*************************************************************************"; - } - // Adblock if (op == QNetworkAccessManager::GetOperation) { -- cgit v1.2.1 From fd9b924083594cc7fb5d42d6ae2f624f52b5e8ba Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Fri, 22 Jan 2010 17:28:19 +0100 Subject: STEP 1: Subdivide loadUrl stuffs --- src/application.cpp | 90 ++++++++++++++++++++++++++++++++--------------------- src/application.h | 6 ++++ 2 files changed, 60 insertions(+), 36 deletions(-) diff --git a/src/application.cpp b/src/application.cpp index 98579cf0..6684439c 100644 --- a/src/application.cpp +++ b/src/application.cpp @@ -42,6 +42,7 @@ #include "urlbar.h" #include "sessionmanager.h" #include "adblockmanager.h" +#include "webview.h" // KDE Includes #include @@ -283,36 +284,9 @@ void Application::loadUrl(const KUrl& url, const Rekonq::OpenType& type) return; } - // first, create the webview(s) to not let hangs UI.. - WebTab *tab = 0; - MainWindow *w = 0; - w = (type == Rekonq::NewWindow) - ? newMainWindow() - : mainWindow(); - - switch(type) - { - case Rekonq::SettingOpenTab: - tab = w->mainView()->newWebTab(!ReKonfig::openTabsBack(), - ReKonfig::openTabsNearCurrent()); - break; - case Rekonq::NewCurrentTab: - tab = w->mainView()->newWebTab(true); - break; - case Rekonq::NewBackTab: - tab = w->mainView()->newWebTab(false, ReKonfig::openTabsNearCurrent()); - break; - case Rekonq::NewWindow: - case Rekonq::CurrentTab: - tab = w->mainView()->currentWebTab(); - break; - }; + WebView *view = createView(type); - // this should let rekonq filtering URI info and supporting - // the beautiful KDE web browsing shortcuts - KUriFilterData data(loadingUrl.pathOrUrl()); - data.setCheckForExecutables(false); // if true, queries like "rekonq" or "dolphin" are considered as executables - loadingUrl = KUriFilter::self()->filterUri(data) ? data.uri().pathOrUrl() : QUrl::fromUserInput(loadingUrl.pathOrUrl()); + loadingUrl = resolvUrl( loadingUrl.pathOrUrl() ); // we are sure of the url now, let's add it to history // anyway we store here just http sites because local and ftp ones are @@ -320,15 +294,15 @@ void Application::loadUrl(const KUrl& url, const Rekonq::OpenType& type) if( url.protocol() == QLatin1String("http") || url.protocol() == QLatin1String("https") ) historyManager()->addHistoryEntry( loadingUrl.prettyUrl() ); - if (!ReKonfig::openTabsBack()) - { - w->mainView()->urlBar()->setUrl(loadingUrl.prettyUrl()); - } +// if (!ReKonfig::openTabsBack()) +// { +// w->mainView()->urlBar()->setUrl(loadingUrl.prettyUrl()); +// } - if (tab) + if (view) { - tab->setFocus(); - tab->view()->load(loadingUrl); + view->setFocus(); + view->load(loadingUrl); } } @@ -372,3 +346,47 @@ AdBlockManager *Application::adblockManager() } return s_adblockManager; } + + +WebView *Application::createView(const Rekonq::OpenType &type) +{ + // first, create the webview(s) to not let hangs UI.. + WebTab *tab = 0; + MainWindow *w = 0; + w = (type == Rekonq::NewWindow) + ? newMainWindow() + : mainWindow(); + + switch(type) + { + case Rekonq::SettingOpenTab: + tab = w->mainView()->newWebTab(!ReKonfig::openTabsBack(), ReKonfig::openTabsNearCurrent()); + break; + case Rekonq::NewCurrentTab: + tab = w->mainView()->newWebTab(true); + break; + case Rekonq::NewBackTab: + tab = w->mainView()->newWebTab(false, ReKonfig::openTabsNearCurrent()); + break; + case Rekonq::NewWindow: + case Rekonq::CurrentTab: + tab = w->mainView()->currentWebTab(); + break; + }; + + return tab->view(); +} + + +KUrl Application::resolvUrl(const QString &urlString) +{ + // this should let rekonq filtering URI info and supporting + // the beautiful KDE web browsing shortcuts + KUriFilterData data(urlString); + data.setCheckForExecutables(false); // if true, queries like "rekonq" or "dolphin" are considered as executables + KUrl url = KUriFilter::self()->filterUri(data) + ? data.uri().pathOrUrl() + : QUrl::fromUserInput( urlString ); + + return url; +} diff --git a/src/application.h b/src/application.h index a0cd6745..c9fb079d 100644 --- a/src/application.h +++ b/src/application.h @@ -48,6 +48,7 @@ class HistoryManager; class MainWindow; class SessionManager; class AdBlockManager; +class WebView; typedef QList< QPointer > MainWindowList; @@ -135,6 +136,11 @@ private slots: void postLaunch(); private: + + // loadUrl Utilities + WebView *createView(const Rekonq::OpenType &); + KUrl resolvUrl(const QString &); + static QPointer s_historyManager; static QPointer s_bookmarkProvider; static QPointer s_sessionManager; -- cgit v1.2.1 From a4a63cd740e30d81d89ca2aa7fcc76d69cd79aad Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Sat, 23 Jan 2010 15:17:57 +0100 Subject: Be sure you need to resolv url... --- src/application.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/application.cpp b/src/application.cpp index 6684439c..e93e5b8e 100644 --- a/src/application.cpp +++ b/src/application.cpp @@ -285,15 +285,7 @@ void Application::loadUrl(const KUrl& url, const Rekonq::OpenType& type) } WebView *view = createView(type); - - loadingUrl = resolvUrl( loadingUrl.pathOrUrl() ); - - // we are sure of the url now, let's add it to history - // anyway we store here just http sites because local and ftp ones are - // added trough the protocol handler and the other are ignored - if( url.protocol() == QLatin1String("http") || url.protocol() == QLatin1String("https") ) - historyManager()->addHistoryEntry( loadingUrl.prettyUrl() ); - + // if (!ReKonfig::openTabsBack()) // { // w->mainView()->urlBar()->setUrl(loadingUrl.prettyUrl()); @@ -301,6 +293,14 @@ void Application::loadUrl(const KUrl& url, const Rekonq::OpenType& type) if (view) { + loadingUrl = resolvUrl( loadingUrl.pathOrUrl() ); + + // we are sure of the url now, let's add it to history + // anyway we store here just http sites because local and ftp ones are + // added trough the protocol handler and the other are ignored + if( url.protocol() == QLatin1String("http") || url.protocol() == QLatin1String("https") ) + historyManager()->addHistoryEntry( loadingUrl.prettyUrl() ); + view->setFocus(); view->load(loadingUrl); } -- cgit v1.2.1 From ade414e7ec17d267ba2382fadd6be2ed9ea89a45 Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Sat, 23 Jan 2010 23:23:51 +0100 Subject: Here we are, with this commit I removed a lot of direct calls to Application::loadUrl slot and changed it to signals emitted there. This to let rekonq managing them and faster return to the main event loop (and hopefully don't freeze). Next step here is change loadUrl slot to a multithreaded one. --- src/previewimage.cpp | 8 +++++--- src/previewimage.h | 4 ++++ src/webtab.cpp | 8 -------- src/webtab.h | 4 +--- src/webview.cpp | 34 ++++++++++++++++++++++++++-------- src/webview.h | 9 +++++++++ 6 files changed, 45 insertions(+), 22 deletions(-) diff --git a/src/previewimage.cpp b/src/previewimage.cpp index 80757ca2..9c8bb194 100644 --- a/src/previewimage.cpp +++ b/src/previewimage.cpp @@ -29,7 +29,6 @@ #include "previewimage.moc" // Local Includes -#include "application.h" #include "historymanager.h" #include "rekonq.h" #include "mainwindow.h" @@ -103,6 +102,9 @@ PreviewImage::PreviewImage(const QUrl &url, const QString &title, int index, boo layout()->setAlignment(Qt::AlignCenter); layout()->addWidget(m_previewLabel); + connect(this, SIGNAL(loadUrl(const KUrl &, const Rekonq::OpenType &)), + Application::instance(), SLOT(loadUrl(const KUrl &, const Rekonq::OpenType &))); + loadUrlPreview(url); } @@ -260,12 +262,12 @@ void PreviewImage::mousePressEvent(QMouseEvent *event) { if(event->button() == Qt::LeftButton) { - Application::instance()->loadUrl(m_url); + emit loadUrl(m_url, Rekonq::CurrentTab); return; } else if(event->button() == Qt::MidButton) { - Application::instance()->loadUrl(m_url, Rekonq::SettingOpenTab); + emit loadUrl(m_url, Rekonq::SettingOpenTab); return; } diff --git a/src/previewimage.h b/src/previewimage.h index e9504210..4dd8df3b 100644 --- a/src/previewimage.h +++ b/src/previewimage.h @@ -29,6 +29,7 @@ // Local Includes #include "websnap.h" +#include "application.h" // KDE Includes #include @@ -58,6 +59,9 @@ public slots: void setUrlFromAction(); void refreshPreview(); +signals: + void loadUrl(const KUrl &, const Rekonq::OpenType &); + protected: void contextMenuEvent(QContextMenuEvent *event); void mouseDoubleClickEvent(QMouseEvent *event); diff --git a/src/webtab.cpp b/src/webtab.cpp index 908fc7a3..3ff69a2f 100644 --- a/src/webtab.cpp +++ b/src/webtab.cpp @@ -91,8 +91,6 @@ WebTab::WebTab(QWidget* parent) connect(m_view, SIGNAL(loadProgress(int)), this, SLOT(updateProgress(int))); connect(m_view, SIGNAL(loadFinished(bool)), this, SLOT(loadFinished(bool))); - - connect(m_view, SIGNAL(linkMiddleOrCtrlClicked(const KUrl &)), this, SLOT(loadInNewTab(const KUrl &)) ); } @@ -150,12 +148,6 @@ void WebTab::loadFinished(bool) } -void WebTab::loadInNewTab(const KUrl &url) -{ - Application::instance()->loadUrl(url, Rekonq::SettingOpenTab); -} - - void WebTab::createWalletBar(const QString &key, const QUrl &url) { KWebWallet *wallet = page()->wallet(); diff --git a/src/webtab.h b/src/webtab.h index 2eb8d733..ecf8e5b3 100644 --- a/src/webtab.h +++ b/src/webtab.h @@ -57,10 +57,8 @@ private slots: void updateProgress(int progress); void loadFinished(bool); - void loadInNewTab(const KUrl &url); - void createWalletBar(const QString &, const QUrl &); - + private: WebView *const m_view; int m_progress; diff --git a/src/webview.cpp b/src/webview.cpp index c2183749..3936ed3c 100644 --- a/src/webview.cpp +++ b/src/webview.cpp @@ -33,7 +33,6 @@ #include "rekonq.h" // Local Includes -#include "application.h" #include "mainwindow.h" #include "mainview.h" #include "webpage.h" @@ -69,8 +68,18 @@ WebView::WebView(QWidget* parent) setPage(m_page); // download system - connect(this, SIGNAL(linkShiftClicked(const KUrl &)), m_page, SLOT(downloadUrl(const KUrl &))); - connect(m_page, SIGNAL(downloadRequested(const QNetworkRequest &)), m_page, SLOT(downloadRequest(const QNetworkRequest &))); + connect(this, SIGNAL(linkShiftClicked(const KUrl &)), + m_page, SLOT(downloadUrl(const KUrl &))); + connect(m_page, SIGNAL(downloadRequested(const QNetworkRequest &)), + m_page, SLOT(downloadRequest(const QNetworkRequest &))); + + // middle click || ctrl + click signal + connect(this, SIGNAL(linkMiddleOrCtrlClicked(const KUrl &)), + this, SLOT(loadUrlInNewTab(const KUrl &)) ); + + // loadUrl signal + connect(this, SIGNAL(loadUrl(const KUrl &, const Rekonq::OpenType &)), + Application::instance(), SLOT(loadUrl(const KUrl &, const Rekonq::OpenType &))); } @@ -341,7 +350,8 @@ void WebView::search() KAction *a = qobject_cast(sender()); QString search = a->data().toString() + selectedText(); KUrl urlSearch = KUrl::fromEncoded(search.toUtf8()); - Application::instance()->loadUrl(urlSearch, Rekonq::NewCurrentTab); + + emit loadUrl(urlSearch, Rekonq::NewCurrentTab); } @@ -358,11 +368,11 @@ void WebView::viewImage(Qt::MouseButtons buttons, Qt::KeyboardModifiers modifier if (modifiers & Qt::ControlModifier || buttons == Qt::MidButton) { - Application::instance()->loadUrl(url, Rekonq::SettingOpenTab); + emit loadUrl(url, Rekonq::SettingOpenTab); } else { - Application::instance()->loadUrl(url, Rekonq::CurrentTab); + emit loadUrl(url, Rekonq::CurrentTab); } } @@ -371,7 +381,8 @@ void WebView::openLinkInNewWindow() { KAction *a = qobject_cast(sender()); KUrl url(a->data().toUrl()); - Application::instance()->loadUrl(url, Rekonq::NewWindow); + + emit loadUrl(url, Rekonq::NewWindow); } @@ -379,7 +390,8 @@ void WebView::openLinkInNewTab() { KAction *a = qobject_cast(sender()); KUrl url(a->data().toUrl()); - Application::instance()->loadUrl(url, Rekonq::SettingOpenTab); + + emit loadUrl(url, Rekonq::SettingOpenTab); } @@ -407,3 +419,9 @@ void WebView::inspect() if(a && !a->isChecked()) a->trigger(); } + + +void WebView::loadUrlInNewTab(const KUrl &url) +{ + emit loadUrl(url, Rekonq::SettingOpenTab); +} diff --git a/src/webview.h b/src/webview.h index d34d108b..263b2ec4 100644 --- a/src/webview.h +++ b/src/webview.h @@ -28,12 +28,16 @@ #ifndef WEBVIEW_H #define WEBVIEW_H +// Local Includes +#include "application.h" + // KDE Includes #include // Forward Declarations class WebPage; + class WebView : public KWebView { Q_OBJECT @@ -56,11 +60,16 @@ private slots: void printFrame(); + void loadUrlInNewTab(const KUrl &); void openLinkInNewWindow(); void openLinkInNewTab(); + void viewImage(Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers); void inspect(); +signals: + void loadUrl(const KUrl &, const Rekonq::OpenType &); + private: WebPage *const m_page; QPoint m_mousePos; -- cgit v1.2.1 From b87a805af7b066159ff4f10ff9c30fd7428ea706 Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Sun, 24 Jan 2010 19:17:58 +0100 Subject: Fixing panels With this commit I fixed panel behaviour && saved some bytes in their definition. This will help hacking there (they are pretty the same now, I just have no time to let them inherit from a parent "rekonq panel" class) and will save some bytes in rekonq footprint :) --- src/CMakeLists.txt | 3 +- src/bookmarks/bookmarkspanel.cpp | 5 +-- src/bookmarks/bookmarkspanel.h | 3 -- src/history/historypanel.cpp | 82 +++++++++++++++++++++-------------- src/history/historypanel.h | 21 ++++----- src/history/sidepanel.cpp | 60 -------------------------- src/history/sidepanel.h | 58 ------------------------- src/mainwindow.cpp | 92 +++++++++++++++++----------------------- src/mainwindow.h | 19 +++------ src/rekonq.kcfg | 2 +- src/webinspectordock.cpp | 83 ------------------------------------ src/webinspectordock.h | 58 ------------------------- src/webinspectorpanel.cpp | 86 +++++++++++++++++++++++++++++++++++++ src/webinspectorpanel.h | 58 +++++++++++++++++++++++++ 14 files changed, 252 insertions(+), 378 deletions(-) delete mode 100644 src/history/sidepanel.cpp delete mode 100644 src/history/sidepanel.h delete mode 100644 src/webinspectordock.cpp delete mode 100644 src/webinspectordock.h create mode 100644 src/webinspectorpanel.cpp create mode 100644 src/webinspectorpanel.h diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index c80aedc0..7a77c25c 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -21,7 +21,7 @@ SET( rekonq_KDEINIT_SRCS webtab.cpp clicktoflash.cpp networkaccessmanager.cpp - webinspectordock.cpp + webinspectorpanel.cpp walletbar.cpp protocolhandler.cpp #---------------------------------------- @@ -29,7 +29,6 @@ SET( rekonq_KDEINIT_SRCS history/historymanager.cpp history/historymodels.cpp history/historypanel.cpp - history/sidepanel.cpp #---------------------------------------- rekonqpage/newtabpage.cpp #---------------------------------------- diff --git a/src/bookmarks/bookmarkspanel.cpp b/src/bookmarks/bookmarkspanel.cpp index 97097fbb..9164dbb6 100644 --- a/src/bookmarks/bookmarkspanel.cpp +++ b/src/bookmarks/bookmarkspanel.cpp @@ -57,7 +57,6 @@ BookmarksPanel::BookmarksPanel(const QString &title, QWidget *parent, Qt::Window BookmarksPanel::~BookmarksPanel() { ReKonfig::setShowBookmarksPanel(!isHidden()); - delete ui; } @@ -73,7 +72,7 @@ void BookmarksPanel::setup() setObjectName("bookmarksPanel"); setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea); - ui = new QWidget(this); + QWidget *ui = new QWidget(this); // setup search bar QHBoxLayout *searchLayout = new QHBoxLayout; @@ -110,5 +109,5 @@ void BookmarksPanel::setup() treeView->setModel( proxy ); connect(search, SIGNAL(textChanged(QString)), proxy, SLOT(setFilterFixedString(QString))); - connect( treeView, SIGNAL( activated(QModelIndex) ), this, SLOT( bookmarkActivated(QModelIndex) ) ); + connect(treeView, SIGNAL( activated(QModelIndex) ), this, SLOT( bookmarkActivated(QModelIndex) ) ); } diff --git a/src/bookmarks/bookmarkspanel.h b/src/bookmarks/bookmarkspanel.h index b7c0b5ed..6c0e153f 100644 --- a/src/bookmarks/bookmarkspanel.h +++ b/src/bookmarks/bookmarkspanel.h @@ -38,7 +38,6 @@ class QModelIndex; class BookmarksPanel : public QDockWidget { Q_OBJECT - Q_DISABLE_COPY(BookmarksPanel) public: explicit BookmarksPanel(const QString &title, QWidget *parent = 0, Qt::WindowFlags flags = 0); @@ -52,8 +51,6 @@ private slots: private: void setup(); - - QWidget *ui; }; #endif // BOOKMARKSPANEL_H diff --git a/src/history/historypanel.cpp b/src/history/historypanel.cpp index 42497f9e..08dc3800 100644 --- a/src/history/historypanel.cpp +++ b/src/history/historypanel.cpp @@ -29,25 +29,52 @@ #include "historypanel.h" #include "historypanel.moc" +// Auto Includes +#include "rekonq.h" + +// Local Includes +#include "application.h" +#include "historymodels.h" + // Qt Includes #include #include #include +#include + // KDE Includes #include #include -HistoryPanel::HistoryPanel(QWidget *parent) - : QWidget(parent) - , m_historyTreeView(new QTreeView) - , m_treeProxyModel(new TreeProxyModel(this)) +HistoryPanel::HistoryPanel(const QString &title, QWidget *parent, Qt::WindowFlags flags) + : QDockWidget(title, parent, flags) +{ + setup(); + setShown(ReKonfig::showHistoryPanel()); +} + + +HistoryPanel::~HistoryPanel() +{ + // Save side panel's state + ReKonfig::setShowHistoryPanel(!isHidden()); +} + + +void HistoryPanel::setup() { - m_historyTreeView->setUniformRowHeights(true); - m_historyTreeView->setSelectionBehavior(QAbstractItemView::SelectRows); - m_historyTreeView->setTextElideMode(Qt::ElideMiddle); - m_historyTreeView->setAlternatingRowColors(true); + setObjectName("historyPanel"); + setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea); + + QWidget *ui = new QWidget(this); + + QTreeView *historyTreeView = new QTreeView(this); + historyTreeView->setUniformRowHeights(true); + historyTreeView->setSelectionBehavior(QAbstractItemView::SelectRows); + historyTreeView->setTextElideMode(Qt::ElideMiddle); + historyTreeView->setAlternatingRowColors(true); // add search bar QHBoxLayout *hBoxLayout = new QHBoxLayout; @@ -60,42 +87,35 @@ HistoryPanel::HistoryPanel(QWidget *parent) QWidget *searchBar = new QWidget; searchBar->setLayout(hBoxLayout); - // setup view + // setup layout QVBoxLayout *vBoxLayout = new QVBoxLayout; vBoxLayout->setContentsMargins(0, 0, 0, 0); vBoxLayout->addWidget(searchBar); - vBoxLayout->addWidget(m_historyTreeView); - setLayout(vBoxLayout); + vBoxLayout->addWidget(historyTreeView); + + // add it to the UI + ui->setLayout(vBoxLayout); + setWidget(ui); //- HistoryManager *historyManager = Application::historyManager(); QAbstractItemModel *model = historyManager->historyTreeModel(); - m_treeProxyModel->setSourceModel(model); - m_historyTreeView->setModel(m_treeProxyModel); - m_historyTreeView->setExpanded(m_treeProxyModel->index(0, 0), true); - m_historyTreeView->header()->hideSection(1); + TreeProxyModel *treeProxyModel = new TreeProxyModel(this); + treeProxyModel->setSourceModel(model); + historyTreeView->setModel(treeProxyModel); + historyTreeView->setExpanded(treeProxyModel->index(0, 0), true); + historyTreeView->header()->hideSection(1); QFontMetrics fm(font()); int header = fm.width(QLatin1Char('m')) * 40; - m_historyTreeView->header()->resizeSection(0, header); - - connect(search, SIGNAL(textChanged(QString)), m_treeProxyModel, SLOT(setFilterFixedString(QString))); - connect(m_historyTreeView, SIGNAL(activated(const QModelIndex&)), this, SLOT(open())); -} - + historyTreeView->header()->resizeSection(0, header); -HistoryPanel::~HistoryPanel() -{ - delete m_treeProxyModel; - delete m_historyTreeView; + connect(search, SIGNAL(textChanged(QString)), treeProxyModel, SLOT(setFilterFixedString(QString))); + connect(historyTreeView, SIGNAL(activated(const QModelIndex &)), this, SLOT(itemActivated(const QModelIndex &))); } -void HistoryPanel::open() +void HistoryPanel::itemActivated(const QModelIndex &item) { - QModelIndex index = m_historyTreeView->currentIndex(); - if (!index.parent().isValid()) - return; - emit openUrl(index.data(HistoryModel::UrlRole).toUrl()); + emit openUrl( item.data(HistoryModel::UrlRole).toUrl() ); } - diff --git a/src/history/historypanel.h b/src/history/historypanel.h index 083b2741..e07e2190 100644 --- a/src/history/historypanel.h +++ b/src/history/historypanel.h @@ -29,36 +29,31 @@ #define HISTORYPANEL_H -// Local Includes -#include "application.h" -#include "historymodels.h" - // Qt Includes -#include -#include +#include // Forward Declarations class KUrl; +class QWidget; +class QModelIndex; -class HistoryPanel : public QWidget +class HistoryPanel : public QDockWidget { Q_OBJECT public: - explicit HistoryPanel(QWidget *parent = 0); - virtual ~HistoryPanel(); + explicit HistoryPanel(const QString &title, QWidget *parent = 0, Qt::WindowFlags flags = 0); + ~HistoryPanel(); signals: void openUrl(const KUrl &); private slots: - void open(); + void itemActivated(const QModelIndex &); private: - QTreeView *m_historyTreeView; - TreeProxyModel *m_treeProxyModel; - + void setup(); }; #endif // HISTORYPANEL_H diff --git a/src/history/sidepanel.cpp b/src/history/sidepanel.cpp deleted file mode 100644 index 7c42301c..00000000 --- a/src/history/sidepanel.cpp +++ /dev/null @@ -1,60 +0,0 @@ -/* ============================================================ -* -* This file is a part of the rekonq project -* -* Copyright (C) 2009 by Andrea Diamantini -* Copyright (C) 2009 by Paweł Prażak -* -* -* 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 the Free Software Foundation; either version 2 of -* the License or (at your option) version 3 or any later version -* accepted by the membership of KDE e.V. (or its successor approved -* by the membership of KDE e.V.), which shall act as a proxy -* defined in Section 14 of version 3 of the license. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program. If not, see . -* -* ============================================================ */ - - -// Self Includes -#include "sidepanel.h" -#include "sidepanel.moc" - -// Auto Includes -#include "rekonq.h" - -// Local Includes -#include "historypanel.h" - - -SidePanel::SidePanel(const QString &title, QWidget *parent, Qt::WindowFlags flags) - : QDockWidget(title, parent, flags) - , m_historyPanel(new HistoryPanel(this)) -{ - setObjectName("sidePanel"); - setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea); - - setShown(ReKonfig::showSideBar()); - - connect(m_historyPanel, SIGNAL(openUrl(const KUrl&)), this, SIGNAL(openUrl(const KUrl&))); - - setWidget(m_historyPanel); -} - - -SidePanel::~SidePanel() -{ - // Save side panel's state - ReKonfig::setShowSideBar(!isHidden()); - - delete m_historyPanel; -} diff --git a/src/history/sidepanel.h b/src/history/sidepanel.h deleted file mode 100644 index 6aca3587..00000000 --- a/src/history/sidepanel.h +++ /dev/null @@ -1,58 +0,0 @@ -/* ============================================================ -* -* This file is a part of the rekonq project -* -* Copyright (C) 2009 by Andrea Diamantini -* Copyright (C) 2009 by Paweł Prażak -* -* -* 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 the Free Software Foundation; either version 2 of -* the License or (at your option) version 3 or any later version -* accepted by the membership of KDE e.V. (or its successor approved -* by the membership of KDE e.V.), which shall act as a proxy -* defined in Section 14 of version 3 of the license. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program. If not, see . -* -* ============================================================ */ - - -#ifndef SIDEPANEL_H -#define SIDEPANEL_H - -// Local Includes -#include "application.h" - -// Qt Includes -#include - -// Forward Declarations -class KUrl; -class HistoryPanel; - - -class SidePanel : public QDockWidget -{ - Q_OBJECT - -public: - explicit SidePanel(const QString &title, QWidget *parent = 0, Qt::WindowFlags flags = 0); - ~SidePanel(); - -signals: - void openUrl(const KUrl &); - -private: - HistoryPanel *m_historyPanel; - -}; - -#endif // SIDEPANEL_H diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 9352ec36..659e5bf5 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -40,9 +40,9 @@ #include "webtab.h" #include "mainview.h" #include "findbar.h" -#include "sidepanel.h" +#include "historypanel.h" #include "bookmarkspanel.h" -#include "webinspectordock.h" +#include "webinspectorpanel.h" #include "urlbar.h" #include "tabbar.h" #include "adblockmanager.h" @@ -98,9 +98,9 @@ MainWindow::MainWindow() : KMainWindow() , m_view( new MainView(this) ) , m_findBar( new FindBar(this) ) - , m_sidePanel(0) + , m_historyPanel(0) , m_bookmarksPanel(0) - , m_webInspectorDock(0) + , m_webInspectorPanel(0) , m_historyBackMenu(0) , m_mainBar( new KToolBar( QString("MainToolBar"), this, Qt::TopToolBarArea, true, false, false) ) , m_bmBar( new KToolBar( QString("BookmarkToolBar"), this, Qt::TopToolBarArea, true, false, false) ) @@ -134,10 +134,8 @@ MainWindow::MainWindow() // then, setup our actions setupActions(); - // setting Side Panel - setupSidePanel(); - setupBookmarksPanel(); - setupWebInspector(); + // setting Panels + setupPanels(); // setting up rekonq tools setupTools(); @@ -166,17 +164,6 @@ MainWindow::~MainWindow() } -SidePanel *MainWindow::sidePanel() -{ - return m_sidePanel; -} - -BookmarksPanel *MainWindow::bookmarksPanel() -{ - return m_bookmarksPanel; -} - - void MainWindow::setupToolbars() { // ============ Main ToolBar ================================ @@ -459,51 +446,50 @@ void MainWindow::setupTools() } -void MainWindow::setupSidePanel() +void MainWindow::setupPanels() { - // Setup history side panel - m_sidePanel = new SidePanel(i18n("History Panel"), this); - connect(m_sidePanel, SIGNAL(openUrl(const KUrl&)), Application::instance(), SLOT(loadUrl(const KUrl&))); - connect(m_sidePanel, SIGNAL(destroyed()), Application::instance(), SLOT(saveConfiguration())); + KAction* a; + + // STEP 1 + // Setup history panel + m_historyPanel = new HistoryPanel(i18n("History Panel"), this); + connect(m_historyPanel, SIGNAL(openUrl(const KUrl&)), Application::instance(), SLOT(loadUrl(const KUrl&))); + connect(m_historyPanel, SIGNAL(destroyed()), Application::instance(), SLOT(saveConfiguration())); - addDockWidget(Qt::LeftDockWidgetArea, m_sidePanel); + addDockWidget(Qt::LeftDockWidgetArea, m_historyPanel); - // setup side panel actions - KAction* a = (KAction *) m_sidePanel->toggleViewAction(); - a->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_H)); + // setup history panel action + a = (KAction *) m_historyPanel->toggleViewAction(); + a->setShortcut( QKeySequence(Qt::CTRL + Qt::Key_H) ); a->setIcon(KIcon("view-history")); actionCollection()->addAction(QLatin1String("show_history_panel"), a); -} - -void MainWindow::setupBookmarksPanel() -{ + // STEP 2 + // Setup bookmarks panel m_bookmarksPanel = new BookmarksPanel(i18n("Bookmarks Panel"), this); connect(m_bookmarksPanel, SIGNAL(openUrl(const KUrl&)), Application::instance(), SLOT(loadUrl(const KUrl&))); connect(m_bookmarksPanel, SIGNAL(destroyed()), Application::instance(), SLOT(saveConfiguration())); addDockWidget(Qt::LeftDockWidgetArea, m_bookmarksPanel); - // setup side panel actions - KAction* a = (KAction *) m_bookmarksPanel->toggleViewAction(); - a->setShortcut(QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_B)); + // setup bookmarks panel action + a = (KAction *) m_bookmarksPanel->toggleViewAction(); + a->setShortcut( QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_B) ); a->setIcon(KIcon("bookmarks-organize")); actionCollection()->addAction(QLatin1String("show_bookmarks_panel"), a); -} - -void MainWindow::setupWebInspector() -{ - m_webInspectorDock = new WebInspectorDock(i18n("Web Inspector"), this); - connect(mainView(), SIGNAL(currentChanged(int)), m_webInspectorDock, SLOT(changeCurrentPage())); + // STEP 3 + // Setup webinspector panel + m_webInspectorPanel = new WebInspectorPanel(i18n("Web Inspector"), this); + connect(mainView(), SIGNAL(currentChanged(int)), m_webInspectorPanel, SLOT(changeCurrentPage())); - KAction *a = new KAction(KIcon("tools-report-bug"), i18n("Web &Inspector"), this); + a = new KAction(KIcon("tools-report-bug"), i18n("Web &Inspector"), this); a->setCheckable(true); actionCollection()->addAction(QLatin1String("web_inspector"), a); - connect(a, SIGNAL(triggered(bool)), m_webInspectorDock, SLOT(toggle(bool))); + connect(a, SIGNAL(triggered(bool)), m_webInspectorPanel, SLOT(toggle(bool))); - addDockWidget(Qt::BottomDockWidgetArea, m_webInspectorDock); - m_webInspectorDock->hide(); + addDockWidget(Qt::BottomDockWidgetArea, m_webInspectorPanel); + m_webInspectorPanel->hide(); } @@ -808,7 +794,7 @@ void MainWindow::setWidgetsVisible(bool makeVisible) { // state flags static bool bookmarksToolBarFlag; - static bool sidePanelFlag; + static bool historyPanelFlag; static bool bookmarksPanelFlag; if (!makeVisible) @@ -817,14 +803,14 @@ void MainWindow::setWidgetsVisible(bool makeVisible) if (!isFullScreen()) { bookmarksToolBarFlag = m_bmBar->isHidden(); - sidePanelFlag = sidePanel()->isHidden(); - bookmarksPanelFlag = bookmarksPanel()->isHidden(); + historyPanelFlag = m_historyPanel->isHidden(); + bookmarksPanelFlag = m_bookmarksPanel->isHidden(); } m_bmBar->hide(); m_view->setTabBarHidden(true); - sidePanel()->hide(); - bookmarksPanel()->hide(); + m_historyPanel->hide(); + m_bookmarksPanel->hide(); // hide main toolbar m_mainBar->hide(); @@ -838,10 +824,10 @@ void MainWindow::setWidgetsVisible(bool makeVisible) // restore state of windowed mode if (!bookmarksToolBarFlag) m_bmBar->show(); - if (!sidePanelFlag) - sidePanel()->show(); + if (!historyPanelFlag) + m_historyPanel->show(); if (!bookmarksPanelFlag) - bookmarksPanel()->show(); + m_bookmarksPanel->show(); } } diff --git a/src/mainwindow.h b/src/mainwindow.h index 49dc2a59..7083591d 100644 --- a/src/mainwindow.h +++ b/src/mainwindow.h @@ -46,9 +46,9 @@ class KAction; class KPassivePopup; class FindBar; -class SidePanel; +class HistoryPanel; class BookmarksPanel; -class WebInspectorDock; +class WebInspectorPanel; class WebTab; class MainView; @@ -77,15 +77,8 @@ private: void setupActions(); void setupTools(); void setupToolbars(); - - void setupSidePanel(); - SidePanel *sidePanel(); - - void setupBookmarksPanel(); - BookmarksPanel *bookmarksPanel(); + void setupPanels(); - void setupWebInspector(); - public slots: void updateBrowser(); void homePage(); @@ -159,9 +152,10 @@ private slots: private: MainView *m_view; FindBar *m_findBar; - SidePanel *m_sidePanel; + + HistoryPanel *m_historyPanel; BookmarksPanel *m_bookmarksPanel; - WebInspectorDock *m_webInspectorDock; + WebInspectorPanel *m_webInspectorPanel; KAction *m_stopReloadAction; KMenu *m_historyBackMenu; @@ -178,4 +172,3 @@ private: }; #endif // MAINWINDOW_H - diff --git a/src/rekonq.kcfg b/src/rekonq.kcfg index f74fb144..a24508fc 100644 --- a/src/rekonq.kcfg +++ b/src/rekonq.kcfg @@ -35,7 +35,7 @@ http://www.kde.org/ - + false diff --git a/src/webinspectordock.cpp b/src/webinspectordock.cpp deleted file mode 100644 index 55ae11cf..00000000 --- a/src/webinspectordock.cpp +++ /dev/null @@ -1,83 +0,0 @@ -/* ============================================================ -* -* This file is a part of the rekonq project -* -* Copyright (C) 2009 by Matthieu Gicquel -* -* -* 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 the Free Software Foundation; either version 2 of -* the License or (at your option) version 3 or any later version -* accepted by the membership of KDE e.V. (or its successor approved -* by the membership of KDE e.V.), which shall act as a proxy -* defined in Section 14 of version 3 of the license. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program. If not, see . -* -* ============================================================ */ - -// Self Includes -#include "webinspectordock.h" -#include "webinspectordock.moc" - -// Local Includes -#include "webtab.h" -#include "webview.h" -#include "webpage.h" - -// KDE Includes -#include "KAction" -#include "KDebug" - -// Qt Includes -#include - - -WebInspectorDock::WebInspectorDock(QString title, QWidget *parent) - : QDockWidget(title, parent) -{ - setObjectName("webInspectorDock"); - setWidget( new QWebInspector(this) ); -} - -void WebInspectorDock::closeEvent(QCloseEvent *event) -{ - Q_UNUSED(event); - toggle(false); -} - -MainWindow* WebInspectorDock::mainWindow() -{ - return qobject_cast< MainWindow* >(parentWidget()); -} - - -void WebInspectorDock::toggle(bool enable) -{ - mainWindow()->actionByName("web_inspector")->setChecked(enable); - if (enable) - { - mainWindow()->currentTab()->view()->settings()->setAttribute(QWebSettings::DeveloperExtrasEnabled, true); - findChild()->setPage(mainWindow()->currentTab()->page()); - show(); - } - else - { - hide(); - mainWindow()->currentTab()->view()->settings()->setAttribute(QWebSettings::DeveloperExtrasEnabled, false); - } -} - - -void WebInspectorDock::changeCurrentPage() -{ - bool enable = mainWindow()->currentTab()->view()->settings()->testAttribute(QWebSettings::DeveloperExtrasEnabled); - toggle(enable); -} diff --git a/src/webinspectordock.h b/src/webinspectordock.h deleted file mode 100644 index c6697361..00000000 --- a/src/webinspectordock.h +++ /dev/null @@ -1,58 +0,0 @@ -/* ============================================================ -* -* This file is a part of the rekonq project -* -* Copyright (C) 2009 by Matthieu Gicquel -* -* -* 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 the Free Software Foundation; either version 2 of -* the License or (at your option) version 3 or any later version -* accepted by the membership of KDE e.V. (or its successor approved -* by the membership of KDE e.V.), which shall act as a proxy -* defined in Section 14 of version 3 of the license. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program. If not, see . -* -* ============================================================ */ - - -#ifndef WEBINSPECTORDOCK_H -#define WEBINSPECTORDOCK_H - - -// Local Includes -#include "mainwindow.h" - -// Qt Includes -#include - -/** - Docked web inspector - behaviour : hide/show by tab, not globally -*/ -class WebInspectorDock : public QDockWidget -{ - Q_OBJECT -public: - WebInspectorDock(QString title, QWidget *parent); - -public slots: - void toggle(bool enable); - void changeCurrentPage(); - -protected: - virtual void closeEvent(QCloseEvent *event); - - MainWindow *mainWindow(); - -}; - -#endif \ No newline at end of file diff --git a/src/webinspectorpanel.cpp b/src/webinspectorpanel.cpp new file mode 100644 index 00000000..a038d280 --- /dev/null +++ b/src/webinspectorpanel.cpp @@ -0,0 +1,86 @@ +/* ============================================================ +* +* This file is a part of the rekonq project +* +* Copyright (C) 2009 by Matthieu Gicquel +* +* +* 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 the Free Software Foundation; either version 2 of +* the License or (at your option) version 3 or any later version +* accepted by the membership of KDE e.V. (or its successor approved +* by the membership of KDE e.V.), which shall act as a proxy +* defined in Section 14 of version 3 of the license. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +* +* ============================================================ */ + + +// Self Includes +#include "webinspectorpanel.h" +#include "webinspectorpanel.moc" + +// Local Includes +#include "webtab.h" +#include "webview.h" +#include "webpage.h" + +// KDE Includes +#include "KAction" +#include "KDebug" + +// Qt Includes +#include + + +WebInspectorPanel::WebInspectorPanel(QString title, QWidget *parent) + : QDockWidget(title, parent) +{ + setObjectName("webInspectorDock"); + setWidget( new QWebInspector(this) ); +} + + +void WebInspectorPanel::closeEvent(QCloseEvent *event) +{ + Q_UNUSED(event); + toggle(false); +} + + +MainWindow* WebInspectorPanel::mainWindow() +{ + return qobject_cast< MainWindow* >(parentWidget()); +} + + +void WebInspectorPanel::toggle(bool enable) +{ + mainWindow()->actionByName("web_inspector")->setChecked(enable); + if (enable) + { + mainWindow()->currentTab()->view()->settings()->setAttribute(QWebSettings::DeveloperExtrasEnabled, true); + findChild()->setPage(mainWindow()->currentTab()->page()); + show(); + } + else + { + hide(); + mainWindow()->currentTab()->view()->settings()->setAttribute(QWebSettings::DeveloperExtrasEnabled, false); + } +} + + +void WebInspectorPanel::changeCurrentPage() +{ + bool enable = mainWindow()->currentTab()->view()->settings()->testAttribute(QWebSettings::DeveloperExtrasEnabled); + toggle(enable); +} diff --git a/src/webinspectorpanel.h b/src/webinspectorpanel.h new file mode 100644 index 00000000..8f65b48a --- /dev/null +++ b/src/webinspectorpanel.h @@ -0,0 +1,58 @@ +/* ============================================================ +* +* This file is a part of the rekonq project +* +* Copyright (C) 2009 by Matthieu Gicquel +* +* +* 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 the Free Software Foundation; either version 2 of +* the License or (at your option) version 3 or any later version +* accepted by the membership of KDE e.V. (or its successor approved +* by the membership of KDE e.V.), which shall act as a proxy +* defined in Section 14 of version 3 of the license. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +* +* ============================================================ */ + + +#ifndef WEBINSPECTOR_PANEL_H +#define WEBINSPECTOR_PANEL_H + + +// Local Includes +#include "mainwindow.h" + +// Qt Includes +#include + +/** + Docked web inspector + behaviour : hide/show by tab, not globally +*/ +class WebInspectorPanel : public QDockWidget +{ + Q_OBJECT +public: + WebInspectorPanel(QString title, QWidget *parent); + +public slots: + void toggle(bool enable); + void changeCurrentPage(); + +protected: + virtual void closeEvent(QCloseEvent *event); + + MainWindow *mainWindow(); + +}; + +#endif -- cgit v1.2.1 From c2014f61977ff220ad023edd221bb1af28e91609 Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Sun, 24 Jan 2010 19:22:30 +0100 Subject: rekonq 0.3.32 fixes && profiling --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6c5e642e..e8ec89f9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,7 +7,7 @@ PROJECT( rekonq ) # Informations to update before to release this package. # rekonq info -SET(REKONQ_VERSION "0.3.31" ) +SET(REKONQ_VERSION "0.3.32" ) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/version.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/version.h ) -- cgit v1.2.1 From fd5a16fc9e64e6499e64a8615d61767f1a755123 Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Sun, 24 Jan 2010 23:47:46 +0100 Subject: disconnect also webpage signals on close! This will save rekonq from crashing on fast CTRL+W close on notify message popup --- src/webpage.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/webpage.cpp b/src/webpage.cpp index 6bf172a6..4cc9bbe3 100644 --- a/src/webpage.cpp +++ b/src/webpage.cpp @@ -91,6 +91,7 @@ WebPage::WebPage(QObject *parent) WebPage::~WebPage() { + disconnect(); } -- cgit v1.2.1 From 3bbfba5e0757af9c02dc5cec637e51b67365a896 Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Tue, 26 Jan 2010 02:09:05 +0100 Subject: MultiThreaded rekonq !! Yeah, you're reading well... rekonq is using multithreading for the loadUrl slot. This (in theory) should mean: "NO MORE UI FREEZES ON LOAD URLS" :D --- src/CMakeLists.txt | 2 + src/application.cpp | 132 ++++++++++++++++++++++++++++++--------------------- src/application.h | 7 ++- src/filterurljob.cpp | 67 ++++++++++++++++++++++++++ src/filterurljob.h | 61 ++++++++++++++++++++++++ src/webtab.cpp | 2 +- 6 files changed, 214 insertions(+), 57 deletions(-) create mode 100644 src/filterurljob.cpp create mode 100644 src/filterurljob.h diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 7a77c25c..b0a3fbd8 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -24,6 +24,7 @@ SET( rekonq_KDEINIT_SRCS webinspectorpanel.cpp walletbar.cpp protocolhandler.cpp + filterurljob.cpp #---------------------------------------- history/autosaver.cpp history/historymanager.cpp @@ -93,6 +94,7 @@ TARGET_LINK_LIBRARIES ( kdeinit_rekonq ${KDE4_KDEUI_LIBS} ${KDE4_KIO_LIBS} ${KDE4_KPARTS_LIBS} + ${KDE4_THREADWEAVER_LIBRARIES} ) diff --git a/src/application.cpp b/src/application.cpp index e93e5b8e..e9f0561d 100644 --- a/src/application.cpp +++ b/src/application.cpp @@ -43,6 +43,7 @@ #include "sessionmanager.h" #include "adblockmanager.h" #include "webview.h" +#include "filterurljob.h" // KDE Includes #include @@ -54,6 +55,7 @@ #include #include #include +#include // Qt Includes #include @@ -71,6 +73,8 @@ QPointer Application::s_adblockManager; Application::Application() : KUniqueApplication() { + connect(Weaver::instance(), SIGNAL( jobDone(ThreadWeaver::Job*) ), + this, SLOT( loadResolvedUrl(ThreadWeaver::Job*) ) ); } @@ -284,25 +288,36 @@ void Application::loadUrl(const KUrl& url, const Rekonq::OpenType& type) return; } - WebView *view = createView(type); - -// if (!ReKonfig::openTabsBack()) -// { -// w->mainView()->urlBar()->setUrl(loadingUrl.prettyUrl()); -// } + // first, create the webview(s) to not let hangs UI.. + WebTab *tab = 0; + MainWindow *w = 0; + w = (type == Rekonq::NewWindow) + ? newMainWindow() + : mainWindow(); + + switch(type) + { + case Rekonq::SettingOpenTab: + tab = w->mainView()->newWebTab(!ReKonfig::openTabsBack(), ReKonfig::openTabsNearCurrent()); + break; + case Rekonq::NewCurrentTab: + tab = w->mainView()->newWebTab(true); + break; + case Rekonq::NewBackTab: + tab = w->mainView()->newWebTab(false, ReKonfig::openTabsNearCurrent()); + break; + case Rekonq::NewWindow: + case Rekonq::CurrentTab: + tab = w->mainView()->currentWebTab(); + break; + }; + + WebView *view = tab->view(); if (view) { - loadingUrl = resolvUrl( loadingUrl.pathOrUrl() ); - - // we are sure of the url now, let's add it to history - // anyway we store here just http sites because local and ftp ones are - // added trough the protocol handler and the other are ignored - if( url.protocol() == QLatin1String("http") || url.protocol() == QLatin1String("https") ) - historyManager()->addHistoryEntry( loadingUrl.prettyUrl() ); - - view->setFocus(); - view->load(loadingUrl); + FilterUrlJob *job = new FilterUrlJob(view, loadingUrl.pathOrUrl(), this); + Weaver::instance()->enqueue(job); } } @@ -348,45 +363,54 @@ AdBlockManager *Application::adblockManager() } -WebView *Application::createView(const Rekonq::OpenType &type) +// WebView *Application::createView(const Rekonq::OpenType &type) +// { +// // first, create the webview(s) to not let hangs UI.. +// WebTab *tab = 0; +// MainWindow *w = 0; +// w = (type == Rekonq::NewWindow) +// ? newMainWindow() +// : mainWindow(); +// +// switch(type) +// { +// case Rekonq::SettingOpenTab: +// tab = w->mainView()->newWebTab(!ReKonfig::openTabsBack(), ReKonfig::openTabsNearCurrent()); +// break; +// case Rekonq::NewCurrentTab: +// tab = w->mainView()->newWebTab(true); +// break; +// case Rekonq::NewBackTab: +// tab = w->mainView()->newWebTab(false, ReKonfig::openTabsNearCurrent()); +// break; +// case Rekonq::NewWindow: +// case Rekonq::CurrentTab: +// tab = w->mainView()->currentWebTab(); +// break; +// }; +// +// return tab->view(); +// } + + +void Application::loadResolvedUrl(ThreadWeaver::Job *job) { - // first, create the webview(s) to not let hangs UI.. - WebTab *tab = 0; - MainWindow *w = 0; - w = (type == Rekonq::NewWindow) - ? newMainWindow() - : mainWindow(); - - switch(type) - { - case Rekonq::SettingOpenTab: - tab = w->mainView()->newWebTab(!ReKonfig::openTabsBack(), ReKonfig::openTabsNearCurrent()); - break; - case Rekonq::NewCurrentTab: - tab = w->mainView()->newWebTab(true); - break; - case Rekonq::NewBackTab: - tab = w->mainView()->newWebTab(false, ReKonfig::openTabsNearCurrent()); - break; - case Rekonq::NewWindow: - case Rekonq::CurrentTab: - tab = w->mainView()->currentWebTab(); - break; - }; + FilterUrlJob *threadedJob = static_cast(job); + KUrl url = threadedJob->url(); + WebView *view = threadedJob->view(); - return tab->view(); -} - - -KUrl Application::resolvUrl(const QString &urlString) -{ - // this should let rekonq filtering URI info and supporting - // the beautiful KDE web browsing shortcuts - KUriFilterData data(urlString); - data.setCheckForExecutables(false); // if true, queries like "rekonq" or "dolphin" are considered as executables - KUrl url = KUriFilter::self()->filterUri(data) - ? data.uri().pathOrUrl() - : QUrl::fromUserInput( urlString ); + if (view) + { + view->setFocus(); + view->load(url); - return url; + // we are sure of the url now, let's add it to history + // anyway we store here just http sites because local and ftp ones are + // added trough the protocol handler and the other are ignored + if( url.protocol() == QLatin1String("http") || url.protocol() == QLatin1String("https") ) + historyManager()->addHistoryEntry( url.prettyUrl() ); + } + + // Bye and thanks :) + delete threadedJob; } diff --git a/src/application.h b/src/application.h index c9fb079d..a326015d 100644 --- a/src/application.h +++ b/src/application.h @@ -35,6 +35,7 @@ #include #include #include +#include // Qt Includes #include @@ -135,11 +136,13 @@ private slots: */ void postLaunch(); + void loadResolvedUrl(ThreadWeaver::Job *); + private: // loadUrl Utilities - WebView *createView(const Rekonq::OpenType &); - KUrl resolvUrl(const QString &); +// WebView *createView(const Rekonq::OpenType &); +// KUrl resolvUrl(const QString &); static QPointer s_historyManager; static QPointer s_bookmarkProvider; diff --git a/src/filterurljob.cpp b/src/filterurljob.cpp new file mode 100644 index 00000000..00bdee36 --- /dev/null +++ b/src/filterurljob.cpp @@ -0,0 +1,67 @@ +/* ============================================================ +* +* This file is a part of the rekonq project +* +* Copyright (C) 2010 by Andrea Diamantini +* +* +* 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 the Free Software Foundation; either version 2 of +* the License or (at your option) version 3 or any later version +* accepted by the membership of KDE e.V. (or its successor approved +* by the membership of KDE e.V.), which shall act as a proxy +* defined in Section 14 of version 3 of the license. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +* +* ============================================================ */ + + +// Self Includes +#include "filterurljob.h" + +// KDE Includes +#include +#include + +// Qt Includes +#include + + +FilterUrlJob::FilterUrlJob(WebView *view, const QString &urlString, QObject *parent) + : Job(parent) + , _view(view) + , _urlString(urlString) +{ +} + + +WebView *FilterUrlJob::view() +{ + return _view; +} + + +KUrl FilterUrlJob::url() +{ + return _url; +} + + +void FilterUrlJob::run() +{ + // this should let rekonq filtering URI info and supporting + // the beautiful KDE web browsing shortcuts + KUriFilterData data(_urlString); + data.setCheckForExecutables(false); // if true, queries like "rekonq" or "dolphin" are considered as executables + _url = KUriFilter::self()->filterUri(data) + ? data.uri().pathOrUrl() + : QUrl::fromUserInput( _urlString ); +} diff --git a/src/filterurljob.h b/src/filterurljob.h new file mode 100644 index 00000000..3a9511ea --- /dev/null +++ b/src/filterurljob.h @@ -0,0 +1,61 @@ +/* ============================================================ +* +* This file is a part of the rekonq project +* +* Copyright (C) 2010 by Andrea Diamantini +* +* +* 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 the Free Software Foundation; either version 2 of +* the License or (at your option) version 3 or any later version +* accepted by the membership of KDE e.V. (or its successor approved +* by the membership of KDE e.V.), which shall act as a proxy +* defined in Section 14 of version 3 of the license. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +* +* ============================================================ */ + + +#ifndef FILTER_URL_JOB_H +#define FILTER_URL_JOB_H + +// Local Includes +#include "webview.h" + +// KDE Includes +#include +#include + +// Qt Includes +#include + + +using namespace ThreadWeaver; + + +class FilterUrlJob : public Job +{ +public: + FilterUrlJob(WebView *view, const QString &urlString, QObject *parent = 0); + + WebView *view(); + KUrl url(); + +protected: + void run(); + +private: + WebView *_view; + QString _urlString; + KUrl _url; +}; + +#endif // FILTER_URL_JOB_H diff --git a/src/webtab.cpp b/src/webtab.cpp index 3ff69a2f..b1f2cdfc 100644 --- a/src/webtab.cpp +++ b/src/webtab.cpp @@ -108,7 +108,7 @@ WebView *WebTab::view() WebPage *WebTab::page() { - return m_view->page(); + return m_view->page(); // FIXME } -- cgit v1.2.1 From 1d9e3e220ffcb606a8bd1bd39da45e22e24e77a0 Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Tue, 26 Jan 2010 02:11:29 +0100 Subject: Cleaning code a bit.. --- src/application.cpp | 30 ------------------------------ src/application.h | 5 ----- 2 files changed, 35 deletions(-) diff --git a/src/application.cpp b/src/application.cpp index e9f0561d..05004f30 100644 --- a/src/application.cpp +++ b/src/application.cpp @@ -363,36 +363,6 @@ AdBlockManager *Application::adblockManager() } -// WebView *Application::createView(const Rekonq::OpenType &type) -// { -// // first, create the webview(s) to not let hangs UI.. -// WebTab *tab = 0; -// MainWindow *w = 0; -// w = (type == Rekonq::NewWindow) -// ? newMainWindow() -// : mainWindow(); -// -// switch(type) -// { -// case Rekonq::SettingOpenTab: -// tab = w->mainView()->newWebTab(!ReKonfig::openTabsBack(), ReKonfig::openTabsNearCurrent()); -// break; -// case Rekonq::NewCurrentTab: -// tab = w->mainView()->newWebTab(true); -// break; -// case Rekonq::NewBackTab: -// tab = w->mainView()->newWebTab(false, ReKonfig::openTabsNearCurrent()); -// break; -// case Rekonq::NewWindow: -// case Rekonq::CurrentTab: -// tab = w->mainView()->currentWebTab(); -// break; -// }; -// -// return tab->view(); -// } - - void Application::loadResolvedUrl(ThreadWeaver::Job *job) { FilterUrlJob *threadedJob = static_cast(job); diff --git a/src/application.h b/src/application.h index a326015d..4b951ded 100644 --- a/src/application.h +++ b/src/application.h @@ -139,11 +139,6 @@ private slots: void loadResolvedUrl(ThreadWeaver::Job *); private: - - // loadUrl Utilities -// WebView *createView(const Rekonq::OpenType &); -// KUrl resolvUrl(const QString &); - static QPointer s_historyManager; static QPointer s_bookmarkProvider; static QPointer s_sessionManager; -- cgit v1.2.1 From 027141e3bc2542ad00456fadc4f8d73e9025db61 Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Tue, 26 Jan 2010 02:17:28 +0100 Subject: rekonq 0.3.33 MultiThreading on loading url :) --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e8ec89f9..661cc6e3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,7 +7,7 @@ PROJECT( rekonq ) # Informations to update before to release this package. # rekonq info -SET(REKONQ_VERSION "0.3.32" ) +SET(REKONQ_VERSION "0.3.33" ) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/version.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/version.h ) -- cgit v1.2.1 From 20f8db33181457f2633ebba0c410ecf3c3fd9f74 Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Wed, 27 Jan 2010 01:54:21 +0100 Subject: Cedric's Patch Fix bookmarks icon size --- src/mainwindow.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 659e5bf5..d3c14d85 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -187,7 +187,7 @@ void MainWindow::setupToolbars() m_bmBar->setToolButtonStyle(Qt::ToolButtonTextBesideIcon); m_bmBar->setAcceptDrops(true); m_bmBar->setContextMenuPolicy(Qt::CustomContextMenu); - + m_bmBar->setIconDimensions(16); Application::bookmarkProvider()->setupBookmarkBar(m_bmBar); } -- cgit v1.2.1 From ba9da08e687a4aac11c0df7bdba770c513e977eb Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Wed, 27 Jan 2010 02:25:31 +0100 Subject: This is not Cedric's fix about new tab button position but I hope he is anyway happy about :) I removed the oxygen trick as I noticed bug is no more present (tested with kde4/oxygen, kde4/cleanlooks && fluxbox) I also noticed that putting Y position to 2 is better than 0. But this is just my opinion.. :) --- src/mainview.cpp | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/mainview.cpp b/src/mainview.cpp index 953f6f38..b26e7466 100644 --- a/src/mainview.cpp +++ b/src/mainview.cpp @@ -146,14 +146,11 @@ void MainView::updateTabButtonPosition() if (tabWidthHint < sizeHint().width()/4) newPosX = tabWidgetWidth - m_addTabButton->width(); - // detecting Y position - int newPosY = m_tabBar->height() - m_addTabButton->height(); - if(newPosY < 0) - newPosY = 5; // this hardcoded value is used in just ONE situation: - // the first time an user changes the "Always Show Tab Bar" settings - // try some better fixes, if you can :D - - m_addTabButton->move(newPosX, newPosY); + // Y position is fixed + // Here I noticed with some emphiric valutations ( :D ) + // that 2 look better than 0, just that.. + + m_addTabButton->move(newPosX, 2); } } -- cgit v1.2.1 From 86421d141004c122f83b9183041751eb905277a2 Mon Sep 17 00:00:00 2001 From: Panagiotis Papadopoulos Date: Thu, 28 Jan 2010 15:34:51 +0100 Subject: KDE HIG fixes --- src/settings/settings_general.ui | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/settings/settings_general.ui b/src/settings/settings_general.ui index 17ac0d0f..a4503d4a 100644 --- a/src/settings/settings_general.ui +++ b/src/settings/settings_general.ui @@ -244,22 +244,22 @@ - favorites + Favorites - closed tabs + Closed Tabs - history + Bookmarks - bookmarks + History @@ -276,12 +276,15 @@ - Download with KGet + Use KGet for downloading files + + If enabled, rekonq will display an additional context menu entry, which, when selected, lists all available links of the current website in KGet. + List links with KGet -- cgit v1.2.1 From adbec40386bf6e82e430d546deaf90407ebb2af6 Mon Sep 17 00:00:00 2001 From: Panagiotis Papadopoulos Date: Thu, 28 Jan 2010 15:35:26 +0100 Subject: KDE HIG fix --- src/webview.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/webview.cpp b/src/webview.cpp index 3936ed3c..232a2633 100644 --- a/src/webview.cpp +++ b/src/webview.cpp @@ -278,7 +278,7 @@ void WebView::contextMenuEvent(QContextMenuEvent *event) if (ReKonfig::kgetList()) { - a = new KAction(KIcon("kget"), i18n("List all links"), this); + a = new KAction(KIcon("kget"), i18n("List All Links"), this); connect(a, SIGNAL(triggered(bool)), page(), SLOT(downloadAllContentsWithKGet())); menu.addAction(a); } -- cgit v1.2.1 From f86fb663a1decd4163f7de623363e8ae17b74e56 Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Mon, 1 Feb 2010 16:16:24 +0100 Subject: Let rekonq use just KIO network cache. This will force webkit to search in the history navigation in the right cache.. --- src/webpage.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/webpage.cpp b/src/webpage.cpp index 4cc9bbe3..b2bedffc 100644 --- a/src/webpage.cpp +++ b/src/webpage.cpp @@ -73,11 +73,19 @@ WebPage::WebPage(QObject *parent) : KWebPage(parent, KWalletIntegration) { - // rekonq own classes integration - setNetworkAccessManager(new NetworkAccessManager(this)); + setForwardUnsupportedContent(true); + + // rekonq Network Manager + NetworkAccessManager *manager = new NetworkAccessManager(this); + + // disable QtWebKit cache to just use KIO one.. + manager->setCache(0); + + setNetworkAccessManager(manager); + + // Web Plugin Factory setPluginFactory(new WebPluginFactory(this)); - setForwardUnsupportedContent(true); connect(networkAccessManager(), SIGNAL(finished(QNetworkReply*)), this, SLOT(manageNetworkErrors(QNetworkReply*))); -- cgit v1.2.1 From 99dfca4ba34f7b00bc64605772046bccd19e148d Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Mon, 1 Feb 2010 16:21:05 +0100 Subject: Fix crashes (and hopefully bug 212219) Thanks to Thomas Gahr for the fix --- src/tabbar.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tabbar.cpp b/src/tabbar.cpp index 12745772..7326d7af 100644 --- a/src/tabbar.cpp +++ b/src/tabbar.cpp @@ -153,8 +153,8 @@ void TabBar::showTabPreview(int tab) WebTab *view = mv->webTab(tab); WebTab *currentView = mv->webTab(currentIndex()); - // should fix bug #212219 - if(!currentView) + // check if view && currentView exist before using them :) + if(!currentView || !view) return; int w = tabSizeHint(tab).width(); -- cgit v1.2.1 From 821a246b101038937f8070152a9c14ead1c4169b Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Tue, 2 Feb 2010 03:36:05 +0100 Subject: This should fix last wrong encoded urls --- src/urlbar/urlbar.cpp | 53 ++++++++++++++++++++++++++++++--------------------- 1 file changed, 31 insertions(+), 22 deletions(-) diff --git a/src/urlbar/urlbar.cpp b/src/urlbar/urlbar.cpp index be19dae4..adeba6ae 100644 --- a/src/urlbar/urlbar.cpp +++ b/src/urlbar/urlbar.cpp @@ -140,13 +140,15 @@ void UrlBar::setUrl(const QUrl& url) if(url.scheme() == "about") { m_currentUrl = KUrl(); + updateUrl(); // updateUrl before setFocus setFocus(); } else { m_currentUrl = KUrl(url); + updateUrl(); } - updateUrl(); + } @@ -302,36 +304,43 @@ bool UrlBar::isLoading() return true; } + void UrlBar::keyPressEvent(QKeyEvent *event) { QString currentText = m_lineEdit->text().trimmed(); - if ((event->key() == Qt::Key_Enter || event->key() == Qt::Key_Return) - && !currentText.startsWith(QLatin1String("http://"), Qt::CaseInsensitive)) + if (event->key() == Qt::Key_Enter || event->key() == Qt::Key_Return) { - QString append; - if (event->modifiers() == Qt::ControlModifier) + if( !currentText.startsWith(QLatin1String("http://"), Qt::CaseInsensitive) ) { - append = QLatin1String(".com"); + QString append; + if (event->modifiers() == Qt::ControlModifier) + { + append = QLatin1String(".com"); + } + else if (event->modifiers() == (Qt::ControlModifier | Qt::ShiftModifier)) + { + append = QLatin1String(".org"); + } + else if (event->modifiers() == Qt::ShiftModifier) + { + append = QLatin1String(".net"); + } + + QUrl url(QLatin1String("http://www.") + currentText); + QString host = url.host(); + if (!host.endsWith(append, Qt::CaseInsensitive)) + { + host += append; + url.setHost(host); + m_lineEdit->setText(url.toString()); + } } - else if (event->modifiers() == (Qt::ControlModifier | Qt::ShiftModifier)) - { - append = QLatin1String(".org"); - } - else if (event->modifiers() == Qt::ShiftModifier) - { - append = QLatin1String(".net"); - } - - QUrl url(QLatin1String("http://www.") + currentText); - QString host = url.host(); - if (!host.endsWith(append, Qt::CaseInsensitive)) + else { - host += append; - url.setHost(host); - m_lineEdit->setText(url.toString()); + // fill lineEdit with its stripped contents to remove trailing spaces + m_lineEdit->setText(currentText); } } KHistoryComboBox::keyPressEvent(event); } - -- cgit v1.2.1 From 4dd21afd4c34db9f9588a32ea5d84d1f2ce47220 Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Tue, 2 Feb 2010 03:40:43 +0100 Subject: Fix bug 219752 Johannes Zellner patch. Thanks :) BUG: 219752 --- src/tabbar.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tabbar.cpp b/src/tabbar.cpp index 7326d7af..460a2464 100644 --- a/src/tabbar.cpp +++ b/src/tabbar.cpp @@ -199,7 +199,7 @@ void TabBar::mouseMoveEvent(QMouseEvent *event) } //if found and not the current tab then show tab preview - if (tab != -1 && tab != currentIndex() && m_currentTabPreview != tab) + if (tab != -1 && tab != currentIndex() && m_currentTabPreview != tab && event->buttons() == Qt::NoButton) { showTabPreview(tab); m_currentTabPreview = tab; -- cgit v1.2.1 From ec68131d7a1a83fd296bbde82a5fda248612ab12 Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Tue, 2 Feb 2010 03:43:42 +0100 Subject: Ronny Scholz string fix about the disappeared Google search bar --- src/mainwindow.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index d3c14d85..517c1e14 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -696,9 +696,8 @@ void MainWindow::privateBrowsing(bool enable) "

When private browsing is turned on," " web pages are not added to the history," " new cookies are not stored, current cookies cannot be accessed," - " site icons will not be stored, the session will not be saved, " - " and searches are not added to the pop-up menu in the Google search box." - " Until you close the window, you can still click the Back and Forward buttons" + " site icons will not be stored, the session will not be saved." + " Until you close the window, you can still click the Back and Forward buttons" " to return to the web pages you have opened.

", title); int button = KMessageBox::questionYesNo(this, text, title); -- cgit v1.2.1 From 8433f5ced32f8e465925db2d67f8f11f4df1d3e0 Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Tue, 2 Feb 2010 03:49:12 +0100 Subject: Again, Ronny Scholz patch about private browsing confirmation dialog --- src/mainwindow.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 517c1e14..df600c05 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -700,8 +700,8 @@ void MainWindow::privateBrowsing(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.

", title); - int button = KMessageBox::questionYesNo(this, text, title); - if (button == KMessageBox::Yes) + int button = KMessageBox::warningContinueCancel(this, text, title); + if (button == KMessageBox::Continue) { settings->setAttribute(QWebSettings::PrivateBrowsingEnabled, true); m_view->urlBar()->setBackgroundColor(Qt::lightGray); // palette().color(QPalette::Active, QPalette::Background)); -- cgit v1.2.1 From 84cd09ad5b7b8ec3e098345890370d6c41656c45 Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Tue, 2 Feb 2010 03:51:42 +0100 Subject: rekonq 0.3.34 fixes fixes fixes --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 661cc6e3..55ea5127 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,7 +7,7 @@ PROJECT( rekonq ) # Informations to update before to release this package. # rekonq info -SET(REKONQ_VERSION "0.3.33" ) +SET(REKONQ_VERSION "0.3.34" ) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/version.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/version.h ) -- cgit v1.2.1