mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-04-28 12:58:00 +03:00
Merge branch 'dont-redraw-the-whole-gui-every-time-we-change-the-tiniest-thing' into 'master'
Some checks failed
Build and test / Ubuntu (push) Has been cancelled
Build and test / MacOS (push) Has been cancelled
Build and test / Read .env file and expose it as output (push) Has been cancelled
Build and test / Windows (2019) (push) Has been cancelled
Build and test / Windows (2022) (push) Has been cancelled
Some checks failed
Build and test / Ubuntu (push) Has been cancelled
Build and test / MacOS (push) Has been cancelled
Build and test / Read .env file and expose it as output (push) Has been cancelled
Build and test / Windows (2019) (push) Has been cancelled
Build and test / Windows (2022) (push) Has been cancelled
Be more careful when we tell Qt that data has changed Closes #8405 See merge request OpenMW/openmw!4621
This commit is contained in:
commit
ea8369eff0
6 changed files with 37 additions and 50 deletions
|
@ -8,6 +8,7 @@
|
|||
#include <QList>
|
||||
#include <QMessageBox>
|
||||
#include <QPair>
|
||||
#include <QProgressDialog>
|
||||
#include <QPushButton>
|
||||
|
||||
#include <algorithm>
|
||||
|
@ -351,9 +352,17 @@ void Launcher::DataFilesPage::populateFileViews(const QString& contentModelName)
|
|||
if (!resourcesVfs.isEmpty())
|
||||
directories.insert(0, { resourcesVfs });
|
||||
|
||||
QIcon containsDataIcon(":/images/openmw-plugin.png");
|
||||
|
||||
QProgressDialog progressBar("Adding data directories", {}, 0, directories.count(), this);
|
||||
progressBar.setWindowModality(Qt::WindowModal);
|
||||
progressBar.setValue(0);
|
||||
|
||||
std::unordered_set<QString> visitedDirectories;
|
||||
for (const Config::SettingValue& currentDir : directories)
|
||||
{
|
||||
progressBar.setValue(progressBar.value() + 1);
|
||||
|
||||
if (!visitedDirectories.insert(currentDir.value).second)
|
||||
continue;
|
||||
|
||||
|
@ -402,7 +411,7 @@ void Launcher::DataFilesPage::populateFileViews(const QString& contentModelName)
|
|||
// Add a "data file" icon if the directory contains a content file
|
||||
if (mSelector->containsDataFiles(currentDir.value))
|
||||
{
|
||||
item->setIcon(QIcon(":/images/openmw-plugin.png"));
|
||||
item->setIcon(containsDataIcon);
|
||||
|
||||
tooltip << tr("Contains content file(s)");
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue