aboutsummaryrefslogtreecommitdiffstats
path: root/src/wm_client.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/wm_client.cpp')
-rw-r--r--src/wm_client.cpp16
1 files changed, 6 insertions, 10 deletions
diff --git a/src/wm_client.cpp b/src/wm_client.cpp
index 79922fa..47d0c2d 100644
--- a/src/wm_client.cpp
+++ b/src/wm_client.cpp
@@ -49,7 +49,7 @@ WMClient::WMClient(const string &appid, unsigned layer, unsigned surface, const
#else
afb_event ev = afb_daemon_make_event(x.c_str());
#endif
- event2list[x] = ev;
+ evname2afb_event[x] = ev;
}
}
@@ -57,7 +57,7 @@ WMClient::WMClient(const string &appid, const string &role)
: id(appid),
layer(0),
role2surface(0),
- event2list(0)
+ evname2afb_event(0)
{
role2surface[role] = INVALID_SURFACE_ID;
for (auto x : kWMEvents)
@@ -67,14 +67,10 @@ WMClient::WMClient(const string &appid, const string &role)
#else
afb_event ev = afb_daemon_make_event(x.c_str());
#endif
- event2list[x] = ev;
+ evname2afb_event[x] = ev;
}
}
-WMClient::~WMClient()
-{
-}
-
string WMClient::appID() const
{
return this->id;
@@ -196,7 +192,7 @@ bool WMClient::subscribe(afb_req req, const string &evname)
HMI_DEBUG("wm", "error is only enabeled for now");
return false;
}
- int ret = afb_req_subscribe(req, this->event2list[evname]);
+ int ret = afb_req_subscribe(req, this->evname2afb_event[evname]);
if (ret)
{
HMI_DEBUG("wm", "Failed to subscribe %s", evname.c_str());
@@ -207,7 +203,7 @@ bool WMClient::subscribe(afb_req req, const string &evname)
void WMClient::emitError(WM_CLIENT_ERROR_EVENT ev)
{
- if (!afb_event_is_valid(this->event2list[kKeyError])){
+ if (!afb_event_is_valid(this->evname2afb_event[kKeyError])){
HMI_ERROR("wm", "event err is not valid");
return;
}
@@ -216,7 +212,7 @@ void WMClient::emitError(WM_CLIENT_ERROR_EVENT ev)
json_object_object_add(j, kKeyErrorDesc, json_object_new_string(kErrorDescription[ev].c_str()));
HMI_DEBUG("wm", "error: %d, description:%s", ev, kErrorDescription[ev].c_str());
- int ret = afb_event_push(this->event2list[kKeyError], j);
+ int ret = afb_event_push(this->evname2afb_event[kKeyError], j);
if (ret != 0)
{
HMI_DEBUG("wm", "afb_event_push failed: %m");