Skip to content
Browse files

Remove Qt 4.7 compatibility code from CurrentUrl

  • Loading branch information...
1 parent 2ceab4e commit c3eb16b87eb8641b71693e8d76c3e3d0ec010c7f @mhoran mhoran committed Nov 22, 2012
Showing with 0 additions and 22 deletions.
  1. +0 −15 src/CurrentUrl.cpp
  2. +0 −6 src/CurrentUrl.h
  3. +0 −1 src/WebPage.cpp
View
15 src/CurrentUrl.cpp
@@ -6,24 +6,9 @@ CurrentUrl::CurrentUrl(WebPageManager *manager, QStringList &arguments, QObject
}
void CurrentUrl::start() {
-#if QT_VERSION >= QT_VERSION_CHECK(4, 8, 0)
QStringList arguments;
QVariant result = page()->invokeCapybaraFunction("currentUrl", arguments);
QString url = result.toString();
emit finished(new Response(true, url));
-#else
- QUrl humanUrl = wasRedirectedAndNotModifiedByJavascript() ?
- page()->currentFrame()->url() : page()->currentFrame()->requestedUrl();
- QByteArray encodedBytes = humanUrl.toEncoded();
- emit finished(new Response(true, encodedBytes));
-}
-
-bool CurrentUrl::wasRegularLoad() {
- return page()->currentFrame()->url() == page()->currentFrame()->requestedUrl();
-}
-
-bool CurrentUrl::wasRedirectedAndNotModifiedByJavascript() {
- return !wasRegularLoad() && page()->currentFrame()->url() == page()->history()->currentItem().url();
-#endif
}
View
6 src/CurrentUrl.h
@@ -6,11 +6,5 @@ class CurrentUrl : public SocketCommand {
public:
CurrentUrl(WebPageManager *, QStringList &arguments, QObject *parent = 0);
virtual void start();
-#if QT_VERSION < QT_VERSION_CHECK(4, 8, 0)
-
- private:
- bool wasRegularLoad();
- bool wasRedirectedAndNotModifiedByJavascript();
-#endif
};
View
1 src/WebPage.cpp
@@ -34,7 +34,6 @@ WebPage::WebPage(WebPageManager *manager, QObject *parent) : QWebPage(parent) {
resetWindowSize();
settings()->setAttribute(QWebSettings::JavascriptCanOpenWindows, true);
- currentFrame()->setUrl(QUrl("about:blank"));
}
void WebPage::resetWindowSize() {

0 comments on commit c3eb16b

Please sign in to comment.
Something went wrong with that request. Please try again.