Merge lp:~larryprice/libertine/recurse-apps-dir into lp:libertine

Proposed by Larry Price
Status: Merged
Approved by: Christopher Townsend
Approved revision: 276
Merged at revision: 279
Proposed branch: lp:~larryprice/libertine/recurse-apps-dir
Merge into: lp:libertine
Diff against target: 86 lines (+16/-4)
2 files modified
liblibertine/libertine.cpp (+14/-2)
liblibertine/libertine.h (+2/-2)
To merge this branch: bzr merge lp:~larryprice/libertine/recurse-apps-dir
Reviewer Review Type Date Requested Status
Christopher Townsend Approve
Libertine CI Bot continuous-integration Approve
Review via email: mp+301694@code.launchpad.net

Commit message

Add API method for finding application desktop files, and extend desktop file search to recurse directories.

Description of the change

Add API method for finding application desktop files, and extend desktop file search to recurse directories.

I also have an impending MP for ubuntu-app-launch which will use this new endpoint, and I will have a quick MP to add a few new apps to the blacklist for libertine-scope.

To post a comment you must log in.
Revision history for this message
Libertine CI Bot (libertine-ci-bot) wrote :

PASSED: Continuous integration, rev:274
https://jenkins.canonical.com/libertine/job/lp-libertine-ci/65/
Executed test runs:
    SUCCESS: https://jenkins.canonical.com/libertine/job/build/231
    SUCCESS: https://jenkins.canonical.com/libertine/job/test-0-autopkgtest/label=amd64,release=vivid+overlay,testname=default/188
    SUCCESS: https://jenkins.canonical.com/libertine/job/test-0-autopkgtest/label=amd64,release=xenial+overlay,testname=default/188
    SUCCESS: https://jenkins.canonical.com/libertine/job/test-0-autopkgtest/label=amd64,release=yakkety,testname=default/188
    SUCCESS: https://jenkins.canonical.com/libertine/job/test-0-autopkgtest/label=i386,release=vivid+overlay,testname=default/188
    SUCCESS: https://jenkins.canonical.com/libertine/job/test-0-autopkgtest/label=i386,release=xenial+overlay,testname=default/188
    SUCCESS: https://jenkins.canonical.com/libertine/job/test-0-autopkgtest/label=i386,release=yakkety,testname=default/188
    None: https://jenkins.canonical.com/libertine/job/lp-generic-update-mp/175/console
    SUCCESS: https://jenkins.canonical.com/libertine/job/build-0-fetch/234
    SUCCESS: https://jenkins.canonical.com/libertine/job/build-1-sourcepkg/release=vivid+overlay/219
    SUCCESS: https://jenkins.canonical.com/libertine/job/build-1-sourcepkg/release=xenial+overlay/219
    SUCCESS: https://jenkins.canonical.com/libertine/job/build-1-sourcepkg/release=yakkety/219
    SUCCESS: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=amd64,release=vivid+overlay/212
        deb: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=amd64,release=vivid+overlay/212/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=amd64,release=xenial+overlay/212
        deb: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=amd64,release=xenial+overlay/212/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=amd64,release=yakkety/212
        deb: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=amd64,release=yakkety/212/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=i386,release=vivid+overlay/212
        deb: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=i386,release=vivid+overlay/212/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=i386,release=xenial+overlay/212
        deb: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=i386,release=xenial+overlay/212/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=i386,release=yakkety/212
        deb: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=i386,release=yakkety/212/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://jenkins.canonical.com/libertine/job/lp-libertine-ci/65/rebuild

review: Approve (continuous-integration)
Revision history for this message
Libertine CI Bot (libertine-ci-bot) wrote :

