~dobey/unity-scope-click/nonclick-touch-apps

« back to all changes in this revision

Viewing changes to libclickscope/click/preview.cpp

  • Committer: Rodney Dawes
  • Date: 2016-09-29 20:38:00 UTC
  • mfrom: (474.1.12 unity-scope-click)
  • Revision ID: rodney.dawes@canonical.com-20160929203800-fy57d6s869irddxw
* Handle exceptions from ual when calling ::info() on apps. (LP:
  #1627759)
[ Alejandro J. Cura ]
* Do not show the link to the store scope from the apps scope
[ Rodney Dawes ]
* Switch to UAL and libclick for listing installed apps. (LP:
  #1317274)
* Add the terminal app desktop file to whitelist.
* Drop the departmentsdb and ubuntu-sdk-libs deps from binary package.
* Update the README for init-departments tool.
* Depend on dh-python and use python3:Depends. (LP: #1614679)

Show diffs side-by-side

added added

removed removed

Lines of Context:
413
413
    }
414
414
}
415
415
 
 
416
// Need to use this in a couple places, so it's a static const.
 
417
static const std::regex desktop_match("^(.*)\\.desktop$");
 
418
 
416
419
// TODO: error handling - once get_details provides errors, we can
417
420
// return them from populateDetails and check them in the calling code
418
421
// to decide whether to show error widgets. see bug LP: #1289541
423
426
 
424
427
    std::string app_name = get_string_maybe_null(result["name"]);
425
428
 
426
 
    if (app_name.empty()) {
 
429
    if (app_name.empty() || std::regex_match(app_name, desktop_match)) {
427
430
        click::PackageDetails details;
428
431
        qDebug() << "in populateDetails(), app_name is empty";
429
432
        details.package.title = result.title();
900
903
    std::promise<Manifest> manifest_promise;
901
904
    std::future<Manifest> manifest_future = manifest_promise.get_future();
902
905
    std::string app_name = result["name"].get_string();
903
 
    if (!app_name.empty()) {
 
906
    if (!app_name.empty() && !std::regex_match(app_name, desktop_match)) {
904
907
        qt::core::world::enter_with_task([&]() {
905
908
            click::Interface().get_manifest_for_app(app_name,
906
909
                [&](Manifest found_manifest, InterfaceError error) {