summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/CMakeLists.txt32
-rw-r--r--src/main.cpp2
-rw-r--r--src/mainview.cpp58
-rw-r--r--src/mainview.h2
-rw-r--r--src/mainwindow.cpp1
-rw-r--r--src/webpage.cpp36
-rw-r--r--src/webpage.h5
7 files changed, 67 insertions, 69 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index ed3205b8..809e54af 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -1,14 +1,10 @@
### ------- SETTING REKONQ FILES..
-if(${KDE_VERSION_MINOR} EQUAL "2" AND ${KDE_VERSION_RELEASE} GREATER "69")
-
-SET( rekonq_NAM networkmanager.cpp )
-
-else(${KDE_VERSION_MINOR} EQUAL "2" AND ${KDE_VERSION_RELEASE} GREATER "69")
-
-SET( rekonq_NAM kaccessmanager.cpp )
-
-endif(${KDE_VERSION_MINOR} EQUAL "2" AND ${KDE_VERSION_RELEASE} GREATER "69")
+if(KDE_OLD_VERSION)
+ SET( rekonq_NAM kaccessmanager.cpp )
+else(KDE_OLD_VERSION)
+ SET( rekonq_NAM networkmanager.cpp )
+endif(KDE_OLD_VERSION)
SET( rekonq_SRCS
${rekonq_NAM}
@@ -66,13 +62,11 @@ INCLUDE_DIRECTORIES ( ${CMAKE_CURRENT_SOURCE_DIR}
${KDEWEBKIT_INCLUDE_DIR}
)
-if(${KDE_VERSION_MINOR} EQUAL "2" AND ${KDE_VERSION_RELEASE} GREATER "69")
-else(${KDE_VERSION_MINOR} EQUAL "2" AND ${KDE_VERSION_RELEASE} GREATER "69")
+if(KDE_OLD_VERSION)
INCLUDE_DIRECTORIES( ${KDENETWORK_INCLUDE_DIR} )
-endif(${KDE_VERSION_MINOR} EQUAL "2" AND ${KDE_VERSION_RELEASE} GREATER "69")
-
+endif(KDE_OLD_VERSION)
### -------------- ADDING DEFINITIONS...
@@ -81,13 +75,11 @@ ADD_DEFINITIONS ( ${KDE4_DEFINITIONS}
${KDEWEBKIT_DEFINITIONS}
)
-if(${KDE_VERSION_MINOR} EQUAL "2" AND ${KDE_VERSION_RELEASE} GREATER "69")
-else(${KDE_VERSION_MINOR} EQUAL "2" AND ${KDE_VERSION_RELEASE} GREATER "69")
+if(KDE_OLD_VERSION)
ADD_DEFINITIONS ( ${KDENETWORK_DEFINITIONS} )
-endif(${KDE_VERSION_MINOR} EQUAL "2" AND ${KDE_VERSION_RELEASE} GREATER "69")
-
+endif(KDE_OLD_VERSION)
### --------------- ADDING EXECUTABLE...
@@ -107,13 +99,11 @@ TARGET_LINK_LIBRARIES ( rekonq
${KDEWEBKIT_LIBRARIES}
)
-if(${KDE_VERSION_MINOR} EQUAL "2" AND ${KDE_VERSION_RELEASE} GREATER "69")
-else(${KDE_VERSION_MINOR} EQUAL "2" AND ${KDE_VERSION_RELEASE} GREATER "69")
+if(KDE_OLD_VERSION)
TARGET_LINK_LIBRARIES( ${KDENETWORK_LIBRARIES} )
-endif(${KDE_VERSION_MINOR} EQUAL "2" AND ${KDE_VERSION_RELEASE} GREATER "69")
-
+endif(KDE_OLD_VERSION)
### ------------ INSTALL FILES...
diff --git a/src/main.cpp b/src/main.cpp
index d97017ca..71ba22b5 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -31,7 +31,7 @@ static const char description[] =
I18N_NOOP("WebKit based Web Browser for KDE");
-static const char version[] = "0.1.6";
+static const char version[] = "0.1.7";
int main(int argc, char **argv)
diff --git a/src/mainview.cpp b/src/mainview.cpp
index 79afd2dc..a3c6e77e 100644
--- a/src/mainview.cpp
+++ b/src/mainview.cpp
@@ -46,6 +46,7 @@
#include <KActionCollection>
#include <KDebug>
#include <KStandardDirs>
+#include <KToolInvocation>
// Qt Includes
#include <QtCore/QTimer>
@@ -628,24 +629,71 @@ void MainView::webViewUrlChanged(const QUrl &url)
}
+// WARNING this method is ready to be refactored with real KServices implementation
+// and moved to a RekonqRun class (0.3 target)
void MainView::loadUrl(const KUrl &url)
{
if (url.isEmpty())
return;
- currentUrlBar()->setUrl(url.prettyUrl());
+ QString scheme = url.scheme();
- WebView *webView = currentWebView();
+ if (scheme == QLatin1String("mailto"))
+ {
+ KToolInvocation::invokeMailer(url);
+ return;
+ }
KUrl loadingUrl(url);
+ // create convenience fake api:// protocol for KDE apidox search and Qt docs
+ if (scheme == QLatin1String("api"))
+ {
+ QString path;
+ QString className = url.host().toLower();
+ if (className[0] == 'k')
+ {
+ path = QString("http://api.kde.org/new.classmapper.php?class=%1").arg(className);
+ }
+ else if (className[0] == 'q')
+ {
+ path = QString("http://doc.trolltech.com/4.5/%1.html").arg(className);
+ }
+ loadingUrl.setUrl(path);
+ }
+
if (loadingUrl.isRelative())
{
- QString fn = loadingUrl.url(KUrl::RemoveTrailingSlash);
- loadingUrl.setUrl("//" + fn);
- loadingUrl.setScheme("http");
+ if(loadingUrl.path().contains('.'))
+ {
+ QString fn = loadingUrl.url(KUrl::RemoveTrailingSlash);
+ loadingUrl.setUrl("//" + fn);
+ loadingUrl.setScheme("http");
+ }
+ else
+ {
+ scheme = QLatin1String("gg");
+ }
+ }
+
+ // create convenience fake gg:// protocol, waiting for KServices learning
+ if(scheme == QLatin1String("gg"))
+ {
+ QString str = loadingUrl.path();
+ loadingUrl.setUrl( QString("http://google.com/search?&q=%1").arg(str) );
}
+ // create convenience fake wk:// protocol, waiting for KServices learning
+ if(scheme == QLatin1String("wk"))
+ {
+ QString str = loadingUrl.path();
+ loadingUrl.setUrl( QString("http://en.wikipedia.org/wiki/%1").arg(str) );
+ }
+
+ currentUrlBar()->setUrl(loadingUrl.prettyUrl());
+
+ WebView *webView = currentWebView();
+
if (webView)
{
webView->load(loadingUrl);
diff --git a/src/mainview.h b/src/mainview.h
index 7cb4e035..d338402a 100644
--- a/src/mainview.h
+++ b/src/mainview.h
@@ -2,7 +2,7 @@
*
* This file is a part of the rekonq project
*
-* Copyright (C) 2008 by Andrea Diamantini <adjam7 at gmail dot com>
+* Copyright (C) 2008-2009 by Andrea Diamantini <adjam7 at gmail dot com>
* Copyright (C) 2009 by Paweł Prażak <pawelprazak at gmail dot com>
*
*
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
index 2c46dc01..44ca861c 100644
--- a/src/mainwindow.cpp
+++ b/src/mainwindow.cpp
@@ -878,7 +878,6 @@ void MainWindow::notifyMessage(const QString &msg, Rekonq::Notify status)
m_popup->setView(msg);
int h = KGlobalSettings::generalFont().pointSize();
- kWarning() << "h: " << h;
// setting popus in bottom-left position
int x = geometry().x();
diff --git a/src/webpage.cpp b/src/webpage.cpp
index 8c6c0d2a..133a263c 100644
--- a/src/webpage.cpp
+++ b/src/webpage.cpp
@@ -40,7 +40,7 @@
#include <KUrl>
#include <KActionCollection>
#include <KDebug>
-#include <KToolInvocation>
+
#include <KDE/KParts/BrowserRun>
#include <KDE/KMimeTypeTrader>
@@ -76,40 +76,6 @@ WebPage::WebPage(QObject *parent)
}
-bool WebPage::acceptNavigationRequest(QWebFrame *frame, const QNetworkRequest &request, NavigationType type)
-{
-
- // TODO: implement ioslaves protocols
- QString scheme = request.url().scheme();
- if (scheme == QLatin1String("mailto"))
- {
- KToolInvocation::invokeMailer(request.url());
- return false;
- }
-
- // create convenience fake api:// protocol for KDE apidox search and Qt docs
- if (scheme == QLatin1String("api"))
- {
- QString path;
- QString className = request.url().host().toLower();
- if (className[0] == 'k')
- {
- path = QString("http://api.kde.org/new.classmapper.php?class=%1").arg(className);
- }
- else if (className[0] == 'q')
- {
- path = QString("http://doc.trolltech.com/4.5/%1.html").arg(className);
- }
- KUrl url(path);
-
- Application::instance()->mainWindow()->loadUrl(url);
- return false;
- }
-
- return QWebPage::acceptNavigationRequest(frame, request, type);
-}
-
-
KWebPage *WebPage::createWindow(QWebPage::WebWindowType type)
{
kDebug() << "creating window as new tab.. ";
diff --git a/src/webpage.h b/src/webpage.h
index 8fe9517d..c43212b6 100644
--- a/src/webpage.h
+++ b/src/webpage.h
@@ -48,13 +48,8 @@ public slots:
void manageNetworkErrors(QNetworkReply* reply);
protected:
- bool acceptNavigationRequest(QWebFrame *frame,
- const QNetworkRequest &request,
- NavigationType type);
-
KWebPage *createWindow(QWebPage::WebWindowType type);
-
protected Q_SLOTS:
virtual void slotHandleUnsupportedContent(QNetworkReply *reply);