From 7527a89d7774a30a907e384c96b67047e3ba74ec Mon Sep 17 00:00:00 2001 From: Sergey Mironov Date: Sat, 27 Feb 2016 10:40:48 +0300 Subject: [PATCH] Fix forgotten parse2 calls in VimAPI --- .gitignore | 2 ++ XKbSwitchApi.cpp | 19 +------------------ XKeyboard.h | 22 ---------------------- 3 files changed, 3 insertions(+), 40 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..53f935f --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +build +.* diff --git a/XKbSwitchApi.cpp b/XKbSwitchApi.cpp index 44193e8..4455681 100644 --- a/XKbSwitchApi.cpp +++ b/XKbSwitchApi.cpp @@ -72,24 +72,7 @@ namespace return symNames; } - loaded = true; - XkbGetControls( xkb->_display, XkbAllControlsMask, xkb->_kbdDescPtr ); - XkbGetNames( xkb->_display, XkbSymbolsNameMask, xkb->_kbdDescPtr ); - - Atom symNameAtom = xkb->_kbdDescPtr->names->symbols; - if ( symNameAtom == None ) - return symNames; - - char * symNameC = XGetAtomName( xkb->_display, symNameAtom ); - string symName( symNameC ); - - XFree( symNameC ); - - if ( symName.empty() ) - return symNames; - - symNames = parse2( symName, nonsyms() ); - + xkb->BuildLayout(symNames); return symNames; } } diff --git a/XKeyboard.h b/XKeyboard.h index 16e60b1..e2302ef 100644 --- a/XKeyboard.h +++ b/XKeyboard.h @@ -62,28 +62,6 @@ class XKeyboard }; -// Parses keyboard string returned by get_kb_stirng. ns are symbols to ignore, -// normally the result of nonsyms() -string_vector parse1(const std::string& symbols, const string_vector& ns); -string_vector parse2(const std::string& symbols, const string_vector& ns); -string_vector parse3(const std::string& symbols, const string_vector& ns); - -// Symbols to be ignored by the parser -inline string_vector nonsyms() -{ - string_vector nonsyms; - nonsyms.push_back("group"); - nonsyms.push_back("inet"); - nonsyms.push_back("ctr"); - nonsyms.push_back("pc"); - nonsyms.push_back("ctrl"); - nonsyms.push_back("capslock"); - nonsyms.push_back("compose"); - nonsyms.push_back("terminate"); - nonsyms.push_back("eurosign"); - return nonsyms; -} - } #endif