AStyle format

This commit is contained in:
ballessay 2017-04-13 17:51:58 +02:00 committed by C. Balles
parent ad0de05654
commit 312cc9b912
10 changed files with 55 additions and 38 deletions

View File

@ -723,7 +723,8 @@ void MainWindow::seek(const QString &offset, const QString &name)
{ {
if (offset.length() == 0) if (offset.length() == 0)
return; return;
if (name != NULL) { if (name != NULL)
{
this->memoryDock->setWindowTitle(name); this->memoryDock->setWindowTitle(name);
this->current_address = name; this->current_address = name;
} }
@ -854,7 +855,8 @@ void MainWindow::showDefaultDocks()
importsDock, importsDock,
symbolsDock, symbolsDock,
notepadDock, notepadDock,
dashboardDock}; dashboardDock
};
for (auto w : dockWidgets) for (auto w : dockWidgets)
{ {
@ -1035,7 +1037,8 @@ void MainWindow::refreshVisibleDockWidgets()
{ {
// There seems to be no convenience function to check if a QDockWidget // There seems to be no convenience function to check if a QDockWidget
// is really visible or hidden in a tabbed dock. So: // is really visible or hidden in a tabbed dock. So:
auto isDockVisible = [](const QDockWidget * const pWidget) { auto isDockVisible = [](const QDockWidget * const pWidget)
{
return pWidget != nullptr && !pWidget->visibleRegion().isEmpty(); return pWidget != nullptr && !pWidget->visibleRegion().isEmpty();
}; };

View File

@ -533,9 +533,12 @@ void MemoryWidget::refreshDisasm(const QString &offset)
if (ele.contains("0x")) if (ele.contains("0x"))
{ {
QString fcn = this->main->core->cmdFunctionAt(ele); QString fcn = this->main->core->cmdFunctionAt(ele);
if (fcn != "") { if (fcn != "")
{
this->main->core->cmd("s " + fcn); this->main->core->cmd("s " + fcn);
} else { }
else
{
this->main->core->cmd("s " + ele); this->main->core->cmd("s " + ele);
} }
} }
@ -1834,7 +1837,8 @@ void MemoryWidget::on_actionXRefs_triggered()
{ {
// Get function for clicked offset // Get function for clicked offset
RAnalFunction *fcn = this->main->core->functionAt(ele.toLongLong(0, 16)); RAnalFunction *fcn = this->main->core->functionAt(ele.toLongLong(0, 16));
if (!fcn) { if (!fcn)
{
return; return;
} }
XrefsDialog *x = new XrefsDialog(this->main, this); XrefsDialog *x = new XrefsDialog(this->main, this);
@ -1980,27 +1984,36 @@ void MemoryWidget::on_memTabWidget_currentChanged(int /*index*/)
this->updateViews(); this->updateViews();
} }
void MemoryWidget::updateViews() { void MemoryWidget::updateViews()
{
// Update only the selected view to improve performance // Update only the selected view to improve performance
int index = ui->memTabWidget->tabBar()->currentIndex(); int index = ui->memTabWidget->tabBar()->currentIndex();
if (index == 0) { if (index == 0)
{
// Disasm // Disasm
if (this->last_disasm_fcn != this->main->current_address) { if (this->last_disasm_fcn != this->main->current_address)
{
//this->main->add_debug_output("Doing disasm"); //this->main->add_debug_output("Doing disasm");
this->refreshDisasm(this->main->current_address); this->refreshDisasm(this->main->current_address);
this->last_disasm_fcn = this->main->current_address; this->last_disasm_fcn = this->main->current_address;
} }
} else if (index == 1) { }
else if (index == 1)
{
// Hex // Hex
if (this->last_hexdump_fcn != this->main->current_address) { if (this->last_hexdump_fcn != this->main->current_address)
{
//this->main->add_debug_output("Doing hex"); //this->main->add_debug_output("Doing hex");
this->refreshHexdump(this->main->current_address); this->refreshHexdump(this->main->current_address);
this->last_hexdump_fcn = this->main->current_address; this->last_hexdump_fcn = this->main->current_address;
} }
} else if (index == 2) { }
else if (index == 2)
{
// Graph // Graph
if (this->last_graph_fcn != this->main->current_address) { if (this->last_graph_fcn != this->main->current_address)
{
//this->main->add_debug_output("Doing graph"); //this->main->add_debug_output("Doing graph");
this->create_graph(this->main->current_address); this->create_graph(this->main->current_address);
this->last_graph_fcn = this->main->current_address; this->last_graph_fcn = this->main->current_address;

View File

@ -95,7 +95,8 @@ void SectionsWidget::fillSections(int row, const QString &str, const QString &st
QColor("#E74C3C"), //ALIZARIN QColor("#E74C3C"), //ALIZARIN
QColor("#ECF0F1"), //CLOUDS QColor("#ECF0F1"), //CLOUDS
QColor("#BDC3C7"), //SILVER QColor("#BDC3C7"), //SILVER
QColor("#95A5A6")}; //COBCRETE QColor("#95A5A6") //COBCRETE
};
QTreeWidgetItem *tempItem = new QTreeWidgetItem(); QTreeWidgetItem *tempItem = new QTreeWidgetItem();
tempItem->setText(0, str); tempItem->setText(0, str);