diff options
| author | isanae <14251494+isanae@users.noreply.github.com> | 2019-06-24 12:49:08 -0400 |
|---|---|---|
| committer | isanae <14251494+isanae@users.noreply.github.com> | 2019-07-02 10:10:18 -0400 |
| commit | 4ee9f29cdcb3df2a085e02fa29c8ae3ddbd27f1c (patch) | |
| tree | 1d5301a98eadee53b20a59a356453e27f0446171 /src/modinfodialogtextfiles.h | |
| parent | f14f2bad3ba7440d6f36657f32d00c89cae54623 (diff) | |
performance optimizations: text/ini tabs and advanced conflict list use views and custom models
call update() after feedFiles() to allow some tabs to have post-processing after feedFiles()
Diffstat (limited to 'src/modinfodialogtextfiles.h')
| -rw-r--r-- | src/modinfodialogtextfiles.h | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/modinfodialogtextfiles.h b/src/modinfodialogtextfiles.h index 75f31d88..d879c2bd 100644 --- a/src/modinfodialogtextfiles.h +++ b/src/modinfodialogtextfiles.h @@ -3,9 +3,10 @@ #include "modinfodialogtab.h" #include <QSplitter> -#include <QListWidget> +#include <QListView> class FileListItem; +class FileListModel; class TextEditor; class GenericFilesTab : public ModInfoDialogTab @@ -16,21 +17,23 @@ public: void clear() override; bool canClose() override; bool feedFile(const QString& rootPath, const QString& fullPath) override; + void update() override; protected: - QListWidget* m_list; + QListView* m_list; TextEditor* m_editor; + FileListModel* m_model; GenericFilesTab( OrganizerCore& oc, PluginContainer& plugin, QWidget* parent, Ui::ModInfoDialog* ui, int id, - QListWidget* list, QSplitter* splitter, TextEditor* editor); + QListView* list, QSplitter* splitter, TextEditor* editor); virtual bool wantsFile(const QString& rootPath, const QString& fullPath) const = 0; private: - void onSelection(QListWidgetItem* current, QListWidgetItem* previous); - void select(FileListItem* item); + void onSelection(const QModelIndex& current, const QModelIndex& previous); + void select(const QModelIndex& index); }; |
