~ci-train-bot/ubuntu-app-launch/ubuntu-app-launch-ubuntu-zesty-2531

« back to all changes in this revision

Viewing changes to libubuntu-app-launch/application-info-desktop.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:
259
259
    return retval;
260
260
}
261
261
 
262
 
Desktop::Desktop(const std::shared_ptr<GKeyFile>& keyfile,
 
262
Desktop::Desktop(const AppID& appid,
 
263
                 const std::shared_ptr<GKeyFile>& keyfile,
263
264
                 const std::string& basePath,
264
265
                 const std::string& rootDir,
265
266
                 std::bitset<2> flags,
328
329
        return fileFromKeyfile<Application::Info::IconPath>(keyfile, basePath, rootDir, "X-Screenshot");
329
330
    }())
330
331
    , _keywords(stringlistFromKeyfile<Application::Info::Keywords>(keyfile, "Keywords"))
 
332
    , _popularity([registry, appid] {
 
333
        if (registry)
 
334
            return Registry::Impl::getZgWatcher(registry)->lookupAppPopularity(appid);
 
335
        else
 
336
            return Application::Info::Popularity::from_raw(0);
 
337
    }())
331
338
    , _splashInfo(
332
339
          {stringFromKeyfile<Application::Info::Splash::Title>(keyfile, "X-Ubuntu-Splash-Title"),
333
340
           fileFromKeyfile<Application::Info::Splash::Image>(keyfile, basePath, rootDir, "X-Ubuntu-Splash-Image"),