mirror of
https://github.com/rizinorg/cutter.git
synced 2025-02-20 13:46:06 +00:00
Remove useless begin-/end-ReloadModel methods (#793)
This commit is contained in:
parent
cd4b86fa69
commit
8d3e8a65e1
@ -74,16 +74,6 @@ QVariant BreakpointModel::headerData(int section, Qt::Orientation, int role) con
|
||||
}
|
||||
}
|
||||
|
||||
void BreakpointModel::beginReloadBreakpoint()
|
||||
{
|
||||
beginResetModel();
|
||||
}
|
||||
|
||||
void BreakpointModel::endReloadBreakpoint()
|
||||
{
|
||||
endResetModel();
|
||||
}
|
||||
|
||||
BreakpointProxyModel::BreakpointProxyModel(BreakpointModel *sourceModel, QObject *parent)
|
||||
: QSortFilterProxyModel(parent)
|
||||
{
|
||||
@ -152,9 +142,9 @@ BreakpointWidget::~BreakpointWidget() {}
|
||||
|
||||
void BreakpointWidget::refreshBreakpoint()
|
||||
{
|
||||
breakpointModel->beginReloadBreakpoint();
|
||||
breakpointModel->beginResetModel();
|
||||
breakpoints = Core()->getBreakpoints();
|
||||
breakpointModel->endReloadBreakpoint();
|
||||
breakpointModel->endResetModel();
|
||||
|
||||
ui->breakpointTreeView->resizeColumnToContents(0);
|
||||
ui->breakpointTreeView->resizeColumnToContents(1);
|
||||
@ -217,4 +207,4 @@ void BreakpointWidget::toggleBreakpoint()
|
||||
} else {
|
||||
Core()->enableBreakpoint(bp.addr);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -18,12 +18,14 @@ class BreakpointWidget;
|
||||
|
||||
class MainWindow;
|
||||
class QTreeWidgetItem;
|
||||
|
||||
class BreakpointWidget;
|
||||
|
||||
class BreakpointModel: public QAbstractListModel
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
friend BreakpointWidget;
|
||||
|
||||
private:
|
||||
QList<BreakpointDescription> *breakpoints;
|
||||
|
||||
@ -31,16 +33,13 @@ public:
|
||||
enum Column { AddrColumn = 0, PermColumn, HwColumn, TraceColumn, EnabledColumn, ColumnCount };
|
||||
enum Role { BreakpointDescriptionRole = Qt::UserRole };
|
||||
|
||||
BreakpointModel(QList<BreakpointDescription> *breakpoints, QObject *parent = 0);
|
||||
BreakpointModel(QList<BreakpointDescription> *breakpoints, QObject *parent = nullptr);
|
||||
|
||||
int rowCount(const QModelIndex &parent = QModelIndex()) const;
|
||||
int columnCount(const QModelIndex &parent = QModelIndex()) const;
|
||||
|
||||
QVariant data(const QModelIndex &index, int role) const;
|
||||
QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
|
||||
|
||||
void beginReloadBreakpoint();
|
||||
void endReloadBreakpoint();
|
||||
};
|
||||
|
||||
|
||||
|
@ -164,16 +164,6 @@ QVariant ClassesModel::headerData(int section, Qt::Orientation, int role) const
|
||||
}
|
||||
}
|
||||
|
||||
void ClassesModel::beginReload()
|
||||
{
|
||||
beginResetModel();
|
||||
}
|
||||
|
||||
void ClassesModel::endReload()
|
||||
{
|
||||
endResetModel();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@ -254,11 +244,11 @@ void ClassesWidget::flagsChanged()
|
||||
|
||||
void ClassesWidget::refreshClasses()
|
||||
{
|
||||
model->beginReload();
|
||||
model->beginResetModel();
|
||||
classes = getSource() == Source::BIN
|
||||
? Core()->getAllClassesFromBin()
|
||||
: Core()->getAllClassesFromFlags();
|
||||
model->endReload();
|
||||
model->endResetModel();
|
||||
|
||||
qhelpers::adjustColumns(ui->classesTreeView, 3, 0);
|
||||
|
||||
|
@ -16,12 +16,15 @@ class ClassesWidget;
|
||||
class QTreeWidget;
|
||||
class QTreeWidgetItem;
|
||||
class MainWindow;
|
||||
class ClassesWidget;
|
||||
|
||||
|
||||
class ClassesModel: public QAbstractItemModel
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
friend ClassesWidget;
|
||||
|
||||
private:
|
||||
QList<ClassDescription> *classes;
|
||||
|
||||
@ -44,9 +47,6 @@ public:
|
||||
QVariant data(const QModelIndex &index, int role) const override;
|
||||
QVariant headerData(int section, Qt::Orientation orientation,
|
||||
int role = Qt::DisplayRole) const override;
|
||||
|
||||
void beginReload();
|
||||
void endReload();
|
||||
};
|
||||
|
||||
Q_DECLARE_METATYPE(ClassesModel::RowType)
|
||||
|
@ -161,16 +161,6 @@ QVariant CommentsModel::headerData(int section, Qt::Orientation, int role) const
|
||||
return QVariant();
|
||||
}
|
||||
|
||||
void CommentsModel::beginReloadComments()
|
||||
{
|
||||
beginResetModel();
|
||||
}
|
||||
|
||||
void CommentsModel::endReloadComments()
|
||||
{
|
||||
endResetModel();
|
||||
}
|
||||
|
||||
CommentsProxyModel::CommentsProxyModel(CommentsModel *sourceModel, QObject *parent)
|
||||
: QSortFilterProxyModel(parent)
|
||||
{
|
||||
@ -325,7 +315,7 @@ void CommentsWidget::resizeEvent(QResizeEvent *event)
|
||||
|
||||
void CommentsWidget::refreshTree()
|
||||
{
|
||||
commentsModel->beginReloadComments();
|
||||
commentsModel->beginResetModel();
|
||||
|
||||
comments = Core()->getAllComments("CCu");
|
||||
nestedComments.clear();
|
||||
@ -334,7 +324,7 @@ void CommentsWidget::refreshTree()
|
||||
nestedComments[fcnName].append(comment);
|
||||
}
|
||||
|
||||
commentsModel->endReloadComments();
|
||||
commentsModel->endResetModel();
|
||||
|
||||
qhelpers::adjustColumns(ui->commentsTreeView, 3, 0);
|
||||
}
|
||||
|
@ -10,6 +10,7 @@
|
||||
|
||||
class MainWindow;
|
||||
class QTreeWidgetItem;
|
||||
class CommentsWidget;
|
||||
|
||||
namespace Ui {
|
||||
class CommentsWidget;
|
||||
@ -19,6 +20,8 @@ class CommentsModel : public QAbstractItemModel
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
friend CommentsWidget;
|
||||
|
||||
private:
|
||||
QList<CommentDescription> *comments;
|
||||
QMap<QString, QList<CommentDescription>> *nestedComments;
|
||||
@ -42,9 +45,6 @@ public:
|
||||
QVariant data(const QModelIndex &index, int role) const;
|
||||
QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
|
||||
|
||||
void beginReloadComments();
|
||||
void endReloadComments();
|
||||
|
||||
bool isNested() const;
|
||||
void setNested(bool nested);
|
||||
};
|
||||
|
@ -706,8 +706,9 @@ void DisassemblyTextEdit::scrollContentsBy(int dx, int dy)
|
||||
}
|
||||
}
|
||||
|
||||
void DisassemblyTextEdit::keyPressEvent(QKeyEvent */*event*/)
|
||||
void DisassemblyTextEdit::keyPressEvent(QKeyEvent *event)
|
||||
{
|
||||
Q_UNUSED(event)
|
||||
//QPlainTextEdit::keyPressEvent(event);
|
||||
}
|
||||
|
||||
|
@ -68,16 +68,6 @@ QVariant ExportsModel::headerData(int section, Qt::Orientation, int role) const
|
||||
}
|
||||
}
|
||||
|
||||
void ExportsModel::beginReloadExports()
|
||||
{
|
||||
beginResetModel();
|
||||
}
|
||||
|
||||
void ExportsModel::endReloadExports()
|
||||
{
|
||||
endResetModel();
|
||||
}
|
||||
|
||||
ExportsProxyModel::ExportsProxyModel(ExportsModel *source_model, QObject *parent)
|
||||
: QSortFilterProxyModel(parent)
|
||||
{
|
||||
@ -155,9 +145,9 @@ ExportsWidget::~ExportsWidget() {}
|
||||
|
||||
void ExportsWidget::refreshExports()
|
||||
{
|
||||
exportsModel->beginReloadExports();
|
||||
exportsModel->beginResetModel();
|
||||
exports = Core()->getAllExports();
|
||||
exportsModel->endReloadExports();
|
||||
exportsModel->endResetModel();
|
||||
|
||||
qhelpers::adjustColumns(ui->exportsTreeView, 3, 0);
|
||||
}
|
||||
|
@ -11,6 +11,7 @@
|
||||
|
||||
class MainWindow;
|
||||
class QTreeWidget;
|
||||
class ExportsWidget;
|
||||
|
||||
namespace Ui {
|
||||
class ExportsWidget;
|
||||
@ -20,6 +21,8 @@ class ExportsModel : public QAbstractListModel
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
friend ExportsWidget;
|
||||
|
||||
private:
|
||||
QList<ExportDescription> *exports;
|
||||
|
||||
@ -34,9 +37,6 @@ public:
|
||||
|
||||
QVariant data(const QModelIndex &index, int role) const;
|
||||
QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
|
||||
|
||||
void beginReloadExports();
|
||||
void endReloadExports();
|
||||
};
|
||||
|
||||
class ExportsProxyModel : public QSortFilterProxyModel
|
||||
|
@ -69,16 +69,6 @@ QVariant FlagsModel::headerData(int section, Qt::Orientation, int role) const
|
||||
}
|
||||
}
|
||||
|
||||
void FlagsModel::beginReloadFlags()
|
||||
{
|
||||
beginResetModel();
|
||||
}
|
||||
|
||||
void FlagsModel::endReloadFlags()
|
||||
{
|
||||
endResetModel();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@ -242,9 +232,9 @@ void FlagsWidget::refreshFlags()
|
||||
flagspace = flagspace_data.value<FlagspaceDescription>().name;
|
||||
|
||||
|
||||
flags_model->beginReloadFlags();
|
||||
flags_model->beginResetModel();
|
||||
flags = Core()->getAllFlags(flagspace);
|
||||
flags_model->endReloadFlags();
|
||||
flags_model->endResetModel();
|
||||
|
||||
qhelpers::adjustColumns(ui->flagsTreeView, 2, 0);
|
||||
|
||||
|
@ -11,12 +11,15 @@
|
||||
|
||||
class MainWindow;
|
||||
class QTreeWidgetItem;
|
||||
class FlagsWidget;
|
||||
|
||||
|
||||
class FlagsModel: public QAbstractListModel
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
friend FlagsWidget;
|
||||
|
||||
private:
|
||||
QList<FlagDescription> *flags;
|
||||
|
||||
@ -31,9 +34,6 @@ public:
|
||||
|
||||
QVariant data(const QModelIndex &index, int role) const;
|
||||
QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
|
||||
|
||||
void beginReloadFlags();
|
||||
void endReloadFlags();
|
||||
};
|
||||
|
||||
|
||||
|
@ -260,17 +260,6 @@ QVariant FunctionModel::headerData(int section, Qt::Orientation orientation, int
|
||||
return QVariant();
|
||||
}
|
||||
|
||||
void FunctionModel::beginReloadFunctions()
|
||||
{
|
||||
beginResetModel();
|
||||
}
|
||||
|
||||
void FunctionModel::endReloadFunctions()
|
||||
{
|
||||
updateCurrentIndex();
|
||||
endResetModel();
|
||||
}
|
||||
|
||||
void FunctionModel::setNested(bool nested)
|
||||
{
|
||||
beginResetModel();
|
||||
@ -487,7 +476,7 @@ void FunctionsWidget::refreshTree()
|
||||
task = QSharedPointer<FunctionsTask>(new FunctionsTask());
|
||||
connect(task.data(), &FunctionsTask::fetchFinished,
|
||||
this, [this] (const QList<FunctionDescription> &functions) {
|
||||
functionModel->beginReloadFunctions();
|
||||
functionModel->beginResetModel();
|
||||
|
||||
this->functions = functions;
|
||||
|
||||
@ -498,7 +487,8 @@ void FunctionsWidget::refreshTree()
|
||||
|
||||
mainAdress = (ut64)Core()->cmdj("iMj").object()["vaddr"].toInt();
|
||||
|
||||
functionModel->endReloadFunctions();
|
||||
functionModel->updateCurrentIndex();
|
||||
functionModel->endResetModel();
|
||||
|
||||
// resize offset and size columns
|
||||
qhelpers::adjustColumns(ui->functionsTreeView, 3, 0);
|
||||
|
@ -12,6 +12,7 @@
|
||||
class MainWindow;
|
||||
class QTreeWidgetItem;
|
||||
class FunctionsTask;
|
||||
class FunctionsWidget;
|
||||
|
||||
namespace Ui {
|
||||
class FunctionsWidget;
|
||||
@ -22,6 +23,8 @@ class FunctionModel : public QAbstractItemModel
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
friend FunctionsWidget;
|
||||
|
||||
private:
|
||||
QList<FunctionDescription> *functions;
|
||||
QSet<RVA> *importAddresses;
|
||||
@ -59,9 +62,6 @@ public:
|
||||
QVariant data(const QModelIndex &index, int role) const;
|
||||
QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
|
||||
|
||||
void beginReloadFunctions();
|
||||
void endReloadFunctions();
|
||||
|
||||
/*!
|
||||
* @return true if the index changed
|
||||
*/
|
||||
|
@ -64,16 +64,6 @@ QVariant HeadersModel::headerData(int section, Qt::Orientation, int role) const
|
||||
}
|
||||
}
|
||||
|
||||
void HeadersModel::beginReloadHeaders()
|
||||
{
|
||||
beginResetModel();
|
||||
}
|
||||
|
||||
void HeadersModel::endReloadHeaders()
|
||||
{
|
||||
endResetModel();
|
||||
}
|
||||
|
||||
HeadersProxyModel::HeadersProxyModel(HeadersModel *sourceModel, QObject *parent)
|
||||
: QSortFilterProxyModel(parent)
|
||||
{
|
||||
@ -128,9 +118,9 @@ HeadersWidget::~HeadersWidget() {}
|
||||
|
||||
void HeadersWidget::refreshHeaders()
|
||||
{
|
||||
headersModel->beginReloadHeaders();
|
||||
headersModel->beginResetModel();
|
||||
headers = Core()->getAllHeaders();
|
||||
headersModel->endReloadHeaders();
|
||||
headersModel->endResetModel();
|
||||
|
||||
ui->headersTreeView->resizeColumnToContents(0);
|
||||
ui->headersTreeView->resizeColumnToContents(1);
|
||||
|
@ -19,12 +19,15 @@ class HeadersWidget;
|
||||
|
||||
class MainWindow;
|
||||
class QTreeWidgetItem;
|
||||
class HeadersWidget;
|
||||
|
||||
|
||||
class HeadersModel: public QAbstractListModel
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
friend HeadersWidget;
|
||||
|
||||
private:
|
||||
QList<HeaderDescription> *headers;
|
||||
|
||||
@ -39,9 +42,6 @@ public:
|
||||
|
||||
QVariant data(const QModelIndex &index, int role) const;
|
||||
QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
|
||||
|
||||
void beginReloadHeaders();
|
||||
void endReloadHeaders();
|
||||
};
|
||||
|
||||
|
||||
|
@ -76,16 +76,6 @@ QVariant ImportsModel::headerData(int section, Qt::Orientation, int role) const
|
||||
return QVariant();
|
||||
}
|
||||
|
||||
void ImportsModel::beginReload()
|
||||
{
|
||||
beginResetModel();
|
||||
}
|
||||
|
||||
void ImportsModel::endReload()
|
||||
{
|
||||
endResetModel();
|
||||
}
|
||||
|
||||
ImportsProxyModel::ImportsProxyModel(ImportsModel *sourceModel, QObject *parent)
|
||||
: QSortFilterProxyModel(parent)
|
||||
{
|
||||
@ -167,9 +157,9 @@ ImportsWidget::~ImportsWidget() {}
|
||||
|
||||
void ImportsWidget::refreshImports()
|
||||
{
|
||||
importsModel->beginReload();
|
||||
importsModel->beginResetModel();
|
||||
imports = Core()->getAllImports();
|
||||
importsModel->endReload();
|
||||
importsModel->endResetModel();
|
||||
qhelpers::adjustColumns(ui->importsTreeView, 4, 0);
|
||||
}
|
||||
|
||||
|
@ -14,6 +14,7 @@
|
||||
|
||||
class MainWindow;
|
||||
class QTreeWidget;
|
||||
class ImportsWidget;
|
||||
|
||||
namespace Ui {
|
||||
class ImportsWidget;
|
||||
@ -23,6 +24,8 @@ class ImportsModel : public QAbstractTableModel
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
friend ImportsWidget;
|
||||
|
||||
private:
|
||||
const QRegularExpression banned = QRegularExpression(QStringLiteral(
|
||||
"\\A(\\w\\.)*(system|strcpy|strcpyA|strcpyW|wcscpy|_tcscpy|_mbscpy|StrCpy|StrCpyA|StrCpyW|lstrcpy|lstrcpyA|lstrcpyW"
|
||||
@ -52,9 +55,6 @@ public:
|
||||
|
||||
QVariant data(const QModelIndex &index, int role) const;
|
||||
QVariant headerData(int section, Qt::Orientation orientation, int role) const;
|
||||
|
||||
void beginReload();
|
||||
void endReload();
|
||||
};
|
||||
|
||||
class ImportsProxyModel : public QSortFilterProxyModel
|
||||
|
@ -68,16 +68,6 @@ QVariant MemoryMapModel::headerData(int section, Qt::Orientation, int role) cons
|
||||
}
|
||||
}
|
||||
|
||||
void MemoryMapModel::beginReloadMemoryMap()
|
||||
{
|
||||
beginResetModel();
|
||||
}
|
||||
|
||||
void MemoryMapModel::endReloadMemoryMap()
|
||||
{
|
||||
endResetModel();
|
||||
}
|
||||
|
||||
MemoryProxyModel::MemoryProxyModel(MemoryMapModel *sourceModel, QObject *parent)
|
||||
: QSortFilterProxyModel(parent)
|
||||
{
|
||||
@ -136,9 +126,9 @@ MemoryMapWidget::~MemoryMapWidget() {}
|
||||
|
||||
void MemoryMapWidget::refreshMemoryMap()
|
||||
{
|
||||
memoryModel->beginReloadMemoryMap();
|
||||
memoryModel->beginResetModel();
|
||||
memoryMaps = Core()->getMemoryMap();
|
||||
memoryModel->endReloadMemoryMap();
|
||||
memoryModel->endResetModel();
|
||||
|
||||
ui->memoryTreeView->resizeColumnToContents(0);
|
||||
ui->memoryTreeView->resizeColumnToContents(1);
|
||||
|
@ -10,6 +10,7 @@
|
||||
|
||||
class MainWindow;
|
||||
class QTreeWidget;
|
||||
class MemoryMapWidget;
|
||||
|
||||
namespace Ui {
|
||||
class MemoryMapWidget;
|
||||
@ -24,6 +25,8 @@ class MemoryMapModel: public QAbstractListModel
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
friend MemoryMapWidget;
|
||||
|
||||
private:
|
||||
QList<MemoryMapDescription> *memoryMaps;
|
||||
|
||||
@ -38,9 +41,6 @@ public:
|
||||
|
||||
QVariant data(const QModelIndex &index, int role) const;
|
||||
QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
|
||||
|
||||
void beginReloadMemoryMap();
|
||||
void endReloadMemoryMap();
|
||||
};
|
||||
|
||||
|
||||
|
@ -66,16 +66,6 @@ QVariant RegisterRefModel::headerData(int section, Qt::Orientation, int role) co
|
||||
}
|
||||
}
|
||||
|
||||
void RegisterRefModel::beginReloadRegisterRef()
|
||||
{
|
||||
beginResetModel();
|
||||
}
|
||||
|
||||
void RegisterRefModel::endReloadRegisterRef()
|
||||
{
|
||||
endResetModel();
|
||||
}
|
||||
|
||||
RegisterRefProxyModel::RegisterRefProxyModel(RegisterRefModel *sourceModel, QObject *parent)
|
||||
: QSortFilterProxyModel(parent)
|
||||
{
|
||||
@ -151,9 +141,9 @@ RegisterRefsWidget::~RegisterRefsWidget() {}
|
||||
|
||||
void RegisterRefsWidget::refreshRegisterRef()
|
||||
{
|
||||
registerRefModel->beginReloadRegisterRef();
|
||||
registerRefModel->beginResetModel();
|
||||
registerRefs = Core()->getRegisterRefs();
|
||||
registerRefModel->endReloadRegisterRef();
|
||||
registerRefModel->endResetModel();
|
||||
|
||||
ui->registerRefTreeView->resizeColumnToContents(0);
|
||||
ui->registerRefTreeView->resizeColumnToContents(1);
|
||||
@ -190,4 +180,4 @@ void RegisterRefsWidget::copyClip(int column)
|
||||
column).data().toString();
|
||||
QClipboard *clipboard = QApplication::clipboard();
|
||||
clipboard->setText(value);
|
||||
}
|
||||
}
|
||||
|
@ -10,6 +10,7 @@
|
||||
|
||||
class MainWindow;
|
||||
class QTreeWidget;
|
||||
class RegisterRefsWidget;
|
||||
|
||||
namespace Ui {
|
||||
class RegisterRefsWidget;
|
||||
@ -24,6 +25,8 @@ class RegisterRefModel: public QAbstractListModel
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
friend RegisterRefsWidget;
|
||||
|
||||
private:
|
||||
QList<RegisterRefDescription> *registerRefs;
|
||||
|
||||
@ -38,9 +41,6 @@ public:
|
||||
|
||||
QVariant data(const QModelIndex &index, int role) const;
|
||||
QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
|
||||
|
||||
void beginReloadRegisterRef();
|
||||
void endReloadRegisterRef();
|
||||
};
|
||||
|
||||
|
||||
|
@ -59,16 +59,6 @@ QVariant RelocsModel::headerData(int section, Qt::Orientation, int role) const
|
||||
return QVariant();
|
||||
}
|
||||
|
||||
void RelocsModel::beginReload()
|
||||
{
|
||||
beginResetModel();
|
||||
}
|
||||
|
||||
void RelocsModel::endReload()
|
||||
{
|
||||
endResetModel();
|
||||
}
|
||||
|
||||
RelocsProxyModel::RelocsProxyModel(RelocsModel *sourceModel, QObject *parent)
|
||||
: QSortFilterProxyModel(parent)
|
||||
{
|
||||
@ -152,9 +142,9 @@ void RelocsWidget::on_relocsTreeView_doubleClicked(const QModelIndex &index)
|
||||
|
||||
void RelocsWidget::refreshRelocs()
|
||||
{
|
||||
relocsModel->beginReload();
|
||||
relocsModel->beginResetModel();
|
||||
relocs = Core()->getAllRelocs();
|
||||
relocsModel->endReload();
|
||||
relocsModel->endResetModel();
|
||||
qhelpers::adjustColumns(ui->relocsTreeView, 3, 0);
|
||||
}
|
||||
|
||||
|
@ -9,6 +9,7 @@
|
||||
#include "Cutter.h"
|
||||
|
||||
class MainWindow;
|
||||
class RelocsWidget;
|
||||
|
||||
namespace Ui {
|
||||
class RelocsWidget;
|
||||
@ -18,6 +19,8 @@ class RelocsModel : public QAbstractTableModel
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
friend RelocsWidget;
|
||||
|
||||
private:
|
||||
QList<RelocDescription> *relocs;
|
||||
|
||||
@ -32,9 +35,6 @@ public:
|
||||
|
||||
QVariant data(const QModelIndex &index, int role) const;
|
||||
QVariant headerData(int section, Qt::Orientation orientation, int role) const;
|
||||
|
||||
void beginReload();
|
||||
void endReload();
|
||||
};
|
||||
|
||||
class RelocsProxyModel : public QSortFilterProxyModel
|
||||
|
@ -73,16 +73,6 @@ QVariant ResourcesModel::headerData(int section, Qt::Orientation, int role) cons
|
||||
}
|
||||
}
|
||||
|
||||
void ResourcesModel::beginReload()
|
||||
{
|
||||
beginResetModel();
|
||||
}
|
||||
|
||||
void ResourcesModel::endReload()
|
||||
{
|
||||
endResetModel();
|
||||
}
|
||||
|
||||
ResourcesWidget::ResourcesWidget(MainWindow *main, QAction *action) :
|
||||
CutterDockWidget(main, action)
|
||||
{
|
||||
@ -106,9 +96,9 @@ ResourcesWidget::ResourcesWidget(MainWindow *main, QAction *action) :
|
||||
|
||||
void ResourcesWidget::refreshResources()
|
||||
{
|
||||
model->beginReload();
|
||||
model->beginResetModel();
|
||||
resources = Core()->getAllResources();
|
||||
model->endReload();
|
||||
model->endResetModel();
|
||||
}
|
||||
|
||||
void ResourcesWidget::onDoubleClicked(const QModelIndex &index)
|
||||
|
@ -8,11 +8,14 @@
|
||||
#include <QTreeView>
|
||||
|
||||
class MainWindow;
|
||||
class ResourcesWidget;
|
||||
|
||||
class ResourcesModel : public QAbstractListModel
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
friend ResourcesWidget;
|
||||
|
||||
private:
|
||||
QList<ResourcesDescription> *resources;
|
||||
|
||||
@ -26,9 +29,6 @@ public:
|
||||
QVariant data(const QModelIndex &index, int role) const override;
|
||||
QVariant headerData(int section, Qt::Orientation orientation,
|
||||
int role = Qt::DisplayRole) const override;
|
||||
|
||||
void beginReload();
|
||||
void endReload();
|
||||
};
|
||||
|
||||
class ResourcesWidget : public CutterDockWidget
|
||||
|
@ -71,16 +71,6 @@ QVariant SearchModel::headerData(int section, Qt::Orientation, int role) const
|
||||
}
|
||||
}
|
||||
|
||||
void SearchModel::beginReloadSearch()
|
||||
{
|
||||
beginResetModel();
|
||||
}
|
||||
|
||||
void SearchModel::endReloadSearch()
|
||||
{
|
||||
endResetModel();
|
||||
}
|
||||
|
||||
|
||||
SearchSortFilterProxyModel::SearchSortFilterProxyModel(SearchModel *source_model, QObject *parent)
|
||||
: QSortFilterProxyModel(parent)
|
||||
@ -192,9 +182,9 @@ void SearchWidget::refreshSearch()
|
||||
QVariant searchspace_data = ui->searchspaceCombo->currentData();
|
||||
QString searchspace = searchspace_data.toString();
|
||||
|
||||
search_model->beginReloadSearch();
|
||||
search_model->beginResetModel();
|
||||
search = Core()->getAllSearch(search_for, searchspace);
|
||||
search_model->endReloadSearch();
|
||||
search_model->endResetModel();
|
||||
|
||||
qhelpers::adjustColumns(ui->searchTreeView, 3, 0);
|
||||
}
|
||||
|
@ -11,12 +11,15 @@
|
||||
|
||||
class MainWindow;
|
||||
class QTreeWidgetItem;
|
||||
class SearchWidget;
|
||||
|
||||
|
||||
class SearchModel: public QAbstractListModel
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
friend SearchWidget;
|
||||
|
||||
private:
|
||||
QList<SearchDescription> *search;
|
||||
|
||||
@ -31,9 +34,6 @@ public:
|
||||
|
||||
QVariant data(const QModelIndex &index, int role) const;
|
||||
QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
|
||||
|
||||
void beginReloadSearch();
|
||||
void endReloadSearch();
|
||||
};
|
||||
|
||||
|
||||
|
@ -92,16 +92,6 @@ QVariant SectionsModel::headerData(int section, Qt::Orientation, int role) const
|
||||
}
|
||||
}
|
||||
|
||||
void SectionsModel::beginReloadSections()
|
||||
{
|
||||
beginResetModel();
|
||||
}
|
||||
|
||||
void SectionsModel::endReloadSections()
|
||||
{
|
||||
endResetModel();
|
||||
}
|
||||
|
||||
SectionsProxyModel::SectionsProxyModel(SectionsModel *sourceModel, QObject *parent)
|
||||
: QSortFilterProxyModel(parent)
|
||||
{
|
||||
@ -164,9 +154,9 @@ SectionsWidget::~SectionsWidget() {}
|
||||
|
||||
void SectionsWidget::refreshSections()
|
||||
{
|
||||
sectionsModel->beginReloadSections();
|
||||
sectionsModel->beginResetModel();
|
||||
sections = Core()->getAllSections();
|
||||
sectionsModel->endReloadSections();
|
||||
sectionsModel->endResetModel();
|
||||
|
||||
qhelpers::adjustColumns(sectionsTable, SectionsModel::ColumnCount, 0);
|
||||
}
|
||||
|
@ -12,11 +12,14 @@
|
||||
class QTreeView;
|
||||
class QAbstractItemView;
|
||||
class MainWindow;
|
||||
class SectionsWidget;
|
||||
|
||||
class SectionsModel : public QAbstractListModel
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
friend SectionsWidget;
|
||||
|
||||
private:
|
||||
QList<SectionDescription> *sections;
|
||||
|
||||
@ -31,9 +34,6 @@ public:
|
||||
|
||||
QVariant data(const QModelIndex &index, int role) const;
|
||||
QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
|
||||
|
||||
void beginReloadSections();
|
||||
void endReloadSections();
|
||||
};
|
||||
|
||||
class SectionsProxyModel : public QSortFilterProxyModel
|
||||
|
@ -77,16 +77,6 @@ QVariant StringsModel::headerData(int section, Qt::Orientation, int role) const
|
||||
}
|
||||
}
|
||||
|
||||
void StringsModel::beginReload()
|
||||
{
|
||||
beginResetModel();
|
||||
}
|
||||
|
||||
void StringsModel::endReload()
|
||||
{
|
||||
endResetModel();
|
||||
}
|
||||
|
||||
StringsSortFilterProxyModel::StringsSortFilterProxyModel(StringsModel *source_model,
|
||||
QObject *parent)
|
||||
: QSortFilterProxyModel(parent)
|
||||
@ -185,9 +175,9 @@ void StringsWidget::refreshStrings()
|
||||
|
||||
void StringsWidget::stringSearchFinished(const QList<StringDescription> &strings)
|
||||
{
|
||||
model->beginReload();
|
||||
model->beginResetModel();
|
||||
this->strings = strings;
|
||||
model->endReload();
|
||||
model->endResetModel();
|
||||
|
||||
qhelpers::adjustColumns(ui->stringsTreeView, 5, 0);
|
||||
if (ui->stringsTreeView->columnWidth(1) > 300)
|
||||
|
@ -12,6 +12,7 @@
|
||||
|
||||
class MainWindow;
|
||||
class QTreeWidgetItem;
|
||||
class StringsWidget;
|
||||
|
||||
namespace Ui {
|
||||
class StringsWidget;
|
||||
@ -21,6 +22,8 @@ class StringsModel: public QAbstractListModel
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
friend StringsWidget;
|
||||
|
||||
private:
|
||||
QList<StringDescription> *strings;
|
||||
|
||||
@ -35,9 +38,6 @@ public:
|
||||
|
||||
QVariant data(const QModelIndex &index, int role) const;
|
||||
QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
|
||||
|
||||
void beginReload();
|
||||
void endReload();
|
||||
};
|
||||
|
||||
|
||||
|
@ -65,16 +65,6 @@ QVariant SymbolsModel::headerData(int section, Qt::Orientation, int role) const
|
||||
}
|
||||
}
|
||||
|
||||
void SymbolsModel::beginReloadSymbols()
|
||||
{
|
||||
beginResetModel();
|
||||
}
|
||||
|
||||
void SymbolsModel::endReloadSymbols()
|
||||
{
|
||||
endResetModel();
|
||||
}
|
||||
|
||||
SymbolsProxyModel::SymbolsProxyModel(SymbolsModel *sourceModel, QObject *parent)
|
||||
: QSortFilterProxyModel(parent)
|
||||
{
|
||||
@ -154,9 +144,9 @@ void SymbolsWidget::on_symbolsTreeView_doubleClicked(const QModelIndex &index)
|
||||
|
||||
void SymbolsWidget::refreshSymbols()
|
||||
{
|
||||
symbolsModel->beginReloadSymbols();
|
||||
symbolsModel->beginResetModel();
|
||||
symbols = Core()->getAllSymbols();
|
||||
symbolsModel->endReloadSymbols();
|
||||
symbolsModel->endResetModel();
|
||||
|
||||
qhelpers::adjustColumns(ui->symbolsTreeView, SymbolsModel::ColumnCount, 0);
|
||||
}
|
||||
|
@ -10,6 +10,7 @@
|
||||
|
||||
class MainWindow;
|
||||
class QTreeWidgetItem;
|
||||
class SymbolsWidget;
|
||||
|
||||
namespace Ui {
|
||||
class SymbolsWidget;
|
||||
@ -19,6 +20,8 @@ class SymbolsModel: public QAbstractListModel
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
friend SymbolsWidget;
|
||||
|
||||
private:
|
||||
QList<SymbolDescription> *symbols;
|
||||
|
||||
@ -33,9 +36,6 @@ public:
|
||||
|
||||
QVariant data(const QModelIndex &index, int role) const;
|
||||
QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
|
||||
|
||||
void beginReloadSymbols();
|
||||
void endReloadSymbols();
|
||||
};
|
||||
|
||||
class SymbolsProxyModel : public QSortFilterProxyModel
|
||||
|
@ -64,15 +64,6 @@ QVariant TypesModel::headerData(int section, Qt::Orientation, int role) const
|
||||
}
|
||||
}
|
||||
|
||||
void TypesModel::beginReloadTypes()
|
||||
{
|
||||
beginResetModel();
|
||||
}
|
||||
|
||||
void TypesModel::endReloadTypes()
|
||||
{
|
||||
endResetModel();
|
||||
}
|
||||
|
||||
TypesSortFilterProxyModel::TypesSortFilterProxyModel(TypesModel *source_model, QObject *parent)
|
||||
: QSortFilterProxyModel(parent)
|
||||
@ -128,9 +119,9 @@ TypesWidget::~TypesWidget() {}
|
||||
|
||||
void TypesWidget::refreshTypes()
|
||||
{
|
||||
types_model->beginReloadTypes();
|
||||
types_model->beginResetModel();
|
||||
types = Core()->getAllTypes();
|
||||
types_model->endReloadTypes();
|
||||
types_model->endResetModel();
|
||||
|
||||
qhelpers::adjustColumns(ui->typesTreeView, 3, 0);
|
||||
}
|
||||
|
@ -11,6 +11,7 @@
|
||||
|
||||
class MainWindow;
|
||||
class QTreeWidget;
|
||||
class TypesWidget;
|
||||
|
||||
namespace Ui {
|
||||
class TypesWidget;
|
||||
@ -25,6 +26,8 @@ class TypesModel: public QAbstractListModel
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
friend TypesWidget;
|
||||
|
||||
private:
|
||||
QList<TypeDescription> *types;
|
||||
|
||||
@ -39,9 +42,6 @@ public:
|
||||
|
||||
QVariant data(const QModelIndex &index, int role) const;
|
||||
QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
|
||||
|
||||
void beginReloadTypes();
|
||||
void endReloadTypes();
|
||||
};
|
||||
|
||||
|
||||
|
@ -92,15 +92,6 @@ QVariant VTableModel::headerData(int section, Qt::Orientation, int role) const
|
||||
return QVariant();
|
||||
}
|
||||
|
||||
void VTableModel::beginReload()
|
||||
{
|
||||
beginResetModel();
|
||||
}
|
||||
|
||||
void VTableModel::endReload()
|
||||
{
|
||||
endResetModel();
|
||||
}
|
||||
|
||||
VTableSortFilterProxyModel::VTableSortFilterProxyModel(VTableModel *model, QObject *parent)
|
||||
: QSortFilterProxyModel(parent)
|
||||
@ -169,9 +160,9 @@ VTablesWidget::~VTablesWidget()
|
||||
|
||||
void VTablesWidget::refreshVTables()
|
||||
{
|
||||
model->beginReload();
|
||||
model->beginResetModel();
|
||||
vtables = Core()->getAllVTables();
|
||||
model->endReload();
|
||||
model->endResetModel();
|
||||
|
||||
qhelpers::adjustColumns(ui->vTableTreeView, 3, 0);
|
||||
|
||||
|
@ -14,11 +14,14 @@ class VTablesWidget;
|
||||
}
|
||||
|
||||
class MainWindow;
|
||||
class VTablesWidget;
|
||||
|
||||
class VTableModel : public QAbstractItemModel
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
friend VTablesWidget;
|
||||
|
||||
private:
|
||||
QList<VTableDescription> *vtables;
|
||||
|
||||
@ -36,9 +39,6 @@ public:
|
||||
|
||||
QVariant data(const QModelIndex &index, int role) const;
|
||||
QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
|
||||
|
||||
void beginReload();
|
||||
void endReload();
|
||||
};
|
||||
|
||||
class VTableSortFilterProxyModel : public QSortFilterProxyModel
|
||||
|
@ -78,16 +78,6 @@ QVariant ZignaturesModel::headerData(int section, Qt::Orientation, int role) con
|
||||
}
|
||||
}
|
||||
|
||||
void ZignaturesModel::beginReloadZignatures()
|
||||
{
|
||||
beginResetModel();
|
||||
}
|
||||
|
||||
void ZignaturesModel::endReloadZignatures()
|
||||
{
|
||||
endResetModel();
|
||||
}
|
||||
|
||||
ZignaturesProxyModel::ZignaturesProxyModel(ZignaturesModel *sourceModel, QObject *parent)
|
||||
: QSortFilterProxyModel(parent)
|
||||
{
|
||||
@ -143,9 +133,9 @@ ZignaturesWidget::~ZignaturesWidget() {}
|
||||
|
||||
void ZignaturesWidget::refreshZignatures()
|
||||
{
|
||||
zignaturesModel->beginReloadZignatures();
|
||||
zignaturesModel->beginResetModel();
|
||||
zignatures = Core()->getAllZignatures();
|
||||
zignaturesModel->endReloadZignatures();
|
||||
zignaturesModel->endResetModel();
|
||||
|
||||
ui->zignaturesTreeView->resizeColumnToContents(0);
|
||||
ui->zignaturesTreeView->resizeColumnToContents(1);
|
||||
|
@ -12,6 +12,7 @@
|
||||
class MainWindow;
|
||||
class QTreeWidget;
|
||||
class QTreeWidgetItem;
|
||||
class ZignaturesWidget;
|
||||
|
||||
namespace Ui {
|
||||
class ZignaturesWidget;
|
||||
@ -21,6 +22,8 @@ class ZignaturesModel : public QAbstractListModel
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
friend ZignaturesWidget;
|
||||
|
||||
public:
|
||||
enum Column { OffsetColumn = 0, NameColumn, ValueColumn, ColumnCount };
|
||||
enum Role { ZignatureDescriptionRole = Qt::UserRole };
|
||||
@ -33,9 +36,6 @@ public:
|
||||
int rowCount(const QModelIndex &parent = QModelIndex()) const;
|
||||
int columnCount(const QModelIndex &parent = QModelIndex()) const;
|
||||
|
||||
void beginReloadZignatures();
|
||||
void endReloadZignatures();
|
||||
|
||||
private:
|
||||
QList<ZignatureDescription> *zignatures;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user