mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
cleanup: use singleton pattern for getPrintingTemplatePath*()
Function-local statics are initialized on first invocation. No point in extra logic. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
f407f5269a
commit
727d519046
1 changed files with 6 additions and 6 deletions
|
@ -719,17 +719,17 @@ static const char *printing_templates = "printing_templates";
|
|||
|
||||
QString getPrintingTemplatePathUser()
|
||||
{
|
||||
static QString path = QString();
|
||||
if (path.isEmpty())
|
||||
path = QString(system_default_directory()) + QDir::separator() + QString(printing_templates);
|
||||
// Function-local statics are initialized on first invocation
|
||||
static QString path(QString(system_default_directory()) +
|
||||
QDir::separator() +
|
||||
QString(printing_templates));
|
||||
return path;
|
||||
}
|
||||
|
||||
QString getPrintingTemplatePathBundle()
|
||||
{
|
||||
static QString path = QString();
|
||||
if (path.isEmpty())
|
||||
path = getSubsurfaceDataPath(printing_templates);
|
||||
// Function-local statics are initialized on first invocation
|
||||
static QString path(getSubsurfaceDataPath(printing_templates));
|
||||
return path;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue