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

Method recvData

src/RedisView/AppView/BatchOperateDialog.cpp:154–244  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

152}
153
154void BatchOperateDialog::recvData(const TaskMsg taskMsg) {
155 if(taskMsg._taskid == THREAD_BATCH_DEL_KEY_TASK) {
156 _TASK_LOCK.lockForWrite();
157 _NowKeyNum += taskMsg._sequence;
158 if(_KeyNum == 0) {
159 _processValue = 100;
160 } else {
161 _processValue = _NowKeyNum * 100 / _KeyNum;
162 _processValue = _processValue > 100 ? 100 : _processValue;
163 _processValue = _processValue < 0 ? 0 : _processValue;
164 }
165 ui->_progressBar->setValue(_processValue);
166 ui->_textBrowser->moveCursor(QTextCursor::End);
167 QTextCursor cursor=ui->_textBrowser->textCursor();
168 cursor.select(QTextCursor::BlockUnderCursor);
169 cursor.removeSelectedText();
170 ui->_textBrowser->append(QString("%1 keys have been deleted").arg(_NowKeyNum));
171 _TASK_LOCK.unlock();
172 } else if(taskMsg._taskid == THREAD_BATCH_SCAN_KEY_TASK) {
173 _TASK_LOCK.lockForWrite();
174 _NowKeyNum += taskMsg._sequence;
175 if(_KeyNum == 0) {
176 _processValue = 100;
177 } else {
178 _processValue = _NowKeyNum * 100 / _KeyNum;
179 _processValue = _processValue > 100 ? 100 : _processValue;
180 _processValue = _processValue < 0 ? 0 : _processValue;
181 }
182 ui->_progressBar->setValue(_processValue);
183 ui->_textBrowser->moveCursor(QTextCursor::End);
184 QTextCursor cursor=ui->_textBrowser->textCursor();
185 cursor.select(QTextCursor::BlockUnderCursor);
186 cursor.removeSelectedText();
187 ui->_textBrowser->append(QString("%1 keys have been scaned").arg(_NowKeyNum));
188 _TASK_LOCK.unlock();
189 } else if(taskMsg._taskid == THREAD_BATCH_OEM_KEY_TASK ||
190 taskMsg._taskid == THREAD_BATCH_MEM_KEY_TASK) {
191 _TASK_LOCK.lockForWrite();
192 _NowKeyNum += taskMsg._sequence;
193 if(_KeyNum == 0) {
194 _processValue = 100;
195 } else {
196 _processValue = _NowKeyNum * 100 / _KeyNum;
197 _processValue = _processValue > 100 ? 100 : _processValue;
198 _processValue = _processValue < 0 ? 0 : _processValue;
199 }
200 ui->_progressBar->setValue(_processValue);
201 ui->_textBrowser->moveCursor(QTextCursor::End);
202 QTextCursor cursor=ui->_textBrowser->textCursor();
203 cursor.select(QTextCursor::BlockUnderCursor);
204 cursor.removeSelectedText();
205 ui->_textBrowser->append(QString("%1 keys have been export").arg(_NowKeyNum));
206 _TASK_LOCK.unlock();
207 } else if(taskMsg._taskid == THREAD_BATCH_OIM_KEY_TASK ||
208 taskMsg._taskid == THREAD_BATCH_MIM_KEY_TASK) {
209 _TASK_LOCK.lockForWrite();
210 _NowKeyNum += taskMsg._sequence;
211 if(_KeyNum == 0) {

Callers

nothing calls this directly

Calls 3

setValueMethod · 0.80
appendMethod · 0.80
selectMethod · 0.45

Tested by

no test coverage detected