Skip to content
Snippets Groups Projects
Commit cbd5e3e4 authored by Rafaël Carré's avatar Rafaël Carré
Browse files

ShortcutPreferences::setShortcuts() : simplify

parent 57b28a17
Branches
No related tags found
No related merge requests found
...@@ -466,47 +466,20 @@ std::map<std::string, std::string> ShortcutPreferences::getShortcuts() ...@@ -466,47 +466,20 @@ std::map<std::string, std::string> ShortcutPreferences::getShortcuts()
} }
void ShortcutPreferences::setShortcuts (std::map<std::string, std::string> map_cpy) void ShortcutPreferences::setShortcuts (std::map<std::string, std::string> map)
{ {
std::map<std::string, std::string>::iterator it; _hangup = map[hangupShortKey];
_pickup = map[pickupShortKey];
it = map_cpy.find (hangupShortKey); _popup = map[popupShortKey];
_toggleHold = map[toggleHoldShortKey];
if (it != map_cpy.end()) { _togglePickupHangup = map[togglePickupHangupShortKey];
_hangup = it->second;
}
it = map_cpy.find (pickupShortKey);
if (it != map_cpy.end()) {
_pickup = it->second;
}
it = map_cpy.find (popupShortKey);
if (it != map_cpy.end()) {
_popup = it->second;
}
it = map_cpy.find (toggleHoldShortKey);
if (it != map_cpy.end()) {
_toggleHold = it->second;
}
it = map_cpy.find (togglePickupHangupShortKey);
if (it != map_cpy.end()) {
_togglePickupHangup = it->second;
}
/* /*
for (int i = 0; i < (int)shortcutsKeys.size(); i++) { for (int i = 0; i < (int)shortcutsKeys.size(); i++) {
std::string key = shortcutsKeys.at(i); std::string key = shortcutsKeys.at(i);
it = map_cpy.find(key); std::string val = map[key];
if (it != shortcutsMap.end()) { if (val != "")
Manager::instance().setConfig("Shortcuts", key, it->second); Manager::instance().setConfig("Shortcuts", key, val);
}
} }
*/ */
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment