~larryprice/ubuntu-app-launch/better-icon-themes

« back to all changes in this revision

Viewing changes to libubuntu-app-launch/registry-impl.cpp

  • Committer: Bileto Bot
  • Author(s): Ted Gould
  • Date: 2017-02-15 15:09:51 UTC
  • mfrom: (274.2.17 zg-ordering)
  • Revision ID: ci-train-bot@canonical.com-20170215150951-r736n25rz2vlg68t
Provide a popularity info item and a signal for info updating

Approved by: Charles Kerr

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
 
20
20
#include "registry-impl.h"
21
21
#include "application-icon-finder.h"
 
22
#include "application-impl-base.h"
22
23
#include <regex>
23
24
#include <upstart.h>
24
25
 
213
214
    });
214
215
}
215
216
 
216
 
/** Send an event to Zietgeist using the registry thread so that
 
217
/** Send an event to Zeitgeist using the registry thread so that
217
218
        the callback comes back in the right place. */
218
219
void Registry::Impl::zgSendEvent(AppID appid, const std::string& eventtype)
219
220
{
305
306
    return watchingAppStarting_;
306
307
}
307
308
 
 
309
core::Signal<const std::shared_ptr<Application>&>& Registry::Impl::appInfoUpdated(const std::shared_ptr<Registry>& reg)
 
310
{
 
311
    std::call_once(flag_appInfoUpdated, [this, reg] {
 
312
        g_debug("App Info Updated Signal Initialized");
 
313
 
 
314
        auto apps = app_impls::Base::createInfoWatchers(reg);
 
315
        apps.push_back(Registry::Impl::getZgWatcher(reg));
 
316
 
 
317
        for (const auto& app : apps)
 
318
        {
 
319
            infoWatchers_.emplace_back(
 
320
                std::make_pair(app, app->infoChanged().connect(
 
321
                                        [this](const std::shared_ptr<Application>& app) { sig_appInfoUpdated(app); })));
 
322
        }
 
323
    });
 
324
    return sig_appInfoUpdated;
 
325
}
 
326
 
308
327
}  // namespace app_launch
309
328
}  // namespace ubuntu