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
1=== modified file 'debian/control'
2--- debian/control 2016-11-03 16:35:23 +0000
3+++ debian/control 2016-12-19 16:45:04 +0000
4@@ -45,7 +45,7 @@
5 Depends: ${misc:Depends},
6 ${shlibs:Depends},
7 fonts-liberation,
8- liboxideqt-qmlplugin (>= 1.17),
9+ liboxideqt-qmlplugin (>= 1.19),
10 libqt5sql5-sqlite,
11 qml-module-qt-labs-folderlistmodel,
12 qml-module-qt-labs-settings,
13@@ -72,7 +72,7 @@
14 Depends: ${misc:Depends},
15 ${shlibs:Depends},
16 fonts-liberation,
17- liboxideqt-qmlplugin (>= 1.17),
18+ liboxideqt-qmlplugin (>= 1.19),
19 libqt5sql5-sqlite,
20 qml-module-qtquick2 (>= 5.4),
21 qml-module-qtquick-window2 (>= 5.3),
22
23=== modified file 'doc/WebView.qdoc'
24--- doc/WebView.qdoc 2015-08-25 14:40:37 +0000
25+++ doc/WebView.qdoc 2016-12-19 16:45:04 +0000
26@@ -1,5 +1,5 @@
27 /*
28- * Copyright 2014-2015 Canonical Ltd.
29+ * Copyright 2014-2016 Canonical Ltd.
30 *
31 * This file is part of webbrowser-app.
32 *
33@@ -59,16 +59,22 @@
34
35 /*!
36 \qmlproperty bool WebView::canGoBack
37+ \deprecated
38
39 Whether the navigation history has a previous entry to navigate back.
40+ This is now deprecated.
41+ Use WebView::navigationHistory::canGoBack instead.
42
43 \sa goBack, canGoForward
44 */
45
46 /*!
47 \qmlproperty bool WebView::canGoForward
48+ \deprecated
49
50 Whether the navigation history has a next entry to navigate forward.
51+ This is now deprecated.
52+ Use WebView::navigationHistory::canGoForward instead.
53
54 \sa goForward, canGoBack
55 */
56@@ -255,16 +261,22 @@
57
58 /*!
59 \qmlmethod void WebView::goBack()
60+ \deprecated
61
62 Go back one entry in the navigation history.
63+ This is now deprecated.
64+ Use WebView::navigationHistory::goBack instead.
65
66 \sa canGoBack, goForward
67 */
68
69 /*!
70 \qmlmethod void WebView::goForward()
71+ \deprecated
72
73 Go forward one entry in the navigation history.
74+ This is now deprecated.
75+ Use WebView::navigationHistory::goForward instead.
76
77 \sa canGoForward, goBack
78 */
79
80=== modified file 'src/app/webbrowser/Browser.qml'
81--- src/app/webbrowser/Browser.qml 2016-11-24 16:02:05 +0000
82+++ src/app/webbrowser/Browser.qml 2016-12-19 16:45:04 +0000
83@@ -19,7 +19,7 @@
84 import QtQuick 2.4
85 import QtQuick.Window 2.2
86 import Qt.labs.settings 1.0
87-import com.canonical.Oxide 1.15 as Oxide
88+import com.canonical.Oxide 1.19 as Oxide
89 import Ubuntu.Components 1.3
90 import Ubuntu.Components.Popups 1.3
91 import Ubuntu.Web 0.2
92@@ -141,12 +141,12 @@
93 onTriggered: currentWebview.url = value
94 },
95 Actions.Back {
96- enabled: currentWebview ? currentWebview.canGoBack : false
97- onTriggered: currentWebview.goBack()
98+ enabled: currentWebview ? currentWebview.navigationHistory.canGoBack : false
99+ onTriggered: currentWebview.navigationHistory.goBack()
100 },
101 Actions.Forward {
102- enabled: currentWebview ? currentWebview.canGoForward : false
103- onTriggered: currentWebview.goForward()
104+ enabled: currentWebview ? currentWebview.navigationHistory.canGoForward : false
105+ onTriggered: currentWebview.navigationHistory.goForward()
106 },
107 Actions.Reload {
108 enabled: currentWebview
109@@ -1173,16 +1173,16 @@
110 }
111
112 function historyGoBack() {
113- if (currentWebview && currentWebview.canGoBack) {
114+ if (currentWebview && currentWebview.navigationHistory.canGoBack) {
115 internal.resetFocus()
116- currentWebview.goBack()
117+ currentWebview.navigationHistory.goBack()
118 }
119 }
120
121 function historyGoForward() {
122- if (currentWebview && currentWebview.canGoForward) {
123+ if (currentWebview && currentWebview.navigationHistory.canGoForward) {
124 internal.resetFocus()
125- currentWebview.goForward()
126+ currentWebview.navigationHistory.goForward()
127 }
128 }
129
130
131=== modified file 'src/app/webbrowser/NavigationBar.qml'
132--- src/app/webbrowser/NavigationBar.qml 2016-09-28 07:51:22 +0000
133+++ src/app/webbrowser/NavigationBar.qml 2016-12-19 16:45:04 +0000
134@@ -73,8 +73,8 @@
135 verticalCenter: parent.verticalCenter
136 }
137
138- enabled: findInPageMode || (internal.webview ? internal.webview.canGoBack : false)
139- onTriggered: findInPageMode ? (findInPageMode = false) : internal.webview.goBack()
140+ enabled: findInPageMode || (internal.webview ? internal.webview.navigationHistory.canGoBack : false)
141+ onTriggered: findInPageMode ? (findInPageMode = false) : internal.webview.navigationHistory.goBack()
142 }
143
144 ChromeButton {
145@@ -95,8 +95,8 @@
146 }
147
148 enabled: findInPageMode ? false :
149- (internal.webview ? internal.webview.canGoForward : false)
150- onTriggered: internal.webview.goForward()
151+ (internal.webview ? internal.webview.navigationHistory.canGoForward : false)
152+ onTriggered: internal.webview.navigationHistory.goForward()
153 }
154
155 AddressBar {
156
157=== modified file 'src/app/webcontainer/Chrome.qml'
158--- src/app/webcontainer/Chrome.qml 2016-10-14 21:30:17 +0000
159+++ src/app/webcontainer/Chrome.qml 2016-12-19 16:45:04 +0000
160@@ -1,5 +1,5 @@
161 /*
162- * Copyright 2013-2015 Canonical Ltd.
163+ * Copyright 2013-2016 Canonical Ltd.
164 *
165 * This file is part of webbrowser-app.
166 *
167@@ -66,8 +66,8 @@
168 verticalCenter: parent.verticalCenter
169 }
170
171- enabled: chrome.webview ? chrome.webview.canGoBack : false
172- onTriggered: chrome.webview.goBack()
173+ enabled: chrome.webview ? chrome.webview.navigationHistory.canGoBack : false
174+ onTriggered: chrome.webview.navigationHistory.goBack()
175 }
176
177 ChromeButton {
178@@ -86,8 +86,8 @@
179 verticalCenter: parent.verticalCenter
180 }
181
182- enabled: chrome.webview ? chrome.webview.canGoForward : false
183- onTriggered: chrome.webview.goForward()
184+ enabled: chrome.webview ? chrome.webview.navigationHistory.canGoForward : false
185+ onTriggered: chrome.webview.navigationHistory.goForward()
186 }
187
188 Item {
189
190=== modified file 'src/app/webcontainer/WebApp.qml'
191--- src/app/webcontainer/WebApp.qml 2016-10-07 11:47:05 +0000
192+++ src/app/webcontainer/WebApp.qml 2016-12-19 16:45:04 +0000
193@@ -18,7 +18,7 @@
194
195 import QtQuick 2.4
196 import webbrowsercommon.private 0.1
197-import com.canonical.Oxide 1.5 as Oxide
198+import com.canonical.Oxide 1.19 as Oxide
199 import Ubuntu.Components 1.3
200 import Ubuntu.Unity.Action 1.1 as UnityActions
201 import Ubuntu.UnityWebApps 0.1 as UnityWebApps
202@@ -69,12 +69,16 @@
203
204 actions: [
205 Actions.Back {
206- enabled: webapp.backForwardButtonsVisible && containerWebView.currentWebview && containerWebView.currentWebview.canGoBack
207- onTriggered: containerWebView.currentWebview.goBack()
208+ enabled: webapp.backForwardButtonsVisible &&
209+ containerWebView.currentWebview &&
210+ containerWebView.currentWebview.navigationHistory.canGoBack
211+ onTriggered: containerWebView.currentWebview.navigationHistory.goBack()
212 },
213 Actions.Forward {
214- enabled: webapp.backForwardButtonsVisible && containerWebView.currentWebview && containerWebView.currentWebview.canGoForward
215- onTriggered: containerWebView.currentWebview.goForward()
216+ enabled: webapp.backForwardButtonsVisible &&
217+ containerWebView.currentWebview &&
218+ containerWebView.currentWebview.navigationHistory.canGoForward
219+ onTriggered: containerWebView.currentWebview.navigationHistory.goForward()
220 },
221 Actions.Reload {
222 onTriggered: containerWebView.currentWebview.reload()
223@@ -310,14 +314,14 @@
224 // Alt+← or Backspace: Goes to the previous page
225 Shortcut {
226 sequence: StandardKey.Back
227- enabled: currentWebview && currentWebview.canGoBack
228- onActivated: currentWebview.goBack()
229+ enabled: currentWebview && currentWebview.navigationHistory.canGoBack
230+ onActivated: currentWebview.navigationHistory.goBack()
231 }
232
233 // Alt+→ or Shift+Backspace: Goes to the next page
234 Shortcut {
235 sequence: StandardKey.Forward
236- enabled: currentWebview && currentWebview.canGoForward
237- onActivated: currentWebview.goForward()
238+ enabled: currentWebview && currentWebview.navigationHistory.canGoForward
239+ onActivated: currentWebview.navigationHistory.goForward()
240 }
241 }

Subscribers

People subscribed via source and target branches