PASSED: Continuous integration, rev:275
https://jenkins.canonical.com/libertine/job/lp-libertine-ci/66/
Executed test runs:
    SUCCESS: https://jenkins.canonical.com/libertine/job/build/233
    SUCCESS: https://jenkins.canonical.com/libertine/job/test-0-autopkgtest/label=amd64,release=vivid+overlay,testname=default/190
    SUCCESS: https://jenkins.canonical.com/libertine/job/test-0-autopkgtest/label=amd64,release=xenial+overlay,testname=default/190
    SUCCESS: https://jenkins.canonical.com/libertine/job/test-0-autopkgtest/label=amd64,release=yakkety,testname=default/190
    SUCCESS: https://jenkins.canonical.com/libertine/job/test-0-autopkgtest/label=i386,release=vivid+overlay,testname=default/190
    SUCCESS: https://jenkins.canonical.com/libertine/job/test-0-autopkgtest/label=i386,release=xenial+overlay,testname=default/190
    SUCCESS: https://jenkins.canonical.com/libertine/job/test-0-autopkgtest/label=i386,release=yakkety,testname=default/190
    None: https://jenkins.canonical.com/libertine/job/lp-generic-update-mp/177/console
    SUCCESS: https://jenkins.canonical.com/libertine/job/build-0-fetch/236
    SUCCESS: https://jenkins.canonical.com/libertine/job/build-1-sourcepkg/release=vivid+overlay/221
    SUCCESS: https://jenkins.canonical.com/libertine/job/build-1-sourcepkg/release=xenial+overlay/221
    SUCCESS: https://jenkins.canonical.com/libertine/job/build-1-sourcepkg/release=yakkety/221
    SUCCESS: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=amd64,release=vivid+overlay/214
        deb: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=amd64,release=vivid+overlay/214/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=amd64,release=xenial+overlay/214
        deb: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=amd64,release=xenial+overlay/214/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=amd64,release=yakkety/214
        deb: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=amd64,release=yakkety/214/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=i386,release=vivid+overlay/214
        deb: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=i386,release=vivid+overlay/214/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=i386,release=xenial+overlay/214
        deb: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=i386,release=xenial+overlay/214/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=i386,release=yakkety/214
        deb: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=i386,release=yakkety/214/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://jenkins.canonical.com/libertine/job/lp-libertine-ci/66/rebuild

review: Approve (continuous-integration)
Revision history for this message
Larry Price (larryprice) wrote :

Need to rework this again to ensure we're not duplicating too much code here and in libu-a-l.

Revision history for this message
Libertine CI Bot (libertine-ci-bot) wrote :

PASSED: Continuous integration, rev:276
https://jenkins.canonical.com/libertine/job/lp-libertine-ci/67/
Executed test runs:
    SUCCESS: https://jenkins.canonical.com/libertine/job/build/236
    SUCCESS: https://jenkins.canonical.com/libertine/job/test-0-autopkgtest/label=amd64,release=vivid+overlay,testname=default/193
    SUCCESS: https://jenkins.canonical.com/libertine/job/test-0-autopkgtest/label=amd64,release=xenial+overlay,testname=default/193
    SUCCESS: https://jenkins.canonical.com/libertine/job/test-0-autopkgtest/label=amd64,release=yakkety,testname=default/193
    SUCCESS: https://jenkins.canonical.com/libertine/job/test-0-autopkgtest/label=i386,release=vivid+overlay,testname=default/193
    SUCCESS: https://jenkins.canonical.com/libertine/job/test-0-autopkgtest/label=i386,release=xenial+overlay,testname=default/193
    SUCCESS: https://jenkins.canonical.com/libertine/job/test-0-autopkgtest/label=i386,release=yakkety,testname=default/193
    None: https://jenkins.canonical.com/libertine/job/lp-generic-update-mp/179/console
    SUCCESS: https://jenkins.canonical.com/libertine/job/build-0-fetch/239
    SUCCESS: https://jenkins.canonical.com/libertine/job/build-1-sourcepkg/release=vivid+overlay/224
    SUCCESS: https://jenkins.canonical.com/libertine/job/build-1-sourcepkg/release=xenial+overlay/224
    SUCCESS: https://jenkins.canonical.com/libertine/job/build-1-sourcepkg/release=yakkety/224
    SUCCESS: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=amd64,release=vivid+overlay/217
        deb: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=amd64,release=vivid+overlay/217/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=amd64,release=xenial+overlay/217
        deb: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=amd64,release=xenial+overlay/217/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=amd64,release=yakkety/217
        deb: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=amd64,release=yakkety/217/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=i386,release=vivid+overlay/217
        deb: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=i386,release=vivid+overlay/217/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=i386,release=xenial+overlay/217
        deb: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=i386,release=xenial+overlay/217/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=i386,release=yakkety/217
        deb: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=i386,release=yakkety/217/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://jenkins.canonical.com/libertine/job/lp-libertine-ci/67/rebuild

