Kaydet (Commit) e5f7b22c authored tarafından Ashod Nakashian's avatar Ashod Nakashian Kaydeden (comit) Jan Holesovsky

LOK: Reduce logging while processing events

Change-Id: I8ca457387715fcd085bcbf3107839d2629580f7b
üst abd504c7
......@@ -130,7 +130,7 @@ namespace desktop {
typedef std::vector<CallbackData> queue_type;
private:
void removeAll(const std::function<bool (const queue_type::value_type&)>& rTestFunc);
bool removeAll(const std::function<bool (const queue_type::value_type&)>& rTestFunc);
queue_type m_queue;
std::map<int, std::string> m_states;
......
......@@ -1080,9 +1080,10 @@ void CallbackFlushHandler::queue(const int type, const char* data)
case LOK_CALLBACK_GRAPHIC_SELECTION:
case LOK_CALLBACK_INVALIDATE_VISIBLE_CURSOR:
case LOK_CALLBACK_INVALIDATE_TILES:
SAL_INFO("lok", "Removing dups of [" << type << "]: [" << payload << "].");
removeAll([type] (const queue_type::value_type& elem) { return (elem.Type == type); });
break;
if (removeAll(
[type](const queue_type::value_type& elem) { return (elem.Type == type); }))
SAL_INFO("lok", "Removed dups of [" << type << "]: [" << payload << "].");
break;
}
}
else
......@@ -1104,7 +1105,9 @@ void CallbackFlushHandler::queue(const int type, const char* data)
case LOK_CALLBACK_STATUS_INDICATOR_SET_VALUE:
case LOK_CALLBACK_RULER_UPDATE:
{
removeAll([type] (const queue_type::value_type& elem) { return (elem.Type == type); });
if (removeAll(
[type](const queue_type::value_type& elem) { return (elem.Type == type); }))
SAL_INFO("lok", "Removed dups of [" << type << "]: [" << payload << "].");
}
break;
......@@ -1485,10 +1488,16 @@ void CallbackFlushHandler::Invoke()
}
}
void CallbackFlushHandler::removeAll(const std::function<bool (const CallbackFlushHandler::queue_type::value_type&)>& rTestFunc)
bool CallbackFlushHandler::removeAll(const std::function<bool (const CallbackFlushHandler::queue_type::value_type&)>& rTestFunc)
{
auto newEnd = std::remove_if(m_queue.begin(), m_queue.end(), rTestFunc);
m_queue.erase(newEnd, m_queue.end());
if (newEnd != m_queue.end())
{
m_queue.erase(newEnd, m_queue.end());
return true;
}
return false;
}
void CallbackFlushHandler::addViewStates(int viewId)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment