on xenial help sign in
Fix fuzzily defined root and other reference problems
commit101c302abfe788ad0f54714e388d7522430413da authorDalton Durst <me@daltondurst.com> dateFri 20 Jul 2018, 12:31 (8 years ago) parent79dab12
5 files changed+17−16
qml/Wizard/Components/InputMethod.qml+9−9 qml/Wizard/Pages.qml+3−4 qml/Wizard/Pages/78-app-update.qml+2 qml/Wizard/Pages/DownloadHandler.qml+1−1 qml/Wizard/Wizard.qml+2−2
qml/Wizard/Components/InputMethod.qml+9−9
@@ -21,19 +21,19 @@ import Ubuntu.Components 0.1
2121// TODO: try to share this code with that from the unity8 shell
2222
2323Item {
24− id: root
24+ id: inputMethodRoot
2525
2626 Connections {
2727 target: SurfaceManager
2828 onSurfaceCreated: {
2929 if (surface.type == MirSurfaceItem.InputMethod) {
30− root.surface = surface;
30+ inputMethodRoot.surface = surface;
3131 }
3232 }
3333
3434 onSurfaceDestroyed: {
35− if (root.surface == surface) {
36− root.surface = null;
35+ if (inputMethodRoot.surface == surface) {
36+ inputMethodRoot.surface = null;
3737 surface.parent = null;
3838 }
3939 if (!surface.parent) {
@@ -71,7 +71,7 @@ Item {
7171 visible: false
7272 // half-way down because the vkb occupies only the lower half of the surface
7373 // TODO: consider keyboard rotation
74− y: root.parent.height / 2.0
74+ y: inputMethodRoot.parent.height / 2.0
7575 }
7676 }
7777 ]
@@ -89,17 +89,17 @@ Item {
8989 ignoreUnknownSignals: true // don't wanna spam the log when surface is null
9090 onStateChanged: {
9191 if (state == MirSurfaceItem.Minimized) {
92− root.hide();
92+ inputMethodRoot.hide();
9393 } else if (state == MirSurfaceItem.Maximized) {
94− root.show();
94+ inputMethodRoot.show();
9595 }
9696 }
9797 }
9898
9999 onSurfaceChanged: {
100100 if (surface) {
101− surface.parent = root;
102− surface.anchors.fill = root;
101+ surface.parent = inputMethodRoot;
102+ surface.anchors.fill = inputMethodRoot;
103103 }
104104 }
105105
qml/Wizard/Pages.qml+3−4
@@ -165,12 +165,11 @@ StyledItem {
165165 /**
166166 * Determine if array contains item
167167 */
168− function itemInArrayInOtherArray(item, array) {
168+ function itemInArray(item, array) {
169169 return array.indexOf(item) >= 0;
170170 }
171171
172172 function checkSkip() {
173− console.warn("Evaluating skip on " + currentPage.objectName);
174173 if (!currentPage) { // may have had a parse error
175174 console.warn("Wizard page skipped due to possible parse error.");
176175 next();
@@ -178,11 +177,11 @@ StyledItem {
178177 if (currentPage.skip) {
179178 next();
180179 console.warn("Wizard page " + currentPage.objectName + " skipped on request");
181− } else if ( !(itemInArray(root.runningWizardVersion, currentPage.showOnVersions)) &&
180+ } else if ( !(itemInArray(wizard.runningWizardVersion, currentPage.showOnVersions)) &&
182181 (currentPage.showOnVersions.length > 0) ) {
183182 // The page is not supposed to run on this version of the wizard
184− console.warn("Wizard page " + currentPage.objectName + " skipped, it is not marked to run on this version.");
185183 next();
184+ console.warn("Wizard page " + currentPage.objectName + " skipped, it is not marked to run on this version.");
186185 } else {
187186 console.warn("Starting wizard page " + currentPage.objectName);
188187 currentPage.opacity = 1;
qml/Wizard/Pages/78-app-update.qml+2
@@ -43,6 +43,8 @@ LocalComponents.Page {
4343 property bool authenticated: UpdateManager.authenticated
4444 property bool forceCheck: false
4545
46+ showOnVersions: [1]
47+
4648 property int updatesCount: {
4749 var count = 0;
4850 if (authenticated) {
qml/Wizard/Pages/DownloadHandler.qml+1−1
@@ -20,7 +20,7 @@ import QtQuick 2.4
2020import Ubuntu.DownloadManager 1.2
2121
2222Item {
23− id: root
23+ id: downloadHandler
2424 property var updateModel
2525 property alias downloads: downloadManager.downloads
2626 property var udm: DownloadManager {
qml/Wizard/Wizard.qml+2−2
@@ -20,7 +20,7 @@ import Wizard 0.1
2020import "../Components"
2121
2222Showable {
23− id: root
23+ id: wizard
2424
2525 // This is a bool instead of an alias because Loader classes like to emit
2626 // changed signals for 'active' during startup even if they aren't actually
@@ -54,7 +54,7 @@ Showable {
5454
5555 Connections {
5656 target: loader.item
57− onQuit: root.hide()
57+ onQuit: wizard.hide()
5858 }
5959 }
6060}