diff options
Diffstat (limited to 'src/cmdmapper.cpp')
-rw-r--r-- | src/cmdmapper.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/cmdmapper.cpp b/src/cmdmapper.cpp index b0ca85f..3782ff3 100644 --- a/src/cmdmapper.cpp +++ b/src/cmdmapper.cpp @@ -226,6 +226,16 @@ int Mapper::map(const char *n) return !name.isEmpty() && (result=m_map.find(name)) ? *result: 0; } +QString Mapper::map(const int n) +{ + QDictIterator<int> mapIterator(m_map); + for (int *curVal = mapIterator.toFirst();curVal = mapIterator.current();++mapIterator) + { + if (*curVal == n || (*curVal == (n | SIMPLESECT_BIT))) return mapIterator.currentKey(); + } + return NULL; +} + Mapper::Mapper(const CommandMap *cm,bool caseSensitive) : m_map(89), m_cs(caseSensitive) { m_map.setAutoDelete(TRUE); |