kdb::KeySet Plugin::getNeededConfig() { Key neededConfigKey ("system/elektra/modules", KEY_END); neededConfigKey.addName(pluginName); neededConfigKey.addName("config/needs"); KeySet d (info.dup()); KeySet config = d.cut(neededConfigKey); KeySet ret; Key oldParent = neededConfigKey; Key newParent("system", KEY_END); for (KeySet::iterator i = config.begin(); i != config.end(); ++i) { Key k(i->dup()); ret.append(kdb::tools::helper::rebaseKey(k, oldParent, newParent)); } return ret; }
// <DEFINE_SYNC_KEY> void SettingLoader::load_DEFINE_SYNC_KEY() { Key *key = m_setting->m_keyboard.getSyncKey(); key->initialize(); key->addName(_T("sync")); if (*getToken() != _T("=")) throw ErrorMessage() << _T("there must be `=' after `sync'."); load_SCAN_CODES(key); }
// <DEFINE_KEY> void SettingLoader::load_DEFINE_KEY() { Token *t = getToken(); Key key; // <KEY_NAMES> if (*t == _T('(')) { key.addName(getToken()->getString()); while (t = getToken(), *t != _T(')')) key.addName(t->getString()); if (*getToken() != _T("=")) throw ErrorMessage() << _T("there must be `=' after `)'."); } else { key.addName(t->getString()); while (t = getToken(), *t != _T("=")) key.addName(t->getString()); } load_SCAN_CODES(&key); m_setting->m_keyboard.addKey(key); }