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
=== modified file 'src/Unity/scopes.cpp'
--- src/Unity/scopes.cpp 2014-12-16 16:02:34 +0000
+++ src/Unity/scopes.cpp 2015-04-30 15:35:25 +0000
@@ -123,6 +123,9 @@
123 QObject::connect(m_dashSettings, &QGSettings::changed, this, &Scopes::dashSettingsChanged);123 QObject::connect(m_dashSettings, &QGSettings::changed, this, &Scopes::dashSettingsChanged);
124 }124 }
125125
126 m_registryRefreshTimer.setSingleShot(true);
127 connect(&m_registryRefreshTimer, SIGNAL(timeout()), this, SLOT(scopeRegistryChanged()));
128
126 m_overviewScope = new OverviewScope(this);129 m_overviewScope = new OverviewScope(this);
127 m_locationService.reset(new UbuntuLocationService());130 m_locationService.reset(new UbuntuLocationService());
128131
@@ -537,10 +540,7 @@
537 invalidateScopeResults("videoaggregator");540 invalidateScopeResults("videoaggregator");
538 } else if (scopeName == "scopes") {541 } else if (scopeName == "scopes") {
539 // emitted when smart-scopes proxy or scope registry discovers new scopes542 // emitted when smart-scopes proxy or scope registry discovers new scopes
540 refreshScopeMetadata();543 m_registryRefreshTimer.start(5000);
541 Q_FOREACH(Scope* scope, m_scopes) {
542 scope->invalidateResults();
543 }
544 return;544 return;
545 }545 }
546546
@@ -562,6 +562,15 @@
562 }562 }
563}563}
564564
565void Scopes::scopeRegistryChanged()
566{
567 qDebug() << "Refreshing scope metadata";
568 refreshScopeMetadata();
569 Q_FOREACH(Scope* scope, m_scopes) {
570 scope->invalidateResults();
571 }
572}
573
565QVariant Scopes::data(const QModelIndex& index, int role) const574QVariant Scopes::data(const QModelIndex& index, int role) const
566{575{
567 Scope* scope = m_scopes.at(index.row());576 Scope* scope = m_scopes.at(index.row());
568577
=== modified file 'src/Unity/scopes.h'
--- src/Unity/scopes.h 2014-12-16 16:02:34 +0000
+++ src/Unity/scopes.h 2015-04-30 15:35:25 +0000
@@ -92,6 +92,7 @@
92 void dpkgFinished();92 void dpkgFinished();
93 void lsbReleaseFinished();93 void lsbReleaseFinished();
94 void completeDiscoveryFinished();94 void completeDiscoveryFinished();
95 void scopeRegistryChanged();
9596
96private:97private:
97 void createUserAgentString();98 void createUserAgentString();
@@ -113,6 +114,7 @@
113114
114 LocationService::Ptr m_locationService;115 LocationService::Ptr m_locationService;
115 QTimer m_startupQueryTimeout;116 QTimer m_startupQueryTimeout;
117 QTimer m_registryRefreshTimer;
116118
117 unity::scopes::Runtime::SPtr m_scopesRuntime;119 unity::scopes::Runtime::SPtr m_scopesRuntime;
118120

Subscribers

People subscribed via source and target branches

to all changes: