This commit is contained in:
mrexodia 2017-06-03 14:27:23 +02:00
parent 2b90122e92
commit 2e4c088eab
No known key found for this signature in database
GPG Key ID: FC89E0AAA0C1AAD8
11 changed files with 145 additions and 134 deletions

View File

@ -284,7 +284,7 @@ void MainWindow::openFile(const QString &fn, int anal_level)
{
QString project_name = qhelpers::uniqueProjectName(fn);
if(core->getProjectNames().contains(project_name))
if (core->getProjectNames().contains(project_name))
openProject(project_name);
else
openNewFile(fn, anal_level);
@ -298,7 +298,7 @@ void MainWindow::openNewFile(const QString &fn, int anal_level)
o->setAttribute(Qt::WA_DeleteOnClose);
o->show();
if(anal_level >= 0)
if (anal_level >= 0)
o->setupAndStartAnalysis(anal_level);
}

View File

@ -855,7 +855,7 @@ QStringList QRCore::getProjectNames()
QStringList ret;
QJsonArray jsonArray = cmdj("Plj").array();
for(QJsonValue value : jsonArray)
for (QJsonValue value : jsonArray)
ret.append(value.toString());
return ret;

View File

@ -234,7 +234,7 @@ void ConsoleWidget::historyNext()
{
if (lastHistoryPosition >= history.size())
{
lastHistoryPosition = history.size() -1 ;
lastHistoryPosition = history.size() - 1 ;
}
--lastHistoryPosition;
@ -257,7 +257,7 @@ void ConsoleWidget::historyPrev()
{
if (!history.isEmpty())
{
if (lastHistoryPosition >= history.size() -1)
if (lastHistoryPosition >= history.size() - 1)
{
lastHistoryPosition = history.size() - 2;
}

View File

@ -24,15 +24,15 @@ int ExportsModel::columnCount(const QModelIndex &) const
QVariant ExportsModel::data(const QModelIndex &index, int role) const
{
if(index.row() >= exports->count())
if (index.row() >= exports->count())
return QVariant();
const ExportDescription &exp = exports->at(index.row());
switch(role)
switch (role)
{
case Qt::DisplayRole:
switch(index.column())
switch (index.column())
{
case OFFSET:
return RAddressString(exp.vaddr);
@ -54,10 +54,10 @@ QVariant ExportsModel::data(const QModelIndex &index, int role) const
QVariant ExportsModel::headerData(int section, Qt::Orientation, int role) const
{
switch(role)
switch (role)
{
case Qt::DisplayRole:
switch(section)
switch (section)
{
case OFFSET:
return tr("Address");
@ -107,20 +107,20 @@ bool ExportsSortFilterProxyModel::lessThan(const QModelIndex &left, const QModel
ExportDescription left_exp = left.data(ExportsModel::ExportDescriptionRole).value<ExportDescription>();
ExportDescription right_exp = right.data(ExportsModel::ExportDescriptionRole).value<ExportDescription>();
switch(left.column())
switch (left.column())
{
case ExportsModel::SIZE:
if(left_exp.size != right_exp.size)
if (left_exp.size != right_exp.size)
return left_exp.size < right_exp.size;
// fallthrough
case ExportsModel::OFFSET:
if(left_exp.vaddr != right_exp.vaddr)
if (left_exp.vaddr != right_exp.vaddr)
return left_exp.vaddr < right_exp.vaddr;
// fallthrough
case ExportsModel::NAME:
return left_exp.name < right_exp.name;
case ExportsModel::TYPE:
if(left_exp.type != right_exp.type)
if (left_exp.type != right_exp.type)
return left_exp.type < right_exp.type;
default:
break;

View File

@ -28,15 +28,15 @@ int FlagsModel::columnCount(const QModelIndex &) const
QVariant FlagsModel::data(const QModelIndex &index, int role) const
{
if(index.row() >= flags->count())
if (index.row() >= flags->count())
return QVariant();
const FlagDescription &flag = flags->at(index.row());
switch(role)
switch (role)
{
case Qt::DisplayRole:
switch(index.column())
switch (index.column())
{
case SIZE:
return RSizeString(flag.size);
@ -56,10 +56,10 @@ QVariant FlagsModel::data(const QModelIndex &index, int role) const
QVariant FlagsModel::headerData(int section, Qt::Orientation, int role) const
{
switch(role)
switch (role)
{
case Qt::DisplayRole:
switch(section)
switch (section)
{
case SIZE:
return tr("Size");
@ -107,14 +107,14 @@ bool FlagsSortFilterProxyModel::lessThan(const QModelIndex &left, const QModelIn
FlagDescription left_flag = left.data(FlagsModel::FlagDescriptionRole).value<FlagDescription>();
FlagDescription right_flag = right.data(FlagsModel::FlagDescriptionRole).value<FlagDescription>();
switch(left.column())
switch (left.column())
{
case FlagsModel::SIZE:
if(left_flag.size != right_flag.size)
if (left_flag.size != right_flag.size)
return left_flag.size < right_flag.size;
// fallthrough
case FlagsModel::OFFSET:
if(left_flag.offset != right_flag.offset)
if (left_flag.offset != right_flag.offset)
return left_flag.offset < right_flag.offset;
// fallthrough
case FlagsModel::NAME:
@ -197,7 +197,7 @@ void FlagsWidget::refreshFlags()
QString flagspace;
QVariant flagspace_data = ui->flagspaceCombo->currentData();
if(flagspace_data.isValid())
if (flagspace_data.isValid())
flagspace = flagspace_data.value<FlagspaceDescription>().name;

View File

@ -617,18 +617,23 @@ void FunctionsWidget::setScrollMode()
qhelpers::setVerticalScrollMode(ui->functionsTreeView);
}
void FunctionsWidget::show_filter() {
void FunctionsWidget::show_filter()
{
ui->filterLineEdit->setVisible(true);
ui->closeFilterButton->setVisible(true);
ui->filterLineEdit->setFocus();
}
void FunctionsWidget::clear_filter() {
if (ui->filterLineEdit->text() == "") {
void FunctionsWidget::clear_filter()
{
if (ui->filterLineEdit->text() == "")
{
ui->filterLineEdit->setVisible(false);
ui->closeFilterButton->setVisible(false);
ui->functionsTreeView->setFocus();
} else {
}
else
{
ui->filterLineEdit->setText("");
}
}

View File

@ -754,7 +754,7 @@ void MemoryWidget::hexScrolled()
// To prevent recursive calls to hexScrolled (this function) blocks the
// scroll bar signals
auto appendTextWithoutSignals = [](QTextEdit *edit, const QString &text)
auto appendTextWithoutSignals = [](QTextEdit * edit, const QString & text)
{
edit->verticalScrollBar()->blockSignals(true);
edit->append(text);
@ -1573,7 +1573,9 @@ void MemoryWidget::create_graph(QString off)
if (settings.value("dark").toBool())
{
ui->graphWebView->page()->runJavaScript(QString("init_panel('dark');"));
} else {
}
else
{
ui->graphWebView->page()->runJavaScript(QString("init_panel('light');"));
}
}
@ -1622,7 +1624,8 @@ void MemoryWidget::on_disasTextEdit_2_cursorPositionChanged()
tc.select(QTextCursor::LineUnderCursor);
QString lastline = tc.selectedText().trimmed();
QList<QString> words = lastline.split(" ", QString::SkipEmptyParts);
if (words.length() == 0) {
if (words.length() == 0)
{
return;
}
QString ele = words[0];

View File

@ -10,7 +10,9 @@
Omnibar::Omnibar(MainWindow *main, QWidget *parent) :
QLineEdit(parent),
main(main),
commands({": Comments toggle",
commands(
{
": Comments toggle",
": Dashboard toggle",
": Exports toggle",
": Flags toggle",
@ -26,7 +28,8 @@ Omnibar::Omnibar(MainWindow *main, QWidget *parent) :
": Symbols toggle",
": Tabs up/down",
": Theme switch",
": Web server start/stop"})
": Web server start/stop"
})
{
// QLineEdit basic features
this->setMinimumHeight(16);

View File

@ -26,7 +26,7 @@ void SectionsWidget::setup()
int row = 0;
for (auto section : main->core->getAllSections())
{
if(!section.name.contains("."))
if (!section.name.contains("."))
continue;
fillSections(row++, section);