aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/app.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/app.cpp b/src/app.cpp
index bbb14c0..be4782a 100644
--- a/src/app.cpp
+++ b/src/app.cpp
@@ -727,6 +727,7 @@ void App::emitCarRun() {
result<int> App::api_request_surface(char const *drawing_name) {
// Convert drawing_name to role
const char* role = this->convertDrawingNameToRole(drawing_name);
+
auto lid = this->layers.get_layer_id(std::string(role));
if (!lid) {
/**
@@ -768,8 +769,10 @@ result<int> App::api_request_surface(char const *drawing_name) {
char const *App::api_request_surface(char const *drawing_name,
char const *ivi_id) {
ST();
+ // Convert drawing_name to role
+ const char* role = this->convertDrawingNameToRole(drawing_name);
- auto lid = this->layers.get_layer_id(std::string(drawing_name));
+ auto lid = this->layers.get_layer_id(std::string(role));
unsigned sid = std::stol(ivi_id);
if (!lid) {
@@ -783,14 +786,14 @@ char const *App::api_request_surface(char const *drawing_name,
}
}
- auto rname = this->lookup_id(drawing_name);
+ auto rname = this->lookup_id(role);
if (rname) {
return "Surface already present";
}
// register pair drawing_name and ivi_id
- this->id_alloc.register_name_id(drawing_name, sid);
+ this->id_alloc.register_name_id(role, sid);
this->layers.add_surface(sid, *lid);
// this surface is already created