mirror of
https://github.com/rizinorg/cutter.git
synced 2025-01-18 02:25:26 +00:00
Fix many warnings and remove waste code (#81)
* Fixed a lot of warnings and removed waste code * Fixed more warnings and removed more waste code * restore XrefsDialog::updateLabels This function is used in memorywidget.cpp
This commit is contained in:
parent
95ca3d5d5b
commit
7c63a67575
@ -65,7 +65,6 @@ void createNewDialog::on_buttonCreate_clicked()
|
|||||||
bool created = false;
|
bool created = false;
|
||||||
|
|
||||||
QString arch = ui->comboArch->currentText();
|
QString arch = ui->comboArch->currentText();
|
||||||
int bits = atoi (ui->comboBits->currentText().toUtf8().constData());
|
|
||||||
int fsize = r_num_math (NULL, ui->entrySize->text().toUtf8().constData());
|
int fsize = r_num_math (NULL, ui->entrySize->text().toUtf8().constData());
|
||||||
QString format = ui->comboFormat->currentText();
|
QString format = ui->comboFormat->currentText();
|
||||||
|
|
||||||
|
@ -64,6 +64,8 @@ void XrefsDialog::fillRefs(QList<QStringList> refs, QList<QStringList> xrefs) {
|
|||||||
|
|
||||||
void XrefsDialog::on_fromTreeWidget_itemDoubleClicked(QTreeWidgetItem *item, int column)
|
void XrefsDialog::on_fromTreeWidget_itemDoubleClicked(QTreeWidgetItem *item, int column)
|
||||||
{
|
{
|
||||||
|
QNOTUSED(column);
|
||||||
|
|
||||||
QString offset = item->text(0);
|
QString offset = item->text(0);
|
||||||
RAnalFunction *fcn = this->main->core->functionAt(offset.toLongLong(0, 16));
|
RAnalFunction *fcn = this->main->core->functionAt(offset.toLongLong(0, 16));
|
||||||
//this->add_debug_output( fcn->name );
|
//this->add_debug_output( fcn->name );
|
||||||
@ -73,6 +75,8 @@ void XrefsDialog::on_fromTreeWidget_itemDoubleClicked(QTreeWidgetItem *item, int
|
|||||||
|
|
||||||
void XrefsDialog::on_toTreeWidget_itemDoubleClicked(QTreeWidgetItem *item, int column)
|
void XrefsDialog::on_toTreeWidget_itemDoubleClicked(QTreeWidgetItem *item, int column)
|
||||||
{
|
{
|
||||||
|
QNOTUSED(column);
|
||||||
|
|
||||||
QString offset = item->text(0);
|
QString offset = item->text(0);
|
||||||
RAnalFunction *fcn = this->main->core->functionAt(offset.toLongLong(0, 16));
|
RAnalFunction *fcn = this->main->core->functionAt(offset.toLongLong(0, 16));
|
||||||
//this->add_debug_output( fcn->name );
|
//this->add_debug_output( fcn->name );
|
||||||
@ -118,7 +122,8 @@ void XrefsDialog::on_fromTreeWidget_itemSelectionChanged()
|
|||||||
QString offset = item->text(0);
|
QString offset = item->text(0);
|
||||||
ui->previewTextEdit->setPlainText( this->main->core->cmd("pdf @ " + offset).trimmed() );
|
ui->previewTextEdit->setPlainText( this->main->core->cmd("pdf @ " + offset).trimmed() );
|
||||||
ui->previewTextEdit->moveCursor(QTextCursor::End);
|
ui->previewTextEdit->moveCursor(QTextCursor::End);
|
||||||
int pos = ui->previewTextEdit->find( this->normalizeAddr(offset), QTextDocument::FindBackward);
|
// Does it make any sense?
|
||||||
|
ui->previewTextEdit->find( this->normalizeAddr(offset), QTextDocument::FindBackward);
|
||||||
ui->previewTextEdit->moveCursor(QTextCursor::StartOfWord, QTextCursor::MoveAnchor);
|
ui->previewTextEdit->moveCursor(QTextCursor::StartOfWord, QTextCursor::MoveAnchor);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -128,7 +133,9 @@ void XrefsDialog::on_toTreeWidget_itemSelectionChanged()
|
|||||||
QString offset = item->text(0);
|
QString offset = item->text(0);
|
||||||
ui->previewTextEdit->setPlainText( this->main->core->cmd("pdf @ " + offset).trimmed() );
|
ui->previewTextEdit->setPlainText( this->main->core->cmd("pdf @ " + offset).trimmed() );
|
||||||
ui->previewTextEdit->moveCursor(QTextCursor::End);
|
ui->previewTextEdit->moveCursor(QTextCursor::End);
|
||||||
int pos = ui->previewTextEdit->find( this->normalizeAddr(offset), QTextDocument::FindBackward);
|
// Again, does it make any sense?
|
||||||
|
// Also, this code should be refactored and shared instead of copied & pasted
|
||||||
|
ui->previewTextEdit->find( this->normalizeAddr(offset), QTextDocument::FindBackward);
|
||||||
ui->previewTextEdit->moveCursor(QTextCursor::StartOfWord, QTextCursor::MoveAnchor);
|
ui->previewTextEdit->moveCursor(QTextCursor::StartOfWord, QTextCursor::MoveAnchor);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -36,22 +36,18 @@
|
|||||||
|
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|
||||||
namespace
|
static void registerCustomFonts()
|
||||||
{
|
{
|
||||||
void registerCustomFonts()
|
int ret = QFontDatabase::addApplicationFont(":/new/prefix1/fonts/Anonymous Pro.ttf");
|
||||||
{
|
assert(-1 != ret && "unable to register Anonymous Pro.ttf");
|
||||||
int ret = QFontDatabase::addApplicationFont(":/new/prefix1/fonts/Anonymous Pro.ttf");
|
|
||||||
assert(-1 != ret && "unable to register Anonymous Pro.ttf");
|
|
||||||
|
|
||||||
ret = QFontDatabase::addApplicationFont(":/new/prefix1/fonts/Inconsolata-Regular.ttf");
|
ret = QFontDatabase::addApplicationFont(":/new/prefix1/fonts/Inconsolata-Regular.ttf");
|
||||||
assert(-1 != ret && "unable to register Inconsolata-Regular.ttf");
|
assert(-1 != ret && "unable to register Inconsolata-Regular.ttf");
|
||||||
|
|
||||||
// do not issue a warning in release
|
// do not issue a warning in release
|
||||||
Q_UNUSED(ret)
|
Q_UNUSED(ret)
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
MainWindow::MainWindow(QWidget *parent, QRCore *kore) :
|
MainWindow::MainWindow(QWidget *parent, QRCore *kore) :
|
||||||
QMainWindow(parent),
|
QMainWindow(parent),
|
||||||
core(kore),
|
core(kore),
|
||||||
@ -752,26 +748,27 @@ void MainWindow::on_consoleInputLineEdit_returnPressed()
|
|||||||
ui->consoleOutputTextEdit->verticalScrollBar()->setValue(ui->consoleOutputTextEdit->verticalScrollBar()->maximum());
|
ui->consoleOutputTextEdit->verticalScrollBar()->setValue(ui->consoleOutputTextEdit->verticalScrollBar()->maximum());
|
||||||
// Add new command to history
|
// Add new command to history
|
||||||
QCompleter *completer = ui->consoleInputLineEdit->completer();
|
QCompleter *completer = ui->consoleInputLineEdit->completer();
|
||||||
/*
|
if ( completer != NULL ) {
|
||||||
* TODO: FIXME: Crashed the fucking app
|
QStringListModel *completerModel = (QStringListModel*)(completer->model());
|
||||||
* ballessay: yes this will crash if no completer is set -> nullptr
|
if ( completerModel != NULL )
|
||||||
*/
|
completerModel->setStringList(completerModel->stringList() << input);
|
||||||
//QStringListModel *completerModel = (QStringListModel*)(completer->model());
|
}
|
||||||
//completerModel->setStringList(completerModel->stringList() << input);
|
|
||||||
ui->consoleInputLineEdit->setText("");
|
ui->consoleInputLineEdit->setText("");
|
||||||
// TODO: add checkbox to enable/disable updating the whole ui or just update the list widgets, not disasm/hex
|
|
||||||
//this->updateFrames();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::on_showHistoToolButton_clicked()
|
void MainWindow::on_showHistoToolButton_clicked()
|
||||||
{
|
{
|
||||||
|
QCompleter *completer = ui->consoleInputLineEdit->completer();
|
||||||
|
if (completer == NULL)
|
||||||
|
return;
|
||||||
|
|
||||||
if (ui->showHistoToolButton->isChecked()) {
|
if (ui->showHistoToolButton->isChecked()) {
|
||||||
QCompleter *completer = ui->consoleInputLineEdit->completer();
|
|
||||||
completer->setCompletionMode(QCompleter::UnfilteredPopupCompletion);
|
completer->setCompletionMode(QCompleter::UnfilteredPopupCompletion);
|
||||||
|
// Uhm... shouldn't it be called always?
|
||||||
completer->complete();
|
completer->complete();
|
||||||
} else {
|
} else {
|
||||||
QCompleter *completer = ui->consoleInputLineEdit->completer();
|
|
||||||
completer->setCompletionMode(QCompleter::PopupCompletion);
|
completer->setCompletionMode(QCompleter::PopupCompletion);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -11,6 +11,8 @@
|
|||||||
const int NewFileDialog::MaxRecentFiles;
|
const int NewFileDialog::MaxRecentFiles;
|
||||||
|
|
||||||
static QColor getColorFor(QString str, int pos) {
|
static QColor getColorFor(QString str, int pos) {
|
||||||
|
QNOTUSED(str);
|
||||||
|
|
||||||
QList<QColor> Colors;
|
QList<QColor> Colors;
|
||||||
Colors << QColor(29, 188, 156); // Turquoise
|
Colors << QColor(29, 188, 156); // Turquoise
|
||||||
Colors << QColor(52, 152, 219); // Blue
|
Colors << QColor(52, 152, 219); // Blue
|
||||||
|
@ -149,6 +149,10 @@ QString QRCore::cmd(const QString &str) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool QRCore::loadFile(QString path, uint64_t loadaddr=0LL, uint64_t mapaddr=0LL, bool rw=false, int va=0, int bits = 0, int idx, bool loadbin) {
|
bool QRCore::loadFile(QString path, uint64_t loadaddr=0LL, uint64_t mapaddr=0LL, bool rw=false, int va=0, int bits = 0, int idx, bool loadbin) {
|
||||||
|
|
||||||
|
QNOTUSED(loadaddr);
|
||||||
|
QNOTUSED(idx);
|
||||||
|
|
||||||
RCoreFile *f;
|
RCoreFile *f;
|
||||||
if (va==0 || va == 2)
|
if (va==0 || va == 2)
|
||||||
r_config_set_i (core->config, "io.va", va);
|
r_config_set_i (core->config, "io.va", va);
|
||||||
@ -455,9 +459,9 @@ int QRCore::fcnEndBbs(QString addr) {
|
|||||||
QString endbbs = tmp.split(": ")[1];
|
QString endbbs = tmp.split(": ")[1];
|
||||||
return endbbs.toInt();
|
return endbbs.toInt();
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
QString QRCore::itoa(ut64 num, int rdx) {
|
QString QRCore::itoa(ut64 num, int rdx) {
|
||||||
@ -483,6 +487,8 @@ int QRCore::config(const QString &k, int v) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void QRCore::setOptions(QString key) {
|
void QRCore::setOptions(QString key) {
|
||||||
|
QNOTUSED(key);
|
||||||
|
|
||||||
// va
|
// va
|
||||||
// lowercase
|
// lowercase
|
||||||
// show bytes
|
// show bytes
|
||||||
|
@ -27,6 +27,7 @@
|
|||||||
#define __alert(x) QMessageBox::question (this, "Alert", QString(x), QMessageBox::Ok)
|
#define __alert(x) QMessageBox::question (this, "Alert", QString(x), QMessageBox::Ok)
|
||||||
#define __question(x) (QMessageBox::Yes==QMessageBox::question (this, "Alert", QString(x), QMessageBox::Yes| QMessageBox::No))
|
#define __question(x) (QMessageBox::Yes==QMessageBox::question (this, "Alert", QString(x), QMessageBox::Yes| QMessageBox::No))
|
||||||
|
|
||||||
|
#define QNOTUSED(x) do { (void)(x); } while ( 0 );
|
||||||
|
|
||||||
class QRCore : public QObject
|
class QRCore : public QObject
|
||||||
{
|
{
|
||||||
|
@ -9,6 +9,10 @@ QRDisasm::QRDisasm(QRCore *core)
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool QRDisasm::disassembleAt (ut64 addr, QRDisasmOption opt, QRDisasmRow &dr) {
|
bool QRDisasm::disassembleAt (ut64 addr, QRDisasmOption opt, QRDisasmRow &dr) {
|
||||||
|
QNOTUSED(addr);
|
||||||
|
QNOTUSED(opt);
|
||||||
|
QNOTUSED(dr);
|
||||||
|
|
||||||
printf ("FUCK\n");
|
printf ("FUCK\n");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -13,6 +13,8 @@
|
|||||||
GraphicsBar::GraphicsBar(MainWindow *main, QWidget *parent) :
|
GraphicsBar::GraphicsBar(MainWindow *main, QWidget *parent) :
|
||||||
QToolBar(main)
|
QToolBar(main)
|
||||||
{
|
{
|
||||||
|
QNOTUSED(parent);
|
||||||
|
|
||||||
setObjectName("codeGraphics");
|
setObjectName("codeGraphics");
|
||||||
setWindowTitle("Code bar");
|
setWindowTitle("Code bar");
|
||||||
// setMovable(false);
|
// setMovable(false);
|
||||||
@ -40,9 +42,11 @@ GraphicsBar::GraphicsBar(MainWindow *main, QWidget *parent) :
|
|||||||
}
|
}
|
||||||
|
|
||||||
void GraphicsBar::paintEvent(QPaintEvent *event) {
|
void GraphicsBar::paintEvent(QPaintEvent *event) {
|
||||||
QPainter painter(this);
|
QNOTUSED(event);
|
||||||
this->fillData();
|
|
||||||
}
|
QPainter painter(this);
|
||||||
|
this->fillData();
|
||||||
|
}
|
||||||
|
|
||||||
void GraphicsBar::fillData() {
|
void GraphicsBar::fillData() {
|
||||||
|
|
||||||
@ -61,7 +65,6 @@ void GraphicsBar::fillData() {
|
|||||||
|
|
||||||
// Parse JSON data
|
// Parse JSON data
|
||||||
QString jsonData = this->main->core->cmd("p-j");
|
QString jsonData = this->main->core->cmd("p-j");
|
||||||
QJsonParseError *err = new QJsonParseError();
|
|
||||||
QJsonDocument doc = QJsonDocument::fromJson(jsonData.toUtf8());
|
QJsonDocument doc = QJsonDocument::fromJson(jsonData.toUtf8());
|
||||||
|
|
||||||
if (doc.isNull()) {
|
if (doc.isNull()) {
|
||||||
|
@ -38,6 +38,8 @@ CommentsWidget::~CommentsWidget()
|
|||||||
|
|
||||||
void CommentsWidget::on_commentsTreeWidget_itemDoubleClicked(QTreeWidgetItem *item, int column)
|
void CommentsWidget::on_commentsTreeWidget_itemDoubleClicked(QTreeWidgetItem *item, int column)
|
||||||
{
|
{
|
||||||
|
QNOTUSED(column);
|
||||||
|
|
||||||
// Get offset and name of item double clicked
|
// Get offset and name of item double clicked
|
||||||
// TODO: use this info to change disasm contents
|
// TODO: use this info to change disasm contents
|
||||||
QString offset = item->text(1);
|
QString offset = item->text(1);
|
||||||
|
@ -133,9 +133,6 @@ void Dashboard::updateContents() {
|
|||||||
// Get stats for the graphs
|
// Get stats for the graphs
|
||||||
QStringList stats = this->main->core->getStats();
|
QStringList stats = this->main->core->getStats();
|
||||||
|
|
||||||
// Calculate total amount flags all + imports
|
|
||||||
int total = stats[6].toInt() + stats[1].toInt();
|
|
||||||
|
|
||||||
// Add data to HTML graphs (stats)
|
// Add data to HTML graphs (stats)
|
||||||
QFile html(":/html/stats.html");
|
QFile html(":/html/stats.html");
|
||||||
if(!html.open(QIODevice::ReadOnly)) {
|
if(!html.open(QIODevice::ReadOnly)) {
|
||||||
|
@ -23,6 +23,8 @@ FlagsWidget::~FlagsWidget()
|
|||||||
|
|
||||||
void FlagsWidget::on_flagsTreeWidget_itemDoubleClicked(QTreeWidgetItem *item, int column)
|
void FlagsWidget::on_flagsTreeWidget_itemDoubleClicked(QTreeWidgetItem *item, int column)
|
||||||
{
|
{
|
||||||
|
QNOTUSED(column);
|
||||||
|
|
||||||
QString offset = item->text(2);
|
QString offset = item->text(2);
|
||||||
QString name = item->text(3);
|
QString name = item->text(3);
|
||||||
this->main->seek(offset, name);
|
this->main->seek(offset, name);
|
||||||
@ -30,5 +32,7 @@ void FlagsWidget::on_flagsTreeWidget_itemDoubleClicked(QTreeWidgetItem *item, in
|
|||||||
|
|
||||||
void FlagsWidget::on_flagspaceCombo_currentTextChanged(const QString &arg1)
|
void FlagsWidget::on_flagspaceCombo_currentTextChanged(const QString &arg1)
|
||||||
{
|
{
|
||||||
|
QNOTUSED(arg1);
|
||||||
|
|
||||||
this->main->refreshFlags();
|
this->main->refreshFlags();
|
||||||
}
|
}
|
||||||
|
@ -94,6 +94,8 @@ void FunctionsWidget::fillFunctions() {
|
|||||||
|
|
||||||
void FunctionsWidget::on_functionsTreeWidget_itemDoubleClicked(QTreeWidgetItem *item, int column)
|
void FunctionsWidget::on_functionsTreeWidget_itemDoubleClicked(QTreeWidgetItem *item, int column)
|
||||||
{
|
{
|
||||||
|
QNOTUSED(column);
|
||||||
|
|
||||||
QString offset = item->text(1);
|
QString offset = item->text(1);
|
||||||
QString name = item->text(3);
|
QString name = item->text(3);
|
||||||
this->main->seek(offset, name);
|
this->main->seek(offset, name);
|
||||||
@ -281,7 +283,6 @@ void FunctionsWidget::on_action_References_triggered()
|
|||||||
x->setWindowTitle("X-Refs for function " + QString::fromUtf8(fcn->name));
|
x->setWindowTitle("X-Refs for function " + QString::fromUtf8(fcn->name));
|
||||||
|
|
||||||
// Get Refs and Xrefs
|
// Get Refs and Xrefs
|
||||||
bool ok;
|
|
||||||
QList<QStringList> ret_refs;
|
QList<QStringList> ret_refs;
|
||||||
QList<QStringList> ret_xrefs;
|
QList<QStringList> ret_xrefs;
|
||||||
|
|
||||||
@ -353,6 +354,8 @@ void FunctionsWidget::on_actionVertical_triggered()
|
|||||||
|
|
||||||
void FunctionsWidget::on_nestedFunctionsTree_itemDoubleClicked(QTreeWidgetItem *item, int column)
|
void FunctionsWidget::on_nestedFunctionsTree_itemDoubleClicked(QTreeWidgetItem *item, int column)
|
||||||
{
|
{
|
||||||
|
QNOTUSED(column);
|
||||||
|
|
||||||
//QString offset = item->text(1);
|
//QString offset = item->text(1);
|
||||||
QString name = item->text(0);
|
QString name = item->text(0);
|
||||||
QString offset = item->child(0)->text(0).split(":")[1];
|
QString offset = item->child(0)->text(0).split(":")[1];
|
||||||
|
@ -147,8 +147,6 @@ void Notepad::on_searchEdit_returnPressed()
|
|||||||
QString searchString = ui->searchEdit->text();
|
QString searchString = ui->searchEdit->text();
|
||||||
QTextDocument *document = ui->notepadTextEdit->document();
|
QTextDocument *document = ui->notepadTextEdit->document();
|
||||||
|
|
||||||
bool found = false;
|
|
||||||
|
|
||||||
if (isFirstTime == false)
|
if (isFirstTime == false)
|
||||||
document->undo();
|
document->undo();
|
||||||
|
|
||||||
@ -167,7 +165,6 @@ void Notepad::on_searchEdit_returnPressed()
|
|||||||
highlightCursor = document->find(searchString, highlightCursor, QTextDocument::FindWholeWords);
|
highlightCursor = document->find(searchString, highlightCursor, QTextDocument::FindWholeWords);
|
||||||
|
|
||||||
if (!highlightCursor.isNull()) {
|
if (!highlightCursor.isNull()) {
|
||||||
found = true;
|
|
||||||
highlightCursor.movePosition(QTextCursor::WordRight,
|
highlightCursor.movePosition(QTextCursor::WordRight,
|
||||||
QTextCursor::KeepAnchor);
|
QTextCursor::KeepAnchor);
|
||||||
highlightCursor.mergeCharFormat(colorFormat);
|
highlightCursor.mergeCharFormat(colorFormat);
|
||||||
@ -176,23 +173,16 @@ void Notepad::on_searchEdit_returnPressed()
|
|||||||
|
|
||||||
cursor.endEditBlock();
|
cursor.endEditBlock();
|
||||||
isFirstTime = false;
|
isFirstTime = false;
|
||||||
|
|
||||||
/*
|
|
||||||
if (found == false) {
|
|
||||||
QMessageBox::information(this, tr("Word Not Found"),
|
|
||||||
"Sorry, the word cannot be found.");
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Notepad::on_searchEdit_textEdited(const QString &arg1)
|
void Notepad::on_searchEdit_textEdited(const QString &arg1)
|
||||||
{
|
{
|
||||||
|
QNOTUSED(arg1);
|
||||||
|
|
||||||
QString searchString = ui->searchEdit->text();
|
QString searchString = ui->searchEdit->text();
|
||||||
QTextDocument *document = ui->notepadTextEdit->document();
|
QTextDocument *document = ui->notepadTextEdit->document();
|
||||||
|
|
||||||
bool found = false;
|
|
||||||
|
|
||||||
if (isFirstTime == false)
|
if (isFirstTime == false)
|
||||||
document->undo();
|
document->undo();
|
||||||
|
|
||||||
@ -211,7 +201,6 @@ void Notepad::on_searchEdit_textEdited(const QString &arg1)
|
|||||||
highlightCursor = document->find(searchString, highlightCursor);
|
highlightCursor = document->find(searchString, highlightCursor);
|
||||||
|
|
||||||
if (!highlightCursor.isNull()) {
|
if (!highlightCursor.isNull()) {
|
||||||
found = true;
|
|
||||||
//highlightCursor.movePosition(QTextCursor::WordRight,
|
//highlightCursor.movePosition(QTextCursor::WordRight,
|
||||||
// QTextCursor::KeepAnchor);
|
// QTextCursor::KeepAnchor);
|
||||||
highlightCursor.mergeCharFormat(colorFormat);
|
highlightCursor.mergeCharFormat(colorFormat);
|
||||||
@ -225,11 +214,11 @@ void Notepad::on_searchEdit_textEdited(const QString &arg1)
|
|||||||
|
|
||||||
void Notepad::on_searchEdit_textChanged(const QString &arg1)
|
void Notepad::on_searchEdit_textChanged(const QString &arg1)
|
||||||
{
|
{
|
||||||
|
QNOTUSED(arg1);
|
||||||
|
|
||||||
QString searchString = ui->searchEdit->text();
|
QString searchString = ui->searchEdit->text();
|
||||||
QTextDocument *document = ui->notepadTextEdit->document();
|
QTextDocument *document = ui->notepadTextEdit->document();
|
||||||
|
|
||||||
bool found = false;
|
|
||||||
|
|
||||||
if (isFirstTime == false)
|
if (isFirstTime == false)
|
||||||
document->undo();
|
document->undo();
|
||||||
|
|
||||||
@ -248,7 +237,6 @@ void Notepad::on_searchEdit_textChanged(const QString &arg1)
|
|||||||
highlightCursor = document->find(searchString, highlightCursor);
|
highlightCursor = document->find(searchString, highlightCursor);
|
||||||
|
|
||||||
if (!highlightCursor.isNull()) {
|
if (!highlightCursor.isNull()) {
|
||||||
found = true;
|
|
||||||
//highlightCursor.movePosition(QTextCursor::WordRight,
|
//highlightCursor.movePosition(QTextCursor::WordRight,
|
||||||
// QTextCursor::KeepAnchor);
|
// QTextCursor::KeepAnchor);
|
||||||
highlightCursor.mergeCharFormat(colorFormat);
|
highlightCursor.mergeCharFormat(colorFormat);
|
||||||
|
@ -92,7 +92,7 @@ void Omnibar::clearContents() {
|
|||||||
void Omnibar::on_gotoEntry_returnPressed()
|
void Omnibar::on_gotoEntry_returnPressed()
|
||||||
{
|
{
|
||||||
QString str = this->text();
|
QString str = this->text();
|
||||||
if (str.length()>0)
|
if (str.length()>0) {
|
||||||
if (str.contains(": ")) {
|
if (str.contains(": ")) {
|
||||||
if (str.contains("Lock")){
|
if (str.contains("Lock")){
|
||||||
this->main->on_actionLock_triggered();
|
this->main->on_actionLock_triggered();
|
||||||
@ -128,6 +128,8 @@ void Omnibar::on_gotoEntry_returnPressed()
|
|||||||
QString off = this->main->core->cmd("afo " + this->text());
|
QString off = this->main->core->cmd("afo " + this->text());
|
||||||
this->main->seek(off.trimmed(), this->text());
|
this->main->seek(off.trimmed(), this->text());
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// check which tab is open? update all tabs? hex, graph?
|
// check which tab is open? update all tabs? hex, graph?
|
||||||
//refreshMem( this->gotoEntry->text() );
|
//refreshMem( this->gotoEntry->text() );
|
||||||
this->setText("");
|
this->setText("");
|
||||||
|
@ -46,6 +46,7 @@
|
|||||||
#define M_PI 3.1415927
|
#define M_PI 3.1415927
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include "qrcore.h"
|
||||||
#include "pieview.h"
|
#include "pieview.h"
|
||||||
|
|
||||||
PieView::PieView(QWidget *parent)
|
PieView::PieView(QWidget *parent)
|
||||||
@ -450,6 +451,8 @@ void PieView::scrollTo(const QModelIndex &index, ScrollHint)
|
|||||||
|
|
||||||
void PieView::setSelection(const QRect &rect, QItemSelectionModel::SelectionFlags command)
|
void PieView::setSelection(const QRect &rect, QItemSelectionModel::SelectionFlags command)
|
||||||
{
|
{
|
||||||
|
QNOTUSED(command);
|
||||||
|
|
||||||
// Use content widget coordinates because we will use the itemRegion()
|
// Use content widget coordinates because we will use the itemRegion()
|
||||||
// function to check for intersections.
|
// function to check for intersections.
|
||||||
|
|
||||||
|
@ -21,6 +21,8 @@ RelocsWidget::~RelocsWidget()
|
|||||||
|
|
||||||
void RelocsWidget::on_relocsTreeWidget_itemDoubleClicked(QTreeWidgetItem *item, int column)
|
void RelocsWidget::on_relocsTreeWidget_itemDoubleClicked(QTreeWidgetItem *item, int column)
|
||||||
{
|
{
|
||||||
|
QNOTUSED(column);
|
||||||
|
|
||||||
// Get offset and name of item double clicked
|
// Get offset and name of item double clicked
|
||||||
// TODO: use this info to change disasm contents
|
// TODO: use this info to change disasm contents
|
||||||
QString offset = item->text(1);
|
QString offset = item->text(1);
|
||||||
|
@ -9,6 +9,8 @@
|
|||||||
SectionsWidget::SectionsWidget(MainWindow *main, QWidget *parent) :
|
SectionsWidget::SectionsWidget(MainWindow *main, QWidget *parent) :
|
||||||
QSplitter(main)
|
QSplitter(main)
|
||||||
{
|
{
|
||||||
|
QNOTUSED(parent);
|
||||||
|
|
||||||
this->main = main;
|
this->main = main;
|
||||||
//setupModel();
|
//setupModel();
|
||||||
setupViews();
|
setupViews();
|
||||||
|
@ -22,6 +22,8 @@ StringsWidget::~StringsWidget()
|
|||||||
|
|
||||||
void StringsWidget::on_stringsTreeWidget_itemDoubleClicked(QTreeWidgetItem *item, int column)
|
void StringsWidget::on_stringsTreeWidget_itemDoubleClicked(QTreeWidgetItem *item, int column)
|
||||||
{
|
{
|
||||||
|
QNOTUSED(column);
|
||||||
|
|
||||||
// Get offset and name of item double clicked
|
// Get offset and name of item double clicked
|
||||||
// TODO: use this info to change disasm contents
|
// TODO: use this info to change disasm contents
|
||||||
QString offset = item->text(1);
|
QString offset = item->text(1);
|
||||||
|
@ -29,6 +29,8 @@ void SymbolsWidget::fillSymbols() {
|
|||||||
|
|
||||||
void SymbolsWidget::on_symbolsTreeWidget_itemDoubleClicked(QTreeWidgetItem *item, int column)
|
void SymbolsWidget::on_symbolsTreeWidget_itemDoubleClicked(QTreeWidgetItem *item, int column)
|
||||||
{
|
{
|
||||||
|
QNOTUSED(column);
|
||||||
|
|
||||||
// Get offset and name of item double clicked
|
// Get offset and name of item double clicked
|
||||||
// TODO: use this info to change disasm contents
|
// TODO: use this info to change disasm contents
|
||||||
QString offset = item->text(1);
|
QString offset = item->text(1);
|
||||||
|
Loading…
Reference in New Issue
Block a user