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()
|
QString getPrintingTemplatePathUser()
|
||||||
{
|
{
|
||||||
static QString path = QString();
|
// Function-local statics are initialized on first invocation
|
||||||
if (path.isEmpty())
|
static QString path(QString(system_default_directory()) +
|
||||||
path = QString(system_default_directory()) + QDir::separator() + QString(printing_templates);
|
QDir::separator() +
|
||||||
|
QString(printing_templates));
|
||||||
return path;
|
return path;
|
||||||
}
|
}
|
||||||
|
|
||||||
QString getPrintingTemplatePathBundle()
|
QString getPrintingTemplatePathBundle()
|
||||||
{
|
{
|
||||||
static QString path = QString();
|
// Function-local statics are initialized on first invocation
|
||||||
if (path.isEmpty())
|
static QString path(getSubsurfaceDataPath(printing_templates));
|
||||||
path = getSubsurfaceDataPath(printing_templates);
|
|
||||||
return path;
|
return path;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue