Merge lp:~stolowski/unity-scopes-shell/fix-1446499-rtm into lp:unity-scopes-shell/rtm-14.09

Proposed by Paweł Stołowski
Status: Merged
Approved by: Marcus Tomlinson
Approved revision: 155
Merged at revision: 154
Proposed branch: lp:~stolowski/unity-scopes-shell/fix-1446499-rtm
Merge into: lp:unity-scopes-shell/rtm-14.09
Diff against target: 60 lines (+15/-4)
2 files modified
src/Unity/scopes.cpp (+13/-4)
src/Unity/scopes.h (+2/-0)
To merge this branch: bzr merge lp:~stolowski/unity-scopes-shell/fix-1446499-rtm
Reviewer Review Type Date Requested Status
Marcus Tomlinson (community) Approve
Review via email: mp+257909@code.launchpad.net

Commit message

Delay change notifications received from scope registry.

Description of the change

Delay change notifications received from scope registry.

To post a comment you must log in.
155. By Paweł Stołowski

Compilation fix

Revision history for this message
Marcus Tomlinson (marcustomlinson) wrote :

Looks good

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

Subscribers

People subscribed via source and target branches

to all changes: