Merge lp:~marcustomlinson/unity-scopes-shell/fix_scope_install_crash into lp:unity-scopes-shell

Proposed by Marcus Tomlinson
Status: Merged
Approved by: Paweł Stołowski
Approved revision: 155
Merged at revision: 156
Proposed branch: lp:~marcustomlinson/unity-scopes-shell/fix_scope_install_crash
Merge into: lp:unity-scopes-shell
Diff against target: 29 lines (+5/-1)
1 file modified
src/Unity/scopes.cpp (+5/-1)
To merge this branch: bzr merge lp:~marcustomlinson/unity-scopes-shell/fix_scope_install_crash
Reviewer Review Type Date Requested Status
Paweł Stołowski (community) Approve
Review via email: mp+236919@code.launchpad.net

Commit message

Use refreshScopeMetadata() rather than populateScopes() when invalidating results (populateScopes() is intended for use only on start-up)

To post a comment you must log in.
154. By Marcus Tomlinson

Added warning comment about populateScopes()

155. By Marcus Tomlinson

Merged trunk and resolved conflict

Revision history for this message
Paweł Stołowski (stolowski) wrote :

Looks good and fixes the crash, thanks!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/Unity/scopes.cpp'
2--- src/Unity/scopes.cpp 2014-10-02 07:18:12 +0000
3+++ src/Unity/scopes.cpp 2014-10-02 15:47:39 +0000
4@@ -235,6 +235,8 @@
5 QTimer::singleShot(LIST_DELAY, this, SLOT(populateScopes()));
6 }
7
8+// *N.B.* populateScopes() is intended for use only on start-up!
9+// In any other circumstance, use refreshScopeMetadata() to invalidate results.
10 void Scopes::populateScopes()
11 {
12 auto thread = new ScopeListWorker;
13@@ -439,6 +441,8 @@
14 m_cachedMetadata[QString::fromStdString(it->first)] = std::make_shared<unity::scopes::ScopeMetadata>(it->second);
15 }
16
17+ processFavoriteScopes();
18+
19 Q_EMIT metadataRefreshed();
20
21 m_listThread = nullptr;
22@@ -457,7 +461,7 @@
23 scope->invalidateResults();
24 }
25 } else if (scopeName == "scopes") {
26- populateScopes();
27+ refreshScopeMetadata();
28 return;
29 }
30

Subscribers

People subscribed via source and target branches

to all changes: