From d0ab264b8aa5f5c7fcb21dd172a1f3f5b777356b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jon=20Ander=20Pe=C3=B1alba?= Date: Thu, 2 Sep 2010 18:10:46 +0200 Subject: Include clean-up in the big src directory --- src/application.cpp | 37 +++++------ src/application.h | 34 ++++------ src/bookmarks/bookmarkstreemodel.cpp | 7 ++- src/clicktoflash.cpp | 12 ++-- src/clicktoflash.h | 4 +- src/filterurljob.h | 15 ++--- src/findbar.cpp | 18 +++--- src/findbar.h | 11 ++-- src/history/historymodels.cpp | 1 + src/iconmanager.cpp | 46 +++++++------- src/iconmanager.h | 19 +++--- src/main.cpp | 12 ++-- src/mainview.cpp | 47 +++++++------- src/mainview.h | 27 ++++---- src/mainwindow.cpp | 64 ++++++++----------- src/mainwindow.h | 21 +++---- src/networkaccessmanager.cpp | 22 +++---- src/networkaccessmanager.h | 12 +--- src/newtabpage.cpp | 18 +++--- src/newtabpage.h | 10 ++- src/paneltreeview.cpp | 4 +- src/paneltreeview.h | 2 +- src/previewselectorbar.cpp | 10 ++- src/previewselectorbar.h | 8 ++- src/protocolhandler.cpp | 40 +++++------- src/protocolhandler.h | 11 ++-- src/sessionmanager.cpp | 15 ++--- src/sessionmanager.h | 6 +- src/tabbar.cpp | 39 +++++------- src/tabbar.h | 11 +--- src/urlbar/urlresolver.cpp | 11 ++-- src/urlpanel.cpp | 3 - src/walletbar.cpp | 11 ++-- src/walletbar.h | 8 +-- src/webicon.cpp | 6 +- src/webicon.h | 3 +- src/webinspectorpanel.cpp | 11 ++-- src/webinspectorpanel.h | 3 - src/webpage.cpp | 117 +++++++++++++++++------------------ src/webpage.h | 18 ++---- src/webpluginfactory.cpp | 4 +- src/webpluginfactory.h | 4 -- src/websnap.h | 20 +++--- src/websslinfo.cpp | 6 ++ src/websslinfo.h | 13 ++-- src/webtab.cpp | 22 +------ src/webtab.h | 15 ++--- src/webview.cpp | 39 +++++------- src/webview.h | 8 +-- src/zoombar.cpp | 11 ++-- src/zoombar.h | 12 ++-- 51 files changed, 395 insertions(+), 533 deletions(-) (limited to 'src') diff --git a/src/application.cpp b/src/application.cpp index 5e7cbd57..32709203 100644 --- a/src/application.cpp +++ b/src/application.cpp @@ -28,47 +28,40 @@ // Self Includes #include "application.h" -#include "application.moc" // Auto Includes #include "rekonq.h" // Local Includes -#include "mainwindow.h" -#include "historymanager.h" +#include "adblockmanager.h" #include "bookmarkprovider.h" +#include "filterurljob.h" +#include "historymanager.h" +#include "iconmanager.h" #include "mainview.h" -#include "webtab.h" -#include "urlbar.h" -#include "sessionmanager.h" -#include "adblockmanager.h" +#include "mainwindow.h" #include "opensearchmanager.h" -#include "iconmanager.h" -#include "webview.h" -#include "filterurljob.h" +#include "sessionmanager.h" +#include "stackedurlbar.h" #include "tabbar.h" +#include "urlbar.h" +#include "webtab.h" // KDE Includes #include #include -#include -#include -#include #include -#include #include -// Qt Includes -#include - -QWeakPointer Application::s_historyManager; -QWeakPointer Application::s_bookmarkProvider; -QWeakPointer Application::s_sessionManager; QWeakPointer Application::s_adblockManager; -QWeakPointer Application::s_opensearchManager; +QWeakPointer Application::s_bookmarkProvider; +QWeakPointer Application::s_historyManager; QWeakPointer Application::s_iconManager; +QWeakPointer Application::s_opensearchManager; +QWeakPointer Application::s_sessionManager; +using namespace ThreadWeaver; Application::Application() : KUniqueApplication() @@ -442,7 +435,7 @@ void Application::loadResolvedUrl(ThreadWeaver::Job *job) { view->load(url); } - + // Bye and thanks :) delete threadedJob; } diff --git a/src/application.h b/src/application.h index 26f5cf74..8afb956f 100644 --- a/src/application.h +++ b/src/application.h @@ -33,36 +33,28 @@ // Rekonq Includes #include "rekonq_defines.h" -#include "opensearchmanager.h" - // KDE Includes #include -#include -#include // Qt Includes -#include -#include +#include +#include // Forward Declarations -class KIcon; -class KUrl; +class AdBlockManager; class BookmarkProvider; +class DownloadItem; class HistoryManager; +class IconManager; class MainWindow; +class OpenSearchManager; class SessionManager; -class AdBlockManager; -class IconManager; -class WebView; - - -typedef QList< QWeakPointer > MainWindowList; - -// --------------------------------------------------------------------------------------------------------------- +namespace ThreadWeaver {class Job;} -#include +typedef QList< QWeakPointer > MainWindowList; +typedef QList DownloadList; class DownloadItem @@ -84,13 +76,9 @@ public: }; -typedef QList DownloadList; - - // --------------------------------------------------------------------------------------------------------------- - /** * */ @@ -114,7 +102,7 @@ public: static AdBlockManager *adblockManager(); static OpenSearchManager *opensearchManager(); static IconManager *iconManager(); - + // DOWNLOADS MANAGEMENT METHODS void addDownload(const QString &srcUrl, const QString &destUrl); DownloadList downloads(); @@ -153,7 +141,7 @@ private: static QWeakPointer s_adblockManager; static QWeakPointer s_opensearchManager; static QWeakPointer s_iconManager; - + MainWindowList m_mainWindows; }; diff --git a/src/bookmarks/bookmarkstreemodel.cpp b/src/bookmarks/bookmarkstreemodel.cpp index 796208a9..8d702fb9 100644 --- a/src/bookmarks/bookmarkstreemodel.cpp +++ b/src/bookmarks/bookmarkstreemodel.cpp @@ -37,6 +37,7 @@ // KDE Includes #include #include +#include // Qt Includes #include @@ -68,14 +69,14 @@ QVariant BtmItem::data(int role) const // NOTE // this should be: // return KIcon(m_kbm.icon()); - // but I cannot let it work :( - // I really cannot understand how let this work properly... + // but I cannot let it work :( + // I really cannot understand how let this work properly... if (m_kbm.isGroup() || m_kbm.isSeparator()) return KIcon(m_kbm.icon()); else return Application::iconManager()->iconForUrl(KUrl(m_kbm.url())); } - + if (role == Qt::UserRole) return m_kbm.url(); diff --git a/src/clicktoflash.cpp b/src/clicktoflash.cpp index 051919fd..26fac0a5 100644 --- a/src/clicktoflash.cpp +++ b/src/clicktoflash.cpp @@ -27,18 +27,16 @@ // Self Includes #include "clicktoflash.h" -#include "clicktoflash.moc" // KDE Includes #include // Qt Includes -#include -#include -#include -#include -#include - +#include +#include +#include +#include +#include ClickToFlash::ClickToFlash(const QUrl &pluginUrl, QWidget *parent) diff --git a/src/clicktoflash.h b/src/clicktoflash.h index 87c53587..49c866b5 100644 --- a/src/clicktoflash.h +++ b/src/clicktoflash.h @@ -33,8 +33,8 @@ #include "rekonq_defines.h" // Qt Includes -#include -#include +#include +#include // Forward Declarations class QWebElement; diff --git a/src/filterurljob.h b/src/filterurljob.h index 0955c969..65d3ba51 100644 --- a/src/filterurljob.h +++ b/src/filterurljob.h @@ -30,22 +30,20 @@ // Rekonq Includes #include "rekonq_defines.h" -// Local Includes -#include "webview.h" - // KDE Includes #include -#include #include // Qt Includes -#include +#include +// Forward Declarations +class WebView; -using namespace ThreadWeaver; +class KUriFilter; -class REKONQ_TESTS_EXPORT FilterUrlJob : public Job +class REKONQ_TESTS_EXPORT FilterUrlJob : public ThreadWeaver::Job { public: FilterUrlJob(WebView *view, const QString &urlString, QObject *parent = 0); @@ -60,9 +58,8 @@ private: WebView *_view; QString _urlString; KUrl _url; - - static KUriFilter *s_uriFilter; + static KUriFilter *s_uriFilter; }; #endif // FILTER_URL_JOB_H diff --git a/src/findbar.cpp b/src/findbar.cpp index e8dda5b2..d74bb02b 100644 --- a/src/findbar.cpp +++ b/src/findbar.cpp @@ -27,27 +27,25 @@ // Self Includes #include "findbar.h" -#include "findbar.moc" // Local Includes #include "mainwindow.h" // KDE Includes -#include +#include #include +#include +#include #include -#include -#include // Qt Includes -#include +#include + +#include #include -#include -#include -#include #include -#include -#include +#include +#include FindBar::FindBar(MainWindow *window) diff --git a/src/findbar.h b/src/findbar.h index e83a65f4..ed856761 100644 --- a/src/findbar.h +++ b/src/findbar.h @@ -32,17 +32,18 @@ // Rekonq Includes #include "rekonq_defines.h" -// KDE Includes -#include - // Qt Includes #include -#include // Forward Declarations -class QString; class MainWindow; +class KLineEdit; + +class QString; +class QCheckBox; + + class REKONQ_TESTS_EXPORT FindBar : public QWidget { Q_OBJECT diff --git a/src/history/historymodels.cpp b/src/history/historymodels.cpp index 0f137e0e..793ff7e5 100644 --- a/src/history/historymodels.cpp +++ b/src/history/historymodels.cpp @@ -40,6 +40,7 @@ // KDE Includes #include #include +#include // Qt Includes #include diff --git a/src/iconmanager.cpp b/src/iconmanager.cpp index 4381b53a..5b2f6c99 100644 --- a/src/iconmanager.cpp +++ b/src/iconmanager.cpp @@ -26,24 +26,22 @@ // Self Includes #include "iconmanager.h" -#include "iconmanager.moc" // Local Includes #include "application.h" #include "webicon.h" // KDE Includes -#include +#include + +#include +#include #include -#include -#include +#include // Qt Includes -#include -#include -#include -#include -#include +#include +#include IconManager::IconManager(QObject *parent) @@ -104,12 +102,12 @@ void IconManager::provideIcon(QWebPage *page, const KUrl &url, bool notify) } QUrl u(url.url()); - QString rootUrlString = u.toString( QUrl::RemovePassword - | QUrl::RemoveUserInfo - | QUrl::RemovePath - | QUrl::RemoveQuery + QString rootUrlString = u.toString( QUrl::RemovePassword + | QUrl::RemoveUserInfo + | QUrl::RemovePath + | QUrl::RemoveQuery | QUrl::StripTrailingSlash); - + // check if icon exists if(!KMimeType::favIconForUrl(url).isEmpty()) { @@ -118,10 +116,10 @@ void IconManager::provideIcon(QWebPage *page, const KUrl &url, bool notify) emit iconChanged(); return; } - + // find ico url KUrl iconUrl(rootUrlString + QL1S("/favicon.ico")); - + QWebElement root = page->mainFrame()->documentElement(); QWebElement e = root.findFirst(QL1S("link[rel~=\"icon\"]")); QString relUrlString = e.attribute(QL1S("href")); @@ -130,25 +128,25 @@ void IconManager::provideIcon(QWebPage *page, const KUrl &url, bool notify) e = root.findFirst(QL1S("link[rel~=\"shortcut icon\"]")); relUrlString = e.attribute(QL1S("href")); } - + if(!relUrlString.isEmpty()) - { + { iconUrl = relUrlString.startsWith("http") - ? KUrl(relUrlString) + ? KUrl(relUrlString) : KUrl(rootUrlString + relUrlString) ; } - + kDebug() << "ICON URL: " << iconUrl; - + QString faviconDir = KStandardDirs::locateLocal("cache" , "favicons/" , true); - + int r = rootUrlString.indexOf(':'); kDebug() << rootUrlString; kDebug() << r; - + KUrl destUrl(faviconDir + rootUrlString.mid(r+3) + ".png"); kDebug() << "DEST URL: " << destUrl; - + // download icon KIO::Job *job = KIO::file_copy(iconUrl, destUrl, -1, KIO::HideProgressInfo); if(notify) diff --git a/src/iconmanager.h b/src/iconmanager.h index 794e61bd..ce6c7d7b 100644 --- a/src/iconmanager.h +++ b/src/iconmanager.h @@ -30,29 +30,28 @@ // Rekonq Includes #include "rekonq_defines.h" -// KDE Includes -#include -#include -#include - // Qt Includes -#include +#include + +// Forward Declarations +class KIcon; +class QWebPage; class REKONQ_TESTS_EXPORT IconManager : public QObject { Q_OBJECT - + public: - IconManager(QObject *parent = 0); + IconManager(QObject *parent = 0); virtual ~IconManager(); KIcon iconForUrl(const KUrl &url); - + void provideIcon(QWebPage *page, const KUrl &url, bool notify = true); void downloadIconFromUrl(const KUrl &url); - + Q_SIGNALS: void iconChanged(); }; diff --git a/src/main.cpp b/src/main.cpp index bda272b0..2a5ee528 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -29,12 +29,10 @@ // Local Includes #include "application.h" -#include "sessionmanager.h" // KDE Includes #include #include -#include static const char description[] = @@ -69,7 +67,7 @@ extern "C" KDE_EXPORT int kdemain(int argc, char **argv) ki18n("Developer, Ideas, Mockups, rekonq Icon"), "megabigbug@yahoo.fr", ""); - + about.addAuthor(ki18n("Johannes Zellner"), ki18n("Patches, Suggestions, Testing, Bugfixing"), "webmaster@nebulon.de", @@ -114,23 +112,23 @@ extern "C" KDE_EXPORT int kdemain(int argc, char **argv) ki18n("Bookmarks code peer reviewer. A fantastic help"), "jonan88@gmail.com", "http://identi.ca/jonan"); - + about.addAuthor(ki18n("Benjamin Poulain"), ki18n("The \"QtWebKit guy\". Code quality improvements"), "ikipou@gmail.com", "http://www.openyourcode.org/"); - + // --------------- about credits ----------------------------- about.addCredit(ki18n("Dawit Alemayehu"), ki18n("KDEWebKit (main) developer. And KIO. And KUriFilter. And more.."), "adawit@kde.org", ""); - + about.addCredit(ki18n("Lindsay Mathieson"), ki18n("Provided Patches & Hints, Discovered Bugs"), "lindsay.mathieson@gmail.com", ""); - + about.addCredit(ki18n("Abdurrahman AVCI"), ki18n("Provided Patches & Hints"), "abdurrahmanavci@gmail.com", diff --git a/src/mainview.cpp b/src/mainview.cpp index 75d98b39..4aeb5256 100644 --- a/src/mainview.cpp +++ b/src/mainview.cpp @@ -29,36 +29,31 @@ // Self Includes #include "mainview.h" -#include "mainview.moc" // Auto Includes #include "rekonq.h" // Local Includes +#include "application.h" +#include "iconmanager.h" +#include "mainwindow.h" +#include "sessionmanager.h" +#include "stackedurlbar.h" #include "tabbar.h" #include "urlbar.h" -#include "sessionmanager.h" -#include "iconmanager.h" +#include "webpage.h" +#include "webtab.h" // KDE Includes -#include #include -#include -#include +#include #include #include -#include -#include // Qt Includes -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include MainView::MainView(MainWindow *parent) @@ -120,7 +115,7 @@ void MainView::postLaunch() m_recentlyClosedTabs.removeAll(item); m_recentlyClosedTabs.prepend(item); } - + // Session Manager connect(this, SIGNAL(tabsChanged()), Application::sessionManager(), SLOT(saveSession())); connect(this, SIGNAL(currentChanged(int)), Application::sessionManager(), SLOT(saveSession())); @@ -412,7 +407,7 @@ void MainView::closeOtherTabs(int index) index = currentIndex(); if (index < 0 || index >= count()) return; - + for (int i = count() - 1; i > index; --i) { closeTab(i); @@ -435,9 +430,9 @@ void MainView::cloneTab(int index) return; KUrl url = webTab(index)->url(); - + Application::instance()->loadUrl(url, Rekonq::NewTab); - + updateTabBar(); } @@ -449,10 +444,10 @@ void MainView::closeTab(int index, bool del) if (count() == 1) { WebView *w = currentWebTab()->view(); - + if( currentWebTab()->url().protocol() == QL1S("about") ) return; - + switch (ReKonfig::newTabsBehaviour()) { case 0: // new tab page @@ -489,8 +484,8 @@ void MainView::closeTab(int index, bool del) return; } - if (!tab->url().isEmpty() - && !QWebSettings::globalSettings()->testAttribute(QWebSettings::PrivateBrowsingEnabled) + if (!tab->url().isEmpty() + && !QWebSettings::globalSettings()->testAttribute(QWebSettings::PrivateBrowsingEnabled) ) { QString title = tab->view()->title(); @@ -591,7 +586,7 @@ void MainView::webViewTitleChanged(const QString &title) QString viewTitle = title.isEmpty()? i18n("(Untitled)") : title; QString tabTitle = viewTitle; tabTitle.replace('&', "&&"); - + WebView *view = qobject_cast(sender()); int index = indexOf(view->parentWidget()); if (-1 != index) @@ -650,7 +645,7 @@ void MainView::openClosedTab() if (action) { Application::instance()->loadUrl(action->data().toUrl(), Rekonq::NewTab); - + QString title = action->text(); title = title.remove('&'); HistoryItem item(action->data().toString(), QDateTime(), title ); diff --git a/src/mainview.h b/src/mainview.h index cc7eb8da..6fab7fc0 100644 --- a/src/mainview.h +++ b/src/mainview.h @@ -35,28 +35,23 @@ #include "rekonq_defines.h" // Local Includes -#include "webview.h" -#include "webpage.h" -#include "webtab.h" -#include "application.h" #include "historymanager.h" -#include "mainwindow.h" -#include "stackedurlbar.h" // KDE Includes #include -// Qt Includes -#include - // Forward Declarations -class QUrl; -class QWebFrame; -class QLabel; -class QMouseEvent; - +class HistoryItem; +class MainWindow; +class StackedUrlBar; class TabBar; class UrlBar; +class WebTab; + +class QLabel; +class QToolButton; +class QUrl; +class QWebFrame; /** @@ -135,11 +130,11 @@ public slots: * added to existing MainWindow @c toWindow. */ void detachTab(int index = -1, MainWindow *toWindow = NULL); - + void reloadAllTabs(); void nextTab(); void previousTab(); - + void openClosedTabs(); void openClosedTab(); void switchToTab(); diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 92735f6f..217c6f31 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -29,70 +29,60 @@ // Self Includes #include "mainwindow.h" -#include "mainwindow.moc" // Auto Includes #include "rekonq.h" // Local Includes -#include "settingsdialog.h" -#include "historymanager.h" +#include "analyzerpanel.h" +#include "application.h" #include "bookmarkprovider.h" +#include "bookmarkspanel.h" #include "bookmarkstoolbar.h" -#include "webtab.h" -#include "mainview.h" #include "findbar.h" -#include "zoombar.h" #include "historypanel.h" -#include "bookmarkspanel.h" -#include "webinspectorpanel.h" -#include "urlbar.h" -#include "tabbar.h" -#include "adblockmanager.h" -#include "analyzerpanel.h" #include "iconmanager.h" +#include "mainview.h" +#include "settingsdialog.h" +#include "stackedurlbar.h" +#include "tabbar.h" +#include "urlbar.h" +#include "webinspectorpanel.h" +#include "webpage.h" +#include "webtab.h" +#include "zoombar.h" // Ui Includes #include "ui_cleardata.h" // KDE Includes -#include -#include +#include + #include #include -#include -#include -#include #include -#include -#include -#include -#include -#include #include -#include -#include -#include -#include +#include +#include +#include +#include #include +#include +#include +#include // Qt Includes #include -#include -#include -#include -#include -#include -#include +#include +#include + #include -#include +#include #include +#include #include -#include - -#include -#include +#include #include diff --git a/src/mainwindow.h b/src/mainwindow.h index 4180af5c..ad4fa4b8 100644 --- a/src/mainwindow.h +++ b/src/mainwindow.h @@ -34,30 +34,25 @@ // Rekonq Includes #include "rekonq_defines.h" -// Local Includes -#include "bookmarkprovider.h" - // KDE Includes -#include #include -#include -#include +#include // Forward Declarations +class BookmarksPanel; +class BookmarkToolBar; class FindBar; -class ZoomBar; class HistoryPanel; -class BookmarksPanel; -class WebInspectorPanel; -class WebTab; class MainView; class NetworkAnalyzerPanel; +class WebInspectorPanel; +class WebTab; +class ZoomBar; -class KAction; +class KActionMenu; class KPassivePopup; class QWebFrame; -class QSlider; /** @@ -172,7 +167,7 @@ private slots: void initBookmarkBar(); void initToolsMenu(); - + private: MainView *m_view; FindBar *m_findBar; diff --git a/src/networkaccessmanager.cpp b/src/networkaccessmanager.cpp index 73c8b599..37ddcacc 100644 --- a/src/networkaccessmanager.cpp +++ b/src/networkaccessmanager.cpp @@ -28,20 +28,16 @@ // Self Includes #include "networkaccessmanager.h" -#include "networkaccessmanager.moc" // Local Includes -#include "application.h" #include "adblockmanager.h" +#include "application.h" #include "webpage.h" // KDE Includes #include #include -// Qt Includes -#include - NetworkAccessManager::NetworkAccessManager(QObject *parent) : AccessManager(parent) @@ -65,7 +61,7 @@ QNetworkReply *NetworkAccessManager::createRequest(QNetworkAccessManager::Operat QNetworkRequest req = request; req.setAttribute(QNetworkRequest::HttpPipeliningAllowedAttribute, true); req.setRawHeader("Accept-Language", _acceptLanguage); - + KIO::CacheControl cc = KProtocolManager::cacheControl(); switch (cc) { @@ -88,20 +84,20 @@ QNetworkReply *NetworkAccessManager::createRequest(QNetworkAccessManager::Operat break; } - // WARNING - // There are actually 3 exceptions here handled with QNAM + // WARNING + // There are actually 3 exceptions here handled with QNAM // instead of KIO that need fixes upstream before removing. They are: // 1) AJAX requests handling // 2) DeleteOperation // 3) CustomOperation - + // this is used to handle "AJAX" requests QByteArray header = req.rawHeader("x-requested-with"); if(!header.isNull()) { return QNetworkAccessManager::createRequest(op, req, outgoingData); } - + switch(op) { case QNetworkAccessManager::HeadOperation: @@ -110,13 +106,13 @@ QNetworkReply *NetworkAccessManager::createRequest(QNetworkAccessManager::Operat case QNetworkAccessManager::GetOperation: reply = Application::adblockManager()->block(req, parentPage); break; - + case QNetworkAccessManager::PutOperation: break; case QNetworkAccessManager::PostOperation: break; - + case QNetworkAccessManager::DeleteOperation: kDebug() << "DELETE OPERATION..."; reply = QNetworkAccessManager::createRequest(op, req, outgoingData); @@ -140,7 +136,7 @@ QNetworkReply *NetworkAccessManager::createRequest(QNetworkAccessManager::Operat reply = AccessManager::createRequest(op, req, outgoingData); if(parentPage && parentPage->hasNetworkAnalyzerEnabled()) - emit networkData( op, req, reply ); + emit networkData( op, req, reply ); return reply; } diff --git a/src/networkaccessmanager.h b/src/networkaccessmanager.h index a012f0d5..d109c6cc 100644 --- a/src/networkaccessmanager.h +++ b/src/networkaccessmanager.h @@ -32,17 +32,11 @@ // Rekonq Includes #include "rekonq_defines.h" -// Local Includes -#include "webpage.h" - // KDE Includes -#include - - -using namespace KIO::Integration; +#include -class REKONQ_TESTS_EXPORT NetworkAccessManager : public AccessManager +class REKONQ_TESTS_EXPORT NetworkAccessManager : public KIO::Integration::AccessManager { Q_OBJECT @@ -53,7 +47,7 @@ protected: virtual QNetworkReply *createRequest(QNetworkAccessManager::Operation op, const QNetworkRequest &request, QIODevice *outgoingData = 0); signals: - void networkData(QNetworkAccessManager::Operation op, const QNetworkRequest &request, QNetworkReply *reply); + void networkData(QNetworkAccessManager::Operation op, const QNetworkRequest &request, QNetworkReply *reply); private: QByteArray _acceptLanguage; diff --git a/src/newtabpage.cpp b/src/newtabpage.cpp index 51081816..04cda204 100644 --- a/src/newtabpage.cpp +++ b/src/newtabpage.cpp @@ -27,31 +27,31 @@ // Self Includes #include "newtabpage.h" -#include "newtabpage.moc" // Auto Includes #include "rekonq.h" // Local Includes -#include "historymodels.h" -#include "bookmarkprovider.h" #include "application.h" -#include "mainwindow.h" +#include "bookmarkprovider.h" +#include "historymodels.h" #include "mainview.h" +#include "mainwindow.h" #include "websnap.h" -#include "previewselectorbar.h" +#include "webpage.h" #include "webtab.h" // KDE Includes -#include -#include -#include -#include #include +#include +#include +#include +#include // Qt Includes #include #include +#include NewTabPage::NewTabPage(QWebFrame *frame) diff --git a/src/newtabpage.h b/src/newtabpage.h index 2560beb2..be02d9dc 100644 --- a/src/newtabpage.h +++ b/src/newtabpage.h @@ -33,17 +33,15 @@ #include "rekonq_defines.h" // KDE Includes -#include #include // Qt Includes -#include -#include -#include +#include +#include -// Forward Includes +// Forward Declarations class KBookmark; -class WebPage; +class QWebFrame; class REKONQ_TESTS_EXPORT NewTabPage : public QObject diff --git a/src/paneltreeview.cpp b/src/paneltreeview.cpp index f935d8a2..35a4172a 100644 --- a/src/paneltreeview.cpp +++ b/src/paneltreeview.cpp @@ -26,7 +26,6 @@ // Self Includes #include "paneltreeview.h" -#include "paneltreeview.moc" // Local Includes #include "application.h" @@ -35,9 +34,8 @@ #include // Qt Includes -#include -#include #include +#include PanelTreeView::PanelTreeView(QWidget *parent) diff --git a/src/paneltreeview.h b/src/paneltreeview.h index 75aee8e7..2385978e 100644 --- a/src/paneltreeview.h +++ b/src/paneltreeview.h @@ -31,7 +31,7 @@ #include "rekonq_defines.h" // Qt Includes -#include +#include // Forward Declarations class KUrl; diff --git a/src/previewselectorbar.cpp b/src/previewselectorbar.cpp index 037222d6..6549b124 100644 --- a/src/previewselectorbar.cpp +++ b/src/previewselectorbar.cpp @@ -27,27 +27,25 @@ // Auto Includes #include "previewselectorbar.h" -#include "previewselectorbar.moc" // Self Includes #include "rekonq.h" // Local Include -#include "websnap.h" #include "application.h" #include "mainwindow.h" -#include "webtab.h" #include "webpage.h" +#include "webtab.h" // KDE Includes #include #include // Qt Includes -#include - -#include #include +#include +#include +#include diff --git a/src/previewselectorbar.h b/src/previewselectorbar.h index 6f2acd41..ff2c7e2a 100644 --- a/src/previewselectorbar.h +++ b/src/previewselectorbar.h @@ -32,9 +32,11 @@ #include "rekonq_defines.h" // Qt Includes -#include -#include -#include +#include + +// Forward Declarations +class QLabel; +class QPushButton; class REKONQ_TESTS_EXPORT PreviewSelectorBar : public QWidget diff --git a/src/protocolhandler.cpp b/src/protocolhandler.cpp index a260ad06..c469d0c3 100644 --- a/src/protocolhandler.cpp +++ b/src/protocolhandler.cpp @@ -25,43 +25,33 @@ // Self Includes #include "protocolhandler.h" -#include "protocolhandler.moc" // Auto Includes #include "rekonq.h" // Local Includes -#include "newtabpage.h" +#include "adblockmanager.h" #include "application.h" -#include "mainwindow.h" +#include "historymanager.h" #include "mainview.h" +#include "mainwindow.h" +#include "newtabpage.h" #include "urlbar.h" +#include "webpage.h" #include "webtab.h" -#include "historymanager.h" -#include "adblockmanager.h" // KDE Includes -#include -#include -#include -#include -#include -#include -#include +#include #include -#include -#include -#include +#include #include -#include +#include +#include +#include // Qt Includes -#include -#include -#include -#include -#include -#include +#include +#include ProtocolHandler::ProtocolHandler(QObject *parent) @@ -108,7 +98,7 @@ bool ProtocolHandler::preHandling(const QNetworkRequest &request, QWebFrame *fra if(scriptSource.isEmpty()) return false; } - + kDebug() << "EVALUATING JAVASCRIPT..."; QVariant result = frame->evaluateJavaScript(scriptSource); return true; @@ -132,11 +122,11 @@ bool ProtocolHandler::preHandling(const QNetworkRequest &request, QWebFrame *fra if ( KProcess::execute (apturl,host)==0) return true; - else + else return false; } - + // "abp" handling if (_url.protocol() == QL1S("abp")) { diff --git a/src/protocolhandler.h b/src/protocolhandler.h index a8661f81..4211e4ef 100644 --- a/src/protocolhandler.h +++ b/src/protocolhandler.h @@ -32,17 +32,18 @@ #include "rekonq_defines.h" // KDE Includes -#include +#include // Qt Includes -#include +#include // Forward Declarations +class KDirLister; +class KFileItemList; +class KJob; + class QNetworkRequest; class QWebFrame; -class QString; -class KUrl; -class KJob; class REKONQ_TESTS_EXPORT ProtocolHandler : public QObject diff --git a/src/sessionmanager.cpp b/src/sessionmanager.cpp index fbab2d82..58cb5895 100644 --- a/src/sessionmanager.cpp +++ b/src/sessionmanager.cpp @@ -28,22 +28,19 @@ // Self Includes #include "sessionmanager.h" -#include "sessionmanager.moc" // Local Includes #include "application.h" -#include "mainwindow.h" #include "mainview.h" -#include "webtab.h" +#include "mainwindow.h" #include "tabbar.h" +#include "webtab.h" // KDE Includes #include // Qt Includes #include -#include - SessionManager::SessionManager(QObject *parent) @@ -64,10 +61,10 @@ void SessionManager::saveSession() if (!m_safe) return; m_safe = false; - + if( QWebSettings::globalSettings()->testAttribute(QWebSettings::PrivateBrowsingEnabled) ) return; - + QFile sessionFile(m_sessionFilePath); if (!sessionFile.open(QFile::WriteOnly | QFile::Truncate)) { @@ -84,7 +81,7 @@ void SessionManager::saveSession() { out << mv->webTab(i)->url().toEncoded() << "\n"; } - + // Current Tab for window out << "currenttab\n"; out << mv->tabBar()->currentIndex() << "\n"; @@ -149,7 +146,7 @@ bool SessionManager::restoreSession() QStringList SessionManager::closedSites() { QStringList list; - + QFile sessionFile(m_sessionFilePath); if (!sessionFile.exists()) return list; diff --git a/src/sessionmanager.h b/src/sessionmanager.h index a446b530..63b33572 100644 --- a/src/sessionmanager.h +++ b/src/sessionmanager.h @@ -35,7 +35,9 @@ // Qt Includes #include -#include + +// Forward Declarations +class QString; /** @@ -50,7 +52,7 @@ public: bool restoreSession(); QStringList closedSites(); - + private slots: void saveSession(); diff --git a/src/tabbar.cpp b/src/tabbar.cpp index f4da2e54..4af2202a 100644 --- a/src/tabbar.cpp +++ b/src/tabbar.cpp @@ -29,34 +29,29 @@ //Self Includes #include "tabbar.h" -#include "tabbar.moc" // Local Includes #include "rekonq.h" + #include "application.h" +#include "iconmanager.h" +#include "mainview.h" #include "mainwindow.h" -#include "urlbar.h" +#include "webpage.h" #include "webtab.h" #include "websnap.h" -#include "mainview.h" -#include "iconmanager.h" // KDE Includes -#include -#include -#include -#include -#include #include +#include +#include +#include // Qt Includes -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include #define BASE_WIDTH_DIVISOR 4 @@ -172,7 +167,7 @@ void TabBar::showTabPreview() // no previews during load if (indexedTab->progress() != 0) return; - + int w = tabSizeHint(m_currentTabPreviewIndex).width(); int h = w * ((0.0 + currentTab->height()) / currentTab->width()); @@ -208,7 +203,7 @@ void TabBar::mouseMoveEvent(QMouseEvent *event) } KTabBar::mouseMoveEvent(event); - + if (ReKonfig::alwaysShowTabPreviews()) { //Find the tab under the mouse @@ -287,7 +282,7 @@ void TabBar::mousePressEvent(QMouseEvent *event) void TabBar::contextMenu(int tab, const QPoint &pos) { setupHistoryActions(); - + m_actualIndex = tab; KMenu menu; @@ -313,7 +308,7 @@ void TabBar::contextMenu(int tab, const QPoint &pos) void TabBar::emptyAreaContextMenu(const QPoint &pos) { setupHistoryActions(); - + KMenu menu; MainWindow *mainWindow = Application::instance()->mainWindow(); @@ -328,7 +323,7 @@ void TabBar::emptyAreaContextMenu(const QPoint &pos) { menu.addAction( mainBar->toggleViewAction() ); } - + menu.exec(pos); } @@ -360,7 +355,7 @@ void TabBar::setupHistoryActions() { MainWindow *w = Application::instance()->mainWindow(); MainView *mv = qobject_cast(parent()); - + QAction *openClosedTabsAction = w->actionByName( QL1S("open_closed_tabs") ); openClosedTabsAction->setEnabled( mv->recentlyClosedTabs().size() > 0 ); diff --git a/src/tabbar.h b/src/tabbar.h index 49c0e3ca..a80776e1 100644 --- a/src/tabbar.h +++ b/src/tabbar.h @@ -34,17 +34,10 @@ // Rekonq Includes #include "rekonq_defines.h" -// Qt Includes -#include - // KDE Includes #include // Forward Declarations -class QPoint; -class QMouseEvent; -class QEvent; - class KPassivePopup; @@ -95,7 +88,7 @@ private slots: private: void setupHistoryActions(); - + friend class MainView; /** @@ -104,7 +97,7 @@ private: int m_actualIndex; QWeakPointer m_previewPopup; - + /** * the index of the tab preview shown */ diff --git a/src/urlbar/urlresolver.cpp b/src/urlbar/urlresolver.cpp index 7f6a7f4f..59fa28c0 100644 --- a/src/urlbar/urlresolver.cpp +++ b/src/urlbar/urlresolver.cpp @@ -33,6 +33,7 @@ #include "historymanager.h" #include "bookmarkprovider.h" #include "searchengine.h" +#include "opensearchmanager.h" // KDE Includes #include @@ -71,7 +72,7 @@ UrlResolver::UrlResolver(const QString &typedUrl) , _typedString(typedUrl.trimmed()) { if (!_searchEngine ) _searchEngine = SearchEngine::defaultEngine(); - + if ( _browseRegexp.isEmpty() ) { kDebug() << "browse regexp empty. Setting value.."; @@ -267,7 +268,7 @@ UrlSearchList UrlResolver::orderLists() historyCount = _history.count(); bookmarksCount = _bookmarks.count(); commonCount = common.count(); - + kDebug() << "HISTORY COUNT: " << historyCount; //now fill the list to MAX_ELEMENTS @@ -386,7 +387,7 @@ void UrlResolver::computeSuggestions() emit suggestionsReady(list, _typedString); return; } - + if (Application::opensearchManager()->isSuggestionAvailable()) { connect(Application::opensearchManager(), @@ -395,7 +396,7 @@ void UrlResolver::computeSuggestions() SLOT(suggestionsReceived(const QString &, const QStringList &))); Application::opensearchManager()->requestSuggestion(_typedString); - } + } } @@ -403,7 +404,7 @@ void UrlResolver::suggestionsReceived(const QString &text, const QStringList &su { if(text != _typedString) return; - + UrlSearchList sugList; Q_FOREACH(const QString &s, suggestions) diff --git a/src/urlpanel.cpp b/src/urlpanel.cpp index cf6aec7b..8753038c 100644 --- a/src/urlpanel.cpp +++ b/src/urlpanel.cpp @@ -29,9 +29,6 @@ #include "urlpanel.h" #include "urlpanel.moc" -// Auto Includes -#include "rekonq.h" - // Local Includes #include "paneltreeview.h" #include "urlfilterproxymodel.h" diff --git a/src/walletbar.cpp b/src/walletbar.cpp index 292e48bd..a12115e0 100644 --- a/src/walletbar.cpp +++ b/src/walletbar.cpp @@ -26,20 +26,19 @@ // Self Includes #include "walletbar.h" -#include "walletbar.moc" // Auto Includes #include "rekonq.h" // KDE Includes -#include #include +#include // Qt Includes -#include -#include -#include -#include +#include +#include +#include +#include WalletBar::WalletBar(QWidget *parent) diff --git a/src/walletbar.h b/src/walletbar.h index 5901c659..a33dc4d3 100644 --- a/src/walletbar.h +++ b/src/walletbar.h @@ -32,10 +32,10 @@ #include "rekonq_defines.h" // Qt Includes -#include -#include -#include -#include +#include +#include + +class QLabel; class REKONQ_TESTS_EXPORT WalletBar : public QWidget diff --git a/src/webicon.cpp b/src/webicon.cpp index 98b88a5c..58f8fcfb 100644 --- a/src/webicon.cpp +++ b/src/webicon.cpp @@ -26,7 +26,6 @@ // Self Includes #include "webicon.h" -#include "webicon.moc" // Local Includes #include "application.h" @@ -35,7 +34,6 @@ // Qt Includes #include #include -#include WebIcon::WebIcon(const KUrl& url, QObject *parent) @@ -45,7 +43,7 @@ WebIcon::WebIcon(const KUrl& url, QObject *parent) m_page.settings()->setAttribute(QWebSettings::PluginsEnabled, false); m_page.settings()->setAttribute(QWebSettings::JavascriptEnabled, false); m_page.settings()->setAttribute(QWebSettings::PrivateBrowsingEnabled, true); - + connect(&m_page, SIGNAL(loadFinished(bool)), this, SLOT(saveIcon(bool))); QTimer::singleShot(0, this, SLOT(load())); } @@ -66,6 +64,6 @@ void WebIcon::saveIcon(bool b) { if(b) Application::iconManager()->provideIcon(&m_page, m_url, false); - + this->deleteLater(); } diff --git a/src/webicon.h b/src/webicon.h index d8b20e10..4afe7d28 100644 --- a/src/webicon.h +++ b/src/webicon.h @@ -32,10 +32,9 @@ // KDE Includes #include -#include // Qt Includes -#include +#include class REKONQ_TESTS_EXPORT WebIcon : public QObject diff --git a/src/webinspectorpanel.cpp b/src/webinspectorpanel.cpp index 3d1a5a1e..05e24fe0 100644 --- a/src/webinspectorpanel.cpp +++ b/src/webinspectorpanel.cpp @@ -26,18 +26,15 @@ // Self Includes #include "webinspectorpanel.h" -#include "webinspectorpanel.moc" // Local Includes -#include "webtab.h" -#include "webview.h" +#include "mainwindow.h" #include "webpage.h" - -// KDE Includes -#include "KAction" +#include "webtab.h" // Qt Includes -#include +#include +#include WebInspectorPanel::WebInspectorPanel(QString title, QWidget *parent) diff --git a/src/webinspectorpanel.h b/src/webinspectorpanel.h index 1f0ea06b..846a2666 100644 --- a/src/webinspectorpanel.h +++ b/src/webinspectorpanel.h @@ -31,9 +31,6 @@ // Rekonq Includes #include "rekonq_defines.h" -// Local Includes -#include "mainwindow.h" - // Qt Includes #include diff --git a/src/webpage.cpp b/src/webpage.cpp index fbccbbe5..bde5aad2 100644 --- a/src/webpage.cpp +++ b/src/webpage.cpp @@ -32,49 +32,44 @@ // Self Includes #include "webpage.h" -#include "webpage.moc" // Auto Includes #include "rekonq.h" // Local Includes +#include "adblockmanager.h" #include "application.h" -#include "mainwindow.h" +#include "iconmanager.h" #include "mainview.h" -#include "webtab.h" -#include "webpluginfactory.h" +#include "mainwindow.h" #include "networkaccessmanager.h" -#include "adblockmanager.h" +#include "newtabpage.h" #include "urlbar.h" -#include "iconmanager.h" +#include "webpluginfactory.h" +#include "webtab.h" #include "sslinfodialog_p.h" // KDE Includes +#include +#include #include -#include +#include +#include +#include +#include +#include +#include #include -#include -#include +#include #include -#include - -#include -#include -#include -#include -#include - // Qt Includes -#include -#include -#include -#include -#include - -#include +#include +#include +#include +#include // Returns true if the scheme and domain of the two urls match... @@ -108,42 +103,42 @@ static bool downloadResource (const KUrl& srcUrl, const KIO::MetaData& metaData QWidget* parent = 0, const QString& suggestedName = QString()) { KUrl destUrl; - + int result = KIO::R_OVERWRITE; const QUrl fileName ((suggestedName.isEmpty() ? srcUrl.fileName() : suggestedName)); - do + do { destUrl = KFileDialog::getSaveFileName(fileName, QString(), parent); - + if(destUrl.isEmpty()) return false; - if (destUrl.isLocalFile()) + if (destUrl.isLocalFile()) { QFileInfo finfo (destUrl.toLocalFile()); - if (finfo.exists()) + if (finfo.exists()) { QDateTime now = QDateTime::currentDateTime(); - QPointer dlg = new KIO::RenameDialog( parent, - i18n("Overwrite File?"), - srcUrl, + QPointer dlg = new KIO::RenameDialog( parent, + i18n("Overwrite File?"), + srcUrl, destUrl, KIO::RenameDialog_Mode(KIO::M_OVERWRITE | KIO::M_SKIP), - -1, + -1, finfo.size(), - now.toTime_t(), + now.toTime_t(), finfo.created().toTime_t(), - now.toTime_t(), + now.toTime_t(), finfo.lastModified().toTime_t() ); result = dlg->exec(); delete dlg; } } - } + } while (result == KIO::R_CANCEL && destUrl.isValid()); - + // Save download history Application::instance()->addDownload(srcUrl.pathOrUrl() , destUrl.pathOrUrl()); @@ -162,7 +157,7 @@ static bool downloadResource (const KUrl& srcUrl, const KIO::MetaData& metaData } return false; } - + KIO::Job *job = KIO::file_copy(srcUrl, destUrl, -1, KIO::Overwrite); if (!metaData.isEmpty()) @@ -172,7 +167,7 @@ static bool downloadResource (const KUrl& srcUrl, const KIO::MetaData& metaData job->addMetaData(QL1S("cache"), QL1S("cache")); // Use entry from cache if available. job->uiDelegate()->setAutoErrorHandlingEnabled(true); return true; - + } @@ -216,7 +211,7 @@ WebPage::WebPage(QWidget *parent) // protocol handler signals connect(&_protHandler, SIGNAL(downloadUrl(const KUrl &)), this, SLOT(downloadUrl(const KUrl &))); - + connect(Application::iconManager(), SIGNAL(iconChanged()), mainFrame(), SIGNAL(iconChanged())); } @@ -318,7 +313,7 @@ WebPage *WebPage::createWindow(QWebPage::WebWindowType type) void WebPage::handleUnsupportedContent(QNetworkReply *reply) { Q_ASSERT (reply); - // NOTE: + // NOTE: // Until kio implements a way to resume/continue a network // request. We must abort the reply to prevent a zombie process // from continuing to download the unsupported content! @@ -330,18 +325,18 @@ void WebPage::handleUnsupportedContent(QNetworkReply *reply) if (reply->error() != QNetworkReply::NoError) return; - + KUrl replyUrl = reply->url(); // HACK ------------------------------------------- // This is done to fix #231204 && #212808 - + QString mimeType; QString suggestedFileName; - + QString app = reply->header(QNetworkRequest::ContentTypeHeader).toString(); QStringList headerList = app.split( ';' ); - + if(headerList.count() > 0) { mimeType = headerList.takeFirst().trimmed(); @@ -362,24 +357,24 @@ void WebPage::handleUnsupportedContent(QNetworkReply *reply) { mimeType = reply->header(QNetworkRequest::ContentTypeHeader).toString(); } - + // NOTE // This part has been copied from KWebPage::downloadResponse code - if (reply->hasRawHeader("Content-Disposition")) + if (reply->hasRawHeader("Content-Disposition")) { KIO::MetaData metaData = reply->attribute(static_cast(KIO::AccessManager::MetaData)).toMap(); - if (metaData.value(QL1S("content-disposition-type")).compare(QL1S("attachment"), Qt::CaseInsensitive) == 0) + if (metaData.value(QL1S("content-disposition-type")).compare(QL1S("attachment"), Qt::CaseInsensitive) == 0) { suggestedFileName = metaData.value(QL1S("content-disposition-filename")); - } - else + } + else { const QString value = QL1S(reply->rawHeader("Content-Disposition").simplified()); - if (value.startsWith(QL1S("attachment"), Qt::CaseInsensitive)) + if (value.startsWith(QL1S("attachment"), Qt::CaseInsensitive)) { const int length = value.size(); int pos = value.indexOf(QL1S("filename"), 0, Qt::CaseInsensitive); - if (pos > -1) + if (pos > -1) { pos += 9; while (pos < length && (value.at(pos) == QL1C(' ') || value.at(pos) == QL1C('=') || value.at(pos) == QL1C('"'))) @@ -389,7 +384,7 @@ void WebPage::handleUnsupportedContent(QNetworkReply *reply) while (endPos < length && value.at(endPos) != QL1C('"') && value.at(endPos) != QL1C(';')) endPos++; - if (endPos > pos) + if (endPos > pos) { suggestedFileName = value.mid(pos, (endPos-pos)).trimmed(); } @@ -397,11 +392,11 @@ void WebPage::handleUnsupportedContent(QNetworkReply *reply) } } } - + kDebug() << "Detected MimeType = " << mimeType; kDebug() << "Suggested File Name = " << suggestedFileName; // ------------------------------------------------ - + KService::Ptr appService = KMimeTypeTrader::self()->preferredService(mimeType); bool isLocal = replyUrl.isLocalFile(); @@ -423,7 +418,7 @@ void WebPage::handleUnsupportedContent(QNetworkReply *reply) KParts::BrowserOpenOrSaveQuestion dlg(Application::instance()->mainWindow(), replyUrl, mimeType); if(!suggestedFileName.isEmpty()) dlg.setSuggestedFileName(suggestedFileName); - + switch (dlg.askEmbedOrSave()) { case KParts::BrowserOpenOrSaveQuestion::Save: @@ -444,7 +439,7 @@ void WebPage::handleUnsupportedContent(QNetworkReply *reply) if (partServices.count() > 0) { QString p = replyUrl.pathOrUrl(); - + // A part can handle this. Embed it! QString html; html += ""; @@ -461,7 +456,7 @@ void WebPage::handleUnsupportedContent(QNetworkReply *reply) html += ""; html += ""; - mainFrame()->setHtml(html); + mainFrame()->setHtml(html); _isOnRekonqPage = true; Application::instance()->mainWindow()->mainView()->urlBar()->setQUrl(replyUrl); Application::instance()->mainWindow()->updateActions(); @@ -485,8 +480,8 @@ void WebPage::loadStarted() void WebPage::loadFinished(bool ok) { Q_UNUSED(ok); - - + + Application::adblockManager()->applyHidingRules(this); QStringList list = ReKonfig::walletBlackList(); @@ -534,7 +529,7 @@ void WebPage::manageNetworkErrors(QNetworkReply *reply) case QNetworkReply::OperationCanceledError: // operation canceled via abort() or close() calls // ignore this.. return; - + case QNetworkReply::ContentAccessDenied: // access to remote content denied (similar to HTTP error 401) kDebug() << "We (hopefully) are managing this through the adblock :)"; break; diff --git a/src/webpage.h b/src/webpage.h index f9f4d9bf..ed5e2dde 100644 --- a/src/webpage.h +++ b/src/webpage.h @@ -38,19 +38,11 @@ // Local Includes #include "protocolhandler.h" -#include "newtabpage.h" #include "websslinfo.h" // KDE Includes #include -// Qt Includes -#include - -// Forward Declarations -class QWebFrame; -class QNetworkReply; - class REKONQ_TESTS_EXPORT WebPage : public KWebPage { @@ -68,10 +60,10 @@ public: public slots: void downloadAllContentsWithKGet(QPoint); - + virtual void downloadRequest(const QNetworkRequest &request); virtual void downloadUrl(const KUrl &url); - + protected: WebPage *createWindow(WebWindowType type); @@ -88,14 +80,14 @@ private slots: void updateImage(bool ok); void downloadReply(const QNetworkReply *reply, const QString &suggestedFileName = QString()); - -private: + +private: QString errorPage(QNetworkReply *reply); QUrl _loadingUrl; ProtocolHandler _protHandler; WebSslInfo _sslInfo; - + bool _networkAnalyzer; bool _isOnRekonqPage; }; diff --git a/src/webpluginfactory.cpp b/src/webpluginfactory.cpp index fe2f965b..5f6ebf04 100644 --- a/src/webpluginfactory.cpp +++ b/src/webpluginfactory.cpp @@ -27,12 +27,10 @@ // Self Includes #include "webpluginfactory.h" -#include "webpluginfactory.moc" // Local Includes #include "rekonq.h" -#include "application.h" -#include "mainwindow.h" + #include "clicktoflash.h" diff --git a/src/webpluginfactory.h b/src/webpluginfactory.h index c5eefa45..a7e32f83 100644 --- a/src/webpluginfactory.h +++ b/src/webpluginfactory.h @@ -35,10 +35,6 @@ // KDE Includes #include -// Qt Includes -#include -#include - class REKONQ_TESTS_EXPORT WebPluginFactory : public KWebPluginFactory { diff --git a/src/websnap.h b/src/websnap.h index 3baa01fd..5bad952d 100644 --- a/src/websnap.h +++ b/src/websnap.h @@ -38,11 +38,11 @@ // Qt Includes #include - -#include - #include +// Forward Declarations +class QPixmap; + // Defines #define WIDTH 200 #define HEIGHT 150 @@ -78,7 +78,7 @@ public: explicit WebSnap(const KUrl &url, QObject *parent = 0); ~WebSnap(); - + /** * Snaps a pixmap of size w * h from a page * @@ -89,9 +89,9 @@ public: * @return the pixmap snapped from the page */ static QPixmap renderPagePreview(const QWebPage &page, int w = WIDTH, int h = HEIGHT); - + // static QPixmap renderVisiblePagePreview(const QWebPage &page, int w = WIDTH, int h = HEIGHT); TODO: try to make this method work => more previews for the urlbar - + /** * Snaps a pixmap of size w * h from a page of a tab that is currently closing * @@ -102,7 +102,7 @@ public: * @return the pixmap snapped from the page */ static QPixmap renderClosingPagePreview(const QWebPage &page, int w = WIDTH, int h = HEIGHT); - + /** * Snaps a pixmap of size w * h from a page for tab preview * @@ -112,8 +112,8 @@ public: * * @return the pixmap snapped from the page */ - static QPixmap renderTabPreview(const QWebPage &page, int w, int h); - + static QPixmap renderTabPreview(const QWebPage &page, int w, int h); + /** * Guess the local path where the image for the url provided * should be @@ -141,7 +141,7 @@ signals: private: QWebPage m_page; KUrl m_url; - + //render a preview: common part of renderPagePreview() and renderTabPreview() static QPixmap render(const QWebPage &page, int w, int h); }; diff --git a/src/websslinfo.cpp b/src/websslinfo.cpp index 35112504..fefb4580 100644 --- a/src/websslinfo.cpp +++ b/src/websslinfo.cpp @@ -20,10 +20,16 @@ * */ +// Self Includes #include "websslinfo.h" +// Qt Includes +#include #include +#include +#include + class WebSslInfo::WebSslInfoPrivate { diff --git a/src/websslinfo.h b/src/websslinfo.h index 4ac708cc..345f5413 100644 --- a/src/websslinfo.h +++ b/src/websslinfo.h @@ -22,13 +22,14 @@ #ifndef WEBSSLINFO_H #define WEBSSLINFO_H -#include - -#include +// Qt Includes #include -#include -#include -#include + +// Forward Declarations +class QHostAddress; +class QSslCertificate; +class QUrl; +class QVariant; class WebSslInfo diff --git a/src/webtab.cpp b/src/webtab.cpp index 2826123d..63223b1c 100644 --- a/src/webtab.cpp +++ b/src/webtab.cpp @@ -27,36 +27,20 @@ // Self Includes #include "webtab.h" -#include "webtab.moc" // Auto Includes #include "rekonq.h" // Local Includes -#include "application.h" -#include "mainwindow.h" -#include "mainview.h" -#include "bookmarkprovider.h" -#include "walletbar.h" #include "previewselectorbar.h" #include "rsswidget.h" +#include "walletbar.h" +#include "webpage.h" // KDE Includes -#include -#include -#include -#include -#include -#include -#include -#include +#include // Qt Includes -#include -#include -#include -#include -#include #include diff --git a/src/webtab.h b/src/webtab.h index a24418ef..a9129d0b 100644 --- a/src/webtab.h +++ b/src/webtab.h @@ -33,19 +33,14 @@ #include "rekonq_defines.h" // Local Includes -#include "webpage.h" #include "webview.h" -// KDE Includes -#include - // Qt Includes -#include -#include +#include // Forward Declarations -class WalletBar; class PreviewSelectorBar; +class WalletBar; class REKONQ_TESTS_EXPORT WebTab : public QWidget @@ -59,7 +54,7 @@ public: inline WebView *view() { return _view; } inline WebPage *page() { return view()->page(); } inline int progress() { return m_progress; } - + KUrl url(); void createPreviewSelectorBar(int index); @@ -74,10 +69,10 @@ private slots: signals: void loadProgressing(); - + private: WebView *_view; - + int m_progress; QWeakPointer _walletBar; diff --git a/src/webview.cpp b/src/webview.cpp index b794007f..3c0187e0 100644 --- a/src/webview.cpp +++ b/src/webview.cpp @@ -27,44 +27,39 @@ // Self Includes #include "webview.h" -#include "webview.moc" // Auto Includes #include "rekonq.h" // Local Includes -#include "mainwindow.h" -#include "mainview.h" -#include "webpage.h" +#include "application.h" #include "bookmarkprovider.h" -#include "searchengine.h" -#include "websnap.h" #include "iconmanager.h" +#include "mainview.h" +#include "mainwindow.h" +#include "searchengine.h" #include "urlbar.h" +#include "webpage.h" +#include "websnap.h" // KDE Includes -#include -#include -#include -#include +#include #include -#include +#include +#include +#include #include // Qt Includes -#include -#include -#include -#include -#include +#include +#include + #include -#include -#include +#include #include -#include -#include -#include +#include +#include WebView::WebView(QWidget* parent) @@ -469,7 +464,7 @@ void WebView::slotCopyImageLocation() imageUrl.populateMimeData( mimeData ); QApplication::clipboard()->setMimeData( mimeData, QClipboard::Selection ); #else - QApplication::clipboard()->setText( imageUrl.url() ); + QApplication::clipboard()->setText( imageUrl.url() ); #endif } diff --git a/src/webview.h b/src/webview.h index f7341644..e760cfe1 100644 --- a/src/webview.h +++ b/src/webview.h @@ -32,12 +32,12 @@ // Rekonq Includes #include "rekonq_defines.h" -//Qt Includes -#include - // KDE Includes #include +//Qt Includes +#include + // Forward Declarations class WebPage; @@ -51,7 +51,7 @@ public: ~WebView(); WebPage *page(); - + inline QPoint mousePos() { return _mousePos; } protected: diff --git a/src/zoombar.cpp b/src/zoombar.cpp index 041e6118..6920101b 100644 --- a/src/zoombar.cpp +++ b/src/zoombar.cpp @@ -27,21 +27,24 @@ // Self Includes #include "zoombar.h" -#include "zoombar.moc" // local includes +#include "application.h" #include "mainview.h" +#include "mainwindow.h" +#include "webtab.h" // KDE Includes -#include -#include #include +#include #include +#include // Qt Includes #include #include -#include +#include +#include ZoomBar::ZoomBar(QWidget *parent) diff --git a/src/zoombar.h b/src/zoombar.h index adb0067b..d45aab19 100644 --- a/src/zoombar.h +++ b/src/zoombar.h @@ -32,16 +32,14 @@ // Rekonq Includes #include "rekonq_defines.h" -// Local Includes -#include "mainwindow.h" - // Qt Includes #include -#include -#include // Forward Declarations -class QString; +class MainWindow; + +class QSlider; +class QToolButton; class REKONQ_TESTS_EXPORT ZoomBar : public QWidget @@ -55,7 +53,7 @@ public: public slots: void show(); void hide(); - + void zoomIn(); void zoomOut(); void zoomNormal(); -- cgit v1.2.1