コード例 #1
0
ファイル: config.cpp プロジェクト: Answeror/ezviewer
void Config::loadAllShortcut()
{
    ActionManager::unbindAllShortcut(); ///

    QXmlGet xmlGet;
    xmlGet.load(ShortcutFilePath());

    QString key, action;
    while (xmlGet.findNext(ShortcutKey)) {
        xmlGet.descend();
        if (xmlGet.find(KeySequenceKey))
            key = xmlGet.getString();
        if (xmlGet.find(ActionKey))
            action = xmlGet.getString();
        xmlGet.rise();

        if (!key.isEmpty() && !action.isEmpty())
            ActionManager::bindShortcut(key, action);

        key.clear();
        action.clear();
    }
}