Skip to content
Permalink
Browse files
[Qt] Fix build for WK2, do not use enum type if values can be outside…
… the enum

https://bugs.webkit.org/show_bug.cgi?id=79800

Reviewed by Csaba Osztrogonác.

We have two different enums called NavigationRequestAction. If we use one of them
to store the variables, compilers can rightfully warn about comparison with
values from other enums.

We might revisit the strategy of exposing different enumerations in experimental,
but for now, fallback to using int for the 'action' property in
QWebNavigationRequest.

* UIProcess/API/qt/qwebnavigationrequest.cpp:
(QWebNavigationRequestPrivate):
(QWebNavigationRequest::setAction):
(QWebNavigationRequest::action):
* UIProcess/API/qt/qwebnavigationrequest_p.h:
* UIProcess/API/qt/tests/publicapi/tst_publicapi.cpp:

Canonical link: https://commits.webkit.org/96874@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@109113 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
Caio Marcelo de Oliveira Filho committed Feb 28, 2012
1 parent d0156ed commit 52e8e708438971ceb3ba25e9eb8cdfdfb630cbe6
@@ -1,3 +1,25 @@
2012-02-28 Caio Marcelo de Oliveira Filho <caio.oliveira@openbossa.org>

[Qt] Fix build for WK2, do not use enum type if values can be outside the enum
https://bugs.webkit.org/show_bug.cgi?id=79800

Reviewed by Csaba Osztrogonác.

We have two different enums called NavigationRequestAction. If we use one of them
to store the variables, compilers can rightfully warn about comparison with
values from other enums.

We might revisit the strategy of exposing different enumerations in experimental,
but for now, fallback to using int for the 'action' property in
QWebNavigationRequest.

* UIProcess/API/qt/qwebnavigationrequest.cpp:
(QWebNavigationRequestPrivate):
(QWebNavigationRequest::setAction):
(QWebNavigationRequest::action):
* UIProcess/API/qt/qwebnavigationrequest_p.h:
* UIProcess/API/qt/tests/publicapi/tst_publicapi.cpp:

2012-02-27 Caio Marcelo de Oliveira Filho <caio.oliveira@openbossa.org>

[Qt] API changes to QWebNavigationRequest
@@ -41,7 +41,7 @@ class QWebNavigationRequestPrivate {
QUrl url;
Qt::MouseButton mouseButton;
Qt::KeyboardModifiers keyboardModifiers;
QQuickWebView::NavigationRequestAction action;
int action;
QQuickWebView::NavigationType navigationType;
};

@@ -56,7 +56,7 @@ QWebNavigationRequest::~QWebNavigationRequest()
delete d;
}

void QWebNavigationRequest::setAction(QQuickWebView::NavigationRequestAction action)
void QWebNavigationRequest::setAction(int action)
{
if (d->action == action)
return;
@@ -80,7 +80,7 @@ int QWebNavigationRequest::keyboardModifiers() const
return int(d->keyboardModifiers);
}

QQuickWebView::NavigationRequestAction QWebNavigationRequest::action() const
int QWebNavigationRequest::action() const
{
return d->action;
}
@@ -33,7 +33,7 @@ class QWEBKIT_EXPORT QWebNavigationRequest : public QObject {
Q_PROPERTY(QUrl url READ url CONSTANT FINAL)
Q_PROPERTY(int mouseButton READ mouseButton CONSTANT FINAL)
Q_PROPERTY(int keyboardModifiers READ keyboardModifiers CONSTANT FINAL)
Q_PROPERTY(QQuickWebView::NavigationRequestAction action READ action WRITE setAction NOTIFY actionChanged FINAL)
Q_PROPERTY(int action READ action WRITE setAction NOTIFY actionChanged FINAL)
Q_PROPERTY(QQuickWebView::NavigationType navigationType READ navigationType CONSTANT FINAL)

public:
@@ -43,9 +43,9 @@ class QWEBKIT_EXPORT QWebNavigationRequest : public QObject {
QUrl url() const;
int mouseButton() const;
int keyboardModifiers() const;
QQuickWebView::NavigationRequestAction action() const;
int action() const;

void setAction(QQuickWebView::NavigationRequestAction action);
void setAction(int action);
QQuickWebView::NavigationType navigationType() const;

Q_SIGNALS:
@@ -85,7 +85,7 @@ static QStringList expectedAPI = QStringList()
<< "QWebNavigationRequest.url --> QUrl"
<< "QWebNavigationRequest.mouseButton --> int"
<< "QWebNavigationRequest.keyboardModifiers --> int"
<< "QWebNavigationRequest.action --> QQuickWebView::NavigationRequestAction"
<< "QWebNavigationRequest.action --> int"
<< "QWebNavigationRequest.navigationType --> QQuickWebView::NavigationType"
<< "QWebNavigationRequest.actionChanged() --> void"
;

0 comments on commit 52e8e70

Please sign in to comment.