review: Approve (continuous-integration)
Revision history for this message
Christopher Townsend (townsend) wrote :

Ok, looks good to me.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'liblibertine/libertine.cpp'
--- liblibertine/libertine.cpp 2016-05-06 20:06:43 +0000
+++ liblibertine/libertine.cpp 2016-08-03 17:21:14 +0000
@@ -21,17 +21,19 @@
21#include "libertine/ContainerConfigList.h"21#include "libertine/ContainerConfigList.h"
22#include "libertine/LibertineConfig.h"22#include "libertine/LibertineConfig.h"
2323
24
24namespace25namespace
25{26{
26constexpr auto DESKTOP_EXTENSION = ".desktop";27constexpr auto DESKTOP_EXTENSION = ".desktop";
27constexpr auto GLOBAL_APPLICATIONS = "usr/share/applications";28constexpr auto GLOBAL_APPLICATIONS = "usr/share/applications";
28constexpr auto LOCAL_APPLICATIONS = ".local/share/applications";29constexpr auto LOCAL_APPLICATIONS = ".local/share/applications";
2930
31
30GError*32GError*
31list_apps_from_path(gchar* path, const gchar* container_id, GArray* apps)33list_apps_from_path(gchar* path, const gchar* container_id, GArray* apps)
32{34{
33 GError* error = nullptr;35 GError* error = nullptr;
34 GDir * dir = g_dir_open(path, 0, &error);36 GDir* dir = g_dir_open(path, 0, &error);
35 if (error != nullptr)37 if (error != nullptr)
36 {38 {
37 return error;39 return error;
@@ -50,6 +52,14 @@
50 g_array_append_val(apps, app_id);52 g_array_append_val(apps, app_id);
51 g_free(name);53 g_free(name);
52 }54 }
55 else if (g_file_test(file, G_FILE_TEST_IS_DIR))
56 {
57 error = list_apps_from_path(file, container_id, apps);
58 if (error != nullptr)
59 {
60 return error;
61 }
62 }
53 g_free(file);63 g_free(file);
54 }64 }
5565
@@ -58,6 +68,7 @@
58}68}
59}69}
6070
71
61gchar**72gchar**
62libertine_list_apps_for_container(const gchar* container_id)73libertine_list_apps_for_container(const gchar* container_id)
63{74{
@@ -92,6 +103,7 @@
92 return (gchar**)g_array_free(apps, FALSE);103 return (gchar**)g_array_free(apps, FALSE);
93}104}
94105
106
95gchar **107gchar **
96libertine_list_containers(void)108libertine_list_containers(void)
97{109{
@@ -106,7 +118,7 @@
106118
107 for (i = 0; i < container_count; ++i)119 for (i = 0; i < container_count; ++i)
108 {120 {
109 id = container_list.data(container_list.index(i, 0), (int)ContainerConfigList::DataRole::ContainerId); 121 id = container_list.data(container_list.index(i, 0), (int)ContainerConfigList::DataRole::ContainerId);
110 gchar * container_id = g_strdup((gchar *)id.toString().toStdString().c_str());122 gchar * container_id = g_strdup((gchar *)id.toString().toStdString().c_str());
111 g_array_append_val(containers, container_id);123 g_array_append_val(containers, container_id);
112 }124 }
113125
=== modified file 'liblibertine/libertine.h'
--- liblibertine/libertine.h 2015-09-21 19:13:40 +0000
+++ liblibertine/libertine.h 2016-08-03 17:21:14 +0000
@@ -24,7 +24,7 @@
2424
25/**25/**
26 * libertine_list_containers:26 * libertine_list_containers:
27 * 27 *
28 * Gets the list of existing containers for the user.28 * Gets the list of existing containers for the user.
29 *29 *
30 * Return value: (transfer full): A NULL terminated list of30 * Return value: (transfer full): A NULL terminated list of
@@ -68,7 +68,7 @@
68/**68/**
69 * libertine_list_apps_for_container:69 * libertine_list_apps_for_container:
70 * @container_id: ID of the container70 * @container_id: ID of the container
71 * 71 *
72 * Gets the list of existing apps installed in a container.72 * Gets the list of existing apps installed in a container.
73 *73 *
74 * Return value: (transfer full): A NULL terminated list of74 * Return value: (transfer full): A NULL terminated list of

Subscribers

People subscribed via source and target branches