Merge lp:~stolowski/unity-scopes-shell/delay-registry-change-processing into lp:unity-scopes-shell

Proposed by Paweł Stołowski
Status: Merged
Approved by: Marcus Tomlinson
Approved revision: 228
Merged at revision: 229
Proposed branch: lp:~stolowski/unity-scopes-shell/delay-registry-change-processing
Merge into: lp:unity-scopes-shell
Diff against target: 62 lines (+16/-4)
2 files modified
src/Unity/scopes.cpp (+14/-4)
src/Unity/scopes.h (+2/-0)
To merge this branch: bzr merge lp:~stolowski/unity-scopes-shell/delay-registry-change-processing
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Needs Fixing
Marcus Tomlinson (community) Approve
Review via email: mp+263902@code.launchpad.net

Commit message

Cherry-picked the workaround for delayed processing of scoperegistry changes from RTM.

Description of the change

Cherry-picked the workaround for delayed processing of scoperegistry changes from RTM.

To post a comment you must log in.
Revision history for this message
Marcus Tomlinson (marcustomlinson) wrote :

Wow, looks a little simpler than the unity-scopes-api version of this fix! +1

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)

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 2015-02-25 14:27:06 +0000
3+++ src/Unity/scopes.cpp 2015-07-06 17:14:27 +0000
4@@ -125,6 +125,10 @@
5 }
6
7 m_overviewScope = OverviewScope::newInstance(this);
8+
9+ m_registryRefreshTimer.setSingleShot(true);
10+ connect(&m_registryRefreshTimer, SIGNAL(timeout()), this, SLOT(scopeRegistryChanged()));
11+
12 m_locationService.reset(new UbuntuLocationService());
13
14 createUserAgentString();
15@@ -549,10 +553,7 @@
16 invalidateScopeResults("videoaggregator");
17 } else if (scopeName == "scopes") {
18 // emitted when smart-scopes proxy or scope registry discovers new scopes
19- refreshScopeMetadata();
20- Q_FOREACH(Scope::Ptr scope, m_scopes) {
21- scope->invalidateResults();
22- }
23+ m_registryRefreshTimer.start(5000);
24 return;
25 }
26
27@@ -569,6 +570,15 @@
28 }
29 }
30
31+void Scopes::scopeRegistryChanged()
32+{
33+ qDebug() << "Refreshing scope metadata";
34+ refreshScopeMetadata();
35+ Q_FOREACH(Scope::Ptr scope, m_scopes) {
36+ scope->invalidateResults();
37+ }
38+}
39+
40 QVariant Scopes::data(const QModelIndex& index, int role) const
41 {
42 int row = index.row();
43
44=== modified file 'src/Unity/scopes.h'
45--- src/Unity/scopes.h 2015-02-25 14:16:45 +0000
46+++ src/Unity/scopes.h 2015-07-06 17:14:27 +0000
47@@ -102,6 +102,7 @@
48 void lsbReleaseFinished();
49 void completeDiscoveryFinished();
50 void purgeScopesToDelete();
51+ void scopeRegistryChanged();
52
53 private:
54 void createUserAgentString();
55@@ -125,6 +126,7 @@
56 QSharedPointer<LocationService> m_locationService;
57 QTimer m_startupQueryTimeout;
58 QTimer m_scopesToDeleteTimer;
59+ QTimer m_registryRefreshTimer;
60
61 unity::scopes::Runtime::SPtr m_scopesRuntime;
62 QMap<QString, Scope::Ptr> m_tempScopes;

Subscribers

People subscribed via source and target branches

to all changes: