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
=== modified file 'src/Unity/scopes.cpp'
--- src/Unity/scopes.cpp 2014-10-02 07:18:12 +0000
+++ src/Unity/scopes.cpp 2014-10-02 15:47:39 +0000
@@ -235,6 +235,8 @@
235 QTimer::singleShot(LIST_DELAY, this, SLOT(populateScopes()));235 QTimer::singleShot(LIST_DELAY, this, SLOT(populateScopes()));
236}236}
237237
238// *N.B.* populateScopes() is intended for use only on start-up!
239// In any other circumstance, use refreshScopeMetadata() to invalidate results.
238void Scopes::populateScopes()240void Scopes::populateScopes()
239{241{
240 auto thread = new ScopeListWorker;242 auto thread = new ScopeListWorker;
@@ -439,6 +441,8 @@
439 m_cachedMetadata[QString::fromStdString(it->first)] = std::make_shared<unity::scopes::ScopeMetadata>(it->second);441 m_cachedMetadata[QString::fromStdString(it->first)] = std::make_shared<unity::scopes::ScopeMetadata>(it->second);
440 }442 }
441443
444 processFavoriteScopes();
445
442 Q_EMIT metadataRefreshed();446 Q_EMIT metadataRefreshed();
443447
444 m_listThread = nullptr;448 m_listThread = nullptr;
@@ -457,7 +461,7 @@
457 scope->invalidateResults();461 scope->invalidateResults();
458 }462 }
459 } else if (scopeName == "scopes") {463 } else if (scopeName == "scopes") {
460 populateScopes();464 refreshScopeMetadata();
461 return;465 return;
462 }466 }
463467

Subscribers

People subscribed via source and target branches

to all changes: