Merge lp:~osomon/webbrowser-app/unsimplify-url-on-focus into lp:webbrowser-app

Proposed by Olivier Tilloy
Status: Merged
Approved by: Michael Sheldon
Approved revision: 1085
Merged at revision: 1086
Proposed branch: lp:~osomon/webbrowser-app/unsimplify-url-on-focus
Merge into: lp:webbrowser-app
Diff against target: 61 lines (+18/-12)
2 files modified
src/app/webbrowser/AddressBar.qml (+16/-12)
tests/unittests/qml/tst_AddressBar.qml (+2/-0)
To merge this branch: bzr merge lp:~osomon/webbrowser-app/unsimplify-url-on-focus
Reviewer Review Type Date Requested Status
Michael Sheldon (community) Approve
PS Jenkins bot continuous-integration Needs Fixing
Review via email: mp+264019@code.launchpad.net

Commit message

Display the full URL when focusing the address bar.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Michael Sheldon (michael-sheldon) wrote :

Looks good, approved :)

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/app/webbrowser/AddressBar.qml'
2--- src/app/webbrowser/AddressBar.qml 2015-06-19 17:32:38 +0000
3+++ src/app/webbrowser/AddressBar.qml 2015-07-07 10:16:27 +0000
4@@ -300,28 +300,32 @@
5 }
6 }
7
8- function updateUrlFromFocus() {
9- if (canSimplifyText) {
10- if (addressbar.activeFocus) {
11- text = actualUrl
12- } else if (!loading && actualUrl.toString()) {
13- text = internal.simplifyUrl(actualUrl)
14- }
15+ // has the URL in the address bar been simplified?
16+ property bool simplified: false
17+ }
18+
19+ onCanSimplifyTextChanged: {
20+ if (canSimplifyText) {
21+ if (!loading && actualUrl.toString()) {
22+ text = internal.simplifyUrl(actualUrl)
23+ internal.simplified = true
24 }
25+ } else if (internal.simplified) {
26+ text = actualUrl
27+ internal.simplified = false
28 }
29 }
30
31- onActiveFocusChanged: internal.updateUrlFromFocus()
32- onCanSimplifyTextChanged: internal.updateUrlFromFocus()
33-
34 onActualUrlChanged: {
35- if (!activeFocus || !actualUrl.toString()) {
36+ if (canSimplifyText || !actualUrl.toString()) {
37 text = internal.simplifyUrl(actualUrl)
38+ internal.simplified = true
39 }
40 }
41 onRequestedUrlChanged: {
42- if (!activeFocus) {
43+ if (canSimplifyText) {
44 text = internal.simplifyUrl(requestedUrl)
45+ internal.simplified = true
46 }
47 }
48
49
50=== modified file 'tests/unittests/qml/tst_AddressBar.qml'
51--- tests/unittests/qml/tst_AddressBar.qml 2015-05-18 13:53:05 +0000
52+++ tests/unittests/qml/tst_AddressBar.qml 2015-07-07 10:16:27 +0000
53@@ -39,6 +39,8 @@
54 height: parent.height / 2
55
56 searchUrl: "http://www.ubuntu.com/search?q={searchTerms}"
57+
58+ canSimplifyText: !activeFocus
59 }
60
61 // only exists to steal focus from the address bar

Subscribers

People subscribed via source and target branches

to status/vote changes: