Replace replace(xxx, "") with remove(xxx)

master
wh201906 2 years ago
parent 5a26cd1936
commit d671266797
No known key found for this signature in database

@ -108,11 +108,11 @@ QMap<QString, QString> Mifare::info(bool isRequiringOutput)
for(auto line = lineList.begin(); line != lineList.end(); line++) for(auto line = lineList.begin(); line != lineList.end(); line++)
{ {
if(line->contains("UID")) if(line->contains("UID"))
map["UID"] = line->replace("UID", "").replace(QRegularExpression("[^0-9a-fA-F]"), "").trimmed(); map["UID"] = line->remove("UID").remove(QRegularExpression("[^0-9a-fA-F]")).trimmed();
else if(line->contains("ATQA")) else if(line->contains("ATQA"))
map["ATQA"] = line->replace("ATQA", "").replace(QRegularExpression("[^0-9a-fA-F]"), "").trimmed(); map["ATQA"] = line->remove("ATQA").remove(QRegularExpression("[^0-9a-fA-F]")).trimmed();
else if(line->contains("SAK")) else if(line->contains("SAK"))
map["SAK"] = line->replace("SAK", "").replace(QRegularExpression("\\[.+?\\]"), "").replace(QRegularExpression("[^0-9a-fA-F]"), "").trimmed(); map["SAK"] = line->remove("SAK").remove(QRegularExpression("\\[.+?\\]")).remove(QRegularExpression("[^0-9a-fA-F]")).trimmed();
} }
} }
else else

@ -625,7 +625,7 @@ void MainWindow::on_MF_dataWidget_itemChanged(QTableWidgetItem *item)
} }
else if(item->column() == 2) else if(item->column() == 2)
{ {
QString data = item->text().replace(" ", "").toUpper(); QString data = item->text().remove(" ").toUpper();
if(data == "" || mifare->data_isDataValid(data) == Mifare::DATA_NOSPACE) if(data == "" || mifare->data_isDataValid(data) == Mifare::DATA_NOSPACE)
{ {
mifare->data_setData(item->row(), data); mifare->data_setData(item->row(), data);
@ -645,7 +645,7 @@ void MainWindow::on_MF_keyWidget_itemChanged(QTableWidgetItem *item)
{ {
if(item->column() == 1) if(item->column() == 1)
{ {
QString key = item->text().replace(" ", "").toUpper(); QString key = item->text().remove(" ").toUpper();
if(key == "" || mifare->data_isKeyValid(key)) if(key == "" || mifare->data_isKeyValid(key))
{ {
mifare->data_setKey(item->row(), Mifare::KEY_A, key); mifare->data_setKey(item->row(), Mifare::KEY_A, key);
@ -658,7 +658,7 @@ void MainWindow::on_MF_keyWidget_itemChanged(QTableWidgetItem *item)
} }
else if(item->column() == 2) else if(item->column() == 2)
{ {
QString key = item->text().replace(" ", "").toUpper(); QString key = item->text().remove(" ").toUpper();
if(key == "" || mifare->data_isKeyValid(key)) if(key == "" || mifare->data_isKeyValid(key))
{ {
mifare->data_setKey(item->row(), Mifare::KEY_B, key); mifare->data_setKey(item->row(), Mifare::KEY_B, key);

Loading…
Cancel
Save