shared: Update all users of DATADIR
Replace every use of DATADIR to create a filename with a call to the new function that allows overriding DATADIR with an env var at runtime. No attention is paid to asprintf failure. This restores make distcheck to a passing state after commit 6b58ea began checking cairo surfaces for validity and exchanged undefined behaviour we shouldn't have been dependent on for consistent test failure. Signed-off-by: Derek Foreman <derekf@osg.samsung.com> Acked-by: Daniel Stone <daniels@collabora.com> Reviewed-by: Quentin Glidic <sardemff7+git@sardemff7.net> [Pekka: split if-branches into two lines] Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
This commit is contained in:
committed by
Pekka Paalanen
parent
b7e3db6a76
commit
e277276b85
+11
-3
@@ -49,6 +49,7 @@
|
||||
#include "shared/helpers.h"
|
||||
#include "shared/xalloc.h"
|
||||
#include "shared/zalloc.h"
|
||||
#include "shared/file-util.h"
|
||||
|
||||
#include "weston-desktop-shell-client-protocol.h"
|
||||
|
||||
@@ -760,8 +761,12 @@ background_draw(struct widget *widget, void *data)
|
||||
image = NULL;
|
||||
if (background->image)
|
||||
image = load_cairo_surface(background->image);
|
||||
else if (background->color == 0)
|
||||
image = load_cairo_surface(DATADIR "/weston/pattern.png");
|
||||
else if (background->color == 0) {
|
||||
char *name = file_name_with_datadir("pattern.png");
|
||||
|
||||
image = load_cairo_surface(name);
|
||||
free(name);
|
||||
}
|
||||
|
||||
if (image && background->type != -1) {
|
||||
im_w = cairo_image_surface_get_width(image);
|
||||
@@ -1351,10 +1356,13 @@ panel_add_launchers(struct panel *panel, struct desktop *desktop)
|
||||
}
|
||||
|
||||
if (count == 0) {
|
||||
char *name = file_name_with_datadir("terminal.png");
|
||||
|
||||
/* add default launcher */
|
||||
panel_add_launcher(panel,
|
||||
DATADIR "/weston/terminal.png",
|
||||
name,
|
||||
BINDIR "/weston-terminal");
|
||||
free(name);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -43,6 +43,7 @@
|
||||
#include "shared/os-compatibility.h"
|
||||
#include "shared/xalloc.h"
|
||||
#include "shared/zalloc.h"
|
||||
#include "shared/file-util.h"
|
||||
#include "ivi-application-client-protocol.h"
|
||||
#include "ivi-hmi-controller-client-protocol.h"
|
||||
|
||||
@@ -1076,6 +1077,7 @@ hmi_homescreen_setting_create(void)
|
||||
const char *name = NULL;
|
||||
uint32_t workspace_layer_id;
|
||||
uint32_t icon_surface_id = 0;
|
||||
char *filename;
|
||||
|
||||
wl_list_init(&setting->workspace_list);
|
||||
wl_list_init(&setting->launcher_list);
|
||||
@@ -1095,51 +1097,65 @@ hmi_homescreen_setting_create(void)
|
||||
weston_config_section_get_uint(
|
||||
shellSection, "workspace-layer-id", &workspace_layer_id, 3000);
|
||||
|
||||
filename = file_name_with_datadir("background.png");
|
||||
weston_config_section_get_string(
|
||||
shellSection, "background-image", &setting->background.filePath,
|
||||
DATADIR "/weston/background.png");
|
||||
filename);
|
||||
free(filename);
|
||||
|
||||
weston_config_section_get_uint(
|
||||
shellSection, "background-id", &setting->background.id, 1001);
|
||||
|
||||
filename = file_name_with_datadir("panel.png");
|
||||
weston_config_section_get_string(
|
||||
shellSection, "panel-image", &setting->panel.filePath,
|
||||
DATADIR "/weston/panel.png");
|
||||
filename);
|
||||
free(filename);
|
||||
|
||||
weston_config_section_get_uint(
|
||||
shellSection, "panel-id", &setting->panel.id, 1002);
|
||||
|
||||
filename = file_name_with_datadir("tiling.png");
|
||||
weston_config_section_get_string(
|
||||
shellSection, "tiling-image", &setting->tiling.filePath,
|
||||
DATADIR "/weston/tiling.png");
|
||||
filename);
|
||||
free(filename);
|
||||
|
||||
weston_config_section_get_uint(
|
||||
shellSection, "tiling-id", &setting->tiling.id, 1003);
|
||||
|
||||
filename = file_name_with_datadir("sidebyside.png");
|
||||
weston_config_section_get_string(
|
||||
shellSection, "sidebyside-image", &setting->sidebyside.filePath,
|
||||
DATADIR "/weston/sidebyside.png");
|
||||
filename);
|
||||
free(filename);
|
||||
|
||||
weston_config_section_get_uint(
|
||||
shellSection, "sidebyside-id", &setting->sidebyside.id, 1004);
|
||||
|
||||
filename = file_name_with_datadir("fullscreen.png");
|
||||
weston_config_section_get_string(
|
||||
shellSection, "fullscreen-image", &setting->fullscreen.filePath,
|
||||
DATADIR "/weston/fullscreen.png");
|
||||
filename);
|
||||
free(filename);
|
||||
|
||||
weston_config_section_get_uint(
|
||||
shellSection, "fullscreen-id", &setting->fullscreen.id, 1005);
|
||||
|
||||
filename = file_name_with_datadir("random.png");
|
||||
weston_config_section_get_string(
|
||||
shellSection, "random-image", &setting->random.filePath,
|
||||
DATADIR "/weston/random.png");
|
||||
filename);
|
||||
free(filename);
|
||||
|
||||
weston_config_section_get_uint(
|
||||
shellSection, "random-id", &setting->random.id, 1006);
|
||||
|
||||
filename = file_name_with_datadir("home.png");
|
||||
weston_config_section_get_string(
|
||||
shellSection, "home-image", &setting->home.filePath,
|
||||
DATADIR "/weston/home.png");
|
||||
filename);
|
||||
free(filename);
|
||||
|
||||
weston_config_section_get_uint(
|
||||
shellSection, "home-id", &setting->home.id, 1007);
|
||||
|
||||
Reference in New Issue
Block a user