~gerboland/unity-2d/unity-core5-change-fix

« back to all changes in this revision

Viewing changes to places/dash.qml

  • Committer: Florian Boucault
  • Date: 2011-12-06 20:58:25 UTC
  • mto: This revision was merged to the branch mainline in revision 822.
  • Revision ID: florian@boucault.net-20111206205825-7vhtth76q1vvfj8k
[dash] Do not unload the current page when exiting it. That does not change
the user experience at all and improves the speed at which the dash opens
up in a number of cases.

Reference: https://bugs.launchpad.net/unity-2d/+bug/881756

The workarounds crashers in the code removed by this change were still valid.

Show diffs side-by-side

added added

removed removed

Lines of Context:
50
50
            DashDeclarativeView.DesktopMode : DashDeclarativeView.FullScreenMode
51
51
    }
52
52
 
53
 
    /* Unload the current page when closing the dash */
54
 
    Connections {
55
 
        target: dashView
56
 
        onActiveChanged: {
57
 
            if (!dashView.active) {
58
 
                /* FIXME: currentPage needs to stop pointing to pageLoader.item
59
 
                          that is about to be invalidated otherwise a crash
60
 
                          occurs because SearchEntry has a binding that refers
61
 
                          to currentPage and tries to access it.
62
 
                   Ref.: https://bugs.launchpad.net/ubuntu/+source/unity-2d/+bug/817896
63
 
                         https://bugreports.qt.nokia.com/browse/QTBUG-20692
64
 
                */
65
 
                deactivateActiveLens()
66
 
                currentPage = undefined
67
 
                // Delay the following instruction by 1 millisecond using a
68
 
                // timer. This is enough to work around a crash that happens
69
 
                // when the layout is mirrored (RTL locales). See QTBUG-22776
70
 
                // for details.
71
 
                //pageLoader.source = ""
72
 
                delayPageLoaderReset.restart()
73
 
            }
74
 
        }
75
 
    }
76
 
    Timer {
77
 
        id: delayPageLoaderReset
78
 
        interval: 1
79
 
        onTriggered: pageLoader.source = ""
80
 
    }
81
 
 
82
53
    function activatePage(page) {
83
54
        /* Always give the focus to the search entry when switching pages */
84
55
        search_entry.focus = true