summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authoradjam <adjam@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-05-06 23:02:43 +0000
committeradjam <adjam@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-05-06 23:02:43 +0000
commit601ebdf6c4faea76016cf0d87d50abc260ca1569 (patch)
treecf601630c933447f2a369f6245f9a04b9a46b08a /src
parentTypographical and grammar corrections (diff)
parentEBN Krazy fixes. 1st round.. (diff)
downloadrekonq-601ebdf6c4faea76016cf0d87d50abc260ca1569.tar.xz
Fixing conflicts merging master
git-svn-id: svn+ssh://svn.kde.org/home/kde/trunk/playground/network/rekonq@964593 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'src')
-rw-r--r--src/application.cpp6
-rw-r--r--src/application.h5
-rw-r--r--src/autosaver.cpp5
-rw-r--r--src/autosaver.h21
-rw-r--r--src/bookmarks.h6
-rw-r--r--src/cookiejar.h16
-rw-r--r--src/download.cpp3
-rw-r--r--src/findbar.cpp7
-rw-r--r--src/findbar.h14
-rw-r--r--src/history.cpp15
-rw-r--r--src/history.h23
-rw-r--r--src/main.cpp18
-rw-r--r--src/mainview.cpp8
-rw-r--r--src/mainview.h4
-rw-r--r--src/mainwindow.cpp21
-rw-r--r--src/mainwindow.h2
-rw-r--r--src/networkaccessmanager.cpp2
-rw-r--r--src/searchbar.cpp10
-rw-r--r--src/settings.cpp6
-rw-r--r--src/webview.cpp118
-rw-r--r--src/webview.h37
21 files changed, 217 insertions, 130 deletions
diff --git a/src/application.cpp b/src/application.cpp
index ec24691e..5f7892c4 100644
--- a/src/application.cpp
+++ b/src/application.cpp
@@ -45,8 +45,9 @@
#include <kio/jobclasses.h>
// Qt Includes
-#include <QtCore>
-#include <QtWebKit>
+#include <QtCore/QTimer>
+#include <QtWebKit/QWebSettings>
+#include <QtWebKit/QWebHistoryInterface>
QPointer<HistoryManager> Application::s_historyManager;
@@ -204,3 +205,4 @@ KIcon Application::icon(const KUrl &url) const
}
return icon;
}
+
diff --git a/src/application.h b/src/application.h
index 61f4af81..e0c7a21c 100644
--- a/src/application.h
+++ b/src/application.h
@@ -23,9 +23,6 @@
#ifndef APPLICATION_H
#define APPLICATION_H
-// Qt Includes
-#include <QPointer>
-
// KDE Includes
#include <KUniqueApplication>
#include <KCmdLineArgs>
@@ -35,6 +32,8 @@
#include <kio/job.h>
#include <kio/jobclasses.h>
+// Qt Includes
+#include <QPointer>
// Forward Declarations
class KIcon;
diff --git a/src/autosaver.cpp b/src/autosaver.cpp
index 25bf9016..c7da12f3 100644
--- a/src/autosaver.cpp
+++ b/src/autosaver.cpp
@@ -20,14 +20,15 @@
-// Local Includes
+// Self Includes
#include "autosaver.h"
+#include "autosaver.moc"
// KDE Includes
#include <KDebug>
// Qt Includes
-#include <QtCore>
+#include <QtCore/QMetaObject>
#define AUTOSAVE_IN 1000 * 3 // seconds
diff --git a/src/autosaver.h b/src/autosaver.h
index 8931da13..b486fcb9 100644
--- a/src/autosaver.h
+++ b/src/autosaver.h
@@ -23,13 +23,22 @@
#ifndef AUTOSAVER_H
#define AUTOSAVER_H
-#include <QtCore>
+// Qt Includes
+#include <QtCore/QObject>
+#include <QtCore/QBasicTimer>
+#include <QtCore/QTime>
-/*
- This class will call the save() slot on the parent object when the parent changes.
- It will wait several seconds after changed() to combining multiple changes and
- prevent continuous writing to disk.
- */
+// Forward Declarations
+#include <QtCore/QTimerEvent>
+
+/**
+ * This class will call the save() slot on the parent object when the parent changes.
+ * It will wait several seconds after changed() to combining multiple changes and
+ * prevent continuous writing to disk.
+ *
+ */
+
+>>>>>>> master:src/autosaver.h
class AutoSaver : public QObject
{
Q_OBJECT
diff --git a/src/bookmarks.h b/src/bookmarks.h
index d7213cb7..fef91413 100644
--- a/src/bookmarks.h
+++ b/src/bookmarks.h
@@ -209,7 +209,7 @@ signals:
public slots:
/**
* @short Opens the context menu on given position
- * @param point Point on whitch you want to open this menu
+ * @param point Point on which you want to open this menu
*/
void contextMenu(const QPoint &point);
@@ -217,8 +217,7 @@ public slots:
* @short Waits for signal that the group with the address has been modified by the caller.
* Waits for signal that the group (or any of its children) with the address
* @p groupAddress (e.g. "/4/5") has been modified by the caller @p caller.
- *
- * @param group bookmark group adress
+ * @param group bookmark group address
* @param caller caller that modified the bookmarks
* @see KBookmarkManager::changed
*/
@@ -236,3 +235,4 @@ private:
};
#endif
+
diff --git a/src/cookiejar.h b/src/cookiejar.h
index 30d57ac1..cd2403a2 100644
--- a/src/cookiejar.h
+++ b/src/cookiejar.h
@@ -35,6 +35,7 @@
// Forward Declarations
class QSortFilterProxyModel;
+class QKeyEvent;
class AutoSaver;
@@ -118,7 +119,8 @@ class CookieModel : public QAbstractTableModel
Q_OBJECT
public:
- CookieModel(CookieJar *jar, QObject *parent = 0);
+ explicit CookieModel(CookieJar *jar, QObject *parent = 0);
+
QVariant headerData(int section, Qt::Orientation orientation, int role) const;
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
int columnCount(const QModelIndex &parent = QModelIndex()) const;
@@ -143,19 +145,24 @@ class CookiesDialog : public QDialog, public Ui_CookiesDialog
Q_OBJECT
public:
- CookiesDialog(CookieJar *cookieJar, QWidget *parent = 0);
+ explicit CookiesDialog(CookieJar *cookieJar, QWidget *parent = 0);
private:
QSortFilterProxyModel *m_proxyModel;
};
+
+// ----------------------------------------------------------------------------------------------------------------------
+
+
class CookieExceptionsModel : public QAbstractTableModel
{
Q_OBJECT
friend class CookiesExceptionsDialog;
public:
- CookieExceptionsModel(CookieJar *cookieJar, QObject *parent = 0);
+ explicit CookieExceptionsModel(CookieJar *cookieJar, QObject *parent = 0);
+
QVariant headerData(int section, Qt::Orientation orientation, int role) const;
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
int columnCount(const QModelIndex &parent = QModelIndex()) const;
@@ -182,7 +189,7 @@ class CookiesExceptionsDialog : public QDialog, public Ui_CookiesExceptionsDialo
Q_OBJECT
public:
- CookiesExceptionsDialog(CookieJar *cookieJar, QWidget *parent = 0);
+ explicit CookiesExceptionsDialog(CookieJar *cookieJar, QWidget *parent = 0);
private slots:
void block();
@@ -197,3 +204,4 @@ private:
};
#endif // COOKIEJAR_H
+
diff --git a/src/download.cpp b/src/download.cpp
index 0a8f19d4..a5aa73bd 100644
--- a/src/download.cpp
+++ b/src/download.cpp
@@ -67,7 +67,7 @@ void DownloadManager::newDownload(const KUrl &srcUrl, const KUrl &destUrl)
KSharedPtr<KMimeType> mimeType = KMimeType::findByPath(srcUrl.prettyUrl());
QString typeText = KMimeType::extractKnownExtension(srcUrl.fileName());
- typeText += " (" + mimeType->name() + ")";
+ typeText += " (" + mimeType->name() + ')';
int answer = KMessageBox::questionYesNoCancel(NULL,
i18n("Download '%1'?\n""Type: %2", srcUrl.prettyUrl(), typeText),
@@ -222,3 +222,4 @@ void Download::slotResult(KJob *job)
// inform the world
emit downloadFinished(job->error());
}
+
diff --git a/src/findbar.cpp b/src/findbar.cpp
index 11d890c1..bc22a04c 100644
--- a/src/findbar.cpp
+++ b/src/findbar.cpp
@@ -30,7 +30,12 @@
#include <klocalizedstring.h>
// Qt Includes
-#include <QtGui>
+#include <QtGui/QWidget>
+#include <QtGui/QHBoxLayout>
+#include <QtGui/QToolButton>
+#include <QtGui/QLabel>
+#include <QtGui/QKeyEvent>
+#include <QtCore/QString>
FindBar::FindBar(KXmlGuiWindow *mainwindow)
diff --git a/src/findbar.h b/src/findbar.h
index 15a82e1e..a8a78970 100644
--- a/src/findbar.h
+++ b/src/findbar.h
@@ -22,14 +22,20 @@
#ifndef FINDBAR_H
#define FINDBAR_H
+
// KDE Includes
#include <KLineEdit>
#include <KToolBar>
-#include <KXmlGuiWindow>
// Qt Includes
-#include <QtCore>
-#include <QtGui>
+#include <QtGui/QWidget>
+#include <QtGui/QCheckBox>
+#include <QtGui/QKeyEvent>
+
+// Forward Declarations
+class KXmlGuiWindow;
+class QKeyEvent;
+class QString;
class FindBar : public QWidget
@@ -57,5 +63,5 @@ private:
QCheckBox *m_matchCase;
};
-
#endif
+
diff --git a/src/history.cpp b/src/history.cpp
index afcb477a..0e822142 100644
--- a/src/history.cpp
+++ b/src/history.cpp
@@ -36,9 +36,17 @@
#include <KStandardDirs>
// Qt Includes
-#include <QtCore>
-#include <QtGui>
-#include <QtWebKit>
+#include <QtCore/QList>
+#include <QtCore/QUrl>
+#include <QtCore/QDate>
+#include <QtCore/QDateTime>
+#include <QtCore/QString>
+#include <QtCore/QFile>
+#include <QtCore/QDataStream>
+#include <QtCore/QBuffer>
+
+#include <QtWebKit/QWebHistoryInterface>
+#include <QtWebKit/QWebSettings>
#include <QtAlgorithms>
@@ -1457,3 +1465,4 @@ void HistoryTreeModel::sourceRowsRemoved(const QModelIndex &parent, int start, i
endRemoveRows();
}
}
+
diff --git a/src/history.h b/src/history.h
index ecae00c3..1b504333 100644
--- a/src/history.h
+++ b/src/history.h
@@ -48,8 +48,15 @@ class HistoryItem
{
public:
HistoryItem() {}
+<<<<<<< HEAD:src/history.h
HistoryItem(const QString &u,
const QDateTime &d = QDateTime(), const QString &t = QString())
+=======
+ explicit HistoryItem(const QString &u,
+ const QDateTime &d = QDateTime(),
+ const QString &t = QString()
+ )
+>>>>>>> master:src/history.h
: title(t), url(u), dateTime(d) {}
inline bool operator==(const HistoryItem &other) const
@@ -159,7 +166,11 @@ public:
UrlStringRole = Qt::UserRole + 4
};
+<<<<<<< HEAD:src/history.h
HistoryModel(HistoryManager *history, QObject *parent = 0);
+=======
+ explicit HistoryModel(HistoryManager *history, QObject *parent = 0);
+>>>>>>> master:src/history.h
QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
int columnCount(const QModelIndex &parent = QModelIndex()) const;
@@ -185,7 +196,11 @@ class HistoryFilterModel : public QAbstractProxyModel
Q_OBJECT
public:
+<<<<<<< HEAD:src/history.h
HistoryFilterModel(QAbstractItemModel *sourceModel, QObject *parent = 0);
+=======
+ explicit HistoryFilterModel(QAbstractItemModel *sourceModel, QObject *parent = 0);
+>>>>>>> master:src/history.h
inline bool historyContains(const QString &url) const
{
@@ -236,7 +251,11 @@ class HistoryMenuModel : public QAbstractProxyModel
Q_OBJECT
public:
+<<<<<<< HEAD:src/history.h
HistoryMenuModel(HistoryTreeModel *sourceModel, QObject *parent = 0);
+=======
+ explicit HistoryMenuModel(HistoryTreeModel *sourceModel, QObject *parent = 0);
+>>>>>>> master:src/history.h
int columnCount(const QModelIndex &parent) const;
int rowCount(const QModelIndex &parent = QModelIndex()) const;
QModelIndex mapFromSource(const QModelIndex & sourceIndex) const;
@@ -328,7 +347,11 @@ class HistoryTreeModel : public QAbstractProxyModel
Q_OBJECT
public:
+<<<<<<< HEAD:src/history.h
HistoryTreeModel(QAbstractItemModel *sourceModel, QObject *parent = 0);
+=======
+ explicit HistoryTreeModel(QAbstractItemModel *sourceModel, QObject *parent = 0);
+>>>>>>> master:src/history.h
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
int columnCount(const QModelIndex &parent) const;
int rowCount(const QModelIndex &parent = QModelIndex()) const;
diff --git a/src/main.cpp b/src/main.cpp
index 5ada94b4..4dcdd902 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -67,10 +67,20 @@ int main(int argc, char **argv)
"pano_90@gmx.net",
"");
-// about.addAuthor(ki18n("your name"),
-// ki18n("your role"),
-// "your mail",
-// "your site");
+ about.addAuthor(ki18n("Juan Pablo Scaletti"),
+ ki18n("Spanish translation"),
+ "juanpablo@jpscaletti.com",
+ "");
+
+ about.addAuthor(ki18n("Eelko Berkenpies"),
+ ki18n("Dutch translation"),
+ "kaboon@gmail.com",
+ "");
+
+ about.addAuthor(ki18n("Alain Laporte"),
+ ki18n("French translation"),
+ "alain_laporte123@yahoo.fr",
+ "");
// Initialize command line args
KCmdLineArgs::init(argc, argv, &about);
diff --git a/src/mainview.cpp b/src/mainview.cpp
index d4edeb19..71f81d66 100644
--- a/src/mainview.cpp
+++ b/src/mainview.cpp
@@ -213,7 +213,7 @@ void MainView::clear()
// clear the line edit history
for (int i = 0; i < m_urlBars->count(); ++i)
{
- /// TODO What exacly do we need to clear here?
+ /// TODO What exactly do we need to clear here?
urlBar(i)->clearHistory();
urlBar(i)->clear();
}
@@ -713,4 +713,8 @@ void MainView::mouseDoubleClickEvent(QMouseEvent *event)
return;
}
KTabWidget::mouseDoubleClickEvent(event);
-} \ No newline at end of file
+<<<<<<< HEAD:src/mainview.cpp
+}
+=======
+}
+>>>>>>> master:src/mainview.cpp
diff --git a/src/mainview.h b/src/mainview.h
index 5696c4c2..d3d4948d 100644
--- a/src/mainview.h
+++ b/src/mainview.h
@@ -32,14 +32,17 @@
#include <KTabWidget>
// Forward Declarations
+class QLineEdit;
class QUrl;
class QWebFrame;
class QLabel;
class KAction;
+class KCompletion;
class KMenu;
class KUrl;
+class HistoryCompletionModel;
class StackedUrlBar;
class TabBar;
class UrlBar;
@@ -193,3 +196,4 @@ private:
};
#endif
+
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
index 4fdf306f..5642ad01 100644
--- a/src/mainwindow.cpp
+++ b/src/mainwindow.cpp
@@ -134,10 +134,12 @@ void MainWindow::postLaunch()
// --------- connect signals and slots
connect(m_view, SIGNAL(setCurrentTitle(const QString &)), this, SLOT(slotUpdateWindowTitle(const QString &)));
connect(m_view, SIGNAL(loadProgress(int)), this, SLOT(slotLoadProgress(int)));
- connect(m_view, SIGNAL(geometryChangeRequested(const QRect &)), this, SLOT(geometryChangeRequested(const QRect &)));
connect(m_view, SIGNAL(printRequested(QWebFrame *)), this, SLOT(printRequested(QWebFrame *)));
- connect(m_view, SIGNAL(menuBarVisibilityChangeRequested(bool)), menuBar(), SLOT(setVisible(bool)));
- connect(m_view, SIGNAL(statusBarVisibilityChangeRequested(bool)), statusBar(), SLOT(setVisible(bool)));
+
+ // FIXME: these slots will be commented out until rekonq will have just ONE mainwindow
+// connect(m_view, SIGNAL(geometryChangeRequested(const QRect &)), this, SLOT(geometryChangeRequested(const QRect &)));
+// connect(m_view, SIGNAL(menuBarVisibilityChangeRequested(bool)), menuBar(), SLOT(setVisible(bool)));
+// connect(m_view, SIGNAL(statusBarVisibilityChangeRequested(bool)), statusBar(), SLOT(setVisible(bool)));
// status bar messages
connect(m_view, SIGNAL(showStatusBarMessage(const QString&)), statusBar(), SLOT(showMessage(const QString&)));
@@ -282,10 +284,7 @@ void MainWindow::setupActions()
// =================== Tab Actions
a = new KAction(KIcon("tab-new"), i18n("New &Tab"), this);
- QList<QKeySequence> newTabShortcutList;
- newTabShortcutList << QKeySequence(QKeySequence::New);
- newTabShortcutList << QKeySequence(QKeySequence::AddTab);
- a->setShortcut(KShortcut(newTabShortcutList));
+ a->setShortcut(KShortcut(Qt::CTRL + Qt::Key_T, Qt::CTRL + Qt::Key_N));
actionCollection()->addAction(QLatin1String("new_tab"), a);
connect(a, SIGNAL(triggered(bool)), m_view, SLOT(newWebView()));
@@ -592,7 +591,7 @@ void MainWindow::slotPrivateBrowsing(bool enable)
settings->setAttribute(QWebSettings::PrivateBrowsingEnabled, false);
MainWindow* win = Application::instance()->mainWindow();
- win->m_lastSearch = QString::null;
+ win->m_lastSearch.clear();
win->mainView()->clear();
}
}
@@ -867,9 +866,13 @@ void MainWindow::slotOpenNext()
}
+// FIXME: this change will be there until rekonq'll have ONE mainwindow
+// (probably forever..)
void MainWindow::geometryChangeRequested(const QRect &geometry)
{
- setGeometry(geometry);
+ Q_UNUSED(geometry)
+// setGeometry(geometry);
+ kDebug() << "No geometry change allowed";
}
diff --git a/src/mainwindow.h b/src/mainwindow.h
index 823ab86f..61d8f27b 100644
--- a/src/mainwindow.h
+++ b/src/mainwindow.h
@@ -40,6 +40,7 @@ class QWebFrame;
class KUrl;
class KAction;
class KActionMenu;
+class KIcon;
class KMenu;
class FindBar;
@@ -150,3 +151,4 @@ private:
};
#endif // MAINWINDOW_H
+
diff --git a/src/networkaccessmanager.cpp b/src/networkaccessmanager.cpp
index bd1e8d8e..c9b94a8d 100644
--- a/src/networkaccessmanager.cpp
+++ b/src/networkaccessmanager.cpp
@@ -122,6 +122,7 @@ void NetworkAccessManager::authenticationRequired(QNetworkReply *reply, QAuthent
}
}
+
void NetworkAccessManager::proxyAuthenticationRequired(const QNetworkProxy &proxy, QAuthenticator *auth)
{
MainWindow *mainWindow = Application::instance()->mainWindow();
@@ -149,6 +150,7 @@ void NetworkAccessManager::proxyAuthenticationRequired(const QNetworkProxy &prox
}
}
+
#ifndef QT_NO_OPENSSL
void NetworkAccessManager::sslErrors(QNetworkReply *reply, const QList<QSslError> &error)
{
diff --git a/src/searchbar.cpp b/src/searchbar.cpp
index fad35748..2110b4d9 100644
--- a/src/searchbar.cpp
+++ b/src/searchbar.cpp
@@ -30,9 +30,12 @@
#include <KUrl>
// Qt Includes
-#include <QtCore>
-#include <QtGui>
-#include <QtNetwork>
+#include <QtCore/QString>
+#include <QtGui/QSizePolicy>
+#include <QtNetwork/QNetworkAccessManager>
+#include <QtNetwork/QNetworkRequest>
+#include <QtNetwork/QNetworkReply>
+#include <QtXml/QXmlStreamReader>
SearchBar::SearchBar(QWidget *parent) :
@@ -127,3 +130,4 @@ void SearchBar::handleNetworkData(QNetworkReply *networkReply)
networkReply->deleteLater();
}
+
diff --git a/src/settings.cpp b/src/settings.cpp
index 1e42413f..bf1f2e38 100644
--- a/src/settings.cpp
+++ b/src/settings.cpp
@@ -51,8 +51,7 @@
#include <KUrl>
// Qt Includes
-#include <QtGui>
-#include <QtWebKit>
+#include <QtGui/QWidget>
class Private
@@ -109,8 +108,10 @@ Private::Private(SettingsDialog *parent)
pageItem->setIcon(webkitIcon);
}
+
// -----------------------------------------------------------------------------------------------------
+
SettingsDialog::SettingsDialog(QWidget *parent)
: KConfigDialog(parent, "rekonfig", ReKonfig::self())
, d(new Private(this))
@@ -210,3 +211,4 @@ void SettingsDialog::setHomeToCurrentPage()
d->generalUi.kcfg_homePage->setText(webView->url().prettyUrl());
}
}
+
diff --git a/src/webview.cpp b/src/webview.cpp
index 5f42112b..c015a941 100644
--- a/src/webview.cpp
+++ b/src/webview.cpp
@@ -56,7 +56,6 @@ WebPage::WebPage(QObject *parent)
: QWebPage(parent)
, m_keyboardModifiers(Qt::NoModifier)
, m_pressedButtons(Qt::NoButton)
- , m_openInNewTab(false)
{
setNetworkAccessManager(Application::networkAccessManager());
@@ -83,48 +82,34 @@ bool WebPage::acceptNavigationRequest(QWebFrame *frame, const QNetworkRequest &r
switch (type)
{
+ // user activated a submit button for an HTML form.
+ case QWebPage::NavigationTypeFormSubmitted:
+ kDebug() << "NavigationTypeFormSubmitted";
+ kDebug() << request.url();
+ break;
- // user clicked on a link or pressed return on a focused link.
- case QWebPage::NavigationTypeLinkClicked:
+ // An HTML form was submitted a second time.
+ case QWebPage::NavigationTypeFormResubmitted:
+ kDebug() << "NavigationTypeFormResubmitted";
- if (m_keyboardModifiers & Qt::ControlModifier || m_pressedButtons == Qt::MidButton)
- {
- webView = Application::instance()->newWebView();
- webView->setFocus();
- webView->load(request);
- m_keyboardModifiers = Qt::NoModifier;
- m_pressedButtons = Qt::NoButton;
- return false;
- }
- if (frame == mainFrame())
- {
- m_loadingUrl = request.url();
- emit loadingUrl(m_loadingUrl);
- }
- else
- {
- // if frame doesn't exists (perhaps) we are pointing to a blank target..
- if (!frame)
- {
- webView = Application::instance()->newWebView();
- webView->setFocus();
- webView->load(request);
- return false;
- }
- }
- break;
+ // A navigation to another document using a method not listed above.
+ case QWebPage::NavigationTypeOther:
+ kDebug() << "NavigationTypeOther";
- // user activated a submit button for an HTML form.
- case QWebPage::NavigationTypeFormSubmitted:
+ // user clicked on a link or pressed return on a focused link.
+ case QWebPage::NavigationTypeLinkClicked:
+ kDebug() << "NavigationTypeLinkClicked";
break;
- // Navigation to a previously shown document in the back or forward history is requested.
+ // Navigation to a previously shown document in the back or forward history is requested.
case QWebPage::NavigationTypeBackOrForward:
+ kDebug() << "NavigationTypeBackOrForward";
break;
// user activated the reload action.
case QWebPage::NavigationTypeReload:
+ kDebug() << "NavigationTypeReload";
#if QT_VERSION <= 040500
// HACK Ported from Arora
@@ -133,6 +118,7 @@ bool WebPage::acceptNavigationRequest(QWebFrame *frame, const QNetworkRequest &r
// See: https://bugs.webkit.org/show_bug.cgi?id=24283
if (qApp->keyboardModifiers() & Qt::ShiftModifier)
{
+ kDebug() << "Arora hack";
QNetworkRequest newRequest(request);
newRequest.setAttribute(QNetworkRequest::CacheLoadControlAttribute,
QNetworkRequest::AlwaysNetwork);
@@ -153,48 +139,64 @@ bool WebPage::acceptNavigationRequest(QWebFrame *frame, const QNetworkRequest &r
// should be nothing..
default:
+ kDebug() << "Default NON existant case..";
break;
}
+ if (m_keyboardModifiers & Qt::ControlModifier || m_pressedButtons == Qt::MidButton)
+ {
+ webView = Application::instance()->newWebView();
+ webView->setFocus();
+ webView->load(request);
+ m_keyboardModifiers = Qt::NoModifier;
+ m_pressedButtons = Qt::NoButton;
+ return false;
+ }
+
+ if (frame == mainFrame())
+ {
+ m_loadingUrl = request.url();
+ emit loadingUrl(m_loadingUrl);
+ }
+ else
+ {
+ // if frame doesn't exists (perhaps) we are pointing to a blank target..
+ if (!frame)
+ {
+ webView = Application::instance()->newWebView();
+ webView->setFocus();
+ webView->load(request);
+ return false;
+ }
+ }
+
return QWebPage::acceptNavigationRequest(frame, request, type);
}
QWebPage *WebPage::createWindow(QWebPage::WebWindowType type)
{
+ kDebug() << "creating window as new tab.. ";
+
// added to manage web modal dialogs
if (type == QWebPage::WebModalDialog)
{
// FIXME : need a "real" implementation..
- kWarning() << "Modal Dialog ---------------------------------------";
- QWebView *w = new QWebView();
- w->show();
- return w->page();
- }
-
- if (m_keyboardModifiers & Qt::ControlModifier || m_pressedButtons == Qt::MidButton)
- {
- m_openInNewTab = true;
- }
-
- if (m_openInNewTab)
- {
- m_openInNewTab = false;
- return Application::instance()->newWebView()->page();
+ kDebug() << "Modal Dialog ---------------------------------------";
}
- MainWindow *mainWindow = Application::instance()->mainWindow();
- return mainWindow->currentTab()->page();
+ WebView *w = Application::instance()->newWebView();
+ return w->page();
}
QObject *WebPage::createPlugin(const QString &classId, const QUrl &url, const QStringList &paramNames, const QStringList &paramValues)
{
- kWarning() << "creating PLUGIN for rekonq ";
- kWarning() << "classId = " << classId;
- kWarning() << "url = " << url;
- kWarning() << "Param Names = " << paramNames;
- kWarning() << "Param Values = " << paramValues;
+ kDebug() << "creating PLUGIN for rekonq ";
+ kDebug() << "classId = " << classId;
+ kDebug() << "url = " << url;
+ kDebug() << "Param Names = " << paramNames;
+ kDebug() << "Param Values = " << paramValues;
QUiLoader loader;
return loader.createWidget(classId, view());
@@ -230,6 +232,10 @@ void WebPage::handleUnsupportedContent(QNetworkReply *reply)
KUrl srcUrl = reply->url();
Application::downloadManager()->newDownload(srcUrl);
}
+ else
+ {
+ kDebug() << "invalid content type header";
+ }
return;
}
@@ -439,7 +445,6 @@ void WebView::wheelEvent(QWheelEvent *event)
void WebView::openLinkInNewTab()
{
- m_page->m_openInNewTab = true;
pageAction(QWebPage::OpenLinkInNewWindow)->trigger();
}
@@ -448,7 +453,7 @@ void WebView::loadFinished()
{
if (m_progress != 100)
{
- kWarning() << "Recieved finished signal while progress is still:" << progress()
+ kWarning() << "Received finished signal while progress is still:" << progress()
<< "Url:" << url();
}
m_progress = 0;
@@ -502,3 +507,4 @@ void WebView::keyPressEvent(QKeyEvent *event)
QWebView::keyPressEvent(event);
}
+
diff --git a/src/webview.h b/src/webview.h
index c6ca17f8..3742a36d 100644
--- a/src/webview.h
+++ b/src/webview.h
@@ -31,12 +31,17 @@
#include <QWebPage>
// Forward Declarations
+class MainWindow;
+class Application;
class KActionCollection;
class QWebFrame;
+class QAuthenticator;
class QMouseEvent;
+class QNetworkProxy;
class QNetworkReply;
+class QSslError;
class WebPage : public QWebPage
@@ -70,7 +75,6 @@ private:
// set the webview mousepressedevent
Qt::KeyboardModifiers m_keyboardModifiers;
Qt::MouseButtons m_pressedButtons;
- bool m_openInNewTab;
KUrl m_loadingUrl;
};
@@ -91,22 +95,10 @@ public:
KActionCollection* webActions();
// inline
- WebPage *webPage() const
- {
- return m_page;
- }
- KUrl url() const
- {
- return KUrl(QWebView::url());
- }
- QString lastStatusBarText() const
- {
- return m_statusBarText;
- }
- int progress() const
- {
- return m_progress;
- }
+ WebPage *webPage() const { return m_page; }
+ KUrl url() const { return KUrl(QWebView::url()); }
+ QString lastStatusBarText() const { return m_statusBarText; }
+ int progress() const { return m_progress; }
signals:
// switching tabs
@@ -126,15 +118,9 @@ protected:
void keyPressEvent(QKeyEvent *event);
private slots:
- void setProgress(int progress)
- {
- m_progress = progress;
- }
+ void setProgress(int progress) { m_progress = progress; }
void loadFinished();
- void setStatusBarText(const QString &string)
- {
- m_statusBarText = string;
- }
+ void setStatusBarText(const QString &string) { m_statusBarText = string; }
void downloadRequested(const QNetworkRequest &request);
void openLinkInNewTab();
@@ -148,3 +134,4 @@ private:
};
#endif
+