Refactored code and possibly fixed a bug

This commit is contained in:
2025-02-07 20:13:30 +02:00
parent 6d9586ac6e
commit a458d82577
4 changed files with 7 additions and 8 deletions

View File

@ -5,7 +5,7 @@
#include <QJsonArray>
#include <QJsonObject>
UserList&& loadUserList(const QString &file)
UserList loadUserList(const QString &file)
{
QFile doc{std::filesystem::path{file.toStdString()}};
QString fileContents = doc.readAll();
@ -23,10 +23,7 @@ UserList&& loadUserList(const QString &file)
container.append(newUser);
}
UserList returnObj;
returnObj.setList(container);
return std::move(returnObj);
return container;
}
void saveUserList(const UserList &list)