mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-04-28 21:07:59 +03:00
Reuse QIcon
This saves more than 15% of launcher startup time on my machine (after the prior improvements - it's way less without those)
This commit is contained in:
parent
1237746549
commit
7bad2864d9
1 changed files with 3 additions and 1 deletions
|
@ -351,6 +351,8 @@ void Launcher::DataFilesPage::populateFileViews(const QString& contentModelName)
|
|||
if (!resourcesVfs.isEmpty())
|
||||
directories.insert(0, { resourcesVfs });
|
||||
|
||||
QIcon containsDataIcon(":/images/openmw-plugin.png");
|
||||
|
||||
std::unordered_set<QString> visitedDirectories;
|
||||
for (const Config::SettingValue& currentDir : directories)
|
||||
{
|
||||
|
@ -402,7 +404,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