Merge lp:~osomon/webbrowser-app/stop-using-deprecated-navigation-apis into lp:webbrowser-app/staging

Proposed by Olivier Tilloy
Status: Merged
Merged at revision: 1588
Proposed branch: lp:~osomon/webbrowser-app/stop-using-deprecated-navigation-apis
Merge into: lp:webbrowser-app/staging
Diff against target: 241 lines (+46/-30)
6 files modified
debian/control (+2/-2)
doc/WebView.qdoc (+13/-1)
src/app/webbrowser/Browser.qml (+9/-9)
src/app/webbrowser/NavigationBar.qml (+4/-4)
src/app/webcontainer/Chrome.qml (+5/-5)
src/app/webcontainer/WebApp.qml (+13/-9)
To merge this branch: bzr merge lp:~osomon/webbrowser-app/stop-using-deprecated-navigation-apis
Reviewer Review Type Date Requested Status
Andrew Hayzen (community) Approve
Review via email: mp+313550@code.launchpad.net

Commit message

Stop using deprecated WebView APIs.

To post a comment you must log in.
Revision history for this message
Andrew Hayzen (ahayzen) wrote :

LGTM, both webbrowser and webapp-container enable/disable the forward/back buttons correctly and the buttons function correctly.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'debian/control'
--- debian/control 2016-11-03 16:35:23 +0000
+++ debian/control 2016-12-19 16:45:04 +0000
@@ -45,7 +45,7 @@
45Depends: ${misc:Depends},45Depends: ${misc:Depends},
46 ${shlibs:Depends},46 ${shlibs:Depends},
47 fonts-liberation,47 fonts-liberation,
48 liboxideqt-qmlplugin (>= 1.17),48 liboxideqt-qmlplugin (>= 1.19),
49 libqt5sql5-sqlite,49 libqt5sql5-sqlite,
50 qml-module-qt-labs-folderlistmodel,50 qml-module-qt-labs-folderlistmodel,
51 qml-module-qt-labs-settings,51 qml-module-qt-labs-settings,
@@ -72,7 +72,7 @@
72Depends: ${misc:Depends},72Depends: ${misc:Depends},
73 ${shlibs:Depends},73 ${shlibs:Depends},
74 fonts-liberation,74 fonts-liberation,
75 liboxideqt-qmlplugin (>= 1.17),75 liboxideqt-qmlplugin (>= 1.19),
76 libqt5sql5-sqlite,76 libqt5sql5-sqlite,
77 qml-module-qtquick2 (>= 5.4),77 qml-module-qtquick2 (>= 5.4),
78 qml-module-qtquick-window2 (>= 5.3),78 qml-module-qtquick-window2 (>= 5.3),
7979
=== modified file 'doc/WebView.qdoc'
--- doc/WebView.qdoc 2015-08-25 14:40:37 +0000
+++ doc/WebView.qdoc 2016-12-19 16:45:04 +0000
@@ -1,5 +1,5 @@
1/*1/*
2 * Copyright 2014-2015 Canonical Ltd.2 * Copyright 2014-2016 Canonical Ltd.
3 *3 *
4 * This file is part of webbrowser-app.4 * This file is part of webbrowser-app.
5 *5 *
@@ -59,16 +59,22 @@
5959
60/*!60/*!
61 \qmlproperty bool WebView::canGoBack61 \qmlproperty bool WebView::canGoBack
62 \deprecated
6263
63 Whether the navigation history has a previous entry to navigate back.64 Whether the navigation history has a previous entry to navigate back.
65 This is now deprecated.
66 Use WebView::navigationHistory::canGoBack instead.
6467
65 \sa goBack, canGoForward68 \sa goBack, canGoForward
66 */69 */
6770
68/*!71/*!
69 \qmlproperty bool WebView::canGoForward72 \qmlproperty bool WebView::canGoForward
73 \deprecated
7074
71 Whether the navigation history has a next entry to navigate forward.75 Whether the navigation history has a next entry to navigate forward.
76 This is now deprecated.
77 Use WebView::navigationHistory::canGoForward instead.
7278
73 \sa goForward, canGoBack79 \sa goForward, canGoBack
74 */80 */
@@ -255,16 +261,22 @@
255261
256/*!262/*!
257 \qmlmethod void WebView::goBack()263 \qmlmethod void WebView::goBack()
264 \deprecated
258265
259 Go back one entry in the navigation history.266 Go back one entry in the navigation history.
267 This is now deprecated.
268 Use WebView::navigationHistory::goBack instead.
260269
261 \sa canGoBack, goForward270 \sa canGoBack, goForward
262 */271 */
263272
264/*!273/*!
265 \qmlmethod void WebView::goForward()274 \qmlmethod void WebView::goForward()
275 \deprecated
266276
267 Go forward one entry in the navigation history.277 Go forward one entry in the navigation history.
278 This is now deprecated.
279 Use WebView::navigationHistory::goForward instead.
268280
269 \sa canGoForward, goBack281 \sa canGoForward, goBack
270 */282 */
271283
=== modified file 'src/app/webbrowser/Browser.qml'
--- src/app/webbrowser/Browser.qml 2016-11-24 16:02:05 +0000
+++ src/app/webbrowser/Browser.qml 2016-12-19 16:45:04 +0000
@@ -19,7 +19,7 @@
19import QtQuick 2.419import QtQuick 2.4
20import QtQuick.Window 2.220import QtQuick.Window 2.2
21import Qt.labs.settings 1.021import Qt.labs.settings 1.0
22import com.canonical.Oxide 1.15 as Oxide22import com.canonical.Oxide 1.19 as Oxide
23import Ubuntu.Components 1.323import Ubuntu.Components 1.3
24import Ubuntu.Components.Popups 1.324import Ubuntu.Components.Popups 1.3
25import Ubuntu.Web 0.225import Ubuntu.Web 0.2
@@ -141,12 +141,12 @@
141 onTriggered: currentWebview.url = value141 onTriggered: currentWebview.url = value
142 },142 },
143 Actions.Back {143 Actions.Back {
144 enabled: currentWebview ? currentWebview.canGoBack : false144 enabled: currentWebview ? currentWebview.navigationHistory.canGoBack : false
145 onTriggered: currentWebview.goBack()145 onTriggered: currentWebview.navigationHistory.goBack()
146 },146 },
147 Actions.Forward {147 Actions.Forward {
148 enabled: currentWebview ? currentWebview.canGoForward : false148 enabled: currentWebview ? currentWebview.navigationHistory.canGoForward : false
149 onTriggered: currentWebview.goForward()149 onTriggered: currentWebview.navigationHistory.goForward()
150 },150 },
151 Actions.Reload {151 Actions.Reload {
152 enabled: currentWebview152 enabled: currentWebview
@@ -1173,16 +1173,16 @@
1173 }1173 }
11741174
1175 function historyGoBack() {1175 function historyGoBack() {
1176 if (currentWebview && currentWebview.canGoBack) {1176 if (currentWebview && currentWebview.navigationHistory.canGoBack) {
1177 internal.resetFocus()1177 internal.resetFocus()
1178 currentWebview.goBack()1178 currentWebview.navigationHistory.goBack()
1179 }1179 }
1180 }1180 }
11811181
1182 function historyGoForward() {1182 function historyGoForward() {
1183 if (currentWebview && currentWebview.canGoForward) {1183 if (currentWebview && currentWebview.navigationHistory.canGoForward) {
1184 internal.resetFocus()1184 internal.resetFocus()
1185 currentWebview.goForward()1185 currentWebview.navigationHistory.goForward()
1186 }1186 }
1187 }1187 }
11881188
11891189
=== modified file 'src/app/webbrowser/NavigationBar.qml'
--- src/app/webbrowser/NavigationBar.qml 2016-09-28 07:51:22 +0000
+++ src/app/webbrowser/NavigationBar.qml 2016-12-19 16:45:04 +0000
@@ -73,8 +73,8 @@
73 verticalCenter: parent.verticalCenter73 verticalCenter: parent.verticalCenter
74 }74 }
7575
76 enabled: findInPageMode || (internal.webview ? internal.webview.canGoBack : false)76 enabled: findInPageMode || (internal.webview ? internal.webview.navigationHistory.canGoBack : false)
77 onTriggered: findInPageMode ? (findInPageMode = false) : internal.webview.goBack()77 onTriggered: findInPageMode ? (findInPageMode = false) : internal.webview.navigationHistory.goBack()
78 }78 }
7979
80 ChromeButton {80 ChromeButton {
@@ -95,8 +95,8 @@
95 }95 }
9696
97 enabled: findInPageMode ? false :97 enabled: findInPageMode ? false :
98 (internal.webview ? internal.webview.canGoForward : false)98 (internal.webview ? internal.webview.navigationHistory.canGoForward : false)
99 onTriggered: internal.webview.goForward()99 onTriggered: internal.webview.navigationHistory.goForward()
100 }100 }
101101
102 AddressBar {102 AddressBar {
103103
=== modified file 'src/app/webcontainer/Chrome.qml'
--- src/app/webcontainer/Chrome.qml 2016-10-14 21:30:17 +0000
+++ src/app/webcontainer/Chrome.qml 2016-12-19 16:45:04 +0000
@@ -1,5 +1,5 @@
1/*1/*
2 * Copyright 2013-2015 Canonical Ltd.2 * Copyright 2013-2016 Canonical Ltd.
3 *3 *
4 * This file is part of webbrowser-app.4 * This file is part of webbrowser-app.
5 *5 *
@@ -66,8 +66,8 @@
66 verticalCenter: parent.verticalCenter66 verticalCenter: parent.verticalCenter
67 }67 }
6868
69 enabled: chrome.webview ? chrome.webview.canGoBack : false69 enabled: chrome.webview ? chrome.webview.navigationHistory.canGoBack : false
70 onTriggered: chrome.webview.goBack()70 onTriggered: chrome.webview.navigationHistory.goBack()
71 }71 }
7272
73 ChromeButton {73 ChromeButton {
@@ -86,8 +86,8 @@
86 verticalCenter: parent.verticalCenter86 verticalCenter: parent.verticalCenter
87 }87 }
8888
89 enabled: chrome.webview ? chrome.webview.canGoForward : false89 enabled: chrome.webview ? chrome.webview.navigationHistory.canGoForward : false
90 onTriggered: chrome.webview.goForward()90 onTriggered: chrome.webview.navigationHistory.goForward()
91 }91 }
9292
93 Item {93 Item {
9494
=== modified file 'src/app/webcontainer/WebApp.qml'
--- src/app/webcontainer/WebApp.qml 2016-10-07 11:47:05 +0000
+++ src/app/webcontainer/WebApp.qml 2016-12-19 16:45:04 +0000
@@ -18,7 +18,7 @@
1818
19import QtQuick 2.419import QtQuick 2.4
20import webbrowsercommon.private 0.120import webbrowsercommon.private 0.1
21import com.canonical.Oxide 1.5 as Oxide21import com.canonical.Oxide 1.19 as Oxide
22import Ubuntu.Components 1.322import Ubuntu.Components 1.3
23import Ubuntu.Unity.Action 1.1 as UnityActions23import Ubuntu.Unity.Action 1.1 as UnityActions
24import Ubuntu.UnityWebApps 0.1 as UnityWebApps24import Ubuntu.UnityWebApps 0.1 as UnityWebApps
@@ -69,12 +69,16 @@
6969
70 actions: [70 actions: [
71 Actions.Back {71 Actions.Back {
72 enabled: webapp.backForwardButtonsVisible && containerWebView.currentWebview && containerWebView.currentWebview.canGoBack72 enabled: webapp.backForwardButtonsVisible &&
73 onTriggered: containerWebView.currentWebview.goBack()73 containerWebView.currentWebview &&
74 containerWebView.currentWebview.navigationHistory.canGoBack
75 onTriggered: containerWebView.currentWebview.navigationHistory.goBack()
74 },76 },
75 Actions.Forward {77 Actions.Forward {
76 enabled: webapp.backForwardButtonsVisible && containerWebView.currentWebview && containerWebView.currentWebview.canGoForward78 enabled: webapp.backForwardButtonsVisible &&
77 onTriggered: containerWebView.currentWebview.goForward()79 containerWebView.currentWebview &&
80 containerWebView.currentWebview.navigationHistory.canGoForward
81 onTriggered: containerWebView.currentWebview.navigationHistory.goForward()
78 },82 },
79 Actions.Reload {83 Actions.Reload {
80 onTriggered: containerWebView.currentWebview.reload()84 onTriggered: containerWebView.currentWebview.reload()
@@ -310,14 +314,14 @@
310 // Alt+← or Backspace: Goes to the previous page314 // Alt+← or Backspace: Goes to the previous page
311 Shortcut {315 Shortcut {
312 sequence: StandardKey.Back316 sequence: StandardKey.Back
313 enabled: currentWebview && currentWebview.canGoBack317 enabled: currentWebview && currentWebview.navigationHistory.canGoBack
314 onActivated: currentWebview.goBack()318 onActivated: currentWebview.navigationHistory.goBack()
315 }319 }
316320
317 // Alt+→ or Shift+Backspace: Goes to the next page321 // Alt+→ or Shift+Backspace: Goes to the next page
318 Shortcut {322 Shortcut {
319 sequence: StandardKey.Forward323 sequence: StandardKey.Forward
320 enabled: currentWebview && currentWebview.canGoForward324 enabled: currentWebview && currentWebview.navigationHistory.canGoForward
321 onActivated: currentWebview.goForward()325 onActivated: currentWebview.navigationHistory.goForward()
322 }326 }
323}327}

Subscribers

People subscribed via source and target branches