Insert hack code
[apps/agl-service-windowmanager.git] / src / applist.cpp
index 462a0d8..2575849 100644 (file)
@@ -53,7 +53,7 @@ void AppList::removeClient(const string &appid)
     this->app2client.erase(appid);
 }
 
-bool AppList::contains(const string &appid)
+bool AppList::contains(const string &appid) const
 {
     auto result = this->app2client.find(appid);
     return (this->app2client.end() != result) ? true : false;
@@ -83,18 +83,18 @@ shared_ptr<WMClient> AppList::lookUpClient(const string &appid)
     return this->app2client.at(appid);
 }
 
-int AppList::countClient()
+int AppList::countClient() const
 {
     return this->app2client.size();
 }
 
-unsigned AppList::currentRequestNumber()
+unsigned AppList::currentRequestNumber() const
 {
     return this->current_req;
 }
 
 // Is this function necessary ?
-unsigned AppList::getRequestNumber(const string &appid)
+unsigned AppList::getRequestNumber(const string &appid) const
 {
     for (const auto &x : this->req_list)
     {
@@ -122,14 +122,14 @@ unsigned AppList::addAllocateRequest(WMRequest req)
     return req.req_num; // return 1; if you test time_expire
 }
 
-bool AppList::requestFinished()
+bool AppList::requestFinished() const
 {
     return this->req_list.empty();
 }
 
 struct WMTrigger AppList::getRequest(unsigned req_num)
 {
-    for (auto &x : this->req_list)
+    for (const auto &x : this->req_list)
     {
         if (req_num == x.req_num)
         {
@@ -269,7 +269,7 @@ void AppList::next()
     }
 }
 
-bool AppList::haveRequest()
+bool AppList::haveRequest() const
 {
     return !this->req_list.empty();
 }