Пример #1
0
    void ExplorerTreeView::finishExecuteCommand(const EventsInfo::CommandResponce& res)
    {
        common::ErrorValueSPtr er = res.errorInfo();
        if(er && er->isError()){
            return;
        }

        IServer* serv = qobject_cast<IServer *>(sender());
        DCHECK(serv);
        if(!serv){
            return;
        }

        ExplorerTreeModel* mod = qobject_cast<ExplorerTreeModel*>(model());
        DCHECK(mod);
        if(!mod){
            return;
        }

        CommandKeySPtr key = res.cmd_;
        if(key->type() == CommandKey::C_DELETE){
            mod->removeKey(serv, res.inf_, key->key());
        }
        else if(key->type() == CommandKey::C_CREATE){
            mod->addKey(serv, res.inf_, key->key());
        }
    }
Пример #2
0
    void ViewKeysDialog::finishExecuteCommand(const EventsInfo::CommandResponce& res)
    {
        common::ErrorValueSPtr er = res.errorInfo();
        if(er && er->isError()){
            return;
        }

        if(res.initiator() != this){
            DEBUG_MSG_FORMAT<512>(common::logging::L_DEBUG, "Skipped event in file: %s, function: %s", __FILE__, __FUNCTION__);
            return;
        }

        CommandKeySPtr key = res.cmd_;
        if(key->type() == CommandKey::C_CHANGE_TTL){
            CommandChangeTTL * cttl = dynamic_cast<CommandChangeTTL*>(key.get());
            if(cttl){
                NDbValue dbv = cttl->newKey();
                keysModel_->changeValue(dbv);
            }
        }
    }