mirror of
https://github.com/rizinorg/cutter.git
synced 2024-12-18 19:06:10 +00:00
Make SearchWidget set search.in only locally (#2578)
This commit is contained in:
parent
753d4a7bb5
commit
3c2b263de7
3
.gitignore
vendored
3
.gitignore
vendored
@ -96,5 +96,6 @@ src/out
|
|||||||
# astyle backup .orig files
|
# astyle backup .orig files
|
||||||
*.orig
|
*.orig
|
||||||
|
|
||||||
# Gdb's history
|
# Local gdb files
|
||||||
.gdb_history
|
.gdb_history
|
||||||
|
.gdbinit
|
||||||
|
@ -3349,12 +3349,17 @@ bool CutterCore::isAddressMapped(RVA addr)
|
|||||||
return !Core()->cmdRawAt(QString("om."), addr).isEmpty();
|
return !Core()->cmdRawAt(QString("om."), addr).isEmpty();
|
||||||
}
|
}
|
||||||
|
|
||||||
QList<SearchDescription> CutterCore::getAllSearch(QString search_for, QString space)
|
QList<SearchDescription> CutterCore::getAllSearch(QString searchFor, QString space, QString in)
|
||||||
{
|
{
|
||||||
CORE_LOCK();
|
CORE_LOCK();
|
||||||
QList<SearchDescription> searchRef;
|
QList<SearchDescription> searchRef;
|
||||||
|
|
||||||
QJsonArray searchArray = cmdj(space + QString(" ") + search_for).array();
|
QJsonArray searchArray;
|
||||||
|
{
|
||||||
|
TempConfig cfg;
|
||||||
|
cfg.set("search.in", in);
|
||||||
|
searchArray = cmdj(QString("%1 %2").arg(space, searchFor)).array();
|
||||||
|
}
|
||||||
|
|
||||||
if (space == "/Rj") {
|
if (space == "/Rj") {
|
||||||
for (const QJsonValue &value : searchArray) {
|
for (const QJsonValue &value : searchArray) {
|
||||||
|
@ -557,7 +557,7 @@ public:
|
|||||||
bool isAddressMapped(RVA addr);
|
bool isAddressMapped(RVA addr);
|
||||||
|
|
||||||
QList<MemoryMapDescription> getMemoryMap();
|
QList<MemoryMapDescription> getMemoryMap();
|
||||||
QList<SearchDescription> getAllSearch(QString search_for, QString space);
|
QList<SearchDescription> getAllSearch(QString searchFor, QString space, QString in);
|
||||||
BlockStatistics getBlockStatistics(unsigned int blocksCount);
|
BlockStatistics getBlockStatistics(unsigned int blocksCount);
|
||||||
QList<BreakpointDescription> getBreakpoints();
|
QList<BreakpointDescription> getBreakpoints();
|
||||||
QList<ProcessDescription> getAllProcesses();
|
QList<ProcessDescription> getAllProcesses();
|
||||||
|
@ -227,7 +227,6 @@ void SearchWidget::updateSearchBoundaries()
|
|||||||
|
|
||||||
mapIter = boundaries.cbegin();
|
mapIter = boundaries.cbegin();
|
||||||
ui->searchInCombo->setCurrentIndex(ui->searchInCombo->findData(mapIter.key()));
|
ui->searchInCombo->setCurrentIndex(ui->searchInCombo->findData(mapIter.key()));
|
||||||
Config()->setConfig("search.in", mapIter.key());
|
|
||||||
|
|
||||||
ui->searchInCombo->blockSignals(true);
|
ui->searchInCombo->blockSignals(true);
|
||||||
ui->searchInCombo->clear();
|
ui->searchInCombo->clear();
|
||||||
@ -265,12 +264,12 @@ void SearchWidget::refreshSearchspaces()
|
|||||||
|
|
||||||
void SearchWidget::refreshSearch()
|
void SearchWidget::refreshSearch()
|
||||||
{
|
{
|
||||||
QString search_for = ui->filterLineEdit->text();
|
QString searchFor = ui->filterLineEdit->text();
|
||||||
QVariant searchspace_data = ui->searchspaceCombo->currentData();
|
QString searchSpace = ui->searchspaceCombo->currentData().toString();
|
||||||
QString searchspace = searchspace_data.toString();
|
QString searchIn = ui->searchInCombo->currentData().toString();
|
||||||
|
|
||||||
search_model->beginResetModel();
|
search_model->beginResetModel();
|
||||||
search = Core()->getAllSearch(search_for, searchspace);
|
search = Core()->getAllSearch(searchFor, searchSpace, searchIn);
|
||||||
search_model->endResetModel();
|
search_model->endResetModel();
|
||||||
|
|
||||||
qhelpers::adjustColumns(ui->searchTreeView, 3, 0);
|
qhelpers::adjustColumns(ui->searchTreeView, 3, 0);
|
||||||
@ -313,9 +312,3 @@ void SearchWidget::updatePlaceholderText(int index)
|
|||||||
ui->filterLineEdit->setPlaceholderText("jmp rax");
|
ui->filterLineEdit->setPlaceholderText("jmp rax");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void SearchWidget::on_searchInCombo_currentIndexChanged(int index)
|
|
||||||
{
|
|
||||||
Config()->setConfig("search.in",
|
|
||||||
ui->searchInCombo->itemData(index).toString());
|
|
||||||
}
|
|
||||||
|
@ -68,7 +68,6 @@ public:
|
|||||||
~SearchWidget();
|
~SearchWidget();
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void on_searchInCombo_currentIndexChanged(int index);
|
|
||||||
void searchChanged();
|
void searchChanged();
|
||||||
void updateSearchBoundaries();
|
void updateSearchBoundaries();
|
||||||
void refreshSearchspaces();
|
void refreshSearchspaces();
|
||||||
|
Loading…
Reference in New Issue
Block a user