Minor cleanups

This commit is contained in:
Florian Märkl 2017-05-06 12:46:28 +02:00 committed by C. Balles
parent b4f1a77a14
commit 9e729e56cd
3 changed files with 6 additions and 8 deletions

View File

@ -36,7 +36,7 @@ link_directories(${RADARE2_LIBRARY_DIRS})
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU"
OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
add_definitions(-Wall)
add_definitions(-Wall -Wextra)
endif()

View File

@ -10,19 +10,18 @@
FlagsModel::FlagsModel(QList<FlagDescription> *flags, MainWindow *main, QObject *parent)
FlagsModel::FlagsModel(QList<FlagDescription> *flags, QObject *parent)
: QAbstractListModel(parent),
main(main),
flags(flags)
{
}
int FlagsModel::rowCount(const QModelIndex &parent) const
int FlagsModel::rowCount(const QModelIndex &) const
{
return flags->count();
}
int FlagsModel::columnCount(const QModelIndex &parent) const
int FlagsModel::columnCount(const QModelIndex &) const
{
return Columns::COUNT;
}
@ -136,7 +135,7 @@ FlagsWidget::FlagsWidget(MainWindow *main, QWidget *parent) :
{
ui->setupUi(this);
flags_model = new FlagsModel(&flags, main, this);
flags_model = new FlagsModel(&flags, this);
flags_proxy_model = new FlagsSortFilterProxyModel(flags_model, this);
connect(ui->filterLineEdit, SIGNAL(textChanged(const QString &)), flags_proxy_model, SLOT(setFilterWildcard(const QString &)));
ui->flagsTreeView->setModel(flags_proxy_model);

View File

@ -18,14 +18,13 @@ class FlagsModel: public QAbstractListModel
Q_OBJECT
private:
MainWindow *main;
QList<FlagDescription> *flags;
public:
enum Columns { OFFSET = 0, SIZE, NAME, COUNT };
static const int FlagDescriptionRole = Qt::UserRole;
FlagsModel(QList<FlagDescription> *flags, MainWindow *main, QObject *parent = 0);
FlagsModel(QList<FlagDescription> *flags, QObject *parent = 0);
int rowCount(const QModelIndex &parent = QModelIndex()) const;
int columnCount(const QModelIndex &parent = QModelIndex()) const;