~ken-vandine/content-hub/noclick

« back to all changes in this revision

Viewing changes to src/com/ubuntu/content/utils.cpp

  • Committer: Ken VanDine
  • Date: 2017-03-15 12:54:42 UTC
  • mfrom: (321.1.7 content-hub)
  • Revision ID: ken.vandine@canonical.com-20170315125442-jultuh0alb8kjknp
merged trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
212
212
    auto app_id = ual::AppID::find(id.toStdString());
213
213
    if (app_id.empty())
214
214
        return false;
215
 
    auto app = ual::Application::create(app_id, reg);
216
 
    if (!app.get()->hasInstances())
217
 
        return false;
218
 
    Q_FOREACH (std::shared_ptr<ual::Application::Instance> instance, app.get()->instances()) {
219
 
        if (instance.get()->hasPid(pid))
220
 
            return true;
 
215
    try {
 
216
        auto app = ual::Application::create(app_id, reg);
 
217
        if (!app.get()->hasInstances())
 
218
            return false;
 
219
        Q_FOREACH (std::shared_ptr<ual::Application::Instance> instance, app.get()->instances()) {
 
220
            if (instance.get()->hasPid(pid))
 
221
                return true;
 
222
        }
 
223
    } catch (...) {
 
224
        qWarning() << Q_FUNC_INFO << "Failed to create Application for" << id;
221
225
    }
222
226
    return false;
223
227
}