logplus/Workflow/WFCrystal/Crystal/src/PaiSettings.cpp
2026-01-16 17:18:41 +08:00

34 lines
908 B
C++
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/**
* @file PaiSettings.cpp
* @brief 用来替代QSettings他可以自动按登录用户区分组
* 相应的存储文件名为applicationName_userID.conf,
* Linux存储路径~/.config/organizationName/
* @date 2013-05-16
*/
#include <QCoreApplication>
#include "PaiSettings.h"
using namespace pai::gui;
QString PaiSettings::m_NameSuffix;
PaiSettings::PaiSettings(bool share, QObject *pParent) :
QSettings(QCoreApplication::organizationName(),
share ? QCoreApplication::applicationName() : (QString("%1%2%3")
.arg(QCoreApplication::applicationName())
.arg(m_NameSuffix.isEmpty() ? "": "_")
.arg(m_NameSuffix)),
pParent)
{
}
PaiSettings::~PaiSettings()
{
}
void PaiSettings::SetNameSuffix(const QString & nameSuffix)
{
m_NameSuffix = nameSuffix;
}