| 578 | } |
| 579 | |
| 580 | void 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 | |
| 622 | void DataView::setDbIndex(const int &index) { |
| 623 | _dbIndex = index; |