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/modinfodialog.cpp | |
| 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/modinfodialog.cpp')
| -rw-r--r-- | src/modinfodialog.cpp | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/src/modinfodialog.cpp b/src/modinfodialog.cpp index 4c169cc4..a407e9b7 100644 --- a/src/modinfodialog.cpp +++ b/src/modinfodialog.cpp @@ -35,6 +35,19 @@ using namespace MOShared; const int max_scan_for_context_menu = 50; + +int naturalCompare(const QString& a, const QString& b) +{ + static QCollator c = []{ + QCollator c; + c.setNumericMode(true); + c.setCaseSensitivity(Qt::CaseInsensitive); + return c; + }(); + + return c.compare(a, b); +} + bool canPreviewFile( PluginContainer& pluginContainer, bool isArchive, const QString& filename) { @@ -283,10 +296,15 @@ void ModInfoDialog::updateTabs(bool becauseOriginChanged) tabInfo.tab->setMod(m_mod, origin); tabInfo.tab->clear(); - tabInfo.tab->update(); } + feedFiles(becauseOriginChanged); + + for (auto& tabInfo : m_tabs) { + tabInfo.tab->update(); + } + setTabsColors(); } |
