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

Method recvData

src/RedisView/AppView/MainWidget.cpp:297–321  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

295}
296
297void MainWidget::recvData(const TaskMsg taskMsg) {
298 if(taskMsg._taskid == THREAD_SCAN_KEY_TASK) {
299 _SCAN_KEY_LOCK.lockForRead();
300 if(_iScanKeySeq == taskMsg._sequence) {
301 QString strKey;
302 KeyTreeItem *subTreeItem;
303 for(int i = 0; i < taskMsg._respResult._arrayValue[1]._arrayValue.size(); ++i) {
304 strKey = QTextCodec::codecForLocale()->toUnicode(taskMsg._respResult._arrayValue[1]._arrayValue[i]._stringValue);
305 if(_isClusterMode) {
306 subTreeItem = new KeyTreeItem(strKey,_treeItemKey);
307 } else {
308 subTreeItem = new KeyTreeItem(strKey,_vTreeItemKey[taskMsg._dbIndex]);
309 }
310 _itemKeyModel->insertRow(subTreeItem);
311 }
312 }
313 _SCAN_KEY_LOCK.unlock();
314 } else if(taskMsg._taskid == THREAD_SCAN_VALUE_TASK) {
315 _SCAN_VALUE_LOCK.lockForRead();
316 if(_iScanValueSeq == taskMsg._sequence) {
317 _dataView->appendValue(taskMsg, taskMsg._type);
318 }
319 _SCAN_VALUE_LOCK.unlock();
320 }
321}
322
323void MainWidget::finishWork(const int taskid) {
324 _vTaskId.removeOne(taskid);

Callers

nothing calls this directly

Calls 2

appendValueMethod · 0.80
insertRowMethod · 0.45

Tested by

no test coverage detected