mirror of
https://github.com/qTox/qTox.git
synced 2024-03-22 14:00:36 +08:00
refactor(profile): use const reference in createNew/loadProfile
This commit is contained in:
parent
040c6b95ae
commit
2d1d5b2a3e
|
@ -120,7 +120,7 @@ Profile::Profile(QString name, const QString& password, bool isNewProfile,
|
||||||
*
|
*
|
||||||
* @example If the profile is already in use return nullptr.
|
* @example If the profile is already in use return nullptr.
|
||||||
*/
|
*/
|
||||||
Profile* Profile::loadProfile(QString name, const QString& password)
|
Profile* Profile::loadProfile(const QString& name, const QString& password)
|
||||||
{
|
{
|
||||||
if (ProfileLocker::hasLock()) {
|
if (ProfileLocker::hasLock()) {
|
||||||
qCritical() << "Tried to load profile " << name << ", but another profile is already locked!";
|
qCritical() << "Tried to load profile " << name << ", but another profile is already locked!";
|
||||||
|
@ -200,7 +200,7 @@ fail:
|
||||||
*
|
*
|
||||||
* @note If the profile is already in use return nullptr.
|
* @note If the profile is already in use return nullptr.
|
||||||
*/
|
*/
|
||||||
Profile* Profile::createProfile(QString name, QString password)
|
Profile* Profile::createProfile(const QString& name, const QString& password)
|
||||||
{
|
{
|
||||||
std::unique_ptr<ToxEncrypt> tmpKey;
|
std::unique_ptr<ToxEncrypt> tmpKey;
|
||||||
if (!password.isEmpty()) {
|
if (!password.isEmpty()) {
|
||||||
|
|
|
@ -39,8 +39,8 @@ class Profile : public QObject
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static Profile* loadProfile(QString name, const QString& password = QString());
|
static Profile* loadProfile(const QString& name, const QString& password = QString());
|
||||||
static Profile* createProfile(QString name, QString password);
|
static Profile* createProfile(const QString& name, const QString& password);
|
||||||
~Profile();
|
~Profile();
|
||||||
|
|
||||||
Core* getCore();
|
Core* getCore();
|
||||||
|
|
Loading…
Reference in New Issue
Block a user