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

Method commit

src/RedisView/AppView/DataView.cpp:170–213  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

168}
169
170void DataView::commit() {
171
172 if(_type != KEY_LIST &&
173 _type != KEY_STRING &&
174 _type != KEY_HASH &&
175 _type != KEY_SET &&
176 _type != KEY_ZSET)
177 return;
178
179 QString str = _timeLineEdit->text().trimmed();
180 if(_time != str.toLongLong()) {
181 _cmdMsg.init();
182 _cmdMsg._dbIndex = _dbIndex;
183 _cmdMsg._clientIndex = _clientIndex;
184 _cmdMsg._key = _key;
185 _cmdMsg._type = _type;
186 _cmdMsg._value = str;
187 _cmdMsg._valueIndex = _time;
188 _cmdMsg._operate = OPERATION_TIMEOUT;
189 _vCmdMsg << _cmdMsg;
190 }
191
192 str = _keyLineEdit->text().trimmed();
193 if(str.isEmpty()) {
194 QMessageBox::critical(this, tr("错误"), tr("新KEY不可为空!"));
195 return;
196 }
197
198 if(_key != str) {
199 _cmdMsg.init();
200 _cmdMsg._dbIndex = _dbIndex;
201 _cmdMsg._clientIndex = _clientIndex;
202 _cmdMsg._key = _key;
203 _cmdMsg._type = _type;
204 _cmdMsg._value = str;
205 _cmdMsg._operate = OPERATION_RENAME;
206 _vCmdMsg << _cmdMsg;
207 }
208
209 if(_vCmdMsg.size() <= 0)
210 return;
211 emit commitData(_vCmdMsg);
212 _vCmdMsg.clear();
213}
214
215void DataView::addHead() {
216 if(_type == KEY_LIST) {

Callers

nothing calls this directly

Calls 3

textMethod · 0.45
initMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected