MCPcopy Create free account
hub / github.com/cc20110101/RedisView / appendValue

Method appendValue

src/RedisView/AppView/DataView.cpp:580–620  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

578}
579
580void DataView::appendValue(const TaskMsg & taskMsg, const int flag) {
581 if(flag == KEY_HASH) {
582 for(int i = 0; i < taskMsg._respResult._arrayValue[1]._arrayValue.size(); ++++i) {
583 vRowData.clear();
584 _value = QTextCodec::codecForLocale()->toUnicode(taskMsg._respResult._arrayValue[1]._arrayValue[i]._stringValue);
585 vRowData.push_back(QVariant(_value));
586 _value = QTextCodec::codecForLocale()->toUnicode(taskMsg._respResult._arrayValue[1]._arrayValue[i+1]._stringValue);
587 vRowData.push_back(QVariant(_value));
588 _tableItemValue = new ValueTableItem(vRowData);
589 _itemTableModel->insertRow(_tableItemValue);
590 }
591 } else if(flag == KEY_ZSET) {
592 for(int i = 0; i < taskMsg._respResult._arrayValue[1]._arrayValue.size(); ++++i) {
593 vRowData.clear();
594 _value = QTextCodec::codecForLocale()->toUnicode(taskMsg._respResult._arrayValue[1]._arrayValue[i]._stringValue);
595 vRowData.push_back(QVariant(_value));
596 vRowData.push_back(QVariant(taskMsg._respResult._arrayValue[1]._arrayValue[i+1]._stringValue.toDouble()));
597 _tableItemValue = new ValueTableItem(vRowData);
598 _itemTableModel->insertRow(_tableItemValue);
599 }
600 } else if(flag == KEY_SET) {
601 for(int i = 0; i < taskMsg._respResult._arrayValue[1]._arrayValue.size(); ++i) {
602 _value = QTextCodec::codecForLocale()->toUnicode(taskMsg._respResult._arrayValue[1]._arrayValue[i]._stringValue);
603 _tableItemValue = new ValueTableItem(_value);
604 _itemTableModel->insertRow(_tableItemValue);
605 }
606 } else if(flag == KEY_STRING) {
607 for(int i = 0; i < taskMsg._list.size(); ++i) {
608 _value = QTextCodec::codecForLocale()->toUnicode(taskMsg._list[i]);
609 _tableItemValue = new ValueTableItem(_value);
610 _itemTableModel->insertRow(_tableItemValue);
611 break;
612 }
613 } else if(flag == KEY_LIST) {
614 for(int i = 0; i < taskMsg._list.size(); ++i) {
615 _value = QTextCodec::codecForLocale()->toUnicode(taskMsg._list[i]);
616 _tableItemValue = new ValueTableItem(_value);
617 _itemTableModel->insertRow(_tableItemValue);
618 }
619 }
620}
621
622void DataView::setDbIndex(const int &index) {
623 _dbIndex = index;

Callers 1

recvDataMethod · 0.80

Calls 2

clearMethod · 0.45
insertRowMethod · 0.45

Tested by

no test coverage detected