Don't use the changed signal to get a User to save itself.

This commit is contained in:
Relintai 2025-05-11 14:23:39 +02:00
parent b770c07a32
commit 272aeb775d
3 changed files with 2 additions and 6 deletions

View File

@ -251,9 +251,6 @@ Ref<User> UserManagerDB::_create_user(Ref<User> p_user) {
p_user.instance(); p_user.instance();
} }
//save_user(u);
p_user->connect("changed", this, "_save_user", varray(p_user));
return p_user; return p_user;
} }
bool UserManagerDB::_is_username_taken(const String &user_name) { bool UserManagerDB::_is_username_taken(const String &user_name) {

View File

@ -165,8 +165,6 @@ Ref<User> UserManagerFile::_create_user(Ref<User> p_user) {
p_user->set_user_id(-1); p_user->set_user_id(-1);
} }
p_user->connect("changed", this, "_save_user", varray(p_user));
return p_user; return p_user;
} }
bool UserManagerFile::_is_username_taken(const String &user_name) { bool UserManagerFile::_is_username_taken(const String &user_name) {

View File

@ -32,6 +32,7 @@
#include "user.h" #include "user.h"
#include "core/io/json.h" #include "core/io/json.h"
#include "core/object/class_db.h" #include "core/object/class_db.h"
#include "../singleton/user_db.h"
#include "user_module.h" #include "user_module.h"
@ -301,7 +302,7 @@ void User::from_json(const String &data) {
} }
void User::save() { void User::save() {
emit_changed(); UserDB::get_singleton()->save_user(Ref<User>(this));
} }
void User::read_lock() { void User::read_lock() {