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

Method setKeyPattern

src/RedisView/AppView/MainWidget.cpp:1380–1415  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1378}
1379
1380void MainWidget::setKeyPattern(QString keyPattern) {
1381 if(_keyPattern == keyPattern)
1382 return;
1383 QList<ClientInfoDialog> vClientInfo;
1384 ClientInfoDialog clientInfo;
1385 QString sPath = QCoreApplication::applicationDirPath() + "/" + IniFileName;
1386 QSettings settings(sPath, QSettings::IniFormat);
1387 settings.setIniCodec("UTF-8");
1388 int size = settings.beginReadArray("logins");
1389 for(int i = 0; i < size; ++i) {
1390 settings.setArrayIndex(i);
1391 clientInfo._name = settings.value("name").toString().trimmed();
1392 clientInfo._encodeAddr = settings.value("addr").toByteArray();
1393 clientInfo._encodePasswd = settings.value("passwd").toByteArray();
1394 clientInfo._encode = settings.value("encode","GB18030").toString().trimmed();
1395 clientInfo._keyPattern = settings.value("keypattern","").toString();
1396 clientInfo._valuePattern = settings.value("valuepattern","").toString();
1397 vClientInfo << clientInfo;
1398 }
1399 settings.endArray();
1400 settings.remove("logins");
1401 settings.beginWriteArray("logins");
1402 for(int j =0; j < vClientInfo.size(); ++j) {
1403 settings.setArrayIndex(j);
1404 settings.setValue("name", vClientInfo[j]._name);
1405 settings.setValue("addr", vClientInfo[j]._encodeAddr);
1406 settings.setValue("passwd", vClientInfo[j]._encodePasswd);
1407 settings.setValue("encode", vClientInfo[j]._encode);
1408 if(_redisClient->getConnectName() == vClientInfo[j]._name)
1409 settings.setValue("keypattern", keyPattern);
1410 else
1411 settings.setValue("keypattern", vClientInfo[j]._keyPattern);
1412 settings.setValue("valuepattern", vClientInfo[j]._valuePattern);
1413 }
1414 settings.endArray();
1415}
1416
1417void MainWidget::on__enterRadioButton_toggled(bool checked)
1418{

Callers

nothing calls this directly

Calls 2

setValueMethod · 0.80
getConnectNameMethod · 0.80

Tested by

no test coverage detected