diff options
author | Jon Ander Peñalba <jonan88@gmail.com> | 2010-09-02 18:10:46 +0200 |
---|---|---|
committer | Jon Ander Peñalba <jonan88@gmail.com> | 2010-09-03 08:27:20 +0200 |
commit | d0ab264b8aa5f5c7fcb21dd172a1f3f5b777356b (patch) | |
tree | f89adefce79c8bf0d5cde2e1bc015a443ccb39fe | |
parent | This commit hacks a merge request, to fast fixing a crash calling the bk toolbar (diff) | |
download | rekonq-d0ab264b8aa5f5c7fcb21dd172a1f3f5b777356b.tar.xz |
Include clean-up in the big src directory
51 files changed, 395 insertions, 533 deletions
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 <KCmdLineArgs> #include <KStandardDirs> -#include <kio/job.h> -#include <kio/jobclasses.h> -#include <KUriFilter> #include <KMessageBox> -#include <KUrl> #include <ThreadWeaver/Weaver> -// Qt Includes -#include <QtCore/QTimer> - -QWeakPointer<HistoryManager> Application::s_historyManager; -QWeakPointer<BookmarkProvider> Application::s_bookmarkProvider; -QWeakPointer<SessionManager> Application::s_sessionManager; QWeakPointer<AdBlockManager> Application::s_adblockManager; -QWeakPointer<OpenSearchManager> Application::s_opensearchManager; +QWeakPointer<BookmarkProvider> Application::s_bookmarkProvider; +QWeakPointer<HistoryManager> Application::s_historyManager; QWeakPointer<IconManager> Application::s_iconManager; +QWeakPointer<OpenSearchManager> Application::s_opensearchManager; +QWeakPointer<SessionManager> 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 <KUniqueApplication> -#include <KIcon> -#include <ThreadWeaver/Job> // Qt Includes -#include <QWeakPointer> -#include <QList> +#include <QtCore/QDateTime> +#include <QtCore/QWeakPointer> // 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<MainWindow> > MainWindowList; - -// --------------------------------------------------------------------------------------------------------------- +namespace ThreadWeaver {class Job;} -#include <QDateTime> +typedef QList< QWeakPointer<MainWindow> > MainWindowList; +typedef QList<DownloadItem> DownloadList; class DownloadItem @@ -84,13 +76,9 @@ public: }; -typedef QList<DownloadItem> 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<AdBlockManager> s_adblockManager; static QWeakPointer<OpenSearchManager> s_opensearchManager; static QWeakPointer<IconManager> 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 <KBookmarkManager> #include <KLocalizedString> +#include <KIcon> // Qt Includes #include <QtCore/QMimeData> @@ -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 <KLocalizedString> // Qt Includes -#include <QWebFrame> -#include <QWebView> -#include <QWebElement> -#include <QHBoxLayout> -#include <QToolButton> - +#include <QtGui/QHBoxLayout> +#include <QtGui/QToolButton> +#include <QtWebKit/QWebElement> +#include <QtWebKit/QWebFrame> +#include <QtWebKit/QWebView> 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 <QWidget> -#include <QUrl> +#include <QtCore/QUrl> +#include <QtGui/QWidget> // 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 <KUrl> -#include <KUriFilter> #include <ThreadWeaver/Job> // Qt Includes -#include <QString> +#include <QtCore/QString> +// 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 <KLineEdit> +#include <KApplication> #include <KIcon> +#include <KLineEdit> +#include <KLocalizedString> #include <KPushButton> -#include <klocalizedstring.h> -#include <KApplication> // Qt Includes -#include <QtGui/QWidget> +#include <QtCore/QTimer> + +#include <QtGui/QCheckBox> #include <QtGui/QHBoxLayout> -#include <QtGui/QToolButton> -#include <QtGui/QLabel> -#include <QtGui/QColor> #include <QtGui/QKeyEvent> -#include <QtCore/QString> -#include <QtCore/QTimer> +#include <QtGui/QLabel> +#include <QtGui/QToolButton> 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 <KLineEdit> - // Qt Includes #include <QtGui/QWidget> -#include <QtGui/QCheckBox> // 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 <KStandardDirs> #include <KLocale> +#include <KIcon> // Qt Includes #include <QtCore/QList> 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 <kmimetype.h> +#include <KIO/Job> + +#include <KIcon> +#include <KMimeType> #include <KStandardDirs> -#include <KFileItem> -#include <KDirLister> +#include <KUrl> // Qt Includes -#include <QDBusInterface> -#include <QDBusReply> -#include <QWebElement> -#include <QWebFrame> -#include <QAction> +#include <QtWebKit/QWebElement> +#include <QtWebKit/QWebFrame> 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 <KUrl> -#include <KIcon> -#include <KIO/Job> - // Qt Includes -#include <QWebPage> +#include <QtCore/QObject> + +// 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 <KAboutData> #include <KCmdLineArgs> -#include <KDebug> 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 <KUrl> #include <KAction> -#include <KShortcut> -#include <KStandardShortcut> +#include <KLocalizedString> #include <KMessageBox> #include <KStandardDirs> -#include <KPassivePopup> -#include <KLocalizedString> // Qt Includes -#include <QTimer> -#include <QString> -#include <QAction> -#include <QIcon> -#include <QLabel> -#include <QMovie> -#include <QWidget> -#include <QVBoxLayout> +#include <QtGui/QLabel> +#include <QtGui/QMovie> +#include <QtGui/QToolButton> 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<WebView *>(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 <KTabWidget> -// Qt Includes -#include <QtGui/QToolButton> - // 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 <KShortcut> -#include <KStandardAction> +#include <KIO/Job> + #include <KAction> #include <KEditToolBar> -#include <KToggleFullScreenAction> -#include <KActionCollection> -#include <KMessageBox> #include <KFileDialog> -#include <KGlobalSettings> -#include <KPushButton> -#include <KTemporaryFile> -#include <KPassivePopup> -#include <KMenuBar> #include <KJobUiDelegate> -#include <kdeprintdialog.h> -#include <KToggleAction> -#include <KStandardDirs> -#include <KActionCategory> +#include <KMenu> +#include <KMenuBar> +#include <KMessageBox> +#include <KPassivePopup> #include <KProcess> +#include <KPushButton> +#include <KStandardDirs> +#include <KToggleFullScreenAction> // Qt Includes #include <QtCore/QTimer> -#include <QtCore/QRect> -#include <QtCore/QSize> -#include <QtCore/QList> -#include <QtCore/QWeakPointer> -#include <QtGui/QVBoxLayout> -#include <QtGui/QFont> +#include <QtDBus/QDBusInterface> +#include <QtDBus/QDBusReply> + #include <QtGui/QDesktopWidget> -#include <QtGui/QPrinter> +#include <QtGui/QLabel> #include <QtGui/QPrintDialog> +#include <QtGui/QPrinter> #include <QtGui/QPrintPreviewDialog> -#include <QtGui/QFontMetrics> - -#include <QtDBus/QDBusInterface> -#include <QtDBus/QDBusReply> +#include <QtGui/QVBoxLayout> #include <QtWebKit/QWebHistory> 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 <KXmlGuiWindow> #include <KActionCollection> -#include <KToolBar> -#include <KUrl> +#include <KXmlGuiWindow> // 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 <KLocale> #include <KProtocolManager> -// Qt Includes -#include <QtNetwork/QNetworkReply> - 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 <kio/accessmanager.h> - - -using namespace KIO::Integration; +#include <KIO/AccessManager> -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 <KStandardDirs> -#include <KConfig> -#include <KDialog> -#include <KCalendarSystem> #include <KBookmarkManager> +#include <KIconLoader> +#include <KLocale> +#include <KMimeType> +#include <KStandardDirs> // Qt Includes #include <QtCore/QFile> #include <QtGui/QAction> +#include <QtWebKit/QWebFrame> 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 <KIconLoader> #include <KUrl> // Qt Includes -#include <QObject> -#include <QString> -#include <QWebElement> +#include <QtCore/QObject> +#include <QtWebKit/QWebElement> -// 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 <KUrl> // Qt Includes -#include <QtGui/QMouseEvent> -#include <QtGui/QKeyEvent> #include <QtGui/QClipboard> +#include <QtGui/QMouseEvent> 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 <QTreeView> +#include <QtGui/QTreeView> // 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 <KIcon> #include <KLocalizedString> // Qt Includes -#include <QtCore/QString> - -#include <QtGui/QToolButton> #include <QtGui/QHBoxLayout> +#include <QtGui/QLabel> +#include <QtGui/QPushButton> +#include <QtGui/QToolButton> 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 <QWidget> -#include <QPushButton> -#include <QLabel> +#include <QtGui/QWidget> + +// 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 <klocalizedstring.h> -#include <KUrl> -#include <KRun> -#include <KToolInvocation> -#include <KStandardDirs> -#include <KMimeType> -#include <KIconLoader> +#include <KIO/Job> #include <KDirLister> -#include <KFileItem> -#include <KJob> -#include <kio/udsentry.h> +#include <KLocalizedString> #include <KMessageBox> -#include <kprocess.h> +#include <KProcess> +#include <KStandardDirs> +#include <KToolInvocation> // Qt Includes -#include <QLatin1String> -#include <QNetworkRequest> -#include <QWebFrame> -#include <QDir> -#include <QFile> -#include <QDateTime> +#include <QtNetwork/QNetworkRequest> +#include <QtWebKit/QWebFrame> 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 <KDirLister> +#include <KUrl> // Qt Includes -#include <QWebFrame> +#include <QtCore/QObject> // 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 <KStandardDirs> // Qt Includes #include <QtCore/QFile> -#include <QtCore/QTextStream> - 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 <QtCore/QObject> -#include <QtCore/QString> + +// 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 <KShortcut> -#include <KStandardShortcut> -#include <KGlobalSettings> -#include <KPassivePopup> -#include <KMenu> #include <KActionMenu> +#include <KMenu> +#include <KPassivePopup> +#include <KToolBar> // Qt Includes -#include <QString> -#include <QFont> -#include <QToolButton> -#include <QLabel> -#include <QMouseEvent> -#include <QPainter> -#include <QVBoxLayout> +#include <QtGui/QLabel> +#include <QtGui/QLayout> +#include <QtGui/QMouseEvent> +#include <QtGui/QToolButton> #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<MainView *>(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 <QWeakPointer> - // KDE Includes #include <KTabBar> // 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<KPassivePopup> 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 <KBookmark> @@ -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 <klocalizedstring.h> #include <KIcon> +#include <KLocalizedString> // Qt Includes -#include <QToolButton> -#include <QPushButton> -#include <QHBoxLayout> -#include <QString> +#include <QtGui/QGridLayout> +#include <QtGui/QLabel> +#include <QtGui/QPushButton> +#include <QtGui/QToolButton> 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 <QWidget> -#include <QString> -#include <QUrl> -#include <QLabel> +#include <QtCore/QUrl> +#include <QtGui/QWidget> + +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 <QtCore/QTimer> #include <QtWebKit/QWebFrame> -#include <QtWebKit/QWebSettings> 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 <KUrl> -#include <KIcon> // Qt Includes -#include <QWebPage> +#include <QtWebKit/QWebPage> 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 <QWebInspector> +#include <QtGui/QAction> +#include <QtWebKit/QWebInspector> 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 <QtGui/QDockWidget> 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 <KIO/Job> +#include <KIO/RenameDialog> #include <KStandardDirs> -#include <KUrl> +#include <KFileDialog> +#include <KJobUiDelegate> +#include <KLocalizedString> +#include <KMessageBox> +#include <KMimeTypeTrader> +#include <KService> #include <KToolInvocation> -#include <KProtocolManager> -#include <kwebwallet.h> +#include <KWebWallet> #include <kparts/browseropenorsavequestion.h> -#include <kio/renamedialog.h> - -#include <KDE/KMimeTypeTrader> -#include <KDE/KRun> -#include <KDE/KFileDialog> -#include <KDE/KMessageBox> -#include <KDE/KJobUiDelegate> - // Qt Includes -#include <QtGui/QContextMenuEvent> -#include <QtGui/QWheelEvent> -#include <QtGui/QMouseEvent> -#include <QtGui/QClipboard> -#include <QtGui/QKeyEvent> - -#include <QtWebKit/QWebFrame> +#include <QtCore/QFileInfo> +#include <QtDBus/QDBusConnection> +#include <QtDBus/QDBusConnectionInterface> +#include <QtDBus/QDBusInterface> // 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<KIO::RenameDialog> dlg = new KIO::RenameDialog( parent, - i18n("Overwrite File?"), - srcUrl, + QPointer<KIO::RenameDialog> 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<QNetworkRequest::Attribute>(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 += "<html>"; @@ -461,7 +456,7 @@ void WebPage::handleUnsupportedContent(QNetworkReply *reply) html += "</body>"; 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 <KWebPage> -// Qt Includes -#include <QUrl> - -// 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 <KWebPluginFactory> -// Qt Includes -#include <QtCore/QList> -#include <QtGui/QWidget> - 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 <QtCore/QObject> - -#include <QtGui/QPixmap> - #include <QtWebKit/QWebPage> +// 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 <QtCore/QUrl> #include <QtCore/QVariant> +#include <QtNetwork/QHostAddress> +#include <QtNetwork/QSslCertificate> + 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 <kdemacros.h> - -#include <QtCore/QUrl> +// Qt Includes #include <QtCore/QList> -#include <QtCore/QString> -#include <QtNetwork/QHostAddress> -#include <QtNetwork/QSslCertificate> + +// 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 <KService> -#include <KUriFilterData> -#include <KStandardShortcut> -#include <KMenu> -#include <KActionMenu> -#include <KWebView> -#include <kwebwallet.h> -#include <KDE/KMessageBox> +#include <KWebWallet> // Qt Includes -#include <QtGui/QContextMenuEvent> -#include <QtGui/QWheelEvent> -#include <QtGui/QMouseEvent> -#include <QtGui/QClipboard> -#include <QtGui/QKeyEvent> #include <QtGui/QVBoxLayout> 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 <KUrl> - // Qt Includes -#include <QWidget> -#include <QWeakPointer> +#include <QtGui/QWidget> // 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> _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 <KService> -#include <KUriFilterData> -#include <KStandardShortcut> -#include <KMenu> +#include <KAction> #include <KActionMenu> -#include <ktoolinvocation.h> +#include <KLocalizedString> +#include <KMenu> +#include <KStandardAction> #include <KStandardDirs> // Qt Includes -#include <QtCore/QDir> -#include <QtGui/QAction> -#include <QtGui/QContextMenuEvent> -#include <QtGui/QWheelEvent> -#include <QtGui/QMouseEvent> +#include <QtCore/QFile> +#include <QtCore/QTimer> + #include <QtGui/QClipboard> -#include <QtGui/QKeyEvent> -#include <QtGui/QLayout> +#include <QtGui/QContextMenuEvent> #include <QtGui/QWindowsStyle> -#include <QtDBus/QDBusConnectionInterface> -#include <QtDBus/QDBusInterface> -#include <QtDBus/QDBusReply> +#include <QtWebKit/QWebFrame> +#include <QtWebKit/QWebHistory> 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 <QTime> - // KDE Includes #include <KWebView> +//Qt Includes +#include <QtCore/QTime> + // 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 <KIcon> -#include <KStandardAction> #include <KAction> +#include <KIcon> #include <KLocalizedString> +#include <KStandardAction> // Qt Includes #include <QtGui/QHBoxLayout> #include <QtGui/QLabel> -#include <QtCore/QString> +#include <QtGui/QSlider> +#include <QtGui/QToolButton> 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 <QtGui/QWidget> -#include <QtGui/QSlider> -#include <QtGui/QToolButton> // 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(); |