Skip to content

Commit

Permalink
🐛 only register once
Browse files Browse the repository at this point in the history
  • Loading branch information
OlivierLDff committed Aug 21, 2024
1 parent b77f80b commit d3b2d19
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/Qaterial/Details/Utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ static const char* _defaultUri = "Qaterial";
static const char** _uri = &_defaultUri;
static quint8 _major = 1;
static quint8 _minor = 0;
static bool registeredTypes = false;
static bool registeredRes = false;

void __Qaterial_registerIconsSingleton();

Expand Down Expand Up @@ -123,6 +125,9 @@ static void Qaterial_loadFonts()

static void Qaterial_loadResources(bool autoRegisterStyle)
{
if(registeredRes)
return;

qCDebug(qaterialUtils).noquote().nospace() << "Load Qaterial v" << qaterial::Version::version().readable();

// Load all fonts embedded in QaterialFonts
Expand All @@ -139,6 +144,9 @@ static void Qaterial_loadResources(bool autoRegisterStyle)

static void Qaterial_loadResources()
{
if(registeredRes)
return;

Qaterial_loadResources(true);
}

Expand Down

0 comments on commit d3b2d19

Please sign in to comment.